Ticket #2982: binutils-haiku-2.18.patch

File binutils-haiku-2.18.patch, 16.1 KB (added by aljen, 16 years ago)

binutils-2.18 patch

  • binutils-2.18/bfd/config.bfd

    diff -rupN binutils-2.18/bfd/config.bfd /Volumes/Develop/Haiku/buildtools/binutils-2.18/bfd/config.bfd
    old new case "${targ}" in  
    270270    ;;
    271271  arm-*-elf | arm-*-freebsd* | arm*-*-linux-* | arm*-*-conix* | \
    272272  arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
    273   arm*-*-eabi* )
     273  arm*-*-eabi* | arm*-*-haiku*)
    274274    targ_defvec=bfd_elf32_littlearm_vec
    275275    targ_selvecs=bfd_elf32_bigarm_vec
    276276    ;;
    case "${targ}" in  
    634634    targ_defvec=bfd_elf32_i386_vec
    635635    targ_selvecs="i386pe_vec i386pei_vec"
    636636    ;;
     637  i[3-7]86-*-haiku*)
     638    targ_defvec=bfd_elf32_i386_vec
     639    ;;
    637640  i[3-7]86-*-interix*)
    638641    targ_defvec=i386pei_vec
    639642    targ_selvecs="i386pe_vec"
    case "${targ}" in  
    815818    targ_selvecs=ieee_vec
    816819    targ_underscore=yes
    817820    ;;
     821  m68*-*-haiku*)
     822    targ_defvec=bfd_elf32_m68k_vec
     823    targ_selvecs="m68kcoff_vec ieee_vec"
     824    ;;
    818825
    819826  m88*-harris-cxux* | m88*-*-dgux* | m88*-*-sysv4*)
    820827    targ_defvec=bfd_elf32_m88k_vec
    case "${targ}" in  
    11021109    targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
    11031110    targ_archs="bfd_powerpc_arch bfd_rs6000_arch bfd_i386_arch"
    11041111    ;;
     1112  powerpc-*-haiku*)
     1113    targ_defvec=bfd_elf32_powerpc_vec
     1114    targ_cflags=-D__HAIKU_TARGET__
     1115    ;;
    11051116  powerpc-*-macos*)
    11061117    targ_defvec=pmac_xcoff_vec
    11071118    ;;
  • binutils-2.18/bfd/elf32-ppc.c

    diff -rupN binutils-2.18/bfd/elf32-ppc.c /Volumes/Develop/Haiku/buildtools/binutils-2.18/bfd/elf32-ppc.c
    old new ppc_elf_finish_dynamic_sections (bfd *ou  
    75807580#define TARGET_BIG_NAME     "elf32-powerpc"
    75817581#define ELF_ARCH        bfd_arch_powerpc
    75827582#define ELF_MACHINE_CODE    EM_PPC
    7583 #ifdef __QNXTARGET__
     7583#if defined(__QNXTARGET__) || defined(__HAIKU_TARGET__)
    75847584#define ELF_MAXPAGESIZE     0x1000
    75857585#else
    75867586#define ELF_MAXPAGESIZE     0x10000
  • binutils-2.18/gas/config/te-beos.h

    diff -rupN binutils-2.18/gas/config/te-beos.h /Volumes/Develop/Haiku/buildtools/binutils-2.18/gas/config/te-beos.h
    old new  
     1/* Target environment for BeOS/haiku.  It is the same as the generic
     2   target, except that it arranges via the TE_BeOS define to
     3   suppress the use of "/" as a comment character.  Some code in the
     4   haiku kernel uses "/" to mean division.  (What a concept!)  */
     5#define TE_BeOS 1
     6
     7#define LOCAL_LABELS_DOLLAR 1
     8#define LOCAL_LABELS_FB 1
     9
     10#include "obj-format.h"
  • binutils-2.18/gas/config/te-haiku.h

    diff -rupN binutils-2.18/gas/config/te-haiku.h /Volumes/Develop/Haiku/buildtools/binutils-2.18/gas/config/te-haiku.h
    old new  
     1/* Target environment for BeOS/haiku.  It is the same as the generic
     2   target, except that it arranges via the TE_BeOS define to
     3   suppress the use of "/" as a comment character.  Some code in the
     4   haiku kernel uses "/" to mean division.  (What a concept!)  */
     5#define TE_BeOS 1
     6
     7#define LOCAL_LABELS_DOLLAR 1
     8#define LOCAL_LABELS_FB 1
     9
     10#include "obj-format.h"
  • binutils-2.18/gas/configure.tgt

    diff -rupN binutils-2.18/gas/configure.tgt /Volumes/Develop/Haiku/buildtools/binutils-2.18/gas/configure.tgt
    old new case ${generic_target} in  
    123123  arm-wince-pe | arm-*-wince)       fmt=coff em=wince-pe ;;
    124124  arm-*-pe | thumb-*-pe)        fmt=coff em=pe ;;
    125125  arm-*-riscix*)            fmt=aout em=riscix ;;
     126  arm*-*-haiku*)            fmt=elf em=haiku ;;
    126127
    127128  avr-*-*)              fmt=elf bfd_gas=yes ;;
    128129  bfin-*-*)             fmt=elf bfd_gas=yes ;;
    case ${generic_target} in  
    173174  i386-*-beos*)             fmt=elf ;;
    174175  i386-*-coff)              fmt=coff ;;
    175176  i386-*-elf)               fmt=elf ;;
     177  i386-*-haiku)             fmt=elf em=haiku ;;
    176178  i386-*-kaos*)             fmt=elf ;;
    177179  i386-*-bsd*)              fmt=aout em=386bsd ;;
    178180  i386-*-netbsd0.8)         fmt=aout em=386bsd ;;
    case ${generic_target} in  
    258260  m68k-*-netbsd*)           fmt=aout em=nbsd bfd_gas=yes ;;
    259261  m68k-*-openbsd*)          fmt=aout em=nbsd bfd_gas=yes ;;
    260262  m68k-*-psos*)             fmt=elf em=psos;;
     263  m68k-*-haiku*)            fmt=elf em=haiku ;;
    261264
    262265  maxq-*-coff)                  fmt=coff bfd_gas=yes ;;
    263266
    case ${generic_target} in  
    317320  ppc-*-beos*)              fmt=coff ;;
    318321  ppc-*-*n*bsd* | ppc-*-elf*)       fmt=elf ;;
    319322  ppc-*-eabi* | ppc-*-sysv4*)       fmt=elf ;;
     323  ppc-*-haiku*)             fmt=elf em=haiku ;;
    320324  ppc-*-linux-*)            fmt=elf em=linux ;;
    321325  ppc-*-solaris*)           fmt=elf ;;
    322326  ppc-*-rtems*)             fmt=elf ;;
  • binutils-2.18/ld/Makefile.am

    diff -rupN binutils-2.18/ld/Makefile.am /Volumes/Develop/Haiku/buildtools/binutils-2.18/ld/Makefile.am
    old new ALL_EMULATIONS = \  
    121121    earmelf.o \
    122122    earmelfb.o \
    123123    earmelf_fbsd.o \
     124    earmelf_haiku.o \
    124125    earmelf_linux.o \
    125126    earmelf_linux_eabi.o \
    126127    earmelfb_linux.o \
    ALL_EMULATIONS = \  
    204205    eelf_i386_be.o \
    205206    eelf_i386_chaos.o \
    206207    eelf_i386_fbsd.o \
     208    eelf_i386_haiku.o \
    207209    eelf_i386_ldso.o \
     210    eelf_ppc_haiku.o \
    208211    eelf_i386_vxworks.o \
    209212    eelf_s390.o \
    210213    egld960.o \
    earmelf_fbsd.c: $(srcdir)/emulparams/arm  
    531534  $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
    532535  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
    533536    ${GENSCRIPTS} armelf_fbsd "$(tdir_armelf_fbsd)"
     537earmelf_haiku.c: $(srcdir)/emulparams/armelf_haiku.sh \
     538  $(srcdir)/emulparams/armelf.sh \
     539  $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
     540  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
     541    ${GENSCRIPTS} armelf_haiku "$(tdir_armelf_haiku)"
    534542earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
    535543  $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
    536544  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
    eelf_i386_fbsd.c: $(srcdir)/emulparams/e  
    9981006  $(srcdir)/emulparams/elf_i386.sh \
    9991007  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
    10001008    ${GENSCRIPTS} elf_i386_fbsd "$(tdir_elf_i386_fbsd)"
     1009eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
     1010  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
     1011    ${GENSCRIPTS} elf_i386_haiku "$(tdir_elf_i386_haiku)"
    10011012eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
    10021013  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
    10031014    ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
     1015eelf_ppc_haiku:c $(srcdir)/emulparams/elf_ppc_haiku.sh \
     1016  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
     1017    ${GENSCRIPTS} elf_ppc_haiku "$(tdir_elf_ppc_haiku)"
    10041018eelf_i386_vxworks.c: $(srcdir)/emulparams/elf_i386_vxworks.sh \
    10051019  $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \
    10061020  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  • binutils-2.18/ld/Makefile.in

    diff -rupN binutils-2.18/ld/Makefile.in /Volumes/Develop/Haiku/buildtools/binutils-2.18/ld/Makefile.in
    old new ALL_EMULATIONS = \  
    368368    earmelf.o \
    369369    earmelfb.o \
    370370    earmelf_fbsd.o \
     371    earmelf_haiku.o \
    371372    earmelf_linux.o \
    372373    earmelf_linux_eabi.o \
    373374    earmelfb_linux.o \
    ALL_EMULATIONS = \  
    451452    eelf_i386_be.o \
    452453    eelf_i386_chaos.o \
    453454    eelf_i386_fbsd.o \
     455    eelf_i386_haiku.o \
    454456    eelf_i386_ldso.o \
     457    eelf_ppc_haiku.o \
    455458    eelf_i386_vxworks.o \
    456459    eelf_s390.o \
    457460    egld960.o \
    earmelf_fbsd.c: $(srcdir)/emulparams/arm  
    13571360  $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
    13581361  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
    13591362    ${GENSCRIPTS} armelf_fbsd "$(tdir_armelf_fbsd)"
     1363earmelf_haiku.c: $(srcdir)/emulparams/armelf_haiku.sh \
     1364  $(srcdir)/emulparams/armelf.sh \
     1365  $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
     1366  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
     1367    ${GENSCRIPTS} armelf_haiku "$(tdir_armelf_haiku)"
    13601368earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
    13611369  $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
    13621370  $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
    eelf_i386_fbsd.c: $(srcdir)/emulparams/e  
    18241832  $(srcdir)/emulparams/elf_i386.sh \
    18251833  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
    18261834    ${GENSCRIPTS} elf_i386_fbsd "$(tdir_elf_i386_fbsd)"
     1835eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
     1836  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
     1837    ${GENSCRIPTS} elf_i386_haiku "$(tdir_elf_i386_haiku)"
    18271838eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
    18281839  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
    18291840    ${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
     1841eelf_ppc_haiku.c: $(srcdir)/emulparams/elf_ppc_haiku.sh \
     1842  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
     1843    ${GENSCRIPTS} elf_ppc_haiku "$(tdir_elf_ppc_haiku)"
    18301844eelf_i386_vxworks.c: $(srcdir)/emulparams/elf_i386_vxworks.sh \
    18311845  $(srcdir)/emulparams/vxworks.sh $(srcdir)/emultempl/vxworks.em \
    18321846  $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
  • binutils-2.18/ld/configure.tgt

    diff -rupN binutils-2.18/ld/configure.tgt /Volumes/Develop/Haiku/buildtools/binutils-2.18/ld/configure.tgt
    old new arm*-*-uclinux*) targ_emul=armelf_linux  
    9393            ;;
    9494arm-*-vxworks)      targ_emul=armelf_vxworks ;;
    9595arm*-*-conix*)      targ_emul=armelf ;;
     96arm*-*-haiku*)      targ_emul=armelf_haiku
     97            targ_extra_emuls="armelf" ;;
    9698thumb-*-linux-* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
    9799strongarm-*-coff)   targ_emul=armcoff ;;
    98100strongarm-*-elf)    targ_emul=armelf ;;
    i[3-7]86-*-interix*) targ_emul=i386pe_po  
    269271            targ_extra_ofiles="deffilep.o pe-dll.o" ;;
    270272i[3-7]86-*-beospe*) targ_emul=i386beos ;;
    271273i[3-7]86-*-beos*)   targ_emul=elf_i386_be ;;
     274i[3-7]86-*-haiku*)  targ_emul=elf_i386_haiku ;;
    272275i[3-7]86-*-vxworks*)    targ_emul=elf_i386_vxworks ;;
    273276i[3-7]86-*-chaos)   targ_emul=elf_i386_chaos
    274277            ;;
    m68*-*-psos*) targ_emul=m68kpsos ;;  
    337340m68*-*-rtemscoff*)  targ_emul=m68kcoff ;;
    338341m68*-*-rtems*)      targ_emul=m68kelf
    339342            ;;
     343m68*-*-haiku*)      targ_emul=m68kelf
     344            targ_extra_emuls=m68kcoff
     345            ;;
    340346m8*-*-*)        targ_emul=m88kbcs
    341347            ;;
    342348maxq-*-coff)            targ_emul=maxqcoff
    powerpc-*-aix5*) targ_emul=aix5ppc ;;  
    480486powerpc-*-aix*)     targ_emul=aixppc ;;
    481487powerpc-*-beos*)    targ_emul=aixppc ;;
    482488powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
     489powerpc-*-haiku*)   targ_emul=elf_ppc_haiku ;;
    483490powerpc-*-lynxos*)  targ_emul=ppclynx ;;
    484491rs6000-*-aix5*)     targ_emul=aix5rs6 ;;
    485492rs6000-*-aix*)      targ_emul=aixrs6
  • binutils-2.18/ld/emulparams/armelf_haiku.sh

    diff -rupN binutils-2.18/ld/emulparams/armelf_haiku.sh /Volumes/Develop/Haiku/buildtools/binutils-2.18/ld/emulparams/armelf_haiku.sh
    old new  
     1. ${srcdir}/emulparams/armelf.sh
     2TEXT_START_ADDR=0x200000
     3NONPAGED_TEXT_START_ADDR=0x200000
     4MAXPAGESIZE=0x1000
     5COMMONPAGESIZE=0x1000
     6GENERATE_SHLIB_SCRIPT=yes
     7TARGET2_TYPE=got-rel
  • binutils-2.18/ld/emulparams/elf_i386_haiku.sh

    diff -rupN binutils-2.18/ld/emulparams/elf_i386_haiku.sh /Volumes/Develop/Haiku/buildtools/binutils-2.18/ld/emulparams/elf_i386_haiku.sh
    old new  
     1SCRIPT_NAME=elf
     2OUTPUT_FORMAT="elf32-i386"
     3TEXT_START_ADDR=0x200000
     4NONPAGED_TEXT_START_ADDR=0x200000
     5MAXPAGESIZE=0x1000
     6ARCH=i386
     7MACHINE=
     8NOP=0x90909090
     9TEMPLATE_NAME=elf32
     10GENERATE_SHLIB_SCRIPT=yes
     11NO_SMALL_DATA=yes
  • binutils-2.18/ld/emulparams/elf_ppc_haiku.sh

    diff -rupN binutils-2.18/ld/emulparams/elf_ppc_haiku.sh /Volumes/Develop/Haiku/buildtools/binutils-2.18/ld/emulparams/elf_ppc_haiku.sh
    old new  
     1SCRIPT_NAME=elf
     2OUTPUT_FORMAT="elf32-powerpc"
     3TEXT_START_ADDR=0x200000
     4NONPAGED_TEXT_START_ADDR=0x200000
     5MAXPAGESIZE=0x1000
     6ARCH=powerpc
     7MACHINE=
     8NOP=0x60000000
     9TEMPLATE_NAME=elf32
     10GENERATE_SHLIB_SCRIPT=yes
     11BSS_PLT=
     12OTHER_RELRO_SECTIONS="
     13  .fixup        ${RELOCATING-0} : { *(.fixup) }
     14  .got1         ${RELOCATING-0} : { *(.got1) }
     15  .got2         ${RELOCATING-0} : { *(.got2) }
     16"
     17OTHER_GOT_RELOC_SECTIONS="
     18  .rela.got1         ${RELOCATING-0} : { *(.rela.got1) }
     19  .rela.got2         ${RELOCATING-0} : { *(.rela.got2) }
     20"
  • binutils-2.18/libtool.m4

    diff -rupN binutils-2.18/libtool.m4 /Volumes/Develop/Haiku/buildtools/binutils-2.18/libtool.m4
    old new else  
    15981598  lt_cv_dlopen_libs=
    15991599
    16001600  case $host_os in
    1601   beos*)
     1601  beos* | haiku*)
    16021602    lt_cv_dlopen="load_add_on"
    16031603    lt_cv_dlopen_libs=
    16041604    lt_cv_dlopen_self=yes
    beos*)  
    20532053  shlibpath_var=LIBRARY_PATH
    20542054  ;;
    20552055
     2056haiku*)
     2057  library_names_spec='${libname}.so'
     2058  dynamic_linker="$host_os ld.so"
     2059  shlibpath_var=LIBRARY_PATH
     2060  ;;
     2061
    20562062bsdi[[45]]*)
    20572063  version_type=linux
    20582064  need_version=no
    gnu*)  
    28912897  lt_cv_deplibs_check_method=pass_all
    28922898  ;;
    28932899
     2900haiku*)
     2901  lt_cv_deplibs_check_method=pass_all
     2902  ;;
     2903
    28942904hpux10.20* | hpux11*)
    28952905  lt_cv_file_magic_cmd=/usr/bin/file
    28962906  case $host_cpu in
    AC_DEFUN([LT_LIB_M],  
    31103120[AC_REQUIRE([AC_CANONICAL_HOST])dnl
    31113121LIBM=
    31123122case $host in
    3113 *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
     3123*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin* | *-*-haiku*)
    31143124  # These system don't have libm, or don't need it
    31153125  ;;
    31163126*-ncr-sysv4.3*)
    m4_if([$1], [CXX], [  
    34113421        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
    34123422      fi
    34133423      ;;
    3414     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
     3424    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5* | haiku*)
    34153425      # PIC is the default for these OSes.
    34163426      ;;
    34173427    mingw* | cygwin* | os2* | pw32*)
    m4_if([$1], [CXX], [  
    37063716      fi
    37073717      ;;
    37083718
    3709     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
     3719    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5* | haiku*)
    37103720      # PIC is the default for these OSes.
    37113721      ;;
    37123722
    _LT_EOF  
    41244134      _LT_TAGVAR(ld_shlibs, $1)=no
    41254135      ;;
    41264136
    4127     beos*)
     4137    beos* | haiku*)
    41284138      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
    41294139    _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
    41304140    # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
    if test "$_lt_caught_CXX_error" != yes;  
    54485458        fi
    54495459        ;;
    54505460
    5451       beos*)
     5461      beos* | haiku*)
    54525462    if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
    54535463      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
    54545464      # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  • binutils-2.18/ltmain.sh

    diff -rupN binutils-2.18/ltmain.sh /Volumes/Develop/Haiku/buildtools/binutils-2.18/ltmain.sh
    old new func_mode_link ()  
    30733073      -l*)
    30743074    if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
    30753075      case $host in
    3076       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
     3076      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-*-haiku*)
    30773077        # These systems don't actually have a C or math library (as such)
    30783078        continue
    30793079        ;;
    func_mode_link ()  
    49964996      if test "$build_libtool_libs" = yes; then
    49974997    if test -n "$rpath"; then
    49984998      case $host in
    4999       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
     4999      *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-*-haiku*)
    50005000        # these systems don't actually have a c library (as such)!
    50015001        ;;
    50025002      *-*-rhapsody* | *-*-darwin1.[012])