Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 595642 - sys-devel/gcc-config-1.8-r1 - /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
Summary: sys-devel/gcc-config-1.8-r1 - /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../.....
Status: RESOLVED DUPLICATE of bug 622690
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-30 13:45 UTC by Thomas Deutschmann (RETIRED)
Modified: 2018-10-31 23:49 UTC (History)
2 users (show)

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 Thomas Deutschmann (RETIRED) gentoo-dev 2016-09-30 13:45:00 UTC
When installing a new system (I used https://ftp.uni-erlangen.de/gentoo/releases/amd64/autobuilds/current-stage3-amd64/stage3-amd64-20160922.tar.bz2) and you try to upgrade world to ~ARCH =sys-devel/gcc-config-1.8-r1 fails to emerge:

 * Package:    sys-devel/gcc-config-1.8-r1
 * Repository: gentoo
 * Maintainer: toolchain@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking gcc-config-1.8.tar.xz to /var/tmp/portage/sys-devel/gcc-config-1.8-r1/work
>>> Source unpacked in /var/tmp/portage/sys-devel/gcc-config-1.8-r1/work
>>> Preparing source in /var/tmp/portage/sys-devel/gcc-config-1.8-r1/work/gcc-config-1.8 ...
 * Applying gcc-config-1.8-dont_source_functions_sh_from_etc_initd.patch ...
 [ ok ]
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-devel/gcc-config-1.8-r1/work/gcc-config-1.8 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-devel/gcc-config-1.8-r1/work/gcc-config-1.8 ...
make --jobs 9 --load-average 7.95 CC=x86_64-pc-linux-gnu-gcc
x86_64-pc-linux-gnu-gcc -O2 -pipe -march=ivybridge -mtune=ivybridge -Wall -Wextra  -Wl,-O1 -Wl,--as-needed  wrapper.c
-o wrapper
wrapper.c: In function ‘main’:
wrapper.c:273:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
 int main(int argc, char *argv[])
              ^
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/..
/../../../lib64/crti.o: unrecognized relocation (0x2a) in section `.init'
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'wrapper' failed
make: *** [wrapper] Error 1


...the error goes away after switching binutils from x86_64-pc-linux-gnu-2.25.1 to x86_64-pc-linux-gnu-2.26.1.
Comment 1 Fernando (likewhoa) 2016-12-26 22:36:08 UTC
confirmed here but it's also broken with =sys-devel/binutils-2.27 and switching to 2.26 doesn't work as stated above.
Comment 2 Fernando (likewhoa) 2016-12-27 15:01:09 UTC
dup of #603798

*** This bug has been marked as a duplicate of bug 603798 ***
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-27 15:17:25 UTC
This is not a dupe. Bug 603798 was about the faulty pre gcc-5.5.0 patch set.
Comment 4 SpanKY gentoo-dev 2016-12-29 23:12:11 UTC
you haven't posted emerge info, so i can only guess at settings here

what version of gcc ?  binutils ?  did you upgrade binutils, upgrade gcc, then switch binutils to an older version ?
Comment 5 Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-29 23:30:09 UTC
1) I extracted stage3-amd64-20160922.tar.bz2 which had =sys-devel/gcc-4.9.3 and =sys-devel/binutils:2.25.1 at this time.

2) I chroot into the new system

3) Adjusted some basic files like /etc/timezone, /etc/locale.gen, /etc/conf.d/hostname, /etc/hosts, /etc/dispatch-conf.conf, /etc/fstab.

4) I set CFLags following https://wiki.gentoo.org/wiki/Safe_CFLAGS#Find_CPU-specific_options, in my case I set

CFLAGS="-O2 -pipe -march=ivybridge  -mtune=ivybridge"

5) I changed

ACCEPT_KEYWORDS="amd64"

into

ACCEPT_KEYWORDS="~amd64"


6) I updated gcc:

# emerge --ask --oneshot --update sys-devel/gcc
# gcc-config -l
# gcc-config 2
# env-update && source /etc/profile
# emerge --oneshot sys-devel/libtool
# emerge --prune --ask sys-devel/gcc
# /usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/fix_libtool_files.sh 4.9.3

(the last command found nothing)


7) Now I tried to update world, i.e.

# emerge --ask --verbose --update --deep --with-bdeps=y --newuse world

...and while updating world (well, you first have to update perl/python on your own...) sys-devel/gcc-config-1.8-r1 failed with the shown output.

This was reproducible.

The problem went away after updating binutils manually (emerge -a1 sys-devel/binutils && eselect binutils list && eselect binutils set 2 (which was sys-devel/binutils-2.26.1 at this time)).
Comment 6 Ben Kohler gentoo-dev 2017-09-08 13:41:59 UTC
Has anyone seen this problem in the wild lately? Should this block stabilization in bug 626646?
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-31 23:49:50 UTC
> /../../../lib64/crti.o: unrecognized relocation (0x2a) in section `.init'

That bug is not specific to gcc-config. It's a case when glibc is built with too new binutils: https://bugs.gentoo.org/622690

*** This bug has been marked as a duplicate of bug 622690 ***