summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@mips.com>2018-08-07 16:09:56 -0700
committerPaul Burton <paul.burton@mips.com>2018-08-07 16:16:13 -0700
commit2f0025675fe51a353e308c38fc7ee0ad75151ef2 (patch)
tree9bd23270eb0165a14e9ba3b47396703ed14dc37c
parentc6d6f4c55f5cda5a7fa5a08eede0eb289937c328 (diff)
downloadlinux-2f0025675fe51a353e308c38fc7ee0ad75151ef2.tar.bz2
MIPS: VDSO: Force link endianness
When building the VDSO with clang it appears to invoke ld without specifying endianness, even though clang itself was provided with a -EB or -EL flag. This results in the build failing due to a mismatch between the objects that are the input to ld, and the output it is attempting to create: VDSO arch/mips/vdso/vdso.so.dbg.raw mips-linux-ld: arch/mips/vdso/elf.o: compiled for a big endian system and target is little endian mips-linux-ld: arch/mips/vdso/elf.o: endianness incompatible with that of the selected emulation mips-linux-ld: failed to merge target specific data of file arch/mips/vdso/elf.o ... Work around this problem by explicitly specifying the link endianness using -Wl,-EB or -Wl,-EL when -EB or -EL are part of KBUILD_CFLAGS. This resolves the build failure when using clang, and doesn't have any negative effect on gcc. Signed-off-by: Paul Burton <paul.burton@mips.com>
-rw-r--r--arch/mips/vdso/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index bd79b27faa2b..34605ca21498 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -44,6 +44,7 @@ endif
# VDSO linker flags.
VDSO_LDFLAGS := \
-Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \
+ $(addprefix -Wl$(comma),$(filter -E%,$(KBUILD_CFLAGS))) \
-nostdlib -shared \
$(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
$(call cc-ldoption, -Wl$(comma)--build-id)