Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 569024 - app-emulation/lxc-1.1.5 emerge fails due to missing -fPIC CFLAG
Summary: app-emulation/lxc-1.1.5 emerge fails due to missing -fPIC CFLAG
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-21 16:36 UTC by Alex
Modified: 2015-12-21 21:16 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2015-12-21 16:36:47 UTC
For both amd64 and ~amd64 compilation fails with:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: liblxc_so-initutils.o: relocation R_X86_64_TPOFF32 against `values.6466' can not be used when making a shared object; recompile with -fPIC
liblxc_so-initutils.o: error adding symbols: Bad value


Reproducible: Always

Steps to Reproduce:
1.emerge app-emulation/lxc

Actual Results:  
...
x86_64-pc-linux-gnu-gcc -fPIC -DPIC -I../../src -DLXCROOTFSMOUNT=\"/var/lib/lxc/rootfs\" -DLXCPATH=\"/var/lib/lxc\" -DLXC_GLOBAL_CONF=\"/etc/lxc/lxc.conf\" -DLXCINITDIR=\"/usr/libexec\" -DLIBEXECDIR=\"/usr/libexec\" -DLXCTEMPLATEDIR=\"/usr/share/lxc/templates\" -DLOGPATH=\"/var/log/lxc\" -DLXC_DEFAULT_CONFIG=\"/etc/lxc/default.conf\" -DLXC_USERNIC_DB=\"/run/lxc/nics\" -DLXC_USERNIC_CONF=\"/etc/lxc/lxc-usernet\" -DDEFAULT_CGROUP_PATTERN=\"/lxc/%n\" -DRUNTIME_PATH=\"/run\" -DSBINDIR=\"/usr/bin\"     -DHAVE_SECCOMP  -pthread  -march=bdver2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -maes -mpclmul -mpopcnt -mabm -mlwp -mfma -mfma4 -mxop -mbmi -mtbm -mavx -msse4.2 -msse4.1 -mlzcnt -mf16c -mprfchw -mfxsr -mxsave --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=bdver2 -fno-strict-overflow -fPIE -fstack-protector-all -fstack-check=specific -O2 -pipe -fno-strict-aliasing -Wall -Werror -pthread -shared -Wl,-soname,liblxc.so.1 -Wl,-O1 -Wl,--as-needed -o liblxc.so liblxc_so-arguments.o liblxc_so-bdev.o liblxc_so-commands.o liblxc_so-start.o liblxc_so-execute.o liblxc_so-monitor.o liblxc_so-console.o liblxc_so-freezer.o liblxc_so-error.o liblxc_so-parse.o liblxc_so-cgfs.o liblxc_so-cgroup.o liblxc_so-initutils.o liblxc_so-utils.o liblxc_so-sync.o liblxc_so-namespace.o liblxc_so-conf.o liblxc_so-confile.o liblxc_so-state.o liblxc_so-log.o liblxc_so-attach.o liblxc_so-criu.o liblxc_so-network.o liblxc_so-nl.o liblxc_so-rtnl.o liblxc_so-genl.o liblxc_so-caps.o liblxc_so-mainloop.o liblxc_so-af_unix.o liblxc_so-lxcutmp.o liblxc_so-lxclock.o liblxc_so-lxccontainer.o lsm/liblxc_so-nop.o lsm/liblxc_so-lsm.o      liblxc_so-seccomp.o -lcap   -lseccomp   -lutil -lpthread 
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: liblxc_so-initutils.o: relocation R_X86_64_TPOFF32 against `values.6466' can not be used when making a shared object; recompile with -fPIC
liblxc_so-initutils.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:942: recipe for target 'liblxc.so' failed
make[3]: *** [liblxc.so] Error 1
make[3]: Leaving directory '/var/tmp/portage/app-emulation/lxc-1.1.5/work/lxc-lxc-1.1.5/src/lxc'
Makefile:404: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/app-emulation/lxc-1.1.5/work/lxc-lxc-1.1.5/src'
Makefile:349: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/var/tmp/portage/app-emulation/lxc-1.1.5/work/lxc-lxc-1.1.5/src'
Makefile:495: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1


Portage 2.2.24 (python 3.4.3-final-0, hardened/linux/amd64/no-multilib, gcc-4.9.3, glibc-2.21-r1, 4.1.7-hardened-r1 x86_64)
=================================================================
System uname: Linux-4.1.7-hardened-r1-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-gentoo-2.2
KiB Mem:    12258964 total,   8617584 free
KiB Swap:    5242876 total,   5242876 free
Timestamp of repository gentoo: Mon, 21 Dec 2015 14:30:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p39::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.4::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

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

local-crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=bdver2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -maes -mpclmul -mpopcnt -mabm -mlwp -mfma -mfma4 -mxop -mbmi -mtbm -mavx -msse4.2 -msse4.1 -mlzcnt -mf16c -mprfchw -mfxsr -mxsave --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=bdver2 -fno-strict-overflow -fPIE -fstack-protector-all -fstack-check=specific -O2 -pipe"
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/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="-march=bdver2 -mmmx -msse -msse2 -msse3 -mssse3 -msse4a -mcx16 -msahf -maes -mpclmul -mpopcnt -mabm -mlwp -mfma -mfma4 -mxop -mbmi -mtbm -mavx -msse4.2 -msse4.1 -mlzcnt -mf16c -mprfchw -mfxsr -mxsave --param l1-cache-size=16 --param l1-cache-line-size=64 --param l2-cache-size=2048 -mtune=bdver2 -fno-strict-overflow -fPIE -fstack-protector-all -fstack-check=specific -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy cgroup config-protect-if-modified distlocks ebuild-locks fail-clean 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="-O2 -pipe"
GENTOO_MIRRORS="rsync://rsync1.uk.gentoo.org/gentoo-portage/ http://mirror.qubenet.net/mirror/gentoo/"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j7"
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="/var/tmp"
USE="X acl alsa amd64 berkdb btrfs bzip2 cli cracklib crossdev crypt cryptsetup cxx device-mapper dri ffmpeg gdbm git glamor gtk gudev hardened iconv jpeg justify lvm mdadm mmx mmxext modules mp3 mtp ncurses nls nptl offensive opengl openmp otr pax_kernel pcre pie png qt5 readline rtmp seccomp session smp sse sse2 ssh ssl ssp tcpd threads udev unicode urandom vaapi vdpau vim-syntax xattr xcb xft xinerama xkb xtpax 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" CPU_FLAGS_X86="mmx mmxext sse sse2" 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" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="radeon radeonsi amdgpu" 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"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Alex 2015-12-21 16:39:52 UTC
Fixed with:

$ cat /etc/portage/env/lxc/lxc.conf 
CFLAGS="${CFLAGS} -fPIC"
$ cat /etc/portage/package.env/lxc 
app-emulation/lxc lxc/lxc.conf
Comment 2 Rafał Mużyło 2015-12-21 21:06:50 UTC
Looks INVALID.

Funny C{XX}FLAGS aside, '-fPIE' doesn't belong into global flags.
Comment 3 Alex 2015-12-21 21:16:06 UTC
My CFLAGS are like that because I use DISTCC to cross compile:

https://wiki.gentoo.org/wiki/Distcc#-march.3Dnative

Removing -fPIE fixed the issue.