Date: Sat, 3 Dec 2011 20:34:43 GMT From: Andreas Tobler <andreast@FreeBSD.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/163041: [patch] add support for powerpc* in binutils-2.22 Message-ID: <201112032034.pB3KYha4081676@red.freebsd.org> Resent-Message-ID: <201112032040.pB3KeBlj067982@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 163041 >Category: ports >Synopsis: [patch] add support for powerpc* in binutils-2.22 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 03 20:40:10 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Andreas Tobler >Release: -CURRENT >Organization: none >Environment: FreeBSD bohrium.andreas.nets 9.0-CURRENT FreeBSD 10.0-CURRENT #11 r227669M: Fri Nov 18 19:05:27 CET 2011 andreast@bohrium.andreas.nets:/usr/obj/export/devel/fbsd/src/sys/GENERIC64_G5 powerpc >Description: The attached patch is a backport of the changes from binutils-cvs needed to support 32- and 64-bit powerpc in binutils-2.22. >How-To-Repeat: >Fix: Attached patch. Patch attached with submission follows: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # files/patch-bfd-powerpc.patch # files/patch-gas-config-tc-ppc.c # files/patch-ld-powerpc.patch # echo x - files/patch-bfd-powerpc.patch sed 's/^X//' >files/patch-bfd-powerpc.patch << 'END-of-files/patch-bfd-powerpc.patch' X--- bfd/configure.orig 2011-12-03 20:02:52.000000000 +0100 X+++ bfd/configure 2011-12-03 20:04:12.000000000 +0100 X@@ -15262,6 +15262,7 @@ X bfd_elf32_pjl_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; X bfd_elf32_powerpc_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; X bfd_elf32_powerpcle_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; X+ bfd_elf32_powerpc_freebsd_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; X bfd_elf32_powerpc_vxworks_vec) tb="$tb elf32-ppc.lo elf-vxworks.lo elf32.lo $elf" ;; X bfd_elf32_rx_le_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; X bfd_elf32_rx_be_vec) tb="$tb elf32-rx.lo elf32.lo $elf" ;; X@@ -15327,6 +15328,7 @@ X bfd_elf64_mmix_vec) tb="$tb elf64-mmix.lo elf64.lo $elf" target_size=64 ;; X bfd_elf64_powerpc_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf"; target_size=64 ;; X bfd_elf64_powerpcle_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; X+ bfd_elf64_powerpc_freebsd_vec) tb="$tb elf64-ppc.lo elf64-gen.lo elf64.lo $elf" target_size=64 ;; X bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; X bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; X bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; X--- bfd/config.bfd.orig 2011-12-03 19:56:39.000000000 +0100 X+++ bfd/config.bfd 2011-12-03 19:59:15.000000000 +0100 X@@ -1128,6 +1128,11 @@ X targ_selvecs=rs6000coff_vec X want64=true X ;; X+ powerpc64-*-freebsd*) X+ targ_defvec=bfd_elf64_powerpc_freebsd_vec X+ targ_selvecs="bfd_elf64_powerpc_vec bfd_elf32_powerpc_vec bfd_elf32_powerpc_freebsd_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec aix5coff64_vec" X+ want64=true X+ ;; X powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \ X powerpc64-*-*bsd*) X targ_defvec=bfd_elf64_powerpc_vec X@@ -1140,6 +1145,11 @@ X want64=true X ;; X #endif X+ powerpc-*-*freebsd*) X+ targ_defvec=bfd_elf32_powerpc_freebsd_vec X+ targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec ppcboot_vec" X+ targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec bfd_elf64_powerpc_freebsd_vec" X+ ;; X powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \ X powerpc-*-solaris2* | powerpc-*-linux-* | powerpc-*-rtems* | \ X powerpc-*-chorus*) X--- bfd/elf32-ppc.c.orig 2011-12-03 19:51:40.000000000 +0100 X+++ bfd/elf32-ppc.c 2011-12-03 19:55:17.000000000 +0100 X@@ -9127,6 +9127,24 @@ X X #include "elf32-target.h" X X+/* FreeBSD Target */ X+ X+#undef TARGET_LITTLE_SYM X+#undef TARGET_LITTLE_NAME X+ X+#undef TARGET_BIG_SYM X+#define TARGET_BIG_SYM bfd_elf32_powerpc_freebsd_vec X+#undef TARGET_BIG_NAME X+#define TARGET_BIG_NAME "elf32-powerpc-freebsd" X+ X+#undef ELF_OSABI X+#define ELF_OSABI ELFOSABI_FREEBSD X+ X+#undef elf32_bed X+#define elf32_bed elf32_powerpc_fbsd_bed X+ X+#include "elf32-target.h" X+ X /* VxWorks Target */ X X #undef TARGET_LITTLE_SYM X@@ -9137,6 +9155,8 @@ X #undef TARGET_BIG_NAME X #define TARGET_BIG_NAME "elf32-powerpc-vxworks" X X+#undef ELF_OSABI X+ X /* VxWorks uses the elf default section flags for .plt. */ X static const struct bfd_elf_special_section * X ppc_elf_vxworks_get_sec_type_attr (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) X--- bfd/elf64-ppc.c.orig 2011-12-03 19:51:08.000000000 +0100 X+++ bfd/elf64-ppc.c 2011-12-03 19:51:32.000000000 +0100 X@@ -13897,3 +13897,22 @@ X } X X #include "elf64-target.h" X+ X+/* FreeBSD support */ X+ X+#undef TARGET_LITTLE_SYM X+#undef TARGET_LITTLE_NAME X+ X+#undef TARGET_BIG_SYM X+#define TARGET_BIG_SYM bfd_elf64_powerpc_freebsd_vec X+#undef TARGET_BIG_NAME X+#define TARGET_BIG_NAME "elf64-powerpc-freebsd" X+ X+#undef ELF_OSABI X+#define ELF_OSABI ELFOSABI_FREEBSD X+ X+#undef elf64_bed X+#define elf64_bed elf64_powerpc_fbsd_bed X+ X+#include "elf64-target.h" X+ X--- bfd/targets.c.orig 2011-12-03 19:59:40.000000000 +0100 X+++ bfd/targets.c 2011-12-03 20:01:55.000000000 +0100 X@@ -667,6 +667,7 @@ X extern const bfd_target bfd_elf32_pjl_vec; X extern const bfd_target bfd_elf32_powerpc_vec; X extern const bfd_target bfd_elf32_powerpcle_vec; X+extern const bfd_target bfd_elf32_powerpc_freebsd_vec; X extern const bfd_target bfd_elf32_powerpc_vxworks_vec; X extern const bfd_target bfd_elf32_rx_le_vec; X extern const bfd_target bfd_elf32_rx_be_vec; X@@ -729,6 +730,7 @@ X extern const bfd_target bfd_elf64_mmix_vec; X extern const bfd_target bfd_elf64_powerpc_vec; X extern const bfd_target bfd_elf64_powerpcle_vec; X+extern const bfd_target bfd_elf64_powerpc_freebsd_vec; X extern const bfd_target bfd_elf64_s390_vec; X extern const bfd_target bfd_elf64_sh64_vec; X extern const bfd_target bfd_elf64_sh64l_vec; X@@ -1033,6 +1035,7 @@ X &bfd_elf32_powerpc_vec, X &bfd_elf32_powerpc_vxworks_vec, X &bfd_elf32_powerpcle_vec, X+ &bfd_elf32_powerpc_freebsd_vec, X &bfd_elf32_rx_be_vec, X &bfd_elf32_rx_be_ns_vec, X &bfd_elf32_rx_le_vec, X@@ -1095,6 +1098,7 @@ X &bfd_elf64_mmix_vec, X &bfd_elf64_powerpc_vec, X &bfd_elf64_powerpcle_vec, X+ &bfd_elf64_powerpc_freebsd_vec, X &bfd_elf64_s390_vec, X &bfd_elf64_sh64_vec, X &bfd_elf64_sh64l_vec, END-of-files/patch-bfd-powerpc.patch echo x - files/patch-gas-config-tc-ppc.c sed 's/^X//' >files/patch-gas-config-tc-ppc.c << 'END-of-files/patch-gas-config-tc-ppc.c' X--- gas/config/tc-ppc.c.orig 2011-12-03 20:06:12.000000000 +0100 X+++ gas/config/tc-ppc.c 2011-12-03 20:07:13.000000000 +0100 X@@ -1370,7 +1370,9 @@ X #endif X #endif X #ifdef OBJ_ELF X-# ifdef TE_VXWORKS X+# ifdef TE_FreeBSD X+ return (ppc_obj64 ? "elf64-powerpc-freebsd" : "elf32-powerpc-freebsd"); X+# elif defined (TE_VXWORKS) X return "elf32-powerpc-vxworks"; X # else X return (target_big_endian END-of-files/patch-gas-config-tc-ppc.c echo x - files/patch-ld-powerpc.patch sed 's/^X//' >files/patch-ld-powerpc.patch << 'END-of-files/patch-ld-powerpc.patch' X--- ld/Makefile.in.orig 2011-12-03 20:13:09.000000000 +0100 X+++ ld/Makefile.in 2011-12-03 20:14:39.000000000 +0100 X@@ -783,6 +783,7 @@ X eelf64ltsmip_fbsd.c \ X eelf64mmix.c \ X eelf64ppc.c \ X+ eelf64ppc_fbsd.c \ X eelf64tilegx.c \ X eelf_l1om.c \ X eelf_l1om_fbsd.c \ X@@ -1180,6 +1181,7 @@ X @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ltsmip_fbsd.Po@am__quote@ X @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64mmix.Po@am__quote@ X @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ppc.Po@am__quote@ X+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64ppc_fbsd.Po@am__quote@ X @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf64tilegx.Po@am__quote@ X @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386.Po@am__quote@ X @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eelf_i386_be.Po@am__quote@ X@@ -3425,6 +3427,10 @@ X ldemul-list.h \ X $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} X ${GENSCRIPTS} elf64ppc "$(tdir_elf64ppc)" X+eelf64ppc_fbsd.c: $(srcdir)/emulparams/elf64ppc_fbsd.sh \ X+ $(srcdir)/emultempl/ppc64elf.em ldemul-list.h \ X+ $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} X+ ${GENSCRIPTS} elf64ppc_fbsd "$(tdir_elf64ppc_fbsd)" X eelf64tilegx.c: $(srcdir)/emulparams/elf64tilegx.sh \ X $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/needrelax.em \ X $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} X--- ld/configure.tgt.orig 2011-12-03 20:15:04.000000000 +0100 X+++ ld/configure.tgt 2011-12-03 20:17:13.000000000 +0100 X@@ -453,10 +453,17 @@ X pj*-*-*) targ_emul=pjelf X ;; X powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu) X- targ_emul=elf32ppc_fbsd; X- targ_extra_emuls="elf32ppc elf32ppcsim"; X+ targ_emul=elf32ppc_fbsd X+ targ_extra_emuls="elf32ppc elf32ppcsim" X targ_extra_libpath=elf32ppc; X tdir_elf32ppcsim=`echo ${targ_alias} | sed -e 's/ppc/ppcsim/'` ;; X+powerpc64-*-freebsd*) X+ targ_emul=elf64ppc_fbsd X+ targ_extra_emuls="elf64ppc elf32ppc_fbsd elf32ppc" X+ targ_extra_libpath="elf32ppc_fbsd elf32ppc" X+ tdir_elf32ppc=`echo "${targ_alias}" | sed -e 's/64//'` X+ tdir_elf32ppc_fbsd=$tdir_elf32ppc X+ ;; X powerpc*-*-linux*) case "${targ}" in X *64*) targ_emul=elf64ppc X targ_extra_emuls="elf32ppclinux elf32ppc elf32ppcsim" X--- ld/emultempl/ppc64elf.em.orig 2011-12-03 20:17:35.000000000 +0100 X+++ ld/emultempl/ppc64elf.em 2011-12-03 20:18:23.000000000 +0100 X@@ -62,7 +62,7 @@ X static int no_toc_sort = 0; X X /* Set if PLT call stubs should load r11. */ X-static int plt_static_chain = 0; X+static int plt_static_chain = ${DEFAULT_PLT_STATIC_CHAIN-0}; X X /* Whether to emit symbols for stubs. */ X static int emit_stub_syms = -1; X--- ld/emulparams/elf32ppc_fbsd.sh.orig 2011-12-03 20:18:53.000000000 +0100 X+++ ld/emulparams/elf32ppc_fbsd.sh 2011-12-03 20:19:31.000000000 +0100 X@@ -1,2 +1,5 @@ X . ${srcdir}/emulparams/elf32ppc.sh X . ${srcdir}/emulparams/elf_fbsd.sh X+ X+OUTPUT_FORMAT="elf32-powerpc-freebsd" X+ X--- ld/emulparams/elf64ppc_fbsd.sh.orig 2011-12-03 20:19:46.000000000 +0100 X+++ ld/emulparams/elf64ppc_fbsd.sh 2011-12-03 20:20:08.000000000 +0100 X@@ -0,0 +1,6 @@ X+. ${srcdir}/emulparams/elf64ppc.sh X+. ${srcdir}/emulparams/elf_fbsd.sh X+ X+OUTPUT_FORMAT="elf64-powerpc-freebsd" X+DEFAULT_PLT_STATIC_CHAIN=1 X+ END-of-files/patch-ld-powerpc.patch exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112032034.pB3KYha4081676>