* [PATCH 1/9] perl: fix do_install failed for nativesdk-perl
@ 2025-01-21 8:55 Hongxu Jia
2025-01-21 8:55 ` [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds Hongxu Jia
` (7 more replies)
0 siblings, 8 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
While set 'baselib = "lib64"' for nativesdk, perl do_install failed:
| rm: cannot remove 'tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-perl/
5.40.0/image//usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/
usr/lib64/perl5/5.40.0/*/CORE/libperl.so': No such file or directory
Refer perl class-target do_configure, explicitly pass option '--libdir=${libdir}'
to nativesdk do_configure
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-devtools/perl/perl_5.40.0.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/perl/perl_5.40.0.bb b/meta/recipes-devtools/perl/perl_5.40.0.bb
index 77b92ae804..30f2431f27 100644
--- a/meta/recipes-devtools/perl/perl_5.40.0.bb
+++ b/meta/recipes-devtools/perl/perl_5.40.0.bb
@@ -90,7 +90,7 @@ do_configure:class-target() {
}
do_configure:class-nativesdk() {
- ./configure --prefix=${prefix} \
+ ./configure --prefix=${prefix} --libdir=${libdir} \
--target=${TARGET_SYS} \
-Duseshrplib \
-Dusethreads \
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
@ 2025-01-21 8:55 ` Hongxu Jia
2025-01-27 13:18 ` [OE-core] " Mathieu Dubois-Briand
2025-01-29 16:58 ` Ross Burton
2025-01-21 8:55 ` [PATCH 3/9] toolchain-shar-relocate.sh: support multiple dynamic loaders for multilib Hongxu Jia
` (6 subsequent siblings)
7 siblings, 2 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
The nativesdk multilib support required it to fix multilib headers
conflict
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
| 5 -----
1 file changed, 5 deletions(-)
--git a/meta/classes-recipe/multilib_header.bbclass b/meta/classes-recipe/multilib_header.bbclass
index 33f7e027f0..b338166f61 100644
--- a/meta/classes-recipe/multilib_header.bbclass
+++ b/meta/classes-recipe/multilib_header.bbclass
@@ -51,8 +51,3 @@ oe_multilib_header() {
oe_multilib_header:class-native () {
return
}
-
-# Nor do we need multilib headers for nativesdk builds.
-oe_multilib_header:class-nativesdk () {
- return
-}
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 3/9] toolchain-shar-relocate.sh: support multiple dynamic loaders for multilib
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
2025-01-21 8:55 ` [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds Hongxu Jia
@ 2025-01-21 8:55 ` Hongxu Jia
2025-01-21 8:55 ` [PATCH 4/9] script/relocate_sdk.py: check dynamic loader arch before relocating interpreter Hongxu Jia
` (5 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
While nativesdk support multilib, there are two dynamic loaders,
$OECORE_NATIVE_SYSROOT/lib64/ld-linux-x86-64.so.2
$OECORE_NATIVE_SYSROOT/lib/ld-linux.so.2
Search them with wildcard and call relocate_sdk.py separately
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/files/toolchain-shar-relocate.sh | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh
index 69ea063c8c..c7170349db 100644
--- a/meta/files/toolchain-shar-relocate.sh
+++ b/meta/files/toolchain-shar-relocate.sh
@@ -8,8 +8,8 @@ done
# fix dynamic loader paths in all ELF SDK binaries
# allow symlinks to be accessed via the find command too
native_sysroot=$($SUDO_EXEC cat $env_setup_script |grep 'OECORE_NATIVE_SYSROOT='|cut -d'=' -f2|tr -d '"')
-dl_path=$($SUDO_EXEC find $native_sysroot/lib/ -maxdepth 1 -name "ld-linux*")
-if [ "$dl_path" = "" ] ; then
+dl_paths=$($SUDO_EXEC find $native_sysroot/lib*/ -maxdepth 1 -name "ld-linux*")
+if [ "$dl_paths" = "" ] ; then
echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!"
exit 1
fi
@@ -39,7 +39,9 @@ if [ x\${PYTHON} = "x" ]; then
echo "SDK could not be relocated. No python found."
exit 1
fi
-\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files
+for dl_path in \$(echo "$dl_paths"); do
+ \${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir \$dl_path $executable_files
+done
EOF
$SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 4/9] script/relocate_sdk.py: check dynamic loader arch before relocating interpreter
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
2025-01-21 8:55 ` [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds Hongxu Jia
2025-01-21 8:55 ` [PATCH 3/9] toolchain-shar-relocate.sh: support multiple dynamic loaders for multilib Hongxu Jia
@ 2025-01-21 8:55 ` Hongxu Jia
2025-01-21 8:55 ` [PATCH 5/9] libgcc-common: apply multilib symlinks for nativesdk libgcc Hongxu Jia
` (4 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
While multiple dynamic loader existed, in order to make executable file is
interpreted by the expected dynamic loader, relocating interpreter only if
the new dynamic loader and executable file have the same arch
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
scripts/relocate_sdk.py | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index 8a728720ba..9e01c09cb0 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -49,6 +49,34 @@ def get_arch():
elif ei_class == 2:
return 64
+def get_dl_arch(dl_path):
+ try:
+ with open(dl_path, "r+b") as f:
+ e_ident =f.read(16)
+ except IOError:
+ exctype, ioex = sys.exc_info()[:2]
+ if ioex.errno == errno.ETXTBSY:
+ print("Could not open %s. File used by another process.\nPlease "\
+ "make sure you exit all processes that might use any SDK "\
+ "binaries." % e)
+ else:
+ print("Could not open %s: %s(%d)" % (e, ioex.strerror, ioex.errno))
+ sys.exit(-1)
+
+ ei_mag0,ei_mag1_3,ei_class,ei_data,ei_version = struct.unpack("<B3sBBB9x", e_ident)
+
+ if (ei_mag0 != 0x7f and ei_mag1_3 != "ELF") or ei_class == 0:
+ print("ERROR: unknow %s" % dl_path)
+ sys.exit(-1)
+
+ if ei_class == 1:
+ arch = 32
+ elif ei_class == 2:
+ arch = 64
+
+ return arch
+
+
def parse_elf_header():
global e_type, e_machine, e_version, e_entry, e_phoff, e_shoff, e_flags,\
e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum, e_shstrndx
@@ -223,6 +251,8 @@ else:
executables_list = sys.argv[3:]
+dl_arch = get_dl_arch(new_dl_path)
+
errors = False
for e in executables_list:
perms = os.stat(e)[stat.ST_MODE]
@@ -247,7 +277,7 @@ for e in executables_list:
old_size = os.path.getsize(e)
if old_size >= 64:
arch = get_arch()
- if arch:
+ if arch and arch == dl_arch:
parse_elf_header()
if not change_interpreter(e):
errors = True
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 5/9] libgcc-common: apply multilib symlinks for nativesdk libgcc
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
` (2 preceding siblings ...)
2025-01-21 8:55 ` [PATCH 4/9] script/relocate_sdk.py: check dynamic loader arch before relocating interpreter Hongxu Jia
@ 2025-01-21 8:55 ` Hongxu Jia
2025-01-21 8:55 ` [PATCH 6/9] meta/conf/bitbake.conf: support multiarch for nativesdk Hongxu Jia
` (3 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
Due to the supported SDKMACHINE includes:
aarch64, i586, i686, loongarch64, ppc64, ppc64le, riscv64, x86_64
Only i586 and x86_64, i686 and x86_64 have multilib relationship,
so create multilib symlinks for i686,i586,x86_64 nativesdk. It will
have no regression when nativesdk-gcc disable multilib support in
which the symlinks is broken
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-devtools/gcc/libgcc-common.inc | 40 +++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
index e3db17d700..ac284a0031 100644
--- a/meta/recipes-devtools/gcc/libgcc-common.inc
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -140,6 +140,46 @@ fakeroot python do_multilib_install() {
os.symlink(src, dest)
}
+# this makes multilib gcc files findable for nativesdk gcc
+# to link multilib nativesdk gcc library
+# e.g.
+# For x86_64 nativesdk-libgcc
+# sysroots/x86_64-pokysdk-linux/usr/lib/i686-pokysdk-linux/14.2.0
+# by creating this symlink to it
+# sysroots/x86_64-pokysdk-linux/usr/lib64/x86_64-pokysdk-linux/14.2.0/32
+#
+# For i686 nativesdk-libgcc
+# sysroots/i686-pokysdk-linux/usr/lib64/x86_64-pokysdk-linux/14.2.0
+# by creating this symlink to it
+# sysroots/i686-pokysdk-linux/usr/lib/i686-pokysdk-linux/14.2.0/64
+
+fakeroot python do_multilib_install:class-nativesdk() {
+ sdk_arch = d.getVar('SDK_ARCH')
+ if sdk_arch not in ['x86_64', 'i686']:
+ return
+
+ binv = d.getVar('BINV')
+ if d.getVar('SDK_ARCH') == 'x86_64':
+ tune_arch = 'i686'
+ tune_bitness = '32'
+ tune_baselib = 'lib'
+ elif d.getVar('SDK_ARCH') in ['i686', 'i586']:
+ tune_arch = 'x86_64'
+ tune_bitness = '64'
+ tune_baselib = 'lib64'
+
+ src = '../../../' + tune_baselib + '/' + \
+ tune_arch + d.getVar('SDK_VENDOR') + \
+ '-' + d.getVar('SDK_OS') + '/' + binv + '/'
+
+ dest = d.getVar('D') + d.getVar('libdir') + '/' + \
+ d.getVar('SDK_SYS') + '/' + binv + '/' + tune_bitness
+
+ if os.path.lexists(dest):
+ os.unlink(dest)
+ os.symlink(src, dest)
+}
+
def get_original_os(d):
vendoros = d.expand('${TARGET_ARCH}${ORIG_TARGET_VENDOR}-${TARGET_OS}')
for suffix in [d.getVar('ABIEXTENSION'), d.getVar('LIBCEXTENSION')]:
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 6/9] meta/conf/bitbake.conf: support multiarch for nativesdk
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
` (3 preceding siblings ...)
2025-01-21 8:55 ` [PATCH 5/9] libgcc-common: apply multilib symlinks for nativesdk libgcc Hongxu Jia
@ 2025-01-21 8:55 ` Hongxu Jia
2025-01-21 8:55 ` [PATCH 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc Hongxu Jia
` (2 subsequent siblings)
7 siblings, 0 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
Otherwise 32bit i686 nativesdk-gcc compiled 64bit executable file
failed
$ cat << ENDOF > main.c
int main() {
return 0;
}
ENDOF
$ i686-pokysdk-linux-gcc -m64 main.c -o main
cc1: sorry, unimplemented: 64-bit mode not compiled in
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/conf/bitbake.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index ba7817b7e5..4668373756 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -922,7 +922,7 @@ IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
# Native distro features (will always be used for -native, even if they
# are not enabled for target)
DISTRO_FEATURES_NATIVE ?= "acl x11 ipv6 xattr"
-DISTRO_FEATURES_NATIVESDK ?= "acl x11 ipv6 xattr"
+DISTRO_FEATURES_NATIVESDK ?= "acl x11 ipv6 xattr multiarch"
DISTRO_FEATURES_NATIVESDK:mingw32 = "x11 ipv6"
# Normally target distro features will not be applied to native builds:
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
` (4 preceding siblings ...)
2025-01-21 8:55 ` [PATCH 6/9] meta/conf/bitbake.conf: support multiarch for nativesdk Hongxu Jia
@ 2025-01-21 8:55 ` Hongxu Jia
2025-01-22 4:20 ` [OE-core] " Khem Raj
2025-01-23 4:53 ` [PATCH v2 " Hongxu Jia
2025-01-21 8:55 ` [PATCH 8/9] Add recipe nativesdk-multiconfig-multlib-toolchain-packager Hongxu Jia
2025-01-21 8:55 ` [PATCH 9/9] selftest/multiconfig: test multiconfig multlib nativesdk gcc Hongxu Jia
7 siblings, 2 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
We have patch 0016-handle-sysroot-support-for-nativesdk-gcc.patch to handle
sysroot support for nativesdk-gcc, and add %r target_relocatable_prefix
into spec file for nativesdk-gcc relocation. It was used for injected
paths SYSTEMLIBS_DIR
Due to the supported SDKMACHINE includes:
aarch64, i586, i686, loongarch64, ppc64, ppc64le, riscv64, x86_64
Only i586 and x86_64, i686 and x86_64 have multilib relationship,
for i586,i686 and x86_64, this commit:
- Tweak target_relocatable_prefix, set ${root_prefix} to it, and tweak
libdir32 and libdir64 based on ${root_prefix} prefix with "/lib" and
"/lib64" suffix.
- Harcode dirnames ['m64', 'm32'] and osdirnames ['../lib64', '../lib']
Above setting also covers gcc-nativesdk without multilib
For other situation, the configuration is the same as usual
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-devtools/gcc/gcc-configure-common.inc | 9 +++++++++
meta/recipes-devtools/gcc/gcc-multilib-config.inc | 5 +++++
.../0016-handle-sysroot-support-for-nativesdk-gcc.patch | 2 +-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index 5c79936242..bd5c953334 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -73,6 +73,14 @@ SYSTEMHEADERS = "${target_includedir}"
SYSTEMLIBS = "${target_base_libdir}/"
SYSTEMLIBS1 = "${target_libdir}/"
+def tune_target_relocatable_prefix(d):
+ if d.getVar("SDK_ARCH") in ["x86_64", "i686", "i586"]:
+ return d.getVar("root_prefix")
+ else:
+ return d.getVar("SYSTEMLIBS")
+TARGET_RELOCATE_PREFIX = "${SYSTEMLIBS}"
+TARGET_RELOCATE_PREFIX:class-nativesdk = "${@tune_target_relocatable_prefix(d)}"
+
do_configure:prepend () {
# teach gcc to find correct target includedir when checking libc ssp support
mkdir -p ${B}/gcc
@@ -83,6 +91,7 @@ do_configure:prepend () {
#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
#define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
+#define TARGET_RELOCATE_PREFIX "${TARGET_RELOCATE_PREFIX}"
#endif /* ! GCC_DEFAULTS_H */
_EOF
mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index 2dbbc23c94..31336f75eb 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -172,6 +172,11 @@ python gcc_multilib_setup() {
target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix
else d.getVar('TARGET_ARCH'))
if pn == "nativesdk-gcc":
+ if d.getVar('SDK_ARCH') in ['x86_64', 'i686', 'i586']:
+ libdir32 = '%r/lib'
+ libdir64 = '%r/lib64'
+ target_config_files = gcc_target_config_files[d.getVar("SDK_ARCH")]
+ write_config(builddir, target_config_files, ['m64', 'm32'], ['64', '32'], ['../lib64', '../lib'])
header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH")]
write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
return
diff --git a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
index edd100ee46..7d96a42027 100644
--- a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
+++ b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
@@ -389,7 +389,7 @@ index e3e9374d1cc..b080609341b 100644
#endif
static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT;
-+static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = TARGET_RELOCATE_PREFIX;
+
/* Nonzero means pass the updated target_system_root to the compiler. */
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 8/9] Add recipe nativesdk-multiconfig-multlib-toolchain-packager
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
` (5 preceding siblings ...)
2025-01-21 8:55 ` [PATCH 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc Hongxu Jia
@ 2025-01-21 8:55 ` Hongxu Jia
2025-01-21 9:05 ` Patchtest results for " patchtest
2025-01-21 9:12 ` [PATCH v2 8/9] nativesdk-multiconfig-multlib-toolchain-packager: add recipe Hongxu Jia
2025-01-21 8:55 ` [PATCH 9/9] selftest/multiconfig: test multiconfig multlib nativesdk gcc Hongxu Jia
7 siblings, 2 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
Support two mutliconfig build x86 and x86_64:
1. Trigger a x86 multiconfig build to generate 32bit x86 buildtools-tarball.
During package runtime installation, script postinst extracted 32bit x86
buildtools-tarball and installed it to 64bit x86_64 nativesdk sysroot.
2. Trigger a x86_64 multiconfig build to generate 64bit x86_64 buildtools-tarball.
During package runtime installation, script postinst extracted 64bit x86_64
buildtools-tarball and installed it to 32bit x86 nativesdk sysroot.
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
...ticonfig-multlib-toolchain-packager_0.1.bb | 74 +++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 meta-selftest/recipes-test/multiconfig/nativesdk-multiconfig-multlib-toolchain-packager_0.1.bb
diff --git a/meta-selftest/recipes-test/multiconfig/nativesdk-multiconfig-multlib-toolchain-packager_0.1.bb b/meta-selftest/recipes-test/multiconfig/nativesdk-multiconfig-multlib-toolchain-packager_0.1.bb
new file mode 100644
index 0000000000..c742c3eddd
--- /dev/null
+++ b/meta-selftest/recipes-test/multiconfig/nativesdk-multiconfig-multlib-toolchain-packager_0.1.bb
@@ -0,0 +1,74 @@
+DESCRIPTION = "Fetch 32bit x86 buildtools-tarball from x86 multiconfig build, \
+extract and install toolchain libraries and include files into 64bit nativesdk sysroot.\
+Or fetch 64bit x86_64 buildtools-tarball from x86_64 multiconfig build, \
+extract and install toolchain libraries and include files into 32bit nativesdk sysroot.\
+"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM ?= "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
+
+inherit nativesdk
+
+MCSDK_ARCH:virtclass-mcextend-x86 = "i686"
+MCSDK_ARCH:virtclass-mcextend-x86_64 = "x86_64"
+
+FROM_MULTICONFIG:virtclass-mcextend-x86_64 = "x86"
+FROM_MULTICONFIG:virtclass-mcextend-x86 = "x86_64"
+
+TO_MULTICONFIG = "${MCNAME}"
+
+MC_SDK_DEPLOY = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/sdk"
+MC_TOOLCHAIN_OUTPUTNAME = "${MCSDK_ARCH}-buildtools-nativesdk-standalone-${DISTRO_VERSION}"
+
+# 64bit x86_64 platform requires 32bit x86 buildtools-tarball
+# Or
+# 32bit x86 platform requires 64bit buildtools-tarball
+do_install[mcdepends] += "mc:${FROM_MULTICONFIG}:${TO_MULTICONFIG}:buildtools-tarball:do_build"
+do_install () {
+ install -d ${D}${localstatedir}/machines/${MCNAME}
+ install ${MC_SDK_DEPLOY}/${MC_TOOLCHAIN_OUTPUTNAME}.sh ${D}${localstatedir}/machines/${MCNAME}/buildtools-tarball.sh
+}
+
+MC_BASELIB:virtclass-mcextend-x86 = "lib"
+MC_BASELIB:virtclass-mcextend-x86_64 = "lib64"
+
+INSTALL_FILES ?= " \
+ /usr/include \
+ /usr/${MC_BASELIB} \
+ /${MC_BASELIB} \
+"
+do_install[vardeps] += "INSTALL_FILES MC_SDK_DEPLOY MC_TOOLCHAIN_OUTPUTNAME"
+
+# Extract and install toolchain libraries and include files into nativesdk sysroot
+pkg_postinst:${PN} () {
+ set -x
+ $D${localstatedir}/machines/${MCNAME}/buildtools-tarball.sh -y -d $D/sdk-${MCNAME}
+ src_prefix="$D/sdk-${MCNAME}/sysroots/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}"
+ for install_file in ${INSTALL_FILES}; do
+ if [ ! -e ${src_prefix}${install_file} ]; then
+ echo "${src_prefix}${install_file} does not exist"
+ exit 1
+ elif [ -d ${src_prefix}${install_file} ]; then
+ install -d $D${SDKPATHNATIVE}${install_file}
+ cp -rf ${src_prefix}${install_file}/* $D${SDKPATHNATIVE}${install_file}/
+ else
+ install -d $D${SDKPATHNATIVE}${install_file%/*}
+ cp -f ${src_prefix}${install_file} $D${SDKPATHNATIVE}${install_file}
+ fi
+ done
+ rm $D/sdk-${MCNAME} -rf
+}
+
+
+python () {
+ mcname = d.getVar('MCNAME')
+ if not mcname:
+ raise bb.parse.SkipRecipe("Not a multiconfig target")
+
+ multiconfigs = d.getVar('BBMULTICONFIG') or ""
+ if mcname not in multiconfigs:
+ raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname)
+}
+
+INSANE_SKIP = "native-last"
+
+BBCLASSEXTEND = "mcextend:x86 mcextend:x86_64"
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [PATCH 9/9] selftest/multiconfig: test multiconfig multlib nativesdk gcc
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
` (6 preceding siblings ...)
2025-01-21 8:55 ` [PATCH 8/9] Add recipe nativesdk-multiconfig-multlib-toolchain-packager Hongxu Jia
@ 2025-01-21 8:55 ` Hongxu Jia
7 siblings, 0 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 8:55 UTC (permalink / raw)
To: openembedded-core
Add 2 cases to test multiconfig multlib nativesdk gcc
1. test_multiconfig_64bit_gcc_suport_32bit_multilib
Build 64bit x86_64 buildtools-tarball with package nativesdk-multiconfig-multlib-toolchain-packager-x86.
The recipe nativesdk-multiconfig-multlib-toolchain-packager trigger a x86 multiconfig
build to generate 32bit x86 buildtools-tarball which contains minimal 32bit toolchains
libraries and include files. The package nativesdk-multiconfig-multlib-toolchain-packager-x86
extract 32bit x86 buildtools-tarball and installed it to 64bit x86_64 nativesdk sysroot.
Then use 64bit gcc to compile 32bit and 64bit hello world program
2. test_multiconfig_32bit_gcc_suport_64bit_multilib
Build 32bit i686 buildtools-tarball with package nativesdk-multiconfig-multlib-toolchain-packager-x86_64.
The recipe nativesdk-multiconfig-multlib-toolchain-packager trigger a x86_64 multiconfig
build to generate 64bit x86_64 buildtools-tarball which contains minimal 64bit toolchains
libraries and include files. The package nativesdk-multiconfig-multlib-toolchain-packager-x86_64
extract 64bit x86_64 buildtools-tarball and installed it to 64bit x86_64 nativesdk sysroot.
Then use 32bit gcc to compile 32bit and 64bit hello world program
...
2025-01-20 22:08:15,003 - oe-selftest - INFO - ... ok
2025-01-20 22:08:15,004 - oe-selftest - INFO - test_multiconfig_32bit_gcc_suport_64bit_multilib (multiconfig.MultiConfig)
2025-01-20 22:17:13,046 - oe-selftest - INFO - ... ok
2025-01-20 22:17:13,047 - oe-selftest - INFO - test_multiconfig_64bit_gcc_suport_32bit_multilib (multiconfig.MultiConfig)
...
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/lib/oeqa/selftest/cases/multiconfig.py | 139 +++++++++++++++++++-
1 file changed, 138 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/cases/multiconfig.py b/meta/lib/oeqa/selftest/cases/multiconfig.py
index f509cbf607..5757612ee3 100644
--- a/meta/lib/oeqa/selftest/cases/multiconfig.py
+++ b/meta/lib/oeqa/selftest/cases/multiconfig.py
@@ -7,7 +7,7 @@
import os
import textwrap
from oeqa.selftest.case import OESelftestTestCase
-from oeqa.utils.commands import bitbake
+from oeqa.utils.commands import bitbake, runCmd, get_bb_vars
class MultiConfig(OESelftestTestCase):
@@ -85,3 +85,140 @@ BBMULTICONFIG = "muslmc"
# Build a core-image-minimal, only dry run needed to check config is present
bitbake('mc:muslmc:bash -n')
+
+ def _run_multilib_nativesdk_gcc(self, environment_script_path, c_example_src):
+ def runCmdEnv(cmd):
+ cmd = '/bin/sh -c ". %s > /dev/null && %s"' % (
+ environment_script_path, cmd)
+ self.logger.debug(cmd)
+ result = runCmd(cmd)
+ self.logger.debug(f"ret: {result.status}, output {result.output}")
+ return result
+
+ runCmdEnv('which gcc')
+ self.logger.debug(f"c_example_src {c_example_src}")
+ result = runCmdEnv("gcc -m32 %s -o main-32 && ./main-32" % (c_example_src))
+ self.assertEqual("Hello world!", result.output, "Compile 32 bit program failed")
+ result = runCmdEnv("gcc -m64 %s -o main-64 && ./main-64" % (c_example_src))
+ self.assertEqual("Hello world!", result.output, "Compile 64 bit program failed")
+
+ def test_multiconfig_64bit_gcc_suport_32bit_multilib(self):
+ """
+ Build 64bit x86_64 buildtools-extended-tarball with package nativesdk-multiconfig-multlib-toolchain-packager-x86.
+ The recipe nativesdk-multiconfig-multlib-toolchain-packager trigger a x86 multiconfig
+ build to generate 32bit x86 buildtools-tarball which contains minimal 32bit toolchains
+ libraries and include files. The package nativesdk-multiconfig-multlib-toolchain-packager-x86
+ extract 32bit x86 buildtools-tarball and installed it to 64bit x86_64 nativesdk sysroot.
+ Then use 64bit gcc to compile 32bit and 64bit hello world program
+ """
+
+ config = """
+BBMULTICONFIG = "x86 x86_64"
+# Unify the same SDKPATHNATIVE for two multiconfig, otherwise
+# nativesdk relocation will fail
+SDKPATHNATIVE = "${SDKPATH}/sysroots/x86_64${SDK_VENDOR}-${SDK_OS}"
+"""
+ self.write_config(config)
+
+ x86config = """
+SDKMACHINE = "i686"
+TMPDIR = "${TOPDIR}/tmp-mc-x86"
+# Only install 32bit toolchains library and include files to buildtools-tarball
+TOOLCHAIN_HOST_TASK:pn-buildtools-tarball = "nativesdk-libgcc nativesdk-libgcc-dev nativesdk-glibc nativesdk-glibc-dev nativesdk-sdk-provides-dummy nativesdk-buildtools-perl-dummy"
+# Do not add relocate script to buildtools-tarball
+SDK_RELOCATE_AFTER_INSTALL:pn-buildtools-tarball = "0"
+"""
+ self.write_config(x86config, 'x86')
+
+ x86_64config = """
+SDKMACHINE = "x86_64"
+TMPDIR = "${TOPDIR}/tmp-mc-x86_64"
+TOOLCHAIN_HOST_TASK:append:pn-buildtools-extended-tarball = " nativesdk-multiconfig-multlib-toolchain-packager-x86"
+# lib64 in 64bit nativesdk sysroot, avoid conflict with 32bit lib
+baselib:class-nativesdk= "lib64"
+baselib:class-crosssdk= "lib64"
+libdir_nativesdk = "${prefix_nativesdk}/lib64"
+base_libdir_nativesdk = "/lib64"
+"""
+ self.write_config(x86_64config, 'x86_64')
+
+ bitbake('mc:x86_64:buildtools-extended-tarball')
+
+ needed_vars = ['TOPDIR', 'DISTRO_VERSION', 'COREBASE', 'SDK_VENDOR']
+ bb_vars = get_bb_vars(needed_vars)
+
+ c_example_src = os.path.join(
+ bb_vars['COREBASE'],
+ 'meta-skeleton/recipes-skeleton/hello-single/files/helloworld.c'
+ )
+ sdk_name = 'x86_64-buildtools-extended-nativesdk-standalone-%s.sh' % bb_vars['DISTRO_VERSION']
+ sdk_path = os.path.join(bb_vars['TOPDIR'], 'tmp-mc-x86_64/deploy/sdk', sdk_name)
+ self.logger.debug(f"sdk_path {sdk_path}")
+ runCmd('sh %s -y -d "%s"' % (sdk_path, './sdk-test'))
+
+ environment_script = 'environment-setup-x86_64%s-linux' % (bb_vars['SDK_VENDOR'])
+ environment_script_path = os.path.join('./sdk-test', environment_script)
+
+ self._run_multilib_nativesdk_gcc(environment_script_path, c_example_src)
+
+ def test_multiconfig_32bit_gcc_suport_64bit_multilib(self):
+ """
+ Build 32bit i686 buildtools-extended-tarball with package nativesdk-multiconfig-multlib-toolchain-packager-x86_64.
+ The recipe nativesdk-multiconfig-multlib-toolchain-packager trigger a x86_64 multiconfig
+ build to generate 64bit x86_64 buildtools-tarball which contains minimal 64bit toolchains
+ libraries and include files. The package nativesdk-multiconfig-multlib-toolchain-packager-x86_64
+ extract 64bit x86_64 buildtools-tarball and installed it to 64bit x86_64 nativesdk sysroot.
+ Then use 64bit gcc to compile 32bit and 64bit hello world program
+ """
+
+ config = """
+BBMULTICONFIG = "x86 x86_64"
+# Unify the same SDKPATHNATIVE for two multiconfig, otherwise
+# nativesdk relocation will fail
+SDKPATHNATIVE = "${SDKPATH}/sysroots/i686${SDK_VENDOR}-${SDK_OS}"
+"""
+ self.write_config(config)
+
+ x86config = """
+SDKMACHINE = "i686"
+TMPDIR = "${TOPDIR}/tmp-mc-x86"
+TOOLCHAIN_HOST_TASK:append:pn-buildtools-extended-tarball = " nativesdk-multiconfig-multlib-toolchain-packager-x86_64"
+"""
+ self.write_config(x86config, 'x86')
+
+ x86_64config = """
+SDKMACHINE = "x86_64"
+TMPDIR = "${TOPDIR}/tmp-mc-x86_64"
+# Only install 64bit toolchains library and include files to buildtools-tarball
+TOOLCHAIN_HOST_TASK:pn-buildtools-tarball = "nativesdk-libgcc nativesdk-libgcc-dev nativesdk-glibc nativesdk-glibc-dev nativesdk-sdk-provides-dummy nativesdk-buildtools-perl-dummy"
+# Do not add relocate script to buildtools-tarball
+SDK_RELOCATE_AFTER_INSTALL:pn-buildtools-tarball = "0"
+
+# lib64 in 64bit nativesdk sysroot, avoid conflict with 32bit lib
+baselib:class-nativesdk= "lib64"
+baselib:class-crosssdk= "lib64"
+libdir_nativesdk = "${prefix_nativesdk}/lib64"
+base_libdir_nativesdk = "/lib64"
+"""
+ self.write_config(x86_64config, 'x86_64')
+
+ bitbake('mc:x86:buildtools-extended-tarball')
+
+ needed_vars = ['TOPDIR', 'DISTRO_VERSION', 'COREBASE', 'SDK_VENDOR']
+ bb_vars = get_bb_vars(needed_vars)
+
+ c_example_src = os.path.join(
+ bb_vars['COREBASE'],
+ 'meta-skeleton/recipes-skeleton/hello-single/files/helloworld.c'
+ )
+ sdk_name = 'i686-buildtools-extended-nativesdk-standalone-%s.sh' % bb_vars['DISTRO_VERSION']
+
+ sdk_path = os.path.join(bb_vars['TOPDIR'], 'tmp-mc-x86/deploy/sdk', sdk_name)
+ self.logger.debug(f"sdk_path {sdk_path}")
+ runCmd('sh %s -y -d "%s"' % (sdk_path, './sdk-test'))
+
+ environment_script = 'environment-setup-i686%s-linux' % (bb_vars['SDK_VENDOR'])
+ environment_script_path = os.path.join('./sdk-test', environment_script)
+
+ self._run_multilib_nativesdk_gcc(environment_script_path, c_example_src)
+
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Patchtest results for [PATCH 8/9] Add recipe nativesdk-multiconfig-multlib-toolchain-packager
2025-01-21 8:55 ` [PATCH 8/9] Add recipe nativesdk-multiconfig-multlib-toolchain-packager Hongxu Jia
@ 2025-01-21 9:05 ` patchtest
2025-01-21 9:12 ` [PATCH v2 8/9] nativesdk-multiconfig-multlib-toolchain-packager: add recipe Hongxu Jia
1 sibling, 0 replies; 19+ messages in thread
From: patchtest @ 2025-01-21 9:05 UTC (permalink / raw)
To: Hongxu Jia; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 3204 bytes --]
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:
---
Testing patch /home/patchtest/share/mboxes/8-9-Add-recipe-nativesdk-multiconfig-multlib-toolchain-packager.patch
FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test bugzilla entry format (test_mbox.TestMbox.test_bugzilla_entry_format)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 8/9] nativesdk-multiconfig-multlib-toolchain-packager: add recipe
2025-01-21 8:55 ` [PATCH 8/9] Add recipe nativesdk-multiconfig-multlib-toolchain-packager Hongxu Jia
2025-01-21 9:05 ` Patchtest results for " patchtest
@ 2025-01-21 9:12 ` Hongxu Jia
1 sibling, 0 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-21 9:12 UTC (permalink / raw)
To: openembedded-core
Support two mutliconfig build x86 and x86_64:
1. Trigger a x86 multiconfig build to generate 32bit x86 buildtools-tarball.
During package runtime installation, script postinst extracted 32bit x86
buildtools-tarball and installed it to 64bit x86_64 nativesdk sysroot.
2. Trigger a x86_64 multiconfig build to generate 64bit x86_64 buildtools-tarball.
During package runtime installation, script postinst extracted 64bit x86_64
buildtools-tarball and installed it to 32bit x86 nativesdk sysroot.
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Changed in v2:
Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"
---
...ticonfig-multlib-toolchain-packager_0.1.bb | 74 +++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 meta-selftest/recipes-test/multiconfig/nativesdk-multiconfig-multlib-toolchain-packager_0.1.bb
diff --git a/meta-selftest/recipes-test/multiconfig/nativesdk-multiconfig-multlib-toolchain-packager_0.1.bb b/meta-selftest/recipes-test/multiconfig/nativesdk-multiconfig-multlib-toolchain-packager_0.1.bb
new file mode 100644
index 0000000000..c742c3eddd
--- /dev/null
+++ b/meta-selftest/recipes-test/multiconfig/nativesdk-multiconfig-multlib-toolchain-packager_0.1.bb
@@ -0,0 +1,74 @@
+DESCRIPTION = "Fetch 32bit x86 buildtools-tarball from x86 multiconfig build, \
+extract and install toolchain libraries and include files into 64bit nativesdk sysroot.\
+Or fetch 64bit x86_64 buildtools-tarball from x86_64 multiconfig build, \
+extract and install toolchain libraries and include files into 32bit nativesdk sysroot.\
+"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM ?= "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
+
+inherit nativesdk
+
+MCSDK_ARCH:virtclass-mcextend-x86 = "i686"
+MCSDK_ARCH:virtclass-mcextend-x86_64 = "x86_64"
+
+FROM_MULTICONFIG:virtclass-mcextend-x86_64 = "x86"
+FROM_MULTICONFIG:virtclass-mcextend-x86 = "x86_64"
+
+TO_MULTICONFIG = "${MCNAME}"
+
+MC_SDK_DEPLOY = "${TOPDIR}/tmp-mc-${MCNAME}/deploy/sdk"
+MC_TOOLCHAIN_OUTPUTNAME = "${MCSDK_ARCH}-buildtools-nativesdk-standalone-${DISTRO_VERSION}"
+
+# 64bit x86_64 platform requires 32bit x86 buildtools-tarball
+# Or
+# 32bit x86 platform requires 64bit buildtools-tarball
+do_install[mcdepends] += "mc:${FROM_MULTICONFIG}:${TO_MULTICONFIG}:buildtools-tarball:do_build"
+do_install () {
+ install -d ${D}${localstatedir}/machines/${MCNAME}
+ install ${MC_SDK_DEPLOY}/${MC_TOOLCHAIN_OUTPUTNAME}.sh ${D}${localstatedir}/machines/${MCNAME}/buildtools-tarball.sh
+}
+
+MC_BASELIB:virtclass-mcextend-x86 = "lib"
+MC_BASELIB:virtclass-mcextend-x86_64 = "lib64"
+
+INSTALL_FILES ?= " \
+ /usr/include \
+ /usr/${MC_BASELIB} \
+ /${MC_BASELIB} \
+"
+do_install[vardeps] += "INSTALL_FILES MC_SDK_DEPLOY MC_TOOLCHAIN_OUTPUTNAME"
+
+# Extract and install toolchain libraries and include files into nativesdk sysroot
+pkg_postinst:${PN} () {
+ set -x
+ $D${localstatedir}/machines/${MCNAME}/buildtools-tarball.sh -y -d $D/sdk-${MCNAME}
+ src_prefix="$D/sdk-${MCNAME}/sysroots/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}"
+ for install_file in ${INSTALL_FILES}; do
+ if [ ! -e ${src_prefix}${install_file} ]; then
+ echo "${src_prefix}${install_file} does not exist"
+ exit 1
+ elif [ -d ${src_prefix}${install_file} ]; then
+ install -d $D${SDKPATHNATIVE}${install_file}
+ cp -rf ${src_prefix}${install_file}/* $D${SDKPATHNATIVE}${install_file}/
+ else
+ install -d $D${SDKPATHNATIVE}${install_file%/*}
+ cp -f ${src_prefix}${install_file} $D${SDKPATHNATIVE}${install_file}
+ fi
+ done
+ rm $D/sdk-${MCNAME} -rf
+}
+
+
+python () {
+ mcname = d.getVar('MCNAME')
+ if not mcname:
+ raise bb.parse.SkipRecipe("Not a multiconfig target")
+
+ multiconfigs = d.getVar('BBMULTICONFIG') or ""
+ if mcname not in multiconfigs:
+ raise bb.parse.SkipRecipe("multiconfig target %s not enabled" % mcname)
+}
+
+INSANE_SKIP = "native-last"
+
+BBCLASSEXTEND = "mcextend:x86 mcextend:x86_64"
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc
2025-01-21 8:55 ` [PATCH 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc Hongxu Jia
@ 2025-01-22 4:20 ` Khem Raj
2025-01-23 4:53 ` [PATCH v2 " Hongxu Jia
1 sibling, 0 replies; 19+ messages in thread
From: Khem Raj @ 2025-01-22 4:20 UTC (permalink / raw)
To: hongxu.jia; +Cc: openembedded-core
seems ok to me.
On Tue, Jan 21, 2025 at 12:55 AM hongxu via lists.openembedded.org
<hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote:
>
> We have patch 0016-handle-sysroot-support-for-nativesdk-gcc.patch to handle
> sysroot support for nativesdk-gcc, and add %r target_relocatable_prefix
> into spec file for nativesdk-gcc relocation. It was used for injected
> paths SYSTEMLIBS_DIR
>
> Due to the supported SDKMACHINE includes:
>
> aarch64, i586, i686, loongarch64, ppc64, ppc64le, riscv64, x86_64
>
> Only i586 and x86_64, i686 and x86_64 have multilib relationship,
> for i586,i686 and x86_64, this commit:
>
> - Tweak target_relocatable_prefix, set ${root_prefix} to it, and tweak
> libdir32 and libdir64 based on ${root_prefix} prefix with "/lib" and
> "/lib64" suffix.
>
> - Harcode dirnames ['m64', 'm32'] and osdirnames ['../lib64', '../lib']
>
> Above setting also covers gcc-nativesdk without multilib
>
> For other situation, the configuration is the same as usual
>
> [ YOCTO #15722 ]
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> meta/recipes-devtools/gcc/gcc-configure-common.inc | 9 +++++++++
> meta/recipes-devtools/gcc/gcc-multilib-config.inc | 5 +++++
> .../0016-handle-sysroot-support-for-nativesdk-gcc.patch | 2 +-
> 3 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> index 5c79936242..bd5c953334 100644
> --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
> +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> @@ -73,6 +73,14 @@ SYSTEMHEADERS = "${target_includedir}"
> SYSTEMLIBS = "${target_base_libdir}/"
> SYSTEMLIBS1 = "${target_libdir}/"
>
> +def tune_target_relocatable_prefix(d):
> + if d.getVar("SDK_ARCH") in ["x86_64", "i686", "i586"]:
> + return d.getVar("root_prefix")
> + else:
> + return d.getVar("SYSTEMLIBS")
> +TARGET_RELOCATE_PREFIX = "${SYSTEMLIBS}"
> +TARGET_RELOCATE_PREFIX:class-nativesdk = "${@tune_target_relocatable_prefix(d)}"
> +
> do_configure:prepend () {
> # teach gcc to find correct target includedir when checking libc ssp support
> mkdir -p ${B}/gcc
> @@ -83,6 +91,7 @@ do_configure:prepend () {
> #define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
> #define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
> #define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
> +#define TARGET_RELOCATE_PREFIX "${TARGET_RELOCATE_PREFIX}"
> #endif /* ! GCC_DEFAULTS_H */
> _EOF
> mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
> diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
> index 2dbbc23c94..31336f75eb 100644
> --- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
> +++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
> @@ -172,6 +172,11 @@ python gcc_multilib_setup() {
> target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix
> else d.getVar('TARGET_ARCH'))
> if pn == "nativesdk-gcc":
> + if d.getVar('SDK_ARCH') in ['x86_64', 'i686', 'i586']:
> + libdir32 = '%r/lib'
> + libdir64 = '%r/lib64'
> + target_config_files = gcc_target_config_files[d.getVar("SDK_ARCH")]
> + write_config(builddir, target_config_files, ['m64', 'm32'], ['64', '32'], ['../lib64', '../lib'])
> header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH")]
> write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
> return
> diff --git a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
> index edd100ee46..7d96a42027 100644
> --- a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
> +++ b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
> @@ -389,7 +389,7 @@ index e3e9374d1cc..b080609341b 100644
> #endif
> static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT;
>
> -+static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
> ++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = TARGET_RELOCATE_PREFIX;
> +
> /* Nonzero means pass the updated target_system_root to the compiler. */
>
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#210079): https://lists.openembedded.org/g/openembedded-core/message/210079
> Mute This Topic: https://lists.openembedded.org/mt/110730425/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v2 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc
2025-01-21 8:55 ` [PATCH 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc Hongxu Jia
2025-01-22 4:20 ` [OE-core] " Khem Raj
@ 2025-01-23 4:53 ` Hongxu Jia
2025-01-23 15:49 ` [OE-core] " Yoann Congal
2025-01-23 17:17 ` hongxu
1 sibling, 2 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-01-23 4:53 UTC (permalink / raw)
To: openembedded-core
We have patch 0016-handle-sysroot-support-for-nativesdk-gcc.patch to handle
sysroot support for nativesdk-gcc, and add %r target_relocatable_prefix
into spec file for nativesdk-gcc relocation. It was used for injected
paths SYSTEMLIBS_DIR
Due to the supported SDKMACHINE includes:
aarch64, i586, i686, loongarch64, ppc64, ppc64le, riscv64, x86_64
Only i586 and x86_64, i686 and x86_64 have multilib relationship,
for i586,i686 and x86_64, this commit:
- Tweak target_relocatable_prefix, set ${root_prefix} to it , and tweak
libdir32 based on ${root_prefix} prefix with "/lib" suffix
- For i686 and i586, hard code `lib' to 32bit osdirname, `lib64' to
libdir64 and 64bit osdirname, whether multlib or not
- For x86_64, use variable baselib to set libdir64 and 64bit osdirnames,
baselib is set to `lib64' for multilib, and `lib' for non multilib
Above setting also covers gcc-nativesdk without multilib
For other situation, the configuration is the same as usual
[ YOCTO #15722 ]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
Changed in v2,
Fix `cargo build' failded in SDK, the interpreter of dynamical loader
is not right
$ rustc build.rs
$ ./build
./build: cannot execute: required file not found
$ file build
build: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter sdk-path-to/sysroots/x86_64-pokysdk-linux/lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=4e012c629e30ebc91c3252eb0fd40358cc5b2dfa, not stripped
$ ls sdk-path-to/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2
sdk-path-to/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2
For x86_64, use variable baselib to set libdir64 and 64bit osdirnames,
baselib is set to `lib64' for multilib, and `lib' for non multilib
meta/recipes-devtools/gcc/gcc-configure-common.inc | 9 +++++++++
meta/recipes-devtools/gcc/gcc-multilib-config.inc | 11 +++++++++++
...016-handle-sysroot-support-for-nativesdk-gcc.patch | 2 +-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index 5c79936242..bd5c953334 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -73,6 +73,14 @@ SYSTEMHEADERS = "${target_includedir}"
SYSTEMLIBS = "${target_base_libdir}/"
SYSTEMLIBS1 = "${target_libdir}/"
+def tune_target_relocatable_prefix(d):
+ if d.getVar("SDK_ARCH") in ["x86_64", "i686", "i586"]:
+ return d.getVar("root_prefix")
+ else:
+ return d.getVar("SYSTEMLIBS")
+TARGET_RELOCATE_PREFIX = "${SYSTEMLIBS}"
+TARGET_RELOCATE_PREFIX:class-nativesdk = "${@tune_target_relocatable_prefix(d)}"
+
do_configure:prepend () {
# teach gcc to find correct target includedir when checking libc ssp support
mkdir -p ${B}/gcc
@@ -83,6 +91,7 @@ do_configure:prepend () {
#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
#define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
+#define TARGET_RELOCATE_PREFIX "${TARGET_RELOCATE_PREFIX}"
#endif /* ! GCC_DEFAULTS_H */
_EOF
mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index 2dbbc23c94..997bb6029b 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -172,6 +172,17 @@ python gcc_multilib_setup() {
target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix
else d.getVar('TARGET_ARCH'))
if pn == "nativesdk-gcc":
+ sdk_arch = d.getVar('SDK_ARCH')
+ if sdk_arch in ['x86_64', 'i686', 'i586']:
+ libdir32 = '%r/lib'
+ if sdk_arch == 'x86_64':
+ libdir64 = '%r/' + d.getVar('baselib')
+ osdirnames = ['../'+d.getVar('baselib') ,'../lib']
+ else:
+ libdir64 = '%r/lib64'
+ osdirnames = ['../lib64', '../lib']
+ target_config_files = gcc_target_config_files[d.getVar("SDK_ARCH")]
+ write_config(builddir, target_config_files, ['m64', 'm32'], ['64', '32'], osdirnames)
header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH")]
write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
return
diff --git a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
index edd100ee46..7d96a42027 100644
--- a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
+++ b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
@@ -389,7 +389,7 @@ index e3e9374d1cc..b080609341b 100644
#endif
static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT;
-+static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = TARGET_RELOCATE_PREFIX;
+
/* Nonzero means pass the updated target_system_root to the compiler. */
--
2.34.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH v2 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc
2025-01-23 4:53 ` [PATCH v2 " Hongxu Jia
@ 2025-01-23 15:49 ` Yoann Congal
2025-01-23 17:17 ` hongxu
1 sibling, 0 replies; 19+ messages in thread
From: Yoann Congal @ 2025-01-23 15:49 UTC (permalink / raw)
To: hongxu.jia; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 6467 bytes --]
Hello,
Le jeu. 23 janv. 2025 à 05:53, hongxu via lists.openembedded.org
<hongxu.jia=eng.windriver.com@lists.openembedded.org> a écrit :
> We have patch 0016-handle-sysroot-support-for-nativesdk-gcc.patch to handle
> sysroot support for nativesdk-gcc, and add %r target_relocatable_prefix
> into spec file for nativesdk-gcc relocation. It was used for injected
> paths SYSTEMLIBS_DIR
>
> Due to the supported SDKMACHINE includes:
>
> aarch64, i586, i686, loongarch64, ppc64, ppc64le, riscv64, x86_64
>
> Only i586 and x86_64, i686 and x86_64 have multilib relationship,
> for i586,i686 and x86_64, this commit:
>
> - Tweak target_relocatable_prefix, set ${root_prefix} to it , and tweak
> libdir32 based on ${root_prefix} prefix with "/lib" suffix
>
> - For i686 and i586, hard code `lib' to 32bit osdirname, `lib64' to
> libdir64 and 64bit osdirname, whether multlib or not
>
> - For x86_64, use variable baselib to set libdir64 and 64bit osdirnames,
> baselib is set to `lib64' for multilib, and `lib' for non multilib
>
> Above setting also covers gcc-nativesdk without multilib
>
> For other situation, the configuration is the same as usual
>
> [ YOCTO #15722 ]
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> Changed in v2,
> Fix `cargo build' failded in SDK, the interpreter of dynamical loader
> is not right
>
> $ rustc build.rs
> $ ./build
> ./build: cannot execute: required file not found
> $ file build
> build: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
> dynamically linked, interpreter
> sdk-path-to/sysroots/x86_64-pokysdk-linux/lib64/ld-linux-x86-64.so.2, for
> GNU/Linux 3.2.0, BuildID[sha1]=4e012c629e30ebc91c3252eb0fd40358cc5b2dfa,
> not stripped
> $ ls sdk-path-to/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2
> sdk-path-to/sysroots/x86_64-pokysdk-linux/lib/ld-linux-x86-64.so.2
>
> For x86_64, use variable baselib to set libdir64 and 64bit osdirnames,
> baselib is set to `lib64' for multilib, and `lib' for non multilib
>
This is the v2 of single patch in the middle of a patch series. Can you send
version iteration of the full series?
Thanks!
> meta/recipes-devtools/gcc/gcc-configure-common.inc | 9 +++++++++
> meta/recipes-devtools/gcc/gcc-multilib-config.inc | 11 +++++++++++
> ...016-handle-sysroot-support-for-nativesdk-gcc.patch | 2 +-
> 3 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc
> b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> index 5c79936242..bd5c953334 100644
> --- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
> +++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
> @@ -73,6 +73,14 @@ SYSTEMHEADERS = "${target_includedir}"
> SYSTEMLIBS = "${target_base_libdir}/"
> SYSTEMLIBS1 = "${target_libdir}/"
>
> +def tune_target_relocatable_prefix(d):
> + if d.getVar("SDK_ARCH") in ["x86_64", "i686", "i586"]:
> + return d.getVar("root_prefix")
> + else:
> + return d.getVar("SYSTEMLIBS")
> +TARGET_RELOCATE_PREFIX = "${SYSTEMLIBS}"
> +TARGET_RELOCATE_PREFIX:class-nativesdk =
> "${@tune_target_relocatable_prefix(d)}"
> +
> do_configure:prepend () {
> # teach gcc to find correct target includedir when checking libc
> ssp support
> mkdir -p ${B}/gcc
> @@ -83,6 +91,7 @@ do_configure:prepend () {
> #define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
> #define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
> #define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
> +#define TARGET_RELOCATE_PREFIX "${TARGET_RELOCATE_PREFIX}"
> #endif /* ! GCC_DEFAULTS_H */
> _EOF
> mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
> diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
> b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
> index 2dbbc23c94..997bb6029b 100644
> --- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
> +++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
> @@ -172,6 +172,17 @@ python gcc_multilib_setup() {
> target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL') if mlprefix
> else d.getVar('TARGET_ARCH'))
> if pn == "nativesdk-gcc":
> + sdk_arch = d.getVar('SDK_ARCH')
> + if sdk_arch in ['x86_64', 'i686', 'i586']:
> + libdir32 = '%r/lib'
> + if sdk_arch == 'x86_64':
> + libdir64 = '%r/' + d.getVar('baselib')
> + osdirnames = ['../'+d.getVar('baselib') ,'../lib']
> + else:
> + libdir64 = '%r/lib64'
> + osdirnames = ['../lib64', '../lib']
> + target_config_files =
> gcc_target_config_files[d.getVar("SDK_ARCH")]
> + write_config(builddir, target_config_files, ['m64', 'm32'],
> ['64', '32'], osdirnames)
> header_config_files =
> gcc_header_config_files[d.getVar("SDK_ARCH")]
> write_headers(builddir, header_config_files, libdir32, libdir64,
> libdirx32, libdirn32)
> return
> diff --git
> a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
> b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
> index edd100ee46..7d96a42027 100644
> ---
> a/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
> +++
> b/meta/recipes-devtools/gcc/gcc/0016-handle-sysroot-support-for-nativesdk-gcc.patch
> @@ -389,7 +389,7 @@ index e3e9374d1cc..b080609341b 100644
> #endif
> static const char *target_system_root = DEFAULT_TARGET_SYSTEM_ROOT;
>
> -+static char target_relocatable_prefix[4096] __attribute__ ((section
> (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
> ++static char target_relocatable_prefix[4096] __attribute__ ((section
> (".gccrelocprefix"))) = TARGET_RELOCATE_PREFIX;
> +
> /* Nonzero means pass the updated target_system_root to the compiler. */
>
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#210174):
> https://lists.openembedded.org/g/openembedded-core/message/210174
> Mute This Topic: https://lists.openembedded.org/mt/110767332/4316185
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> yoann.congal@smile.fr]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
--
Yoann Congal
Smile ECS - Tech expert
[-- Attachment #2: Type: text/html, Size: 8679 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v2 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc
2025-01-23 4:53 ` [PATCH v2 " Hongxu Jia
2025-01-23 15:49 ` [OE-core] " Yoann Congal
@ 2025-01-23 17:17 ` hongxu
1 sibling, 0 replies; 19+ messages in thread
From: hongxu @ 2025-01-23 17:17 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 884 bytes --]
The series is available in https://git.openembedded.org/openembedded-core-contrib/log/?h=mathieu/master-next
selftest/multiconfig: test multiconfig multlib nativesdk gccmathieu/master-next Hongxu Jia
nativesdk-multiconfig-multlib-toolchain-packager: add recipe Hongxu Jia
gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc Hongxu Jia
meta/conf/bitbake.conf: support multiarch for nativesdk Hongxu Jia
libgcc-common: apply multilib symlinks for nativesdk libgcc Hongxu Jia
script/relocate_sdk.py: check dynamic loader arch before relocating interpreter Hongxu Jia
toolchain-shar-relocate.sh: support multiple dynamic loaders for multilib Hongxu Jia
multilib_header.bbclass: need multilib headers for nativesdk builds Hongxu Jia
perl: fix do_install failed for nativesdk-perl Hongxu Jia
//Hongxu
[-- Attachment #2: Type: text/html, Size: 1182 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds
2025-01-21 8:55 ` [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds Hongxu Jia
@ 2025-01-27 13:18 ` Mathieu Dubois-Briand
2025-01-29 16:58 ` Ross Burton
1 sibling, 0 replies; 19+ messages in thread
From: Mathieu Dubois-Briand @ 2025-01-27 13:18 UTC (permalink / raw)
To: hongxu.jia, openembedded-core; +Cc: Joshua Watt
On Tue Jan 21, 2025 at 9:55 AM CET, hongxu via lists.openembedded.org wrote:
> The nativesdk multilib support required it to fix multilib headers
> conflict
>
> [ YOCTO #15722 ]
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
Hi,
I forgot to mention this last week, but it seems this patch is breaking
builds with meta-mingw.
https://autobuilder.yoctoproject.org/valkyrie/#/builders/7/builds/914/steps/12/logs/stdio
Maybe this is something to fix in meta-mingw directly, but I'm not sure
about what cause this issue.
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds
2025-01-21 8:55 ` [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds Hongxu Jia
2025-01-27 13:18 ` [OE-core] " Mathieu Dubois-Briand
@ 2025-01-29 16:58 ` Ross Burton
2025-02-06 7:39 ` Richard Purdie
1 sibling, 1 reply; 19+ messages in thread
From: Ross Burton @ 2025-01-29 16:58 UTC (permalink / raw)
To: hongxu.jia@eng.windriver.com; +Cc: openembedded-core@lists.openembedded.org
On 21 Jan 2025, at 08:55, hongxu via lists.openembedded.org <hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote:
> The nativesdk multilib support required it to fix multilib headers
> conflict
So the context here is that luajit apparently needs to be able to build native code with the same word size as the target. But this demonstrates nicely that nobody has tried to build a 32-bit luajit on a 64-bit non-x86 machine, for example:
| gcc: error: unrecognized command-line option ‘-m32’
So if the goal is “build luajit everywhere” then this doesn’t solve that problem.
Ross
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds
2025-01-29 16:58 ` Ross Burton
@ 2025-02-06 7:39 ` Richard Purdie
2025-02-07 5:21 ` Hongxu Jia
0 siblings, 1 reply; 19+ messages in thread
From: Richard Purdie @ 2025-02-06 7:39 UTC (permalink / raw)
To: ross.burton, hongxu.jia@eng.windriver.com
Cc: openembedded-core@lists.openembedded.org
On Wed, 2025-01-29 at 16:58 +0000, Ross Burton via
lists.openembedded.org wrote:
> On 21 Jan 2025, at 08:55, hongxu via lists.openembedded.org
> <hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote:
> > The nativesdk multilib support required it to fix multilib headers
> > conflict
>
> So the context here is that luajit apparently needs to be able to
> build native code with the same word size as the target. But this
> demonstrates nicely that nobody has tried to build a 32-bit luajit on
> a 64-bit non-x86 machine, for example:
>
> > gcc: error: unrecognized command-line option ‘-m32’
>
> So if the goal is “build luajit everywhere” then this doesn’t solve
> that problem.
I've been giving this a lot of. Part of me does like this solution but
equally, it is complicating something which is already quite complex
for a comparatively isolated problem. As Ross mentions, it only fixes
this for a small subsection there too, it isn't a universal fix.
Some of the patches in the series are simple/trivial but others have
what looks like quite fragile logic (e.g. the libgcc paths).
I'm not convinced merging this and trying to support multilib
nativesdk-gcc is in our best interests unfortunately.
Cheers,
Richard
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [OE-core] [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds
2025-02-06 7:39 ` Richard Purdie
@ 2025-02-07 5:21 ` Hongxu Jia
0 siblings, 0 replies; 19+ messages in thread
From: Hongxu Jia @ 2025-02-07 5:21 UTC (permalink / raw)
To: richard.purdie, ross.burton, hongxu.jia@eng.windriver.com
Cc: openembedded-core@lists.openembedded.org
[-- Attachment #1: Type: text/plain, Size: 2476 bytes --]
Sorry for replying late, I am just back from the vacation
On 2/6/25 15:39, Richard Purdie via lists.openembedded.org wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> On Wed, 2025-01-29 at 16:58 +0000, Ross Burton via
> lists.openembedded.org wrote:
>> On 21 Jan 2025, at 08:55, hongxu via lists.openembedded.org
>> <hongxu.jia=eng.windriver.com@lists.openembedded.org> wrote:
>>> The nativesdk multilib support required it to fix multilib headers
>>> conflict
>> So the context here is that luajit apparently needs to be able to
>> build native code with the same word size as the target. But this
>> demonstrates nicely that nobody has tried to build a 32-bit luajit on
>> a 64-bit non-x86 machine, for example:
>>
>>> gcc: error: unrecognized command-line option ‘-m32’
>> So if the goal is “build luajit everywhere” then this doesn’t solve
>> that problem.
> I've been giving this a lot of. Part of me does like this solution but
> equally, it is complicating something which is already quite complex
> for a comparatively isolated problem. As Ross mentions, it only fixes
> this for a small subsection there too, it isn't a universal fix.
>
> Some of the patches in the series are simple/trivial but others have
> what looks like quite fragile logic (e.g. the libgcc paths).
>
> I'm not convinced merging this and trying to support multilib
> nativesdk-gcc is in our best interests unfortunately.
Agree with you, follow your suggestion, I will drop libgcc patches to
supportmultilib nativesdk-gcc
and pick up the simple/trivial patches from the series and resend them
in v2, including:
[OE-core] [PATCH 3/9] toolchain-shar-relocate.sh: support multiple
dynamic loaders for multilib
[OE-core] [PATCH 4/9] script/relocate_sdk.py: check dynamic loader
arch before relocating interpreter
//Hongxu
> Cheers,
>
> Richard
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#210907):https://lists.openembedded.org/g/openembedded-core/message/210907
> Mute This Topic:https://lists.openembedded.org/mt/110730419/3617049
> Group Owner:openembedded-core+owner@lists.openembedded.org
> Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [hongxu.jia@eng.windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
[-- Attachment #2: Type: text/html, Size: 4418 bytes --]
^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2025-02-07 5:22 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-21 8:55 [PATCH 1/9] perl: fix do_install failed for nativesdk-perl Hongxu Jia
2025-01-21 8:55 ` [PATCH 2/9] multilib_header.bbclass: need multilib headers for nativesdk builds Hongxu Jia
2025-01-27 13:18 ` [OE-core] " Mathieu Dubois-Briand
2025-01-29 16:58 ` Ross Burton
2025-02-06 7:39 ` Richard Purdie
2025-02-07 5:21 ` Hongxu Jia
2025-01-21 8:55 ` [PATCH 3/9] toolchain-shar-relocate.sh: support multiple dynamic loaders for multilib Hongxu Jia
2025-01-21 8:55 ` [PATCH 4/9] script/relocate_sdk.py: check dynamic loader arch before relocating interpreter Hongxu Jia
2025-01-21 8:55 ` [PATCH 5/9] libgcc-common: apply multilib symlinks for nativesdk libgcc Hongxu Jia
2025-01-21 8:55 ` [PATCH 6/9] meta/conf/bitbake.conf: support multiarch for nativesdk Hongxu Jia
2025-01-21 8:55 ` [PATCH 7/9] gcc-configure-common.inc: add multlib support for i686/i586/x86_64 nativesdk gcc Hongxu Jia
2025-01-22 4:20 ` [OE-core] " Khem Raj
2025-01-23 4:53 ` [PATCH v2 " Hongxu Jia
2025-01-23 15:49 ` [OE-core] " Yoann Congal
2025-01-23 17:17 ` hongxu
2025-01-21 8:55 ` [PATCH 8/9] Add recipe nativesdk-multiconfig-multlib-toolchain-packager Hongxu Jia
2025-01-21 9:05 ` Patchtest results for " patchtest
2025-01-21 9:12 ` [PATCH v2 8/9] nativesdk-multiconfig-multlib-toolchain-packager: add recipe Hongxu Jia
2025-01-21 8:55 ` [PATCH 9/9] selftest/multiconfig: test multiconfig multlib nativesdk gcc Hongxu Jia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox