blob: eb4dedaae9aad6f761f73baa23fb0347265bdfd7 [file] [log] [blame]
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/config.sub gcc-6.3.0/config.sub
--- gcc-6.3.0-fsf/config.sub 2017-03-30 16:18:19.117238667 -0700
+++ gcc-6.3.0/config.sub 2017-03-30 16:23:21.688074247 -0700
@@ -1531,6 +1531,9 @@ case $os in
;;
-nacl*)
;;
+ -fuchsia*)
+ os=-fuchsia
+ ;;
-none)
;;
*)
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/collect2.c gcc-6.3.0/gcc/collect2.c
--- gcc-6.3.0-fsf/gcc/collect2.c 2017-03-30 16:18:18.781239956 -0700
+++ gcc-6.3.0/gcc/collect2.c 2017-03-30 16:23:21.692074232 -0700
@@ -1067,8 +1067,10 @@ main (int argc, char **argv)
if (signal (SIGQUIT, SIG_IGN) != SIG_IGN)
signal (SIGQUIT, handler);
#endif
+#ifdef SIGINT
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, handler);
+#endif
#ifdef SIGALRM
if (signal (SIGALRM, SIG_IGN) != SIG_IGN)
signal (SIGALRM, handler);
@@ -1077,8 +1079,10 @@ main (int argc, char **argv)
if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
signal (SIGHUP, handler);
#endif
+#ifdef SIGSEGV
if (signal (SIGSEGV, SIG_IGN) != SIG_IGN)
signal (SIGSEGV, handler);
+#endif
#ifdef SIGBUS
if (signal (SIGBUS, SIG_IGN) != SIG_IGN)
signal (SIGBUS, handler);
@@ -2307,7 +2311,9 @@ static void
scan_prog_file (const char *prog_name, scanpass which_pass,
scanfilter filter)
{
+#ifdef SIGINT
void (*int_handler) (int);
+#endif
#ifdef SIGQUIT
void (*quit_handler) (int);
#endif
@@ -2373,7 +2379,9 @@ scan_prog_file (const char *prog_name, s
fatal_error (input_location, errmsg);
}
+#ifdef SIGINT
int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN);
+#endif
#ifdef SIGQUIT
quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN);
#endif
@@ -2499,7 +2507,9 @@ scan_prog_file (const char *prog_name, s
do_wait (nm_file_name, pex);
+#ifdef SIGINT
signal (SIGINT, int_handler);
+#endif
#ifdef SIGQUIT
signal (SIGQUIT, quit_handler);
#endif
@@ -2571,7 +2581,9 @@ scan_libraries (const char *prog_name)
fatal_error (input_location, errmsg);
}
+#ifdef SIGINT
int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN);
+#endif
#ifdef SIGQUIT
quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN);
#endif
@@ -2619,7 +2631,9 @@ scan_libraries (const char *prog_name)
do_wait (ldd_file_name, pex);
+#ifdef SIGINT
signal (SIGINT, int_handler);
+#endif
#ifdef SIGQUIT
signal (SIGQUIT, quit_handler);
#endif
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/config/fuchsia.h gcc-6.3.0/gcc/config/fuchsia.h
--- gcc-6.3.0-fsf/gcc/config/fuchsia.h 1969-12-31 16:00:00.000000000 -0800
+++ gcc-6.3.0/gcc/config/fuchsia.h 2017-03-30 16:23:21.692074232 -0700
@@ -0,0 +1,105 @@
+/* Base configuration file for all Fuchsia targets.
+ Copyright (C) 2016 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* Common Fuchsia configuration. */
+
+/* In case we need to know. */
+#define USING_CONFIG_FUCHSIA 1
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%{!shared: crt1%O%s} crtbegin%O%s"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend%O%s"
+
+/* When neither pic nor pie has been specified, use PIE by default. */
+#undef CC1_SPEC
+#define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC:" \
+ "%{!fno-pie:%{!fno-PIE:%{!fpie:%{!fPIE: -fPIE}}}}}}}}"
+
+#undef LIB_SPEC
+#define LIB_SPEC "--start-group" \
+ " -lmxio -lmagenta -lc -llaunchpad" \
+ "%{!static: -lgcc_s}" \
+ " --end-group"
+
+#undef LINK_SPEC
+#define LINK_SPEC "-z max-page-size=4096" \
+ " -z combreloc" \
+ " -z relro" \
+ " -z now" \
+ " -z text" \
+ "%{!hash-style: --hash-style=gnu}" \
+ "%{!no-eh-frame-hdr: --eh-frame-hdr}" \
+ "%{!no-build-id: --build-id}" \
+ "%{shared: -shared}" \
+ "%{!shared:%{!static:%{!dynamic-linker: -dynamic-linker=ld.so.1}}}"
+
+/* We are using MUSL as our libc. */
+#undef OPTION_MUSL
+#define OPTION_MUSL 1
+
+#ifndef TARGET_SUB_OS_CPP_BUILTINS
+#define TARGET_SUB_OS_CPP_BUILTINS()
+#endif
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__Fuchsia__"); \
+ TARGET_SUB_OS_CPP_BUILTINS(); \
+ } \
+ while (false)
+
+/* /dev/null is unwritable, at the moment. Use this as a workaround. */
+#undef HOST_BIT_BUCKET
+#define HOST_BIT_BUCKET "/tmp/.null"
+
+/* Inode numbers are not available to us. */
+#define HOST_LACKS_INODE_NUMBERS
+
+/* In fact we have ftw.h, but the function itself is unimplemented. */
+#undef HAVE_FTW_H
+
+/* Functions that are implemented as stubs in libc. */
+#undef HAVE_GETRLIMIT
+#undef HAVE_GETRUSAGE
+#undef HAVE_REALPATH
+#undef HAVE_SETRLIMIT
+#undef HAVE_TIMES
+
+/* No ioctl() support. */
+#undef TIOCGWINSZ
+
+/* No signal() support. */
+#undef SIGABRT
+#undef SIGALRM
+#undef SIGBUS
+#undef SIGCHLD
+#undef SIGFPE
+#undef SIGHUP
+#undef SIGILL
+#undef SIGINT
+#undef SIGIOT
+#undef SIGPIPE
+#undef SIGQUIT
+#undef SIGSEGV
+#undef SIGTERM
+
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/config/i386/i386.c gcc-6.3.0/gcc/config/i386/i386.c
--- gcc-6.3.0-fsf/gcc/config/i386/i386.c 2017-03-30 16:18:17.521244794 -0700
+++ gcc-6.3.0/gcc/config/i386/i386.c 2017-03-30 16:23:21.708074170 -0700
@@ -41322,9 +41322,6 @@ ix86_expand_builtin (tree exp, rtx targe
mode0 = DImode;
rdrand_step:
- op0 = gen_reg_rtx (mode0);
- emit_insn (GEN_FCN (icode) (op0));
-
arg0 = CALL_EXPR_ARG (exp, 0);
op1 = expand_normal (arg0);
if (!address_operand (op1, VOIDmode))
@@ -41332,6 +41329,10 @@ rdrand_step:
op1 = convert_memory_address (Pmode, op1);
op1 = copy_addr_to_reg (op1);
}
+
+ op0 = gen_reg_rtx (mode0);
+ emit_insn (GEN_FCN (icode) (op0));
+
emit_move_insn (gen_rtx_MEM (mode0, op1), op0);
op1 = gen_reg_rtx (SImode);
@@ -41340,8 +41341,20 @@ rdrand_step:
/* Emit SImode conditional move. */
if (mode0 == HImode)
{
- op2 = gen_reg_rtx (SImode);
- emit_insn (gen_zero_extendhisi2 (op2, op0));
+ if (TARGET_ZERO_EXTEND_WITH_AND
+ && optimize_function_for_speed_p (cfun))
+ {
+ op2 = force_reg (SImode, const0_rtx);
+
+ emit_insn (gen_movstricthi
+ (gen_lowpart (HImode, op2), op0));
+ }
+ else
+ {
+ op2 = gen_reg_rtx (SImode);
+
+ emit_insn (gen_zero_extendhisi2 (op2, op0));
+ }
}
else if (mode0 == SImode)
op2 = op0;
@@ -41373,9 +41386,6 @@ rdrand_step:
mode0 = DImode;
rdseed_step:
- op0 = gen_reg_rtx (mode0);
- emit_insn (GEN_FCN (icode) (op0));
-
arg0 = CALL_EXPR_ARG (exp, 0);
op1 = expand_normal (arg0);
if (!address_operand (op1, VOIDmode))
@@ -41383,6 +41393,10 @@ rdseed_step:
op1 = convert_memory_address (Pmode, op1);
op1 = copy_addr_to_reg (op1);
}
+
+ op0 = gen_reg_rtx (mode0);
+ emit_insn (GEN_FCN (icode) (op0));
+
emit_move_insn (gen_rtx_MEM (mode0, op1), op0);
op2 = gen_reg_rtx (QImode);
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/config/i386/t-x86_64-elf gcc-6.3.0/gcc/config/i386/t-x86_64-elf
--- gcc-6.3.0-fsf/gcc/config/i386/t-x86_64-elf 1969-12-31 16:00:00.000000000 -0800
+++ gcc-6.3.0/gcc/config/i386/t-x86_64-elf 2017-03-30 16:23:21.712074155 -0700
@@ -0,0 +1,8 @@
+# Add redzoneless libgcc
+
+MULTILIB_OPTIONS += mno-red-zone
+MULTILIB_DIRNAMES += no-red-zone
+
+# Build a 32bit libgcc as well
+MULTILIB_OPTIONS += m32
+MULTILIB_DIRNAMES += 32
\ No newline at end of file
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/config.gcc gcc-6.3.0/gcc/config.gcc
--- gcc-6.3.0-fsf/gcc/config.gcc 2017-03-30 16:18:18.853239681 -0700
+++ gcc-6.3.0/gcc/config.gcc 2017-03-31 18:27:18.774027678 -0700
@@ -710,6 +710,9 @@ case ${target} in
esac
use_gcc_stdint=wrap
;;
+*-*-fuchsia*)
+ native_system_header_dir=/include
+ ;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
extra_options="$extra_options gnu-user.opt"
gas=yes
@@ -912,7 +915,7 @@ case ${target} in
esac
case ${target} in
-aarch64*-*-elf | aarch64*-*-rtems*)
+aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h"
tmake_file="${tmake_file} aarch64/t-aarch64"
@@ -920,6 +923,9 @@ aarch64*-*-elf | aarch64*-*-rtems*)
aarch64-*-elf*)
use_gcc_stdint=wrap
;;
+ aarch64-*-fuchsia*)
+ tm_file="${tm_file} fuchsia.h"
+ ;;
aarch64-*-rtems*)
tm_file="${tm_file} rtems.h aarch64/rtems.h"
;;
@@ -1429,6 +1435,7 @@ i[34567]86-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
;;
x86_64-*-elf*)
+ tmake_file="${tmake_file} i386/t-x86_64-elf"
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
;;
x86_64-*-rtems*)
@@ -1802,6 +1809,10 @@ i[34567]86-*-interix[3-9]*)
tm_file="${tm_file} dbxcoff.h"
fi
;;
+x86_64-*-fuchsia*)
+ tmake_file="${tmake_file} i386/t-x86_64-elf"
+ tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h fuchsia.h"
+ ;;
ia64*-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h ia64/sysv4.h ia64/elf.h"
tmake_file="ia64/t-ia64"
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/config.host gcc-6.3.0/gcc/config.host
--- gcc-6.3.0-fsf/gcc/config.host 2017-03-30 16:18:17.569244610 -0700
+++ gcc-6.3.0/gcc/config.host 2017-03-31 18:27:55.833878360 -0700
@@ -99,7 +99,7 @@ case ${host} in
esac
case ${host} in
- aarch64*-*-linux*)
+ aarch64*-*-linux* | aarch64*-*-fuchsia*)
case ${target} in
aarch64*-*-*)
host_extra_gcc_objs="driver-aarch64.o"
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/configure gcc-6.3.0/gcc/configure
--- gcc-6.3.0-fsf/gcc/configure 2017-03-30 16:18:18.769240003 -0700
+++ gcc-6.3.0/gcc/configure 2017-03-31 06:43:15.446595972 -0700
@@ -13387,6 +13387,10 @@ freebsd* | dragonfly*)
fi
;;
+fuchsia*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -17645,6 +17649,15 @@ freebsd* | dragonfly*)
esac
;;
+fuchsia*)
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os ld.so.1"
+ library_names_spec='$libname$shared_ext'
+ soname_spec='$libname$shared_ext'
+ sys_lib_dlsearch_path_spec='/system/lib /boot/lib'
+ ;;
+
gnu*)
version_type=linux
need_lib_prefix=no
@@ -18248,6 +18261,11 @@ fi
;;
+ fuchsia*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
*)
ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
if test "x$ac_cv_func_shl_load" = x""yes; then :
@@ -18460,7 +18478,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18463 "configure"
+#line 18481 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18566,7 +18584,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18569 "configure"
+#line 18587 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -20470,6 +20488,10 @@ $as_echo_n "checking for $compiler optio
freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
+ fuchsia* )
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
hpux9* | hpux10* | hpux11*)
case $cc_basename in
CC*)
@@ -21305,6 +21327,15 @@ freebsd* | dragonfly*)
esac
;;
+fuchsia*)
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os ld.so.1"
+ library_names_spec='$libname$shared_ext'
+ soname_spec='$libname$shared_ext'
+ sys_lib_dlsearch_path_spec='/system/lib /boot/lib'
+ ;;
+
gnu*)
version_type=linux
need_lib_prefix=no
@@ -29486,14 +29517,19 @@ fi
# Check if -fno-PIE works.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-PIE option" >&5
+case $host_os in
+ fuchsia*)
+ # Fuchsia requires PIE binaries
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-PIE option" >&5
$as_echo_n "checking for -fno-PIE option... " >&6; }
if test "${gcc_cv_c_no_fpie+set}" = set; then :
$as_echo_n "(cached) " >&6
else
saved_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -fno-PIE"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ CXXFLAGS="$CXXFLAGS -fno-PIE"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(void) {return 0;}
_ACEOF
@@ -29503,24 +29539,31 @@ else
gcc_cv_c_no_fpie=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CXXFLAGS="$saved_CXXFLAGS"
+ CXXFLAGS="$saved_CXXFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_c_no_fpie" >&5
$as_echo "$gcc_cv_c_no_fpie" >&6; }
-if test "$gcc_cv_c_no_fpie" = "yes"; then
- NO_PIE_CFLAGS="-fno-PIE"
-fi
+ if test "$gcc_cv_c_no_fpie" = "yes"; then
+ NO_PIE_CFLAGS="-fno-PIE"
+ fi
+ ;;
+esac
# Check if -no-pie works.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -no-pie option" >&5
+case $host_os in
+ fuchsia*)
+ # Fuchsia requires PIE binaries
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -no-pie option" >&5
$as_echo_n "checking for -no-pie option... " >&6; }
if test "${gcc_cv_no_pie+set}" = set; then :
$as_echo_n "(cached) " >&6
else
saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -no-pie"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ LDFLAGS="$LDFLAGS -no-pie"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int main(void) {return 0;}
_ACEOF
@@ -29531,13 +29574,15 @@ else
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$saved_LDFLAGS"
+ LDFLAGS="$saved_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_no_pie" >&5
$as_echo "$gcc_cv_no_pie" >&6; }
-if test "$gcc_cv_no_pie" = "yes"; then
- NO_PIE_FLAG="-no-pie"
-fi
+ if test "$gcc_cv_no_pie" = "yes"; then
+ NO_PIE_FLAG="-no-pie"
+ fi
+ ;;
+esac
# Check linker supports '-z bndplt'
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/configure.ac gcc-6.3.0/gcc/configure.ac
--- gcc-6.3.0-fsf/gcc/configure.ac 2017-03-30 16:18:18.865239634 -0700
+++ gcc-6.3.0/gcc/configure.ac 2017-03-30 16:23:21.720074124 -0700
@@ -6160,31 +6160,45 @@ fi
AC_SUBST([enable_default_pie])
# Check if -fno-PIE works.
-AC_CACHE_CHECK([for -fno-PIE option],
- [gcc_cv_c_no_fpie],
- [saved_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS -fno-PIE"
- AC_COMPILE_IFELSE([int main(void) {return 0;}],
- [gcc_cv_c_no_fpie=yes],
- [gcc_cv_c_no_fpie=no])
- CXXFLAGS="$saved_CXXFLAGS"])
-if test "$gcc_cv_c_no_fpie" = "yes"; then
- NO_PIE_CFLAGS="-fno-PIE"
-fi
+case $host_os in
+ fuchsia*)
+ # Fuchsia requires PIE binaries
+ ;;
+ *)
+ AC_CACHE_CHECK([for -fno-PIE option],
+ [gcc_cv_c_no_fpie],
+ [saved_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-PIE"
+ AC_COMPILE_IFELSE([int main(void) {return 0;}],
+ [gcc_cv_c_no_fpie=yes],
+ [gcc_cv_c_no_fpie=no])
+ CXXFLAGS="$saved_CXXFLAGS"])
+ if test "$gcc_cv_c_no_fpie" = "yes"; then
+ NO_PIE_CFLAGS="-fno-PIE"
+ fi
+ ;;
+esac
AC_SUBST([NO_PIE_CFLAGS])
# Check if -no-pie works.
-AC_CACHE_CHECK([for -no-pie option],
- [gcc_cv_no_pie],
- [saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -no-pie"
- AC_LINK_IFELSE([int main(void) {return 0;}],
- [gcc_cv_no_pie=yes],
- [gcc_cv_no_pie=no])
- LDFLAGS="$saved_LDFLAGS"])
-if test "$gcc_cv_no_pie" = "yes"; then
- NO_PIE_FLAG="-no-pie"
-fi
+case $host_os in
+ fuchsia*)
+ # Fuchsia requires PIE binaries
+ ;;
+ *)
+ AC_CACHE_CHECK([for -no-pie option],
+ [gcc_cv_no_pie],
+ [saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -no-pie"
+ AC_LINK_IFELSE([int main(void) {return 0;}],
+ [gcc_cv_no_pie=yes],
+ [gcc_cv_no_pie=no])
+ LDFLAGS="$saved_LDFLAGS"])
+ if test "$gcc_cv_no_pie" = "yes"; then
+ NO_PIE_FLAG="-no-pie"
+ fi
+ ;;
+esac
AC_SUBST([NO_PIE_FLAG])
# Check linker supports '-z bndplt'
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/gcc.c gcc-6.3.0/gcc/gcc.c
--- gcc-6.3.0-fsf/gcc/gcc.c 2017-03-30 16:18:18.805239865 -0700
+++ gcc-6.3.0/gcc/gcc.c 2017-03-30 16:23:21.724074108 -0700
@@ -7255,14 +7255,18 @@ driver::global_initializations ()
if (atexit (delete_temp_files) != 0)
fatal_error (input_location, "atexit failed");
+#ifdef SIGINT
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, fatal_signal);
+#endif
#ifdef SIGHUP
if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
signal (SIGHUP, fatal_signal);
#endif
+#ifdef SIGTERM
if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
signal (SIGTERM, fatal_signal);
+#endif
#ifdef SIGPIPE
if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
signal (SIGPIPE, fatal_signal);
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/gcov-tool.c gcc-6.3.0/gcc/gcov-tool.c
--- gcc-6.3.0-fsf/gcc/gcov-tool.c 2017-03-30 16:18:18.793239910 -0700
+++ gcc-6.3.0/gcc/gcov-tool.c 2017-03-30 16:23:21.724074108 -0700
@@ -51,7 +51,8 @@ extern void gcov_set_verbose (void);
/* Set to verbose output mode. */
static bool verbose;
-#if HAVE_FTW_H
+/* Fuchsia: remove when nftw has been implemented. */
+#if HAVE_FTW_H && !defined(__Fuchsia__)
/* Remove file NAME if it has a gcda suffix. */
@@ -80,7 +81,8 @@ unlink_gcda_file (const char *name,
static int
unlink_profile_dir (const char *path ATTRIBUTE_UNUSED)
{
-#if HAVE_FTW_H
+/* Fuchsia: remove when nftw has been implemented. */
+#if HAVE_FTW_H && !defined(__Fuchsia__)
return nftw(path, unlink_gcda_file, 64, FTW_DEPTH | FTW_PHYS);
#else
return -1;
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/ggc-common.c gcc-6.3.0/gcc/ggc-common.c
--- gcc-6.3.0-fsf/gcc/ggc-common.c 2017-03-30 16:18:17.565244626 -0700
+++ gcc-6.3.0/gcc/ggc-common.c 2017-03-30 16:23:21.724074108 -0700
@@ -728,7 +728,8 @@ mmap_gt_pch_use_address (void *base, siz
static double
ggc_rlimit_bound (double limit)
{
-#if defined(HAVE_GETRLIMIT)
+/* Fuchsia: getrlimit is not fully implemented yet. */
+#if !defined(__Fuchsia__) && defined(HAVE_GETRLIMIT)
struct rlimit rlim;
# if defined (RLIMIT_AS)
/* RLIMIT_AS is what POSIX says is the limit on mmap. Presumably
@@ -752,7 +753,7 @@ ggc_rlimit_bound (double limit)
&& rlim.rlim_cur >= 8 * 1024 * 1024)
limit = rlim.rlim_cur;
# endif /* RLIMIT_AS or RLIMIT_DATA */
-#endif /* HAVE_GETRLIMIT */
+#endif /* !Fuchsia && HAVE_GETRLIMIT */
return limit;
}
@@ -790,7 +791,8 @@ ggc_min_heapsize_heuristic (void)
bound of 128M (when RAM >= 1GB). */
phys_kbytes /= 8;
-#if defined(HAVE_GETRLIMIT) && defined (RLIMIT_RSS)
+/* Fuchsia: getrlimit is not fully implemented yet. */
+#if !defined(__Fuchsia__) && defined(HAVE_GETRLIMIT) && defined (RLIMIT_RSS)
/* Try not to overrun the RSS limit while doing garbage collection.
The RSS limit is only advisory, so no margin is subtracted. */
{
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/opts.c gcc-6.3.0/gcc/opts.c
--- gcc-6.3.0-fsf/gcc/opts.c 2017-03-30 16:18:18.789239926 -0700
+++ gcc-6.3.0/gcc/opts.c 2017-03-30 16:23:21.724074108 -0700
@@ -2386,7 +2386,8 @@ setup_core_dumping (diagnostic_context *
#ifdef SIGABRT
signal (SIGABRT, SIG_DFL);
#endif
-#if defined(HAVE_SETRLIMIT)
+/* Fuchsia: remove when getrlimit/setrlimit have been implemented. */
+#if !defined(__Fuchsia__) && defined(HAVE_SETRLIMIT)
{
struct rlimit rlim;
if (getrlimit (RLIMIT_CORE, &rlim) != 0)
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/timevar.c gcc-6.3.0/gcc/timevar.c
--- gcc-6.3.0-fsf/gcc/timevar.c 2017-03-30 16:18:18.869239620 -0700
+++ gcc-6.3.0/gcc/timevar.c 2017-03-30 16:23:21.724074108 -0700
@@ -69,7 +69,8 @@ struct tms
# define HAVE_SYS_TIME
# define HAVE_WALL_TIME
#else
-#ifdef HAVE_GETRUSAGE
+/* Fuchsia: remove when getrusage has been implemented. */
+#if !defined(__Fuchsia__) && defined(HAVE_GETRUSAGE)
# if defined HAVE_DECL_GETRUSAGE && !HAVE_DECL_GETRUSAGE
extern int getrusage (int, struct rusage *);
# endif
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/gcc/varasm.c gcc-6.3.0/gcc/varasm.c
--- gcc-6.3.0-fsf/gcc/varasm.c 2017-03-30 16:18:17.549244687 -0700
+++ gcc-6.3.0/gcc/varasm.c 2017-03-30 16:23:21.724074108 -0700
@@ -6193,15 +6193,20 @@ default_section_type_flags (tree decl, c
|| strncmp (name, ".gnu.linkonce.tb.", 17) == 0)
flags |= SECTION_TLS | SECTION_BSS;
- /* These three sections have special ELF types. They are neither
- SHT_PROGBITS nor SHT_NOBITS, so when changing sections we don't
- want to print a section type (@progbits or @nobits). If someone
- is silly enough to emit code or TLS variables to one of these
- sections, then don't handle them specially. */
- if (!(flags & (SECTION_CODE | SECTION_BSS | SECTION_TLS))
- && (strcmp (name, ".init_array") == 0
- || strcmp (name, ".fini_array") == 0
- || strcmp (name, ".preinit_array") == 0))
+ /* Various sections have special ELF types that the assembler will
+ assign by default based on the name. They are neither SHT_PROGBITS
+ nor SHT_NOBITS, so when changing sections we don't want to print a
+ section type (@progbits or @nobits). Rather than duplicating the
+ assembler's knowledge of what those special name patterns are, just
+ let the assembler choose the type if we don't know a specific
+ reason to set it to something other than the default. SHT_PROGBITS
+ is the default for sections whose name is not specially known to
+ the assembler, so it does no harm to leave the choice to the
+ assembler when @progbits is the best thing we know to use. If
+ someone is silly enough to emit code or TLS variables to one of
+ these sections, then don't handle them specially. */
+ if (!(flags & (SECTION_CODE | SECTION_BSS | SECTION_TLS | SECTION_ENTSIZE))
+ && !(HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE)))
flags |= SECTION_NOTYPE;
return flags;
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libgcc/config/t-slibgcc-fuchsia gcc-6.3.0/libgcc/config/t-slibgcc-fuchsia
--- gcc-6.3.0-fsf/libgcc/config/t-slibgcc-fuchsia 1969-12-31 16:00:00.000000000 -0800
+++ gcc-6.3.0/libgcc/config/t-slibgcc-fuchsia 2017-03-30 16:23:21.728074093 -0700
@@ -0,0 +1,22 @@
+# Copyright (C) 2016 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Fuchsia-specific shared library overrides.
+
+SHLIB_LDFLAGS = -Wl,--soname=$(SHLIB_SONAME) \
+ $(LDFLAGS)
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libgcc/config.host gcc-6.3.0/libgcc/config.host
--- gcc-6.3.0-fsf/libgcc/config.host 2017-03-30 16:18:19.057238897 -0700
+++ gcc-6.3.0/libgcc/config.host 2017-03-31 18:28:28.201747975 -0700
@@ -230,6 +230,10 @@ case ${host} in
;;
esac
;;
+*-*-fuchsia*)
+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia"
+ extra_parts="crtbegin.o crtend.o"
+ ;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-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"
@@ -333,6 +337,10 @@ aarch64*-*-elf | aarch64*-*-rtems*)
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
;;
+aarch64*-*-fuchsia*)
+ tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
+ tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp"
+ ;;
aarch64*-*-linux*)
extra_parts="$extra_parts crtfastmath.o"
md_unwind_header=aarch64/linux-unwind.h
@@ -584,8 +592,8 @@ i[34567]86-*-elfiamcu)
i[34567]86-*-elf*)
tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
;;
-x86_64-*-elf* | x86_64-*-rtems*)
- tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
+x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia*)
+ tmake_file="$tmake_file t-libgcc-pic"
;;
i[34567]86-*-dragonfly*)
tmake_file="${tmake_file} i386/t-dragonfly i386/t-crtstuff"
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libgcc/libgcov-util.c gcc-6.3.0/libgcc/libgcov-util.c
--- gcc-6.3.0-fsf/libgcc/libgcov-util.c 2017-03-30 16:18:19.057238897 -0700
+++ gcc-6.3.0/libgcc/libgcov-util.c 2017-03-30 16:23:21.728074093 -0700
@@ -382,7 +382,8 @@ read_gcda_file (const char *filename)
return obj_info;
}
-#ifdef HAVE_FTW_H
+/* Fuchsia: remove when ftw has been implemented. */
+#if defined(HAVE_FTW_H) && !defined(__Fuchsia__)
/* This will be called by ftw(). It opens and read a gcda file FILENAME.
Return a non-zero value to stop the tree walk. */
@@ -455,7 +456,8 @@ gcov_read_profile_dir (const char* dir_n
fnotice (stderr, "%s is not a directory\n", dir_name);
return NULL;
}
-#ifdef HAVE_FTW_H
+/* Fuchsia: remove when ftw has been implemented. */
+#if defined(HAVE_FTW_H) && !defined(__Fuchsia__)
ftw (".", ftw_read_file, 50);
#endif
ret = chdir (pwd);
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libiberty/lrealpath.c gcc-6.3.0/libiberty/lrealpath.c
--- gcc-6.3.0-fsf/libiberty/lrealpath.c 2017-03-30 16:18:18.997239127 -0700
+++ gcc-6.3.0/libiberty/lrealpath.c 2017-03-30 16:23:21.728074093 -0700
@@ -56,7 +56,8 @@ components will be simplified. The retu
extern char *canonicalize_file_name (const char *);
#endif
-#if defined(HAVE_REALPATH)
+/* Fuchsia: remove when realpath has been implemented. */
+#if !defined(__Fuchsia__) && defined(HAVE_REALPATH)
# if defined (PATH_MAX)
# define REALPATH_LIMIT PATH_MAX
# else
@@ -109,7 +110,9 @@ lrealpath (const char *filename)
pathconf()) making it impossible to pass a correctly sized buffer
to realpath() (it could always overflow). On those systems, we
skip this. */
-#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H)
+/* Fuchsia: remove from conditional when realpath has been implemented. */
+#if defined (HAVE_REALPATH) && defined (HAVE_UNISTD_H) \
+ && !defined (__Fuchsia__)
{
/* Find out the max path size. */
long path_max = pathconf ("/", _PC_PATH_MAX);
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libiberty/pex-unix.c gcc-6.3.0/libiberty/pex-unix.c
--- gcc-6.3.0-fsf/libiberty/pex-unix.c 2017-03-30 16:18:18.993239143 -0700
+++ gcc-6.3.0/libiberty/pex-unix.c 2017-03-30 16:23:21.728074093 -0700
@@ -60,6 +60,12 @@ extern int errno;
#include <process.h>
#endif
+#ifdef __Fuchsia__
+#include <launchpad/launchpad.h>
+#include <magenta/syscalls.h>
+#include <magenta/syscalls/object.h>
+#endif
+
#ifdef vfork /* Autoconf may define this to fork for us. */
# define VFORK_STRING "fork"
#else
@@ -120,7 +126,37 @@ to_ptr32 (char **ptr64)
static pid_t pex_wait (struct pex_obj *, pid_t, int *, struct pex_time *);
-#ifdef HAVE_WAIT4
+#ifdef __Fuchsia__
+
+static pid_t
+pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status,
+ struct pex_time *time ATTRIBUTE_UNUSED)
+{
+ mx_status_t wait_result, procinfo_result;
+ mx_info_process_t proc_info;
+
+ /* We don't support waiting on multiple pids. */
+ if (pid <= 0)
+ return -1;
+
+ wait_result = mx_object_wait_one ((mx_handle_t) pid, MX_TASK_TERMINATED,
+ MX_TIME_INFINITE, NULL);
+
+ if (wait_result != NO_ERROR)
+ return -1;
+
+ procinfo_result = mx_object_get_info ((mx_handle_t) pid, MX_INFO_PROCESS,
+ &proc_info, sizeof (proc_info), NULL,
+ NULL);
+
+ if (procinfo_result != NO_ERROR)
+ return -1;
+
+ *status = (proc_info.return_code & 0xff) << 8;
+ return pid;
+}
+
+#elif defined(HAVE_WAIT4)
static pid_t
pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status,
@@ -391,7 +427,7 @@ pex_child_error (struct pex_obj *obj, co
/* Execute a child. */
-#if defined(HAVE_SPAWNVE) && defined(HAVE_SPAWNVPE)
+#if defined(__Fuchsia__) || (defined(HAVE_SPAWNVE) && defined(HAVE_SPAWNVPE))
/* Implementation of pex->exec_child using the Cygwin spawn operation. */
/* Subroutine of pex_unix_exec_child. Move OLD_FD to a new file descriptor
@@ -492,7 +528,7 @@ static pid_t
pex_unix_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED,
int flags, const char *executable,
char * const * argv, char * const * env,
- int in, int out, int errdes, int toclose,
+ int in, int out, int errdes, int toclose,
const char **errmsg, int *err)
{
int fl_in = 0, fl_out = 0, fl_err = 0, fl_tc = 0;
@@ -547,6 +583,30 @@ pex_unix_exec_child (struct pex_obj *obj
{
typedef const char * const *cc_cp;
+#ifdef __Fuchsia__
+ {
+ int argc;
+
+ /* Count the number of arguments. */
+ for (argc = 0; argv[argc]; argc++)
+ ;
+
+ /* TODO: Implement PATH search for PEX_SEARCH option. */
+ launchpad_t *lp;
+ launchpad_create (MX_HANDLE_INVALID, executable, &lp);
+ launchpad_load_from_file (lp, executable);
+ launchpad_set_args (lp, argc, argv);
+ launchpad_clone (lp, LP_CLONE_ALL);
+ mx_handle_t handle;
+ mx_status_t status = launchpad_go (lp, &handle, errmsg);
+ if (status == NO_ERROR) {
+ pid = (pid_t) handle;
+ break;
+ }
+ *err = status;
+ return (pid_t) -1;
+ }
+#else
if (flags & PEX_SEARCH)
pid = spawnvpe (_P_NOWAITO, executable, (cc_cp)argv, (cc_cp)env);
else
@@ -560,6 +620,7 @@ pex_unix_exec_child (struct pex_obj *obj
if (errno != EAGAIN || ++retries == 4)
return (pid_t) -1;
sleep (1 << retries);
+#endif
}
/* Success. Restore the parent's file descriptors that we saved above. */
@@ -590,7 +651,7 @@ pex_unix_exec_child (struct pex_obj *obj
static pid_t
pex_unix_exec_child (struct pex_obj *obj, int flags, const char *executable,
char * const * argv, char * const * env,
- int in, int out, int errdes,
+ int in, int out, int errdes,
int toclose, const char **errmsg, int *err)
{
pid_t pid;
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libiberty/stack-limit.c gcc-6.3.0/libiberty/stack-limit.c
--- gcc-6.3.0-fsf/libiberty/stack-limit.c 2017-03-30 16:18:18.993239143 -0700
+++ gcc-6.3.0/libiberty/stack-limit.c 2017-03-30 16:23:21.728074093 -0700
@@ -46,8 +46,10 @@ Attempt to increase stack size limit to
void
stack_limit_increase (unsigned long pref ATTRIBUTE_UNUSED)
{
+/* Fuchsia: remove when getrlimit/setrlimit have been implemented. */
#if defined(HAVE_SETRLIMIT) && defined(HAVE_GETRLIMIT) \
- && defined(RLIMIT_STACK) && defined(RLIM_INFINITY)
+ && defined(RLIMIT_STACK) && defined(RLIM_INFINITY) \
+ && !defined(__Fuchsia__)
struct rlimit rlim;
if (getrlimit (RLIMIT_STACK, &rlim) == 0
&& rlim.rlim_cur != RLIM_INFINITY
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libstdc++-v3/configure gcc-6.3.0/libstdc++-v3/configure
--- gcc-6.3.0-fsf/libstdc++-v3/configure 2017-03-30 16:18:16.689247989 -0700
+++ gcc-6.3.0/libstdc++-v3/configure 2017-03-31 06:42:34.802733803 -0700
@@ -6360,6 +6360,10 @@ freebsd* | dragonfly*)
fi
;;
+fuchsia*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -10763,6 +10767,15 @@ freebsd* | dragonfly*)
esac
;;
+fuchsia*)
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os ld.so.1"
+ library_names_spec='$libname$shared_ext'
+ soname_spec='$libname$shared_ext'
+ sys_lib_dlsearch_path_spec='/system/lib /boot/lib'
+ ;;
+
gnu*)
version_type=linux
need_lib_prefix=no
@@ -11372,6 +11385,11 @@ fi
;;
+ fuchsia*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
*)
ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
if test "x$ac_cv_func_shl_load" = x""yes; then :
@@ -11596,7 +11614,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11599 "configure"
+#line 11617 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11702,7 +11720,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11705 "configure"
+#line 11723 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13612,6 +13630,10 @@ $as_echo_n "checking for $compiler optio
freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
+ fuchsia* )
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
hpux9* | hpux10* | hpux11*)
case $cc_basename in
CC*)
@@ -14447,6 +14469,15 @@ freebsd* | dragonfly*)
esac
;;
+fuchsia*)
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os ld.so.1"
+ library_names_spec='$libname$shared_ext'
+ soname_spec='$libname$shared_ext'
+ sys_lib_dlsearch_path_spec='/system/lib /boot/lib'
+ ;;
+
gnu*)
version_type=linux
need_lib_prefix=no
@@ -15388,7 +15419,7 @@ $as_echo "$glibcxx_cv_atomic_long_long"
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15391 "configure"
+#line 15422 "configure"
int main()
{
typedef bool atomic_type;
@@ -15423,7 +15454,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6;
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15426 "configure"
+#line 15457 "configure"
int main()
{
typedef short atomic_type;
@@ -15458,7 +15489,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6;
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15461 "configure"
+#line 15492 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -15494,7 +15525,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15497 "configure"
+#line 15528 "configure"
int main()
{
typedef long long atomic_type;
@@ -15575,7 +15606,7 @@ $as_echo "$as_me: WARNING: Performance o
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15578 "configure"
+#line 15609 "configure"
int main()
{
_Decimal32 d1;
@@ -15617,7 +15648,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15620 "configure"
+#line 15651 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -15651,7 +15682,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15654 "configure"
+#line 15685 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@@ -53199,6 +53230,12 @@ $as_echo "$ac_ld_relro" >&6; }
fi
;;
+
+ *-fuchsia*)
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
+ ;;
+
*-hpux*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libstdc++-v3/crossconfig.m4 gcc-6.3.0/libstdc++-v3/crossconfig.m4
--- gcc-6.3.0-fsf/libstdc++-v3/crossconfig.m4 2017-03-30 16:18:16.741247790 -0700
+++ gcc-6.3.0/libstdc++-v3/crossconfig.m4 2017-03-30 16:23:21.744074031 -0700
@@ -107,6 +107,12 @@ case "${host}" in
AC_DEFINE(HAVE_ISNANL)
fi
;;
+
+ *-fuchsia*)
+ SECTION_FLAGS='-ffunction-sections -fdata-sections'
+ SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
+ ;;
+
*-hpux*)
SECTION_FLAGS='-ffunction-sections -fdata-sections'
AC_SUBST(SECTION_FLAGS)
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/libtool.m4 gcc-6.3.0/libtool.m4
--- gcc-6.3.0-fsf/libtool.m4 2017-03-30 16:18:19.009239082 -0700
+++ gcc-6.3.0/libtool.m4 2017-03-31 06:41:11.187017373 -0700
@@ -1748,6 +1748,11 @@ else
])
;;
+ fuchsia*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
*)
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
@@ -2323,6 +2328,15 @@ freebsd* | dragonfly*)
esac
;;
+fuchsia*)
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os ld.so.1"
+ library_names_spec='$libname$shared_ext'
+ soname_spec='$libname$shared_ext'
+ sys_lib_dlsearch_path_spec='/system/lib /boot/lib'
+ ;;
+
gnu*)
version_type=linux
need_lib_prefix=no
@@ -3047,6 +3061,10 @@ freebsd* | dragonfly*)
fi
;;
+fuchsia*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3694,6 +3712,10 @@ m4_if([$1], [CXX], [
freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
+ fuchsia* )
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
hpux9* | hpux10* | hpux11*)
case $cc_basename in
CC*)
diff -rdup --unidirectional-new-file gcc-6.3.0-fsf/Makefile.in gcc-6.3.0/Makefile.in
--- gcc-6.3.0-fsf/Makefile.in 2017-03-30 16:18:19.009239082 -0700
+++ gcc-6.3.0/Makefile.in 2017-03-30 16:23:21.752074000 -0700
@@ -287,6 +287,7 @@ BASE_TARGET_EXPORTS = \
LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
+ NO_PIE_CFLAGS="$(NO_PIE_CFLAGS_FOR_TARGET)"; export NO_PIE_CFLAGS; \
OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \
RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
@@ -869,6 +870,7 @@ EXTRA_TARGET_FLAGS = \
'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
'NM=$(COMPILER_NM_FOR_TARGET)' \
+ 'NO_PIE_CFLAGS=$(NO_PIE_CFLAGS_FOR_TARGET)' \
'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \
'RANLIB=$$(RANLIB_FOR_TARGET)' \