From 5d903ccee9a364a5cc25cb86f12a049978667ec0 Mon Sep 17 00:00:00 2001 From: Alexey Brodkin Date: Thu, 7 Oct 2021 08:04:50 -0700 Subject: [PATCH] binutils-2.37: Remove obsolete ld_makefile patch The patch in question was first introduced in [1] as a copy-paste from OpenEmbedded [2], where it seems to exist on the first ever SVN commit. Later it was removed from OE in [3] on switching to Binutils 2.25. It's not clear why it was introduced in the first place and why it got removed later. But given in OE/Yocto it was missing since 2015 and never was reverted, I guess it is not strictly necessary at least with recent Binutils. So it's an extra patch which adds questionable value. Moreover it gets in the way if one wants to merge a couple of separate toolchains like little- & big-enadian so that "bin" & "lib" folder contain all the binaries and libs simultaneously. W/ that patch in place ldscripts won't co-exist, but instead the latest set of scripts will override all the rest. And in case of aforementioned example w/ merged little- & big-endian toolchains BE ldscripts will override LE ones leading to a funny behavior: on linking w/o explicitly set endianess (via "-EL" or "-EB") default linker scripts won't match the GCC driver used: ------------------------------->8--------------------------- $ arc-elf32-gcc test.c -Wl,-marcv2elfx ... .../bin/../lib/gcc/arc-snps-elf/11.2.0/../../../../arc-snps-elf/bin/ld: .../bin/../lib/gcc/arc-snps-elf/11.2.0/../../../../arc-snps-elf/lib/crt0.o: compiled for a little endian system and target is big endian .../bin/../lib/gcc/arc-snps-elf/11.2.0/../../../../arc-snps-elf/bin/ld: failed to merge target specific data of file .../bin/../lib/gcc/arc-snps-elf/11.2.0/../../../../arc-snps-elf/lib/crt0.o .../bin/../lib/gcc/arc-snps-elf/11.2.0/../../../../arc-snps-elf/bin/ld: .../bin/../lib/gcc/arc-snps-elf/11.2.0/crti.o: compiled for a little endian system and target is big endian ... ------------------------------->8--------------------------- [1] https://github.com/crosstool-ng/crosstool-ng/commit/cfbcdd378646594887c9d488aee529c07838ee8e [2] https://github.com/openembedded/openembedded-core/commit/4b46c1f6e891b1ddd5968536440b888661fade3e [3] https://github.com/openembedded/openembedded-core/commit/3c7fe424f850af70989ad682dd9c5be70cd02ca5 Signed-off-by: Alexey Brodkin --- .../2.37/0001-ld_makefile_patch.patch | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 packages/binutils/2.37/0001-ld_makefile_patch.patch diff --git a/packages/binutils/2.37/0001-ld_makefile_patch.patch b/packages/binutils/2.37/0001-ld_makefile_patch.patch deleted file mode 100644 index 68d20133..00000000 --- a/packages/binutils/2.37/0001-ld_makefile_patch.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- - ld/Makefile.am | 2 +- - ld/Makefile.in | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -50,7 +50,7 @@ - # 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. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -562,7 +562,7 @@ - # 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. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include