From 1ac8c0ae893cce269b1164bb0d5d075a4e36279b Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 4 Jan 1999 22:37:29 +0000 Subject: Major `cross' category overhaul. Clean up the shared Makefiles; move all binutils stuff (except gas) to a shared, multiple-target binutils build; reduce extract and compile times by being more specific with files and targets; update to egcs 1.1.1 with a diffball from NetBSD's src/gnu/dist tree; add 4.4BSD a.out archive support to binutils. --- cross/binutils/Makefile | 62 ++++++++++++++ cross/binutils/files/exclude | 3 + cross/binutils/files/md5 | 3 + cross/binutils/patches/patch-aa | 45 ++++++++++ cross/binutils/patches/patch-ab | 37 +++++++++ cross/binutils/patches/patch-ac | 151 ++++++++++++++++++++++++++++++++++ cross/binutils/patches/patch-ad | 21 +++++ cross/binutils/patches/patch-ae | 21 +++++ cross/binutils/patches/patch-af | 13 +++ cross/binutils/patches/patch-ag | 21 +++++ cross/binutils/patches/patch-ah | 21 +++++ cross/binutils/patches/patch-ai | 15 ++++ cross/binutils/patches/patch-aj | 14 ++++ cross/binutils/patches/patch-archive | 155 +++++++++++++++++++++++++++++++++++ cross/binutils/patches/patch-arrays | 81 ++++++++++++++++++ cross/binutils/pkg/COMMENT | 1 + cross/binutils/pkg/DESCR | 3 + cross/binutils/pkg/PLIST | 115 ++++++++++++++++++++++++++ 18 files changed, 782 insertions(+) create mode 100644 cross/binutils/Makefile create mode 100644 cross/binutils/files/exclude create mode 100644 cross/binutils/files/md5 create mode 100644 cross/binutils/patches/patch-aa create mode 100644 cross/binutils/patches/patch-ab create mode 100644 cross/binutils/patches/patch-ac create mode 100644 cross/binutils/patches/patch-ad create mode 100644 cross/binutils/patches/patch-ae create mode 100644 cross/binutils/patches/patch-af create mode 100644 cross/binutils/patches/patch-ag create mode 100644 cross/binutils/patches/patch-ah create mode 100644 cross/binutils/patches/patch-ai create mode 100644 cross/binutils/patches/patch-aj create mode 100644 cross/binutils/patches/patch-archive create mode 100644 cross/binutils/patches/patch-arrays create mode 100644 cross/binutils/pkg/COMMENT create mode 100644 cross/binutils/pkg/DESCR create mode 100644 cross/binutils/pkg/PLIST (limited to 'cross/binutils') diff --git a/cross/binutils/Makefile b/cross/binutils/Makefile new file mode 100644 index 00000000000..60c2648dd26 --- /dev/null +++ b/cross/binutils/Makefile @@ -0,0 +1,62 @@ +# $NetBSD: Makefile,v 1.1 1999/01/04 22:37:31 tv Exp $ +# +# GNU binutils configured to hold `as many targets as the cross system is +# capable of using'. Configures and builds everything except gas, which +# gets built at cross-pkg build time (it's target specific). + +DISTNAME= binutils-2.9.1 +PKGNAME= cross-binutils-2.9.1.0 +CATEGORIES= cross lang +MASTER_SITES= ${MASTER_SITE_GNU} + +MAINTAINER= tv@netbsd.org +HOMEPAGE= http://www.gnu.org/ + +USE_CROSSBASE= yes +USE_LIBTOOL= yes + +GNU_CONFIGURE= yes +CONFIGURE_ARGS+= --enable-64-bit-bfd \ + --enable-targets=${ENABLE_TARGETS_LIST} +MAKE_ARGS+= CFLAGS="${CFLAGS}" +ALL_TARGET= all-binutils all-gprof all-ld + +BINDIR= ${PREFIX}/libexec/binutils + +ENABLE_TARGETS= alpha-netbsd \ + i386-cygwin32 i386-elf i386-go32 i386-linux \ + i386-netbsd i386-netware \ + m68k-elf m68k-netbsd m68k-sunos4 \ + mips-dec-netbsd \ + powerpc-eabi powerpcle-eabi \ + sparc-netbsd sparc-solaris2 sparc-sunos4 \ + sparc64-elf + +post-extract: + @${RM} -rf ${WRKSRC}/gas + +# we use MKDIR, not INSTALL_PROGRAM_DIR, deliberately. +do-install: + ${MKDIR} ${BINDIR} ${PREFIX}/lib/ldscripts + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/addr2line ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/ar ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/dlltool ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/gprof/gprof ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/ld/ld-new ${BINDIR}/ld + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/nlmconv ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/nm-new ${BINDIR}/nm + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/objcopy ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/objdump ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/ranlib ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/size ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/strings ${BINDIR} + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/strip-new ${BINDIR}/strip + @${LIBTOOL} ${INSTALL_PROGRAM} ${WRKSRC}/binutils/windres ${BINDIR} + @${LIBTOOL} ${INSTALL_DATA} ${WRKSRC}/bfd/libbfd.la ${PREFIX}/lib + @${LIBTOOL} ${INSTALL_DATA} ${WRKSRC}/opcodes/libopcodes.la ${PREFIX}/lib + ${INSTALL_DATA} ${WRKSRC}/ld/ldscripts/* ${PREFIX}/lib/ldscripts + +.include "../../mk/bsd.pkg.mk" + +ENABLE_TARGETS_LIST!= ${ECHO} "${ENABLE_TARGETS}" | ${SED} "s/[ ][ ]*/,/g;s/^,*//" +EXTRACT_BEFORE_ARGS:= -X ${FILESDIR}/exclude ${EXTRACT_BEFORE_ARGS} diff --git a/cross/binutils/files/exclude b/cross/binutils/files/exclude new file mode 100644 index 00000000000..b0349ef5bdf --- /dev/null +++ b/cross/binutils/files/exclude @@ -0,0 +1,3 @@ +binutils-*/*/tests/* +binutils-*/*/testsuite/* +binutils-*/etc/* diff --git a/cross/binutils/files/md5 b/cross/binutils/files/md5 new file mode 100644 index 00000000000..52e97ae6adb --- /dev/null +++ b/cross/binutils/files/md5 @@ -0,0 +1,3 @@ +$NetBSD: md5,v 1.1 1999/01/04 22:37:31 tv Exp $ + +MD5 (binutils-2.9.1.tar.gz) = 8f9ad1a6e96742fd3069479171a63c22 diff --git a/cross/binutils/patches/patch-aa b/cross/binutils/patches/patch-aa new file mode 100644 index 00000000000..42765bf3c16 --- /dev/null +++ b/cross/binutils/patches/patch-aa @@ -0,0 +1,45 @@ +$NetBSD: patch-aa,v 1.1 1999/01/04 22:37:31 tv Exp $ + +--- ./bfd/elf64-alpha.c.orig Fri May 1 11:48:09 1998 ++++ ./bfd/elf64-alpha.c Tue Dec 29 15:31:36 1998 +@@ -1012,9 +1012,16 @@ + #define PLT_HEADER_WORD4 0x6b7b0000 /* jmp $27,($27) */ + + #define PLT_ENTRY_SIZE 12 ++#ifdef __NetBSD__ ++/* XXX. XXX. For NetBSD 1.3 compatibility - should be fixed better */ ++#define PLT_ENTRY_WORD1 0x279f0000 /* ldah $28, 0($31) */ ++#define PLT_ENTRY_WORD2 0x239c0000 /* lda $28, 0($28) */ ++#define PLT_ENTRY_WORD3 0xc3e00000 /* br $31, plt0 */ ++#else + #define PLT_ENTRY_WORD1 0xc3800000 /* br $28, plt0 */ + #define PLT_ENTRY_WORD2 0 + #define PLT_ENTRY_WORD3 0 ++#endif + + #define MAX_GOT_ENTRIES (64*1024 / 8) + +@@ -3118,9 +3125,23 @@ + { + unsigned insn1, insn2, insn3; + ++#ifdef __NetBSD__ ++/* XXX. XXX. For NetBSD 1.3 compatibility - should be fixed better */ ++ long hi, lo; ++ ++ /* decompose the reloc offset for the plt for ldah+lda */ ++ hi = plt_index * sizeof(Elf64_External_Rela); ++ lo = ((hi & 0xffff) ^ 0x8000) - 0x8000; ++ hi = (hi - lo) >> 16; ++ ++ insn1 = PLT_ENTRY_WORD1 | (hi & 0xffff); ++ insn2 = PLT_ENTRY_WORD2 | (lo & 0xffff); ++ insn3 = PLT_ENTRY_WORD3 | ((-(h->plt_offset + 12) >> 2) & 0x1fffff); ++#else + insn1 = PLT_ENTRY_WORD1 | ((-(h->plt_offset + 4) >> 2) & 0x1fffff); + insn2 = PLT_ENTRY_WORD2; + insn3 = PLT_ENTRY_WORD3; ++#endif + + bfd_put_32 (output_bfd, insn1, splt->contents + h->plt_offset); + bfd_put_32 (output_bfd, insn2, splt->contents + h->plt_offset + 4); diff --git a/cross/binutils/patches/patch-ab b/cross/binutils/patches/patch-ab new file mode 100644 index 00000000000..049645c1c4c --- /dev/null +++ b/cross/binutils/patches/patch-ab @@ -0,0 +1,37 @@ +$NetBSD: patch-ab,v 1.1 1999/01/04 22:37:31 tv Exp $ + +--- ./ld/configure.host.orig Fri May 1 11:48:48 1998 ++++ ./ld/configure.host Wed Dec 22 09:52:16 1999 +@@ -16,12 +16,7 @@ + + case "${host}" in + +-alpha*-*-linux-gnu*) +- HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`gcc --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*.so..\).*,\1,"` `gcc --print-file-name=crt1.o` `gcc --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`' +- HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -L`dirname \`gcc --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc --print-file-name=crtend.o; fi` `gcc --print-file-name=crtn.o`' +- ;; +- +-alpha*-*-netbsd*) ++*-*-netbsd*) + # The new BSD `make' has a bug: it doesn't pass empty arguments in + # shell commands. So we need to make this value non-empty in order + # for the genscripts.sh call to work. There's nothing magic about +@@ -30,12 +25,17 @@ + HOSTING_CRT0=/usr/lib/crt0.o + ;; + ++alpha*-*-linux-gnu*) ++ HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`gcc --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[ ][ ]*\(.*/ld[^ ]*.so..\).*,\1,"` `gcc --print-file-name=crt1.o` `gcc --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`' ++ HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -L`dirname \`gcc --print-file-name=libc.so\`` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc --print-file-name=crtend.o; fi` `gcc --print-file-name=crtn.o`' ++ ;; ++ + alpha*-*-*) + HOSTING_CRT0=/usr/ccs/lib/crt0.o + NATIVE_LIB_DIRS=/usr/ccs/lib + ;; + +-i[3456]86-*-bsd* | i[3456]86-*-freebsd* | i[3456]86-*-netbsd*) ++i[3456]86-*-bsd* | i[3456]86-*-freebsd*) + # The new BSD `make' has a bug: it doesn't pass empty arguments in + # shell commands. So we need to make this value non-empty in order + # for the genscripts.sh call to work. There's nothing magic about diff --git a/cross/binutils/patches/patch-ac b/cross/binutils/patches/patch-ac new file mode 100644 index 00000000000..30a0d7d7e80 --- /dev/null +++ b/cross/binutils/patches/patch-ac @@ -0,0 +1,151 @@ +$NetBSD: patch-ac,v 1.1 1999/01/04 22:37:31 tv Exp $ + +--- ./bfd/elf32-mips.c.orig Fri May 1 11:48:09 1998 ++++ ./bfd/elf32-mips.c Mon Dec 28 17:43:20 1998 +@@ -155,6 +155,11 @@ + #define STUB_LI16 0x34180000 /* ori t8,zero,0 */ + #define MIPS_FUNCTION_STUB_SIZE (16) + ++#if 0 ++/* We no longer try to identify particular sections for the .dynsym ++ section. When we do, we wind up crashing if there are other random ++ sections with relocations. */ ++ + /* Names of sections which appear in the .dynsym section in an Irix 5 + executable. */ + +@@ -179,6 +184,8 @@ + + #define MIPS_TEXT_DYNSYM_SECNO (3) + ++#endif /* 0 */ ++ + /* The names of the runtime procedure table symbols used on Irix 5. */ + + static const char * const mips_elf_dynsym_rtproc_names[] = +@@ -2314,7 +2321,10 @@ + || strcmp (name, ".dynstr") == 0)) + { + hdr->sh_entsize = 0; ++#if 0 ++ /* This isn't how the Irix 6 linker behaves. */ + hdr->sh_info = SIZEOF_MIPS_DYNSYM_SECNAMES; ++#endif + } + else if (strcmp (name, ".got") == 0 + || strcmp (name, ".sdata") == 0 +@@ -3178,8 +3188,11 @@ + struct mips_elf_link_hash_table + { + struct elf_link_hash_table root; ++#if 0 ++ /* We no longer use this. */ + /* String section indices for the dynamic section symbols. */ + bfd_size_type dynsym_sec_strindex[SIZEOF_MIPS_DYNSYM_SECNAMES]; ++#endif + /* The number of .rtproc entries. */ + bfd_size_type procedure_count; + /* The size of the .compact_rel section (if SGI_COMPAT). */ +@@ -3264,7 +3277,6 @@ + bfd *abfd; + { + struct mips_elf_link_hash_table *ret; +- unsigned int i; + + ret = ((struct mips_elf_link_hash_table *) + bfd_alloc (abfd, sizeof (struct mips_elf_link_hash_table))); +@@ -3278,8 +3290,11 @@ + return NULL; + } + ++#if 0 ++ /* We no longer use this. */ + for (i = 0; i < SIZEOF_MIPS_DYNSYM_SECNAMES; i++) + ret->dynsym_sec_strindex[i] = (bfd_size_type) -1; ++#endif + ret->procedure_count = 0; + ret->compact_rel_size = 0; + ret->use_rld_obj_head = false; +@@ -6570,15 +6585,20 @@ + That means we must increment the dynamic symbol index of every + other dynamic symbol. */ + { +- const char * const *namep; + unsigned int c, i; +- bfd_size_type strindex; +- struct bfd_strtab_hash *dynstr; + struct mips_got_info *g; + + c = 0; + if (elf_hash_table (info)->dynamic_sections_created) + { ++#if 0 ++ /* We no longer try to restrict the set of sections which get ++ dynamic symbol table entries, since it fails if we have ++ other random sections which need dynamic relocations. */ ++ const char * const *namep; ++ bfd_size_type strindex; ++ struct bfd_strtab_hash *dynstr; ++ + if (SGI_COMPAT (output_bfd)) + { + c = SIZEOF_MIPS_DYNSYM_SECNAMES - 1; +@@ -6606,6 +6626,7 @@ + } + } + else ++#endif /* 0 */ + { + c = bfd_count_sections (output_bfd); + elf_link_hash_traverse (elf_hash_table (info), +@@ -6962,8 +6983,11 @@ + break; + + case DT_MIPS_UNREFEXTNO: +- /* XXX FIXME: */ ++#if 0 + dyn.d_un.d_val = SIZEOF_MIPS_DYNSYM_SECNAMES; ++#else ++ dyn.d_un.d_val = bfd_count_sections (output_bfd); ++#endif + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + +@@ -7001,12 +7025,7 @@ + { + asection *sdynsym; + asection *s; +- unsigned int i; +- bfd_vma last; + Elf_Internal_Sym sym; +- long dindx; +- const char *name; +- const char * const * namep = mips_elf_dynsym_sec_names; + Elf32_compact_rel cpt; + + /* Set up the section symbols for the output sections. SGI sets +@@ -7015,6 +7034,16 @@ + sdynsym = bfd_get_section_by_name (dynobj, ".dynsym"); + if (sdynsym != NULL) + { ++#if 0 ++ const char *name; ++ const char * const * namep = mips_elf_dynsym_sec_names; ++ unsigned int i; ++ bfd_vma last; ++ long dindx; ++ ++ /* We no longer try to restrict the set of sections which get ++ dynamic symbol table entries, since it fails if we have ++ other random sections which need dynamic relocations. */ + if (SGI_COMPAT (output_bfd)) + { + sym.st_size = 0; +@@ -7059,6 +7088,7 @@ + SIZEOF_MIPS_DYNSYM_SECNAMES; + } + else ++#endif /* 0 */ + { + sym.st_size = 0; + sym.st_name = 0; diff --git a/cross/binutils/patches/patch-ad b/cross/binutils/patches/patch-ad new file mode 100644 index 00000000000..dd0b32c7ab4 --- /dev/null +++ b/cross/binutils/patches/patch-ad @@ -0,0 +1,21 @@ +$NetBSD: patch-ad,v 1.1 1999/01/04 22:37:31 tv Exp $ + +--- bfd/configure.orig Thu Dec 31 14:13:13 1998 ++++ bfd/configure Thu Dec 31 14:13:32 1998 +@@ -1398,6 +1398,7 @@ + echo "$ac_t""no" 1>&6 + fi + ++if false; then + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +@@ -1443,7 +1444,7 @@ + ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ + $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ + || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } +- ++fi + + # Check whether --enable-64-bit-bfd or --disable-64-bit-bfd was given. + if test "${enable_64_bit_bfd+set}" = set; then diff --git a/cross/binutils/patches/patch-ae b/cross/binutils/patches/patch-ae new file mode 100644 index 00000000000..67765e7f0a2 --- /dev/null +++ b/cross/binutils/patches/patch-ae @@ -0,0 +1,21 @@ +$NetBSD: patch-ae,v 1.1 1999/01/04 22:37:32 tv Exp $ + +--- opcodes/configure.orig Thu Dec 31 14:13:46 1998 ++++ opcodes/configure Thu Dec 31 14:14:00 1998 +@@ -1380,6 +1380,7 @@ + echo "$ac_t""no" 1>&6 + fi + ++if false; then + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +@@ -1425,7 +1426,7 @@ + ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ + $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ + || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } +- ++fi + + # Check whether --enable-targets or --disable-targets was given. + if test "${enable_targets+set}" = set; then diff --git a/cross/binutils/patches/patch-af b/cross/binutils/patches/patch-af new file mode 100644 index 00000000000..be7d76331fc --- /dev/null +++ b/cross/binutils/patches/patch-af @@ -0,0 +1,13 @@ +$NetBSD: patch-af,v 1.1 1999/01/04 22:37:32 tv Exp $ + +--- ld/Makefile.in.orig Thu Dec 31 15:03:33 1998 ++++ ld/Makefile.in Thu Dec 31 15:03:43 1998 +@@ -87,7 +87,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 = $(prefix)/lib + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ diff --git a/cross/binutils/patches/patch-ag b/cross/binutils/patches/patch-ag new file mode 100644 index 00000000000..72a289028c3 --- /dev/null +++ b/cross/binutils/patches/patch-ag @@ -0,0 +1,21 @@ +$NetBSD: patch-ag,v 1.1 1999/01/04 22:37:32 tv Exp $ + +--- ld/configure.orig Thu Dec 31 15:21:31 1998 ++++ ld/configure Thu Dec 31 15:21:46 1998 +@@ -1269,6 +1269,7 @@ + echo "$ac_t""no" 1>&6 + fi + ++if false; then + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +@@ -1314,7 +1315,7 @@ + ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ + $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ + || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } +- ++fi + + # Check whether --enable-targets or --disable-targets was given. + if test "${enable_targets+set}" = set; then diff --git a/cross/binutils/patches/patch-ah b/cross/binutils/patches/patch-ah new file mode 100644 index 00000000000..755e4673018 --- /dev/null +++ b/cross/binutils/patches/patch-ah @@ -0,0 +1,21 @@ +$NetBSD: patch-ah,v 1.1 1999/01/04 22:37:32 tv Exp $ + +--- binutils/configure.orig Thu Dec 31 15:22:04 1998 ++++ binutils/configure Thu Dec 31 15:22:17 1998 +@@ -1269,6 +1269,7 @@ + echo "$ac_t""no" 1>&6 + fi + ++if false; then + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +@@ -1314,7 +1315,7 @@ + ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \ + $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \ + || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } +- ++fi + + # Check whether --enable-targets or --disable-targets was given. + if test "${enable_targets+set}" = set; then diff --git a/cross/binutils/patches/patch-ai b/cross/binutils/patches/patch-ai new file mode 100644 index 00000000000..a8ba285bd0d --- /dev/null +++ b/cross/binutils/patches/patch-ai @@ -0,0 +1,15 @@ +$NetBSD: patch-ai,v 1.1 1999/01/04 22:37:32 tv Exp $ + +XXX - this isn't quite right, but is necessary for now to make DJGPP work. + +--- ld/scripttempl/i386go32.sc.orig Sun Aug 2 15:02:47 1998 ++++ ld/scripttempl/i386go32.sc Sun Aug 2 15:02:59 1998 +@@ -27,8 +27,6 @@ + ${RELOCATING+ edata = . ; _edata = .}; + ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});} + } +- ${CONSTRUCTING+${RELOCATING-.ctor : { *(.ctor) }}} +- ${CONSTRUCTING+${RELOCATING-.dtor : { *(.dtor) }}} + .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : + { + *(.bss) diff --git a/cross/binutils/patches/patch-aj b/cross/binutils/patches/patch-aj new file mode 100644 index 00000000000..dedd43edfe5 --- /dev/null +++ b/cross/binutils/patches/patch-aj @@ -0,0 +1,14 @@ +$NetBSD: patch-aj,v 1.1 1999/01/04 22:37:32 tv Exp $ + +--- ld/emultempl/elf32.em.orig Fri May 1 11:48:55 1998 ++++ ld/emultempl/elf32.em Mon Jan 4 14:11:48 1999 +@@ -342,6 +342,9 @@ + fi + fi + cat >>e${EMULATION_NAME}.c <name, force)) ++ break; + } + + if (force < 2) diff --git a/cross/binutils/patches/patch-archive b/cross/binutils/patches/patch-archive new file mode 100644 index 00000000000..b3f9feaa4a9 --- /dev/null +++ b/cross/binutils/patches/patch-archive @@ -0,0 +1,155 @@ +$NetBSD: patch-archive,v 1.1 1999/01/04 22:37:32 tv Exp $ + +--- ./bfd/archive.c.orig Fri May 1 11:48:01 1998 ++++ ./bfd/archive.c Mon Dec 28 17:43:17 1998 +@@ -595,7 +595,9 @@ + Note that last_file->origin can be odd in the case of + BSD-4.4-style element with a long odd size. */ + filestart = last_file->origin + size; +- filestart += filestart % 2; ++ if (!strncmp(arch_hdr (last_file)->ar_name, "#1/", 3)) ++ size += strlen(normalize(last_file, last_file->filename)); ++ filestart += size % 2; + } + + return _bfd_get_elt_at_filepos (archive, filestart); +@@ -1202,6 +1204,44 @@ + return _bfd_construct_extended_name_table (abfd, false, tabloc, tablen); + } + ++/* 4.4BSD: frob short names, but leave extended name until write time. */ ++ ++boolean ++_bfd_archive_bsd44_construct_extended_name_table (abfd, tabloc, tablen, name) ++ bfd *abfd; ++ char **tabloc; ++ bfd_size_type *tablen; ++ const char **name; ++{ ++ unsigned int maxname = abfd->xvec->ar_max_namelen; ++ bfd *current; ++ ++ for (current = abfd->archive_head; current != NULL; current = current->next) ++ { ++ const char *normal; ++ unsigned int thislen; ++ ++ normal = normalize (current, current->filename); ++ if (normal == NULL) ++ return false; ++ ++ thislen = strlen (normal); ++ if (((thislen > maxname) || (strchr(normal, ' ') != NULL)) ++ && ((bfd_get_file_flags (abfd) & BFD_TRADITIONAL_FORMAT) == 0)) ++ { ++ struct ar_hdr *hdr = arch_hdr (current); ++ sprintf ((hdr->ar_name), "#1/%-12ld", (long) thislen); ++ hdr->ar_name[15] = ' '; ++ sprintf ((hdr->ar_size), "%-9ld", (long) arelt_size(current) + thislen); ++ hdr->ar_size[9] = ' '; ++ } ++ } ++ ++ *name = *tabloc = NULL; ++ *tablen = 0; ++ return true; ++} ++ + /* Build an SVR4 style extended name table. */ + + boolean +@@ -1371,8 +1411,12 @@ + + /* Goddamned sprintf doesn't permit MAXIMUM field lengths */ + sprintf ((hdr->ar_date), "%-12ld", (long) status.st_mtime); +- sprintf ((hdr->ar_uid), "%ld", (long) status.st_uid); +- sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid); ++ if (status.st_uid > 65535U) ++ fprintf (stderr, "%s: uid %ld truncated to 16 bits\n", filename, status.st_uid); ++ sprintf ((hdr->ar_uid), "%ld", (long) status.st_uid & 0xffffU); ++ if (status.st_gid > 65535U) ++ fprintf (stderr, "%s: gid %ld truncated to 16 bits\n", filename, status.st_gid); ++ sprintf ((hdr->ar_gid), "%ld", (long) status.st_gid & 0xffffU); + sprintf ((hdr->ar_mode), "%-8o", (unsigned int) status.st_mode); + sprintf ((hdr->ar_size), "%-10ld", (long) status.st_size); + /* Correct for a lossage in sprintf whereby it null-terminates. I cannot +@@ -1654,12 +1698,22 @@ + for (current = arch->archive_head; current; current = current->next) + { + char buffer[DEFAULT_BUFFERSIZE]; +- unsigned int remaining = arelt_size (current); ++ unsigned int saved_size = arelt_size (current); ++ unsigned int remaining = saved_size; + struct ar_hdr *hdr = arch_hdr (current); + + /* write ar header */ + if (bfd_write ((char *) hdr, 1, sizeof (*hdr), arch) != sizeof (*hdr)) + return false; ++ /* write filename if it is a 4.4BSD extended file, and add to size */ ++ if (!strncmp (hdr->ar_name, "#1/", 3)) ++ { ++ const char *normal = normalize (current, current->filename); ++ unsigned int thislen = strlen (normal); ++ if (bfd_write (normal, 1, thislen, arch) != thislen) ++ return false; ++ saved_size += thislen; ++ } + if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) + return false; + while (remaining) +@@ -1678,7 +1732,7 @@ + return false; + remaining -= amt; + } +- if ((arelt_size (current) % 2) == 1) ++ if ((saved_size % 2) == 1) + { + if (bfd_write ("\012", 1, 1, arch) != 1) + return false; +@@ -1914,8 +1968,11 @@ + { + do + { +- firstreal += arelt_size (current) + sizeof (struct ar_hdr); +- firstreal += firstreal % 2; ++ unsigned int size = arelt_size (current); ++ if (!strncmp(arch_hdr (current)->ar_name, "#1/", 3)) ++ size += strlen(normalize(current, current->filename)); ++ firstreal += size + sizeof (struct ar_hdr); ++ firstreal += size % 2; + current = current->next; + } + while (current != (bfd *) (map[count]).pos); +--- ./bfd/libbfd-in.h.orig Fri May 1 11:48:12 1998 ++++ ./bfd/libbfd-in.h Mon Dec 28 17:43:21 1998 +@@ -219,6 +219,8 @@ + _bfd_slurp_extended_name_table + extern boolean _bfd_archive_bsd_construct_extended_name_table + PARAMS ((bfd *, char **, bfd_size_type *, const char **)); ++extern boolean _bfd_archive_bsd44_construct_extended_name_table ++ PARAMS ((bfd *, char **, bfd_size_type *, const char **)); + #define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname + #define _bfd_archive_bsd_write_armap bsd_write_armap + #define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr +--- ./bfd/libbfd.h.orig Fri May 1 11:48:12 1998 ++++ ./bfd/libbfd.h Mon Dec 28 17:43:21 1998 +@@ -219,6 +219,8 @@ + _bfd_slurp_extended_name_table + extern boolean _bfd_archive_bsd_construct_extended_name_table + PARAMS ((bfd *, char **, bfd_size_type *, const char **)); ++extern boolean _bfd_archive_bsd44_construct_extended_name_table ++ PARAMS ((bfd *, char **, bfd_size_type *, const char **)); + #define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname + #define _bfd_archive_bsd_write_armap bsd_write_armap + #define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr +--- bfd/netbsd.h.orig Mon Jan 4 09:58:12 1999 ++++ bfd/netbsd.h Mon Jan 4 09:58:37 1999 +@@ -66,6 +66,8 @@ + #define MY_write_object_contents MY(write_object_contents) + static boolean MY(write_object_contents) PARAMS ((bfd *abfd)); + #define MY_text_includes_header 1 ++#define MY_construct_extended_name_table \ ++ _bfd_archive_bsd44_construct_extended_name_table + + #include "aout-target.h" + diff --git a/cross/binutils/patches/patch-arrays b/cross/binutils/patches/patch-arrays new file mode 100644 index 00000000000..81d785810c8 --- /dev/null +++ b/cross/binutils/patches/patch-arrays @@ -0,0 +1,81 @@ +--- ./bfd/libbfd-in.h.orig Fri May 1 11:48:12 1998 ++++ ./bfd/libbfd-in.h Mon Dec 28 17:43:21 1998 +@@ -496,7 +498,7 @@ + + /* List of supported target vectors, and the default vector (if + bfd_default_vector[0] is NULL, there is no default). */ +-extern const bfd_target * const bfd_target_vector[]; ++extern const bfd_target * const *bfd_target_vector; + extern const bfd_target *bfd_default_vector[]; + + /* Functions shared by the ECOFF and MIPS ELF backends, which have no +--- ./bfd/libbfd.h.orig Fri May 1 11:48:12 1998 ++++ ./bfd/libbfd.h Mon Dec 28 17:43:21 1998 +@@ -496,7 +498,7 @@ + + /* List of supported target vectors, and the default vector (if + bfd_default_vector[0] is NULL, there is no default). */ +-extern const bfd_target * const bfd_target_vector[]; ++extern const bfd_target * const *bfd_target_vector; + extern const bfd_target *bfd_default_vector[]; + + /* Functions shared by the ECOFF and MIPS ELF backends, which have no +--- ./bfd/targets.c.orig Fri May 1 11:48:16 1998 ++++ ./bfd/targets.c Mon Dec 28 17:43:23 1998 +@@ -611,7 +612,7 @@ + extern const bfd_target trad_core_vec; + extern const bfd_target ptrace_core_vec; + +-const bfd_target * const bfd_target_vector[] = { ++static const bfd_target * const _bfd_target_vector[] = { + + #ifdef SELECT_VECS + +@@ -841,6 +846,7 @@ + + NULL /* end of list marker */ + }; ++const bfd_target * const *bfd_target_vector = _bfd_target_vector; + + /* bfd_default_vector[0] contains either the address of the default vector, + if there is one, or zero if there isn't. */ +--- ./binutils/bucomm.c.orig Fri May 1 11:49:31 1998 ++++ ./binutils/bucomm.c Tue Dec 21 07:30:13 1999 +@@ -137,7 +137,7 @@ + const char *name; + FILE *f; + { +- extern bfd_target *bfd_target_vector[]; ++ extern bfd_target **bfd_target_vector; + int t; + + if (name == NULL) +--- ./binutils/objdump.c.orig Fri May 1 11:49:34 1998 ++++ ./binutils/objdump.c Tue Dec 21 07:30:13 1999 +@@ -2466,7 +2466,7 @@ + static void + display_target_list () + { +- extern bfd_target *bfd_target_vector[]; ++ extern bfd_target **bfd_target_vector; + char *dummy_name; + int t; + +@@ -2512,7 +2512,7 @@ + int first; + int last; + { +- extern bfd_target *bfd_target_vector[]; ++ extern bfd_target **bfd_target_vector; + int t, a; + char *dummy_name; + +@@ -2579,7 +2579,7 @@ + display_target_tables () + { + int t, columns; +- extern bfd_target *bfd_target_vector[]; ++ extern bfd_target **bfd_target_vector; + char *colum; + + columns = 0; diff --git a/cross/binutils/pkg/COMMENT b/cross/binutils/pkg/COMMENT new file mode 100644 index 00000000000..24bffdaff19 --- /dev/null +++ b/cross/binutils/pkg/COMMENT @@ -0,0 +1 @@ +Unified GNU binutils for cross build environments diff --git a/cross/binutils/pkg/DESCR b/cross/binutils/pkg/DESCR new file mode 100644 index 00000000000..5fd5e962f46 --- /dev/null +++ b/cross/binutils/pkg/DESCR @@ -0,0 +1,3 @@ +The cross-binutils pkg is used only by the other `cross' pkgs. The +binutils provides various binary manipulation utilities as well as the GNU +linker. (The assembler is bundled with each individual cross pkg.) diff --git a/cross/binutils/pkg/PLIST b/cross/binutils/pkg/PLIST new file mode 100644 index 00000000000..c377ecae0c6 --- /dev/null +++ b/cross/binutils/pkg/PLIST @@ -0,0 +1,115 @@ +@comment $NetBSD: PLIST,v 1.1 1999/01/04 22:37:32 tv Exp $ +lib/ldscripts/elf32_sparc.x +lib/ldscripts/elf32_sparc.xbn +lib/ldscripts/elf32_sparc.xn +lib/ldscripts/elf32_sparc.xr +lib/ldscripts/elf32_sparc.xs +lib/ldscripts/elf32_sparc.xu +lib/ldscripts/elf32lmip.x +lib/ldscripts/elf32lmip.xbn +lib/ldscripts/elf32lmip.xn +lib/ldscripts/elf32lmip.xr +lib/ldscripts/elf32lmip.xs +lib/ldscripts/elf32lmip.xu +lib/ldscripts/elf32lppc.x +lib/ldscripts/elf32lppc.xbn +lib/ldscripts/elf32lppc.xn +lib/ldscripts/elf32lppc.xr +lib/ldscripts/elf32lppc.xs +lib/ldscripts/elf32lppc.xu +lib/ldscripts/elf32ppc.x +lib/ldscripts/elf32ppc.xbn +lib/ldscripts/elf32ppc.xn +lib/ldscripts/elf32ppc.xr +lib/ldscripts/elf32ppc.xs +lib/ldscripts/elf32ppc.xu +lib/ldscripts/elf64_sparc.x +lib/ldscripts/elf64_sparc.xbn +lib/ldscripts/elf64_sparc.xn +lib/ldscripts/elf64_sparc.xr +lib/ldscripts/elf64_sparc.xs +lib/ldscripts/elf64_sparc.xu +lib/ldscripts/elf64alpha.x +lib/ldscripts/elf64alpha.xbn +lib/ldscripts/elf64alpha.xn +lib/ldscripts/elf64alpha.xr +lib/ldscripts/elf64alpha.xs +lib/ldscripts/elf64alpha.xu +lib/ldscripts/elf_i386.x +lib/ldscripts/elf_i386.xbn +lib/ldscripts/elf_i386.xn +lib/ldscripts/elf_i386.xr +lib/ldscripts/elf_i386.xs +lib/ldscripts/elf_i386.xu +lib/ldscripts/i386go32.x +lib/ldscripts/i386go32.xbn +lib/ldscripts/i386go32.xn +lib/ldscripts/i386go32.xr +lib/ldscripts/i386go32.xu +lib/ldscripts/i386linux.x +lib/ldscripts/i386linux.xbn +lib/ldscripts/i386linux.xn +lib/ldscripts/i386linux.xr +lib/ldscripts/i386linux.xu +lib/ldscripts/i386nbsd.x +lib/ldscripts/i386nbsd.xbn +lib/ldscripts/i386nbsd.xn +lib/ldscripts/i386nbsd.xr +lib/ldscripts/i386nbsd.xu +lib/ldscripts/i386nw.x +lib/ldscripts/i386nw.xbn +lib/ldscripts/i386nw.xn +lib/ldscripts/i386nw.xr +lib/ldscripts/i386nw.xs +lib/ldscripts/i386nw.xu +lib/ldscripts/i386pe.x +lib/ldscripts/i386pe.xbn +lib/ldscripts/i386pe.xn +lib/ldscripts/i386pe.xr +lib/ldscripts/i386pe.xu +lib/ldscripts/m68kelf.x +lib/ldscripts/m68kelf.xbn +lib/ldscripts/m68kelf.xn +lib/ldscripts/m68kelf.xr +lib/ldscripts/m68kelf.xs +lib/ldscripts/m68kelf.xu +lib/ldscripts/m68knbsd.x +lib/ldscripts/m68knbsd.xbn +lib/ldscripts/m68knbsd.xn +lib/ldscripts/m68knbsd.xr +lib/ldscripts/m68knbsd.xu +lib/ldscripts/sparcnbsd.x +lib/ldscripts/sparcnbsd.xbn +lib/ldscripts/sparcnbsd.xn +lib/ldscripts/sparcnbsd.xr +lib/ldscripts/sparcnbsd.xu +lib/ldscripts/sun3.x +lib/ldscripts/sun3.xbn +lib/ldscripts/sun3.xn +lib/ldscripts/sun3.xr +lib/ldscripts/sun3.xu +lib/ldscripts/sun4.x +lib/ldscripts/sun4.xbn +lib/ldscripts/sun4.xn +lib/ldscripts/sun4.xr +lib/ldscripts/sun4.xu +@unexec rmdir %D/lib/ldscripts 2>/dev/null || true +lib/libbfd-2.9.1.so.0.0 +lib/libbfd.a +lib/libopcodes-2.9.1.so.0.0 +lib/libopcodes.a +libexec/binutils/addr2line +libexec/binutils/ar +libexec/binutils/dlltool +libexec/binutils/gprof +libexec/binutils/ld +libexec/binutils/nlmconv +libexec/binutils/nm +libexec/binutils/objcopy +libexec/binutils/objdump +libexec/binutils/ranlib +libexec/binutils/size +libexec/binutils/strings +libexec/binutils/strip +libexec/binutils/windres +@dirrm libexec/binutils -- cgit v1.2.3