Skip to content

Commit

Permalink
examples/kni: fix build with pkg-config
Browse files Browse the repository at this point in the history
[ upstream commit 58a0648 ]

rm -f build/kni build/kni-static build/kni-shared
test -d build && rmdir -p build || true
[...]
/usr/bin/ld: /tmp/cc72ssnK.o: undefined reference to symbol
'pthread_join@@GLIBC_2.2.5'

This example explicitly call pthread API and should be linked against
the pthread library.

Fixes: 724beb9 ("examples/kni: monitor and update link state continually")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  • Loading branch information
david-marchand authored and kevintraynor committed Nov 23, 2020
1 parent 5567063 commit 80741c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/kni/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ CFLAGS += -DALLOW_EXPERIMENTAL_API
LDFLAGS_SHARED = $(shell $(PKGCONF) --libs libdpdk)
LDFLAGS_STATIC = -Wl,-Bstatic $(shell $(PKGCONF) --static --libs libdpdk)

LDFLAGS += -pthread

build/$(APP)-shared: $(SRCS-y) Makefile $(PC_FILE) | build
$(CC) $(CFLAGS) $(SRCS-y) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED)

Expand Down

0 comments on commit 80741c6

Please sign in to comment.