From owner-freebsd-threads@FreeBSD.ORG Sat Sep 27 21:49:47 2014 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1A36E6 for ; Sat, 27 Sep 2014 21:49:47 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C91E768 for ; Sat, 27 Sep 2014 21:49:46 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XXzrz-0000tb-2H for freebsd-threads@freebsd.org; Sat, 27 Sep 2014 23:49:35 +0200 Received: from a91-154-115-217.elisa-laajakaista.fi ([91.154.115.217]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Sep 2014 23:49:35 +0200 Received: from rakuco by a91-154-115-217.elisa-laajakaista.fi with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Sep 2014 23:49:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-threads@freebsd.org From: Raphael Kubo da Costa Subject: Re: Segfault from libthr.so. Date: Sun, 28 Sep 2014 00:49:21 +0300 Lines: 15 Message-ID: <86ppegg2e6.fsf@FreeBSD.org> References: <20140926150001.GF7885@Jetdail> <20140926164306.GE8870@kib.kiev.ua> <20140927065556.GH7885@Jetdail> <20140927083621.GJ8870@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: a91-154-115-217.elisa-laajakaista.fi User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (berkeley-unix) Cancel-Lock: sha1:3MxJG3BOu3N6LKisXAdHIkcTTdk= X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 21:49:47 -0000 Konstantin Belousov writes: >> In my app, i dont directly start any thread, lower libs do. So it >> doesnt seem logical to add -lpthread before declaring the deps. So >> should i just remove this m4 macro that seems to be use on quite some >> projects, so it works on BSD ? >> >> What is the best way to do it, in your opinion ? > > Just put -lpthread last in the command line (automake variable) for linker. > This should work portable on all systems I know. Alternatively, you could pass -pthread instead of -lpthread: the compiler should then take care of passing -lpthread in the right position -- it's what we use in the ports tree, for example.