Skip to contentSkip to conversation

4.14 git: massive linker failures: cannot reach anything

DISCUSSION Meelis Roos 3 participants 5 messages Sep 11, 2017

lore
Share & tools
lore
#0 lore raw

While compiling 4.13+git on all of my gentoo parisc machines, I get tons of linking failures like below.

$ ld -v
GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
$ hppa64-linux-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/hppa2.0-unknown-linux-gnu/hppa64-unknown-linux-gnu/gcc-bin/5.4.0/hppa64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/hppa64-unknown-linux-gnu/5.4.0/lto-wrapper
Target: hppa64-unknown-linux-gnu
Configured with: 
/var/tmp/portage/sys-devel/kgcc64-5.4.0/work/gcc-5.4.0/configure 
--host=hppa2.0-unknown-linux-gnu --target=hppa64-unknown-linux-gnu 
--build=hppa2.0-unknown-linux-gnu --prefix=/usr 
--bindir=/usr/hppa2.0-unknown-linux-gnu/hppa64-unknown-linux-gnu/gcc-bin/5.4.0 
--includedir=/usr/lib/gcc/hppa64-unknown-linux-gnu/5.4.0/include 
--datadir=/usr/share/gcc-data/hppa64-unknown-linux-gnu/5.4.0 
--mandir=/usr/share/gcc-data/hppa64-unknown-linux-gnu/5.4.0/man 
--infodir=/usr/share/gcc-data/hppa64-unknown-linux-gnu/5.4.0/info 
--with-gxx-include-dir=/usr/lib/gcc/hppa64-unknown-linux-gnu/5.4.0/include/g++-v5 
--with-python-dir=/share/gcc-data/hppa64-unknown-linux-gnu/5.4.0/python 
--enable-languages=c --enable-obsolete --enable-secureplt 
--disable-werror --with-system-zlib --enable-nls 
--without-included-gettext --enable-checking=release 
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 5.4.0 p1.0' 
--enable-poison-system-directories --disable-shared 
--disable-libatomic --disable-threads --without-headers 
--disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu 
--disable-multilib --disable-altivec --disable-fixed-point 
--disable-libgcj --disable-libgomp --disable-libmudflap --disable-libssp 
--disable-libquadmath --enable-lto --without-isl --disable-libsanitizer
Thread model: single
gcc version 5.4.0 (Gentoo 5.4.0 p1.0)

hppa64-linux-ld: init/main.o(.text+0x160): cannot reach strreplace
init/main.o: In function initcall_blacklisted':(.text+0x160): relocation truncated to fit: R_PARISC_PCREL22F against symbol strreplace' defined in .text.strreplace section in lib/string.o
hppa64-linux-ld: init/main.o(.text+0x1a4): cannot reach strcmp
init/main.o: In function initcall_blacklisted':(.text+0x1a4): relocation truncated to fit: R_PARISC_PCREL22F against symbol strcmp' defined in .text.strcmp section in lib/string.o
hppa64-linux-ld: init/main.o(.text+0x22c): cannot reach __ubsan_handle_type_mismatch
init/main.o: In function initcall_blacklisted':(.text+0x22c): relocation truncated to fit: R_PARISC_PCREL22F against symbol __ubsan_handle_type_mismatch' defined in .text.__ubsan_handle_type_mismatch section in lib/ubsan.o

and so on for pages, more than my terminal scrollback provides.

Signature · 1 line
Meelis Roos ([email protected])
#1 lore raw
Quoted 35 lines · Meelis Roos

While compiling 4.13+git on all of my gentoo parisc machines, I get tons of linking failures like below.

$ ld -v
GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
$ hppa64-linux-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/hppa2.0-unknown-linux-gnu/hppa64-unknown-linux-gnu/gcc-bin/5.4.0/hppa64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/hppa64-unknown-linux-gnu/5.4.0/lto-wrapper
Target: hppa64-unknown-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/kgcc64-5.4.0/work/gcc-5.4.0/configure
--host=hppa2.0-unknown-linux-gnu --target=hppa64-unknown-linux-gnu
--build=hppa2.0-unknown-linux-gnu --prefix=/usr
--bindir=/usr/hppa2.0-unknown-linux-gnu/hppa64-unknown-linux-gnu/gcc-bin/5.4.0
--includedir=/usr/lib/gcc/hppa64-unknown-linux-gnu/5.4.0/include
--datadir=/usr/share/gcc-data/hppa64-unknown-linux-gnu/5.4.0
--mandir=/usr/share/gcc-data/hppa64-unknown-linux-gnu/5.4.0/man
--infodir=/usr/share/gcc-data/hppa64-unknown-linux-gnu/5.4.0/info
--with-gxx-include-dir=/usr/lib/gcc/hppa64-unknown-linux-gnu/5.4.0/include/g++-v5
--with-python-dir=/share/gcc-data/hppa64-unknown-linux-gnu/5.4.0/python
--enable-languages=c --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --enable-nls
--without-included-gettext --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 5.4.0 p1.0'
--enable-poison-system-directories --disable-shared
--disable-libatomic --disable-threads --without-headers
--disable-bootstrap --enable-__cxa_atexit --enable-clocale=gnu
--disable-multilib --disable-altivec --disable-fixed-point
--disable-libgcj --disable-libgomp --disable-libmudflap --disable-libssp
--disable-libquadmath --enable-lto --without-isl --disable-libsanitizer
Thread model: single
gcc version 5.4.0 (Gentoo 5.4.0 p1.0)
Quoted 8 lines

