selftests: fix compile error for sync
PATCH 1/1 selftests: fix compile error for sync
I got below error message when building sync test:
make[1]: Entering directory `tools/testing/selftests/sync' gcc -c sync.c -o tools/testing/selftests/sync/sync.o sync.c:42:29: fatal error: linux/sync_file.h: No such file or directory
#include <linux/sync_file.h>
obviously, CFLAGS and LDFLAGS are not used when comipling.
--- tools/testing/selftests/sync/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/sync/Makefile +2 -2
@@ -29,9 +29,9 @@ $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS) $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS) $(OBJS): $(OUTPUT)/%.o: %.c - $(CC) -c $^ -o $@ + $(CC) -c $^ -o $@ $(CFLAGS) $(LDFLAGS) $(TESTS): $(OUTPUT)/%.o: %.c - $(CC) -c $^ -o $@ + $(CC) -c $^ -o $@ $(CFLAGS) $(LDFLAGS) EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS)
Signature · 1 line
1.9.1
Quoted 21 lines · Lei Yang
I got below error message when building sync test:
make[1]: Entering directory `tools/testing/selftests/sync' gcc -c
sync.c-otools/testing/selftests/sync/sync.osync.c:42:29: fatal error:linux/sync_file.h: No such file or directory
#include <linux/sync_file.h>obviously, CFLAGS and LDFLAGS are not used when comipling.
Signed-off-by Lei Yang <[email protected]>--- tools/testing/selftests/sync/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/testing/selftests/sync/Makefile +0
-0@@ -29,9 +29,9 @@ $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS) $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS)
tools/testing/selftests/sync/Makefile $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS) · line 37
Quoted 10 lines
tools/testing/selftests/sync/Makefile +2
-2$(OBJS): $(OUTPUT)/%.o: %.c - $(CC) -c $^ -o $@ + $(CC) -c $^ -o $@ $(CFLAGS) $(LDFLAGS) $(TESTS): $(OUTPUT)/%.o: %.c - $(CC) -c $^ -o $@ + $(CC) -c $^ -o $@ $(CFLAGS) $(LDFLAGS) EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS)
How are you building the test? I am not seeing the error on linux-4.14.0-rc8
thanks,
-- Shuah
Quoted 26 lines · Shuah Khan
Quoted 25 lines · Lei Yang
I got below error message when building sync test:
make[1]: Entering directory `tools/testing/selftests/sync' gcc -c
sync.c-otools/testing/selftests/sync/sync.osync.c:42:29: fatal error:linux/sync_file.h: No such file or directory
#include <linux/sync_file.h>obviously, CFLAGS and LDFLAGS are not used when comipling.
Signed-off-by Lei Yang <[email protected]>--- tools/testing/selftests/sync/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/testing/selftests/sync/Makefile +1
-1@@ -29,9 +29,9 @@ $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS) $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS) $(OBJS): $(OUTPUT)/%.o: %.c - $(CC) -c $^ -o $@ + $(CC) -c $^ -o $@ $(CFLAGS) $(LDFLAGS)
Quoted 7 lines
tools/testing/selftests/sync/Makefile $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS) · line 37
Quoted 6 lines
tools/testing/selftests/sync/Makefile +1
-1$(TESTS): $(OUTPUT)/%.o: %.c - $(CC) -c $^ -o $@ + $(CC) -c $^ -o $@ $(CFLAGS) $(LDFLAGS) EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS)How are you building the test? I am not seeing the error on linux-4.14.0-rc8
make -C tools/testing/selftests
Lei
Quoted 6 lines
thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 34 lines · lei yang
Quoted 15 lines · Shuah Khan
Quoted 14 lines · Lei Yang
I got below error message when building sync test:
make[1]: Entering directory `tools/testing/selftests/sync' gcc -c
sync.c-otools/testing/selftests/sync/sync.osync.c:42:29: fatal error:linux/sync_file.h: No such file or directory #include <linux/sync_file.h>obviously, CFLAGS and LDFLAGS are not used when comipling.
Signed-off-by Lei Yang <Lei.Yang at windriver.com>---
tools/testing/selftests/sync/Makefile| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)Quoted 15 lines
Quoted 6 lines
tools/testing/selftests/sync/Makefile +0
-0@@ -29,9 +29,9 @@ $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS) $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS)Quoted 8 lines
$(OBJS): $(OUTPUT)/%.o: %.c
- $(CC) -c $^ -o $@
+ $(CC) -c $^ -o $@ $(CFLAGS) $(LDFLAGS) $(TESTS): $(OUTPUT)/%.o: %.c
- $(CC) -c $^ -o $@
+ $(CC) -c $^ -o $@ $(CFLAGS) $(LDFLAGS)EXTRA_CLEAN:= $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS)How are you building the test? I am not seeing the error on linux-4.14.0-rc8
Quoted 5 lines
make -C
tools/testing/selftestsLei
Based on the information in your other emails, looks like you are testing these patches on
$ cat /proc/version Linux version 3.16.0-30-generic (buildd at kissel) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015
That explains why you aren't finding sync_file.h header. This test isn't applicable to Linux 3.16. In any case, I can't take patches that aren't tested on the latest kernel release. 3.16 is very old.
thanks,
-- Shuah
--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html