Skip to content

Commit 991a201

Browse files
sumanthkorikkarVasily Gorbik
authored andcommitted
s390: Fix linker error when -no-pie option is unavailable
The kernel build may fail if the linker does not support -no-pie option, as it always included in LDFLAGS_vmlinux. Error log: s390-linux-ld: unable to disambiguate: -no-pie (did you mean --no-pie ?) Although the GNU linker defaults to -no-pie, the ability to explicitly specify this option was introduced in binutils 2.36. Hence, fix it by adding -no-pie to LDFLAGS_vmlinux only when it is available. Cc: stable@vger.kernel.org Fixes: 00cda11 ("s390: Compile kernel with -fPIC and link with -no-pie") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202503220342.T3fElO9L-lkp@intel.com/ Suggested-by: Jens Remus <jremus@linux.ibm.com> Reviewed-by: Jens Remus <jremus@linux.ibm.com> Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 3232f1c commit 991a201

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ KBUILD_CFLAGS_MODULE += -fPIC
1515
KBUILD_AFLAGS += -m64
1616
KBUILD_CFLAGS += -m64
1717
KBUILD_CFLAGS += -fPIC
18-
LDFLAGS_vmlinux := -no-pie --emit-relocs --discard-none
18+
LDFLAGS_vmlinux := $(call ld-option,-no-pie) --emit-relocs --discard-none
1919
extra_tools := relocs
2020
aflags_dwarf := -Wa,-gdwarf-2
2121
KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__

0 commit comments

Comments
 (0)