Skip to content

Commit 826eb9b

Browse files
0x7f454c46davem330
authored andcommitted
selftest/tcp-ao: Rectify out-of-tree build
Trivial fix for out-of-tree build that I wasn't testing previously: 1. Create a directory for library object files, fixes: > gcc lib/kconfig.c -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing -I ../../../../../usr/include/ -iquote /tmp/kselftest/kselftest/net/tcp_ao/lib -I ../../../../include/ -o /tmp/kselftest/kselftest/net/tcp_ao/lib/kconfig.o -c > Assembler messages: > Fatal error: can't create /tmp/kselftest/kselftest/net/tcp_ao/lib/kconfig.o: No such file or directory > make[1]: *** [Makefile:46: /tmp/kselftest/kselftest/net/tcp_ao/lib/kconfig.o] Error 1 2. Include $(KHDR_INCLUDES) that's exported by selftests/Makefile, fixes: > In file included from lib/kconfig.c:6: > lib/aolib.h:320:45: warning: ‘struct tcp_ao_add’ declared inside parameter list will not be visible outside of this definition or declaration > 320 | extern int test_prepare_key_sockaddr(struct tcp_ao_add *ao, const char *alg, > | ^~~~~~~~~~ ... 3. While at here, clean-up $(KSFT_KHDR_INSTALL): it's not needed anymore since commit f2745dc ("selftests: stop using KSFT_KHDR_INSTALL") 4. Also, while at here, drop .DEFAULT_GOAL definition: that has a self-explaining comment, that was valid when I made these selftests compile on local v4.19 kernel, but not needed since commit 8ce72dc ("selftests: fix headers_install circular dependency") Fixes: cfbab37 ("selftests/net: Add TCP-AO library") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Signed-off-by: Dmitry Safonov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 45248f2 commit 826eb9b

File tree

1 file changed

+3
-6
lines changed
  • tools/testing/selftests/net/tcp_ao

1 file changed

+3
-6
lines changed

tools/testing/selftests/net/tcp_ao/Makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@ TEST_IPV6_PROGS := $(TEST_BOTH_AF:%=%_ipv6)
1717
TEST_GEN_PROGS := $(TEST_IPV4_PROGS) $(TEST_IPV6_PROGS)
1818

1919
top_srcdir := ../../../../..
20-
KSFT_KHDR_INSTALL := 1
2120
include ../../lib.mk
2221

2322
HOSTAR ?= ar
2423

25-
# Drop it on port to linux/master with commit 8ce72dc32578
26-
.DEFAULT_GOAL := all
27-
2824
LIBDIR := $(OUTPUT)/lib
2925
LIB := $(LIBDIR)/libaotst.a
3026
LDLIBS += $(LIB) -pthread
3127
LIBDEPS := lib/aolib.h Makefile
3228

3329
CFLAGS := -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing
34-
CFLAGS += -I ../../../../../usr/include/ -iquote $(LIBDIR)
35-
CFLAGS += -I ../../../../include/
30+
CFLAGS += $(KHDR_INCLUDES)
31+
CFLAGS += -iquote ./lib/ -I ../../../../include/
3632

3733
# Library
3834
LIBSRC := kconfig.c netlink.c proc.c repair.c setup.c sock.c utils.c
@@ -43,6 +39,7 @@ $(LIB): $(LIBOBJ)
4339
$(HOSTAR) rcs $@ $^
4440

4541
$(LIBDIR)/%.o: ./lib/%.c $(LIBDEPS)
42+
mkdir -p $(LIBDIR)
4643
$(CC) $< $(CFLAGS) $(CPPFLAGS) -o $@ -c
4744

4845
$(TEST_GEN_PROGS): $(LIB)

0 commit comments

Comments
 (0)