Skip to contentSkip to conversation

On-target multilib gcc enhacement

PATCH Superseded Constantin Musca 1 participant 7 messages Jan 15, 2013

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover On-target multilib gcc enhacement

This patchset enables the user to build gcc with configurable multilib options. The following changes since commit 53cc748b93e8af584557d6db5309c3e955182c5c:

linux-libc-headers: fix headers install in long path name environments (2013-01-10 23:53:51 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib cmuscax/gcc_enhan5
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=cmuscax/gcc_enhan4

Constantin Musca (6):
gcc: add missing dependency (zlib)
gcc: remove the 64bithack patch
multilib.conf: add TARGET_ARCH to MULTILIB_SAVE_VARNAME
gcc: enable multilib for target gcc
tune-mips32: add BASE_LIB to mips32 tunes
tune-ppc603e: add BASE_LIB

 meta/conf/machine/include/tune-mips32.inc          |   4 +
 meta/conf/machine/include/tune-ppc603e.inc         |   1 +
 meta/conf/multilib.conf                            |   2 +-
 meta/recipes-devtools/gcc/gcc-4.7.inc              |   5 +-
 meta/recipes-devtools/gcc/gcc-4.7/64bithack.patch  |  63 -------
 meta/recipes-devtools/gcc/gcc-common.inc           |  25 +++
 meta/recipes-devtools/gcc/gcc-configure-common.inc |   3 +-
 meta/recipes-devtools/gcc/gcc-configure-target.inc |   1 +
 meta/recipes-devtools/gcc/gcc-multilib-config.inc  | 198 +++++++++++++++++++++
 meta/recipes-devtools/gcc/libgcc_4.7.bb            |  44 +++++
 10 files changed, 278 insertions(+), 68 deletions(-)
 delete mode 100644 meta/recipes-devtools/gcc/gcc-4.7/64bithack.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-multilib-config.inc
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH v3 1/6 gcc: add missing dependency (zlib)

- add zlib to DEPENDS (it fails otherwise)

---
 meta/recipes-devtools/gcc/gcc-4.7.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meta/recipes-devtools/gcc/gcc-4.7.inc +2 -2
index 378caf0..08a0103 100644
@@ -1,6 +1,6 @@
 require gcc-common.inc
 
-PR = "r13"
+PR = "r14"
 
 # Third digit in PV should be incremented after a minor release
 # happens from this branch on gcc e.g. currently its 4.7.1
@@ -20,7 +20,7 @@ BINV = "4.7.2"
 
 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/gcc-4.7' ], d)}"
 
-DEPENDS =+ "mpfr gmp libmpc"
+DEPENDS =+ "mpfr gmp libmpc zlib"
 NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
 
 LICENSE="GPL-3.0-with-GCC-exception & GPLv3"
Signature · 1 line
1.7.11.7
#2 lore raw

PATCH v3 2/6 gcc: remove the 64bithack patch

In reply to Constantin Musca
---
 meta/recipes-devtools/gcc/gcc-4.7.inc             |  1 -
 meta/recipes-devtools/gcc/gcc-4.7/64bithack.patch | 63 -----------------------
 2 files changed, 64 deletions(-)
 delete mode 100644 meta/recipes-devtools/gcc/gcc-4.7/64bithack.patch
meta/recipes-devtools/gcc/gcc-4.7.inc +0 -1
index 08a0103..2fad764 100644
@@ -50,7 +50,6 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
            file://gcc-poison-system-directories.patch \
            file://gcc-poison-dir-extend.patch \
            file://gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
-	   file://64bithack.patch \
 	   file://optional_libstdc.patch \
 	   file://disable_relax_pic_calls_flag.patch \
 	   file://COLLECT_GCC_OPTIONS.patch \
meta/recipes-devtools/gcc/gcc-4.7/64bithack.patch deleted +0 -63

63 lines not on this page · raw message

Signature · 1 line
1.7.11.7
#3 lore raw

PATCH v3 3/6 multilib.conf: add TARGET_ARCH to MULTILIB_SAVE_VARNAME

In reply to Constantin Musca
---
 meta/conf/multilib.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/multilib.conf +1 -1
index 97b53ec..daa569c 100644
@@ -2,7 +2,7 @@
 baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or 'lib'}"
 
 MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
-MULTILIB_SAVE_VARNAME = "DEFAULTTUNE"
+MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH"
 
 MULTILIBS ??= "multilib:lib32"
 
Signature · 1 line
1.7.11.7
#4 lore raw

PATCH v3 4/6 gcc: enable multilib for target gcc

In reply to Constantin Musca

- add a task to setup multilib configuration for target gcc
- this commit adapts Nitin Kamble's work to gcc 4.7
- gcc_multilib_setup creates the same patch for all gcc variants
- use a hash for storing the multilib default options
- use a hash for storing arch-dependent multilib options

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]

---
 meta/recipes-devtools/gcc/gcc-4.7.inc              |   2 +-
 meta/recipes-devtools/gcc/gcc-common.inc           |  25 +++
 meta/recipes-devtools/gcc/gcc-configure-common.inc |   3 +-
 meta/recipes-devtools/gcc/gcc-configure-target.inc |   1 +
 meta/recipes-devtools/gcc/gcc-multilib-config.inc  | 198 +++++++++++++++++++++
 meta/recipes-devtools/gcc/libgcc_4.7.bb            |  44 +++++
 6 files changed, 271 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-multilib-config.inc
meta/recipes-devtools/gcc/gcc-4.7.inc +1 -1
index 2fad764..13a1e7e 100644
@@ -1,6 +1,6 @@
 require gcc-common.inc
 
