Skip to contentSkip to conversation

binutils: Upgrade to 2.34 release

PATCH Superseded Khem Raj 2 participants 3 messages Feb 19, 2020 – Feb 20, 2020

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v3 1/1 binutils: Upgrade to 2.34 release

Details of changelog [1]

Removing bfd/ld patch to ebale pe targets instead use specific emulations via --enable-targets for x86_64

Re-arrange/forward-port patches and upgrade libctf configure to libtool 2.4 patch

rpaths are no longer emitted into elfedit/readelf therefore no need of chrpath anymore

Instead of pre-generating configure scripts and house them in libtool patch, generate them during configure. This also ensures that we do not patch configure directly but rather the sources which generate it

Package newly added libctf library

[1] https://lists.gnu.org/archive/html/info-gnu/2020-02/msg00000.html

Cc Christopher Clark <[email protected]>

---
v2: Fix libtool patch and drop EFI patch for configure option
v3: Make libtool patch not generate configure, fix packaging

 meta/conf/distro/include/tcmode-default.inc   |     2 +-
 .../{binutils-2.33.inc => binutils-2.34.inc}  |    37 +-
 ....33.bb => binutils-cross-canadian_2.34.bb} |     0
 ...33.bb => binutils-cross-testsuite_2.34.bb} |     0
 ...s-cross_2.33.bb => binutils-cross_2.34.bb} |     0
 ...ssdk_2.33.bb => binutils-crosssdk_2.34.bb} |     0
 meta/recipes-devtools/binutils/binutils.inc   |    26 +-
 ...s-crosssdk-Generate-relocatable-SDKs.patch |    21 +-
 ...o-not-generate-linker-script-directo.patch |    10 +-
 ...k-Search-for-alternative-ld.so.conf.patch} |    78 +-
 ...iden-the-regexp-for-SH-architectures.patch |    44 -
 ...iden-the-regexp-for-SH-architectures.patch |    44 +
 ...-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch |    35 -
 ...05-Point-scripts-location-to-libdir.patch} |    15 +-
 ...-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch |    41 +
 .../binutils/0006-Use-libtool-2.4.patch       | 21203 ----------------
 .../binutils/0007-Use-libtool-2.4.patch       |  7118 ++++++
 ...tro-compiler-point-to-the-wrong-ins.patch} |    13 +-
 ...system-directories-when-cross-linki.patch} |    45 +-
 ...-in-libtool-when-sysroot-is-enabled.patch} |     7 +-
 ...-default-emulation-for-mips64-linux.patch} |    28 +-
 ...> 0012-Add-support-for-Netlogic-XLP.patch} |   117 +-
 ...ct-assembling-for-ppc-wait-mnemonic.patch} |     9 +-
 ... => 0014-Detect-64-bit-MIPS-targets.patch} |     9 +-
 ...x86_64-pep-for-producing-EFI-binarie.patch |    46 -
 ...> 0015-sync-with-OE-libtool-changes.patch} |     7 +-
 .../binutils/binutils/CVE-2019-17450.patch    |    94 -
 .../binutils/binutils/CVE-2019-17451.patch    |    46 -
 .../{binutils_2.33.bb => binutils_2.34.bb}    |     4 +-
 29 files changed, 7476 insertions(+), 21623 deletions(-)
 rename meta/recipes-devtools/binutils/{binutils-2.33.inc => binutils-2.34.inc} (54%)
 rename meta/recipes-devtools/binutils/{binutils-cross-canadian_2.33.bb => binutils-cross-canadian_2.34.bb} (100%)
 rename meta/recipes-devtools/binutils/{binutils-cross-testsuite_2.33.bb => binutils-cross-testsuite_2.34.bb} (100%)
 rename meta/recipes-devtools/binutils/{binutils-cross_2.33.bb => binutils-cross_2.34.bb} (100%)
 rename meta/recipes-devtools/binutils/{binutils-crosssdk_2.33.bb => binutils-crosssdk_2.34.bb} (100%)
 rename meta/recipes-devtools/binutils/binutils/{nativesdk-relocation.patch => 0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch} (56%)
 delete mode 100644 meta/recipes-devtools/binutils/binutils/0003-configure-widen-the-regexp-for-SH-architectures.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0004-configure-widen-the-regexp-for-SH-architectures.patch
 delete mode 100644 meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
 rename meta/recipes-devtools/binutils/binutils/{0004-Point-scripts-location-to-libdir.patch => 0005-Point-scripts-location-to-libdir.patch} (78%)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
 delete mode 100644 meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch
 rename meta/recipes-devtools/binutils/binutils/{0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch => 0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch} (79%)
 rename meta/recipes-devtools/binutils/binutils/{0008-warn-for-uses-of-system-directories-when-cross-linki.patch => 0009-warn-for-uses-of-system-directories-when-cross-linki.patch} (85%)
 rename meta/recipes-devtools/binutils/binutils/{0009-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch => 0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch} (91%)
 rename meta/recipes-devtools/binutils/binutils/{0010-Change-default-emulation-for-mips64-linux.patch => 0011-Change-default-emulation-for-mips64-linux.patch} (77%)
 rename meta/recipes-devtools/binutils/binutils/{0011-Add-support-for-Netlogic-XLP.patch => 0012-Add-support-for-Netlogic-XLP.patch} (81%)
 rename meta/recipes-devtools/binutils/binutils/{0012-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch => 0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch} (85%)
 rename meta/recipes-devtools/binutils/binutils/{0013-Detect-64-bit-MIPS-targets.patch => 0014-Detect-64-bit-MIPS-targets.patch} (86%)
 delete mode 100644 meta/recipes-devtools/binutils/binutils/0015-binutils-enable-x86_64-pep-for-producing-EFI-binarie.patch
 rename meta/recipes-devtools/binutils/binutils/{0014-sync-with-OE-libtool-changes.patch => 0015-sync-with-OE-libtool-changes.patch} (95%)
 delete mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch
 delete mode 100644 meta/recipes-devtools/binutils/binutils/CVE-2019-17451.patch
 rename meta/recipes-devtools/binutils/{binutils_2.33.bb => binutils_2.34.bb} (91%)
meta/conf/distro/include/tcmode-default.inc +1 -1
index 82530f5e7b..e957e3a9bb 100644
@@ -18,7 +18,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
 
 GCCVERSION ?= "9.%"
 SDKGCCVERSION ?= "${GCCVERSION}"
-BINUVERSION ?= "2.33%"
+BINUVERSION ?= "2.34%"
 GDBVERSION ?= "9.%"
 GLIBCVERSION ?= "2.31"
 LINUXLIBCVERSION ?= "5.4%"
meta/recipes-devtools/binutils/binutils-2.34.inc renamed from meta/recipes-devtools/binutils/binutils-2.33.inc +17 -20
similarity index 54%
rename from meta/recipes-devtools/binutils/binutils-2.33.inc
rename to meta/recipes-devtools/binutils/binutils-2.34.inc
index 84a9ec8fc3..2808a1ac56 100644
@@ -14,35 +14,32 @@ def binutils_branch_version(d):
     pvsplit = d.getVar('PV').split('.')
     return pvsplit[0] + "_" + pvsplit[1]
 
-# When upgrading to 2.33, please make sure there is no trailing .0, so
+# When upgrading to 2.35, please make sure there is no trailing .0, so
 # that upstream version check can work correctly.
-PV = "2.33.1"
-CVE_VERSION = "2.33"
+PV = "2.34"
+CVE_VERSION = "2.34"
 BINUPV = "${@binutils_branch_version(d)}"
 #BRANCH = "binutils-${BINUPV}-branch"
-BRANCH ?= "binutils-2_33-branch"
+BRANCH ?= "binutils-2_34-branch"
 
 UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P<pver>\d+_(\d_?)*)"
 
-SRCREV ?= "c656f9a430636a6a7fc7a08c0e08f0098a729a02"
+SRCREV ?= "e2b46ba142d9901897d8189422f0bcc28e5660b8"
 BINUTILS_GIT_URI ?= "git://sourceware.org/git/binutils-gdb.git;branch=${BRANCH};protocol=git"
 SRC_URI = "\
      ${BINUTILS_GIT_URI} \
-     file://0003-configure-widen-the-regexp-for-SH-architectures.patch \
-     file://0004-Point-scripts-location-to-libdir.patch \
-     file://0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
-     file://0006-Use-libtool-2.4.patch \
-     file://0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
-     file://0008-warn-for-uses-of-system-directories-when-cross-linki.patch \
-     file://0009-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
-     file://0010-Change-default-emulation-for-mips64-linux.patch \
-     file://0011-Add-support-for-Netlogic-XLP.patch \
-     file://0012-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch \
-     file://0013-Detect-64-bit-MIPS-targets.patch \
-     file://0014-sync-with-OE-libtool-changes.patch \
-     file://0015-binutils-enable-x86_64-pep-for-producing-EFI-binarie.patch \
-     file://CVE-2019-17450.patch \
-     file://CVE-2019-17451.patch \
+     file://0004-configure-widen-the-regexp-for-SH-architectures.patch \
+     file://0005-Point-scripts-location-to-libdir.patch \
+     file://0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
+     file://0007-Use-libtool-2.4.patch \
+     file://0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
+     file://0009-warn-for-uses-of-system-directories-when-cross-linki.patch \
+     file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
+     file://0011-Change-default-emulation-for-mips64-linux.patch \
+     file://0012-Add-support-for-Netlogic-XLP.patch \
+     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 \
 "
 S  = "${WORKDIR}/git"
 
