[jakub_at_redhat.com:Linking against libpthread via -pthread?

From: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Date: Fri, 10 Feb 2006 10:17:29 -0800
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_at_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_at_redhat.com>
To: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Cc: gcc-patches_at_gcc.gnu.org, fortran_at_gcc.gnu.org
Subject: Re: [gomp merge] Stage 2: OpenMP for the Fortran front end (take 2)
Reply-To: Jakub Jelinek <jakub_at_redhat.com>
In-Reply-To: <20060210170929.GA43794_at_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
Received on Fri Feb 10 2006 - 17:17:30 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:52 UTC