From patchwork Sat Apr 29 17:20:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 23181 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 8E3F9C77B7F for ; Sat, 29 Apr 2023 17:21:16 +0000 (UTC) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mx.groups.io with SMTP id smtpd.web10.51589.1682788873359231542 for ; Sat, 29 Apr 2023 10:21:13 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@sakoman-com.20221208.gappssmtp.com header.s=20221208 header.b=SZfzIkci; spf=softfail (domain: sakoman.com, ip: 209.85.214.181, mailfrom: steve@sakoman.com) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1a66888cb89so8128125ad.3 for ; Sat, 29 Apr 2023 10:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20221208.gappssmtp.com; s=20221208; t=1682788872; x=1685380872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=pOiQgugVqUW7Z32fW+jXoiGv+Gjz3SUB794KgAaCLnU=; b=SZfzIkcibCeSikCdciQKDZV2ZiKqYvDHrjTJwiNDCLF2rcSEwN6qGx613TDRXyS0aK +TI4nGBEHAmEhUIrpRMlgxxoKqGvr88NTNkrNaRNhBE4wR/scpgMQOF45ym7FhnuY8YV tAYYyHL3GMiQkVdBwKd6u/9LXCzL8SIo4xUjFOGk3qPN2o3WMNOzz0imuNzVj2yze8yL qRxa/m0Y/BTjL37ZyddAcAy267O05zfLNC+y/Id6GuHpCFzK0yXRLvw2AAWijgiqibed Xfd5peftXNFVtk5euFeJ3JCAgmfnBagjd0LJ6SZn9m7jMCD4kr8ToU+zhYKe4s8Lxdi9 KUPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682788872; x=1685380872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pOiQgugVqUW7Z32fW+jXoiGv+Gjz3SUB794KgAaCLnU=; b=Y41Wj9ZXvN692/WLIgJPZZBQJ6DC/GSummHy1Li1KYjDMr9rfM0X0vzZT6ecT3vCzu 0ccpDZiQtWJoLUf8dVGZTwT2aeSrCMSUaLxL35SeOtO1WtFSQrWfXQDef0drljmWbGud pJEP/+FAv3F+I2qNQGMsgBO5Ui2OeDQx1gf9JH9iYZwZuXy87nBTghlALEQwo6yEijV/ UFVgQR2NrQzQ2ckwrF52Gq3q1pVoopnU7aJsC7/ZBjFKg63ig9UPRyd9RokH4H6WN8sJ P2y+L1WmkYdwsMFURbp/wdHi9DvcmE783E8IJH1EOdiuyWyO2usr3U7mDRCaQ5rdWvMp ctqg== X-Gm-Message-State: AC+VfDxjaENFEeDgjZPrvPKVqBauJW56XXYcAkgCquXEoizNcXHYWODF FOqLpcFy6TfjWvbJHb96chaqrTO3Z+yuz2bnLU4= X-Google-Smtp-Source: ACHHUZ75CA/5CmlqVegk2+2Qc2IIf1ruq+RXU85+ViAFMZG0DcVlDCRSuaYsWsA8u0M/ueIvChTaPg== X-Received: by 2002:a17:902:db03:b0:1a6:e1ac:ecb8 with SMTP id m3-20020a170902db0300b001a6e1acecb8mr11853526plx.43.1682788872441; Sat, 29 Apr 2023 10:21:12 -0700 (PDT) Received: from hexa.lan (rrcs-66-91-142-162.west.biz.rr.com. [66.91.142.162]) by smtp.gmail.com with ESMTPSA id c3-20020a170902d90300b001a6b9c42dbasm15156041plz.88.2023.04.29.10.21.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Apr 2023 10:21:12 -0700 (PDT) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][kirkstone 11/13] cmake: add CMAKE_SYSROOT to generated toolchain file Date: Sat, 29 Apr 2023 07:20:31 -1000 Message-Id: <1105c67d554bcd155e8247cb16efc8d6a642444f.1682788726.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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 ; Sat, 29 Apr 2023 17:21:16 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/180554 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: Steve Sakoman --- meta/classes/cmake.bbclass | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index d9bcddbdbb..7ec6ca58fc 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass @@ -85,9 +85,12 @@ def map_host_arch_to_uname_arch(host_arch): return "ppc64" return 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 <