Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-20 Thread Peter Johansson
Hi again, FWIW, problem solved if we linked with LDFLAGS=-Wl,-flat_namespace. I noticed that 'libtool.m4' has some code to enforce flat_namespace under certain circumstances on darwin (see below). Would it make sense to switch to flat_namespace in even more cases, since the default seems prob

Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-18 Thread Russ Allbery
Satz Klauer writes: > This line looks a bit strange to me: > libtool: link: g++ -g -O2 -Wl,-whole-archive -Wl,-no-whole-archive -o > .libs/baz baz.o -Wl,-bind_at_load ../foo/libfoo.a > ../bar/.libs/libbar.dylib > g++ looks like some GCC-type compiler, so GNU-specifics should not be > a problem

Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-18 Thread Peter Johansson
On 3/18/13 8:39 PM, Satz Klauer wrote: This line looks a bit strange to me: libtool: link: g++ -g -O2 -Wl,-whole-archive -Wl,-no-whole-archive -o .libs/baz baz.o -Wl,-bind_at_load ../foo/libfoo.a ../bar/.libs/libbar.dylib That looks strange indeed. Is libtool shuffling around the order of com

Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-18 Thread Satz Klauer
This line looks a bit strange to me: libtool: link: g++ -g -O2 -Wl,-whole-archive -Wl,-no-whole-archive -o .libs/baz baz.o -Wl,-bind_at_load ../foo/libfoo.a ../bar/.libs/libbar.dylib g++ looks like some GCC-type compiler, so GNU-specifics should not be a problem!? Nevertheless I don't know what

Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-18 Thread Peter Johansson
On 3/18/13 4:03 PM, Satz Klauer wrote: It is not a libtool-specific thingy, you have to use these linking options: -Wl,-whole-archive -lyourlib.a -lyourlib2.a -Wl,-no-whole-archive This includes your static libraries libyourlib1.a and libyourlib2.a into the shared library. Please do not forget

Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-17 Thread Satz Klauer
It is not a libtool-specific thingy, you have to use these linking options: -Wl,-whole-archive -lyourlib.a -lyourlib2.a -Wl,-no-whole-archive This includes your static libraries libyourlib1.a and libyourlib2.a into the shared library. Please do not forget the "-Wl,-no-whole-archive" at the end to

Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-17 Thread Peter Johansson
Hi Bob, Thanks for your quick reply. On 03/18/2013 04:41 AM, Bob Friesenhahn wrote: It is not portable, safe, or advisable to link a shared library with a static library. Due to this, libtool does not apply .a files while it is linking a shared library. Usually it warns and provides advice

Re: lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-17 Thread Bob Friesenhahn
On Sun, 17 Mar 2013, Peter Johansson wrote: Hi libtoolers, I've encontered a problem on newer OSX (10.7 and 10.8) when mixing a static library (libfoo) and a dynamic library (libbar). The dynamic library is created with libtool so there is a libbar.la file whereas for the static library ther

lazy symbol binding failed - on MacOSX 10.7 and 10.8

2013-03-16 Thread Peter Johansson
Hi libtoolers, I've encontered a problem on newer OSX (10.7 and 10.8) when mixing a static library (libfoo) and a dynamic library (libbar). The dynamic library is created with libtool so there is a libbar.la file whereas for the static library there is no .la file. Code in libbar uses libfoo b