python build fail; undefined reference to pthread_* and sem_*

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

python build fail; undefined reference to pthread_* and sem_*

Walter Dnes
  This is happening with both python 2.7.12 and 3.4.5 on a 32-bit x86
system.  Build logs are attached, along with "emerge --info" output.  I
can't find anything relevant in bugzilla.

--
Walter Dnes <[hidden email]>
I don't run "desktop environments"; I run useful applications

python-2.7.12.log.gz (11K) Download Attachment
python-3.4.5.log.gz (11K) Download Attachment
info.txt.gz (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python build fail; undefined reference to pthread_* and sem_*

Walter Dnes
> ‹ӖÝYinfo.txt
> FÃþÅL
> (£)–QŽ@J=ŽRÊ%¥4ò•>#:Ӥȩ½ØnuŽÎ;k„ĉÎXö;©0¿K‡

  Something failed there.  I'll attach as plain text and hopefully the
"emerge --info" output will get through



--
Walter Dnes <[hidden email]>
I don't run "desktop environments"; I run useful applications

info.txt (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python build fail; undefined reference to pthread_* and sem_*

Mike Gilbert-2
In reply to this post by Walter Dnes
On Wed, Oct 11, 2017 at 12:16 AM, Walter Dnes <[hidden email]> wrote:
>   This is happening with both python 2.7.12 and 3.4.5 on a 32-bit x86
> system.  Build logs are attached, along with "emerge --info" output.  I
> can't find anything relevant in bugzilla.

From the build log for 3.4.5:

checking whether pthreads are available without options... yes

This is clearly a lie; glibc requires that you pass "-pthread" to gcc
to enable pthreads. For some reason, configure is mis-detecting this.

I would try rebuilding with minimal CFLAGS.

Reply | Threaded
Open this post in threaded view
|

Re: python build fail; undefined reference to pthread_* and sem_*

Mike Gilbert-2
On Wed, Oct 11, 2017 at 11:50 AM, Mike Gilbert <[hidden email]> wrote:

> On Wed, Oct 11, 2017 at 12:16 AM, Walter Dnes <[hidden email]> wrote:
>>   This is happening with both python 2.7.12 and 3.4.5 on a 32-bit x86
>> system.  Build logs are attached, along with "emerge --info" output.  I
>> can't find anything relevant in bugzilla.
>
> From the build log for 3.4.5:
>
> checking whether pthreads are available without options... yes
>
> This is clearly a lie; glibc requires that you pass "-pthread" to gcc
> to enable pthreads. For some reason, configure is mis-detecting this.
>
> I would try rebuilding with minimal CFLAGS.

I can reproduce the issue by adding -fopenmp to my CFLAGS. You can
work around it by adding -fopenmp to LDFLAGS as well.

This is probably a bug in the Python build system; it should probably
be passing CFLAGS to gcc when linking libpython.

Reply | Threaded
Open this post in threaded view
|

Re: python build fail; undefined reference to pthread_* and sem_*

Walter Dnes
On Wed, Oct 11, 2017 at 11:56:21AM -0400, Mike Gilbert wrote

> I can reproduce the issue by adding -fopenmp to my CFLAGS. You can
> work around it by adding -fopenmp to LDFLAGS as well.

  Thanks.  The following workaround makes python build properly.

LDFLAGS="-fopenmp" emerge =dev-lang/python-2.7.12 =dev-lang/python-3.4.5

> This is probably a bug in the Python build system; it should probably
> be passing CFLAGS to gcc when linking libpython.

  Bug https://bugs.gentoo.org/634064 filed.

--
Walter Dnes <[hidden email]>
I don't run "desktop environments"; I run useful applications