From 703b70c98a86771a891b46382f3ee20c4ef93f39 Mon Sep 17 00:00:00 2001 From: Constantin Musca Date: Mon, 17 Dec 2012 13:46:20 +0200 Subject: gcc: enable multilib for target gcc - add a task to setup multilib configuration for target gcc - this commit adapts Nitin Kamble's work to gcc 4.7 - use a hash for storing arch-dependent multilib options - patch gcc in order to use the multilib config files from the build directory Tests: root@qemux86-64:~# gcc -m64 t.c -o t root@qemux86-64:~# file t t: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped root@qemux86-64:~# ./t Hello World ! root@qemux86-64:~# gcc -m32 t.c -o t root@qemux86-64:~# file t t: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped root@qemux86-64:~# ./t Hello World ! [YOCTO #1369] (From OE-Core rev: b26819c85881e82ee1b5c68840011e78c321f18e) Signed-off-by: Constantin Musca Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- meta/recipes-devtools/gcc/gcc-common.inc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'meta/recipes-devtools/gcc/gcc-common.inc') diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc index 6e64441c3d..ad96989573 100644 --- a/meta/recipes-devtools/gcc/gcc-common.inc +++ b/meta/recipes-devtools/gcc/gcc-common.inc @@ -34,6 +34,30 @@ def get_gcc_multiarch_setting(bb, d): return multiarch_options[target_arch] return "" +# this is used by the multilib setup of gcc +def get_tune_parameters(tune, d): + availtunes = d.getVar('AVAILTUNES', True) + if tune not in availtunes.split(): + bb.error('The tune: %s is not one of the available tunes: %s', tune, availtunes) + + localdata = bb.data.createCopy(d) + override = ':tune-' + tune + localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) + bb.data.update_data(localdata) + + retdict = {} + retdict['tune'] = tune + retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True) + retdict['features'] = localdata.getVar('TUNE_FEATURES', True) + # BASELIB is used by the multilib code to change library paths + retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True) + retdict['arch'] = localdata.getVar('TUNE_ARCH', True) + retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True) + retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True) + retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True) + retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True) + return retdict + # We really need HOST_SYS here for some packages and TARGET_SYS for others. # For now, libgcc is most important so we fix for that - RP. SHLIBSDIR = "${STAGING_DIR_TARGET}/shlibs" -- cgit v1.2.3-54-g00ecf