Add fuchsia OS support to binutils/gcc.

Change-Id: Iae02c2980107f7b7386bb3b700fd36ed59686ca1
diff --git a/patches/binutils-patch.txt b/patches/binutils-patch.txt
index 648ef13..2d18df0 100644
--- a/patches/binutils-patch.txt
+++ b/patches/binutils-patch.txt
@@ -93,3 +93,96 @@
  }
  
  // Print the SECTIONS clause to F for debugging.
+diff -dcp -r binutils-2.27/bfd/config.bfd binutils-2.27-fuchsia/bfd/config.bfd
+*** binutils-2.27/bfd/config.bfd	2016-08-03 00:36:50.000000000 -0700
+--- binutils-2.27-fuchsia/bfd/config.bfd	2016-10-24 17:43:42.471794309 -0700
+*************** case "${targ}" in
+*** 693,699 ****
+      targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec"
+      want64=true
+      ;;
+!   x86_64-*-elf* | x86_64-*-rtems*)
+      targ_defvec=x86_64_elf64_vec
+      targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec l1om_elf64_vec k1om_elf64_vec"
+      want64=true
+--- 693,699 ----
+      targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec"
+      want64=true
+      ;;
+!   x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia)
+      targ_defvec=x86_64_elf64_vec
+      targ_selvecs="i386_elf32_vec iamcu_elf32_vec x86_64_elf32_vec l1om_elf64_vec k1om_elf64_vec"
+      want64=true
+diff -dcp -r binutils-2.27/config.sub binutils-2.27-fuchsia/config.sub
+*** binutils-2.27/config.sub	2016-08-03 00:36:51.000000000 -0700
+--- binutils-2.27-fuchsia/config.sub	2016-10-24 17:41:14.128384816 -0700
+*************** case $os in
+*** 1399,1405 ****
+  	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+  	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+  	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+! 	      | -onefs* | -tirtos* | -phoenix*)
+  	# Remember, each alternative MUST END IN *, to match a version number.
+  		;;
+  	-qnx*)
+--- 1399,1405 ----
+  	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+  	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+  	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+! 	      | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
+  	# Remember, each alternative MUST END IN *, to match a version number.
+  		;;
+  	-qnx*)
+diff -dcp -r binutils-2.27/configure binutils-2.27-fuchsia/configure
+*** binutils-2.27/configure	2016-08-03 00:54:55.000000000 -0700
+--- binutils-2.27-fuchsia/configure	2016-10-31 12:00:06.513896294 -0700
+*************** case "${ENABLE_GOLD}" in
+*** 2959,2965 ****
+        *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
+        | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
+        | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
+!       | *-*-solaris2* | *-*-nto* | *-*-nacl*)
+          case "${target}" in
+            *-*-linux*aout* | *-*-linux*oldld*)
+              ;;
+--- 2959,2965 ----
+        *-*-elf* | *-*-sysv4* | *-*-unixware* | *-*-eabi* | hppa*64*-*-hpux* \
+        | *-*-linux* | *-*-gnu* | frv-*-uclinux* | *-*-irix5* | *-*-irix6* \
+        | *-*-netbsd* | *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* \
+!       | *-*-solaris2* | *-*-nto* | *-*-nacl* | *-*-fuchsia*)
+          case "${target}" in
+            *-*-linux*aout* | *-*-linux*oldld*)
+              ;;
+diff -dcp -r binutils-2.27/gas/configure.tgt binutils-2.27-fuchsia/gas/configure.tgt
+*** binutils-2.27/gas/configure.tgt	2016-08-03 00:36:51.000000000 -0700
+--- binutils-2.27-fuchsia/gas/configure.tgt	2016-10-24 17:47:01.051004624 -0700
+*************** case ${generic_target} in
+*** 219,224 ****
+--- 219,225 ----
+    i386-*-coff)				fmt=coff ;;
+    i386-*-elfiamcu)			fmt=elf arch=iamcu ;;
+    i386-*-elf*)				fmt=elf ;;
++   i386-*-fuchsia*)			fmt=elf ;;
+    i386-*-kaos*)				fmt=elf ;;
+    i386-*-bsd*)				fmt=aout em=386bsd ;;
+    i386-*-nacl*)				fmt=elf em=nacl
+diff -dcp -r binutils-2.27/ld/configure.tgt binutils-2.27-fuchsia/ld/configure.tgt
+*** binutils-2.27/ld/configure.tgt	2016-08-03 00:36:54.000000000 -0700
+--- binutils-2.27-fuchsia/ld/configure.tgt	2016-10-24 17:50:01.570287514 -0700
+*************** i[3-7]86-*-elfiamcu)	targ_emul=elf_iamcu
+*** 316,322 ****
+  			targ_extra_emuls=elf_i386 ;;
+  i[3-7]86-*-elf*)	targ_emul=elf_i386
+  			targ_extra_emuls=elf_iamcu ;;
+! x86_64-*-elf* | x86_64-*-rtems*)
+  			targ_emul=elf_x86_64
+  			targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om"
+  			targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om"
+--- 316,322 ----
+  			targ_extra_emuls=elf_i386 ;;
+  i[3-7]86-*-elf*)	targ_emul=elf_i386
+  			targ_extra_emuls=elf_iamcu ;;
+! x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia*)
+  			targ_emul=elf_x86_64
+  			targ_extra_emuls="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om"
+  			targ_extra_libpath="elf_i386 elf_iamcu elf32_x86_64 elf_l1om elf_k1om"
diff --git a/patches/gcc-patch.txt b/patches/gcc-patch.txt
index 48fba78..8319982 100644
--- a/patches/gcc-patch.txt
+++ b/patches/gcc-patch.txt
@@ -128,3 +128,448 @@
      flags |= SECTION_NOTYPE;
  
    return flags;
