diff --git a/arch/um/Makefile b/arch/um/Makefile index 937639edc295..d930c5f25fb9 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -134,9 +134,10 @@ LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc # Avoid binutils 2.39+ warnings by marking the stack non-executable and # ignorning warnings for the kallsyms sections. LDFLAGS_EXECSTACK = -z noexecstack -ifeq ($(CONFIG_LD_IS_BFD),y) -LDFLAGS_EXECSTACK += $(call ld-option,--no-warn-rwx-segments) -endif +# check --no-warn-rwx-segments with CC-as-linker since that gets used +# for vmlinux and is where we need the option, in particular with LLVM=1 +# it might be different links (ld.bfd vs. ld.lld) +LDFLAGS_EXECSTACK += $(call try-run,$(CC) -Wl$(comma)--no-warn-rwx-segments -shared -x c /dev/null -o "$$TMP",--no-warn-rwx-segments) LD_FLAGS_CMDLINE = $(foreach opt,$(KBUILD_LDFLAGS) $(LDFLAGS_EXECSTACK),-Wl,$(opt))