mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <shuah@kernel.org>
To: Anders Roxell <anders.roxell@linaro.org>,
	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 <shuahkh@osg.samsung.com>,
	Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH] selftests: sync: missing CFLAGS while compiling
Date: Tue, 9 Jan 2018 17:05:03 -0700	[thread overview]
Message-ID: <7273d0ce-3548-60f7-c331-bdf9bd9a3ec2@kernel.org> (raw)
In-Reply-To: <20180105163323.22920-1-anders.roxell@linaro.org>

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 <linux/sync_file.h>
>                              ^
> 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 <Lei.Yang@windriver.com>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  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

  parent reply	other threads:[~2018-01-10  0:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05 16:33 Anders Roxell
2018-01-05 17:21 ` Naresh Kamboju
2018-01-10  0:05 ` Shuah Khan [this message]
2018-01-16 11:00   ` Anders Roxell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7273d0ce-3548-60f7-c331-bdf9bd9a3ec2@kernel.org \
    --to=shuah@kernel.org \
    --cc=Lei.Yang@windriver.com \
    --cc=anders.roxell@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pombredanne@nexb.com \
    --cc=shuahkh@osg.samsung.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome