⛏️ index : buildtools.git

author waddlesplash <waddlesplash@gmail.com> 2018-05-19 20:54:06.0 -04:00:00
committer waddlesplash <waddlesplash@gmail.com> 2018-05-19 23:00:50.0 -04:00:00
commit
8651cd3f95cde12486ef7dea52fa8332d007094e [patch]
tree
77888459519b44e5d566f6591674fccd2bebea46
parent
51ec6d2217e914e0b420fa853b8157519de2c777
download
8651cd3f95cde12486ef7dea52fa8332d007094e.tar.gz

Further fixes to get GCC 7.3 actually working for Haiku builds.

Partially from @jarekpelczar's work, but only certain pieces that
were needed, and the rest is either from earlier GCC patches
or is my own work.

With this, GCC 7 can now build Haiku.

Diff

 gcc/config.rpath                |  2 ++
 gcc/libtool.m4                  |  2 +-
 gcc/gcc/config.host             |  4 ++--
 gcc/gcc/configure               |  2 ++
 gcc/libgcc/config.host          | 23 +++++++++++++++++++++++
 gcc/libstdc++-v3/configure      | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gcc/libstdc++-v3/configure.host |  5 ++++-
 gcc/libstdc++-v3/crossconfig.m4 | 40 ++++++++++++++++++++++++++++++++++++++++
 gcc/gcc/config/haiku.h          |  3 ---
 gcc/gcc/config/i386/haiku64.h   |  6 +++---
 10 files changed, 161 insertions(+), 11 deletions(-)

diff --git a/gcc/config.rpath b/gcc/config.rpath
index 4dea759..7f4f578 100755
--- a/gcc/config.rpath
+++ a/gcc/config.rpath
@@ -161,6 +161,8 @@
      ;;
    netbsd*)
      ;;
	haiku*)
	  ;;
    solaris* | sysv5*)
      if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
        ld_shlibs=no
diff --git a/gcc/libtool.m4 b/gcc/libtool.m4
index 24d13f3..615cd59 100644
--- a/gcc/libtool.m4
+++ a/gcc/libtool.m4
@@ -1722,7 +1722,7 @@
  lt_cv_dlopen_libs=

  case $host_os in
  beos*)
  beos* | haiku*)
    lt_cv_dlopen="load_add_on"
    lt_cv_dlopen_libs=
    lt_cv_dlopen_self=yes
diff --git a/gcc/gcc/config.host b/gcc/gcc/config.host
index 9bccbda..74b4af7 100644
--- a/gcc/gcc/config.host
+++ a/gcc/gcc/config.host
@@ -134,10 +134,10 @@
    esac
    ;;
  mips*-*-linux* \
    mips*-*-haiku*)
  |  mips*-*-haiku*)
    case ${target} in
      mips*-*-linux* \
        mips*-*-haiku*)
      |  mips*-*-haiku*)
	host_extra_gcc_objs="driver-native.o"
	host_xmake_file="${host_xmake_file} mips/x-native"
      ;;
diff --git a/gcc/gcc/configure b/gcc/gcc/configure
index 043a62b..9ce728f 100755
--- a/gcc/gcc/configure
+++ a/gcc/gcc/configure
@@ -25217,6 +25217,7 @@

fi


    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for SPARC6 instructions" >&5
$as_echo_n "checking assembler for SPARC6 instructions... " >&6; }
if test "${gcc_cv_as_sparc_sparc6+set}" = set; then :
@@ -25252,6 +25253,7 @@
$as_echo "#define HAVE_AS_SPARC6 1" >>confdefs.h

fi


    { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for LEON instructions" >&5
$as_echo_n "checking assembler for LEON instructions... " >&6; }
diff --git a/gcc/libgcc/config.host b/gcc/libgcc/config.host
index 8beb492..8a7595a 100644
--- a/gcc/libgcc/config.host
+++ a/gcc/libgcc/config.host
@@ -231,6 +231,10 @@
      ;;
  esac
  ;;
*-*-haiku*)
  tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-slibgcc-nolc-override t-haiku"
  extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
  ;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
  tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
  extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
@@ -391,6 +395,13 @@
arm*-*-freebsd*)                # ARM FreeBSD EABI
	tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf"
	tmake_file="${tmake_file} arm/t-bpabi arm/t-freebsd"
	tm_file="${tm_file} arm/bpabi-lib.h"
	unwind_header=config/arm/unwind-arm.h
	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
	;;
arm*-*-haiku*)
	tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf"
	tmake_file="${tmake_file} arm/t-bpabi"
	tm_file="${tm_file} arm/bpabi-lib.h"
	unwind_header=config/arm/unwind-arm.h
	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
