diff mbox series

[2/3] ref-manual: variables: Add TOOLCHAIN_OPTIONS variable

Message ID 20231020094102.414940-2-bhstalel@gmail.com
State New
Headers show
Series [1/3] ref-manual: variables: Add RECIPE_SYSROOT and RECIPE_SYSROOT_NATIVE | expand

Commit Message

Talel BELHADJ SALEM Oct. 20, 2023, 9:41 a.m. UTC
Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
---
 documentation/ref-manual/variables.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Khem Raj Oct. 20, 2023, 4:04 p.m. UTC | #1
On 10/20/23 2:41 AM, BELHADJ SALEM Talel wrote:
> Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
> ---
>   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

This will be good to mention that its different from adding to CFLAGS 
since this variable ends up in CC/CXX variables which is important to 
know that in some packages CFLAGS/LDFLAGS may not be used especially 
during configure tests etc.

> +      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 <ref-classes-populate-sdk-*>` class sets
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#4438): https://lists.yoctoproject.org/g/docs/message/4438
> Mute This Topic: https://lists.yoctoproject.org/mt/102077750/1997914
> Group Owner: docs+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Michael Opdenacker Oct. 20, 2023, 5:17 p.m. UTC | #2
On 20.10.23 at 18:04, Khem Raj wrote:
> On 10/20/23 2:41 AM, BELHADJ SALEM Talel wrote:
>> Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
>> ---
>>   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
>
> This will be good to mention that its different from adding to CFLAGS 
> since this variable ends up in CC/CXX variables which is important to 
> know that in some packages CFLAGS/LDFLAGS may not be used especially 
> during configure tests etc.


Khem. Thanks for the suggestion!
Talel, your patches are already merged but follow-up patches to 
implement Khem's suggestions are welcome, of course.
Cheers
Michael.
diff mbox series

Patch

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 <ref-classes-populate-sdk-*>` class sets