Add support for fuchsia native tools.

Change-Id: Ifaf4f15119b22f56b5144da35d2fd2e28600c71d
diff --git a/patches/binutils-patch.txt b/patches/binutils-patch.txt
index 22251a4..e24e86d 100644
--- a/patches/binutils-patch.txt
+++ b/patches/binutils-patch.txt
@@ -93,9 +93,36 @@
  }
  
  // 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
+diff -rdcp --unidirectional-new-file binutils-2.27-fsf/bfd/config.bfd binutils-2.27/bfd/config.bfd
+*** binutils-2.27-fsf/bfd/config.bfd	2016-11-23 08:59:58.370833363 -0800
+--- binutils-2.27/bfd/config.bfd	2016-11-16 08:49:21.135106894 -0800
+*************** case "${targ}" in
+*** 192,197 ****
+--- 192,202 ----
+      targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
+      want64=true
+      ;;
++   aarch64-*-fuchsia*)
++     targ_defvec=aarch64_elf64_le_vec
++     targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
++     want64=true
++     ;;
+    aarch64-*-cloudabi*)
+      targ_defvec=aarch64_elf64_le_cloudabi_vec
+      targ_selvecs=aarch64_elf64_be_cloudabi_vec
+*************** case "${targ}" in
+*** 286,291 ****
+--- 291,300 ----
+      targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec"
+      targ_archs="$targ_archs bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
+      ;;
++   arm-*-fuchsia*)
++     targ_defvec=arm_elf32_le_vec
++     targ_selvecs="arm_elf32_be_vec"
++     ;;
+    arm-*-nacl*)
+      targ_defvec=arm_elf32_nacl_le_vec
+      targ_selvecs="arm_elf32_nacl_be_vec i386_elf32_nacl_vec"
 *************** case "${targ}" in
 *** 693,699 ****
       targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec"
@@ -105,7 +132,7 @@
       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 ----
+--- 702,708 ----
       targ_selvecs="i386_elf32_vec iamcu_elf32_vec l1om_elf64_vec k1om_elf64_vec"
       want64=true
       ;;
@@ -153,72 +180,9 @@
           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 -rdcp binutils-2.27-orig/bfd/config.bfd binutils-2.27/bfd/config.bfd
-*** binutils-2.27-orig/bfd/config.bfd	2016-11-14 16:52:46.909843404 -0800
---- binutils-2.27/bfd/config.bfd	2016-11-15 08:37:21.691710128 -0800
-*************** case "${targ}" in
-*** 192,197 ****
---- 192,202 ----
-      targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
-      want64=true
-      ;;
-+   aarch64-*-fuchsia*)
-+     targ_defvec=aarch64_elf64_le_vec
-+     targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
-+     want64=true
-+     ;;
-    aarch64-*-cloudabi*)
-      targ_defvec=aarch64_elf64_le_cloudabi_vec
-      targ_selvecs=aarch64_elf64_be_cloudabi_vec
-*************** case "${targ}" in
-*** 286,291 ****
---- 291,300 ----
-      targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec"
-      targ_archs="$targ_archs bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
-      ;;
-+   arm-*-fuchsia*)
-+     targ_defvec=arm_elf32_le_vec
-+     targ_selvecs="arm_elf32_be_vec"
-+     ;;
-    arm-*-nacl*)
-      targ_defvec=arm_elf32_nacl_le_vec
-      targ_selvecs="arm_elf32_nacl_be_vec i386_elf32_nacl_vec"
-diff -rdcp binutils-2.27-orig/gas/configure.tgt binutils-2.27/gas/configure.tgt
-*** binutils-2.27-orig/gas/configure.tgt	2016-11-14 16:52:47.073842705 -0800
---- binutils-2.27/gas/configure.tgt	2016-11-15 08:39:07.799302559 -0800
+diff -rdcp --unidirectional-new-file binutils-2.27-fsf/gas/configure.tgt binutils-2.27/gas/configure.tgt
+*** binutils-2.27-fsf/gas/configure.tgt	2016-11-23 08:59:59.878827298 -0800
+--- binutils-2.27/gas/configure.tgt	2016-11-16 08:49:21.135106894 -0800
 *************** generic_target=${cpu_type}-$vendor-$os
 *** 121,126 ****
 --- 121,127 ----
@@ -239,9 +203,85 @@
   
     avr-*-*)				fmt=elf bfd_gas=yes ;;
   