@@ -604,7 +615,13 @@
x86_64-*-freebsd*)
	tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
	md_unwind_header=i386/freebsd-unwind.h
	;;
i[34567]86-*-haiku*)
	tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2"
	;;
x86_64-*-haiku*)
	tmake_file="${tmake_file} i386/t-crtstuff i386/t-eh-dw2"
	;;
i[34567]86-*-netbsdelf*)
	tmake_file="${tmake_file} i386/t-crtstuff"
	;;
@@ -812,6 +829,8 @@
 	;;
m32rle-*-linux*)
	tmake_file="$tmake_file m32r/t-linux t-fdpbit"
	;;
m68k-*-haiku*)
	;;
m68k-*-elf* | fido-*-elf)
	tmake_file="$tmake_file m68k/t-floatlib"
@@ -883,6 +902,8 @@
	esac
	extra_parts="$extra_parts crti.o crtn.o"
	;;
mipsel-*-haiku*)
	;;
mipsisa32-*-elf* | mipsisa32el-*-elf* | \
mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \
@@ -1008,6 +1029,8 @@
	  md_unwind_header=rs6000/freebsd-unwind.h
	  ;;
	esac
	;;
powerpc-*-haiku*)
	;;
powerpc-*-netbsd*)
	tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff"
diff --git a/gcc/libstdc++-v3/configure b/gcc/libstdc++-v3/configure
index e70fdd6..826bfb1 100755
--- a/gcc/libstdc++-v3/configure
+++ a/gcc/libstdc++-v3/configure
@@ -11308,7 +11308,7 @@
  lt_cv_dlopen_libs=

  case $host_os in
  beos*)
  beos* | haiku*)
    lt_cv_dlopen="load_add_on"
    lt_cv_dlopen_libs=
    lt_cv_dlopen_self=yes
@@ -53326,6 +53326,89 @@

fi
done

    ;;

  *-haiku*)
    for ac_header in nan.h ieeefp.h endian.h sys/isa_defs.h \
      machine/endian.h machine/param.h sys/machine.h sys/types.h \
      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h
do :
  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
eval as_val=\$$as_ac_Header
   if test "x$as_val" = x""yes; then :
  cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF

fi

done

    SECTION_FLAGS='-ffunction-sections -fdata-sections'


    $as_echo "#define HAVE_INT64_T 1" >>confdefs.h


    $as_echo "#define HAVE_ACOSF 1" >>confdefs.h

    $as_echo "#define HAVE_ASINF 1" >>confdefs.h

    $as_echo "#define HAVE_ATANF 1" >>confdefs.h

    $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h

    $as_echo "#define HAVE_CEILF 1" >>confdefs.h

    $as_echo "#define HAVE_COSF 1" >>confdefs.h

    $as_echo "#define HAVE_COSHF 1" >>confdefs.h

    $as_echo "#define HAVE_EXPF 1" >>confdefs.h

    $as_echo "#define HAVE_FABSF 1" >>confdefs.h

    $as_echo "#define HAVE_FINITE 1" >>confdefs.h

    $as_echo "#define HAVE_FINITEF 1" >>confdefs.h

    $as_echo "#define HAVE_FLOORF 1" >>confdefs.h

    $as_echo "#define HAVE_FMODF 1" >>confdefs.h

    $as_echo "#define HAVE_FREXPF 1" >>confdefs.h

    $as_echo "#define HAVE_HYPOT 1" >>confdefs.h

    $as_echo "#define HAVE_HYPOTF 1" >>confdefs.h

    $as_echo "#define HAVE_ISINF 1" >>confdefs.h

    $as_echo "#define HAVE_ISINFF 1" >>confdefs.h

    $as_echo "#define HAVE_ISNAN 1" >>confdefs.h

    $as_echo "#define HAVE_ISNANF 1" >>confdefs.h

    $as_echo "#define HAVE_LOGF 1" >>confdefs.h

    $as_echo "#define HAVE_LOG10F 1" >>confdefs.h

    $as_echo "#define HAVE_MODFF 1" >>confdefs.h

    $as_echo "#define HAVE_SINF 1" >>confdefs.h

    $as_echo "#define HAVE_SINHF 1" >>confdefs.h

    $as_echo "#define HAVE_SQRTF 1" >>confdefs.h

    $as_echo "#define HAVE_TANF 1" >>confdefs.h

    $as_echo "#define HAVE_TANHF 1" >>confdefs.h

    $as_echo "#define HAVE_TLS 1" >>confdefs.h

    ;;

