* [PATCH 0/3] selftest: Fix build errors
@ 2017-06-18 0:56 SeongJae Park
2017-06-18 0:56 ` [PATCH 1/3] selftest/memfd/Makefile: Fix build error SeongJae Park
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: SeongJae Park @ 2017-06-18 0:56 UTC (permalink / raw)
To: shuah
Cc: bamvor.zhangjian, shorne, davem, linux-kselftest, netdev,
linux-kernel, SeongJae Park
This patchset fixes build errors in selftest.
SeongJae Park (3):
selftest/memfd/Makefile: Fix build error
selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS
selftest/net/Makefile: Specify output with $(OUTPUT)
tools/testing/selftests/intel_pstate/Makefile | 2 +-
tools/testing/selftests/memfd/Makefile | 2 +-
tools/testing/selftests/net/Makefile | 3 +--
3 files changed, 3 insertions(+), 4 deletions(-)
--
2.13.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] selftest/memfd/Makefile: Fix build error
2017-06-18 0:56 [PATCH 0/3] selftest: Fix build errors SeongJae Park
@ 2017-06-18 0:56 ` SeongJae Park
2017-06-18 0:56 ` [PATCH 2/3] selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS SeongJae Park
2017-06-18 0:56 ` [PATCH 3/3] selftest/net/Makefile: Specify output with $(OUTPUT) SeongJae Park
2 siblings, 0 replies; 5+ messages in thread
From: SeongJae Park @ 2017-06-18 0:56 UTC (permalink / raw)
To: shuah
Cc: bamvor.zhangjian, shorne, davem, linux-kselftest, netdev,
linux-kernel, SeongJae Park
Selftest for memfd shows build error as below:
```
gcc -D_FILE_OFFSET_BITS=64 -I../../../../include/uapi/ -I../../../../include/ -I../../../../usr/include/ fuse_mnt.c -o /home/sjpark/linux/tools/testing/selftests/memfd/fuse_mnt
/tmp/cc6NHdwJ.o: In function `main':
fuse_mnt.c:(.text+0x249): undefined reference to `fuse_main_real'
collect2: error: ld returned 1 exit status
```
The build fails because output file is specified without $(OUTPUT) and
LDFLAGS is used though Makefile implicit rule is used. This commit
fixes the error by specifying output file path with $(OUTPUT) and using
LDLIBS instead of LDFLAGS.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
tools/testing/selftests/memfd/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index 79891d033de1..ad8a0897e47f 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -7,7 +7,7 @@ TEST_PROGS := run_fuse_test.sh
TEST_GEN_FILES := memfd_test fuse_mnt fuse_test
fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
-fuse_mnt: LDFLAGS += $(shell pkg-config fuse --libs)
include ../lib.mk
+$(OUTPUT)/fuse_mnt: LDLIBS += $(shell pkg-config fuse --libs)
--
2.13.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS
2017-06-18 0:56 [PATCH 0/3] selftest: Fix build errors SeongJae Park
2017-06-18 0:56 ` [PATCH 1/3] selftest/memfd/Makefile: Fix build error SeongJae Park
@ 2017-06-18 0:56 ` SeongJae Park
2017-06-18 0:56 ` [PATCH 3/3] selftest/net/Makefile: Specify output with $(OUTPUT) SeongJae Park
2 siblings, 0 replies; 5+ messages in thread
From: SeongJae Park @ 2017-06-18 0:56 UTC (permalink / raw)
To: shuah
Cc: bamvor.zhangjian, shorne, davem, linux-kselftest, netdev,
linux-kernel, SeongJae Park
Build of aperf fails as below:
```
gcc -Wall -D_GNU_SOURCE -lm aperf.c -o /tools/testing/selftests/intel_pstate/aperf
/tmp/ccKf3GF6.o: In function `main':
aperf.c:(.text+0x278): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
```
The faulure occurs because -lm was defined as LDFLAGS and implicit rule
of make places LDFLAGS before source file. This commit fixes the
problem by using LDLIBS instead of LDFLAGS.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
tools/testing/selftests/intel_pstate/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile
index 19678e90efb2..849a90ffe8dd 100644
--- a/tools/testing/selftests/intel_pstate/Makefile
+++ b/tools/testing/selftests/intel_pstate/Makefile
@@ -1,5 +1,5 @@
CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE
-LDFLAGS := $(LDFLAGS) -lm
+LDLIBS := $(LDLIBS) -lm
TEST_GEN_FILES := msr aperf
--
2.13.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] selftest/net/Makefile: Specify output with $(OUTPUT)
2017-06-18 0:56 [PATCH 0/3] selftest: Fix build errors SeongJae Park
2017-06-18 0:56 ` [PATCH 1/3] selftest/memfd/Makefile: Fix build error SeongJae Park
2017-06-18 0:56 ` [PATCH 2/3] selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS SeongJae Park
@ 2017-06-18 0:56 ` SeongJae Park
2017-06-18 2:48 ` David Miller
2 siblings, 1 reply; 5+ messages in thread
From: SeongJae Park @ 2017-06-18 0:56 UTC (permalink / raw)
To: shuah
Cc: bamvor.zhangjian, shorne, davem, linux-kselftest, netdev,
linux-kernel, SeongJae Park
After commit a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT"),
net selftest build fails because it points output file without $(OUTPUT)
yet. This commit fixes the error.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
---
tools/testing/selftests/net/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 35cbb4cba410..f6c9dbf478f8 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -3,8 +3,6 @@
CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
CFLAGS += -I../../../../usr/include/
-reuseport_bpf_numa: LDFLAGS += -lnuma
-
TEST_PROGS := run_netsocktests run_afpackettests test_bpf.sh netdevice.sh
TEST_GEN_FILES = socket
TEST_GEN_FILES += psock_fanout psock_tpacket
@@ -13,3 +11,4 @@ TEST_GEN_FILES += reuseport_dualstack
include ../lib.mk
+$(OUTPUT)/reuseport_bpf_numa: LDFLAGS += -lnuma
--
2.13.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 3/3] selftest/net/Makefile: Specify output with $(OUTPUT)
2017-06-18 0:56 ` [PATCH 3/3] selftest/net/Makefile: Specify output with $(OUTPUT) SeongJae Park
@ 2017-06-18 2:48 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2017-06-18 2:48 UTC (permalink / raw)
To: sj38.park
Cc: shuah, bamvor.zhangjian, shorne, linux-kselftest, netdev,
linux-kernel
From: SeongJae Park <sj38.park@gmail.com>
Date: Sun, 18 Jun 2017 09:56:04 +0900
> After commit a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT"),
> net selftest build fails because it points output file without $(OUTPUT)
> yet. This commit fixes the error.
>
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
> Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT")
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-06-18 2:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-18 0:56 [PATCH 0/3] selftest: Fix build errors SeongJae Park
2017-06-18 0:56 ` [PATCH 1/3] selftest/memfd/Makefile: Fix build error SeongJae Park
2017-06-18 0:56 ` [PATCH 2/3] selftest/intel_pstate/aperf: Use LDLIBS instead of LDFLAGS SeongJae Park
2017-06-18 0:56 ` [PATCH 3/3] selftest/net/Makefile: Specify output with $(OUTPUT) SeongJae Park
2017-06-18 2:48 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).