meta/recipes-devtools/binutils/binutils-cross-canadian_2.34.bb renamed from meta/recipes-devtools/binutils/binutils-cross-canadian_2.33.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/binutils/binutils-cross-canadian_2.33.bb
rename to meta/recipes-devtools/binutils/binutils-cross-canadian_2.34.bb
meta/recipes-devtools/binutils/binutils-cross-testsuite_2.34.bb renamed from meta/recipes-devtools/binutils/binutils-cross-testsuite_2.33.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/binutils/binutils-cross-testsuite_2.33.bb
rename to meta/recipes-devtools/binutils/binutils-cross-testsuite_2.34.bb
meta/recipes-devtools/binutils/binutils-cross_2.34.bb renamed from meta/recipes-devtools/binutils/binutils-cross_2.33.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/binutils/binutils-cross_2.33.bb
rename to meta/recipes-devtools/binutils/binutils-cross_2.34.bb
meta/recipes-devtools/binutils/binutils-crosssdk_2.34.bb renamed from meta/recipes-devtools/binutils/binutils-crosssdk_2.33.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/binutils/binutils-crosssdk_2.33.bb
rename to meta/recipes-devtools/binutils/binutils-crosssdk_2.34.bb
meta/recipes-devtools/binutils/binutils.inc +14 -12
index a4b9aa586d..b070d85e15 100644
@@ -13,17 +13,12 @@ LICENSE = "GPLv3"
 
 DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native"
 
-#
-# we need chrpath > 0.14 and some distros like centos 7 still have older chrpath
-#
-DEPENDS_append_class-target = " chrpath-replacement-native"
-EXTRANATIVEPATH_append_class-target = " chrpath-native"
-
 inherit autotools gettext multilib_header texinfo
 
 FILES_${PN} = " \
 	${bindir}/${TARGET_PREFIX}* \
-	${libdir}/lib*-*.so \
+	${libdir}/lib*.so.* \
+	${libdir}/lib*-${PV}*.so \
 	${prefix}/${TARGET_SYS}/bin/* \
         ${bindir}/embedspu"
 
@@ -33,6 +28,8 @@ FILES_${PN}-dev = " \
 	${includedir} \
 	${libdir}/*.la \
 	${libdir}/libbfd.so \
+	${libdir}/libctf.so \
+	${libdir}/libctf-nobfd.so \
 	${libdir}/libopcodes.so"
 
 # Rather than duplicating multiple entries for these, make one
@@ -80,6 +77,8 @@ EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
                 ${LDGOLD} \
                 ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
 
+EXTRA_OECONF_append_x86-64 = " --enable-targets=x86_64-pe,x86_64-pep "
+
 LDGOLD_class-native = ""
 LDGOLD_class-crosssdk = ""
 LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}"
