Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2006 10:17:29 -0800
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        freebsd-current@freebsd.org
Subject:   [jakub@redhat.com:Linking against libpthread via -pthread?
Message-ID:  <20060210181715.GA21782@troutmask.apl.washington.edu>

next in thread | raw e-mail | index | archive | help
Some background information:  I routinely build GCC mainline
on i386-*-freebsd and amd64-*-freebsd.  GCC mainline is introducing
OpenMP support.  When libgomp.so.1 is built, the compiler is 
given the -pthread option throughout the construction of libgomp.so.1.
However, a "ldd libgomp.so.1" shows no dependence on libpthread.so.2

Anyone have an answer to Jakub's question below.

----- Forwarded message from Jakub Jelinek <jakub@redhat.com> -----

X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on 
	troutmask.apl.washington.edu
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00 autolearn=ham 
	version=3.1.0
Date: Fri, 10 Feb 2006 13:04:25 -0500
From: Jakub Jelinek <jakub@redhat.com>
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org
Subject: Re: [gomp merge] Stage 2: OpenMP for the Fortran front end (take 2)
Reply-To: Jakub Jelinek <jakub@redhat.com>
In-Reply-To: <20060210170929.GA43794@troutmask.apl.washington.edu>
User-Agent: Mutt/1.4.1i

On Fri, Feb 10, 2006 at 09:09:29AM -0800, Steve Kargl wrote:
> jakub and I have discussed.  The other failures are probably
> due to FreeBSD's loader.  I'll pursue that issue on the FreeBSD
> mailing lists.

libgomp.so.0 not linking against libpthread.so.* is indeed IMHO a FreeBSD
bug.
For FreeBSD 6+, there is:
#define FBSD_LIB_SPEC "                                                 \
  %{!shared:                                                            \
    %{!pg: %{pthread:-lpthread} -lc}                                    \
    %{pg:  %{pthread:-lpthread_p} -lc_p}                                \
  }"
#endif

This means that -pthread doesn't imply -lpthread for -shared.
Can anyone from the FreeBSD crowd explain why it isn't
%{pthread:-lpthread%{pg:_p}} %{!shared:-lc%{pg:_p}}
or better yet, why isn't -lc linked in automatically as well for -shared?

	Jakub

----- End forwarded message -----

-- 
Steve



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060210181715.GA21782>