From patchwork Thu Oct 19 21:48:25 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: 32602 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 324A3C004C0 for ; Thu, 19 Oct 2023 21:48:53 +0000 (UTC) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mx.groups.io with SMTP id smtpd.web10.40363.1697752126239140149 for ; Thu, 19 Oct 2023 14:48:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VFcErR9Y; spf=pass (domain: gmail.com, ip: 209.85.208.170, mailfrom: bhstalel@gmail.com) Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2c4fe37f166so1941841fa.1 for ; Thu, 19 Oct 2023 14:48:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697752124; x=1698356924; 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=a//i8T4GZn1VIkBQ9mAWQV7hfOQzpZLlcE2cN88gcCE=; b=VFcErR9YCySNtZDbRJezoHIvRnYAb+WQcKuV2mAYh1Te40TcjcFvl7wwYx0N2By9Nx 5eOB7SKxkCS3+vB9H1eoV9RJcfYNqN8SbjPl2mlnaH6Gxq6PlCRdFMKIqjYXZfmSIMj8 FB///3TSYqIKILZdNHtGujbxV7ATMKD6mxTC0t18FUIRSV9E0DQo76CMN6Mz6MRLaV6Q bmRiP3PRCszWX4jAh/ra9Hy33qCJUNFFhQrHskkVd6n2w1QaR+jXgexQwJbtiz7uyFJX MuzABX/yRal9UYmQlxm2sekr4OvKt0WpOU6O1fONqpbBJLTdpRj3+mLOQuz0nQnLTa4n hj6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697752124; x=1698356924; 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=a//i8T4GZn1VIkBQ9mAWQV7hfOQzpZLlcE2cN88gcCE=; b=Rybhf8mwRZGdbXDvVkDuND59mkplPs6PBRcYmnwuAW7ycgZ7v4aBwWQvjqUR271Z61 KFCrfpwtSr/aQARiCx0hYYwwM3ihOZupSrFVNUdryvPsfFAehYt3YDBmelA0ZL2Wlngc tpDTWlQuvgSfLaGAXg6nBa9j9GFrR8zWOKiNdsLAVKcWx1Za0ayUbcLVNdyRzEQqwe0p BaBuWTwOwgDckc3c6qt4abrRYmA1u4c24T5s2UgfI/6D/pqqBrg8tpRk8MBKkbf/Q+aV KwCOiAizWS0q89jzVr25zVNl12uUigc30u7nynX7ogeZWc/56jMLZI07rKL/wesWeVy5 czTA== X-Gm-Message-State: AOJu0YwckaUnVl4SEkKrtS1Bqi4xR1qofYrwTqT0NDMG7Qj0inUNqpFQ A7jkBAW9PLqChFB5qahoSA+qhktNpas= X-Google-Smtp-Source: AGHT+IF98D5P87+7KRnBLaYGqYsgIoJnedetZuT4c0IyCreTQNddmlQUfp5N150moZDcnTwVUuS2xA== X-Received: by 2002:a2e:a4cb:0:b0:2c5:55a:b6b5 with SMTP id p11-20020a2ea4cb000000b002c5055ab6b5mr111750ljm.28.1697752123762; Thu, 19 Oct 2023 14:48:43 -0700 (PDT) Received: from localhost.localdomain ([197.27.108.75]) by smtp.gmail.com with ESMTPSA id n15-20020a7bcbcf000000b004060f0a0fdbsm5341724wmi.41.2023.10.19.14.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 14:48:43 -0700 (PDT) From: Talel BELHAJSALEM To: docs@lists.yoctoproject.org Cc: Talel BELHAJSALEM Subject: [PATCH 1/3] ref-manual: variabls: Add RECIPE_SYSROOT and RECIPE_SYSROOT_NATIVE variables Date: Thu, 19 Oct 2023 22:48:25 +0100 Message-Id: <20231019214827.405886-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 ; Thu, 19 Oct 2023 21:48:53 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/4430 Signed-off-by: Talel BELHAJSALEM --- documentation/ref-manual/variables.rst | 36 +++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 26a5aed82..22787f3b4 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 needs 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 understand more 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. @@ -8242,7 +8272,8 @@ system and gives an overview of their function and contents. the component is built to run (the system that hosts the component). For most recipes, this sysroot is the one in which that recipe's :ref:`ref-tasks-populate_sysroot` task copies - files. Exceptions include ``-native`` recipes, where the + files, check :term:`RECIPE_SYSROOT`. + Exceptions include ``-native`` recipes, where the :ref:`ref-tasks-populate_sysroot` task instead uses :term:`STAGING_DIR_NATIVE`. Depending on the type of recipe and the build target, :term:`STAGING_DIR_HOST` can @@ -8279,6 +8310,9 @@ system and gives an overview of their function and contents. 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 Thu Oct 19 21:48:26 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: 32604 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 21A8AC00A98 for ; Thu, 19 Oct 2023 21:49:03 +0000 (UTC) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by mx.groups.io with SMTP id smtpd.web11.40422.1697752133541405418 for ; Thu, 19 Oct 2023 14:48:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hYl1fGuA; spf=pass (domain: gmail.com, ip: 209.85.208.178, mailfrom: bhstalel@gmail.com) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2c50d1b9f22so2268371fa.0 for ; Thu, 19 Oct 2023 14:48:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697752131; x=1698356931; 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=fvVLEAk0/4ACR5ZX+Ers46A6tamRZX7dOtzy7qXAaaA=; b=hYl1fGuAYii2SOYffnW4qPM8vtd1bVmrgLuXWVZLaembRPvrSWbi5cBC8ir741u9vf l/9EicMCyNItolEBWl7LGwxyxqOi0mmqwjau3Q7NvapiravZ0FAot6aWunbFCNpo8mGi s+eoDFy7ywh3/YlpaMZDNmHfxlzykBYLmDb/5nTY3isEqTcXNMG6RZXi8cis3iA9AWqP BZ7kaWNhhFdmec7vXrZFznmrOkoVit9gVGpRc6rSTLdPfeg3f7ryKYu5JyFewDQjUpZG 6TR89ZOd6pszPILWMdkCvopJ4WVfuwMB39YG3OpmYF800jsHocvdft5dcQpy300XcOZ+ wTGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697752131; x=1698356931; 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=fvVLEAk0/4ACR5ZX+Ers46A6tamRZX7dOtzy7qXAaaA=; b=YwGoogbFCXVI+9SXhHg179NPgrrOkm4FfilYF+dZ6W8xvmYeWGkVEX7L/GrJ9nCbim saSU1btQyTpDVXG+G6Zbj9NXGj1/BqNXEURSO79v/eJv1iy9CutJR4RfDN0Zzmfmxaz3 RAONQyoyE47376R8McM9JqmMF8TTMnb89SPp9VOL0gnaiBr0iXtIfwZff92w8DEgCFCG WosPJRwI5p+4Iu07Xch0blR4UlaIWTDv3Flpn+uVygZOYU1W7wEdk0a/q+obbJhZzOzn +cp4th4PMlng7zL5Gx1Qrr1ks6wxtDiIheXIab+5dmiae8n6lreYSW2rWOMXk0XkYKa3 YkBg== X-Gm-Message-State: AOJu0YzQ36HaFU32nXCM/d5mIFlzk/oN7guvMIeiZ+e5BNlz5ZrgBIC0 kubi4XAUHQ0vEaoxMz71E15aio8KqjU= X-Google-Smtp-Source: AGHT+IHozrX2oSAWHjwSy0B4fD3rlH6b5KJPrwgXd5ZU305ykczfNKtVdz7LqIptQmrruhY3k3CJbA== X-Received: by 2002:a05:651c:50f:b0:2c5:6df:8b24 with SMTP id o15-20020a05651c050f00b002c506df8b24mr122914ljp.41.1697752131253; Thu, 19 Oct 2023 14:48:51 -0700 (PDT) Received: from localhost.localdomain ([197.27.108.75]) by smtp.gmail.com with ESMTPSA id n15-20020a7bcbcf000000b004060f0a0fdbsm5341724wmi.41.2023.10.19.14.48.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 14:48:50 -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: Thu, 19 Oct 2023 22:48:26 +0100 Message-Id: <20231019214827.405886-2-bhstalel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231019214827.405886-1-bhstalel@gmail.com> References: <20231019214827.405886-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 ; Thu, 19 Oct 2023 21:49:03 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/4431 Signed-off-by: Talel BELHAJSALEM Reviewed-by: Michael Opdenacker --- 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 22787f3b4..958b98fd6 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -9134,6 +9134,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 Thu Oct 19 21:48:27 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: 32603 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 1F8BBC001DF for ; Thu, 19 Oct 2023 21:49:03 +0000 (UTC) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.groups.io with SMTP id smtpd.web11.40426.1697752142408432443 for ; Thu, 19 Oct 2023 14:49:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h0/781KH; spf=pass (domain: gmail.com, ip: 209.85.128.44, mailfrom: bhstalel@gmail.com) Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40839652b97so1081005e9.3 for ; Thu, 19 Oct 2023 14:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697752140; x=1698356940; 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=YcnZ+7ws16kEUPU5ojRInJB5z/zHR+ctOrmMoU3lpIs=; b=h0/781KHiMM3x3G7P/s7m12FvLUINzg9rGaqUW38F6wOj08b3YSCYOaC1OcaeiSSbb FJbMN6oCz4cqoOKE7xKctWiIwmAJr02xOVMB5Hkrh2ex/t/5pp0ZKcdlqBc8pbTCj1jN qy9A3L+xzQQ8jUssaUlOCq+2d5AvfV/Cjm/ii2lUUeR+YURClOdBIsbv/yfsKftU8mj4 GfrKr+S6U5nx5uqtQHHGD8j2oHyjuU+BWouSWJP2z3lBKp/vF4pWjZo1YRMQVZ2FMkAe jpRSPSoT3lzE+CZkZoSxreZxJA6sTVDIm4q+sXqaDxx0Yk5+G7dBTRCk7zZNHEe7+hXs Y7QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697752140; x=1698356940; 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=YcnZ+7ws16kEUPU5ojRInJB5z/zHR+ctOrmMoU3lpIs=; b=WIjjGKiTRIhdqZsiAdFre/xWRjeTAVkSTwcCbVblW3wZhMozocDkFCKTFIKmON9K43 5DMzpmaJiKSH6fzB1Z7ppVoiMAXN4MSTrBfHcthOhak2klaq+AMHZdc2nNynA9bFiWs1 IcVcEE2IOPopDjkyrYGBILZP1G8ZLMpzYWoLQxim2lX7hhKdutSuGuueMEu8do5PpCuZ 7+lCC6pG/W1Ii30hJIxXZnPR/NlwLQgeyYWhEovkYxheiW9MlBV6FQyr+bDeZMTLoO5o 7+05mwKmeniQUs3tEKodMbu4PJBJ7qEOHNuz0tW0YSLZtXp8og+BSlkPP3+5+b2BS0V8 FS3A== X-Gm-Message-State: AOJu0Yzx4NulkwV0h1Dam9gqm99c+qL3NDLLcPWhx+Rx23AYMqbNNr7O ivC1TWeifo0ZMuLzVawndO5tk1u7lvc= X-Google-Smtp-Source: AGHT+IEdRmJee6elr/cKivy6eYZKvqVdONeNIVqhGOZTTIwc2hCXC9WkcCytE/QgVkDWB6HbRaZTcQ== X-Received: by 2002:a05:600c:138d:b0:3fe:dcd0:2e32 with SMTP id u13-20020a05600c138d00b003fedcd02e32mr91215wmf.19.1697752140240; Thu, 19 Oct 2023 14:49:00 -0700 (PDT) Received: from localhost.localdomain ([197.27.108.75]) by smtp.gmail.com with ESMTPSA id n15-20020a7bcbcf000000b004060f0a0fdbsm5341724wmi.41.2023.10.19.14.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 14:48:59 -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: Thu, 19 Oct 2023 22:48:27 +0100 Message-Id: <20231019214827.405886-3-bhstalel@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231019214827.405886-1-bhstalel@gmail.com> References: <20231019214827.405886-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 ; Thu, 19 Oct 2023 21:49:03 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/4432 Signed-off-by: Talel BELHAJSALEM --- 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 958b98fd6..8f1abf43a 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst @@ -8474,6 +8474,35 @@ system and gives an overview of their function and contents. /sysroot-only \ " + 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 still 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 fail + because the linker does not know that location since :term:`TARGET_LDFLAGS` (if your recipe + is for the target) doesn't contain it. Therefore, so you should add:: + + TARGET_LDFLAGS:append = " -L${RECIPE_SYSROOT}/opt/lib" + :term:`SYSROOT_DIRS_IGNORE` Directories that are not staged into the sysroot by the :ref:`ref-tasks-populate_sysroot` task. You