Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568560 - dev-lang/python-3.4.3-r5 fails emerge using clang with libomp
Summary: dev-lang/python-3.4.3-r5 fails emerge using clang with libomp
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-17 17:36 UTC by Mark
Modified: 2018-04-21 21:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (dev-lang:python-3.4.3-r5:20151217-171722.log,82.11 KB, text/x-log)
2015-12-17 17:37 UTC, Mark
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark 2015-12-17 17:36:30 UTC
python-3.4.3-r5 emerges fine with plain-jane clang.  However, with the environment set for libomp:

CC=clang
CXX=clang++
CFLAGS="-march=bdver2 -O2 -pipe -fopenmp=libomp"
CXXFLAGS="${CFLAGS}"

build fails with:


./libpython3.4m.so: undefined reference to `sem_wait'
./libpython3.4m.so: undefined reference to `pthread_setspecific'
./libpython3.4m.so: undefined reference to `sem_init'
./libpython3.4m.so: undefined reference to `pthread_key_delete'
./libpython3.4m.so: undefined reference to `pthread_create'
./libpython3.4m.so: undefined reference to `sem_destroy'
x86_64-pc-linux-gnu-clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:718: recipe for target 'Modules/_testembed' failed
make: *** [Modules/_testembed] Error 1
make: *** Waiting for unfinished jobs....
./libpython3.4m.so: undefined reference to `pthread_detach'
./libpython3.4m.so: undefined reference to `sem_post'
./libpython3.4m.so: undefined reference to `pthread_sigmask'
./libpython3.4m.so: undefined reference to `pthread_attr_setstacksize'
./libpython3.4m.so: undefined reference to `pthread_getspecific'
./libpython3.4m.so: undefined reference to `sem_trywait'
./libpython3.4m.so: undefined reference to `sem_timedwait'
./libpython3.4m.so: undefined reference to `pthread_key_create'
./libpython3.4m.so: undefined reference to `pthread_kill'
./libpython3.4m.so: undefined reference to `sem_wait'
./libpython3.4m.so: undefined reference to `pthread_setspecific'
./libpython3.4m.so: undefined reference to `sem_init'
./libpython3.4m.so: undefined reference to `pthread_key_delete'
./libpython3.4m.so: undefined reference to `pthread_create'
./libpython3.4m.so: undefined reference to `sem_destroy'
x86_64-pc-linux-gnu-clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:556: recipe for target 'python' failed
make: *** [python] Error 1
 * ERROR: dev-lang/python-3.4.3-r5::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/python-3.4.3-r5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/python-3.4.3-r5::gentoo'`.
 * The complete build log is located at '/var/log/portage/dev-lang:python-3.4.3-r5:20151217-171722.log'.
 * The ebuild environment file is located at '/dev/shm/portage/dev-lang/python-3.4.3-r5/temp/environment'.
 * Working directory: '/dev/shm/portage/dev-lang/python-3.4.3-r5/work/x86_64-pc-linux-gnu'
 * S: '/dev/shm/portage/dev-lang/python-3.4.3-r5/work/Python-3.4.3'

>>> Failed to emerge dev-lang/python-3.4.3-r5, Log file:



emerge --info '=dev-lang/python-3.4.3-r5::gentoo'
Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop, gcc-4.8.4, glibc-2.22-r1, 3.10.93-gentoo-R5 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.93-gentoo-R5-x86_64-AMD_Opteron-tm-_Processor_6344-with-gentoo-2.2
KiB Mem:    65963228 total,  11747172 free
KiB Swap:    2047996 total,   2047996 free
Timestamp of repository gentoo: Thu, 17 Dec 2015 09:00:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2-r1::gentoo
dev-lang/python:          2.7.11::gentoo, 3.4.3-r5::gentoo
dev-util/cmake:           3.4.1::gentoo
dev-util/pkgconfig:       0.29::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.9::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15-r1::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.7.4::gentoo, 4.8.4::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo
Repositories:

proaudio
    location: /var/lib/layman/proaudio
    masters: gentoo
    priority: 0

squeezebox
    location: /var/lib/layman/squeezebox
    masters: gentoo
    priority: 1

sunrise
    location: /var/lib/layman/sunrise
    masters: gentoo
    priority: 2

prism-overlay
    location: /var/lib/layman/prism-overlay
    masters: gentoo
    priority: 3

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: 4

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 5

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=bdver2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=bdver2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n --oneshot --autounmask=n --keep-going=y --fail-clean=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg collision-protect config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j24"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/dev/shm"
USE="X a52 aac acl acpi alsa amd64 avi berkdb branding bzip2 cairo cdda cdparanoia cdr chroot cleartype cli corefonts cracklib crypt cups cxx dri dts dv dvd dvdr emboss encode exif fam firefox flac fortran freetype gdbm gif glamor gpm gtk hwdb iconv jack java javascript jpeg lcms libnotify lm_sensors mad mime mmx mmxext mng modules mp3 mp4 mpeg mpi multilib nas ncurses net network nls nptl nptonly nsplugin ogg opengl openmp pam pango pcre pdf png posix ppds python qt4 readline samba sdl seccomp session snmp socks5 spell sqlite sse sse2 ssl startup-notification svg swat tcpd tiff truetype type1 udev unicode usb userlocales vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.4"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

dev-lang/python-3.4.3-r5::gentoo was built with the following:
USE="gdbm ncurses readline sqlite ssl threads tk xml -build -examples -hardened -ipv6 -libressl -wininst" ABI_X86="64"
CFLAGS="-march=bdver2 -O2 -pipe -fwrapv"
CXXFLAGS="-march=bdver2 -O2 -pipe -fwrapv"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -L."

So far, all other clang packages compiled with libomp have been successful.  



Reproducible: Always

Steps to Reproduce:
1. emerge python with clang/opm
2. fails
3. emerge python with clang alone
4. success



Build log attached
Comment 1 Mark 2015-12-17 17:37:27 UTC
Created attachment 419506 [details]
Build log
Comment 2 Mike Gilbert gentoo-dev 2015-12-24 17:55:31 UTC
This check is giving the wrong result:

> checking whether pthreads are available without options... yes

I suspect that -fopenmp=libomp implicitly enables the -pthread option as well. Otherwise, -pthread would be added to both the linker command.

It looks like the python build system does not pass CFLAGS to the linker when building libpython.so, and -pthread doesn't get passed due to the above configure check.

Try adding -fopenmp=libomp to LDFLAGS.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-21 21:45:26 UTC
Mass closing of bugs reported against old versions of dev-lang/python.  If the problem still occurs with the current versions (i.e. newest in each visible slot), feel free to reopen.