-diff -rdcp binutils-2.27-orig/ld/configure.tgt binutils-2.27/ld/configure.tgt
-*** binutils-2.27-orig/ld/configure.tgt	2016-11-14 16:52:46.665844445 -0800
---- binutils-2.27/ld/configure.tgt	2016-11-15 08:40:41.870942601 -0800
+*************** case ${generic_target} in
+*** 219,224 ****
+--- 221,227 ----
+    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 -rdcp --unidirectional-new-file binutils-2.27-fsf/gold/fileread.cc binutils-2.27/gold/fileread.cc
+*** binutils-2.27-fsf/gold/fileread.cc	2016-11-23 09:00:03.026814640 -0800
+--- binutils-2.27/gold/fileread.cc	2016-12-02 11:05:29.758465966 -0800
+*************** File_read::find_view(off_t start, sectio
+*** 372,377 ****
+--- 372,391 ----
+    return NULL;
+  }
+  
++ #ifdef __fuchsia__
++ /* Fuchsia provides an unimplemented pread, which is sufficient to convince
++    configure into linking against it.  */
++ extern "C" {
++ static ssize_t
++ fuchsia_pread (int fd, void *buf, size_t count, off_t offset)
++ {
++   if (lseek(fd, offset, SEEK_SET) != offset)
++     return -1;
++   return read(fd, buf, count);
++ }
++ }
++ #endif
++ 
+  // Read SIZE bytes from the file starting at offset START.  Read into
+  // the buffer at P.
+  
+*************** File_read::do_read(off_t start, section_
+*** 397,403 ****
+--- 411,421 ----
+        size_t to_read = size;
+        do
+  	{
++ #ifdef __fuchsia__
++ 	  bytes = fuchsia_pread(this->descriptor_, read_ptr, to_read, read_pos);
++ #else
+  	  bytes = ::pread(this->descriptor_, read_ptr, to_read, read_pos);
++ #endif
+  	  if (bytes < 0)
+  	    gold_fatal(_("%s: pread failed: %s"),
+  		       this->filename().c_str(), strerror(errno));
+diff -rdcp --unidirectional-new-file binutils-2.27-fsf/gold/output.cc binutils-2.27/gold/output.cc
+*** binutils-2.27-fsf/gold/output.cc	2016-11-23 09:00:03.242813772 -0800
+--- binutils-2.27/gold/output.cc	2016-12-09 17:11:18.558286565 -0800
+*************** namespace gold
+*** 127,136 ****
+  static int
+  gold_fallocate(int o, off_t offset, off_t len)
+  {
+! #ifdef HAVE_POSIX_FALLOCATE
+    if (parameters->options().posix_fallocate())
+      return ::posix_fallocate(o, offset, len);
+! #endif // defined(HAVE_POSIX_FALLOCATE)
+  #ifdef HAVE_FALLOCATE
+    if (::fallocate(o, 0, offset, len) == 0)
+      return 0;
+--- 127,136 ----
+  static int
+  gold_fallocate(int o, off_t offset, off_t len)
+  {
+! #if defined(HAVE_POSIX_FALLOCATE) && !defined(__fuchsia__)
+    if (parameters->options().posix_fallocate())
+      return ::posix_fallocate(o, offset, len);
+! #endif // defined(HAVE_POSIX_FALLOCATE) && !defined(__fuchsia__)
+  #ifdef HAVE_FALLOCATE
+    if (::fallocate(o, 0, offset, len) == 0)
+      return 0;
+diff -rdcp --unidirectional-new-file binutils-2.27-fsf/ld/configure.tgt binutils-2.27/ld/configure.tgt
+*** binutils-2.27-fsf/ld/configure.tgt	2016-11-23 08:59:55.706844075 -0800
+--- binutils-2.27/ld/configure.tgt	2016-11-21 16:45:35.047787524 -0800
 *************** aarch64-*-cloudabi*)	targ_emul=aarch64cl
 *** 54,59 ****
 --- 54,61 ----
@@ -259,9 +299,213 @@
   			;;
   arm-*-vxworks)		targ_emul=armelf_vxworks ;;
   arm*-*-conix*)		targ_emul=armelf ;;
-+ arm*-*-fuchsia*)	targ_emul=armelf
-+ 			targ_extra_emuls="armelfb"
++ arm*-*-fuchsia*)	targ_emul=armelf_fuchsia
++ 			targ_extra_emuls="armelfb_fuchsia armelf armelfb"
 + 			;;
   avr-*-*)		targ_emul=avr2
   			targ_extra_emuls="avr1 avr25 avr3 avr31 avr35 avr4 avr5 avr51 avr6 avrxmega1 avrxmega2 avrxmega3 avrxmega4 avrxmega5 avrxmega6 avrxmega7 avrtiny"
   			;;
