Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756841AbeAJAFV (ORCPT + 1 other); Tue, 9 Jan 2018 19:05:21 -0500 Received: from mailout.easymail.ca ([64.68.200.34]:60267 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751994AbeAJAFT (ORCPT ); Tue, 9 Jan 2018 19:05:19 -0500 Reply-To: shuah@kernel.org Subject: Re: [PATCH] selftests: sync: missing CFLAGS while compiling To: Anders Roxell , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, tglx@linutronix.de, kstewart@linuxfoundation.org, pombredanne@nexb.com, Lei.Yang@windriver.com, Shuah Khan , Shuah Khan References: <20180105163323.22920-1-anders.roxell@linaro.org> From: Shuah Khan Message-ID: <7273d0ce-3548-60f7-c331-bdf9bd9a3ec2@kernel.org> Date: Tue, 9 Jan 2018 17:05:03 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180105163323.22920-1-anders.roxell@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/05/2018 09:33 AM, 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. Hmm. The changes don't match the change log. It odes more than just removing LDFLAGS from compile 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) So why not just delete $(LDFLAGS)?? $(CC) -o $(TEST_CUSTOM_PROGS) $(OBJS) $(TESTS) $(CFLAGS) > - > -$(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) > I can't take this patch the way it is. It breaks the following use-case: make O=/tmp/kselftest TARGETS=sync kselftest thanks, -- Shuah