[v2,1/2] toolchain-scripts.bbclass: also recognize ${SDK_SYS} env setups

Submitted by Jens Rehsack on July 24, 2020, 5:26 a.m. | Patch ID: 174658

Details

Message ID 20200724052606.6726-1-sno@netbsd.org
State Master Next
Commit 4fa1944829558ef6af1148df40d663d504f6456b
Headers show

Commit Message

Jens Rehsack July 24, 2020, 5:26 a.m.
Instead of recognizing only environment-setup scripts in
${STAGING_DIR_TARGET} or ${STAGING_DIR_NATIVE}, respectively - lurk also into
${SDKPATH}/buildtools/sysroots/${SDK_SYS} where nativesdk-openssl installs
setup files.

Signed-off-by: Jens Rehsack <sno@netbsd.org>
---
 meta/classes/toolchain-scripts.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index db1d3215ef..e3959e21e8 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -119,6 +119,11 @@  if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
 	    . \$envfile
     done
 fi
+if [ -d "${SDKPATH}/buildtools/sysroots/${SDK_SYS}/environment-setup.d" ]; then
+    for envfile in ${SDKPATH}/buildtools/sysroots/${SDK_SYS}/environment-setup.d/*.sh; do
+	    . \$envfile
+    done
+fi
 EOF
 }
 

Comments

Richard Purdie July 27, 2020, 4:06 p.m.
On Fri, 2020-07-24 at 07:26 +0200, Jens Rehsack wrote:
> Instead of recognizing only environment-setup scripts in
> ${STAGING_DIR_TARGET} or ${STAGING_DIR_NATIVE}, respectively - lurk also into
> ${SDKPATH}/buildtools/sysroots/${SDK_SYS} where nativesdk-openssl installs
> setup files.
> 
> Signed-off-by: Jens Rehsack <sno@netbsd.org>
> ---
>  meta/classes/toolchain-scripts.bbclass | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
> index db1d3215ef..e3959e21e8 100644
> --- a/meta/classes/toolchain-scripts.bbclass
> +++ b/meta/classes/toolchain-scripts.bbclass
> @@ -119,6 +119,11 @@ if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
>  	    . \$envfile
>      done
>  fi
> +if [ -d "${SDKPATH}/buildtools/sysroots/${SDK_SYS}/environment-setup.d" ]; then
> +    for envfile in ${SDKPATH}/buildtools/sysroots/${SDK_SYS}/environment-setup.d/*.sh; do
> +	    . \$envfile
> +    done
> +fi
>  EOF
>  }

I finally got around to looking at this, sorry about the delay. Whilst
this fixes the issue and doesn't harm anything, I think its incorrect.
I suspect that $OECORE_NATIVE_SYSROOT should be pointing at
${SDKPATH}/buildtools/sysroots/${SDK_SYS}.

Could you see where $OECORE_NATIVE_SYSROOT is pointing and see if we
perhaps can't fix that instead?

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#141005): https://lists.openembedded.org/g/openembedded-core/message/141005
Mute This Topic: https://lists.openembedded.org/mt/75761296/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Jens Rehsack Aug. 4, 2020, 10:22 a.m.
> Am 27.07.2020 um 18:06 schrieb Richard Purdie <richard.purdie@linuxfoundation.org>:
> 
> On Fri, 2020-07-24 at 07:26 +0200, Jens Rehsack wrote:
>> Instead of recognizing only environment-setup scripts in
>> ${STAGING_DIR_TARGET} or ${STAGING_DIR_NATIVE}, respectively - lurk also into
>> ${SDKPATH}/buildtools/sysroots/${SDK_SYS} where nativesdk-openssl installs
>> setup files.
>> 
>> Signed-off-by: Jens Rehsack <sno@netbsd.org>
>> ---
>> meta/classes/toolchain-scripts.bbclass | 5 +++++
>> 1 file changed, 5 insertions(+)
>> 
>> diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
>> index db1d3215ef..e3959e21e8 100644
>> --- a/meta/classes/toolchain-scripts.bbclass
>> +++ b/meta/classes/toolchain-scripts.bbclass
>> @@ -119,6 +119,11 @@ if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
>> 	    . \$envfile
>>     done
>> fi
>> +if [ -d "${SDKPATH}/buildtools/sysroots/${SDK_SYS}/environment-setup.d" ]; then
>> +    for envfile in ${SDKPATH}/buildtools/sysroots/${SDK_SYS}/environment-setup.d/*.sh; do
>> +	    . \$envfile
>> +    done
>> +fi
>> EOF
>> }
> 
> I finally got around to looking at this, sorry about the delay. Whilst
> this fixes the issue and doesn't harm anything, I think its incorrect.
> I suspect that $OECORE_NATIVE_SYSROOT should be pointing at
> ${SDKPATH}/buildtools/sysroots/${SDK_SYS}.

This would definitively a much better solution. Actually it's created as follows:

```
sdkpathnative=${7:-${SDKPATHNATIVE}}
echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script
```

Which is expanded (taken from `bitbake -e`):

# $SDKPATHNATIVE
#   set /home/sno/gpw-community-bsp/sources/poky/meta/conf/bitbake.conf:424
#     "${SDKPATH}/sysroots/${SDK_SYS}"
SDKPATHNATIVE="/opt/gpw/1.0.0/sysroots/x86_64-pokysdk-linux"

And it's updates after installing the SDK to:
export OECORE_NATIVE_SYSROOT="/home/sno/sds-lp791a-sdk/tmp/sysroots/x86_64"

> Could you see where $OECORE_NATIVE_SYSROOT is pointing and see if we
> perhaps can't fix that instead?

Any suggestions?

Cheers
--
Jens Rehsack - rehsack@gmail.com
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#141183): https://lists.openembedded.org/g/openembedded-core/message/141183
Mute This Topic: https://lists.openembedded.org/mt/75761296/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-