Skip to content

Commit 72cf3b3

Browse files
nathanchancepaulburton
authored andcommitted
MIPS: vdso: Wrap -mexplicit-relocs in cc-option
Clang does not support this option and errors out: clang-11: error: unknown argument: '-mexplicit-relocs' Clang does not appear to need this flag like GCC does because the jalr check that was added in commit 976c23a ("mips: vdso: add build time check that no 'jalr t9' calls left") passes just fine with $ make ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu- malta_defconfig arch/mips/vdso/ even before commit d3f703c ("mips: vdso: fix 'jalr t9' crash in vdso code"). -mrelax-pic-calls has been supported since clang 9, which is the earliest version that could build a working MIPS kernel, and it is the default for clang so just leave it be. Fixes: d3f703c ("mips: vdso: fix 'jalr t9' crash in vdso code") Link: ClangBuiltLinux#890 Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected]
1 parent bef8e2d commit 72cf3b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/vdso/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif
3333
cflags-vdso := $(ccflags-vdso) \
3434
$(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
3535
-O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
36-
-mrelax-pic-calls -mexplicit-relocs \
36+
-mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
3737
-fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
3838
$(call cc-option, -fno-asynchronous-unwind-tables) \
3939
$(call cc-option, -fno-stack-protector)

0 commit comments

Comments
 (0)