Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 622690 - sys-devel/binutils: Should it have a softblocker on itself to ensure removal of older versions on upgrade to avoid compatibility-related errors?
Summary: sys-devel/binutils: Should it have a softblocker on itself to ensure removal ...
Status: RESOLVED WONTFIX
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:
: 595642 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-25 12:40 UTC by Kristian Fiskerstrand (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 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-06-25 12:40:51 UTC
As discussed briefly on IRC; after upgrading glibc to 2.23-r4 I'm starting to see an unusable compiler with message for test as shown below

$ cat test.c 
int main (void)
{
  ;
 return 0;
}

$ gcc test.c
/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

Downgrading glibc to -r3 again and gcc can once again work as a compiler
$ gcc test.c 
$ echo $?
0
Comment 1 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-06-25 12:46:35 UTC
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808205 seems related, i.e matching with binutils
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2017-06-25 12:56:09 UTC
0x2a is relocation number 42

(from /usr/include/elf.h)
#define R_X86_64_REX_GOTPCRELX<>42
/* Load from 32 bit signed pc relative
   offset to GOT entry with REX prefix,
   relaxable.  */

It means you have build glibc with new binutils that intruduced new type of relocation: https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0

Older binutils does not understand object files generated by new binutils.
You need to update binutils on a target machine or downgrade binutils
on a machine you build glibc (and other libraries).
Comment 3 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-06-25 13:03:51 UTC
Indeed, the newer binutil was upgraded in the VM but not selected using binutils-config, so I can toggle the issue on/off by selecting the various implementations.

Could we make this more transparent e.g by introducing a softblocker for lower versions on binutils during upgrade to force removal of old versions?
Comment 4 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-06-25 13:59:09 UTC
Adding some more rationale for the consideration, now users will be faced with errors on toolchain during e.g a world upgrade, complaining about unusable compiler. The use cases that have been presented to me where multiple binutils versions are preferable are related to embedded and crossdev scenarios. Given that these are advanced users; I'd argue that the usability experience for regular users takes precedence which we can improve with a softblocker, the more advanced users can still keep their workflow by using an overlay where this is removed.
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2017-09-13 18:39:53 UTC
To be honest I have no clue how this bug even occurred - given that the newer binutils was never selected (?).
Comment 6 Kristian Fiskerstrand (RETIRED) gentoo-dev 2017-09-16 13:38:00 UTC
(In reply to Andreas K. Hüttel from comment #5)
> To be honest I have no clue how this bug even occurred - given that the
> newer binutils was never selected (?).

It was selected on the binhost and installed, but not selected on target.
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2018-04-15 10:52:36 UTC
This particular change (R_X86_64_REX_GOTPCRELX) was added in binutils-2.26 and is already masked for removal (upstream commit 2891b491040ac84dfe0013454b2aa834de7b539c).

More generally eagerly deinstalling older binutils is dangerous because if newly installed binutils is broken you would not be able to easily roll back. Because you might not be able to build older binutils with new binutils anymore.

That occasionally happens on sparc and powerpc.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-31 23:49:50 UTC
*** Bug 595642 has been marked as a duplicate of this bug. ***