diff -rupN old/config.sub new/config.sub
--- old/config.sub	2012-08-06 22:34:27.000000000 +0800
+++ new/config.sub	2020-02-24 16:21:19.164775997 +0800
@@ -1353,6 +1353,7 @@ case $os in
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -lyos* \
 	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
diff -rupN old/gcc/config/lyos.h new/gcc/config/lyos.h
--- old/gcc/config/lyos.h	1970-01-01 08:00:00.000000000 +0800
+++ new/gcc/config/lyos.h	2020-02-24 16:21:19.164775997 +0800
@@ -0,0 +1,25 @@
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+  do { \
+    builtin_define_std ("lyos"); \
+    builtin_define_std ("unix"); \
+    builtin_assert ("system=lyos"); \
+    builtin_assert ("system=unix"); \
+  } while (0);
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%{!shared:crt0.o%s} \
+   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
+
+#undef  LINK_SPEC
+#define LINK_SPEC "\
+  %{shared:-shared -dynamic-linker " "/lib/ld-lyos.so" "} \
+  %{!shared: \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker " "/lib/ld-lyos.so" "}} \
+    %{static:-static}}"
+
diff -rupN old/gcc/config.gcc new/gcc/config.gcc
--- old/gcc/config.gcc	2013-03-07 06:54:11.000000000 +0800
+++ new/gcc/config.gcc	2020-02-24 16:21:19.168109283 +0800
@@ -767,6 +767,11 @@ case ${target} in
     *) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
   esac
   ;;
+*-*-lyos*)
+  gas=yes
+  gnu_ld=yes
+  default_use_cxa_atexit=yes
+  ;;
 *-*-elf)
   # Assume that newlib is being used and so __cxa_atexit is provided.
   default_use_cxa_atexit=yes
@@ -930,6 +935,10 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*
 	esac
 	tm_file="${tm_file} arm/aout.h arm/arm.h"
 	;;
+arm-*-lyos*)
+	tm_file="dbxelf.h elfos.h newlib-stdint.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h lyos.h"
+	tmake_file="arm/t-arm arm/t-arm-elf"
+	;;
 arm*-*-elf)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h"
 	tmake_file="arm/t-arm arm/t-arm-elf"
@@ -1199,6 +1208,11 @@ hppa[12]*-*-hpux11*)
 		dwarf2=no
 	fi
 	;;
+i[34567]86-*-lyos*)
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h lyos.h"
+	tmake_file="${tmake_file} i386/t-i386elf t-svr4 i386/t-crtstuff"
+	use_fixproto=yes
+	;;
 i[34567]86-*-darwin*)
 	need_64bit_isa=yes
 	# Baseline choice for a machine that allows m64 support.
diff -rupN old/gcc/cp/cfns.h new/gcc/cp/cfns.h
--- old/gcc/cp/cfns.h	2009-04-22 03:03:23.000000000 +0800
+++ new/gcc/cp/cfns.h	2020-02-24 16:40:08.253071546 +0800
@@ -53,6 +53,9 @@ __inline
 static unsigned int hash (const char *, unsigned int);
 #ifdef __GNUC__
 __inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
 #endif
 const char * libc_name_p (const char *, unsigned int);
 /* maximum key range = 391, duplicates = 0 */
@@ -96,7 +99,7 @@ hash (register const char *str, register
       400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
       400, 400, 400, 400, 400, 400, 400
     };
-  register int hval = len;
+  register int hval = (int)len;
 
   switch (hval)
     {
diff -rupN old/gcc/doc/gcc.texi new/gcc/doc/gcc.texi
--- old/gcc/doc/gcc.texi	2010-06-10 07:46:33.000000000 +0800
+++ new/gcc/doc/gcc.texi	2020-02-24 16:23:16.109925318 +0800
@@ -86,9 +86,15 @@ Published by:
 @item GNU Press
 @tab Website: www.gnupress.org
 @item a division of the
-@tab General: @tex press@@gnu.org @end tex
+@tab General: 
+@tex 
+press@@gnu.org 
+@end tex
 @item Free Software Foundation
-@tab Orders:  @tex sales@@gnu.org @end tex
+@tab Orders:  
+@tex 
+sales@@gnu.org 
+@end tex
 @item 51 Franklin Street, Fifth Floor
 @tab Tel 617-542-5942
 @item Boston, MA 02110-1301 USA
diff -rupN old/libgcc/config.host new/libgcc/config.host
--- old/libgcc/config.host	2013-03-07 01:42:45.000000000 +0800
+++ new/libgcc/config.host	2020-02-24 16:21:19.168109283 +0800
@@ -382,6 +382,9 @@ arm*-*-elf)
 arm*-wince-pe*)
 	tmake_file="$tmake_file arm/t-arm arm/t-wince-pe"
 	;;
+arm-*-lyos*)
+	extra_parts="crtbegin.o crtend.o"
+	;;
 avr-*-rtems*)
 	tmake_file="$tmake_file avr/t-avr avr/t-rtems t-fpbit"
 	tm_file="$tm_file avr/avr-lib.h"
@@ -646,6 +649,10 @@ x86_64-*-mingw*)
 i[34567]86-*-interix[3-9]*)
 	tmake_file="$tmake_file i386/t-interix i386/t-chkstk"
 	;;
+i[34567]86-*-lyos*)
+ tmake_file="$tmake_file i386/t-i386elf t-svr4 i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
+	;;
 ia64*-*-elf*)
 	extra_parts="$extra_parts crtbeginS.o crtendS.o crtfastmath.o"
 	tmake_file="ia64/t-ia64 ia64/t-ia64-elf ia64/t-eh-ia64 t-crtfm"
diff -rupN old/libstdc++-v3/crossconfig.m4 new/libstdc++-v3/crossconfig.m4
--- old/libstdc++-v3/crossconfig.m4	2011-07-18 19:04:18.000000000 +0800
+++ new/libstdc++-v3/crossconfig.m4	2020-02-24 16:21:19.168109283 +0800
@@ -150,6 +150,12 @@ case "${host}" in
     GCC_CHECK_TLS
     AM_ICONV
     ;;
+  *-lyos*)
+    AC_CHECK_HEADERS([sys/types.h local.h float.h])
+    GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
+    GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
+    GLIBCXX_CHECK_STDLIB_SUPPORT
+    ;;
   *-mingw32*)
     GLIBCXX_CHECK_LINKER_FEATURES
     GLIBCXX_CHECK_MATH_SUPPORT
