Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] poky: kirkstone: eSDK: fix build-in eSDK environment file generation
@ 2023-11-22  9:04 Alberto Merciai
  2023-11-22  9:13 ` Alexander Kanavin
  0 siblings, 1 reply; 10+ messages in thread
From: Alberto Merciai @ 2023-11-22  9:04 UTC (permalink / raw)
  To: openembedded-core; +Cc: alb3rt0.m3rciai, Alexander Kanavin

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



^ permalink raw reply related	[flat|nested] 10+ messages in thread
[parent not found: <20231122085438.7328-1-alb3rt0.m3rciai@gmail.com>]

end of thread, other threads:[~2023-11-22 13:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-22  9:04 [PATCH] poky: kirkstone: eSDK: fix build-in eSDK environment file generation Alberto Merciai
2023-11-22  9:13 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox