Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbeAEQdl (ORCPT + 1 other); Fri, 5 Jan 2018 11:33:41 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:41267 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbeAEQdi (ORCPT ); Fri, 5 Jan 2018 11:33:38 -0500 X-Google-Smtp-Source: ACJfBottwxLYPl44MPHn7XMOYCI4RXOWeZoTsI5grJYomHqcGm7GjFa5Vj0ehRyzvcNYWwLH843KHg== From: Anders Roxell To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, tglx@linutronix.de, kstewart@linuxfoundation.org, pombredanne@nexb.com, shuah@kernel.org, Lei.Yang@windriver.com, Anders Roxell Subject: [PATCH] selftests: sync: missing CFLAGS while compiling Date: Fri, 5 Jan 2018 17:33:23 +0100 Message-Id: <20180105163323.22920-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 ^ CFLAGS is not used during the compile step, so the system instead of kernel headers are used. Fix this by using lib.mk's compile rules and remove CFLAGS from the linking step. Reported-by: Lei Yang Signed-off-by: Anders Roxell --- tools/testing/selftests/sync/Makefile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/testing/selftests/sync/Makefile b/tools/testing/selftests/sync/Makefile index b3c8ba3cb668..58b9336d6c84 100644 --- a/tools/testing/selftests/sync/Makefile +++ b/tools/testing/selftests/sync/Makefile @@ -27,12 +27,6 @@ OBJS := $(patsubst %,$(OUTPUT)/%,$(OBJS)) TESTS := $(patsubst %,$(OUTPUT)/%,$(TESTS)) $(TEST_CUSTOM_PROGS): $(TESTS) $(OBJS) - $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) $(LDFLAGS) - -$(OBJS): $(OUTPUT)/%.o: %.c - $(CC) -c $^ -o $@ - -$(TESTS): $(OUTPUT)/%.o: %.c - $(CC) -c $^ -o $@ + $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(LDFLAGS) EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) -- 2.11.0