diff options
author | Constantin Musca <constantinx.musca@intel.com> | 2012-12-17 13:46:20 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-02-01 15:54:31 +0000 |
commit | 703b70c98a86771a891b46382f3ee20c4ef93f39 (patch) | |
tree | b4a64935644ce22b6f58d47e3dea56c0ee38af90 /meta/recipes-devtools/gcc/gcc-common.inc | |
parent | 62285873e2a6b9375a96a3de7a500205aeb18fb3 (diff) | |
download | poky-703b70c98a86771a891b46382f3ee20c4ef93f39.tar.gz |
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 <constantinx.musca@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-common.inc')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-common.inc | 24 |
1 files changed, 24 insertions, 0 deletions
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): | |||
34 | return multiarch_options[target_arch] | 34 | return multiarch_options[target_arch] |
35 | return "" | 35 | return "" |
36 | 36 | ||
37 | # this is used by the multilib setup of gcc | ||
38 | def get_tune_parameters(tune, d): | ||
39 | availtunes = d.getVar('AVAILTUNES', True) | ||
40 | if tune not in availtunes.split(): | ||
41 | bb.error('The tune: %s is not one of the available tunes: %s', tune, availtunes) | ||
42 | |||
43 | localdata = bb.data.createCopy(d) | ||
44 | override = ':tune-' + tune | ||
45 | localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override) | ||
46 | bb.data.update_data(localdata) | ||
47 | |||
48 | retdict = {} | ||
49 | retdict['tune'] = tune | ||
50 | retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True) | ||
51 | retdict['features'] = localdata.getVar('TUNE_FEATURES', True) | ||
52 | # BASELIB is used by the multilib code to change library paths | ||
53 | retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True) | ||
54 | retdict['arch'] = localdata.getVar('TUNE_ARCH', True) | ||
55 | retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True) | ||
56 | retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True) | ||
57 | retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True) | ||
58 | retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True) | ||
59 | return retdict | ||
60 | |||
37 | # We really need HOST_SYS here for some packages and TARGET_SYS for others. | 61 | # We really need HOST_SYS here for some packages and TARGET_SYS for others. |
38 | # For now, libgcc is most important so we fix for that - RP. | 62 | # For now, libgcc is most important so we fix for that - RP. |
39 | SHLIBSDIR = "${STAGING_DIR_TARGET}/shlibs" | 63 | SHLIBSDIR = "${STAGING_DIR_TARGET}/shlibs" |