Ports: Update binutils to version 2.36.1

Otherwise linking fails when building object files with
DWARF 5 symbols.
This commit is contained in:
Gunnar Beutner 2021-04-27 20:16:59 +02:00 committed by Andreas Kling
parent 77087780a2
commit 797cb8858a
Notes: sideshowbarker 2024-07-18 18:56:21 +09:00
3 changed files with 97 additions and 89 deletions

View file

@ -6,7 +6,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
|----------------------------------------|------------------------------------------------------------|--------------------------|--------------------------------------------------------------------------------|
| [`bash`](bash/) | GNU Bash | 5.0 | https://www.gnu.org/software/bash/ |
| [`bc`](bc/) | bc | 2.5.1 | https://github.com/gavinhoward/bc |
| [`binutils`](binutils/) | GNU Binutils | 2.32 | https://www.gnu.org/software/binutils/ |
| [`binutils`](binutils/) | GNU Binutils | 2.36.1 | https://www.gnu.org/software/binutils/ |
| [`bison`](bison/) | GNU Bison | 1.25 | https://www.gnu.org/software/bison/ |
| [`byacc`](byacc/) | Berkeley Yacc | 20191125 | https://invisible-island.net/byacc/byacc.html |
| [`bzip2`](bzip2/) | bzip2 | 1.0.8 | https://sourceware.org/bzip2/ |

View file

@ -1,6 +1,6 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=binutils
version=2.32
version=2.36.1
useconfigure=true
configopts="--target=${SERENITY_ARCH}-pc-serenity --with-sysroot=/ --with-build-sysroot=${SERENITY_INSTALL_ROOT} --disable-werror --disable-gdb --disable-nls"
files="https://ftpmirror.gnu.org/gnu/binutils/binutils-${version}.tar.xz binutils-${version}.tar.xz

View file

