 +# if defined (__UINT_LEAST16_TYPE__) && defined(__UINT_LEAST32_TYPE__) && 0
  namespace std
  {
-   typedef __UINT_LEAST16_TYPE__ uint_least16_t;
+   typedef __UINT_LEAST16_TYPE__ uint_least16_t;
diff -urN gcc-old/config.sub gcc/config.sub
--- gcc-old/config.sub  2015-01-02 15:00:21.000000000 +0530
+++ gcc/config.sub  2016-09-24 14:04:03.955832000 +0530
@@ -1368,7 +1368,7 @@
  # The portable systems comes first.
  # Each alternative MUST END IN A *, to match a version number.
  # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* | -atomos* \
        | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
        | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
        | -sym* | -kopensolaris* | -plan9* \
diff -urN gcc-old/fixincludes/mkfixinc.sh gcc/fixincludes/mkfixinc.sh
--- gcc-old/fixincludes/mkfixinc.sh 2012-10-29 03:12:48.000000000 +0530
+++ gcc/fixincludes/mkfixinc.sh 2016-09-24 14:16:48.787810000 +0530
@@ -12,6 +12,7 @@
 # Check for special fix rules for particular targets
 case $machine in

   gas=yes
   gnu_ld=yes
@@ -909,6 +914,12 @@
 	done
 	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
 	;;
+i[34567]86-*-atomos*)
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h atomos.h"
+	;;
+x86_64-*-atomos*)
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h glibc-stdint.h i386/i386elf.h i386/x86-64.h atomos.h"
+	;;
 aarch64*-*-linux*)
 	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
 	tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
diff -urN gcc-old/libgcc/config.host gcc/libgcc/config.host
--- gcc-old/libgcc/config.host	2015-10-01 17:31:18.000000000 +0530
+++ gcc/libgcc/config.host	2016-09-24 14:15:31.471812000 +0530
@@ -328,6 +328,14 @@
 	tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
 	tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
 	;;
+i[34567]86-*-atomos*)
+	extra_parts="$extra_parts crtbegin.o crtend.o"
+	tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
+	;;
+x86_64-*-atomos*)
+	extra_parts="$extra_parts crtbegin.o crtend.o"
+	tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
+	;;
 aarch64*-*-linux*)
 	extra_parts="$extra_parts crtfastmath.o"
 	md_unwind_header=aarch64/linux-unwind.h
diff -urN gcc-old/libstdc++-v3/crossconfig.m4 gcc/libstdc++-v3/crossconfig.m4
--- gcc-old/libstdc++-v3/crossconfig.m4	2014-04-22 18:00:59.000000000 +0530
+++ gcc/libstdc++-v3/crossconfig.m4	2016-09-24 17:22:40.323493000 +0530
@@ -36,6 +36,13 @@
     AM_ICONV
     ;;
