Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 583930 - dev-lisp/sbcl-1.1.18 : /.../ld: x86-64-assem.o: relocation R_X86_64_32S against `all_threads' can not be used when making a shared object; recompile with -fPIC
Summary: dev-lisp/sbcl-1.1.18 : /.../ld: x86-64-assem.o: relocation R_X86_64_32S again...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mark Wright
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-24 07:40 UTC by Toralf Förster
Modified: 2017-03-21 01:57 UTC (History)
5 users (show)

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


Attachments
dev-lisp:sbcl-1.1.18:20160523-222037.log (dev-lisp:sbcl-1.1.18:20160523-222037.log,895.26 KB, text/plain)
2016-05-24 07:40 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,111.87 KB, text/plain)
2016-05-24 07:40 UTC, Toralf Förster
Details
environment (environment,93.39 KB, text/plain)
2016-05-24 07:40 UTC, Toralf Förster
Details
emerge-info.txt (emerge-info.txt,5.28 KB, text/plain)
2017-02-03 18:54 UTC, Toralf Förster
Details
dev-lisp:sbcl-1.3.11:20170203-181450.log (dev-lisp:sbcl-1.3.11:20170203-181450.log,87.97 KB, text/plain)
2017-02-03 18:54 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,173.83 KB, text/plain)
2017-02-03 18:54 UTC, Toralf Förster
Details
environment (environment,98.07 KB, text/plain)
2017-02-03 18:54 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,19.06 KB, application/x-bzip)
2017-02-03 18:54 UTC, Toralf Förster
Details
sbcl-1.3.14-ebuild-bug-58930.patch (sbcl-1.3.14-ebuild-bug-58930.patch,1004 bytes, patch)
2017-02-27 13:52 UTC, Mark Wright
Details | Diff
sbcl-1.3.14-gentoo-fix_nopie_for_hardened_toolchain.patch (sbcl-1.3.14-gentoo-fix_nopie_for_hardened_toolchain.patch,624 bytes, patch)
2017-02-28 03:10 UTC, Mark Wright
Details | Diff
sbcl-1.3.14-ebuild-bug-58930.patch (sbcl-1.3.14-ebuild-bug-58930.patch,780 bytes, patch)
2017-02-28 03:21 UTC, Mark Wright
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2016-05-24 07:40:45 UTC
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -g -Wall -Wsign-compare -O3 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fno-omit-frame-pointer -I. -DSBCL_PREFIX=\"'/usr/local'\"  -c -o ldso-stubs.o ldso-stubs.S
x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -g -Wl,--export-dynamic -o sbcl alloc.o backtrace.o breakpoint.o coreparse.o dynbind.o funcall.o gc-common.o globals.o interr.o interrupt.o largefile.o monitor.o os-common.o parse.o print.o purify.o pthread-futex.o regnames.o run-program.o runtime.o safepoint.o save.o search.o thread.o time.o util.o validate.o vars.o wrap.o x86-64-arch.o linux-os.o x
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld: x86-64-assem.o: relocation R_X86_64_32S against `all_threads' can not be used when making a shared object; recompile with -fPIC
x86-64-assem.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
GNUmakefile:61: recipe for target 'sbcl' failed


$ cat emerge-info.txt
  -----------------------------------------------------------------

  This is an stable amd64 chroot image (named amd64-hardened-stable_20160522-172226) at a hardened host acting as a tinderbox.

  -----------------------------------------------------------------

  make.conf: USE="mmx sse sse2 pax_kernel xtpax -cdinstall -oci8 -bindist u"

  -----------------------------------------------------------------

Portage 2.2.28 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.3-vanilla, glibc-2.22-r4, 4.5.5-hardened x86_64)
=================================================================
System uname: Linux-4.5.5-hardened-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16157888 total,   3374304 free
KiB Swap:   16777212 total,  16750420 free
Timestamp of repository gentoo: Mon, 23 May 2016 18:36:42 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::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.19.1::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.11.6-r1::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: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

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

local
    location: /usr/local/portage
    masters: gentoo
    priority: 2

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
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/apache2-php5.6/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/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="-march=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--verbose-conflicts --color=n --nospinner --tree --quiet-build"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox 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="http://ftp.uni-erlangen.de/pub/mirrors/gentoo rsync://mirror.netcologne.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gor.bytemark.co.uk/gentoo/ rsync://ftp.snt.utwente.nl/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
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 --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri gdbm hardened iconv ipv6 justify mmx mmxext modules multilib ncurses nls nptl openmp pam pax_kernel pcre pie readline seccomp session sse sse2 ssl ssp tcpd u unicode urandom xattr 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="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" 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="intel i965" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Toralf Förster gentoo-dev 2016-05-24 07:40:48 UTC
Created attachment 435168 [details]
dev-lisp:sbcl-1.1.18:20160523-222037.log
Comment 2 Toralf Förster gentoo-dev 2016-05-24 07:40:51 UTC
Created attachment 435170 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2016-05-24 07:40:54 UTC
Created attachment 435172 [details]
environment
Comment 4 Andrey Grozin gentoo-dev 2017-01-22 16:50:18 UTC
No longer in the tree.
Comment 5 Toralf Förster gentoo-dev 2017-02-03 18:54:22 UTC
same at a tinderbox image
Comment 6 Toralf Förster gentoo-dev 2017-02-03 18:54:25 UTC
Created attachment 462362 [details]
emerge-info.txt
Comment 7 Toralf Förster gentoo-dev 2017-02-03 18:54:28 UTC
Created attachment 462364 [details]
dev-lisp:sbcl-1.3.11:20170203-181450.log
Comment 8 Toralf Förster gentoo-dev 2017-02-03 18:54:31 UTC
Created attachment 462366 [details]
emerge-history.txt
Comment 9 Toralf Förster gentoo-dev 2017-02-03 18:54:35 UTC
Created attachment 462368 [details]
environment
Comment 10 Toralf Förster gentoo-dev 2017-02-03 18:54:38 UTC
Created attachment 462370 [details]
etc.portage.tbz2
Comment 11 Andrey Grozin gentoo-dev 2017-02-05 15:24:42 UTC
Cannot reproduce. Probably, something gcc-6 specific. I'll contact the upstream, it would be good to sort it out before gcc-6 is unmasked.
Comment 12 Mark Wright gentoo-dev 2017-02-27 13:52:46 UTC
Created attachment 465392 [details, diff]
sbcl-1.3.14-ebuild-bug-58930.patch

