Skip to content

Commit

Permalink
selftests: sync: missing CFLAGS while compiling
Browse files Browse the repository at this point in the history
Based on patch: https://patchwork.kernel.org/patch/10042045/

arch64-linux-gnu-gcc -c sync.c -o sync/sync.o
sync.c:42:29: fatal error: linux/sync_file.h: No such file or directory
 #include <linux/sync_file.h>
                             ^
CFLAGS is not used during the compile step, so the system instead of
kernel headers are used.  Fix this by adding CFLAGS to the OBJS compile
rule.

Reported-by: Lei Yang <Lei.Yang@windriver.com>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
  • Loading branch information
Anders Roxell authored and Shuah Khan committed Feb 13, 2018
1 parent 7928b2c commit b2c93e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/sync/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $(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)

$(TESTS): $(OUTPUT)/%.o: %.c
$(CC) -c $^ -o $@
Expand Down

0 comments on commit b2c93e3

Please sign in to comment.