summaryrefslogtreecommitdiff
path: root/arch/mips/vdso/Makefile
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@mips.com>2018-08-06 15:24:27 -0700
committerPaul Burton <paul.burton@mips.com>2018-08-06 15:53:33 -0700
commitee67855ecd9d02da348af11ec8474698b886a0e6 (patch)
tree1c5d74afd7dbbae3167eb2f59d0703965eb9e3fe /arch/mips/vdso/Makefile
parent4467f7ad7dbb0af5136fadb32dba37bc0388194f (diff)
downloadlwn-ee67855ecd9d02da348af11ec8474698b886a0e6.tar.gz
lwn-ee67855ecd9d02da348af11ec8474698b886a0e6.zip
MIPS: vdso: Allow clang's --target flag in VDSO cflags
The MIPS VDSO code filters out a subset of known-good flags from KBUILD_CFLAGS to use when building VDSO libraries. When we build using clang we need to allow the --target flag through, otherwise we'll generally attempt to build the VDSO for the architecture of the build machine rather than for MIPS. Signed-off-by: Paul Burton <paul.burton@mips.com> Patchwork: https://patchwork.linux-mips.org/patch/20154/ Cc: James Hogan <jhogan@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org
Diffstat (limited to 'arch/mips/vdso/Makefile')
-rw-r--r--arch/mips/vdso/Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index 477c463c89ec..bd79b27faa2b 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -9,6 +9,11 @@ ccflags-vdso := \
$(filter -mmicromips,$(KBUILD_CFLAGS)) \
$(filter -march=%,$(KBUILD_CFLAGS)) \
-D__VDSO__
+
+ifeq ($(cc-name),clang)
+ccflags-vdso += $(filter --target=%,$(KBUILD_CFLAGS))
+endif
+
cflags-vdso := $(ccflags-vdso) \
$(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
-O2 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \