# Gentoo-sources-5.1.6 SOLVED

## Moonboots

I'm having problems building this kernel  with the following error

```
Invalid absolute R_X86_64_32S relocation: _etext

make[2]: *** [arch/x86/boot/compressed/Makefile:130: arch/x86/boot/compressed/vmlinux.relocs] Error 1

make[2]: *** Suppression du fichier « arch/x86/boot/compressed/vmlinux.relocs »

make[2]: *** Attente des tâches non terminées....

  CC      arch/x86/boot/cpu.o

  CC      arch/x86/boot/compressed/cpuflags.o

  CC      arch/x86/boot/compressed/early_serial_console.o

make[1]: *** [arch/x86/boot/Makefile:112: arch/x86/boot/compressed/vmlinux] Error 2

make: *** [arch/x86/Makefile:316: bzImage] Error 2

```

There was a fellow gentoo user who reported this in mid-May https://lkml.org/lkml/2019/5/16/583 , but his solution make distclean didn't work for me.

I've even tried make defconfig for a default config , but to no avail .  Any ideas or suggestions ?

[Moderator edit: added [code] tags to preserve output layout. -Hu]Last edited by Moonboots on Sat Jun 01, 2019 4:32 pm; edited 1 time in total

----------

## Perfect Gentleman

https://lkml.org/lkml/diff/2019/4/23/938/1

reverse patch from link above.

----------

## DaggyStyle

Greetings,

I've upgraded to 5.1.6, didn't encountered the issue.

----------

## The Main Man

Yeah, no issues here as well, must be something specific.

----------

## Moonboots

 *Perfect Gentleman wrote:*   

> https://lkml.org/lkml/diff/2019/4/23/938/1
> 
> reverse patch from link above.

 

Yes thanks , but i don't want to do this for every kernel , particularly as it's a upstream patch.

@ Kaizer   Yes it does look that way , 5.1.5 build fine.  i'm on a hardened no-multilib profile with gcc-9.1 , Johannes Hirte reported  it failed with both 8.3.0-r1 and 9.1.0 before make distclean worked.

I don't have any ideas myself and it's not something i can ignore as 5.1.7 etc will most likely present the same problem , perhaps if i file a bug someone more knowledgable can point the way ?

I'm not alone https://bugs.gentoo.org/687116  :Smile: 

----------

## NeddySeagoon

Moonboots,

That's not the error we need.

```
make: *** [arch/x86/Makefile:316: bzImage] Error 2
```

Error 2 usually means its a second or subsequent error. 

We need the error tagged Error 1, as that's the one we need to fix.

Depending on how many parallel makes you run, it can be a very long way back in the build log.

Pastebin the entire build log please.

----------

## Moonboots

Sorry for my lack of knowledge Neddy , but I don’t use genkernel.

Where would I find or how would I obtain the build.log ?

----------

## DaggyStyle

Greetings Neddy,

 *NeddySeagoon wrote:*   

> Moonboots,
> 
> That's not the error we need.
> 
> ```
> ...

 

I've actually thought the same until I've noticed this:

```
Invalid absolute R_X86_64_32S relocation: _etext 
```

it is the first line in his paste

----------

## Moonboots

Here is my build log Neddy 

https://pastebin.com/xVzTQFd6

----------

## NeddySeagoon

Moonboots,

I misread your original post. Sorry about that.

The Error 1 is there.

Can you post the output of 

```
emerge --info
```

```
gcc-config -l
```

```
binutils-config-l
```

I suspect an old gcc or old binutils (or both) in use.

Are you using the gold linker? 

Answer no if you don't know what the gold linker is.

```
ld -V
```

will tell you on the first line of the output.

----------

## Moonboots

```
Portage 2.3.67 (python 3.6.8-final-0, default/linux/amd64/17.0/no-multilib/hardened, gcc-9.1.0, glibc-2.29-r2, 5.1.5-gentoo x86_64)

=================================================================

System uname: Linux-5.1.5-gentoo-x86_64-AMD_Ryzen_7_1700_Eight-Core_Processor-with-gentoo-2.6

KiB Mem:    16420772 total,  13154892 free

KiB Swap:    3145724 total,   3145724 free

Timestamp of repository gentoo: Sat, 01 Jun 2019 03:15:01 +0000

Head commit of repository gentoo: 02ceffca106c927189b518e48585ae4777df7e04

sh bash 5.0_p7

