Bug 4901 - No warning that the toolchain and machine do not match
Summary: No warning that the toolchain and machine do not match
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 1.4
Hardware: All Multiple
: Medium normal
Target Milestone: 1.5
Assignee: Laurentiu Palcu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2013-07-25 06:02 UTC by Laszlo Papp
Modified: 2013-07-31 06:12 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.