Skip to contentSkip to conversation

gcc: Configure all gccs with --disable-install-libiberty

PATCH In review Khem Raj 3 participants 7 messages Apr 15, 2020 – Apr 28, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 gcc: Configure all gccs with --disable-install-libiberty

OE uses libiberty from binutils, since its properly compiled as pic archive and applications and other libraries needing libiberty can properly link with it.

With this option applied, explicit delete of libiberty headers and libraries is not required in install step, since they wont get installed in first place.

---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 1 +
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc   | 6 ------
 meta/recipes-devtools/gcc/gcc-cross.inc            | 4 ----
 meta/recipes-devtools/gcc/gcc-target.inc           | 4 ----
 4 files changed, 1 insertion(+), 14 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +1 -0
index bb4f6923f2..a64c4caf00 100644
@@ -33,6 +33,7 @@ EXTRA_OECONF = "\
     --enable-libstdcxx-pch \
     --program-prefix=${TARGET_PREFIX} \
     --without-local-prefix \
+    --disable-install-libiberty \
     ${EXTRA_OECONF_BASE} \
     ${EXTRA_OECONF_GCC_FLOAT} \
     ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +0 -6
index 4aac345bec..553ef7fe62 100644
@@ -108,12 +108,6 @@ do_install () {
 	# We don't care about the gcc-<version> copies
 	rm -f ${D}${bindir}/*gcc-?.?*
 
-	# We use libiberty from binutils
-	rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
-	# Not sure where the strange paths come from
-	rm -f ${D}${libdir}/../lib/libiberty.a
-	rm -f ${D}${libdir}/libiberty.a
-
 	# Cleanup empty directories which are not shipped
 	# we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
 	# ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
meta/recipes-devtools/gcc/gcc-cross.inc +0 -4
index c68cdd5dc4..6fa8c274cd 100644
@@ -117,10 +117,6 @@ do_install () {
 	cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
 	cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
 
-	# We use libiberty from binutils
-	find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
-	find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
 	find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f
 }
 
meta/recipes-devtools/gcc/gcc-target.inc +0 -4
index 34c1b2263b..8cb432780f 100644
@@ -192,10 +192,6 @@ do_install () {
 	# We don't care about the gcc-<version> ones for this
 	rm -f *gcc-?.?*
 
-	# We use libiberty from binutils
-	find ${D}${libdir} -name libiberty.a | xargs rm -f
-	find ${D}${libdir} -name libiberty.h | xargs rm -f
-
 	# Not sure why we end up with these but we don't want them...
 	rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
 
Signature · 1 line
2.26.1
author
#1 lore raw

PATCH 2/3 binutils: Detect proper static-libstdc++ support when using clang

Fixes configure time tests to ensure static-libstdc++ is enabled when using clang

---
 .../binutils/binutils-2.34.inc                |  1 +
 ...or-clang-before-checking-gcc-version.patch | 48 +++++++++++++++++++
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch
meta/recipes-devtools/binutils/binutils-2.34.inc +1 -0
index 4b085b6fe0..66a3850ef2 100644
@@ -40,6 +40,7 @@ SRC_URI = "\
      file://0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
      file://0014-Detect-64-bit-MIPS-targets.patch \
      file://0015-sync-with-OE-libtool-changes.patch \
+     file://0016-Check-for-clang-before-checking-gcc-version.patch \
      file://CVE-2020-0551.patch \
 "
 S  = "${WORKDIR}/git"
meta/recipes-devtools/binutils/binutils/0016-Check-for-clang-before-checking-gcc-version.patch new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
2.26.1
author
#2 lore raw

PATCH 3/3 binutils: Install PIC version of libiberty.a

In reply to Khem Raj

some architectures e.g. mips complain in linking apps which have shared libs that are linking with libiberty.a fixes errors like below

libiberty/../../libiberty/hashtab.c:285:(.text+0xf8): relocation R_MIPS_26 against `htab_create_typed_alloc' cannot be used when making a shared object; recompile with -fPIC

---
 meta/recipes-devtools/binutils/binutils.inc | 5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-devtools/binutils/binutils.inc +5 -0
index 4119960c63..e93cd50b20 100644
@@ -152,6 +152,11 @@ do_install () {
 	install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
 	install -m 644 ${S}/include/libiberty.h ${D}${includedir}
 
+	# insall pic version of libiberty if available
+        if [ -e ${B}/libiberty/pic/libiberty.a ]; then
+		install -Dm 0644 ${B}/libiberty/pic/libiberty.a ${D}${libdir}/libiberty.a
+	fi
+
 	cd ${D}${bindir}
 
 	# Symlinks for ease of running these on the native target
Signature · 1 line
2.26.1
#3 lore raw
In reply to Khem Raj

Hi Khem,

Is this series something I should consider for dunfell LTS?

Steve

Quoted 80 lines · Khem Raj

OE uses libiberty from binutils, since its properly compiled as pic archive and applications and other libraries needing libiberty can properly link with it.

With this option applied, explicit delete of libiberty headers and libraries is not required in install step, since they wont get installed in first place.

---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 1 +
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc   | 6 ------
 meta/recipes-devtools/gcc/gcc-cross.inc            | 4 ----
 meta/recipes-devtools/gcc/gcc-target.inc           | 4 ----
 4 files changed, 1 insertion(+), 14 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +1 -0
index bb4f6923f2..a64c4caf00 100644
@@ -33,6 +33,7 @@ EXTRA_OECONF = "\
     --enable-libstdcxx-pch \
     --program-prefix=${TARGET_PREFIX} \
     --without-local-prefix \
+    --disable-install-libiberty \
     ${EXTRA_OECONF_BASE} \
     ${EXTRA_OECONF_GCC_FLOAT} \
     ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +0 -6
index 4aac345bec..553ef7fe62 100644
@@ -108,12 +108,6 @@ do_install () {
        # We don't care about the gcc-<version> copies
        rm -f ${D}${bindir}/*gcc-?.?*
 
-       # We use libiberty from binutils
-       rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
-       # Not sure where the strange paths come from
-       rm -f ${D}${libdir}/../lib/libiberty.a
-       rm -f ${D}${libdir}/libiberty.a
-
        # Cleanup empty directories which are not shipped
        # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
        # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
meta/recipes-devtools/gcc/gcc-cross.inc +0 -4
index c68cdd5dc4..6fa8c274cd 100644
@@ -117,10 +117,6 @@ do_install () {
        cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
        cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
 
-       # We use libiberty from binutils
-       find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
-       find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
        find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f
 }
 
meta/recipes-devtools/gcc/gcc-target.inc +0 -5
index 34c1b2263b..8cb432780f 100644
@@ -192,10 +192,6 @@ do_install () {
        # We don't care about the gcc-<version> ones for this
        rm -f *gcc-?.?*
 
-       # We use libiberty from binutils
-       find ${D}${libdir} -name libiberty.a | xargs rm -f
-       find ${D}${libdir} -name libiberty.h | xargs rm -f
-
        # Not sure why we end up with these but we don't want them...
        rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
 
--

2.26.1

author
#4 lore raw

Yes Steve, there are good for Dunfell. We should consider them

Quoted 87 lines · Steve Sakoman

Hi Khem,

Is this series something I should consider for dunfell LTS?

Steve

Quoted 80 lines · Khem Raj

OE uses libiberty from binutils, since its properly compiled as pic archive and applications and other libraries needing libiberty can properly link with it.

With this option applied, explicit delete of libiberty headers and libraries is not required in install step, since they wont get installed in first place.

---
  meta/recipes-devtools/gcc/gcc-configure-common.inc | 1 +
  meta/recipes-devtools/gcc/gcc-cross-canadian.inc   | 6 ------
  meta/recipes-devtools/gcc/gcc-cross.inc            | 4 ----
  meta/recipes-devtools/gcc/gcc-target.inc           | 4 ----
  4 files changed, 1 insertion(+), 14 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +1 -0
index bb4f6923f2..a64c4caf00 100644
@@ -33,6 +33,7 @@ EXTRA_OECONF = "\
      --enable-libstdcxx-pch \
      --program-prefix=${TARGET_PREFIX} \
      --without-local-prefix \
+    --disable-install-libiberty \
      ${EXTRA_OECONF_BASE} \
      ${EXTRA_OECONF_GCC_FLOAT} \
      ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +0 -6
index 4aac345bec..553ef7fe62 100644
@@ -108,12 +108,6 @@ do_install () {
         # We don't care about the gcc-<version> copies
         rm -f ${D}${bindir}/*gcc-?.?*
 
-       # We use libiberty from binutils
-       rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
-       # Not sure where the strange paths come from
-       rm -f ${D}${libdir}/../lib/libiberty.a
-       rm -f ${D}${libdir}/libiberty.a
-
         # Cleanup empty directories which are not shipped
         # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
         # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
meta/recipes-devtools/gcc/gcc-cross.inc +0 -4
index c68cdd5dc4..6fa8c274cd 100644
@@ -117,10 +117,6 @@ do_install () {
         cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
         cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
 
-       # We use libiberty from binutils
-       find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
-       find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
         find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f
  }
 
meta/recipes-devtools/gcc/gcc-target.inc +0 -5
index 34c1b2263b..8cb432780f 100644
@@ -192,10 +192,6 @@ do_install () {
         # We don't care about the gcc-<version> ones for this
         rm -f *gcc-?.?*
 
-       # We use libiberty from binutils
-       find ${D}${libdir} -name libiberty.a | xargs rm -f
-       find ${D}${libdir} -name libiberty.h | xargs rm -f
-
         # Not sure why we end up with these but we don't want them...
         rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
 
--

2.26.1

#5 lore raw

Hi, Steve,

Is there a repo/branch available where you collect patches for dunfell-next?

Denys

Quoted 92 lines · Khem Raj

Yes Steve, there are good for Dunfell. We should consider them

Quoted 87 lines · Steve Sakoman

Hi Khem,

Is this series something I should consider for dunfell LTS?

Steve

Quoted 80 lines · Khem Raj

OE uses libiberty from binutils, since its properly compiled as pic archive and applications and other libraries needing libiberty can properly link with it.

With this option applied, explicit delete of libiberty headers and libraries is not required in install step, since they wont get installed in first place.

---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 1 +
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc   | 6 ------
 meta/recipes-devtools/gcc/gcc-cross.inc            | 4 ----
 meta/recipes-devtools/gcc/gcc-target.inc           | 4 ----
 4 files changed, 1 insertion(+), 14 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +1 -0
index bb4f6923f2..a64c4caf00 100644
@@ -33,6 +33,7 @@ EXTRA_OECONF = "\
     --enable-libstdcxx-pch \
     --program-prefix=${TARGET_PREFIX} \
     --without-local-prefix \
+    --disable-install-libiberty \
     ${EXTRA_OECONF_BASE} \
     ${EXTRA_OECONF_GCC_FLOAT} \
     ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +0 -6
index 4aac345bec..553ef7fe62 100644
@@ -108,12 +108,6 @@ do_install () {
        # We don't care about the gcc-<version> copies
        rm -f ${D}${bindir}/*gcc-?.?*
 
-       # We use libiberty from binutils
-       rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
-       # Not sure where the strange paths come from
-       rm -f ${D}${libdir}/../lib/libiberty.a
-       rm -f ${D}${libdir}/libiberty.a
-
        # Cleanup empty directories which are not shipped
        # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
        # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
meta/recipes-devtools/gcc/gcc-cross.inc +0 -4
index c68cdd5dc4..6fa8c274cd 100644
@@ -117,10 +117,6 @@ do_install () {
        cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
        cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
 
-       # We use libiberty from binutils
-       find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
-       find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
        find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f
 }
 
meta/recipes-devtools/gcc/gcc-target.inc +0 -5
index 34c1b2263b..8cb432780f 100644
@@ -192,10 +192,6 @@ do_install () {
        # We don't care about the gcc-<version> ones for this
        rm -f *gcc-?.?*
 
-       # We use libiberty from binutils
-       find ${D}${libdir} -name libiberty.a | xargs rm -f
-       find ${D}${libdir} -name libiberty.h | xargs rm -f
-
        # Not sure why we end up with these but we don't want them...
        rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
 
--

2.26.1

#6 lore raw

On Mon, Apr 27, 2020 at 1:34 PM Denys Dmytriyenko <[email protected]> wrote:

Hi Denys,

Quoted 1 line

Is there a repo/branch available where you collect patches for dunfell-next?

Yes, I'm using a naming scheme similar to what Armin has been doing for stable, so you can find what I'm currently testing on the autobuilder here:

https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=stable/dunfell-nut

The above repo is constructed from component repos in:

https://git.openembedded.org/openembedded-core-contrib/log/?h=stable/dunfell-nut
https://git.openembedded.org/bitbake-contrib/log/?h=stable/1.46-nut

And I'll shortly have pointers to where I am collecting meta-yocto and yocto-docs patches.

I'm still learning all the systems and refining a workflow. I'll be updating this wiki page as I find my way:

https://wiki.yoctoproject.org/wiki/Stable_Release_and_LTS

Suggestions and complaints are welcome ;-)

Steve

Quoted 94 lines · Khem Raj
Quoted 92 lines

Yes Steve, there are good for Dunfell. We should consider them

Quoted 87 lines · Steve Sakoman

Hi Khem,

Is this series something I should consider for dunfell LTS?

Steve

Quoted 80 lines · Khem Raj

OE uses libiberty from binutils, since its properly compiled as pic archive and applications and other libraries needing libiberty can properly link with it.

With this option applied, explicit delete of libiberty headers and libraries is not required in install step, since they wont get installed in first place.

---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 1 +
 meta/recipes-devtools/gcc/gcc-cross-canadian.inc   | 6 ------
 meta/recipes-devtools/gcc/gcc-cross.inc            | 4 ----
 meta/recipes-devtools/gcc/gcc-target.inc           | 4 ----
 4 files changed, 1 insertion(+), 14 deletions(-)
meta/recipes-devtools/gcc/gcc-configure-common.inc +1 -0
index bb4f6923f2..a64c4caf00 100644
@@ -33,6 +33,7 @@ EXTRA_OECONF = "\
     --enable-libstdcxx-pch \
     --program-prefix=${TARGET_PREFIX} \
     --without-local-prefix \
+    --disable-install-libiberty \
     ${EXTRA_OECONF_BASE} \
     ${EXTRA_OECONF_GCC_FLOAT} \
     ${EXTRA_OECONF_PATHS} \
meta/recipes-devtools/gcc/gcc-cross-canadian.inc +0 -6
index 4aac345bec..553ef7fe62 100644
@@ -108,12 +108,6 @@ do_install () {
        # We don't care about the gcc-<version> copies
        rm -f ${D}${bindir}/*gcc-?.?*
 
-       # We use libiberty from binutils
-       rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
-       # Not sure where the strange paths come from
-       rm -f ${D}${libdir}/../lib/libiberty.a
-       rm -f ${D}${libdir}/libiberty.a
-
        # Cleanup empty directories which are not shipped
        # we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
        # ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
meta/recipes-devtools/gcc/gcc-cross.inc +0 -4
index c68cdd5dc4..6fa8c274cd 100644
@@ -117,10 +117,6 @@ do_install () {
        cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
        cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
 
-       # We use libiberty from binutils
-       find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
-       find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
-
        find ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed -type f -not -name "README" -not -name limits.h -not -name syslimits.h | xargs rm -f
 }
 
meta/recipes-devtools/gcc/gcc-target.inc +0 -5
index 34c1b2263b..8cb432780f 100644
@@ -192,10 +192,6 @@ do_install () {
        # We don't care about the gcc-<version> ones for this
        rm -f *gcc-?.?*
 
-       # We use libiberty from binutils
-       find ${D}${libdir} -name libiberty.a | xargs rm -f
-       find ${D}${libdir} -name libiberty.h | xargs rm -f
-
        # Not sure why we end up with these but we don't want them...
        rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
 
--

2.26.1