-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Martin Costabel wrote: | Dave Vasilevsky wrote: | [] | |> There are two ways this can be done. The simple way is to not use |> libraries where possible--just link all your .o files into an |> executable and pass gcc -Wl,-bind_at_load . The more complicated |> way--which works for libs too--is to use an intermediate .o file. |> Here's a modified example from KDE (which I stole from Apple's Jam |> files for an old version of Project Builder): |> |> gcc -r -Wl,-bind_at_load -keep_private_externs -nostdlib -o combined.o |> my.o module.o files.o |> gcc -dynamiclib -o libfoo.dylib combined.o [other flags for lib] | | | Is this different from using the "-single-module" linker flag? The | latter is often recommended for problems with static initializers. |
Yes. -single_module will make just one module, using gcc -r first on your objects will not. The stuff in .a's (such as libgcc.a and libstdc++.a) will be in separate modules. This does not actually make too much difference in the static initializers not being called problem, but does affect the speed of the dynamic linker (single_module is "faster" in general than multi-module, but is nigh on impossible to debug).
Also note that -single_module only appeared on the december 2002 developer tools (if I recall correctly) and is not available on prior versions of the linker. The gcc -r crap will work on all systems.
Peter - -- Peter O'Gorman - http://www.pogma.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iQCVAwUBQcsCDLiDAg3OZTLPAQIuTgP/S7nfZv3GPDauz5IpO4VMsygZ8lwcpvjp d9ytCYvwImiaOafkQ5zWhmSS6AsJWni2H5qvxS+CpiWTB+3dONtxGB4uUNBSAXD6 35/Z0p5JrrXc3vBqG/A5VvXldFfI4whVEte4q85rk2Fy/ZSEaQp9HX8umIfVNqR+ yeMM4ZLcwsg= =dgQa -----END PGP SIGNATURE-----
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
Fink-devel mailing list
Fink-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-devel