Bug 4901

Summary: No warning that the toolchain and machine do not match
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Laszlo Papp <lpapp>
Component: devtools / tool chainAssignee: Laurentiu Palcu <laurentiu.palcu>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, meta.mr.watcher, meta.watcher, poky.bs.watcher, poky.watcher, ross.burton
Version: 1.4   
Target Milestone: 1.5   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Laszlo Papp 2013-07-25 06:02:41 UTC
If you use a cross-compilation toolchain setup like this:

TCMODE = "external-sourcery"
EXTERNAL_TOOLCHAIN = "/usr"
TARGET_PREFIX = "arm-none-linux-gnueabi-"

with the following machine which is the default:

MACHINE ??= "qemux86"

... then you will end up having weird toolchain issues without any reference to the setup with regards to MACHINE.

I believe it would make sense to print a warning that the architecture just does not match. That could spare a lot of time for many people, including me.

Nothing fancy, just grab any poky variant, and try to build a "core-image-minimal" image with bitbake. You can use the default local.conf with the three lines above after installing the toolchain:

https://developer.ridgerun.com/wiki/index.php/Code_Sourcery_ARM_toolchain_2009q1-203
Comment 1 Laurentiu Palcu 2013-07-26 09:20:31 UTC
Currently, the TARGET_PREFIX that you set is not taken into account. It's overwritten with CSL_TARGET_SYS, in tcmode-external-sourcery.inc +20.

So, technically, MACHINE setting will be in sync with TARGET_PREFIX. The issue, however, is that the external toolchain does not provide a compiler for this architecture. In this case, there's already an error message printed if MACHINE is set to qemux86 for an arm toolchain:

ERROR: Failed to obtain CodeSourcery toolchain version: Execution of '/home/lau/Personal/tests/ext_toolchain/CodeSourcery/Sourcery_G++_Lite/bin/i686-pc-linux-gnu-gcc -v' failed: command not found

So, we can add another message to ask user to double check his MACHINE setting and the external toolchain to see that they match but it will only be redundant.
Comment 2 Laszlo Papp 2013-07-26 09:25:09 UTC
There is no any redundancy. That error message is unclear, and that is why I had to spend a few days to figure it out.

Surely, as I already wrote, a proper error message would have been a time saver. I would not have needed to waste a few days with it as it would have been clear right up front.
Comment 3 Laurentiu Palcu 2013-07-30 08:15:28 UTC
Patch under review on the ML, waiting merge.
Comment 4 Laszlo Papp 2013-07-30 08:38:40 UTC
Please paste a link next time in the bugreport.