Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752348AbeAERVn (ORCPT + 1 other); Fri, 5 Jan 2018 12:21:43 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:44401 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbeAERVl (ORCPT ); Fri, 5 Jan 2018 12:21:41 -0500 X-Google-Smtp-Source: ACJfBosoE/HrzdOFqErUq/den8SqgZ5N6FtZu2klpDrbhuXtkEKU8CNR0tgv57dOo6GLCjxmjwNq8jMm+JsD+7tO5MU= MIME-Version: 1.0 In-Reply-To: <20180105163323.22920-1-anders.roxell@linaro.org> References: <20180105163323.22920-1-anders.roxell@linaro.org> From: Naresh Kamboju Date: Fri, 5 Jan 2018 22:51:38 +0530 Message-ID: Subject: Re: [PATCH] selftests: sync: missing CFLAGS while compiling To: Anders Roxell Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Thomas Gleixner , kstewart@linuxfoundation.org, pombredanne@nexb.com, Shuah Khan , lyang0 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 5 January 2018 at 22:03, Anders Roxell wrote: > 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 Tested-by: Naresh Kamboju > --- > 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 >