@ -1,105 +1,60 @@
diff -Nru ../binutils-2.32/bfd/config.bfd binutils-2.32-serenity/bfd/config.bfd
--- ../binutils-2.32/bfd/config.bfd 2019-01-19 17:01:32.000000000 +0100
+++ binutils-2.32-serenity/bfd/config.bfd 2019-04-04 17:41:07.000000000 +0200
@@ -223,6 +223,20 @@
;;
diff -Naur binutils-2.36.1/bfd/config.bfd binutils-2.36.1.serenity/bfd/config.bfd
--- binutils-2.36.1/bfd/config.bfd 2021-01-09 11:47:33.000000000 +0100
+++ binutils-2.36.1.serenity/bfd/config.bfd 2021-04-27 20:27:28.646876773 +0200
@@ -224,7 +224,24 @@
case "${targ}" in
# START OF targmatch.h
+
+ i[3-7]86-*-serenity*)
+ targ_defvec=i386_elf32_vec
+ targ_selvecs=
+ targ64_selvecs=x86_64_elf64_vec
+ ;;
+#ifdef BFD64
#ifdef BFD64
+ x86_64-*-serenity*)
+ targ_defvec=x86_64_elf64_vec
+ targ_selvecs=i386_elf32_vec
+ want64=true
+ ;;
+#endif
+
#ifdef BFD64
+
+ arm-*-serenity*)
+ targ_defvec=arm_elf32_le_vec
+ targ_selvecs=
+ targ64_selvecs=
+ ;;
+
aarch64-*-darwin*)
targ_defvec=aarch64_mach_o_vec
diff -Nru ../binutils-2.32/config.sub binutils-2.32-serenity/config.sub
--- ../binutils-2.32/config.sub 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-serenity/config.sub 2019-04-04 17:39:29.000000000 +0200
@@ -1337,6 +1337,7 @@
targ_selvecs="arm_mach_o_vec mach_o_le_vec mach_o_be_vec mach_o_fat_vec"
diff -Naur binutils-2.36.1/config.sub binutils-2.36.1.serenity/config.sub
--- binutils-2.36.1/config.sub 2021-01-09 11:47:33.000000000 +0100
+++ binutils-2.36.1.serenity/config.sub 2021-04-27 20:23:15.975422803 +0200
@@ -1693,6 +1693,7 @@
# The portable systems comes first.
# Each alternative MUST end in a * to match a version number.
# sysv* is not here because it comes later, after sysvr4.
gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | serenity* \
| *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | serenity* \
| *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
| sym* | kopensolaris* | plan9* \
diff -Nru ../binutils-2.32/gas/configure.tgt binutils-2.32-serenity/gas/configure.tgt
--- ../binutils-2.32/gas/configure.tgt 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-serenity/gas/configure.tgt 2019-04-04 17:41:40.000000000 +0200
@@ -121,6 +121,7 @@
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
diff -Naur binutils-2.36.1/gas/configure.tgt binutils-2.36.1.serenity/gas/configure.tgt
--- binutils-2.36.1/gas/configure.tgt 2021-01-09 11:47:33.000000000 +0100
+++ binutils-2.36.1.serenity/gas/configure.tgt 2021-04-27 20:23:15.975422803 +0200
@@ -123,6 +123,8 @@
generic_target=${cpu_type}-$vendor-$os
# Note: This table is alpha-sorted, please try to keep it that way.
case ${generic_target} in
+ i386-*-serenity*) fmt=elf;;
+ arm-*-serenity*) fmt=elf;;
aarch64*-*-elf*) fmt=elf;;
aarch64*-*-fuchsia*) fmt=elf;;
aarch64*-*-linux*) fmt=elf em=linux
diff -Nru ../binutils-2.32/ld/Makefile.am binutils-2.32-serenity/ld/Makefile.am
--- ../binutils-2.32/ld/Makefile.am 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-serenity/ld/Makefile.am 2019-04-04 17:50:13.000000000 +0200
@@ -1289,6 +1289,10 @@
eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_i386_serenity.c: $(srcdir)/emulparams/elf_i386_serenity.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_serenity "$(tdir_elf_i386_serenity)"
+
eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -1849,6 +1853,10 @@
eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_x86_64_serenity.c: $(srcdir)/emulparams/elf_x86_64_serenity.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_x86_64_serenity "$(tdir_elf_x86_64_serenity)"
+
eelf_x86_64_cloudabi.c: $(srcdir)/emulparams/elf_x86_64_cloudabi.sh \
$(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff -Nru ../binutils-2.32/ld/Makefile.in binutils-2.32-serenity/ld/Makefile.in
--- ../binutils-2.32/ld/Makefile.in 2019-02-02 16:54:43.000000000 +0100
+++ binutils-2.32-serenity/ld/Makefile.in 2019-04-04 17:50:55.000000000 +0200
@@ -2893,6 +2893,10 @@
eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_i386_serenity.c: $(srcdir)/emulparams/elf_i386_serenity.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_i386_serenity "$(tdir_elf_i386_serenity)"
+
eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
$(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
@@ -3453,6 +3457,10 @@
eelf_x86_64.c: $(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+eelf_x86_64_serenity.c: $(srcdir)/emulparams/elf_x86_64_serenity.sh \
+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf_x86_64_serenity "$(tdir_elf_x86_64_serenity)"
+
eelf_x86_64_cloudabi.c: $(srcdir)/emulparams/elf_x86_64_cloudabi.sh \
$(srcdir)/emulparams/elf_x86_64.sh \
$(ELF_X86_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff -Nru ../binutils-2.32/ld/configure.tgt binutils-2.32-serenity/ld/configure.tgt
--- ../binutils-2.32/ld/configure.tgt 2019-01-19 17:01:33.000000000 +0100
+++ binutils-2.32-serenity/ld/configure.tgt 2019-04-04 17:42:40.000000000 +0200
@@ -45,6 +45,15 @@
# architecture variants should be kept together even if their names
# break the alpha sorting.
diff -Naur binutils-2.36.1/ld/configure.tgt binutils-2.36.1.serenity/ld/configure.tgt
--- binutils-2.36.1/ld/configure.tgt 2021-01-09 11:47:34.000000000 +0100
+++ binutils-2.36.1.serenity/ld/configure.tgt 2021-04-27 20:23:15.975422803 +0200
@@ -43,6 +43,19 @@
# Please try to keep this table more or less in alphabetic order - it
# makes it much easier to lookup a specific archictecture.
case "${targ}" in
+i[3-7]86-*-serenity*)
+ targ_emul=elf_i386_serenity
@ -109,19 +64,72 @@ diff -Nru ../binutils-2.32/ld/configure.tgt binutils-2.32-serenity/ld/configure.
+x86_64-*-serenity*)
+ targ_emul=elf_x86_64_serenity
+ targ_extra_emuls="elf_i386_serenity elf_x86_64 elf_i386"
+ ;;
+arm-*-serenity*)
+ targ_emul=armelf_serenity
+ targ_extra_emuls="armelf_serenity armelf"
+ ;;
aarch64_be-*-elf) targ_emul=aarch64elfb
targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b armelfb armelf" ;;
aarch64-*-elf | aarch64-*-rtems*)
diff -Nru ../binutils-2.32/ld/emulparams/elf_i386_serenity.sh binutils-2.32-serenity/ld/emulparams/elf_i386_serenity.sh
--- ../binutils-2.32/ld/emulparams/elf_i386_serenity.sh 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.32-serenity/ld/emulparams/elf_i386_serenity.sh 2019-04-04 17:43:12.000000000 +0200
targ_extra_emuls="aarch64elf aarch64elf32 aarch64elf32b armelfb armelf"
;;
diff -Naur binutils-2.36.1/ld/emulparams/armelf_serenity.sh binutils-2.36.1.serenity/ld/emulparams/armelf_serenity.sh
--- binutils-2.36.1/ld/emulparams/armelf_serenity.sh 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.36.1.serenity/ld/emulparams/armelf_serenity.sh 2021-04-27 20:23:15.975422803 +0200
@@ -0,0 +1,7 @@
+. ${srcdir}/emulparams/armelf.sh
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+TEXT_START_ADDR=0x00008000
+TARGET2_TYPE=got-rel
+
+unset STACK_ADDR
+unset EMBEDDED
diff -Naur binutils-2.36.1/ld/emulparams/elf_i386_serenity.sh binutils-2.36.1.serenity/ld/emulparams/elf_i386_serenity.sh
--- binutils-2.36.1/ld/emulparams/elf_i386_serenity.sh 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.36.1.serenity/ld/emulparams/elf_i386_serenity.sh 2021-04-27 20:23:15.975422803 +0200
@@ -0,0 +1,3 @@
+. ${srcdir}/emulparams/elf_i386.sh
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
diff -Nru ../binutils-2.32/ld/emulparams/elf_x86_64_serenity.sh binutils-2.32-serenity/ld/emulparams/elf_x86_64_serenity.sh
--- ../binutils-2.32/ld/emulparams/elf_x86_64_serenity.sh 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.32-serenity/ld/emulparams/elf_x86_64_serenity.sh 2019-04-04 17:43:34.000000000 +0200
diff -Naur binutils-2.36.1/ld/emulparams/elf_x86_64_serenity.sh binutils-2.36.1.serenity/ld/emulparams/elf_x86_64_serenity.sh
--- binutils-2.36.1/ld/emulparams/elf_x86_64_serenity.sh 1970-01-01 01:00:00.000000000 +0100
+++ binutils-2.36.1.serenity/ld/emulparams/elf_x86_64_serenity.sh 2021-04-27 20:23:15.975422803 +0200
@@ -0,0 +1 @@
+. ${srcdir}/emulparams/elf_x86_64.sh
diff -Naur binutils-2.36.1/ld/Makefile.am binutils-2.36.1.serenity/ld/Makefile.am
--- binutils-2.36.1/ld/Makefile.am 2021-01-09 11:47:34.000000000 +0100
+++ binutils-2.36.1.serenity/ld/Makefile.am 2021-04-27 20:23:15.975422803 +0200
@@ -174,6 +174,7 @@
earmelf_nbsd.c \
earmelf_phoenix.c \
earmelf_vxworks.c \
+ earmelf_serenity.c \
earmelfb.c \
earmelfb_fbsd.c \
earmelfb_fuchsia.c \
diff -Naur binutils-2.36.1/ld/Makefile.in binutils-2.36.1.serenity/ld/Makefile.in
--- binutils-2.36.1/ld/Makefile.in 2021-02-06 10:03:32.000000000 +0100
+++ binutils-2.36.1.serenity/ld/Makefile.in 2021-04-27 20:23:15.975422803 +0200
@@ -663,6 +663,7 @@
earmelf_nbsd.c \
earmelf_phoenix.c \
earmelf_vxworks.c \
+ earmelf_serenity.c \
earmelfb.c \
earmelfb_fbsd.c \
earmelfb_fuchsia.c \
@@ -780,6 +781,7 @@
eelf_i386_vxworks.c \
eelf_iamcu.c \
eelf_s390.c \
+ eelf_i386_serenity.c \
eh8300elf.c \
eh8300elf_linux.c \
eh8300helf.c \
@@ -945,6 +947,7 @@
eelf_x86_64_cloudabi.c \
eelf_x86_64_fbsd.c \
eelf_x86_64_sol2.c \
+ eelf_x86_64_serenity.c \
ehppa64linux.c \
ei386pep.c \
emmo.c