From patchwork Fri Apr 21 07:09:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Poonam Jadhav X-Patchwork-Id: 22823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 790AAC7618E for ; Fri, 21 Apr 2023 07:15:20 +0000 (UTC) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mx.groups.io with SMTP id smtpd.web11.6139.1682061313016448142 for ; Fri, 21 Apr 2023 00:15:13 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=Be/hyBn/; spf=pass (domain: gmail.com, ip: 209.85.210.170, mailfrom: ppjadhav456@gmail.com) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-63d4595d60fso12503882b3a.0 for ; Fri, 21 Apr 2023 00:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682061312; x=1684653312; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UIrqWMI7++v+/UUfrjZ0PIjY0lUGx2fMddpY7lMSpOk=; b=Be/hyBn/WzUnlxYgt4xLwHqmsoANhSd6LtjyU/u0nKubgumwFnFodKbi6w+BADdyGL /rVcxkF5GReQONQ8gjqbFwMi5HNbrYyaiQPXNSPBaUmqCY7n6S4+59Wxr8jzyf+8zYpf GMCdQIkziUADHbRzsumniazM+WdavdgF/OhwQPy6OhbWya7/DTGDBZ6EnExsjX3rzvv1 WbAo7Dj8ty6wXjbH95tpQn6WSJiD/hz4QN9itAxZKoq6ZhHL/pDS/Mg8C2bNVbzFylYF yDuaMPETuUKHiEXcU7JDgRbtJcRxy5S3CJtDRZRCgFOcy+wjiHqSmBDU00oXrKty/gUf 6FYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682061312; x=1684653312; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UIrqWMI7++v+/UUfrjZ0PIjY0lUGx2fMddpY7lMSpOk=; b=OeYNKaNfdGwNeBaJFcA/oUQ2O4SdAXG8GtCspxXvvzU8FYiymL6jLX10/IZS4hYkVf PJB0+0Lp3y0Y0nUZ2W816IFHoLUM+8CMI7Oo0nQZeCuXK8rlO/Iwdfz9Y8jQ8g++UUtp 7Ynos4XePUz9yJGgtpP/nr2a2d0qtkfTXrUBUuUsfppKy6YDydzwh5MeGDQZklGigoZZ IXyWtjCST95JCfqntvmzUucrggYAPMkyPKXq4VZYDmEBs4R8GhLypu2BmxMZMyEQsJQW KIB411V5DJPDbUMgt6bn4sxbKSF62tkMhKGyczPbkM8Ickg9+82lmZ0mGy8U37saPLJn 0Y3g== X-Gm-Message-State: AAQBX9eKvxeeD3vx8EFArAugyVGnkA88zJlh7IAgYht8/8BiGHLZrvgI 9TM14fY5FKidjeQdDHyzDj8XTLPGKWaTtA== X-Google-Smtp-Source: AKy350ZXTHuSOkShyN98TAMfSypFnHRd43mLxl+DJDvOpN/AQOlqGRUUQWMhkT98ucqI+QyeczDVlQ== X-Received: by 2002:a17:903:294c:b0:1a6:846f:90cb with SMTP id li12-20020a170903294c00b001a6846f90cbmr7549873plb.11.1682061311711; Fri, 21 Apr 2023 00:15:11 -0700 (PDT) Received: from localhost.localdomain ([38.41.69.0]) by smtp.gmail.com with ESMTPSA id a13-20020a170902ee8d00b001a66bf1406bsm2144354pld.144.2023.04.21.00.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 00:15:11 -0700 (PDT) From: Poonam Jadhav To: openembedded-core@lists.openembedded.org, poonam.jadhav@kpit.com Cc: ranjitsinh.rathod@kpit.com, Pascal Bach , Mikko Rapeli , Poonam Jadhav Subject: [OE-core][master][PATCH] cmake: add CMAKE_SYSROOT to generated toolchain file Date: Fri, 21 Apr 2023 12:39:47 +0530 Message-Id: <20230421070947.32523-1-ppjadhav456@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 21 Apr 2023 07:15:20 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/180278 From: Pascal Bach This already got fixed in the toolchain file that is used during development in https://github.com/openembedded/openembedded-core/commit/cb42802f2fe1760f894a435b07286bca3a220364 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. 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 out of the box. CMAKE_SYSROOT must only be set when crosscompiling, otherwise it will interfere with the native compiler headers. Signed-off-by: Pascal Bach (from http://lists.openembedded.org/pipermail/openembedded-core/2018-August/154791.html ) Signed-off-by: Mikko Rapeli Signed-off-by: Poonam Jadhav Signed-off-by: Poonam Jadhav --- meta/classes-recipe/cmake.bbclass | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/classes-recipe/cmake.bbclass b/meta/classes-recipe/cmake.bbclass index 554b948c32..301367b515 100644 --- a/meta/classes-recipe/cmake.bbclass +++ b/meta/classes-recipe/cmake.bbclass @@ -94,6 +94,8 @@ def map_host_arch_to_uname_arch(host_arch): cmake_do_generate_toolchain_file() { if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )" + else + cmake_sysroot="set( CMAKE_SYSROOT \"${RECIPE_SYSROOT}\" )" fi cat > ${WORKDIR}/toolchain.cmake <