diff --git a/gcc/libstdc++-v3/configure.host b/gcc/libstdc++-v3/configure.host
index caea9de..0bd5636 100644
--- a/gcc/libstdc++-v3/configure.host
+++ a/gcc/libstdc++-v3/configure.host
@@ -270,6 +270,9 @@
      os_include_dir="os/gnu-linux"
    fi
    ;;
  haiku*)
    os_include_dir="os/haiku"
    ;;
  hpux*)
    os_include_dir="os/hpux"
    ;;
@@ -360,7 +363,7 @@
	;;
    esac
    ;;
  arm*-*-freebsd*)
  arm*-*-freebsd* | arm*-*-haiku*)
     port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
     ;;
  powerpc*-*-darwin*)
diff --git a/gcc/libstdc++-v3/crossconfig.m4 b/gcc/libstdc++-v3/crossconfig.m4
index 77c9828..38da254 100644
--- a/gcc/libstdc++-v3/crossconfig.m4
+++ a/gcc/libstdc++-v3/crossconfig.m4
@@ -135,6 +135,46 @@
    AC_CHECK_FUNCS(__cxa_thread_atexit)
    ;;

  *-haiku*)
    AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
      machine/endian.h machine/param.h sys/machine.h sys/types.h \
      fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
    SECTION_FLAGS='-ffunction-sections -fdata-sections'
    AC_SUBST(SECTION_FLAGS)

    AC_DEFINE(HAVE_INT64_T)

    AC_DEFINE(HAVE_ACOSF)
    AC_DEFINE(HAVE_ASINF)
    AC_DEFINE(HAVE_ATANF)
    AC_DEFINE(HAVE_ATAN2F)
    AC_DEFINE(HAVE_CEILF)
    AC_DEFINE(HAVE_COSF)
    AC_DEFINE(HAVE_COSHF)
    AC_DEFINE(HAVE_EXPF)
    AC_DEFINE(HAVE_FABSF)
    AC_DEFINE(HAVE_FINITE)
    AC_DEFINE(HAVE_FINITEF)
    AC_DEFINE(HAVE_FLOORF)
    AC_DEFINE(HAVE_FMODF)
    AC_DEFINE(HAVE_FREXPF)
    AC_DEFINE(HAVE_HYPOT)
    AC_DEFINE(HAVE_HYPOTF)
    AC_DEFINE(HAVE_ISINF)
    AC_DEFINE(HAVE_ISINFF)
    AC_DEFINE(HAVE_ISNAN)
    AC_DEFINE(HAVE_ISNANF)
    AC_DEFINE(HAVE_LOGF)
    AC_DEFINE(HAVE_LOG10F)
    AC_DEFINE(HAVE_MODFF)
    AC_DEFINE(HAVE_SINF)
    AC_DEFINE(HAVE_SINHF)
    AC_DEFINE(HAVE_SQRTF)
    AC_DEFINE(HAVE_TANF)
    AC_DEFINE(HAVE_TANHF)
    AC_DEFINE(HAVE_TLS)
    ;;

  *-fuchsia*)
    SECTION_FLAGS='-ffunction-sections -fdata-sections'
    AC_SUBST(SECTION_FLAGS)
diff --git a/gcc/gcc/config/haiku.h b/gcc/gcc/config/haiku.h
index 27bab0a..e3a9c7e 100644
--- a/gcc/gcc/config/haiku.h
+++ a/gcc/gcc/config/haiku.h
@@ -213,8 +213,5 @@
/* Do not use JCR_SECTION_NAME default definition for Haiku */
#define TARGET_NO_JCR_SECTION_NAME 1

/* Do not desire to have _Jv_RegisterClasses in crtbegin.o for Haiku */
#define TARGET_USE_JCR_SECTION 0

/* Do not use TM clone registry in Haiku for now */
#define USE_TM_CLONE_REGISTRY 0
diff --git a/gcc/gcc/config/i386/haiku64.h b/gcc/gcc/config/i386/haiku64.h
index 76ba48e..8c43498 100644
--- a/gcc/gcc/config/i386/haiku64.h
+++ a/gcc/gcc/config/i386/haiku64.h
@@ -112,9 +112,9 @@
#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \
 %{Wa,*:%*} %{" SPEC_32 ":--32} %{" SPEC_64 ":--64}"

#undef  ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN)		\
  x86_elf_aligned_common (FILE, NAME, SIZE, ALIGN);
#undef  ASM_OUTPUT_ALIGNED_DECL_COMMON
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN)		\
  x86_elf_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN);


/* i386 System V Release 4 uses DWARF debugging info.