Re: Linking convenience libraries
On Thu, Mar 03, 2005 at 09:39:36PM -0600, Albert Chin wrote: > On Thu, Mar 03, 2005 at 12:01:26PM -0600, Bob Friesenhahn wrote: > > On Thu, 3 Mar 2005, Albert Chin wrote: > > > > >When using the compiler to perform the link and linking against > > >convenience libraries, is there any reason to link explicitly against > > >the extracted objects of the convenience libraries rather than just > > >the .a file? I'm running into a problem on IRIX with the SGI C++ > > >compiler that is solved if I link the .a files. I see no reason why we > > >extract the convenience libraries libraries when linking against the > > >compiler v. the linker. > > > > If we link against the .a file directly then the only objects which > > will get pulled in are the ones required to link (resolve symbols). > > This means that much of the library may be missing. > > > > If we are building an application it is desirable to shed unnecessary > > objects but it is not desirable to do that for libraries. > > What if we use $whole_archive_flag_spec? > > Are the following equivalent on Linux? > 1. ld -soname libfoo.so 1.o 2.o 3.o [all .o's from lib1.a] \ > [all .o's from lib2.a] > 2. ld -soname libfoo.so 1.o 2.o 3.o \ > --whole-archive lib1.a lib2.a -no-whole-archive > > If so, then we should be able to use $whole_archive_flag_spec in lieu > of extracting everything. Sorry, this is already used when creating shared libraries. -- albert chin ([EMAIL PROTECTED]) ___ http://lists.gnu.org/mailman/listinfo/libtool
Re: Linking convenience libraries
On Thu, Mar 03, 2005 at 12:01:26PM -0600, Bob Friesenhahn wrote: > On Thu, 3 Mar 2005, Albert Chin wrote: > > >When using the compiler to perform the link and linking against > >convenience libraries, is there any reason to link explicitly against > >the extracted objects of the convenience libraries rather than just > >the .a file? I'm running into a problem on IRIX with the SGI C++ > >compiler that is solved if I link the .a files. I see no reason why we > >extract the convenience libraries libraries when linking against the > >compiler v. the linker. > > If we link against the .a file directly then the only objects which > will get pulled in are the ones required to link (resolve symbols). > This means that much of the library may be missing. > > If we are building an application it is desirable to shed unnecessary > objects but it is not desirable to do that for libraries. What if we use $whole_archive_flag_spec? Are the following equivalent on Linux? 1. ld -soname libfoo.so 1.o 2.o 3.o [all .o's from lib1.a] \ [all .o's from lib2.a] 2. ld -soname libfoo.so 1.o 2.o 3.o \ --whole-archive lib1.a lib2.a -no-whole-archive If so, then we should be able to use $whole_archive_flag_spec in lieu of extracting everything. -- albert chin ([EMAIL PROTECTED]) ___ http://lists.gnu.org/mailman/listinfo/libtool
Re: Linking convenience libraries
On Thu, Mar 03, 2005 at 11:41:00AM -0600, Albert Chin wrote: > When using the compiler to perform the link and linking against > convenience libraries, is there any reason to link explicitly against > the extracted objects of the convenience libraries rather than just > the .a file? I'm running into a problem on IRIX with the SGI C++ > compiler that is solved if I link the .a files. I see no reason why we > extract the convenience libraries libraries when linking against the > compiler v. the linker. Ok, my mistakes. $whole_archive_flag_spec works around this. But, only when creating shared objects. Any portability problems with .a files in static archives? -- albert chin ([EMAIL PROTECTED]) ___ http://lists.gnu.org/mailman/listinfo/libtool
Re: Linking convenience libraries
On Thu, 3 Mar 2005, Albert Chin wrote: When using the compiler to perform the link and linking against convenience libraries, is there any reason to link explicitly against the extracted objects of the convenience libraries rather than just the .a file? I'm running into a problem on IRIX with the SGI C++ compiler that is solved if I link the .a files. I see no reason why we extract the convenience libraries libraries when linking against the compiler v. the linker. If we link against the .a file directly then the only objects which will get pulled in are the ones required to link (resolve symbols). This means that much of the library may be missing. If we are building an application it is desirable to shed unnecessary objects but it is not desirable to do that for libraries. Bob == Bob Friesenhahn [EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer,http://www.GraphicsMagick.org/ ___ http://lists.gnu.org/mailman/listinfo/libtool