From: Shuah Khan <shuahkh@osg.samsung.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
Shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [PATCH] selftests: Fix build failures when invoked from kselftest target
Date: Wed, 18 Mar 2015 10:46:39 -0600 [thread overview]
Message-ID: <5509ABEF.1030203@osg.samsung.com> (raw)
In-Reply-To: <1426466329.21900.2.camel@ellerman.id.au>
On 03/15/2015 06:38 PM, Michael Ellerman wrote:
> On Fri, 2015-03-13 at 19:45 -0600, Shuah Khan wrote:
>> Several tests that rely on implicit build rules fail to build,
>> when invoked from the main Makefile kselftest target. These
>> failures are due to --no-builtin-rules and --no-builtin-variables
>> options set in the inherited MAKEFLAGS.
>>
>> --no-builtin-rules eliminates the use of built-in implicit rules
>> and --no-builtin-variables is for not defining built-in variables.
>> These two options override the use of implicit rules resulting in
>> build failures. In addition, inherited LDFLAGS result in build
>> failures and there is no need to define LDFLAGS. Clear LDFLAGS
>> and MAKEFLAG when make is invoked from the main Makefile kselftest
>> target. Fixing this at selftests Makefile avoids changing the main
>> Makefile and keeps this change self contained at selftests level.
>>
>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>> ---
>> tools/testing/selftests/Makefile | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
>> index 4e51122..8e09db7 100644
>> --- a/tools/testing/selftests/Makefile
>> +++ b/tools/testing/selftests/Makefile
>> @@ -22,6 +22,15 @@ TARGETS += vm
>> TARGETS_HOTPLUG = cpu-hotplug
>> TARGETS_HOTPLUG += memory-hotplug
>>
>> +# Clear LDFLAGS and MAKEFLAGS if called from main
>> +# Makefile to avoid test build failures when test
>> +# Makefile doesn't have explicit build rules.
>> +ifeq (1,$(MAKELEVEL))
>> +undefine LDFLAGS
>> +override define MAKEFLAGS =
>> +endef
>> +endif
>
> You shouldn't need to use define/endef here, that is just for multi-line
> variables.
>
> This should be equivalent:
>
> ifeq (1,$(MAKELEVEL))
> undefine LDFLAGS
> override MAKEFLAGS =
> endif
>
ok. Will send a patch v2 with that change.
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
prev parent reply other threads:[~2015-03-18 16:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-14 1:45 Shuah Khan
2015-03-14 1:45 ` [PATCH] selftests: Fix kcmp build to not require headers install Shuah Khan
2015-03-16 11:00 ` Michael Ellerman
2015-03-18 15:04 ` Shuah Khan
2015-03-19 0:02 ` Michael Ellerman
2015-03-19 0:18 ` Shuah Khan
2015-03-19 0:51 ` Michael Ellerman
2015-03-16 0:38 ` [PATCH] selftests: Fix build failures when invoked from kselftest target Michael Ellerman
2015-03-18 16:46 ` Shuah Khan [this message]
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=5509ABEF.1030203@osg.samsung.com \
--to=shuahkh@osg.samsung.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpe@ellerman.id.au \
/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