From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934490AbbENPjt (ORCPT ); Thu, 14 May 2015 11:39:49 -0400 Received: from lists.s-osg.org ([54.187.51.154]:35486 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932684AbbENPjq (ORCPT ); Thu, 14 May 2015 11:39:46 -0400 Message-ID: <5554C1BF.7000408@osg.samsung.com> Date: Thu, 14 May 2015 09:39:43 -0600 From: Shuah Khan Organization: Samsung Open Source Group User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: Michael Ellerman , Ingo Molnar , David Ahern , Linux Kernel Mailing List , Shuah Khan Subject: Re: make -C tools clean failure on older systems References: <20150514151225.GH23588@kernel.org> In-Reply-To: <20150514151225.GH23588@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/14/2015 09:12 AM, Arnaldo Carvalho de Melo wrote: > Hi, > > In: > > ------------- > commit 67d8712dcc70aa16d8e14a52eb73870e3cbddfc2 > Author: Shuah Khan > Date: Wed Mar 18 11:57:39 2015 -0600 > > selftests: Fix build failures when invoked from kselftest target > > ------------- > > You cleaned two variables using different methods, any reason for that? > > I asked because the 'undefine' method causes it to fail in older > systems: The reason for this change is some tests fail to build when invoked from the main Makefile level. The commit log explains the change: 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. > > [acme@rhel5 linux]$ make -C tools/ clean > > CLEAN python > make[1]: Leaving directory `/home/acme/git/linux/tools/perf' > DESCEND testing/selftests > make[1]: Entering directory > `/home/acme/git/linux/tools/testing/selftests' > Makefile:30: *** missing separator. Stop. > make[1]: Leaving directory > `/home/acme/git/linux/tools/testing/selftests' > make: *** [selftests_clean] Error 2 > make: Leaving directory `/home/acme/git/linux/tools' > > ---------------------------------- > > [acme@rhel5 linux]$ make --version > GNU Make 3.81 > Copyright (C) 2006 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. > There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A > PARTICULAR PURPOSE. > > This program built for x86_64-redhat-linux-gnu > [acme@rhel5 linux]$ > > Wonder if it would be ok to use: > > diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile > index 95abddcd7839..f76830643086 100644 > --- a/tools/testing/selftests/Makefile > +++ b/tools/testing/selftests/Makefile > @@ -27,7 +27,7 @@ TARGETS_HOTPLUG += memory-hotplug > # Makefile to avoid test build failures when test > # Makefile doesn't have explicit build rules. > ifeq (1,$(MAKELEVEL)) > -undefine LDFLAGS > +override LDFLAGS = > override MAKEFLAGS = > endif I recall testing with override and remember it to not work. If you would like experiment with it, feel free to send a patch with that change. My make version is very new: make --version GNU Make 4.0 Built for x86_64-pc-linux-gnu You have to run make kselftest from the main kernel Makefile to see the build failures that undefine LDFLAGS fixed. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh@osg.samsung.com | (970) 217-8978