Skip to content

Commit

Permalink
libxdp: add forgotten LDFLAGS
Browse files Browse the repository at this point in the history
Hardening flags are skipped in the Debian build and it thus fails:

$ blhc --debian --line-numbers --color ${SALSA_CI_BLHC_ARGS} ${WORKING_DIR}/*.build || [ $? -eq 1 ]
140:LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -r -nostdlib -Wl,-z,noexecstack,--format=binary -o xsk_def_xdp_prog.embed.o xsk_def_xdp_prog.o
143:LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -r -nostdlib -Wl,-z,noexecstack,--format=binary -o xsk_def_xdp_prog_5.3.embed.o xsk_def_xdp_prog_5.3.o
150:LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -r -nostdlib -Wl,-z,noexecstack,--format=binary -o xdp-dispatcher.embed.o xdp-dispatcher.o

Fixes: 69a6939 ("libxdp: fix build with clang 18")

Signed-off-by: Luca Boccassi <[email protected]>
  • Loading branch information
bluca authored and tohojo committed Jan 13, 2025
1 parent cd66f66 commit 3d4fa44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libxdp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ $(TEMPLATED_SOURCES): %.c: %.c.in Makefile
$(QUIET_M4)$(M4) $(DEFINES) $< > $@ || ( ret=$$?; rm -f $@; exit $$ret )

$(EMBEDDED_XDP_OBJS): %.embed.o: %.o
$(QUIET_CC)$(CC) -r -nostdlib -Wl,-z,noexecstack,--format=binary -o $@ $<
$(QUIET_CC)$(CC) -r -nostdlib -Wl,-z,noexecstack,--format=binary $(LDFLAGS) -o $@ $<
$(Q)$(OBJCOPY) --rename-section .data=.rodata,alloc,load,readonly,data,contents $@

$(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(LIBMK)
Expand Down

0 comments on commit 3d4fa44

Please sign in to comment.