Skip to content

Commit 7742219

Browse files
hcahcajfvogel
authored andcommitted
s390/decompressor: fix misaligned symbol build error
commit 938f0c3 upstream. Nathan Chancellor reported a kernel build error on Fedora 39: $ clang --version | head -1 clang version 16.0.5 (Fedora 16.0.5-1.fc39) $ s390x-linux-gnu-ld --version | head -1 GNU ld version 2.40-1.fc39 $ make -skj"$(nproc)" ARCH=s390 CC=clang CROSS_COMPILE=s390x-linux-gnu- olddefconfig all s390x-linux-gnu-ld: arch/s390/boot/startup.o(.text+0x5b4): misaligned symbol `_decompressor_end' (0x35b0f) for relocation R_390_PC32DBL make[3]: *** [.../arch/s390/boot/Makefile:78: arch/s390/boot/vmlinux] Error 1 It turned out that the problem with misaligned symbols on s390 was fixed with commit 80ddf5c ("s390: always build relocatable kernel") for the kernel image, but did not take into account that the decompressor uses its own set of CFLAGS, which come without -fPIE. Add the -fPIE flag also to the decompresser CFLAGS to fix this. Reported-by: Nathan Chancellor <[email protected]> Tested-by: Nathan Chancellor <[email protected]> Reported-by: CKI <[email protected]> Suggested-by: Ulrich Weigand <[email protected]> Link: ClangBuiltLinux/linux#1747 Link: https://lore.kernel.org/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit b45a33897f5410a2c0f66c51224b4a7558a96ce9) Signed-off-by: Jack Vogel <[email protected]>
1 parent f3b3a75 commit 7742219

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/s390/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ KBUILD_CFLAGS_DECOMPRESSOR += -fno-delete-null-pointer-checks -msoft-float -mbac
2929
KBUILD_CFLAGS_DECOMPRESSOR += -fno-asynchronous-unwind-tables
3030
KBUILD_CFLAGS_DECOMPRESSOR += -ffreestanding
3131
KBUILD_CFLAGS_DECOMPRESSOR += -fno-stack-protector
32+
KBUILD_CFLAGS_DECOMPRESSOR += -fPIE
3233
KBUILD_CFLAGS_DECOMPRESSOR += $(call cc-disable-warning, address-of-packed-member)
3334
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO),-g)
3435
KBUILD_CFLAGS_DECOMPRESSOR += $(if $(CONFIG_DEBUG_INFO_DWARF4), $(call cc-option, -gdwarf-4,))

0 commit comments

Comments
 (0)