@@ -112,7 +111,14 @@ export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
 MULTIARCH := "${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}"
 do_configure[vardeps] += "MULTIARCH"
 do_configure () {
-	(cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
+	(for d in . bfd binutils gas gold gprof ld libctf opcodes; do
+            cd ${S}/$d
+            autoconf
+            rm -rf autom4te.cache
+        done
+        cd ${S}
+        gnu-configize)
+
 	oe_runconf
 #
 # must prime config.cache to ensure the build of libiberty
@@ -123,10 +129,6 @@ do_configure () {
 	done
 }
 
-do_compile_append_class-target() {
-	chrpath -d ${B}/binutils/elfedit
-	chrpath -d ${B}/binutils/readelf
-}
 do_install () {
 	autotools_do_install
 
meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch +12 -9
index 3a9461bf4a..a36c259711 100644
@@ -1,7 +1,7 @@
-From c9aed4cb3c02715b2ba1fc70949043849f202f46 Mon Sep 17 00:00:00 2001
+From 9caa0964b6f50411d1b4520a31461cd0a87810fd Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
-Date: Sun, 8 Dec 2019 00:31:35 -0800
-Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs
+Date: Mon, 2 Mar 2015 01:58:54 +0000
+Subject: [PATCH 01/15] binutils-crosssdk: Generate relocatable SDKs
 
 This patch will modify the ELF linker scripts so that the crosssdk
 linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries
@@ -18,23 +18,23 @@ Signed-off-by: Khem Raj <[email protected]>
  2 files changed, 5 insertions(+), 2 deletions(-)
 
 diff --git a/ld/genscripts.sh b/ld/genscripts.sh
-index cb2b081e9e..db2e9fd569 100755
+index 03392d265c..435689ea14 100755
 --- a/ld/genscripts.sh
 +++ b/ld/genscripts.sh
-@@ -325,6 +325,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
+@@ -304,6 +304,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
  LD_FLAG=r
  DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
  DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
 +PARTIAL_LINKING=" "
- ( echo "/* Script for ld -r: link without relocation */"
+ ( echo "/* Script for -r */"
    source_sh ${CUSTOMIZER_SCRIPT}
    source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
-@@ -333,10 +334,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
+@@ -312,10 +313,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
  LD_FLAG=u
  DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
  CONSTRUCTING=" "
 +PARTIAL_LINKING=" "
- ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"
+ ( echo "/* Script for -Ur */"
    source_sh ${CUSTOMIZER_SCRIPT}
    source_sh ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
  ) | sed -e '/^ *$/d;s/[	 ]*$//' > ldscripts/${EMULATION_NAME}.xu
@@ -43,7 +43,7 @@ index cb2b081e9e..db2e9fd569 100755
  DATA_ALIGNMENT=${DATA_ALIGNMENT_}
  RELOCATING=" "
 diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
-index f9f0f7d402..9e469dca86 100644
+index 0b8b32a440..ee6b71075d 100644
 --- a/ld/scripttempl/elf.sc
 +++ b/ld/scripttempl/elf.sc
 @@ -140,8 +140,8 @@ if test -z "$DATA_SEGMENT_ALIGN"; then
@@ -57,3 +57,6 @@ index f9f0f7d402..9e469dca86 100644
  fi
  if test -z "$PLT"; then
    IPLT=".iplt         ${RELOCATING-0} : { *(.iplt) }"
+-- 
+2.25.1
+
meta/recipes-devtools/binutils/binutils/0002-binutils-cross-Do-not-generate-linker-script-directo.patch +7 -3
index 1b499a4504..f71c425ba6 100644
@@ -1,7 +1,8 @@
-From 9fe5a2dd03fdf2986c89dd58ae48c0095f1c0411 Mon Sep 17 00:00:00 2001
+From 0427b3691e544051c208ea9bac9a7fb3accccba7 Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
 Date: Mon, 6 Mar 2017 23:37:05 -0800
-Subject: [PATCH] binutils-cross: Do not generate linker script directories
+Subject: [PATCH 02/15] binutils-cross: Do not generate linker script
+ directories
 
 We don't place target libraries within ${exec_prefix}, we'd always place these
 within the target sysroot within the standard library directories. Worse, the
@@ -22,7 +23,7 @@ Signed-off-by: Khem Raj <[email protected]>
  1 file changed, 25 deletions(-)
 
 diff --git a/ld/genscripts.sh b/ld/genscripts.sh
-index c90f38a63c..97ad1a24d6 100755
+index 435689ea14..cff8a1467f 100755
 --- a/ld/genscripts.sh
 +++ b/ld/genscripts.sh
 @@ -235,31 +235,6 @@ append_to_lib_path()
@@ -57,3 +58,6 @@ index c90f38a63c..97ad1a24d6 100755
  if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
    libs=${NATIVE_LIB_DIRS}
    if [ "x${NATIVE}" = "xyes" ] ; then
+-- 
+2.25.1
+
meta/recipes-devtools/binutils/binutils/0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch renamed from meta/recipes-devtools/binutils/binutils/nativesdk-relocation.patch +48 -30

119 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0003-configure-widen-the-regexp-for-SH-architectures.patch deleted +0 -44

44 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0004-configure-widen-the-regexp-for-SH-architectures.patch new file +44 -0

44 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0005-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch deleted +0 -35
deleted file mode 100644
index 214ae06344..0000000000
@@ -1,35 +0,0 @@
-From 65fb7a33aba30dec8690e0a237efaa3b9649154c Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Mon, 2 Mar 2015 01:27:17 +0000
-Subject: [PATCH] Only generate an RPATH entry if LD_RUN_PATH is not empty
-
-for cases where -rpath isn't specified. debian (#151024)
-
-Upstream-Status: Pending
-
-Signed-off-by: Chris Chimelis <[email protected]>
-Signed-off-by: Khem Raj <[email protected]>
----
- ld/emultempl/elf32.em | 4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/ld/emultempl/elf32.em
-+++ b/ld/emultempl/elf32.em
-@@ -1470,6 +1470,8 @@ fragment <<EOF
- 	      && command_line.rpath == NULL)
- 	    {
- 	      path = (const char *) getenv ("LD_RUN_PATH");
-+	      if ((path) && (strlen (path) == 0))
-+		path = NULL;
- 	      if (path
- 		  && gld${EMULATION_NAME}_search_needed (path, &n, force))
- 		break;
-@@ -1745,6 +1747,8 @@ gld${EMULATION_NAME}_before_allocation (
-   rpath = command_line.rpath;
-   if (rpath == NULL)
-     rpath = (const char *) getenv ("LD_RUN_PATH");
-+  if ((rpath) && (strlen (rpath) == 0))
-+    rpath = NULL;
- 
-   for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
-     if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
meta/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch renamed from meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch +9 -6
similarity index 78%
rename from meta/recipes-devtools/binutils/binutils/0004-Point-scripts-location-to-libdir.patch
rename to meta/recipes-devtools/binutils/binutils/0005-Point-scripts-location-to-libdir.patch
index 8318bd3899..d618fc44b3 100644
@@ -1,7 +1,7 @@
-From a9332107872ada73e72e92872ea2998a4e1495e0 Mon Sep 17 00:00:00 2001
+From 63806906fdfbebffb36ca8bfef1ecfb0c995222a Mon Sep 17 00:00:00 2001
 From: Khem Raj <[email protected]>
 Date: Mon, 2 Mar 2015 01:09:58 +0000
-Subject: [PATCH] Point scripts location to libdir
+Subject: [PATCH 05/15] Point scripts location to libdir
 
 Upstream-Status: Inappropriate [debian patch]
 
@@ -12,10 +12,10 @@ Signed-off-by: Khem Raj <[email protected]>
  2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/ld/Makefile.am b/ld/Makefile.am
-index ddc7a78368..6fa7bf2583 100644
+index 1c132d3ce4..8d82cf2e16 100644
 --- a/ld/Makefile.am
 +++ b/ld/Makefile.am
-@@ -63,7 +63,7 @@ endif
+@@ -64,7 +64,7 @@ endif
  # We put the scripts in the directory $(scriptdir)/ldscripts.
  # We can't put the scripts in $(datadir) because the SEARCH_DIR
  # directives need to be different for native and cross linkers.
@@ -25,10 +25,10 @@ index ddc7a78368..6fa7bf2583 100644
  EMUL = @EMUL@
  EMULATION_OFILES = @EMULATION_OFILES@
 diff --git a/ld/Makefile.in b/ld/Makefile.in
-index fdf06128b2..5c108b9e05 100644
+index e453bc1b33..2dcd72f809 100644
 --- a/ld/Makefile.in
 +++ b/ld/Makefile.in
-@@ -572,7 +572,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
+@@ -573,7 +573,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS)
  # We put the scripts in the directory $(scriptdir)/ldscripts.
  # We can't put the scripts in $(datadir) because the SEARCH_DIR
  # directives need to be different for native and cross linkers.
@@ -37,3 +37,6 @@ index fdf06128b2..5c108b9e05 100644
  BASEDIR = $(srcdir)/..
  BFDDIR = $(BASEDIR)/bfd
  INCDIR = $(BASEDIR)/include
+-- 
+2.25.1
+
meta/recipes-devtools/binutils/binutils/0006-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch new file +41 -0

41 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch deleted +0 -21203

2,482 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch new file +7118 -0

7,118 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch renamed from meta/recipes-devtools/binutils/binutils/0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch +8 -5
similarity index 79%
rename from meta/recipes-devtools/binutils/binutils/0007-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
rename to meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
index 5a195054f6..68fd4de24a 100644

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/binutils/binutils/0009-warn-for-uses-of-system-directories-when-cross-linki.patch renamed from meta/recipes-devtools/binutils/binutils/0008-warn-for-uses-of-system-directories-when-cross-linki.patch +33 -12

45 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch renamed from meta/recipes-devtools/binutils/binutils/0009-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch +5 -2
similarity index 91%
rename from meta/recipes-devtools/binutils/binutils/0009-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
rename to meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
index e63d278bcd..8629be42f5 100644

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch renamed from meta/recipes-devtools/binutils/binutils/0010-Change-default-emulation-for-mips64-linux.patch +18 -10
similarity index 77%
rename from meta/recipes-devtools/binutils/binutils/0010-Change-default-emulation-for-mips64-linux.patch
rename to meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
index e6b50dbcde..3405bf5f36 100644

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/binutils/binutils/0012-Add-support-for-Netlogic-XLP.patch renamed from meta/recipes-devtools/binutils/binutils/0011-Add-support-for-Netlogic-XLP.patch +82 -35

117 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch renamed from meta/recipes-devtools/binutils/binutils/0012-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch +6 -3
similarity index 85%
rename from meta/recipes-devtools/binutils/binutils/0012-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
rename to meta/recipes-devtools/binutils/binutils/0013-fix-the-incorrect-assembling-for-ppc-wait-mnemonic.patch
index f686763594..34a4a3501e 100644

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/binutils/binutils/0014-Detect-64-bit-MIPS-targets.patch renamed from meta/recipes-devtools/binutils/binutils/0013-Detect-64-bit-MIPS-targets.patch +6 -3
similarity index 86%
rename from meta/recipes-devtools/binutils/binutils/0013-Detect-64-bit-MIPS-targets.patch
rename to meta/recipes-devtools/binutils/binutils/0014-Detect-64-bit-MIPS-targets.patch
index 493b05026d..692954596f 100644

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/binutils/binutils/0015-binutils-enable-x86_64-pep-for-producing-EFI-binarie.patch deleted +0 -46

46 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch renamed from meta/recipes-devtools/binutils/binutils/0014-sync-with-OE-libtool-changes.patch +5 -2
similarity index 95%
rename from meta/recipes-devtools/binutils/binutils/0014-sync-with-OE-libtool-changes.patch
rename to meta/recipes-devtools/binutils/binutils/0015-sync-with-OE-libtool-changes.patch
index ae5915d39b..e637d2a128 100644

Lines of this file are not shown. View the raw message.

meta/recipes-devtools/binutils/binutils/CVE-2019-17450.patch deleted +0 -94

94 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/CVE-2019-17451.patch deleted +0 -46

46 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils_2.34.bb renamed from meta/recipes-devtools/binutils/binutils_2.33.bb +2 -2
similarity index 91%
rename from meta/recipes-devtools/binutils/binutils_2.33.bb
rename to meta/recipes-devtools/binutils/binutils_2.34.bb
index 8bd2bf778c..bfc9346822 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.25.1

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 11 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Khem Raj
Sent: den 19 februari 2020 23:43
To: [email protected]
Cc: Christopher Clark <[email protected]>
Subject: [OE-core] [PATCH v3] binutils: Upgrade to 2.34 release

Details of changelog [1]

Removing bfd/ld patch to ebale pe targets instead use

Change "ebale" to "enable".

Quoted 21 lines

specific emulations via --enable-targets for x86_64

Re-arrange/forward-port patches and upgrade libctf configure to libtool 2.4 patch

rpaths are no longer emitted into elfedit/readelf therefore no need of chrpath anymore

Instead of pre-generating configure scripts and house them in libtool patch, generate them during configure. This also ensures that we do not patch configure directly but rather the sources which generate it

Package newly added libctf library

[1] https://lists.gnu.org/archive/html/info-gnu/2020-02/msg00000.html

Cc Christopher Clark <mailto:[email protected]>

---
v2: Fix libtool patch and drop EFI patch for configure option
v3: Make libtool patch not generate configure, fix packaging

[cut]

Quoted 45 lines
meta/recipes-devtools/binutils/binutils.inc +6 -7
index a4b9aa586d..b070d85e15 100644
@@ -13,17 +13,12 @@ LICENSE = "GPLv3"
 
 DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native"
 
-#
-# we need chrpath > 0.14 and some distros like centos 7 still have older chrpath
-#
-DEPENDS_append_class-target = " chrpath-replacement-native"
-EXTRANATIVEPATH_append_class-target = " chrpath-native"
-
 inherit autotools gettext multilib_header texinfo
 
 FILES_${PN} = " \
 	${bindir}/${TARGET_PREFIX}* \
-	${libdir}/lib*-*.so \
+	${libdir}/lib*.so.* \
+	${libdir}/lib*-${PV}*.so \
 	${prefix}/${TARGET_SYS}/bin/* \
         ${bindir}/embedspu"
 
@@ -33,6 +28,8 @@ FILES_${PN}-dev = " \
 	${includedir} \
 	${libdir}/*.la \
 	${libdir}/libbfd.so \
+	${libdir}/libctf.so \
+	${libdir}/libctf-nobfd.so \
 	${libdir}/libopcodes.so"
 
 # Rather than duplicating multiple entries for these, make one
@@ -80,6 +77,8 @@ EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
                 ${LDGOLD} \
                 mailto:${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
 
+EXTRA_OECONF_append_x86-64 = " --enable-targets=x86_64-pe,x86_64-pep "
+
 LDGOLD_class-native = ""
 LDGOLD_class-crosssdk = ""
 LDGOLD ?= "mailto:${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}"
@@ -112,7 +111,14 @@ export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
 MULTIARCH := "mailto:${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}"
 do_configure[vardeps] += "MULTIARCH"

meta/recipes-devtools/binutils/binutils.inc export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}" · line 121

Quoted 10 lines
meta/recipes-devtools/binutils/binutils.inc +8 -1
 do_configure () {
-	(cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
+	(for d in . bfd binutils gas gold gprof ld libctf opcodes; do
+            cd ${S}/$d
+            autoconf
+            rm -rf autom4te.cache
+        done
+        cd ${S}
+        gnu-configize)
+

Correct the indentation to use tabs.

There are also some patches below that still modify configure, which shouldn't be needed with the introduction of autoconf above.

Quoted 29 lines
meta/recipes-devtools/binutils/binutils.inc +0 -4
 	oe_runconf
 #
 # must prime config.cache to ensure the build of libiberty
@@ -123,10 +129,6 @@ do_configure () {
 	done
 }
 
-do_compile_append_class-target() {
-	chrpath -d ${B}/binutils/elfedit
-	chrpath -d ${B}/binutils/readelf
-}
 do_install () {
 	autotools_do_install
 
meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch +3 -3
index 3a9461bf4a..a36c259711 100644
@@ -1,7 +1,7 @@
-From c9aed4cb3c02715b2ba1fc70949043849f202f46 Mon Sep 17 00:00:00 2001
+From 9caa0964b6f50411d1b4520a31461cd0a87810fd Mon Sep 17 00:00:00 2001
 From: Khem Raj <mailto:[email protected]>
-Date: Sun, 8 Dec 2019 00:31:35 -0800
-Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs
+Date: Mon, 2 Mar 2015 01:58:54 +0000
+Subject: [PATCH 01/15] binutils-crosssdk: Generate relocatable SDKs
 
 This patch will modify the ELF linker scripts so that the crosssdk
 linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries

[cut]

meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch index f9f0f7d402..9e469dca86 100644 · line 62

Quoted 7 lines
meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch +3 -0
@@ -57,3 +57,6 @@ index f9f0f7d402..9e469dca86 100644
  fi
  if test -z "$PLT"; then
    IPLT=".iplt         ${RELOCATING-0} : { *(.iplt) }"
+--
+2.25.1
+

May I suggest that you continue to use --no-signature and --no-numbered as options to git format-patch to avoid unnecessary changes to the patches?

[cut]

Quoted 13 lines
meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch new file +7 -0
new file mode 100644
index 0000000000..82906026a9
@@ -0,0 +1,7118 @@
+From c0ec70962bffb56b563475f539e8175ea97d7eb1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sun, 14 Feb 2016 17:04:07 +0000
+Subject: [PATCH 07/15] Use libtool 2.4
+
+get libtool sysroot support
+

meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch line 17

Quoted 10 lines
meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch new file +10 -0
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ bfd/configure.ac |    2 +-
+ libtool.m4       | 1080 +++++++++++------
+ ltmain.sh        | 2925 +++++++++++++++++++++++++++++++---------------
+ ltoptions.m4     |    2 +-
+ ltversion.m4     |   12 +-
+ lt~obsolete.m4   |    2 +-

Wouldn't it be better to run automake --add-missing --copy instead (or autoreconf)? That way you would get rid of all the patches to Makefile.in as well.

meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch line 19

Quoted 2 lines
meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch new file +2 -0
+ 6 files changed, 2717 insertions(+), 1306 deletions(-)
+

[cut]

//Peter

author
#2 lore raw
Quoted 8 lines · Peter Kjellerstedt
Quoted 8 lines

-----Original Message-----
From: [email protected] <openembedded-core- [email protected]> On Behalf Of Khem Raj
Sent: den 19 februari 2020 23:43
To: [email protected]
Cc: Christopher Clark <[email protected]>
Subject: [OE-core] [PATCH v3] binutils: Upgrade to 2.34 release

Quoted 6 lines
Quoted 3 lines

Details of changelog [1]

Removing bfd/ld patch to ebale pe targets instead use

Change "ebale" to "enable".

Will be in v4

Quoted 73 lines
Quoted 21 lines

specific emulations via --enable-targets for x86_64

Re-arrange/forward-port patches and upgrade libctf configure to libtool 2.4 patch

rpaths are no longer emitted into elfedit/readelf therefore no need of chrpath anymore

Instead of pre-generating configure scripts and house them in libtool patch, generate them during configure. This also ensures that we do not patch configure directly but rather the sources which generate it

Package newly added libctf library

[1] https://lists.gnu.org/archive/html/info-gnu/2020-02/msg00000.html

Cc Christopher Clark <mailto:[email protected]>

---
v2: Fix libtool patch and drop EFI patch for configure option
v3: Make libtool patch not generate configure, fix packaging

[cut]

Quoted 49 lines
meta/recipes-devtools/binutils/binutils.inc +8 -8
index a4b9aa586d..b070d85e15 100644
@@ -13,17 +13,12 @@ LICENSE = "GPLv3"
 
  DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native"
 
-#
-# we need chrpath > 0.14 and some distros like centos 7 still have older chrpath
-#
-DEPENDS_append_class-target = " chrpath-replacement-native"
-EXTRANATIVEPATH_append_class-target = " chrpath-native"
-
  inherit autotools gettext multilib_header texinfo
 
  FILES_${PN} = " \
  	${bindir}/${TARGET_PREFIX}* \
-	${libdir}/lib*-*.so \
+	${libdir}/lib*.so.* \
+	${libdir}/lib*-${PV}*.so \
  	${prefix}/${TARGET_SYS}/bin/* \
          ${bindir}/embedspu"
 
@@ -33,6 +28,8 @@ FILES_${PN}-dev = " \
  	${includedir} \
  	${libdir}/*.la \
  	${libdir}/libbfd.so \
+	${libdir}/libctf.so \
+	${libdir}/libctf-nobfd.so \
  	${libdir}/libopcodes.so"
 
  # Rather than duplicating multiple entries for these, make one
@@ -80,6 +77,8 @@ EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
                  ${LDGOLD} \
                  mailto:${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
 
+EXTRA_OECONF_append_x86-64 = " --enable-targets=x86_64-pe,x86_64-pep "
+
  LDGOLD_class-native = ""
  LDGOLD_class-crosssdk = ""
  LDGOLD ?= "mailto:${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}"
@@ -112,7 +111,14 @@ export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
  MULTIARCH := "mailto:${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}"
  do_configure[vardeps] += "MULTIARCH"
  do_configure () {
-	(cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
+	(for d in . bfd binutils gas gold gprof ld libctf opcodes; do
+            cd ${S}/$d
Quoted 9 lines

meta/recipes-devtools/binutils/binutils.inc export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}" · line 121

Quoted 6 lines
meta/recipes-devtools/binutils/binutils.inc +6 -0
+            autoconf
+            rm -rf autom4te.cache
+        done
+        cd ${S}
+        gnu-configize)
+

Correct the indentation to use tabs.

in v4

Quoted 3 lines

There are also some patches below that still modify configure, which shouldn't be needed with the introduction of autoconf above.

thats intentional. Ideally all patches should modify configure since that will be needed if they are upstreamed. However, libtool 2.4 is quite intrusive where it has to be regenerated almost everytime it is rebased on top of latest binutils.

Quoted 32 lines
Quoted 29 lines
meta/recipes-devtools/binutils/binutils.inc +0 -4
  	oe_runconf
  #
  # must prime config.cache to ensure the build of libiberty
@@ -123,10 +129,6 @@ do_configure () {
  	done
  }
 
-do_compile_append_class-target() {
-	chrpath -d ${B}/binutils/elfedit
-	chrpath -d ${B}/binutils/readelf
-}
  do_install () {
  	autotools_do_install
 
meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch +3 -3
index 3a9461bf4a..a36c259711 100644
@@ -1,7 +1,7 @@
-From c9aed4cb3c02715b2ba1fc70949043849f202f46 Mon Sep 17 00:00:00 2001
+From 9caa0964b6f50411d1b4520a31461cd0a87810fd Mon Sep 17 00:00:00 2001
  From: Khem Raj <mailto:[email protected]>
-Date: Sun, 8 Dec 2019 00:31:35 -0800
-Subject: [PATCH] binutils-crosssdk: Generate relocatable SDKs
+Date: Mon, 2 Mar 2015 01:58:54 +0000
+Subject: [PATCH 01/15] binutils-crosssdk: Generate relocatable SDKs
 
  This patch will modify the ELF linker scripts so that the crosssdk
  linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries

[cut]

Quoted 11 lines

meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch index f9f0f7d402..9e469dca86 100644 · line 62

Quoted 7 lines
meta/recipes-devtools/binutils/binutils/0001-binutils-crosssdk-Generate-relocatable-SDKs.patch +3 -0
@@ -57,3 +57,6 @@ index f9f0f7d402..9e469dca86 100644
   fi
   if test -z "$PLT"; then
     IPLT=".iplt         ${RELOCATING-0} : { *(.iplt) }"
+--
+2.25.1
+

May I suggest that you continue to use --no-signature and --no-numbered as options to git format-patch to avoid unnecessary changes to the patches?

I guess yes will be in v4

Quoted 21 lines

[cut]

Quoted 19 lines
meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch new file +13 -0
new file mode 100644
index 0000000000..82906026a9
@@ -0,0 +1,7118 @@
+From c0ec70962bffb56b563475f539e8175ea97d7eb1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sun, 14 Feb 2016 17:04:07 +0000
+Subject: [PATCH 07/15] Use libtool 2.4
+
+get libtool sysroot support
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ bfd/configure.ac |    2 +-
+ libtool.m4       | 1080 +++++++++++------
Quoted 8 lines

meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch line 17

Quoted 4 lines
meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch new file +4 -0
+ ltmain.sh        | 2925 +++++++++++++++++++++++++++++++---------------
+ ltoptions.m4     |    2 +-
+ ltversion.m4     |   12 +-
+ lt~obsolete.m4   |    2 +-

Wouldn't it be better to run automake --add-missing --copy instead (or autoreconf)? That way you would get rid of all the patches to Makefile.in as well.

As said above, we only want to regenerate configure, nothing else, there are different versions of gettext etc would be needed to fully reconfigure it and its version specific.

Quoted 8 lines

meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch line 19

Quoted 3 lines
meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch new file +2 -0
+ 6 files changed, 2717 insertions(+), 1306 deletions(-)
+

[cut]

//Peter