binutils-cross: Build with --enable-shared and install libiberty-pic.a
authorKhem Raj <raj.khem@gmail.com>
Sat, 5 Jun 2010 00:50:32 +0000 (17:50 -0700)
committerKhem Raj <raj.khem@gmail.com>
Sat, 5 Jun 2010 13:52:42 +0000 (06:52 -0700)
* On systems where PIC matters (e.g. MIPS, x86_64) building target
  binutils fails because its configured with --enable-shared but
  when it tried to link a shared library (libopcode.so) then it
  pulls in libiberty.a from the sysroot which is installed by
  binutils-cross earlier. This version however is a static archive
  and linking it with shared libraries not only does not work but
  is wrong too.

* This patch builds binutils-cross with --enable-shared and installs
  the PIC version of libiberty.a into sysroot as libiberty_pic.a
  now when target binutils is configured with --enable-shared and
  searches for PIC version of libiberty.a then it finds it
  correctly.

* Move INC_PR to binutils.inc. Also noticed that several recipes
  do not use binutils.inc so did not touch them

Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 files changed:
recipes/binutils/binutils-cross.inc
recipes/binutils/binutils-cross_cvs.bb
recipes/binutils/binutils.inc
recipes/binutils/binutils_2.16.1.bb
recipes/binutils/binutils_2.16.bb
recipes/binutils/binutils_2.17.50.0.12.bb
recipes/binutils/binutils_2.17.50.0.5.bb
recipes/binutils/binutils_2.17.50.0.8.bb
recipes/binutils/binutils_2.17.bb
recipes/binutils/binutils_2.18.50.0.7.bb
recipes/binutils/binutils_2.18.bb
recipes/binutils/binutils_2.19.1.bb
recipes/binutils/binutils_2.19.51.0.3.bb
recipes/binutils/binutils_2.19.51.bb
recipes/binutils/binutils_2.19.bb
recipes/binutils/binutils_2.20.1.bb
recipes/binutils/binutils_2.20.bb
recipes/binutils/binutils_cvs.bb

index bd22c92..432e1a7 100644 (file)
@@ -6,10 +6,14 @@ PACKAGES = ""
 EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \
                --program-prefix=${TARGET_PREFIX} \
                --enable-install-libbfd \
