Skip to content

Commit

Permalink
libxdp: fix build with clang 18
Browse files Browse the repository at this point in the history
Use compiler to link.  While here, retire LD from configure since this
is not used anymore

Signed-off-by: Renato Botelho do Couto <renato@netgate.com>
  • Loading branch information
rbgarga authored and tohojo committed Dec 12, 2024
1 parent afb3d58 commit 69a6939
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ check_toolchain()

: ${PKG_CONFIG:=pkg-config}
: ${CC=gcc}
: ${LD=ld}
: ${OBJCOPY=objcopy}
: ${CLANG=clang}
: ${LLC=llc}
Expand All @@ -73,7 +72,7 @@ check_toolchain()
CLANG=$(find_tool clang "$CLANG")
LLC=$(find_tool llc "$LLC")

for TOOL in $PKG_CONFIG $CC $LD $OBJCOPY $CLANG $LLC $M4 $READELF; do
for TOOL in $PKG_CONFIG $CC $OBJCOPY $CLANG $LLC $M4 $READELF; do
if [ ! $(command -v ${TOOL} 2>/dev/null) ]; then
echo "*** ERROR: Cannot find tool ${TOOL}" ;
exit 1;
Expand Down Expand Up @@ -130,7 +129,6 @@ check_toolchain()

echo "PKG_CONFIG:=${PKG_CONFIG}" >>$CONFIG
echo "CC:=${CC}" >>$CONFIG
echo "LD:=${LD}" >>$CONFIG
echo "OBJCOPY:=${OBJCOPY}" >>$CONFIG
echo "CLANG:=${CLANG}" >>$CONFIG
echo "LLC:=${LLC}" >>$CONFIG
Expand Down
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_GEN)$(LD) -r -b binary -o $@ -z noexecstack --format=binary $<
$(QUIET_CC)$(CC) -r -nostdlib -Wl,-z,noexecstack,--format=binary -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 69a6939

Please sign in to comment.