From mboxrd@z Thu Jan 1 00:00:00 1970 From: Danny Milosavljevic Subject: Re: [PATCH] gnu: Add LDFLAGS=-lpthread to configure-flags where needed. Date: Tue, 21 Mar 2017 12:29:05 +0100 Message-ID: <20170321122905.64b408a6@scratchpost.org> References: <1490059331-32049-1-git-send-email-john@darrington.wattle.id.au> <1490059331-32049-2-git-send-email-john@darrington.wattle.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqHyT-0004ow-H2 for guix-devel@gnu.org; Tue, 21 Mar 2017 07:29:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqHyP-0004ON-EV for guix-devel@gnu.org; Tue, 21 Mar 2017 07:29:13 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:52517) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqHyP-0004O3-8E for guix-devel@gnu.org; Tue, 21 Mar 2017 07:29:09 -0400 In-Reply-To: <1490059331-32049-2-git-send-email-john@darrington.wattle.id.au> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: John Darrington Cc: guix-devel@gnu.org Hi John, thanks for looking into the problem. On Tue, 21 Mar 2017 02:22:11 +0100 John Darrington 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.