-                --disable-werror"
+               --enable-shared \
+               --disable-werror \
+              "
 
 do_install () {
        oe_runmake 'DESTDIR=${D}' install
+       install -m 0644 libiberty/pic/libiberty.a \
+       ${D}${libdir}/libiberty_pic.a
 
        # We don't really need these, so we'll remove them...
        rm -rf ${D}${CROSS_DIR}/lib/ldscripts
@@ -23,7 +27,3 @@ do_install () {
        rmdir ${D}${CROSS_DIR}/${libdir}64 || :
        rmdir ${D}${CROSS_DIR}/${prefix} || :
 }
-
-do_stage () {
-       use_do_install_for_stage
-}
index df17028..eee356d 100644 (file)
@@ -2,6 +2,6 @@ require binutils_cvs.bb
 require binutils-cross.inc
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
 
-do_stage () {
+do_install () {
         oe_runmake install-ld install-binutils install-gas
 }
index ee44a5d..a1866f3 100644 (file)
@@ -3,6 +3,8 @@ HOMEPAGE = "http://www.gnu.org/software/binutils/"
 SECTION = "devel"
 LICENSE = "GPL"
 
+INC_PR = "r10"
+
 inherit autotools gettext
 
 PACKAGES += "${PN}-symlinks"
index 688856c..0b3ede1 100644 (file)
@@ -1,5 +1,3 @@
-PR = "r1"
-
 CROSSTOOL_PATCH_URL = "http://www.kegel.com/crosstool/crosstool-0.43/patches/binutils-2.16.1/"
 SRC_URI = \
     "${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2;name=archive \
@@ -14,6 +12,8 @@ SRC_URI = \
 
 require binutils.inc
 
+PR = "${INC_PR}.0"
+
 SRC_URI[archive.md5sum] = "6a9d529efb285071dad10e1f3d2b2967"
 SRC_URI[archive.sha256sum] = "351a6846ee179a37ed87a487971547159a7f4f92a1dec598c727f184a0de61ae"
 SRC_URI[patch1.md5sum] = "b12426fd72bedf00c389a7fb458275a8"
index c8aa2de..35255a8 100644 (file)
@@ -19,6 +19,7 @@ SRC_URI += "file://binutils-2.16-thumb-glue.patch"
 SRC_URI += "file://binutils-2.16.1-e300c2c3.patch"
 
 require binutils.inc
+PR = "${INC_PR}.0"
 
 SRC_URI[md5sum] = "bcb9fabaf0eaf91bd38c4ee148658df8"
 SRC_URI[sha256sum] = "5645c3371aac47cbbcc1354eab10ec32777837d7cb4ba47b94c9043612b12f36"
index 0d2ce9f..dc0c538 100644 (file)
@@ -1,5 +1,4 @@
 require binutils.inc
-INC_PR = "r5"
 PR = "${INC_PR}.1"
 
 SRC_URI = \
index 9a4950d..f0eb7f6 100644 (file)
@@ -1,6 +1,6 @@
 require binutils.inc
 
-PR = "r3"
+PR = "${INC_PR}.0"
 
 SRC_URI = \
     "${KERNELORG_MIRROR}/pub/linux/devel/binutils/binutils-${PV}.tar.bz2 \
index e8a6ebe..450fbf8 100644 (file)
@@ -1,6 +1,5 @@
 require binutils.inc
-
-PR = "r2"
+PR = "${INC_PR}.0"
 
 SRC_URI = \
     "${KERNELORG_MIRROR}/pub/linux/devel/binutils/binutils-${PV}.tar.bz2 \
index 1ffa61d..ce31709 100644 (file)
@@ -1,7 +1,6 @@
 require binutils.inc
 require binutils-avr32.inc
 
-INC_PR = "r7"
 PR = "${INC_PR}.1"
 
 SRC_URI = \
index f9bb77a..a320b4a 100644 (file)
@@ -1,7 +1,7 @@
-INC_PR = "r7"
-PR = "${INC_PR}.1"
 
 require binutils.inc
+PR = "${INC_PR}.1"
+
 LICENSE = "GPLv3"
 
 SRC_URI = "\
index aab634b..6ba551e 100644 (file)
@@ -1,7 +1,5 @@
-INC_PR = "r8"
-PR = "${INC_PR}.2"
-
 require binutils.inc
+PR = "${INC_PR}.2"
 LICENSE = "GPLv3"
 
 SRC_URI = "\
index 68ac7c5..a4ed780 100644 (file)
@@ -1,7 +1,5 @@
-INC_PR = "r1"
-PR = "${INC_PR}.1"
-
 require binutils.inc
+PR = "${INC_PR}.1"
 LICENSE = "GPLv3"
 
 SRC_URI = "\
index dea4551..3141c25 100644 (file)
@@ -1,7 +1,5 @@
-INC_PR = "r1"
-PR = "${INC_PR}.1"
-
 require binutils.inc
+PR = "${INC_PR}.1"
 LICENSE = "GPLv3"
 
 SRC_URI = "\
index 0ebcb33..7dac777 100644 (file)
@@ -1,6 +1,6 @@
-PR = "r2"
-
 require binutils.inc
+PR = "${INC_PR}.0"
+
 LICENSE = "GPLv3"
 
 SRC_URI = "\
index 2a081db..187a99f 100644 (file)
@@ -1,7 +1,5 @@
-INC_PR = "r2"
-PR = "${INC_PR}.1"
-
 require binutils.inc
+PR = "${INC_PR}.1"
 LICENSE = "GPLv3"
 
 SRC_URI = "\
index e573c27..a6b564f 100644 (file)
@@ -1,7 +1,6 @@
 require binutils.inc
 LICENSE = "GPLv3"
 
-INC_PR = "r1"
 PR = "${INC_PR}.0"
 
 SRC_URI = "\
index 9d0438a..54c969c 100644 (file)
@@ -1,7 +1,6 @@
 require binutils.inc
 LICENSE = "GPLv3"
 
-INC_PR = "r2"
 PR = "${INC_PR}.4"
 
 SRC_URI = "\
index e852afb..1e4e210 100644 (file)
@@ -1,9 +1,8 @@
 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-cvs"
 PV = "2.20+cvs${SRCDATE}"
-INC_PR = "r5"
-PR = "${INC_PR}.2"
 
 require binutils.inc
+PR = "${INC_PR}.2"
 
 S = "${WORKDIR}/src"
 EXTRA_OEMAKE = "configure-build-libiberty"