diff mbox series

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

Message ID 20231016215302.3089907-1-bhstalel@gmail.com
State New
Headers show
Series [1/3] ref-manual: Add example for SYSROOT_DIRS | expand

Commit Message

Talel BELHADJ SALEM Oct. 16, 2023, 9:53 p.m. UTC
Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
---
 documentation/ref-manual/variables.rst | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

Comments

Michael Opdenacker Oct. 19, 2023, 6:25 p.m. UTC | #1
Hello Talel,

On 16.10.23 at 23:53, BELHADJ SALEM Talel wrote:
> Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
> ---
>   documentation/ref-manual/variables.rst | 18 ++++++++++++------
>   1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
> index 246584fc5..6cb4efff5 100644
> --- a/documentation/ref-manual/variables.rst
> +++ b/documentation/ref-manual/variables.rst
> @@ -6952,13 +6952,9 @@ system and gives an overview of their function and contents.
>         used by the compiler in order to find headers and other needs to complete
>         its job.
>   
> -      The value of this variable will be affected to :term:`TOOLCHAIN_OPTIONS`
> -      as::
> -
> -         TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}"
> -
>         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.
> +      according to the type of the recipe and the build target and also related to
> +      :term:`TOOLCHAIN_OPTIONS`.


This part of the commit is weird, as you're making changes to your 
previous commit. This change should go in your second patch, to minimize 
the effort for people reviewing your changes (or studying the commit 
history when the patch is merged it).

>   
>         To understand more this variable, consider the following examples:
>   
> @@ -9141,6 +9137,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}"
> +
> +      As ``-native`` recipes are built for the ``HOST`` itself this variable
> +      is not used, thus it is empty.

Don't you just mean that native recipes don't need this variable to be 
set, as they are built for the host machine with the native compiler?

Thanks
Michael.
Talel BELHADJ SALEM Oct. 19, 2023, 6:37 p.m. UTC | #2
Hello Michael,

The reason for the commits are in reverse is that when I added support for
a variable I discovered that another one is missing
and I need to create another commit, I am new to handling patches with Git,
next I think I need to analyze exactly what I need to do and do it in the
right way.

I will fix all comments.

Thanks for the review.

Kind regards
Talel

On Thu, Oct 19, 2023 at 7:25 PM Michael Opdenacker <
michael.opdenacker@bootlin.com> wrote:

> Hello Talel,
>
> On 16.10.23 at 23:53, BELHADJ SALEM Talel wrote:
> > Signed-off-by: Talel BELHAJSALEM <bhstalel@gmail.com>
> > ---
> >   documentation/ref-manual/variables.rst | 18 ++++++++++++------
> >   1 file changed, 12 insertions(+), 6 deletions(-)
> >
> > diff --git a/documentation/ref-manual/variables.rst
> b/documentation/ref-manual/variables.rst
> > index 246584fc5..6cb4efff5 100644
> > --- a/documentation/ref-manual/variables.rst
> > +++ b/documentation/ref-manual/variables.rst
> > @@ -6952,13 +6952,9 @@ system and gives an overview of their function
> and contents.
> >         used by the compiler in order to find headers and other needs to
> complete
> >         its job.
> >
> > -      The value of this variable will be affected to
> :term:`TOOLCHAIN_OPTIONS`
> > -      as::
> > -
> > -         TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}"
> > -
> >         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.
> > +      according to the type of the recipe and the build target and also
> related to
> > +      :term:`TOOLCHAIN_OPTIONS`.
>
>
> This part of the commit is weird, as you're making changes to your
> previous commit. This change should go in your second patch, to minimize
> the effort for people reviewing your changes (or studying the commit
> history when the patch is merged it).
>
> >
> >         To understand more this variable, consider the following
> examples:
> >
> > @@ -9141,6 +9137,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}"
> > +
> > +      As ``-native`` recipes are built for the ``HOST`` itself this
> variable
> > +      is not used, thus it is empty.
>
> Don't you just mean that native recipes don't need this variable to be
> set, as they are built for the host machine with the native compiler?
>
> Thanks
> Michael.
>
> --
> Michael Opdenacker, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
>
Michael Opdenacker Oct. 19, 2023, 8:05 p.m. UTC | #3
Hi Talel

On 19.10.23 at 20:37, BELHADJ SALEM Talel wrote:
> Hello Michael,
>
> The reason for the commits are in reverse is that when I added support 
> for a variable I discovered that another one is missing
> and I need to create another commit, I am new to handling patches with 
> Git, next I think I need to analyze exactly what I need to do and do 
> it in the right way.
>
> I will fix all comments.
>
> Thanks for the review.

Very happy to help!
Everyone has to go through this and learning how to organize patches is 
a very nice though not trivial learning experience :)

Don't hesitate to ask for tips. A great one is using "git rebase -i" to 
reorganize your commits vs the branch you started from.
Cheers
Michael.
diff mbox series

Patch

diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index 246584fc5..6cb4efff5 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -6952,13 +6952,9 @@  system and gives an overview of their function and contents.
       used by the compiler in order to find headers and other needs to complete
       its job.
 
-      The value of this variable will be affected to :term:`TOOLCHAIN_OPTIONS`
-      as::
-         
-         TOOLCHAIN_OPTIONS = " --sysroot=${RECIPE_SYSROOT}"
-
       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.
+      according to the type of the recipe and the build target and also related to
+      :term:`TOOLCHAIN_OPTIONS`.
 
       To understand more this variable, consider the following examples:
 
@@ -9141,6 +9137,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}"
+
+      As ``-native`` recipes are built for the ``HOST`` itself this variable
+      is not used, thus it is empty.
+
    :term:`TOOLCHAIN_OUTPUTNAME`
       This variable defines the name used for the toolchain output. The
       :ref:`populate_sdk_base <ref-classes-populate-sdk-*>` class sets