[PATCH] sandbox: Fix fixing linker warnings with newer ld

Sascha Hauer s.hauer at pengutronix.de
Tue Feb 21 07:24:25 PST 2023


There must be a comma between the words passed in the -Wl option,
otherwise gcc responds with:

gcc: error: noexecstack: No such file or directory

Also cc-option only compiles but doesn't link, so can't detect if the
linker accepts flags or not. Use ld-option instead.

Fixes: 4e8713dd6e ("sandbox: fix linker warnings with newer ld")
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/sandbox/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index 0f59e79e13..9d5a5d8c6a 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -69,7 +69,7 @@ BAREBOX_LDFLAGS += \
 	-Wl,-T,$(BAREBOX_LDS) \
 	-Wl,--whole-archive $(BAREBOX_OBJS) -Wl,--no-whole-archive \
 	-lrt -pthread $(SDL_LIBS) $(FTDI1_LIBS) \
-	-Wl,-z noexecstack $(call cc-option,-Wl$(comma)--no-warn-rwx-segments) \
+	-Wl,-z,noexecstack $(call ld-option,--no-warn-rwx-segments) \
 	$(SANITIZER_LIBS)
 
 cmd_barebox__ = $(CC) -o $@ $(BAREBOX_LDFLAGS)
-- 
2.30.2




More information about the barebox mailing list