From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (5751f4a1.skybroadband.com [87.81.244.161]) by mail.openembedded.org (Postfix) with ESMTP id 415D860809 for ; Thu, 10 Apr 2014 09:06:15 +0000 (UTC) Received: from localhost (dan.rpsys.net [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu4) with ESMTP id s3A963Db016164; Thu, 10 Apr 2014 10:06:03 +0100 X-Virus-Scanned: Debian amavisd-new at dan.rpsys.net Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id NXsbcOMGdCnT; Thu, 10 Apr 2014 10:06:02 +0100 (BST) Received: from [192.168.3.10] (rpvlan0 [192.168.3.10]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id s3A95uRF016144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 10 Apr 2014 10:05:57 +0100 Message-ID: <1397120750.24597.238.camel@ted> From: Richard Purdie To: openembedded-core Date: Thu, 10 Apr 2014 10:05:50 +0100 X-Mailer: Evolution 3.8.4-0ubuntu1 Mime-Version: 1.0 Cc: "Hart, Darren" Subject: [PATCH] perf: Fix sysroot option to CC handling X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2014 09:06:16 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit If you build perf in tree /xxx/treea, then cleansstate perf and build it in /xxx/treeb having deleted treea, the build will fail, unable to find libc. The problem is that the --sysroot option passed in through CC is missing. This works fine if the default sysroot is ok, if it isn't, things will fail. In 1.7 we'll start poisoning the default sysroot in gcc to catch this kind of issue however that doesn't fix the problem with perf. The problem is that various Makefiles set CC = $(CROSS_COMPILE)gcc. The easist fix for now is to sed out the problematic Makefile lines. Its worth noting the tools/lib/traceevent Makefile has a much more funky way of setting CC which works for us and may be the way we need to fix the other Makefiles upstream. This fixes build failures we're occasionally seen on the autobuilders. Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index 9dfccdf..ef21b6c 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb @@ -133,6 +133,18 @@ do_configure_prepend () { if [ -e "${S}/tools/perf/config/Makefile" ]; then sed -i 's,libdir = $(prefix)/$(lib),libdir = $(prefix)/${baselib},' ${S}/tools/perf/config/Makefile fi + # We need to ensure the --sysroot option in CC is preserved + if [ -e "${S}/tools/perf/Makefile.perf" ]; then + sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf + sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf + fi + if [ -e "${S}/tools/lib/api/Makefile" ]; then + sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile + sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/api/Makefile + fi + if [ -e "${S}/tools/perf/config/feature-checks/Makefile" ]; then + sed -i 's,CC := $(CROSS_COMPILE)gcc -MD,CC += -MD,' ${S}/tools/perf/config/feature-checks/Makefile + fi } python do_package_prepend() {