-PR = "r14"
+PR = "r15"
 
 # Third digit in PV should be incremented after a minor release
 # happens from this branch on gcc e.g. currently its 4.7.1
meta/recipes-devtools/gcc/gcc-common.inc +25 -0
index 6e64441..8c8168f 100644
@@ -34,6 +34,29 @@ 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)
+    retdict['baselib'] = localdata.getVar('BASE_LIB', 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"
@@ -62,10 +85,12 @@ SS = "${TMPDIR}/stamps/work-shared/gcc-${PV}-${PR}"
 do_fetch[stamp-base] = "${SS}"
 do_unpack[stamp-base] = "${SS}"
 do_patch[stamp-base] = "${SS}"
+do_gcc_multilib_setup[stamp-base] = "${SS}"
 SSCLEAN = "${TMPDIR}/stamps/work-shared/gcc-[0-9]*-*"
 do_fetch[stamp-base-clean] = "${SSCLEAN}"
 do_unpack[stamp-base-clean] = "${SSCLEAN}"
 do_patch[stamp-base-clean] = "${SSCLEAN}"
+do_gcc_multilib_setup[stamp-base-clean] = "${SSCLEAN}"
 
 # SW means Shared Work directory
 SW = "${TMPDIR}/work-shared/gcc-${PV}-${PR}"
meta/recipes-devtools/gcc/gcc-configure-common.inc +2 -1
index 4eb59fd..b87ea62 100644
@@ -1,3 +1,4 @@
+require gcc-multilib-config.inc
 #
 # Build the list of lanaguages to build.
 #
@@ -25,7 +26,7 @@ EXTRA_OECONF_PATHS ?= ""
 EXTRA_OECONF_INITIAL ?= ""
 EXTRA_OECONF_INTERMEDIATE ?= ""
 
-GCCMULTILIB = "--disable-multilib"
+GCCMULTILIB ?= "--disable-multilib"
 GCCTHREADS ?= "posix"
 
 EXTRA_OECONF = "${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \
meta/recipes-devtools/gcc/gcc-configure-target.inc +1 -0
index f41301f..6cc374b 100644
@@ -1,3 +1,4 @@
+GCCMULTILIB = "--enable-multilib"
 require gcc-configure-common.inc
 
 EXTRA_OECONF_PATHS = " \
meta/recipes-devtools/gcc/gcc-multilib-config.inc new file +198 -0

198 lines not on this page · raw message

meta/recipes-devtools/gcc/libgcc_4.7.bb +44 -0

53 lines not on this page · raw message

Signature · 1 line
1.7.11.7
#5 lore raw

PATCH v3 5/6 tune-mips32: add BASE_LIB to mips32 tunes

In reply to Constantin Musca
---
 meta/conf/machine/include/tune-mips32.inc | 4 ++++
 1 file changed, 4 insertions(+)
meta/conf/machine/include/tune-mips32.inc +4 -0
index 03cd411..ffbaecf 100644
@@ -9,17 +9,21 @@ TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "mips32", "-march=mips32",
 AVAILTUNES += "mips32 mips32el mips32-nf mips32el-nf"
 
 TUNE_FEATURES_tune-mips32 = "${TUNE_FEATURES_tune-mips} mips32"
+BASE_LIB_tune-mips32 = "lib"
 MIPSPKGSFX_VARIANT_tune-mips32 = "mips32"
 PACKAGE_EXTRA_ARCHS_tune-mips32 = "mips mips32"
 
 TUNE_FEATURES_tune-mips32el = "${TUNE_FEATURES_tune-mipsel} mips32"
+BASE_LIB_tune-mips32el = "lib"
 MIPSPKGSFX_VARIANT_tune-mips32el = "mips32el"
 PACKAGE_EXTRA_ARCHS_tune-mips32el = "mipsel mips32el"
 
 TUNE_FEATURES_tune-mips32-nf = "${TUNE_FEATURES_tune-mips-nf} mips32"
+BASE_LIB_tune-mips32-nf = "lib"
 MIPSPKGSFX_VARIANT_tune-mips32-nf = "mips32"
 PACKAGE_EXTRA_ARCHS_tune-mips32-nf = "mips-nf mips32-nf"
 
 TUNE_FEATURES_tune-mips32el-nf = "${TUNE_FEATURES_tune-mipsel-nf} mips32"
+BASE_LIB_tune-mips32el-nf = "lib"
 MIPSPKGSFX_VARIANT_tune-mips32el-nf = "mips32el"
 PACKAGE_EXTRA_ARCHS_tune-mips32el-nf = "mipsel-nf mips32el-nf"
Signature · 1 line
1.7.11.7
#6 lore raw

PATCH v3 6/6 tune-ppc603e: add BASE_LIB

In reply to Constantin Musca
---
 meta/conf/machine/include/tune-ppc603e.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/machine/include/tune-ppc603e.inc +1 -0
index 6557c1d..2cfd342 100644
@@ -7,6 +7,7 @@ TUNE_CCARGS += "${@bb.utils.contains("TUNE_FEATURES", "ppc603e", "-mcpu=603e", "
 
 AVAILTUNES += "ppc603e"
 TUNE_FEATURES_tune-ppc603e = "m32 fpu-hard ppc603e"
+BASE_LIB_tune-ppc603e = "lib"
 TUNE_PKGARCH_tune-ppc603e = "ppc603e"
 PACKAGE_EXTRA_ARCHS_tune-ppc603e = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc603e"
 
Signature · 1 line
1.7.11.7