From patchwork Fri Oct 20 09:41:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Talel BELHADJ SALEM X-Patchwork-Id: 32626 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 20CA6CDB47E for ; Fri, 20 Oct 2023 09:41:37 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web11.50762.1697794891025678906 for ; Fri, 20 Oct 2023 02:41:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Q26mU6gc; spf=pass (domain: gmail.com, ip: 209.85.128.43, mailfrom: bhstalel@gmail.com) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40651a72807so4583555e9.1 for ; Fri, 20 Oct 2023 02:41:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697794889; x=1698399689; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UUGM0SFW8d2ocIocFdgFtMCyCwUYtBf0kbINboCyB3A=; b=Q26mU6gcDqQs6iepmMDffMBYfx0R4bigk3mSZ19NVIbT3kZR980QlTZs7iPW9AD80r 9TupihVAhFjXyeOezz5NeimYJbyj5Tro9sO9aZaVOJHrDpWWWLUH3UwzImde9eC2Sdqb BJiO/RMAICWXAc+bzm9Yn/FycpXcuBdwgcpltqWDyDASRWXI3LR+Zq3M2v8jcqzN7c56 zc7phH6w2ZbeZFo8vJEY3n+uPUQBqRKqcbZyRJ0UZg98XzHVWNYYBn79Fvy6t+MCSBVH biHtig/tODReGCgtw4FeVWX/EMTmk6sJpf+JtGgXgTX6NZ/rcwmulCzCnaqQxzxamonb 4l/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697794889; x=1698399689; 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=UUGM0SFW8d2ocIocFdgFtMCyCwUYtBf0kbINboCyB3A=; b=tGBySj3t6ynXsN1stIQjE9qHeKdgd1N6r9ka2R2iGUGPzJsDiHriCvgiF1nrulQmEE F5WCZqt/eVOzftbUOzLCmRyIjKIcM8CbvAiOhBrD5Y3e9TeIic3sqStjjUpLfAD01HKr 3tXiHeoW35ALTb3exPRT5ugAtgi9GVmnnyQQikFfmv4slyR8eU7hNvqCL4/1Fc67jta/ ZUSzW1GUFaMqPBQ+Gl0bsV+rRVnjN2QRumeNqncSKDjiy8D7NuSY+fIoozRq6F14/H7q i9THoIINe2ZnTDw6z3+jlcDHGRcw7YKPGSvEMWKErr65V9sea0/A7jANFwNrV+fsLEyA EmkQ== X-Gm-Message-State: AOJu0Yz9O8Q+zkFoOVpRHUoGRFUoVcZL1ql70ebjEuIkQ/JPPD/rgTWA XSLdxCueGGT/prQQjLWFWWSjApNMwXw= X-Google-Smtp-Source: AGHT+IFv7C8Ob+gQcFzu1PTGMXOSTYmxAu3R+a0o569iu4MhN4NQYhd9sJv3/631fUB8iwA6B/4/cQ== X-Received: by 2002:a05:600c:1c01:b0:405:1c14:9227 with SMTP id j1-20020a05600c1c0100b004051c149227mr1053696wms.33.1697794888880; Fri, 20 Oct 2023 02:41:28 -0700 (PDT) Received: from talel.sofia.local ([41.225.25.106]) by smtp.gmail.com with ESMTPSA id 1-20020a05600c228100b0040596352951sm6433452wmf.5.2023.10.20.02.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:41:28 -0700 (PDT) From: Talel BELHAJSALEM To: docs@lists.yoctoproject.org Cc: Talel BELHAJSALEM Subject: [PATCH 1/3] ref-manual: variables: Add RECIPE_SYSROOT and RECIPE_SYSROOT_NATIVE Date: Fri, 20 Oct 2023 10:41:00 +0100 Message-Id: <20231020094102.414940-1-bhstalel@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, 20 Oct 2023 09:41:37 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/4437 Signed-off-by: Talel BELHAJSALEM --- documentation/ref-manual/variables.rst | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 26a5aed82..b00445946 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -6971,6 +6971,36 @@ system and gives an overview of their function and contents. in the ":ref:`ref-manual/devtool-reference:checking on the upgrade status of a recipe`" section. + :term:`RECIPE_SYSROOT` + This variable points to the directory that holds all files populated from + recipes specified in :term:`DEPENDS`. As the name indicates, + think of this variable as a custom root ``/`` for the recipe that will be + used by the compiler in order to find headers and other files needed to complete + its job. + + This variable is related to :term:`STAGING_DIR_HOST` or :term:`STAGING_DIR_TARGET` + according to the type of the recipe and the build target. + + To better understand this variable, consider the following examples: + + - For ``#include ``, ``header.h`` should be in ``"${RECIPE_SYSROOT}/usr/include"`` + + - For ``-lexample``, ``libexample.so`` should be in ``"${RECIPE_SYSROOT}/lib"`` + or other library sysroot directories. + + The default value is ``"${WORKDIR}/recipe-sysroot"``. + Do not modify it. + + :term:`RECIPE_SYSROOT_NATIVE` + This is similar to :term:`RECIPE_SYSROOT` but the populated files are from + ``-native`` recipes. This allows a recipe built for the target machine to + use ``native`` tools. + + This variable is related to :term:`STAGING_DIR_NATIVE`. + + The default value is ``"${WORKDIR}/recipe-sysroot-native"``. + Do not modify it. + :term:`REPODIR` See :term:`bitbake:REPODIR` in the BitBake manual. @@ -8275,10 +8305,15 @@ system and gives an overview of their function and contents. for ``-native`` recipes, as they make use of host headers and libraries. + Check :term:`RECIPE_SYSROOT` and :term:`RECIPE_SYSROOT_NATIVE`. + :term:`STAGING_DIR_NATIVE` Specifies the path to the sysroot directory used when building components that run on the build host itself. + The default value is ``"${RECIPE_SYSROOT_NATIVE}"``, + check :term:`RECIPE_SYSROOT_NATIVE`. + :term:`STAGING_DIR_TARGET` Specifies the path to the sysroot used for the system for which the component generates code. For components that do not generate code, From patchwork Fri Oct 20 09:41:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Talel BELHADJ SALEM X-Patchwork-Id: 32627 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 039F0CDB474 for ; Fri, 20 Oct 2023 09:41:57 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web11.50767.1697794909849579325 for ; Fri, 20 Oct 2023 02:41:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bSu4jhIk; spf=pass (domain: gmail.com, ip: 209.85.128.42, mailfrom: bhstalel@gmail.com) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40842752c6eso5198315e9.1 for ; Fri, 20 Oct 2023 02:41:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697794908; x=1698399708; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fAnv5pMiCSCSlZ3rzutkJ/WP7wLEoDNDn1ElL8BBTHQ=; b=bSu4jhIkyyQK/rbsOhMatgpho9Shov82H0cCUI2H1BBgjsOaRvafNDLpdM7ilN7d7e n0s06oll5mAh8f5zhQ6iKxuZcOq3l2NkC7M1/FdI6/cIm1B4Ixqsk+MZZWgw4A+1QR8B PTjRPD9FF/16SkQJSeb6FdSiaMkblNUIz+6rg56QRJmJ53AcIeHeSz6lsqv0Qk65AKrQ BOgRBz9sWP0rJwjbcczfCZmwBlpHyW+FHtjnOdK+BAJov0U/xDd6eSb5OQUIypIyIlue MNlD3KBOBiF2cJJW7yatYvHY/loQAbffbm70DwgeAtjG7CGQ2JDPHc0cH8JO2F2iHY+s UpEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697794908; x=1698399708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fAnv5pMiCSCSlZ3rzutkJ/WP7wLEoDNDn1ElL8BBTHQ=; b=MmJdcNc5pklZlRmP7WzNVEbZEPODMbbOXRJgy/q7FU4GvpLw9XCxU1mW1B7RBvYVsn LGjC8acJxwQph+xES+SkWT178h32gDQQi5biob+vTaM068UYo0Ak+JL1tRe+H20+kRPT UESpB+VRFOd1nV8rT1M9DtHHM88SQGfFYrtdNY+wdc2yM3fj8SY0ZlA1nKF5cMfPBBIP WBtzuGYnbKH7h3RWQU+MGMLp1NY1K/HiaNzr/RtVLqpdRGU0pXcXCJ9ZKaYRqJnxZsEu uwWIjopJFDY+PgMk7vKFa4xzbK/0yHIs5raDiN6yodgn2wlL836m6aFEndM4ZkvmVFhE ZGSA== X-Gm-Message-State: AOJu0YxeaiCFXhBnt2nCSL6Xm/THU4s03a6FX4vfPh8XgKp3rv4F4AiD rtv5fw5kyrWtZpvXZ3TrSJ+x9K/tRf0= X-Google-Smtp-Source: AGHT+IEm04q/aqKF91UjXAe7O1m7b3yD195a1e2Cz1QboZTGoVTuRQv5Jm5YrgcCiArH/sOO0kwEWw== X-Received: by 2002:a05:600c:3555:b0:402:d72:bee5 with SMTP id i21-20020a05600c355500b004020d72bee5mr966190wmq.21.1697794907917; Fri, 20 Oct 2023 02:41:47 -0700 (PDT) Received: from talel.sofia.local ([41.225.25.106]) by smtp.gmail.com with ESMTPSA id 1-20020a05600c228100b0040596352951sm6433452wmf.5.2023.10.20.02.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:41:47 -0700 (PDT) From: Talel BELHAJSALEM To: docs@lists.yoctoproject.org Cc: Talel BELHAJSALEM Subject: [PATCH 2/3] ref-manual: variables: Add TOOLCHAIN_OPTIONS variable Date: Fri, 20 Oct 2023 10:41:01 +0100 Message-Id: <20231020094102.414940-2-bhstalel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231020094102.414940-1-bhstalel@gmail.com> References: <20231020094102.414940-1-bhstalel@gmail.com> 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, 20 Oct 2023 09:41:57 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/4438 Signed-off-by: Talel BELHAJSALEM --- documentation/ref-manual/variables.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index b00445946..1fca913e2 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -9135,6 +9135,16 @@ system and gives an overview of their function and contents. portion of an eSDK. This is similar to :term:`TOOLCHAIN_HOST_TASK` applying to SDKs. + :term:`TOOLCHAIN_OPTIONS` + This variable holds extra options passed to the compiler and the linker + for non ``-native`` recipes as they have to point to their custom + ``sysroot`` folder pointed to by :term:`RECIPE_SYSROOT`:: + + TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}" + + Native recipes don't need this variable to be set, as they are + built for the host machine with the native compiler. + :term:`TOOLCHAIN_OUTPUTNAME` This variable defines the name used for the toolchain output. The :ref:`populate_sdk_base ` class sets From patchwork Fri Oct 20 09:41:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Talel BELHADJ SALEM X-Patchwork-Id: 32628 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 09005CDB474 for ; Fri, 20 Oct 2023 09:42:07 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.web11.50769.1697794916861393510 for ; Fri, 20 Oct 2023 02:41:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iqRAHuoW; spf=pass (domain: gmail.com, ip: 209.85.128.45, mailfrom: bhstalel@gmail.com) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-40806e40fccso4501045e9.2 for ; Fri, 20 Oct 2023 02:41:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697794915; x=1698399715; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cjufGrbZrsmMG/XF/+bgJjIbmpC6psLLpJu/Ox9OiXQ=; b=iqRAHuoWG0wbPa2V14x9v55ZQeun5Hjz8jC3Ofn2KVGX5YW/xz4NcFccgNJnJe6fH5 cY1PWj/iw2g+jmxUIbCG9fInWmVtGmW4Ph3ed5EmHkHqgmB4bnkl3lE54aGKTQbNqccA f9i2YjYPFkLjc9TRYjMKPe8IiUn4T8IqqshC1zXPeUtNFfHYQvtqfQzh0FVIMJufPKCG Z9gId3Jbq0ewgFtJfewMl6hnw/WaTCNzSnX0cxWSgWXqcr6Xz3Abt22OixjWxGGN722c zWV+kWfDdewVgVioI+nKP/qQ4FYDtxC+EIin7BSVsqVa0xh0xkCYwy0ndtPsiZ9/ND1S 5hSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697794915; x=1698399715; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cjufGrbZrsmMG/XF/+bgJjIbmpC6psLLpJu/Ox9OiXQ=; b=GWDxpdZ9VJtHoTRym01MMIwL/tlvbOQu0/+mALxdfSi4kp7GLQexgxg0PpXkPAa1n8 NIHIqZu9NyY9XdvsTQryD3DN6MqcgVEWqm09jNJvcczcqaTOnRol5WfwjYqEAz/zdBNp QkM6QfnEKAsZHTBb7+weuNmxA9gZwOEOTbdpQwsdKWBXTCYwcXvuQg4TZ/sDLjyytLoN oBgwAExV4FDwSGidb69Ru+jfGMQquyL4jLbAvp5xmTK1wjay6uiGg6bgGRW+WB2VWmqn rMUFkRSmEItWeHa93JVF9ZV+zlRecnqFRLXwNYwzygw/JXkE7pgSCSdy1503b9auWgJ2 yR3g== X-Gm-Message-State: AOJu0Yznl8jcYkoBI6CakbQooIXf7vKI6BGtQ+Ld5Q6AmXkjH5dcaWQd jai3+jFktToU0XUSjAoSRiUjrZlpB/w= X-Google-Smtp-Source: AGHT+IFjHqXtqH9bzg+XM2h+mwvgqhFSZ75VM1pBhHQC87/KdELOxsHqo7OAB9N0gpI93O7hg/4aYw== X-Received: by 2002:a05:600c:3c8d:b0:408:434c:dae7 with SMTP id bg13-20020a05600c3c8d00b00408434cdae7mr1160483wmb.2.1697794914863; Fri, 20 Oct 2023 02:41:54 -0700 (PDT) Received: from talel.sofia.local ([41.225.25.106]) by smtp.gmail.com with ESMTPSA id 1-20020a05600c228100b0040596352951sm6433452wmf.5.2023.10.20.02.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:41:54 -0700 (PDT) From: Talel BELHAJSALEM To: docs@lists.yoctoproject.org Cc: Talel BELHAJSALEM Subject: [PATCH 3/3] ref-manual: variables: Add example for SYSROOT_DIRS variable Date: Fri, 20 Oct 2023 10:41:02 +0100 Message-Id: <20231020094102.414940-3-bhstalel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231020094102.414940-1-bhstalel@gmail.com> References: <20231020094102.414940-1-bhstalel@gmail.com> 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, 20 Oct 2023 09:42:07 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/4439 Signed-off-by: Talel BELHAJSALEM Reviewed-by: Michael Opdenacker --- documentation/ref-manual/variables.rst | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 1fca913e2..3faa39704 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -8498,6 +8498,35 @@ system and gives an overview of their function and contents. ${libdir}/${BPN}/ptest \ " + Consider the following example in which you need to manipulate this variable. + Assume you have a recipe ``A`` that provides a shared library ``.so.*`` that is + installed into a custom folder other than "``${libdir}``" + or "``${base_libdir}``", let's say "``/opt/lib``". + + .. note:: + + This is not a recommended way to deal with shared libraries, but this + is just to show the usefulness of setting :term:`SYSROOT_DIRS`. + + When a recipe ``B`` :term:`DEPENDS` on ``A``, it means what is in + :term:`SYSROOT_DIRS` will be copied from :term:`D` of the recipe ``B`` + into ``B``'s :term:`SYSROOT_DESTDIR` that is "``${WORKDIR}/sysroot-destdir``". + + Now, since ``/opt/lib`` is not in :term:`SYSROOT_DIRS`, it will never be copied to + ``A``'s :term:`RECIPE_SYSROOT`, which is "``${WORKDIR}/recipe-sysroot``". So, + the linking process will fail. + + To fix this, you need to add ``/opt/lib`` to :term:`SYSROOT_DIRS`:: + + SYSROOT_DIRS:append = " /opt/lib" + + .. note:: + Even after setting ``/opt/lib`` to :term:`SYSROOT_DIRS`, the linking process will still fail + because the linker does not know that location, since :term:`TARGET_LDFLAGS` + doesn't contain it (if your recipe is for the target). Therefore, so you should add:: + + TARGET_LDFLAGS:append = " -L${RECIPE_SYSROOT}/opt/lib" + :term:`SYSROOT_DIRS_NATIVE` Extra directories staged into the sysroot by the :ref:`ref-tasks-populate_sysroot` task for