guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: Add LDFLAGS=-lpthread to configure-flags where needed.


From: Danny Milosavljevic
Subject: Re: [PATCH] gnu: Add LDFLAGS=-lpthread to configure-flags where needed.
Date: Tue, 21 Mar 2017 12:29:05 +0100

Hi John,

thanks for looking into the problem.

On Tue, 21 Mar 2017 02:22:11 +0100
John Darrington <address@hidden> wrote:
> +   (arguments `(#:configure-flags '("LDFLAGS=-lpthread")))

Hmm, that seems to be a very unsafe thing to do.

In order to actually use pthread, one has to switch gcc into pthread mode 
(which influences how it handles variables etc).
But just passing "-lpthread" to the linker does no such things and will only 
make it link - with the wrong actual instructions in the object files!

Also, even if it worked - by chance -, that seems like papering over the 
problem.

It would be better to check out the object files (with objdump -r or objdump 
-t) and find out where the symbol is listed as undefined ("U"). Then check the 
associated source file whether it actually intended to use pthread.

Pthread is not exactly a modular library that you can just switch on and off at 
will.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]