| Summary: | Set default gcc instruction generation to TARGET_ARCH on target | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Joshua Lock - Disabled <josh> | ||||
| Component: | devtools / tool chain | Assignee: | Khem Raj <raj.khem> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | Low | CC: | dl9pf, meta.mr.watcher, meta.watcher, poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie, ross.burton, sgw | ||||
| Version: | 2.5 | ||||||
| Target Milestone: | Future | ||||||
| Hardware: | All | ||||||
| OS: | Multiple | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||
| Attachments: |
|
||||||
I will look into this. Jessica may have a fix. this may be already fixed in the current code No, its not already fixed. Any news about this? Richard, Nitin can anyone of you guys give me an ideea of what the workload is for this feature? I'll go with 5 days for now so we can schedule it and update appropriate once I have handle on it. I think the gcc-cross-canadian problem has been solved since the environment scripts contain the relavent information and that is probably as good as we're going to get. You'll need to use those scripts since there are other key variables set there. This bug was left open as this problem still exists for the "on target" gcc where if you just use "gcc" on the target, you will not get optimised binaries for that platform. I'm adjusting the bug to reflect this. The patch Joshua attached is still relavent for this. We could configure target gcc using --with-cpu=native which should generate code for the same processor flavor that GCC itself is running on We did start to do this for some platforms: http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/recipes-devtools/gcc/gcc-target.inc EXTRA_OECONF_append_armv6 = " --with-arch=armv6${ARMFPARCHEXT}" EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a${ARMFPARCHEXT}" EXTRA_OECONF_append_armv7ve = " --with-arch=armv7ve${ARMFPARCHEXT}" EXTRA_OECONF_append_arc = " --with-cpu=${TUNE_PKGARCH}" If native would work on the target, that would be a better alternative. No expert on GCC building here. Would changing that bundle of --with-arch assignments to --with-cpu=native be sufficient? (In reply to comment #10) > No expert on GCC building here. Would changing that bundle of --with-arch > assignments to --with-cpu=native be sufficient? --with-arch=native could work on x86_64 only, perhaps it should be done like what we have done with ARM ones, this, however, would mean if someone was to recompile a package natively then it won't use same options as used during cross-compile but perhaps thats acceptable compromise. patch to add march=native for x86_64 is on ml I think we can close it now as the patch is in core |
Created attachment 21 [details] MeeGo's patch to use Atom optimisations by default in GCC It would be useful if the cross compiler shipped with meta-toolchain defaulted to generating instructions for the CPU type of the cross-compilation target. Currently we export CFLAGS="-march=${BASE_PACKAGE_ARCH}" in the environment set up script for meta-toolchain but there's probably a nicer way to do this. MeeGo patches GCC to use Atom optimizations by default (see attached patch), however this tactic wouldn't work well for the multiple architectures Poky targets. Some preliminary investigation by Richard suggests that modifying SUBTARGET32_DEFAULT_CPU could be the right approach, but more investigation is required.