diff --git a/SOURCES/gcc9-dts-arm.patch b/SOURCES/gcc9-dts-arm.patch
new file mode 100644
index 0000000..c22d892
--- /dev/null
+++ b/SOURCES/gcc9-dts-arm.patch
@@ -0,0 +1,250 @@
+diff -Naurp a/libstdc++-v3/src/nonshared11/cow-shim_facets.cc b/libstdc++-v3/src/nonshared11/cow-shim_facets.cc
+--- a/libstdc++-v3/src/nonshared11/cow-shim_facets.cc 2020-02-06 10:31:53.446807279 +0000
++++ b/libstdc++-v3/src/nonshared11/cow-shim_facets.cc 2020-02-06 10:26:44.225333453 +0000
+@@ -168,7 +168,7 @@ asm (".hidden _ZTVNSt13__facet_shims12_G
+ asm (".hidden _ZTVNSt13__facet_shims12_GLOBAL__N_115moneypunct_shimIwLb1EEE");
+ asm (".hidden _ZNSt13__facet_shims21__numpunct_fill_cacheIcEEvSt17integral_constantIbLb0EEPKNSt6locale5facetEPSt16__numpunct_cacheIT_E");
+ asm (".hidden _ZNSt13__facet_shims21__numpunct_fill_cacheIwEEvSt17integral_constantIbLb0EEPKNSt6locale5facetEPSt16__numpunct_cacheIT_E");
+-#if defined(__i386__) || (defined(__powerpc__) && !defined(__powerpc64__))
++#if defined(__i386__) || defined(__arm__) || (defined(__powerpc__) && !defined(__powerpc64__))
+ asm (".hidden _ZNSt13__facet_shims14__messages_getIcEEvSt17integral_constantIbLb0EEPKNSt6locale5facetERNS_12__any_stringEiiiPKT_j");
+ asm (".hidden _ZNSt13__facet_shims14__messages_getIwEEvSt17integral_constantIbLb0EEPKNSt6locale5facetERNS_12__any_stringEiiiPKT_j");
+ asm (".hidden _ZNSt13__facet_shims15__messages_openIcEEiSt17integral_constantIbLb0EEPKNSt6locale5facetEPKcjRKS3_");
+diff -Naurp a/libstdc++-v3/src/nonshared11/cow-stdexcept.cc b/libstdc++-v3/src/nonshared11/cow-stdexcept.cc
+--- a/libstdc++-v3/src/nonshared11/cow-stdexcept.cc 2020-02-06 10:31:53.417808266 +0000
++++ b/libstdc++-v3/src/nonshared11/cow-stdexcept.cc 2020-02-06 10:26:44.226333419 +0000
+@@ -35,7 +35,7 @@ asm (".hidden _ZNSt12__cow_stringaSEOS_"
+ asm (".hidden _ZNSt12__cow_stringaSERKS_");
+ asm (".hidden _ZNSt12__sso_stringC1ERKSs");
+ asm (".hidden _ZNSt12__sso_stringC2ERKSs");
+-#if defined(__i386__) || (defined(__powerpc__) && !defined(__powerpc64__))
++#if defined(__i386__) || defined(__arm__) || (defined(__powerpc__) && !defined(__powerpc64__))
+ asm (".hidden _ZNSt12__cow_stringC1EPKcj");
+ asm (".hidden _ZNSt12__cow_stringC2EPKcj");
+ #else
+diff -Naurp a/libstdc++-v3/src/nonshared11/cxx11-shim_facets.cc b/libstdc++-v3/src/nonshared11/cxx11-shim_facets.cc
+--- a/libstdc++-v3/src/nonshared11/cxx11-shim_facets.cc 2020-02-06 10:31:53.426807959 +0000
++++ b/libstdc++-v3/src/nonshared11/cxx11-shim_facets.cc 2020-02-06 10:26:44.227333385 +0000
+@@ -168,7 +168,7 @@ asm (".hidden _ZTVNSt13__facet_shims12_G
+ asm (".hidden _ZTVNSt13__facet_shims12_GLOBAL__N_115moneypunct_shimIcLb1EEE");
+ asm (".hidden _ZTVNSt13__facet_shims12_GLOBAL__N_115moneypunct_shimIwLb0EEE");
+ asm (".hidden _ZTVNSt13__facet_shims12_GLOBAL__N_115moneypunct_shimIwLb1EEE");
+-#if defined(__i386__) || (defined(__powerpc__) && !defined(__powerpc64__))
++#if defined(__i386__) || defined(__arm__) || (defined(__powerpc__) && !defined(__powerpc64__))
+ asm (".hidden _ZNSt13__facet_shims14__messages_getIcEEvSt17integral_constantIbLb1EEPKNSt6locale5facetERNS_12__any_stringEiiiPKT_j");
+ asm (".hidden _ZNSt13__facet_shims14__messages_getIwEEvSt17integral_constantIbLb1EEPKNSt6locale5facetERNS_12__any_stringEiiiPKT_j");
+ asm (".hidden _ZNSt13__facet_shims15__messages_openIcEEiSt17integral_constantIbLb1EEPKNSt6locale5facetEPKcjRKS3_");
+diff -Naurp a/libstdc++-v3/src/nonshared11/cxx11-wlocale-inst.cc b/libstdc++-v3/src/nonshared11/cxx11-wlocale-inst.cc
+--- a/libstdc++-v3/src/nonshared11/cxx11-wlocale-inst.cc 2020-02-06 10:31:53.403808742 +0000
++++ b/libstdc++-v3/src/nonshared11/cxx11-wlocale-inst.cc 2020-02-06 10:26:44.227333385 +0000
+@@ -36,7 +36,7 @@ asm (".hidden _ZNKSt17__gnu_cxx_ldbl1287
+ asm (".hidden _ZNKSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intB5cxx11IxEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_");
+ asm (".hidden _ZNKSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE14_M_extract_intB5cxx11IyEES4_S4_S4_RSt8ios_baseRSt12_Ios_IostateRT_");
+ #endif
+-#if defined(__i386__) || (defined(__powerpc__) && !defined(__powerpc64__))
++#if defined(__i386__) || defined(__arm__) || (defined(__powerpc__) && !defined(__powerpc64__))
+ asm (".hidden _ZNSt15time_put_bynameIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC1ERKNSt7__cxx1112basic_stringIcS1_IcESaIcEEEj");
+ asm (".hidden _ZNSt15time_put_bynameIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEEC2ERKNSt7__cxx1112basic_stringIcS1_IcESaIcEEEj");
+ #else
+diff -Naurp a/libstdc++-v3/src/nonshared11/locale-inst-asm.S b/libstdc++-v3/src/nonshared11/locale-inst-asm.S
+--- a/libstdc++-v3/src/nonshared11/locale-inst-asm.S 2020-02-06 10:31:53.405808674 +0000
++++ b/libstdc++-v3/src/nonshared11/locale-inst-asm.S 2020-02-06 10:26:44.228333351 +0000
+@@ -43,6 +43,11 @@
+ #define ALIGN3 .align 2
+ #define SECTION2(x).section .gnu.linkonce.s.x,"aw",@progbits
+ #define SECTION3(x)SECTION2(x)
++#elif defined __arm__
++#define ALIGN1 .align 4
++#define OBJECT %object
++#define SECTION1(x).section .gnu.linkonce.d.rel.ro.x,"aw",%progbits
++#define SECTION3(x).section .gnu.linkonce.r.x,"a",%progbits
+ #elif defined __aarch64__
+ #define ALIGN1 .align 3
+ #define ALIGN3 .align 3
+@@ -288,4 +293,4 @@ _ZTVSt16__numpunct_cacheIwE:
+ POINTER SYM(_ZTISt16__numpunct_cacheIwE)
+ VPTR(_ZNSt16__numpunct_cacheIwED1Ev)
+ VPTR(_ZNSt16__numpunct_cacheIwED0Ev)
+- .section .note.GNU-stack,"",@progbits
++ .section .note.GNU-stack,"",%progbits
+diff -Naurp a/libstdc++-v3/src/nonshared11/locale-inst.cc b/libstdc++-v3/src/nonshared11/locale-inst.cc
+--- a/libstdc++-v3/src/nonshared11/locale-inst.cc 2020-02-06 10:31:53.439807517 +0000
++++ b/libstdc++-v3/src/nonshared11/locale-inst.cc 2020-02-06 10:30:38.905344733 +0000
+@@ -75,13 +75,13 @@ _GLIBCXX_END_NAMESPACE_VERSION
+
+ #ifndef _GLIBCXX_NONSHARED_CXX11_80
+ #ifdef C_is_char
+-#if defined(__i386__) || (defined(__powerpc__) && !defined(__powerpc64__))
++#if defined(__i386__) || defined(__arm__) || (defined(__powerpc__) && !defined(__powerpc64__))
+ asm (".hidden _ZSt14__add_groupingIcEPT_S1_S0_PKcjPKS0_S5_");
+ #else
+ asm (".hidden _ZSt14__add_groupingIcEPT_S1_S0_PKcmPKS0_S5_");
+ #endif
+ #else
+-#if defined(__i386__) || (defined(__powerpc__) && !defined(__powerpc64__))
++#if defined(__i386__) || defined(__arm__) || (defined(__powerpc__) && !defined(__powerpc64__))
+ asm (".hidden _ZSt14__add_groupingIwEPT_S1_S0_PKcjPKS0_S5_");
+ #else
+ asm (".hidden _ZSt14__add_groupingIwEPT_S1_S0_PKcmPKS0_S5_");
+diff -Naurp a/libstdc++-v3/src/nonshared11/snprintf_lite.cc b/libstdc++-v3/src/nonshared11/snprintf_lite.cc
+--- a/libstdc++-v3/src/nonshared11/snprintf_lite.cc 2020-02-06 10:31:53.451807108 +0000
++++ b/libstdc++-v3/src/nonshared11/snprintf_lite.cc 2020-02-06 10:26:44.229333317 +0000
+@@ -30,6 +30,9 @@ asm (".hidden _ZN9__gnu_cxx15__snprintf_
+ #elif defined(__powerpc__)
+ asm (".hidden _ZN9__gnu_cxx15__concat_size_tEPcjj");
+ asm (".hidden _ZN9__gnu_cxx15__snprintf_liteEPcjPKcP13__va_list_tag");
++#elif defined(__arm__)
++asm (".hidden _ZN9__gnu_cxx15__concat_size_tEPcjj");
++asm (".hidden _ZN9__gnu_cxx15__snprintf_liteEPcjPKcSt9__va_list");
+ #elif defined(__aarch64__)
+ asm (".hidden _ZN9__gnu_cxx15__concat_size_tEPcmm");
+ asm (".hidden _ZN9__gnu_cxx15__snprintf_liteEPcmPKcSt9__va_list");
+diff -Naurp a/libstdc++-v3/src/nonshared11/sso_string.cc b/libstdc++-v3/src/nonshared11/sso_string.cc
+--- a/libstdc++-v3/src/nonshared11/sso_string.cc 2020-02-06 10:31:53.447807245 +0000
++++ b/libstdc++-v3/src/nonshared11/sso_string.cc 2020-02-06 10:26:44.230333283 +0000
+@@ -39,7 +39,7 @@ asm (".hidden _ZNSt12__sso_stringD1Ev");
+ asm (".hidden _ZNSt12__sso_stringD2Ev");
+ asm (".hidden _ZNSt12__sso_stringaSEOS_");
+ asm (".hidden _ZNSt12__sso_stringaSERKS_");
+-#if defined(__i386__) || (defined(__powerpc__) && !defined(__powerpc64__))
++#if defined(__i386__) || defined(__arm__) || (defined(__powerpc__) && !defined(__powerpc64__))
+ asm (".hidden _ZNSt12__sso_stringC1EPKcj");
+ asm (".hidden _ZNSt12__sso_stringC2EPKcj");
+ #else
+diff -Naurp a/libstdc++-v3/src/nonshared98/char8_t-rtti.S b/libstdc++-v3/src/nonshared98/char8_t-rtti.S
+--- a/libstdc++-v3/src/nonshared98/char8_t-rtti.S 2020-02-06 14:28:37.000000000 +0000
++++ b/libstdc++-v3/src/nonshared98/char8_t-rtti.S 2020-02-06 14:40:31.628979022 +0000
+@@ -21,12 +21,17 @@
+ . */
+
+ #if defined __x86_64__ || defined __powerpc64__ || defined __s390x__ || defined __ia64__ || defined __aarch64__ \
+- || defined __i386__ || defined __powerpc__ || defined __s390__
++ || defined __i386__ || defined __powerpc__ || defined __s390__ || defined __arm__
+ #ifdef __i386__
+ #define ALIGN1 .align 4
+ #elif defined __x86_64__
+ #define ALIGN1 .align 32
+ #define ALIGN2 .align 16
++#elif defined __arm__
++#define ALIGN1 .align 4
++#define OBJECT %object
++#define SECTION1(x).section .gnu.linkonce.d.rel.ro.x,"aw",%progbits
++#define SECTION3(x).section .gnu.linkonce.r.x,"a",%progbits
+ #elif defined __ia64__
+ #define ALIGN1 .align 8
+ #define ALIGN3 .align 8
+@@ -163,4 +168,4 @@ _ZTSPDu:
+ _ZTSDu:
+ STRING "Du"
+ #endif
+- .section .note.GNU-stack,"",@progbits
++ .section .note.GNU-stack,"",%progbits
+diff -Naurp a/libstdc++-v3/src/nonshared98/decimal-rtti.S b/libstdc++-v3/src/nonshared98/decimal-rtti.S
+--- a/libstdc++-v3/src/nonshared98/decimal-rtti.S 2020-02-06 10:31:53.383809423 +0000
++++ b/libstdc++-v3/src/nonshared98/decimal-rtti.S 2020-02-06 10:26:44.231333249 +0000
+@@ -21,7 +21,7 @@
+ . */
+
+ #if defined __x86_64__ || defined __powerpc64__ || defined __s390x__ || defined __ia64__ || defined __aarch64__ \
+- || defined __i386__ || defined __powerpc__ || defined __s390__
++ || defined __i386__ || defined __powerpc__ || defined __s390__ || defined __arm__
+ #ifdef __i386__
+ #define ALIGN1 .align 4
+ #elif defined __x86_64__
+@@ -43,6 +43,11 @@
+ #define ALIGN3 .align 2
+ #define SECTION2(x).section .gnu.linkonce.s.x,"aw",@progbits
+ #define SECTION3(x)SECTION2(x)
++#elif defined __arm__
++#define ALIGN1 .align 4
++#define OBJECT %object
++#define SECTION1(x).section .gnu.linkonce.d.rel.ro.x,"aw",%progbits
++#define SECTION3(x).section .gnu.linkonce.r.x,"a",%progbits
+ #elif defined __aarch64__
+ #define ALIGN1 .align 3
+ #define ALIGN3 .align 3
+@@ -271,4 +276,4 @@ _ZTSPDf:
+ _ZTSDf:
+ STRING "Df"
+ #endif
+- .section .note.GNU-stack,"",@progbits
++ .section .note.GNU-stack,"",%progbits
+diff -Naurp a/libstdc++-v3/src/nonshared98/float128.S b/libstdc++-v3/src/nonshared98/float128.S
+--- a/libstdc++-v3/src/nonshared98/float128.S 2020-02-06 10:31:53.376809661 +0000
++++ b/libstdc++-v3/src/nonshared98/float128.S 2020-02-06 10:26:44.231333249 +0000
+@@ -20,12 +20,17 @@
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ . */
+
+-#if defined __x86_64__ || defined __i386__ || defined __ia64__
++#if defined __x86_64__ || defined __i386__ || defined __ia64__ || defined __arm__
+ #ifdef __i386__
+ #define ALIGN1 .align 4
+ #elif defined __x86_64__
+ #define ALIGN1 .align 32
+ #define ALIGN2 .align 16
++#elif defined __arm__
++#define ALIGN1 .align 4
++#define OBJECT %object
++#define SECTION1(x).section .gnu.linkonce.d.rel.ro.x,"aw",%progbits
++#define SECTION3(x).section .gnu.linkonce.r.x,"a",%progbits
+ #elif defined __ia64__
+ #define ALIGN1 .align 8
+ #define ALIGN3 .align 8
+@@ -159,4 +164,4 @@ _ZTSPg:
+ _ZTSg:
+ STRING "g"
+ #endif
+- .section .note.GNU-stack,"",@progbits
++ .section .note.GNU-stack,"",%progbits
+diff -Naurp a/libstdc++-v3/src/nonshared98/int128.S b/libstdc++-v3/src/nonshared98/int128.S
+--- a/libstdc++-v3/src/nonshared98/int128.S 2020-02-06 10:31:53.398808912 +0000
++++ b/libstdc++-v3/src/nonshared98/int128.S 2020-02-06 10:26:44.232333215 +0000
+@@ -213,4 +213,4 @@ _ZTSPo:
+ _ZTSo:
+ STRING "o"
+ #endif
+- .section .note.GNU-stack,"",@progbits
++ .section .note.GNU-stack,"",%progbits
+diff -Naurp a/libstdc++-v3/src/nonshared98/locale_facets.cc b/libstdc++-v3/src/nonshared98/locale_facets.cc
+--- a/libstdc++-v3/src/nonshared98/locale_facets.cc 2020-02-06 10:31:53.381809491 +0000
++++ b/libstdc++-v3/src/nonshared98/locale_facets.cc 2020-02-06 10:26:44.232333215 +0000
+@@ -22,7 +22,7 @@
+
+ #define _GLIBCXX_NONSHARED_CXX11
+ #include "../c++98/locale_facets.cc"
+-#if defined(__i386__) || (defined(__powerpc__) && !defined(__powerpc64__))
++#if defined(__i386__) || defined(__arm__) || (defined(__powerpc__) && !defined(__powerpc64__))
+ asm (".hidden _ZSt22__verify_grouping_implPKcjS0_j");
+ #else
+ asm (".hidden _ZSt22__verify_grouping_implPKcmS0_m");
+diff -Naurp a/libstdc++-v3/src/nonshared98/nullptr-rtti.S b/libstdc++-v3/src/nonshared98/nullptr-rtti.S
+--- a/libstdc++-v3/src/nonshared98/nullptr-rtti.S 2020-02-06 10:31:53.396808981 +0000
++++ b/libstdc++-v3/src/nonshared98/nullptr-rtti.S 2020-02-06 10:26:44.233333181 +0000
+@@ -21,7 +21,7 @@
+ . */
+
+ #if defined __x86_64__ || defined __powerpc64__ || defined __s390x__ || defined __ia64__ || defined __aarch64__ \
+- || defined __i386__ || defined __powerpc__ || defined __s390__
++ || defined __i386__ || defined __powerpc__ || defined __s390__ || defined __arm__
+ #ifdef __i386__
+ #define ALIGN1 .align 4
+ #elif defined __x86_64__
+@@ -43,6 +43,11 @@
+ #define ALIGN3 .align 2
+ #define SECTION2(x).section .gnu.linkonce.s.x,"aw",@progbits
+ #define SECTION3(x)SECTION2(x)
++#elif defined __arm__
++#define ALIGN1 .align 4
++#define OBJECT %object
++#define SECTION1(x).section .gnu.linkonce.d.rel.ro.x,"aw",%progbits
++#define SECTION3(x).section .gnu.linkonce.r.x,"a",%progbits
+ #elif defined __aarch64__
+ #define ALIGN1 .align 3
+ #define ALIGN3 .align 3
+@@ -163,4 +168,4 @@ _ZTSPDn:
+ _ZTSDn:
+ STRING "Dn"
+ #endif
+- .section .note.GNU-stack,"",@progbits
++ .section .note.GNU-stack,"",%progbits
diff --git a/SPECS/gcc.spec b/SPECS/gcc.spec
index cc018e0..81d3cc3 100644
--- a/SPECS/gcc.spec
+++ b/SPECS/gcc.spec
@@ -276,6 +276,10 @@ Provides: liblto_plugin.so.0
%ifarch aarch64
%global oformat OUTPUT_FORMAT(elf64-littleaarch64)
%endif
+%ifarch %{arm}
+%global oformat OUTPUT_FORMAT(elf32-littlearm)
+%endif
+
Patch0: gcc9-hack.patch
Patch1: gcc9-i386-libgomp.patch
@@ -702,6 +706,10 @@ cd nvptx-tools-%{nvptx_tools_gitrev}
%patch4002 -p1 -b .nvptx-tools-glibc~
cd ..
+%ifarch %{arm}
+%patch10001 -p1 -b .arm1
+%endif
+
echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE
%if 0%{?rhel} == 6
@@ -969,6 +977,10 @@ CONFIGURE_OPTS="\
%ifarch mips64 mips64el
--with-arch=mips64r2 --with-abi=64 \
%endif
+%ifarch armv7hl
+ --with-tune=cortex-a8 --with-arch=armv7-a \
+ --with-float=hard --with-fpu=vfpv3-d16 --with-abi=aapcs-linux \
+%endif
%ifnarch sparc sparcv9 ppc
--build=%{gcc_target_platform} \
%endif