summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml4
-rw-r--r--config/global/paths.in16
-rw-r--r--config/libc/uClibc.in88
-rw-r--r--config/libc/uClibc.in.21
-rw-r--r--contrib/uClibc-defconfigs/uClibc-ng.config41
-rw-r--r--contrib/uClibc-defconfigs/uClibc.config (renamed from samples/arm-unknown-linux-uclibcgnueabihf/uClibc-0.9.33.2.config)77
-rw-r--r--kconfig/confdata.c7
-rw-r--r--kconfig/expr.c2
-rw-r--r--kconfig/symbol.c5
-rw-r--r--kconfig/zconf.gperf1
-rw-r--r--kconfig/zconf.l20
-rw-r--r--patches/gcc/4.8.5/001_gcc_bug_62231.patch (renamed from patches/gcc/4.8.4/001_gcc_bug_62231.patch)0
-rw-r--r--patches/gcc/4.8.5/002_gcc_bug_62231.patch (renamed from patches/gcc/4.8.4/002_gcc_bug_62231.patch)0
-rw-r--r--patches/gcc/4.8.5/100-uclibc-conf.patch15
-rw-r--r--patches/gcc/4.8.5/1000-powerpc-link-with-math-lib.patch.conditional122
-rw-r--r--patches/gcc/4.8.5/111-pr65730.patch37
-rw-r--r--patches/gcc/4.8.5/301-missing-execinfo_h.patch13
-rw-r--r--patches/gcc/4.8.5/305-libmudflap-susv3-legacy.patch49
-rw-r--r--patches/gcc/4.8.5/810-arm-softfloat-libgcc.patch30
-rw-r--r--patches/gcc/4.8.5/830-arm_unbreak_armv4t.patch13
-rw-r--r--patches/gcc/4.8.5/841-PR57717-E500v2.patch (renamed from patches/gcc/4.8.4/003-PR57717-E500v2.patch)8
-rw-r--r--patches/gcc/4.8.5/842-PR60155.patch111
-rw-r--r--patches/gcc/4.8.5/843-aarch64-vmlaq_lane_s32-typo.patch24
-rw-r--r--patches/gcc/4.8.5/850-libstdcxx-uclibc-c99.patch273
-rw-r--r--patches/gcc/4.8.5/851-PR-other-56780.patch244
-rw-r--r--patches/gcc/4.8.5/870-xtensa-add-mauto-litpools-option.patch290
-rw-r--r--patches/gcc/4.8.5/871-xtensa-reimplement-register-spilling.patch76
-rw-r--r--patches/gcc/4.8.5/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch33
-rw-r--r--patches/gcc/4.8.5/873-xtensa-fix-_Unwind_GetCFA.patch40
-rw-r--r--patches/gcc/4.8.5/900-musl-support.patch648
-rw-r--r--patches/gcc/4.9.3/001_gcc_bug_62231.patch129
-rw-r--r--patches/gcc/4.9.3/002_gcc_bug_62231.patch18
-rw-r--r--patches/gcc/4.9.3/100-uclibc-conf.patch15
-rw-r--r--patches/gcc/4.9.3/1000-powerpc-link-with-math-lib.patch.conditional122
-rw-r--r--patches/gcc/4.9.3/111-pr65730.patch37
-rw-r--r--patches/gcc/4.9.3/301-missing-execinfo_h.patch13
-rw-r--r--patches/gcc/4.9.3/810-arm-softfloat-libgcc.patch30
-rw-r--r--patches/gcc/4.9.3/830-arm_unbreak_armv4t.patch13
-rw-r--r--patches/gcc/4.9.3/840-microblaze-enable-dwarf-eh-support.patch169
-rw-r--r--patches/gcc/4.9.3/850-libstdcxx-uclibc-c99.patch255
-rw-r--r--patches/gcc/4.9.3/860-cilk-wchar.patch56
-rw-r--r--patches/gcc/4.9.3/870-xtensa-add-mauto-litpools-option.patch290
-rw-r--r--patches/gcc/4.9.3/871-xtensa-reimplement-register-spilling.patch76
-rw-r--r--patches/gcc/4.9.3/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch33
-rw-r--r--patches/gcc/4.9.3/873-xtensa-fix-_Unwind_GetCFA.patch40
-rw-r--r--patches/gcc/4.9.3/900-musl-support.patch640
-rw-r--r--patches/gcc/4.9.3/920-libgcc-remove-unistd-header.patch12
-rw-r--r--patches/gcc/5.2.0/100-uclibc-conf.patch15
-rw-r--r--patches/gcc/5.2.0/201-libgcc-remove-unistd-header.patch14
-rw-r--r--patches/gcc/5.2.0/301-missing-execinfo_h.patch13
-rw-r--r--patches/gcc/5.2.0/810-arm-softfloat-libgcc.patch30
-rw-r--r--patches/gcc/5.2.0/830-arm_unbreak_armv4t.patch15
-rw-r--r--patches/gcc/5.2.0/840-microblaze-enable-dwarf-eh-support.patch166
-rw-r--r--patches/gcc/5.2.0/850-libstdcxx-uclibc-c99.patch273
-rw-r--r--patches/gcc/5.2.0/860-cilk-wchar.patch56
-rw-r--r--patches/gcc/5.2.0/870-xtensa-add-mauto-litpools-option.patch290
-rw-r--r--patches/gcc/5.2.0/871-xtensa-reimplement-register-spilling.patch76
-rw-r--r--patches/gcc/5.2.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch31
-rw-r--r--patches/gcc/5.2.0/873-xtensa-fix-_Unwind_GetCFA.patch40
-rw-r--r--patches/gcc/5.2.0/900-libitm-fixes-for-musl-support.patch (renamed from patches/gcc/5.2.0/100-libitm-fixes-for-musl-support.patch)12
-rw-r--r--patches/gcc/5.2.0/901-fixincludes-update-for-musl-support.patch (renamed from patches/gcc/5.2.0/101-fixincludes-update-for-musl-support.patch)6
-rw-r--r--patches/gcc/5.2.0/902-unwind-fix-for-musl.patch (renamed from patches/gcc/5.2.0/102-unwind-fix-for-musl.patch)4
-rw-r--r--patches/gcc/5.2.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch (renamed from patches/gcc/5.2.0/103-libstdc++-libgfortran-gthr-workaround-for-musl.patch)22
-rw-r--r--patches/gcc/5.2.0/904-musl-libc-config.patch (renamed from patches/gcc/5.2.0/104-musl-libc-config.patch)80
-rw-r--r--patches/gcc/5.2.0/905-add-musl-support-to-gcc.patch (renamed from patches/gcc/5.2.0/105-add-musl-support-to-gcc.patch)30
-rw-r--r--patches/gcc/5.2.0/906-mips-musl-support.patch (renamed from patches/gcc/5.2.0/106-mips-musl-support.patch)7
-rw-r--r--patches/gcc/5.2.0/907-x86-musl-support.patch (renamed from patches/gcc/5.2.0/107-x86-musl-support.patch)12
-rw-r--r--patches/gcc/5.2.0/908-arm-musl-support.patch (renamed from patches/gcc/5.2.0/108-arm-musl-support.patch)4
-rw-r--r--patches/gcc/5.2.0/909-aarch64-musl-support.patch (renamed from patches/gcc/5.2.0/109-aarch64-musl-support.patch)4
-rw-r--r--patches/uClibc-ng/1.0.8/001-unistd-fix-if-condition.patch34
-rw-r--r--patches/uClibc/0.9.28.3/100-string-functions.patch14
-rw-r--r--patches/uClibc/0.9.28.3/110-install_dev.patch22
-rw-r--r--patches/uClibc/0.9.28.3/120-no_LFS-no_readahead.patch14
-rw-r--r--patches/uClibc/0.9.28.3/130-ctype.patch17
-rw-r--r--patches/uClibc/0.9.28.3/140-custom-ISA.patch31
-rw-r--r--patches/uClibc/0.9.28.3/150-mips-asm.h.patch41
-rw-r--r--patches/uClibc/0.9.29/100-fix-mmap.patch91
-rw-r--r--patches/uClibc/0.9.29/110-conditional-sched_affinity.patch53
-rw-r--r--patches/uClibc/0.9.29/120-fix-internal_function-definition.patch51
-rw-r--r--patches/uClibc/0.9.29/130-fix-gethostent_r-failure-retval.patch12
-rw-r--r--patches/uClibc/0.9.29/140-bits_sysnum_h.patch33
-rw-r--r--patches/uClibc/0.9.29/150-bits_sysnum_h2.patch18
-rw-r--r--patches/uClibc/0.9.29/160-custom-ISA.patch31
-rw-r--r--patches/uClibc/0.9.29/170-filter-gnu99-from-assembly-flags.patch12
-rw-r--r--patches/uClibc/0.9.29/180-linuxthreads.patch145
-rw-r--r--patches/uClibc/0.9.29/190-rm-whitespace.patch86
-rw-r--r--patches/uClibc/0.9.30.1/100-fix-gethostent_r-failure-retval.patch17
-rw-r--r--patches/uClibc/0.9.30.1/110-arm_fix_alignment.patch23
-rw-r--r--patches/uClibc/0.9.30.1/120-rm-whitespace.patch88
-rw-r--r--patches/uClibc/0.9.30.1/130-arm-ftruncate64.patch17
-rw-r--r--patches/uClibc/0.9.30.1/140-gnu89-inline.patch16
-rw-r--r--patches/uClibc/0.9.30.1/150-64bit-strtouq.patch48
-rw-r--r--patches/uClibc/0.9.30.1/160-c99-ldbl-math.patch474
-rw-r--r--patches/uClibc/0.9.30.1/170-dl-sysdep-inline.patch371
-rw-r--r--patches/uClibc/0.9.30.1/180-getline-conflict.patch30
-rw-r--r--patches/uClibc/0.9.30.1/190-fix-getaddrinfo-NULL-pointer-dereference.patch12
-rw-r--r--patches/uClibc/0.9.30.1/200-pack-netinet-structs.patch224
-rw-r--r--patches/uClibc/0.9.30.2/100-fix-gethostent_r-failure-retval.patch17
-rw-r--r--patches/uClibc/0.9.30.2/110-arm_fix_alignment.patch25
-rw-r--r--patches/uClibc/0.9.30.2/120-rm-whitespace.patch88
-rw-r--r--patches/uClibc/0.9.30.2/130-gnu89-inline.patch16
-rw-r--r--patches/uClibc/0.9.30.2/140-pack-netinet-structs.patch224
-rw-r--r--patches/uClibc/0.9.30.2/150-LT-pthread_atfork-unhide.patch64
-rw-r--r--patches/uClibc/0.9.30.2/160-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch87
-rw-r--r--patches/uClibc/0.9.30.2/170-Makefile.in-Make-install_dev-depend-on-install_runti.patch30
-rw-r--r--patches/uClibc/0.9.30.2/180-Unbreak-build-for-sparc-on-some-config-s.patch42
-rw-r--r--patches/uClibc/0.9.30.2/210-fix-make-install-host-utils.patch153
-rw-r--r--patches/uClibc/0.9.30.2/220-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch113
-rw-r--r--patches/uClibc/0.9.30.2/230-getdents-Fix-mips64-build.patch72
-rw-r--r--patches/uClibc/0.9.30.2/240-host-utils-depend-on-headers.patch35
-rw-r--r--patches/uClibc/0.9.30.2/250-libc-Fix-typo-in-include-rpc.patch63
-rw-r--r--patches/uClibc/0.9.30.2/260-libm-enable-log2f-and-exp2f.patch70
-rw-r--r--patches/uClibc/0.9.30.2/270-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch89
-rw-r--r--patches/uClibc/0.9.30.2/280-rpc-fix-typo-in-version-mismatch-msg.patch26
-rw-r--r--patches/uClibc/0.9.30/100-fix-gethostent_r-failure-retval.patch17
-rw-r--r--patches/uClibc/0.9.30/110-arm_fix_alignment.patch23
-rw-r--r--patches/uClibc/0.9.30/120-rm-whitespace.patch88
-rw-r--r--patches/uClibc/0.9.30/130-arm-ftruncate64.patch17
-rw-r--r--patches/uClibc/0.9.30/140-gnu89-inline.patch16
-rw-r--r--patches/uClibc/0.9.30/150-getaddrinfo-segfault-ipv6-and-ipv4.patch32
-rw-r--r--patches/uClibc/0.9.30/200-getline-already-declared.patch29
-rw-r--r--patches/uClibc/0.9.30/210-find-portable.patch11
-rw-r--r--patches/uClibc/0.9.32.1/100-fix-TLS-DTPREL-TPREL-macros.patch40
-rw-r--r--patches/uClibc/0.9.32/100-bump-version-to-0.9.32.1-git.patch21
-rw-r--r--patches/uClibc/0.9.32/110-nptl-Makefile.in-Fix-the-build-break-caused-by-UCLIBC_CTOR_DTOR-enabling.patch28
-rw-r--r--patches/uClibc/0.9.32/120-ctor-dtor-nptl-Fix-init-and-fini-function-compilation.patch182
-rw-r--r--patches/uClibc/0.9.32/130-nptl-pthread-Correct-path-for-machine-specific-pt-initfini.c.patch24
-rw-r--r--patches/uClibc/0.9.32/140-ARM-reorder-Use-BX-option.patch48
-rw-r--r--patches/uClibc/0.9.32/150-Rules.mak-Rearrange-appending-UCLIBC_EXTRA_CFLAGS-to-CFLAGS.patch38
-rw-r--r--patches/uClibc/0.9.32/160-fix-TLS-DTPREL-TPREL-macros.patch40
-rw-r--r--patches/uClibc/0.9.32/170-Conditionalize-use-libgcc_eh-when-libubacktrace-is-n.patch29
-rw-r--r--samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config2
-rw-r--r--samples/arm-cortexa5-linux-uclibcgnueabihf/uClibc-0.9.33.2.config251
-rw-r--r--samples/arm-unknown-linux-uclibcgnueabi/crosstool.config1
-rw-r--r--samples/arm-unknown-linux-uclibcgnueabi/uClibc-0.9.33.2.config253
-rw-r--r--samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config2
-rw-r--r--samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config2
-rw-r--r--samples/armeb-unknown-linux-uclibcgnueabi/uClibc-0.9.33.2.config255
-rw-r--r--samples/i586-geode-linux-uclibc/crosstool.config3
-rw-r--r--samples/i586-geode-linux-uclibc/uClibc-0.9.33.2.config270
-rw-r--r--samples/m68k-unknown-uclinux-uclibc/crosstool.config1
-rw-r--r--samples/m68k-unknown-uclinux-uclibc/uClibc-0.9.33.2.config260
-rw-r--r--samples/mips-unknown-linux-uclibc/crosstool.config1
-rw-r--r--samples/mips-unknown-linux-uclibc/uClibc-0.9.33.2.config255
-rw-r--r--samples/mips64el-n32-linux-uclibc/crosstool.config2
-rw-r--r--samples/mips64el-n32-linux-uclibc/uClibc-0.9.33.2.config255
-rw-r--r--samples/mips64el-n64-linux-uclibc/crosstool.config2
-rw-r--r--samples/mips64el-n64-linux-uclibc/uClibc-0.9.33.2.config255
-rw-r--r--samples/powerpc-unknown-linux-uclibc/crosstool.config9
-rw-r--r--samples/powerpc-unknown-linux-uclibc/uClibc-0.9.30.1.config247
-rw-r--r--samples/x86_64-unknown-linux-uclibc/crosstool.config3
-rw-r--r--samples/x86_64-unknown-linux-uclibc/uClibc-0.9.33.2.config247
-rwxr-xr-xscripts/addToolVersion.sh9
-rw-r--r--scripts/build/cc/100-gcc.sh6
-rw-r--r--scripts/build/internals.sh2
-rw-r--r--scripts/build/libc/uClibc.sh437
-rw-r--r--scripts/crosstool-NG.sh.in2
-rw-r--r--scripts/functions50
158 files changed, 5506 insertions, 6934 deletions
diff --git a/.travis.yml b/.travis.yml
index 0269ac5..58f6a85 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,10 +37,12 @@ install:
# by the continuous integration system
env:
- CT_SAMPLE=arm-unknown-eabi
- - CT_SAMPLE=armeb-unknown-eabi
- CT_SAMPLE=arm-unknown-linux-gnueabi
- CT_SAMPLE=armeb-unknown-linux-gnueabi
- CT_SAMPLE=arm-unknown-linux-musleabi
+ - CT_SAMPLE=mips64el-n64-linux-uclibc
+ - CT_SAMPLE=powerpc-e500v2-linux-gnuspe
+ - CT_SAMPLE=x86_64-unknown-linux-uclibc
# Building the standard samples
script:
diff --git a/config/global/paths.in b/config/global/paths.in
index 3e19332..f3059b9 100644
--- a/config/global/paths.in
+++ b/config/global/paths.in
@@ -117,12 +117,22 @@ config INSTALL_DIR_RO
Useful for toolchains destined for production.
-config STRIP_ALL_TOOLCHAIN_EXECUTABLES
+config STRIP_HOST_TOOLCHAIN_EXECUTABLES
bool
- prompt "Strip all toolchain executables"
+ prompt "Strip host toolchain executables"
default y
help
All build host executables contain a lot of unnecessary info.
- By stripping all executables it slightly speeds up the compilation
+ By stripping host executables it slightly speeds up the compilation
of large projects.
NOTE: It does NOT strip the target libraries, only HOST executables
+
+config STRIP_TARGET_TOOLCHAIN_EXECUTABLES
+ bool
+ prompt "Strip target toolchain executables"
+ depends on CC_GCC_4_6_or_later
+ help
+ It means using install-strip target for GCC 4.6 or later.
+ An install-strip make target is provided that installs stripped
+ executables, and may install libraries with unneeded or debugging
+ sections stripped.
diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in
index 1529642..4e57be0 100644
--- a/config/libc/uClibc.in
+++ b/config/libc/uClibc.in
@@ -26,62 +26,21 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
-config LIBC_UCLIBC_V_0_9_33_2
- bool
- prompt "0.9.33.2"
- select LIBC_UCLIBC_0_9_32_or_later
-
-config LIBC_UCLIBC_V_0_9_33_1
- bool
- prompt "0.9.33.1"
- select LIBC_UCLIBC_0_9_32_or_later
-
-config LIBC_UCLIBC_V_0_9_33
- bool
- prompt "0.9.33"
- select LIBC_UCLIBC_0_9_32_or_later
-
-config LIBC_UCLIBC_V_0_9_32_1
+config LIBC_UCLIBC_NG_V_1_0_8
bool
- prompt "0.9.32.1"
- select LIBC_UCLIBC_0_9_32_or_later
+ prompt "1.0.8"
+ select LIBC_UCLIBC_NG_1_0_8_or_later
-config LIBC_UCLIBC_V_0_9_32
- bool
- prompt "0.9.32"
- select LIBC_UCLIBC_0_9_32_or_later
-
-config LIBC_UCLIBC_V_0_9_31
- bool
- prompt "0.9.31"
- select LIBC_UCLIBC_0_9_30_or_later
-
-config LIBC_UCLIBC_V_0_9_30_3
- bool
- prompt "0.9.30.3"
- select LIBC_UCLIBC_0_9_30_or_later
-
-config LIBC_UCLIBC_V_0_9_30_2
- bool
- prompt "0.9.30.2"
- select LIBC_UCLIBC_0_9_30_or_later
-
-config LIBC_UCLIBC_V_0_9_30_1
- bool
- prompt "0.9.30.1"
- select LIBC_UCLIBC_0_9_30_or_later
-
-config LIBC_UCLIBC_V_0_9_30
+config LIBC_UCLIBC_V_0_9_33_2
bool
- prompt "0.9.30"
- select LIBC_UCLIBC_0_9_30_or_later
+ prompt "0.9.33.2"
+ select LIBC_UCLIBC_0_9_33_2_or_later
config LIBC_UCLIBC_CUSTOM
bool
prompt "Custom uClibc"
depends on EXPERIMENTAL
- select LIBC_SUPPORT_THREADS_NATIVE
- select LIBC_UCLIBC_0_9_30_or_later
+ select LIBC_UCLIBC_0_9_33_2_or_later
endchoice
@@ -101,30 +60,29 @@ config LIBC_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
+ default "1.0.8" if LIBC_UCLIBC_NG_V_1_0_8
default "0.9.33.2" if LIBC_UCLIBC_V_0_9_33_2
- default "0.9.33.1" if LIBC_UCLIBC_V_0_9_33_1
- default "0.9.33" if LIBC_UCLIBC_V_0_9_33
- default "0.9.32.1" if LIBC_UCLIBC_V_0_9_32_1
- default "0.9.32" if LIBC_UCLIBC_V_0_9_32
- default "0.9.31" if LIBC_UCLIBC_V_0_9_31
- default "0.9.30.3" if LIBC_UCLIBC_V_0_9_30_3
- default "0.9.30.2" if LIBC_UCLIBC_V_0_9_30_2
- default "0.9.30.1" if LIBC_UCLIBC_V_0_9_30_1
- default "0.9.30" if LIBC_UCLIBC_V_0_9_30
- default "custom" if LIBC_UCLIBC_CUSTOM
-
-config LIBC_UCLIBC_0_9_32_or_later
+
+config LIBC_UCLIBC_NG_1_0_8_or_later
bool
- select LIBC_SUPPORT_THREADS_NATIVE
- select LIBC_UCLIBC_0_9_30_or_later
+ select LIBC_UCLIBC_NG_1_0_0_or_later
+
+config LIBC_UCLIBC_NG_1_0_0_or_later
+ bool
+ select LIBC_UCLIBC_NG
+ select LIBC_UCLIBC_0_9_33_2_or_later
-config LIBC_UCLIBC_0_9_30_or_later
+config LIBC_UCLIBC_0_9_33_2_or_later
bool
+ select LIBC_SUPPORT_THREADS_NATIVE
select LIBC_UCLIBC_PARALLEL
config LIBC_UCLIBC_PARALLEL
bool
+config LIBC_UCLIBC_NG
+ bool
+
choice
bool
prompt "uClibc verbosity:"
@@ -191,5 +149,5 @@ config LIBC_UCLIBC_CONFIG_FILE
default ""
help
Path to the configuration file.
-
- You _must_ provide one (for now).
+
+ If the file is not provided, we fall back to a default config file.
diff --git a/config/libc/uClibc.in.2 b/config/libc/uClibc.in.2
index 6660c43..1e33db4 100644
--- a/config/libc/uClibc.in.2
+++ b/config/libc/uClibc.in.2
@@ -50,6 +50,7 @@ config LIBC_UCLIBC_LOCALES_PREGEN_DATA
bool
prompt "Use pregen locales"
depends on LIBC_UCLIBC_LOCALES
+ depends on ! LIBC_UCLIBC_NG
default y
help
If you see issues with using pre-generated locales data,
diff --git a/contrib/uClibc-defconfigs/uClibc-ng.config b/contrib/uClibc-defconfigs/uClibc-ng.config
new file mode 100644
index 0000000..c17603d
--- /dev/null
+++ b/contrib/uClibc-defconfigs/uClibc-ng.config
@@ -0,0 +1,41 @@
+DO_C99_MATH=y
+KERNEL_HEADERS="/usr/src/linux/include"
+# LDSO_CACHE_SUPPORT is not set
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+LDSO_RUNPATH_OF_EXECUTABLE=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_HAS_OBSTACK=y
+UCLIBC_HAS_UTMPX=y
+UCLIBC_HAS_UTMP=y
+UCLIBC_SUSV2_LEGACY=y
+UCLIBC_SUSV3_LEGACY=y
+UCLIBC_HAS_CONTEXT_FUNCS=y
+UCLIBC_SUSV4_LEGACY=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS_GETPT=y
+UCLIBC_HAS_LIBUTIL=y
+UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_RESOLVER_SUPPORT=y
+UCLIBC_HAS_LIBRESOLV_STUB=y
+UCLIBC_HAS_LIBNSL_STUB=y
+UCLIBC_HAS_CTYPE_CHECKED=y
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+# UCLIBC_HAS_REGEX_OLD is not set
+# UCLIBC_HAS_FNMATCH_OLD is not set
+UCLIBC_HAS_NFTW=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_GNU_GLOB=y
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="/usr/"
+UCLIBC_HAS_SSP=y
+UCLIBC_BUILD_NOW=y
+# DOSTRIP is not set
diff --git a/samples/arm-unknown-linux-uclibcgnueabihf/uClibc-0.9.33.2.config b/contrib/uClibc-defconfigs/uClibc.config
index a39720c..104eb5c 100644
--- a/samples/arm-unknown-linux-uclibcgnueabihf/uClibc-0.9.33.2.config
+++ b/contrib/uClibc-defconfigs/uClibc.config
@@ -1,12 +1,12 @@
#
# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Fri Sep 5 12:29:57 2014
+# Version: 0.9.32-git
+# Fri Jul 9 22:31:59 2010
#
# TARGET_alpha is not set
-TARGET_arm=y
-
-# TARGET_c6x is not set
+# TARGET_arm is not set
+# TARGET_avr32 is not set
+# TARGET_bfin is not set
# TARGET_cris is not set
# TARGET_e1 is not set
# TARGET_frv is not set
@@ -28,24 +28,43 @@ TARGET_arm=y
# TARGET_vax is not set
# TARGET_x86_64 is not set
# TARGET_xtensa is not set
+# TARGET_c6x is not set
+
+# CONFIG_GENERIC_ARM is not set
+# CONFIG_ARM610 is not set
+# CONFIG_ARM710 is not set
+# CONFIG_ARM7TDMI is not set
+# CONFIG_ARM720T is not set
+# CONFIG_ARM920T is not set
+# CONFIG_ARM922T is not set
+# CONFIG_ARM926T is not set
+# CONFIG_ARM10T is not set
+# CONFIG_ARM1136JF_S is not set
+# CONFIG_ARM1176JZ_S is not set
+# CONFIG_ARM1176JZF_S is not set
+# CONFIG_ARM_CORTEX_M3 is not set
+# CONFIG_ARM_CORTEX_M1 is not set
+# CONFIG_ARM_SA110 is not set
+# CONFIG_ARM_SA1100 is not set
+# CONFIG_ARM_XSCALE is not set
+# CONFIG_ARM_IWMMXT is not set
+
+# COMPILE_IN_THUMB_MODE is not set
+USE_BX=y
+TARGET_SUBARCH=""
#
# Target Architecture Features and Options
#
-TARGET_ARCH="arm"
+TARGET_ARCH="none"
FORCE_OPTIONS_FOR_ARCH=y
-CONFIG_ARM_EABI=y
-# COMPILE_IN_THUMB_MODE is not set
-USE_BX=y
-TARGET_SUBARCH=""
-
#
# Using ELF file format
#
-ARCH_ANY_ENDIAN=y
-ARCH_LITTLE_ENDIAN=y
+# ARCH_LITTLE_ENDIAN is not set
+# ARCH_BIG_ENDIAN is not set
+# ARCH_WANTS_LITTLE_ENDIAN is not set
# ARCH_WANTS_BIG_ENDIAN is not set
-ARCH_WANTS_LITTLE_ENDIAN=y
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
@@ -53,14 +72,17 @@ UCLIBC_HAS_FPU=y
DO_C99_MATH=y
# DO_XSI_MATH is not set
# UCLIBC_HAS_FENV is not set
-KERNEL_HEADERS="/usr/include"
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+KERNEL_HEADERS="/usr/src/linux/include"
HAVE_DOT_CONFIG=y
#
# General Library Settings
#
+# HAVE_NO_PIC is not set
DOPIC=y
-HAVE_SHARED=y
+# ARCH_HAS_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
LDSO_LDD_SUPPORT=y
# LDSO_CACHE_SUPPORT is not set
@@ -76,12 +98,11 @@ LDSO_LD_LIBRARY_PATH=y
UCLIBC_CTOR_DTOR=y
# LDSO_GNU_HASH_SUPPORT is not set
# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
+LINUXTHREADS_OLD=y
# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
+# UCLIBC_HAS_THREADS_NATIVE is not set
UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-PTHREADS_DEBUG_SUPPORT=y
+# PTHREADS_DEBUG_SUPPORT is not set
UCLIBC_HAS_SYSLOG=y
UCLIBC_HAS_LFS=y
# MALLOC is not set
@@ -143,6 +164,8 @@ UCLIBC_HAS_SOCKET=y
UCLIBC_HAS_IPV4=y
# UCLIBC_HAS_IPV6 is not set
# UCLIBC_HAS_RPC is not set
+# UCLIBC_HAS_FULL_RPC is not set
+# UCLIBC_HAS_REENTRANT_RPC is not set
UCLIBC_USE_NETLINK=y
UCLIBC_SUPPORT_AI_ADDRCONFIG=y
# UCLIBC_HAS_BSD_RES_CLOSE is not set
@@ -155,7 +178,7 @@ UCLIBC_HAS_LIBNSL_STUB=y
#
# String and Stdio Support
#
-# UCLIBC_HAS_STRING_GENERIC_OPT is not set
+UCLIBC_HAS_STRING_GENERIC_OPT=y
UCLIBC_HAS_STRING_ARCH_OPT=y
UCLIBC_HAS_CTYPE_TABLES=y
UCLIBC_HAS_CTYPE_SIGNED=y
@@ -165,6 +188,7 @@ UCLIBC_HAS_CTYPE_CHECKED=y
# UCLIBC_HAS_WCHAR is not set
# UCLIBC_HAS_LOCALE is not set
UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set
UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
# USE_OLD_VFPRINTF is not set
UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
@@ -180,8 +204,8 @@ UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-# UCLIBC_HAS_STDIO_GETC_MACRO is not set
-# UCLIBC_HAS_STDIO_PUTC_MACRO is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
@@ -193,8 +217,7 @@ UCLIBC_HAS_ERRNO_MESSAGES=y
UCLIBC_HAS_SIGNUM_MESSAGES=y
# UCLIBC_HAS_SYS_SIGLIST is not set
UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-# UCLIBC_HAS_GNU_GETSUBOPT is not set
+UCLIBC_HAS_GNU_GETSUBOPT=y
#
# Big and Tall
@@ -224,6 +247,7 @@ HARDWIRED_ABSPATH=y
#
# UCLIBC_BUILD_PIE is not set
# UCLIBC_HAS_ARC4RANDOM is not set
+# HAVE_NO_SSP is not set
UCLIBC_HAS_SSP=y
# UCLIBC_HAS_SSP_COMPAT is not set
# SSP_QUICK_CANARY is not set
@@ -235,11 +259,12 @@ UCLIBC_BUILD_NOW=y
UCLIBC_BUILD_NOEXECSTACK=y
#
-# Development/debugging options
+# uClibc development/debugging options
#
CROSS_COMPILER_PREFIX=""
UCLIBC_EXTRA_CFLAGS=""
# DODEBUG is not set
+# DODEBUG_PT is not set
# DOSTRIP is not set
# DOASSERTS is not set
# SUPPORT_LD_DEBUG is not set
diff --git a/kconfig/confdata.c b/kconfig/confdata.c
index c814f57..0b7dc2f 100644
--- a/kconfig/confdata.c
+++ b/kconfig/confdata.c
@@ -268,8 +268,7 @@ int conf_read_simple(const char *name, int def)
goto load;
sym_add_change_count(1);
if (!sym_defconfig_list) {
- if (modules_sym)
- sym_calc_value(modules_sym);
+ sym_calc_value(modules_sym);
return 1;
}
@@ -404,9 +403,7 @@ setsym:
}
free(line);
fclose(in);
-
- if (modules_sym)
- sym_calc_value(modules_sym);
+ sym_calc_value(modules_sym);
return 0;
}
diff --git a/kconfig/expr.c b/kconfig/expr.c
index 667d1aa..cbf4996 100644
--- a/kconfig/expr.c
+++ b/kconfig/expr.c
@@ -1113,7 +1113,7 @@ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *
fn(data, e->left.sym, e->left.sym->name);
else
fn(data, NULL, "<choice>");
- fn(data, NULL, e->type == E_LEQ ? ">=" : ">");
+ fn(data, NULL, e->type == E_GEQ ? ">=" : ">");
fn(data, e->right.sym, e->right.sym->name);
break;
case E_UNEQUAL:
diff --git a/kconfig/symbol.c b/kconfig/symbol.c
index 70c5ee1..25cf0c2 100644
--- a/kconfig/symbol.c
+++ b/kconfig/symbol.c
@@ -467,8 +467,7 @@ void sym_clear_all_valid(void)
for_all_symbols(i, sym)
sym->flags &= ~SYMBOL_VALID;
sym_add_change_count(1);
- if (modules_sym)
- sym_calc_value(modules_sym);
+ sym_calc_value(modules_sym);
}
bool sym_tristate_within_range(struct symbol *sym, tristate val)
@@ -1117,6 +1116,8 @@ static void sym_check_print_recursive(struct symbol *last_sym)
if (stack->sym == last_sym)
fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
prop->file->name, prop->lineno);
+ fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
+ fprintf(stderr, "subsection \"Kconfig recursive dependency limitations\"\n");
if (stack->expr) {
fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
prop->file->name, prop->lineno,
diff --git a/kconfig/zconf.gperf b/kconfig/zconf.gperf
index b6ac02d..ac498f0 100644
--- a/kconfig/zconf.gperf
+++ b/kconfig/zconf.gperf
@@ -22,6 +22,7 @@ comment, T_COMMENT, TF_COMMAND
config, T_CONFIG, TF_COMMAND
menuconfig, T_MENUCONFIG, TF_COMMAND
help, T_HELP, TF_COMMAND
+---help---, T_HELP, TF_COMMAND
if, T_IF, TF_COMMAND|TF_PARAM
endif, T_ENDIF, TF_COMMAND
depends, T_DEPENDS, TF_COMMAND
diff --git a/kconfig/zconf.l b/kconfig/zconf.l
index 200a3fe..c410d25 100644
--- a/kconfig/zconf.l
+++ b/kconfig/zconf.l
@@ -66,9 +66,16 @@ static void alloc_string(const char *str, int size)
memcpy(text, str, size);
text[size] = 0;
}
+
+static void warn_ignored_character(char chr)
+{
+ fprintf(stderr,
+ "%s:%d:warning: ignoring unsupported character '%c'\n",
+ zconf_curname(), zconf_lineno(), chr);
+}
%}
-n [A-Za-z0-9_]
+n [A-Za-z0-9_-]
%%
int str = 0;
@@ -106,7 +113,7 @@ n [A-Za-z0-9_]
zconflval.string = text;
return T_WORD;
}
- .
+ . warn_ignored_character(*yytext);
\n {
BEGIN(INITIAL);
current_file->lineno++;
@@ -132,8 +139,7 @@ n [A-Za-z0-9_]
BEGIN(STRING);
}
\n BEGIN(INITIAL); current_file->lineno++; return T_EOL;
- --- /* ignore */
- ({n}|[-/.])+ {
+ ({n}|[/.])+ {
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
if (id && id->flags & TF_PARAM) {
zconflval.id = id;
@@ -146,11 +152,7 @@ n [A-Za-z0-9_]
#.* /* comment */
\\\n current_file->lineno++;
[[:blank:]]+
- . {
- fprintf(stderr,
- "%s:%d:warning: ignoring unsupported character '%c'\n",
- zconf_curname(), zconf_lineno(), *yytext);
- }
+ . warn_ignored_character(*yytext);
<<EOF>> {
BEGIN(INITIAL);
}
diff --git a/patches/gcc/4.8.4/001_gcc_bug_62231.patch b/patches/gcc/4.8.5/001_gcc_bug_62231.patch
index e7c9cf9..e7c9cf9 100644
--- a/patches/gcc/4.8.4/001_gcc_bug_62231.patch
+++ b/patches/gcc/4.8.5/001_gcc_bug_62231.patch
diff --git a/patches/gcc/4.8.4/002_gcc_bug_62231.patch b/patches/gcc/4.8.5/002_gcc_bug_62231.patch
index b970ebc..b970ebc 100644
--- a/patches/gcc/4.8.4/002_gcc_bug_62231.patch
+++ b/patches/gcc/4.8.5/002_gcc_bug_62231.patch
diff --git a/patches/gcc/4.8.5/100-uclibc-conf.patch b/patches/gcc/4.8.5/100-uclibc-conf.patch
new file mode 100644
index 0000000..d56bf0a
--- /dev/null
+++ b/patches/gcc/4.8.5/100-uclibc-conf.patch
@@ -0,0 +1,15 @@
+Index: gcc-4.8.0/contrib/regression/objs-gcc.sh
+===================================================================
+--- gcc-4.8.0.orig/contrib/regression/objs-gcc.sh 2009-04-09 17:00:19.000000000 +0200
++++ gcc-4.8.0/contrib/regression/objs-gcc.sh 2013-03-23 17:39:04.000000000 +0100
+@@ -106,6 +106,10 @@
+ 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
diff --git a/patches/gcc/4.8.5/1000-powerpc-link-with-math-lib.patch.conditional b/patches/gcc/4.8.5/1000-powerpc-link-with-math-lib.patch.conditional
new file mode 100644
index 0000000..b7094fe
--- /dev/null
+++ b/patches/gcc/4.8.5/1000-powerpc-link-with-math-lib.patch.conditional
@@ -0,0 +1,122 @@
+http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
+
+On glibc the libc.so carries a copy of the math function copysignl() but
+on uClibc math functions like copysignl() live in libm. Since libgcc_s
+contains unresolved symbols, any attempt to link against libgcc_s
+without explicitely specifying -lm fails, resulting in a broken
+bootstrap of the compiler.
+
+Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+---
+ libgcc/Makefile.in | 4 +++-
+ libgcc/configure | 32 ++++++++++++++++++++++++++++++++
+ libgcc/configure.ac | 21 +++++++++++++++++++++
+ 3 files changed, 56 insertions(+), 1 deletion(-)
+
+Index: gcc-4.8.0/libgcc/Makefile.in
+===================================================================
+--- gcc-4.8.0.orig/libgcc/Makefile.in 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.0/libgcc/Makefile.in 2013-03-24 09:12:43.000000000 +0100
+@@ -41,6 +41,7 @@
+ decimal_float = @decimal_float@
+ enable_decimal_float = @enable_decimal_float@
+ fixed_point = @fixed_point@
++LIBGCC_LIBM = @LIBGCC_LIBM@
+
+ host_noncanonical = @host_noncanonical@
+ target_noncanonical = @target_noncanonical@
+@@ -927,9 +928,10 @@
+ @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_objs@,$(objects) libgcc.a,$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
++ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
+ @shlib_map_file@,$(mapfile),$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
++ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
+
+ libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
+ # @multilib_flags@ is still needed because this may use
+Index: gcc-4.8.0/libgcc/configure
+===================================================================
+--- gcc-4.8.0.orig/libgcc/configure 2012-11-05 00:08:42.000000000 +0100
++++ gcc-4.8.0/libgcc/configure 2013-03-24 09:12:43.000000000 +0100
+@@ -564,6 +564,7 @@
+ tmake_file
+ sfp_machine_header
+ set_use_emutls
++LIBGCC_LIBM
+ set_have_cc_tls
+ vis_hide
+ fixed_point
+@@ -4481,6 +4482,37 @@
+ fi
+ fi
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++echo "$as_me:$LINENO: checking for library containing copysignl" >&5
++echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
++if test "${libgcc_cv_copysignl_lib+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++
++fi
++echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
++echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
+
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+Index: gcc-4.8.0/libgcc/configure.ac
+===================================================================
+--- gcc-4.8.0.orig/libgcc/configure.ac 2012-10-15 15:10:30.000000000 +0200
++++ gcc-4.8.0/libgcc/configure.ac 2013-03-24 09:12:43.000000000 +0100
+@@ -326,6 +326,27 @@
+ fi
+ AC_SUBST(set_have_cc_tls)
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++AC_CACHE_CHECK
++ libgcc_cv_copysignl_lib,
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++ ])
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++AC_SUBST(LIBGCC_LIBM)
++
+ # See if we have emulated thread-local storage.
+ GCC_CHECK_EMUTLS
+ set_use_emutls=
diff --git a/patches/gcc/4.8.5/111-pr65730.patch b/patches/gcc/4.8.5/111-pr65730.patch
new file mode 100644
index 0000000..f195e30
--- /dev/null
+++ b/patches/gcc/4.8.5/111-pr65730.patch
@@ -0,0 +1,37 @@
+From b9a7775674d91c7af8043a83211ffeaa576327d7 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Fri, 10 Apr 2015 17:46:30 +0300
+Subject: [PATCH] Fix PR target/65730
+
+2015-05-20 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (init_alignment_context): Replace MULT
+ by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT).
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223452
+Changes to ChangeLog are dropped.
+
+ gcc/config/xtensa/xtensa.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index eb039ba..7296e36 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem)
+ if (ac->shift != NULL_RTX)
+ {
+ /* Shift is the byte count, but we need the bitcount. */
+- ac->shift = expand_simple_binop (SImode, MULT, ac->shift,
+- GEN_INT (BITS_PER_UNIT),
++ gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0);
++ ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift,
++ GEN_INT (exact_log2 (BITS_PER_UNIT)),
+ NULL_RTX, 1, OPTAB_DIRECT);
+ ac->modemask = expand_simple_binop (SImode, ASHIFT,
+ GEN_INT (GET_MODE_MASK (mode)),
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.8.5/301-missing-execinfo_h.patch b/patches/gcc/4.8.5/301-missing-execinfo_h.patch
new file mode 100644
index 0000000..00efda2
--- /dev/null
+++ b/patches/gcc/4.8.5/301-missing-execinfo_h.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.8.0/boehm-gc/include/gc.h
+===================================================================
+--- gcc-4.8.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
++++ gcc-4.8.0/boehm-gc/include/gc.h 2013-03-23 17:39:20.000000000 +0100
+@@ -503,7 +503,7 @@
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/patches/gcc/4.8.5/305-libmudflap-susv3-legacy.patch b/patches/gcc/4.8.5/305-libmudflap-susv3-legacy.patch
new file mode 100644
index 0000000..35d5f50
--- /dev/null
+++ b/patches/gcc/4.8.5/305-libmudflap-susv3-legacy.patch
@@ -0,0 +1,49 @@
+Index: gcc-4.8.0/libmudflap/mf-hooks2.c
+===================================================================
+--- gcc-4.8.0.orig/libmudflap/mf-hooks2.c 2013-02-03 18:48:05.000000000 +0100
++++ gcc-4.8.0/libmudflap/mf-hooks2.c 2013-03-23 17:39:43.000000000 +0100
+@@ -424,7 +424,7 @@
+ {
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+- bzero (s, n);
++ memset (s, 0, n);
+ }
+
+
+@@ -434,7 +434,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+ MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+- bcopy (src, dest, n);
++ memmove (dest, src, n);
+ }
+
+
+@@ -444,7 +444,7 @@
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+ MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+- return bcmp (s1, s2, n);
++ return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+
+
+@@ -453,7 +453,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+- return index (s, c);
++ return strchr (s, c);
+ }
+
+
+@@ -462,7 +462,7 @@
+ size_t n = strlen (s);
+ TRACE ("%s\n", __PRETTY_FUNCTION__);
+ MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+- return rindex (s, c);
++ return strrchr (s, c);
+ }
+
+ /* XXX: stpcpy, memccpy */
diff --git a/patches/gcc/4.8.5/810-arm-softfloat-libgcc.patch b/patches/gcc/4.8.5/810-arm-softfloat-libgcc.patch
new file mode 100644
index 0000000..c8cb377
--- /dev/null
+++ b/patches/gcc/4.8.5/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,30 @@
+Index: gcc-4.8.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.8.0.orig/gcc/config/arm/linux-elf.h 2013-01-10 21:38:27.000000000 +0100
++++ gcc-4.8.0/gcc/config/arm/linux-elf.h 2013-03-23 17:40:00.000000000 +0100
+@@ -55,7 +55,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+Index: gcc-4.8.0/libgcc/config/arm/t-linux
+===================================================================
+--- gcc-4.8.0.orig/libgcc/config/arm/t-linux 2012-03-22 16:14:46.000000000 +0100
++++ gcc-4.8.0/libgcc/config/arm/t-linux 2013-03-23 17:40:54.000000000 +0100
+@@ -1,6 +1,11 @@
+ LIB1ASMSRC = arm/lib1funcs.S
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++ _arm_fixsfsi _arm_fixunssfsi
+
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference.
diff --git a/patches/gcc/4.8.5/830-arm_unbreak_armv4t.patch b/patches/gcc/4.8.5/830-arm_unbreak_armv4t.patch
new file mode 100644
index 0000000..37f8f2a
--- /dev/null
+++ b/patches/gcc/4.8.5/830-arm_unbreak_armv4t.patch
@@ -0,0 +1,13 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -45,7 +45,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
diff --git a/patches/gcc/4.8.4/003-PR57717-E500v2.patch b/patches/gcc/4.8.5/841-PR57717-E500v2.patch
index 723c710..a011e24 100644
--- a/patches/gcc/4.8.4/003-PR57717-E500v2.patch
+++ b/patches/gcc/4.8.5/841-PR57717-E500v2.patch
@@ -2,13 +2,15 @@ This backports fix from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57717
Upstream-Status: Backport
Signed-off-by: Julian Brown <Julian_Brown@mentor.com>
+[Gustavo: Update for gcc 4.8.3]
fix for PR57717 (PowerPC E500v2)
http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00668.html
---- a/gcc/config/rs6000/rs6000.c 2013-05-09 20:54:06.000000000 -0500
-+++ b/gcc/config/rs6000/rs6000.c 2013-08-28 01:25:24.865218744 -0500
-@@ -7385,9 +7385,7 @@
+diff -Nura gcc-4.8.3/gcc/config/rs6000/rs6000.c gcc-4.8.3-pr57717/gcc/config/rs6000/rs6000.c
+--- gcc-4.8.3/gcc/config/rs6000/rs6000.c 2014-05-04 23:18:35.000000000 -0300
++++ gcc-4.8.3-pr57717/gcc/config/rs6000/rs6000.c 2014-05-22 15:20:12.554270919 -0300
+@@ -7343,9 +7343,7 @@
&& GET_CODE (XEXP (x, 1)) == CONST_INT
&& reg_offset_p
&& !SPE_VECTOR_MODE (mode)
diff --git a/patches/gcc/4.8.5/842-PR60155.patch b/patches/gcc/4.8.5/842-PR60155.patch
new file mode 100644
index 0000000..7bc2122
--- /dev/null
+++ b/patches/gcc/4.8.5/842-PR60155.patch
@@ -0,0 +1,111 @@
+From gcc bugzilla https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60155
+Upstream status: in trunk.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+--- trunk/gcc/gcse.c 2014/02/12 14:50:06 207726
++++ trunk/gcc/gcse.c 2014/04/04 22:25:51 209134
+@@ -2502,6 +2502,65 @@
+ }
+ }
+
++struct set_data
++{
++ rtx insn;
++ const_rtx set;
++ int nsets;
++};
++
++/* Increment number of sets and record set in DATA. */
++
++static void
++record_set_data (rtx dest, const_rtx set, void *data)
++{
++ struct set_data *s = (struct set_data *)data;
++
++ if (GET_CODE (set) == SET)
++ {
++ /* We allow insns having multiple sets, where all but one are
++ dead as single set insns. In the common case only a single
++ set is present, so we want to avoid checking for REG_UNUSED
++ notes unless necessary. */
++ if (s->nsets == 1
++ && find_reg_note (s->insn, REG_UNUSED, SET_DEST (s->set))
++ && !side_effects_p (s->set))
++ s->nsets = 0;
++
++ if (!s->nsets)
++ {
++ /* Record this set. */
++ s->nsets += 1;
++ s->set = set;
++ }
++ else if (!find_reg_note (s->insn, REG_UNUSED, dest)
++ || side_effects_p (set))
++ s->nsets += 1;
++ }
++}
++
++static const_rtx
++single_set_gcse (rtx insn)
++{
++ struct set_data s;
++ rtx pattern;
++
++ gcc_assert (INSN_P (insn));
++
++ /* Optimize common case. */
++ pattern = PATTERN (insn);
++ if (GET_CODE (pattern) == SET)
++ return pattern;
++
++ s.insn = insn;
++ s.nsets = 0;
++ note_stores (pattern, record_set_data, &s);
++
++ /* Considered invariant insns have exactly one set. */
++ gcc_assert (s.nsets == 1);
++ return s.set;
++}
++
+ /* Emit move from SRC to DEST noting the equivalence with expression computed
+ in INSN. */
+
+@@ -2509,7 +2568,8 @@
+ gcse_emit_move_after (rtx dest, rtx src, rtx insn)
+ {
+ rtx new_rtx;
+- rtx set = single_set (insn), set2;
++ const_rtx set = single_set_gcse (insn);
++ rtx set2;
+ rtx note;
+ rtx eqv = NULL_RTX;
+
+@@ -3369,13 +3429,12 @@
+ FOR_EACH_VEC_ELT (occrs_to_hoist, j, occr)
+ {
+ rtx insn;
+- rtx set;
++ const_rtx set;
+
+ gcc_assert (!occr->deleted_p);
+
+ insn = occr->insn;
+- set = single_set (insn);
+- gcc_assert (set);
++ set = single_set_gcse (insn);
+
+ /* Create a pseudo-reg to store the result of reaching
+ expressions into. Get the mode for the new pseudo
+@@ -3456,10 +3515,8 @@
+ {
+ rtx reg;
+ enum reg_class pressure_class;
+- rtx set = single_set (insn);
++ const_rtx set = single_set_gcse (insn);
+
+- /* Considered invariant insns have only one set. */
+- gcc_assert (set != NULL_RTX);
+ reg = SET_DEST (set);
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
diff --git a/patches/gcc/4.8.5/843-aarch64-vmlaq_lane_s32-typo.patch b/patches/gcc/4.8.5/843-aarch64-vmlaq_lane_s32-typo.patch
new file mode 100644
index 0000000..afa650c
--- /dev/null
+++ b/patches/gcc/4.8.5/843-aarch64-vmlaq_lane_s32-typo.patch
@@ -0,0 +1,24 @@
+From 845478644ba54a6947e9b224f2e5cd342e8257a9 Mon Sep 17 00:00:00 2001
+From: Andrew Hsieh <andrewhsieh@google.com>
+Date: Wed, 25 Jun 2014 22:13:48 -0700
+Subject: [PATCH] Fix a typo in vmlaq_lane_s32
+
+BUG=15526898
+
+Change-Id: I4e35a764d369d378808dab29beefe34d1f93249b
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+
+diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h
+index 73c7e7d..92b0119 100644
+--- a/gcc/config/aarch64/arm_neon.h
++++ b/gcc/config/aarch64/arm_neon.h
+@@ -9984,7 +9984,7 @@
+ #define vmlaq_lane_s32(a, b, c, d) \
+ __extension__ \
+ ({ \
+- int32x4_t c_ = (c); \
++ int32x2_t c_ = (c); \
+ int32x4_t b_ = (b); \
+ int32x4_t a_ = (a); \
+ int32x4_t result; \
diff --git a/patches/gcc/4.8.5/850-libstdcxx-uclibc-c99.patch b/patches/gcc/4.8.5/850-libstdcxx-uclibc-c99.patch
new file mode 100644
index 0000000..792976f
--- /dev/null
+++ b/patches/gcc/4.8.5/850-libstdcxx-uclibc-c99.patch
@@ -0,0 +1,273 @@
+Allow C99-depending features of libstdc++ with uClibc
+
+The libstdc++ code is fairly restrictive on how it checks for C99
+compatibility: it requires *complete* C99 support to enable certain
+features. For example, uClibc provides a good number of C99 features,
+but not C99 complex number support. For this reason, libstdc++
+completely disables many the standard C++ methods that can in fact
+work because uClibc provides the necessary functions.
+
+This patch is similar and highly inspired from
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in
+a way that doesn't involve changing the configure.ac script, as
+autoreconfiguring gcc is complicated. It simply relies on the fact
+that uClibc defines the __UCLIBC__ definition.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/libstdc++-v3/config/locale/generic/c_locale.h
+===================================================================
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -70,7 +70,7 @@
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+ #else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+Index: b/libstdc++-v3/config/locale/gnu/c_locale.h
+===================================================================
+--- a/libstdc++-v3/config/locale/gnu/c_locale.h
++++ b/libstdc++-v3/config/locale/gnu/c_locale.h
+@@ -88,7 +88,7 @@
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+ #else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+Index: b/libstdc++-v3/include/bits/basic_string.h
+===================================================================
+--- a/libstdc++-v3/include/bits/basic_string.h
++++ b/libstdc++-v3/include/bits/basic_string.h
+@@ -2809,7 +2809,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
++#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)) \
+ && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
+
+ #include <ext/string_conversions.h>
+Index: b/libstdc++-v3/include/bits/locale_facets.tcc
+===================================================================
+--- a/libstdc++-v3/include/bits/locale_facets.tcc
++++ b/libstdc++-v3/include/bits/locale_facets.tcc
+@@ -987,7 +987,7 @@
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ // First try a buffer perhaps big enough (most probably sufficient
+ // for non-ios_base::fixed outputs)
+ int __cs_size = __max_digits * 3;
+Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+===================================================================
+--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
++++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+@@ -572,7 +572,7 @@
+ {
+ const locale __loc = __io.getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ // First try a buffer perhaps big enough.
+ int __cs_size = 64;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+Index: b/libstdc++-v3/include/c_compatibility/math.h
+===================================================================
+--- a/libstdc++-v3/include/c_compatibility/math.h
++++ b/libstdc++-v3/include/c_compatibility/math.h
+@@ -56,7 +56,7 @@
+ using std::floor;
+ using std::fmod;
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::fpclassify;
+ using std::isfinite;
+ using std::isinf;
+Index: b/libstdc++-v3/include/c_compatibility/wchar.h
+===================================================================
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -103,7 +103,7 @@
+ using std::wmemset;
+ using std::wcsftime;
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/c_global/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/c_global/cstdlib
++++ b/libstdc++-v3/include/c_global/cstdlib
+@@ -182,7 +182,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef _Exit
+ #undef llabs
+Index: b/libstdc++-v3/include/c_global/cwchar
+===================================================================
+--- a/libstdc++-v3/include/c_global/cwchar
++++ b/libstdc++-v3/include/c_global/cwchar
+@@ -232,7 +232,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef wcstold
+ #undef wcstoll
+@@ -289,7 +289,7 @@
+ using std::vwscanf;
+ #endif
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/c_std/cstdio
+===================================================================
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -139,7 +139,7 @@
+ using ::vsprintf;
+ } // namespace std
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+Index: b/libstdc++-v3/include/c_std/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/c_std/cstdlib
++++ b/libstdc++-v3/include/c_std/cstdlib
+@@ -180,7 +180,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef _Exit
+ #undef llabs
+Index: b/libstdc++-v3/include/c_std/cwchar
+===================================================================
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -228,7 +228,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef wcstold
+ #undef wcstoll
+Index: b/libstdc++-v3/include/ext/vstring.h
+===================================================================
+--- a/libstdc++-v3/include/ext/vstring.h
++++ b/libstdc++-v3/include/ext/vstring.h
+@@ -2571,7 +2571,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
++#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)))
+
+ #include <ext/string_conversions.h>
+
+Index: b/libstdc++-v3/include/tr1/cstdio
+===================================================================
+--- a/libstdc++-v3/include/tr1/cstdio
++++ b/libstdc++-v3/include/tr1/cstdio
+@@ -33,7 +33,7 @@
+
+ #include <cstdio>
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+Index: b/libstdc++-v3/include/tr1/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/tr1/cstdlib
++++ b/libstdc++-v3/include/tr1/cstdlib
+@@ -35,7 +35,7 @@
+
+ #if _GLIBCXX_HOSTED
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+Index: b/libstdc++-v3/include/tr1/cwchar
+===================================================================
+--- a/libstdc++-v3/include/tr1/cwchar
++++ b/libstdc++-v3/include/tr1/cwchar
+@@ -52,7 +52,7 @@
+ using std::vwscanf;
+ #endif
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/tr1/stdlib.h
+===================================================================
+--- a/libstdc++-v3/include/tr1/stdlib.h
++++ b/libstdc++-v3/include/tr1/stdlib.h
+@@ -33,7 +33,7 @@
+
+ #if _GLIBCXX_HOSTED
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ using std::tr1::atoll;
+ using std::tr1::strtoll;
+Index: b/libstdc++-v3/src/c++11/debug.cc
+===================================================================
+--- a/libstdc++-v3/src/c++11/debug.cc
++++ b/libstdc++-v3/src/c++11/debug.cc
+@@ -787,7 +787,7 @@
+ int __n __attribute__ ((__unused__)),
+ const char* __fmt, _Tp __s) const throw ()
+ {
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ std::snprintf(__buf, __n, __fmt, __s);
+ #else
+ std::sprintf(__buf, __fmt, __s);
+Index: b/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- a/libstdc++-v3/include/c_global/cstdio
++++ b/libstdc++-v3/include/c_global/cstdio
+@@ -139,7 +139,7 @@
+ using ::vsprintf;
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/patches/gcc/4.8.5/851-PR-other-56780.patch b/patches/gcc/4.8.5/851-PR-other-56780.patch
new file mode 100644
index 0000000..feb4339
--- /dev/null
+++ b/patches/gcc/4.8.5/851-PR-other-56780.patch
@@ -0,0 +1,244 @@
+From afe990251bd9b3a063f03da31a3b8d139d033bc3 Mon Sep 17 00:00:00 2001
+From: ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 1 Jun 2013 00:20:49 +0000
+Subject: [PATCH] PR other/56780
+
+* libiberty/configure.ac: Move test for --enable-install-libiberty
+outside of the 'with_target_subdir' test so that it actually gets
+run. Add output messages to show the test result.
+* libiberty/configure: Regenerate.
+* libiberty/Makefile.in (install_to_libdir): Place the
+installation of the libiberty library in the same guard as that
+used for the headers to prevent it being installed unless
+requested via --enable-install-libiberty.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199570 138bc75d-0d04-0410-961f-82ee72b054a4
+
+libiberty: fix --enable-install-libiberty flag [PR 56780]
+
+Commit 199570 fixed the --disable-install-libiberty behavior, but it also
+added a bug where the enable path never works because the initial clear
+of target_header_dir wasn't deleted. So we end up initializing properly
+at the top only to reset it at the end all the time.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367 138bc75d-0d04-0410-961f-82ee72b054a4
+
+[Romain
+ squash the two upstream commits
+ Remove the ChangeLog]
+Signed-off-by: Romain Naour <romain.naour@openwide.fr>
+---
+ libiberty/Makefile.in | 24 ++++++++++-----------
+ libiberty/configure | 57 +++++++++++++++++++++++++++-----------------------
+ libiberty/configure.ac | 47 ++++++++++++++++++++++-------------------
+ 3 files changed, 68 insertions(+), 60 deletions(-)
+
+diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
+index f6a3ebd..75ff82d 100644
+--- a/libiberty/Makefile.in
++++ b/libiberty/Makefile.in
+@@ -355,19 +355,19 @@ install-strip: install
+ # since it will be passed the multilib flags.
+ MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
+ install_to_libdir: all
+- ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
+- $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
+- ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n )
+- mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)
+ if test -n "${target_header_dir}"; then \
+- case "${target_header_dir}" in \
+- /*) thd=${target_header_dir};; \
+- *) thd=${includedir}/${target_header_dir};; \
+- esac; \
+- ${mkinstalldirs} $(DESTDIR)$${thd}; \
+- for h in ${INSTALLED_HEADERS}; do \
+- ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
+- done; \
++ ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
++ $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n; \
++ ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ); \
++ mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB); \
++ case "${target_header_dir}" in \
++ /*) thd=${target_header_dir};; \
++ *) thd=${includedir}/${target_header_dir};; \
++ esac; \
++ ${mkinstalldirs} $(DESTDIR)$${thd}; \
++ for h in ${INSTALLED_HEADERS}; do \
++ ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
++ done; \
+ fi
+ @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
+
+diff --git a/libiberty/configure b/libiberty/configure
+index 5367027..4feb95a 100755
+--- a/libiberty/configure
++++ b/libiberty/configure
+@@ -675,8 +675,8 @@ with_cross_host
+ with_newlib
+ enable_maintainer_mode
+ enable_multilib
+-enable_largefile
+ enable_install_libiberty
++enable_largefile
+ '
+ ac_precious_vars='build_alias
+ host_alias
+@@ -1303,8 +1303,8 @@ Optional Features:
+ enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --enable-multilib build many library versions (default)
++ --enable-install-libiberty Install headers and library for end users
+ --disable-largefile omit support for large files
+- --enable-install-libiberty Install headers for end users
+
+ Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+@@ -2784,6 +2784,35 @@ if test $cross_compiling = no && test $multilib = yes \
+ cross_compiling=maybe
+ fi
+
++# We may wish to install the target headers somewhere.
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install libiberty headers and static library" >&5
++$as_echo_n "checking whether to install libiberty headers and static library... " >&6; }
++
++# Check whether --enable-install-libiberty was given.
++if test "${enable_install_libiberty+set}" = set; then :
++ enableval=$enable_install_libiberty; enable_install_libiberty=$enableval
++else
++ enable_install_libiberty=no
++fi
++
++# Option parsed, now set things appropriately.
++case x"$enable_install_libiberty" in
++ xyes|x)
++ target_header_dir=libiberty
++ ;;
++ xno)
++ target_header_dir=
++ ;;
++ *)
++ # This could be sanity-checked in various ways...
++ target_header_dir="${enable_install_libiberty}"
++ ;;
++esac
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_install_libiberty" >&5
++$as_echo "$enable_install_libiberty" >&6; }
++{ $as_echo "$as_me:${as_lineno-$LINENO}: target_header_dir = $target_header_dir" >&5
++$as_echo "$as_me: target_header_dir = $target_header_dir" >&6;}
++
+
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+@@ -5476,7 +5505,6 @@ fi
+
+ setobjs=
+ CHECK=
+-target_header_dir=
+ if test -n "${with_target_subdir}"; then
+
+ # We are being configured as a target library. AC_REPLACE_FUNCS
+@@ -5759,29 +5787,6 @@ _ACEOF
+
+ esac
+
+- # We may wish to install the target headers somewhere.
+- # Check whether --enable-install-libiberty was given.
+-if test "${enable_install_libiberty+set}" = set; then :
+- enableval=$enable_install_libiberty; enable_install_libiberty=$enableval
+-else
+- enable_install_libiberty=no
+-fi
+-
+- # Option parsed, now set things appropriately.
+- case x"$enable_install_libiberty" in
+- xyes|x)
+- target_header_dir=libiberty
+- ;;
+- xno)
+- target_header_dir=
+- ;;
+- *)
+- # This could be sanity-checked in various ways...
+- target_header_dir="${enable_install_libiberty}"
+- ;;
+- esac
+-
+-
+ else
+
+ # Not a target library, so we set things up to run the test suite.
+diff --git a/libiberty/configure.ac b/libiberty/configure.ac
+index c763894..f17e6b6 100644
+--- a/libiberty/configure.ac
++++ b/libiberty/configure.ac
+@@ -128,6 +128,31 @@ if test $cross_compiling = no && test $multilib = yes \
+ cross_compiling=maybe
+ fi
+
++# We may wish to install the target headers somewhere.
++AC_MSG_CHECKING([whether to install libiberty headers and static library])
++dnl install-libiberty is disabled by default
++
++AC_ARG_ENABLE(install-libiberty,
++[ --enable-install-libiberty Install headers and library for end users],
++enable_install_libiberty=$enableval,
++enable_install_libiberty=no)dnl
++
++# Option parsed, now set things appropriately.
++case x"$enable_install_libiberty" in
++ xyes|x)
++ target_header_dir=libiberty
++ ;;
++ xno)
++ target_header_dir=
++ ;;
++ *)
++ # This could be sanity-checked in various ways...
++ target_header_dir="${enable_install_libiberty}"
++ ;;
++esac
++AC_MSG_RESULT($enable_install_libiberty)
++AC_MSG_NOTICE([target_header_dir = $target_header_dir])
++
+ GCC_NO_EXECUTABLES
+ AC_PROG_CC
+ AC_SYS_LARGEFILE
+@@ -380,7 +405,6 @@ fi
+
+ setobjs=
+ CHECK=
+-target_header_dir=
+ if test -n "${with_target_subdir}"; then
+
+ # We are being configured as a target library. AC_REPLACE_FUNCS
+@@ -492,27 +516,6 @@ if test -n "${with_target_subdir}"; then
+
+ esac
+
+- # We may wish to install the target headers somewhere.
+- AC_ARG_ENABLE(install-libiberty,
+- [ --enable-install-libiberty Install headers for end users],
+- enable_install_libiberty=$enableval,
+- enable_install_libiberty=no)dnl
+-
+- # Option parsed, now set things appropriately.
+- case x"$enable_install_libiberty" in
+- xyes|x)
+- target_header_dir=libiberty
+- ;;
+- xno)
+- target_header_dir=
+- ;;
+- *)
+- # This could be sanity-checked in various ways...
+- target_header_dir="${enable_install_libiberty}"
+- ;;
+- esac
+-
+-
+ else
+
+ # Not a target library, so we set things up to run the test suite.
+--
+1.9.3
+
diff --git a/patches/gcc/4.8.5/870-xtensa-add-mauto-litpools-option.patch b/patches/gcc/4.8.5/870-xtensa-add-mauto-litpools-option.patch
new file mode 100644
index 0000000..aa1376c
--- /dev/null
+++ b/patches/gcc/4.8.5/870-xtensa-add-mauto-litpools-option.patch
@@ -0,0 +1,290 @@
+From 6d852ffb43b111a39162135c95249e749c4e285b Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 6 Aug 2015 01:16:02 +0300
+Subject: [PATCH] xtensa: add -mauto-litpools option
+
+With support from assembler this option allows compiling huge functions,
+where single literal pool at the beginning of a function may not be
+reachable by L32R instructions at its end.
+
+Currently assembler --auto-litpools option cannot deal with literals
+used from multiple locations separated by more than 256 KBytes of code.
+Don't turn constants into literals, instead use MOVI instruction to load
+them into registers and let the assembler turn them into literals as
+necessary.
+
+2015-08-12 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/constraints.md (define_constraint "Y"): New
+ constraint.
+ * config/xtensa/elf.h (ASM_SPEC): Add m(no-)auto-litpools.
+ * config/xtensa/linux.h (ASM_SPEC): Likewise.
+ * config/xtensa/predicates.md (move_operand): Match constants
+ and symbols in the presence of TARGET_AUTO_LITPOOLS.
+ * config/xtensa/xtensa.c (xtensa_valid_move): Don't allow
+ immediate references to TLS data.
+ (xtensa_emit_move_sequence): Don't force constants to memory in
+ the presence of TARGET_AUTO_LITPOOLS.
+ (print_operand): Add 'y' format, same as default, but capable of
+ printing SF mode constants as well.
+ * config/xtensa/xtensa.md (movsi_internal, movhi_internal)
+ (movsf_internal): Add movi pattern that loads literal.
+ (movsf, movdf): Don't force constants to memory in the presence
+ of TARGET_AUTO_LITPOOLS.
+ (movdf_internal): Add 'Y' constraint.
+ * config/xtensa/xtensa.opt (mauto-litpools): New option.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226828
+Changes to ChangeLogs and documentation are dropped.
+
+ gcc/config/xtensa/constraints.md | 5 +++++
+ gcc/config/xtensa/elf.h | 4 +++-
+ gcc/config/xtensa/linux.h | 4 +++-
+ gcc/config/xtensa/predicates.md | 3 ++-
+ gcc/config/xtensa/xtensa.c | 19 ++++++++++++++++++-
+ gcc/config/xtensa/xtensa.md | 35 +++++++++++++++++++----------------
+ gcc/config/xtensa/xtensa.opt | 4 ++++
+ 7 files changed, 54 insertions(+), 20 deletions(-)
+
+diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md
+index 30f4c1f..773d4f9 100644
+--- a/gcc/config/xtensa/constraints.md
++++ b/gcc/config/xtensa/constraints.md
+@@ -111,6 +111,11 @@
+ (and (match_code "const_int")
+ (match_test "xtensa_mask_immediate (ival)")))
+
++(define_constraint "Y"
++ "A constant that can be used in relaxed MOVI instructions."
++ (and (match_code "const_int,const_double,const,symbol_ref,label_ref")
++ (match_test "TARGET_AUTO_LITPOOLS")))
++
+ ;; Memory constraints. Do not use define_memory_constraint here. Doing so
+ ;; causes reload to force some constants into the constant pool, but since
+ ;; the Xtensa constant pool can only be accessed with L32R instructions, it
+diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
+index e59bede..12056f7 100644
+--- a/gcc/config/xtensa/elf.h
++++ b/gcc/config/xtensa/elf.h
+@@ -48,7 +48,9 @@ along with GCC; see the file COPYING3. If not see
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+- %{mno-longcalls:--no-longcalls}"
++ %{mno-longcalls:--no-longcalls} \
++ %{mauto-litpools:--auto-litpools} \
++ %{mno-auto-litpools:--no-auto-litpools}"
+
+ #undef LIB_SPEC
+ #define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal"
+diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
+index 675aacf..5b0243a 100644
+--- a/gcc/config/xtensa/linux.h
++++ b/gcc/config/xtensa/linux.h
+@@ -42,7 +42,9 @@ along with GCC; see the file COPYING3. If not see
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+- %{mno-longcalls:--no-longcalls}"
++ %{mno-longcalls:--no-longcalls} \
++ %{mauto-litpools:--auto-litpools} \
++ %{mno-auto-litpools:--no-auto-litpools}"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
+diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md
+index e02209e..d7dfa11 100644
+--- a/gcc/config/xtensa/predicates.md
++++ b/gcc/config/xtensa/predicates.md
+@@ -142,7 +142,8 @@
+ (match_test "GET_MODE_CLASS (mode) == MODE_INT
+ && xtensa_simm12b (INTVAL (op))"))
+ (and (match_code "const_int,const_double,const,symbol_ref,label_ref")
+- (match_test "TARGET_CONST16 && CONSTANT_P (op)
++ (match_test "(TARGET_CONST16 || TARGET_AUTO_LITPOOLS)
++ && CONSTANT_P (op)
+ && GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0")))))
+
+ ;; Accept the floating point constant 1 in the appropriate mode.
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index eb039ba..206ff80 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -501,6 +501,9 @@ xtensa_valid_move (machine_mode mode, rtx *operands)
+ {
+ int dst_regnum = xt_true_regnum (operands[0]);
+
++ if (xtensa_tls_referenced_p (operands[1]))
++ return FALSE;
++
+ /* The stack pointer can only be assigned with a MOVSP opcode. */
+ if (dst_regnum == STACK_POINTER_REGNUM)
+ return !TARGET_WINDOWED_ABI
+@@ -1069,7 +1072,7 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
+ return 1;
+ }
+
+- if (! TARGET_CONST16)
++ if (! TARGET_AUTO_LITPOOLS && ! TARGET_CONST16)
+ {
+ src = force_const_mem (SImode, src);
+ operands[1] = src;
+@@ -2449,6 +2452,20 @@ print_operand (FILE *file, rtx x, int letter)
+ }
+ break;
+
++ case 'y':
++ if (GET_CODE (x) == CONST_DOUBLE &&
++ GET_MODE (x) == SFmode)
++ {
++ REAL_VALUE_TYPE r;
++ long l;
++ REAL_VALUE_FROM_CONST_DOUBLE (r, x);
++ REAL_VALUE_TO_TARGET_SINGLE (r, l);
++ fprintf (file, "0x%08lx", l);
++ break;
++ }
++
++ /* fall through */
++
+ default:
+ if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
+ fprintf (file, "%s", reg_names[xt_true_regnum (x)]);
+diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
+index 6d84384..0e673a3 100644
+--- a/gcc/config/xtensa/xtensa.md
++++ b/gcc/config/xtensa/xtensa.md
+@@ -761,8 +761,8 @@
+ })
+
+ (define_insn "movsi_internal"
+- [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,W,a,a,U,*a,*A")
+- (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,i,T,U,r,*A,*r"))]
++ [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,a,W,a,a,U,*a,*A")
++ (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,Y,i,T,U,r,*A,*r"))]
+ "xtensa_valid_move (SImode, operands)"
+ "@
+ movi.n\t%0, %x1
+@@ -774,15 +774,16 @@
+ mov\t%0, %1
+ movsp\t%0, %1
+ movi\t%0, %x1
++ movi\t%0, %1
+ const16\t%0, %t1\;const16\t%0, %b1
+ %v1l32r\t%0, %1
+ %v1l32i\t%0, %1
+ %v0s32i\t%1, %0
+ rsr\t%0, ACCLO
+ wsr\t%1, ACCLO"
+- [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,load,load,store,rsr,wsr")
++ [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr")
+ (set_attr "mode" "SI")
+- (set_attr "length" "2,2,2,2,2,2,3,3,3,6,3,3,3,3,3")])
++ (set_attr "length" "2,2,2,2,2,2,3,3,3,3,6,3,3,3,3,3")])
+
+ ;; 16-bit Integer moves
+
+@@ -796,21 +797,22 @@
+ })
+
+ (define_insn "movhi_internal"
+- [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
+- (match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
++ [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,a,U,*a,*A")
++ (match_operand:HI 1 "move_operand" "M,d,r,I,Y,U,r,*A,*r"))]
+ "xtensa_valid_move (HImode, operands)"
+ "@
+ movi.n\t%0, %x1
+ mov.n\t%0, %1
+ mov\t%0, %1
+ movi\t%0, %x1
++ movi\t%0, %1
+ %v1l16ui\t%0, %1
+ %v0s16i\t%1, %0
+ rsr\t%0, ACCLO
+ wsr\t%1, ACCLO"
+- [(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
++ [(set_attr "type" "move,move,move,move,move,load,store,rsr,wsr")
+ (set_attr "mode" "HI")
+- (set_attr "length" "2,2,3,3,3,3,3,3")])
++ (set_attr "length" "2,2,3,3,3,3,3,3,3")])
+
+ ;; 8-bit Integer moves
+
+@@ -881,7 +883,7 @@
+ (match_operand:SF 1 "general_operand" ""))]
+ ""
+ {
+- if (!TARGET_CONST16 && CONSTANT_P (operands[1]))
++ if (!TARGET_CONST16 && !TARGET_AUTO_LITPOOLS && CONSTANT_P (operands[1]))
+ operands[1] = force_const_mem (SFmode, operands[1]);
+
+ if ((!register_operand (operands[0], SFmode)
+@@ -896,8 +898,8 @@
+ })
+
+ (define_insn "movsf_internal"
+- [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,W,a,a,U")
+- (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,iF,T,U,r"))]
++ [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,a,W,a,a,U")
++ (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,Y,iF,T,U,r"))]
+ "((register_operand (operands[0], SFmode)
+ || register_operand (operands[1], SFmode))
+ && !(FP_REG_P (xt_true_regnum (operands[0]))
+@@ -912,13 +914,14 @@
+ mov\t%0, %1
+ wfr\t%0, %1
+ rfr\t%0, %1
++ movi\t%0, %y1
+ const16\t%0, %t1\;const16\t%0, %b1
+ %v1l32r\t%0, %1
+ %v1l32i\t%0, %1
+ %v0s32i\t%1, %0"
+- [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,load,load,store")
++ [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,move,load,load,store")
+ (set_attr "mode" "SF")
+- (set_attr "length" "3,3,3,2,2,2,3,3,3,6,3,3,3")])
++ (set_attr "length" "3,3,3,2,2,2,3,3,3,3,6,3,3,3")])
+
+ (define_insn "*lsiu"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+@@ -991,7 +994,7 @@
+ (match_operand:DF 1 "general_operand" ""))]
+ ""
+ {
+- if (CONSTANT_P (operands[1]) && !TARGET_CONST16)
++ if (CONSTANT_P (operands[1]) && !TARGET_CONST16 && !TARGET_AUTO_LITPOOLS)
+ operands[1] = force_const_mem (DFmode, operands[1]);
+
+ if (!register_operand (operands[0], DFmode)
+@@ -1002,8 +1005,8 @@
+ })
+
+ (define_insn_and_split "movdf_internal"
+- [(set (match_operand:DF 0 "nonimmed_operand" "=a,W,a,a,U")
+- (match_operand:DF 1 "move_operand" "r,iF,T,U,r"))]
++ [(set (match_operand:DF 0 "nonimmed_operand" "=a,a,W,a,a,U")
++ (match_operand:DF 1 "move_operand" "r,Y,iF,T,U,r"))]
+ "register_operand (operands[0], DFmode)
+ || register_operand (operands[1], DFmode)"
+ "#"
+diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt
+index 2fd6cee..21c6e96 100644
+--- a/gcc/config/xtensa/xtensa.opt
++++ b/gcc/config/xtensa/xtensa.opt
+@@ -38,6 +38,10 @@ mtext-section-literals
+ Target
+ Intersperse literal pools with code in the text section
+
++mauto-litpools
++Target Report Mask(AUTO_LITPOOLS)
++Relax literals in assembler and place them automatically in the text section
++
+ mserialize-volatile
+ Target Report Mask(SERIALIZE_VOLATILE)
+ -mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.8.5/871-xtensa-reimplement-register-spilling.patch b/patches/gcc/4.8.5/871-xtensa-reimplement-register-spilling.patch
new file mode 100644
index 0000000..abc7a08
--- /dev/null
+++ b/patches/gcc/4.8.5/871-xtensa-reimplement-register-spilling.patch
@@ -0,0 +1,76 @@
+From 05154174b369505238b759cf80d595d8cfc8c731 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Mon, 10 Aug 2015 21:35:20 +0300
+Subject: [PATCH 1/3] xtensa: reimplement register spilling
+
+Spilling windowed registers in userspace is much easier, more portable,
+less error-prone and equally effective as in kernel. Now that register
+spilling syscall is considered obsolete in the xtensa linux kernel
+replace it with CALL12 followed by series of ENTRY in libgcc.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/lib2funcs.S (__xtensa_libgcc_window_spill): Use
+ CALL12 followed by series of ENTRY to spill windowed registers.
+ (__xtensa_nonlocal_goto): Call __xtensa_libgcc_window_spill
+ instead of making linux spill syscall.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226962
+
+ libgcc/config/xtensa/lib2funcs.S | 30 +++++++++++++++++++++++-------
+ 1 file changed, 23 insertions(+), 7 deletions(-)
+
+diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S
+index 3ac8c1d..2e678af 100644
+--- a/libgcc/config/xtensa/lib2funcs.S
++++ b/libgcc/config/xtensa/lib2funcs.S
+@@ -33,10 +33,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ .global __xtensa_libgcc_window_spill
+ .type __xtensa_libgcc_window_spill,@function
+ __xtensa_libgcc_window_spill:
+- entry sp, 32
+- movi a2, 0
+- syscall
++ entry sp, 48
++#if XCHAL_NUM_AREGS > 16
++ call12 1f
++ retw
++ .align 4
++1:
++ .rept (XCHAL_NUM_AREGS - 24) / 12
++ _entry sp, 48
++ mov a12, a0
++ .endr
++ _entry sp, 16
++#if XCHAL_NUM_AREGS % 12 == 0
++ mov a4, a4
++#elif XCHAL_NUM_AREGS % 12 == 4
++ mov a8, a8
++#elif XCHAL_NUM_AREGS % 12 == 8
++ mov a12, a12
++#endif
++ retw
++#else
++ mov a8, a8
+ retw
++#endif
+ .size __xtensa_libgcc_window_spill, .-__xtensa_libgcc_window_spill
+
+
+@@ -58,10 +77,7 @@ __xtensa_nonlocal_goto:
+ entry sp, 32
+
+ /* Flush registers. */
+- mov a5, a2
+- movi a2, 0
+- syscall
+- mov a2, a5
++ call8 __xtensa_libgcc_window_spill
+
+ /* Because the save area for a0-a3 is stored one frame below
+ the one identified by a2, the only way to restore those
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.8.5/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch b/patches/gcc/4.8.5/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
new file mode 100644
index 0000000..f23a5c0
--- /dev/null
+++ b/patches/gcc/4.8.5/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
@@ -0,0 +1,33 @@
+From f66206679a0ad604f13673559f230160cd3d1189 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Fri, 14 Aug 2015 02:45:02 +0300
+Subject: [PATCH 2/3] xtensa: use unwind-dw2-fde-dip instead of unwind-dw2-fde
+
+This allows having exception cleanup code in binaries that don't
+register their unwind tables.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/t-xtensa (LIB2ADDEH): Replace unwind-dw2-fde
+ with unwind-dw2-fde-dip.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226963
+
+ libgcc/config/xtensa/t-xtensa | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgcc/config/xtensa/t-xtensa b/libgcc/config/xtensa/t-xtensa
+index 27399e6..66d0eb3 100644
+--- a/libgcc/config/xtensa/t-xtensa
++++ b/libgcc/config/xtensa/t-xtensa
+@@ -13,4 +13,4 @@ LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _udivsi3 _umodsi3 \
+ LIB2ADD = $(srcdir)/config/xtensa/lib2funcs.S
+
+ LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
+- $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++ $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.8.5/873-xtensa-fix-_Unwind_GetCFA.patch b/patches/gcc/4.8.5/873-xtensa-fix-_Unwind_GetCFA.patch
new file mode 100644
index 0000000..dc40513
--- /dev/null
+++ b/patches/gcc/4.8.5/873-xtensa-fix-_Unwind_GetCFA.patch
@@ -0,0 +1,40 @@
+From 15c7c4d39b317f0d902ef28fd43eca5c3369f891 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sat, 15 Aug 2015 05:12:11 +0300
+Subject: [PATCH 3/3] xtensa: fix _Unwind_GetCFA
+
+Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame
+higher than what was actually used by code at context->ra. This results
+in invalid CFA value in signal frames and premature unwinding completion
+in forced unwinding used by uClibc NPTL thread cancellation.
+Returning context->sp from _Unwind_GetCFA makes all CFA values valid and
+matching code that used them.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
+ context->sp instead of context->cfa.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226964
+
+ libgcc/config/xtensa/unwind-dw2-xtensa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c
+index 35f7797..ef6b900 100644
+--- a/libgcc/config/xtensa/unwind-dw2-xtensa.c
++++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c
+@@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
+ _Unwind_Word
+ _Unwind_GetCFA (struct _Unwind_Context *context)
+ {
+- return (_Unwind_Ptr) context->cfa;
++ return (_Unwind_Ptr) context->sp;
+ }
+
+ /* Overwrite the saved value for register INDEX in CONTEXT with VAL. */
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.8.5/900-musl-support.patch b/patches/gcc/4.8.5/900-musl-support.patch
new file mode 100644
index 0000000..6743a88
--- /dev/null
+++ b/patches/gcc/4.8.5/900-musl-support.patch
@@ -0,0 +1,648 @@
+Add musl support to gcc
+
+This patch comes from the musl-cross project at
+https://bitbucket.org/GregorR/musl-cross/src. Compared to the upstream version:
+
+ * the config.sub modifications have been removed, because Buildroot
+ already overwrites all config.sub with a more recent config.sub
+ that has musl support.
+
+ * change to ensure that a dummy dynamic linker path
+ MUSL_DYNAMIC_LINKER<foo> is defined for all architectures,
+ otherwise building gcc for architectures not supported by musl was
+ causing build failure. Bug reported upstream at
+ https://bitbucket.org/GregorR/musl-gcc-patches/issue/4/musl-gcc-patches-break-the-build-on.
+
+ * change the USE_PT_GNU_EH_FRAME logic to keep the existing gcc logic
+ and only add the musl one as an addition, not as a replacement. Not
+ doing this breaks C++ exception handling with glibc, because
+ USE_PT_GNU_EH_FRAME doesn't get defined due to the configure script
+ not testing dl_iterate_phdr() on any system except Solaris.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[Gustavo: Update for gcc 4.8.3]
+
+Index: b/fixincludes/mkfixinc.sh
+===================================================================
+--- a/fixincludes/mkfixinc.sh
++++ b/fixincludes/mkfixinc.sh
+@@ -19,7 +19,8 @@
+ powerpc-*-eabi* | \
+ powerpc-*-rtems* | \
+ powerpcle-*-eabisim* | \
+- powerpcle-*-eabi* )
++ powerpcle-*-eabi* | \
++ *-musl* )
+ # IF there is no include fixing,
+ # THEN create a no-op fixer and exit
+ (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
+Index: b/gcc/config/aarch64/aarch64-linux.h
+===================================================================
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,12 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+
++/* The AArch64 port currently supports two dynamic linkers:
++ - ld-linux-aarch64.so.1 - GLIBC dynamic linker
++ - ld-musl-aarch64.so.1 - musl libc dynamic linker */
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64.so.1"
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1"
+
+ #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
+Index: b/gcc/config/arm/linux-eabi.h
+===================================================================
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -77,6 +77,23 @@
+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+
++/* For ARM musl currently supports four dynamic linkers:
++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
++ musl does not support the legacy OABI mode.
++ All the dynamic linkers live in /lib.
++ We default to soft-float, EL. */
++#undef MUSL_DYNAMIC_LINKER
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
++#endif
++#define MUSL_DYNAMIC_LINKER \
++ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+ #undef LINK_SPEC
+Index: b/gcc/config/i386/linux64.h
+===================================================================
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -30,3 +30,10 @@
+ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++
++#undef MUSL_DYNAMIC_LINKER32
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
++#undef MUSL_DYNAMIC_LINKER64
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
++#undef MUSL_DYNAMIC_LINKERX32
++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
+Index: b/gcc/config/i386/linux.h
+===================================================================
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -21,3 +21,5 @@
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
+Index: b/gcc/config/linux.h
+===================================================================
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -32,10 +32,12 @@
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+ #else
+ #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+ #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
+ #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
+@@ -53,18 +55,21 @@
+ uClibc or Bionic is the default C library and whether
+ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+
+-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
+- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
+
+ #if DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
+ #elif DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
+ #elif DEFAULT_LIBC == LIBC_BIONIC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif /* DEFAULT_LIBC */
+@@ -82,23 +87,32 @@
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+ #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32"
+
++/* Musl dynamic linker paths must be defined on a per-architecture
++ basis, for each architecture supported by Musl. However, in order
++ to let other architectures continue to build with other C
++ libraries, we provide a dummy definition of the following defines. */
++#define MUSL_DYNAMIC_LINKER "invalid"
++#define MUSL_DYNAMIC_LINKER32 "invalid"
++#define MUSL_DYNAMIC_LINKER64 "invalid"
++#define MUSL_DYNAMIC_LINKERX32 "invalid"
++
+ #define GNU_USER_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
+- BIONIC_DYNAMIC_LINKER)
++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+ #define GNU_USER_DYNAMIC_LINKER32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
+- BIONIC_DYNAMIC_LINKER32)
++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
+- BIONIC_DYNAMIC_LINKER64)
++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+ #define GNU_USER_DYNAMIC_LINKERX32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
+- BIONIC_DYNAMIC_LINKERX32)
++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
+
+ /* Determine whether the entire c99 runtime
+ is present in the runtime library. */
+ #undef TARGET_C99_FUNCTIONS
+-#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
++#define TARGET_C99_FUNCTIONS (OPTION_GLIBC || OPTION_MUSL)
+
+ /* Whether we have sincos that follows the GNU extension. */
+ #undef TARGET_HAS_SINCOS
+@@ -107,3 +121,74 @@
+ /* Whether we have Bionic libc runtime */
+ #undef TARGET_HAS_BIONIC
+ #define TARGET_HAS_BIONIC (OPTION_BIONIC)
++
++/* musl avoids problematic includes by rearranging the include directories.
++ * Unfortunately, this is mostly duplicated from cppdefault.c */
++#if DEFAULT_LIBC == LIBC_MUSL
++#define INCLUDE_DEFAULTS_MUSL_GPP \
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
++
++#ifdef LOCAL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_LOCAL \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_LOCAL
++#endif
++
++#ifdef PREFIX_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_PREFIX \
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_PREFIX
++#endif
++
++#ifdef CROSS_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_CROSS \
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#ifdef TOOL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_TOOL \
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_TOOL
++#endif
++
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++#define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_NATIVE
++#endif
++
++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
++# undef INCLUDE_DEFAULTS_MUSL_LOCAL
++# define INCLUDE_DEFAULTS_MUSL_LOCAL
++# undef INCLUDE_DEFAULTS_MUSL_NATIVE
++# define INCLUDE_DEFAULTS_MUSL_NATIVE
++#else
++# undef INCLUDE_DEFAULTS_MUSL_CROSS
++# define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#undef INCLUDE_DEFAULTS
++#define INCLUDE_DEFAULTS \
++ { \
++ INCLUDE_DEFAULTS_MUSL_GPP \
++ INCLUDE_DEFAULTS_MUSL_PREFIX \
++ INCLUDE_DEFAULTS_MUSL_CROSS \
++ INCLUDE_DEFAULTS_MUSL_TOOL \
++ INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
++ { 0, 0, 0, 0, 0, 0 } \
++ }
++#endif
+Index: b/gcc/config/linux.opt
+===================================================================
+--- a/gcc/config/linux.opt
++++ b/gcc/config/linux.opt
+@@ -30,3 +30,7 @@
+ muclibc
+ Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
+ Use uClibc C library
++
++mmusl
++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
++Use musl C library
+Index: b/gcc/config/microblaze/linux.h
+===================================================================
+--- a/gcc/config/microblaze/linux.h
++++ b/gcc/config/microblaze/linux.h
+@@ -25,7 +25,23 @@
+ #undef TLS_NEEDS_GOT
+ #define TLS_NEEDS_GOT 1
+
+-#define DYNAMIC_LINKER "/lib/ld.so.1"
++#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
++#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
++#endif
++
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++
++#if DEFAULT_LIBC == LIBC_MUSL
++#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER
++#else
++#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
++#endif
++
++
+ #undef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+ { "dynamic_linker", DYNAMIC_LINKER }
+Index: b/gcc/config/mips/linux64.h
+===================================================================
+--- a/gcc/config/mips/linux64.h
++++ b/gcc/config/mips/linux64.h
+@@ -29,4 +29,4 @@
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+- BIONIC_DYNAMIC_LINKERN32)
++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKER)
+Index: b/gcc/config/mips/linux.h
+===================================================================
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -18,3 +18,11 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++
++#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
++#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
++#endif
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
+Index: b/gcc/config/rs6000/linux64.h
+===================================================================
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -374,17 +374,23 @@
+ #endif
+ #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#undef MUSL_DYNAMIC_LINKER32
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
++#undef MUSL_DYNAMIC_LINKER64
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER32 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+
+ #undef DEFAULT_ASM_ENDIAN
+ #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+Index: b/gcc/config/rs6000/secureplt.h
+===================================================================
+--- a/gcc/config/rs6000/secureplt.h
++++ b/gcc/config/rs6000/secureplt.h
+@@ -18,3 +18,4 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+Index: b/gcc/config/rs6000/sysv4.h
+===================================================================
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -537,6 +537,9 @@
+ #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
+ #define CC1_SECURE_PLT_DEFAULT_SPEC ""
+ #endif
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
+
+ /* Pass -G xxx to the compiler. */
+ #define CC1_SPEC "%{G*} %(cc1_cpu)" \
+@@ -585,7 +588,8 @@
+
+ /* Override the default target of the linker. */
+ #define LINK_TARGET_SPEC \
+- ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
++ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
++ "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
+
+ /* Any specific OS flags. */
+ #define LINK_OS_SPEC "\
+@@ -763,15 +767,18 @@
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+@@ -894,6 +901,7 @@
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
+Index: b/gcc/config/sh/linux.h
+===================================================================
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -43,7 +43,15 @@
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
++#if TARGET_BIG_ENDIAN_DEFAULT /* BE */
++#define MUSL_DYNAMIC_LINKER_E "eb"
++#else
++#define MUSL_DYNAMIC_LINKER_E
++#endif
++
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E ".so.1"
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+Index: b/gcc/config.gcc
+===================================================================
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -550,7 +550,7 @@
+ esac
+
+ # Common C libraries.
+-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
+
+ # Common parts for widely ported systems.
+ case ${target} in
+@@ -653,6 +653,9 @@
+ *-*-*uclibc*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+ ;;
++ *-*-*musl*)
++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
++ ;;
+ *)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
+ ;;
+@@ -2135,6 +2138,10 @@
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
+Index: b/gcc/configure
+===================================================================
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26936,6 +26940,9 @@
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+Index: b/gcc/configure.ac
+===================================================================
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4848,6 +4852,9 @@
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+ GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+Index: b/gcc/ginclude/stddef.h
+===================================================================
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -181,6 +181,7 @@
+ #ifndef _GCC_SIZE_T
+ #ifndef _SIZET_
+ #ifndef __size_t
++#ifndef __DEFINED_size_t /* musl */
+ #define __size_t__ /* BeOS */
+ #define __SIZE_T__ /* Cray Unicos/Mk */
+ #define _SIZE_T
+@@ -197,6 +198,7 @@
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
++#define __DEFINED_size_t /* musl */
+ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
+ || defined(__FreeBSD_kernel__)
+ /* __size_t is a typedef on FreeBSD 5, must not trash it. */
+@@ -214,6 +216,7 @@
+ typedef long ssize_t;
+ #endif /* __BEOS__ */
+ #endif /* !(defined (__GNUG__) && defined (size_t)) */
++#endif /* __DEFINED_size_t */
+ #endif /* __size_t */
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+Index: b/libgcc/unwind-dw2-fde-dip.c
+===================================================================
+--- a/libgcc/unwind-dw2-fde-dip.c
++++ b/libgcc/unwind-dw2-fde-dip.c
+@@ -75,6 +75,13 @@
+ # define USE_PT_GNU_EH_FRAME
+ #endif
+
++/* For musl libc, TARGET_DL_ITERATE_PHDR gets defined by the configure
++ script. */
++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
++ && defined(TARGET_DL_ITERATE_PHDR)
++# define USE_PT_GNU_EH_FRAME
++#endif
++
+ #if defined(USE_PT_GNU_EH_FRAME)
+
+ #include <link.h>
+Index: b/libgomp/config/posix/time.c
+===================================================================
+--- a/libgomp/config/posix/time.c
++++ b/libgomp/config/posix/time.c
+@@ -28,6 +28,8 @@
+ The following implementation uses the most simple POSIX routines.
+ If present, POSIX 4 clocks should be used instead. */
+
++#define _POSIX_C_SOURCE 199309L /* for clocks */
++
+ #include "libgomp.h"
+ #include <unistd.h>
+ #if TIME_WITH_SYS_TIME
+Index: b/libitm/config/arm/hwcap.cc
+===================================================================
+--- a/libitm/config/arm/hwcap.cc
++++ b/libitm/config/arm/hwcap.cc
+@@ -40,7 +40,11 @@
+
+ #ifdef __linux__
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/fcntl.h>
++#else
++#include <fcntl.h>
++#endif
+ #include <elf.h>
+
+ static void __attribute__((constructor))
+Index: b/libitm/config/linux/x86/tls.h
+===================================================================
+--- a/libitm/config/linux/x86/tls.h
++++ b/libitm/config/linux/x86/tls.h
+@@ -25,16 +25,19 @@
+ #ifndef LIBITM_X86_TLS_H
+ #define LIBITM_X86_TLS_H 1
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ /* Use slots in the TCB head rather than __thread lookups.
+ GLIBC has reserved words 10 through 13 for TM. */
+ #define HAVE_ARCH_GTM_THREAD 1
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
+ #endif
++#endif
+
+ #include "config/generic/tls.h"
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ namespace GTM HIDDEN {
+
+ #ifdef __x86_64__
+@@ -101,5 +104,6 @@
+
+ } // namespace GTM
+ #endif /* >= GLIBC 2.10 */
++#endif
+
+ #endif // LIBITM_X86_TLS_H
+Index: b/libstdc++-v3/configure.host
+===================================================================
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -264,6 +264,13 @@
+ os_include_dir="os/bsd/freebsd"
+ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
++ # check for musl by target
++ case "${host_os}" in
++ *-musl*)
++ os_include_dir="os/generic"
++ ;;
++ *)
++
+ if [ "$uclibc" = "yes" ]; then
+ os_include_dir="os/uclibc"
+ elif [ "$bionic" = "yes" ]; then
+@@ -272,6 +279,9 @@
+ os_include_dir="os/gnu-linux"
+ fi
+ ;;
++
++ esac
++ ;;
+ hpux*)
+ os_include_dir="os/hpux"
+ ;;
diff --git a/patches/gcc/4.9.3/001_gcc_bug_62231.patch b/patches/gcc/4.9.3/001_gcc_bug_62231.patch
new file mode 100644
index 0000000..e7c9cf9
--- /dev/null
+++ b/patches/gcc/4.9.3/001_gcc_bug_62231.patch
@@ -0,0 +1,129 @@
+As-applied. From:
+
+https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02625.html
+
+Linked from bug62231 comment 4 there
+
+diff -durN a/gcc/defaults.h b/gcc/defaults.h
+--- a/gcc/defaults.h 2013-01-10 12:38:27.000000000 -0800
++++ b/gcc/defaults.h 2014-12-15 13:26:13.498904465 -0800
+@@ -438,6 +438,11 @@
+ #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
+ #endif
+
++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers. */
++#ifndef DWARF_REG_TO_UNWIND_COLUMN
++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
++#endif
++
+ /* Map register numbers held in the call frame info that gcc has
+ collected using DWARF_FRAME_REGNUM to those that should be output in
+ .debug_frame and .eh_frame. */
+diff -durN a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
+--- a/gcc/dwarf2cfi.c 2013-01-10 12:38:27.000000000 -0800
++++ b/gcc/dwarf2cfi.c 2014-12-15 13:50:24.554883694 -0800
+@@ -225,7 +225,44 @@
+ emit_move_insn (adjust_address (mem, mode, offset), GEN_INT (size));
+ }
+
+-/* Generate code to initialize the register size table. */
++/* Helper for expand_builtin_init_dwarf_reg_sizes. Generate code to
++ initialize the dwarf register size table entry corresponding to register
++ REGNO in REGMODE. TABLE is the table base address, SLOTMODE is the mode
++ to use for the size entry to initialize, and WROTE_RETURN_COLUMN needs to
++ be set to true if the dwarf register number for REGNO is the dwarf return
++ column number. */
++
++static
++void init_one_dwarf_reg_size (int regno, enum machine_mode regmode,
++ rtx table, enum machine_mode slotmode,
++ bool *wrote_return_column)
++{
++ const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
++ const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++ const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
++
++ const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
++ const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
++
++ if (rnum >= DWARF_FRAME_REGISTERS)
++ return;
++
++ if (dnum == DWARF_FRAME_RETURN_COLUMN)
++ {
++ if (regmode == VOIDmode)
++ return;
++ *wrote_return_column = true;
++ }
++
++ if (slotoffset < 0)
++ return;
++
++ emit_move_insn (adjust_address (table, slotmode, slotoffset),
++ gen_int_mode (regsize, slotmode));
++}
++
++/* Generate code to initialize the dwarf register size table located
++ at the provided ADDRESS. */
+
+ void
+ expand_builtin_init_dwarf_reg_sizes (tree address)
+@@ -238,30 +275,21 @@
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ {
+- unsigned int dnum = DWARF_FRAME_REGNUM (i);
+- unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
+-
+- if (rnum < DWARF_FRAME_REGISTERS)
+- {
+- HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+- enum machine_mode save_mode = reg_raw_mode[i];
+- HOST_WIDE_INT size;
+-
+- if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+- save_mode = choose_hard_reg_mode (i, 1, true);
+- if (dnum == DWARF_FRAME_RETURN_COLUMN)
+- {
+- if (save_mode == VOIDmode)
+- continue;
+- wrote_return_column = true;
+- }
+- size = GET_MODE_SIZE (save_mode);
+- if (offset < 0)
+- continue;
++ enum machine_mode save_mode = reg_raw_mode[i];
++ rtx span;
+
+- emit_move_insn (adjust_address (mem, mode, offset),
+- gen_int_mode (size, mode));
+- }
++ span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
++ if (!span)
++ init_one_dwarf_reg_size (i, save_mode, mem, mode, &wrote_return_column);
++ else
++ {
++ for (int si = 0; si < XVECLEN (span, 0); si++)
++ {
++ rtx reg = XVECEXP (span, 0, si);
++ init_one_dwarf_reg_size
++ (REGNO (reg), GET_MODE (reg), mem, mode, &wrote_return_column);
++ }
++ }
+ }
+
+ if (!wrote_return_column)
+diff -durN a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c
+--- a/libgcc/unwind-dw2.c 2013-05-31 16:21:46.000000000 -0700
++++ b/libgcc/unwind-dw2.c 2014-12-15 13:26:13.570904866 -0800
+@@ -55,10 +55,6 @@
+ #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+ #endif
+
+-#ifndef DWARF_REG_TO_UNWIND_COLUMN
+-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
+-#endif
+-
+ /* ??? For the public function interfaces, we tend to gcc_assert that the
+ column numbers are in range. For the dwarf2 unwind info this does happen,
+ although so far in a case that doesn't actually matter.
diff --git a/patches/gcc/4.9.3/002_gcc_bug_62231.patch b/patches/gcc/4.9.3/002_gcc_bug_62231.patch
new file mode 100644
index 0000000..b970ebc
--- /dev/null
+++ b/patches/gcc/4.9.3/002_gcc_bug_62231.patch
@@ -0,0 +1,18 @@
+As-applied. From:
+
+https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02605.html
+
+Linked from bug62231 comment 4 there
+
+diff -durN a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
+--- a/gcc/config/rs6000/rs6000.c 2014-12-08 17:29:04.000000000 -0800
++++ b/gcc/config/rs6000/rs6000.c 2014-12-15 14:44:46.568801843 -0800
+@@ -1673,7 +1673,7 @@
+ SCmode so as to pass the value correctly in a pair of
+ registers. */
+ else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
+- && !DECIMAL_FLOAT_MODE_P (mode))
++ && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
+ reg_size = UNITS_PER_FP_WORD;
+
+ else
diff --git a/patches/gcc/4.9.3/100-uclibc-conf.patch b/patches/gcc/4.9.3/100-uclibc-conf.patch
new file mode 100644
index 0000000..d56bf0a
--- /dev/null
+++ b/patches/gcc/4.9.3/100-uclibc-conf.patch
@@ -0,0 +1,15 @@
+Index: gcc-4.8.0/contrib/regression/objs-gcc.sh
+===================================================================
+--- gcc-4.8.0.orig/contrib/regression/objs-gcc.sh 2009-04-09 17:00:19.000000000 +0200
++++ gcc-4.8.0/contrib/regression/objs-gcc.sh 2013-03-23 17:39:04.000000000 +0100
+@@ -106,6 +106,10 @@
+ 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
diff --git a/patches/gcc/4.9.3/1000-powerpc-link-with-math-lib.patch.conditional b/patches/gcc/4.9.3/1000-powerpc-link-with-math-lib.patch.conditional
new file mode 100644
index 0000000..b7094fe
--- /dev/null
+++ b/patches/gcc/4.9.3/1000-powerpc-link-with-math-lib.patch.conditional
@@ -0,0 +1,122 @@
+http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
+
+On glibc the libc.so carries a copy of the math function copysignl() but
+on uClibc math functions like copysignl() live in libm. Since libgcc_s
+contains unresolved symbols, any attempt to link against libgcc_s
+without explicitely specifying -lm fails, resulting in a broken
+bootstrap of the compiler.
+
+Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+---
+ libgcc/Makefile.in | 4 +++-
+ libgcc/configure | 32 ++++++++++++++++++++++++++++++++
+ libgcc/configure.ac | 21 +++++++++++++++++++++
+ 3 files changed, 56 insertions(+), 1 deletion(-)
+
+Index: gcc-4.8.0/libgcc/Makefile.in
+===================================================================
+--- gcc-4.8.0.orig/libgcc/Makefile.in 2013-02-04 20:06:20.000000000 +0100
++++ gcc-4.8.0/libgcc/Makefile.in 2013-03-24 09:12:43.000000000 +0100
+@@ -41,6 +41,7 @@
+ decimal_float = @decimal_float@
+ enable_decimal_float = @enable_decimal_float@
+ fixed_point = @fixed_point@
++LIBGCC_LIBM = @LIBGCC_LIBM@
+
+ host_noncanonical = @host_noncanonical@
+ target_noncanonical = @target_noncanonical@
+@@ -927,9 +928,10 @@
+ @multilib_dir@,$(MULTIDIR),$(subst \
+ @shlib_objs@,$(objects) libgcc.a,$(subst \
+ @shlib_base_name@,libgcc_s,$(subst \
++ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
+ @shlib_map_file@,$(mapfile),$(subst \
+ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
+- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
++ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
+
+ libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
+ # @multilib_flags@ is still needed because this may use
+Index: gcc-4.8.0/libgcc/configure
+===================================================================
+--- gcc-4.8.0.orig/libgcc/configure 2012-11-05 00:08:42.000000000 +0100
++++ gcc-4.8.0/libgcc/configure 2013-03-24 09:12:43.000000000 +0100
+@@ -564,6 +564,7 @@
+ tmake_file
+ sfp_machine_header
+ set_use_emutls
++LIBGCC_LIBM
+ set_have_cc_tls
+ vis_hide
+ fixed_point
+@@ -4481,6 +4482,37 @@
+ fi
+ fi
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++echo "$as_me:$LINENO: checking for library containing copysignl" >&5
++echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
++if test "${libgcc_cv_copysignl_lib+set}" = set; then
++ echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++ (eval $ac_try) 2>&5
++ ac_status=$?
++ echo "$as_me:$LINENO: \$? = $ac_status" >&5
++ (exit $ac_status); }; }
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++
++fi
++echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
++echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
+
+ # Conditionalize the makefile for this target machine.
+ tmake_file_=
+Index: gcc-4.8.0/libgcc/configure.ac
+===================================================================
+--- gcc-4.8.0.orig/libgcc/configure.ac 2012-10-15 15:10:30.000000000 +0200
++++ gcc-4.8.0/libgcc/configure.ac 2013-03-24 09:12:43.000000000 +0100
+@@ -326,6 +326,27 @@
+ fi
+ AC_SUBST(set_have_cc_tls)
+
++# On powerpc libgcc_s references copysignl which is a libm function but
++# glibc apparently also provides it via libc as opposed to uClibc where
++# it lives in libm.
++AC_CACHE_CHECK
++ libgcc_cv_copysignl_lib,
++ echo '#include <features.h>' > conftest.c
++ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
++ libgcc_cv_copysignl_lib="-lc"
++ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
++ then
++ libgcc_cv_copysignl_lib="-lm"
++ fi
++ rm -f conftest.*
++ ])
++
++case /${libgcc_cv_copysignl_lib}/ in
++ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
++ *) LIBGCC_LIBM= ;;
++esac
++AC_SUBST(LIBGCC_LIBM)
++
+ # See if we have emulated thread-local storage.
+ GCC_CHECK_EMUTLS
+ set_use_emutls=
diff --git a/patches/gcc/4.9.3/111-pr65730.patch b/patches/gcc/4.9.3/111-pr65730.patch
new file mode 100644
index 0000000..f195e30
--- /dev/null
+++ b/patches/gcc/4.9.3/111-pr65730.patch
@@ -0,0 +1,37 @@
+From b9a7775674d91c7af8043a83211ffeaa576327d7 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Fri, 10 Apr 2015 17:46:30 +0300
+Subject: [PATCH] Fix PR target/65730
+
+2015-05-20 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (init_alignment_context): Replace MULT
+ by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT).
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223452
+Changes to ChangeLog are dropped.
+
+ gcc/config/xtensa/xtensa.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index eb039ba..7296e36 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem)
+ if (ac->shift != NULL_RTX)
+ {
+ /* Shift is the byte count, but we need the bitcount. */
+- ac->shift = expand_simple_binop (SImode, MULT, ac->shift,
+- GEN_INT (BITS_PER_UNIT),
++ gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0);
++ ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift,
++ GEN_INT (exact_log2 (BITS_PER_UNIT)),
+ NULL_RTX, 1, OPTAB_DIRECT);
+ ac->modemask = expand_simple_binop (SImode, ASHIFT,
+ GEN_INT (GET_MODE_MASK (mode)),
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.9.3/301-missing-execinfo_h.patch b/patches/gcc/4.9.3/301-missing-execinfo_h.patch
new file mode 100644
index 0000000..00efda2
--- /dev/null
+++ b/patches/gcc/4.9.3/301-missing-execinfo_h.patch
@@ -0,0 +1,13 @@
+Index: gcc-4.8.0/boehm-gc/include/gc.h
+===================================================================
+--- gcc-4.8.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
++++ gcc-4.8.0/boehm-gc/include/gc.h 2013-03-23 17:39:20.000000000 +0100
+@@ -503,7 +503,7 @@
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/patches/gcc/4.9.3/810-arm-softfloat-libgcc.patch b/patches/gcc/4.9.3/810-arm-softfloat-libgcc.patch
new file mode 100644
index 0000000..c8cb377
--- /dev/null
+++ b/patches/gcc/4.9.3/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,30 @@
+Index: gcc-4.8.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.8.0.orig/gcc/config/arm/linux-elf.h 2013-01-10 21:38:27.000000000 +0100
++++ gcc-4.8.0/gcc/config/arm/linux-elf.h 2013-03-23 17:40:00.000000000 +0100
+@@ -55,7 +55,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+Index: gcc-4.8.0/libgcc/config/arm/t-linux
+===================================================================
+--- gcc-4.8.0.orig/libgcc/config/arm/t-linux 2012-03-22 16:14:46.000000000 +0100
++++ gcc-4.8.0/libgcc/config/arm/t-linux 2013-03-23 17:40:54.000000000 +0100
+@@ -1,6 +1,11 @@
+ LIB1ASMSRC = arm/lib1funcs.S
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++ _arm_fixsfsi _arm_fixunssfsi
+
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference.
diff --git a/patches/gcc/4.9.3/830-arm_unbreak_armv4t.patch b/patches/gcc/4.9.3/830-arm_unbreak_armv4t.patch
new file mode 100644
index 0000000..37f8f2a
--- /dev/null
+++ b/patches/gcc/4.9.3/830-arm_unbreak_armv4t.patch
@@ -0,0 +1,13 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -45,7 +45,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
diff --git a/patches/gcc/4.9.3/840-microblaze-enable-dwarf-eh-support.patch b/patches/gcc/4.9.3/840-microblaze-enable-dwarf-eh-support.patch
new file mode 100644
index 0000000..e116e2b
--- /dev/null
+++ b/patches/gcc/4.9.3/840-microblaze-enable-dwarf-eh-support.patch
@@ -0,0 +1,169 @@
+Fetched from Xilinx gcc git at https://github.com/Xilinx/gcc
+
+From 23c35173490ac2d6348a668dfc9c1a6eb62171f2 Mon Sep 17 00:00:00 2001
+From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
+Date: Mon, 18 Jun 2012 20:18:13 +0200
+Subject: [PATCH] [Patch, microblaze]: Enable DWARF exception handling support.
+
+Changelog
+
+2013-03-18 Edgar E. Iglesias <edgar.iglesias@xilinx.com>
+ David Holsgrove <david.holsgrove@xilinx.com>
+
+ * common/config/microblaze/microblaze-common.c: Remove
+ TARGET_EXCEPT_UNWIND_INFO definition.
+ * config/microblaze/microblaze-protos.h: Add
+ microblaze_eh_return prototype.
+ * gcc/config/microblaze/microblaze.c: (microblaze_must_save_register,
+ microblaze_expand_epilogue, microblaze_return_addr): Handle
+ calls_eh_return
+ (microblaze_eh_return): New function.
+ * gcc/config/microblaze/microblaze.h: Define RETURN_ADDR_OFFSET,
+ EH_RETURN_DATA_REGNO, MB_EH_STACKADJ_REGNUM, EH_RETURN_STACKADJ_RTX,
+ ASM_PREFERRED_EH_DATA_FORMAT
+ * gcc/config/microblaze/microblaze.md: Define eh_return pattern.
+
+Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
+Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
+---
+ gcc/common/config/microblaze/microblaze-common.c | 3 ---
+ gcc/config/microblaze/microblaze-protos.h | 1 +
+ gcc/config/microblaze/microblaze.c | 29 ++++++++++++++++++++----
+ gcc/config/microblaze/microblaze.h | 15 ++++++++++++
+ gcc/config/microblaze/microblaze.md | 11 +++++++++
+ 5 files changed, 52 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/common/config/microblaze/microblaze-common.c b/gcc/common/config/microblaze/microblaze-common.c
+index 5835acc..85e6a53 100644
+--- a/gcc/common/config/microblaze/microblaze-common.c
++++ b/gcc/common/config/microblaze/microblaze-common.c
+@@ -39,7 +39,4 @@ static const struct default_options microblaze_option_optimization_table[] =
+ #undef TARGET_OPTION_OPTIMIZATION_TABLE
+ #define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table
+
+-#undef TARGET_EXCEPT_UNWIND_INFO
+-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+-
+ struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
+diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h
+index c30ec72..260f4e4 100644
+--- a/gcc/config/microblaze/microblaze-protos.h
++++ b/gcc/config/microblaze/microblaze-protos.h
+@@ -56,6 +56,7 @@ extern bool microblaze_tls_referenced_p (rtx);
+ extern int symbol_mentioned_p (rtx);
+ extern int label_mentioned_p (rtx);
+ extern bool microblaze_cannot_force_const_mem (enum machine_mode, rtx);
++extern void microblaze_eh_return (rtx op0);
+ #endif /* RTX_CODE */
+
+ /* Declare functions in microblaze-c.c. */
+diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
+index fe61fce..15166d3 100644
+--- a/gcc/config/microblaze/microblaze.c
++++ b/gcc/config/microblaze/microblaze.c
+@@ -1999,6 +1999,11 @@ microblaze_must_save_register (int regno)
+ if (frame_pointer_needed && (regno == HARD_FRAME_POINTER_REGNUM))
+ return 1;
+
++ if (crtl->calls_eh_return
++ && regno == MB_ABI_SUB_RETURN_ADDR_REGNUM) {
++ return 1;
++ }
++
+ if (!crtl->is_leaf)
+ {
+ if (regno == MB_ABI_SUB_RETURN_ADDR_REGNUM)
+@@ -2026,6 +2031,13 @@ microblaze_must_save_register (int regno)
+ return 1;
+ }
+
++ if (crtl->calls_eh_return
++ && (regno == EH_RETURN_DATA_REGNO (0)
++ || regno == EH_RETURN_DATA_REGNO (1)))
++ {
++ return 1;
++ }
++
+ return 0;
+ }
+
+@@ -3131,6 +3143,12 @@ microblaze_expand_epilogue (void)
+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx));
+ }
+
++ if (crtl->calls_eh_return)
++ emit_insn (gen_addsi3 (stack_pointer_rtx,
++ stack_pointer_rtx,
++ gen_rtx_raw_REG (SImode,
++ MB_EH_STACKADJ_REGNUM)));
++
+ emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, GP_REG_FIRST +
+ MB_ABI_SUB_RETURN_ADDR_REGNUM)));
+ }
+@@ -3427,10 +3445,13 @@ microblaze_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
+ if (count != 0)
+ return NULL_RTX;
+
+- return gen_rtx_PLUS (Pmode,
+- get_hard_reg_initial_val (Pmode,
+- MB_ABI_SUB_RETURN_ADDR_REGNUM),
+- GEN_INT (8));
++ return get_hard_reg_initial_val (Pmode,
++ MB_ABI_SUB_RETURN_ADDR_REGNUM);
++}
++
++void microblaze_eh_return (rtx op0)
++{
++ emit_insn (gen_movsi(gen_rtx_MEM(Pmode, stack_pointer_rtx), op0));
+ }
+
+ /* Queue an .ident string in the queue of top-level asm statements.
+diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
+index 4072283..5e9f49c 100644
+--- a/gcc/config/microblaze/microblaze.h
++++ b/gcc/config/microblaze/microblaze.h
+@@ -184,6 +184,21 @@ extern enum pipeline_type microblaze_pipe;
+ #define INCOMING_RETURN_ADDR_RTX \
+ gen_rtx_REG (VOIDmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM)
+
++/* Specifies the offset from INCOMING_RETURN_ADDR_RTX and the actual return PC. */
++#define RETURN_ADDR_OFFSET (8)
++
++/* Describe how we implement __builtin_eh_return. */
++#define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? MB_ABI_FIRST_ARG_REGNUM + (N) : INVALID_REGNUM)
++
++#define MB_EH_STACKADJ_REGNUM MB_ABI_INT_RETURN_VAL2_REGNUM
++#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, MB_EH_STACKADJ_REGNUM)
++
++/* Select a format to encode pointers in exception handling data. CODE
++ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
++ true if the symbol may be affected by dynamic relocations. */
++#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
++ ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
++
+ /* Use DWARF 2 debugging information by default. */
+ #define DWARF2_DEBUGGING_INFO
+ #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
+index ed6131a..dc2405f 100644
+--- a/gcc/config/microblaze/microblaze.md
++++ b/gcc/config/microblaze/microblaze.md
+@@ -2327,4 +2327,15 @@
+ (set_attr "mode" "SI")
+ (set_attr "length" "4")])
+
++; This is used in compiling the unwind routines.
++(define_expand "eh_return"
++ [(use (match_operand 0 "general_operand" ""))]
++ ""
++ "
++{
++ microblaze_eh_return(operands[0]);
++ DONE;
++}")
++
+ (include "sync.md")
++
+--
+1.8.3.2
+
diff --git a/patches/gcc/4.9.3/850-libstdcxx-uclibc-c99.patch b/patches/gcc/4.9.3/850-libstdcxx-uclibc-c99.patch
new file mode 100644
index 0000000..d103af1
--- /dev/null
+++ b/patches/gcc/4.9.3/850-libstdcxx-uclibc-c99.patch
@@ -0,0 +1,255 @@
+Allow C99-depending features of libstdc++ with uClibc
+
+The libstdc++ code is fairly restrictive on how it checks for C99
+compatibility: it requires *complete* C99 support to enable certain
+features. For example, uClibc provides a good number of C99 features,
+but not C99 complex number support. For this reason, libstdc++
+completely disables many the standard C++ methods that can in fact
+work because uClibc provides the necessary functions.
+
+This patch is similar and highly inspired from
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in
+a way that doesn't involve changing the configure.ac script, as
+autoreconfiguring gcc is complicated. It simply relies on the fact
+that uClibc defines the __UCLIBC__ definition.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+[Gustavo: update for 4.9.3]
+
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/config/locale/generic/c_locale.h gcc-4.9.3/libstdc++-v3/config/locale/generic/c_locale.h
+--- gcc-4.9.3.orig/libstdc++-v3/config/locale/generic/c_locale.h 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/config/locale/generic/c_locale.h 2015-06-27 06:46:04.420022179 -0300
+@@ -70,7 +70,7 @@
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+ #else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/config/locale/gnu/c_locale.h gcc-4.9.3/libstdc++-v3/config/locale/gnu/c_locale.h
+--- gcc-4.9.3.orig/libstdc++-v3/config/locale/gnu/c_locale.h 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/config/locale/gnu/c_locale.h 2015-06-27 06:46:04.465023743 -0300
+@@ -88,7 +88,7 @@
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+ #else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/basic_string.h gcc-4.9.3/libstdc++-v3/include/bits/basic_string.h
+--- gcc-4.9.3.orig/libstdc++-v3/include/bits/basic_string.h 2015-05-28 13:27:46.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/bits/basic_string.h 2015-06-27 06:49:04.741284648 -0300
+@@ -2844,7 +2844,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
++#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
+
+ #include <ext/string_conversions.h>
+
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets_nonio.tcc gcc-4.9.3/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+--- gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/bits/locale_facets_nonio.tcc 2015-06-27 06:46:04.466023777 -0300
+@@ -572,7 +572,7 @@
+ {
+ const locale __loc = __io.getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ // First try a buffer perhaps big enough.
+ int __cs_size = 64;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets.tcc gcc-4.9.3/libstdc++-v3/include/bits/locale_facets.tcc
+--- gcc-4.9.3.orig/libstdc++-v3/include/bits/locale_facets.tcc 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/bits/locale_facets.tcc 2015-06-27 06:46:04.466023777 -0300
+@@ -987,7 +987,7 @@
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ // First try a buffer perhaps big enough (most probably sufficient
+ // for non-ios_base::fixed outputs)
+ int __cs_size = __max_digits * 3;
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/math.h gcc-4.9.3/libstdc++-v3/include/c_compatibility/math.h
+--- gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/math.h 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/c_compatibility/math.h 2015-06-27 06:46:04.466023777 -0300
+@@ -56,7 +56,7 @@
+ using std::floor;
+ using std::fmod;
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::fpclassify;
+ using std::isfinite;
+ using std::isinf;
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.9.3/libstdc++-v3/include/c_compatibility/wchar.h
+--- gcc-4.9.3.orig/libstdc++-v3/include/c_compatibility/wchar.h 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/c_compatibility/wchar.h 2015-06-27 06:46:04.466023777 -0300
+@@ -103,7 +103,7 @@
+ using std::wmemset;
+ using std::wcsftime;
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdio gcc-4.9.3/libstdc++-v3/include/c_global/cstdio
+--- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdio 2014-01-23 18:17:15.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/c_global/cstdio 2015-06-27 06:46:04.481024298 -0300
+@@ -146,7 +146,7 @@
+ using ::vsprintf;
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdlib gcc-4.9.3/libstdc++-v3/include/c_global/cstdlib
+--- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cstdlib 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/c_global/cstdlib 2015-06-27 06:46:04.466023777 -0300
+@@ -182,7 +182,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef _Exit
+ #undef llabs
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_global/cwchar gcc-4.9.3/libstdc++-v3/include/c_global/cwchar
+--- gcc-4.9.3.orig/libstdc++-v3/include/c_global/cwchar 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/c_global/cwchar 2015-06-27 06:46:04.466023777 -0300
+@@ -232,7 +232,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef wcstold
+ #undef wcstoll
+@@ -289,7 +289,7 @@
+ using std::vwscanf;
+ #endif
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdio gcc-4.9.3/libstdc++-v3/include/c_std/cstdio
+--- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdio 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/c_std/cstdio 2015-06-27 06:46:04.480024263 -0300
+@@ -144,7 +144,7 @@
+ using ::vsprintf;
+ } // namespace std
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdlib gcc-4.9.3/libstdc++-v3/include/c_std/cstdlib
+--- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cstdlib 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/c_std/cstdlib 2015-06-27 06:46:04.480024263 -0300
+@@ -180,7 +180,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef _Exit
+ #undef llabs
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/c_std/cwchar gcc-4.9.3/libstdc++-v3/include/c_std/cwchar
+--- gcc-4.9.3.orig/libstdc++-v3/include/c_std/cwchar 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/c_std/cwchar 2015-06-27 06:46:04.480024263 -0300
+@@ -228,7 +228,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef wcstold
+ #undef wcstoll
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/ext/vstring.h gcc-4.9.3/libstdc++-v3/include/ext/vstring.h
+--- gcc-4.9.3.orig/libstdc++-v3/include/ext/vstring.h 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/ext/vstring.h 2015-06-27 06:46:04.480024263 -0300
+@@ -2680,7 +2680,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
++#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)))
+
+ #include <ext/string_conversions.h>
+
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdio gcc-4.9.3/libstdc++-v3/include/tr1/cstdio
+--- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdio 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/tr1/cstdio 2015-06-27 06:46:04.480024263 -0300
+@@ -33,7 +33,7 @@
+
+ #include <cstdio>
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdlib gcc-4.9.3/libstdc++-v3/include/tr1/cstdlib
+--- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cstdlib 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/tr1/cstdlib 2015-06-27 06:46:04.480024263 -0300
+@@ -35,7 +35,7 @@
+
+ #if _GLIBCXX_HOSTED
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/cwchar gcc-4.9.3/libstdc++-v3/include/tr1/cwchar
+--- gcc-4.9.3.orig/libstdc++-v3/include/tr1/cwchar 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/tr1/cwchar 2015-06-27 06:46:04.480024263 -0300
+@@ -52,7 +52,7 @@
+ using std::vwscanf;
+ #endif
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/include/tr1/stdlib.h gcc-4.9.3/libstdc++-v3/include/tr1/stdlib.h
+--- gcc-4.9.3.orig/libstdc++-v3/include/tr1/stdlib.h 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/include/tr1/stdlib.h 2015-06-27 06:46:04.481024298 -0300
+@@ -33,7 +33,7 @@
+
+ #if _GLIBCXX_HOSTED
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ using std::tr1::atoll;
+ using std::tr1::strtoll;
+diff -Nura gcc-4.9.3.orig/libstdc++-v3/src/c++11/debug.cc gcc-4.9.3/libstdc++-v3/src/c++11/debug.cc
+--- gcc-4.9.3.orig/libstdc++-v3/src/c++11/debug.cc 2014-01-02 19:30:10.000000000 -0300
++++ gcc-4.9.3/libstdc++-v3/src/c++11/debug.cc 2015-06-27 06:46:04.481024298 -0300
+@@ -788,7 +788,7 @@
+ int __n __attribute__ ((__unused__)),
+ const char* __fmt, _Tp __s) const throw ()
+ {
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ std::snprintf(__buf, __n, __fmt, __s);
+ #else
+ std::sprintf(__buf, __fmt, __s);
diff --git a/patches/gcc/4.9.3/860-cilk-wchar.patch b/patches/gcc/4.9.3/860-cilk-wchar.patch
new file mode 100644
index 0000000..1837405
--- /dev/null
+++ b/patches/gcc/4.9.3/860-cilk-wchar.patch
@@ -0,0 +1,56 @@
+[PATCH] cilk: fix build without wchar
+
+When building against uClibc with wchar support disabled, WCHAR_MIN and
+WCHAR_MAX are not defined leading to compilation errors.
+
+Fix it by only including the wchar code if available.
+
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ libcilkrts/include/cilk/reducer_min_max.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+Index: host-gcc-final-4.9.2/libcilkrts/include/cilk/reducer_min_max.h
+===================================================================
+--- host-gcc-final-4.9.2.orig/libcilkrts/include/cilk/reducer_min_max.h
++++ host-gcc-final-4.9.2/libcilkrts/include/cilk/reducer_min_max.h
+@@ -3154,7 +3154,9 @@
+ CILK_C_REDUCER_MAX_INSTANCE(char, char, CHAR_MIN)
+ CILK_C_REDUCER_MAX_INSTANCE(unsigned char, uchar, 0)
+ CILK_C_REDUCER_MAX_INSTANCE(signed char, schar, SCHAR_MIN)
++#ifdef WCHAR_MIN
+ CILK_C_REDUCER_MAX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN)
++#endif
+ CILK_C_REDUCER_MAX_INSTANCE(short, short, SHRT_MIN)
+ CILK_C_REDUCER_MAX_INSTANCE(unsigned short, ushort, 0)
+ CILK_C_REDUCER_MAX_INSTANCE(int, int, INT_MIN)
+@@ -3306,7 +3308,9 @@
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(char, char, CHAR_MIN)
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned char, uchar, 0)
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(signed char, schar, SCHAR_MIN)
++#ifdef WCHAR_MIN
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN)
++#endif
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(short, short, SHRT_MIN)
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned short, ushort, 0)
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(int, int, INT_MIN)
+@@ -3432,7 +3436,9 @@
+ CILK_C_REDUCER_MIN_INSTANCE(char, char, CHAR_MAX)
+ CILK_C_REDUCER_MIN_INSTANCE(unsigned char, uchar, CHAR_MAX)
+ CILK_C_REDUCER_MIN_INSTANCE(signed char, schar, SCHAR_MAX)
++#ifdef WCHAR_MAX
+ CILK_C_REDUCER_MIN_INSTANCE(wchar_t, wchar_t, WCHAR_MAX)
++#endif
+ CILK_C_REDUCER_MIN_INSTANCE(short, short, SHRT_MAX)
+ CILK_C_REDUCER_MIN_INSTANCE(unsigned short, ushort, USHRT_MAX)
+ CILK_C_REDUCER_MIN_INSTANCE(int, int, INT_MAX)
+@@ -3584,7 +3590,9 @@
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(char, char, CHAR_MAX)
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned char, uchar, CHAR_MAX)
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(signed char, schar, SCHAR_MAX)
++#ifdef WCHAR_MAX
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MAX)
++#endif
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(short, short, SHRT_MAX)
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned short, ushort, USHRT_MAX)
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(int, int, INT_MAX)
diff --git a/patches/gcc/4.9.3/870-xtensa-add-mauto-litpools-option.patch b/patches/gcc/4.9.3/870-xtensa-add-mauto-litpools-option.patch
new file mode 100644
index 0000000..aa1376c
--- /dev/null
+++ b/patches/gcc/4.9.3/870-xtensa-add-mauto-litpools-option.patch
@@ -0,0 +1,290 @@
+From 6d852ffb43b111a39162135c95249e749c4e285b Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 6 Aug 2015 01:16:02 +0300
+Subject: [PATCH] xtensa: add -mauto-litpools option
+
+With support from assembler this option allows compiling huge functions,
+where single literal pool at the beginning of a function may not be
+reachable by L32R instructions at its end.
+
+Currently assembler --auto-litpools option cannot deal with literals
+used from multiple locations separated by more than 256 KBytes of code.
+Don't turn constants into literals, instead use MOVI instruction to load
+them into registers and let the assembler turn them into literals as
+necessary.
+
+2015-08-12 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/constraints.md (define_constraint "Y"): New
+ constraint.
+ * config/xtensa/elf.h (ASM_SPEC): Add m(no-)auto-litpools.
+ * config/xtensa/linux.h (ASM_SPEC): Likewise.
+ * config/xtensa/predicates.md (move_operand): Match constants
+ and symbols in the presence of TARGET_AUTO_LITPOOLS.
+ * config/xtensa/xtensa.c (xtensa_valid_move): Don't allow
+ immediate references to TLS data.
+ (xtensa_emit_move_sequence): Don't force constants to memory in
+ the presence of TARGET_AUTO_LITPOOLS.
+ (print_operand): Add 'y' format, same as default, but capable of
+ printing SF mode constants as well.
+ * config/xtensa/xtensa.md (movsi_internal, movhi_internal)
+ (movsf_internal): Add movi pattern that loads literal.
+ (movsf, movdf): Don't force constants to memory in the presence
+ of TARGET_AUTO_LITPOOLS.
+ (movdf_internal): Add 'Y' constraint.
+ * config/xtensa/xtensa.opt (mauto-litpools): New option.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226828
+Changes to ChangeLogs and documentation are dropped.
+
+ gcc/config/xtensa/constraints.md | 5 +++++
+ gcc/config/xtensa/elf.h | 4 +++-
+ gcc/config/xtensa/linux.h | 4 +++-
+ gcc/config/xtensa/predicates.md | 3 ++-
+ gcc/config/xtensa/xtensa.c | 19 ++++++++++++++++++-
+ gcc/config/xtensa/xtensa.md | 35 +++++++++++++++++++----------------
+ gcc/config/xtensa/xtensa.opt | 4 ++++
+ 7 files changed, 54 insertions(+), 20 deletions(-)
+
+diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md
+index 30f4c1f..773d4f9 100644
+--- a/gcc/config/xtensa/constraints.md
++++ b/gcc/config/xtensa/constraints.md
+@@ -111,6 +111,11 @@
+ (and (match_code "const_int")
+ (match_test "xtensa_mask_immediate (ival)")))
+
++(define_constraint "Y"
++ "A constant that can be used in relaxed MOVI instructions."
++ (and (match_code "const_int,const_double,const,symbol_ref,label_ref")
++ (match_test "TARGET_AUTO_LITPOOLS")))
++
+ ;; Memory constraints. Do not use define_memory_constraint here. Doing so
+ ;; causes reload to force some constants into the constant pool, but since
+ ;; the Xtensa constant pool can only be accessed with L32R instructions, it
+diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
+index e59bede..12056f7 100644
+--- a/gcc/config/xtensa/elf.h
++++ b/gcc/config/xtensa/elf.h
+@@ -48,7 +48,9 @@ along with GCC; see the file COPYING3. If not see
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+- %{mno-longcalls:--no-longcalls}"
++ %{mno-longcalls:--no-longcalls} \
++ %{mauto-litpools:--auto-litpools} \
++ %{mno-auto-litpools:--no-auto-litpools}"
+
+ #undef LIB_SPEC
+ #define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal"
+diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
+index 675aacf..5b0243a 100644
+--- a/gcc/config/xtensa/linux.h
++++ b/gcc/config/xtensa/linux.h
+@@ -42,7 +42,9 @@ along with GCC; see the file COPYING3. If not see
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+- %{mno-longcalls:--no-longcalls}"
++ %{mno-longcalls:--no-longcalls} \
++ %{mauto-litpools:--auto-litpools} \
++ %{mno-auto-litpools:--no-auto-litpools}"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
+diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md
+index e02209e..d7dfa11 100644
+--- a/gcc/config/xtensa/predicates.md
++++ b/gcc/config/xtensa/predicates.md
+@@ -142,7 +142,8 @@
+ (match_test "GET_MODE_CLASS (mode) == MODE_INT
+ && xtensa_simm12b (INTVAL (op))"))
+ (and (match_code "const_int,const_double,const,symbol_ref,label_ref")
+- (match_test "TARGET_CONST16 && CONSTANT_P (op)
++ (match_test "(TARGET_CONST16 || TARGET_AUTO_LITPOOLS)
++ && CONSTANT_P (op)
+ && GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0")))))
+
+ ;; Accept the floating point constant 1 in the appropriate mode.
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index eb039ba..206ff80 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -501,6 +501,9 @@ xtensa_valid_move (machine_mode mode, rtx *operands)
+ {
+ int dst_regnum = xt_true_regnum (operands[0]);
+
++ if (xtensa_tls_referenced_p (operands[1]))
++ return FALSE;
++
+ /* The stack pointer can only be assigned with a MOVSP opcode. */
+ if (dst_regnum == STACK_POINTER_REGNUM)
+ return !TARGET_WINDOWED_ABI
+@@ -1069,7 +1072,7 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
+ return 1;
+ }
+
+- if (! TARGET_CONST16)
++ if (! TARGET_AUTO_LITPOOLS && ! TARGET_CONST16)
+ {
+ src = force_const_mem (SImode, src);
+ operands[1] = src;
+@@ -2449,6 +2452,20 @@ print_operand (FILE *file, rtx x, int letter)
+ }
+ break;
+
++ case 'y':
++ if (GET_CODE (x) == CONST_DOUBLE &&
++ GET_MODE (x) == SFmode)
++ {
++ REAL_VALUE_TYPE r;
++ long l;
++ REAL_VALUE_FROM_CONST_DOUBLE (r, x);
++ REAL_VALUE_TO_TARGET_SINGLE (r, l);
++ fprintf (file, "0x%08lx", l);
++ break;
++ }
++
++ /* fall through */
++
+ default:
+ if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
+ fprintf (file, "%s", reg_names[xt_true_regnum (x)]);
+diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
+index 6d84384..0e673a3 100644
+--- a/gcc/config/xtensa/xtensa.md
++++ b/gcc/config/xtensa/xtensa.md
+@@ -761,8 +761,8 @@
+ })
+
+ (define_insn "movsi_internal"
+- [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,W,a,a,U,*a,*A")
+- (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,i,T,U,r,*A,*r"))]
++ [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,a,W,a,a,U,*a,*A")
++ (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,Y,i,T,U,r,*A,*r"))]
+ "xtensa_valid_move (SImode, operands)"
+ "@
+ movi.n\t%0, %x1
+@@ -774,15 +774,16 @@
+ mov\t%0, %1
+ movsp\t%0, %1
+ movi\t%0, %x1
++ movi\t%0, %1
+ const16\t%0, %t1\;const16\t%0, %b1
+ %v1l32r\t%0, %1
+ %v1l32i\t%0, %1
+ %v0s32i\t%1, %0
+ rsr\t%0, ACCLO
+ wsr\t%1, ACCLO"
+- [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,load,load,store,rsr,wsr")
++ [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr")
+ (set_attr "mode" "SI")
+- (set_attr "length" "2,2,2,2,2,2,3,3,3,6,3,3,3,3,3")])
++ (set_attr "length" "2,2,2,2,2,2,3,3,3,3,6,3,3,3,3,3")])
+
+ ;; 16-bit Integer moves
+
+@@ -796,21 +797,22 @@
+ })
+
+ (define_insn "movhi_internal"
+- [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
+- (match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
++ [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,a,U,*a,*A")
++ (match_operand:HI 1 "move_operand" "M,d,r,I,Y,U,r,*A,*r"))]
+ "xtensa_valid_move (HImode, operands)"
+ "@
+ movi.n\t%0, %x1
+ mov.n\t%0, %1
+ mov\t%0, %1
+ movi\t%0, %x1
++ movi\t%0, %1
+ %v1l16ui\t%0, %1
+ %v0s16i\t%1, %0
+ rsr\t%0, ACCLO
+ wsr\t%1, ACCLO"
+- [(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
++ [(set_attr "type" "move,move,move,move,move,load,store,rsr,wsr")
+ (set_attr "mode" "HI")
+- (set_attr "length" "2,2,3,3,3,3,3,3")])
++ (set_attr "length" "2,2,3,3,3,3,3,3,3")])
+
+ ;; 8-bit Integer moves
+
+@@ -881,7 +883,7 @@
+ (match_operand:SF 1 "general_operand" ""))]
+ ""
+ {
+- if (!TARGET_CONST16 && CONSTANT_P (operands[1]))
++ if (!TARGET_CONST16 && !TARGET_AUTO_LITPOOLS && CONSTANT_P (operands[1]))
+ operands[1] = force_const_mem (SFmode, operands[1]);
+
+ if ((!register_operand (operands[0], SFmode)
+@@ -896,8 +898,8 @@
+ })
+
+ (define_insn "movsf_internal"
+- [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,W,a,a,U")
+- (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,iF,T,U,r"))]
++ [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,a,W,a,a,U")
++ (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,Y,iF,T,U,r"))]
+ "((register_operand (operands[0], SFmode)
+ || register_operand (operands[1], SFmode))
+ && !(FP_REG_P (xt_true_regnum (operands[0]))
+@@ -912,13 +914,14 @@
+ mov\t%0, %1
+ wfr\t%0, %1
+ rfr\t%0, %1
++ movi\t%0, %y1
+ const16\t%0, %t1\;const16\t%0, %b1
+ %v1l32r\t%0, %1
+ %v1l32i\t%0, %1
+ %v0s32i\t%1, %0"
+- [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,load,load,store")
++ [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,move,load,load,store")
+ (set_attr "mode" "SF")
+- (set_attr "length" "3,3,3,2,2,2,3,3,3,6,3,3,3")])
++ (set_attr "length" "3,3,3,2,2,2,3,3,3,3,6,3,3,3")])
+
+ (define_insn "*lsiu"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+@@ -991,7 +994,7 @@
+ (match_operand:DF 1 "general_operand" ""))]
+ ""
+ {
+- if (CONSTANT_P (operands[1]) && !TARGET_CONST16)
++ if (CONSTANT_P (operands[1]) && !TARGET_CONST16 && !TARGET_AUTO_LITPOOLS)
+ operands[1] = force_const_mem (DFmode, operands[1]);
+
+ if (!register_operand (operands[0], DFmode)
+@@ -1002,8 +1005,8 @@
+ })
+
+ (define_insn_and_split "movdf_internal"
+- [(set (match_operand:DF 0 "nonimmed_operand" "=a,W,a,a,U")
+- (match_operand:DF 1 "move_operand" "r,iF,T,U,r"))]
++ [(set (match_operand:DF 0 "nonimmed_operand" "=a,a,W,a,a,U")
++ (match_operand:DF 1 "move_operand" "r,Y,iF,T,U,r"))]
+ "register_operand (operands[0], DFmode)
+ || register_operand (operands[1], DFmode)"
+ "#"
+diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt
+index 2fd6cee..21c6e96 100644
+--- a/gcc/config/xtensa/xtensa.opt
++++ b/gcc/config/xtensa/xtensa.opt
+@@ -38,6 +38,10 @@ mtext-section-literals
+ Target
+ Intersperse literal pools with code in the text section
+
++mauto-litpools
++Target Report Mask(AUTO_LITPOOLS)
++Relax literals in assembler and place them automatically in the text section
++
+ mserialize-volatile
+ Target Report Mask(SERIALIZE_VOLATILE)
+ -mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.9.3/871-xtensa-reimplement-register-spilling.patch b/patches/gcc/4.9.3/871-xtensa-reimplement-register-spilling.patch
new file mode 100644
index 0000000..abc7a08
--- /dev/null
+++ b/patches/gcc/4.9.3/871-xtensa-reimplement-register-spilling.patch
@@ -0,0 +1,76 @@
+From 05154174b369505238b759cf80d595d8cfc8c731 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Mon, 10 Aug 2015 21:35:20 +0300
+Subject: [PATCH 1/3] xtensa: reimplement register spilling
+
+Spilling windowed registers in userspace is much easier, more portable,
+less error-prone and equally effective as in kernel. Now that register
+spilling syscall is considered obsolete in the xtensa linux kernel
+replace it with CALL12 followed by series of ENTRY in libgcc.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/lib2funcs.S (__xtensa_libgcc_window_spill): Use
+ CALL12 followed by series of ENTRY to spill windowed registers.
+ (__xtensa_nonlocal_goto): Call __xtensa_libgcc_window_spill
+ instead of making linux spill syscall.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226962
+
+ libgcc/config/xtensa/lib2funcs.S | 30 +++++++++++++++++++++++-------
+ 1 file changed, 23 insertions(+), 7 deletions(-)
+
+diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S
+index 3ac8c1d..2e678af 100644
+--- a/libgcc/config/xtensa/lib2funcs.S
++++ b/libgcc/config/xtensa/lib2funcs.S
+@@ -33,10 +33,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ .global __xtensa_libgcc_window_spill
+ .type __xtensa_libgcc_window_spill,@function
+ __xtensa_libgcc_window_spill:
+- entry sp, 32
+- movi a2, 0
+- syscall
++ entry sp, 48
++#if XCHAL_NUM_AREGS > 16
++ call12 1f
++ retw
++ .align 4
++1:
++ .rept (XCHAL_NUM_AREGS - 24) / 12
++ _entry sp, 48
++ mov a12, a0
++ .endr
++ _entry sp, 16
++#if XCHAL_NUM_AREGS % 12 == 0
++ mov a4, a4
++#elif XCHAL_NUM_AREGS % 12 == 4
++ mov a8, a8
++#elif XCHAL_NUM_AREGS % 12 == 8
++ mov a12, a12
++#endif
++ retw
++#else
++ mov a8, a8
+ retw
++#endif
+ .size __xtensa_libgcc_window_spill, .-__xtensa_libgcc_window_spill
+
+
+@@ -58,10 +77,7 @@ __xtensa_nonlocal_goto:
+ entry sp, 32
+
+ /* Flush registers. */
+- mov a5, a2
+- movi a2, 0
+- syscall
+- mov a2, a5
++ call8 __xtensa_libgcc_window_spill
+
+ /* Because the save area for a0-a3 is stored one frame below
+ the one identified by a2, the only way to restore those
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.9.3/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch b/patches/gcc/4.9.3/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
new file mode 100644
index 0000000..f23a5c0
--- /dev/null
+++ b/patches/gcc/4.9.3/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
@@ -0,0 +1,33 @@
+From f66206679a0ad604f13673559f230160cd3d1189 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Fri, 14 Aug 2015 02:45:02 +0300
+Subject: [PATCH 2/3] xtensa: use unwind-dw2-fde-dip instead of unwind-dw2-fde
+
+This allows having exception cleanup code in binaries that don't
+register their unwind tables.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/t-xtensa (LIB2ADDEH): Replace unwind-dw2-fde
+ with unwind-dw2-fde-dip.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226963
+
+ libgcc/config/xtensa/t-xtensa | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgcc/config/xtensa/t-xtensa b/libgcc/config/xtensa/t-xtensa
+index 27399e6..66d0eb3 100644
+--- a/libgcc/config/xtensa/t-xtensa
++++ b/libgcc/config/xtensa/t-xtensa
+@@ -13,4 +13,4 @@ LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _udivsi3 _umodsi3 \
+ LIB2ADD = $(srcdir)/config/xtensa/lib2funcs.S
+
+ LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
+- $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++ $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.9.3/873-xtensa-fix-_Unwind_GetCFA.patch b/patches/gcc/4.9.3/873-xtensa-fix-_Unwind_GetCFA.patch
new file mode 100644
index 0000000..dc40513
--- /dev/null
+++ b/patches/gcc/4.9.3/873-xtensa-fix-_Unwind_GetCFA.patch
@@ -0,0 +1,40 @@
+From 15c7c4d39b317f0d902ef28fd43eca5c3369f891 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sat, 15 Aug 2015 05:12:11 +0300
+Subject: [PATCH 3/3] xtensa: fix _Unwind_GetCFA
+
+Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame
+higher than what was actually used by code at context->ra. This results
+in invalid CFA value in signal frames and premature unwinding completion
+in forced unwinding used by uClibc NPTL thread cancellation.
+Returning context->sp from _Unwind_GetCFA makes all CFA values valid and
+matching code that used them.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
+ context->sp instead of context->cfa.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226964
+
+ libgcc/config/xtensa/unwind-dw2-xtensa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c
+index 35f7797..ef6b900 100644
+--- a/libgcc/config/xtensa/unwind-dw2-xtensa.c
++++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c
+@@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
+ _Unwind_Word
+ _Unwind_GetCFA (struct _Unwind_Context *context)
+ {
+- return (_Unwind_Ptr) context->cfa;
++ return (_Unwind_Ptr) context->sp;
+ }
+
+ /* Overwrite the saved value for register INDEX in CONTEXT with VAL. */
+--
+1.8.1.4
+
diff --git a/patches/gcc/4.9.3/900-musl-support.patch b/patches/gcc/4.9.3/900-musl-support.patch
new file mode 100644
index 0000000..a711b06
--- /dev/null
+++ b/patches/gcc/4.9.3/900-musl-support.patch
@@ -0,0 +1,640 @@
+Add musl support to gcc
+
+This patch comes from the musl-cross project at
+https://bitbucket.org/GregorR/musl-cross/src. Compared to the upstream version:
+
+ * the config.sub modifications have been removed, because Buildroot
+ already overwrites all config.sub with a more recent config.sub
+ that has musl support.
+
+ * change to ensure that a dummy dynamic linker path
+ MUSL_DYNAMIC_LINKER<foo> is defined for all architectures,
+ otherwise building gcc for architectures not supported by musl was
+ causing build failure. Bug reported upstream at
+ https://bitbucket.org/GregorR/musl-gcc-patches/issue/4/musl-gcc-patches-break-the-build-on.
+
+ * change the USE_PT_GNU_EH_FRAME logic to keep the existing gcc logic
+ and only add the musl one as an addition, not as a replacement. Not
+ doing this breaks C++ exception handling with glibc, because
+ USE_PT_GNU_EH_FRAME doesn't get defined due to the configure script
+ not testing dl_iterate_phdr() on any system except Solaris.
+
+[Gustavo: remove upstream applied gcc/config/sh/sh.c chunk for 4.9.1]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+
+Index: b/fixincludes/mkfixinc.sh
+===================================================================
+--- a/fixincludes/mkfixinc.sh
++++ b/fixincludes/mkfixinc.sh
+@@ -19,7 +19,8 @@
+ powerpc-*-eabi* | \
+ powerpc-*-rtems* | \
+ powerpcle-*-eabisim* | \
+- powerpcle-*-eabi* )
++ powerpcle-*-eabi* | \
++ *-musl* )
+ # IF there is no include fixing,
+ # THEN create a no-op fixer and exit
+ (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
+Index: b/gcc/config.gcc
+===================================================================
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -594,7 +594,7 @@
+ esac
+
+ # Common C libraries.
+-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
+
+ # 32-bit x86 processors supported by --with-arch=. Each processor
+ # MUST be separated by exactly one space.
+@@ -719,6 +719,9 @@
+ *-*-*uclibc*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+ ;;
++ *-*-*musl*)
++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
++ ;;
+ *)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
+ ;;
+@@ -2322,6 +2325,10 @@
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
+Index: b/gcc/config/aarch64/aarch64-linux.h
+===================================================================
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -22,6 +22,8 @@
+ #define GCC_AARCH64_LINUX_H
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1"
+
+ #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+
+Index: b/gcc/config/arm/linux-eabi.h
+===================================================================
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -77,6 +77,23 @@
+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+
++/* For ARM musl currently supports four dynamic linkers:
++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
++ musl does not support the legacy OABI mode.
++ All the dynamic linkers live in /lib.
++ We default to soft-float, EL. */
++#undef MUSL_DYNAMIC_LINKER
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
++#endif
++#define MUSL_DYNAMIC_LINKER \
++ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+ #undef LINK_SPEC
+Index: b/gcc/config/i386/linux.h
+===================================================================
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -21,3 +21,5 @@
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
+Index: b/gcc/config/i386/linux64.h
+===================================================================
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -30,3 +30,10 @@
+ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++
++#undef MUSL_DYNAMIC_LINKER32
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
++#undef MUSL_DYNAMIC_LINKER64
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
++#undef MUSL_DYNAMIC_LINKERX32
++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
+Index: b/gcc/config/linux.h
+===================================================================
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -32,10 +32,12 @@
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
+ #else
+ #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+ #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
+ #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
+@@ -53,18 +55,21 @@
+ uClibc or Bionic is the default C library and whether
+ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+
+-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
+- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
+
+ #if DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
+ #elif DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
+ #elif DEFAULT_LIBC == LIBC_BIONIC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif /* DEFAULT_LIBC */
+@@ -82,23 +87,103 @@
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+ #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32"
+
++/* Musl dynamic linker paths must be defined on a per-architecture
++ basis, for each architecture supported by Musl. However, in order
++ to let other architectures continue to build with other C
++ libraries, we provide a dummy definition of the following defines. */
++#define MUSL_DYNAMIC_LINKER "invalid"
++#define MUSL_DYNAMIC_LINKER32 "invalid"
++#define MUSL_DYNAMIC_LINKER64 "invalid"
++#define MUSL_DYNAMIC_LINKERX32 "invalid"
++
+ #define GNU_USER_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
+- BIONIC_DYNAMIC_LINKER)
++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+ #define GNU_USER_DYNAMIC_LINKER32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
+- BIONIC_DYNAMIC_LINKER32)
++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
+- BIONIC_DYNAMIC_LINKER64)
++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+ #define GNU_USER_DYNAMIC_LINKERX32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
+- BIONIC_DYNAMIC_LINKERX32)
++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKER32)
+
+ /* Whether we have Bionic libc runtime */
+ #undef TARGET_HAS_BIONIC
+ #define TARGET_HAS_BIONIC (OPTION_BIONIC)
+
++/* musl avoids problematic includes by rearranging the include directories.
++ * Unfortunately, this is mostly duplicated from cppdefault.c */
++#if DEFAULT_LIBC == LIBC_MUSL
++#define INCLUDE_DEFAULTS_MUSL_GPP \
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
++
++#ifdef LOCAL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_LOCAL \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_LOCAL
++#endif
++
++#ifdef PREFIX_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_PREFIX \
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_PREFIX
++#endif
++
++#ifdef CROSS_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_CROSS \
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#ifdef TOOL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_TOOL \
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_TOOL
++#endif
++
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++#define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_NATIVE
++#endif
++
++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
++# undef INCLUDE_DEFAULTS_MUSL_LOCAL
++# define INCLUDE_DEFAULTS_MUSL_LOCAL
++# undef INCLUDE_DEFAULTS_MUSL_NATIVE
++# define INCLUDE_DEFAULTS_MUSL_NATIVE
++#else
++# undef INCLUDE_DEFAULTS_MUSL_CROSS
++# define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#undef INCLUDE_DEFAULTS
++#define INCLUDE_DEFAULTS \
++ { \
++ INCLUDE_DEFAULTS_MUSL_GPP \
++ INCLUDE_DEFAULTS_MUSL_PREFIX \
++ INCLUDE_DEFAULTS_MUSL_CROSS \
++ INCLUDE_DEFAULTS_MUSL_TOOL \
++ INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
++ { 0, 0, 0, 0, 0, 0 } \
++ }
++#endif
++
+ #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
+ /* This is a *uclinux* target. We don't define below macros to normal linux
+ versions, because doing so would require *uclinux* targets to include
+Index: b/gcc/config/linux.opt
+===================================================================
+--- a/gcc/config/linux.opt
++++ b/gcc/config/linux.opt
+@@ -30,3 +30,7 @@
+ muclibc
+ Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
+ Use uClibc C library
++
++mmusl
++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
++Use musl C library
+Index: b/gcc/config/microblaze/linux.h
+===================================================================
+--- a/gcc/config/microblaze/linux.h
++++ b/gcc/config/microblaze/linux.h
+@@ -25,7 +25,23 @@
+ #undef TLS_NEEDS_GOT
+ #define TLS_NEEDS_GOT 1
+
+-#define DYNAMIC_LINKER "/lib/ld.so.1"
++#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */
++#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
++#endif
++
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++
++#if DEFAULT_LIBC == LIBC_MUSL
++#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER
++#else
++#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER
++#endif
++
++
+ #undef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+ { "dynamic_linker", DYNAMIC_LINKER }
+Index: b/gcc/config/rs6000/linux64.h
+===================================================================
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -375,17 +375,23 @@
+ #endif
+ #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#undef MUSL_DYNAMIC_LINKER32
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
++#undef MUSL_DYNAMIC_LINKER64
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER32 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+
+ #undef DEFAULT_ASM_ENDIAN
+ #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+Index: b/gcc/config/rs6000/secureplt.h
+===================================================================
+--- a/gcc/config/rs6000/secureplt.h
++++ b/gcc/config/rs6000/secureplt.h
+@@ -18,3 +18,4 @@
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+Index: b/gcc/config/rs6000/sysv4.h
+===================================================================
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -537,6 +537,9 @@
+ #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
+ #define CC1_SECURE_PLT_DEFAULT_SPEC ""
+ #endif
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
+
+ /* Pass -G xxx to the compiler. */
+ #define CC1_SPEC "%{G*} %(cc1_cpu)" \
+@@ -585,7 +588,8 @@
+
+ /* Override the default target of the linker. */
+ #define LINK_TARGET_SPEC \
+- ENDIAN_SELECT("", " --oformat elf32-powerpcle", "")
++ ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \
++ "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
+
+ /* Any specific OS flags. */
+ #define LINK_OS_SPEC "\
+@@ -763,15 +767,18 @@
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER \
+- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+@@ -894,6 +901,7 @@
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
+Index: b/gcc/config/sh/linux.h
+===================================================================
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -43,7 +43,15 @@
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
++#if TARGET_BIG_ENDIAN_DEFAULT /* BE */
++#define MUSL_DYNAMIC_LINKER_E "eb"
++#else
++#define MUSL_DYNAMIC_LINKER_E
++#endif
++
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E ".so.1"
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+Index: b/gcc/configure
+===================================================================
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27449,6 +27453,9 @@
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+Index: b/gcc/configure.ac
+===================================================================
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5108,6 +5112,9 @@
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+ GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+Index: b/gcc/ginclude/stddef.h
+===================================================================
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -181,6 +181,7 @@
+ #ifndef _GCC_SIZE_T
+ #ifndef _SIZET_
+ #ifndef __size_t
++#ifndef __DEFINED_size_t /* musl */
+ #define __size_t__ /* BeOS */
+ #define __SIZE_T__ /* Cray Unicos/Mk */
+ #define _SIZE_T
+@@ -197,6 +198,7 @@
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
++#define __DEFINED_size_t /* musl */
+ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
+ || defined(__FreeBSD_kernel__)
+ /* __size_t is a typedef on FreeBSD 5, must not trash it. */
+@@ -214,6 +216,7 @@
+ typedef long ssize_t;
+ #endif /* __BEOS__ */
+ #endif /* !(defined (__GNUG__) && defined (size_t)) */
++#endif /* __DEFINED_size_t */
+ #endif /* __size_t */
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+Index: b/libgcc/unwind-dw2-fde-dip.c
+===================================================================
+--- a/libgcc/unwind-dw2-fde-dip.c
++++ b/libgcc/unwind-dw2-fde-dip.c
+@@ -73,6 +73,13 @@
+ && defined(TARGET_DL_ITERATE_PHDR) \
+ && defined(__sun__) && defined(__svr4__)
+ # define USE_PT_GNU_EH_FRAME
++ #endif
++
++/* For musl libc, TARGET_DL_ITERATE_PHDR gets defined by the configure
++ script. */
++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
++ && defined(TARGET_DL_ITERATE_PHDR)
++# define USE_PT_GNU_EH_FRAME
+ #endif
+
+ #if defined(USE_PT_GNU_EH_FRAME)
+Index: b/libgomp/config/posix/time.c
+===================================================================
+--- a/libgomp/config/posix/time.c
++++ b/libgomp/config/posix/time.c
+@@ -28,6 +28,8 @@
+ The following implementation uses the most simple POSIX routines.
+ If present, POSIX 4 clocks should be used instead. */
+
++#define _POSIX_C_SOURCE 199309L /* for clocks */
++
+ #include "libgomp.h"
+ #include <unistd.h>
+ #if TIME_WITH_SYS_TIME
+Index: b/libitm/config/arm/hwcap.cc
+===================================================================
+--- a/libitm/config/arm/hwcap.cc
++++ b/libitm/config/arm/hwcap.cc
+@@ -40,7 +40,11 @@
+
+ #ifdef __linux__
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/fcntl.h>
++#else
++#include <fcntl.h>
++#endif
+ #include <elf.h>
+
+ static void __attribute__((constructor))
+Index: b/libitm/config/linux/x86/tls.h
+===================================================================
+--- a/libitm/config/linux/x86/tls.h
++++ b/libitm/config/linux/x86/tls.h
+@@ -25,16 +25,19 @@
+ #ifndef LIBITM_X86_TLS_H
+ #define LIBITM_X86_TLS_H 1
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ /* Use slots in the TCB head rather than __thread lookups.
+ GLIBC has reserved words 10 through 13 for TM. */
+ #define HAVE_ARCH_GTM_THREAD 1
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
+ #endif
++#endif
+
+ #include "config/generic/tls.h"
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ namespace GTM HIDDEN {
+
+ #ifdef __x86_64__
+@@ -101,5 +104,6 @@
+
+ } // namespace GTM
+ #endif /* >= GLIBC 2.10 */
++#endif
+
+ #endif // LIBITM_X86_TLS_H
+Index: b/libstdc++-v3/configure.host
+===================================================================
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -264,6 +264,13 @@
+ os_include_dir="os/bsd/freebsd"
+ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
++ # check for musl by target
++ case "${host_os}" in
++ *-musl*)
++ os_include_dir="os/generic"
++ ;;
++ *)
++
+ if [ "$uclibc" = "yes" ]; then
+ os_include_dir="os/uclibc"
+ elif [ "$bionic" = "yes" ]; then
+@@ -272,6 +279,9 @@
+ os_include_dir="os/gnu-linux"
+ fi
+ ;;
++
++ esac
++ ;;
+ hpux*)
+ os_include_dir="os/hpux"
+ ;;
+Index: b/gcc/config/mips/linux64.h
+===================================================================
+--- a/gcc/config/mips/linux64.h
++++ b/gcc/config/mips/linux64.h
+@@ -41,4 +41,4 @@
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+- BIONIC_DYNAMIC_LINKERN32)
++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKER)
+Index: b/gcc/config/mips/linux.h
+===================================================================
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -23,3 +23,11 @@
+ #undef UCLIBC_DYNAMIC_LINKER
+ #define UCLIBC_DYNAMIC_LINKER \
+ "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
++
++#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
++#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
++#endif
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
diff --git a/patches/gcc/4.9.3/920-libgcc-remove-unistd-header.patch b/patches/gcc/4.9.3/920-libgcc-remove-unistd-header.patch
new file mode 100644
index 0000000..df5372b
--- /dev/null
+++ b/patches/gcc/4.9.3/920-libgcc-remove-unistd-header.patch
@@ -0,0 +1,12 @@
+Upstream status: In progress
+
+--- a/libgcc/config/nios2/linux-atomic.c
++++ b/libgcc/config/nios2/linux-atomic.c
+@@ -20,7 +20,6 @@
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+-#include <asm/unistd.h>
+ #define EFAULT 14
+ #define EBUSY 16
+ #define ENOSYS 38
diff --git a/patches/gcc/5.2.0/100-uclibc-conf.patch b/patches/gcc/5.2.0/100-uclibc-conf.patch
new file mode 100644
index 0000000..73d1f0d
--- /dev/null
+++ b/patches/gcc/5.2.0/100-uclibc-conf.patch
@@ -0,0 +1,15 @@
+Index: b/contrib/regression/objs-gcc.sh
+===================================================================
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@
+ 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
diff --git a/patches/gcc/5.2.0/201-libgcc-remove-unistd-header.patch b/patches/gcc/5.2.0/201-libgcc-remove-unistd-header.patch
new file mode 100644
index 0000000..20d1c06
--- /dev/null
+++ b/patches/gcc/5.2.0/201-libgcc-remove-unistd-header.patch
@@ -0,0 +1,14 @@
+Upstream status: In progress
+
+Index: b/libgcc/config/nios2/linux-atomic.c
+===================================================================
+--- a/libgcc/config/nios2/linux-atomic.c
++++ b/libgcc/config/nios2/linux-atomic.c
+@@ -20,7 +20,6 @@
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+-#include <asm/unistd.h>
+ #define EFAULT 14
+ #define EBUSY 16
+ #define ENOSYS 38
diff --git a/patches/gcc/5.2.0/301-missing-execinfo_h.patch b/patches/gcc/5.2.0/301-missing-execinfo_h.patch
new file mode 100644
index 0000000..2d0e7ba
--- /dev/null
+++ b/patches/gcc/5.2.0/301-missing-execinfo_h.patch
@@ -0,0 +1,13 @@
+Index: b/boehm-gc/include/gc.h
+===================================================================
+--- a/boehm-gc/include/gc.h
++++ b/boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+- && !defined(__ia64__)
++ && !defined(__ia64__) && !defined(__UCLIBC__)
+ # ifndef GC_HAVE_BUILTIN_BACKTRACE
+ # define GC_HAVE_BUILTIN_BACKTRACE
+ # endif
diff --git a/patches/gcc/5.2.0/810-arm-softfloat-libgcc.patch b/patches/gcc/5.2.0/810-arm-softfloat-libgcc.patch
new file mode 100644
index 0000000..5efa7fd
--- /dev/null
+++ b/patches/gcc/5.2.0/810-arm-softfloat-libgcc.patch
@@ -0,0 +1,30 @@
+Index: b/gcc/config/arm/linux-elf.h
+===================================================================
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -60,7 +60,7 @@
+ %{shared:-lc} \
+ %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+
+-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
++#define LIBGCC_SPEC "-lgcc"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+Index: b/libgcc/config/arm/t-linux
+===================================================================
+--- a/libgcc/config/arm/t-linux
++++ b/libgcc/config/arm/t-linux
+@@ -1,6 +1,11 @@
+ LIB1ASMSRC = arm/lib1funcs.S
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_addsubdf3 _arm_addsubsf3 \
++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++ _arm_fixsfsi _arm_fixunssfsi
+
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference.
diff --git a/patches/gcc/5.2.0/830-arm_unbreak_armv4t.patch b/patches/gcc/5.2.0/830-arm_unbreak_armv4t.patch
new file mode 100644
index 0000000..b730059
--- /dev/null
+++ b/patches/gcc/5.2.0/830-arm_unbreak_armv4t.patch
@@ -0,0 +1,15 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+Index: b/gcc/config/arm/linux-eabi.h
+===================================================================
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -45,7 +45,7 @@
+ The ARM10TDMI core is the default for armv5t, so set
+ SUBTARGET_CPU_DEFAULT to achieve this. */
+ #undef SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+ config.gcc for big endian configurations. */
diff --git a/patches/gcc/5.2.0/840-microblaze-enable-dwarf-eh-support.patch b/patches/gcc/5.2.0/840-microblaze-enable-dwarf-eh-support.patch
new file mode 100644
index 0000000..9d29090
--- /dev/null
+++ b/patches/gcc/5.2.0/840-microblaze-enable-dwarf-eh-support.patch
@@ -0,0 +1,166 @@
+Fetched from Xilinx gcc git at https://github.com/Xilinx/gcc
+
+From 23c35173490ac2d6348a668dfc9c1a6eb62171f2 Mon Sep 17 00:00:00 2001
+From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
+Date: Mon, 18 Jun 2012 20:18:13 +0200
+Subject: [PATCH] [Patch, microblaze]: Enable DWARF exception handling support.
+
+Changelog
+
+2013-03-18 Edgar E. Iglesias <edgar.iglesias@xilinx.com>
+ David Holsgrove <david.holsgrove@xilinx.com>
+
+ * common/config/microblaze/microblaze-common.c: Remove
+ TARGET_EXCEPT_UNWIND_INFO definition.
+ * config/microblaze/microblaze-protos.h: Add
+ microblaze_eh_return prototype.
+ * gcc/config/microblaze/microblaze.c: (microblaze_must_save_register,
+ microblaze_expand_epilogue, microblaze_return_addr): Handle
+ calls_eh_return
+ (microblaze_eh_return): New function.
+ * gcc/config/microblaze/microblaze.h: Define RETURN_ADDR_OFFSET,
+ EH_RETURN_DATA_REGNO, MB_EH_STACKADJ_REGNUM, EH_RETURN_STACKADJ_RTX,
+ ASM_PREFERRED_EH_DATA_FORMAT
+ * gcc/config/microblaze/microblaze.md: Define eh_return pattern.
+
+Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
+Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
+---
+ gcc/common/config/microblaze/microblaze-common.c | 3 ---
+ gcc/config/microblaze/microblaze-protos.h | 1 +
+ gcc/config/microblaze/microblaze.c | 29 ++++++++++++++++++++----
+ gcc/config/microblaze/microblaze.h | 15 ++++++++++++
+ gcc/config/microblaze/microblaze.md | 11 +++++++++
+ 5 files changed, 52 insertions(+), 7 deletions(-)
+
+Index: b/gcc/common/config/microblaze/microblaze-common.c
+===================================================================
+--- a/gcc/common/config/microblaze/microblaze-common.c
++++ b/gcc/common/config/microblaze/microblaze-common.c
+@@ -37,7 +37,4 @@
+ #undef TARGET_OPTION_OPTIMIZATION_TABLE
+ #define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table
+
+-#undef TARGET_EXCEPT_UNWIND_INFO
+-#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+-
+ struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
+Index: b/gcc/config/microblaze/microblaze-protos.h
+===================================================================
+--- a/gcc/config/microblaze/microblaze-protos.h
++++ b/gcc/config/microblaze/microblaze-protos.h
+@@ -56,6 +56,7 @@
+ extern int symbol_mentioned_p (rtx);
+ extern int label_mentioned_p (rtx);
+ extern bool microblaze_cannot_force_const_mem (machine_mode, rtx);
++extern void microblaze_eh_return (rtx op0);
+ #endif /* RTX_CODE */
+
+ /* Declare functions in microblaze-c.c. */
+Index: b/gcc/config/microblaze/microblaze.c
+===================================================================
+--- a/gcc/config/microblaze/microblaze.c
++++ b/gcc/config/microblaze/microblaze.c
+@@ -1959,6 +1959,11 @@
+ if (frame_pointer_needed && (regno == HARD_FRAME_POINTER_REGNUM))
+ return 1;
+
++ if (crtl->calls_eh_return
++ && regno == MB_ABI_SUB_RETURN_ADDR_REGNUM) {
++ return 1;
++ }
++
+ if (!crtl->is_leaf)
+ {
+ if (regno == MB_ABI_SUB_RETURN_ADDR_REGNUM)
+@@ -1986,6 +1991,13 @@
+ return 1;
+ }
+
++ if (crtl->calls_eh_return
++ && (regno == EH_RETURN_DATA_REGNO (0)
++ || regno == EH_RETURN_DATA_REGNO (1)))
++ {
++ return 1;
++ }
++
+ return 0;
+ }
+
+@@ -3067,6 +3079,12 @@
+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx));
+ }
+
++ if (crtl->calls_eh_return)
++ emit_insn (gen_addsi3 (stack_pointer_rtx,
++ stack_pointer_rtx,
++ gen_rtx_raw_REG (SImode,
++ MB_EH_STACKADJ_REGNUM)));
++
+ emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, GP_REG_FIRST +
+ MB_ABI_SUB_RETURN_ADDR_REGNUM)));
+ }
+@@ -3364,10 +3382,13 @@
+ if (count != 0)
+ return NULL_RTX;
+
+- return gen_rtx_PLUS (Pmode,
+- get_hard_reg_initial_val (Pmode,
+- MB_ABI_SUB_RETURN_ADDR_REGNUM),
+- GEN_INT (8));
++ return get_hard_reg_initial_val (Pmode,
++ MB_ABI_SUB_RETURN_ADDR_REGNUM);
++}
++
++void microblaze_eh_return (rtx op0)
++{
++ emit_insn (gen_movsi(gen_rtx_MEM(Pmode, stack_pointer_rtx), op0));
+ }
+
+ /* Queue an .ident string in the queue of top-level asm statements.
+Index: b/gcc/config/microblaze/microblaze.h
+===================================================================
+--- a/gcc/config/microblaze/microblaze.h
++++ b/gcc/config/microblaze/microblaze.h
+@@ -184,6 +184,21 @@
+ #define INCOMING_RETURN_ADDR_RTX \
+ gen_rtx_REG (VOIDmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM)
+
++/* Specifies the offset from INCOMING_RETURN_ADDR_RTX and the actual return PC. */
++#define RETURN_ADDR_OFFSET (8)
++
++/* Describe how we implement __builtin_eh_return. */
++#define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? MB_ABI_FIRST_ARG_REGNUM + (N) : INVALID_REGNUM)
++
++#define MB_EH_STACKADJ_REGNUM MB_ABI_INT_RETURN_VAL2_REGNUM
++#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, MB_EH_STACKADJ_REGNUM)
++
++/* Select a format to encode pointers in exception handling data. CODE
++ is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is
++ true if the symbol may be affected by dynamic relocations. */
++#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
++ ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
++
+ /* Use DWARF 2 debugging information by default. */
+ #define DWARF2_DEBUGGING_INFO
+ #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+Index: b/gcc/config/microblaze/microblaze.md
+===================================================================
+--- a/gcc/config/microblaze/microblaze.md
++++ b/gcc/config/microblaze/microblaze.md
+@@ -2272,4 +2272,15 @@
+ (set_attr "mode" "SI")
+ (set_attr "length" "4")])
+
++; This is used in compiling the unwind routines.
++(define_expand "eh_return"
++ [(use (match_operand 0 "general_operand" ""))]
++ ""
++ "
++{
++ microblaze_eh_return(operands[0]);
++ DONE;
++}")
++
+ (include "sync.md")
++
diff --git a/patches/gcc/5.2.0/850-libstdcxx-uclibc-c99.patch b/patches/gcc/5.2.0/850-libstdcxx-uclibc-c99.patch
new file mode 100644
index 0000000..9e97d94
--- /dev/null
+++ b/patches/gcc/5.2.0/850-libstdcxx-uclibc-c99.patch
@@ -0,0 +1,273 @@
+Allow C99-depending features of libstdc++ with uClibc
+
+The libstdc++ code is fairly restrictive on how it checks for C99
+compatibility: it requires *complete* C99 support to enable certain
+features. For example, uClibc provides a good number of C99 features,
+but not C99 complex number support. For this reason, libstdc++
+completely disables many the standard C++ methods that can in fact
+work because uClibc provides the necessary functions.
+
+This patch is similar and highly inspired from
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in
+a way that doesn't involve changing the configure.ac script, as
+autoreconfiguring gcc is complicated. It simply relies on the fact
+that uClibc defines the __UCLIBC__ definition.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/libstdc++-v3/config/locale/generic/c_locale.h
+===================================================================
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -70,7 +70,7 @@
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+ #else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+Index: b/libstdc++-v3/config/locale/gnu/c_locale.h
+===================================================================
+--- a/libstdc++-v3/config/locale/gnu/c_locale.h
++++ b/libstdc++-v3/config/locale/gnu/c_locale.h
+@@ -88,7 +88,7 @@
+ __builtin_va_list __args;
+ __builtin_va_start(__args, __fmt);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
+ #else
+ const int __ret = __builtin_vsprintf(__out, __fmt, __args);
+Index: b/libstdc++-v3/include/bits/basic_string.h
+===================================================================
+--- a/libstdc++-v3/include/bits/basic_string.h
++++ b/libstdc++-v3/include/bits/basic_string.h
+@@ -5239,7 +5239,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
++#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
+
+ #include <ext/string_conversions.h>
+
+Index: b/libstdc++-v3/include/bits/locale_facets.tcc
+===================================================================
+--- a/libstdc++-v3/include/bits/locale_facets.tcc
++++ b/libstdc++-v3/include/bits/locale_facets.tcc
+@@ -992,7 +992,7 @@
+ char __fbuf[16];
+ __num_base::_S_format_float(__io, __fbuf, __mod);
+
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ // Precision is always used except for hexfloat format.
+ const bool __use_prec =
+ (__io.flags() & ios_base::floatfield) != ios_base::floatfield;
+Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+===================================================================
+--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
++++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+@@ -578,7 +578,7 @@
+ {
+ const locale __loc = __io.getloc();
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ // First try a buffer perhaps big enough.
+ int __cs_size = 64;
+ char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
+Index: b/libstdc++-v3/include/c_compatibility/math.h
+===================================================================
+--- a/libstdc++-v3/include/c_compatibility/math.h
++++ b/libstdc++-v3/include/c_compatibility/math.h
+@@ -56,7 +56,7 @@
+ using std::floor;
+ using std::fmod;
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::fpclassify;
+ using std::isfinite;
+ using std::isinf;
+Index: b/libstdc++-v3/include/c_compatibility/wchar.h
+===================================================================
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -103,7 +103,7 @@
+ using std::wmemset;
+ using std::wcsftime;
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/c_global/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/c_global/cstdlib
++++ b/libstdc++-v3/include/c_global/cstdlib
+@@ -195,7 +195,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef _Exit
+ #undef llabs
+Index: b/libstdc++-v3/include/c_global/cwchar
+===================================================================
+--- a/libstdc++-v3/include/c_global/cwchar
++++ b/libstdc++-v3/include/c_global/cwchar
+@@ -232,7 +232,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef wcstold
+ #undef wcstoll
+@@ -289,7 +289,7 @@
+ using std::vwscanf;
+ #endif
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/c_std/cstdio
+===================================================================
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -144,7 +144,7 @@
+ using ::vsprintf;
+ } // namespace std
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
+Index: b/libstdc++-v3/include/c_std/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/c_std/cstdlib
++++ b/libstdc++-v3/include/c_std/cstdlib
+@@ -192,7 +192,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef _Exit
+ #undef llabs
+Index: b/libstdc++-v3/include/c_std/cwchar
+===================================================================
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -228,7 +228,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef wcstold
+ #undef wcstoll
+Index: b/libstdc++-v3/include/ext/vstring.h
+===================================================================
+--- a/libstdc++-v3/include/ext/vstring.h
++++ b/libstdc++-v3/include/ext/vstring.h
+@@ -2680,7 +2680,7 @@
+ _GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+-#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
++#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)))
+
+ #include <ext/string_conversions.h>
+
+Index: b/libstdc++-v3/include/tr1/cstdio
+===================================================================
+--- a/libstdc++-v3/include/tr1/cstdio
++++ b/libstdc++-v3/include/tr1/cstdio
+@@ -33,7 +33,7 @@
+
+ #include <cstdio>
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+Index: b/libstdc++-v3/include/tr1/cstdlib
+===================================================================
+--- a/libstdc++-v3/include/tr1/cstdlib
++++ b/libstdc++-v3/include/tr1/cstdlib
+@@ -35,7 +35,7 @@
+
+ #if _GLIBCXX_HOSTED
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+Index: b/libstdc++-v3/include/tr1/cwchar
+===================================================================
+--- a/libstdc++-v3/include/tr1/cwchar
++++ b/libstdc++-v3/include/tr1/cwchar
+@@ -52,7 +52,7 @@
+ using std::vwscanf;
+ #endif
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ using std::wcstold;
+ using std::wcstoll;
+ using std::wcstoull;
+Index: b/libstdc++-v3/include/tr1/stdlib.h
+===================================================================
+--- a/libstdc++-v3/include/tr1/stdlib.h
++++ b/libstdc++-v3/include/tr1/stdlib.h
+@@ -33,7 +33,7 @@
+
+ #if _GLIBCXX_HOSTED
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ using std::tr1::atoll;
+ using std::tr1::strtoll;
+Index: b/libstdc++-v3/src/c++11/debug.cc
+===================================================================
+--- a/libstdc++-v3/src/c++11/debug.cc
++++ b/libstdc++-v3/src/c++11/debug.cc
+@@ -788,7 +788,7 @@
+ int __n __attribute__ ((__unused__)),
+ const char* __fmt, _Tp __s) const throw ()
+ {
+-#ifdef _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+ std::snprintf(__buf, __n, __fmt, __s);
+ #else
+ std::sprintf(__buf, __fmt, __s);
+Index: b/libstdc++-v3/include/c_global/cstdio
+===================================================================
+--- a/libstdc++-v3/include/c_global/cstdio
++++ b/libstdc++-v3/include/c_global/cstdio
+@@ -146,7 +146,7 @@
+ using ::vsprintf;
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/patches/gcc/5.2.0/860-cilk-wchar.patch b/patches/gcc/5.2.0/860-cilk-wchar.patch
new file mode 100644
index 0000000..1d9916f
--- /dev/null
+++ b/patches/gcc/5.2.0/860-cilk-wchar.patch
@@ -0,0 +1,56 @@
+[PATCH] cilk: fix build without wchar
+
+When building against uClibc with wchar support disabled, WCHAR_MIN and
+WCHAR_MAX are not defined leading to compilation errors.
+
+Fix it by only including the wchar code if available.
+
+Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
+---
+ libcilkrts/include/cilk/reducer_min_max.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+Index: b/libcilkrts/include/cilk/reducer_min_max.h
+===================================================================
+--- a/libcilkrts/include/cilk/reducer_min_max.h
++++ b/libcilkrts/include/cilk/reducer_min_max.h
+@@ -3154,7 +3154,9 @@
+ CILK_C_REDUCER_MAX_INSTANCE(char, char, CHAR_MIN)
+ CILK_C_REDUCER_MAX_INSTANCE(unsigned char, uchar, 0)
+ CILK_C_REDUCER_MAX_INSTANCE(signed char, schar, SCHAR_MIN)
++#ifdef WCHAR_MIN
+ CILK_C_REDUCER_MAX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN)
++#endif
+ CILK_C_REDUCER_MAX_INSTANCE(short, short, SHRT_MIN)
+ CILK_C_REDUCER_MAX_INSTANCE(unsigned short, ushort, 0)
+ CILK_C_REDUCER_MAX_INSTANCE(int, int, INT_MIN)
+@@ -3306,7 +3308,9 @@
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(char, char, CHAR_MIN)
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned char, uchar, 0)
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(signed char, schar, SCHAR_MIN)
++#ifdef WCHAR_MIN
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN)
++#endif
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(short, short, SHRT_MIN)
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned short, ushort, 0)
+ CILK_C_REDUCER_MAX_INDEX_INSTANCE(int, int, INT_MIN)
+@@ -3432,7 +3436,9 @@
+ CILK_C_REDUCER_MIN_INSTANCE(char, char, CHAR_MAX)
+ CILK_C_REDUCER_MIN_INSTANCE(unsigned char, uchar, CHAR_MAX)
+ CILK_C_REDUCER_MIN_INSTANCE(signed char, schar, SCHAR_MAX)
++#ifdef WCHAR_MAX
+ CILK_C_REDUCER_MIN_INSTANCE(wchar_t, wchar_t, WCHAR_MAX)
++#endif
+ CILK_C_REDUCER_MIN_INSTANCE(short, short, SHRT_MAX)
+ CILK_C_REDUCER_MIN_INSTANCE(unsigned short, ushort, USHRT_MAX)
+ CILK_C_REDUCER_MIN_INSTANCE(int, int, INT_MAX)
+@@ -3584,7 +3590,9 @@
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(char, char, CHAR_MAX)
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned char, uchar, CHAR_MAX)
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(signed char, schar, SCHAR_MAX)
++#ifdef WCHAR_MAX
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MAX)
++#endif
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(short, short, SHRT_MAX)
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned short, ushort, USHRT_MAX)
+ CILK_C_REDUCER_MIN_INDEX_INSTANCE(int, int, INT_MAX)
diff --git a/patches/gcc/5.2.0/870-xtensa-add-mauto-litpools-option.patch b/patches/gcc/5.2.0/870-xtensa-add-mauto-litpools-option.patch
new file mode 100644
index 0000000..aa1376c
--- /dev/null
+++ b/patches/gcc/5.2.0/870-xtensa-add-mauto-litpools-option.patch
@@ -0,0 +1,290 @@
+From 6d852ffb43b111a39162135c95249e749c4e285b Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Thu, 6 Aug 2015 01:16:02 +0300
+Subject: [PATCH] xtensa: add -mauto-litpools option
+
+With support from assembler this option allows compiling huge functions,
+where single literal pool at the beginning of a function may not be
+reachable by L32R instructions at its end.
+
+Currently assembler --auto-litpools option cannot deal with literals
+used from multiple locations separated by more than 256 KBytes of code.
+Don't turn constants into literals, instead use MOVI instruction to load
+them into registers and let the assembler turn them into literals as
+necessary.
+
+2015-08-12 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/constraints.md (define_constraint "Y"): New
+ constraint.
+ * config/xtensa/elf.h (ASM_SPEC): Add m(no-)auto-litpools.
+ * config/xtensa/linux.h (ASM_SPEC): Likewise.
+ * config/xtensa/predicates.md (move_operand): Match constants
+ and symbols in the presence of TARGET_AUTO_LITPOOLS.
+ * config/xtensa/xtensa.c (xtensa_valid_move): Don't allow
+ immediate references to TLS data.
+ (xtensa_emit_move_sequence): Don't force constants to memory in
+ the presence of TARGET_AUTO_LITPOOLS.
+ (print_operand): Add 'y' format, same as default, but capable of
+ printing SF mode constants as well.
+ * config/xtensa/xtensa.md (movsi_internal, movhi_internal)
+ (movsf_internal): Add movi pattern that loads literal.
+ (movsf, movdf): Don't force constants to memory in the presence
+ of TARGET_AUTO_LITPOOLS.
+ (movdf_internal): Add 'Y' constraint.
+ * config/xtensa/xtensa.opt (mauto-litpools): New option.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226828
+Changes to ChangeLogs and documentation are dropped.
+
+ gcc/config/xtensa/constraints.md | 5 +++++
+ gcc/config/xtensa/elf.h | 4 +++-
+ gcc/config/xtensa/linux.h | 4 +++-
+ gcc/config/xtensa/predicates.md | 3 ++-
+ gcc/config/xtensa/xtensa.c | 19 ++++++++++++++++++-
+ gcc/config/xtensa/xtensa.md | 35 +++++++++++++++++++----------------
+ gcc/config/xtensa/xtensa.opt | 4 ++++
+ 7 files changed, 54 insertions(+), 20 deletions(-)
+
+diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md
+index 30f4c1f..773d4f9 100644
+--- a/gcc/config/xtensa/constraints.md
++++ b/gcc/config/xtensa/constraints.md
+@@ -111,6 +111,11 @@
+ (and (match_code "const_int")
+ (match_test "xtensa_mask_immediate (ival)")))
+
++(define_constraint "Y"
++ "A constant that can be used in relaxed MOVI instructions."
++ (and (match_code "const_int,const_double,const,symbol_ref,label_ref")
++ (match_test "TARGET_AUTO_LITPOOLS")))
++
+ ;; Memory constraints. Do not use define_memory_constraint here. Doing so
+ ;; causes reload to force some constants into the constant pool, but since
+ ;; the Xtensa constant pool can only be accessed with L32R instructions, it
+diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
+index e59bede..12056f7 100644
+--- a/gcc/config/xtensa/elf.h
++++ b/gcc/config/xtensa/elf.h
+@@ -48,7 +48,9 @@ along with GCC; see the file COPYING3. If not see
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+- %{mno-longcalls:--no-longcalls}"
++ %{mno-longcalls:--no-longcalls} \
++ %{mauto-litpools:--auto-litpools} \
++ %{mno-auto-litpools:--no-auto-litpools}"
+
+ #undef LIB_SPEC
+ #define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal"
+diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
+index 675aacf..5b0243a 100644
+--- a/gcc/config/xtensa/linux.h
++++ b/gcc/config/xtensa/linux.h
+@@ -42,7 +42,9 @@ along with GCC; see the file COPYING3. If not see
+ %{mtarget-align:--target-align} \
+ %{mno-target-align:--no-target-align} \
+ %{mlongcalls:--longcalls} \
+- %{mno-longcalls:--no-longcalls}"
++ %{mno-longcalls:--no-longcalls} \
++ %{mauto-litpools:--auto-litpools} \
++ %{mno-auto-litpools:--no-auto-litpools}"
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
+diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md
+index e02209e..d7dfa11 100644
+--- a/gcc/config/xtensa/predicates.md
++++ b/gcc/config/xtensa/predicates.md
+@@ -142,7 +142,8 @@
+ (match_test "GET_MODE_CLASS (mode) == MODE_INT
+ && xtensa_simm12b (INTVAL (op))"))
+ (and (match_code "const_int,const_double,const,symbol_ref,label_ref")
+- (match_test "TARGET_CONST16 && CONSTANT_P (op)
++ (match_test "(TARGET_CONST16 || TARGET_AUTO_LITPOOLS)
++ && CONSTANT_P (op)
+ && GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0")))))
+
+ ;; Accept the floating point constant 1 in the appropriate mode.
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index eb039ba..206ff80 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -501,6 +501,9 @@ xtensa_valid_move (machine_mode mode, rtx *operands)
+ {
+ int dst_regnum = xt_true_regnum (operands[0]);
+
++ if (xtensa_tls_referenced_p (operands[1]))
++ return FALSE;
++
+ /* The stack pointer can only be assigned with a MOVSP opcode. */
+ if (dst_regnum == STACK_POINTER_REGNUM)
+ return !TARGET_WINDOWED_ABI
+@@ -1069,7 +1072,7 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode)
+ return 1;
+ }
+
+- if (! TARGET_CONST16)
++ if (! TARGET_AUTO_LITPOOLS && ! TARGET_CONST16)
+ {
+ src = force_const_mem (SImode, src);
+ operands[1] = src;
+@@ -2449,6 +2452,20 @@ print_operand (FILE *file, rtx x, int letter)
+ }
+ break;
+
++ case 'y':
++ if (GET_CODE (x) == CONST_DOUBLE &&
++ GET_MODE (x) == SFmode)
++ {
++ REAL_VALUE_TYPE r;
++ long l;
++ REAL_VALUE_FROM_CONST_DOUBLE (r, x);
++ REAL_VALUE_TO_TARGET_SINGLE (r, l);
++ fprintf (file, "0x%08lx", l);
++ break;
++ }
++
++ /* fall through */
++
+ default:
+ if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG)
+ fprintf (file, "%s", reg_names[xt_true_regnum (x)]);
+diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
+index 6d84384..0e673a3 100644
+--- a/gcc/config/xtensa/xtensa.md
++++ b/gcc/config/xtensa/xtensa.md
+@@ -761,8 +761,8 @@
+ })
+
+ (define_insn "movsi_internal"
+- [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,W,a,a,U,*a,*A")
+- (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,i,T,U,r,*A,*r"))]
++ [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,a,W,a,a,U,*a,*A")
++ (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,Y,i,T,U,r,*A,*r"))]
+ "xtensa_valid_move (SImode, operands)"
+ "@
+ movi.n\t%0, %x1
+@@ -774,15 +774,16 @@
+ mov\t%0, %1
+ movsp\t%0, %1
+ movi\t%0, %x1
++ movi\t%0, %1
+ const16\t%0, %t1\;const16\t%0, %b1
+ %v1l32r\t%0, %1
+ %v1l32i\t%0, %1
+ %v0s32i\t%1, %0
+ rsr\t%0, ACCLO
+ wsr\t%1, ACCLO"
+- [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,load,load,store,rsr,wsr")
++ [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr")
+ (set_attr "mode" "SI")
+- (set_attr "length" "2,2,2,2,2,2,3,3,3,6,3,3,3,3,3")])
++ (set_attr "length" "2,2,2,2,2,2,3,3,3,3,6,3,3,3,3,3")])
+
+ ;; 16-bit Integer moves
+
+@@ -796,21 +797,22 @@
+ })
+
+ (define_insn "movhi_internal"
+- [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A")
+- (match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))]
++ [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,a,U,*a,*A")
++ (match_operand:HI 1 "move_operand" "M,d,r,I,Y,U,r,*A,*r"))]
+ "xtensa_valid_move (HImode, operands)"
+ "@
+ movi.n\t%0, %x1
+ mov.n\t%0, %1
+ mov\t%0, %1
+ movi\t%0, %x1
++ movi\t%0, %1
+ %v1l16ui\t%0, %1
+ %v0s16i\t%1, %0
+ rsr\t%0, ACCLO
+ wsr\t%1, ACCLO"
+- [(set_attr "type" "move,move,move,move,load,store,rsr,wsr")
++ [(set_attr "type" "move,move,move,move,move,load,store,rsr,wsr")
+ (set_attr "mode" "HI")
+- (set_attr "length" "2,2,3,3,3,3,3,3")])
++ (set_attr "length" "2,2,3,3,3,3,3,3,3")])
+
+ ;; 8-bit Integer moves
+
+@@ -881,7 +883,7 @@
+ (match_operand:SF 1 "general_operand" ""))]
+ ""
+ {
+- if (!TARGET_CONST16 && CONSTANT_P (operands[1]))
++ if (!TARGET_CONST16 && !TARGET_AUTO_LITPOOLS && CONSTANT_P (operands[1]))
+ operands[1] = force_const_mem (SFmode, operands[1]);
+
+ if ((!register_operand (operands[0], SFmode)
+@@ -896,8 +898,8 @@
+ })
+
+ (define_insn "movsf_internal"
+- [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,W,a,a,U")
+- (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,iF,T,U,r"))]
++ [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,a,W,a,a,U")
++ (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,Y,iF,T,U,r"))]
+ "((register_operand (operands[0], SFmode)
+ || register_operand (operands[1], SFmode))
+ && !(FP_REG_P (xt_true_regnum (operands[0]))
+@@ -912,13 +914,14 @@
+ mov\t%0, %1
+ wfr\t%0, %1
+ rfr\t%0, %1
++ movi\t%0, %y1
+ const16\t%0, %t1\;const16\t%0, %b1
+ %v1l32r\t%0, %1
+ %v1l32i\t%0, %1
+ %v0s32i\t%1, %0"
+- [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,load,load,store")
++ [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,move,load,load,store")
+ (set_attr "mode" "SF")
+- (set_attr "length" "3,3,3,2,2,2,3,3,3,6,3,3,3")])
++ (set_attr "length" "3,3,3,2,2,2,3,3,3,3,6,3,3,3")])
+
+ (define_insn "*lsiu"
+ [(set (match_operand:SF 0 "register_operand" "=f")
+@@ -991,7 +994,7 @@
+ (match_operand:DF 1 "general_operand" ""))]
+ ""
+ {
+- if (CONSTANT_P (operands[1]) && !TARGET_CONST16)
++ if (CONSTANT_P (operands[1]) && !TARGET_CONST16 && !TARGET_AUTO_LITPOOLS)
+ operands[1] = force_const_mem (DFmode, operands[1]);
+
+ if (!register_operand (operands[0], DFmode)
+@@ -1002,8 +1005,8 @@
+ })
+
+ (define_insn_and_split "movdf_internal"
+- [(set (match_operand:DF 0 "nonimmed_operand" "=a,W,a,a,U")
+- (match_operand:DF 1 "move_operand" "r,iF,T,U,r"))]
++ [(set (match_operand:DF 0 "nonimmed_operand" "=a,a,W,a,a,U")
++ (match_operand:DF 1 "move_operand" "r,Y,iF,T,U,r"))]
+ "register_operand (operands[0], DFmode)
+ || register_operand (operands[1], DFmode)"
+ "#"
+diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt
+index 2fd6cee..21c6e96 100644
+--- a/gcc/config/xtensa/xtensa.opt
++++ b/gcc/config/xtensa/xtensa.opt
+@@ -38,6 +38,10 @@ mtext-section-literals
+ Target
+ Intersperse literal pools with code in the text section
+
++mauto-litpools
++Target Report Mask(AUTO_LITPOOLS)
++Relax literals in assembler and place them automatically in the text section
++
+ mserialize-volatile
+ Target Report Mask(SERIALIZE_VOLATILE)
+ -mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions
+--
+1.8.1.4
+
diff --git a/patches/gcc/5.2.0/871-xtensa-reimplement-register-spilling.patch b/patches/gcc/5.2.0/871-xtensa-reimplement-register-spilling.patch
new file mode 100644
index 0000000..4056f8b
--- /dev/null
+++ b/patches/gcc/5.2.0/871-xtensa-reimplement-register-spilling.patch
@@ -0,0 +1,76 @@
+From 40507bf199440082ed69b777986d50c31efe2520 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Mon, 10 Aug 2015 21:35:20 +0300
+Subject: [PATCH 1/3] xtensa: reimplement register spilling
+
+Spilling windowed registers in userspace is much easier, more portable,
+less error-prone and equally effective as in kernel. Now that register
+spilling syscall is considered obsolete in the xtensa linux kernel
+replace it with CALL12 followed by series of ENTRY in libgcc.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/lib2funcs.S (__xtensa_libgcc_window_spill): Use
+ CALL12 followed by series of ENTRY to spill windowed registers.
+ (__xtensa_nonlocal_goto): Call __xtensa_libgcc_window_spill
+ instead of making linux spill syscall.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226962
+
+ libgcc/config/xtensa/lib2funcs.S | 30 +++++++++++++++++++++++-------
+ 1 file changed, 23 insertions(+), 7 deletions(-)
+
+diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S
+index 4d451c8..ef0703f 100644
+--- a/libgcc/config/xtensa/lib2funcs.S
++++ b/libgcc/config/xtensa/lib2funcs.S
+@@ -34,10 +34,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ .global __xtensa_libgcc_window_spill
+ .type __xtensa_libgcc_window_spill,@function
+ __xtensa_libgcc_window_spill:
+- entry sp, 32
+- movi a2, 0
+- syscall
++ entry sp, 48
++#if XCHAL_NUM_AREGS > 16
++ call12 1f
++ retw
++ .align 4
++1:
++ .rept (XCHAL_NUM_AREGS - 24) / 12
++ _entry sp, 48
++ mov a12, a0
++ .endr
++ _entry sp, 16
++#if XCHAL_NUM_AREGS % 12 == 0
++ mov a4, a4
++#elif XCHAL_NUM_AREGS % 12 == 4
++ mov a8, a8
++#elif XCHAL_NUM_AREGS % 12 == 8
++ mov a12, a12
++#endif
+ retw
++#else
++ mov a8, a8
++ retw
++#endif
+ .size __xtensa_libgcc_window_spill, .-__xtensa_libgcc_window_spill
+ #endif
+
+@@ -61,10 +80,7 @@ __xtensa_nonlocal_goto:
+ entry sp, 32
+
+ /* Flush registers. */
+- mov a5, a2
+- movi a2, 0
+- syscall
+- mov a2, a5
++ call8 __xtensa_libgcc_window_spill
+
+ /* Because the save area for a0-a3 is stored one frame below
+ the one identified by a2, the only way to restore those
+--
+1.8.1.4
+
diff --git a/patches/gcc/5.2.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch b/patches/gcc/5.2.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
new file mode 100644
index 0000000..9707f68
--- /dev/null
+++ b/patches/gcc/5.2.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
@@ -0,0 +1,31 @@
+From 7d7a85f75ba218df4a4226e95865fc8fa561cb86 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Fri, 14 Aug 2015 02:45:02 +0300
+Subject: [PATCH 2/3] xtensa: use unwind-dw2-fde-dip instead of unwind-dw2-fde
+
+This allows having exception cleanup code in binaries that don't
+register their unwind tables.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/t-windowed (LIB2ADDEH): Replace unwind-dw2-fde
+ with unwind-dw2-fde-dip.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226963
+
+ libgcc/config/xtensa/t-windowed | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgcc/config/xtensa/t-windowed b/libgcc/config/xtensa/t-windowed
+index 7d9e9db..a99156c 100644
+--- a/libgcc/config/xtensa/t-windowed
++++ b/libgcc/config/xtensa/t-windowed
+@@ -1,2 +1,2 @@
+ LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
+- $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
++ $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+--
+1.8.1.4
+
diff --git a/patches/gcc/5.2.0/873-xtensa-fix-_Unwind_GetCFA.patch b/patches/gcc/5.2.0/873-xtensa-fix-_Unwind_GetCFA.patch
new file mode 100644
index 0000000..2d8eb7c
--- /dev/null
+++ b/patches/gcc/5.2.0/873-xtensa-fix-_Unwind_GetCFA.patch
@@ -0,0 +1,40 @@
+From b33905dc310f475ddbde4c9fb7230724b2068a2b Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sat, 15 Aug 2015 05:12:11 +0300
+Subject: [PATCH 3/3] xtensa: fix _Unwind_GetCFA
+
+Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame
+higher than what was actually used by code at context->ra. This results
+in invalid CFA value in signal frames and premature unwinding completion
+in forced unwinding used by uClibc NPTL thread cancellation.
+Returning context->sp from _Unwind_GetCFA makes all CFA values valid and
+matching code that used them.
+
+2015-08-18 Max Filippov <jcmvbkbc@gmail.com>
+libgcc/
+ * config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return
+ context->sp instead of context->cfa.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+Backported from: r226964
+
+ libgcc/config/xtensa/unwind-dw2-xtensa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c
+index 82b0e63..8e579c7 100644
+--- a/libgcc/config/xtensa/unwind-dw2-xtensa.c
++++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c
+@@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
+ _Unwind_Word
+ _Unwind_GetCFA (struct _Unwind_Context *context)
+ {
+- return (_Unwind_Ptr) context->cfa;
++ return (_Unwind_Ptr) context->sp;
+ }
+
+ /* Overwrite the saved value for register INDEX in CONTEXT with VAL. */
+--
+1.8.1.4
+
diff --git a/patches/gcc/5.2.0/100-libitm-fixes-for-musl-support.patch b/patches/gcc/5.2.0/900-libitm-fixes-for-musl-support.patch
index 96a724b..fdf4ee7 100644
--- a/patches/gcc/5.2.0/100-libitm-fixes-for-musl-support.patch
+++ b/patches/gcc/5.2.0/900-libitm-fixes-for-musl-support.patch
@@ -17,11 +17,11 @@ On behalf of Szabolcs.Nagy@arm.com
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222325 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/libitm/config/arm/hwcap.cc b/libitm/config/arm/hwcap.cc
-index a1c2cfd..ea8f023 100644
+Index: b/libitm/config/arm/hwcap.cc
+===================================================================
--- a/libitm/config/arm/hwcap.cc
+++ b/libitm/config/arm/hwcap.cc
-@@ -40,7 +40,7 @@ int GTM_hwcap HIDDEN = 0
+@@ -40,7 +40,7 @@
#ifdef __linux__
#include <unistd.h>
@@ -30,8 +30,8 @@ index a1c2cfd..ea8f023 100644
#include <elf.h>
static void __attribute__((constructor))
-diff --git a/libitm/config/linux/x86/tls.h b/libitm/config/linux/x86/tls.h
-index e731ab7..54ad8b6 100644
+Index: b/libitm/config/linux/x86/tls.h
+===================================================================
--- a/libitm/config/linux/x86/tls.h
+++ b/libitm/config/linux/x86/tls.h
@@ -25,16 +25,19 @@
@@ -56,7 +56,7 @@ index e731ab7..54ad8b6 100644
namespace GTM HIDDEN {
#ifdef __x86_64__
-@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct abi_dispatch *x)
+@@ -101,5 +104,6 @@
} // namespace GTM
#endif /* >= GLIBC 2.10 */
diff --git a/patches/gcc/5.2.0/101-fixincludes-update-for-musl-support.patch b/patches/gcc/5.2.0/901-fixincludes-update-for-musl-support.patch
index 6bc3f54..13c08d6 100644
--- a/patches/gcc/5.2.0/101-fixincludes-update-for-musl-support.patch
+++ b/patches/gcc/5.2.0/901-fixincludes-update-for-musl-support.patch
@@ -16,11 +16,11 @@ On behalf of Szabolcs.Nagy@arm.com
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222327 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/fixincludes/mkfixinc.sh b/fixincludes/mkfixinc.sh
-index 6653fed..0d96c8c 100755
+Index: b/fixincludes/mkfixinc.sh
+===================================================================
--- a/fixincludes/mkfixinc.sh
+++ b/fixincludes/mkfixinc.sh
-@@ -19,7 +19,8 @@ case $machine in
+@@ -19,7 +19,8 @@
powerpc-*-eabi* | \
powerpc-*-rtems* | \
powerpcle-*-eabisim* | \
diff --git a/patches/gcc/5.2.0/102-unwind-fix-for-musl.patch b/patches/gcc/5.2.0/902-unwind-fix-for-musl.patch
index 6db0e6f..ef47054 100644
--- a/patches/gcc/5.2.0/102-unwind-fix-for-musl.patch
+++ b/patches/gcc/5.2.0/902-unwind-fix-for-musl.patch
@@ -17,8 +17,8 @@ On behalf of szabolcs.nagy@arm.com
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c
-index e1e566b..137dced 100644
+Index: b/libgcc/unwind-dw2-fde-dip.c
+===================================================================
--- a/libgcc/unwind-dw2-fde-dip.c
+++ b/libgcc/unwind-dw2-fde-dip.c
@@ -59,6 +59,12 @@
diff --git a/patches/gcc/5.2.0/103-libstdc++-libgfortran-gthr-workaround-for-musl.patch b/patches/gcc/5.2.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch
index df1d321..c852131 100644
--- a/patches/gcc/5.2.0/103-libstdc++-libgfortran-gthr-workaround-for-musl.patch
+++ b/patches/gcc/5.2.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch
@@ -24,11 +24,11 @@ On behalf of szabolcs.nagy@arm.com
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
-index ba890f9..30b8b1a6 100644
+Index: b/libgfortran/acinclude.m4
+===================================================================
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
-@@ -100,7 +100,7 @@ void foo (void);
+@@ -100,7 +100,7 @@
[Define to 1 if the target supports #pragma weak])
fi
case "$host" in
@@ -37,11 +37,11 @@ index ba890f9..30b8b1a6 100644
AC_DEFINE(GTHREAD_USE_WEAK, 0,
[Define to 0 if the target shouldn't use #pragma weak])
;;
-diff --git a/libgfortran/configure b/libgfortran/configure
-index e1592f7..07542e1 100755
+Index: b/libgfortran/configure
+===================================================================
--- a/libgfortran/configure
+++ b/libgfortran/configure
-@@ -26447,7 +26447,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>confdefs.h
+@@ -26447,7 +26447,7 @@
fi
case "$host" in
@@ -50,8 +50,8 @@ index e1592f7..07542e1 100755
$as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
-diff --git a/libstdc++-v3/config/os/generic/os_defines.h b/libstdc++-v3/config/os/generic/os_defines.h
-index 45bf52a..103ec0e 100644
+Index: b/libstdc++-v3/config/os/generic/os_defines.h
+===================================================================
--- a/libstdc++-v3/config/os/generic/os_defines.h
+++ b/libstdc++-v3/config/os/generic/os_defines.h
@@ -33,4 +33,9 @@
@@ -64,11 +64,11 @@ index 45bf52a..103ec0e 100644
+#define _GLIBCXX_GTHREAD_USE_WEAK 0
+
#endif
-diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
-index 82ddc52..a349ce3 100644
+Index: b/libstdc++-v3/configure.host
+===================================================================
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
-@@ -271,6 +271,9 @@ case "${host_os}" in
+@@ -271,6 +271,9 @@
freebsd*)
os_include_dir="os/bsd/freebsd"
;;
diff --git a/patches/gcc/5.2.0/104-musl-libc-config.patch b/patches/gcc/5.2.0/904-musl-libc-config.patch
index 7020a3d..8549140 100644
--- a/patches/gcc/5.2.0/104-musl-libc-config.patch
+++ b/patches/gcc/5.2.0/904-musl-libc-config.patch
@@ -25,11 +25,11 @@ X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a9173ceabaf29
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/gcc/config.gcc b/gcc/config.gcc
-index 938d619..e993e5d 100644
+Index: b/gcc/config.gcc
+===================================================================
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
-@@ -575,7 +575,7 @@ case ${target} in
+@@ -575,7 +575,7 @@
esac
# Common C libraries.
@@ -38,7 +38,7 @@ index 938d619..e993e5d 100644
# 32-bit x86 processors supported by --with-arch=. Each processor
# MUST be separated by exactly one space.
-@@ -728,6 +728,9 @@ case ${target} in
+@@ -720,6 +720,9 @@
*-*-*uclibc*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
;;
@@ -48,11 +48,11 @@ index 938d619..e993e5d 100644
*)
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
;;
-diff --git a/gcc/config/linux.h b/gcc/config/linux.h
-index 857389a..b551c56 100644
+Index: b/gcc/config/linux.h
+===================================================================
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
-@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+@@ -32,10 +32,12 @@
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
@@ -65,7 +65,7 @@ index 857389a..b551c56 100644
#endif
#define GNU_USER_TARGET_OS_CPP_BUILTINS() \
-@@ -50,21 +52,25 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+@@ -50,21 +52,25 @@
} while (0)
/* Determine which dynamic linker to use depending on whether GLIBC or
@@ -101,7 +101,7 @@ index 857389a..b551c56 100644
#else
#error "Unsupported DEFAULT_LIBC"
#endif /* DEFAULT_LIBC */
-@@ -81,24 +87,100 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+@@ -81,24 +87,100 @@
#define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
#define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
#define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32"
@@ -206,11 +206,11 @@ index 857389a..b551c56 100644
#if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
/* This is a *uclinux* target. We don't define below macros to normal linux
versions, because doing so would require *uclinux* targets to include
-diff --git a/gcc/config/linux.opt b/gcc/config/linux.opt
-index c054338..ef055a7 100644
+Index: b/gcc/config/linux.opt
+===================================================================
--- a/gcc/config/linux.opt
+++ b/gcc/config/linux.opt
-@@ -28,5 +28,9 @@ Target Report RejectNegative Var(linux_libc,LIBC_GLIBC) Negative(muclibc)
+@@ -28,5 +28,9 @@
Use GNU C library
muclibc
@@ -221,29 +221,11 @@ index c054338..ef055a7 100644
+mmusl
+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic)
+Use musl C library
-diff --git a/gcc/configure b/gcc/configure
-index e563e94..b99eb6d 100755
+Index: b/gcc/configure
+===================================================================
--- a/gcc/configure
+++ b/gcc/configure
-@@ -27740,6 +27740,9 @@ if test "${gcc_cv_libc_provides_ssp+set}" = set; then :
- else
- gcc_cv_libc_provides_ssp=no
- case "$target" in
-+ *-*-musl*)
-+ # All versions of musl provide stack protector
-+ gcc_cv_libc_provides_ssp=yes;;
- *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
- # glibc 2.4 and later provides __stack_chk_fail and
- # either __stack_chk_guard, or TLS access to stack guard canary.
-@@ -27772,6 +27775,7 @@ fi
- # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
- # simply assert that glibc does provide this, which is true for all
- # realistically usable GNU/Hurd configurations.
-+ # All supported versions of musl provide it as well
- gcc_cv_libc_provides_ssp=yes;;
- *-*-darwin* | *-*-freebsd*)
- ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
-@@ -27868,6 +27872,9 @@ case "$target" in
+@@ -27809,6 +27813,9 @@
gcc_cv_target_dl_iterate_phdr=no
fi
;;
@@ -253,29 +235,11 @@ index e563e94..b99eb6d 100755
esac
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
-diff --git a/gcc/configure.ac b/gcc/configure.ac
-index 55fe633..810725c 100644
+Index: b/gcc/configure.ac
+===================================================================
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
-@@ -5247,6 +5247,9 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
- gcc_cv_libc_provides_ssp,
- [gcc_cv_libc_provides_ssp=no
- case "$target" in
-+ *-*-musl*)
-+ # All versions of musl provide stack protector
-+ gcc_cv_libc_provides_ssp=yes;;
- *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
- # glibc 2.4 and later provides __stack_chk_fail and
- # either __stack_chk_guard, or TLS access to stack guard canary.
-@@ -5273,6 +5276,7 @@ AC_CACHE_CHECK(__stack_chk_fail in target C library,
- # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
- # simply assert that glibc does provide this, which is true for all
- # realistically usable GNU/Hurd configurations.
-+ # All supported versions of musl provide it as well
- gcc_cv_libc_provides_ssp=yes;;
- *-*-darwin* | *-*-freebsd*)
- AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
-@@ -5346,6 +5350,9 @@ case "$target" in
+@@ -5298,6 +5302,9 @@
gcc_cv_target_dl_iterate_phdr=no
fi
;;
@@ -285,11 +249,11 @@ index 55fe633..810725c 100644
esac
GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
-diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
-index cb5ae17..9169731 100644
+Index: b/gcc/doc/invoke.texi
+===================================================================
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
-@@ -669,7 +669,7 @@ Objective-C and Objective-C++ Dialects}.
+@@ -667,7 +667,7 @@
-mcpu=@var{cpu}}
@emph{GNU/Linux Options}
@@ -298,7 +262,7 @@ index cb5ae17..9169731 100644
-tno-android-cc -tno-android-ld}
@emph{H8/300 Options}
-@@ -15384,13 +15384,19 @@ These @samp{-m} options are defined for GNU/Linux targets:
+@@ -15324,13 +15324,19 @@
@item -mglibc
@opindex mglibc
Use the GNU C library. This is the default except
diff --git a/patches/gcc/5.2.0/105-add-musl-support-to-gcc.patch b/patches/gcc/5.2.0/905-add-musl-support-to-gcc.patch
index a1c3e08..92e7436 100644
--- a/patches/gcc/5.2.0/105-add-musl-support-to-gcc.patch
+++ b/patches/gcc/5.2.0/905-add-musl-support-to-gcc.patch
@@ -19,11 +19,11 @@ X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=f2d678afa5b83
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222905 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
-index c567f43..475ea06 100644
+Index: b/gcc/config/alpha/linux.h
+===================================================================
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
-@@ -61,10 +61,14 @@ along with GCC; see the file COPYING3. If not see
+@@ -61,10 +61,14 @@
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
@@ -38,11 +38,11 @@ index c567f43..475ea06 100644
#endif
/* Determine what functions are present at the runtime;
-diff --git a/gcc/config/glibc-stdint.h b/gcc/config/glibc-stdint.h
-index 3fc67dc..98f4f04 100644
+Index: b/gcc/config/glibc-stdint.h
+===================================================================
--- a/gcc/config/glibc-stdint.h
+++ b/gcc/config/glibc-stdint.h
-@@ -22,6 +22,12 @@ a copy of the GCC Runtime Library Exception along with this program;
+@@ -22,6 +22,12 @@
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
@@ -55,7 +55,7 @@ index 3fc67dc..98f4f04 100644
#define SIG_ATOMIC_TYPE "int"
#define INT8_TYPE "signed char"
-@@ -43,12 +49,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+@@ -43,12 +49,12 @@
#define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
#define INT_FAST8_TYPE "signed char"
@@ -72,11 +72,11 @@ index 3fc67dc..98f4f04 100644
#define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
#define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
-diff --git a/gcc/config/linux.h b/gcc/config/linux.h
-index b551c56..7bc87ab 100644
+Index: b/gcc/config/linux.h
+===================================================================
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
-@@ -32,11 +32,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+@@ -32,11 +32,13 @@
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
@@ -90,8 +90,8 @@ index b551c56..7bc87ab 100644
#define OPTION_MUSL (linux_libc == LIBC_MUSL)
#endif
-diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
-index fe0ebd6..a68ff69 100644
+Index: b/gcc/config/rs6000/linux.h
+===================================================================
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -30,10 +30,14 @@
@@ -109,11 +109,11 @@ index fe0ebd6..a68ff69 100644
#endif
/* Determine what functions are present at the runtime;
-diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
-index 0879e7e..1b7f695 100644
+Index: b/gcc/config/rs6000/linux64.h
+===================================================================
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
-@@ -299,10 +299,14 @@ extern int dot_symbols;
+@@ -299,10 +299,14 @@
#define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
diff --git a/patches/gcc/5.2.0/106-mips-musl-support.patch b/patches/gcc/5.2.0/906-mips-musl-support.patch
index 60a5ac0..6b473f9 100644
--- a/patches/gcc/5.2.0/106-mips-musl-support.patch
+++ b/patches/gcc/5.2.0/906-mips-musl-support.patch
@@ -16,11 +16,11 @@ X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2550b6a866c88
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222915 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
-index 91df261..fb358e2 100644
+Index: b/gcc/config/mips/linux.h
+===================================================================
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
-@@ -37,7 +37,13 @@ along with GCC; see the file COPYING3. If not see
+@@ -37,7 +37,13 @@
#define UCLIBC_DYNAMIC_LINKERN32 \
"%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
@@ -35,4 +35,3 @@ index 91df261..fb358e2 100644
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
- BIONIC_DYNAMIC_LINKERN32)
+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
-
diff --git a/patches/gcc/5.2.0/107-x86-musl-support.patch b/patches/gcc/5.2.0/907-x86-musl-support.patch
index 1ab6c44..3f2fe5d 100644
--- a/patches/gcc/5.2.0/107-x86-musl-support.patch
+++ b/patches/gcc/5.2.0/907-x86-musl-support.patch
@@ -17,22 +17,22 @@ On behalf of Szabolcs Nagy.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223218 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
-index a100963..385aefd 100644
+Index: b/gcc/config/i386/linux.h
+===================================================================
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
-@@ -21,3 +21,6 @@ along with GCC; see the file COPYING3. If not see
+@@ -21,3 +21,6 @@
#define GNU_USER_LINK_EMULATION "elf_i386"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+#undef MUSL_DYNAMIC_LINKER
+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
-diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
-index a27d3be..e300480 100644
+Index: b/gcc/config/i386/linux64.h
+===================================================================
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
-@@ -30,3 +30,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+@@ -30,3 +30,10 @@
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
diff --git a/patches/gcc/5.2.0/108-arm-musl-support.patch b/patches/gcc/5.2.0/908-arm-musl-support.patch
index 34b348f..906355a 100644
--- a/patches/gcc/5.2.0/108-arm-musl-support.patch
+++ b/patches/gcc/5.2.0/908-arm-musl-support.patch
@@ -15,8 +15,8 @@ On behalf of szabolcs.nagy@arm.com
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223749 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
-index 2cf3ca7..d51376f 100644
+Index: b/gcc/config/arm/linux-eabi.h
+===================================================================
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -77,6 +77,23 @@
diff --git a/patches/gcc/5.2.0/109-aarch64-musl-support.patch b/patches/gcc/5.2.0/909-aarch64-musl-support.patch
index d6a95ca..3d032f5 100644
--- a/patches/gcc/5.2.0/109-aarch64-musl-support.patch
+++ b/patches/gcc/5.2.0/909-aarch64-musl-support.patch
@@ -17,8 +17,8 @@ gcc/Changelog:
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223766 138bc75d-0d04-0410-961f-82ee72b054a4
---
-diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
-index ba7fc3b..1600a32 100644
+Index: b/gcc/config/aarch64/aarch64-linux.h
+===================================================================
--- a/gcc/config/aarch64/aarch64-linux.h
+++ b/gcc/config/aarch64/aarch64-linux.h
@@ -23,6 +23,9 @@
diff --git a/patches/uClibc-ng/1.0.8/001-unistd-fix-if-condition.patch b/patches/uClibc-ng/1.0.8/001-unistd-fix-if-condition.patch
new file mode 100644
index 0000000..c321f4e
--- /dev/null
+++ b/patches/uClibc-ng/1.0.8/001-unistd-fix-if-condition.patch
@@ -0,0 +1,34 @@
+From 1e85892911bf016e9bb2a647b6584cdd806706f8 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Tue, 3 Nov 2015 15:32:23 +0100
+Subject: [PATCH] unistd: fix #if condition
+
+Commit dfa593d4d881116723a4401b466ea964fb12327b ("syncfs: add system
+call support") modified the #if condition around the definition of the
+syncfs() prototype in a way that doesn't build, causing build failures
+of any file including <unistd.h>:
+
+output/host/usr/powerpc-buildroot-linux-uclibc/sysroot/usr/include/unistd.h:988:14: error: #if with no expression
+ #if __USE_GNU
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ include/unistd.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/unistd.h b/include/unistd.h
+index 4701dab..40d6abd 100644
+--- a/include/unistd.h
++++ b/include/unistd.h
+@@ -1073,7 +1073,7 @@ extern char *getpass (const char *__prompt) __nonnull ((1));
+ extern int fsync (int __fd);
+ #endif /* Use BSD || X/Open || Unix98. */
+
+-#if __USE_GNU
++#if defined __USE_GNU
+ /* Make all changes done to all files on the file system associated
+ * with FD actually appear on disk. */
+ extern int syncfs (int __fd) __THROW;
+--
+2.6.2
+
diff --git a/patches/uClibc/0.9.28.3/100-string-functions.patch b/patches/uClibc/0.9.28.3/100-string-functions.patch
deleted file mode 100644
index ab6c255..0000000
--- a/patches/uClibc/0.9.28.3/100-string-functions.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-Give preference to target-optimised functions over glibc's ones,
-which in turn ahave precedence over generic ones.
-
---- uClibc.orig/libc/Makefile 2005-07-20 08:10:44.000000000 +0200
-+++ uclibc/libc/Makefile 2005-07-28 13:33:40.000000000 +0200
-@@ -59,7 +59,7 @@
- $(AR) dN 2 $(LIBNAME) $$objs && \
- $(AR) dN 2 $(LIBNAME) $$objs
- @for objfile in obj.signal \
-- obj.string.generic obj.string.$(TARGET_ARCH) obj.string \
-+ obj.string obj.string.generic obj.string.$(TARGET_ARCH) \
- obj.sysdeps.common obj.sysdeps.$(TARGET_ARCH) ; do \
- if [ -e $$objfile ] ; then \
- echo $(AR) $(ARFLAGS) $(LIBNAME) $$objfile ; \
diff --git a/patches/uClibc/0.9.28.3/110-install_dev.patch b/patches/uClibc/0.9.28.3/110-install_dev.patch
deleted file mode 100644
index 4b42467..0000000
--- a/patches/uClibc/0.9.28.3/110-install_dev.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-We know that the kernel headers are in place. Don't try to install them.
-
-diff -dur uClibc-0.9.28.1.orig/Makefile uClibc-0.9.28.1/Makefile
---- uClibc-0.9.28.1.orig/Makefile 2007-01-28 06:38:00.000000000 +0100
-+++ uClibc-0.9.28.1/Makefile 2007-01-28 18:55:46.000000000 +0100
-@@ -158,12 +158,10 @@
- $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
- $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
- -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
-- if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
-- extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
-- else \
-- extra_exclude="" ; \
-- fi ; \
-- tar -chf - include --exclude .svn --exclude CVS $$extra_exclude \
-+ extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
-+ tar -chf - include --exclude .svn --exclude CVS \
-+ --exclude include/linux \
-+ --exclude include/asm'*' \
- | tar -xf - -C $(PREFIX)$(DEVEL_PREFIX)
- echo '/* Dont use _syscall#() macros; use the syscall() function */' > \
- $(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h
diff --git a/patches/uClibc/0.9.28.3/120-no_LFS-no_readahead.patch b/patches/uClibc/0.9.28.3/120-no_LFS-no_readahead.patch
deleted file mode 100644
index ca0568c..0000000
--- a/patches/uClibc/0.9.28.3/120-no_LFS-no_readahead.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile
---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/common/Makefile 2007-01-26 00:54:19.000000000 +0100
-+++ uClibc-0.9.28.1/libc/sysdeps/linux/common/Makefile 2007-02-01 08:44:37.000000000 +0100
-@@ -25,6 +25,10 @@
- SRCS := $(filter-out sbrk.c,$(SRCS))
- endif
-
-+ifneq ($(strip $(UCLIBC_HAS_LFS)),y)
-+SRCS := $(filter-out readahead.c,$(SRCS))
-+endif
-+
- ifneq ($(strip $(UCLIBC_HAS_SSP)),y)
- SRCS := $(filter-out ssp.c,$(SRCS))
- endif
diff --git a/patches/uClibc/0.9.28.3/130-ctype.patch b/patches/uClibc/0.9.28.3/130-ctype.patch
deleted file mode 100644
index b07ccdb..0000000
--- a/patches/uClibc/0.9.28.3/130-ctype.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -urN uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h
---- uClibc-dist/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:25 2005
-+++ uClibc/libc/sysdeps/linux/common/bits/uClibc_touplow.h Fri Jun 3 13:30:39 2005
-@@ -34,11 +34,11 @@
-
- /* glibc uses the equivalent of - typedef __int32_t __ctype_touplow_t; */
-
--typedef __uint16_t __ctype_mask_t;
-+typedef __uint32_t __ctype_mask_t;
-
- #ifdef __UCLIBC_HAS_CTYPE_SIGNED__
-
--typedef __int16_t __ctype_touplow_t;
-+typedef __int32_t __ctype_touplow_t;
- #define __UCLIBC_CTYPE_B_TBL_OFFSET 128
- #define __UCLIBC_CTYPE_TO_TBL_OFFSET 128
-
diff --git a/patches/uClibc/0.9.28.3/140-custom-ISA.patch b/patches/uClibc/0.9.28.3/140-custom-ISA.patch
deleted file mode 100644
index 2cc9bcb..0000000
--- a/patches/uClibc/0.9.28.3/140-custom-ISA.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff -dur uClibc-0.9.28.orig/Rules.mak uClibc-0.9.28/Rules.mak
---- uClibc-0.9.28.orig/Rules.mak 2005-08-18 00:49:49.000000000 +0200
-+++ uClibc-0.9.28/Rules.mak 2007-01-30 10:53:34.000000000 +0100
-@@ -168,6 +168,7 @@
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32
- CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32
-+ CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
- endif
-
- ifeq ($(strip $(TARGET_ARCH)),sh)
-diff -dur uClibc-0.9.28.orig/extra/Configs/Config.mips uClibc-0.9.28/extra/Configs/Config.mips
---- uClibc-0.9.28.orig/extra/Configs/Config.mips 2005-08-18 00:49:41.000000000 +0200
-+++ uClibc-0.9.28/extra/Configs/Config.mips 2007-01-30 10:52:12.000000000 +0100
-@@ -63,4 +63,16 @@
- config CONFIG_MIPS_ISA_MIPS64
- bool "MIPS64"
-
-+config CONFIG_MIPS_ISA_CUSTOM
-+ bool "Custom"
-+
- endchoice
-+
-+config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
-+ string
-+ prompt "Custon ISA"
-+ depends on CONFIG_MIPS_ISA_CUSTOM
-+ default ""
-+ help
-+ Enter your custom ISA here (eg: lx4189!).
-+
diff --git a/patches/uClibc/0.9.28.3/150-mips-asm.h.patch b/patches/uClibc/0.9.28.3/150-mips-asm.h.patch
deleted file mode 100644
index 285feed..0000000
--- a/patches/uClibc/0.9.28.3/150-mips-asm.h.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S
---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/clone.S 2007-02-07 11:18:12.000000000 +0100
-+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/clone.S 2007-02-07 10:41:34.000000000 +0100
-@@ -24,7 +24,7 @@
- #include <sys/regdef.h>
- #define _ERRNO_H 1
- #include <bits/errno.h>
--#include <asm/asm.h>
-+#include <sys/asm.h>
-
- /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg) */
-
-diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S
---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/pipe.S 2007-02-07 11:18:12.000000000 +0100
-+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/pipe.S 2007-02-07 11:16:52.000000000 +0100
-@@ -3,9 +3,9 @@
- /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
-
- #include <features.h>
--#include <asm/asm.h>
-+#include <sys/asm.h>
- #include <asm/unistd.h>
--#include <asm/regdef.h>
-+#include <sys/regdef.h>
-
- .globl pipe
- .ent pipe, 0
-diff -dur uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S
---- uClibc-0.9.28.1.orig/libc/sysdeps/linux/mips/syscall.S 2007-02-07 11:18:12.000000000 +0100
-+++ uClibc-0.9.28.1/libc/sysdeps/linux/mips/syscall.S 2007-02-07 11:17:03.000000000 +0100
-@@ -17,8 +17,8 @@
- 02111-1307 USA. */
-
- #include <features.h>
--#include <asm/asm.h>
--#include <asm/regdef.h>
-+#include <sys/asm.h>
-+#include <sys/regdef.h>
-
- #ifdef __PIC__
- .option pic2
diff --git a/patches/uClibc/0.9.29/100-fix-mmap.patch b/patches/uClibc/0.9.29/100-fix-mmap.patch
deleted file mode 100644
index 4775e8c..0000000
--- a/patches/uClibc/0.9.29/100-fix-mmap.patch
+++ /dev/null
@@ -1,91 +0,0 @@
---- uClibc-0.9.29.oorig/test/mmap/mmap2.c (revision 0)
-+++ uClibc-0.9.29/test/mmap/mmap2.c (revision 18616)
-@@ -0,0 +1,41 @@
-+/* When trying to map /dev/mem with offset 0xFFFFF000 on the ARM platform, mmap
-+ * returns -EOVERFLOW.
-+ *
-+ * Since off_t is defined as a long int and the sign bit is set in the address,
-+ * the shift operation shifts in ones instead of zeroes
-+ * from the left. This results the offset sent to the kernel function becomes
-+ * 0xFFFFFFFF instead of 0x000FFFFF with MMAP2_PAGE_SHIFT set to 12.
-+ */
-+
-+#include <unistd.h>
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <fcntl.h>
-+#include <sys/mman.h>
-+
-+#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
-+ __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
-+
-+#define MAP_SIZE 4096UL
-+#define MAP_MASK (MAP_SIZE - 1)
-+
-+int main(int argc, char **argv) {
-+ void* map_base = 0;
-+ int fd;
-+ off_t target = 0xfffff000;
-+ if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL;
-+ printf("/dev/mem opened.\n");
-+ fflush(stdout);
-+
-+ /* Map one page */
-+ map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED,
-+ fd, target & ~MAP_MASK);
-+ if(map_base == (void *) -1) FATAL;
-+ printf("Memory mapped at address %p.\n", map_base);
-+ fflush(stdout);
-+ if(munmap(map_base, MAP_SIZE) == -1) FATAL;
-+ close(fd);
-+ return 0;
-+}
---- uClibc-0.9.29.oorig/libc/sysdeps/linux/arm/mmap.c (revision 18615)
-+++ uClibc-0.9.29/libc/sysdeps/linux/arm/mmap.c (revision 18616)
-@@ -27,7 +27,6 @@ __ptr_t mmap(__ptr_t addr, size_t len, i
-
- #elif defined (__NR_mmap2)
- #define __NR__mmap __NR_mmap2
--
- #ifndef MMAP2_PAGE_SHIFT
- # define MMAP2_PAGE_SHIFT 12
- #endif
-@@ -39,9 +38,17 @@ __ptr_t mmap(__ptr_t addr, size_t len, i
- {
- /* check if offset is page aligned */
- if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1))
-+ {
-+ __set_errno(EINVAL);
- return MAP_FAILED;
-+ }
-+#ifdef __USE_FILE_OFFSET64
-+ return (__ptr_t) _mmap (addr, len, prot, flags,
-+ fd,((__u_quad_t) offset >> MMAP2_PAGE_SHIFT));
-+#else
- return (__ptr_t) _mmap (addr, len, prot, flags,
-- fd,(off_t) (offset >> MMAP2_PAGE_SHIFT));
-+ fd,((__u_long) offset >> MMAP2_PAGE_SHIFT));
-+#endif
- }
- #elif defined (__NR_mmap)
- # define __NR__mmap __NR_mmap
---- uClibc-0.9.29.oorig/libc/sysdeps/linux/common/mmap64.c (revision 18615)
-+++ uClibc-0.9.29/libc/sysdeps/linux/common/mmap64.c (revision 18616)
-@@ -58,8 +58,13 @@ __ptr_t mmap64(__ptr_t addr, size_t len,
- __set_errno(EINVAL);
- return MAP_FAILED;
- }
--
-- return __syscall_mmap2(addr, len, prot, flags, fd, (off_t) (offset >> MMAP2_PAGE_SHIFT));
-+#ifdef __USE_FILE_OFFSET64
-+ return __syscall_mmap2(addr, len, prot, flags,
-+ fd,((__u_quad_t)offset >> MMAP2_PAGE_SHIFT));
-+#else
-+ return __syscall_mmap2(addr, len, prot, flags,
-+ fd,((__u_long)offset >> MMAP2_PAGE_SHIFT));
-+#endif
- }
-
- # endif
diff --git a/patches/uClibc/0.9.29/110-conditional-sched_affinity.patch b/patches/uClibc/0.9.29/110-conditional-sched_affinity.patch
deleted file mode 100644
index 509c42a..0000000
--- a/patches/uClibc/0.9.29/110-conditional-sched_affinity.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c
---- uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c 2007-02-12 16:52:32.000000000 -0600
-+++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c 2007-05-09 18:05:09.397411811 -0500
-@@ -29,6 +29,7 @@
- #include <sys/param.h>
- #include <sys/types.h>
-
-+#ifdef __NR_sched_getaffinity
- libc_hidden_proto(memset)
-
- #define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
-@@ -48,5 +49,15 @@
- }
- return res;
- }
-+#else
-+/*
-+int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
-+{
-+ __set_errno(ENOSYS);
-+ return -1;
-+}
-+*/
- #endif
- #endif
-+
-+#endif
-diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c
---- uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c 2007-02-12 16:52:32.000000000 -0600
-+++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c 2007-05-09 18:05:09.397411811 -0500
-@@ -31,6 +31,7 @@
- #include <sys/types.h>
- #include <alloca.h>
-
-+#ifdef __NR_sched_setaffinity
- libc_hidden_proto(getpid)
-
- #define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
-@@ -74,5 +75,14 @@
-
- return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
- }
-+#else
-+/*
-+int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
-+{
-+ __set_errno(ENOSYS);
-+ return -1;
-+}
-+*/
-+#endif
- #endif
- #endif
diff --git a/patches/uClibc/0.9.29/120-fix-internal_function-definition.patch b/patches/uClibc/0.9.29/120-fix-internal_function-definition.patch
deleted file mode 100644
index 9b88d82..0000000
--- a/patches/uClibc/0.9.29/120-fix-internal_function-definition.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Index: uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h
-===================================================================
---- uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h (revision 18898)
-+++ uClibc/libc/sysdeps/linux/i386/bits/uClibc_arch_features.h (working copy)
-@@ -42,6 +42,8 @@
- /* define if target supports IEEE signed zero floats */
- #define __UCLIBC_HAVE_SIGNED_ZERO__
-
-+#if defined _LIBC
- #define internal_function __attribute__ ((regparm (3), stdcall))
-+#endif
-
- #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
-Index: uClibc/include/libc-symbols.h
-===================================================================
---- uClibc/include/libc-symbols.h (revision 18898)
-+++ uClibc/include/libc-symbols.h (working copy)
-@@ -22,6 +22,16 @@
- #ifndef _LIBC_SYMBOLS_H
- #define _LIBC_SYMBOLS_H 1
-
-+/* This is defined for the compilation of all C library code. features.h
-+ tests this to avoid inclusion of stubs.h while compiling the library,
-+ before stubs.h has been generated. Some library code that is shared
-+ with other packages also tests this symbol to see if it is being
-+ compiled as part of the C library. We must define this before including
-+ config.h, because it makes some definitions conditional on whether libc
-+ itself is being compiled, or just some generator program. */
-+#define _LIBC 1
-+
-+
- /* This file's macros are included implicitly in the compilation of every
- file in the C library by -imacros.
-
-@@ -40,16 +50,6 @@
-
- #include <bits/uClibc_arch_features.h>
-
--
--/* This is defined for the compilation of all C library code. features.h
-- tests this to avoid inclusion of stubs.h while compiling the library,
-- before stubs.h has been generated. Some library code that is shared
-- with other packages also tests this symbol to see if it is being
-- compiled as part of the C library. We must define this before including
-- config.h, because it makes some definitions conditional on whether libc
-- itself is being compiled, or just some generator program. */
--#define _LIBC 1
--
- /* Enable declarations of GNU extensions, since we are compiling them. */
- #define _GNU_SOURCE 1
-
diff --git a/patches/uClibc/0.9.29/130-fix-gethostent_r-failure-retval.patch b/patches/uClibc/0.9.29/130-fix-gethostent_r-failure-retval.patch
deleted file mode 100644
index 7b246c1..0000000
--- a/patches/uClibc/0.9.29/130-fix-gethostent_r-failure-retval.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur uClibc-0.9.29/libc/inet/resolv.c uClibc-0.9.29-patched/libc/inet/resolv.c
---- uClibc-0.9.29/libc/inet/resolv.c 2007-04-23 12:01:05.000000000 -0500
-+++ uClibc-0.9.29-patched/libc/inet/resolv.c 2007-05-09 18:05:33.563404419 -0500
-@@ -1700,7 +1700,7 @@
- int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
- struct hostent **result, int *h_errnop)
- {
-- int ret;
-+ int ret = HOST_NOT_FOUND;
-
- __UCLIBC_MUTEX_LOCK(mylock);
- if (__gethostent_fp == NULL) {
diff --git a/patches/uClibc/0.9.29/140-bits_sysnum_h.patch b/patches/uClibc/0.9.29/140-bits_sysnum_h.patch
deleted file mode 100644
index 595a22e..0000000
--- a/patches/uClibc/0.9.29/140-bits_sysnum_h.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-YEM-20070519:
-bits/sysnum.h needs a cross compiler to be built. Fortunately, this
-header is not needed to build gcc. Move generation of this header.
-
-Index: uClibc/Makefile.in
-===================================================================
---- uClibc/Makefile.in (revision 18651)
-+++ uClibc/Makefile.in (working copy)
-@@ -91,6 +91,11 @@
- $(LN) -fs $$i .; \
- done; \
- fi
-+ifeq ($(UCLIBC_HAS_LOCALE),y)
-+ $(MAKE) locale_headers
-+endif
-+
-+pregen: headers
- $(Q)\
- set -e; \
- cd $(top_builddir); \
-@@ -102,12 +107,7 @@
- else \
- mv -f $$tmp include/bits/sysnum.h; \
- fi
--ifeq ($(UCLIBC_HAS_LOCALE),y)
-- $(MAKE) locale_headers
--endif
-
--pregen: headers
--
- install: install_runtime install_dev
-
-
diff --git a/patches/uClibc/0.9.29/150-bits_sysnum_h2.patch b/patches/uClibc/0.9.29/150-bits_sysnum_h2.patch
deleted file mode 100644
index d650d8d..0000000
--- a/patches/uClibc/0.9.29/150-bits_sysnum_h2.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-YEM-20070519:
-Patch from Bernhard Fischer <rep.dot.nop@gmail.com> on the uClibc mailing
-list ( http://www.uclibc.org/lists/uclibc/2008-January/018940.html ) above
-the 400-bits_sysnum_h.patch.
-
-Index: uClibc/Makefile.in
-===================================================================
---- uClibc/Makefile.in (revision 18651)
-+++ uClibc/Makefile.in (working copy)
-@@ -114,7 +116,7 @@ install: install_runtime install_dev
- RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)lib $(RUNTIME_PREFIX)lib)
-
- # Installs header files.
--install_headers:
-+install_headers: headers
- $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
- printf ".svn\n.cvsignore\nCVS\n" > tar_exclude ; \
- $(TAR) -chf - -X tar_exclude include \
diff --git a/patches/uClibc/0.9.29/160-custom-ISA.patch b/patches/uClibc/0.9.29/160-custom-ISA.patch
deleted file mode 100644
index 51993ee..0000000
--- a/patches/uClibc/0.9.29/160-custom-ISA.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff -dur uClibc-0.9.29.orig/extra/Configs/Config.mips uClibc-0.9.29/extra/Configs/Config.mips
---- uClibc-0.9.29.orig/extra/Configs/Config.mips 2007-03-16 20:38:14.000000000 +0100
-+++ uClibc-0.9.29/extra/Configs/Config.mips 2007-05-22 19:30:43.000000000 +0200
-@@ -71,4 +71,16 @@
- config CONFIG_MIPS_ISA_MIPS64
- bool "MIPS64"
-
-+config CONFIG_MIPS_ISA_CUSTOM
-+ bool "Custom"
-+
- endchoice
-+
-+config CONFIG_MIPS_CPU_CFLAGS_CUSTOM
-+ string
-+ prompt "Custon ISA"
-+ depends on CONFIG_MIPS_ISA_CUSTOM
-+ default ""
-+ help
-+ Enter your custom ISA here (eg: lx4189!).
-+
-diff -dur uClibc-0.9.29.orig/Rules.mak uClibc-0.9.29/Rules.mak
---- uClibc-0.9.29.orig/Rules.mak 2007-04-17 15:34:11.000000000 +0200
-+++ uClibc-0.9.29/Rules.mak 2007-05-22 19:31:48.000000000 +0200
-@@ -234,6 +234,7 @@
- CPU_CFLAGS-$(CONFIG_MIPS_N64_ABI)+=-mabi=64
- CPU_CFLAGS-$(CONFIG_MIPS_O32_ABI)+=-mabi=32
- CPU_CFLAGS-$(CONFIG_MIPS_N32_ABI)+=-mabi=n32
-+ CPU_CFLAGS-$(CONFIG_MIPS_ISA_CUSTOM)+=-march=$(CONFIG_MIPS_CPU_CFLAGS_CUSTOM)
- endif
-
- ifeq ($(TARGET_ARCH),nios)
diff --git a/patches/uClibc/0.9.29/170-filter-gnu99-from-assembly-flags.patch b/patches/uClibc/0.9.29/170-filter-gnu99-from-assembly-flags.patch
deleted file mode 100644
index d1a7e3a..0000000
--- a/patches/uClibc/0.9.29/170-filter-gnu99-from-assembly-flags.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur uClibc-0.9.29/Makerules uClibc-0.9.29-patched/Makerules
---- uClibc-0.9.29/Makerules 2006-12-10 18:25:23.000000000 -0600
-+++ uClibc-0.9.29-patched/Makerules 2008-01-26 17:04:50.965699518 -0600
-@@ -96,7 +96,7 @@
- disp_ld = $($(DISP)_disp_ld)
-
- cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $(^D)))) $(CFLAGS-$(subst $(top_srcdir),,$(dir $<))) $(CFLAGS-$(notdir $<)) $(CFLAGS-$(notdir $@))
--cmd_compile.S = $(cmd_compile.c) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
-+cmd_compile.S = $(filter-out -std=gnu99, $(cmd_compile.c)) -D__ASSEMBLER__ $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
- cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
- cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@))
- cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^
diff --git a/patches/uClibc/0.9.29/180-linuxthreads.patch b/patches/uClibc/0.9.29/180-linuxthreads.patch
deleted file mode 100644
index 8ce2439..0000000
--- a/patches/uClibc/0.9.29/180-linuxthreads.patch
+++ /dev/null
@@ -1,145 +0,0 @@
---- a/libpthread/linuxthreads.old/attr.c 2006-01-24 12:41:01.000000000 -0500
-+++ b/libpthread/linuxthreads.old/attr.c 2008-02-10 11:35:32.000000000 -0500
-@@ -25,6 +25,14 @@
- #include "pthread.h"
- #include "internals.h"
-
-+#include <sys/resource.h>
-+#include <inttypes.h>
-+#include <stdio.h>
-+#include <stdio_ext.h>
-+#include <stdlib.h>
-+#include <sys/resource.h>
-+
-+
- /* NOTE: With uClibc I don't think we need this versioning stuff.
- * Therefore, define the function pthread_attr_init() here using
- * a strong symbol. */
-@@ -209,4 +217,94 @@ int __pthread_attr_getstacksize(const pt
- *stacksize = attr->__stacksize;
- return 0;
- }
-+
-+
-+extern int *__libc_stack_end;
-+
- weak_alias (__pthread_attr_getstacksize, pthread_attr_getstacksize)
-+void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr)
-+{
-+ static void *stackBase = 0;
-+ static size_t stackSize = 0;
-+ int ret = 0;
-+ /* Stack size limit. */
-+ struct rlimit rl;
-+
-+ /* The safest way to get the top of the stack is to read
-+ /proc/self/maps and locate the line into which
-+ __libc_stack_end falls. */
-+ FILE *fp = fopen("/proc/self/maps", "rc");
-+ if (fp == NULL)
-+ ret = errno;
-+ /* We need the limit of the stack in any case. */
-+ else if (getrlimit (RLIMIT_STACK, &rl) != 0)
-+ ret = errno;
-+ else {
-+ /* We need no locking. */
-+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
-+
-+ /* Until we found an entry (which should always be the case)
-+ mark the result as a failure. */
-+ ret = ENOENT;
-+
-+ char *line = NULL;
-+ size_t linelen = 0;
-+ uintptr_t last_to = 0;
-+
-+ while (! feof_unlocked (fp)) {
-+ if (getdelim (&line, &linelen, '\n', fp) <= 0)
-+ break;
-+
-+ uintptr_t from;
-+ uintptr_t to;
-+ if (sscanf (line, "%x-%x", &from, &to) != 2)
-+ continue;
-+ if (from <= (uintptr_t) __libc_stack_end
-+ && (uintptr_t) __libc_stack_end < to) {
-+ /* Found the entry. Now we have the info we need. */
-+ attr->__stacksize = rl.rlim_cur;
-+#ifdef _STACK_GROWS_UP
-+ /* Don't check to enforce a limit on the __stacksize */
-+ attr->__stackaddr = (void *) from;
-+#else
-+ attr->__stackaddr = (void *) to;
-+
-+ /* The limit might be too high. */
-+ if ((size_t) attr->__stacksize > (size_t) attr->__stackaddr - last_to)
-+ attr->__stacksize = (size_t) attr->__stackaddr - last_to;
-+#endif
-+
-+ /* We succeed and no need to look further. */
-+ ret = 0;
-+ break;
-+ }
-+ last_to = to;
-+ }
-+
-+ fclose (fp);
-+ free (line);
-+ }
-+#ifndef _STACK_GROWS_UP
-+ stackBase = (char *) attr->__stackaddr - attr->__stacksize;
-+#else
-+ stackBase = attr->__stackaddr;
-+#endif
-+ stackSize = attr->__stacksize;
-+ return (void*)(stackBase + stackSize);
-+}
-+
-+int __pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr,
-+ size_t *stacksize)
-+{
-+ /* XXX This function has a stupid definition. The standard specifies
-+ no error value but what is if no stack address was set? We simply
-+ return the value we have in the member. */
-+#ifndef _STACK_GROWS_UP
-+ *stackaddr = (char *) attr->__stackaddr - attr->__stacksize;
-+#else
-+ *stackaddr = attr->__stackaddr;
-+#endif
-+ *stacksize = attr->__stacksize;
-+ return 0;
-+}
-+weak_alias (__pthread_attr_getstack, pthread_attr_getstack)
-
---- a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h 2006-12-07 22:19:36.000000000 -0500
-+++ b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h 2008-02-10 11:42:35.000000000 -0500
-@@ -288,15 +288,11 @@ extern int pthread_attr_getstacksize (__
- __attr, size_t *__restrict __stacksize)
- __THROW;
-
--#if 0
--/* Not yet implemented in uClibc! */
--
- #ifdef __USE_GNU
- /* Initialize thread attribute *ATTR with attributes corresponding to the
- already running thread TH. It shall be called on unitialized ATTR
- and destroyed with pthread_attr_destroy when no longer needed. */
--extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr) __THROW;
--#endif
-+extern void* pthread_getattr_np(pthread_t thread, pthread_attr_t *attr);
- #endif
-
- /* Functions for scheduling control. */
-@@ -599,6 +595,11 @@ extern int pthread_cancel (pthread_t __c
- cancelled. */
- extern void pthread_testcancel (void);
-
-+/* Return the previously set address for the stack. */
-+extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
-+ void **__restrict __stackaddr,
-+ size_t *__restrict __stacksize) __THROW;
-+
-
- /* Install a cleanup handler: ROUTINE will be called with arguments ARG
- when the thread is cancelled or calls pthread_exit. ROUTINE will also
-
diff --git a/patches/uClibc/0.9.29/190-rm-whitespace.patch b/patches/uClibc/0.9.29/190-rm-whitespace.patch
deleted file mode 100644
index 6004f91..0000000
--- a/patches/uClibc/0.9.29/190-rm-whitespace.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-diff -urN uClibc-0.9.29-0rig/include/assert.h uClibc-0.9.29/include/assert.h
---- uClibc-0.9.29-0rig/include/assert.h 2005-11-03 23:42:46.000000000 +0100
-+++ uClibc-0.9.29/include/assert.h 2007-08-13 19:10:57.000000000 +0200
-@@ -31,7 +31,7 @@
- #define _ASSERT_H 1
- #include <features.h>
-
--#if defined __cplusplus && __GNUC_PREREQ (2,95)
-+#if defined __cplusplus && __GNUC_PREREQ(2,95)
- # define __ASSERT_VOID_CAST static_cast<void>
- #else
- # define __ASSERT_VOID_CAST (void)
-@@ -59,13 +59,17 @@
- (__ASSERT_VOID_CAST ((expr) ? 0 : \
- (__assert (__STRING(expr), __FILE__, __LINE__, \
- __ASSERT_FUNCTION), 0)))
--
-+
-+/* Define some temporaries to workaround tinyx makedepend bug */
-+#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
-+#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
- /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
- which contains the name of the function currently being defined.
- This is broken in G++ before version 2.6.
- C9x has a similar variable called __func__, but prefer the GCC one since
- it demangles C++ function names. */
--# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
-+
-+# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
- # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
- # else
- # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-diff -urN uClibc-0.9.29-0rig/include/complex.h uClibc-0.9.29/include/complex.h
---- uClibc-0.9.29-0rig/include/complex.h 2002-05-09 10:15:21.000000000 +0200
-+++ uClibc-0.9.29/include/complex.h 2007-08-13 17:55:29.000000000 +0200
-@@ -33,7 +33,7 @@
- /* We might need to add support for more compilers here. But since ISO
- C99 is out hopefully all maintained compilers will soon provide the data
- types `float complex' and `double complex'. */
--#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
-+#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
- # define _Complex __complex__
- #endif
-
-diff -urN uClibc-0.9.29-0rig/include/features.h uClibc-0.9.29/include/features.h
---- uClibc-0.9.29-0rig/include/features.h 2006-11-29 22:10:04.000000000 +0100
-+++ uClibc-0.9.29/include/features.h 2007-08-13 17:55:51.000000000 +0200
-@@ -143,7 +143,7 @@
-
- /* Convenience macros to test the versions of glibc and gcc.
- Use them like this:
-- #if __GNUC_PREREQ (2,8)
-+ #if __GNUC_PREREQ(2,8)
- ... code requiring gcc 2.8 or later ...
- #endif
- Note - they won't work for gcc1 or glibc1, since the _MINOR macros
-@@ -297,7 +297,7 @@
- /* uClibc does not support _FORTIFY_SOURCE */
- #undef _FORTIFY_SOURCE
- #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
-- && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
-+ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
- # if _FORTIFY_SOURCE > 1
- # define __USE_FORTIFY_LEVEL 2
- # else
-@@ -366,7 +366,7 @@
- #endif /* !ASSEMBLER */
-
- /* Decide whether we can define 'extern inline' functions in headers. */
--#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
-+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
- && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
- # define __USE_EXTERN_INLINES 1
- #endif
-diff -urN uClibc-0.9.29-0rig/include/tgmath.h uClibc-0.9.29/include/tgmath.h
---- uClibc-0.9.29-0rig/include/tgmath.h 2002-05-09 10:15:21.000000000 +0200
-+++ uClibc-0.9.29/include/tgmath.h 2007-08-13 17:56:17.000000000 +0200
-@@ -34,7 +34,7 @@
- do not try this for now and instead concentrate only on GNU CC. Once
- we have more information support for other compilers might follow. */
-
--#if __GNUC_PREREQ (2, 7)
-+#if __GNUC_PREREQ(2, 7)
-
- # ifdef __NO_LONG_DOUBLE_MATH
- # define __tgml(fct) fct
diff --git a/patches/uClibc/0.9.30.1/100-fix-gethostent_r-failure-retval.patch b/patches/uClibc/0.9.30.1/100-fix-gethostent_r-failure-retval.patch
deleted file mode 100644
index 34e18d2..0000000
--- a/patches/uClibc/0.9.30.1/100-fix-gethostent_r-failure-retval.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/libc/inet/resolv.c uClibc-0.9.30/libc/inet/resolv.c
---- uClibc-0.9.30.orig/libc/inet/resolv.c 2008-11-02 01:25:33.000000000 +0100
-+++ uClibc-0.9.30/libc/inet/resolv.c 2009-02-07 09:57:59.000000000 +0100
-@@ -1788,7 +1788,7 @@
- int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
- struct hostent **result, int *h_errnop)
- {
-- int ret;
-+ int ret = HOST_NOT_FOUND;
-
- __UCLIBC_MUTEX_LOCK(mylock);
- if (__gethostent_fp == NULL) {
diff --git a/patches/uClibc/0.9.30.1/110-arm_fix_alignment.patch b/patches/uClibc/0.9.30.1/110-arm_fix_alignment.patch
deleted file mode 100644
index 0d72e7f..0000000
--- a/patches/uClibc/0.9.30.1/110-arm_fix_alignment.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
-ARMV5 can use STRD and LDRD access instructions but these accesses need to be
-8 byte aligned. The dynamic linker's malloc needs to match this so structures
-become 8 byte aligned to void unaligned accesses.
-
-RP - 14/02/2008
-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/ldso/ldso/arm/dl-sysdep.h uClibc-0.9.30/ldso/ldso/arm/dl-sysdep.h
---- uClibc-0.9.30.orig/ldso/ldso/arm/dl-sysdep.h 2008-09-25 10:35:20.000000000 +0200
-+++ uClibc-0.9.30/ldso/ldso/arm/dl-sysdep.h 2009-02-07 09:57:59.000000000 +0100
-@@ -15,6 +15,8 @@
- GOT_BASE[1] = (unsigned long) MODULE; \
- }
-
-+#define DL_MALLOC_ALIGN 8 /* EABI needs 8 byte alignment for STRD LDRD*/
-+
- static __inline__ unsigned long arm_modulus(unsigned long m, unsigned long p)
- {
- unsigned long i,t,inc;
diff --git a/patches/uClibc/0.9.30.1/120-rm-whitespace.patch b/patches/uClibc/0.9.30.1/120-rm-whitespace.patch
deleted file mode 100644
index 59fe3be..0000000
--- a/patches/uClibc/0.9.30.1/120-rm-whitespace.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/include/assert.h uClibc-0.9.30/include/assert.h
---- uClibc-0.9.30.orig/include/assert.h 2008-07-23 13:23:36.000000000 +0200
-+++ uClibc-0.9.30/include/assert.h 2009-02-07 09:57:59.000000000 +0100
-@@ -31,7 +31,7 @@
- #define _ASSERT_H 1
- #include <features.h>
-
--#if defined __cplusplus && __GNUC_PREREQ (2,95)
-+#if defined __cplusplus && __GNUC_PREREQ(2,95)
- # define __ASSERT_VOID_CAST static_cast<void>
- #else
- # define __ASSERT_VOID_CAST (void)
-@@ -60,12 +60,15 @@
- (__assert (__STRING(expr), __FILE__, __LINE__, \
- __ASSERT_FUNCTION), 0)))
-
-+/* Define some temporaries to workaround tinyx makedepend bug */
-+#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
-+#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
- /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
- which contains the name of the function currently being defined.
- This is broken in G++ before version 2.6.
- C9x has a similar variable called __func__, but prefer the GCC one since
- it demangles C++ function names. */
--# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
-+# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
- # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
- # else
- # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-diff -durN uClibc-0.9.30.orig/include/complex.h uClibc-0.9.30/include/complex.h
---- uClibc-0.9.30.orig/include/complex.h 2008-10-03 16:24:28.000000000 +0200
-+++ uClibc-0.9.30/include/complex.h 2009-02-07 09:57:59.000000000 +0100
-@@ -33,7 +33,7 @@
- /* We might need to add support for more compilers here. But since ISO
- C99 is out hopefully all maintained compilers will soon provide the data
- types `float complex' and `double complex'. */
--#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
-+#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
- # define _Complex __complex__
- #endif
-
-diff -durN uClibc-0.9.30.orig/include/features.h uClibc-0.9.30/include/features.h
---- uClibc-0.9.30.orig/include/features.h 2008-09-06 18:45:07.000000000 +0200
-+++ uClibc-0.9.30/include/features.h 2009-02-07 09:57:59.000000000 +0100
-@@ -143,7 +143,7 @@
-
- /* Convenience macros to test the versions of glibc and gcc.
- Use them like this:
-- #if __GNUC_PREREQ (2,8)
-+ #if __GNUC_PREREQ(2,8)
- ... code requiring gcc 2.8 or later ...
- #endif
- Note - they won't work for gcc1 or glibc1, since the _MINOR macros
-@@ -297,7 +297,7 @@
- /* uClibc does not support _FORTIFY_SOURCE */
- #undef _FORTIFY_SOURCE
- #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
-- && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
-+ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
- # if _FORTIFY_SOURCE > 1
- # define __USE_FORTIFY_LEVEL 2
- # else
-@@ -366,7 +366,7 @@
- #endif /* !ASSEMBLER */
-
- /* Decide whether we can define 'extern inline' functions in headers. */
--#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
-+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
- && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
- && (defined __extern_inline || defined __GNUC_GNU_INLINE__)
- # define __USE_EXTERN_INLINES 1
-diff -durN uClibc-0.9.30.orig/include/tgmath.h uClibc-0.9.30/include/tgmath.h
---- uClibc-0.9.30.orig/include/tgmath.h 2008-10-03 16:24:28.000000000 +0200
-+++ uClibc-0.9.30/include/tgmath.h 2009-02-07 09:57:59.000000000 +0100
-@@ -34,7 +34,7 @@
- do not try this for now and instead concentrate only on GNU CC. Once
- we have more information support for other compilers might follow. */
-
--#if __GNUC_PREREQ (2, 7)
-+#if __GNUC_PREREQ(2, 7)
-
- # ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
- # define __tgml(fct) fct
diff --git a/patches/uClibc/0.9.30.1/130-arm-ftruncate64.patch b/patches/uClibc/0.9.30.1/130-arm-ftruncate64.patch
deleted file mode 100644
index 7bd8ef6..0000000
--- a/patches/uClibc/0.9.30.1/130-arm-ftruncate64.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h uClibc-0.9.30/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
---- uClibc-0.9.30.orig/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h 2008-09-25 10:50:56.000000000 +0200
-+++ uClibc-0.9.30/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h 2009-02-07 09:57:59.000000000 +0100
-@@ -39,4 +39,8 @@
- /* define if target supports IEEE signed zero floats */
- #define __UCLIBC_HAVE_SIGNED_ZERO__
-
-+#ifdef __ARM_EABI__
-+# define __UCLIBC_TRUNCATE64_HAS_4_ARGS__
-+#endif
-+
- #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/patches/uClibc/0.9.30.1/140-gnu89-inline.patch b/patches/uClibc/0.9.30.1/140-gnu89-inline.patch
deleted file mode 100644
index afa9528..0000000
--- a/patches/uClibc/0.9.30.1/140-gnu89-inline.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/Rules.mak uClibc-0.9.30/Rules.mak
---- uClibc-0.9.30.orig/Rules.mak 2008-11-12 13:24:16.000000000 +0100
-+++ uClibc-0.9.30/Rules.mak 2009-02-07 09:57:59.000000000 +0100
-@@ -519,6 +519,7 @@
- endif
-
- CFLAGS += $(call check_gcc,-std=gnu99,)
-+CFLAGS += $(call check_gcc,-fgnu89-inline,)
-
- LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -Wl,-shared \
- -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc
diff --git a/patches/uClibc/0.9.30.1/150-64bit-strtouq.patch b/patches/uClibc/0.9.30.1/150-64bit-strtouq.patch
deleted file mode 100644
index bd4ecaa..0000000
--- a/patches/uClibc/0.9.30.1/150-64bit-strtouq.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-[PATCH]: Add strtouq alias (to strtoul) for 64bit
-
-The strtouq alias was only available on 32bit, breaking compilation of stuff
-using strtouq on 64bit machines. At the same time use the correct return
-type (u_quad_t).
-
-Signed-of-by: Peter Korsgaard <jacmet@sunsite.dk>
----
- include/stdlib.h | 4 +++-
- libc/stdlib/stdlib.c | 1 +
- 2 files changed, 4 insertions(+), 1 deletion(-)
-
-Index: uClibc-0.9.30.1/libc/stdlib/stdlib.c
-===================================================================
---- uClibc-0.9.30.1.orig/libc/stdlib/stdlib.c
-+++ uClibc-0.9.30.1/libc/stdlib/stdlib.c
-@@ -401,6 +401,9 @@
- libc_hidden_proto(__XL_NPP(strtoull))
- strong_alias(__XL_NPP(strtoul),__XL_NPP(strtoull))
- libc_hidden_def(__XL_NPP(strtoull))
-+#if !defined(L_strtoul_l)
-+strong_alias(strtoul,strtouq)
-+#endif
- #endif
-
-
-Index: uClibc-0.9.30.1/include/stdlib.h
-===================================================================
---- uClibc-0.9.30.1.orig/include/stdlib.h
-+++ uClibc-0.9.30.1/include/stdlib.h
-@@ -203,6 +203,8 @@
- __END_NAMESPACE_STD
-
- #ifdef __USE_BSD
-+#include <sys/types.h> /* for u_quad_t */
-+
- /* Convert a string to a quadword integer. */
- __extension__
- extern long long int strtoq (__const char *__restrict __nptr,
-@@ -210,7 +212,7 @@
- __THROW __nonnull ((1)) __wur;
- /* Convert a string to an unsigned quadword integer. */
- __extension__
--extern unsigned long long int strtouq (__const char *__restrict __nptr,
-+extern u_quad_t strtouq (__const char *__restrict __nptr,
- char **__restrict __endptr, int __base)
- __THROW __nonnull ((1)) __wur;
- #endif /* GCC and use BSD. */
diff --git a/patches/uClibc/0.9.30.1/160-c99-ldbl-math.patch b/patches/uClibc/0.9.30.1/160-c99-ldbl-math.patch
deleted file mode 100644
index f44f32c..0000000
--- a/patches/uClibc/0.9.30.1/160-c99-ldbl-math.patch
+++ /dev/null
@@ -1,474 +0,0 @@
-Index: uClibc-0.9.30.1/libm/ldouble_wrappers.c
-===================================================================
---- uClibc-0.9.30.1/libm/ldouble_wrappers.c (revision 25552)
-+++ uClibc-0.9.30.1/libm/ldouble_wrappers.c (working copy)
-@@ -13,6 +13,16 @@
- #include "math.h"
- #include <complex.h>
-
-+#if defined __NO_LONG_DOUBLE_MATH
-+# define int_WRAPPER_C99(func) /* not needed */
-+# else
-+# define int_WRAPPER_C99(func) \
-+int func##l(long double x) \
-+{ \
-+ return func((double) x); \
-+} \
-+libm_hidden_def(func##l)
-+#endif
-
- /* Implement the following, as defined by SuSv3 */
- #if 0
-@@ -543,46 +553,28 @@ long double truncl (long double x)
- #endif
-
-
--#ifdef __DO_C99_MATH__
-+#if defined __DO_C99_MATH__
-
- #ifdef L_fpclassifyl
--int __fpclassifyl (long double x)
--{
-- return __fpclassify ( (double) x );
--}
--libm_hidden_def(__fpclassifyl)
-+int_WRAPPER_C99(__fpclassify)
- #endif
-
- #ifdef L_finitel
--int __finitel (long double x)
--{
-- return __finite ( (double)x );
--}
--libm_hidden_def(__finitel)
-+int_WRAPPER_C99(__finite)
- #endif
-
- #ifdef L_signbitl
--int __signbitl (long double x)
--{
-- return __signbitl ( (double)x );
--}
--libm_hidden_def(__signbitl)
-+int_WRAPPER_C99(__signbit)
- #endif
-
- #ifdef L_isnanl
--int __isnanl (long double x)
--{
-- return __isnan ( (double)x );
--}
--libm_hidden_def(__isnanl)
-+int_WRAPPER_C99(__isnan)
- #endif
-
- #ifdef L_isinfl
--int __isinfl (long double x)
--{
-- return __isinf ( (double)x );
--}
--libm_hidden_def(__isinfl)
-+int_WRAPPER_C99(__isinf)
- #endif
-
--#endif
-+#endif /* DO_C99_MATH */
-+
-+#undef int_WRAPPER_C99
-Index: uClibc-0.9.30.1/libm/nan.c
-===================================================================
---- uClibc-0.9.30.1/libm/nan.c (revision 25552)
-+++ uClibc-0.9.30.1/libm/nan.c (working copy)
-@@ -45,7 +45,7 @@ float nanf (const char *tagp)
- }
- libm_hidden_def(nanf)
-
--#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __NO_LONG_DOUBLE_MATH
- libm_hidden_proto(nanl)
- long double nanl (const char *tagp)
- {
-Index: uClibc-0.9.30.1/include/math.h
-===================================================================
---- uClibc-0.9.30.1/include/math.h (revision 25552)
-+++ uClibc-0.9.30.1/include/math.h (working copy)
-@@ -118,7 +118,7 @@ __BEGIN_DECLS
- # undef __MATH_PRECNAME
-
- # if (__STDC__ - 0 || __GNUC__ - 0) \
-- && (defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ || defined __LDBL_COMPAT)
-+ && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
- # ifdef __LDBL_COMPAT
-
- # ifdef __USE_ISOC99
-@@ -230,7 +230,7 @@ enum
- };
-
- /* Return number of classification appropriate for X. */
--# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# ifdef __NO_LONG_DOUBLE_MATH
- # define fpclassify(x) \
- (sizeof (x) == sizeof (float) ? __fpclassifyf (x) : __fpclassify (x))
- # else
-@@ -242,7 +242,7 @@ enum
- # endif
-
- /* Return nonzero value if sign of X is negative. */
--# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# ifdef __NO_LONG_DOUBLE_MATH
- # define signbit(x) \
- (sizeof (x) == sizeof (float) ? __signbitf (x) : __signbit (x))
- # else
-@@ -254,7 +254,7 @@ enum
- # endif
-
- /* Return nonzero value if X is not +-Inf or NaN. */
--# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# ifdef __NO_LONG_DOUBLE_MATH
- # define isfinite(x) \
- (sizeof (x) == sizeof (float) ? __finitef (x) : __finite (x))
- # else
-@@ -270,7 +270,7 @@ enum
-
- /* Return nonzero value if X is a NaN. We could use `fpclassify' but
- we already have this functions `__isnan' and it is faster. */
--# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# ifdef __NO_LONG_DOUBLE_MATH
- # define isnan(x) \
- (sizeof (x) == sizeof (float) ? __isnanf (x) : __isnan (x))
- # else
-@@ -282,7 +282,7 @@ enum
- # endif
-
- /* Return nonzero value is X is positive or negative infinity. */
--# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# ifdef __NO_LONG_DOUBLE_MATH
- # define isinf(x) \
- (sizeof (x) == sizeof (float) ? __isinff (x) : __isinf (x))
- # else
-Index: uClibc-0.9.30.1/include/tgmath.h
-===================================================================
---- uClibc-0.9.30.1/include/tgmath.h (revision 25552)
-+++ uClibc-0.9.30.1/include/tgmath.h (working copy)
-@@ -36,7 +36,7 @@
-
- #if __GNUC_PREREQ(2, 7)
-
--# ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# ifdef __NO_LONG_DOUBLE_MATH
- # define __tgml(fct) fct
- # else
- # define __tgml(fct) fct ## l
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/wordsize.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/wordsize.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/wordsize.h (working copy)
-@@ -7,13 +7,13 @@
- # define __WORDSIZE 32
- #endif
-
--#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL
-+#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
- /* Signal the glibc ABI didn't used to have a `long double'.
- The changes all the `long double' function variants to be redirects
- to the double functions. */
- # define __LONG_DOUBLE_MATH_OPTIONAL 1
- # ifndef __LONG_DOUBLE_128__
--# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
- # endif
- #endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/powerpc/bits/mathdef.h (working copy)
-@@ -65,11 +65,13 @@ typedef double double_t;
-
- #endif /* ISO C99 */
-
--#ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+#ifndef __NO_LONG_DOUBLE_MATH
- #include <bits/wordsize.h>
- /* Signal that we do not really have a `long double'. The disables the
- declaration of all the `long double' function variants. */
- # if __WORDSIZE == 32
--# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
-+# elif !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
- # endif /* __WORDSIZE == 32 */
--#endif /* __UCLIBC_HAS_LONG_DOUBLE_MATH__ */
-+#endif /* __NO_LONG_DOUBLE_MATH */
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/arm/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/arm/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/arm/bits/mathdef.h (working copy)
-@@ -34,3 +34,11 @@ typedef double double_t; /* `double' exp
- # define FP_ILOGBNAN (2147483647)
-
- #endif /* ISO C99 */
-+
-+#ifndef __NO_LONG_DOUBLE_MATH
-+/* Signal that we do not really have a `long double'. This disables the
-+ declaration of all the `long double' function variants. */
-+/* XXX The FPA does support this but the patterns in GCC are currently
-+ turned off. */
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/m68k/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/m68k/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/m68k/bits/mathdef.h (working copy)
-@@ -36,3 +36,7 @@ typedef long double double_t; /* `double
- # define FP_ILOGBNAN (2147483647)
-
- #endif /* ISO C99 */
-+
-+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/wordsize.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/wordsize.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/wordsize.h (working copy)
-@@ -18,13 +18,13 @@
-
- #define __WORDSIZE 64
-
--#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL
-+#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
-
- /* Signal that we didn't used to have a `long double'. The changes all
- the `long double' function variants to be redirects to the double
- functions. */
- # define __LONG_DOUBLE_MATH_OPTIONAL 1
- # ifndef __LONG_DOUBLE_128__
--# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
- # endif
- #endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/alpha/bits/mathdef.h (working copy)
-@@ -78,3 +78,7 @@ typedef double double_t;
-
- # endif /* GNUC before 3.4 */
- #endif /* COMPLEX_H */
-+
-+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/common/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/common/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/common/bits/mathdef.h (working copy)
-@@ -35,3 +35,9 @@ typedef double double_t; /* `double' exp
- # define FP_ILOGBNAN 2147483647
-
- #endif /* ISO C99 */
-+
-+#ifndef __NO_LONG_DOUBLE_MATH
-+/* Signal that we do not really have a `long double'. The disables the
-+ declaration of all the `long double' function variants. */
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/i386/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/i386/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/i386/bits/mathdef.h (working copy)
-@@ -44,3 +44,7 @@ typedef long double double_t; /* `double
- # define FP_ILOGBNAN (-2147483647 - 1)
-
- #endif /* ISO C99 */
-+
-+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/nios2/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/nios2/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/nios2/bits/mathdef.h (working copy)
-@@ -34,3 +34,11 @@ typedef double double_t; /* `double' exp
- # define FP_ILOGBNAN (2147483647)
-
- #endif /* ISO C99 */
-+
-+#ifndef __NO_LONG_DOUBLE_MATH
-+/* Signal that we do not really have a `long double'. This disables the
-+ declaration of all the `long double' function variants. */
-+/* XXX The FPA does support this but the patterns in GCC are currently
-+ turned off. */
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/x86_64/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/x86_64/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/x86_64/bits/mathdef.h (working copy)
-@@ -46,3 +46,7 @@ typedef long double double_t; /* `double
- # define FP_ILOGBNAN (-2147483647 - 1)
-
- #endif /* ISO C99 */
-+
-+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/xtensa/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/xtensa/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/xtensa/bits/mathdef.h (working copy)
-@@ -36,8 +36,8 @@ typedef double double_t; /* `double' exp
-
- #endif /* ISO C99 */
-
--#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+#ifndef __NO_LONG_DOUBLE_MATH
- /* Signal that we do not really have a `long double'. The disables the
- declaration of all the `long double' function variants. */
--# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
- #endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/ia64/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/ia64/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/ia64/bits/mathdef.h (working copy)
-@@ -35,3 +35,7 @@ typedef double double_t; /* `double' exp
- # define FP_ILOGBNAN 2147483647
-
- #endif /* ISO C99 */
-+
-+#if !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/mips/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/mips/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/mips/bits/mathdef.h (working copy)
-@@ -39,8 +39,10 @@ typedef double double_t; /* `double' exp
-
- #endif /* ISO C99 */
-
--#if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && _MIPS_SIM == _ABIO32
-+#if ! defined __NO_LONG_DOUBLE_MATH && _MIPS_SIM == _ABIO32
- /* Signal that we do not really have a `long double'. This disables the
- declaration of all the `long double' function variants. */
--# error defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ and _MIPS_SIM == _ABIO32
-+# define __NO_LONG_DOUBLE_MATH 1
-+#elif !defined __NO_LONG_DOUBLE_MATH && !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
- #endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/nios/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/nios/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/nios/bits/mathdef.h (working copy)
-@@ -34,3 +34,11 @@ typedef double double_t; /* `double' exp
- # define FP_ILOGBNAN (2147483647)
-
- #endif /* ISO C99 */
-+
-+#ifndef __NO_LONG_DOUBLE_MATH
-+/* Signal that we do not really have a `long double'. This disables the
-+ declaration of all the `long double' function variants. */
-+/* XXX The FPA does support this but the patterns in GCC are currently
-+ turned off. */
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/wordsize.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/wordsize.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/wordsize.h (working copy)
-@@ -6,7 +6,7 @@
- # define __WORDSIZE 32
- #endif
-
--#if 0 /* uClibc: done in mathdefs.h: defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __LONG_DOUBLE_MATH_OPTIONAL*/
-+#if 0 /* uClibc: done in mathdefs.h: !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL*/
-
- # if __WORDSIZE == 32
- /* Signal that in 32bit ABI we didn't used to have a `long double'.
-@@ -14,7 +14,7 @@
- to the double functions. */
- # define __LONG_DOUBLE_MATH_OPTIONAL 1
- # ifndef __LONG_DOUBLE_128__
--# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
- # endif
- # endif
- #endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathdef.h (working copy)
-@@ -57,13 +57,15 @@ typedef double double_t;
-
- #endif /* ISO C99 */
-
--#ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+#ifndef __NO_LONG_DOUBLE_MATH
-
- # if __WORDSIZE == 32
- /* Signal that in 32bit ABI we do not really have a `long double'.
- The disables the declaration of all the `long double' function
- variants. */
--# undef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
-+# elif !defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# define __NO_LONG_DOUBLE_MATH 1
- # endif
-
- #endif
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathinline.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathinline.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/sparc/bits/mathinline.h (working copy)
-@@ -37,7 +37,7 @@
-
- # if __WORDSIZE == 32
-
--# ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# ifndef __NO_LONG_DOUBLE_MATH
-
- # define __unordered_cmp(x, y) \
- (__extension__ \
-@@ -157,7 +157,7 @@ __NTH (__signbit (double __x))
- return __u.__i[0] < 0;
- }
-
--# ifdef __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# ifndef __NO_LONG_DOUBLE_MATH
- __MATH_INLINE int
- __NTH (__signbitl (long double __x))
- {
-@@ -219,7 +219,7 @@ __NTH (sqrtl (long double __x))
- _Qp_sqrt (&__r, &__x);
- return __r;
- }
--# elif defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# elif !defined __NO_LONG_DOUBLE_MATH
- __MATH_INLINE long double
- sqrtl (long double __x) __THROW
- {
-@@ -257,7 +257,7 @@ __ieee754_sqrtl (long double __x)
- _Qp_sqrt(&__r, &__x);
- return __r;
- }
--# elif defined __UCLIBC_HAS_LONG_DOUBLE_MATH__
-+# elif !defined __NO_LONG_DOUBLE_MATH
- __MATH_INLINE long double
- __ieee754_sqrtl (long double __x)
- {
-Index: uClibc-0.9.30.1/libc/sysdeps/linux/sh/bits/mathdef.h
-===================================================================
---- uClibc-0.9.30.1/libc/sysdeps/linux/sh/bits/mathdef.h (revision 25552)
-+++ uClibc-0.9.30.1/libc/sysdeps/linux/sh/bits/mathdef.h (working copy)
-@@ -61,3 +61,9 @@ typedef double double_t;
- # define FP_ILOGBNAN 0x7fffffff
-
- #endif /* ISO C99 */
-+
-+#ifndef __NO_LONG_DOUBLE_MATH
-+/* Signal that we do not really have a `long double'. The disables the
-+ declaration of all the `long double' function variants. */
-+# define __NO_LONG_DOUBLE_MATH 1
-+#endif
diff --git a/patches/uClibc/0.9.30.1/170-dl-sysdep-inline.patch b/patches/uClibc/0.9.30.1/170-dl-sysdep-inline.patch
deleted file mode 100644
index 460d66a..0000000
--- a/patches/uClibc/0.9.30.1/170-dl-sysdep-inline.patch
+++ /dev/null
@@ -1,371 +0,0 @@
-Index: uClibc-0.9.30.1/ldso/ldso/arm/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/arm/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/arm/dl-sysdep.h (working copy)
-@@ -17,7 +17,7 @@
-
- #define DL_MALLOC_ALIGN 8 /* EABI needs 8 byte alignment for STRD LDRD*/
-
--static __inline__ unsigned long arm_modulus(unsigned long m, unsigned long p)
-+static __always_inline unsigned long arm_modulus(unsigned long m, unsigned long p)
- {
- unsigned long i,t,inc;
- i=p; t=0;
-@@ -74,7 +74,7 @@ unsigned long _dl_linux_resolver(struct
- first element of the GOT. We used to use the PIC register to do this
- without a constant pool reference, but GCC 4.2 will use a pseudo-register
- for the PIC base, so it may not be in r10. */
--static __inline__ Elf32_Addr __attribute__ ((unused))
-+static __always_inline Elf32_Addr __attribute__ ((unused))
- elf_machine_dynamic (void)
- {
- Elf32_Addr dynamic;
-@@ -106,7 +106,7 @@ elf_machine_dynamic (void)
- }
-
- /* Return the run-time load address of the shared object. */
--static __inline__ Elf32_Addr __attribute__ ((unused))
-+static __always_inline Elf32_Addr __attribute__ ((unused))
- elf_machine_load_address (void)
- {
- extern void __dl_start __asm__ ("_dl_start");
-@@ -130,7 +130,7 @@ elf_machine_load_address (void)
- return pcrel_addr - got_addr;
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/powerpc/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/powerpc/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/powerpc/dl-sysdep.h (working copy)
-@@ -90,7 +90,7 @@ void _dl_init_got(unsigned long *lpnt,st
- #define ELF_MACHINE_PLTREL_OVERLAP 1
-
- /* Return the value of the GOT pointer. */
--static __inline__ Elf32_Addr * __attribute__ ((const))
-+static __always_inline Elf32_Addr * __attribute__ ((const))
- ppc_got (void)
- {
- Elf32_Addr *got;
-@@ -109,14 +109,14 @@ ppc_got (void)
-
- /* Return the link-time address of _DYNAMIC, stored as
- the first value in the GOT. */
--static __inline__ Elf32_Addr __attribute__ ((const))
-+static __always_inline Elf32_Addr __attribute__ ((const))
- elf_machine_dynamic (void)
- {
- return *ppc_got();
- }
-
- /* Return the run-time load address of the shared object. */
--static __inline__ Elf32_Addr __attribute__ ((const))
-+static __always_inline Elf32_Addr __attribute__ ((const))
- elf_machine_load_address (void)
- {
- Elf32_Addr *branchaddr;
-@@ -164,7 +164,7 @@ elf_machine_load_address (void)
- return runtime_dynamic - elf_machine_dynamic ();
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/sh64/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/sh64/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/sh64/dl-sysdep.h (working copy)
-@@ -42,7 +42,7 @@ extern unsigned long _dl_linux_resolver(
- /* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
--static __inline__ Elf32_Addr elf_machine_dynamic(void)
-+static __always_inline Elf32_Addr elf_machine_dynamic(void)
- {
- register Elf32_Addr *got;
-
-@@ -70,7 +70,7 @@ static __inline__ Elf32_Addr elf_machine
- }
-
- /* Return the run-time load address of the shared object. */
--static __inline__ Elf32_Addr elf_machine_load_address(void)
-+static __always_inline Elf32_Addr elf_machine_load_address(void)
- {
- Elf32_Addr addr;
-
-@@ -123,7 +123,7 @@ static __inline__ Elf32_Addr elf_machine
- } \
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative(Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/m68k/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/m68k/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/m68k/dl-sysdep.h (working copy)
-@@ -41,7 +41,7 @@ extern unsigned long _dl_linux_resolver
- /* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr
- elf_machine_dynamic (void)
- {
- register Elf32_Addr *got __asm__ ("%a5");
-@@ -50,7 +50,7 @@ elf_machine_dynamic (void)
-
-
- /* Return the run-time load address of the shared object. */
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr
- elf_machine_load_address (void)
- {
- Elf32_Addr addr;
-@@ -60,7 +60,7 @@ elf_machine_load_address (void)
- return addr;
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/i386/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/i386/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/i386/dl-sysdep.h (working copy)
-@@ -42,8 +42,8 @@ extern unsigned long _dl_linux_resolver(
- /* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
--static __inline__ Elf32_Addr elf_machine_dynamic (void) attribute_unused;
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr elf_machine_dynamic (void) attribute_unused;
-+static __always_inline Elf32_Addr
- elf_machine_dynamic (void)
- {
- register Elf32_Addr *got __asm__ ("%ebx");
-@@ -52,8 +52,8 @@ elf_machine_dynamic (void)
-
-
- /* Return the run-time load address of the shared object. */
--static __inline__ Elf32_Addr elf_machine_load_address (void) attribute_unused;
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr elf_machine_load_address (void) attribute_unused;
-+static __always_inline Elf32_Addr
- elf_machine_load_address (void)
- {
- /* It doesn't matter what variable this is, the reference never makes
-@@ -66,7 +66,7 @@ elf_machine_load_address (void)
- return addr;
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/cris/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/cris/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/cris/dl-sysdep.h (working copy)
-@@ -39,7 +39,7 @@ extern unsigned long _dl_linux_resolver(
- || ((type) == R_CRIS_GLOB_DAT)) * ELF_RTYPE_CLASS_PLT) \
- | (((type) == R_CRIS_COPY) * ELF_RTYPE_CLASS_COPY))
-
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr
- elf_machine_dynamic(void)
- {
- /* Don't just set this to an asm variable "r0" since that's not logical
-@@ -61,7 +61,7 @@ elf_machine_dynamic(void)
- there's some other symbol we could use, that we don't *have* to force a
- GOT entry for. */
-
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr
- elf_machine_load_address(void)
- {
- Elf32_Addr gotaddr_diff;
-@@ -95,7 +95,7 @@ elf_machine_load_address(void)
- return gotaddr_diff;
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative(Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/xtensa/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/xtensa/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/xtensa/dl-sysdep.h (working copy)
-@@ -87,7 +87,7 @@ extern unsigned long _dl_linux_resolver
- (((type) == R_XTENSA_JMP_SLOT) * ELF_RTYPE_CLASS_PLT)
-
- /* Return the link-time address of _DYNAMIC. */
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr
- elf_machine_dynamic (void)
- {
- /* This function is only used while bootstrapping the runtime linker.
-@@ -97,7 +97,7 @@ elf_machine_dynamic (void)
- }
-
- /* Return the run-time load address of the shared object. */
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr
- elf_machine_load_address (void)
- {
- Elf32_Addr addr, tmp;
-@@ -118,7 +118,7 @@ elf_machine_load_address (void)
- return addr - 3;
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/sparc/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/sparc/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/sparc/dl-sysdep.h (working copy)
-@@ -49,7 +49,7 @@ unsigned long _dl_linux_resolver(struct
-
- #ifndef COMPILE_ASM
- /* Cheap modulo implementation, taken from arm/ld_sysdep.h. */
--static __inline__ unsigned long
-+static __always_inline unsigned long
- sparc_mod(unsigned long m, unsigned long p)
- {
- unsigned long i, t, inc;
-@@ -127,7 +127,7 @@ do { register Elf32_Addr pc __asm__("
- /* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr
- elf_machine_dynamic (void)
- {
- register Elf32_Addr *got __asm__ ("%l7");
-@@ -138,7 +138,7 @@ elf_machine_dynamic (void)
- }
-
- /* Return the run-time load address of the shared object. */
--static __inline__ Elf32_Addr
-+static __always_inline Elf32_Addr
- elf_machine_load_address (void)
- {
- register Elf32_Addr *pc __asm__ ("%o7"), *got __asm__ ("%l7");
-@@ -157,7 +157,7 @@ elf_machine_load_address (void)
- return (Elf32_Addr) got - *got + (pc[2] - pc[3]) * 4 - 4;
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/mips/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/mips/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/mips/dl-sysdep.h (working copy)
-@@ -163,7 +163,7 @@ void _dl_perform_mips_global_got_relocat
-
- #define OFFSET_GP_GOT 0x7ff0
-
--static __inline__ ElfW(Addr) *
-+static __always_inline ElfW(Addr) *
- elf_mips_got_from_gpreg (ElfW(Addr) gpreg)
- {
- /* FIXME: the offset of gp from GOT may be system-dependent. */
-@@ -173,7 +173,7 @@ elf_mips_got_from_gpreg (ElfW(Addr) gpre
- /* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. We assume its $gp points to the primary GOT. */
--static __inline__ ElfW(Addr)
-+static __always_inline ElfW(Addr)
- elf_machine_dynamic (void)
- {
- register ElfW(Addr) gp __asm__ ("$28");
-@@ -192,7 +192,7 @@ elf_machine_dynamic (void)
- #endif
-
- /* Return the run-time load address of the shared object. */
--static __inline__ ElfW(Addr)
-+static __always_inline ElfW(Addr)
- elf_machine_load_address (void)
- {
- ElfW(Addr) addr;
-@@ -208,7 +208,7 @@ elf_machine_load_address (void)
- return addr;
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (ElfW(Addr) load_off, const ElfW(Addr) rel_addr,
- ElfW(Word) relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/sh/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/sh/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/sh/dl-sysdep.h (working copy)
-@@ -25,7 +25,7 @@
- struct elf_resolve;
- extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry);
-
--static __inline__ unsigned int
-+static __always_inline unsigned int
- _dl_urem(unsigned int n, unsigned int base)
- {
- int res;
-@@ -100,7 +100,7 @@ _dl_urem(unsigned int n, unsigned int ba
- /* Return the link-time address of _DYNAMIC. Conveniently, this is the
- first element of the GOT. This must be inlined in a function which
- uses global data. */
--static __inline__ Elf32_Addr __attribute__ ((unused))
-+static __always_inline Elf32_Addr __attribute__ ((unused))
- elf_machine_dynamic (void)
- {
- register Elf32_Addr *got;
-@@ -109,7 +109,7 @@ elf_machine_dynamic (void)
- }
-
- /* Return the run-time load address of the shared object. */
--static __inline__ Elf32_Addr __attribute__ ((unused))
-+static __always_inline Elf32_Addr __attribute__ ((unused))
- elf_machine_load_address (void)
- {
- Elf32_Addr addr;
-@@ -151,7 +151,7 @@ elf_machine_load_address (void)
- } \
- }
-
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
-Index: uClibc-0.9.30.1/ldso/ldso/bfin/dl-sysdep.h
-===================================================================
---- uClibc-0.9.30.1/ldso/ldso/bfin/dl-sysdep.h (revision 25503)
-+++ uClibc-0.9.30.1/ldso/ldso/bfin/dl-sysdep.h (working copy)
-@@ -213,7 +213,7 @@ while (0)
- #endif
-
- #include <elf.h>
--static __inline__ void
-+static __always_inline void
- elf_machine_relative (DL_LOADADDR_TYPE load_off, const Elf32_Addr rel_addr,
- Elf32_Word relative_count)
- {
diff --git a/patches/uClibc/0.9.30.1/180-getline-conflict.patch b/patches/uClibc/0.9.30.1/180-getline-conflict.patch
deleted file mode 100644
index 50842f9..0000000
--- a/patches/uClibc/0.9.30.1/180-getline-conflict.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/extra/scripts/unifdef.c
-+++ b/extra/scripts/unifdef.c
-@@ -206,7 +206,7 @@
- static void error(const char *);
- static int findsym(const char *);
- static void flushline(bool);
--static Linetype getline(void);
-+static Linetype get_line(void);
- static Linetype ifeval(const char **);
- static void ignoreoff(void);
- static void ignoreon(void);
-@@ -512,7 +512,7 @@
-
- for (;;) {
- linenum++;
-- lineval = getline();
-+ lineval = get_line();
- trans_table[ifstate[depth]][lineval]();
- debug("process %s -> %s depth %d",
- linetype_name[lineval],
-@@ -526,7 +526,7 @@
- * help from skipcomment().
- */
- static Linetype
--getline(void)
-+get_line(void)
- {
- const char *cp;
- int cursym;
-
diff --git a/patches/uClibc/0.9.30.1/190-fix-getaddrinfo-NULL-pointer-dereference.patch b/patches/uClibc/0.9.30.1/190-fix-getaddrinfo-NULL-pointer-dereference.patch
deleted file mode 100644
index 3909871..0000000
--- a/patches/uClibc/0.9.30.1/190-fix-getaddrinfo-NULL-pointer-dereference.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Narup uClibc-0.9.30.1.orig/libc/inet/getaddrinfo.c uClibc-0.9.30.1/libc/inet/getaddrinfo.c
---- uClibc-0.9.30.1.orig/libc/inet/getaddrinfo.c 2009-02-26 21:49:14.000000000 +0900
-+++ uClibc-0.9.30.1/libc/inet/getaddrinfo.c 2009-03-06 00:59:23.000000000 +0900
-@@ -187,6 +187,8 @@ static unsigned __check_pf(void)
- }
-
- for (runp = ifa; runp != NULL; runp = runp->ifa_next) {
-+ if (runp->ifa_addr == NULL)
-+ continue;
- #if defined __UCLIBC_HAS_IPV4__
- if (runp->ifa_addr->sa_family == PF_INET)
- seen |= SEEN_IPV4;
diff --git a/patches/uClibc/0.9.30.1/200-pack-netinet-structs.patch b/patches/uClibc/0.9.30.1/200-pack-netinet-structs.patch
deleted file mode 100644
index d727f4d..0000000
--- a/patches/uClibc/0.9.30.1/200-pack-netinet-structs.patch
+++ /dev/null
@@ -1,224 +0,0 @@
-diff -urN uClibc-0.9.30.1.orig/include/netinet/igmp.h uClibc-0.9.30.1/include/netinet/igmp.h
---- uClibc-0.9.30.1.orig/include/netinet/igmp.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/igmp.h 2009-04-08 09:00:26.242514273 +0200
-@@ -69,7 +69,7 @@
- u_int8_t igmp_code; /* routing code */
- u_int16_t igmp_cksum; /* checksum */
- struct in_addr igmp_group; /* group address */
--};
-+} __attribute__ ((__packed__));
-
- #define IGMP_MINLEN 8
-
-diff -urN uClibc-0.9.30.1.orig/include/netinet/in.h uClibc-0.9.30.1/include/netinet/in.h
---- uClibc-0.9.30.1.orig/include/netinet/in.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/in.h 2009-04-08 09:00:26.242514273 +0200
-@@ -202,7 +202,7 @@
- #define s6_addr in6_u.u6_addr8
- #define s6_addr16 in6_u.u6_addr16
- #define s6_addr32 in6_u.u6_addr32
-- };
-+ } __attribute__ ((__packed__));
-
- extern const struct in6_addr in6addr_any; /* :: */
- extern const struct in6_addr in6addr_loopback; /* ::1 */
-@@ -229,7 +229,7 @@
- __SOCKADDR_COMMON_SIZE -
- sizeof (in_port_t) -
- sizeof (struct in_addr)];
-- };
-+ } __attribute__ ((__packed__));
- #endif
-
- /* Ditto, for IPv6. */
-@@ -240,7 +240,7 @@
- uint32_t sin6_flowinfo; /* IPv6 flow information */
- struct in6_addr sin6_addr; /* IPv6 address */
- uint32_t sin6_scope_id; /* IPv6 scope-id */
-- };
-+ } __attribute__ ((__packed__));
-
-
- /* IPv4 multicast request. */
-@@ -251,7 +251,7 @@
-
- /* Local IP address of interface. */
- struct in_addr imr_interface;
-- };
-+ } __attribute__ ((__packed__));
-
- struct ip_mreq_source
- {
-@@ -263,7 +263,7 @@
-
- /* IP address of interface. */
- struct in_addr imr_sourceaddr;
-- };
-+ } __attribute__ ((__packed__));
-
- /* Likewise, for IPv6. */
- struct ipv6_mreq
-@@ -273,7 +273,7 @@
-
- /* local interface */
- unsigned int ipv6mr_interface;
-- };
-+ } __attribute__ ((__packed__));
-
-
- /* Multicast group request. */
-@@ -284,7 +284,7 @@
-
- /* Group address. */
- struct sockaddr_storage gr_group;
-- };
-+ } __attribute__ ((__packed__));
-
- struct group_source_req
- {
-@@ -296,7 +296,7 @@
-
- /* Source address. */
- struct sockaddr_storage gsr_source;
-- };
-+ } __attribute__ ((__packed__));
-
-
- /* Full-state filter operations. */
-@@ -315,7 +315,7 @@
- uint32_t imsf_numsrc;
- /* Source addresses. */
- struct in_addr imsf_slist[1];
-- };
-+ } __attribute__ ((__packed__));
-
- #define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
- - sizeof (struct in_addr) \
-@@ -336,7 +336,7 @@
- uint32_t gf_numsrc;
- /* Source addresses. */
- struct sockaddr_storage gf_slist[1];
--};
-+} __attribute__ ((__packed__));
-
- #define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
- - sizeof (struct sockaddr_storage) \
-@@ -460,14 +460,14 @@
- {
- struct in6_addr ipi6_addr; /* src/dst IPv6 address */
- unsigned int ipi6_ifindex; /* send/recv interface index */
-- };
-+ } __attribute__ ((__packed__));
-
- /* IPv6 MTU information. */
- struct ip6_mtuinfo
- {
- struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
- uint32_t ip6m_mtu; /* path MTU in host byte order */
-- };
-+ } __attribute__ ((__packed__));
-
-
- #if 0 /*def __USE_GNU*/
-diff -urN uClibc-0.9.30.1.orig/include/netinet/ip.h uClibc-0.9.30.1/include/netinet/ip.h
---- uClibc-0.9.30.1.orig/include/netinet/ip.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/ip.h 2009-04-08 09:00:26.242514273 +0200
-@@ -63,7 +63,7 @@
- u_int32_t saddr;
- u_int32_t daddr;
- /*The options start here. */
-- };
-+ } __attribute__ ((__packed__));
-
- #ifdef __USE_BSD
- /*
-@@ -127,7 +127,7 @@
- u_int8_t ip_p; /* protocol */
- u_short ip_sum; /* checksum */
- struct in_addr ip_src, ip_dst; /* source and dest address */
-- };
-+ } __attribute__ ((__packed__));
-
- /*
- * Time stamp option structure.
-diff -urN uClibc-0.9.30.1.orig/include/netinet/ip_icmp.h uClibc-0.9.30.1/include/netinet/ip_icmp.h
---- uClibc-0.9.30.1.orig/include/netinet/ip_icmp.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/ip_icmp.h 2009-04-08 09:00:26.242514273 +0200
-@@ -43,7 +43,7 @@
- u_int16_t mtu;
- } frag; /* path mtu discovery */
- } un;
--};
-+} __attribute__ ((__packed__));
-
- #define ICMP_ECHOREPLY 0 /* Echo Reply */
- #define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
-@@ -199,7 +199,7 @@
- #define icmp_radv icmp_dun.id_radv
- #define icmp_mask icmp_dun.id_mask
- #define icmp_data icmp_dun.id_data
--};
-+} __attribute__ ((__packed__));
-
- /*
- * Lower bounds on packet lengths for various types.
-diff -urN uClibc-0.9.30.1.orig/include/netinet/tcp.h uClibc-0.9.30.1/include/netinet/tcp.h
---- uClibc-0.9.30.1.orig/include/netinet/tcp.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/tcp.h 2009-04-08 09:00:26.242514273 +0200
-@@ -86,7 +86,7 @@
- u_int16_t th_win; /* window */
- u_int16_t th_sum; /* checksum */
- u_int16_t th_urp; /* urgent pointer */
--};
-+} __attribute__ ((__packed__));
-
- # else /* !__FAVOR_BSD */
- struct tcphdr
-@@ -121,7 +121,7 @@
- u_int16_t window;
- u_int16_t check;
- u_int16_t urg_ptr;
--};
-+} __attribute__ ((__packed__));
- # endif /* __FAVOR_BSD */
-
- enum
-@@ -226,7 +226,7 @@
- u_int32_t tcpi_rcv_space;
-
- u_int32_t tcpi_total_retrans;
--};
-+} __attribute__ ((__packed__));
-
-
- /* For TCP_MD5SIG socket option. */
-@@ -239,7 +239,7 @@
- u_int16_t tcpm_keylen; /* Key length. */
- u_int32_t __tcpm_pad2; /* Zero. */
- u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */
--};
-+} __attribute__ ((__packed__));
-
- #endif /* Misc. */
-
-diff -urN uClibc-0.9.30.1.orig/include/netinet/udp.h uClibc-0.9.30.1/include/netinet/udp.h
---- uClibc-0.9.30.1.orig/include/netinet/udp.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/udp.h 2009-04-08 09:00:26.242514273 +0200
-@@ -61,7 +61,7 @@
- u_int16_t uh_dport; /* destination port */
- u_int16_t uh_ulen; /* udp length */
- u_int16_t uh_sum; /* udp checksum */
--};
-+} __attribute__ ((__packed__));
-
- #else
-
-@@ -71,7 +71,7 @@
- u_int16_t dest;
- u_int16_t len;
- u_int16_t check;
--};
-+} __attribute__ ((__packed__));
- #endif
-
- #define SOL_UDP 17 /* sockopt level for UDP */
diff --git a/patches/uClibc/0.9.30.2/100-fix-gethostent_r-failure-retval.patch b/patches/uClibc/0.9.30.2/100-fix-gethostent_r-failure-retval.patch
deleted file mode 100644
index 34e18d2..0000000
--- a/patches/uClibc/0.9.30.2/100-fix-gethostent_r-failure-retval.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/libc/inet/resolv.c uClibc-0.9.30/libc/inet/resolv.c
---- uClibc-0.9.30.orig/libc/inet/resolv.c 2008-11-02 01:25:33.000000000 +0100
-+++ uClibc-0.9.30/libc/inet/resolv.c 2009-02-07 09:57:59.000000000 +0100
-@@ -1788,7 +1788,7 @@
- int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
- struct hostent **result, int *h_errnop)
- {
-- int ret;
-+ int ret = HOST_NOT_FOUND;
-
- __UCLIBC_MUTEX_LOCK(mylock);
- if (__gethostent_fp == NULL) {
diff --git a/patches/uClibc/0.9.30.2/110-arm_fix_alignment.patch b/patches/uClibc/0.9.30.2/110-arm_fix_alignment.patch
deleted file mode 100644
index 1029c34..0000000
--- a/patches/uClibc/0.9.30.2/110-arm_fix_alignment.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
-ARMV5 can use STRD and LDRD access instructions but these accesses need to be
-8 byte aligned. The dynamic linker's malloc needs to match this so structures
-become 8 byte aligned to void unaligned accesses.
-
-RP - 14/02/2008
-
--= END original header =-
-
-Modified slightly for uClibc-0.9.30.2 by Joachim Nilsson <jocke@vmlinux.org>
-
-diff -durN uClibc-0.9.30.orig/ldso/ldso/arm/dl-sysdep.h uClibc-0.9.30/ldso/ldso/arm/dl-sysdep.h
---- uClibc-0.9.30.orig/ldso/ldso/arm/dl-sysdep.h 2008-09-25 10:35:20.000000000 +0200
-+++ uClibc-0.9.30/ldso/ldso/arm/dl-sysdep.h 2009-02-07 09:57:59.000000000 +0100
-@@ -15,6 +15,8 @@
- GOT_BASE[1] = (unsigned long) MODULE; \
- }
-
-+#define DL_MALLOC_ALIGN 8 /* EABI needs 8 byte alignment for STRD LDRD*/
-+
- static __always_inline unsigned long arm_modulus(unsigned long m, unsigned long p)
- {
- unsigned long i,t,inc;
diff --git a/patches/uClibc/0.9.30.2/120-rm-whitespace.patch b/patches/uClibc/0.9.30.2/120-rm-whitespace.patch
deleted file mode 100644
index 3857dc3..0000000
--- a/patches/uClibc/0.9.30.2/120-rm-whitespace.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/include/assert.h uClibc-0.9.30/include/assert.h
---- uClibc-0.9.30.orig/include/assert.h 2008-07-23 13:23:36.000000000 +0200
-+++ uClibc-0.9.30/include/assert.h 2009-02-07 09:57:59.000000000 +0100
-@@ -31,7 +31,7 @@
- #define _ASSERT_H 1
- #include <features.h>
-
--#if defined __cplusplus && __GNUC_PREREQ (2,95)
-+#if defined __cplusplus && __GNUC_PREREQ(2,95)
- # define __ASSERT_VOID_CAST static_cast<void>
- #else
- # define __ASSERT_VOID_CAST (void)
-@@ -60,12 +60,15 @@
- (__assert (__STRING(expr), __FILE__, __LINE__, \
- __ASSERT_FUNCTION), 0)))
-
-+/* Define some temporaries to workaround tinyx makedepend bug */
-+#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
-+#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
- /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
- which contains the name of the function currently being defined.
- This is broken in G++ before version 2.6.
- C9x has a similar variable called __func__, but prefer the GCC one since
- it demangles C++ function names. */
--# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
-+# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
- # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
- # else
- # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-diff -durN uClibc-0.9.30.orig/include/complex.h uClibc-0.9.30/include/complex.h
---- uClibc-0.9.30.orig/include/complex.h 2008-10-03 16:24:28.000000000 +0200
-+++ uClibc-0.9.30/include/complex.h 2009-02-07 09:57:59.000000000 +0100
-@@ -33,7 +33,7 @@
- /* We might need to add support for more compilers here. But since ISO
- C99 is out hopefully all maintained compilers will soon provide the data
- types `float complex' and `double complex'. */
--#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
-+#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
- # define _Complex __complex__
- #endif
-
-diff -durN uClibc-0.9.30.orig/include/features.h uClibc-0.9.30/include/features.h
---- uClibc-0.9.30.orig/include/features.h 2008-09-06 18:45:07.000000000 +0200
-+++ uClibc-0.9.30/include/features.h 2009-02-07 09:57:59.000000000 +0100
-@@ -143,7 +143,7 @@
-
- /* Convenience macros to test the versions of glibc and gcc.
- Use them like this:
-- #if __GNUC_PREREQ (2,8)
-+ #if __GNUC_PREREQ(2,8)
- ... code requiring gcc 2.8 or later ...
- #endif
- Note - they won't work for gcc1 or glibc1, since the _MINOR macros
-@@ -297,7 +297,7 @@
- /* uClibc does not support _FORTIFY_SOURCE */
- #undef _FORTIFY_SOURCE
- #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
-- && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
-+ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
- # if _FORTIFY_SOURCE > 1
- # define __USE_FORTIFY_LEVEL 2
- # else
-@@ -366,7 +366,7 @@
- * uclibc itself is usually built without __USE_EXTERN_INLINES,
- * remove "&& !defined __OPTIMIZE_SIZE__" part to do otherwise.
- */
--#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
-+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
- && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
- && (defined __extern_inline || defined __GNUC_GNU_INLINE__)
- # define __USE_EXTERN_INLINES 1
-diff -durN uClibc-0.9.30.orig/include/tgmath.h uClibc-0.9.30/include/tgmath.h
---- uClibc-0.9.30.orig/include/tgmath.h 2008-10-03 16:24:28.000000000 +0200
-+++ uClibc-0.9.30/include/tgmath.h 2009-02-07 09:57:59.000000000 +0100
-@@ -34,7 +34,7 @@
- do not try this for now and instead concentrate only on GNU CC. Once
- we have more information support for other compilers might follow. */
-
--#if __GNUC_PREREQ (2, 7)
-+#if __GNUC_PREREQ(2, 7)
-
- # ifdef __NO_LONG_DOUBLE_MATH
- # define __tgml(fct) fct
diff --git a/patches/uClibc/0.9.30.2/130-gnu89-inline.patch b/patches/uClibc/0.9.30.2/130-gnu89-inline.patch
deleted file mode 100644
index bc45bf6..0000000
--- a/patches/uClibc/0.9.30.2/130-gnu89-inline.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/Rules.mak uClibc-0.9.30/Rules.mak
---- uClibc-0.9.30.orig/Rules.mak 2008-11-12 13:24:16.000000000 +0100
-+++ uClibc-0.9.30/Rules.mak 2009-02-07 09:57:59.000000000 +0100
-@@ -519,6 +519,7 @@
- endif
-
- CFLAGS += $(call check_gcc,-std=gnu99,)
-+CFLAGS += $(call check_gcc,-fgnu89-inline,)
-
- LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared \
- -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc
diff --git a/patches/uClibc/0.9.30.2/140-pack-netinet-structs.patch b/patches/uClibc/0.9.30.2/140-pack-netinet-structs.patch
deleted file mode 100644
index d727f4d..0000000
--- a/patches/uClibc/0.9.30.2/140-pack-netinet-structs.patch
+++ /dev/null
@@ -1,224 +0,0 @@
-diff -urN uClibc-0.9.30.1.orig/include/netinet/igmp.h uClibc-0.9.30.1/include/netinet/igmp.h
---- uClibc-0.9.30.1.orig/include/netinet/igmp.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/igmp.h 2009-04-08 09:00:26.242514273 +0200
-@@ -69,7 +69,7 @@
- u_int8_t igmp_code; /* routing code */
- u_int16_t igmp_cksum; /* checksum */
- struct in_addr igmp_group; /* group address */
--};
-+} __attribute__ ((__packed__));
-
- #define IGMP_MINLEN 8
-
-diff -urN uClibc-0.9.30.1.orig/include/netinet/in.h uClibc-0.9.30.1/include/netinet/in.h
---- uClibc-0.9.30.1.orig/include/netinet/in.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/in.h 2009-04-08 09:00:26.242514273 +0200
-@@ -202,7 +202,7 @@
- #define s6_addr in6_u.u6_addr8
- #define s6_addr16 in6_u.u6_addr16
- #define s6_addr32 in6_u.u6_addr32
-- };
-+ } __attribute__ ((__packed__));
-
- extern const struct in6_addr in6addr_any; /* :: */
- extern const struct in6_addr in6addr_loopback; /* ::1 */
-@@ -229,7 +229,7 @@
- __SOCKADDR_COMMON_SIZE -
- sizeof (in_port_t) -
- sizeof (struct in_addr)];
-- };
-+ } __attribute__ ((__packed__));
- #endif
-
- /* Ditto, for IPv6. */
-@@ -240,7 +240,7 @@
- uint32_t sin6_flowinfo; /* IPv6 flow information */
- struct in6_addr sin6_addr; /* IPv6 address */
- uint32_t sin6_scope_id; /* IPv6 scope-id */
-- };
-+ } __attribute__ ((__packed__));
-
-
- /* IPv4 multicast request. */
-@@ -251,7 +251,7 @@
-
- /* Local IP address of interface. */
- struct in_addr imr_interface;
-- };
-+ } __attribute__ ((__packed__));
-
- struct ip_mreq_source
- {
-@@ -263,7 +263,7 @@
-
- /* IP address of interface. */
- struct in_addr imr_sourceaddr;
-- };
-+ } __attribute__ ((__packed__));
-
- /* Likewise, for IPv6. */
- struct ipv6_mreq
-@@ -273,7 +273,7 @@
-
- /* local interface */
- unsigned int ipv6mr_interface;
-- };
-+ } __attribute__ ((__packed__));
-
-
- /* Multicast group request. */
-@@ -284,7 +284,7 @@
-
- /* Group address. */
- struct sockaddr_storage gr_group;
-- };
-+ } __attribute__ ((__packed__));
-
- struct group_source_req
- {
-@@ -296,7 +296,7 @@
-
- /* Source address. */
- struct sockaddr_storage gsr_source;
-- };
-+ } __attribute__ ((__packed__));
-
-
- /* Full-state filter operations. */
-@@ -315,7 +315,7 @@
- uint32_t imsf_numsrc;
- /* Source addresses. */
- struct in_addr imsf_slist[1];
-- };
-+ } __attribute__ ((__packed__));
-
- #define IP_MSFILTER_SIZE(numsrc) (sizeof (struct ip_msfilter) \
- - sizeof (struct in_addr) \
-@@ -336,7 +336,7 @@
- uint32_t gf_numsrc;
- /* Source addresses. */
- struct sockaddr_storage gf_slist[1];
--};
-+} __attribute__ ((__packed__));
-
- #define GROUP_FILTER_SIZE(numsrc) (sizeof (struct group_filter) \
- - sizeof (struct sockaddr_storage) \
-@@ -460,14 +460,14 @@
- {
- struct in6_addr ipi6_addr; /* src/dst IPv6 address */
- unsigned int ipi6_ifindex; /* send/recv interface index */
-- };
-+ } __attribute__ ((__packed__));
-
- /* IPv6 MTU information. */
- struct ip6_mtuinfo
- {
- struct sockaddr_in6 ip6m_addr; /* dst address including zone ID */
- uint32_t ip6m_mtu; /* path MTU in host byte order */
-- };
-+ } __attribute__ ((__packed__));
-
-
- #if 0 /*def __USE_GNU*/
-diff -urN uClibc-0.9.30.1.orig/include/netinet/ip.h uClibc-0.9.30.1/include/netinet/ip.h
---- uClibc-0.9.30.1.orig/include/netinet/ip.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/ip.h 2009-04-08 09:00:26.242514273 +0200
-@@ -63,7 +63,7 @@
- u_int32_t saddr;
- u_int32_t daddr;
- /*The options start here. */
-- };
-+ } __attribute__ ((__packed__));
-
- #ifdef __USE_BSD
- /*
-@@ -127,7 +127,7 @@
- u_int8_t ip_p; /* protocol */
- u_short ip_sum; /* checksum */
- struct in_addr ip_src, ip_dst; /* source and dest address */
-- };
-+ } __attribute__ ((__packed__));
-
- /*
- * Time stamp option structure.
-diff -urN uClibc-0.9.30.1.orig/include/netinet/ip_icmp.h uClibc-0.9.30.1/include/netinet/ip_icmp.h
---- uClibc-0.9.30.1.orig/include/netinet/ip_icmp.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/ip_icmp.h 2009-04-08 09:00:26.242514273 +0200
-@@ -43,7 +43,7 @@
- u_int16_t mtu;
- } frag; /* path mtu discovery */
- } un;
--};
-+} __attribute__ ((__packed__));
-
- #define ICMP_ECHOREPLY 0 /* Echo Reply */
- #define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
-@@ -199,7 +199,7 @@
- #define icmp_radv icmp_dun.id_radv
- #define icmp_mask icmp_dun.id_mask
- #define icmp_data icmp_dun.id_data
--};
-+} __attribute__ ((__packed__));
-
- /*
- * Lower bounds on packet lengths for various types.
-diff -urN uClibc-0.9.30.1.orig/include/netinet/tcp.h uClibc-0.9.30.1/include/netinet/tcp.h
---- uClibc-0.9.30.1.orig/include/netinet/tcp.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/tcp.h 2009-04-08 09:00:26.242514273 +0200
-@@ -86,7 +86,7 @@
- u_int16_t th_win; /* window */
- u_int16_t th_sum; /* checksum */
- u_int16_t th_urp; /* urgent pointer */
--};
-+} __attribute__ ((__packed__));
-
- # else /* !__FAVOR_BSD */
- struct tcphdr
-@@ -121,7 +121,7 @@
- u_int16_t window;
- u_int16_t check;
- u_int16_t urg_ptr;
--};
-+} __attribute__ ((__packed__));
- # endif /* __FAVOR_BSD */
-
- enum
-@@ -226,7 +226,7 @@
- u_int32_t tcpi_rcv_space;
-
- u_int32_t tcpi_total_retrans;
--};
-+} __attribute__ ((__packed__));
-
-
- /* For TCP_MD5SIG socket option. */
-@@ -239,7 +239,7 @@
- u_int16_t tcpm_keylen; /* Key length. */
- u_int32_t __tcpm_pad2; /* Zero. */
- u_int8_t tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* Key (binary). */
--};
-+} __attribute__ ((__packed__));
-
- #endif /* Misc. */
-
-diff -urN uClibc-0.9.30.1.orig/include/netinet/udp.h uClibc-0.9.30.1/include/netinet/udp.h
---- uClibc-0.9.30.1.orig/include/netinet/udp.h 2009-04-08 09:00:10.926545132 +0200
-+++ uClibc-0.9.30.1/include/netinet/udp.h 2009-04-08 09:00:26.242514273 +0200
-@@ -61,7 +61,7 @@
- u_int16_t uh_dport; /* destination port */
- u_int16_t uh_ulen; /* udp length */
- u_int16_t uh_sum; /* udp checksum */
--};
-+} __attribute__ ((__packed__));
-
- #else
-
-@@ -71,7 +71,7 @@
- u_int16_t dest;
- u_int16_t len;
- u_int16_t check;
--};
-+} __attribute__ ((__packed__));
- #endif
-
- #define SOL_UDP 17 /* sockopt level for UDP */
diff --git a/patches/uClibc/0.9.30.2/150-LT-pthread_atfork-unhide.patch b/patches/uClibc/0.9.30.2/150-LT-pthread_atfork-unhide.patch
deleted file mode 100644
index dfe4567..0000000
--- a/patches/uClibc/0.9.30.2/150-LT-pthread_atfork-unhide.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From a05c4380c5aaa6e107a4c7e1e5a139ec4cc43f0c Mon Sep 17 00:00:00 2001
-From: Henning Heinold <heinold@inf.fu-berlin.de>
-Date: Sun, 21 Feb 2010 11:55:32 +0100
-Subject: [PATCH 14/15] LT pthread_atfork: unhide
-
-Trying to compile perl with uClibc new linuxthreads on arm.
-I run into the problem that pthread_atfork is not available.
-The problem was that it was synced with the glibc version, which has
-compat ifdefs we do not need in uClibc. The inital checked in version
-is right and works. So either revert the commit 2 years ago
-or patch it with the patch attached I made for openembedded.
-
-Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- libpthread/linuxthreads/Makefile.in | 2 +-
- libpthread/linuxthreads/pthread_atfork.c | 13 +++----------
- 2 files changed, 4 insertions(+), 11 deletions(-)
-
-diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in
-index 947dea9..d53b5fa 100644
---- a/libpthread/linuxthreads/Makefile.in
-+++ b/libpthread/linuxthreads/Makefile.in
-@@ -45,7 +45,7 @@ pthread_sysdep_SRC := $(patsubst %,$(libpthread_DIR)/sysdeps/pthread/%.c,$(pthre
- pthread_SRC := \
- attr barrier cancel condvar errno events join pthread \
- lockfile manager mutex pt-machine ptcleanup \
-- ptclock_gettime ptclock_settime ptfork pthandles \
-+ ptclock_gettime ptclock_settime ptfork pthandles pthread_atfork \
- pthread_setegid pthread_seteuid pthread_setgid pthread_setregid \
- pthread_setresgid pthread_setresuid pthread_setreuid pthread_setuid \
- rwlock semaphore sighandler signals specific spinlock
-diff --git a/libpthread/linuxthreads/pthread_atfork.c b/libpthread/linuxthreads/pthread_atfork.c
-index 2464acb..4c83dd0 100644
---- a/libpthread/linuxthreads/pthread_atfork.c
-+++ b/libpthread/linuxthreads/pthread_atfork.c
-@@ -43,12 +43,8 @@ extern void *__dso_handle __attribute__ ((__weak__));
-
- /* Hide the symbol so that no definition but the one locally in the
- executable or DSO is used. */
--int
--#ifndef __pthread_atfork
--/* Don't mark the compatibility function as hidden. */
--attribute_hidden
--#endif
--__pthread_atfork (prepare, parent, child)
-+
-+int attribute_hidden __pthread_atfork (prepare, parent, child)
- void (*prepare) (void);
- void (*parent) (void);
- void (*child) (void);
-@@ -56,8 +52,5 @@ __pthread_atfork (prepare, parent, child)
- return __register_atfork (prepare, parent, child,
- &__dso_handle == NULL ? NULL : __dso_handle);
- }
--#ifndef __pthread_atfork
--extern int pthread_atfork (void (*prepare) (void), void (*parent) (void),
-- void (*child) (void)) attribute_hidden;
-+
- strong_alias (__pthread_atfork, pthread_atfork)
--#endif
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/160-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch b/patches/uClibc/0.9.30.2/160-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch
deleted file mode 100644
index 25b7964..0000000
--- a/patches/uClibc/0.9.30.2/160-Make-use-of-macros-from-sys-asm.h-in-crt1.S.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From 2911103dd4a03bbd3aad11eddfce524a5c9ba9b3 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 22 Jan 2010 13:00:20 +0100
-Subject: [PATCH 03/15] Make use of macros from sys/asm.h in crt1.S
-
-Needed for mips nptl to boot once again.
-(cherry picked from commit 9c343fd4030dcd7a52616f365893177dded50346)
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- libc/sysdeps/linux/mips/crt1.S | 46 +++++++++++----------------------------
- 1 files changed, 13 insertions(+), 33 deletions(-)
-
-diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S
-index e851d52..6a80412 100644
---- a/libc/sysdeps/linux/mips/crt1.S
-+++ b/libc/sysdeps/linux/mips/crt1.S
-@@ -85,29 +85,10 @@
-
- __start:
- #ifdef __PIC__
--#if _MIPS_SIM == _MIPS_SIM_ABI32
-- .frame sp, 24, sp
-- .set noreorder
-- move $0, $31 /* Save old ra. */
-- bal 10f /* Find addr of cpload. */
-- nop
--10:
-- .cpload $31
-- move $31, $0
-- .set reorder
-- .cprestore 16
--#else
-- move $0, $31; /* Save old ra. */
-- .set noreorder
-- bal 10f /* Find addr of .cpsetup. */
-- nop
--10:
-- .set reorder
-- .cpsetup $31, $25, 10b
-- move $31, $0
--#endif
-+ SETUP_GPX($0)
-+ SETUP_GPX64($25,$0)
- #else
-- la $28, _gp /* Setup GP correctly if we're non-PIC. */
-+ PTR_LA $28, _gp /* Setup GP correctly if we're non-PIC. */
- move $31, $0
- #endif
-
-@@ -118,18 +99,18 @@ __start:
- /* Allocate space on the stack for seven arguments and
- * make sure the stack is aligned to double words (8 bytes) */
-
-+ and $29, -2 * SZREG
-+
- #if _MIPS_SIM == _MIPS_SIM_ABI32
-- and $29, -2 * 4
-- subu $29, 32
-- la $7, _init /* init */
-- la $8, _fini
-- sw $8, 16($29) /* fini */
-- sw $2, 20($29) /* rtld_fini */
-- sw $29, 24($29) /* stack_end */
--#else
-- and $29, -2 * PTRSIZE
-+ PTR_SUBIU $29, 32
-+#endif
- PTR_LA $7, _init /* init */
-- PTR_LA $8, _fini /* fini */
-+ PTR_LA $8, _fini
-+#if _MIPS_SIM == _MIPS_SIM_ABI32
-+ PTR_S $8, 16($29) /* fini */
-+ PTR_S $2, 20($29) /* rtld_fini */
-+ PTR_S $29, 24($29) /* stack_end */
-+#else
- move $9, $2 /* rtld_fini */
- move $10, $29 /* stack_end */
- #endif
-@@ -148,4 +129,3 @@ __data_start:
- .weak data_start
- data_start = __data_start
-
--
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/170-Makefile.in-Make-install_dev-depend-on-install_runti.patch b/patches/uClibc/0.9.30.2/170-Makefile.in-Make-install_dev-depend-on-install_runti.patch
deleted file mode 100644
index 88c8490..0000000
--- a/patches/uClibc/0.9.30.2/170-Makefile.in-Make-install_dev-depend-on-install_runti.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 323453d85ed29ccba7a81d884479188869cd64b7 Mon Sep 17 00:00:00 2001
-From: Henning Heinold <heinold@inf.fu-berlin.de>
-Date: Sat, 23 Jan 2010 21:29:42 -0800
-Subject: [PATCH 13/15] Makefile.in: Make install_dev depend on install_runtime.
-
-* Helps in parallel build.
-
-Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- Makefile.in | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index ec4c28e..a889838 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -370,7 +370,7 @@ ifneq ($(UCLIBC_SUPPORT_AI_ADDRCONFIG),y)
- endif
-
- # Installs development library links.
--install_dev: install_headers all
-+install_dev: install_headers install_runtime
- $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)lib
- -$(INSTALL) -m 644 lib/*.[ao] $(PREFIX)$(DEVEL_PREFIX)lib/
- ifeq ($(HAVE_SHARED),y)
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/180-Unbreak-build-for-sparc-on-some-config-s.patch b/patches/uClibc/0.9.30.2/180-Unbreak-build-for-sparc-on-some-config-s.patch
deleted file mode 100644
index 21d779a..0000000
--- a/patches/uClibc/0.9.30.2/180-Unbreak-build-for-sparc-on-some-config-s.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 7b964170536951a260f7d552db99b428d1ea5026 Mon Sep 17 00:00:00 2001
-From: Austin Foxley <austinf@cetoncorp.com>
-Date: Wed, 3 Feb 2010 12:12:10 -0800
-Subject: [PATCH 08/15] Unbreak build for sparc on some config's
-
-Thanks to rob@landley.net
-
-Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
----
- libc/sysdeps/linux/sparc/sigaction.c | 9 ++++-----
- 1 files changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/libc/sysdeps/linux/sparc/sigaction.c b/libc/sysdeps/linux/sparc/sigaction.c
-index a22ac40..7140fd3 100644
---- a/libc/sysdeps/linux/sparc/sigaction.c
-+++ b/libc/sysdeps/linux/sparc/sigaction.c
-@@ -34,7 +34,8 @@ _syscall5(int, rt_sigaction, int, a, int, b, int, c, int, d, int, e);
- static void __rt_sigreturn_stub(void);
- static void __sigreturn_stub(void);
-
--int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
-+libc_hidden_proto(sigaction)
-+int sigaction(int sig, const struct sigaction *act, struct sigaction *oact)
- {
- int ret;
- struct sigaction kact, koact;
-@@ -65,10 +66,8 @@ int __libc_sigaction(int sig, const struct sigaction *act, struct sigaction *oac
- return ret;
- }
-
--#ifndef LIBC_SIGACTION
--weak_alias(__libc_sigaction,sigaction)
--libc_hidden_weak(sigaction)
--#endif
-+libc_hidden_def(sigaction)
-+weak_alias(sigaction,__libc_sigaction)
-
- static void
- __rt_sigreturn_stub(void)
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/210-fix-make-install-host-utils.patch b/patches/uClibc/0.9.30.2/210-fix-make-install-host-utils.patch
deleted file mode 100644
index 526dfb1..0000000
--- a/patches/uClibc/0.9.30.2/210-fix-make-install-host-utils.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-From d75ad2e129b3f22296cead3db53c784527deab60 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 18 Sep 2009 14:07:31 +0000
-Subject: fix make {,install_}{,host}utils
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
-diff --git a/extra/locale/programs/locale.c b/extra/locale/programs/locale.c
-index 462a579..dfd2029 100644
---- a/extra/locale/programs/locale.c
-+++ b/extra/locale/programs/locale.c
-@@ -10,10 +10,9 @@
- *
- */
-
--
-+#include <string.h>
- #include <stdio.h>
- #include <stdlib.h>
--#include <string.h>
- #include <langinfo.h>
- #include <unistd.h>
- #ifdef __UCLIBC_HAS_GETOPT_LONG__
-diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
-index 290e680..3ce884d 100644
---- a/libc/misc/wchar/wchar.c
-+++ b/libc/misc/wchar/wchar.c
-@@ -171,7 +171,6 @@ extern size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
-
- extern size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n,
- const wchar_t **__restrict src, size_t wn) attribute_hidden;
--
- #endif /* _LIBC */
- /**********************************************************************/
- #ifdef L_btowc
-@@ -1201,45 +1200,6 @@ typedef struct {
- int skip_invalid_input; /* To support iconv -c option. */
- } _UC_iconv_t;
-
--
--
--#ifdef L_iconv
--
--#include <iconv.h>
--#include <string.h>
--#include <endian.h>
--#include <byteswap.h>
--
--#if (__BYTE_ORDER != __BIG_ENDIAN) && (__BYTE_ORDER != __LITTLE_ENDIAN)
--#error unsupported endianness for iconv
--#endif
--
--#ifndef __CTYPE_HAS_8_BIT_LOCALES
--#error currently iconv requires 8 bit locales
--#endif
--#ifndef __CTYPE_HAS_UTF_8_LOCALES
--#error currently iconv requires UTF-8 locales
--#endif
--
--
--enum {
-- IC_WCHAR_T = 0xe0,
-- IC_MULTIBYTE = 0xe0,
--#if __BYTE_ORDER == __BIG_ENDIAN
-- IC_UCS_4 = 0xec,
-- IC_UTF_32 = 0xe4,
-- IC_UCS_2 = 0xe2,
-- IC_UTF_16 = 0xea,
--#else
-- IC_UCS_4 = 0xed,
-- IC_UTF_32 = 0xe5,
-- IC_UCS_2 = 0xe3,
-- IC_UTF_16 = 0xeb,
--#endif
-- IC_UTF_8 = 2,
-- IC_ASCII = 1
--};
--
- /* For the multibyte
- * bit 0 means swap endian
- * bit 1 means 2 byte
-@@ -1247,8 +1207,13 @@ enum {
- *
- */
-
-+#if defined L_iconv && defined _LIBC
-+/* Used externally only by iconv utility */
- extern const unsigned char __iconv_codesets[];
- libc_hidden_proto(__iconv_codesets)
-+#endif
-+
-+#if defined L_iconv || defined L_iconv_main
- const unsigned char __iconv_codesets[] =
- "\x0a\xe0""WCHAR_T\x00" /* superset of UCS-4 but platform-endian */
- #if __BYTE_ORDER == __BIG_ENDIAN
-@@ -1281,7 +1246,48 @@ const unsigned char __iconv_codesets[] =
- "\x08\x02""UTF-8\x00"
- "\x0b\x01""US-ASCII\x00"
- "\x07\x01""ASCII"; /* Must be last! (special case to save a nul) */
-+#endif
-+#if defined L_iconv && defined _LIBC
- libc_hidden_data_def(__iconv_codesets)
-+#endif
-+
-+
-+#ifdef L_iconv
-+
-+#include <iconv.h>
-+#include <string.h>
-+#include <endian.h>
-+#include <byteswap.h>
-+
-+#if (__BYTE_ORDER != __BIG_ENDIAN) && (__BYTE_ORDER != __LITTLE_ENDIAN)
-+#error unsupported endianness for iconv
-+#endif
-+
-+#ifndef __CTYPE_HAS_8_BIT_LOCALES
-+#error currently iconv requires 8 bit locales
-+#endif
-+#ifndef __CTYPE_HAS_UTF_8_LOCALES
-+#error currently iconv requires UTF-8 locales
-+#endif
-+
-+
-+enum {
-+ IC_WCHAR_T = 0xe0,
-+ IC_MULTIBYTE = 0xe0,
-+#if __BYTE_ORDER == __BIG_ENDIAN
-+ IC_UCS_4 = 0xec,
-+ IC_UTF_32 = 0xe4,
-+ IC_UCS_2 = 0xe2,
-+ IC_UTF_16 = 0xea,
-+#else
-+ IC_UCS_4 = 0xed,
-+ IC_UTF_32 = 0xe5,
-+ IC_UCS_2 = 0xe3,
-+ IC_UTF_16 = 0xeb,
-+#endif
-+ IC_UTF_8 = 2,
-+ IC_ASCII = 1
-+};
-
- /* Experimentally off - libc_hidden_proto(strcasecmp) */
-
-@@ -1575,6 +1581,4 @@ size_t weak_function iconv(iconv_t cd, char **__restrict inbuf,
- }
- return nrcount;
- }
--
- #endif
--
---
-cgit v0.8.2.1
diff --git a/patches/uClibc/0.9.30.2/220-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch b/patches/uClibc/0.9.30.2/220-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch
deleted file mode 100644
index 52ae2a5..0000000
--- a/patches/uClibc/0.9.30.2/220-fstatat-fix-up-behavior-on-32-64-bit-hosts.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From d43f068e84513ed88392df4ca27d49ad01145fd2 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sun, 6 Sep 2009 12:12:12 -0400
-Subject: [PATCH 07/15] fstatat: fix up behavior on 32/64 bit hosts
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The fstatat() syscall is a little funky in that it sometimes changes name
-between 32 and 64 bit hosts, but it should always operate on a 64bit stat
-structure. So for the fstatat() function, make sure we convert it from a
-64bit kstat to a 32bit stat.
-
-Along these lines, we need to restore the __xstat32_conv() function.
-
-Reported-by: Timo Teräs <timo.teras@iki.fi>
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- libc/sysdeps/linux/common/fstatat.c | 9 +++++++--
- libc/sysdeps/linux/common/fstatat64.c | 5 +++++
- libc/sysdeps/linux/common/xstatconv.c | 19 +++++++++++++++++++
- libc/sysdeps/linux/common/xstatconv.h | 1 +
- 4 files changed, 32 insertions(+), 2 deletions(-)
-
-diff --git a/libc/sysdeps/linux/common/fstatat.c b/libc/sysdeps/linux/common/fstatat.c
-index 149c189..33daa7c 100644
---- a/libc/sysdeps/linux/common/fstatat.c
-+++ b/libc/sysdeps/linux/common/fstatat.c
-@@ -10,15 +10,20 @@
- #include <sys/stat.h>
- #include "xstatconv.h"
-
-+/* 64bit ports tend to favor newfstatat() */
-+#ifdef __NR_newfstatat
-+# define __NR_fstatat64 __NR_newfstatat
-+#endif
-+
- #ifdef __NR_fstatat64
- int fstatat(int fd, const char *file, struct stat *buf, int flag)
- {
- int ret;
-- struct kernel_stat kbuf;
-+ struct kernel_stat64 kbuf;
-
- ret = INLINE_SYSCALL(fstatat64, 4, fd, file, &kbuf, flag);
- if (ret == 0)
-- __xstat_conv(&kbuf, buf);
-+ __xstat32_conv(&kbuf, buf);
-
- return ret;
- }
-diff --git a/libc/sysdeps/linux/common/fstatat64.c b/libc/sysdeps/linux/common/fstatat64.c
-index 5ae1fad..95627af 100644
---- a/libc/sysdeps/linux/common/fstatat64.c
-+++ b/libc/sysdeps/linux/common/fstatat64.c
-@@ -12,6 +12,11 @@
-
- #ifdef __UCLIBC_HAS_LFS__
-
-+/* 64bit ports tend to favor newfstatat() */
-+#ifdef __NR_newfstatat
-+# define __NR_fstatat64 __NR_newfstatat
-+#endif
-+
- #ifdef __NR_fstatat64
- int fstatat64(int fd, const char *file, struct stat64 *buf, int flag)
- {
-diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c
-index e575b26..50455c6 100644
---- a/libc/sysdeps/linux/common/xstatconv.c
-+++ b/libc/sysdeps/linux/common/xstatconv.c
-@@ -46,6 +46,25 @@ void attribute_hidden __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
- buf->st_ctim = kbuf->st_ctim;
- }
-
-+void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf)
-+{
-+ /* Convert to current kernel version of `struct stat64'. */
-+ memset(buf, 0x00, sizeof(*buf));
-+ buf->st_dev = kbuf->st_dev;
-+ buf->st_ino = kbuf->st_ino;
-+ buf->st_mode = kbuf->st_mode;
-+ buf->st_nlink = kbuf->st_nlink;
-+ buf->st_uid = kbuf->st_uid;
-+ buf->st_gid = kbuf->st_gid;
-+ buf->st_rdev = kbuf->st_rdev;
-+ buf->st_size = kbuf->st_size;
-+ buf->st_blksize = kbuf->st_blksize;
-+ buf->st_blocks = kbuf->st_blocks;
-+ buf->st_atim = kbuf->st_atim;
-+ buf->st_mtim = kbuf->st_mtim;
-+ buf->st_ctim = kbuf->st_ctim;
-+}
-+
- #ifdef __UCLIBC_HAS_LFS__
-
- void attribute_hidden __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
-diff --git a/libc/sysdeps/linux/common/xstatconv.h b/libc/sysdeps/linux/common/xstatconv.h
-index 57c8bcb..7568da8 100644
---- a/libc/sysdeps/linux/common/xstatconv.h
-+++ b/libc/sysdeps/linux/common/xstatconv.h
-@@ -26,6 +26,7 @@
- #include <bits/kernel_stat.h>
-
- extern void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf) attribute_hidden;
-+extern void __xstat32_conv(struct kernel_stat64 *kbuf, struct stat *buf) attribute_hidden;
- #if defined __UCLIBC_HAS_LFS__
- extern void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf) attribute_hidden;
- #endif
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/230-getdents-Fix-mips64-build.patch b/patches/uClibc/0.9.30.2/230-getdents-Fix-mips64-build.patch
deleted file mode 100644
index 3e5713e..0000000
--- a/patches/uClibc/0.9.30.2/230-getdents-Fix-mips64-build.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 13545bce877b33e30155fc412ad44cc118d83f77 Mon Sep 17 00:00:00 2001
-From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
-Date: Sat, 30 Jan 2010 00:24:37 +0900
-Subject: [PATCH 15/15] getdents: Fix mips64 build
-
-On Wed, 27 Jan 2010 07:14:08 +0100, Carmelo AMOROSO <carmelo.amoroso@st.com> wrote:
-> I would re-write your patch in a simpler way.
->
-> We already have the following
->
-> 136 #if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
-> 137 attribute_hidden strong_alias(__getdents,__getdents64)
-> 138 #endif
->
-> I think that it's simpler to move in the proper place this statement.
-
-Thanks, indeed. If we came into "#elif WORDSIZE == 32" block, above
-condition never be true. So we can just move this statement out of
-"#if...#elif...#elif...#endif" block. Here is a revised patch.
-
-------------------------------------------------------
-From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
-Subject: [PATCH] getdents: Fix mips64 build
-
-Some archs (such as mips64) do not have getdents64 syscall but have
-getdents syscall. Define alias for it.
-
-This fixes regression from 0.9.30.1.
-
-Backgrounds:
-This is once done by commit e8b1c674. But after the commit 33bcf733
-("Use getdents syscall if kernel provide supports for this instead of
-relying upon getdents64."), if __ASSUME_GETDENTS32_D_TYPE was defined
-the alias for getdents64 is not defined. The macro
-__ASSUME_GETDENTS32_D_TYPE had been effectively ignored until 0.9.30.1
-but the commit 0f0f20ab ("Move kernel-features.h header from the
-linuxthread directory to a common one...") really enables it.
-
-Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- libc/sysdeps/linux/common/getdents.c | 8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/libc/sysdeps/linux/common/getdents.c b/libc/sysdeps/linux/common/getdents.c
-index b518cc0..66a03b3 100644
---- a/libc/sysdeps/linux/common/getdents.c
-+++ b/libc/sysdeps/linux/common/getdents.c
-@@ -136,10 +136,6 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
- return (char *) dp - buf;
- }
-
--#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
--attribute_hidden strong_alias(__getdents,__getdents64)
--#endif
--
- #elif __WORDSIZE == 32
-
- /* Experimentally off - libc_hidden_proto(memmove) */
-@@ -171,4 +167,8 @@ ssize_t __getdents (int fd, char *buf, size_t nbytes)
- }
- #endif
-
-+#if defined __UCLIBC_HAS_LFS__ && ! defined __NR_getdents64
-+attribute_hidden strong_alias(__getdents,__getdents64)
-+#endif
-+
- #endif
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/240-host-utils-depend-on-headers.patch b/patches/uClibc/0.9.30.2/240-host-utils-depend-on-headers.patch
deleted file mode 100644
index 39b9642..0000000
--- a/patches/uClibc/0.9.30.2/240-host-utils-depend-on-headers.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 47e88c04e01299f975ff23f33035d0f34a8f6787 Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Fri, 22 Jan 2010 13:32:44 +0100
-Subject: [PATCH 06/15] {,host}utils depend on headers
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- Makefile.in | 4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 4c5aecb..ec4c28e 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -436,7 +436,7 @@ ifeq ($(HAVE_SHARED),y)
- fi
- endif
-
--utils:
-+utils: headers
- $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils $@
-
- # Installs helper applications, such as 'ldd' and 'ldconfig'
-@@ -445,7 +445,7 @@ install_utils: utils
-
- endif # ifeq ($(HAVE_DOT_CONFIG),y)
-
--hostutils:
-+hostutils: headers
- $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils $@
-
- install_hostutils: hostutils
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/250-libc-Fix-typo-in-include-rpc.patch b/patches/uClibc/0.9.30.2/250-libc-Fix-typo-in-include-rpc.patch
deleted file mode 100644
index 423617a..0000000
--- a/patches/uClibc/0.9.30.2/250-libc-Fix-typo-in-include-rpc.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From b4d6a6e94d87ff2b4ae687a21048833f19b9dd48 Mon Sep 17 00:00:00 2001
-From: Carmelo Amoroso <carmelo.amoroso@st.com>
-Date: Mon, 8 Feb 2010 16:24:06 +0100
-Subject: [PATCH 11/15] libc: Fix typo in include/rpc
-
-s/GNU_SOUCE/GNU_SOURCE/ in include/rcp/
-
-Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
-Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
----
- include/rpc/auth.h | 4 ++--
- include/rpc/rpc.h | 4 ++--
- include/rpc/types.h | 4 ++--
- 3 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/include/rpc/auth.h b/include/rpc/auth.h
-index 17eb59f..12297e6 100644
---- a/include/rpc/auth.h
-+++ b/include/rpc/auth.h
-@@ -47,8 +47,8 @@
- #ifndef __FORCE_GLIBC
- #define __FORCE_GLIBC
- #endif
--#ifndef _GNU_SOUCE
--#define _GNU_SOUCE
-+#ifndef _GNU_SOURCE
-+#define _GNU_SOURCE
- #endif
- #define _(X) X
- #endif
-diff --git a/include/rpc/rpc.h b/include/rpc/rpc.h
-index 8194ffe..219910e 100644
---- a/include/rpc/rpc.h
-+++ b/include/rpc/rpc.h
-@@ -44,8 +44,8 @@
- #ifndef __FORCE_GLIBC
- #define __FORCE_GLIBC
- #endif
--#ifndef _GNU_SOUCE
--#define _GNU_SOUCE
-+#ifndef _GNU_SOURCE
-+#define _GNU_SOURCE
- #endif
- #define _(X) X
- #include <features.h>
-diff --git a/include/rpc/types.h b/include/rpc/types.h
-index 469576e..05f49c3 100644
---- a/include/rpc/types.h
-+++ b/include/rpc/types.h
-@@ -39,8 +39,8 @@
- #ifndef __FORCE_GLIBC
- #define __FORCE_GLIBC
- #endif
--#ifndef _GNU_SOUCE
--#define _GNU_SOUCE
-+#ifndef _GNU_SOURCE
-+#define _GNU_SOURCE
- #endif
- #define _(X) X
- #endif
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/260-libm-enable-log2f-and-exp2f.patch b/patches/uClibc/0.9.30.2/260-libm-enable-log2f-and-exp2f.patch
deleted file mode 100644
index 3b43356..0000000
--- a/patches/uClibc/0.9.30.2/260-libm-enable-log2f-and-exp2f.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 956a0087e282e53ba9c085dbbc469391f7234944 Mon Sep 17 00:00:00 2001
-From: Aurelien Jacobs <aurel@gnuage.org>
-Date: Thu, 4 Feb 2010 09:31:40 -0800
-Subject: [PATCH 10/15] libm: enable log2f and exp2f
-
-Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
-Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
----
- libm/float_wrappers.c | 4 ++--
- test/math/compile_test.c | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/libm/float_wrappers.c b/libm/float_wrappers.c
-index dc315e7..b7317a1 100644
---- a/libm/float_wrappers.c
-+++ b/libm/float_wrappers.c
-@@ -15,12 +15,10 @@
-
- /* For the time being, do _NOT_ implement these functions
- * that are defined by SuSv3 */
--#undef L_exp2f /*float exp2f(float);*/
- #undef L_fdimf /*float fdimf(float, float);*/
- #undef L_fmaf /*float fmaf(float, float, float);*/
- #undef L_fmaxf /*float fmaxf(float, float);*/
- #undef L_fminf /*float fminf(float, float);*/
--#undef L_log2f /*float log2f(float);*/
- #undef L_nearbyintf /*float nearbyintf(float);*/
- #undef L_nexttowardf /*float nexttowardf(float, long double);*/
- #undef L_remquof /*float remquof(float, float, int *);*/
-@@ -43,6 +41,7 @@ float cosf(float);
- float coshf(float);
- float erfcf(float);
- float erff(float);
-+float exp2f(float);
- float expf(float);
- float expm1f(float);
- float fabsf(float);
-@@ -56,6 +55,7 @@ float lgammaf(float);
- long long llroundf(float);
- float log10f(float);
- float log1pf(float);
-+float log2f(float);
- float logbf(float);
- float logf(float);
- long lroundf(float);
-diff --git a/test/math/compile_test.c b/test/math/compile_test.c
-index 9990520..ee5e2e3 100644
---- a/test/math/compile_test.c
-+++ b/test/math/compile_test.c
-@@ -18,7 +18,7 @@ r += cosf(float_x);
- r += coshf(float_x);
- r += erfcf(float_x);
- r += erff(float_x);
--/*r += exp2f(float_x); - uclibc does not have it (yet?) */
-+r += exp2f(float_x);
- r += expf(float_x);
- r += expm1f(float_x);
- r += fabsf(float_x);
-@@ -38,7 +38,7 @@ r += llrintf(float_x);
- r += llroundf(float_x);
- r += log10f(float_x);
- r += log1pf(float_x);
--/*r += log2f(float_x); - uclibc does not have it (yet?) */
-+r += log2f(float_x);
- r += logbf(float_x);
- r += logf(float_x);
- r += lrintf(float_x);
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/270-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch b/patches/uClibc/0.9.30.2/270-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch
deleted file mode 100644
index aa9c2f4..0000000
--- a/patches/uClibc/0.9.30.2/270-malloc-fix-race-condition-and-other-bugs-in-the-no-m.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From fa476d01f1c1990a92ee49d1f1c557b83805d0e9 Mon Sep 17 00:00:00 2001
-From: Freeman Wang <xwang@ubicom.com>
-Date: Sat, 19 Dec 2009 13:43:00 -0800
-Subject: [PATCH 09/15] malloc: fix race condition and other bugs in the no-mmu malloc
-
-Fixes multiple race conditions on mmb list. This was done by
-making the mmb_heap_lock into a recursive lock and making the
-regular heap_lock extend to cover the mmb heap handling.
-
-Also move the new_mmb allocation up to before the mmb list is
-iterated through to find the insertion point. When the mmb_heap
-also runs out and needs to be extended when the regular heap is
-just extended, the mmb list could be messed up.
-
-Signed-off-by: Freeman Wang <xwang@ubicom.com>
-Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
----
- libc/stdlib/malloc/free.c | 6 +++---
- libc/stdlib/malloc/malloc.c | 7 ++++---
- 2 files changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/libc/stdlib/malloc/free.c b/libc/stdlib/malloc/free.c
-index 90e18f4..741248a 100644
---- a/libc/stdlib/malloc/free.c
-+++ b/libc/stdlib/malloc/free.c
-@@ -179,14 +179,14 @@ __free_to_heap (void *mem, struct heap_free_area **heap
- /* Start searching again from the end of this block. */
- start = mmb_end;
-
-+ /* Release the descriptor block we used. */
-+ free_to_heap (mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock);
-+
- /* We have to unlock the heap before we recurse to free the mmb
- descriptor, because we might be unmapping from the mmb
- heap. */
- __heap_unlock (heap_lock);
-
-- /* Release the descriptor block we used. */
-- free_to_heap (mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock);
--
- /* Do the actual munmap. */
- munmap ((void *)mmb_start, mmb_end - mmb_start);
-
-diff --git a/libc/stdlib/malloc/malloc.c b/libc/stdlib/malloc/malloc.c
-index 71f9e58..84a6acd 100644
---- a/libc/stdlib/malloc/malloc.c
-+++ b/libc/stdlib/malloc/malloc.c
-@@ -48,7 +48,7 @@ struct malloc_mmb *__malloc_mmapped_blocks = 0;
- HEAP_DECLARE_STATIC_FREE_AREA (initial_mmb_fa, 48); /* enough for 3 mmbs */
- struct heap_free_area *__malloc_mmb_heap = HEAP_INIT_WITH_FA (initial_mmb_fa);
- #ifdef HEAP_USE_LOCKING
--pthread_mutex_t __malloc_mmb_heap_lock = PTHREAD_MUTEX_INITIALIZER;
-+pthread_mutex_t __malloc_mmb_heap_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
- #endif
- #endif /* __UCLIBC_UCLINUX_BROKEN_MUNMAP__ */
-
-@@ -151,19 +151,19 @@ __malloc_from_heap (size_t size, struct heap_free_area **heap
- /* Try again to allocate. */
- mem = __heap_alloc (heap, &size);
-
-- __heap_unlock (heap_lock);
-
- #if !defined(MALLOC_USE_SBRK) && defined(__UCLIBC_UCLINUX_BROKEN_MUNMAP__)
- /* Insert a record of BLOCK in sorted order into the
- __malloc_mmapped_blocks list. */
-
-+ new_mmb = malloc_from_heap (sizeof *new_mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock);
-+
- for (prev_mmb = 0, mmb = __malloc_mmapped_blocks;
- mmb;
- prev_mmb = mmb, mmb = mmb->next)
- if (block < mmb->mem)
- break;
-
-- new_mmb = malloc_from_heap (sizeof *new_mmb, &__malloc_mmb_heap, &__malloc_mmb_heap_lock);
- new_mmb->next = mmb;
- new_mmb->mem = block;
- new_mmb->size = block_size;
-@@ -177,6 +177,7 @@ __malloc_from_heap (size_t size, struct heap_free_area **heap
- (unsigned)new_mmb,
- (unsigned)new_mmb->mem, block_size);
- #endif /* !MALLOC_USE_SBRK && __UCLIBC_UCLINUX_BROKEN_MUNMAP__ */
-+ __heap_unlock (heap_lock);
- }
- }
-
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30.2/280-rpc-fix-typo-in-version-mismatch-msg.patch b/patches/uClibc/0.9.30.2/280-rpc-fix-typo-in-version-mismatch-msg.patch
deleted file mode 100644
index f2e1637..0000000
--- a/patches/uClibc/0.9.30.2/280-rpc-fix-typo-in-version-mismatch-msg.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 83a09cd5c9ed9afd87a7d1d17319c2fd2203ad0f Mon Sep 17 00:00:00 2001
-From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Thu, 21 Jan 2010 10:36:13 +0100
-Subject: [PATCH 04/15] rpc: fix typo in version mismatch msg
-
-Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
----
- libc/inet/rpc/rpc_prot.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libc/inet/rpc/rpc_prot.c b/libc/inet/rpc/rpc_prot.c
-index 74658e6..229f988 100644
---- a/libc/inet/rpc/rpc_prot.c
-+++ b/libc/inet/rpc/rpc_prot.c
-@@ -229,7 +229,7 @@ rejected (enum reject_stat rjct_stat,
- {
- switch (rjct_stat)
- {
-- case RPC_VERSMISMATCH:
-+ case RPC_MISMATCH:
- error->re_status = RPC_VERSMISMATCH;
- return;
- case AUTH_ERROR:
---
-1.6.6.1
-
diff --git a/patches/uClibc/0.9.30/100-fix-gethostent_r-failure-retval.patch b/patches/uClibc/0.9.30/100-fix-gethostent_r-failure-retval.patch
deleted file mode 100644
index 34e18d2..0000000
--- a/patches/uClibc/0.9.30/100-fix-gethostent_r-failure-retval.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/libc/inet/resolv.c uClibc-0.9.30/libc/inet/resolv.c
---- uClibc-0.9.30.orig/libc/inet/resolv.c 2008-11-02 01:25:33.000000000 +0100
-+++ uClibc-0.9.30/libc/inet/resolv.c 2009-02-07 09:57:59.000000000 +0100
-@@ -1788,7 +1788,7 @@
- int gethostent_r(struct hostent *result_buf, char *buf, size_t buflen,
- struct hostent **result, int *h_errnop)
- {
-- int ret;
-+ int ret = HOST_NOT_FOUND;
-
- __UCLIBC_MUTEX_LOCK(mylock);
- if (__gethostent_fp == NULL) {
diff --git a/patches/uClibc/0.9.30/110-arm_fix_alignment.patch b/patches/uClibc/0.9.30/110-arm_fix_alignment.patch
deleted file mode 100644
index 0d72e7f..0000000
--- a/patches/uClibc/0.9.30/110-arm_fix_alignment.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
-ARMV5 can use STRD and LDRD access instructions but these accesses need to be
-8 byte aligned. The dynamic linker's malloc needs to match this so structures
-become 8 byte aligned to void unaligned accesses.
-
-RP - 14/02/2008
-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/ldso/ldso/arm/dl-sysdep.h uClibc-0.9.30/ldso/ldso/arm/dl-sysdep.h
---- uClibc-0.9.30.orig/ldso/ldso/arm/dl-sysdep.h 2008-09-25 10:35:20.000000000 +0200
-+++ uClibc-0.9.30/ldso/ldso/arm/dl-sysdep.h 2009-02-07 09:57:59.000000000 +0100
-@@ -15,6 +15,8 @@
- GOT_BASE[1] = (unsigned long) MODULE; \
- }
-
-+#define DL_MALLOC_ALIGN 8 /* EABI needs 8 byte alignment for STRD LDRD*/
-+
- static __inline__ unsigned long arm_modulus(unsigned long m, unsigned long p)
- {
- unsigned long i,t,inc;
diff --git a/patches/uClibc/0.9.30/120-rm-whitespace.patch b/patches/uClibc/0.9.30/120-rm-whitespace.patch
deleted file mode 100644
index 59fe3be..0000000
--- a/patches/uClibc/0.9.30/120-rm-whitespace.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/include/assert.h uClibc-0.9.30/include/assert.h
---- uClibc-0.9.30.orig/include/assert.h 2008-07-23 13:23:36.000000000 +0200
-+++ uClibc-0.9.30/include/assert.h 2009-02-07 09:57:59.000000000 +0100
-@@ -31,7 +31,7 @@
- #define _ASSERT_H 1
- #include <features.h>
-
--#if defined __cplusplus && __GNUC_PREREQ (2,95)
-+#if defined __cplusplus && __GNUC_PREREQ(2,95)
- # define __ASSERT_VOID_CAST static_cast<void>
- #else
- # define __ASSERT_VOID_CAST (void)
-@@ -60,12 +60,15 @@
- (__assert (__STRING(expr), __FILE__, __LINE__, \
- __ASSERT_FUNCTION), 0)))
-
-+/* Define some temporaries to workaround tinyx makedepend bug */
-+#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
-+#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
- /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
- which contains the name of the function currently being defined.
- This is broken in G++ before version 2.6.
- C9x has a similar variable called __func__, but prefer the GCC one since
- it demangles C++ function names. */
--# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
-+# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
- # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
- # else
- # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-diff -durN uClibc-0.9.30.orig/include/complex.h uClibc-0.9.30/include/complex.h
---- uClibc-0.9.30.orig/include/complex.h 2008-10-03 16:24:28.000000000 +0200
-+++ uClibc-0.9.30/include/complex.h 2009-02-07 09:57:59.000000000 +0100
-@@ -33,7 +33,7 @@
- /* We might need to add support for more compilers here. But since ISO
- C99 is out hopefully all maintained compilers will soon provide the data
- types `float complex' and `double complex'. */
--#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
-+#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
- # define _Complex __complex__
- #endif
-
-diff -durN uClibc-0.9.30.orig/include/features.h uClibc-0.9.30/include/features.h
---- uClibc-0.9.30.orig/include/features.h 2008-09-06 18:45:07.000000000 +0200
-+++ uClibc-0.9.30/include/features.h 2009-02-07 09:57:59.000000000 +0100
-@@ -143,7 +143,7 @@
-
- /* Convenience macros to test the versions of glibc and gcc.
- Use them like this:
-- #if __GNUC_PREREQ (2,8)
-+ #if __GNUC_PREREQ(2,8)
- ... code requiring gcc 2.8 or later ...
- #endif
- Note - they won't work for gcc1 or glibc1, since the _MINOR macros
-@@ -297,7 +297,7 @@
- /* uClibc does not support _FORTIFY_SOURCE */
- #undef _FORTIFY_SOURCE
- #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
-- && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
-+ && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
- # if _FORTIFY_SOURCE > 1
- # define __USE_FORTIFY_LEVEL 2
- # else
-@@ -366,7 +366,7 @@
- #endif /* !ASSEMBLER */
-
- /* Decide whether we can define 'extern inline' functions in headers. */
--#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
-+#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
- && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
- && (defined __extern_inline || defined __GNUC_GNU_INLINE__)
- # define __USE_EXTERN_INLINES 1
-diff -durN uClibc-0.9.30.orig/include/tgmath.h uClibc-0.9.30/include/tgmath.h
---- uClibc-0.9.30.orig/include/tgmath.h 2008-10-03 16:24:28.000000000 +0200
-+++ uClibc-0.9.30/include/tgmath.h 2009-02-07 09:57:59.000000000 +0100
-@@ -34,7 +34,7 @@
- do not try this for now and instead concentrate only on GNU CC. Once
- we have more information support for other compilers might follow. */
-
--#if __GNUC_PREREQ (2, 7)
-+#if __GNUC_PREREQ(2, 7)
-
- # ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
- # define __tgml(fct) fct
diff --git a/patches/uClibc/0.9.30/130-arm-ftruncate64.patch b/patches/uClibc/0.9.30/130-arm-ftruncate64.patch
deleted file mode 100644
index 7bd8ef6..0000000
--- a/patches/uClibc/0.9.30/130-arm-ftruncate64.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h uClibc-0.9.30/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h
---- uClibc-0.9.30.orig/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h 2008-09-25 10:50:56.000000000 +0200
-+++ uClibc-0.9.30/libc/sysdeps/linux/arm/bits/uClibc_arch_features.h 2009-02-07 09:57:59.000000000 +0100
-@@ -39,4 +39,8 @@
- /* define if target supports IEEE signed zero floats */
- #define __UCLIBC_HAVE_SIGNED_ZERO__
-
-+#ifdef __ARM_EABI__
-+# define __UCLIBC_TRUNCATE64_HAS_4_ARGS__
-+#endif
-+
- #endif /* _BITS_UCLIBC_ARCH_FEATURES_H */
diff --git a/patches/uClibc/0.9.30/140-gnu89-inline.patch b/patches/uClibc/0.9.30/140-gnu89-inline.patch
deleted file mode 100644
index 02fe3e5..0000000
--- a/patches/uClibc/0.9.30/140-gnu89-inline.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Original patch from Gentoo.
-
--= BEGIN original header =-
--= END original header =-
-
-diff -durN uClibc-0.9.30.orig/Rules.mak uClibc-0.9.30/Rules.mak
---- uClibc-0.9.30.orig/Rules.mak 2008-11-12 13:24:16.000000000 +0100
-+++ uClibc-0.9.30/Rules.mak 2009-02-07 09:57:59.000000000 +0100
-@@ -502,6 +502,7 @@
- endif
-
- CFLAGS += $(call check_gcc,-std=gnu99,)
-+CFLAGS += $(call check_gcc,-fgnu89-inline,)
-
- LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -Wl,-shared \
- -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc
diff --git a/patches/uClibc/0.9.30/150-getaddrinfo-segfault-ipv6-and-ipv4.patch b/patches/uClibc/0.9.30/150-getaddrinfo-segfault-ipv6-and-ipv4.patch
deleted file mode 100644
index 40f2928..0000000
--- a/patches/uClibc/0.9.30/150-getaddrinfo-segfault-ipv6-and-ipv4.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From: Tomoyoshi ASANO <asa@lineo.co.jp>
-Message ID: <20081208073522.0AEF.22C34B8C@lineo.co.jp>
-
-Hello,
-
-I have SEGV at busybox's telnet with uClibc-0.9.30.
-It seem the current uClibc-trunk has the same problem.
-
-Thanks,
--- Tom
-
-diff -ru uClibc-0.9.30.orig/libc/inet/getaddrinfo.c uClibc-0.9.30/libc/inet/getaddrinfo.c
---- uClibc-0.9.30.orig/libc/inet/getaddrinfo.c 2008-10-28 17:25:10.000000000 +0100
-+++ uClibc-0.9.30/libc/inet/getaddrinfo.c 2009-02-26 14:20:06.000000000 +0100
-@@ -186,7 +186,7 @@
- return seen;
- }
-
-- for (runp = ifa; runp != NULL; runp = runp->ifa_next)
-+ for (runp = ifa; runp != NULL; runp = runp->ifa_next) {
- #if defined __UCLIBC_HAS_IPV4__
- if (runp->ifa_addr->sa_family == PF_INET)
- seen |= SEEN_IPV4;
-@@ -195,7 +195,7 @@
- if (runp->ifa_addr->sa_family == PF_INET6)
- seen |= SEEN_IPV6;
- #endif /* __UCLIBC_HAS_IPV6__ */
--
-+ }
- freeifaddrs(ifa);
- }
- #else
diff --git a/patches/uClibc/0.9.30/200-getline-already-declared.patch b/patches/uClibc/0.9.30/200-getline-already-declared.patch
deleted file mode 100644
index f57104b..0000000
--- a/patches/uClibc/0.9.30/200-getline-already-declared.patch
+++ /dev/null
@@ -1,29 +0,0 @@
---- uClibc-0.9.30.orig/extra/scripts/unifdef.c 2008-04-28 01:10:00.000000000 +0200
-+++ uClibc-0.9.30/extra/scripts/unifdef.c 2011-08-21 09:42:21.000000000 +0200
-@@ -206,7 +206,7 @@
- static void error(const char *);
- static int findsym(const char *);
- static void flushline(bool);
--static Linetype getline(void);
-+static Linetype getlinetype(void);
- static Linetype ifeval(const char **);
- static void ignoreoff(void);
- static void ignoreon(void);
-@@ -512,7 +512,7 @@
-
- for (;;) {
- linenum++;
-- lineval = getline();
-+ lineval = getlinetype();
- trans_table[ifstate[depth]][lineval]();
- debug("process %s -> %s depth %d",
- linetype_name[lineval],
-@@ -526,7 +526,7 @@
- * help from skipcomment().
- */
- static Linetype
--getline(void)
-+getlinetype(void)
- {
- const char *cp;
- int cursym;
diff --git a/patches/uClibc/0.9.30/210-find-portable.patch b/patches/uClibc/0.9.30/210-find-portable.patch
deleted file mode 100644
index 86c5ae3..0000000
--- a/patches/uClibc/0.9.30/210-find-portable.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- uClibc-0.9.30.orig/extra/scripts/install_headers.sh 2008-10-10 15:50:38.000000000 +0200
-+++ uClibc-0.9.30/extra/scripts/install_headers.sh 2011-08-21 09:49:03.000000000 +0200
-@@ -33,7 +33,7 @@
- (
- # We must cd, or else we'll prepend "$1" to filenames!
- cd "$1" || exit 1
--find ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
-+find . ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \
- -e '/^config$/d'
- ) | \
- (
diff --git a/patches/uClibc/0.9.32.1/100-fix-TLS-DTPREL-TPREL-macros.patch b/patches/uClibc/0.9.32.1/100-fix-TLS-DTPREL-TPREL-macros.patch
deleted file mode 100644
index 4491d26..0000000
--- a/patches/uClibc/0.9.32.1/100-fix-TLS-DTPREL-TPREL-macros.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-ldso/mips: workaround for missing TLS macros in elfinterpret.c
-
-These macros declarations are missing, so gcc believes the code is calling
-a function, so any later linking will fail.
-
-Work this around by copying the mcaros from:
- libpthread/nptl/sysdeps/mips/dl-tls.h
-
-We can't include the header because of incompatible symbol declarations,
-so we just copy the macros for now.
-
-----> THIS IS A DIRTY HACK! <----
-
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-
-diff -durN uClibc-0.9.32.orig/ldso/ldso/mips/elfinterp.c uClibc-0.9.32/ldso/ldso/mips/elfinterp.c
---- uClibc-0.9.32.orig/ldso/ldso/mips/elfinterp.c 2011-06-08 21:35:20.000000000 +0200
-+++ uClibc-0.9.32/ldso/ldso/mips/elfinterp.c 2011-09-12 14:02:37.553628824 +0200
-@@ -34,6 +34,21 @@
-
- #define OFFSET_GP_GOT 0x7ff0
-
-+/* The thread pointer points 0x7000 past the first static TLS block. */
-+#define TLS_TP_OFFSET 0x7000
-+
-+/* Dynamic thread vector pointers point 0x8000 past the start of each
-+ * TLS block. */
-+#define TLS_DTV_OFFSET 0x8000
-+
-+/* Compute the value for a GOTTPREL reloc. */
-+#define TLS_TPREL_VALUE(sym_map, sym_val) \
-+ ((sym_map)->l_tls_offset + sym_val - TLS_TP_OFFSET)
-+
-+/* Compute the value for a DTPREL reloc. */
-+#define TLS_DTPREL_VALUE(sym_val) \
-+ (sym_val - TLS_DTV_OFFSET)
-+
- unsigned long __dl_runtime_resolve(unsigned long sym_index,
- unsigned long old_gpreg)
- {
diff --git a/patches/uClibc/0.9.32/100-bump-version-to-0.9.32.1-git.patch b/patches/uClibc/0.9.32/100-bump-version-to-0.9.32.1-git.patch
deleted file mode 100644
index 46b3031..0000000
--- a/patches/uClibc/0.9.32/100-bump-version-to-0.9.32.1-git.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-commit 608e138586993d3c59c65c2958d9a98cf0d4d1eb
-Author: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-Date: Wed Jun 8 21:47:42 2011 +0200
-
- bump version to 0.9.32.1-git
-
- Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-
-diff --git a/Rules.mak b/Rules.mak
-index fe06c24..a00deea 100644
---- a/Rules.mak
-+++ b/Rules.mak
-@@ -106,7 +106,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR
- MAJOR_VERSION := 0
- MINOR_VERSION := 9
- SUBLEVEL := 32
--EXTRAVERSION :=
-+EXTRAVERSION :=.1-git
- VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
- ABI_VERSION := $(MAJOR_VERSION)
- ifneq ($(EXTRAVERSION),)
diff --git a/patches/uClibc/0.9.32/110-nptl-Makefile.in-Fix-the-build-break-caused-by-UCLIBC_CTOR_DTOR-enabling.patch b/patches/uClibc/0.9.32/110-nptl-Makefile.in-Fix-the-build-break-caused-by-UCLIBC_CTOR_DTOR-enabling.patch
deleted file mode 100644
index f8e8411..0000000
--- a/patches/uClibc/0.9.32/110-nptl-Makefile.in-Fix-the-build-break-caused-by-UCLIBC_CTOR_DTOR-enabling.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-commit fc643f77a3abc8743620445f47b1bade9862d45a
-Author: Khem Raj <raj.khem@gmail.com>
-Date: Fri Jun 10 13:05:34 2011 -0700
-
- nptl/Makefile.in: Fix the build break caused by UCLIBC_CTOR_DTOR enabling
-
- Extra / somehow does not match the target and complains that
- $(top_builddir)libpthread/nptl/sysdeps/pthread/crti.o has no rules to
- build
-
- Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-
-diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
-index 70616a1..92d72a6 100644
---- a/libpthread/nptl/Makefile.in
-+++ b/libpthread/nptl/Makefile.in
-@@ -64,8 +64,8 @@ endif
- librt-so-y += $(librt_OBJS:.o=.oS) $(librt-pt-shared-only-routines-y:.o=.oS)
-
- ifeq ($(UCLIBC_CTOR_DTOR),y)
--START_FILE-libpthread.so := $(top_builddir)/libpthread/nptl/sysdeps/pthread/crti.o
--END_FILE-libpthread.so := $(top_builddir)/libpthread/nptl/sysdeps/pthread/crtn.o
-+START_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/crti.o
-+END_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/crtn.o
- LDFLAGS-libpthread.so += -nostartfiles
- $(top_builddir)lib/libpthread.so: | $(START_FILE-libpthread.so) $(END_FILE-libpthread.so)
- endif
diff --git a/patches/uClibc/0.9.32/120-ctor-dtor-nptl-Fix-init-and-fini-function-compilation.patch b/patches/uClibc/0.9.32/120-ctor-dtor-nptl-Fix-init-and-fini-function-compilation.patch
deleted file mode 100644
index 146610b..0000000
--- a/patches/uClibc/0.9.32/120-ctor-dtor-nptl-Fix-init-and-fini-function-compilation.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-commit f9e311d11c374e68736c741ede1845bdc8091627
-Author: Khem Raj <raj.khem@gmail.com>
-Date: Mon Jun 13 16:30:55 2011 -0700
-
- ctor/dtor nptl: Fix init and fini function compilation
-
- We need to define the rules for .S files so it
- gets the include paths some architectures like mips
- include headers
-
- Some architectures e.g. SH have their own version
- of pt-initfini.c so look for that first before resorting
- to generic version of pt-initfini.c
-
- Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-
-diff --git a/libc/sysdeps/linux/mips/crtn.S b/libc/sysdeps/linux/mips/crtn.S
-index cedd593..f3756a2 100644
---- a/libc/sysdeps/linux/mips/crtn.S
-+++ b/libc/sysdeps/linux/mips/crtn.S
-@@ -10,7 +10,6 @@
- #NO_APP
- .align 2
- .globl _init
-- .ent _init
- .type _init, @function
- #NO_APP
- lw $31,28($sp)
-@@ -22,14 +21,12 @@
- .set macro
- .set reorder
-
-- .end _init
- #APP
-
- .section .fini
- #NO_APP
- .align 2
- .globl _fini
-- .ent _fini
- .type _fini, @function
- #NO_APP
- lw $31,28($sp)
-@@ -41,7 +38,6 @@
- .set macro
- .set reorder
-
-- .end _fini
- #APP
-
- .ident "GCC: (GNU) 3.3.2"
-@@ -54,10 +50,8 @@
-
- .section .init
- #NO_APP
-- .align 2
- .align 3
- .globl _init
-- .ent _init
- .type _init, @function
- #NO_APP
- ld $31,8($sp)
-@@ -68,16 +62,12 @@
- addiu $sp,$sp,16
- .set macro
- .set reorder
--
-- .end _init
- #APP
-
- .section .fini
- #NO_APP
-- .align 2
- .align 3
- .globl _fini
-- .ent _fini
- .type _fini, @function
- #NO_APP
- ld $31,8($sp)
-@@ -89,7 +79,6 @@
- .set macro
- .set reorder
-
-- .end _fini
- #APP
-
- .ident "GCC: (GNU) 3.4.3"
-@@ -105,7 +94,6 @@
- #NO_APP
- .align 2
- .globl _init
-- .ent _init
- .type _init, @function
- #NO_APP
- ld $31,24($sp)
-@@ -118,14 +106,12 @@
- .set macro
- .set reorder
-
-- .end _init
- #APP
-
- .section .fini
- #NO_APP
- .align 2
- .globl _fini
-- .ent _fini
- .type _fini, @function
- #NO_APP
- ld $31,24($sp)
-@@ -138,7 +124,6 @@
- .set macro
- .set reorder
-
-- .end _fini
- #APP
-
- .ident "GCC: (GNU) 3.3.2"
-diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
-index 92d72a6..849bd59 100644
---- a/libpthread/nptl/Makefile.in
-+++ b/libpthread/nptl/Makefile.in
-@@ -64,8 +64,8 @@ endif
- librt-so-y += $(librt_OBJS:.o=.oS) $(librt-pt-shared-only-routines-y:.o=.oS)
-
- ifeq ($(UCLIBC_CTOR_DTOR),y)
--START_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/crti.o
--END_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/crtn.o
-+START_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crti.o
-+END_FILE-libpthread.so := $(top_builddir)libpthread/nptl/sysdeps/pthread/pt-crtn.o
- LDFLAGS-libpthread.so += -nostartfiles
- $(top_builddir)lib/libpthread.so: | $(START_FILE-libpthread.so) $(END_FILE-libpthread.so)
- endif
-diff --git a/libpthread/nptl/sysdeps/pthread/Makefile.in b/libpthread/nptl/sysdeps/pthread/Makefile.in
-index d93b3a5..398eaea 100644
---- a/libpthread/nptl/sysdeps/pthread/Makefile.in
-+++ b/libpthread/nptl/sysdeps/pthread/Makefile.in
-@@ -73,23 +73,37 @@ CFLAGS-pt-initfini.c = -S -g0 $(PICFLAG) -fno-inline-functions \
- -finhibit-size-directive \
- -fno-asynchronous-unwind-tables -fno-unwind-tables \
- $(patsubst -f%,-fno-%,$(call check_gcc,-fexceptions,))
--ASFLAGS-crti.S = -g0
--ASFLAGS-crtn.S = -g0
-
--$(libpthread_pthread_OUT)/pt-initfini.s: $(libpthread_pthread_DIR)/pt-initfini.c
-+#ASFLAGS += $(PICFLAG) -I$(top_srcdir)include -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
-+ifneq ($(wildcard $(libpthread_DIR)/sysdeps/linux/$(TARGET_ARCH)/pt-initfini.c),)
-+PTHREAD_INITFINI := $(libpthread_DIR)/sysdeps/linux/$(TARGET_ARCH)/pt-initfini.c
-+else
-+PTHREAD_INITFINI := $(libpthread_pthread_DIR)/pt-initfini.c
-+endif
-+
-+ASFLAGS-pt-crti.S = $(PICFLAG)
-+ASFLAGS-pt-crtn.S = $(PICFLAG)
-+
-+$(libpthread_pthread_OUT)/pt-crti.o: $(libpthread_pthread_OUT)/pt-crti.S
-+ $(compile.S)
-+
-+$(libpthread_pthread_OUT)/pt-crtn.o: $(libpthread_pthread_OUT)/pt-crtn.S
-+ $(compile.S)
-+
-+$(libpthread_pthread_OUT)/pt-initfini.s: $(PTHREAD_INITFINI)
- $(compile.c)
--$(libpthread_pthread_OUT)/defs.h: $(libpthread_pthread_DIR)/pt-initfini.c
-+$(libpthread_pthread_OUT)/defs.h: $(PTHREAD_INITFINI)
- $(do_sed) -n -e '/@TESTS_BEGIN/,/@TESTS_END/p' $< | \
- $(AWK) -f $(top_srcdir)extra/scripts/defs.awk > $@.tmp
- $(Q)mv $@.tmp $@
-
--$(libpthread_pthread_OUT)/crti.S: $(libpthread_pthread_OUT)/pt-initfini.s $(libpthread_pthread_OUT)/defs.h
-+$(libpthread_pthread_OUT)/pt-crti.S: $(libpthread_pthread_OUT)/pt-initfini.s $(libpthread_pthread_OUT)/defs.h
- $(do_sed) -n -e '/[ ]*\.file/d' \
- -e '1,/@HEADER_ENDS/p' \
- -e '/@_.*_PROLOG_BEGINS/,/@_.*_PROLOG_ENDS/p' \
- -e '/@TRAILER_BEGINS/,$$p' $< > $@.tmp
- $(Q)mv $@.tmp $@
--$(libpthread_pthread_OUT)/crtn.S: $(libpthread_pthread_OUT)/pt-initfini.s $(libpthread_pthread_OUT)/defs.h
-+$(libpthread_pthread_OUT)/pt-crtn.S: $(libpthread_pthread_OUT)/pt-initfini.s $(libpthread_pthread_OUT)/defs.h
- $(do_sed) -n -e '/[ ]*\.file/d' \
- -e '1,/@HEADER_ENDS/p' \
- -e '/@_.*_EPILOG_BEGINS/,/@_.*_EPILOG_ENDS/p' \
diff --git a/patches/uClibc/0.9.32/130-nptl-pthread-Correct-path-for-machine-specific-pt-initfini.c.patch b/patches/uClibc/0.9.32/130-nptl-pthread-Correct-path-for-machine-specific-pt-initfini.c.patch
deleted file mode 100644
index adb35c9..0000000
--- a/patches/uClibc/0.9.32/130-nptl-pthread-Correct-path-for-machine-specific-pt-initfini.c.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit ebe6c38d7e60e8a43d8b926c17a561a5a3e06a22
-Author: Khem Raj <raj.khem@gmail.com>
-Date: Mon Jun 13 17:13:52 2011 -0700
-
- nptl/pthread: Correct path for machine specific pt-initfini.c
-
- Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-
-diff --git a/libpthread/nptl/sysdeps/pthread/Makefile.in b/libpthread/nptl/sysdeps/pthread/Makefile.in
-index 398eaea..ca84642 100644
---- a/libpthread/nptl/sysdeps/pthread/Makefile.in
-+++ b/libpthread/nptl/sysdeps/pthread/Makefile.in
-@@ -75,8 +75,8 @@ CFLAGS-pt-initfini.c = -S -g0 $(PICFLAG) -fno-inline-functions \
- $(patsubst -f%,-fno-%,$(call check_gcc,-fexceptions,))
-
- #ASFLAGS += $(PICFLAG) -I$(top_srcdir)include -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
--ifneq ($(wildcard $(libpthread_DIR)/sysdeps/linux/$(TARGET_ARCH)/pt-initfini.c),)
--PTHREAD_INITFINI := $(libpthread_DIR)/sysdeps/linux/$(TARGET_ARCH)/pt-initfini.c
-+ifneq ($(wildcard $(libpthread_pthread_DIR)/../unix/sysv/linux/$(TARGET_ARCH)/pt-initfini.c),)
-+PTHREAD_INITFINI := $(libpthread_pthread_DIR)/../unix/sysv/linux/$(TARGET_ARCH)/pt-initfini.c
- else
- PTHREAD_INITFINI := $(libpthread_pthread_DIR)/pt-initfini.c
- endif
diff --git a/patches/uClibc/0.9.32/140-ARM-reorder-Use-BX-option.patch b/patches/uClibc/0.9.32/140-ARM-reorder-Use-BX-option.patch
deleted file mode 100644
index 5321a48..0000000
--- a/patches/uClibc/0.9.32/140-ARM-reorder-Use-BX-option.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-commit d64b91a6d4fa1a3ac1d01fa7593d67c5e5ed5101
-Author: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
-Date: Sun Jan 9 01:45:04 2011 +0100
-
- ARM: reorder "Use BX" option
-
- "Use BX" is not available on all CPUs, so the option depends on
- a correct CPU to be chosen . It is weird that e BX" then appears
- _above_ the CPU selection, not below.
-
- Move the "Use BX" after the CPU selection.
-
- Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
- Cc: Khem Raj <raj.khem@gmail.com>
- Cc: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
- Cc: Carmelo AMOROSO <carmelo.amoroso@st.com>
- Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-
-diff --git a/extra/Configs/Config.arm b/extra/Configs/Config.arm
-index eb27a33..dd63b80 100644
---- a/extra/Configs/Config.arm
-+++ b/extra/Configs/Config.arm
-@@ -30,13 +30,6 @@ config CONFIG_ARM_EABI
-
- endchoice
-
--config USE_BX
-- bool "Use BX in function return"
-- default y
-- depends on !CONFIG_GENERIC_ARM && !CONFIG_ARM610 && !CONFIG_ARM710
-- help
-- Use BX instruction for THUMB aware architectures.
--
- choice
- prompt "Target Processor Type"
- default CONFIG_GENERIC_ARM
-@@ -131,3 +124,10 @@ config CONFIG_ARM_IWMMXT
- select ARCH_HAS_MMU
-
- endchoice
-+
-+config USE_BX
-+ bool "Use BX in function return"
-+ default y
-+ depends on !CONFIG_GENERIC_ARM && !CONFIG_ARM610 && !CONFIG_ARM710
-+ help
-+ Use BX instruction for THUMB aware architectures.
diff --git a/patches/uClibc/0.9.32/150-Rules.mak-Rearrange-appending-UCLIBC_EXTRA_CFLAGS-to-CFLAGS.patch b/patches/uClibc/0.9.32/150-Rules.mak-Rearrange-appending-UCLIBC_EXTRA_CFLAGS-to-CFLAGS.patch
deleted file mode 100644
index 01e4806..0000000
--- a/patches/uClibc/0.9.32/150-Rules.mak-Rearrange-appending-UCLIBC_EXTRA_CFLAGS-to-CFLAGS.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit 4642f4eead07080bf46b6d67b873d303eda9fb48
-Author: Khem Raj <raj.khem@gmail.com>
-Date: Sat Jun 11 00:15:02 2011 -0700
-
- Rules.mak: Rearrange appending UCLIBC_EXTRA_CFLAGS to CFLAGS
-
- UCLIBC_EXTRA_CFLAGS is currently added before the OPTIMIZATION flags
- and OPTIMIZATION is chosen to be Os by default. But in OE we pass the optimisation
- flags through UCLIBC_EXTRA_CFLAGS but they are not effective since -Os is
- specified at last. So we need to change the order of these option flags
-
- Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-
-diff --git a/Rules.mak b/Rules.mak
-index a00deea..6b8f5b2 100644
---- a/Rules.mak
-+++ b/Rules.mak
-@@ -585,9 +585,6 @@ CFLAGS := -include $(top_srcdir)include/libc-symbols.h \
- -nostdinc -I$(top_builddir)include -I$(top_srcdir)include -I. \
- -I$(top_srcdir)libc/sysdeps/linux \
- -I$(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)
--ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
--CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
--endif
-
- # We need this to be checked within libc-symbols.h
- ifneq ($(HAVE_SHARED),y)
-@@ -633,6 +630,9 @@ LDFLAGS += -Wl,-s
- else
- STRIPTOOL := true -Stripping_disabled
- endif
-+ifneq ($(strip $(UCLIBC_EXTRA_CFLAGS)),"")
-+CFLAGS += $(call qstrip,$(UCLIBC_EXTRA_CFLAGS))
-+endif
-
- ifeq ($(DOMULTI),y)
- # we try to compile all sources at once into an object (IMA), but
diff --git a/patches/uClibc/0.9.32/160-fix-TLS-DTPREL-TPREL-macros.patch b/patches/uClibc/0.9.32/160-fix-TLS-DTPREL-TPREL-macros.patch
deleted file mode 100644
index 4491d26..0000000
--- a/patches/uClibc/0.9.32/160-fix-TLS-DTPREL-TPREL-macros.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-ldso/mips: workaround for missing TLS macros in elfinterpret.c
-
-These macros declarations are missing, so gcc believes the code is calling
-a function, so any later linking will fail.
-
-Work this around by copying the mcaros from:
- libpthread/nptl/sysdeps/mips/dl-tls.h
-
-We can't include the header because of incompatible symbol declarations,
-so we just copy the macros for now.
-
-----> THIS IS A DIRTY HACK! <----
-
-Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
-
-diff -durN uClibc-0.9.32.orig/ldso/ldso/mips/elfinterp.c uClibc-0.9.32/ldso/ldso/mips/elfinterp.c
---- uClibc-0.9.32.orig/ldso/ldso/mips/elfinterp.c 2011-06-08 21:35:20.000000000 +0200
-+++ uClibc-0.9.32/ldso/ldso/mips/elfinterp.c 2011-09-12 14:02:37.553628824 +0200
-@@ -34,6 +34,21 @@
-
- #define OFFSET_GP_GOT 0x7ff0
-
-+/* The thread pointer points 0x7000 past the first static TLS block. */
-+#define TLS_TP_OFFSET 0x7000
-+
-+/* Dynamic thread vector pointers point 0x8000 past the start of each
-+ * TLS block. */
-+#define TLS_DTV_OFFSET 0x8000
-+
-+/* Compute the value for a GOTTPREL reloc. */
-+#define TLS_TPREL_VALUE(sym_map, sym_val) \
-+ ((sym_map)->l_tls_offset + sym_val - TLS_TP_OFFSET)
-+
-+/* Compute the value for a DTPREL reloc. */
-+#define TLS_DTPREL_VALUE(sym_val) \
-+ (sym_val - TLS_DTV_OFFSET)
-+
- unsigned long __dl_runtime_resolve(unsigned long sym_index,
- unsigned long old_gpreg)
- {
diff --git a/patches/uClibc/0.9.32/170-Conditionalize-use-libgcc_eh-when-libubacktrace-is-n.patch b/patches/uClibc/0.9.32/170-Conditionalize-use-libgcc_eh-when-libubacktrace-is-n.patch
deleted file mode 100644
index 209e7f1..0000000
--- a/patches/uClibc/0.9.32/170-Conditionalize-use-libgcc_eh-when-libubacktrace-is-n.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From the uClibc ML archives:
- http://lists.uclibc.org/pipermail/uclibc/2011-June/045411.html
-
->From 364a3a9c576d604bed146efe0b8b33d2b81d4c64 Mon Sep 17 00:00:00 2001
-From: Jason Woodward <jason.woodward@timesys.com>
-Date: Sat, 11 Jun 2011 01:08:48 -0400
-Subject: [PATCH 1/3] Conditionalize use libgcc_eh when libubacktrace is not enabled
-
-Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
----
- libubacktrace/Makefile.in | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libubacktrace/Makefile.in b/libubacktrace/Makefile.in
-index f75f68b..880a8af 100644
---- a/libubacktrace/Makefile.in
-+++ b/libubacktrace/Makefile.in
-@@ -12,7 +12,7 @@ CFLAGS-libubacktrace := -DNOT_IN_libc -DIS_IN_libubacktrace $(SSP_ALL_CFLAGS)
-
- LDFLAGS-libubacktrace.so := $(LDFLAGS) $(top_builddir)lib/libdl-$(VERSION).so
-
--ifeq ($(CONFIG_ARM_EABI),y)
-+ifeq ($(UCLIBC_HAS_BACKTRACE)$(CONFIG_ARM_EABI),yy)
- LIBGCC += $(shell $(CC) -print-file-name=libgcc_eh.a)
- endif
-
---
-1.7.0.4
-
diff --git a/samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config b/samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config
index a64912c..ee18e5e 100644
--- a/samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config
+++ b/samples/arm-cortexa5-linux-uclibcgnueabihf/crosstool.config
@@ -11,13 +11,11 @@ CT_ARCH_arm=y
CT_ARCH_ARM_TUPLE_USE_EABIHF=y
CT_TARGET_VENDOR="cortexa5"
CT_KERNEL_linux=y
-CT_BINUTILS_V_2_22=y
CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
CT_LIBC_UCLIBC_WCHAR=y
CT_CC_LANG_CXX=y
CT_DEBUG_dmalloc=y
diff --git a/samples/arm-cortexa5-linux-uclibcgnueabihf/uClibc-0.9.33.2.config b/samples/arm-cortexa5-linux-uclibcgnueabihf/uClibc-0.9.33.2.config
deleted file mode 100644
index 1f281e1..0000000
--- a/samples/arm-cortexa5-linux-uclibcgnueabihf/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,251 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Wed Sep 3 17:02:28 2014
-#
-# TARGET_alpha is not set
-TARGET_arm=y
-
-# TARGET_c6x is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="arm"
-FORCE_OPTIONS_FOR_ARCH=y
-CONFIG_ARM_EABI=y
-# COMPILE_IN_THUMB_MODE is not set
-USE_BX=y
-TARGET_SUBARCH=""
-
-#
-# Using ELF file format
-#
-ARCH_ANY_ENDIAN=y
-ARCH_LITTLE_ENDIAN=y
-# ARCH_WANTS_BIG_ENDIAN is not set
-ARCH_WANTS_LITTLE_ENDIAN=y
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-UCLIBC_HAS_FPU=y
-DO_C99_MATH=y
-# DO_XSI_MATH is not set
-# UCLIBC_HAS_FENV is not set
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-DOPIC=y
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-# LDSO_CACHE_SUPPORT is not set
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-# LDSO_STANDALONE_SUPPORT is not set
-# LDSO_PRELINK_SUPPORT is not set
-# UCLIBC_STATIC_LDCONFIG is not set
-LDSO_RUNPATH=y
-LDSO_SEARCH_INTERP_PATH=y
-LDSO_LD_LIBRARY_PATH=y
-# LDSO_NO_CLEANUP is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
-# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-MALLOC_GLIBC_COMPAT=y
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-UCLIBC_SUSV3_LEGACY=y
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-UCLIBC_SUSV4_LEGACY=y
-# UCLIBC_STRICT_HEADERS is not set
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
-UCLIBC_HAS___PROGNAME=y
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-UCLIBC_HAS_GETPT=y
-UCLIBC_HAS_LIBUTIL=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_26=y
-# UCLIBC_LINUX_MODULE_24 is not set
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-UCLIBC_BSD_SPECIFIC=y
-UCLIBC_HAS_BSD_ERR=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
-# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-# UCLIBC_HAS_IPV6 is not set
-# UCLIBC_HAS_RPC is not set
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-UCLIBC_HAS_RESOLVER_SUPPORT=y
-UCLIBC_HAS_LIBRESOLV_STUB=y
-UCLIBC_HAS_LIBNSL_STUB=y
-
-#
-# String and Stdio Support
-#
-# UCLIBC_HAS_STRING_GENERIC_OPT is not set
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-UCLIBC_HAS_CTYPE_CHECKED=y
-# UCLIBC_HAS_CTYPE_ENFORCED is not set
-UCLIBC_HAS_WCHAR=y
-# UCLIBC_HAS_LOCALE is not set
-UCLIBC_HAS_HEXADECIMAL_FLOATS=y
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-# UCLIBC_HAS_STDIO_GETC_MACRO is not set
-# UCLIBC_HAS_STDIO_PUTC_MACRO is not set
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
-# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
-UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-# UCLIBC_HAS_GNU_GETSUBOPT is not set
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-# UCLIBC_HAS_REGEX_OLD is not set
-UCLIBC_HAS_FNMATCH=y
-# UCLIBC_HAS_FNMATCH_OLD is not set
-# UCLIBC_HAS_WORDEXP is not set
-UCLIBC_HAS_NFTW=y
-UCLIBC_HAS_FTW=y
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-UCLIBC_HAS_UTMPX=y
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-MULTILIB_DIR="lib"
-HARDWIRED_ABSPATH=y
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-UCLIBC_HAS_SSP=y
-# UCLIBC_HAS_SSP_COMPAT is not set
-# SSP_QUICK_CANARY is not set
-PROPOLICE_BLOCK_ABRT=y
-# PROPOLICE_BLOCK_SEGV is not set
-# UCLIBC_BUILD_SSP is not set
-UCLIBC_BUILD_RELRO=y
-UCLIBC_BUILD_NOW=y
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# Development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-# UCLIBC_HAS_BACKTRACE is not set
-WARNINGS="-Wall"
-# EXTRA_WARNINGS is not set
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config b/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config
index 06b279f..4372df6 100644
--- a/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config
+++ b/samples/arm-unknown-linux-uclibcgnueabi/crosstool.config
@@ -12,7 +12,6 @@ CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
CT_CC_LANG_CXX=y
CT_DEBUG_dmalloc=y
CT_DEBUG_duma=y
diff --git a/samples/arm-unknown-linux-uclibcgnueabi/uClibc-0.9.33.2.config b/samples/arm-unknown-linux-uclibcgnueabi/uClibc-0.9.33.2.config
deleted file mode 100644
index 9f2ed53..0000000
--- a/samples/arm-unknown-linux-uclibcgnueabi/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,253 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Wed Sep 3 12:55:06 2014
-#
-# TARGET_alpha is not set
-TARGET_arm=y
-
-# TARGET_c6x is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="arm"
-FORCE_OPTIONS_FOR_ARCH=y
-CONFIG_ARM_EABI=y
-# COMPILE_IN_THUMB_MODE is not set
-USE_BX=y
-TARGET_SUBARCH=""
-
-#
-# Using ELF file format
-#
-ARCH_ANY_ENDIAN=y
-ARCH_LITTLE_ENDIAN=y
-# ARCH_WANTS_BIG_ENDIAN is not set
-ARCH_WANTS_LITTLE_ENDIAN=y
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-# UCLIBC_HAS_FPU is not set
-UCLIBC_HAS_SOFT_FLOAT=y
-DO_C99_MATH=y
-# DO_XSI_MATH is not set
-# UCLIBC_HAS_FENV is not set
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-DOPIC=y
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-# LDSO_CACHE_SUPPORT is not set
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-# LDSO_STANDALONE_SUPPORT is not set
-# LDSO_PRELINK_SUPPORT is not set
-# UCLIBC_STATIC_LDCONFIG is not set
-LDSO_RUNPATH=y
-LDSO_SEARCH_INTERP_PATH=y
-LDSO_LD_LIBRARY_PATH=y
-# LDSO_NO_CLEANUP is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
-# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-MALLOC_GLIBC_COMPAT=y
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-UCLIBC_SUSV3_LEGACY=y
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-UCLIBC_SUSV4_LEGACY=y
-# UCLIBC_STRICT_HEADERS is not set
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
-UCLIBC_HAS___PROGNAME=y
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-UCLIBC_HAS_GETPT=y
-UCLIBC_HAS_LIBUTIL=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_26=y
-# UCLIBC_LINUX_MODULE_24 is not set
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-UCLIBC_BSD_SPECIFIC=y
-UCLIBC_HAS_BSD_ERR=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
-# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-# UCLIBC_HAS_IPV6 is not set
-# UCLIBC_HAS_RPC is not set
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-UCLIBC_HAS_RESOLVER_SUPPORT=y
-UCLIBC_HAS_LIBRESOLV_STUB=y
-UCLIBC_HAS_LIBNSL_STUB=y
-
-#
-# String and Stdio Support
-#
-# UCLIBC_HAS_STRING_GENERIC_OPT is not set
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-UCLIBC_HAS_CTYPE_CHECKED=y
-# UCLIBC_HAS_CTYPE_ENFORCED is not set
-# UCLIBC_HAS_WCHAR is not set
-# UCLIBC_HAS_LOCALE is not set
-UCLIBC_HAS_HEXADECIMAL_FLOATS=y
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-# USE_OLD_VFPRINTF is not set
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-# UCLIBC_HAS_STDIO_GETC_MACRO is not set
-# UCLIBC_HAS_STDIO_PUTC_MACRO is not set
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
-# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
-UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-# UCLIBC_HAS_GNU_GETSUBOPT is not set
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-# UCLIBC_HAS_REGEX_OLD is not set
-UCLIBC_HAS_FNMATCH=y
-# UCLIBC_HAS_FNMATCH_OLD is not set
-# UCLIBC_HAS_WORDEXP is not set
-UCLIBC_HAS_NFTW=y
-UCLIBC_HAS_FTW=y
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-UCLIBC_HAS_UTMPX=y
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-MULTILIB_DIR="lib"
-HARDWIRED_ABSPATH=y
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-UCLIBC_HAS_SSP=y
-# UCLIBC_HAS_SSP_COMPAT is not set
-# SSP_QUICK_CANARY is not set
-PROPOLICE_BLOCK_ABRT=y
-# PROPOLICE_BLOCK_SEGV is not set
-# UCLIBC_BUILD_SSP is not set
-UCLIBC_BUILD_RELRO=y
-UCLIBC_BUILD_NOW=y
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# Development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-# UCLIBC_HAS_BACKTRACE is not set
-WARNINGS="-Wall -pipe"
-# EXTRA_WARNINGS is not set
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config b/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config
index f3162f8..834c1a0 100644
--- a/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config
+++ b/samples/arm-unknown-linux-uclibcgnueabihf/crosstool.config
@@ -9,13 +9,11 @@ CT_ARCH_FLOAT_HW=y
CT_ARCH_arm=y
CT_ARCH_ARM_TUPLE_USE_EABIHF=y
CT_KERNEL_linux=y
-CT_BINUTILS_V_2_22=y
CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
CT_CC_LANG_CXX=y
CT_DEBUG_dmalloc=y
CT_DEBUG_duma=y
diff --git a/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config b/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config
index 6fbf451..d8d6f54 100644
--- a/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config
+++ b/samples/armeb-unknown-linux-uclibcgnueabi/crosstool.config
@@ -13,8 +13,6 @@ CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
-CT_LIBC_UCLIBC_LOCALES=y
CT_CC_LANG_CXX=y
# CT_CC_GCC_SJLJ_EXCEPTIONS is not set
CT_DEBUG_dmalloc=y
diff --git a/samples/armeb-unknown-linux-uclibcgnueabi/uClibc-0.9.33.2.config b/samples/armeb-unknown-linux-uclibcgnueabi/uClibc-0.9.33.2.config
deleted file mode 100644
index e304c34..0000000
--- a/samples/armeb-unknown-linux-uclibcgnueabi/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,255 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Tue Sep 2 17:35:34 2014
-#
-# TARGET_alpha is not set
-TARGET_arm=y
-
-# TARGET_c6x is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="arm"
-FORCE_OPTIONS_FOR_ARCH=y
-CONFIG_ARM_EABI=y
-# COMPILE_IN_THUMB_MODE is not set
-# USE_BX is not set
-TARGET_SUBARCH=""
-
-#
-# Using ELF file format
-#
-ARCH_ANY_ENDIAN=y
-ARCH_BIG_ENDIAN=y
-ARCH_WANTS_BIG_ENDIAN=y
-# ARCH_WANTS_LITTLE_ENDIAN is not set
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-# UCLIBC_HAS_FPU is not set
-UCLIBC_HAS_SOFT_FLOAT=y
-DO_C99_MATH=y
-DO_XSI_MATH=y
-UCLIBC_HAS_FENV=y
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-DOPIC=y
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-# LDSO_STANDALONE_SUPPORT is not set
-# LDSO_PRELINK_SUPPORT is not set
-UCLIBC_STATIC_LDCONFIG=y
-# LDSO_RUNPATH is not set
-# LDSO_SEARCH_INTERP_PATH is not set
-LDSO_LD_LIBRARY_PATH=y
-# LDSO_NO_CLEANUP is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
-# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-# PTHREADS_DEBUG_SUPPORT is not set
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-# MALLOC_GLIBC_COMPAT is not set
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-UCLIBC_SUSV3_LEGACY=y
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-UCLIBC_SUSV4_LEGACY=y
-# UCLIBC_STRICT_HEADERS is not set
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-# UCLIBC_HAS_GETPT is not set
-UCLIBC_HAS_LIBUTIL=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_26=y
-UCLIBC_LINUX_MODULE_24=y
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-# UCLIBC_BSD_SPECIFIC is not set
-# UCLIBC_HAS_BSD_ERR is not set
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
-# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-# UCLIBC_HAS_RESOLVER_SUPPORT is not set
-# UCLIBC_HAS_LIBRESOLV_STUB is not set
-# UCLIBC_HAS_LIBNSL_STUB is not set
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-# UCLIBC_HAS_CTYPE_CHECKED is not set
-UCLIBC_HAS_CTYPE_ENFORCED=y
-UCLIBC_HAS_WCHAR=y
-UCLIBC_HAS_LOCALE=y
-# UCLIBC_BUILD_ALL_LOCALE is not set
-# UCLIBC_BUILD_MINIMAL_LOCALE is not set
-UCLIBC_PREGENERATED_LOCALE_DATA=y
-# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set
-# UCLIBC_HAS_XLOCALE is not set
-# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
-# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
-# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
-# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-UCLIBC_HAS_GNU_GETSUBOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-# UCLIBC_HAS_REGEX_OLD is not set
-UCLIBC_HAS_FNMATCH=y
-# UCLIBC_HAS_FNMATCH_OLD is not set
-# UCLIBC_HAS_WORDEXP is not set
-UCLIBC_HAS_NFTW=y
-# UCLIBC_HAS_FTW is not set
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-# UCLIBC_HAS_UTMPX is not set
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-MULTILIB_DIR="lib"
-# HARDWIRED_ABSPATH is not set
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-# UCLIBC_HAS_SSP is not set
-UCLIBC_BUILD_RELRO=y
-# UCLIBC_BUILD_NOW is not set
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# Development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-UCLIBC_HAS_BACKTRACE=y
-WARNINGS="-Wall"
-EXTRA_WARNINGS=y
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/i586-geode-linux-uclibc/crosstool.config b/samples/i586-geode-linux-uclibc/crosstool.config
index f54c1ce..5a5a2dc 100644
--- a/samples/i586-geode-linux-uclibc/crosstool.config
+++ b/samples/i586-geode-linux-uclibc/crosstool.config
@@ -10,8 +10,7 @@ CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
-CT_LIBC_UCLIBC_LOCALES=y
+CT_LIBC_UCLIBC_WCHAR=y
CT_CC_LANG_CXX=y
CT_DEBUG_dmalloc=y
CT_DEBUG_duma=y
diff --git a/samples/i586-geode-linux-uclibc/uClibc-0.9.33.2.config b/samples/i586-geode-linux-uclibc/uClibc-0.9.33.2.config
deleted file mode 100644
index aaabf2f..0000000
--- a/samples/i586-geode-linux-uclibc/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,270 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Mon Sep 1 18:15:30 2014
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-
-# TARGET_c6x is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-TARGET_i386=y
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="i386"
-FORCE_OPTIONS_FOR_ARCH=y
-# CONFIG_GENERIC_386 is not set
-# CONFIG_386 is not set
-# CONFIG_486 is not set
-CONFIG_586=y
-# CONFIG_586MMX is not set
-# CONFIG_686 is not set
-# CONFIG_PENTIUMII is not set
-# CONFIG_PENTIUMIII is not set
-# CONFIG_PENTIUM4 is not set
-# CONFIG_K6 is not set
-# CONFIG_K7 is not set
-# CONFIG_ELAN is not set
-# CONFIG_CRUSOE is not set
-# CONFIG_WINCHIPC6 is not set
-# CONFIG_WINCHIP2 is not set
-# CONFIG_CYRIXIII is not set
-# CONFIG_NEHEMIAH is not set
-TARGET_SUBARCH="i586"
-
-#
-# Using ELF file format
-#
-ARCH_LITTLE_ENDIAN=y
-
-#
-# Using Little Endian
-#
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-UCLIBC_HAS_FPU=y
-DO_C99_MATH=y
-# DO_XSI_MATH is not set
-UCLIBC_HAS_FENV=y
-UCLIBC_HAS_LONG_DOUBLE_MATH=y
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-DOPIC=y
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-# LDSO_STANDALONE_SUPPORT is not set
-# LDSO_PRELINK_SUPPORT is not set
-UCLIBC_STATIC_LDCONFIG=y
-# LDSO_RUNPATH is not set
-LDSO_SEARCH_INTERP_PATH=y
-LDSO_LD_LIBRARY_PATH=y
-# LDSO_NO_CLEANUP is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
-# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-# PTHREADS_DEBUG_SUPPORT is not set
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-# MALLOC_GLIBC_COMPAT is not set
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-UCLIBC_SUSV3_LEGACY=y
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-UCLIBC_SUSV4_LEGACY=y
-# UCLIBC_STRICT_HEADERS is not set
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-# UCLIBC_HAS_GETPT is not set
-# UCLIBC_HAS_LIBUTIL is not set
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_26=y
-UCLIBC_LINUX_MODULE_24=y
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-# UCLIBC_BSD_SPECIFIC is not set
-UCLIBC_HAS_BSD_ERR=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
-# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-# UCLIBC_HAS_IPV6 is not set
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-# UCLIBC_HAS_RESOLVER_SUPPORT is not set
-# UCLIBC_HAS_LIBRESOLV_STUB is not set
-# UCLIBC_HAS_LIBNSL_STUB is not set
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-# UCLIBC_HAS_CTYPE_CHECKED is not set
-UCLIBC_HAS_CTYPE_ENFORCED=y
-UCLIBC_HAS_WCHAR=y
-UCLIBC_HAS_LOCALE=y
-# UCLIBC_BUILD_ALL_LOCALE is not set
-# UCLIBC_BUILD_MINIMAL_LOCALE is not set
-UCLIBC_PREGENERATED_LOCALE_DATA=y
-# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set
-# UCLIBC_HAS_XLOCALE is not set
-# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
-# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
-# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
-# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-UCLIBC_HAS_GNU_GETSUBOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-UCLIBC_HAS_REGEX_OLD=y
-UCLIBC_HAS_FNMATCH=y
-UCLIBC_HAS_FNMATCH_OLD=y
-# UCLIBC_HAS_WORDEXP is not set
-# UCLIBC_HAS_NFTW is not set
-# UCLIBC_HAS_FTW is not set
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-# UCLIBC_HAS_UTMPX is not set
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-MULTILIB_DIR="lib"
-HARDWIRED_ABSPATH=y
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-# UCLIBC_HAS_SSP is not set
-UCLIBC_BUILD_RELRO=y
-# UCLIBC_BUILD_NOW is not set
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# Development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-# UCLIBC_HAS_BACKTRACE is not set
-WARNINGS="-Wall -pipe -pipe"
-# EXTRA_WARNINGS is not set
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/m68k-unknown-uclinux-uclibc/crosstool.config b/samples/m68k-unknown-uclinux-uclibc/crosstool.config
index 1f018aa..21175ea 100644
--- a/samples/m68k-unknown-uclinux-uclibc/crosstool.config
+++ b/samples/m68k-unknown-uclinux-uclibc/crosstool.config
@@ -4,5 +4,4 @@ CT_LOG_EXTRA=y
CT_ARCH_m68k=y
CT_KERNEL_linux=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
CT_THREADS_LT=y
diff --git a/samples/m68k-unknown-uclinux-uclibc/uClibc-0.9.33.2.config b/samples/m68k-unknown-uclinux-uclibc/uClibc-0.9.33.2.config
deleted file mode 100644
index 6db98ae..0000000
--- a/samples/m68k-unknown-uclinux-uclibc/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,260 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.32.1-git
-# Mon Sep 12 22:41:20 2011
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-TARGET_m68k=y
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-# TARGET_c6x is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="m68k"
-FORCE_OPTIONS_FOR_ARCH=y
-CONFIG_ARM_OABI=y
-# CONFIG_ARM_EABI is not set
-CONFIG_GENERIC_ARM=y
-# CONFIG_ARM610 is not set
-# CONFIG_ARM710 is not set
-# CONFIG_ARM7TDMI is not set
-# CONFIG_ARM720T is not set
-# CONFIG_ARM920T is not set
-# CONFIG_ARM922T is not set
-# CONFIG_ARM926T is not set
-# CONFIG_ARM10T is not set
-# CONFIG_ARM1136JF_S is not set
-# CONFIG_ARM1176JZ_S is not set
-# CONFIG_ARM1176JZF_S is not set
-# CONFIG_ARM_CORTEX_M3 is not set
-# CONFIG_ARM_CORTEX_M1 is not set
-# CONFIG_ARM_SA110 is not set
-# CONFIG_ARM_SA1100 is not set
-# CONFIG_ARM_XSCALE is not set
-# CONFIG_ARM_IWMMXT is not set
-TARGET_SUBARCH=""
-
-#
-# Using ELF file format
-#
-ARCH_ANY_ENDIAN=y
-ARCH_BIG_ENDIAN=y
-ARCH_WANTS_BIG_ENDIAN=y
-# ARCH_WANTS_LITTLE_ENDIAN is not set
-# ARCH_HAS_MMU is not set
-UCLIBC_HAS_FLOATS=y
-# UCLIBC_HAS_FPU is not set
-UCLIBC_HAS_SOFT_FLOAT=y
-DO_C99_MATH=y
-DO_XSI_MATH=y
-UCLIBC_HAS_FENV=y
-KERNEL_HEADERS=""
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-# HAVE_NO_PIC is not set
-DOPIC=y
-# ARCH_HAS_NO_SHARED is not set
-# ARCH_HAS_NO_LDSO is not set
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-UCLIBC_STATIC_LDCONFIG=y
-# LDSO_RUNPATH is not set
-# LDSO_SEARCH_INTERP_PATH is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-LINUXTHREADS_OLD=y
-# LINUXTHREADS_NEW is not set
-# UCLIBC_HAS_THREADS_NATIVE is not set
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-# MALLOC_GLIBC_COMPAT is not set
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-UCLIBC_SUSV3_LEGACY=y
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-# UCLIBC_SUSV4_LEGACY is not set
-UCLIBC_STRICT_HEADERS=y
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-# UCLIBC_HAS_GETPT is not set
-UCLIBC_HAS_LIBUTIL=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_24=y
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-# UCLIBC_BSD_SPECIFIC is not set
-# UCLIBC_HAS_BSD_ERR is not set
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-# UCLIBC_HAS_LIBRESOLV_STUB is not set
-# UCLIBC_HAS_LIBNSL_STUB is not set
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-# UCLIBC_HAS_CTYPE_CHECKED is not set
-UCLIBC_HAS_CTYPE_ENFORCED=y
-UCLIBC_HAS_WCHAR=n
-# UCLIBC_HAS_LOCALE is not set
-# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-# USE_OLD_VFPRINTF is not set
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
-# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-UCLIBC_HAS_GNU_GETSUBOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-# UCLIBC_HAS_REGEX_OLD is not set
-UCLIBC_HAS_FNMATCH=y
-# UCLIBC_HAS_FNMATCH_OLD is not set
-# UCLIBC_HAS_WORDEXP is not set
-UCLIBC_HAS_NFTW=y
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-# UCLIBC_HAS_UTMPX is not set
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-MULTILIB_DIR="lib"
-# HARDWIRED_ABSPATH is not set
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-# HAVE_NO_SSP is not set
-# UCLIBC_HAS_SSP is not set
-UCLIBC_BUILD_RELRO=y
-# UCLIBC_BUILD_NOW is not set
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# uClibc development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-UCLIBC_HAS_BACKTRACE=y
-WARNINGS="-Wall"
-EXTRA_WARNINGS=y
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/mips-unknown-linux-uclibc/crosstool.config b/samples/mips-unknown-linux-uclibc/crosstool.config
index 6b9bc31..73ddfa0 100644
--- a/samples/mips-unknown-linux-uclibc/crosstool.config
+++ b/samples/mips-unknown-linux-uclibc/crosstool.config
@@ -7,7 +7,6 @@ CT_ARCH_mips=y
CT_KERNEL_linux=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
CT_LIBC_UCLIBC_WCHAR=y
CT_CC_LANG_CXX=y
CT_CC_GCC_mips_plt=y
diff --git a/samples/mips-unknown-linux-uclibc/uClibc-0.9.33.2.config b/samples/mips-unknown-linux-uclibc/uClibc-0.9.33.2.config
deleted file mode 100644
index 6e7039f..0000000
--- a/samples/mips-unknown-linux-uclibc/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,255 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Sat Sep 6 00:33:32 2014
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-
-# TARGET_c6x is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-TARGET_mips=y
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="mips"
-FORCE_OPTIONS_FOR_ARCH=y
-CONFIG_MIPS_O32_ABI=y
-# CONFIG_MIPS_N32_ABI is not set
-# CONFIG_MIPS_N64_ABI is not set
-CONFIG_MIPS_ISA_1=y
-# CONFIG_MIPS_ISA_2 is not set
-# CONFIG_MIPS_ISA_3 is not set
-# CONFIG_MIPS_ISA_4 is not set
-# CONFIG_MIPS_ISA_MIPS32 is not set
-# CONFIG_MIPS_ISA_MIPS32R2 is not set
-# CONFIG_MIPS_ISA_MIPS64 is not set
-TARGET_SUBARCH=""
-
-#
-# Using ELF file format
-#
-ARCH_ANY_ENDIAN=y
-ARCH_BIG_ENDIAN=y
-ARCH_WANTS_BIG_ENDIAN=y
-# ARCH_WANTS_LITTLE_ENDIAN is not set
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-# UCLIBC_HAS_FPU is not set
-UCLIBC_HAS_SOFT_FLOAT=y
-DO_C99_MATH=y
-DO_XSI_MATH=y
-UCLIBC_HAS_FENV=y
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-DOPIC=y
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-# LDSO_STANDALONE_SUPPORT is not set
-# LDSO_PRELINK_SUPPORT is not set
-UCLIBC_STATIC_LDCONFIG=y
-# LDSO_RUNPATH is not set
-# LDSO_SEARCH_INTERP_PATH is not set
-LDSO_LD_LIBRARY_PATH=y
-# LDSO_NO_CLEANUP is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
-# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-# MALLOC_GLIBC_COMPAT is not set
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-UCLIBC_SUSV3_LEGACY=y
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-# UCLIBC_SUSV4_LEGACY is not set
-UCLIBC_STRICT_HEADERS=y
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-# UCLIBC_HAS_GETPT is not set
-UCLIBC_HAS_LIBUTIL=y
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_26=y
-UCLIBC_LINUX_MODULE_24=y
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-# UCLIBC_BSD_SPECIFIC is not set
-UCLIBC_HAS_BSD_ERR=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
-# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-# UCLIBC_HAS_RESOLVER_SUPPORT is not set
-UCLIBC_HAS_LIBRESOLV_STUB=y
-UCLIBC_HAS_LIBNSL_STUB=y
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-# UCLIBC_HAS_CTYPE_CHECKED is not set
-UCLIBC_HAS_CTYPE_ENFORCED=y
-UCLIBC_HAS_WCHAR=y
-# UCLIBC_HAS_LOCALE is not set
-# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
-# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
-# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-UCLIBC_HAS_GNU_GETSUBOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-UCLIBC_HAS_REGEX_OLD=y
-UCLIBC_HAS_FNMATCH=y
-UCLIBC_HAS_FNMATCH_OLD=y
-# UCLIBC_HAS_WORDEXP is not set
-UCLIBC_HAS_NFTW=y
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-UCLIBC_HAS_UTMPX=y
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-MULTILIB_DIR="lib"
-# HARDWIRED_ABSPATH is not set
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-# UCLIBC_HAS_SSP is not set
-UCLIBC_BUILD_RELRO=y
-# UCLIBC_BUILD_NOW is not set
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# Development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-# UCLIBC_HAS_BACKTRACE is not set
-WARNINGS="-Wall"
-EXTRA_WARNINGS=y
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/mips64el-n32-linux-uclibc/crosstool.config b/samples/mips64el-n32-linux-uclibc/crosstool.config
index 4697dfe..82b0ea5 100644
--- a/samples/mips64el-n32-linux-uclibc/crosstool.config
+++ b/samples/mips64el-n32-linux-uclibc/crosstool.config
@@ -8,10 +8,8 @@ CT_ARCH_FLOAT_SW=y
CT_ARCH_mips=y
CT_TARGET_VENDOR="n32"
CT_KERNEL_linux=y
-CT_BINUTILS_V_2_22=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
CT_LIBC_UCLIBC_WCHAR=y
CT_CC_LANG_CXX=y
CT_CC_GCC_mips_plt=y
diff --git a/samples/mips64el-n32-linux-uclibc/uClibc-0.9.33.2.config b/samples/mips64el-n32-linux-uclibc/uClibc-0.9.33.2.config
deleted file mode 100644
index d62dc15..0000000
--- a/samples/mips64el-n32-linux-uclibc/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,255 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Fri Sep 5 15:55:00 2014
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-
-# TARGET_c6x is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-TARGET_mips=y
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="mips"
-FORCE_OPTIONS_FOR_ARCH=y
-# CONFIG_MIPS_O32_ABI is not set
-CONFIG_MIPS_N32_ABI=y
-# CONFIG_MIPS_N64_ABI is not set
-# CONFIG_MIPS_ISA_1 is not set
-# CONFIG_MIPS_ISA_2 is not set
-CONFIG_MIPS_ISA_3=y
-# CONFIG_MIPS_ISA_4 is not set
-# CONFIG_MIPS_ISA_MIPS32 is not set
-# CONFIG_MIPS_ISA_MIPS32R2 is not set
-# CONFIG_MIPS_ISA_MIPS64 is not set
-TARGET_SUBARCH=""
-
-#
-# Using ELF file format
-#
-ARCH_ANY_ENDIAN=y
-ARCH_LITTLE_ENDIAN=y
-# ARCH_WANTS_BIG_ENDIAN is not set
-ARCH_WANTS_LITTLE_ENDIAN=y
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-# UCLIBC_HAS_FPU is not set
-UCLIBC_HAS_SOFT_FLOAT=y
-DO_C99_MATH=y
-# DO_XSI_MATH is not set
-UCLIBC_HAS_FENV=y
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-DOPIC=y
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-# LDSO_STANDALONE_SUPPORT is not set
-# LDSO_PRELINK_SUPPORT is not set
-UCLIBC_STATIC_LDCONFIG=y
-# LDSO_RUNPATH is not set
-LDSO_SEARCH_INTERP_PATH=y
-LDSO_LD_LIBRARY_PATH=y
-# LDSO_NO_CLEANUP is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
-# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-# PTHREADS_DEBUG_SUPPORT is not set
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-# MALLOC_GLIBC_COMPAT is not set
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-# UCLIBC_SUSV3_LEGACY is not set
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-# UCLIBC_SUSV4_LEGACY is not set
-# UCLIBC_STRICT_HEADERS is not set
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-# UCLIBC_HAS_GETPT is not set
-# UCLIBC_HAS_LIBUTIL is not set
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_26=y
-UCLIBC_LINUX_MODULE_24=y
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-# UCLIBC_BSD_SPECIFIC is not set
-UCLIBC_HAS_BSD_ERR=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
-# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-# UCLIBC_HAS_IPV6 is not set
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-# UCLIBC_HAS_RESOLVER_SUPPORT is not set
-# UCLIBC_HAS_LIBRESOLV_STUB is not set
-# UCLIBC_HAS_LIBNSL_STUB is not set
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-# UCLIBC_HAS_CTYPE_CHECKED is not set
-UCLIBC_HAS_CTYPE_ENFORCED=y
-UCLIBC_HAS_WCHAR=y
-# UCLIBC_HAS_LOCALE is not set
-# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
-# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
-# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-UCLIBC_HAS_GNU_GETSUBOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-UCLIBC_HAS_REGEX_OLD=y
-UCLIBC_HAS_FNMATCH=y
-UCLIBC_HAS_FNMATCH_OLD=y
-# UCLIBC_HAS_WORDEXP is not set
-# UCLIBC_HAS_NFTW is not set
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-# UCLIBC_HAS_UTMPX is not set
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-MULTILIB_DIR="lib"
-HARDWIRED_ABSPATH=y
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-# UCLIBC_HAS_SSP is not set
-UCLIBC_BUILD_RELRO=y
-# UCLIBC_BUILD_NOW is not set
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# Development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-# UCLIBC_HAS_BACKTRACE is not set
-WARNINGS="-Wall"
-# EXTRA_WARNINGS is not set
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/mips64el-n64-linux-uclibc/crosstool.config b/samples/mips64el-n64-linux-uclibc/crosstool.config
index 0588cc3..05e4278 100644
--- a/samples/mips64el-n64-linux-uclibc/crosstool.config
+++ b/samples/mips64el-n64-linux-uclibc/crosstool.config
@@ -9,10 +9,8 @@ CT_ARCH_mips=y
CT_ARCH_mips_n64=y
CT_TARGET_VENDOR="n64"
CT_KERNEL_linux=y
-CT_BINUTILS_V_2_22=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
CT_LIBC_UCLIBC_WCHAR=y
CT_CC_LANG_CXX=y
CT_CC_GCC_mips_plt=y
diff --git a/samples/mips64el-n64-linux-uclibc/uClibc-0.9.33.2.config b/samples/mips64el-n64-linux-uclibc/uClibc-0.9.33.2.config
deleted file mode 100644
index aee8bd7..0000000
--- a/samples/mips64el-n64-linux-uclibc/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,255 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Fri Sep 5 19:48:28 2014
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-
-# TARGET_c6x is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-TARGET_mips=y
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="mips"
-FORCE_OPTIONS_FOR_ARCH=y
-# CONFIG_MIPS_O32_ABI is not set
-# CONFIG_MIPS_N32_ABI is not set
-CONFIG_MIPS_N64_ABI=y
-# CONFIG_MIPS_ISA_1 is not set
-# CONFIG_MIPS_ISA_2 is not set
-# CONFIG_MIPS_ISA_3 is not set
-# CONFIG_MIPS_ISA_4 is not set
-# CONFIG_MIPS_ISA_MIPS32 is not set
-# CONFIG_MIPS_ISA_MIPS32R2 is not set
-CONFIG_MIPS_ISA_MIPS64=y
-TARGET_SUBARCH=""
-
-#
-# Using ELF file format
-#
-ARCH_ANY_ENDIAN=y
-ARCH_LITTLE_ENDIAN=y
-# ARCH_WANTS_BIG_ENDIAN is not set
-ARCH_WANTS_LITTLE_ENDIAN=y
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-# UCLIBC_HAS_FPU is not set
-UCLIBC_HAS_SOFT_FLOAT=y
-DO_C99_MATH=y
-# DO_XSI_MATH is not set
-UCLIBC_HAS_FENV=y
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-DOPIC=y
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-# LDSO_STANDALONE_SUPPORT is not set
-# LDSO_PRELINK_SUPPORT is not set
-UCLIBC_STATIC_LDCONFIG=y
-# LDSO_RUNPATH is not set
-LDSO_SEARCH_INTERP_PATH=y
-LDSO_LD_LIBRARY_PATH=y
-# LDSO_NO_CLEANUP is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
-# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-PTHREADS_DEBUG_SUPPORT=y
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-# MALLOC_GLIBC_COMPAT is not set
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-# UCLIBC_SUSV3_LEGACY is not set
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-# UCLIBC_SUSV4_LEGACY is not set
-# UCLIBC_STRICT_HEADERS is not set
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-# UCLIBC_HAS_GETPT is not set
-# UCLIBC_HAS_LIBUTIL is not set
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_26=y
-UCLIBC_LINUX_MODULE_24=y
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-# UCLIBC_BSD_SPECIFIC is not set
-UCLIBC_HAS_BSD_ERR=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
-# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-# UCLIBC_HAS_IPV6 is not set
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-# UCLIBC_HAS_RESOLVER_SUPPORT is not set
-# UCLIBC_HAS_LIBRESOLV_STUB is not set
-# UCLIBC_HAS_LIBNSL_STUB is not set
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-# UCLIBC_HAS_CTYPE_CHECKED is not set
-UCLIBC_HAS_CTYPE_ENFORCED=y
-UCLIBC_HAS_WCHAR=y
-# UCLIBC_HAS_LOCALE is not set
-# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
-# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
-# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-UCLIBC_HAS_GNU_GETSUBOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-UCLIBC_HAS_REGEX_OLD=y
-UCLIBC_HAS_FNMATCH=y
-UCLIBC_HAS_FNMATCH_OLD=y
-# UCLIBC_HAS_WORDEXP is not set
-# UCLIBC_HAS_NFTW is not set
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-# UCLIBC_HAS_UTMPX is not set
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/"
-DEVEL_PREFIX="/usr/"
-MULTILIB_DIR="lib"
-HARDWIRED_ABSPATH=y
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-# UCLIBC_HAS_SSP is not set
-UCLIBC_BUILD_RELRO=y
-# UCLIBC_BUILD_NOW is not set
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# Development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-# UCLIBC_HAS_BACKTRACE is not set
-WARNINGS="-Wall"
-# EXTRA_WARNINGS is not set
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/powerpc-unknown-linux-uclibc/crosstool.config b/samples/powerpc-unknown-linux-uclibc/crosstool.config
index 80ce057..941f38a 100644
--- a/samples/powerpc-unknown-linux-uclibc/crosstool.config
+++ b/samples/powerpc-unknown-linux-uclibc/crosstool.config
@@ -4,21 +4,12 @@ CT_LOG_EXTRA=y
CT_ARCH_FLOAT_SW=y
CT_ARCH_powerpc=y
CT_KERNEL_linux=y
-CT_KERNEL_V_2_6_31=y
-CT_BINUTILS_V_2_19_1a=y
CT_BINUTILS_FOR_TARGET=y
-CT_CC_V_4_2_4=y
CT_CC_LANG_FORTRAN=y
CT_CC_LANG_CXX=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_V_0_9_30_1=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
CT_DEBUG_dmalloc=y
CT_DEBUG_duma=y
CT_DEBUG_gdb=y
CT_GDB_NATIVE=y
-CT_GDB_V_6_8a=y
CT_DEBUG_strace=y
-CT_STRACE_V_4_5_19=y
-CT_GMP_V_4_3_2=y
-CT_MPFR_V_2_4_2=y
diff --git a/samples/powerpc-unknown-linux-uclibc/uClibc-0.9.30.1.config b/samples/powerpc-unknown-linux-uclibc/uClibc-0.9.30.1.config
deleted file mode 100644
index 6126e4a..0000000
--- a/samples/powerpc-unknown-linux-uclibc/uClibc-0.9.30.1.config
+++ /dev/null
@@ -1,247 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.30
-# Thu Nov 20 22:43:39 2008
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-TARGET_powerpc=y
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-# TARGET_x86_64 is not set
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="powerpc"
-FORCE_OPTIONS_FOR_ARCH=y
-# CONFIG_ARM_OABI is not set
-# CONFIG_ARM_EABI is not set
-# CONFIG_GENERIC_ARM is not set
-# CONFIG_ARM610 is not set
-# CONFIG_ARM710 is not set
-# CONFIG_ARM7TDMI is not set
-# CONFIG_ARM720T is not set
-# CONFIG_ARM920T is not set
-# CONFIG_ARM922T is not set
-# CONFIG_ARM926T is not set
-# CONFIG_ARM10T is not set
-# CONFIG_ARM1136JF_S is not set
-# CONFIG_ARM1176JZ_S is not set
-# CONFIG_ARM1176JZF_S is not set
-# CONFIG_ARM_CORTEX_M3 is not set
-# CONFIG_ARM_CORTEX_M1 is not set
-# CONFIG_ARM_SA110 is not set
-# CONFIG_ARM_SA1100 is not set
-# CONFIG_ARM_XSCALE is not set
-# CONFIG_ARM_IWMMXT is not set
-CONFIG_CLASSIC=y
-# CONFIG_E500 is not set
-TARGET_SUBARCH="classic"
-
-#
-# Using ELF file format
-#
-ARCH_BIG_ENDIAN=y
-# ARCH_WANTS_BIG_ENDIAN is not set
-# ARCH_WANTS_LITTLE_ENDIAN is not set
-
-#
-# Using Big Endian
-#
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-UCLIBC_HAS_FPU=y
-DO_C99_MATH=y
-UCLIBC_HAS_FENV=y
-UCLIBC_HAS_LONG_DOUBLE_MATH=y
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-# HAVE_NO_PIC is not set
-DOPIC=y
-# ARCH_HAS_NO_SHARED is not set
-# ARCH_HAS_NO_LDSO is not set
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-UCLIBC_STATIC_LDCONFIG=y
-# LDSO_RUNPATH is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-UCLIBC_HAS_THREADS=y
-# PTHREADS_DEBUG_SUPPORT is not set
-LINUXTHREADS_OLD=y
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-# MALLOC_GLIBC_COMPAT is not set
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-# UCLIBC_SUSV3_LEGACY is not set
-# UCLIBC_SUSV3_LEGACY_MACROS is not set
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-# UCLIBC_HAS_GETPT is not set
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_24=y
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-# UCLIBC_BSD_SPECIFIC is not set
-UCLIBC_HAS_BSD_ERR=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-# UCLIBC_HAS_IPV6 is not set
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-# UCLIBC_HAS_CTYPE_CHECKED is not set
-UCLIBC_HAS_CTYPE_ENFORCED=y
-# UCLIBC_HAS_WCHAR is not set
-# UCLIBC_HAS_LOCALE is not set
-# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-# USE_OLD_VFPRINTF is not set
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
-# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_GNU_GETSUBOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-UCLIBC_HAS_REGEX_OLD=y
-UCLIBC_HAS_FNMATCH=y
-UCLIBC_HAS_FNMATCH_OLD=y
-# UCLIBC_HAS_WORDEXP is not set
-# UCLIBC_HAS_FTW is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-
-#
-# Library Installation Options
-#
-SHARED_LIB_LOADER_PREFIX="$(RUNTIME_PREFIX)lib"
-RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/"
-DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/usr/"
-
-#
-# Security options
-#
-# UCLIBC_BUILD_PIE is not set
-# UCLIBC_HAS_ARC4RANDOM is not set
-# HAVE_NO_SSP is not set
-# UCLIBC_HAS_SSP is not set
-UCLIBC_BUILD_RELRO=y
-# UCLIBC_BUILD_NOW is not set
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# uClibc development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DODEBUG_PT is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-WARNINGS="-Wall"
-# EXTRA_WARNINGS is not set
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/samples/x86_64-unknown-linux-uclibc/crosstool.config b/samples/x86_64-unknown-linux-uclibc/crosstool.config
index 0e0dbb9..ef1ed9d 100644
--- a/samples/x86_64-unknown-linux-uclibc/crosstool.config
+++ b/samples/x86_64-unknown-linux-uclibc/crosstool.config
@@ -10,8 +10,7 @@ CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
CT_LIBC_uClibc=y
-CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
-CT_LIBC_UCLIBC_LOCALES=y
+CT_LIBC_UCLIBC_WCHAR=y
CT_CC_LANG_CXX=y
CT_CC_EXTRA_CONFIG_ARRAY="--disable-libsanitizer"
CT_DEBUG_dmalloc=y
diff --git a/samples/x86_64-unknown-linux-uclibc/uClibc-0.9.33.2.config b/samples/x86_64-unknown-linux-uclibc/uClibc-0.9.33.2.config
deleted file mode 100644
index 1073465..0000000
--- a/samples/x86_64-unknown-linux-uclibc/uClibc-0.9.33.2.config
+++ /dev/null
@@ -1,247 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Version: 0.9.33.2
-# Sun Aug 31 15:27:07 2014
-#
-# TARGET_alpha is not set
-# TARGET_arm is not set
-
-# TARGET_c6x is not set
-# TARGET_cris is not set
-# TARGET_e1 is not set
-# TARGET_frv is not set
-# TARGET_h8300 is not set
-# TARGET_hppa is not set
-# TARGET_i386 is not set
-# TARGET_i960 is not set
-# TARGET_ia64 is not set
-# TARGET_m68k is not set
-# TARGET_microblaze is not set
-# TARGET_mips is not set
-# TARGET_nios is not set
-# TARGET_nios2 is not set
-# TARGET_powerpc is not set
-# TARGET_sh is not set
-# TARGET_sh64 is not set
-# TARGET_sparc is not set
-# TARGET_v850 is not set
-# TARGET_vax is not set
-TARGET_x86_64=y
-# TARGET_xtensa is not set
-
-#
-# Target Architecture Features and Options
-#
-TARGET_ARCH="x86_64"
-FORCE_OPTIONS_FOR_ARCH=y
-TARGET_SUBARCH=""
-
-#
-# Using ELF file format
-#
-ARCH_LITTLE_ENDIAN=y
-
-#
-# Using Little Endian
-#
-ARCH_HAS_MMU=y
-ARCH_USE_MMU=y
-UCLIBC_HAS_FLOATS=y
-UCLIBC_HAS_FPU=y
-DO_C99_MATH=y
-# DO_XSI_MATH is not set
-UCLIBC_HAS_FENV=y
-UCLIBC_HAS_LONG_DOUBLE_MATH=y
-KERNEL_HEADERS="/usr/include"
-HAVE_DOT_CONFIG=y
-
-#
-# General Library Settings
-#
-DOPIC=y
-HAVE_SHARED=y
-# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
-LDSO_LDD_SUPPORT=y
-LDSO_CACHE_SUPPORT=y
-LDSO_PRELOAD_ENV_SUPPORT=y
-# LDSO_PRELOAD_FILE_SUPPORT is not set
-LDSO_BASE_FILENAME="ld.so"
-# LDSO_STANDALONE_SUPPORT is not set
-# LDSO_PRELINK_SUPPORT is not set
-UCLIBC_STATIC_LDCONFIG=y
-# LDSO_RUNPATH is not set
-LDSO_SEARCH_INTERP_PATH=y
-LDSO_LD_LIBRARY_PATH=y
-# LDSO_NO_CLEANUP is not set
-UCLIBC_CTOR_DTOR=y
-# LDSO_GNU_HASH_SUPPORT is not set
-# HAS_NO_THREADS is not set
-# LINUXTHREADS_OLD is not set
-# LINUXTHREADS_NEW is not set
-UCLIBC_HAS_THREADS_NATIVE=y
-UCLIBC_HAS_THREADS=y
-UCLIBC_HAS_TLS=y
-# PTHREADS_DEBUG_SUPPORT is not set
-UCLIBC_HAS_SYSLOG=y
-UCLIBC_HAS_LFS=y
-# MALLOC is not set
-# MALLOC_SIMPLE is not set
-MALLOC_STANDARD=y
-# MALLOC_GLIBC_COMPAT is not set
-UCLIBC_DYNAMIC_ATEXIT=y
-# COMPAT_ATEXIT is not set
-UCLIBC_SUSV3_LEGACY=y
-UCLIBC_SUSV3_LEGACY_MACROS=y
-UCLIBC_SUSV4_LEGACY=y
-# UCLIBC_STRICT_HEADERS is not set
-# UCLIBC_HAS_STUBS is not set
-UCLIBC_HAS_SHADOW=y
-# UCLIBC_HAS_PROGRAM_INVOCATION_NAME is not set
-UCLIBC_HAS_PTY=y
-ASSUME_DEVPTS=y
-UNIX98PTY_ONLY=y
-# UCLIBC_HAS_GETPT is not set
-# UCLIBC_HAS_LIBUTIL is not set
-UCLIBC_HAS_TM_EXTENSIONS=y
-UCLIBC_HAS_TZ_CACHING=y
-UCLIBC_HAS_TZ_FILE=y
-UCLIBC_HAS_TZ_FILE_READ_MANY=y
-UCLIBC_TZ_FILE_PATH="/etc/TZ"
-UCLIBC_FALLBACK_TO_ETC_LOCALTIME=y
-
-#
-# Advanced Library Settings
-#
-UCLIBC_PWD_BUFFER_SIZE=256
-UCLIBC_GRP_BUFFER_SIZE=256
-
-#
-# Support various families of functions
-#
-UCLIBC_LINUX_MODULE_26=y
-UCLIBC_LINUX_MODULE_24=y
-UCLIBC_LINUX_SPECIFIC=y
-UCLIBC_HAS_GNU_ERROR=y
-# UCLIBC_BSD_SPECIFIC is not set
-UCLIBC_HAS_BSD_ERR=y
-# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
-# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
-# UCLIBC_NTP_LEGACY is not set
-# UCLIBC_SV4_DEPRECATED is not set
-UCLIBC_HAS_REALTIME=y
-UCLIBC_HAS_ADVANCED_REALTIME=y
-UCLIBC_HAS_EPOLL=y
-UCLIBC_HAS_XATTR=y
-UCLIBC_HAS_PROFILING=y
-UCLIBC_HAS_CRYPT_IMPL=y
-# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set
-# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set
-UCLIBC_HAS_CRYPT=y
-UCLIBC_HAS_NETWORK_SUPPORT=y
-UCLIBC_HAS_SOCKET=y
-UCLIBC_HAS_IPV4=y
-# UCLIBC_HAS_IPV6 is not set
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
-UCLIBC_USE_NETLINK=y
-UCLIBC_SUPPORT_AI_ADDRCONFIG=y
-# UCLIBC_HAS_BSD_RES_CLOSE is not set
-UCLIBC_HAS_COMPAT_RES_STATE=y
-# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set
-# UCLIBC_HAS_RESOLVER_SUPPORT is not set
-# UCLIBC_HAS_LIBRESOLV_STUB is not set
-# UCLIBC_HAS_LIBNSL_STUB is not set
-
-#
-# String and Stdio Support
-#
-UCLIBC_HAS_STRING_GENERIC_OPT=y
-UCLIBC_HAS_STRING_ARCH_OPT=y
-UCLIBC_HAS_CTYPE_TABLES=y
-UCLIBC_HAS_CTYPE_SIGNED=y
-# UCLIBC_HAS_CTYPE_UNSAFE is not set
-# UCLIBC_HAS_CTYPE_CHECKED is not set
-UCLIBC_HAS_CTYPE_ENFORCED=y
-# UCLIBC_HAS_WCHAR is not set
-# UCLIBC_HAS_LOCALE is not set
-# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
-UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
-# USE_OLD_VFPRINTF is not set
-UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
-# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
-# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
-UCLIBC_HAS_STDIO_BUFSIZ_4096=y
-# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
-UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
-# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
-# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
-UCLIBC_HAS_STDIO_GETC_MACRO=y
-UCLIBC_HAS_STDIO_PUTC_MACRO=y
-UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
-# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
-# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
-# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
-# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
-UCLIBC_HAS_PRINTF_M_SPEC=y
-UCLIBC_HAS_ERRNO_MESSAGES=y
-# UCLIBC_HAS_SYS_ERRLIST is not set
-UCLIBC_HAS_SIGNUM_MESSAGES=y
-# UCLIBC_HAS_SYS_SIGLIST is not set
-UCLIBC_HAS_GNU_GETOPT=y
-UCLIBC_HAS_STDIO_FUTEXES=y
-UCLIBC_HAS_GNU_GETSUBOPT=y
-
-#
-# Big and Tall
-#
-UCLIBC_HAS_REGEX=y
-UCLIBC_HAS_REGEX_OLD=y
-UCLIBC_HAS_FNMATCH=y
-UCLIBC_HAS_FNMATCH_OLD=y
-UCLIBC_HAS_WORDEXP=y
-# UCLIBC_HAS_NFTW is not set
-# UCLIBC_HAS_FTW is not set
-# UCLIBC_HAS_FTS is not set
-UCLIBC_HAS_GLOB=y
-UCLIBC_HAS_GNU_GLOB=y
-# UCLIBC_HAS_UTMPX is not set
-
-#
-# Library Installation Options
-#
-RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/"
-DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/usr/"
-MULTILIB_DIR="lib"
-HARDWIRED_ABSPATH=y
-
-#
-# Security options
-#
-# UCLIBC_HAS_ARC4RANDOM is not set
-# UCLIBC_HAS_SSP is not set
-UCLIBC_BUILD_RELRO=y
-# UCLIBC_BUILD_NOW is not set
-UCLIBC_BUILD_NOEXECSTACK=y
-
-#
-# Development/debugging options
-#
-CROSS_COMPILER_PREFIX=""
-UCLIBC_EXTRA_CFLAGS=""
-# DODEBUG is not set
-# DOSTRIP is not set
-# DOASSERTS is not set
-# SUPPORT_LD_DEBUG is not set
-# SUPPORT_LD_DEBUG_EARLY is not set
-# UCLIBC_MALLOC_DEBUGGING is not set
-# UCLIBC_HAS_BACKTRACE is not set
-WARNINGS="-Wall"
-# EXTRA_WARNINGS is not set
-# DOMULTI is not set
-# UCLIBC_MJN3_ONLY is not set
diff --git a/scripts/addToolVersion.sh b/scripts/addToolVersion.sh
index 37c3ae1..9c6c4c6 100755
--- a/scripts/addToolVersion.sh
+++ b/scripts/addToolVersion.sh
@@ -133,15 +133,12 @@ addToolVersion() {
fi
;;
uClibc)
- # uClibc-0.9.30 and above need some love
+ # uClibc-0.9.33.2 needs some love
ver_M=$(getVersionField "${version}" . 1)
ver_m=$(getVersionField "${version}" . 2)
ver_p=$(getVersionField "${version}" . 3)
- if [ ${ver_M} -eq 0 -a ${ver_m} -eq 9 -a ${ver_p} -eq 30 \
- -o ${ver_M} -eq 0 -a ${ver_m} -eq 9 -a ${ver_p} -eq 31 ]; then
- SedExpr1="${SedExpr1}\n select LIBC_UCLIBC_0_9_30_or_later"
- elif [ ${ver_M} -eq 0 -a ${ver_m} -eq 9 -a ${ver_p} -eq 32 ]; then
- SedExpr1="${SedExpr1}\n select LIBC_UCLIBC_0_9_32_or_later"
+ elif [ ${ver_M} -eq 0 -a ${ver_m} -eq 9 -a ${ver_p} -eq 33 ]; then
+ SedExpr1="${SedExpr1}\n select LIBC_UCLIBC_0_9_33_2_or_later"
fi
;;
gdb)
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 28dda1d..6515f96 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -940,7 +940,11 @@ do_gcc_backend() {
CT_DoExecLog ALL make ${JOBSFLAGS} all
CT_DoLog EXTRA "Installing final gcc compiler"
- CT_DoExecLog ALL make ${JOBSFLAGS} install
+ if [ "${CT_STRIP_TARGET_TOOLCHAIN_EXECUTABLES}" = "y" ]; then
+ CT_DoExecLog ALL make ${JOBSFLAGS} install-strip
+ else
+ CT_DoExecLog ALL make ${JOBSFLAGS} install
+ fi
# Remove the libtool "pseudo-libraries": having them in the installed
# tree makes the libtoolized utilities that are built next assume
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh
index 21f6472..52eaa3d 100644
--- a/scripts/build/internals.sh
+++ b/scripts/build/internals.sh
@@ -11,7 +11,7 @@ do_finish() {
CT_DoStep INFO "Cleaning-up the toolchain's directory"
- if [ "${CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES}" = "y" ]; then
+ if [ "${CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES}" = "y" ]; then
case "$CT_HOST" in
*darwin*)
strip_args=""
diff --git a/scripts/build/libc/uClibc.sh b/scripts/build/libc/uClibc.sh
index eac32da..f49fd08 100644
--- a/scripts/build/libc/uClibc.sh
+++ b/scripts/build/libc/uClibc.sh
@@ -7,15 +7,22 @@
uclibc_locales_version=030818
uclibc_local_tarball="uClibc-locale-${uclibc_locales_version}"
-# Download uClibc
-do_libc_get() {
+if [ "${CT_LIBC_UCLIBC_NG}" = "y" ]; then
+ uclibc_name="uClibc-ng"
+ libc_src="http://downloads.uclibc-ng.org/releases/${CT_LIBC_VERSION}"
+else
+ uclibc_name="uClibc"
libc_src="http://www.uclibc.org/downloads
http://www.uclibc.org/downloads/old-releases"
+fi
+
+# Download uClibc
+do_libc_get() {
if [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" ]; then
- CT_GetCustom "uClibc" "${CT_LIBC_VERSION}" \
+ CT_GetCustom "${uclibc_name}" "${CT_LIBC_VERSION}" \
"${CT_LIBC_UCLIBC_CUSTOM_LOCATION}"
else
- CT_GetFile "uClibc-${CT_LIBC_VERSION}" ${libc_src}
+ CT_GetFile "${uclibc_name}-${CT_LIBC_VERSION}" ${libc_src}
fi
# uClibc locales
if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" ]; then
@@ -33,9 +40,9 @@ do_libc_extract() {
# custom location directory. Just use negate the whole test,
# to keep it the same as for other components.
if ! [ "${CT_LIBC_UCLIBC_CUSTOM}" = "y" \
- -a -d "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}" ]; then
- CT_Extract "uClibc-${CT_LIBC_VERSION}"
- CT_Patch "uClibc" "${CT_LIBC_VERSION}"
+ -a -d "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" ]; then
+ CT_Extract "${uclibc_name}-${CT_LIBC_VERSION}"
+ CT_Patch "${uclibc_name}" "${CT_LIBC_VERSION}"
fi
# uClibc locales
@@ -43,7 +50,7 @@ do_libc_extract() {
# broken, so just link it in place...
if [ "${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" = "y" \
-a ! -f "${CT_SRC_DIR}/.${uclibc_local_tarball}.extracted" ]; then
- CT_Pushd "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}/extra/locale"
+ CT_Pushd "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}/extra/locale"
CT_DoExecLog ALL ln -s "${CT_TARBALLS_DIR}/${uclibc_local_tarball}.tgz" .
CT_Popd
touch "${CT_SRC_DIR}/.${uclibc_local_tarball}.extracted"
@@ -56,29 +63,31 @@ do_libc_extract() {
do_libc_check_config() {
CT_DoStep INFO "Checking C library configuration"
- CT_TestOrAbort "You did not provide a uClibc config file!" -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" -a -f "${CT_LIBC_UCLIBC_CONFIG_FILE}"
+ # Use the default config if the user did not provide one.
+ if [ -z "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
+ CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/contrib/uClibc-defconfigs/${uclibc_name}.config"
+ fi
- if grep -E '^KERNEL_SOURCE=' "${CT_LIBC_UCLIBC_CONFIG_FILE}" >/dev/null 2>&1; then
+ if ${grep} -E '^KERNEL_SOURCE=' "${CT_LIBC_UCLIBC_CONFIG_FILE}" >/dev/null 2>&1; then
CT_DoLog WARN "Your uClibc version refers to the kernel _sources_, which is bad."
CT_DoLog WARN "I can't guarantee that our little hack will work. Please try to upgrade."
fi
- CT_DoLog EXTRA "Munging uClibc configuration"
- mungeuClibcConfig "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${CT_CONFIG_DIR}/uClibc.config"
+ CT_DoLog EXTRA "Manage uClibc configuration"
+ manage_uClibc_config "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${CT_CONFIG_DIR}/uClibc.config"
CT_EndStep
}
# Build and install headers and start files
do_libc_start_files() {
- local install_rule
local cross
CT_DoStep INFO "Installing C library headers"
# Simply copy files until uClibc has the ability to build out-of-tree
CT_DoLog EXTRA "Copying sources to build dir"
- CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}" \
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" \
"${CT_BUILD_DIR}/build-libc-headers"
cd "${CT_BUILD_DIR}/build-libc-headers"
@@ -99,6 +108,7 @@ do_libc_start_files() {
CT_DoLog EXTRA "Applying configuration"
CT_DoYes "" |CT_DoExecLog ALL \
make CROSS_COMPILE="${cross}" \
+ UCLIBC_EXTRA_CFLAGS="-pipe" \
PREFIX="${CT_SYSROOT_DIR}/" \
LOCALE_DATA_FILENAME="${uclibc_local_tarball}.tgz" \
oldconfig
@@ -107,29 +117,26 @@ do_libc_start_files() {
CT_DoExecLog ALL \
make ${CT_LIBC_UCLIBC_VERBOSITY} \
CROSS_COMPILE="${cross}" \
+ UCLIBC_EXTRA_CFLAGS="-pipe" \
PREFIX="${CT_SYSROOT_DIR}/" \
LOCALE_DATA_FILENAME="${uclibc_local_tarball}.tgz" \
headers
- if [ "${CT_LIBC_UCLIBC_0_9_30_or_later}" = "y" ]; then
- install_rule=install_headers
- else
- install_rule=install_dev
- fi
-
CT_DoLog EXTRA "Installing headers"
CT_DoExecLog ALL \
make ${CT_LIBC_UCLIBC_VERBOSITY} \
CROSS_COMPILE="${cross}" \
+ UCLIBC_EXTRA_CFLAGS="-pipe" \
PREFIX="${CT_SYSROOT_DIR}/" \
LOCALE_DATA_FILENAME="${uclibc_local_tarball}.tgz" \
- ${install_rule}
+ install_headers
if [ "${CT_THREADS}" = "nptl" ]; then
CT_DoLog EXTRA "Building start files"
CT_DoExecLog ALL \
make ${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} \
CROSS_COMPILE="${cross}" \
+ UCLIBC_EXTRA_CFLAGS="-pipe" \
PREFIX="${CT_SYSROOT_DIR}/" \
STRIPTOOL=true \
${CT_LIBC_UCLIBC_VERBOSITY} \
@@ -164,7 +171,7 @@ do_libc() {
# Simply copy files until uClibc has the ability to build out-of-tree
CT_DoLog EXTRA "Copying sources to build dir"
- CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}" \
+ CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/${uclibc_name}-${CT_LIBC_VERSION}" \
"${CT_BUILD_DIR}/build-libc"
cd "${CT_BUILD_DIR}/build-libc"
@@ -181,6 +188,7 @@ do_libc() {
CT_DoLog EXTRA "Applying configuration"
CT_DoYes "" |CT_DoExecLog CFG \
make CROSS_COMPILE=${CT_TARGET}- \
+ UCLIBC_EXTRA_CFLAGS="-pipe" \
PREFIX="${CT_SYSROOT_DIR}/" \
LOCALE_DATA_FILENAME="${uclibc_local_tarball}.tgz" \
oldconfig
@@ -192,6 +200,7 @@ do_libc() {
CT_DoExecLog ALL \
make -j1 \
CROSS_COMPILE=${CT_TARGET}- \
+ UCLIBC_EXTRA_CFLAGS="-pipe" \
PREFIX="${CT_SYSROOT_DIR}/" \
STRIPTOOL=true \
${CT_LIBC_UCLIBC_VERBOSITY} \
@@ -200,6 +209,7 @@ do_libc() {
CT_DoExecLog ALL \
make ${CT_LIBC_UCLIBC_PARALLEL:+${JOBSFLAGS}} \
CROSS_COMPILE=${CT_TARGET}- \
+ UCLIBC_EXTRA_CFLAGS="-pipe" \
PREFIX="${CT_SYSROOT_DIR}/" \
STRIPTOOL=true \
${CT_LIBC_UCLIBC_VERBOSITY} \
@@ -223,6 +233,7 @@ do_libc() {
CT_DoLog EXTRA "Installing C library"
CT_DoExecLog ALL \
make CROSS_COMPILE=${CT_TARGET}- \
+ UCLIBC_EXTRA_CFLAGS="-pipe" \
PREFIX="${CT_SYSROOT_DIR}/" \
STRIPTOOL=true \
${CT_LIBC_UCLIBC_VERBOSITY} \
@@ -234,18 +245,15 @@ do_libc() {
# Initialises the .config file to sensible values
# $1: original file
-# $2: munged file
-mungeuClibcConfig() {
- src_config_file="$1"
- dst_config_file="$2"
- munge_file="${CT_BUILD_DIR}/munge-uClibc-config.sed"
+# $2: modified file
+manage_uClibc_config() {
+ src="$1"
+ dst="$2"
- # Start with a fresh file
- rm -f "${munge_file}"
- touch "${munge_file}"
-
- # Do it all in a sub-shell, it's easier to redirect output
- (
+ # Start with fresh files
+ CT_DoExecLog ALL rm -f "${dst}"
+ CT_DoExecLog ALL mkdir -p "$(dirname ${dst})"
+ CT_DoExecLog ALL cp "${src}" "${dst}"
# Hack our target in the config file.
case "${CT_ARCH}:${CT_ARCH_BITNESS}" in
@@ -257,159 +265,134 @@ mungeuClibcConfig() {
esac
# Also remove stripping: its the responsibility of the
# firmware builder to strip or not.
- cat <<-ENDSED
- s/^(TARGET_.*)=y$/# \\1 is not set/
- s/^# TARGET_${arch} is not set/TARGET_${arch}=y/
- s/^TARGET_ARCH=".*"/TARGET_ARCH="${arch}"/
- s/.*(DOSTRIP).*/# \\1 is not set/
- ENDSED
+ ${sed} -i -r -e '/^TARGET_.*/d' "${dst}"
+ CT_KconfigEnableOption "TARGET_${arch}" "${dst}"
+ CT_KconfigSetOption "TARGET_ARCH" "${arch}" "${dst}"
+ CT_KconfigDisableOption "DOSTRIP" "${dst}"
# Ah. We may one day need architecture-specific handler here...
- case "${CT_ARCH}" in
- arm)
- # Hack the ARM {E,O}ABI into the config file
+ case "${arch}" in
+ arm*)
if [ "${CT_ARCH_ARM_EABI}" = "y" ]; then
- cat <<-ENDSED
- s/.*(CONFIG_ARM_OABI).*/# \\1 is not set/
- s/.*(CONFIG_ARM_EABI).*/\\1=y/
- ENDSED
+ CT_KconfigDisableOption "CONFIG_ARM_OABI" "${dst}"
+ CT_KconfigEnableOption "CONFIG_ARM_EABI" "${dst}"
else
- cat <<-ENDSED
- s/.*(CONFIG_ARM_OABI).*/\\1=y/
- s/.*(CONFIG_ARM_EABI).*/# \\1 is not set/
- ENDSED
+ CT_KconfigDisableOption "CONFIG_ARM_EABI" "${dst}"
+ CT_KconfigEnableOption "CONFIG_ARM_OABI" "${dst}"
fi
;;
- mips)
+ i386)
+ # FIXME This doesn't cover all cases of x86_32...
+ case ${CT_TARGET_ARCH} in
+ i386)
+ CT_KconfigEnableOption "CONFIG_386" "${dst}"
+ ;;
+ i486)
+ CT_KconfigEnableOption "CONFIG_486" "${dst}"
+ ;;
+ i586)
+ CT_KconfigEnableOption "CONFIG_586" "${dst}"
+ ;;
+ i686)
+ CT_KconfigEnableOption "CONFIG_686" "${dst}"
+ ;;
+ esac
+ ;;
+ mips*)
+ CT_KconfigDisableOption "CONFIG_MIPS_O32_ABI" "${dst}"
+ CT_KconfigDisableOption "CONFIG_MIPS_N32_ABI" "${dst}"
+ CT_KconfigDisableOption "CONFIG_MIPS_N64_ABI" "${dst}"
+ CT_KconfigDeleteOption "CONFIG_MIPS_ISA_1" "${dst}"
+ CT_KconfigDeleteOption "CONFIG_MIPS_ISA_2" "${dst}"
+ CT_KconfigDeleteOption "CONFIG_MIPS_ISA_3" "${dst}"
+ CT_KconfigDeleteOption "CONFIG_MIPS_ISA_4" "${dst}"
+ CT_KconfigDeleteOption "CONFIG_MIPS_ISA_MIPS32" "${dst}"
+ CT_KconfigDeleteOption "CONFIG_MIPS_ISA_MIPS32R2" "${dst}"
+ CT_KconfigDeleteOption "CONFIG_MIPS_ISA_MIPS64" "${dst}"
+ CT_KconfigDeleteOption "CONFIG_MIPS_ISA_MIPS64R2" "${dst}"
case "${CT_ARCH_mips_ABI}" in
32)
- cat <<-ENDSED
- s/.*(CONFIG_MIPS_O32_ABI).*/\\1=y/
- s/.*(CONFIG_MIPS_N32_ABI).*/# \\1 is not set/
- s/.*(CONFIG_MIPS_N64_ABI).*/# \\1 is not set/
- ENDSED
+ CT_KconfigEnableOption "CONFIG_MIPS_O32_ABI" "${dst}"
;;
- # For n32 and n64, also force the ISA
- # Not so sure this is pertinent, so it's
- # commented out for now. It would take a
- # (MIPS+uClibc) expert to either remove
- # or re-enable the overrides.
n32)
- cat <<-ENDSED
- s/.*(CONFIG_MIPS_O32_ABI).*/# \\1 is not set/
- s/.*(CONFIG_MIPS_N32_ABI).*/\\1=y/
- s/.*(CONFIG_MIPS_N64_ABI).*/# \\1 is not set/
- s/.*(CONFIG_MIPS_ISA_.*).*/# \\1 is not set/
- s/.*(CONFIG_MIPS_ISA_3).*/\\1=y/
- ENDSED
+ CT_KconfigEnableOption "CONFIG_MIPS_N32_ABI" "${dst}"
;;
64)
- cat <<-ENDSED
- s/.*(CONFIG_MIPS_O32_ABI).*/# \\1 is not set/
- s/.*(CONFIG_MIPS_N32_ABI).*/# \\1 is not set/
- s/.*(CONFIG_MIPS_N64_ABI).*/\\1=y/
- s/.*(CONFIG_MIPS_ISA_.*).*/# \\1 is not set/
- s/.*(CONFIG_MIPS_ISA_MIPS64).*/\\1=y/
- ENDSED
+ CT_KconfigEnableOption "CONFIG_MIPS_N64_ABI" "${dst}"
;;
esac
;;
+ powerpc*)
+ CT_KconfigDisableOption "CONFIG_E500" "${dst}"
+ CT_KconfigDisableOption "CONFIG_CLASSIC" "${dst}"
+ CT_KconfigDeleteOption "TARGET_SUBARCH" "${dst}"
+ if [ "${CT_ARCH_powerpc_ABI}" = "spe" ]; then
+ CT_KconfigEnableOption "CONFIG_E500" "${dst}"
+ CT_KconfigSetOption "TARGET_SUBARCH" "e500" "${dst}"
+ else
+ CT_KconfigEnableOption "CONFIG_CLASSIC" "${dst}"
+ CT_KconfigSetOption "TARGET_SUBARCH" "classic" "${dst}"
+ fi
+ ;;
+ sh)
+ # all we really support right now is sh4:32
+ CT_KconfigEnableOption "CONFIG_SH4" "${dst}"
+ ;;
esac
# Accomodate for old and new uClibc versions, where the
# way to select between big/little endian has changed
case "${CT_ARCH_ENDIAN}" in
big)
- cat <<-ENDSED
- s/.*(ARCH_LITTLE_ENDIAN).*/# \\1 is not set/
- s/.*(ARCH_BIG_ENDIAN).*/\\1=y/
- s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/# \\1 is not set/
- s/.*(ARCH_WANTS_BIG_ENDIAN).*/\\1=y/
- ENDSED
- ;;
+ CT_KconfigDisableOption "ARCH_LITTLE_ENDIAN" "${dst}"
+ CT_KconfigDisableOption "ARCH_WANTS_LITTLE_ENDIAN" "${dst}"
+ CT_KconfigEnableOption "ARCH_BIG_ENDIAN" "${dst}"
+ CT_KconfigEnableOption "ARCH_WANTS_BIG_ENDIAN" "${dst}"
+ ;;
little)
- cat <<-ENDSED
- s/.*(ARCH_LITTLE_ENDIAN).*/\\1=y/
- s/.*(ARCH_BIG_ENDIAN).*/# \\1 is not set/
- s/.*(ARCH_WANTS_LITTLE_ENDIAN).*/\\1=y/
- s/.*(ARCH_WANTS_BIG_ENDIAN).*/# \\1 is not set/
- ENDSED
- ;;
+ CT_KconfigDisableOption "ARCH_BIG_ENDIAN" "${dst}"
+ CT_KconfigDisableOption "ARCH_WANTS_BIG_ENDIAN" "${dst}"
+ CT_KconfigEnableOption "ARCH_LITTLE_ENDIAN" "${dst}"
+ CT_KconfigEnableOption "ARCH_WANTS_LITTLE_ENDIAN" "${dst}"
+ ;;
esac
# Accomodate for old and new uClibc versions, where the
# MMU settings has different config knobs
if [ "${CT_ARCH_USE_MMU}" = "y" ]; then
- cat <<-ENDSED
- s/.*(ARCH_HAS_MMU).*/\\1=y\nARCH_USE_MMU=y/
- ENDSED
+ CT_KconfigEnableOption "ARCH_USE_MMU" "${dst}"
else
- cat <<-ENDSED
- s/.*(ARCH_HAS_MMU).*/# \\1 is not set/
- /.*(ARCH_USE_MMU).*/d
- ENDSED
+ CT_KconfigDisableOption "ARCH_USE_MMU" "${dst}"
fi
# Accomodate for old and new uClibc version, where the
# way to select between hard/soft float has changed
case "${CT_ARCH_FLOAT}" in
hard|softfp)
- cat <<-ENDSED
- s/^[^_]*(HAS_FPU).*/\\1=y/
- s/.*(UCLIBC_HAS_FPU).*/\\1=y/
- ENDSED
+ CT_KconfigEnableOption "UCLIBC_HAS_FPU" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_HAS_FLOATS" "${dst}"
;;
soft)
- cat <<-ENDSED
- s/^[^_]*(HAS_FPU).*/\\# \\1 is not set/
- s/.*(UCLIBC_HAS_FPU).*/# \\1 is not set/
- ENDSED
+ CT_KconfigDisableOption "UCLIBC_HAS_FPU" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_HAS_FLOATS" "${dst}"
+ CT_KconfigEnableOption "DO_C99_MATH" "${dst}"
;;
esac
if [ "${CT_LIBC_UCLIBC_FENV}" = "y" ]; then
- cat <<-ENDSED
- s/.*(UCLIBC_HAS_FENV).*/\\1=y/
- ENDSED
+ CT_KconfigEnableOption "UCLIBC_HAS_FENV" "${dst}"
fi
# We always want ctor/dtor
- cat <<-ENDSED
- s/^# (UCLIBC_CTOR_DTOR) is not set/\\1=y/
- ENDSED
+ CT_KconfigEnableOption "UCLIBC_CTOR_DTOR" "${dst}"
# Change paths to work with crosstool-NG
- # From http://www.uclibc.org/cgi-bin/viewcvs.cgi?rev=16846&view=rev
- # " we just want the kernel headers, not the whole kernel source ...
- # " so people may need to update their paths slightly
- quoted_kernel_source=$(echo "${CT_HEADERS_DIR}" | sed -r -e 's,/include/?$,,; s,/,\\/,g;')
- quoted_headers_dir=$(echo "${CT_HEADERS_DIR}" | sed -r -e 's,/,\\/,g;')
- # CROSS_COMPILER_PREFIX is left as is, as the CROSS_COMPILE parameter is forced on the command line
- # DEVEL_PREFIX is left as '/usr/' because it is post-pended to $PREFIX, wich is the correct value of ${PREFIX}/${TARGET}
- # Some (old) versions of uClibc use KERNEL_SOURCE (which is _wrong_), and
- # newer versions use KERNEL_HEADERS (which is right).
- cat <<-ENDSED
- s/^DEVEL_PREFIX=".*"/DEVEL_PREFIX="\\/usr\\/"/
- s/^RUNTIME_PREFIX=".*"/RUNTIME_PREFIX="\\/"/
- s/^SHARED_LIB_LOADER_PREFIX=.*/SHARED_LIB_LOADER_PREFIX="\\/lib\\/"/
- s/^KERNEL_SOURCE=".*"/KERNEL_SOURCE="${quoted_kernel_source}"/
- s/^KERNEL_HEADERS=".*"/KERNEL_HEADERS="${quoted_headers_dir}"/
- s/^UCLIBC_DOWNLOAD_PREGENERATED_LOCALE=y/\\# UCLIBC_DOWNLOAD_PREGENERATED_LOCALE is not set/
- ENDSED
-
- if [ "${CT_USE_PIPES}" = "y" ]; then
- if grep UCLIBC_EXTRA_CFLAGS extra/Configs/Config.in >/dev/null 2>&1; then
- # Good, there is special provision for such things as -pipe!
- cat <<-ENDSED
- s/^(UCLIBC_EXTRA_CFLAGS=".*)"$/\\1 -pipe"/
- ENDSED
- else
- # Hack our -pipe into WARNINGS, which will be internally incorporated to
- # CFLAGS. This a dirty hack, but yet needed
- cat <<-ENDSED
- s/^(WARNINGS=".*)"$/\\1 -pipe"/
- ENDSED
- fi
- fi
+ #
+ # DEVEL_PREFIX is left as '/usr/' because it is post-pended to $PREFIX,
+ # which is the correct value of ${PREFIX}/${TARGET}.
+ CT_KconfigSetOption "DEVEL_PREFIX" "\"/usr/\"" "${dst}"
+ CT_KconfigSetOption "RUNTIME_PREFIX" "\"/\"" "${dst}"
+ CT_KconfigSetOption "SHARED_LIB_LOADER_PREFIX" "\"/lib/\"" "${dst}"
+ CT_KconfigSetOption "KERNEL_HEADERS" "\"${CT_HEADERS_DIR}\"" "${dst}"
# Locales support
# Note that the two PREGEN_LOCALE and the XLOCALE lines may be missing
@@ -418,81 +401,74 @@ mungeuClibcConfig() {
# arrangements. Note that having the uClibc Makefile download the
# pregenerated locales is not compatible with crosstool; besides,
# crosstool downloads them as part of getandpatch.sh.
+ CT_KconfigDeleteOption "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE" "${dst}"
case "${CT_LIBC_UCLIBC_LOCALES}:${CT_LIBC_UCLIBC_LOCALES_PREGEN_DATA}" in
:*)
;;
y:)
- cat <<-ENDSED
- s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\
- # UCLIBC_PREGENERATED_LOCALE_DATA is not set\\
- # UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\
- # UCLIBC_HAS_XLOCALE is not set/
- ENDSED
+ CT_KconfigEnableOption "UCLIBC_HAS_LOCALE" "${dst}"
+ CT_KconfigDeleteOption "UCLIBC_PREGENERATED_LOCALE_DATA" "${dst}"
+ CT_KconfigDeleteOption "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA" \
+ "${dst}"
+ CT_KconfigDeleteOption "UCLIBC_HAS_XLOCALE" "${dst}"
;;
y:y)
- cat <<-ENDSED
- s/^# UCLIBC_HAS_LOCALE is not set/UCLIBC_HAS_LOCALE=y\\
- UCLIBC_PREGENERATED_LOCALE_DATA=y\\
- # UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA is not set\\
- # UCLIBC_HAS_XLOCALE is not set/
- ENDSED
+ CT_KconfigEnableOption "UCLIBC_HAS_LOCALE" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_PREGENERATED_LOCALE_DATA" "${dst}"
+ CT_KconfigDeleteOption "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA" \
+ "${dst}"
+ CT_KconfigDeleteOption "UCLIBC_HAS_XLOCALE" "${dst}"
;;
esac
# WCHAR support
- if [ "${CT_LIBC_UCLIBC_WCHAR}" = "y" ] ; then
- cat <<-ENDSED
- s/^.*UCLIBC_HAS_WCHAR.*/UCLIBC_HAS_WCHAR=y/
- ENDSED
+ if [ "${CT_LIBC_UCLIBC_WCHAR}" = "y" ]; then
+ CT_KconfigEnableOption "UCLIBC_HAS_WCHAR" "${dst}"
else
- cat <<-ENDSED
- s/^.*UCLIBC_HAS_WCHAR.*/UCLIBC_HAS_WCHAR=n/
- ENDSED
+ CT_KconfigDisableOption "UCLIBC_HAS_WCHAR" "${dst}"
fi
# Force on options needed for C++ if we'll be making a C++ compiler.
# I'm not sure locales are a requirement for doing C++... Are they?
if [ "${CT_CC_LANG_CXX}" = "y" ]; then
- cat <<-ENDSED
- s/^# DO_C99_MATH is not set/DO_C99_MATH=y/
- s/^# UCLIBC_HAS_GNU_GETOPT is not set/UCLIBC_HAS_GNU_GETOPT=y/
- ENDSED
+ CT_KconfigEnableOption "DO_C99_MATH" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_HAS_GNU_GETOPT" "${dst}"
+ fi
+
+ # Stack Smash Protection (SSP)
+ if [ "${CT_CC_GCC_LIBSSP}" = "y" ]; then
+ CT_KconfigEnableOption "UCLIBC_HAS_SSP" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_BUILD_SSP" "${dst}"
+ else
+ CT_KconfigDisableOption "UCLIBC_HAS_SSP" "${dst}"
+ CT_KconfigDisableOption "UCLIBC_BUILD_SSP" "${dst}"
fi
# Push the threading model
case "${CT_THREADS}:${CT_LIBC_UCLIBC_LNXTHRD}" in
none:)
- cat <<-ENDSED
- s/^UCLIBC_HAS_THREADS=y/# UCLIBC_HAS_THREADS is not set/
- s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
- s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
- s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
- ENDSED
+ CT_KconfigDisableOption "UCLIBC_HAS_THREADS" "${dst}"
+ CT_KconfigDisableOption "LINUXTHREADS_OLD" "${dst}"
+ CT_KconfigDisableOption "LINUXTHREADS_NEW" "${dst}"
+ CT_KconfigDisableOption "UCLIBC_HAS_THREADS_NATIVE" "${dst}"
;;
linuxthreads:old)
- cat <<-ENDSED
- s/^# UCLIBC_HAS_THREADS is not set/UCLIBC_HAS_THREADS=y/
- s/^# LINUXTHREADS_OLD is not set/LINUXTHREADS_OLD=y/
- s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
- s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
- ENDSED
+ CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
+ CT_KconfigEnableOption "LINUXTHREADS_OLD" "${dst}"
+ CT_KconfigDisableOption "LINUXTHREADS_NEW" "${dst}"
+ CT_KconfigDisableOption "UCLIBC_HAS_THREADS_NATIVE" "${dst}"
;;
linuxthreads:new)
- cat <<-ENDSED
- s/^# UCLIBC_HAS_THREADS is not set/UCLIBC_HAS_THREADS=y/
- s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
- s/^# LINUXTHREADS_NEW is not set/LINUXTHREADS_NEW=y/
- s/^UCLIBC_HAS_THREADS_NATIVE=y/# UCLIBC_HAS_THREADS_NATIVE is not set/
- ENDSED
+ CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
+ CT_KconfigDisableOption "LINUXTHREADS_OLD" "${dst}"
+ CT_KconfigEnableOption "LINUXTHREADS_NEW" "${dst}"
+ CT_KconfigDisableOption "UCLIBC_HAS_THREADS_NATIVE" "${dst}"
;;
nptl:)
- cat <<-ENDSED
- s/^HAS_NO_THREADS=y/# HAS_NO_THREADS is not set/
- s/^UCLIBC_HAS_THREADS=y/# UCLIBC_HAS_THREADS is not set/
- s/^LINUXTHREADS_OLD=y/# LINUXTHREADS_OLD is not set/
- s/^LINUXTHREADS_NEW=y/# LINUXTHREADS_NEW is not set/
- s/^# UCLIBC_HAS_THREADS_NATIVE is not set/UCLIBC_HAS_THREADS_NATIVE=y/
- ENDSED
+ CT_KconfigEnableOption "UCLIBC_HAS_THREADS" "${dst}"
+ CT_KconfigDisableOption "LINUXTHREADS_OLD" "${dst}"
+ CT_KconfigDisableOption "LINUXTHREADS_NEW" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_HAS_THREADS_NATIVE" "${dst}"
;;
*)
CT_Abort "Incorrect thread settings: CT_THREADS='${CT_THREAD}' CT_LIBC_UCLIBC_LNXTHRD='${CT_LIBC_UCLIBC_LNXTHRD}'"
@@ -500,58 +476,43 @@ mungeuClibcConfig() {
esac
# Always build the libpthread_db
- cat <<-ENDSED
- s/^# PTHREADS_DEBUG_SUPPORT is not set.*/PTHREADS_DEBUG_SUPPORT=y/
- ENDSED
+ CT_KconfigEnableOption "PTHREADS_DEBUG_SUPPORT" "${dst}"
# Force on debug options if asked for
case "${CT_LIBC_UCLIBC_DEBUG_LEVEL}" in
- 0)
- cat <<-ENDSED
- s/^DODEBUG=y/# DODEBUG is not set/
- s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
- s/^DOASSERTS=y/# DOASSERTS is not set/
- s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
- s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
- s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
- ENDSED
- ;;
- 1)
- cat <<-ENDSED
- s/^# DODEBUG is not set.*/DODEBUG=y/
- s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
- s/^DOASSERTS=y/# DOASSERTS is not set/
- s/^SUPPORT_LD_DEBUG=y/# SUPPORT_LD_DEBUG is not set/
- s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
- s/^UCLIBC_MALLOC_DEBUGGING=y/# UCLIBC_MALLOC_DEBUGGING is not set/
- ENDSED
- ;;
- 2)
- cat <<-ENDSED
- s/^# DODEBUG is not set.*/DODEBUG=y/
- s/^DODEBUG_PT=y/# DODEBUG_PT is not set/
- s/^# DOASSERTS is not set.*/DOASSERTS=y/
- s/^# SUPPORT_LD_DEBUG is not set.*/SUPPORT_LD_DEBUG=y/
- s/^SUPPORT_LD_DEBUG_EARLY=y/# SUPPORT_LD_DEBUG_EARLY is not set/
- s/^# UCLIBC_MALLOC_DEBUGGING is not set/UCLIBC_MALLOC_DEBUGGING=y/
- ENDSED
- ;;
- 3)
- cat <<-ENDSED
- s/^# DODEBUG is not set.*/DODEBUG=y/
- s/^# DODEBUG_PT is not set.*/DODEBUG_PT=y/
- s/^# DOASSERTS is not set.*/DOASSERTS=y/
- s/^# SUPPORT_LD_DEBUG is not set.*/SUPPORT_LD_DEBUG=y/
- s/^# SUPPORT_LD_DEBUG_EARLY is not set.*/SUPPORT_LD_DEBUG_EARLY=y/
- s/^# UCLIBC_MALLOC_DEBUGGING is not set/UCLIBC_MALLOC_DEBUGGING=y/
- ENDSED
- ;;
+ 0)
+ CT_KconfigDisableOption "DODEBUG" "${dst}"
+ CT_KconfigDisableOption "DODEBUG_PT" "${dst}"
+ CT_KconfigDisableOption "DOASSERTS" "${dst}"
+ CT_KconfigDisableOption "SUPPORT_LD_DEBUG" "${dst}"
+ CT_KconfigDisableOption "SUPPORT_LD_DEBUG_EARLY" "${dst}"
+ CT_KconfigDisableOption "UCLIBC_MALLOC_DEBUGGING" "${dst}"
+ ;;
+ 1)
+ CT_KconfigEnableOption "DODEBUG" "${dst}"
+ CT_KconfigDisableOption "DODEBUG_PT" "${dst}"
+ CT_KconfigDisableOption "DOASSERTS" "${dst}"
+ CT_KconfigDisableOption "SUPPORT_LD_DEBUG" "${dst}"
+ CT_KconfigDisableOption "SUPPORT_LD_DEBUG_EARLY" "${dst}"
+ CT_KconfigDisableOption "UCLIBC_MALLOC_DEBUGGING" "${dst}"
+ ;;
+ 2)
+ CT_KconfigEnableOption "DODEBUG" "${dst}"
+ CT_KconfigDisableOption "DODEBUG_PT" "${dst}"
+ CT_KconfigEnableOption "DOASSERTS" "${dst}"
+ CT_KconfigEnableOption "SUPPORT_LD_DEBUG" "${dst}"
+ CT_KconfigDisableOption "SUPPORT_LD_DEBUG_EARLY" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_MALLOC_DEBUGGING" "${dst}"
+ ;;
+ 3)
+ CT_KconfigEnableOption "DODEBUG" "${dst}"
+ CT_KconfigEnableOption "DODEBUG_PT" "${dst}"
+ CT_KconfigEnableOption "DOASSERTS" "${dst}"
+ CT_KconfigEnableOption "SUPPORT_LD_DEBUG" "${dst}"
+ CT_KconfigEnableOption "SUPPORT_LD_DEBUG_EARLY" "${dst}"
+ CT_KconfigEnableOption "UCLIBC_MALLOC_DEBUGGING" "${dst}"
+ ;;
esac
-
- # And now, this is the end
- ) >>"${munge_file}"
-
- sed -r -f "${munge_file}" "${src_config_file}" >"${dst_config_file}"
}
do_libc_post_cc() {
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index a3514cb..b9b8aee 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -458,7 +458,7 @@ if [ -z "${CT_RESTART}" ]; then
CT_TestAndAbort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!" "${CT_CC_LANG_JAVA}" = "y"
;;
strip)
- CT_TestAndAbort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!" "${CT_STRIP_ALL_TOOLCHAIN_EXECUTABLES}" = "y"
+ CT_TestAndAbort "Missing: '${t}${tool}${!s}' or '${t}${tool}' or '${tool}' : either needed!" "${CT_STRIP_HOST_TOOLCHAIN_EXECUTABLES}" = "y"
;;
# If any other is missing, only warn at low level
*)
diff --git a/scripts/functions b/scripts/functions
index 2261b8d..f09df54 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -842,7 +842,7 @@ CT_GetGit() {
local url="${3}"
local _out_cset="${4}"
- local ref=$(echo "${cset_or_ref}" | sed -n 's/^ref=\(.*\)/\1/p')
+ local ref=$(echo "${cset_or_ref}" | ${sed} -n 's/^ref=\(.*\)/\1/p')
if [ -n "$ref" ]; then
local matches=$(git ls-remote --exit-code "$url" --refs "${ref}")
local result=$?
@@ -1428,3 +1428,51 @@ CT_DoLoadState(){
exec >>"${tmp_log_file}"
rm -f "${state_dir}/tail.log"
}
+
+# This function sets a kconfig option to a specific value in a .config file
+# Usage: CT_KconfigSetOption <option> <value> <file>
+CT_KconfigSetOption() {
+ option="$1"
+ value="$2"
+ file="$3"
+
+ ${grep} -E -q "^${option}=.*" "${file}" && \
+ ${sed} -i -r -e "s;^${option}=.*$;${option}=${value};" "${file}" || \
+ ${grep} -E -q "^# ${option} is not set$" "${file}" && \
+ ${sed} -i -r -e "s;^# ${option} is not set$;${option}=${value};" "${file}" || \
+ echo "${option}=${value}" >> "${file}"
+}
+
+# This function enables a kconfig option to '=y' in a .config file
+# Usage: CT_KconfigEnableOption <option> <file>
+CT_KconfigEnableOption() {
+ option="$1"
+ file="$2"
+
+ CT_KconfigSetOption "${option}" "y" "${file}"
+}
+
+# This function disables a kconfig option in a .config file
+# Usage: CT_KconfigDisableOption <option> <file>
+CT_KconfigDisableOption() {
+ option="${1}"
+ file="${2}"
+
+ ${grep} -E -q "^# ${option} is not set$" "${file}" || \
+ ${grep} -E -q "^${option}=.*$" "${file}" && \
+ ${sed} -i -r -e "s;^${option}=.*$;# ${option} is not set;" "${file}" || \
+ echo "# ${option} is not set" >> "${file}"
+}
+
+# This function deletes a kconfig option in a .config file, no matter if it
+# is set or commented out.
+# Usage: CT_KconfigDeleteOption <option> <file>
+CT_KconfigDeleteOption() {
+ option="${1}"
+ file="${2}"
+
+ ${grep} -E -q "^# ${option} is not set$" "${file}" && \
+ ${sed} -i -r -e "/^# ${option} is not set$/d" "${file}" || \
+ ${grep} -E -q "^${option}=.*$" "${file}" && \
+ ${sed} -i -r -e "/^${option}=.*$/d" "${file}" || true
+}