[M3devel] static linking of some C libs...

Dragiša Durić dragisha at m3w.org
Thu Oct 7 09:16:36 CEST 2010


Of course it's built with Modula-3, and if it's pure C lib - then make a
"placeholder" Modula-3 lib just to keep it "under quake". That way we
will have full control on options, resolving,,, per platform where
differences occur. As opposed to autocrap way and m4 (it's not Modula-4,
don't jump :).

GCC is a hell, and linking "logic" is just a tip of the iceberg. Order
dependency is least of problems. Thus said - I am against Modula-3
linker - our resources are too scarce to fix everything.

import_standalone() would fill static_libs hash, just like import fills
imported_libs, and build_standalone() will just move everything from
imported_libs to static_libs before m3_link continues. Looks clean.

On Thu, 2010-10-07 at 06:13 +0000, Jay K wrote:
> 
> Right.
> What you want something like:
> import_standalone("libfoo")
> or import_static("libfoo")
> 
> shouldn't be too hard.
> Just stick libfoo in some global hashtable and then when linking looks
> for libfoo.so vs. libfoo.a, it can use that to guide.
> 
> That is assuming libfoo is built by Modula-3 and that there are both.
> If it is a C library, you'll have to do something else.
> 
> <rant>
> I find Unix link command lines extremely confusing and very likely
> both
>   having too many and too few features. What with options being in
> effect
> until end of command line, or maybe not, or being able to turn them
> off/on as you go,
> making it all ridiculously order-dependent. 
-- 
Dragiša Durić <dragisha at m3w.org>




More information about the M3devel mailing list