+*************** 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"
+--- 321,327 ----
+  			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 -rdcp --unidirectional-new-file binutils-2.27-fsf/ld/emulparams/armelfb_fuchsia.sh binutils-2.27/ld/emulparams/armelfb_fuchsia.sh
+*** binutils-2.27-fsf/ld/emulparams/armelfb_fuchsia.sh	1969-12-31 16:00:00.000000000 -0800
+--- binutils-2.27/ld/emulparams/armelfb_fuchsia.sh	2016-11-21 16:45:22.135841864 -0800
+***************
+*** 0 ****
+--- 1,2 ----
++ . ${srcdir}/emulparams/armelf_fuchsia.sh
++ OUTPUT_FORMAT="$BIG_OUTPUT_FORMAT"
+diff -rdcp --unidirectional-new-file binutils-2.27-fsf/ld/emulparams/armelf_fuchsia.sh binutils-2.27/ld/emulparams/armelf_fuchsia.sh
+*** binutils-2.27-fsf/ld/emulparams/armelf_fuchsia.sh	1969-12-31 16:00:00.000000000 -0800
+--- binutils-2.27/ld/emulparams/armelf_fuchsia.sh	2016-11-21 17:26:46.729182447 -0800
+***************
+*** 0 ****
+--- 1,32 ----
++ ARCH=arm
++ SCRIPT_NAME=elf
++ OUTPUT_FORMAT="elf32-littlearm"
++ BIG_OUTPUT_FORMAT="elf32-bigarm"
++ LITTLE_OUTPUT_FORMAT="elf32-littlearm"
++ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
++ COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
++ TEMPLATE_NAME=elf32
++ EXTRA_EM_FILE=armelf
++ GENERATE_SHLIB_SCRIPT=yes
++ GENERATE_PIE_SCRIPT=yes
++ 
++ DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
++ OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)'
++ OTHER_BSS_SYMBOLS='__bss_start__ = .;'
++ OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
++ OTHER_END_SYMBOLS='__end__ = . ;'
++ OTHER_SECTIONS='.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }'
++ 
++ TEXT_START_ADDR=0x00001000
++ TARGET2_TYPE=got-rel
++ 
++ # ARM does not support .s* sections.
++ NO_SMALL_DATA=yes
++ 
++ # Use the ARM ABI-compliant exception-handling sections.
++ OTHER_READONLY_SECTIONS="
++   .ARM.extab ${RELOCATING-0} : { *(.ARM.extab${RELOCATING+* .gnu.linkonce.armextab.*}) }
++   ${RELOCATING+ PROVIDE_HIDDEN (__exidx_start = .); }
++   .ARM.exidx ${RELOCATING-0} : { *(.ARM.exidx${RELOCATING+* .gnu.linkonce.armexidx.*}) }
++   ${RELOCATING+ PROVIDE_HIDDEN (__exidx_end = .); }"
++ 
+diff -rdcp --unidirectional-new-file binutils-2.27-fsf/ld/Makefile.am binutils-2.27/ld/Makefile.am
+*** binutils-2.27-fsf/ld/Makefile.am	2016-11-23 08:59:58.042834681 -0800
+--- binutils-2.27/ld/Makefile.am	2016-11-21 17:16:33.371837561 -0800
+*************** ALL_EMULATION_SOURCES = \
+*** 175,180 ****
+--- 175,181 ----
+  	earmcoff.c \
+  	earmelf.c \
+  	earmelf_fbsd.c \
++ 	earmelf_fuchsia.c \
+  	earmelf_linux.c \
+  	earmelf_linux_eabi.c \
+  	earmelf_nacl.c \
+*************** ALL_EMULATION_SOURCES = \
+*** 183,188 ****
+--- 184,190 ----
+  	earmelf_vxworks.c \
+  	earmelfb.c \
+  	earmelfb_fbsd.c \
++ 	earmelfb_fuchsia.c \
+  	earmelfb_linux.c \
+  	earmelfb_linux_eabi.c \
+  	earmelfb_nacl.c \
+*************** earmelf_fbsd.c: $(srcdir)/emulparams/arm
+*** 757,762 ****
+--- 759,768 ----
+    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+    $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+  
++ earmelf_fuchsia.c: $(srcdir)/emulparams/armelf_fuchsia.sh \
++   $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
++   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ 
+  earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
+    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+    $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+*************** earmelfb_fbsd.c: $(srcdir)/emulparams/ar
+*** 797,802 ****
+--- 803,812 ----
+    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+    $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+  
++ earmelf_fuchsia.c: $(srcdir)/emulparams/armelfb_fuchsia.sh \
++   $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
++   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ 
+  earmelfb_linux.c: $(srcdir)/emulparams/armelfb_linux.sh \
+    $(srcdir)/emulparams/armelf_linux.sh \
+    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+diff -rdcp --unidirectional-new-file binutils-2.27-fsf/ld/Makefile.in binutils-2.27/ld/Makefile.in
+*** binutils-2.27-fsf/ld/Makefile.in	2016-11-23 08:59:58.082834520 -0800
+--- binutils-2.27/ld/Makefile.in	2016-11-21 17:16:38.471815461 -0800
+*************** ALL_EMULATION_SOURCES = \
+*** 543,548 ****
+--- 543,549 ----
+  	earmcoff.c \
+  	earmelf.c \
+  	earmelf_fbsd.c \
++ 	earmelf_fuchsia.c \
+  	earmelf_linux.c \
+  	earmelf_linux_eabi.c \
+  	earmelf_nacl.c \
+*************** ALL_EMULATION_SOURCES = \
+*** 551,556 ****
+--- 552,558 ----
+  	earmelf_vxworks.c \
+  	earmelfb.c \
+  	earmelfb_fbsd.c \
++ 	earmelfb_fuchsia.c \
+  	earmelfb_linux.c \
+  	earmelfb_linux_eabi.c \
+  	earmelfb_nacl.c \
+*************** distclean-compile:
+*** 1180,1185 ****
+--- 1182,1188 ----
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmcoff.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_fbsd.Po@am__quote@
++ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_fuchsia.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_linux_eabi.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_nacl.Po@am__quote@
+*************** distclean-compile:
+*** 1188,1193 ****
+--- 1191,1197 ----
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelf_vxworks.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_fbsd.Po@am__quote@
++ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_fuchsia.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_linux.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_linux_eabi.Po@am__quote@
+  @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earmelfb_nacl.Po@am__quote@
+*************** earmelf_fbsd.c: $(srcdir)/emulparams/arm
+*** 2345,2350 ****
+--- 2349,2358 ----
+    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+    $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+  
++ earmelf_fuchsia.c: $(srcdir)/emulparams/armelf_fuchsia.sh \
++   $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
++   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ 
+  earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
+    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+    $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+*************** earmelfb_fbsd.c: $(srcdir)/emulparams/ar
+*** 2385,2390 ****
+--- 2393,2402 ----
+    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+    $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+  
++ earmelf_fuchsia.c: $(srcdir)/emulparams/armelfb_fuchsia.sh \
++   $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
++   $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ 
+  earmelfb_linux.c: $(srcdir)/emulparams/armelfb_linux.sh \
+    $(srcdir)/emulparams/armelf_linux.sh \
+    $(ELF_DEPS) $(srcdir)/emultempl/armelf.em \
+diff -rdcp --unidirectional-new-file binutils-2.27-fsf/Makefile.in binutils-2.27/Makefile.in
+*** binutils-2.27-fsf/Makefile.in	2016-11-23 09:00:02.962814897 -0800
+--- binutils-2.27/Makefile.in	2016-11-17 14:27:46.861334193 -0800
+*************** HOST_EXPORTS = \
+*** 190,195 ****
+--- 190,196 ----
+  	ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
+  	CFLAGS="$(CFLAGS)"; export CFLAGS; \
+  	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
++ 	CPPFLAGS="$(CPPFLAGS)"; export CPPFLAGS; \
+  	CXX="$(CXX)"; export CXX; \
+  	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+  	GCJ="$(GCJ)"; export GCJ; \
+*************** GNATBIND = @GNATBIND@
+*** 410,415 ****
+--- 411,417 ----
+  GNATMAKE = @GNATMAKE@
+  
+  CFLAGS = @CFLAGS@
++ CPPFLAGS = @CPPFLAGS@
+  LDFLAGS = @LDFLAGS@
+  LIBCFLAGS = $(CFLAGS)
+  CXXFLAGS = @CXXFLAGS@