[M3devel] a hope for dynamic linking!

Tony Hosking hosking at cs.purdue.edu
Sat Apr 19 17:34:38 CEST 2008


Regular Modula-3 app stuff should build statically already, where it  
makes sense.  build_standalone() achieves this.  On some systems  
static libraries for certain system libraries are not available and  
cannot be assumed.  We always build static Modula-3 libraries, so the  
current setup will link those statically even if other libraries are  
not available.  For example, cm3 on I386_DARWIN gives:

hosking$ otool -L /usr/local/cm3/bin/cm3
/usr/local/cm3/bin/cm3:
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,  
current version 111.0.0)
         /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0,  
current version 1.0.0)

Notice that all the M3 libraries are static, but libgcc and friends  
are dynamic.

So, I don't know what you are attempting to do.  Did you try --disable- 
shared for m3cc configuration?

On Apr 19, 2008, at 11:10 AM, Jay wrote:

> (ok, actually I meant maybe for cm3cg but ok either way, there'd  
> only be one use of "/usr/local/cm3/bin/libgmp.so" so might as well  
> be static)
>
>
>
>
> From: jayk123 at hotmail.com
> To: hosking at cs.purdue.edu
> Date: Sat, 19 Apr 2008 15:02:44 +0000
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] a hope for dynamic linking!
>
> I mean for the "regular" Modula-3 "app" stuff, not cm3cg.
>
> It looks like it is already static, good.
>
> 1) http://gcc.gnu.org/ml/gcc/2006-10/msg00141.html
>
> 2) The current code:
>
> m3-sys/m3cc/gcc/Makefile.in:
>
> configure-gmp:
> ...
>     echo Configuring in $(HOST_SUBDIR)/gmp; \
> ...
>       $(HOST_CONFIGARGS) --build=${build_alias} --host=none-$ 
> {host_vendor}-${host_os} \
>       --target=none-${host_vendor}-${host_os} $${srcdiroption} -- 
> disable-shared \
>       || exit 1
> @endif gmp
>
>
> configure-mpfr:
> ...
>     echo Configuring in $(HOST_SUBDIR)/mpfr; \
> ...
>       $(HOST_CONFIGARGS) --build=${build_alias} --host=none-$ 
> {host_vendor}-${host_os} \
>       --target=none-${host_vendor}-${host_os} $${srcdiroption} -- 
> disable-shared --with-gmp-build=$$r/$(HOST_SUBDIR)/gmp \
>       || exit 1
> @endif mpfr
>
>
> Let me test it and then I'll remove the Quake code related to this.
>
>
>  - Jay
>
>
> CC: m3devel at elegosoft.com
> From: hosking at cs.purdue.edu
> To: jayk123 at hotmail.com
> Subject: Re: [M3devel] a hope for dynamic linking!
> Date: Sat, 19 Apr 2008 10:50:04 -0400
>
> Hold on!  I am strongly in favor of static linking for cm3cg/m3cgc1  
> so that it is a standalone executable.  Should be easy enough with  
> gcc configure.
>
> On Apr 19, 2008, at 10:31 AM, Jay wrote:
> http://www.eyrie.org/~eagle/notes/rpath.html
> http://people.debian.org/~che/personal/rpath-considered-harmful
>
>
> but yet:
>
> http://www.scons.org/wiki/UsingOrigin
>
> So you can either colocate executables and .sos in the same  
> directory or, like
>   /cm3/bin
>   /cm3/lib/m3core.so
>
> and vary the install root.
>
> We should be using this where available -- Linux, Solaris, Irix.
> Too bad not supported elsewhere.
> On Windows you can colocate; the .exe's directory is always searched.
>
>  - Jay
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080419/151f7d36/attachment-0002.html>


More information about the M3devel mailing list