Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 530608

Summary: media-sound/pulseaudio-5.0-r4 - configure:19002: checking if x86_64-pc-linux-gnu-g++ PIC flag -fPIC -DPIC works // configure:19037: result: no
Product: Gentoo Linux Reporter: Marek Szuba <marecki>
Component: [OLD] GNOMEAssignee: Gentoo Linux Gnome Desktop Team <gnome>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: sound
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: pulseaudio-5.0-r4-build.log.xz
pulseaudio-5.0-r4-config.log.xz

Description Marek Szuba archtester gentoo-dev 2014-11-25 12:35:36 UTC
Hello,

Attempting to emerge media-sound/pulseaudio-5.0-r4 on an up-to-date amd64 system results in invalid-relocation linking errors. The solution to this problem is at a glance straightforward and even suggested by the linker error message - relevant files should be recompiled with the -fPIC option. In practice however it is not that simple - simply adding -fPIC to CFLAGS does NOT result in the problem going away. Having studied the build log, it would appear that PIC-related compiler flags are explicitly stripped for certain source files.

Reproducible: Always

Steps to Reproduce:
emerge =media-sound/pulseaudio-5.0-r4

Actual Results:  
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: modules/echo-cancel/.libs/libwebrtc_util_la-webrtc.o: warning: relocation against `pa_webrtc_ec_play' in readonly section `.text'.
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: modules/echo-cancel/.libs/libwebrtc_util_la-webrtc.o: relocation R_X86_64_PC32 against symbol `pa_webrtc_ec_play' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:5376: recipe for target 'libwebrtc-util.la' failed


Expected Results:  
Pulseaudio builds and installs successfully.

Portage 2.2.8-r2 (hardened/linux/amd64, gcc-4.8.3, glibc-2.19-r1, 3.15.10-hardened-r1 x86_64)
=================================================================
System uname: Linux-3.15.10-hardened-r1-x86_64-Intel-R-_Core-TM-_i5-4300U_CPU_@_1.90GHz-with-gentoo-2.2
KiB Mem:    12248208 total,   8368076 free
KiB Swap:    8388928 total,   8214108 free
Timestamp of tree: Tue, 25 Nov 2014 07:45:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.18.2-r2
dev-lang/python:          2.7.7
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.2-r1
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.16 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo steam-overlay local
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-ggdb3 -O2 -pipe -march=native -floop-interchange -floop-strip-mine -floop-block"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-ggdb3 -O2 -pipe -march=native -floop-interchange -floop-strip-mine -floop-block"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-ggdb3 -O2 -pipe -march=native -floop-interchange -floop-strip-mine -floop-block"
FEATURES="assume-digests binpkg-logs ccache collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-ggdb3 -O2 -pipe -march=native -floop-interchange -floop-strip-mine -floop-block"
GENTOO_MIRRORS="http://de-mirror.org/gentoo/ http://mirror.netcologne.de/gentoo/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-5"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/steam /usr/local/portage"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 audit avx avx2 bash-completion berkdb bluetooth branding bzip2 cairo caps cjk clamav cli cracklib crypt cryptsetup cscope cups curl cxx dbus dga dri dts dv egl emacs encode exif expat fam fbcon ffmpeg fftw flac fontconfig fortran ftp gdbm gif gimp gles gmp gnutls gpm gps gsl gtk gtk3 gzip hardened iconv icu idn imagemagick imap ipv6 jabber java jpeg justify kerberos kpathsea latex lcms ldap libedit libnotify libsamplerate logrotate lzma mad maildir mime mmap mmx mmxext mng modules mp3 mp4 mpeg mplayer multilib ncurses nls nntp nptl nsplugin offensive ogg openal opencl openexr opengl openmp pam pango pax_kernel pcre pdf perl pic png policykit posix postscript pulseaudio python qt3support qt4 quicktime raw rdesktop readline recode rss sdl session sharedmem smp sndfile sockets speex spell sqlite sqlite3 sse sse2 sse3 ssl ssse3 startup-notification svg systemd sysvipc tcpd threads tiff truetype udev udisks unicode upower urandom usb v4l vaapi vdpau vim-syntax vorbis wifi win32codecs wxwidgets x264 xattr xcb xcomposite xft xml xmp xtpax xv xvid zlib" ABI_X86="64" 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" 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" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="intel" 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"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Marek Szuba archtester gentoo-dev 2014-11-25 12:38:23 UTC
Created attachment 390262 [details]
pulseaudio-5.0-r4-build.log.xz
Comment 2 Marek Szuba archtester gentoo-dev 2014-11-25 12:55:59 UTC
An update: one can get this ebuild to install successfully by explicitly setting PIC flags (I have used both -fPIC and -DPIC to be on the safe side) in both CFLAGS and CXXFLAGS. Setting them in CXXFLAGS only merely shifts the error to a different file.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-11-25 20:45:14 UTC
checking for x86_64-pc-linux-gnu-gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if x86_64-pc-linux-gnu-gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
[...]
checking for x86_64-pc-linux-gnu-g++ option to produce PIC... -fPIC -DPIC
checking if x86_64-pc-linux-gnu-g++ PIC flag -fPIC -DPIC works... no

Why does it not work for g++?

Please attach that config.log to this bug report.
Comment 4 Marek Szuba archtester gentoo-dev 2014-11-26 16:05:26 UTC
Created attachment 390354 [details]
pulseaudio-5.0-r4-config.log.xz

Here is a config.log file. Note that this time I have forced PIC flags for neither C nor C++ flags - resulting in configure stating that PIC flags work for neither gcc nor g++.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2014-11-26 17:24:20 UTC
configure:19002: checking if x86_64-pc-linux-gnu-g++ PIC flag -fPIC -DPIC works
configure:19020: x86_64-pc-linux-gnu-g++ -c -ggdb3 -O2 -pipe -march=native -floop-interchange -floop-strip-mine -floop-block -DFASTPATH -D_FORTIFY_SOURCE=2 -fPIC -DPIC -DPIC conftest.cpp >&5
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:0:0: note: this is the location of the previous definition
<command-line>:3:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
<built-in>:198:0: note: this is the location of the previous definition
configure:19024: $? = 0
configure:19037: result: no
Comment 6 Pacho Ramos gentoo-dev 2015-09-24 18:22:20 UTC
Please retry on a full updated system and with pulseaudio-7.0
Comment 7 Marek Szuba archtester gentoo-dev 2015-09-25 22:02:28 UTC
No build error this time.