path: root/meta/recipes-devtools/gcc
diff options
authorJulian Pidancet <>2011-11-16 01:01:59 (GMT)
committerRichard Purdie <>2011-11-29 11:22:06 (GMT)
commit7edf5cff9c8815f74804082fef4f0dfcdbab3cf6 (patch)
treef1a3201603c9ecf4eed2abb15cba5d4166ed4f45 /meta/recipes-devtools/gcc
parentf4791847cd22fbb874d471be4abfe5ef5711bd42 (diff)
Introduce multiarch DISTRO_FEATURE
This patch introduces a distro feature which enables gcc to produce both 32bit and 64bit code, and enables binutils to operate on both 32bit and 64bit binaries. It differs from multilib toolchains in that it does not require to compile a version of the libc for each architecture variant. However, the code produced for the secondary architecture will not be linkable against the libc. v2: - Renamed the feature name from "biarch" to "multiarch". The GCC installation manual claims that the mips-linux can be made a tri-arch compiler ( - For x86_64, the compiler is made bi-arch by default, so nothing has to be done in particular. - I analyzed the gcc/config.gcc from GCC sources and added in this patch all the architectures that could be made biarch with the version of gcc currently used in OE, which are powerpc, and sparc, in addition to x86. mips and s390 will probably be supported in future versions of gcc. For x86 and sparc, only the --enable-targets=all option is valid to make this work (this option doesn't have any other side effects than making the compiler bi-arch). For powerpc, I used the --enable-targets=powerpc64 option (although 'all' also works). Note: - Untested on powerpc and sparc. But I believe it works the same as with x86. - gcc in meta-toolchain is also made multiarch. (From OE-Core rev: 99e295ef30ba02db3966c66619807c037ef5089f) Signed-off-by: Julian Pidancet <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'meta/recipes-devtools/gcc')
2 files changed, 12 insertions, 1 deletions
diff --git a/meta/recipes-devtools/gcc/ b/meta/recipes-devtools/gcc/
index 69e0213..7ec2f7e 100644
--- a/meta/recipes-devtools/gcc/
+++ b/meta/recipes-devtools/gcc/
@@ -21,6 +21,16 @@ def get_gcc_mips_plt_setting(bb, d):
21 return "--with-mips-plt" 21 return "--with-mips-plt"
22 return "" 22 return ""
23 23
24def get_gcc_multiarch_setting(bb, d):
25 if 'multiarch' in'DISTRO_FEATURES',d,1).split() :
26 if'TARGET_ARCH', d, 1) in [ 'i586', 'i686' ] :
27 return "--enable-targets=all"
28 if'TARGET_ARCH', d, 1) in [ 'powerpc' ] :
29 return "--enable-targets=powerpc64"
30 if'TARGET_ARCH', d, 1) in [ 'sparc' ] :
31 return "--enable-targets=all"
32 return ""
24# We really need HOST_SYS here for some packages and TARGET_SYS for others. 34# We really need HOST_SYS here for some packages and TARGET_SYS for others.
25# For now, libgcc is most important so we fix for that - RP. 35# For now, libgcc is most important so we fix for that - RP.
diff --git a/meta/recipes-devtools/gcc/ b/meta/recipes-devtools/gcc/
index ae23e8e..d014980 100644
--- a/meta/recipes-devtools/gcc/
+++ b/meta/recipes-devtools/gcc/
@@ -42,7 +42,8 @@ EXTRA_OECONF = "${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', 1) != 'n
45 ${@get_gcc_mips_plt_setting(bb, d)}" 45 ${@get_gcc_mips_plt_setting(bb, d)} \
46 ${@get_gcc_multiarch_setting(bb, d)}"
46 47
47# Build uclibc compilers without cxa_atexit support 48# Build uclibc compilers without cxa_atexit support
48EXTRA_OECONF_append_linux = " --enable-__cxa_atexit" 49EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"