ld GNU gold (Gentoo 2.32 p2 2.32.0) 1.16

app-shells/bash:          5.0_p7::gentoo

dev-java/java-config:     2.2.0-r4::gentoo

dev-lang/perl:            5.30.0::gentoo

dev-lang/python:          2.7.16::gentoo, 3.5.7::gentoo, 3.6.8::gentoo, 3.7.3::gentoo

dev-util/cmake:           3.14.4::gentoo

dev-util/pkgconfig:       0.29.2::gentoo

sys-apps/baselayout:      2.6-r1::gentoo

sys-apps/sandbox:         2.17::gentoo

sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo

sys-devel/automake:       1.16.1-r1::gentoo

sys-devel/binutils:       2.32-r1::gentoo

sys-devel/gcc:            9.1.0::gentoo

sys-devel/gcc-config:     2.0::gentoo

sys-devel/libtool:        2.4.6-r5::gentoo

sys-devel/make:           4.2.1-r4::gentoo

sys-kernel/linux-headers: 5.0-r1::gentoo (virtual/os-headers)

sys-libs/glibc:           2.29-r2::gentoo

Repositories:

gentoo

    location: /usr/portage

    sync-type: rsync

    sync-uri: rsync://rsync.europe.gentoo.org/gentoo-portage

    priority: -1000

    sync-rsync-verify-max-age: 24

    sync-rsync-verify-metamanifest: yes

    sync-rsync-verify-jobs: 1

    sync-rsync-extra-opts:

localrepo

    location: /usr/local/portage

    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"

ACCEPT_LICENSE="* -@EULA"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=native -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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"

CXXFLAGS="-march=native -O2 -pipe"

DISTDIR="/usr/portage/distfiles"

EMERGE_DEFAULT_OPTS="--autounmask-keep-masks=y"

ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"

FCFLAGS="-O2 -pipe"

FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync webrsync-gpg xattr"

FFLAGS="-O2 -pipe"

GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/"

LANG="fr_FR.utf8"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="fr en"

MAKEOPTS="-j16"

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="X acl alsa amd64 apparmor bluetooth bzip2 crypt cxx dbus djbfft dri dri3 dvd egl experimental fat fdk glamor gles2 gnome gold graphicsmagick gtk gtk3 hardened iconv ipv6 jpeg jpeg2k libtirpc lm_sensors lto mp3 mtp ncurses networkmanager nls nptl ogg opencl openmp opus pam pcre pgo pie policykit pulseaudio readline rust seccomp smp ssl ssp symlink system-llvm systemd theora threads udev udisks unicode vorbis vpx vulkan wayland widevine x264 x265 xattr xcb 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="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="fr en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby25 ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" 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_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

```

```
 [1] x86_64-pc-linux-gnu-9.1.0 *
```

```
[1] x86_64-pc-linux-gnu-2.32 *
```

Yes i'm using the gold linker Neddy.    As i mentioned in the bug report  i disabled it for gentoo-sources, but i still had the same error.

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## DaggyStyle

 *Moonboots wrote:*   

> 
> 
> ```
> Portage 2.3.67 (python 3.6.8-final-0, default/linux/amd64/17.0/no-multilib/hardened, gcc-9.1.0, glibc-2.29-r2, 5.1.5-gentoo x86_64)
> 
> ...

 

have you cleaned the tree?

----------

## Moonboots

@ DaggyStyle @ Neddy,

I used as initially make distclean , then thanks to Marien Zwart, built with bfd linker the kernel successfully.

Pity we have appeared to have lost the ability to build with gold   :Sad:   But that life !

----------

## Ant P.

gold's been a source of hard-to-diagnose bugs since it was first introduced. I think it's irresponsible of Gentoo to be installing it at all at this point.

----------

## Moonboots

 *Ant P. wrote:*   

> gold's been a source of hard-to-diagnose bugs since it was first introduced. I think it's irresponsible of Gentoo to be installing it at all at this point.

 

Gentoo is not forcing gold on to anybody, apart from Firefox with pgo ?, even that is a matter of choice.

Apart from the ebulds which force bfd, curl is only example before which need a manual no-gold.

The problem with this gentoo-sources was a new upstream patch,previous kernels had built without incidence.

----------

## NeddySeagoon

Ant P.,

The gold linker is present but its not the default.

It mostly works but as you say, its a PITA when it doesn't.

If you turn the gold linker on system wide, Gentoo expects you to deal with it, or post here :)

----------