+diff -dcprN gcc-6.2.0/config.sub gcc-6.2.0-fuchsia/config.sub
+*** gcc-6.2.0/config.sub	2015-12-31 13:13:28.000000000 -0800
+--- gcc-6.2.0-fuchsia/config.sub	2016-10-24 17:07:48.244523443 -0700
+*************** case $os in
+*** 1531,1536 ****
+--- 1531,1539 ----
+  		;;
+  	-nacl*)
+  		;;
++ 	-fuchsia*)
++ 		os=-fuchsia
++ 		;;
+  	-none)
+  		;;
+  	*)
+diff -dcprN gcc-6.2.0/gcc/config/fuchsia.h gcc-6.2.0-fuchsia/gcc/config/fuchsia.h
+*** gcc-6.2.0/gcc/config/fuchsia.h	1969-12-31 16:00:00.000000000 -0800
+--- gcc-6.2.0-fuchsia/gcc/config/fuchsia.h	2016-10-31 13:08:34.707128162 -0700
+***************
+*** 0 ****
+--- 1,49 ----
++ /* 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}"
++ 
++ #undef  ENDFILE_SPEC
++ #define ENDFILE_SPEC ""
++ 
++ #undef  CC1_SPEC
++ #define CC1_SPEC "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
++ 
++ #undef  LIB_SPEC
++ #define LIB_SPEC "-lmxio -lmagenta -lc" \
++ 		 "%{!static: -lgcc_s}"
++ 
++ #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}}}"
++ 
+diff -dcprN gcc-6.2.0/gcc/config.gcc gcc-6.2.0-fuchsia/gcc/config.gcc
+*** gcc-6.2.0/gcc/config.gcc	2016-10-24 16:39:48.403676689 -0700
+--- gcc-6.2.0-fuchsia/gcc/config.gcc	2016-10-31 15:26:25.548944871 -0700
+*************** i[34567]86-*-interix[3-9]*)
+*** 1792,1797 ****
+--- 1792,1801 ----
+  		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 -dcprN gcc-6.2.0/libgcc/config/t-slibgcc-fuchsia gcc-6.2.0-fuchsia/libgcc/config/t-slibgcc-fuchsia
+*** gcc-6.2.0/libgcc/config/t-slibgcc-fuchsia	1969-12-31 16:00:00.000000000 -0800
+--- gcc-6.2.0-fuchsia/libgcc/config/t-slibgcc-fuchsia	2016-10-28 10:05:17.778985385 -0700
+***************
+*** 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 -dcprN gcc-6.2.0/libgcc/config.host gcc-6.2.0-fuchsia/libgcc/config.host
+*** gcc-6.2.0/libgcc/config.host	2016-05-16 23:15:52.000000000 -0700
+--- gcc-6.2.0-fuchsia/libgcc/config.host	2016-10-31 15:15:46.787859155 -0700
+*************** case ${host} in
+*** 230,235 ****
+--- 230,238 ----
+        ;;
+    esac
+    ;;
++ *-*-fuchsia*)
++   tmake_file="$tmake_file t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-fuchsia"
++   ;;
+  *-*-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"
+*************** i[34567]86-*-elfiamcu)
+*** 577,584 ****
+  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"
+  	;;
+  i[34567]86-*-dragonfly*)
+  	tmake_file="${tmake_file} i386/t-dragonfly i386/t-crtstuff"
+--- 580,587 ----
+  i[34567]86-*-elf*)
+  	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 -dcprN gcc-6.2.0/libstdc++-v3/configure gcc-6.2.0-fuchsia/libstdc++-v3/configure
+*** gcc-6.2.0/libstdc++-v3/configure	2016-04-05 12:03:46.000000000 -0700
+--- gcc-6.2.0-fuchsia/libstdc++-v3/configure	2016-10-25 16:25:08.882770549 -0700
+*************** if test -z "$aix_libpath"; then aix_libp
+*** 9825,9830 ****
+--- 9825,9837 ----
+        hardcode_shlibpath_var=no
+        ;;
+  
++     fuchsia*)
++       archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++       hardcode_libdir_flag_spec='-R$libdir'
++       hardcode_direct=yes
++       hardcode_shlibpath_var=no
++       ;;
++ 
+      hpux9*)
+        if test "$GCC" = yes; then
+  	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+*************** freebsd* | dragonfly*)
+*** 10763,10768 ****
+--- 10770,10781 ----
+    esac
+    ;;
+  
++ fuchsia*)
++   library_names_spec='${libname}${shared_ext}'
++   need_lib_prefix=no
++   need_version=no
++   ;;
++ 
+  gnu*)
+    version_type=linux
+    need_lib_prefix=no
+*************** fi
+*** 11372,11377 ****
+--- 11385,11395 ----
+  
+      ;;
+  
++   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 :
+*************** else
+*** 11596,11602 ****
+    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+    lt_status=$lt_dlunknown
+    cat > conftest.$ac_ext <<_LT_EOF
+! #line 11599 "configure"
+  #include "confdefs.h"
+  
+  #if HAVE_DLFCN_H
+--- 11614,11620 ----
+    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+    lt_status=$lt_dlunknown
+    cat > conftest.$ac_ext <<_LT_EOF
+! #line 11617 "configure"
+  #include "confdefs.h"
+  
+  #if HAVE_DLFCN_H
+*************** else
+*** 11702,11708 ****
+    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+    lt_status=$lt_dlunknown
+    cat > conftest.$ac_ext <<_LT_EOF
+! #line 11705 "configure"
+  #include "confdefs.h"
+  
+  #if HAVE_DLFCN_H
+--- 11720,11726 ----
+    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+    lt_status=$lt_dlunknown
+    cat > conftest.$ac_ext <<_LT_EOF
+! #line 11723 "configure"
+  #include "confdefs.h"
+  
+  #if HAVE_DLFCN_H
+*************** freebsd* | dragonfly*)
+*** 14447,14452 ****
+--- 14465,14476 ----
+    esac
+    ;;
+  
++ fuchsia*)
++   library_names_spec='${libname}${shared_ext}'
++   need_lib_prefix=no
++   need_version=no
++   ;;
++ 
+  gnu*)
+    version_type=linux
+    need_lib_prefix=no
+*************** $as_echo "$glibcxx_cv_atomic_long_long"
+*** 15388,15394 ****
+    # Fake what AC_TRY_COMPILE does.
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15391 "configure"
+  int main()
+  {
+    typedef bool atomic_type;
+--- 15412,15418 ----
+    # Fake what AC_TRY_COMPILE does.
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15415 "configure"
+  int main()
+  {
+    typedef bool atomic_type;
+*************** $as_echo "$glibcxx_cv_atomic_bool" >&6;
+*** 15423,15429 ****
+      rm -f conftest*
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15426 "configure"
+  int main()
+  {
+    typedef short atomic_type;
+--- 15447,15453 ----
+      rm -f conftest*
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15450 "configure"
+  int main()
+  {
+    typedef short atomic_type;
+*************** $as_echo "$glibcxx_cv_atomic_short" >&6;
+*** 15458,15464 ****
+      rm -f conftest*
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15461 "configure"
+  int main()
+  {
+    // NB: _Atomic_word not necessarily int.
+--- 15482,15488 ----
+      rm -f conftest*
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15485 "configure"
+  int main()
+  {
+    // NB: _Atomic_word not necessarily int.
+*************** $as_echo "$glibcxx_cv_atomic_int" >&6; }
+*** 15494,15500 ****
+      rm -f conftest*
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15497 "configure"
+  int main()
+  {
+    typedef long long atomic_type;
+--- 15518,15524 ----
+      rm -f conftest*
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15521 "configure"
+  int main()
+  {
+    typedef long long atomic_type;
+*************** $as_echo "$as_me: WARNING: Performance o
+*** 15573,15579 ****
+    # unnecessary for this test.
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15576 "configure"
+  int main()
+  {
+    _Decimal32 d1;
+--- 15597,15603 ----
+    # unnecessary for this test.
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15600 "configure"
+  int main()
+  {
+    _Decimal32 d1;
+*************** ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+*** 15615,15621 ****
+    # unnecessary for this test.
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15618 "configure"
+  template<typename T1, typename T2>
+    struct same
+    { typedef T2 type; };
+--- 15639,15645 ----
+    # unnecessary for this test.
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15642 "configure"
+  template<typename T1, typename T2>
+    struct same
+    { typedef T2 type; };
+*************** $as_echo "$enable_int128" >&6; }
+*** 15649,15655 ****
+      rm -f conftest*
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15652 "configure"
+  template<typename T1, typename T2>
+    struct same
+    { typedef T2 type; };
+--- 15673,15679 ----
+      rm -f conftest*
+  
+      cat > conftest.$ac_ext << EOF
+! #line 15676 "configure"
+  template<typename T1, typename T2>
+    struct same
+    { typedef T2 type; };
+*************** $as_echo "$ac_ld_relro" >&6; }
+*** 53130,53135 ****
+--- 53154,53165 ----
+  
+      fi
+      ;;
++ 
++   *-fuchsia*)
++     SECTION_FLAGS='-ffunction-sections -fdata-sections'
++     SECTION_LDFLAGS='-Wl,--gc-sections $SECTION_LDFLAGS'
++     ;;
++ 
+    *-hpux*)
+      SECTION_FLAGS='-ffunction-sections -fdata-sections'
+  
+diff -dcprN gcc-6.2.0/libstdc++-v3/crossconfig.m4 gcc-6.2.0-fuchsia/libstdc++-v3/crossconfig.m4
+*** gcc-6.2.0/libstdc++-v3/crossconfig.m4	2015-10-11 15:34:28.000000000 -0700
+--- gcc-6.2.0-fuchsia/libstdc++-v3/crossconfig.m4	2016-10-25 16:20:47.855807450 -0700
+*************** case "${host}" in
+*** 107,112 ****
+--- 107,118 ----
+        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 -dcprN gcc-6.2.0/libtool.m4 gcc-6.2.0-fuchsia/libtool.m4
+*** gcc-6.2.0/libtool.m4	2015-11-26 05:20:59.000000000 -0800
+--- gcc-6.2.0-fuchsia/libtool.m4	2016-10-25 15:03:17.327232321 -0700
+*************** else
+*** 1748,1753 ****
+--- 1748,1758 ----
+      ])
+      ;;
+  
++   fuchsia*)
++     lt_cv_dlopen="dlopen"
++     lt_cv_dlopen_libs=
++     ;;
++ 
+    *)
+      AC_CHECK_FUNC([shl_load],
+  	  [lt_cv_dlopen="shl_load"],
+*************** freebsd* | dragonfly*)
+*** 2323,2328 ****
+--- 2328,2339 ----
+    esac
+    ;;
+  
++ fuchsia*)
++   library_names_spec='${libname}${shared_ext}'
++   need_lib_prefix=no
++   need_version=no
++   ;;
++ 
+  gnu*)
+    version_type=linux
+    need_lib_prefix=no
+*************** _LT_EOF
+*** 4831,4836 ****
+--- 4842,4854 ----
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
++       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
++       ;;
++ 
++     fuchsia*)
++       _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
++       _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+        ;;
+