From: Inger, M. <inger@Synygy.com> - 2003-08-27 21:08:49
|
I have a project which seems to require the "--export-all-symbols" flag to be passed to "gcc" when a shared library link occurs. However, the GCC linker code, coverts this to "-Wl,--export-all-symbols". Which, of course is wrong because "ld" doesn't understand what --export-all-symbols means. Does anyone know if this even translates into a linker argument? If not, I have 2 choices: 1. Have the GCC linker class treat strings that start with "--" as being direct gcc arguments (there's already a place where this type of thing is being done for other combinations, such as -g in GCCLinker.java 2. Add a flag to <linkerarg> tag which allows you to specify that it goes to the command line as-is with no additional translation. <linker name="gcc"> <linkerarg value="--export-all-symbols" direct="true" /> What do people think? ---------------- Matthew Inger [in...@sy...] Software Developer Synygy, Inc 610-664-7433 x 7770 "Man who jump off cliff, leap to conclusions." - Confucious |
From: Stephen M. W. <ste...@cr...> - 2003-08-28 12:45:56
|
On August 27, 2003 05:08 pm, Inger, Matthew wrote: > I have a project which seems to require the "--export-all-symbols" > flag to be passed to "gcc" when a shared library link occurs. > > However, the GCC linker code, coverts this to "-Wl,--export-all-symbols". > Which, of course is wrong because "ld" doesn't understand what > --export-all-symbols > means. Does anyone know if this even translates into a linker argument? The only place in the GNU toolchain where that command-line argument is used is in dlltool, a part of the cygwin/mingw target toolchain. > If not, I have 2 choices: > > 1. Have the GCC linker class treat strings that start with "--" as > being direct gcc arguments (there's already a place where this type of > thing > is being done for other combinations, such as -g in GCCLinker.java > > 2. Add a flag to <linkerarg> tag which allows you to specify that it > goes > to the command line as-is with no additional translation. > <linker name="gcc"> > <linkerarg value="--export-all-symbols" direct="true" /> > > What do people think? I think there's a need for some more flexible way to add target-specific link arguments to at least the gcc (and g++) linkers. Both the Win32 target and the Mac OS X target require fancy arguments for various nefarious purposes and wrapping them in -Wl, won't necessarily work. I'v been patching my source locally to pass the additional linkerargs through unmodified (your solution number 2), but I know there's got to be a better solution out there. Perhaps what we need is to be able to distinguish between the compile driver tool (gcc, g++, gcj, etc) and the underlying invoked toolchain components (ld, libtool (on Mac), dlltool (on Win32)). Perhaps the linker task should trust the programmer to add the -Wl, where necessary and not try to be so clever about what it allows through. These taregt-specific linker arguments are a bit of a thorn in my side. -- Stephen M. Webb ste...@cr... |