From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa8.bmw.c3s2.iphmx.com (esa8.bmw.c3s2.iphmx.com [68.232.139.97]) by mail.openembedded.org (Postfix) with ESMTP id EB00678A74 for ; Fri, 24 Aug 2018 14:15:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bmw.de; i=@bmw.de; q=dns/txt; s=mailing1; t=1535120115; x=1566656115; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=gWhNLsANty0hbB6TAQzEiIDSjvDgJ99/ijG78SKsZxo=; b=XvOBdPrF6tIatOKD3PuK/RpUykP0/ehezkgUTwwVf814JSlAUDPgLM56 Y3vbPix5BwYbZbbakwHfaW+CeLhfWY1dLC980fGlyfjKYFscYyPusPDDl KS/OMHGYl+DpjSxiS1M232xmDBjAen9q4AeXhJfZ2FTYRaiyGqMvm1CnI U=; Received: from esagw4.bmwgroup.com (HELO esagw4.muc) ([160.46.252.39]) by esa8.bmw.c3s2.iphmx.com with ESMTP/TLS; 24 Aug 2018 16:15:13 +0200 Received: from esabb3.muc ([160.50.100.30]) by esagw4.muc with ESMTP/TLS; 24 Aug 2018 16:15:12 +0200 Received: from smucm10j.bmwgroup.net (HELO smucm10j.europe.bmw.corp) ([160.48.96.46]) by esabb3.muc with ESMTP/TLS; 24 Aug 2018 16:15:12 +0200 Received: from smucm10k.europe.bmw.corp (160.48.96.47) by smucm10j.europe.bmw.corp (160.48.96.46) with Microsoft SMTP Server (TLS; Fri, 24 Aug 2018 16:15:12 +0200 Received: from smucm10k.europe.bmw.corp ([160.48.96.47]) by smucm10k.europe.bmw.corp ([160.48.96.47]) with mapi id 15.00.1367.000; Fri, 24 Aug 2018 16:15:12 +0200 From: To: Thread-Topic: [OE-core] [PATCH] cmake: add CMAKE_SYSROOT to generated toolchain file Thread-Index: AQHUO7TfP39PtwdlbkOrx+nUTU/G7A== Date: Fri, 24 Aug 2018 14:15:12 +0000 Message-ID: <20180824141512.GG20864@hiutale> References: <20180824123346.8602-1-pascal.bach@siemens.com> In-Reply-To: <20180824123346.8602-1-pascal.bach@siemens.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [192.168.221.33] MIME-Version: 1.0 Cc: openembedded-core@lists.openembedded.org Subject: Re: [PATCH] cmake: add CMAKE_SYSROOT to generated toolchain file 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: Fri, 24 Aug 2018 14:15:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable On Fri, Aug 24, 2018 at 02:33:46PM +0200, Pascal Bach wrote: > This already got fixed in the toolchain file that is used during developm= ent > in https://github.com/openembedded/openembedded-core/commit/cb42802f2fe17= 60f894a435b07286bca3a220364 >=20 > The toolchain file generated by the cmake.bbclass however does not set > CMAKE_SYSROOT. Under certain circumstances this also leads to the error: > `"stdlib.h: No such file or directory #include_next "` > during the build of a recipe. >=20 > An example where this accured was during the upgrade of the Apache Thrift > recipe in meta-openembedded to 0.11.0. With this change the build works o= ut of > the box. >=20 > CMAKE_SYSROOT must only be set when crosscompiling, otherwise it will int= erfere > with the native compiler headers. >=20 > Signed-off-by: Pascal Bach > --- > meta/classes/cmake.bbclass | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass > index fd40a9863e..251ddd9afe 100644 > --- a/meta/classes/cmake.bbclass > +++ b/meta/classes/cmake.bbclass > @@ -64,9 +64,12 @@ def map_target_arch_to_uname_arch(target_arch): > return "ppc64" > return target_arch > =20 > + > cmake_do_generate_toolchain_file() { > if [ "${BUILD_SYS}" =3D "${HOST_SYS}" ]; then > cmake_crosscompiling=3D"set( CMAKE_CROSSCOMPILING FALSE )" > + else > + cmake_sysroot=3D"set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" > fi > cat > ${WORKDIR}/toolchain.cmake < # CMake system name must be something like "Linux". > @@ -95,6 +98,8 @@ set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_R= OOT_PATH_MODE_PROGRAM} ) > set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) > set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) > =20 > +$cmake_sysroot > + > # Use qt.conf settings > set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf ) Fixes problems which we have also seen on sumo branch. Thanks for this! Tested-by: Mikko Rapeli =