Skip to contentSkip to conversation

On-target gcc enhancement

PATCH New Constantin Musca 1 participant 4 messages Jan 29, 2013

lore
Share & tools
lore
#0 lore raw

v4 cover On-target gcc enhancement

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

bitbake: build.py: Dump out performance data of individual tasks (2013-01-28 14:49:05 +0000)

are available in the git repository at:

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

Constantin Musca (3):
autotools.bbclass: add EXTRACONFFUNCS variable multilib.conf: add TARGET_ARCH & TARGET_SYS to MULTILIB_SAVE_VARNAME
gcc: enable multilib for target gcc

 meta/classes/autotools.bbclass                     |   4 +-
 meta/conf/multilib.conf                            |   2 +-
 meta/recipes-devtools/gcc/gcc-4.7.inc              |   3 +-
 .../gcc/gcc-4.7/use-ml-conf-files-from-B.patch     |  87 ++++++++++
 meta/recipes-devtools/gcc/gcc-common.inc           |  24 +++
 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  | 190 +++++++++++++++++++++
 meta/recipes-devtools/gcc/libgcc_4.7.bb            |  73 ++++++++
 9 files changed, 383 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.7/use-ml-conf-files-from-B.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-multilib-config.inc
Signature · 1 line
1.7.11.7
#1 lore raw

PATCH v4 1/3 autotools.bbclass: add EXTRACONFFUNCS variable

- add EXTRACONFFUNCS variable in order to make it possible to inject tasks after autotools_preconfigure

---
 meta/classes/autotools.bbclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/classes/autotools.bbclass +3 -1
index 9d1a299..b19a871 100644
@@ -122,7 +122,9 @@ autotools_postconfigure(){
 	fi
 }
 
-do_configure[prefuncs] += "autotools_preconfigure"
+EXTRACONFFUNCS ??= ""
+
+do_configure[prefuncs] += "autotools_preconfigure ${EXTRACONFFUNCS}"
 do_configure[postfuncs] += "autotools_postconfigure"
 
 autotools_do_configure() {
Signature · 1 line
1.7.11.7
#2 lore raw

PATCH v4 2/3 multilib.conf: add TARGET_ARCH & TARGET_SYS 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..8f03661 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 TARGET_SYS"
 
 MULTILIBS ??= "multilib:lib32"
 
Signature · 1 line
1.7.11.7
#3 lore raw

PATCH v4 3/3 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
- 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]

---
 meta/recipes-devtools/gcc/gcc-4.7.inc              |   3 +-
 .../gcc/gcc-4.7/use-ml-conf-files-from-B.patch     |  87 ++++++++++
 meta/recipes-devtools/gcc/gcc-common.inc           |  24 +++
 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  | 190 +++++++++++++++++++++
 meta/recipes-devtools/gcc/libgcc_4.7.bb            |  73 ++++++++
 7 files changed, 379 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.7/use-ml-conf-files-from-B.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-multilib-config.inc
meta/recipes-devtools/gcc/gcc-4.7.inc +2 -1
index 2548f84..d4caf61 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
@@ -74,6 +74,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
 	   file://ppc_no_crtsavres.patch \
 	   file://0001-crtstuff.c-USE_PT_GNU_EH_FRAME-Define-for-systems-us.patch \
 	   file://0001-Makefile.in-vis_hide-gen-hide-list-Do-not-make-defin.patch \
+	   file://use-ml-conf-files-from-B.patch \
 	  "
 SRC_URI[md5sum] = "cc308a0891e778cfda7a151ab8a6e762"
 SRC_URI[sha256sum] = "8a9283d7010fb9fe5ece3ca507e0af5c19412626384f8a5e9434251ae100b084"
meta/recipes-devtools/gcc/gcc-4.7/use-ml-conf-files-from-B.patch new file +87 -0

87 lines not on this page · raw message

meta/recipes-devtools/gcc/gcc-common.inc +24 -0
index 6e64441..ad96989 100644
@@ -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"
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 +190 -0

190 lines not on this page · raw message

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

82 lines not on this page · raw message

Signature · 1 line
1.7.11.7