hppa64-linux-ld: init/main.o(.text+0x160): cannot reach strreplace
init/main.o: In function initcall_blacklisted':(.text+0x160): relocation truncated to fit: R_PARISC_PCREL22F against symbol strreplace' defined in .text.strreplace section in lib/string.o
hppa64-linux-ld: init/main.o(.text+0x1a4): cannot reach strcmp
init/main.o: In function initcall_blacklisted':(.text+0x1a4): relocation truncated to fit: R_PARISC_PCREL22F against symbol strcmp' defined in .text.strcmp section in lib/string.o
hppa64-linux-ld: init/main.o(.text+0x22c): cannot reach __ubsan_handle_type_mismatch
init/main.o: In function initcall_blacklisted':(.text+0x22c): relocation truncated to fit: R_PARISC_PCREL22F against symbol __ubsan_handle_type_mismatch' defined in .text.__ubsan_handle_type_mismatch section in lib/ubsan.o

and so on for pages, more than my terminal scrollback provides.

As far as gcc goes, you need to add -mlong-calls to avoid these errors.  I think there is a config option. The kernel is too big and some "b,l" branches can't reach their targets.

Dave

Signature · 1 line
John David Anglin  [email protected]
#2 lore raw
Quoted 11 lines
Quoted 8 lines

hppa64-linux-ld: init/main.o(.text+0x22c): cannot reach __ubsan_handle_type_mismatch
init/main.o: In function initcall_blacklisted':(.text+0x22c): relocation truncated to fit: R_PARISC_PCREL22F against symbol __ubsan_handle_type_mismatch' defined in .text.__ubsan_handle_type_mismatch section in lib/ubsan.o

and so on for pages, more than my terminal scrollback provides.

As far as gcc goes, you need to add -mlong-calls to avoid these errors.  I think there is a config option. The kernel is too big and some "b,l" branches can't reach their targets.

Thank you, yes, I found CONFIG_MLONGCALLS for that.

However, the next strange thing is why did custom kernels of multiple different machines grew so much (A500 UP and RP3440 SMP kernels)? My kernel configs are quite minimalistic anyway, except I include everything needed for booting (no dependenc on initramfs, so sd, scsi driver and ext4 are in). Perhaps a binary format or two, PDC stable storage and anothe IO schaduler too, and some kernel debugging options like UBSAN.

Signature · 1 line
Meelis Roos ([email protected])
#3 lore raw
Quoted 13 lines · Meelis Roos
Quoted 11 lines
Quoted 8 lines

hppa64-linux-ld: init/main.o(.text+0x22c): cannot reach __ubsan_handle_type_mismatch
init/main.o: In function initcall_blacklisted':(.text+0x22c): relocation truncated to fit: R_PARISC_PCREL22F against symbol __ubsan_handle_type_mismatch' defined in .text.__ubsan_handle_type_mismatch section in lib/ubsan.o

and so on for pages, more than my terminal scrollback provides.

As far as gcc goes, you need to add -mlong-calls to avoid these errors.  I think there is a config option. The kernel is too big and some "b,l" branches can't reach their targets.

Thank you, yes, I found CONFIG_MLONGCALLS for that.

Quoted 7 lines

However, the next strange thing is why did custom kernels of multiple different machines grew so much (A500 UP and RP3440 SMP kernels)? My kernel configs are quite minimalistic anyway, except I include everything needed for booting (no dependenc on initramfs, so sd, scsi driver and ext4 are in). Perhaps a binary format or two, PDC stable storage and anothe IO schaduler too, and some kernel debugging options like UBSAN.

UBSAN is huge.  Helge knows more about it.  I would only use it for test kernels.

Dave

Signature · 1 line
John David Anglin  [email protected]
#4 lore raw
Quoted 22 lines · John David Anglin
Quoted 13 lines · Meelis Roos
Quoted 11 lines
Quoted 8 lines

hppa64-linux-ld: init/main.o(.text+0x22c): cannot reach __ubsan_handle_type_mismatch
init/main.o: In function initcall_blacklisted':(.text+0x22c): relocation truncated to fit: R_PARISC_PCREL22F against symbol __ubsan_handle_type_mismatch' defined in .text.__ubsan_handle_type_mismatch section in lib/ubsan.o

and so on for pages, more than my terminal scrollback provides.

As far as gcc goes, you need to add -mlong-calls to avoid these errors.  I think there is a config option. The kernel is too big and some "b,l" branches can't reach their targets.

Thank you, yes, I found CONFIG_MLONGCALLS for that.

Quoted 7 lines

However, the next strange thing is why did custom kernels of multiple different machines grew so much (A500 UP and RP3440 SMP kernels)? My kernel configs are quite minimalistic anyway, except I include everything needed for booting (no dependenc on initramfs, so sd, scsi driver and ext4 are in). Perhaps a binary format or two, PDC stable storage and anothe IO schaduler too, and some kernel debugging options like UBSAN.

Quoted 1 line

UBSAN is huge.

Yes, UBSAN is huge and is probably the reason why you see so many linker errors. Beside enabling CONFIG_MLONGCALLS in the kernel, you probably need to update palo [1] to version 1.99 as well. Please remember to update palo in the boot sector on the harddisc too (run: "palo -v" once), otherwise palo may refuse to load your kernel because of it's size (even if it's compressed with gzip).

Helge

[1] https://git.kernel.org/pub/scm/linux/kernel/git/deller/palo.git/