openembedded-core.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
From: Alberto Merciai <alb3rt0.m3rciai@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: alb3rt0.m3rciai@gmail.com, Alexander Kanavin <alex.kanavin@gmail.com>
Subject: [PATCH] poky: kirkstone: eSDK: fix build-in eSDK environment file generation
Date: Wed, 22 Nov 2023 10:04:02 +0100	[thread overview]
Message-ID: <20231122090402.7643-1-alb3rt0.m3rciai@gmail.com> (raw)

From: amerciai <alb3rt0.m3rciai@gmail.com>

- Following Setting up the Extensible SDK environment directly in a Yocto build
  https://docs.yoctoproject.org/4.0.14/sdk-manual/extensible.html#setting-up-the-extensible-sdk-environment-directly-in-a-yocto-build
  The generated environment file does not point to the
  correct sysroot folder, then the end user is not able
  to cross-compile by sourcing the file.

- The same for kirkstone-4.0.10

- By analyzing
  https://lore.kernel.org/all/20220622103312.1098389-3-alex@linutronix.de/T/#m7eadf6c722410f5b233ebba9fc700a895af9f052
  I found that changes apllied to
  meta/classes/toolchain-scripts.bbclass
  solve the issue.

Suggested-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Alberto Merciai <alb3rt0.m3rciai@gmail.com>

diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index d735d434e6..ec50a1efa0 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -70,15 +70,23 @@ toolchain_create_tree_env_script () {
 	script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
 	rm -f $script
 	touch $script
+	echo 'standalone_sysroot_target="${STAGING_DIR}/${MACHINE}"' >> $script
+	echo 'standalone_sysroot_native="${STAGING_DIR}/${BUILD_ARCH}"' >> $script
 	echo 'orig=`pwd`; cd ${COREBASE}; . ./oe-init-build-env ${TOPDIR}; cd $orig' >> $script
-	echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${STAGING_BINDIR_TOOLCHAIN}:$PATH' >> $script
-	echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
-	echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
+
+	echo 'export PATH=$standalone_sysroot_native/${bindir_native}:$standalone_sysroot_native/${bindir_native}/${TARGET_SYS}:$PATH' >> $script
+	echo 'export PKG_CONFIG_SYSROOT_DIR=$standalone_sysroot_target' >> $script
+	echo 'export PKG_CONFIG_PATH=$standalone_sysroot_target'"$libdir"'/pkgconfig:$standalone_sysroot_target'"$prefix"'/share/pkgconfig' >> $script
+
 	echo 'export CONFIG_SITE="${CONFIG_SITE}"' >> $script
-	echo 'export SDKTARGETSYSROOT=${STAGING_DIR_TARGET}' >> $script
-	echo 'export OECORE_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script
-	echo 'export OECORE_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script
-	echo 'export OECORE_ACLOCAL_OPTS="-I ${STAGING_DIR_NATIVE}/usr/share/aclocal"' >> $script
+
+	echo 'export SDKTARGETSYSROOT=$standalone_sysroot_target' >> $script
+	echo 'export OECORE_NATIVE_SYSROOT=$standalone_sysroot_native' >> $script
+	echo 'export OECORE_TARGET_SYSROOT=$standalone_sysroot_target' >> $script
+	echo 'export OECORE_ACLOCAL_OPTS="-I $standalone_sysroot_native/usr/share/aclocal"' >> $script
+	echo 'export OECORE_BASELIB="${baselib}"' >> $script
+	echo 'export OECORE_TARGET_ARCH="${TARGET_ARCH}"' >>$script
+	echo 'export OECORE_TARGET_OS="${TARGET_OS}"' >>$script
 
 	toolchain_shared_env_script
 }
-- 
2.34.1



             reply	other threads:[~2023-11-22  9:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  9:04 Alberto Merciai [this message]
2023-11-22  9:13 ` [PATCH] poky: kirkstone: eSDK: fix build-in eSDK environment file generation Alexander Kanavin
     [not found] <20231122085438.7328-1-alb3rt0.m3rciai@gmail.com>
2023-11-22  8:59 ` Alexander Kanavin
2023-11-22  9:18   ` Alberto Merciai
2023-11-22  9:30     ` Alexander Kanavin
2023-11-22 12:10       ` Alberto Merciai
2023-11-22 12:12         ` Alexander Kanavin
2023-11-22 13:46           ` Alberto Merciai
2023-11-22 12:45       ` Alexander Kanavin
2023-11-22 13:48         ` Alberto Merciai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231122090402.7643-1-alb3rt0.m3rciai@gmail.com \
    --to=alb3rt0.m3rciai@gmail.com \
    --cc=alex.kanavin@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).