diff --git a/SOURCES/gcc7-dts-arm.patch b/SOURCES/gcc7-dts-arm.patch
new file mode 100644
index 0000000..38c5b92
--- /dev/null
+++ b/SOURCES/gcc7-dts-arm.patch
@@ -0,0 +1,222 @@
+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 2018-05-04 23:23:30.522747952 +0000
++++ b/libstdc++-v3/src/nonshared11/cow-shim_facets.cc 2018-05-04 23:10:06.516246998 +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 2018-05-04 23:23:30.452746531 +0000
++++ b/libstdc++-v3/src/nonshared11/cow-stdexcept.cc 2018-05-04 23:11:08.487596734 +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 2018-05-04 23:23:30.472746937 +0000
++++ b/libstdc++-v3/src/nonshared11/cxx11-shim_facets.cc 2018-05-04 23:13:51.221131240 +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 2018-05-04 23:23:30.422745921 +0000
++++ b/libstdc++-v3/src/nonshared11/cxx11-wlocale-inst.cc 2018-05-04 23:14:53.182398549 +0000
+@@ -37,7 +37,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 2018-05-04 23:23:30.422745921 +0000
++++ b/libstdc++-v3/src/nonshared11/locale-inst-asm.S 2018-05-04 22:57:53.009910103 +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 2018-05-04 23:23:30.502747546 +0000
++++ b/libstdc++-v3/src/nonshared11/locale-inst.cc 2018-05-04 23:16:21.674298394 +0000
+@@ -70,13 +70,13 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+ #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 2018-05-04 23:23:30.532748156 +0000
++++ b/libstdc++-v3/src/nonshared11/snprintf_lite.cc 2018-05-04 23:16:52.254940101 +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 2018-05-04 23:23:30.522747952 +0000
++++ b/libstdc++-v3/src/nonshared11/sso_string.cc 2018-05-04 23:18:59.917467051 +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/decimal-rtti.S b/libstdc++-v3/src/nonshared98/decimal-rtti.S
+--- a/libstdc++-v3/src/nonshared98/decimal-rtti.S 2018-05-04 23:23:30.372744906 +0000
++++ b/libstdc++-v3/src/nonshared98/decimal-rtti.S 2018-05-04 23:00:30.443350078 +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 2018-05-04 23:23:30.362744703 +0000
++++ b/libstdc++-v3/src/nonshared98/float128.S 2018-05-04 23:03:16.517115056 +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 2018-05-04 23:23:30.412745718 +0000
++++ b/libstdc++-v3/src/nonshared98/int128.S 2018-05-04 23:04:19.068615032 +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 2018-05-04 23:23:30.372744906 +0000
++++ b/libstdc++-v3/src/nonshared98/locale_facets.cc 2018-05-04 23:19:19.847795727 +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 2018-05-04 23:23:30.402745515 +0000
++++ b/libstdc++-v3/src/nonshared98/nullptr-rtti.S 2018-05-04 23:06:14.031147463 +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 b2cc788..2060275 100644
--- a/SPECS/gcc.spec
+++ b/SPECS/gcc.spec
@@ -243,6 +243,9 @@ Provides: liblto_plugin.so.0
%ifarch aarch64
%global oformat OUTPUT_FORMAT(elf64-littleaarch64)
%endif
+%ifarch %{arm}
+%global oformat OUTPUT_FORMAT(elf32-littlearm)
+%endif
Patch0: gcc7-hack.patch
Patch2: gcc7-i386-libgomp.patch
@@ -302,6 +305,9 @@ Patch3027: gcc7-fortran-fdec-include-doc.patch
Patch3028: gcc7-fortran-fpad-source.patch
+# specific patches for .el7 armhfp build
+Patch10001: gcc7-dts-arm.patch
+
%if 0%{?rhel} >= 7
%global nonsharedver 48
%else
@@ -309,7 +315,9 @@ Patch3028: gcc7-fortran-fpad-source.patch
%endif
%if 0%{?scl:1}
+%ifnarch %{arm}
%global _gnu %{nil}
+%endif
%else
%global _gnu 7E
%endif
@@ -319,7 +327,10 @@ Patch3028: gcc7-fortran-fpad-source.patch
%ifarch ppc
%global gcc_target_platform ppc64-%{_vendor}-%{_target_os}%{?_gnu}
%endif
-%ifnarch sparcv9 ppc
+%ifarch %{arm}
+%global gcc_target_platform armv7hl-%{_vendor}-%{_target_os}-gnueabi
+%endif
+%ifnarch sparcv9 ppc %{arm}
%global gcc_target_platform %{_target_platform}
%endif
@@ -759,6 +770,10 @@ cd ..
%patch3028 -p0 -b .fortran28~
%endif
+%ifarch %{arm}
+%patch10001 -p1 -b .arm1
+%endif
+
echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE
%if 0%{?rhel} == 6
@@ -956,6 +971,10 @@ CONFIGURE_OPTS="\
%ifarch s390 s390x
--with-arch=z9-109 --with-tune=z10 --enable-decimal-float \
%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
@@ -2912,6 +2931,9 @@ fi
%doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog
+* Tue Sep 10 2019 Pablo Greco 7.3.1-5.16
+- Fix for armhfp
+
* Tue Jul 9 2019 Marek Polacek 7.3.1-5.16
- apply a patch for middle-end/85496 (#1570308)