I reproduced the problem with sbcl-1.3.14 building with gcc-6.3.0 on gentoo-hardened.  The proposed patch only applies the sbcl-1.3.14-config.patch if the compiler does not support the -nopie or -no-pie options.  At the time of writing, gcc-specs-pie only checks for -nopie, the my-gcc-specs-pie function works around this.  The sbcl-1.1.17-gentoo-fix_nopie_for_hardened_toolchain.patch is no longer necessary as upstream are already compiling with -nopie or -no-pie, so we should only remove compiling with -nopie or -no-pie if the compiler does not support either of these options.
Comment 13 Mark Wright gentoo-dev 2017-02-27 14:07:08 UTC
The https://bugs.gentoo.org/attachment.cgi?id=465392 patch is bad, sorry, it brings back bug 607302 when compiling with gcc 5.3.0 and probably other gcc versions on gentoo-hardened.
Comment 14 Mark Wright gentoo-dev 2017-02-28 03:10:41 UTC
Created attachment 465452 [details, diff]
sbcl-1.3.14-gentoo-fix_nopie_for_hardened_toolchain.patch

Replaces sbcl-1.3.14-config.patch.  I will try to upstream this patch, after it has been tested on non-hardened systems.
Comment 15 Mark Wright gentoo-dev 2017-02-28 03:21:14 UTC
Created attachment 465454 [details, diff]
sbcl-1.3.14-ebuild-bug-58930.patch

Tested with gcc 4.7.4, 4.8.5, 4.9.3, 5.3.0, 5.4.0, 6.3.0 on gentoo-hardened only.  It would be neat if someone would like to test it on a non-hardened system.

Unless someone else wants to commit it, I will take the bug and commit it.
Comment 16 Andrey Grozin gentoo-dev 2017-02-28 05:29:29 UTC
(In reply to Mark Wright from comment #15)
> Tested with gcc 4.7.4, 4.8.5, 4.9.3, 5.3.0, 5.4.0, 6.3.0 on gentoo-hardened
> only.  It would be neat if someone would like to test it on a non-hardened
> system.
Tested on non-hardened ~amd64 and ~x86 with gcc-5.4.0.

> Unless someone else wants to commit it, I will take the bug and commit it.
Please go ahead and commit it.
Comment 17 Mark Wright gentoo-dev 2017-03-01 13:01:02 UTC
(In reply to Andrey Grozin from comment #16)
> (In reply to Mark Wright from comment #15)
> > Tested with gcc 4.7.4, 4.8.5, 4.9.3, 5.3.0, 5.4.0, 6.3.0 on gentoo-hardened
> > only.  It would be neat if someone would like to test it on a non-hardened
> > system.
> Tested on non-hardened ~amd64 and ~x86 with gcc-5.4.0.

Great, thanks for testing.

> > Unless someone else wants to commit it, I will take the bug and commit it.
> Please go ahead and commit it.

Done:

commit 4d54b1daeefc0acd44a6d8971c70104a534ed853
Author: Mark Wright <gienah@gentoo.org>
Date:   Wed Mar 1 23:57:07 2017 +1100

    dev-lisp/sbcl: Fix the detection of -nopie and -no-pie.
    
    The change 3403dbaffc0a9bab49b78cf0bb5308cce0a0c153 that upstream did for
    https://bugs.launchpad.net/sbcl/+bug/1633559 does not work on Gentoo.  So
    it was patched out in the fix for #607302 with sbcl-1.3.14-config.patch,
    which unfortunately leads to #583930.  Thanks to Toralf Forster for
    reporting, and grozin for testing.
    
    Gentoo-bug: 599902, 607302, 583930
Comment 18 Mark Wright gentoo-dev 2017-03-01 13:33:05 UTC
Raised this bug to try to upstream the patch:
https://bugs.launchpad.net/sbcl/+bug/1668986
Comment 19 Mark Wright gentoo-dev 2017-03-21 01:57:13 UTC
Fixed upstream:

https://bugs.launchpad.net/bugs/1668986

Stas Boukarev (stassats) wrote 2 hours ago:	#3
In d905bdd3b4ce68682ea611390624b78c8d8dbdcf.

Changed in sbcl:
status:	New → Fix Committed