summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/conf/distro/include/tcmode-default.inc2
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1.inc133
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch42
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0002-uclibc-conf.patch30
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0003-gcc-uclibc-locale-ctype_touplow_t.patch87
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0004-uclibc-locale.patch2862
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0005-uclibc-locale-no__x.patch257
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0006-uclibc-locale-wchar_fix.patch68
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0007-uclibc-locale-update.patch542
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0008-c99-snprintf.patch28
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0009-gcc-poison-system-directories.patch192
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0010-gcc-poison-dir-extend.patch39
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch73
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0012-64-bit-multilib-hack.patch85
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0013-optional-libstdc.patch125
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch59
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0015-COLLECT_GCC_OPTIONS.patch38
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch96
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0017-fortran-cross-compile-hack.patch46
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0018-cpp-honor-sysroot.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0019-MIPS64-Default-to-N64-ABI.patch57
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch234
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0021-gcc-Fix-argument-list-too-long-error.patch40
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0022-Disable-sdt.patch113
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0023-libtool.patch42
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch43
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch102
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch31
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0027-export-CPP.patch53
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch56
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch42
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0030-Ensure-target-gcc-headers-can-be-included.patch98
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch38
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch29
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0034-aarch64-Add-support-for-musl-ldso.patch28
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0036-handle-sysroot-support-for-nativesdk-gcc.patch213
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch102
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0038-Fix-various-_FOR_BUILD-and-related-variables.patch137
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch28
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0040-ssp_nonshared.patch28
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch284
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch43
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch54
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch123
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch29
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0046-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch85
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.1/0047-sync-gcc-stddef.h-with-musl.patch91
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian.inc3
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-canadian_7.1.bb5
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-initial.inc3
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross-initial_7.1.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc3
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross_7.1.bb3
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk-initial_7.1.bb3
-rw-r--r--meta/recipes-devtools/gcc/gcc-crosssdk_7.1.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime.inc4
-rw-r--r--meta/recipes-devtools/gcc/gcc-runtime_7.1.bb7
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc-sanitizers_7.1.bb2
-rw-r--r--meta/recipes-devtools/gcc/gcc-source_7.1.bb4
-rw-r--r--meta/recipes-devtools/gcc/gcc_7.1.bb9
-rw-r--r--meta/recipes-devtools/gcc/libgcc-initial_7.1.bb2
-rw-r--r--meta/recipes-devtools/gcc/libgcc_7.1.bb2
-rw-r--r--meta/recipes-devtools/gcc/libgfortran_7.1.bb3
66 files changed, 7242 insertions, 5 deletions
diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
index fe217c0392..d5ba38d442 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -22,7 +22,7 @@ PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "${TCLIBC}-initial"
PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial ?= "nativesdk-glibc-initial"
PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
-GCCVERSION ?= "6.3%"
+GCCVERSION ?= "7.%"
SDKGCCVERSION ?= "${GCCVERSION}"
BINUVERSION ?= "2.28%"
GDBVERSION ?= "8.0%"
diff --git a/meta/recipes-devtools/gcc/gcc-7.1.inc b/meta/recipes-devtools/gcc/gcc-7.1.inc
new file mode 100644
index 0000000000..3df04199a6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.1.inc
@@ -0,0 +1,133 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "7.1.0"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "7.1.0"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-7.1:${FILE_DIRNAME}/gcc-7.1/backport:"
+
+DEPENDS =+ "mpfr gmp libmpc zlib"
+NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
+
+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
+
+LIC_FILES_CHKSUM = "\
+ file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+ file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+ file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
+"
+
+#RELEASE = "7-20170504"
+BASEURI ?= "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2"
+#SRCREV = "f7cf798b73fd1a07098f9a490deec1e2a36e0bed"
+#BASEURI ?= "git://github.com/gcc-mirror/gcc;branch=gcc-6-branch;protocol=git"
+#BASEURI ?= "http://mirrors.concertpass.com/gcc/snapshots/${RELEASE}/gcc-${RELEASE}.tar.bz2"
+
+SRC_URI = "\
+ ${BASEURI} \
+ file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
+ file://0002-uclibc-conf.patch \
+ file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+ file://0004-uclibc-locale.patch \
+ file://0005-uclibc-locale-no__x.patch \
+ file://0006-uclibc-locale-wchar_fix.patch \
+ file://0007-uclibc-locale-update.patch \
+ file://0008-c99-snprintf.patch \
+ file://0009-gcc-poison-system-directories.patch \
+ file://0010-gcc-poison-dir-extend.patch \
+ file://0011-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+ file://0012-64-bit-multilib-hack.patch \
+ file://0013-optional-libstdc.patch \
+ file://0014-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+ file://0015-COLLECT_GCC_OPTIONS.patch \
+ file://0016-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+ file://0017-fortran-cross-compile-hack.patch \
+ file://0018-cpp-honor-sysroot.patch \
+ file://0019-MIPS64-Default-to-N64-ABI.patch \
+ file://0020-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+ file://0021-gcc-Fix-argument-list-too-long-error.patch \
+ file://0022-Disable-sdt.patch \
+ file://0023-libtool.patch \
+ file://0024-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+ file://0025-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+ file://0026-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
+ file://0027-export-CPP.patch \
+ file://0028-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+ file://0029-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch \
+ file://0030-Ensure-target-gcc-headers-can-be-included.patch \
+ file://0031-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \
+ file://0032-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
+ file://0033-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+ file://0034-aarch64-Add-support-for-musl-ldso.patch \
+ file://0035-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
+ file://0036-handle-sysroot-support-for-nativesdk-gcc.patch \
+ file://0037-Search-target-sysroot-gcc-version-specific-dirs-with.patch \
+ file://0038-Fix-various-_FOR_BUILD-and-related-variables.patch \
+ file://0039-nios2-Define-MUSL_DYNAMIC_LINKER.patch \
+ file://0040-ssp_nonshared.patch \
+ file://0041-gcc-libcpp-support-ffile-prefix-map-old-new.patch \
+ file://0042-Reuse-fdebug-prefix-map-to-replace-ffile-prefix-map.patch \
+ file://0043-gcc-final.c-fdebug-prefix-map-support-to-remap-sourc.patch \
+ file://0044-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch \
+ file://0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
+ file://0046-libgcc_s-Use-alias-for-__cpu_indicator_init-instead-.patch \
+ file://0047-sync-gcc-stddef.h-with-musl.patch \
+ ${BACKPORTS} \
+"
+BACKPORTS = "\
+"
+SRC_URI[md5sum] = "6bf56a2bca9dac9dbbf8e8d1036964a8"
+SRC_URI[sha256sum] = "8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17"
+
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/git"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+# Language Overrides
+FORTRAN = ""
+JAVA = ""
+
+LTO = "--enable-lto"
+
+EXTRA_OECONF_BASE = "\
+ ${LTO} \
+ --enable-libssp \
+ --enable-libitm \
+ --disable-bootstrap \
+ --disable-libmudflap \
+ --with-system-zlib \
+ --with-linker-hash-style=${LINKER_HASH_STYLE} \
+ --enable-linker-build-id \
+ --with-ppl=no \
+ --with-cloog=no \
+ --enable-checking=release \
+ --enable-cheaders=c_global \
+ --without-isl \
+"
+
+EXTRA_OECONF_INITIAL = "\
+ --disable-libmudflap \
+ --disable-libgomp \
+ --disable-libitm \
+ --disable-libquadmath \
+ --with-system-zlib \
+ --disable-lto \
+ --disable-plugin \
+ --enable-decimal-float=no \
+ --without-isl \
+ gcc_cv_libc_provides_ssp=yes \
+"
+
+EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
+
+EXTRA_OECONF_PATHS = "\
+ --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
+ --with-sysroot=/not/exist \
+ --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
diff --git a/meta/recipes-devtools/gcc/gcc-7.1/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-7.1/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000000..1af1c74e61
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.1/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From 2fcf1e23ef4b2a5c93526f12212aa892595261f6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:37:11 +0400
+Subject: [PATCH 01/47] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ configure | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 32a38633ad8..b4760952085 100755
+--- a/configure
++++ b/configure
+@@ -7472,7 +7472,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+diff --git a/configure.ac b/configure.ac
+index 12377499295..176ebb921ed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3065,7 +3065,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+ *" newlib "*)
+ case " $target_configargs " in
+--
+2.12.2
+
diff --git a/meta/recipes-devtools/gcc/gcc-7.1/0002-uclibc-conf.patch b/meta/recipes-devtools/gcc/gcc-7.1/0002-uclibc-conf.patch
new file mode 100644
index 0000000000..dfcf25feb3
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.1/0002-uclibc-conf.patch
@@ -0,0 +1,30 @@
+From b4edd6af6e5c007d04ba0a0b6f614ac5773c9b36 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:38:25 +0400
+Subject: [PATCH 02/47] uclibc-conf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497fea2..6dc7eadff36 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++ make all-gdb all-dejagnu all-ld || exit 1
++ make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+ make bootstrap || exit 1
+ make install || exit 1
+--
+2.12.2
+
diff --git a/meta/recipes-devtools/gcc/gcc-7.1/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/meta/recipes-devtools/gcc/gcc-7.1/0003-gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 0000000000..bd9eddc4d6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.1/0003-gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,87 @@
+From e53fb4bcf1e584413ca7207511757287a0156147 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:40:12 +0400
+Subject: [PATCH 03/47] gcc-uclibc-locale-ctype_touplow_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/generic/c_locale.cc | 5 +++++
+ libstdc++-v3/config/locale/generic/c_locale.h | 9 +++++++++
+ libstdc++-v3/config/os/gnu-linux/ctype_base.h | 9 +++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
+index bd311e300f8..3190973d164 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.cc
++++ b/libstdc++-v3/config/locale/generic/c_locale.cc
+@@ -273,5 +273,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+ #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+ extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++#ifdef __UCLIBC__
++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
++#else
+ _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif
+ #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
+index ce9fbb80d76..54211bee314 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -40,13 +40,22 @@
+
+ #include <clocale>
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ #define _GLIBCXX_NUM_CATEGORIES 0
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
++#ifdef __UCLIBC__
++ typedef __ctype_touplow_t* __c_locale;
++#else
+ typedef int* __c_locale;
++#endif
+
+ // Convert numeric value of type double and long double to string and
+ // return length of string. If vsnprintf is available use it, otherwise
+diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+index 6ee1debdc2a..94bf3cf00aa 100644
+--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h
++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+@@ -33,6 +33,11 @@
+
+ // Information as gleaned from /usr/include/ctype.h
+
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ struct ctype_base
+ {
+ // Non-standard typedefs.
++#ifdef __UCLIBC__
++ typedef const __ctype_touplow_t* __to_type;
++#else
+ typedef const int* __to_type;
++#endif
+
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+--
+2.12.2
+
diff --git a/meta/recipes-devtools/gcc/gcc-7.1/0004-uclibc-locale.patch b/meta/recipes-devtools/gcc/gcc-7.1/0004-uclibc-locale.patch
new file mode 100644
index 0000000000..8d3135b992
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.1/0004-uclibc-locale.patch
@@ -0,0 +1,2862 @@
+From 87010423a7d26baed4556f5e540f4d00664ae86d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:41:39 +0400
+Subject: [PATCH 04/47] uclibc-locale
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/acinclude.m4 | 37 ++
+ .../config/locale/uclibc/c++locale_internal.h | 63 ++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/c_locale.h | 117 ++++
+ .../config/locale/uclibc/codecvt_members.cc | 308 +++++++++
+ .../config/locale/uclibc/collate_members.cc | 80 +++
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 300 +++++++++
+ .../config/locale/uclibc/messages_members.cc | 100 +++
+ .../config/locale/uclibc/messages_members.h | 118 ++++
+ .../config/locale/uclibc/monetary_members.cc | 692 +++++++++++++++++++++
+ .../config/locale/uclibc/numeric_members.cc | 160 +++++
+ libstdc++-v3/config/locale/uclibc/time_members.cc | 406 ++++++++++++
+ libstdc++-v3/config/locale/uclibc/time_members.h | 68 ++
+ libstdc++-v3/configure | 75 +++
+ libstdc++-v3/include/c_compatibility/wchar.h | 2 +
+ libstdc++-v3/include/c_std/cwchar | 2 +
+ 16 files changed, 2688 insertions(+)
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 8cb525b2938..e6056f25ddc 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -2410,6 +2410,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ # Default to "generic".
+ if test $enable_clocale_flag = auto; then
+ case ${target_os} in
++ *-uclibc*)
++ enable_clocale_flag=uclibc
++ ;;
+ linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ enable_clocale_flag=gnu
+ ;;
+@@ -2594,6 +2597,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+ CTIME_CC=config/locale/generic/time_members.cc
+ CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+ ;;
++ uclibc)
++ AC_MSG_RESULT(uclibc)
++
++ # Declare intention to use gettext, and add support for specific
++ # languages.
++ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++ ALL_LINGUAS="de fr"
++
++ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++ USE_NLS=yes
++ fi
++ # Export the build objects.
++ for ling in $ALL_LINGUAS; do \
++ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
<