| Summary: | When generating a multilib MIPS64 SDK, some environment files are broken | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Mark Hatle <mark.hatle> |
| Component: | devtools / tool chain | Assignee: | Richard Purdie <richard.purdie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | meta.mr.watcher, meta.watcher, richard.purdie |
| Version: | 1.7.1 | ||
| Target Milestone: | 1.7.2 | ||
| Hardware: | x86 | ||
| OS: | mips | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
Applying the following patch: arch-mips.inc: Add the MIPS ABIEXTENSION to toolchain name The toolchain uses the TRANSLATED_TARGET_ARCH in it's name, however the target for mips64 and mips64 n32 were the same, causing a conflict. Avoid this conflict by adding the ABIEXTENSION to the name. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> diff --git a/meta/conf/machine/include/mips/arch-mips.inc b/meta/conf/machine/include/mips/arch-mips.inc index 02626d3..08d8fdc 100644 --- a/meta/conf/machine/include/mips/arch-mips.inc +++ b/meta/conf/machine/include/mips/arch-mips.inc @@ -100,3 +100,5 @@ TUNE_FEATURES_tune-mips64el-nf = "n64" BASE_LIB_tune-mips64el-nf = "lib64" MIPSPKGSFX_VARIANT_tune-mips64el-nf = "${TUNE_ARCH}" PACKAGE_EXTRA_ARCHS_tune-mips64el-nf = "mips64el-nf" + +TRANSLATED_TARGET_ARCH_append = "${ABIEXTENSION}" This allows the system to build the missing toolchains: [mhatle@msp-dhcp23 linux2]$ find sysroots/ -name *-gcc sysroots/x86_64-pokysdk-linux/usr/bin/mips64-pokymllib64-linux/mips64-pokymllib64-linux-gcc sysroots/x86_64-pokysdk-linux/usr/bin/mips64-pokymllib32-linux-gnun32/mips64-pokymllib32-linux-gnun32-gcc sysroots/x86_64-pokysdk-linux/usr/bin/mips-poky-linux/mips-poky-linux-gcc However, the environment files still do not work properly: for each in environment-setup-mips* ; do (echo $each ; . $each ; $CC -o hello_$each hello.c) ; done environment-setup-mips32r2-poky-linux environment-setup-mips64-n32-pokymllib32-linux bash: mips64-pokymllib32-linux-gcc: command not found... environment-setup-mips64-pokymllib64-linux In file included from /home/mhatle/git/oss/poky/build-qemumips64/tmp/deploy/sdk/linux2/sysroots/mips32r2-poky-linux/usr/include/features.h:389:0, from /home/mhatle/git/oss/poky/build-qemumips64/tmp/deploy/sdk/linux2/sysroots/mips32r2-poky-linux/usr/include/stdio.h:27, from hello.c:1: /home/mhatle/git/oss/poky/build-qemumips64/tmp/deploy/sdk/linux2/sysroots/mips32r2-poky-linux/usr/include/gnu/stubs.h:35:33: fatal error: gnu/stubs-n64_hard.h: No such file or directory # include <gnu/stubs-n64_hard.h> ^ compilation terminated. With some help from RP, I got it working. Configuration: MACHINE = "qemumips64" require conf/multilib.conf MULTILIBS = "multilib:lib32 multilib:lib64" DEFAULTTUNE = "mips32r2" DEFAULTTUNE_virtclass-multilib-lib32 = "mips64-n32" DEFAULTTUNE_virtclass-multilib-lib64 = "mips64" USE_LDCONFIG = '0' IMAGE_INSTALL_append = "lib32-libgcc lib32-libgcc-dev lib32-glibc lib32-glibc-dev lib64-libgcc lib64-libgcc-dev lib64-glibc lib64-glibc-dev" Patches: (See comment 1 for the ABIEXTENSION patch) Patch from RP: diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass index fec6438..824be07 100644 --- a/meta/classes/cross-canadian.bbclass +++ b/meta/classes/cross-canadian.bbclass @@ -16,6 +16,7 @@ STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${S # PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}" CANADIANEXTRAOS = "" +MODIFYTOS = "1" python () { archs = d.getVar('PACKAGE_ARCHS', True).split() sdkarchs = [] @@ -23,6 +24,9 @@ python () { sdkarchs.append(arch + '-${SDKPKGSUFFIX}') d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs)) + # Allow the following code segment to be disabled, e.g. meta-environment + if d.getVar("MODIFYTOS", True) != "1": + return # PowerPC can build "linux" and "linux-gnuspe" tarch = d.getVar("TARGET_ARCH", True) if tarch == "powerpc": diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb index bb208a3..420c704 100644 --- a/meta/recipes-core/meta/meta-environment.bb +++ b/meta/recipes-core/meta/meta-environment.bb @@ -6,9 +6,7 @@ PR = "r8" EXCLUDE_FROM_WORLD = "1" -ORIGOS := "${TARGET_OS}" - -REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${ORIGOS}" +REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" inherit toolchain-scripts TOOLCHAIN_NEED_CONFIGSITE_CACHE += "zlib" @@ -31,7 +29,6 @@ python do_generate_content() { # make sure we only use the SDKTARGETSYSROOT value from 'd' localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT', True)) - localdata.setVar('TARGET_OS', d.getVar('ORIGOS', True)) localdata.setVar('libdir', d.getVar('target_libdir', False)) # Process DEFAULTTUNE Results from building: for each in environment-setup-mips* ; do (echo $each ; . $each ; $CC -o hello_$each hello.c) ; done environment-setup-mips32r2-poky-linux environment-setup-mips64-n32-pokymllib32-linux-gnun32 environment-setup-mips64-pokymllib64-linux file hello_* hello_environment-setup-mips32r2-poky-linux: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=7c2e4742df4ed7426b3025c71b525d69cf38c962, not stripped hello_environment-setup-mips64-n32-pokymllib32-linux-gnun32: ELF 32-bit MSB executable, MIPS, N32 MIPS64 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=5bf21ce5f65f281cfd58482f95e0e61ae1d5e0db, not stripped hello_environment-setup-mips64-pokymllib64-linux: ELF 64-bit MSB executable, MIPS, MIPS64 version 1 (SYSV), dynamically linked (uses shared libs), BuildID[sha1]=e258c337ce4b54d64985ab98710ba4e9eeb00dbf, for GNU/Linux 2.6.32, not stripped There is a MODIFYTOS = "0" missing from my patch in meta-environment? re comment #3, was a paste error on my part. It was there in my testing. |
configuration (local.conf): MACHINE = "qemumips64" require conf/multilib.conf MULTILIBS = "multilib:lib32 multilib:lib64" DEFAULTTUNE = "mips32r2" DEFAULTTUNE_virtclass-multilib-lib32 = "mips64-n32" DEFAULTTUNE_virtclass-multilib-lib64 = "mips64" Results in an SDK with: environment-setup-mips32r2-poky-linux environment-setup-mips64-n32-pokymllib32-linux environment-setup-mips64-pokymllib64-linux If you try to use these: hello.c: #include <stdio.h> int main() { printf("Hello World!\n"); return 0; } for each in environment-setup-mips* ; do (echo $each ; . $each ; $CC -o hello_$each hello.c) ; done you get: environment-setup-mips32r2-poky-linux environment-setup-mips64-n32-pokymllib32-linux bash: mips64-pokymllib32-linux-gcc: command not found... environment-setup-mips64-pokymllib64-linux bash: mips64-pokymllib64-linux-gcc: command not found... The problem is that the mips64 toolchain is clashing with the mips64-n32 toolchain. Whichever is build first is the one that is produced, but the filename still doesn't match the resulting binaries. sysroots/x86_64-pokysdk-linux/usr/bin/mips64-pokymllib32-linux-gnun32/mips64-pokymllib32-linux-gnun32-gcc sysroots/x86_64-pokysdk-linux/usr/bin/mips-poky-linux/mips-poky-linux-gcc (gnun32 comes from the ABIEXTENSION on the MIPS64-n32 configuration.)