Re: Make mjpegtools build with LDFLAGS=-Wl, -z, defs

Fabian Greffrath <[email protected]> Thu, 27 Mar 2008 16:48:27 +0100
Newsgroups gmane.comp.video.mjpeg.devel
Message-ID <[email protected]>
Steven M. Schultz schrieb:
> 	That's because on MY systems nothing is needed for PTHREAD_LIBS since
> 	(correctly I think) threads are integrated into the system library.

It is in a separate library in /usr/lib/libpthread.so.

> 	The problem was in the Makefile.am files - the usage should have been
> 	@PTHREAD_LIBS@ instead of $(PTHREADS_LIBS) so that automake would do
> 	the substitution.

Compilation is still failing with "undefined reference to 
'pthread_[...]'" errors. Automake did not substitute @PTHREAD_LIBS@ 
with the correct parameter either.

> 	Well, they're not "unnecessary" - all of the dependencies are needed
> 	on my systems (for one thing or another ;)).

To make sure we are not at cross-purposes: It is not '-Wl, 
--as-needed' that makes the compilation fail. It is '-Wl,-z,defs' 
instead. This option (called --no-undefined in the long form) makes 
sure that each binary object, which is using symbols of a library, is 
explicitely linked against this very library - be it a "system 
library" or not (well, except libc.so that is). ;)

However, I believe there is something going wrong in the pthread 
implementation detection code during configure...

Cheers,
Fabian


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace