Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390: fix linker script for 31 bit builds

Because of a change in the s390 arch backend of binutils (commit 23ecd77
"Pick the default arch depending on the target size" in binutils repo)
31 bit builds will fail since the linker would now try to create 64 bit
binary output.
Fix this by setting OUTPUT_ARCH to s390:31-bit instead of s390.
Thanks to Andreas Krebbel for figuring out the issue.

Fixes this build error:

LD init/built-in.o
s390x-4.7.2-ld: s390:31-bit architecture of input file
`arch/s390/kernel/head.o' is incompatible with s390:64-bit output

Cc: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
c985cb37 0f58aac9

+2 -2
+1 -1
arch/s390/boot/compressed/vmlinux.lds.S
··· 5 5 OUTPUT_ARCH(s390:64-bit) 6 6 #else 7 7 OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") 8 - OUTPUT_ARCH(s390) 8 + OUTPUT_ARCH(s390:31-bit) 9 9 #endif 10 10 11 11 ENTRY(startup)
+1 -1
arch/s390/kernel/vmlinux.lds.S
··· 8 8 9 9 #ifndef CONFIG_64BIT 10 10 OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") 11 - OUTPUT_ARCH(s390) 11 + OUTPUT_ARCH(s390:31-bit) 12 12 ENTRY(startup) 13 13 jiffies = jiffies_64 + 4; 14 14 #else