mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
gcc: set the default target arch
The default x86-64 architecture for target gcc (ie, the one in poky build appliances) is native. Since we have a variety of build systems it will occasionally produce instructions that don't work on all of our development system. Instead, set gcc's default architecture to the one specified in TUNE_CC_ARCH, that guarantees that gcc-runtime and any binaries produced are compatible with the target machine type. (From OE-Core rev: 52b952e474e655f8b4b6501813d57e20c9f02ba2) Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
92527cdb76
commit
beea1db008
@@ -32,6 +32,16 @@ def get_gcc_float_setting(bb, d):
|
||||
|
||||
get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}"
|
||||
|
||||
def get_gcc_x86_64_arch_setting(bb, d):
|
||||
import re
|
||||
march = re.match(r'^.*-march=([^\s]*)', d.getVar('TUNE_CCARGS'))
|
||||
if march:
|
||||
return "--with-arch=%s " % march.group(1)
|
||||
# The earliest supported x86-64 CPU
|
||||
return "--with-arch=core2"
|
||||
|
||||
get_gcc_x86_64_arch_setting[vardepvalue] = "${@get_gcc_x86_64_arch_setting(bb, d)}"
|
||||
|
||||
def get_gcc_mips_plt_setting(bb, d):
|
||||
if d.getVar('TRANSLATED_TARGET_ARCH') in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
|
||||
return "--with-mips-plt"
|
||||
|
||||
Reference in New Issue
Block a user