summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile.in144
-rw-r--r--TODO2
-rwxr-xr-xbootstrap3
-rw-r--r--config/arch/msp430.in8
-rw-r--r--config/backend.in26
-rw-r--r--config/binutils.in4
-rw-r--r--config/binutils/binutils.in1
-rw-r--r--config/cc.in2
-rw-r--r--config/cc/gcc.in30
-rw-r--r--config/cc/gcc.in.212
-rw-r--r--config/companion_tools.in2
-rw-r--r--config/config.in1
-rw-r--r--config/config.mk114
-rw-r--r--config/configure.in.in46
-rw-r--r--config/debug.in2
-rw-r--r--config/debug/duma.in2
-rw-r--r--config/debug/gdb.in18
-rw-r--r--config/debug/gdb.in.native3
-rw-r--r--config/debug/ltrace.in3
-rw-r--r--config/debug/strace.in2
-rw-r--r--config/global/build-behave.in19
-rw-r--r--config/global/ct-behave.in1
-rw-r--r--config/global/paths.in14
-rw-r--r--config/kernel.in4
-rw-r--r--config/kernel/linux.in37
-rw-r--r--config/libc.in4
-rw-r--r--config/libc/bionic.in187
-rw-r--r--config/libc/mingw.in8
-rw-r--r--config/libc/newlib.in4
-rw-r--r--config/libc/uClibc.in12
-rw-r--r--config/target.in12
-rw-r--r--config/toolchain.in4
-rw-r--r--config/versions/autoconf.in103
-rw-r--r--config/versions/automake.in114
-rw-r--r--config/versions/avr-libc.in108
-rw-r--r--config/versions/binutils.in298
-rw-r--r--config/versions/bionic.in93
-rw-r--r--config/versions/cloog.in127
-rw-r--r--config/versions/duma.in99
-rw-r--r--config/versions/elf2flt.in64
-rw-r--r--config/versions/expat.in104
-rw-r--r--config/versions/gcc.in436
-rw-r--r--config/versions/gdb.in502
-rw-r--r--config/versions/gettext.in104
-rw-r--r--config/versions/glibc-ports.in105
-rw-r--r--config/versions/glibc.in413
-rw-r--r--config/versions/gmp.in171
-rw-r--r--config/versions/isl.in174
-rw-r--r--config/versions/libelf.in73
-rw-r--r--config/versions/libiconv.in104
-rw-r--r--config/versions/libtool.in99
-rw-r--r--config/versions/linux.in280
-rw-r--r--config/versions/ltrace.in104
-rw-r--r--config/versions/m4.in109
-rw-r--r--config/versions/make.in114
-rw-r--r--config/versions/mingw-w64.in168
-rw-r--r--config/versions/mpc.in134
-rw-r--r--config/versions/mpfr.in144
-rw-r--r--config/versions/musl.in104
-rw-r--r--config/versions/ncurses.in68
-rw-r--r--config/versions/newlib.in377
-rw-r--r--config/versions/strace.in163
-rw-r--r--config/versions/uClibc-ng.in316
-rw-r--r--config/versions/zlib.in99
-rw-r--r--configure.ac9
-rw-r--r--ct-ng.in1
-rw-r--r--kconfig/Makefile44
-rw-r--r--kconfig/kconfig.mk20
-rwxr-xr-xmaintainer/gen-kconfig.sh (renamed from scripts/gen_in_frags.sh)83
-rw-r--r--patches/gcc/4.8.5/111-alpha-bad-eh_frame.patch13
-rw-r--r--patches/gcc/4.8.5/874-gcc-xtensa-fix-fprintf-format-specifiers.patch73
-rw-r--r--patches/gcc/4.9.4/1100-msp430-string-literals.patch27
-rw-r--r--patches/gcc/4.9.4/111-alpha-bad-eh_frame.patch13
-rw-r--r--patches/gcc/4.9.4/875-gcc-xtensa-fix-fprintf-format-specifiers.patch73
-rw-r--r--patches/gcc/5.4.0/1100-msp430-string-literals.patch81
-rw-r--r--patches/gcc/5.4.0/111-alpha-bad-eh_frame.patch13
-rw-r--r--patches/gcc/5.4.0/879-gcc-xtensa-fix-fprintf-format-specifiers.patch74
-rw-r--r--patches/gcc/6.3.0/1100-ubsan-fix-check-empty-string.patch28
-rw-r--r--patches/gcc/6.3.0/111-alpha-bad-eh_frame.patch13
-rw-r--r--patches/gcc/6.3.0/873-gcc-xtensa-fix-fprintf-format-specifiers.patch74
-rw-r--r--patches/gcc/6.3.0/951-bionic-ndk.patch58
-rw-r--r--patches/gcc/6.3.0/952-bionic-errno.patch19
-rw-r--r--patches/gcc/6.3.0/970-crystax.patch551
-rw-r--r--patches/gcc/6.3.0/971-crystax.patch25
-rw-r--r--patches/gcc/6.3.0/972-crystax.patch302
-rw-r--r--patches/gcc/6.3.0/973-crystax.patch20
-rw-r--r--patches/gcc/6.3.0/974-crystax.patch24
-rw-r--r--patches/gcc/6.3.0/975-crystax.patch31
-rw-r--r--patches/gcc/6.3.0/976-crystax.patch21
-rw-r--r--patches/gcc/6.3.0/977-crystax.patch33
-rw-r--r--patches/gcc/7.1.0/100-uclibc-conf.patch (renamed from patches/gcc/linaro-6.3-2017.02/100-uclibc-conf.patch)0
-rw-r--r--patches/gcc/7.1.0/1000-libtool-leave-framework-alone.patch (renamed from patches/gcc/linaro-6.3-2017.02/1000-libtool-leave-framework-alone.patch)0
-rw-r--r--patches/gcc/7.1.0/111-alpha-bad-eh_frame.patch13
-rw-r--r--patches/gcc/7.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch (renamed from patches/gcc/linaro-6.3-2017.02/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch)0
-rw-r--r--patches/gcc/7.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch (renamed from patches/gcc/linaro-6.3-2017.02/380-gcc-plugin-POSIX-include-sys-select-h.patch)0
-rw-r--r--patches/gcc/7.1.0/810-arm-softfloat-libgcc.patch (renamed from patches/gcc/linaro-6.3-2017.02/810-arm-softfloat-libgcc.patch)0
-rw-r--r--patches/gcc/7.1.0/860-cilk-wchar.patch (renamed from patches/gcc/linaro-6.3-2017.02/860-cilk-wchar.patch)0
-rw-r--r--patches/gcc/7.1.0/870-gcc-xtensa-fix-fprintf-format-specifiers.patch74
-rw-r--r--patches/gcc/7.1.0/891-fix-m68k-uclinux.patch (renamed from patches/gcc/linaro-6.3-2017.02/891-fix-m68k-uclinux.patch)0
-rw-r--r--patches/gcc/7.1.0/900-libgfortran-missing-include.patch (renamed from patches/gcc/linaro-6.3-2017.02/900-libgfortran-missing-include.patch)0
-rw-r--r--patches/gcc/7.1.0/910-nios2-bad-multilib-default.patch (renamed from patches/gcc/linaro-6.3-2017.02/910-nios2-bad-multilib-default.patch)0
-rw-r--r--patches/gcc/7.1.0/930-libgcc-disable-split-stack-nothreads.patch (renamed from patches/gcc/linaro-6.3-2017.02/930-libgcc-disable-split-stack-nothreads.patch)0
-rw-r--r--patches/gcc/7.1.0/951-bionic-ndk.patch58
-rw-r--r--patches/gcc/7.1.0/952-bionic-errno.patch19
-rw-r--r--patches/gcc/7.1.0/970-crystax.patch553
-rw-r--r--patches/gcc/7.1.0/971-crystax.patch25
-rw-r--r--patches/gcc/7.1.0/972-crystax.patch302
-rw-r--r--patches/gcc/7.1.0/973-crystax.patch20
-rw-r--r--patches/gcc/7.1.0/974-crystax.patch24
-rw-r--r--patches/gcc/7.1.0/975-crystax.patch31
-rw-r--r--patches/gcc/7.1.0/976-crystax.patch21
-rw-r--r--patches/gcc/7.1.0/977-crystax.patch33
-rw-r--r--patches/gcc/linaro-4.8-2015.06/874-gcc-xtensa-fix-fprintf-format-specifiers.patch73
-rw-r--r--patches/gcc/linaro-4.9-2017.01/1100-msp430-string-literals.patch27
-rw-r--r--patches/gcc/linaro-4.9-2017.01/875-gcc-xtensa-fix-fprintf-format-specifiers.patch73
-rw-r--r--patches/gcc/linaro-5.4-2017.05/100-uclibc-conf.patch (renamed from patches/gcc/linaro-5.4-2017.01/100-uclibc-conf.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/1000-libtool-leave-framework-alone.patch (renamed from patches/gcc/linaro-5.4-2017.01/1000-libtool-leave-framework-alone.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/110-xtensa-implement-trap-pattern.patch (renamed from patches/gcc/linaro-5.4-2017.01/110-xtensa-implement-trap-pattern.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/1100-msp430-string-literals.patch81
-rw-r--r--patches/gcc/linaro-5.4-2017.05/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch (renamed from patches/gcc/linaro-5.4-2017.01/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/301-missing-execinfo_h.patch (renamed from patches/gcc/linaro-6.3-2017.02/301-missing-execinfo_h.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch (renamed from patches/gcc/linaro-5.4-2017.01/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/380-gcc-plugin-POSIX-include-sys-select-h.patch (renamed from patches/gcc/linaro-5.4-2017.01/380-gcc-plugin-POSIX-include-sys-select-h.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/810-arm-softfloat-libgcc.patch (renamed from patches/gcc/linaro-5.4-2017.01/810-arm-softfloat-libgcc.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/830-arm_unbreak_armv4t.patch (renamed from patches/gcc/linaro-6.3-2017.02/830-arm_unbreak_armv4t.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/840-microblaze-enable-dwarf-eh-support.patch (renamed from patches/gcc/linaro-5.4-2017.01/840-microblaze-enable-dwarf-eh-support.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/850-libstdcxx-uclibc-c99.patch (renamed from patches/gcc/linaro-5.4-2017.01/850-libstdcxx-uclibc-c99.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/860-cilk-wchar.patch (renamed from patches/gcc/linaro-5.4-2017.01/860-cilk-wchar.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/870-xtensa-add-mauto-litpools-option.patch (renamed from patches/gcc/linaro-5.4-2017.01/870-xtensa-add-mauto-litpools-option.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/871-xtensa-reimplement-register-spilling.patch (renamed from patches/gcc/linaro-5.4-2017.01/871-xtensa-reimplement-register-spilling.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch (renamed from patches/gcc/linaro-5.4-2017.01/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/873-xtensa-fix-_Unwind_GetCFA.patch (renamed from patches/gcc/linaro-5.4-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/874-xtensa-add-uclinux-support.patch (renamed from patches/gcc/linaro-5.4-2017.01/874-xtensa-add-uclinux-support.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch (renamed from patches/gcc/linaro-5.4-2017.01/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/876-xtensa-fix-libgcc-build-with-text-section-literals.patch (renamed from patches/gcc/linaro-5.4-2017.01/876-xtensa-fix-libgcc-build-with-text-section-literals.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch (renamed from patches/gcc/linaro-5.4-2017.01/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/878-xtensa-Fix-PR-target-78603.patch (renamed from patches/gcc/linaro-5.4-2017.01/878-xtensa-Fix-PR-target-78603.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/879-gcc-xtensa-fix-fprintf-format-specifiers.patch74
-rw-r--r--patches/gcc/linaro-5.4-2017.05/890-fix-m68k-compile.patch (renamed from patches/gcc/linaro-6.3-2017.02/890-fix-m68k-compile.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/891-fix-m68k-uclinux.patch (renamed from patches/gcc/linaro-5.4-2017.01/891-fix-m68k-uclinux.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/892-microblaze-uclibc.patch (renamed from patches/gcc/linaro-5.4-2017.01/892-microblaze-uclibc.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/902-unwind-fix-for-musl.patch (renamed from patches/gcc/linaro-5.4-2017.01/902-unwind-fix-for-musl.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/910-nios2-bad-multilib-default.patch (renamed from patches/gcc/linaro-5.4-2017.01/910-nios2-bad-multilib-default.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/930-libgcc-disable-split-stack-nothreads.patch (renamed from patches/gcc/linaro-5.4-2017.01/930-libgcc-disable-split-stack-nothreads.patch)0
-rw-r--r--patches/gcc/linaro-5.4-2017.05/940-uclinux-enable-threads.patch (renamed from patches/gcc/linaro-6.3-2017.02/940-uclinux-enable-threads.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/100-uclibc-conf.patch15
-rw-r--r--patches/gcc/linaro-6.3-2017.05/1000-libtool-leave-framework-alone.patch14
-rw-r--r--patches/gcc/linaro-6.3-2017.05/301-missing-execinfo_h.patch (renamed from patches/gcc/linaro-5.4-2017.01/301-missing-execinfo_h.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch160
-rw-r--r--patches/gcc/linaro-6.3-2017.05/380-gcc-plugin-POSIX-include-sys-select-h.patch11
-rw-r--r--patches/gcc/linaro-6.3-2017.05/810-arm-softfloat-libgcc.patch30
-rw-r--r--patches/gcc/linaro-6.3-2017.05/830-arm_unbreak_armv4t.patch (renamed from patches/gcc/linaro-5.4-2017.01/830-arm_unbreak_armv4t.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/860-cilk-wchar.patch56
-rw-r--r--patches/gcc/linaro-6.3-2017.05/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch (renamed from patches/gcc/linaro-6.3-2017.02/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/871-xtensa-Fix-PR-target-78118.patch (renamed from patches/gcc/linaro-6.3-2017.02/871-xtensa-Fix-PR-target-78118.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/872-xtensa-Fix-PR-target-78603.patch (renamed from patches/gcc/linaro-6.3-2017.02/872-xtensa-Fix-PR-target-78603.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/873-gcc-xtensa-fix-fprintf-format-specifiers.patch74
-rw-r--r--patches/gcc/linaro-6.3-2017.05/890-fix-m68k-compile.patch (renamed from patches/gcc/linaro-5.4-2017.01/890-fix-m68k-compile.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/891-fix-m68k-uclinux.patch18
-rw-r--r--patches/gcc/linaro-6.3-2017.05/892-libgcc-mkmap-symver-support-skip_underscore.patch (renamed from patches/gcc/linaro-6.3-2017.02/892-libgcc-mkmap-symver-support-skip_underscore.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch (renamed from patches/gcc/linaro-6.3-2017.02/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch (renamed from patches/gcc/linaro-6.3-2017.02/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/895-bfin-define-REENTRANT.patch (renamed from patches/gcc/linaro-6.3-2017.02/895-bfin-define-REENTRANT.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/900-libgfortran-missing-include.patch10
-rw-r--r--patches/gcc/linaro-6.3-2017.05/910-nios2-bad-multilib-default.patch28
-rw-r--r--patches/gcc/linaro-6.3-2017.05/930-libgcc-disable-split-stack-nothreads.patch14
-rw-r--r--patches/gcc/linaro-6.3-2017.05/940-uclinux-enable-threads.patch (renamed from patches/gcc/linaro-5.4-2017.01/940-uclinux-enable-threads.patch)0
-rw-r--r--patches/gcc/linaro-6.3-2017.05/951-bionic-ndk.patch58
-rw-r--r--patches/gcc/linaro-6.3-2017.05/952-bionic-errno.patch19
-rw-r--r--patches/gcc/linaro-6.3-2017.05/970-crystax.patch551
-rw-r--r--patches/gcc/linaro-6.3-2017.05/971-crystax.patch25
-rw-r--r--patches/gcc/linaro-6.3-2017.05/972-crystax.patch302
-rw-r--r--patches/gcc/linaro-6.3-2017.05/973-crystax.patch20
-rw-r--r--patches/gcc/linaro-6.3-2017.05/974-crystax.patch24
-rw-r--r--patches/gcc/linaro-6.3-2017.05/975-crystax.patch31
-rw-r--r--patches/gcc/linaro-6.3-2017.05/976-crystax.patch21
-rw-r--r--patches/gcc/linaro-6.3-2017.05/977-crystax.patch33
-rw-r--r--patches/gdb/7.12.1/200-allow-android.patch42
-rw-r--r--patches/gdb/8.0/100-musl_fix.patch28
-rw-r--r--patches/gdb/8.0/101-uclibc-no-gettimeofday-clobber.patch30
-rw-r--r--patches/gdb/8.0/111-xtensa-make-sure-ar_base-is-initialized.patch35
-rw-r--r--patches/gdb/8.0/112-WIP-end-of-prologue-detection-hack.patch31
-rw-r--r--patches/gdb/8.0/200-allow-android.patch42
-rw-r--r--patches/glibc/2.12.1/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.12.1/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.12.2/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.12.2/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.13/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.13/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.14.1/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.14.1/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.14/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.14/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.15/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.15/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.16.0/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.16.0/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.17/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.17/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.18/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.18/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.19/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.19/930-explicit-boolean.patch33
-rw-r--r--patches/glibc/2.19/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.20/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.20/930-explicit-boolean.patch33
-rw-r--r--patches/glibc/2.20/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.21/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.21/930-explicit-boolean.patch33
-rw-r--r--patches/glibc/2.21/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.21/950-dlclose-assert.patch40
-rw-r--r--patches/glibc/2.22/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.22/930-explicit-boolean.patch33
-rw-r--r--patches/glibc/2.22/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.23/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.23/930-explicit-boolean.patch33
-rw-r--r--patches/glibc/2.23/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.24/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/2.24/930-explicit-boolean.patch33
-rw-r--r--patches/glibc/2.24/940-nis-bogus-conditional.patch62
-rw-r--r--patches/glibc/2.25/960-sh4-trap-divdi3.patch340
-rw-r--r--patches/glibc/2.25/961-sparc-extra-plt-call.patch65
-rw-r--r--patches/glibc/linaro-2.20-2014.11/920-fix-rpc_parse-format.patch60
-rw-r--r--patches/glibc/linaro-2.20-2014.11/930-explicit-boolean.patch33
-rw-r--r--patches/glibc/linaro-2.20-2014.11/940-nis-bogus-conditional.patch62
-rw-r--r--patches/mingw-w64/v5.0.2/100-mingw64-malloc.patch55
-rw-r--r--patches/newlib/2.5.0.20170323/110-fix-eabihf.patch24
-rw-r--r--patches/newlib/2.5.0.20170519/100-fix-unaligned-access-memcpy-m68k.patch (renamed from patches/newlib/2.5.0.20170323/100-fix-unaligned-access-memcpy-m68k.patch)0
-rw-r--r--patches/newlib/2.5.0.20170519/200-fix-mt-cflags.patch (renamed from patches/newlib/2.5.0.20170323/200-fix-mt-cflags.patch)0
-rw-r--r--patches/uClibc-ng/1.0.20/700-features.h-c11.patch61
-rw-r--r--patches/uClibc-ng/1.0.21/700-features.h-c11.patch61
-rw-r--r--patches/uClibc-ng/1.0.22/700-features.h-c11.patch61
-rw-r--r--patches/uClibc-ng/1.0.23/700-features.h-c11.patch61
-rw-r--r--patches/uClibc-ng/1.0.24/700-features.h-c11.patch61
-rw-r--r--patches/zlib/1.2.11/120-mingw-static-only.patch25
-rw-r--r--samples/aarch64-rpi3-linux-gnueabi/crosstool.config1
-rw-r--r--samples/aarch64-unknown-linux-android/crosstool.config11
-rw-r--r--samples/aarch64-unknown-linux-android/reported.by3
-rw-r--r--samples/aarch64-unknown-linux-gnueabi/crosstool.config1
-rw-r--r--samples/arm-cortex_a15-linux-gnueabihf/crosstool.config1
-rw-r--r--samples/arm-cortex_a8-linux-gnueabi/crosstool.config1
-rw-r--r--samples/arm-cortexa9_neon-linux-gnueabihf/crosstool.config1
-rw-r--r--samples/arm-unknown-linux-gnueabi/crosstool.config1
-rw-r--r--samples/armeb-unknown-linux-gnueabi/crosstool.config1
-rw-r--r--samples/armv6-rpi-linux-gnueabi/crosstool.config1
-rw-r--r--samples/armv7-rpi2-linux-gnueabihf/crosstool.config1
-rw-r--r--samples/armv8-rpi3-linux-gnueabihf/crosstool.config1
-rw-r--r--samples/i686-centos6-linux-gnu/crosstool.config1
-rw-r--r--samples/i686-centos7-linux-gnu/crosstool.config1
-rw-r--r--samples/i686-nptl-linux-gnu/crosstool.config1
-rw-r--r--samples/i686-ubuntu12.04-linux-gnu/crosstool.config1
-rw-r--r--samples/i686-ubuntu14.04-linux-gnu/crosstool.config1
-rw-r--r--samples/i686-ubuntu16.04-linux-gnu/crosstool.config1
-rw-r--r--samples/mips-ar2315-linux-gnu/crosstool.config1
-rw-r--r--samples/mips-malta-linux-gnu/crosstool.config1
-rw-r--r--samples/mipsel-multilib-linux-gnu/crosstool.config1
-rw-r--r--samples/mipsel-unknown-linux-gnu/crosstool.config1
-rw-r--r--samples/msp430-unknown-elf/crosstool.config2
-rw-r--r--samples/msp430-unknown-elf/reported.by3
-rw-r--r--samples/samples.mk14
-rw-r--r--samples/sparc-leon-linux-uclibc/crosstool.config3
-rw-r--r--samples/sparc-leon-linux-uclibc/uClibc.config5
-rw-r--r--samples/x86_64-centos6-linux-gnu/crosstool.config1
-rw-r--r--samples/x86_64-centos7-linux-gnu/crosstool.config1
-rw-r--r--samples/x86_64-multilib-linux-gnu/crosstool.config1
-rw-r--r--samples/x86_64-ubuntu12.04-linux-gnu/crosstool.config1
-rw-r--r--samples/x86_64-ubuntu14.04-linux-gnu/crosstool.config1
-rw-r--r--samples/x86_64-ubuntu16.04-linux-gnu/crosstool.config1
-rw-r--r--samples/x86_64-unknown-linux-gnu/crosstool.config1
-rw-r--r--samples/x86_64-w64-mingw32,arm-cortexa9_neon-linux-gnueabihf/crosstool.config1
-rw-r--r--samples/x86_64-w64-mingw32,x86_64-pc-linux-gnu/crosstool.config1
-rw-r--r--scripts/build/arch/arm.sh1
-rw-r--r--scripts/build/arch/mips.sh11
-rw-r--r--scripts/build/arch/msp430.sh5
-rw-r--r--scripts/build/cc/100-gcc.sh12
-rw-r--r--scripts/build/companion_libs/050-zlib.sh49
-rw-r--r--scripts/build/debug/300-gdb.sh9
-rw-r--r--scripts/build/libc/bionic.sh43
-rw-r--r--scripts/crosstool-NG.sh.in2
-rw-r--r--scripts/functions1
-rw-r--r--scripts/saveSample.sh.in2
-rwxr-xr-xscripts/showSamples.sh2
283 files changed, 13934 insertions, 460 deletions
diff --git a/.gitignore b/.gitignore
index daedcdd..1bdd197 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,7 +9,7 @@ config.status
!ct-ng.in
paths.*
!paths.in
-config.gen/
+config/gen/
.config
# Temporaries
diff --git a/Makefile.in b/Makefile.in
index 3d2c607..4980346 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -35,6 +35,12 @@ endif # No rR
endif # No -Rr
endif # No Rr
+# Helper: print abbreviation of the command by default, or full command
+# if doing 'make V=1'.
+__silent = $(if $(V),,@printf ' %-7s %s\n' '$1' '$(if $2,$2,$(strip $<))' && )
+__silent_rm = $(call __silent,RM,$1)rm -f $1
+__silent_rmdir = $(call __silent,RMDIR,$1)rm -rf $1
+
# Remove any suffix rules
.SUFFIXES:
@@ -83,9 +89,6 @@ export curses_hdr := @ac_ct_curses_hdr@
export gettext := @gettext@
export CPU_COUNT := @CPU_COUNT@
-# config options to push down to kconfig
-KCONFIG:= @kconfig_options@
-
###############################################################################
# Non-configure variables
MAN_SECTION := 1
@@ -98,7 +101,7 @@ PROG_NAME := $(shell echo 'ct-ng' |$(sed) -r -e '$(PROG_SED)' )
# Check if Makefile is up to date:
Makefile: Makefile.in
- @echo "$< did changed: you must re-run './configure'"
+ @echo "$< changed: you must re-run './configure'"
@false
# If installing with DESTDIR, check it's an absolute path
@@ -142,12 +145,11 @@ install: build real-install
clean: $(patsubst %,clean-%,$(TARGETS))
distclean: clean
- @echo " RM 'Makefile'"
- @rm -f Makefile
+ $(call __silent_rm,Makefile config/configure.in)
mrproper: distclean
- @echo " RM 'autostuff'"
- @ rm -rf autom4te.cache config.log config.status configure
+ $(call __silent_rmdir,autom4te.cache config/gen)
+ $(call __silent_rm,config.log config.status configure)
uninstall: real-uninstall
@@ -162,26 +164,25 @@ build-bin: $(PROG_NAME) \
scripts/crosstool-NG.sh \
scripts/saveSample.sh \
scripts/showConfig.sh
- @chmod 755 $^
+ $(call __silent,CHMOD,$^)chmod 755 $^
-build-lib: config/configure.in \
- paths.mk \
+build-lib: paths.mk \
paths.sh
build-lib-kconfig:
- @$(MAKE) -C kconfig
+ $(call __silent,ENTER,kconfig)$(MAKE) -C kconfig
+ $(call __silent,LEAVE,kconfig):
build-doc:
build-man: docs/$(PROG_NAME).1.gz
docs/$(PROG_NAME).1.gz: docs/$(PROG_NAME).1
- @echo " GZIP '$@'"
- @gzip -c9 $< >$@
+ $(call __silent,GZIP)gzip -c9 $< >$@
define sed_it
- @echo " SED '$@'"
- @$(sed) -r -e 's,@@CT_BINDIR@@,$(bindir),g;' \
+ $(call __silent,SED,$@)$(sed) -r \
+ -e 's,@@CT_BINDIR@@,$(bindir),g;' \
-e 's,@@CT_LIBDIR@@,$(libdir),g;' \
-e 's,@@CT_DOCDIR@@,$(docdir),g;' \
-e 's,@@CT_MANDIR@@,$(mandir),g;' \
@@ -212,27 +213,10 @@ __paths_vars = install bash awk grep make sed libtool \
# We create a script fragment that is parseable from inside a Makefile,
# and one from inside a shell script.
paths.mk: FORCE
- @echo " GEN '$@'"
- @{ $(foreach w,$(__paths_vars),$(if $($w),echo 'export $w=$(subst ','\'',$($w))';)) :; } >$@
+ $(call __silent,GEN,$@){ $(foreach w,$(__paths_vars),$(if $($w),echo 'export $w=$(subst ','\'',$($w))';)) :; } >$@
paths.sh: FORCE
- @echo " GEN '$@'"
- @{ $(foreach w,$(__paths_vars),$(if $($w),echo 'export $w="$(subst ','\'',$($w))"';)) :; } >$@
-
-config/configure.in: FORCE
- @echo " GEN '$@'"
- @{ printf "# Generated file, do not edit\n"; \
- printf "# Default values as found by ./configure\n"; \
- for var in $(KCONFIG); do \
- printf "\n"; \
- printf "config CONFIGURE_$${var%%=*}\n"; \
- if [ "$${var#*=}" = "y" ]; then \
- printf " def_bool y\n"; \
- else \
- printf " bool\n"; \
- fi; \
- done; \
- } >$@
+ $(call __silent,GEN,$@){ $(foreach w,$(__paths_vars),$(if $($w),echo 'export $w="$(subst ','\'',$($w))"';)) :; } >$@
FORCE:
@@ -240,33 +224,24 @@ FORCE:
# Clean rules
clean-bin:
- @echo " RM '$(PROG_NAME)'"
- @rm -f $(PROG_NAME)
- @echo " RM 'scripts/scripts.mk'"
- @rm -f scripts/scripts.mk
- @echo " RM 'scripts/crosstool-NG.sh'"
- @rm -f scripts/crosstool-NG.sh
- @echo " RM 'scripts/saveSample.sh'"
- @rm -f scripts/saveSample.sh
- @echo " RM 'scripts/showConfig.sh'"
- @rm -f scripts/showConfig.sh
+ $(call __silent_rm,$(PROG_NAME))
+ $(call __silent_rm,scripts/scripts.mk)
+ $(call __silent_rm,scripts/crosstool-NG.sh)
+ $(call __silent_rm,scripts/saveSample.sh)
+ $(call __silent_rm,scripts/showConfig.sh)
clean-lib:
- @echo " RM 'paths'"
- @rm -f paths.mk paths.sh
- @echo " RM 'config/configure.in'"
- @rm -f config/configure.in
+ $(call __silent_rm,paths.mk paths.sh)
clean-lib-kconfig:
- @$(MAKE) -C kconfig clean
+ $(call __silent,ENTER,kconfig)$(MAKE) -C kconfig clean
+ $(call __silent,LEAVE,kconfig):
clean-doc:
clean-man:
- @echo " RM 'docs/$(PROG_NAME).1'"
- @rm -f docs/$(PROG_NAME).1
- @echo " RM 'docs/$(PROG_NAME).1.gz'"
- @rm -f docs/$(PROG_NAME).1.gz
+ $(call __silent_rm,docs/$(PROG_NAME).1)
+ $(call __silent_rm,docs/$(PROG_NAME).1.gz)
#--------------------------------------
# Check for --local setup
@@ -287,8 +262,7 @@ else
real-install: $(patsubst %,install-%,$(TARGETS)) install-post
install-bin: $(DESTDIR)$(bindir)
- @echo " INST '$(PROG_NAME)'"
- @$(install) -m 755 $(PROG_NAME) "$(DESTDIR)$(bindir)/$(PROG_NAME)"
+ $(call __silent,INST,$(PROG_NAME))$(install) -m 755 $(PROG_NAME) "$(DESTDIR)$(bindir)/$(PROG_NAME)"
# If one is hacking crosstool-NG, the patch set might change between any two
# installations of the same VERSION, thus the patches must be removed prior
@@ -299,30 +273,22 @@ install-lib: $(DESTDIR)$(libdir) \
install-lib-samples
LIB_SUB_DIR := config contrib patches scripts
-$(patsubst %,install-lib-%-copy,$(LIB_SUB_DIR)): $(DESTDIR)$(libdir)
- @echo " INSTDIR '$(patsubst install-lib-%-copy,%,$(@))/'"
- @tar cf - --exclude='*.sh.in' $(patsubst install-lib-%-copy,%,$(@)) \
+$(patsubst %,install-lib-%-copy,$(LIB_SUB_DIR)): install-lib-%-copy: $(DESTDIR)$(libdir)
+ $(call __silent,INSTDIR,$*)tar cf - --exclude='*.sh.in' --exclude='*.in.in' $* \
|(cd "$(DESTDIR)$(libdir)"; tar xf -)
-# We need at least one command to make this rule kick-in.
-install-lib-%: install-lib-%-copy
- @true
-
-install-lib-scripts: install-lib-scripts-copy
- @chmod a+x $(DESTDIR)$(libdir)/scripts/crosstool-NG.sh
- @chmod a+x $(DESTDIR)$(libdir)/scripts/saveSample.sh
+# Dependency-only by default.
+$(patsubst %,install-lib-%,$(LIB_SUB_DIR)): install-lib-%: install-lib-%-copy
install-lib-main: $(DESTDIR)$(libdir) $(patsubst %,install-lib-%,$(LIB_SUB_DIR))
- @echo " INST 'steps.mk'"
- @$(install) -m 644 steps.mk "$(DESTDIR)$(libdir)/steps.mk"
- @echo " INST 'paths'"
- @$(install) -m 644 paths.mk paths.sh "$(DESTDIR)$(libdir)"
+ $(call __silent,INST,steps.mk)$(install) -m 644 steps.mk "$(DESTDIR)$(libdir)"
+ $(call __silent,INST,paths.mk)$(install) -m 644 paths.mk "$(DESTDIR)$(libdir)"
+ $(call __silent,INST,paths.sh)$(install) -m 644 paths.sh "$(DESTDIR)$(libdir)"
# Samples need a little love:
# - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
install-lib-samples: $(DESTDIR)$(libdir) install-lib-main
- @echo " INSTDIR 'samples/'"
- @for samp_dir in samples/*/; do \
+ $(call __silent,INSTDIR,samples)for samp_dir in samples/*/; do \
mkdir -p "$(DESTDIR)$(libdir)/$${samp_dir}"; \
$(sed) -r -e 's:\$$\{CT_TOP_DIR\}:\$$\{CT_LIB_DIR\}:;' \
-e 's:^(CT_WORK_DIR)=.*:\1="\$${CT_TOP_DIR}/.build":;' \
@@ -341,13 +307,11 @@ install-lib-samples: $(DESTDIR)$(libdir) install-lib-main
done
@$(install) -m 644 samples/samples.mk "$(DESTDIR)$(libdir)/samples/samples.mk"
-KCONFIG_FILES := conf mconf nconf kconfig.mk
install-lib-kconfig: $(DESTDIR)$(libdir) install-lib-main
- @echo " INST 'kconfig/'"
- @mkdir -p "$(DESTDIR)$(libdir)/kconfig"
- @for f in $(KCONFIG_FILES); do \
- install "kconfig/$${f}" "$(DESTDIR)$(libdir)/kconfig/$${f}"; \
- done
+ $(call __silent,MKDIR,$@)$(install) -m 755 -d "$(DESTDIR)$(libdir)/kconfig"
+ $(call __silent,ENTER,kconfig)$(MAKE) -C kconfig install \
+ DESTDIR=$(DESTDIR)$(libdir)/kconfig
+ $(call __silent,LEAVE,kconfig):
install-doc: install-doc-$(if $(wildcard docs/MANUAL_ONLINE),message,real)
@@ -358,20 +322,16 @@ install-doc-message:
@echo " http://crosstool-ng.github.io/docs"
@echo "********************************************************************"
-
install-doc-real: $(DESTDIR)$(docdir)
- @echo " INST 'docs/manual/*.md'"
- @for doc_file in docs/manual/*.md; do \
+ $(call __silent,INST,docs)for doc_file in docs/manual/*.md; do \
$(install) -m 644 "$${doc_file}" "$(DESTDIR)$(docdir)"; \
- done
+ done
install-man: $(DESTDIR)$(mandir)$(MAN_SUBDIR)
- @echo " INST '$(PROG_NAME).1.gz'"
- @$(install) -m 644 docs/$(PROG_NAME).1.gz "$(DESTDIR)$(mandir)$(MAN_SUBDIR)"
+ $(call __silent,INST,$(PROG_NAME).1.gz)$(install) -m 644 docs/$(PROG_NAME).1.gz "$(DESTDIR)$(mandir)$(MAN_SUBDIR)"
$(sort $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(docdir) $(DESTDIR)$(mandir)$(MAN_SUBDIR)):
- @echo " MKDIR '$@/'"
- @$(install) -m 755 -d "$@"
+ $(call __silent,MKDIR,$@)$(install) -m 755 -d "$@"
install-post:
@echo
@@ -384,20 +344,16 @@ install-post:
real-uninstall: $(patsubst %,uninstall-%,$(filter-out lib-kconfig,$(TARGETS)))
uninstall-bin:
- @echo " RM '$(DESTDIR)$(bindir)/$(PROG_NAME)'"
- @rm -f "$(DESTDIR)$(bindir)/$(PROG_NAME)"
+ $(call __silent_rm,$(DESTDIR)$(bindir)/$(PROG_NAME))
uninstall-lib:
- @echo " RMDIR '$(DESTDIR)$(libdir)/'"
- @rm -rf "$(DESTDIR)$(libdir)"
+ $(call __silent_rmdir,$(DESTDIR)$(libdir))
uninstall-doc:
- @echo " RMDIR '$(DESTDIR)$(docdir)/'"
- @rm -rf "$(DESTDIR)$(docdir)"
+ $(call __silent_rmdir,$(DESTDIR)$(docdir))
uninstall-man:
- @echo " RM '$(DESTDIR)$(mandir)$(MAN_SUBDIR)/$(PROG_NAME).1.gz'"
- @rm -f "$(DESTDIR)$(mandir)$(MAN_SUBDIR)/$(PROG_NAME).1"{,.gz}
+ $(call __silent_rm,$(DESTDIR)$(mandir)$(MAN_SUBDIR)/$(PROG_NAME).1.gz)
endif # Not --local
diff --git a/TODO b/TODO
index 06f353b..58694c2 100644
--- a/TODO
+++ b/TODO
@@ -2,6 +2,7 @@ A (slightly) ordered set of tasks for crosstool-NG. Written in a cryptic languag
-- Alexey Neyman (@stilor)
+[ ] arm_neon.h - offer as a companion "library" for the target
[ ] FreeBSD
[ ] Use 'cc' rather than 'gcc' on the host
[ ] Detect in configure what the default value is
@@ -46,7 +47,6 @@ A (slightly) ordered set of tasks for crosstool-NG. Written in a cryptic languag
[ ] add passthrough to configure, for host/target
[ ] Read/spellcheck configs & scripts
[ ] 'ct-ng olddefconfig'
-[ ] Install config.gen so that it is not rebuilt in the installed configurations
[ ] Install a "trap" C++ compiler as ${CT_TARGET}-g++ during pass-1/pass-2 to trap attempts to compile target code with g++ (currently glibc detects host g++ and warns that it uses g++ w/o target triplet)
[ ] Somehow it needs to be functional during the configure step - export env var while running in CT_DoExecLog with CFG level, and forward it to host compiler?
[ ] elf2flt not compatible with multiple linkers enabled in binutils (ld.bfd + ld.gold) - fix upstream?
diff --git a/bootstrap b/bootstrap
index 1260830..ab493dd 100755
--- a/bootstrap
+++ b/bootstrap
@@ -4,4 +4,7 @@ set -e
printf "Running autoconf...\n"
autoconf -Wall --force
+printf "Generating kconfig files...\n"
+./maintainer/gen-kconfig.sh
+
printf "Done. You may now run:\n ./configure\n"
diff --git a/config/arch/msp430.in b/config/arch/msp430.in
new file mode 100644
index 0000000..a1c4ab5
--- /dev/null
+++ b/config/arch/msp430.in
@@ -0,0 +1,8 @@
+# MSP430 specific config options
+
+## select ARCH_SUPPORTS_16
+## select ARCH_DEFAULT_16
+## select ARCH_REQUIRES_MULTILIB
+##
+## help The 16-bit MSP430 architecture, as defined by:
+## help http://www.ti.com/lsds/ti/microcontrollers-16-bit-32-bit/msp/overview.page?HQS=msp430
diff --git a/config/backend.in b/config/backend.in
deleted file mode 100644
index 12d278b..0000000
--- a/config/backend.in
+++ /dev/null
@@ -1,26 +0,0 @@
-# Options specific to crosstool-NG acting as a backend
-
-config IS_A_BACKEND
- string
- option env="CT_IS_A_BACKEND"
-
-config BACKEND
- bool
- depends on OBSOLETE
- default y if IS_A_BACKEND = "y" || IS_A_BACKEND = "Y"
-
-if BACKEND
-
-config BACKEND_ARCH
- string
- option env="CT_BACKEND_ARCH"
-
-config BACKEND_KERNEL
- string
- option env="CT_BACKEND_KERNEL"
-
-config BACKEND_LIBC
- string
- option env="CT_BACKEND_LIBC"
-
-endif #if BACKEND
diff --git a/config/binutils.in b/config/binutils.in
index 99b8b9f..0c6d5c0 100644
--- a/config/binutils.in
+++ b/config/binutils.in
@@ -36,7 +36,7 @@ endchoice
config BINUTILS
string
-source "config.gen/binutils.in"
-source "config.gen/binutils.in.2"
+source "config/gen/binutils.in"
+source "config/gen/binutils.in.2"
endmenu
diff --git a/config/binutils/binutils.in b/config/binutils/binutils.in
index 1bb674e..c83cbb1 100644
--- a/config/binutils/binutils.in
+++ b/config/binutils/binutils.in
@@ -314,7 +314,6 @@ config BINUTILS_FOR_TARGET
bool
prompt "binutils libraries for the target"
depends on ! BARE_METAL
- depends on ! BACKEND
help
Some utilities may need binutils libraries to be available on
the target, eg. oprofile.
diff --git a/config/cc.in b/config/cc.in
index 5603738..81f168c 100644
--- a/config/cc.in
+++ b/config/cc.in
@@ -20,7 +20,7 @@ config CC_CORE_PASS_1_NEEDED
config CC_CORE_PASS_2_NEEDED
bool
-source "config.gen/cc.in"
+source "config/gen/cc.in"
config CC_SUPPORT_CXX
bool
diff --git a/config/cc/gcc.in b/config/cc/gcc.in
index caf254c..d86a300 100644
--- a/config/cc/gcc.in
+++ b/config/cc/gcc.in
@@ -3,7 +3,7 @@
## default y
## select CC_SUPPORT_CXX if !LIBC_none
## select CC_SUPPORT_FORTRAN
-## select CC_SUPPORT_JAVA
+## select CC_SUPPORT_JAVA if !CC_GCC_6_or_later
## select CC_SUPPORT_ADA
## select CC_SUPPORT_OBJC
## select CC_SUPPORT_OBJCXX
@@ -73,9 +73,14 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
+config CC_GCC_V_7_1_0
+ bool
+ prompt "7.1.0"
+ select CC_GCC_7
+
config CC_GCC_V_linaro_6_3
bool
- prompt "linaro-6.3-2017.02"
+ prompt "linaro-6.3-2017.05"
depends on CC_GCC_SHOW_LINARO
select CC_GCC_6
@@ -86,7 +91,7 @@ config CC_GCC_V_6_3_0
config CC_GCC_V_linaro_5_4
bool
- prompt "linaro-5.4-2017.01"
+ prompt "linaro-5.4-2017.05"
depends on CC_GCC_SHOW_LINARO
select CC_GCC_5
@@ -141,25 +146,31 @@ config CC_GCC_4_9_or_later
config CC_GCC_5
bool
select CC_GCC_5_or_later
- select CC_GCC_HAS_LIBMPX
config CC_GCC_5_or_later
bool
select CC_GCC_4_9_or_later
+ select CC_GCC_HAS_LIBMPX
config CC_GCC_6
bool
select CC_GCC_6_or_later
- select CC_GCC_HAS_LIBMPX
config CC_GCC_6_or_later
bool
select CC_GCC_5_or_later
-config CC_GCC_latest
+config CC_GCC_7
+ bool
+ select CC_GCC_7_or_later
+
+config CC_GCC_7_or_later
bool
select CC_GCC_6_or_later
- select CC_GCC_HAS_LIBMPX
+
+config CC_GCC_latest
+ bool
+ select CC_GCC_7_or_later
# Only enable gcc's support for plugins if binutils has it as well
# They are useful only when doing LTO, but it does no harm enabling
@@ -185,9 +196,10 @@ config CC_GCC_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
- default "linaro-6.3-2017.02" if CC_GCC_V_linaro_6_3
+ default "7.1.0" if CC_GCC_V_7_1_0
+ default "linaro-6.3-2017.05" if CC_GCC_V_linaro_6_3
default "6.3.0" if CC_GCC_V_6_3_0
- default "linaro-5.4-2017.01" if CC_GCC_V_linaro_5_4
+ default "linaro-5.4-2017.05" if CC_GCC_V_linaro_5_4
default "5.4.0" if CC_GCC_V_5_4_0
default "linaro-4.9-2017.01" if CC_GCC_V_linaro_4_9
default "4.9.4" if CC_GCC_V_4_9_4
diff --git a/config/cc/gcc.in.2 b/config/cc/gcc.in.2
index c147f05..79a6225 100644
--- a/config/cc/gcc.in.2
+++ b/config/cc/gcc.in.2
@@ -47,17 +47,6 @@ config CC_GCC_MULTILIB_LIST
for the format of this option for a particular architecture.
Leave empty to use the default list for this architecture.
-config CC_GCC_TARGET_FINAL
- bool
- prompt "Use the default targets all and install for the final compiler"
- default n
- depends on BARE_METAL
- help
- The final GCC for a bare metal system is built by the core gcc script.
- This script does a lot of tricks to build the core gcc, which are not
- required for the final gcc build. If you set this flag to true, all the
- tricks are not done and the compiler is build with all/install.
-
config STATIC_TOOLCHAIN
bool
select CC_GCC_STATIC_LIBSTDCXX
@@ -94,6 +83,7 @@ config CC_GCC_SYSTEM_ZLIB
config CC_GCC_CONFIG_TLS
tristate
prompt "Configure TLS (Thread Local Storage)"
+ depends on !LIBC_bionic
default m
help
Specify that the target supports TLS (Thread Local Storage). Usually
diff --git a/config/companion_tools.in b/config/companion_tools.in
index 5291f46..e5ef3fc 100644
--- a/config/companion_tools.in
+++ b/config/companion_tools.in
@@ -10,6 +10,6 @@ config COMP_TOOLS_FOR_HOST
tools into the final toolchain (rather than just using them
to build it).
-source "config.gen/companion_tools.in"
+source "config/gen/companion_tools.in"
endmenu
diff --git a/config/config.in b/config/config.in
index 885f722..21b0c7e 100644
--- a/config/config.in
+++ b/config/config.in
@@ -1,5 +1,4 @@
source "config/configure.in"
-source "config/backend.in"
source "config/global.in"
source "config/target.in"
source "config/toolchain.in"
diff --git a/config/config.mk b/config/config.mk
deleted file mode 100644
index 670ecba..0000000
--- a/config/config.mk
+++ /dev/null
@@ -1,114 +0,0 @@
-# ===========================================================================
-# crosstool-NG genererated config files
-# These targets are used from top-level makefile
-
-#-----------------------------------------------------------
-# List all config files, wether sourced or generated
-
-# The top-level config file to be used be configurators
-# We need it to savedefconfig in scripts/saveSample.sh
-export KCONFIG_TOP = config/config.in
-
-# Build the list of all source config files
-STATIC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(shell find $(CT_LIB_DIR)/config -type f \( -name '*.in' -o -name '*.in.2' \) 2>/dev/null))
-# ... and how to access them:
-$(STATIC_CONFIG_FILES): config
-
-# Build a list of per-component-type source config files
-ARCH_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/arch/*.in)))
-ARCH_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/arch/*.in.2)))
-KERNEL_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/kernel/*.in)))
-KERNEL_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/kernel/*.in.2)))
-CC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/cc/*.in)))
-CC_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/cc/*.in.2)))
-BINUTILS_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/binutils/*.in)))
-BINUTILS_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/binutils/*.in.2)))
-LIBC_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/libc/*.in)))
-LIBC_CONFIG_FILES_2 = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/libc/*.in.2)))
-DEBUG_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/debug/*.in)))
-COMP_TOOLS_CONFIG_FILES = $(patsubst $(CT_LIB_DIR)/%,%,$(sort $(wildcard $(CT_LIB_DIR)/config/companion_tools/*.in)))
-
-# Build the list of generated config files
-GEN_CONFIG_FILES = config.gen/arch.in \
- config.gen/kernel.in \
- config.gen/cc.in \
- config.gen/binutils.in \
- config.gen/libc.in \
- config.gen/debug.in \
- config.gen/companion_tools.in
-# ... and how to access them:
-# Generated files depends on the gen_in_frags script because it has the
-# functions needed to build the genrated files, and thus they might need
-# re-generation if it changes.
-# They also depends on config.mk (this file) because it has the dependency
-# rules, and thus they might need re-generation if the deps change.
-$(GEN_CONFIG_FILES): config.gen \
- $(CT_LIB_DIR)/scripts/gen_in_frags.sh \
- $(CT_LIB_DIR)/config/config.mk
-
-# Helper entry for the configurators
-PHONY += config_files
-config_files: $(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
-
-# Where to access to the source config files from
-config:
- @$(CT_ECHO) " LN config"
- $(SILENT)ln -s $(CT_LIB_DIR)/config config
-
-# Where to store the generated config files into
-config.gen:
- @$(CT_ECHO) " MKDIR config.gen"
- $(SILENT)mkdir -p config.gen
-
-#-----------------------------------------------------------
-# Build list of per-component-type items to easily build generated files
-
-ARCHS = $(patsubst config/arch/%.in,%,$(ARCH_CONFIG_FILES))
-KERNELS = $(patsubst config/kernel/%.in,%,$(KERNEL_CONFIG_FILES))
-CCS = $(patsubst config/cc/%.in,%,$(CC_CONFIG_FILES))
-BINUTILSS = $(patsubst config/binutils/%.in,%,$(BINUTILS_CONFIG_FILES))
-LIBCS = $(patsubst config/libc/%.in,%,$(LIBC_CONFIG_FILES))
-DEBUGS = $(patsubst config/debug/%.in,%,$(DEBUG_CONFIG_FILES))
-COMP_TOOLS= $(patsubst config/companion_tools/%.in,%,$(COMP_TOOLS_CONFIG_FILES))
-
-#-----------------------------------------------------------
-# The rules for the generated config files
-
-# WARNING! If a .in file disapears between two runs, that will NOT be detected!
-
-config.gen/arch.in: $(ARCH_CONFIG_FILES) $(ARCH_CONFIG_FILES_2)
- @$(CT_ECHO) ' IN $(@)'
- $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Target Architecture" "ARCH" "config/arch" "Y" $(ARCHS)
-
-config.gen/kernel.in: $(KERNEL_CONFIG_FILES) $(KERNEL_CONFIG_FILES_2)
- @$(CT_ECHO) ' IN $(@)'
- $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Target OS" "KERNEL" "config/kernel" "Y" $(KERNELS)
-
-config.gen/cc.in: $(CC_CONFIG_FILES) $(CC_CONFIG_FILES_2)
- @$(CT_ECHO) ' IN $(@)'
- $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C compiler" "CC" "config/cc" "N" $(CCS)
-
-config.gen/binutils.in: $(CC_BINUTILS_FILES) $(CC_BINUTILS_FILES_2)
- @$(CT_ECHO) ' IN $(@)'
- $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "Binutils" "BINUTILS" "config/binutils" "N" $(BINUTILSS)
-
-config.gen/libc.in: $(LIBC_CONFIG_FILES) $(LIBC_CONFIG_FILES_2)
- @$(CT_ECHO) ' IN $(@)'
- $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh choice "$@" "C library" "LIBC" "config/libc" "Y" $(LIBCS)
-
-config.gen/debug.in: $(DEBUG_CONFIG_FILES)
- @$(CT_ECHO) ' IN $(@)'
- $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh menu "$@" "Debug facilities" "DEBUG" "config/debug" $(DEBUGS)
-
-config.gen/companion_tools.in: $(COMP_TOOLS_CONFIG_FILES)
- @$(CT_ECHO) ' IN $(@)'
- $(SILENT)$(CT_LIB_DIR)/scripts/gen_in_frags.sh menu "$@" "Companion tools" "COMP_TOOLS" "config/companion_tools" $(COMP_TOOLS)
-
-#-----------------------------------------------------------
-# Cleaning up the mess...
-
-clean::
- @$(CT_ECHO) " CLEAN config"
- $(SILENT)rm -f config 2>/dev/null || true
- @$(CT_ECHO) " CLEAN config.gen"
- $(SILENT)rm -rf config.gen
diff --git a/config/configure.in.in b/config/configure.in.in
new file mode 100644
index 0000000..aaebbde
--- /dev/null
+++ b/config/configure.in.in
@@ -0,0 +1,46 @@
+# Default values as found by ./configure
+
+config CONFIGURE_has_static_link
+ @KCONFIG_static_link@
+
+config CONFIGURE_has_wget
+ @KCONFIG_wget@
+
+config CONFIGURE_has_curl
+ @KCONFIG_curl@
+
+config CONFIGURE_has_stat_flavor_BSD
+ @KCONFIG_stat_flavor_BSD@
+
+config CONFIGURE_has_stat_flavor_GNU
+ @KCONFIG_stat_flavor_GNU@
+
+config CONFIGURE_has_make_3_81_or_newer
+ @KCONFIG_make_3_81_or_newer@
+
+config CONFIGURE_has_libtool_2_4_or_newer
+ @KCONFIG_libtool_2_4_or_newer@
+
+config CONFIGURE_has_libtoolize_2_4_or_newer
+ @KCONFIG_libtoolize_2_4_or_newer@
+
+config CONFIGURE_has_autoconf_2_63_or_newer
+ @KCONFIG_autoconf_2_63_or_newer@
+
+config CONFIGURE_has_autoreconf_2_63_or_newer
+ @KCONFIG_autoreconf_2_63_or_newer@
+
+config CONFIGURE_has_automake_1_15_or_newer
+ @KCONFIG_automake_1_15_or_newer@
+
+config CONFIGURE_has_gnu_m4_1_4_12_or_newer
+ @KCONFIG_gnu_m4_1_4_12_or_newer@
+
+config CONFIGURE_has_cvs
+ @KCONFIG_cvs@
+
+config CONFIGURE_has_svn
+ @KCONFIG_svn@
+
+config CONFIGURE_has_git
+ @KCONFIG_git@
diff --git a/config/debug.in b/config/debug.in
index 9fd99ef..8fc549b 100644
--- a/config/debug.in
+++ b/config/debug.in
@@ -1,3 +1,3 @@
menu "Debug facilities"
-source "config.gen/debug.in"
+source "config/gen/debug.in"
endmenu
diff --git a/config/debug/duma.in b/config/debug/duma.in
index 9947ca2..f9e727b 100644
--- a/config/debug/duma.in
+++ b/config/debug/duma.in
@@ -1,7 +1,7 @@
# D.U.M.A. - Detect Unintended Memory Access - Memory checker
-## depends on ! BACKEND
## depends on ! BARE_METAL
+## depends on ! LIBC_bionic
## help D.U.M.A. - Detect Unintended Memory Access
## help A memory bound checker, with additional features.
diff --git a/config/debug/gdb.in b/config/debug/gdb.in
index c8652ca..b1d101b 100644
--- a/config/debug/gdb.in
+++ b/config/debug/gdb.in
@@ -12,7 +12,7 @@ config GDB_CUSTOM
bool
prompt "Custom gdb"
depends on EXPERIMENTAL
- select GDB_7_12_or_later
+ select GDB_8_0_or_later
help
The choosen gdb version shall be not downloaded. Instead use
a custom location to get the source.
@@ -67,6 +67,11 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
+config GDB_V_8_0
+ bool
+ prompt "8.0"
+ select GDB_8_0_or_later
+
config GDB_V_7_12_1
bool
prompt "7.12.1"
@@ -249,6 +254,10 @@ endchoice
endif # ! GDB_CUSTOM
+config GDB_8_0_or_later
+ bool
+ select GDB_7_12_or_later
+
config GDB_7_12_or_later
bool
select GDB_7_2_or_later
@@ -272,12 +281,19 @@ config GDB_HAS_PYTHON
config GDB_INSTALL_GDBINIT
bool
+# GDB 8.0 now requires C++ for build. GDB 7.12 offered a configure
+# switch to fall back to C.
+config GDB_TARGET_DISABLE_CXX_BUILD
+ def_bool y
+ depends on GDB_7_12_or_later && !GDB_8_0_or_later
+
if ! GDB_CUSTOM
config GDB_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
+ default "8.0" if GDB_V_8_0
default "7.12.1" if GDB_V_7_12_1
default "7.11.1" if GDB_V_7_11_1
default "7.10.1" if GDB_V_7_10_1
diff --git a/config/debug/gdb.in.native b/config/debug/gdb.in.native
index 8684c05..f199d59 100644
--- a/config/debug/gdb.in.native
+++ b/config/debug/gdb.in.native
@@ -4,7 +4,8 @@ config GDB_NATIVE
bool
prompt "Native gdb"
depends on ! BARE_METAL
- depends on ! BACKEND
+ depends on ! LIBC_bionic
+ depends on CC_LANG_CXX || !GDB_8_0_or_later
select EXPAT_TARGET
select NCURSES_TARGET
help
diff --git a/config/debug/ltrace.in b/config/debug/ltrace.in
index fc5822d..fab6b81 100644
--- a/config/debug/ltrace.in
+++ b/config/debug/ltrace.in
@@ -1,8 +1,7 @@
# ltrace
-## depends on ! BACKEND
-##
## select LIBELF_TARGET
+## depends on ! LIBC_bionic
##
## help ltrace is a program that simply runs the specified command until it exits.
## help It intercepts and records the dynamic library calls which are called by
diff --git a/config/debug/strace.in b/config/debug/strace.in
index 4cf6980..e77702b 100644
--- a/config/debug/strace.in
+++ b/config/debug/strace.in
@@ -1,6 +1,6 @@
# strace
-## depends on ! BACKEND
+## depends on ! LIBC_bionic
choice
bool
diff --git a/config/global/build-behave.in b/config/global/build-behave.in
index 9ad5438..d3298ea 100644
--- a/config/global/build-behave.in
+++ b/config/global/build-behave.in
@@ -2,12 +2,9 @@
comment "Build behavior"
-comment "Build options hiden"
- depends on BACKEND
-
config PARALLEL_JOBS
int
- prompt "Number of parallel jobs" if ! BACKEND
+ prompt "Number of parallel jobs"
default 0
help
Number of jobs make will be allowed to run concurently.
@@ -20,7 +17,7 @@ config PARALLEL_JOBS
config LOAD
string
- prompt "Maximum allowed load" if ! BACKEND
+ prompt "Maximum allowed load"
default ""
help
Specifies that no new jobs should be started if there are others jobs
@@ -33,7 +30,7 @@ config LOAD
config USE_PIPES
bool
- prompt "Use -pipe" if ! BACKEND
+ prompt "Use -pipe"
default y
help
Use gcc's option -pipe to use pipes rather than temp files when building
@@ -83,7 +80,6 @@ choice
bool
prompt "Shell to use as CONFIG_SHELL"
default CONFIG_SHELL_BASH
- depends on ! BACKEND
config CONFIG_SHELL_SH
bool
@@ -141,13 +137,10 @@ config CONFIG_SHELL_CUSTOM
endchoice
-# Do not put this into the choice above, because the choice
-# is not available in BACKEND-mode, while we do want this to
-# be set even in BACKEND-mode.
config CONFIG_SHELL_CUSTOM_PATH
string
- prompt "Path to custom shell" if ! BACKEND
- depends on CONFIG_SHELL_CUSTOM || BACKEND
+ prompt "Path to custom shell"
+ depends on CONFIG_SHELL_CUSTOM
default "/bin/sh"
# Ditto.
@@ -157,4 +150,4 @@ config CONFIG_SHELL
default "/bin/sh" if CONFIG_SHELL_SH
default "/bin/ash" if CONFIG_SHELL_ASH
default "${bash}" if CONFIG_SHELL_BASH
- default CONFIG_SHELL_CUSTOM_PATH if CONFIG_SHELL_CUSTOM || BACKEND
+ default CONFIG_SHELL_CUSTOM_PATH if CONFIG_SHELL_CUSTOM
diff --git a/config/global/ct-behave.in b/config/global/ct-behave.in
index a57c798..42171e4 100644
--- a/config/global/ct-behave.in
+++ b/config/global/ct-behave.in
@@ -63,7 +63,6 @@ config ALLOW_BUILD_AS_ROOT_SURE
config DEBUG_CT
bool
prompt "Debug crosstool-NG"
- depends on ! BACKEND
help
Say 'y' here to get some options regarding debugging crosstool-NG.
diff --git a/config/global/paths.in b/config/global/paths.in
index 5313d0d..39e15f3 100644
--- a/config/global/paths.in
+++ b/config/global/paths.in
@@ -4,7 +4,7 @@ comment "Paths"
config LOCAL_TARBALLS_DIR
string
- prompt "Local tarballs directory" if ! BACKEND
+ prompt "Local tarballs directory"
default "${HOME}/src"
help
If you have previously downloaded the tarballs, enter the PATH where
@@ -12,8 +12,8 @@ config LOCAL_TARBALLS_DIR
config SAVE_TARBALLS
bool
- prompt "Save new tarballs" if ! BACKEND
- depends on LOCAL_TARBALLS_DIR != "" || BACKEND
+ prompt "Save new tarballs"
+ depends on LOCAL_TARBALLS_DIR != ""
default y
help
If you say 'y' here, new downloaded tarballs will be saved in the
@@ -21,7 +21,7 @@ config SAVE_TARBALLS
config WORK_DIR
string
- prompt "Working directory" if ! BACKEND
+ prompt "Working directory"
default "${CT_TOP_DIR}/.build"
help
Set this to the directory where all build actions will be done.
@@ -46,7 +46,7 @@ config BUILD_TOP_DIR
config PREFIX_DIR
string
- prompt "Prefix directory" if ! BACKEND
+ prompt "Prefix directory"
default "${CT_PREFIX:-${HOME}/x-tools}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
help
This is the path the toolchain will run from.
@@ -55,7 +55,6 @@ config RM_RF_PREFIX_DIR
bool
prompt "| Remove the prefix dir prior to building"
default y
- depends on !BACKEND
help
If you say 'y' here, then PREFIX_DIR (above) will be eradicated
prior to the toolchain is built.
@@ -69,9 +68,6 @@ config RM_RF_PREFIX_DIR
it into a directory with pre-install, unrelated programs, it would be
damageable to remove that directory. In this case, you may want to
say 'n' here.
-
- Note that when acting as a backend, this option is not available, and
- is forced to 'n'.
config REMOVE_DOCS
bool
diff --git a/config/kernel.in b/config/kernel.in
index 64b69c6..c04f2cb 100644
--- a/config/kernel.in
+++ b/config/kernel.in
@@ -22,7 +22,7 @@ config KERNEL
config KERNEL_VERSION
string
-source "config.gen/kernel.in"
+source "config/gen/kernel.in"
comment "Common kernel options"
@@ -37,6 +37,6 @@ config SHARED_LIBS
You might not want shared libraries if you're building for a target that
don't support it (maybe some nommu targets, for example, or bare metal).
-source "config.gen/kernel.in.2"
+source "config/gen/kernel.in.2"
endmenu
diff --git a/config/kernel/linux.in b/config/kernel/linux.in
index 1b32763..dc0f5e5 100644
--- a/config/kernel/linux.in
+++ b/config/kernel/linux.in
@@ -49,13 +49,17 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
+config KERNEL_V_4_11
+ bool
+ prompt "4.11.3"
+
config KERNEL_V_4_10
bool
- prompt "4.10.8"
+ prompt "4.10.17 (EOL)"
config KERNEL_V_4_9
bool
- prompt "4.9.20"
+ prompt "4.9.30"
config KERNEL_V_4_8
bool
@@ -80,7 +84,7 @@ config KERNEL_V_4_5
# EOL 04/2021 [Ubuntu16.04]
config KERNEL_V_4_4
bool
- prompt "4.4.59"
+ prompt "4.4.70"
config KERNEL_V_4_3
bool
@@ -94,7 +98,7 @@ config KERNEL_V_4_2
config KERNEL_V_4_1
bool
- prompt "4.1.39"
+ prompt "4.1.40"
config KERNEL_V_4_0
bool
@@ -108,7 +112,7 @@ config KERNEL_V_3_19
config KERNEL_V_3_18
bool
- prompt "3.18.48 (EOL)"
+ prompt "3.18.55 (EOL)"
depends on OBSOLETE
config KERNEL_V_3_17
@@ -118,7 +122,7 @@ config KERNEL_V_3_17
config KERNEL_V_3_16
bool
- prompt "3.16.42"
+ prompt "3.16.43"
config KERNEL_V_3_15
bool
@@ -138,7 +142,7 @@ config KERNEL_V_3_13
config KERNEL_V_3_12
bool
- prompt "3.12.72"
+ prompt "3.12.74"
config KERNEL_V_3_11
bool
@@ -187,7 +191,7 @@ config KERNEL_V_3_3
# EOL 04/2017 [Ubuntu12.04]
config KERNEL_V_3_2
bool
- prompt "3.2.87"
+ prompt "3.2.88"
config KERNEL_V_3_1
bool
@@ -246,25 +250,26 @@ config KERNEL_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
- default "4.10.8" if KERNEL_V_4_10
- default "4.9.20" if KERNEL_V_4_9
+ default "4.11.3" if KERNEL_V_4_11
+ default "4.10.17" if KERNEL_V_4_10
+ default "4.9.30" if KERNEL_V_4_9
default "4.8.17" if KERNEL_V_4_8
default "4.7.10" if KERNEL_V_4_7
default "4.6.7" if KERNEL_V_4_6
default "4.5.7" if KERNEL_V_4_5
- default "4.4.59" if KERNEL_V_4_4
+ default "4.4.70" if KERNEL_V_4_4
default "4.3.6" if KERNEL_V_4_3
default "4.2.8" if KERNEL_V_4_2
- default "4.1.39" if KERNEL_V_4_1
+ default "4.1.40" if KERNEL_V_4_1
default "4.0.9" if KERNEL_V_4_0
default "3.19.8" if KERNEL_V_3_19
- default "3.18.48" if KERNEL_V_3_18
+ default "3.18.55" if KERNEL_V_3_18
default "3.17.8" if KERNEL_V_3_17
- default "3.16.42" if KERNEL_V_3_16
+ default "3.16.43" if KERNEL_V_3_16
default "3.15.10" if KERNEL_V_3_15
default "3.14.79" if KERNEL_V_3_14
default "3.13.11" if KERNEL_V_3_13
- default "3.12.72" if KERNEL_V_3_12
+ default "3.12.74" if KERNEL_V_3_12
default "3.11.10" if KERNEL_V_3_11
default "3.10.105" if KERNEL_V_3_10
default "3.9.11" if KERNEL_V_3_9
@@ -274,7 +279,7 @@ config KERNEL_VERSION
default "3.5.7" if KERNEL_V_3_5
default "3.4.113" if KERNEL_V_3_4
default "3.3.8" if KERNEL_V_3_3
- default "3.2.87" if KERNEL_V_3_2
+ default "3.2.88" if KERNEL_V_3_2
default "3.1.10" if KERNEL_V_3_1
default "3.0.101" if KERNEL_V_3_0
default "2.6.39.4" if KERNEL_V_2_6_39
diff --git a/config/libc.in b/config/libc.in
index 0566212..708c3b6 100644
--- a/config/libc.in
+++ b/config/libc.in
@@ -19,7 +19,7 @@ config LIBC_VERSION
So if you want to be able to re-build your toolchain later, you will
have to save your C library tarball by yourself.
-source "config.gen/libc.in"
+source "config/gen/libc.in"
config LIBC_SUPPORT_THREADS_ANY
bool
@@ -123,7 +123,7 @@ config LIBC_XLDD
for the native ldd. Please see the help, by running it
with '--help' for more explanations.
-source "config.gen/libc.in.2"
+source "config/gen/libc.in.2"
endif # ! LIBC_none
diff --git a/config/libc/bionic.in b/config/libc/bionic.in
new file mode 100644
index 0000000..9e04130
--- /dev/null
+++ b/config/libc/bionic.in
@@ -0,0 +1,187 @@
+# bionic options
+
+## depends on ! WINDOWS && ! BARE_METAL
+## depends on ARCH_arm || ARCH_mips || ARCH_x86
+## depends on EXPERIMENTAL
+## depends on CC_GCC_6_or_later
+##
+## select LIBC_SUPPORT_THREADS_POSIX
+##
+## help Bionic is the Android C library. It is prebuilt, extracted from the Android NDK.
+## help This platform has no TLS (Thread Local Storage) support so that option must be
+## help disabled in the Compiler options.
+
+config THREADS
+ default "posix"
+
+config LIBC_BIONIC_CUSTOM
+ bool
+ prompt "Custom bionic"
+ help
+ The chosen bionic-libc version shall be not downloaded. Instead use
+ a custom location to get the source.
+
+if LIBC_BIONIC_CUSTOM
+
+config LIBC_BIONIC_CUSTOM_LOCATION
+ string
+ prompt "Full path to custom bionic source"
+ help
+ Enter the path to the directory or tarball of your source for bionic.
+
+ If the path is a zip archive, it should extract to: <name>-<version>/
+ where the name is android-ndk, and the version is set
+ below in the custom version string.
+
+config LIBC_BIONIC_CUSTOM_VERSION
+ string
+ prompt "Custom BIONIC version"
+ help
+ Enter the version number for your custom bionic.
+
+config LIBC_VERSION
+ string
+ default LIBC_BIONIC_CUSTOM_VERSION
+
+endif # LIBC_BIONIC_CUSTOM
+
+if ! LIBC_BIONIC_CUSTOM
+
+choice
+ bool
+ prompt "bionic version"
+# Don't remove next line
+# CT_INSERT_VERSION_BELOW
+
+config LIBC_BIONIC_V_15beta1
+ bool
+ prompt "15beta1"
+
+config LIBC_BIONIC_V_14b
+ bool
+ prompt "14b"
+
+config LIBC_BIONIC_V_13b
+ bool
+ prompt "13b (OBSOLETE)"
+ depends on OBSOLETE
+
+config LIBC_BIONIC_V_12b
+ bool
+ prompt "12b (OBSOLETE)"
+ depends on OBSOLETE
+
+config LIBC_BIONIC_V_11c
+ bool
+ prompt "11c (OBSOLETE)"
+ depends on OBSOLETE
+
+config LIBC_BIONIC_V_10e
+ bool
+ prompt "10e (OBSOLETE)"
+ depends on OBSOLETE
+
+endchoice
+
+config LIBC_VERSION
+ string
+# Don't remove next line
+# CT_INSERT_VERSION_STRING_BELOW
+ default "r15-beta1" if LIBC_BIONIC_V_15beta1
+ default "r14b" if LIBC_BIONIC_V_14b
+ default "r13b" if LIBC_BIONIC_V_13b
+ default "r12b" if LIBC_BIONIC_V_12b
+ default "r11c" if LIBC_BIONIC_V_11c
+ default "r10e" if LIBC_BIONIC_V_10e
+
+endif # ! LIBC_BIONIC_CUSTOM
+
+choice
+ bool
+ prompt "Android API level"
+ help
+ The minimum for 64 bit support is 21.
+# Don't remove next line
+# CT_INSERT_VERSION_BELOW
+
+config ANDROID_API_24
+ bool
+ prompt "24"
+
+config ANDROID_API_23
+ bool
+ prompt "23"
+
+config ANDROID_API_22
+ bool
+ prompt "22"
+
+config ANDROID_API_21
+ bool
+ prompt "21"
+
+config ANDROID_API_19
+ bool
+ prompt "19"
+ depends on ARCH_32
+
+config ANDROID_API_18
+ bool
+ prompt "18"
+ depends on ARCH_32
+
+config ANDROID_API_17
+ bool
+ prompt "17"
+ depends on ARCH_32
+
+config ANDROID_API_16
+ bool
+ prompt "16"
+ depends on ARCH_32
+
+config ANDROID_API_15
+ bool
+ prompt "15"
+ depends on ARCH_32
+
+config ANDROID_API_14
+ bool
+ prompt "14"
+ depends on ARCH_32
+
+config ANDROID_API_13
+ bool
+ prompt "13"
+ depends on ARCH_32
+
+config ANDROID_API_12
+ bool
+ prompt "12"
+ depends on ARCH_32
+
+config ANDROID_API_9
+ bool
+ prompt "9"
+ depends on ARCH_32
+
+endchoice
+
+config ANDROID_API
+ string
+# Don't remove next line
+# CT_INSERT_VERSION_STRING_BELOW
+ default "24" if ANDROID_API_24
+ default "23" if ANDROID_API_23
+ default "22" if ANDROID_API_22
+ default "21" if ANDROID_API_21
+ default "19" if ANDROID_API_19
+ default "18" if ANDROID_API_18
+ default "17" if ANDROID_API_17
+ default "16" if ANDROID_API_16
+ default "15" if ANDROID_API_15
+ default "14" if ANDROID_API_14
+ default "13" if ANDROID_API_13
+ default "12" if ANDROID_API_12
+ default "9" if ANDROID_API_9
+
diff --git a/config/libc/mingw.in b/config/libc/mingw.in
index 9b2cb28..0ca1823 100644
--- a/config/libc/mingw.in
+++ b/config/libc/mingw.in
@@ -19,9 +19,14 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
+config WINAPI_V_5_0_2
+ bool
+ prompt "5.0.2"
+
config WINAPI_V_5_0_1
bool
- prompt "5.0.1"
+ prompt "5.0.1 (OBSOLETE)"
+ depends on OBSOLETE
config WINAPI_V_5_0_0
bool
@@ -110,6 +115,7 @@ config WINAPI_VERSION
default "devel" if WINAPI_V_DEVEL
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
+ default "5.0.2" if WINAPI_V_5_0_2
default "5.0.1" if WINAPI_V_5_0_1
default "5.0.0" if WINAPI_V_5_0_0
default "4.0.6" if WINAPI_V_4_0_6
diff --git a/config/libc/newlib.in b/config/libc/newlib.in
index 625b1b8..68e8b62 100644
--- a/config/libc/newlib.in
+++ b/config/libc/newlib.in
@@ -72,7 +72,7 @@ choice
# CT_INSERT_VERSION_BELOW
config LIBC_NEWLIB_V_2_5_0
bool
- prompt "2.5.0.20170323"
+ prompt "2.5.0.20170519"
select LIBC_NEWLIB_2_5
config LIBC_NEWLIB_V_2_4_0
@@ -187,7 +187,7 @@ config LIBC_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
- default "2.5.0.20170323" if LIBC_NEWLIB_V_2_5_0
+ default "2.5.0.20170519" if LIBC_NEWLIB_V_2_5_0
default "2.4.0.20161025" if LIBC_NEWLIB_V_2_4_0
default "2.3.0.20160226" if LIBC_NEWLIB_V_2_3_0
default "linaro-2.2.0-2015.01" if LIBC_NEWLIB_LINARO_V_2_2_0
diff --git a/config/libc/uClibc.in b/config/libc/uClibc.in
index 9d5e8fd..fcc179b 100644
--- a/config/libc/uClibc.in
+++ b/config/libc/uClibc.in
@@ -82,6 +82,16 @@ choice
# Don't remove next line
# CT_INSERT_VERSION_BELOW
+config LIBC_UCLIBC_NG_V_1_0_24
+ bool
+ prompt "1.0.24"
+ select LIBC_UCLIBC_NG_1_0_15_or_later
+
+config LIBC_UCLIBC_NG_V_1_0_23
+ bool
+ prompt "1.0.23"
+ select LIBC_UCLIBC_NG_1_0_15_or_later
+
config LIBC_UCLIBC_NG_V_1_0_22
bool
prompt "1.0.22"
@@ -111,6 +121,8 @@ config LIBC_VERSION
string
# Don't remove next line
# CT_INSERT_VERSION_STRING_BELOW
+ default "1.0.24" if LIBC_UCLIBC_NG_V_1_0_24
+ default "1.0.23" if LIBC_UCLIBC_NG_V_1_0_23
default "1.0.22" if LIBC_UCLIBC_NG_V_1_0_22
default "1.0.21" if LIBC_UCLIBC_NG_V_1_0_21
default "1.0.20" if LIBC_UCLIBC_NG_V_1_0_20
diff --git a/config/target.in b/config/target.in
index af010c0..2ce8aa3 100644
--- a/config/target.in
+++ b/config/target.in
@@ -5,7 +5,7 @@ menu "Target options"
config ARCH
string
-source "config.gen/arch.in"
+source "config/gen/arch.in"
config ARCH_SUFFIX
string
@@ -132,6 +132,9 @@ config ARCH_ENDIAN
config ARCH_SUPPORTS_8
bool
+config ARCH_SUPPORTS_16
+ bool
+
config ARCH_SUPPORTS_32
bool
@@ -165,6 +168,11 @@ config ARCH_8
prompt "8-bit"
depends on ARCH_SUPPORTS_8
+config ARCH_16
+ bool
+ prompt "16-bit"
+ depends on ARCH_SUPPORTS_16
+
config ARCH_32
bool
prompt "32-bit"
@@ -392,6 +400,6 @@ config ARCH_FLOAT
default "soft" if ARCH_FLOAT_SW
default "softfp" if ARCH_FLOAT_SOFTFP
-source "config.gen/arch.in.2"
+source "config/gen/arch.in.2"
endmenu
diff --git a/config/toolchain.in b/config/toolchain.in
index c712f39..1b2a289 100644
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -20,7 +20,7 @@ config USE_SYSROOT
config SYSROOT_NAME
string
- prompt "sysroot directory name" if ! BACKEND
+ prompt "sysroot directory name"
depends on USE_SYSROOT
default "sysroot"
help
@@ -33,7 +33,7 @@ config SYSROOT_NAME
config SYSROOT_DIR_PREFIX
string
- prompt "sysroot prefix dir (READ HELP)" if ! BACKEND
+ prompt "sysroot prefix dir (READ HELP)"
depends on USE_SYSROOT
default ""
help
diff --git a/config/versions/autoconf.in b/config/versions/autoconf.in
new file mode 100644
index 0000000..dfa2db5
--- /dev/null
+++ b/config/versions/autoconf.in
@@ -0,0 +1,103 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of autoconf"
+
+config AUTOCONF_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config AUTOCONF_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://git.sv.gnu.org/autoconf
+
+if AUTOCONF_SRC_DEVEL
+
+config AUTOCONF_DEVEL_VCS
+ string
+ default "git"
+
+config AUTOCONF_DEVEL_URL
+ string
+ default "git://git.sv.gnu.org/autoconf"
+
+config AUTOCONF_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config AUTOCONF_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config AUTOCONF_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if AUTOCONF_SRC_CUSTOM
+
+config AUTOCONF_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config AUTOCONF_MIRRORS_ARRAY
+ string
+ default "$( mirrors GNU autoconf )"
+
+choice
+ bool "Version of autoconf"
+ help
+ For a released version, select the version of autoconf to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building autoconf.
+
+config AUTOCONF_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on AUTOCONF_SRC_DEVEL || AUTOCONF_SRC_CUSTOM
+
+config AUTOCONF_V_2_69
+ bool "2.69"
+
+config AUTOCONF_V_2_65
+ bool "2.65"
+
+config AUTOCONF_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on AUTOCONF_SRC_DEVEL || AUTOCONF_SRC_CUSTOM
+
+endchoice
+
+
+
+config AUTOCONF_VERSION
+ string
+ default "2.69" if AUTOCONF_V_2_69
+ default "2.65" if AUTOCONF_V_2_65
+ default "unknown"
+
+
diff --git a/config/versions/automake.in b/config/versions/automake.in
new file mode 100644
index 0000000..c682b39
--- /dev/null
+++ b/config/versions/automake.in
@@ -0,0 +1,114 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of automake"
+
+config AUTOMAKE_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config AUTOMAKE_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.savannah.gnu.org/git/automake.git
+
+if AUTOMAKE_SRC_DEVEL
+
+config AUTOMAKE_DEVEL_VCS
+ string
+ default "git"
+
+config AUTOMAKE_DEVEL_URL
+ string
+ default "https://git.savannah.gnu.org/git/automake.git"
+
+config AUTOMAKE_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config AUTOMAKE_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config AUTOMAKE_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if AUTOMAKE_SRC_CUSTOM
+
+config AUTOMAKE_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config AUTOMAKE_MIRRORS_ARRAY
+ string
+ default "https://ftp.gnu.org/gnu/automake http://ftp.gnu.org/gnu/automake ftp://ftp.gnu.org/gnu/automake"
+
+choice
+ bool "Version of automake"
+ help
+ For a released version, select the version of automake to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building automake.
+
+config AUTOMAKE_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on AUTOMAKE_SRC_DEVEL || AUTOMAKE_SRC_CUSTOM
+
+config AUTOMAKE_V_1_15
+ bool "1.15"
+
+config AUTOMAKE_V_1_14
+ bool "1.14 (OBSOLETE)"
+ depends on OBSOLETE
+
+config AUTOMAKE_V_1_11_6
+ bool "1.11.6 (OBSOLETE)"
+ depends on OBSOLETE
+
+config AUTOMAKE_V_1_11_1
+ bool "1.11.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config AUTOMAKE_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on AUTOMAKE_SRC_DEVEL || AUTOMAKE_SRC_CUSTOM
+
+endchoice
+
+
+
+config AUTOMAKE_VERSION
+ string
+ default "1.15" if AUTOMAKE_V_1_15
+ default "1.14" if AUTOMAKE_V_1_14
+ default "1.11.6" if AUTOMAKE_V_1_11_6
+ default "1.11.1" if AUTOMAKE_V_1_11_1
+ default "unknown"
+
+
diff --git a/config/versions/avr-libc.in b/config/versions/avr-libc.in
new file mode 100644
index 0000000..67fca13
--- /dev/null
+++ b/config/versions/avr-libc.in
@@ -0,0 +1,108 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of avr-libc"
+
+config AVR_LIBC_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config AVR_LIBC_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ svn://svn.savannah.nongnu.org/avr-libc/trunk/avr-libc
+
+if AVR_LIBC_SRC_DEVEL
+
+config AVR_LIBC_DEVEL_VCS
+ string
+ default "svn"
+
+config AVR_LIBC_DEVEL_URL
+ string
+ default "svn://svn.savannah.nongnu.org/avr-libc/trunk/avr-libc"
+
+config AVR_LIBC_DEVEL_BRANCH
+ string "Branch to check out"
+ default "/trunk"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config AVR_LIBC_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config AVR_LIBC_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if AVR_LIBC_SRC_CUSTOM
+
+config AVR_LIBC_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config AVR_LIBC_MIRRORS_ARRAY
+ string
+ default "http://download.savannah.gnu.org/releases/avr-libc"
+
+choice
+ bool "Version of avr-libc"
+ help
+ For a released version, select the version of avr-libc to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building avr-libc.
+
+config AVR_LIBC_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on AVR_LIBC_SRC_DEVEL || AVR_LIBC_SRC_CUSTOM
+
+config AVR_LIBC_V_2_0_0
+ bool "2.0.0"
+
+config AVR_LIBC_V_1_8_1
+ bool "1.8.1"
+
+config AVR_LIBC_V_1_8_0
+ bool "1.8.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config AVR_LIBC_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on AVR_LIBC_SRC_DEVEL || AVR_LIBC_SRC_CUSTOM
+
+endchoice
+
+
+
+config AVR_LIBC_VERSION
+ string
+ default "2.0.0" if AVR_LIBC_V_2_0_0
+ default "1.8.1" if AVR_LIBC_V_1_8_1
+ default "1.8.0" if AVR_LIBC_V_1_8_0
+ default "unknown"
+
+
diff --git a/config/versions/binutils.in b/config/versions/binutils.in
new file mode 100644
index 0000000..d9ad521
--- /dev/null
+++ b/config/versions/binutils.in
@@ -0,0 +1,298 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+choice
+ bool "Show binutils versions from"
+
+config BINUTILS_USE_GNU
+ bool "GNU"
+ help
+ GNU (which is a recursive acronym for "GNU's Not Unix") provides GNU binutils,
+ GNU C Compiler (gcc), GNU debugger (gdb) and many other utilities. GNU is
+ considered the master source for these packages.
+
+ You should select "GNU" here unless you definitely know that you need some version
+ from another source.
+
+config BINUTILS_USE_LINARO
+ bool "Linaro"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ help
+ Linaro is maintaining some advanced/more stable/experimental versions
+ of binutils, gcc, glibc and gdb, especially for the ARM architecture.
+ These versions contain some changes that are not (yet?) merged into
+ their respective upstream repositories.
+
+endchoice
+
+config BINUTILS_USE
+ string
+ default "BINUTILS" if BINUTILS_USE_GNU
+ default "BINUTILS_LINARO" if BINUTILS_USE_LINARO
+
+
+if BINUTILS_USE_GNU
+
+if EXPERIMENTAL
+choice
+ bool "Source of binutils"
+
+config BINUTILS_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config BINUTILS_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://sourceware.org/git/binutils-gdb.git
+
+if BINUTILS_SRC_DEVEL
+
+config BINUTILS_DEVEL_VCS
+ string
+ default "git"
+
+config BINUTILS_DEVEL_URL
+ string
+ default "git://sourceware.org/git/binutils-gdb.git"
+
+config BINUTILS_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config BINUTILS_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config BINUTILS_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if BINUTILS_SRC_CUSTOM
+
+config BINUTILS_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config BINUTILS_MIRRORS_ARRAY
+ string
+ default "https://ftp.gnu.org/gnu/binutils ftp://ftp.gnu.org/gnu/binutils ftp://sourceware.org/pub/binutils/releases ftp://gcc.gnu.org/pub/binutils/releases"
+
+choice
+ bool "Version of binutils"
+ help
+ For a released version, select the version of binutils to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building binutils.
+
+config BINUTILS_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on BINUTILS_SRC_DEVEL || BINUTILS_SRC_CUSTOM
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_V_2_28
+ bool "2.28"
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_V_2_27
+ bool "2.27"
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_V_2_26
+ bool "2.26"
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_V_2_25_1
+ bool "2.25.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_V_2_24
+ bool "2.24 (OBSOLETE)"
+ depends on OBSOLETE
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_V_2_23_2
+ bool "2.23.2 (OBSOLETE)"
+ depends on OBSOLETE
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on BINUTILS_SRC_DEVEL || BINUTILS_SRC_CUSTOM
+ depends on !BINUTILS_REQUIRE_2_23_or_later
+
+endchoice
+
+
+endif
+
+config BINUTILS_VERSION
+ string
+ default "2.28" if BINUTILS_V_2_28
+ default "2.27" if BINUTILS_V_2_27
+ default "2.26" if BINUTILS_V_2_26
+ default "2.25.1" if BINUTILS_V_2_25_1
+ default "2.24" if BINUTILS_V_2_24
+ default "2.23.2" if BINUTILS_V_2_23_2
+ default "unknown"
+
+if BINUTILS_USE_LINARO
+
+if EXPERIMENTAL
+choice
+ bool "Source of binutils-linaro"
+
+config BINUTILS_LINARO_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config BINUTILS_LINARO_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.linaro.org/toolchain/binutils-gdb.git
+
+if BINUTILS_LINARO_SRC_DEVEL
+
+config BINUTILS_LINARO_DEVEL_VCS
+ string
+ default "git"
+
+config BINUTILS_LINARO_DEVEL_URL
+ string
+ default "https://git.linaro.org/toolchain/binutils-gdb.git"
+
+config BINUTILS_LINARO_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config BINUTILS_LINARO_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config BINUTILS_LINARO_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if BINUTILS_LINARO_SRC_CUSTOM
+
+config BINUTILS_LINARO_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config BINUTILS_LINARO_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of binutils-linaro"
+ help
+ For a released version, select the version of binutils-linaro to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building binutils-linaro.
+
+config BINUTILS_LINARO_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on BINUTILS_LINARO_SRC_DEVEL || BINUTILS_LINARO_SRC_CUSTOM
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_LINARO_V_2_25_0_2015_01_2
+ bool "2.25.0-2015.01-2 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_LINARO_V_2_24_0_2014_11_2
+ bool "2.24.0-2014.11-2 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_LINARO_V_2_23_2_2013_10_4
+ bool "2.23.2-2013.10-4 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select BINUTILS_2_23_or_later
+ depends on !BINUTILS_REQUIRE_2_23_or_older
+
+config BINUTILS_LINARO_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on BINUTILS_LINARO_SRC_DEVEL || BINUTILS_LINARO_SRC_CUSTOM
+ depends on !BINUTILS_REQUIRE_2_23_or_later
+
+endchoice
+
+
+endif
+
+config BINUTILS_LINARO_VERSION
+ string
+ default "2.25.0-2015.01-2" if BINUTILS_LINARO_V_2_25_0_2015_01_2
+ default "2.24.0-2014.11-2" if BINUTILS_LINARO_V_2_24_0_2014_11_2
+ default "2.23.2-2013.10-4" if BINUTILS_LINARO_V_2_23_2_2013_10_4
+ default "unknown"
+
+
+config BINUTILS_2_23_or_later
+ bool
+
+config BINUTILS_REQUIRE_2_23_or_later
+ bool
+
+config BINUTILS_REQUIRE_2_23_or_older
+ bool
+
diff --git a/config/versions/bionic.in b/config/versions/bionic.in
new file mode 100644
index 0000000..fd8d9d2
--- /dev/null
+++ b/config/versions/bionic.in
@@ -0,0 +1,93 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of bionic"
+
+config BIONIC_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config BIONIC_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if BIONIC_SRC_CUSTOM
+
+config BIONIC_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config BIONIC_MIRRORS_ARRAY
+ string
+ default "https://dl.google.com/android/repository"
+
+choice
+ bool "Version of bionic"
+ help
+ For a released version, select the version of bionic to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building bionic.
+
+config BIONIC_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on BIONIC_SRC_DEVEL || BIONIC_SRC_CUSTOM
+
+config BIONIC_V_15_BETA2
+ bool "15-beta2 (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+
+config BIONIC_V_14B
+ bool "14b"
+
+config BIONIC_V_13B
+ bool "13b (OBSOLETE)"
+ depends on OBSOLETE
+
+config BIONIC_V_12B
+ bool "12b (OBSOLETE)"
+ depends on OBSOLETE
+
+config BIONIC_V_11C
+ bool "11c (OBSOLETE)"
+ depends on OBSOLETE
+
+config BIONIC_V_10E
+ bool "10e (OBSOLETE)"
+ depends on OBSOLETE
+
+config BIONIC_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on BIONIC_SRC_DEVEL || BIONIC_SRC_CUSTOM
+
+endchoice
+
+
+
+config BIONIC_VERSION
+ string
+ default "15-beta2" if BIONIC_V_15_BETA2
+ default "14b" if BIONIC_V_14B
+ default "13b" if BIONIC_V_13B
+ default "12b" if BIONIC_V_12B
+ default "11c" if BIONIC_V_11C
+ default "10e" if BIONIC_V_10E
+ default "unknown"
+
+
diff --git a/config/versions/cloog.in b/config/versions/cloog.in
new file mode 100644
index 0000000..8c9cc5c
--- /dev/null
+++ b/config/versions/cloog.in
@@ -0,0 +1,127 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of CLooG"
+
+config CLOOG_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config CLOOG_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://repo.or.cz/cloog.git
+
+if CLOOG_SRC_DEVEL
+
+config CLOOG_DEVEL_VCS
+ string
+ default "git"
+
+config CLOOG_DEVEL_URL
+ string
+ default "git://repo.or.cz/cloog.git"
+
+config CLOOG_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config CLOOG_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config CLOOG_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if CLOOG_SRC_CUSTOM
+
+config CLOOG_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config CLOOG_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of CLooG"
+ help
+ For a released version, select the version of CLooG to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building CLooG.
+
+config CLOOG_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on CLOOG_SRC_DEVEL || CLOOG_SRC_CUSTOM
+ select CLOOG_0_18_or_later
+ depends on !CLOOG_REQUIRE_0_18_or_older
+
+config CLOOG_V_0_18_4
+ bool "0.18.4"
+ select CLOOG_0_18_or_later
+ depends on !CLOOG_REQUIRE_0_18_or_older
+
+config CLOOG_V_0_18_1
+ bool "0.18.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select CLOOG_0_18_or_later
+ depends on !CLOOG_REQUIRE_0_18_or_older
+
+config CLOOG_V_0_18_0
+ bool "0.18.0 (OBSOLETE)"
+ depends on OBSOLETE
+ select CLOOG_0_18_or_later
+ depends on !CLOOG_REQUIRE_0_18_or_older
+
+config CLOOG_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on CLOOG_SRC_DEVEL || CLOOG_SRC_CUSTOM
+ depends on !CLOOG_REQUIRE_0_18_or_later
+
+endchoice
+
+
+
+config CLOOG_VERSION
+ string
+ default "0.18.4" if CLOOG_V_0_18_4
+ default "0.18.1" if CLOOG_V_0_18_1
+ default "0.18.0" if CLOOG_V_0_18_0
+ default "unknown"
+
+
+config CLOOG_0_18_or_later
+ bool
+
+config CLOOG_REQUIRE_0_18_or_later
+ bool
+
+config CLOOG_REQUIRE_0_18_or_older
+ bool
+
diff --git a/config/versions/duma.in b/config/versions/duma.in
new file mode 100644
index 0000000..7f4d811
--- /dev/null
+++ b/config/versions/duma.in
@@ -0,0 +1,99 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of duma"
+
+config DUMA_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config DUMA_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ :pserver:anonymous@duma.cvs.sourceforge.net:/cvsroot/duma
+
+if DUMA_SRC_DEVEL
+
+config DUMA_DEVEL_VCS
+ string
+ default "cvs"
+
+config DUMA_DEVEL_URL
+ string
+ default ":pserver:anonymous@duma.cvs.sourceforge.net:/cvsroot/duma"
+
+config DUMA_DEVEL_BRANCH
+ string "Branch to check out"
+ default ""
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config DUMA_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config DUMA_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if DUMA_SRC_CUSTOM
+
+config DUMA_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config DUMA_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of duma"
+ help
+ For a released version, select the version of duma to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building duma.
+
+config DUMA_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on DUMA_SRC_DEVEL || DUMA_SRC_CUSTOM
+
+config DUMA_V_2_5_15
+ bool "2_5_15"
+
+config DUMA_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on DUMA_SRC_DEVEL || DUMA_SRC_CUSTOM
+
+endchoice
+
+
+
+config DUMA_VERSION
+ string
+ default "2_5_15" if DUMA_V_2_5_15
+ default "unknown"
+
+
diff --git a/config/versions/elf2flt.in b/config/versions/elf2flt.in
new file mode 100644
index 0000000..20d5e6a
--- /dev/null
+++ b/config/versions/elf2flt.in
@@ -0,0 +1,64 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+choice
+ bool "Source of elf2flt"
+
+config ELF2FLT_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://github.com/uclinux-dev/elf2flt.git
+
+if ELF2FLT_SRC_DEVEL
+
+config ELF2FLT_DEVEL_VCS
+ string
+ default "git"
+
+config ELF2FLT_DEVEL_URL
+ string
+ default "https://github.com/uclinux-dev/elf2flt.git"
+
+config ELF2FLT_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config ELF2FLT_DEVEL_REVISION
+ string "Revision/changeset"
+ default "6d80ab6c93409e796f85da404bde84b841231531"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config ELF2FLT_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if ELF2FLT_SRC_CUSTOM
+
+config ELF2FLT_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+
+
+
+
+config ELF2FLT_VERSION
+ string
+ default "unknown"
+
+
diff --git a/config/versions/expat.in b/config/versions/expat.in
new file mode 100644
index 0000000..b7b61ca
--- /dev/null
+++ b/config/versions/expat.in
@@ -0,0 +1,104 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of expat"
+
+config EXPAT_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config EXPAT_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://github.com/libexpat/libexpat.git
+
+if EXPAT_SRC_DEVEL
+
+config EXPAT_DEVEL_VCS
+ string
+ default "git"
+
+config EXPAT_DEVEL_URL
+ string
+ default "https://github.com/libexpat/libexpat.git"
+
+config EXPAT_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config EXPAT_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config EXPAT_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if EXPAT_SRC_CUSTOM
+
+config EXPAT_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config EXPAT_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of expat"
+ help
+ For a released version, select the version of expat to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building expat.
+
+config EXPAT_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on EXPAT_SRC_DEVEL || EXPAT_SRC_CUSTOM
+
+config EXPAT_V_2_2_0
+ bool "2.2.0"
+
+config EXPAT_V_2_1_1
+ bool "2.1.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config EXPAT_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on EXPAT_SRC_DEVEL || EXPAT_SRC_CUSTOM
+
+endchoice
+
+
+
+config EXPAT_VERSION
+ string
+ default "2.2.0" if EXPAT_V_2_2_0
+ default "2.1.1" if EXPAT_V_2_1_1
+ default "unknown"
+
+
diff --git a/config/versions/gcc.in b/config/versions/gcc.in
new file mode 100644
index 0000000..3610f63
--- /dev/null
+++ b/config/versions/gcc.in
@@ -0,0 +1,436 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+choice
+ bool "Show gcc versions from"
+
+config GCC_USE_GNU
+ bool "GNU"
+ help
+ GNU (which is a recursive acronym for "GNU's Not Unix") provides GNU binutils,
+ GNU C Compiler (gcc), GNU debugger (gdb) and many other utilities. GNU is
+ considered the master source for these packages.
+
+ You should select "GNU" here unless you definitely know that you need some version
+ from another source.
+
+config GCC_USE_LINARO
+ bool "Linaro"
+ depends on EXPERIMENTAL
+ help
+ Linaro is maintaining some advanced/more stable/experimental versions
+ of binutils, gcc, glibc and gdb, especially for the ARM architecture.
+ These versions contain some changes that are not (yet?) merged into
+ their respective upstream repositories.
+
+endchoice
+
+config GCC_USE
+ string
+ default "GCC" if GCC_USE_GNU
+ default "GCC_LINARO" if GCC_USE_LINARO
+
+
+if GCC_USE_GNU
+
+if EXPERIMENTAL
+choice
+ bool "Source of gcc"
+
+config GCC_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GCC_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ svn://gcc.gnu.org/svn/gcc
+
+if GCC_SRC_DEVEL
+
+config GCC_DEVEL_VCS
+ string
+ default "svn"
+
+config GCC_DEVEL_URL
+ string
+ default "svn://gcc.gnu.org/svn/gcc"
+
+config GCC_DEVEL_BRANCH
+ string "Branch to check out"
+ default "/trunk"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GCC_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GCC_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GCC_SRC_CUSTOM
+
+config GCC_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GCC_MIRRORS_ARRAY
+ string
+ default "ftp://ftp.gnu.org/gnu/gcc/gcc-${CT_GCC_VERSION} https://ftp.gnu.org/gnu/gcc/gcc-${CT_GCC_VERSION} ftp://sourceware.org/pub/gcc/releases/gcc-${CT_GCC_VERSION} ftp://gcc.gnu.org/pub/gcc/releases/gcc-${CT_GCC_VERSION}"
+
+choice
+ bool "Version of gcc"
+ help
+ For a released version, select the version of gcc to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building gcc.
+
+config GCC_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on GCC_SRC_DEVEL || GCC_SRC_CUSTOM
+ select GCC_7_or_later
+ depends on !GCC_REQUIRE_7_or_older
+ select GCC_6_or_later
+ depends on !GCC_REQUIRE_6_or_older
+ select GCC_5_or_later
+ depends on !GCC_REQUIRE_5_or_older
+ select GCC_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_older
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_V_7_1_0
+ bool "7.1.0"
+ select GCC_7_or_later
+ depends on !GCC_REQUIRE_7_or_older
+ select GCC_6_or_later
+ depends on !GCC_REQUIRE_6_or_older
+ select GCC_5_or_later
+ depends on !GCC_REQUIRE_5_or_older
+ select GCC_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_older
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_V_6_3_0
+ bool "6.3.0"
+ depends on !GCC_REQUIRE_7_or_later
+ select GCC_6_or_later
+ depends on !GCC_REQUIRE_6_or_older
+ select GCC_5_or_later
+ depends on !GCC_REQUIRE_5_or_older
+ select GCC_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_older
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_V_5_4_0
+ bool "5.4.0"
+ depends on !GCC_REQUIRE_7_or_later
+ depends on !GCC_REQUIRE_6_or_later
+ select GCC_5_or_later
+ depends on !GCC_REQUIRE_5_or_older
+ select GCC_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_older
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_V_4_9_4
+ bool "4.9.4"
+ depends on !GCC_REQUIRE_7_or_later
+ depends on !GCC_REQUIRE_6_or_later
+ depends on !GCC_REQUIRE_5_or_later
+ select GCC_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_older
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_V_4_8_5
+ bool "4.8.5 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GCC_REQUIRE_7_or_later
+ depends on !GCC_REQUIRE_6_or_later
+ depends on !GCC_REQUIRE_5_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_or_later
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on GCC_SRC_DEVEL || GCC_SRC_CUSTOM
+ depends on !GCC_REQUIRE_7_or_later
+ depends on !GCC_REQUIRE_6_or_later
+ depends on !GCC_REQUIRE_5_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_or_later
+ depends on !GCC_REQUIRE_4_8_or_later
+
+endchoice
+
+
+endif
+
+config GCC_VERSION
+ string
+ default "7.1.0" if GCC_V_7_1_0
+ default "6.3.0" if GCC_V_6_3_0
+ default "5.4.0" if GCC_V_5_4_0
+ default "4.9.4" if GCC_V_4_9_4
+ default "4.8.5" if GCC_V_4_8_5
+ default "unknown"
+
+if GCC_USE_LINARO
+
+if EXPERIMENTAL
+choice
+ bool "Source of gcc-linaro"
+
+config GCC_LINARO_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GCC_LINARO_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.linaro.org/toolchain/gcc.git
+
+if GCC_LINARO_SRC_DEVEL
+
+config GCC_LINARO_DEVEL_VCS
+ string
+ default "git"
+
+config GCC_LINARO_DEVEL_URL
+ string
+ default "https://git.linaro.org/toolchain/gcc.git"
+
+config GCC_LINARO_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GCC_LINARO_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GCC_LINARO_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GCC_LINARO_SRC_CUSTOM
+
+config GCC_LINARO_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GCC_LINARO_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of gcc-linaro"
+ help
+ For a released version, select the version of gcc-linaro to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building gcc-linaro.
+
+config GCC_LINARO_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on GCC_LINARO_SRC_DEVEL || GCC_LINARO_SRC_CUSTOM
+ select GCC_7_or_later
+ depends on !GCC_REQUIRE_7_or_older
+ select GCC_6_or_later
+ depends on !GCC_REQUIRE_6_or_older
+ select GCC_5_or_later
+ depends on !GCC_REQUIRE_5_or_older
+ select GCC_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_older
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_LINARO_V_6_3_2017_02
+ bool "6.3-2017.02 (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ depends on !GCC_REQUIRE_7_or_later
+ select GCC_6_or_later
+ depends on !GCC_REQUIRE_6_or_older
+ select GCC_5_or_later
+ depends on !GCC_REQUIRE_5_or_older
+ select GCC_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_older
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_LINARO_V_5_4_2017_01
+ bool "5.4-2017.01 (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ depends on !GCC_REQUIRE_7_or_later
+ depends on !GCC_REQUIRE_6_or_later
+ select GCC_5_or_later
+ depends on !GCC_REQUIRE_5_or_older
+ select GCC_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_older
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_LINARO_V_4_9_2017_01
+ bool "4.9-2017.01 (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ depends on !GCC_REQUIRE_7_or_later
+ depends on !GCC_REQUIRE_6_or_later
+ depends on !GCC_REQUIRE_5_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_later
+ select GCC_4_9_or_later
+ depends on !GCC_REQUIRE_4_9_or_older
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_LINARO_V_4_8_2015_06
+ bool "4.8-2015.06 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ depends on !GCC_REQUIRE_7_or_later
+ depends on !GCC_REQUIRE_6_or_later
+ depends on !GCC_REQUIRE_5_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_or_later
+ select GCC_4_8_or_later
+ depends on !GCC_REQUIRE_4_8_or_older
+
+config GCC_LINARO_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on GCC_LINARO_SRC_DEVEL || GCC_LINARO_SRC_CUSTOM
+ depends on !GCC_REQUIRE_7_or_later
+ depends on !GCC_REQUIRE_6_or_later
+ depends on !GCC_REQUIRE_5_or_later
+ depends on !GCC_REQUIRE_4_9_2_or_later
+ depends on !GCC_REQUIRE_4_9_or_later
+ depends on !GCC_REQUIRE_4_8_or_later
+
+endchoice
+
+
+endif
+
+config GCC_LINARO_VERSION
+ string
+ default "6.3-2017.02" if GCC_LINARO_V_6_3_2017_02
+ default "5.4-2017.01" if GCC_LINARO_V_5_4_2017_01
+ default "4.9-2017.01" if GCC_LINARO_V_4_9_2017_01
+ default "4.8-2015.06" if GCC_LINARO_V_4_8_2015_06
+ default "unknown"
+
+
+config GCC_7_or_later
+ bool
+
+config GCC_REQUIRE_7_or_later
+ bool
+
+config GCC_REQUIRE_7_or_older
+ bool
+
+config GCC_6_or_later
+ bool
+
+config GCC_REQUIRE_6_or_later
+ bool
+
+config GCC_REQUIRE_6_or_older
+ bool
+
+config GCC_5_or_later
+ bool
+
+config GCC_REQUIRE_5_or_later
+ bool
+
+config GCC_REQUIRE_5_or_older
+ bool
+
+config GCC_4_9_2_or_later
+ bool
+
+config GCC_REQUIRE_4_9_2_or_later
+ bool
+
+config GCC_REQUIRE_4_9_2_or_older
+ bool
+
+config GCC_4_9_or_later
+ bool
+
+config GCC_REQUIRE_4_9_or_later
+ bool
+
+config GCC_REQUIRE_4_9_or_older
+ bool
+
+config GCC_4_8_or_later
+ bool
+
+config GCC_REQUIRE_4_8_or_later
+ bool
+
+config GCC_REQUIRE_4_8_or_older
+ bool
+
diff --git a/config/versions/gdb.in b/config/versions/gdb.in
new file mode 100644
index 0000000..e8c234f
--- /dev/null
+++ b/config/versions/gdb.in
@@ -0,0 +1,502 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+choice
+ bool "Show gdb versions from"
+
+config GDB_USE_GNU
+ bool "GNU"
+ help
+ GNU (which is a recursive acronym for "GNU's Not Unix") provides GNU binutils,
+ GNU C Compiler (gcc), GNU debugger (gdb) and many other utilities. GNU is
+ considered the master source for these packages.
+
+ You should select "GNU" here unless you definitely know that you need some version
+ from another source.
+
+config GDB_USE_LINARO
+ bool "Linaro"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ help
+ Linaro is maintaining some advanced/more stable/experimental versions
+ of binutils, gcc, glibc and gdb, especially for the ARM architecture.
+ These versions contain some changes that are not (yet?) merged into
+ their respective upstream repositories.
+
+endchoice
+
+config GDB_USE
+ string
+ default "GDB" if GDB_USE_GNU
+ default "GDB_LINARO" if GDB_USE_LINARO
+
+
+if GDB_USE_GNU
+
+if EXPERIMENTAL
+choice
+ bool "Source of gdb"
+
+config GDB_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GDB_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ ssh://sourceware.org/git/binutils-gdb.git
+
+if GDB_SRC_DEVEL
+
+config GDB_DEVEL_VCS
+ string
+ default "git"
+
+config GDB_DEVEL_URL
+ string
+ default "ssh://sourceware.org/git/binutils-gdb.git"
+
+config GDB_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GDB_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GDB_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GDB_SRC_CUSTOM
+
+config GDB_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GDB_MIRRORS_ARRAY
+ string
+ default " $( mirrors GNU gdb ) $( mirrors sourceware gdb ) $( mirrors GCC_GNU gdb )"
+
+choice
+ bool "Version of gdb"
+ help
+ For a released version, select the version of gdb to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building gdb.
+
+config GDB_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on GDB_SRC_DEVEL || GDB_SRC_CUSTOM
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_12_1
+ bool "7.12.1"
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_11_1
+ bool "7.11.1"
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_10_1
+ bool "7.10.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_10
+ bool "7.10 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_9_1
+ bool "7.9.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_9
+ bool "7.9 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_8_1
+ bool "7.8.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_8
+ bool "7.8 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_7_1
+ bool "7.7.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_7
+ bool "7.7 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_6_1
+ bool "7.6.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_5_1
+ bool "7.5.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_4_1
+ bool "7.4.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_4
+ bool "7.4 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_3A
+ bool "7.3a (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_3_1
+ bool "7.3.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_2A
+ bool "7.2a (OBSOLETE)"
+ depends on OBSOLETE
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_1A
+ bool "7.1a (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GDB_REQUIRE_7_2_or_later
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_0A
+ bool "7.0a (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GDB_REQUIRE_7_2_or_later
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_7_0_1A
+ bool "7.0.1a (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GDB_REQUIRE_7_2_or_later
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_V_6_8A
+ bool "6.8a (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GDB_REQUIRE_7_2_or_later
+ depends on !GDB_REQUIRE_7_0_or_later
+
+config GDB_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on GDB_SRC_DEVEL || GDB_SRC_CUSTOM
+ depends on !GDB_REQUIRE_7_2_or_later
+ depends on !GDB_REQUIRE_7_0_or_later
+
+endchoice
+
+
+endif
+
+config GDB_VERSION
+ string
+ default "7.12.1" if GDB_V_7_12_1
+ default "7.11.1" if GDB_V_7_11_1
+ default "7.10.1" if GDB_V_7_10_1
+ default "7.10" if GDB_V_7_10
+ default "7.9.1" if GDB_V_7_9_1
+ default "7.9" if GDB_V_7_9
+ default "7.8.1" if GDB_V_7_8_1
+ default "7.8" if GDB_V_7_8
+ default "7.7.1" if GDB_V_7_7_1
+ default "7.7" if GDB_V_7_7
+ default "7.6.1" if GDB_V_7_6_1
+ default "7.5.1" if GDB_V_7_5_1
+ default "7.4.1" if GDB_V_7_4_1
+ default "7.4" if GDB_V_7_4
+ default "7.3a" if GDB_V_7_3A
+ default "7.3.1" if GDB_V_7_3_1
+ default "7.2a" if GDB_V_7_2A
+ default "7.1a" if GDB_V_7_1A
+ default "7.0a" if GDB_V_7_0A
+ default "7.0.1a" if GDB_V_7_0_1A
+ default "6.8a" if GDB_V_6_8A
+ default "unknown"
+
+if GDB_USE_LINARO
+
+if EXPERIMENTAL
+choice
+ bool "Source of gdb-linaro"
+
+config GDB_LINARO_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GDB_LINARO_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.linaro.org/toolchain/binutils-gdb.git
+
+if GDB_LINARO_SRC_DEVEL
+
+config GDB_LINARO_DEVEL_VCS
+ string
+ default "git"
+
+config GDB_LINARO_DEVEL_URL
+ string
+ default "https://git.linaro.org/toolchain/binutils-gdb.git"
+
+config GDB_LINARO_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GDB_LINARO_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GDB_LINARO_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GDB_LINARO_SRC_CUSTOM
+
+config GDB_LINARO_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GDB_LINARO_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of gdb-linaro"
+ help
+ For a released version, select the version of gdb-linaro to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building gdb-linaro.
+
+config GDB_LINARO_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on GDB_LINARO_SRC_DEVEL || GDB_LINARO_SRC_CUSTOM
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_LINARO_V_7_8_2014_09
+ bool "7.8-2014.09 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_LINARO_V_7_7_1_2014_06_1
+ bool "7.7.1-2014.06-1 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_LINARO_V_7_7_2014_05
+ bool "7.7-2014.05 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_LINARO_V_7_6_1_2013_10
+ bool "7.6.1-2013.10 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_LINARO_V_7_5_2012_12
+ bool "7.5-2012.12 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_LINARO_V_7_4_2012_06
+ bool "7.4-2012.06 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_LINARO_V_7_3_2011_12
+ bool "7.3-2011.12 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select GDB_7_2_or_later
+ depends on !GDB_REQUIRE_7_2_or_older
+ select GDB_7_0_or_later
+ depends on !GDB_REQUIRE_7_0_or_older
+
+config GDB_LINARO_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on GDB_LINARO_SRC_DEVEL || GDB_LINARO_SRC_CUSTOM
+ depends on !GDB_REQUIRE_7_2_or_later
+ depends on !GDB_REQUIRE_7_0_or_later
+
+endchoice
+
+
+endif
+
+config GDB_LINARO_VERSION
+ string
+ default "7.8-2014.09" if GDB_LINARO_V_7_8_2014_09
+ default "7.7.1-2014.06-1" if GDB_LINARO_V_7_7_1_2014_06_1
+ default "7.7-2014.05" if GDB_LINARO_V_7_7_2014_05
+ default "7.6.1-2013.10" if GDB_LINARO_V_7_6_1_2013_10
+ default "7.5-2012.12" if GDB_LINARO_V_7_5_2012_12
+ default "7.4-2012.06" if GDB_LINARO_V_7_4_2012_06
+ default "7.3-2011.12" if GDB_LINARO_V_7_3_2011_12
+ default "unknown"
+
+
+config GDB_7_2_or_later
+ bool
+
+config GDB_REQUIRE_7_2_or_later
+ bool
+
+config GDB_REQUIRE_7_2_or_older
+ bool
+
+config GDB_7_0_or_later
+ bool
+
+config GDB_REQUIRE_7_0_or_later
+ bool
+
+config GDB_REQUIRE_7_0_or_older
+ bool
+
diff --git a/config/versions/gettext.in b/config/versions/gettext.in
new file mode 100644
index 0000000..88436e0
--- /dev/null
+++ b/config/versions/gettext.in
@@ -0,0 +1,104 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of gettext"
+
+config GETTEXT_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GETTEXT_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.savannah.gnu.org/git/gettext.git
+
+if GETTEXT_SRC_DEVEL
+
+config GETTEXT_DEVEL_VCS
+ string
+ default "git"
+
+config GETTEXT_DEVEL_URL
+ string
+ default "https://git.savannah.gnu.org/git/gettext.git"
+
+config GETTEXT_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GETTEXT_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GETTEXT_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GETTEXT_SRC_CUSTOM
+
+config GETTEXT_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GETTEXT_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of gettext"
+ help
+ For a released version, select the version of gettext to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building gettext.
+
+config GETTEXT_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on GETTEXT_SRC_DEVEL || GETTEXT_SRC_CUSTOM
+
+config GETTEXT_V_0_19_8_1
+ bool "0.19.8.1"
+
+config GETTEXT_V_0_19_7
+ bool "0.19.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config GETTEXT_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on GETTEXT_SRC_DEVEL || GETTEXT_SRC_CUSTOM
+
+endchoice
+
+
+
+config GETTEXT_VERSION
+ string
+ default "0.19.8.1" if GETTEXT_V_0_19_8_1
+ default "0.19.7" if GETTEXT_V_0_19_7
+ default "unknown"
+
+
diff --git a/config/versions/glibc-ports.in b/config/versions/glibc-ports.in
new file mode 100644
index 0000000..ea52b41
--- /dev/null
+++ b/config/versions/glibc-ports.in
@@ -0,0 +1,105 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of glibc-ports"
+
+config GLIBC_PORTS_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GLIBC_PORTS_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://sourceware.org/git/glibc-ports.git
+
+if GLIBC_PORTS_SRC_DEVEL
+
+config GLIBC_PORTS_DEVEL_VCS
+ string
+ default "git"
+
+config GLIBC_PORTS_DEVEL_URL
+ string
+ default "git://sourceware.org/git/glibc-ports.git"
+
+config GLIBC_PORTS_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GLIBC_PORTS_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GLIBC_PORTS_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GLIBC_PORTS_SRC_CUSTOM
+
+config GLIBC_PORTS_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GLIBC_PORTS_MIRRORS_ARRAY
+ string
+ default "https://ftp.gnu.org/gnu/glibc http://ftp.gnu.org/gnu/glibc ftp://ftp.gnu.org/gnu/glibc ftp://sourceware.org/pub/glibc/releases ftp://gcc.gnu.org/pub/glibc/releases"
+
+
+config GLIBC_PORTS_V_2_16_0
+ def_bool y
+ depends on GLIBC_V_2_16_0
+
+config GLIBC_PORTS_V_2_15
+ def_bool y
+ depends on GLIBC_V_2_15
+
+config GLIBC_PORTS_V_2_14_1
+ def_bool y
+ depends on GLIBC_V_2_14_1
+
+config GLIBC_PORTS_V_2_14
+ def_bool y
+ depends on GLIBC_V_2_14
+
+config GLIBC_PORTS_V_2_13
+ def_bool y
+ depends on GLIBC_V_2_13
+
+config GLIBC_PORTS_V_2_12_1
+ def_bool y
+ depends on GLIBC_V_2_12_1
+
+
+
+config GLIBC_PORTS_VERSION
+ string
+ default "2.16.0" if GLIBC_PORTS_V_2_16_0
+ default "2.15" if GLIBC_PORTS_V_2_15
+ default "2.14.1" if GLIBC_PORTS_V_2_14_1
+ default "2.14" if GLIBC_PORTS_V_2_14
+ default "2.13" if GLIBC_PORTS_V_2_13
+ default "2.12.1" if GLIBC_PORTS_V_2_12_1
+ default "unknown"
+
+
diff --git a/config/versions/glibc.in b/config/versions/glibc.in
new file mode 100644
index 0000000..1c8b2e9
--- /dev/null
+++ b/config/versions/glibc.in
@@ -0,0 +1,413 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+choice
+ bool "Show glibc versions from"
+
+config GLIBC_USE_GNU
+ bool "GNU"
+ help
+ GNU (which is a recursive acronym for "GNU's Not Unix") provides GNU binutils,
+ GNU C Compiler (gcc), GNU debugger (gdb) and many other utilities. GNU is
+ considered the master source for these packages.
+
+ You should select "GNU" here unless you definitely know that you need some version
+ from another source.
+
+config GLIBC_USE_LINARO
+ bool "Linaro"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ help
+ Linaro is maintaining some advanced/more stable/experimental versions
+ of binutils, gcc, glibc and gdb, especially for the ARM architecture.
+ These versions contain some changes that are not (yet?) merged into
+ their respective upstream repositories.
+
+endchoice
+
+config GLIBC_USE
+ string
+ default "GLIBC" if GLIBC_USE_GNU
+ default "GLIBC_LINARO" if GLIBC_USE_LINARO
+
+
+if GLIBC_USE_GNU
+
+if EXPERIMENTAL
+choice
+ bool "Source of glibc"
+
+config GLIBC_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GLIBC_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://sourceware.org/git/glibc.git
+
+if GLIBC_SRC_DEVEL
+
+config GLIBC_DEVEL_VCS
+ string
+ default "git"
+
+config GLIBC_DEVEL_URL
+ string
+ default "git://sourceware.org/git/glibc.git"
+
+config GLIBC_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GLIBC_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GLIBC_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GLIBC_SRC_CUSTOM
+
+config GLIBC_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GLIBC_MIRRORS_ARRAY
+ string
+ default "https://ftp.gnu.org/gnu/glibc http://ftp.gnu.org/gnu/glibc ftp://ftp.gnu.org/gnu/glibc ftp://sourceware.org/pub/glibc/releases ftp://gcc.gnu.org/pub/glibc/releases"
+
+choice
+ bool "Version of glibc"
+ help
+ For a released version, select the version of glibc to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building glibc.
+
+config GLIBC_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on GLIBC_SRC_DEVEL || GLIBC_SRC_CUSTOM
+ select GLIBC_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_23_or_older
+ select GLIBC_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_older
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_25
+ bool "2.25"
+ select GLIBC_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_23_or_older
+ select GLIBC_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_older
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_24
+ bool "2.24"
+ select GLIBC_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_23_or_older
+ select GLIBC_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_older
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_23
+ bool "2.23"
+ select GLIBC_2_23_or_later
+ select GLIBC_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_older
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_22
+ bool "2.22 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ select GLIBC_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_older
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_21
+ bool "2.21 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ select GLIBC_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_older
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_20
+ bool "2.20 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ select GLIBC_2_20_or_later
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_19
+ bool "2.19"
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_18
+ bool "2.18 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_V_2_17
+ bool "2.17"
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ select GLIBC_2_17_or_later
+
+config GLIBC_V_2_16_0
+ bool "2.16.0 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+config GLIBC_V_2_15
+ bool "2.15 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+config GLIBC_V_2_14_1
+ bool "2.14.1 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+config GLIBC_V_2_14
+ bool "2.14 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+config GLIBC_V_2_13
+ bool "2.13 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+config GLIBC_V_2_12_2
+ bool "2.12.2 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+config GLIBC_V_2_12_1
+ bool "2.12.1"
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+config GLIBC_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on GLIBC_SRC_DEVEL || GLIBC_SRC_CUSTOM
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+endchoice
+
+
+endif
+
+config GLIBC_VERSION
+ string
+ default "2.25" if GLIBC_V_2_25
+ default "2.24" if GLIBC_V_2_24
+ default "2.23" if GLIBC_V_2_23
+ default "2.22" if GLIBC_V_2_22
+ default "2.21" if GLIBC_V_2_21
+ default "2.20" if GLIBC_V_2_20
+ default "2.19" if GLIBC_V_2_19
+ default "2.18" if GLIBC_V_2_18
+ default "2.17" if GLIBC_V_2_17
+ default "2.16.0" if GLIBC_V_2_16_0
+ default "2.15" if GLIBC_V_2_15
+ default "2.14.1" if GLIBC_V_2_14_1
+ default "2.14" if GLIBC_V_2_14
+ default "2.13" if GLIBC_V_2_13
+ default "2.12.2" if GLIBC_V_2_12_2
+ default "2.12.1" if GLIBC_V_2_12_1
+ default "unknown"
+
+if GLIBC_USE_LINARO
+
+if EXPERIMENTAL
+choice
+ bool "Source of glibc-linaro"
+
+config GLIBC_LINARO_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GLIBC_LINARO_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.linaro.org/toolchain/glibc.git
+
+if GLIBC_LINARO_SRC_DEVEL
+
+config GLIBC_LINARO_DEVEL_VCS
+ string
+ default "git"
+
+config GLIBC_LINARO_DEVEL_URL
+ string
+ default "https://git.linaro.org/toolchain/glibc.git"
+
+config GLIBC_LINARO_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GLIBC_LINARO_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GLIBC_LINARO_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GLIBC_LINARO_SRC_CUSTOM
+
+config GLIBC_LINARO_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GLIBC_LINARO_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of glibc-linaro"
+ help
+ For a released version, select the version of glibc-linaro to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building glibc-linaro.
+
+config GLIBC_LINARO_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on GLIBC_LINARO_SRC_DEVEL || GLIBC_LINARO_SRC_CUSTOM
+ select GLIBC_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_23_or_older
+ select GLIBC_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_older
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_LINARO_V_2_20_2014_11
+ bool "2.20-2014.11 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ select GLIBC_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_older
+ select GLIBC_2_17_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_older
+
+config GLIBC_LINARO_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on GLIBC_LINARO_SRC_DEVEL || GLIBC_LINARO_SRC_CUSTOM
+ depends on !GLIBC_REQUIRE_2_23_or_later
+ depends on !GLIBC_REQUIRE_2_20_or_later
+ depends on !GLIBC_REQUIRE_2_17_or_later
+
+endchoice
+
+
+endif
+
+config GLIBC_LINARO_VERSION
+ string
+ default "2.20-2014.11" if GLIBC_LINARO_V_2_20_2014_11
+ default "unknown"
+
+
+config GLIBC_2_23_or_later
+ bool
+
+config GLIBC_REQUIRE_2_23_or_later
+ bool
+
+config GLIBC_REQUIRE_2_23_or_older
+ bool
+
+config GLIBC_2_20_or_later
+ bool
+
+config GLIBC_REQUIRE_2_20_or_later
+ bool
+
+config GLIBC_REQUIRE_2_20_or_older
+ bool
+
+config GLIBC_2_17_or_later
+ bool
+
+config GLIBC_REQUIRE_2_17_or_later
+ bool
+
+config GLIBC_REQUIRE_2_17_or_older
+ bool
+
diff --git a/config/versions/gmp.in b/config/versions/gmp.in
new file mode 100644
index 0000000..b4c738b
--- /dev/null
+++ b/config/versions/gmp.in
@@ -0,0 +1,171 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of gmp"
+
+config GMP_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config GMP_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://gmplib.org/repo/gmp/
+
+if GMP_SRC_DEVEL
+
+config GMP_DEVEL_VCS
+ string
+ default "hg"
+
+config GMP_DEVEL_URL
+ string
+ default "https://gmplib.org/repo/gmp/"
+
+config GMP_DEVEL_BRANCH
+ string "Branch to check out"
+ default ""
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config GMP_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config GMP_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if GMP_SRC_CUSTOM
+
+config GMP_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config GMP_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of gmp"
+ help
+ For a released version, select the version of gmp to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building gmp.
+
+config GMP_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on GMP_SRC_DEVEL || GMP_SRC_CUSTOM
+ select GMP_5_1_or_later
+ depends on !GMP_REQUIRE_5_1_or_older
+
+config GMP_V_6_1_2
+ bool "6.1.2"
+ select GMP_5_1_or_later
+ depends on !GMP_REQUIRE_5_1_or_older
+
+config GMP_V_6_1_0
+ bool "6.1.0 (OBSOLETE)"
+ depends on OBSOLETE
+ select GMP_5_1_or_later
+ depends on !GMP_REQUIRE_5_1_or_older
+
+config GMP_V_6_0_0A
+ bool "6.0.0a (OBSOLETE)"
+ depends on OBSOLETE
+ select GMP_5_1_or_later
+ depends on !GMP_REQUIRE_5_1_or_older
+
+config GMP_V_5_1_3
+ bool "5.1.3 (OBSOLETE)"
+ depends on OBSOLETE
+ select GMP_5_1_or_later
+ depends on !GMP_REQUIRE_5_1_or_older
+
+config GMP_V_5_1_1
+ bool "5.1.1 (OBSOLETE)"
+ depends on OBSOLETE
+ select GMP_5_1_or_later
+ depends on !GMP_REQUIRE_5_1_or_older
+
+config GMP_V_5_0_2
+ bool "5.0.2 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GMP_REQUIRE_5_1_or_later
+
+config GMP_V_5_0_1
+ bool "5.0.1 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GMP_REQUIRE_5_1_or_later
+
+config GMP_V_4_3_2
+ bool "4.3.2 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GMP_REQUIRE_5_1_or_later
+
+config GMP_V_4_3_1
+ bool "4.3.1 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GMP_REQUIRE_5_1_or_later
+
+config GMP_V_4_3_0
+ bool "4.3.0 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !GMP_REQUIRE_5_1_or_later
+
+config GMP_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on GMP_SRC_DEVEL || GMP_SRC_CUSTOM
+ depends on !GMP_REQUIRE_5_1_or_later
+
+endchoice
+
+
+
+config GMP_VERSION
+ string
+ default "6.1.2" if GMP_V_6_1_2
+ default "6.1.0" if GMP_V_6_1_0
+ default "6.0.0a" if GMP_V_6_0_0A
+ default "5.1.3" if GMP_V_5_1_3
+ default "5.1.1" if GMP_V_5_1_1
+ default "5.0.2" if GMP_V_5_0_2
+ default "5.0.1" if GMP_V_5_0_1
+ default "4.3.2" if GMP_V_4_3_2
+ default "4.3.1" if GMP_V_4_3_1
+ default "4.3.0" if GMP_V_4_3_0
+ default "unknown"
+
+
+config GMP_5_1_or_later
+ bool
+
+config GMP_REQUIRE_5_1_or_later
+ bool
+
+config GMP_REQUIRE_5_1_or_older
+ bool
+
diff --git a/config/versions/isl.in b/config/versions/isl.in
new file mode 100644
index 0000000..5753d76
--- /dev/null
+++ b/config/versions/isl.in
@@ -0,0 +1,174 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of isl"
+
+config ISL_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config ISL_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://repo.or.cz/isl.git
+
+if ISL_SRC_DEVEL
+
+config ISL_DEVEL_VCS
+ string
+ default "git"
+
+config ISL_DEVEL_URL
+ string
+ default "git://repo.or.cz/isl.git"
+
+config ISL_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config ISL_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config ISL_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if ISL_SRC_CUSTOM
+
+config ISL_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config ISL_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of isl"
+ help
+ For a released version, select the version of isl to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building isl.
+
+config ISL_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on ISL_SRC_DEVEL || ISL_SRC_CUSTOM
+ select ISL_0_14_or_later
+ depends on !ISL_REQUIRE_0_14_or_older
+ select ISL_0_12_or_later
+ depends on !ISL_REQUIRE_0_12_or_older
+
+config ISL_V_0_18
+ bool "0.18"
+ select ISL_0_14_or_later
+ depends on !ISL_REQUIRE_0_14_or_older
+ select ISL_0_12_or_later
+ depends on !ISL_REQUIRE_0_12_or_older
+
+config ISL_V_0_17_1
+ bool "0.17.1"
+ select ISL_0_14_or_later
+ depends on !ISL_REQUIRE_0_14_or_older
+ select ISL_0_12_or_later
+ depends on !ISL_REQUIRE_0_12_or_older
+
+config ISL_V_0_16_1
+ bool "0.16.1"
+ select ISL_0_14_or_later
+ depends on !ISL_REQUIRE_0_14_or_older
+ select ISL_0_12_or_later
+ depends on !ISL_REQUIRE_0_12_or_older
+
+config ISL_V_0_15
+ bool "0.15"
+ select ISL_0_14_or_later
+ depends on !ISL_REQUIRE_0_14_or_older
+ select ISL_0_12_or_later
+ depends on !ISL_REQUIRE_0_12_or_older
+
+config ISL_V_0_14
+ bool "0.14 (OBSOLETE)"
+ depends on OBSOLETE
+ select ISL_0_14_or_later
+ select ISL_0_12_or_later
+ depends on !ISL_REQUIRE_0_12_or_older
+
+config ISL_V_0_12_2
+ bool "0.12.2 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !ISL_REQUIRE_0_14_or_later
+ select ISL_0_12_or_later
+ depends on !ISL_REQUIRE_0_12_or_older
+
+config ISL_V_0_11_1
+ bool "0.11.1 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !ISL_REQUIRE_0_14_or_later
+ depends on !ISL_REQUIRE_0_12_or_later
+
+config ISL_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on ISL_SRC_DEVEL || ISL_SRC_CUSTOM
+ depends on !ISL_REQUIRE_0_14_or_later
+ depends on !ISL_REQUIRE_0_12_or_later
+
+endchoice
+
+
+
+config ISL_VERSION
+ string
+ default "0.18" if ISL_V_0_18
+ default "0.17.1" if ISL_V_0_17_1
+ default "0.16.1" if ISL_V_0_16_1
+ default "0.15" if ISL_V_0_15
+ default "0.14" if ISL_V_0_14
+ default "0.12.2" if ISL_V_0_12_2
+ default "0.11.1" if ISL_V_0_11_1
+ default "unknown"
+
+
+config ISL_0_14_or_later
+ bool
+
+config ISL_REQUIRE_0_14_or_later
+ bool
+
+config ISL_REQUIRE_0_14_or_older
+ bool
+
+config ISL_0_12_or_later
+ bool
+
+config ISL_REQUIRE_0_12_or_later
+ bool
+
+config ISL_REQUIRE_0_12_or_older
+ bool
+
diff --git a/config/versions/libelf.in b/config/versions/libelf.in
new file mode 100644
index 0000000..d51084c
--- /dev/null
+++ b/config/versions/libelf.in
@@ -0,0 +1,73 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of libelf"
+
+config LIBELF_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config LIBELF_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if LIBELF_SRC_CUSTOM
+
+config LIBELF_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config LIBELF_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of libelf"
+ help
+ For a released version, select the version of libelf to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building libelf.
+
+config LIBELF_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on LIBELF_SRC_DEVEL || LIBELF_SRC_CUSTOM
+
+config LIBELF_V_0_8_13
+ bool "0.8.13"
+
+config LIBELF_V_0_8_12
+ bool "0.8.12 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LIBELF_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on LIBELF_SRC_DEVEL || LIBELF_SRC_CUSTOM
+
+endchoice
+
+
+
+config LIBELF_VERSION
+ string
+ default "0.8.13" if LIBELF_V_0_8_13
+ default "0.8.12" if LIBELF_V_0_8_12
+ default "unknown"
+
+
diff --git a/config/versions/libiconv.in b/config/versions/libiconv.in
new file mode 100644
index 0000000..991c5ee
--- /dev/null
+++ b/config/versions/libiconv.in
@@ -0,0 +1,104 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of libiconv"
+
+config LIBICONV_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config LIBICONV_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.savannah.gnu.org/git/libiconv.git
+
+if LIBICONV_SRC_DEVEL
+
+config LIBICONV_DEVEL_VCS
+ string
+ default "git"
+
+config LIBICONV_DEVEL_URL
+ string
+ default "https://git.savannah.gnu.org/git/libiconv.git"
+
+config LIBICONV_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config LIBICONV_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config LIBICONV_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if LIBICONV_SRC_CUSTOM
+
+config LIBICONV_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config LIBICONV_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of libiconv"
+ help
+ For a released version, select the version of libiconv to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building libiconv.
+
+config LIBICONV_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on LIBICONV_SRC_DEVEL || LIBICONV_SRC_CUSTOM
+
+config LIBICONV_V_1_15
+ bool "1.15"
+
+config LIBICONV_V_1_14
+ bool "1.14 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LIBICONV_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on LIBICONV_SRC_DEVEL || LIBICONV_SRC_CUSTOM
+
+endchoice
+
+
+
+config LIBICONV_VERSION
+ string
+ default "1.15" if LIBICONV_V_1_15
+ default "1.14" if LIBICONV_V_1_14
+ default "unknown"
+
+
diff --git a/config/versions/libtool.in b/config/versions/libtool.in
new file mode 100644
index 0000000..64b5bee
--- /dev/null
+++ b/config/versions/libtool.in
@@ -0,0 +1,99 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of libtool"
+
+config LIBTOOL_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config LIBTOOL_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://git.savannah.gnu.org/libtool.git
+
+if LIBTOOL_SRC_DEVEL
+
+config LIBTOOL_DEVEL_VCS
+ string
+ default "git"
+
+config LIBTOOL_DEVEL_URL
+ string
+ default "git://git.savannah.gnu.org/libtool.git"
+
+config LIBTOOL_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config LIBTOOL_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config LIBTOOL_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if LIBTOOL_SRC_CUSTOM
+
+config LIBTOOL_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config LIBTOOL_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of libtool"
+ help
+ For a released version, select the version of libtool to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building libtool.
+
+config LIBTOOL_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on LIBTOOL_SRC_DEVEL || LIBTOOL_SRC_CUSTOM
+
+config LIBTOOL_V_2_4_6
+ bool "2.4.6"
+
+config LIBTOOL_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on LIBTOOL_SRC_DEVEL || LIBTOOL_SRC_CUSTOM
+
+endchoice
+
+
+
+config LIBTOOL_VERSION
+ string
+ default "2.4.6" if LIBTOOL_V_2_4_6
+ default "unknown"
+
+
diff --git a/config/versions/linux.in b/config/versions/linux.in
new file mode 100644
index 0000000..eacc452
--- /dev/null
+++ b/config/versions/linux.in
@@ -0,0 +1,280 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of linux"
+
+config LINUX_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config LINUX_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+
+if LINUX_SRC_DEVEL
+
+config LINUX_DEVEL_VCS
+ string
+ default "git"
+
+config LINUX_DEVEL_URL
+ string
+ default "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
+
+config LINUX_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config LINUX_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config LINUX_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if LINUX_SRC_CUSTOM
+
+config LINUX_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config LINUX_MIRRORS_ARRAY
+ string
+ default "http://www.kernel.org/pub/linux/kernel http://www.kernel.org/pub/linux/kernel/longterm http://www.kernel.org/pub/linux/kernel/longterm/v${CT_LINUX_BASE_VERSION}"
+
+choice
+ bool "Version of linux"
+ help
+ For a released version, select the version of linux to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building linux.
+
+config LINUX_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on LINUX_SRC_DEVEL || LINUX_SRC_CUSTOM
+
+config LINUX_V_4_10_8
+ bool "4.10.8 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_4_9_20
+ bool "4.9.20"
+
+config LINUX_V_4_8_17
+ bool "4.8.17 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_4_7_10
+ bool "4.7.10 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_4_6_7
+ bool "4.6.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_4_5_7
+ bool "4.5.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_4_4_59
+ bool "4.4.59"
+
+config LINUX_V_4_3_6
+ bool "4.3.6 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_4_2_8
+ bool "4.2.8 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_4_1_39
+ bool "4.1.39"
+
+config LINUX_V_4_0_9
+ bool "4.0.9 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_19_8
+ bool "3.19.8 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_18_48
+ bool "3.18.48 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_17_8
+ bool "3.17.8 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_16_42
+ bool "3.16.42"
+
+config LINUX_V_3_15_10
+ bool "3.15.10 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_14_79
+ bool "3.14.79 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_13_11
+ bool "3.13.11"
+
+config LINUX_V_3_12_72
+ bool "3.12.72"
+
+config LINUX_V_3_11_10
+ bool "3.11.10 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_10_105
+ bool "3.10.105"
+
+config LINUX_V_3_9_11
+ bool "3.9.11 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_8_13
+ bool "3.8.13 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_7_10
+ bool "3.7.10 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_6_11
+ bool "3.6.11 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_5_7
+ bool "3.5.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_4_113
+ bool "3.4.113"
+
+config LINUX_V_3_3_8
+ bool "3.3.8 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_2_87
+ bool "3.2.87"
+
+config LINUX_V_3_1_10
+ bool "3.1.10 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_3_0_101
+ bool "3.0.101 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_2_6_39_4
+ bool "2.6.39.4 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_2_6_38_8
+ bool "2.6.38.8 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_2_6_37_6
+ bool "2.6.37.6 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_2_6_36_4
+ bool "2.6.36.4 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_2_6_35_9
+ bool "2.6.35.9 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_2_6_34_7
+ bool "2.6.34.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_2_6_33_7
+ bool "2.6.33.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LINUX_V_2_6_32_27
+ bool "2.6.32.27"
+
+config LINUX_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on LINUX_SRC_DEVEL || LINUX_SRC_CUSTOM
+
+endchoice
+
+
+
+config LINUX_VERSION
+ string
+ default "4.10.8" if LINUX_V_4_10_8
+ default "4.9.20" if LINUX_V_4_9_20
+ default "4.8.17" if LINUX_V_4_8_17
+ default "4.7.10" if LINUX_V_4_7_10
+ default "4.6.7" if LINUX_V_4_6_7
+ default "4.5.7" if LINUX_V_4_5_7
+ default "4.4.59" if LINUX_V_4_4_59
+ default "4.3.6" if LINUX_V_4_3_6
+ default "4.2.8" if LINUX_V_4_2_8
+ default "4.1.39" if LINUX_V_4_1_39
+ default "4.0.9" if LINUX_V_4_0_9
+ default "3.19.8" if LINUX_V_3_19_8
+ default "3.18.48" if LINUX_V_3_18_48
+ default "3.17.8" if LINUX_V_3_17_8
+ default "3.16.42" if LINUX_V_3_16_42
+ default "3.15.10" if LINUX_V_3_15_10
+ default "3.14.79" if LINUX_V_3_14_79
+ default "3.13.11" if LINUX_V_3_13_11
+ default "3.12.72" if LINUX_V_3_12_72
+ default "3.11.10" if LINUX_V_3_11_10
+ default "3.10.105" if LINUX_V_3_10_105
+ default "3.9.11" if LINUX_V_3_9_11
+ default "3.8.13" if LINUX_V_3_8_13
+ default "3.7.10" if LINUX_V_3_7_10
+ default "3.6.11" if LINUX_V_3_6_11
+ default "3.5.7" if LINUX_V_3_5_7
+ default "3.4.113" if LINUX_V_3_4_113
+ default "3.3.8" if LINUX_V_3_3_8
+ default "3.2.87" if LINUX_V_3_2_87
+ default "3.1.10" if LINUX_V_3_1_10
+ default "3.0.101" if LINUX_V_3_0_101
+ default "2.6.39.4" if LINUX_V_2_6_39_4
+ default "2.6.38.8" if LINUX_V_2_6_38_8
+ default "2.6.37.6" if LINUX_V_2_6_37_6
+ default "2.6.36.4" if LINUX_V_2_6_36_4
+ default "2.6.35.9" if LINUX_V_2_6_35_9
+ default "2.6.34.7" if LINUX_V_2_6_34_7
+ default "2.6.33.7" if LINUX_V_2_6_33_7
+ default "2.6.32.27" if LINUX_V_2_6_32_27
+ default "unknown"
+
+
diff --git a/config/versions/ltrace.in b/config/versions/ltrace.in
new file mode 100644
index 0000000..e28a139
--- /dev/null
+++ b/config/versions/ltrace.in
@@ -0,0 +1,104 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of ltrace"
+
+config LTRACE_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config LTRACE_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://git.debian.org/git/collab-maint/ltrace.git
+
+if LTRACE_SRC_DEVEL
+
+config LTRACE_DEVEL_VCS
+ string
+ default "git"
+
+config LTRACE_DEVEL_URL
+ string
+ default "git://git.debian.org/git/collab-maint/ltrace.git"
+
+config LTRACE_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config LTRACE_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config LTRACE_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if LTRACE_SRC_CUSTOM
+
+config LTRACE_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config LTRACE_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of ltrace"
+ help
+ For a released version, select the version of ltrace to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building ltrace.
+
+config LTRACE_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on LTRACE_SRC_DEVEL || LTRACE_SRC_CUSTOM
+
+config LTRACE_V_0_7_3
+ bool "0.7.3"
+
+config LTRACE_V_0_5_3
+ bool "0.5.3 (OBSOLETE)"
+ depends on OBSOLETE
+
+config LTRACE_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on LTRACE_SRC_DEVEL || LTRACE_SRC_CUSTOM
+
+endchoice
+
+
+
+config LTRACE_VERSION
+ string
+ default "0.7.3" if LTRACE_V_0_7_3
+ default "0.5.3" if LTRACE_V_0_5_3
+ default "unknown"
+
+
diff --git a/config/versions/m4.in b/config/versions/m4.in
new file mode 100644
index 0000000..959f186
--- /dev/null
+++ b/config/versions/m4.in
@@ -0,0 +1,109 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of m4"
+
+config M4_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config M4_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://git.sv.gnu.org/m4
+
+if M4_SRC_DEVEL
+
+config M4_DEVEL_VCS
+ string
+ default "git"
+
+config M4_DEVEL_URL
+ string
+ default "git://git.sv.gnu.org/m4"
+
+config M4_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config M4_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config M4_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if M4_SRC_CUSTOM
+
+config M4_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config M4_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of m4"
+ help
+ For a released version, select the version of m4 to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building m4.
+
+config M4_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on M4_SRC_DEVEL || M4_SRC_CUSTOM
+
+config M4_V_1_4_18
+ bool "1.4.18"
+
+config M4_V_1_4_17
+ bool "1.4.17 (OBSOLETE)"
+ depends on OBSOLETE
+
+config M4_V_1_4_13
+ bool "1.4.13 (OBSOLETE)"
+ depends on OBSOLETE
+
+config M4_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on M4_SRC_DEVEL || M4_SRC_CUSTOM
+
+endchoice
+
+
+
+config M4_VERSION
+ string
+ default "1.4.18" if M4_V_1_4_18
+ default "1.4.17" if M4_V_1_4_17
+ default "1.4.13" if M4_V_1_4_13
+ default "unknown"
+
+
diff --git a/config/versions/make.in b/config/versions/make.in
new file mode 100644
index 0000000..6f0a607
--- /dev/null
+++ b/config/versions/make.in
@@ -0,0 +1,114 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of make"
+
+config MAKE_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config MAKE_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.savannah.gnu.org/git/make.git
+
+if MAKE_SRC_DEVEL
+
+config MAKE_DEVEL_VCS
+ string
+ default "git"
+
+config MAKE_DEVEL_URL
+ string
+ default "https://git.savannah.gnu.org/git/make.git"
+
+config MAKE_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config MAKE_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config MAKE_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if MAKE_SRC_CUSTOM
+
+config MAKE_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config MAKE_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of make"
+ help
+ For a released version, select the version of make to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building make.
+
+config MAKE_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on MAKE_SRC_DEVEL || MAKE_SRC_CUSTOM
+
+config MAKE_V_4_2_1
+ bool "4.2.1"
+
+config MAKE_V_4_1
+ bool "4.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MAKE_V_4_0
+ bool "4.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MAKE_V_3_81
+ bool "3.81 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MAKE_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on MAKE_SRC_DEVEL || MAKE_SRC_CUSTOM
+
+endchoice
+
+
+
+config MAKE_VERSION
+ string
+ default "4.2.1" if MAKE_V_4_2_1
+ default "4.1" if MAKE_V_4_1
+ default "4.0" if MAKE_V_4_0
+ default "3.81" if MAKE_V_3_81
+ default "unknown"
+
+
diff --git a/config/versions/mingw-w64.in b/config/versions/mingw-w64.in
new file mode 100644
index 0000000..b4cdbe5
--- /dev/null
+++ b/config/versions/mingw-w64.in
@@ -0,0 +1,168 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of mingw-w64"
+
+config MINGW_W64_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config MINGW_W64_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.code.sf.net/p/mingw-w64/mingw-w64
+
+if MINGW_W64_SRC_DEVEL
+
+config MINGW_W64_DEVEL_VCS
+ string
+ default "git"
+
+config MINGW_W64_DEVEL_URL
+ string
+ default "https://git.code.sf.net/p/mingw-w64/mingw-w64"
+
+config MINGW_W64_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config MINGW_W64_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config MINGW_W64_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if MINGW_W64_SRC_CUSTOM
+
+config MINGW_W64_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config MINGW_W64_MIRRORS_ARRAY
+ string
+ default "http://downloads.sourceforge.net/sourceforge/mingw-w64"
+
+choice
+ bool "Version of mingw-w64"
+ help
+ For a released version, select the version of mingw-w64 to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building mingw-w64.
+
+config MINGW_W64_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on MINGW_W64_SRC_DEVEL || MINGW_W64_SRC_CUSTOM
+
+config MINGW_W64_V_V5_0_1
+ bool "v5.0.1"
+
+config MINGW_W64_V_V5_0_0
+ bool "v5.0.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V4_0_6
+ bool "v4.0.6"
+
+config MINGW_W64_V_V4_0_5
+ bool "v4.0.5 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V4_0_4
+ bool "v4.0.4 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V4_0_2
+ bool "v4.0.2 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V4_0_1
+ bool "v4.0.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V4_0_0
+ bool "v4.0.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V3_3_0
+ bool "v3.3.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V3_2_0
+ bool "v3.2.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V3_1_0
+ bool "v3.1.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V3_0_0
+ bool "v3.0.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V2_0_9
+ bool "v2.0.9 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V2_0_8
+ bool "v2.0.8 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_V_V2_0_7
+ bool "v2.0.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MINGW_W64_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on MINGW_W64_SRC_DEVEL || MINGW_W64_SRC_CUSTOM
+
+endchoice
+
+
+
+config MINGW_W64_VERSION
+ string
+ default "v5.0.1" if MINGW_W64_V_V5_0_1
+ default "v5.0.0" if MINGW_W64_V_V5_0_0
+ default "v4.0.6" if MINGW_W64_V_V4_0_6
+ default "v4.0.5" if MINGW_W64_V_V4_0_5
+ default "v4.0.4" if MINGW_W64_V_V4_0_4
+ default "v4.0.2" if MINGW_W64_V_V4_0_2
+ default "v4.0.1" if MINGW_W64_V_V4_0_1
+ default "v4.0.0" if MINGW_W64_V_V4_0_0
+ default "v3.3.0" if MINGW_W64_V_V3_3_0
+ default "v3.2.0" if MINGW_W64_V_V3_2_0
+ default "v3.1.0" if MINGW_W64_V_V3_1_0
+ default "v3.0.0" if MINGW_W64_V_V3_0_0
+ default "v2.0.9" if MINGW_W64_V_V2_0_9
+ default "v2.0.8" if MINGW_W64_V_V2_0_8
+ default "v2.0.7" if MINGW_W64_V_V2_0_7
+ default "unknown"
+
+
diff --git a/config/versions/mpc.in b/config/versions/mpc.in
new file mode 100644
index 0000000..7f377b5
--- /dev/null
+++ b/config/versions/mpc.in
@@ -0,0 +1,134 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of mpc"
+
+config MPC_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config MPC_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://scm.gforge.inria.fr/anonscm/git/mpc/mpc.git
+
+if MPC_SRC_DEVEL
+
+config MPC_DEVEL_VCS
+ string
+ default "git"
+
+config MPC_DEVEL_URL
+ string
+ default "https://scm.gforge.inria.fr/anonscm/git/mpc/mpc.git"
+
+config MPC_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config MPC_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config MPC_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if MPC_SRC_CUSTOM
+
+config MPC_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config MPC_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of mpc"
+ help
+ For a released version, select the version of mpc to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building mpc.
+
+config MPC_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on MPC_SRC_DEVEL || MPC_SRC_CUSTOM
+
+config MPC_V_1_0_3
+ bool "1.0.3"
+
+config MPC_V_1_0_2
+ bool "1.0.2 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPC_V_1_0_1
+ bool "1.0.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPC_V_1_0
+ bool "1.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPC_V_0_9
+ bool "0.9 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPC_V_0_8_2
+ bool "0.8.2 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPC_V_0_8_1
+ bool "0.8.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPC_V_0_7
+ bool "0.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPC_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on MPC_SRC_DEVEL || MPC_SRC_CUSTOM
+
+endchoice
+
+
+
+config MPC_VERSION
+ string
+ default "1.0.3" if MPC_V_1_0_3
+ default "1.0.2" if MPC_V_1_0_2
+ default "1.0.1" if MPC_V_1_0_1
+ default "1.0" if MPC_V_1_0
+ default "0.9" if MPC_V_0_9
+ default "0.8.2" if MPC_V_0_8_2
+ default "0.8.1" if MPC_V_0_8_1
+ default "0.7" if MPC_V_0_7
+ default "unknown"
+
+
diff --git a/config/versions/mpfr.in b/config/versions/mpfr.in
new file mode 100644
index 0000000..ac6080f
--- /dev/null
+++ b/config/versions/mpfr.in
@@ -0,0 +1,144 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of mpfr"
+
+config MPFR_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config MPFR_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://scm.gforge.inria.fr/anonscm/svn/mpfr
+
+if MPFR_SRC_DEVEL
+
+config MPFR_DEVEL_VCS
+ string
+ default "svn"
+
+config MPFR_DEVEL_URL
+ string
+ default "https://scm.gforge.inria.fr/anonscm/svn/mpfr"
+
+config MPFR_DEVEL_BRANCH
+ string "Branch to check out"
+ default "/trunk"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config MPFR_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config MPFR_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if MPFR_SRC_CUSTOM
+
+config MPFR_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config MPFR_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of mpfr"
+ help
+ For a released version, select the version of mpfr to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building mpfr.
+
+config MPFR_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on MPFR_SRC_DEVEL || MPFR_SRC_CUSTOM
+
+config MPFR_V_3_1_5
+ bool "3.1.5"
+
+config MPFR_V_3_1_3
+ bool "3.1.3 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_V_3_1_2
+ bool "3.1.2 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_V_3_1_1
+ bool "3.1.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_V_3_1_0
+ bool "3.1.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_V_3_0_1
+ bool "3.0.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_V_3_0_0
+ bool "3.0.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_V_2_4_2
+ bool "2.4.2 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_V_2_4_1
+ bool "2.4.1 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_V_2_4_0
+ bool "2.4.0 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MPFR_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on MPFR_SRC_DEVEL || MPFR_SRC_CUSTOM
+
+endchoice
+
+
+
+config MPFR_VERSION
+ string
+ default "3.1.5" if MPFR_V_3_1_5
+ default "3.1.3" if MPFR_V_3_1_3
+ default "3.1.2" if MPFR_V_3_1_2
+ default "3.1.1" if MPFR_V_3_1_1
+ default "3.1.0" if MPFR_V_3_1_0
+ default "3.0.1" if MPFR_V_3_0_1
+ default "3.0.0" if MPFR_V_3_0_0
+ default "2.4.2" if MPFR_V_2_4_2
+ default "2.4.1" if MPFR_V_2_4_1
+ default "2.4.0" if MPFR_V_2_4_0
+ default "unknown"
+
+
diff --git a/config/versions/musl.in b/config/versions/musl.in
new file mode 100644
index 0000000..e07346c
--- /dev/null
+++ b/config/versions/musl.in
@@ -0,0 +1,104 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of musl"
+
+config MUSL_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config MUSL_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://git.musl-libc.org/musl
+
+if MUSL_SRC_DEVEL
+
+config MUSL_DEVEL_VCS
+ string
+ default "git"
+
+config MUSL_DEVEL_URL
+ string
+ default "git://git.musl-libc.org/musl"
+
+config MUSL_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config MUSL_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config MUSL_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if MUSL_SRC_CUSTOM
+
+config MUSL_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config MUSL_MIRRORS_ARRAY
+ string
+ default "http://www.musl-libc.org/releases"
+
+choice
+ bool "Version of musl"
+ help
+ For a released version, select the version of musl to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building musl.
+
+config MUSL_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on MUSL_SRC_DEVEL || MUSL_SRC_CUSTOM
+
+config MUSL_V_1_1_16
+ bool "1.1.16"
+
+config MUSL_V_1_1_15
+ bool "1.1.15 (OBSOLETE)"
+ depends on OBSOLETE
+
+config MUSL_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on MUSL_SRC_DEVEL || MUSL_SRC_CUSTOM
+
+endchoice
+
+
+
+config MUSL_VERSION
+ string
+ default "1.1.16" if MUSL_V_1_1_16
+ default "1.1.15" if MUSL_V_1_1_15
+ default "unknown"
+
+
diff --git a/config/versions/ncurses.in b/config/versions/ncurses.in
new file mode 100644
index 0000000..7b0cf98
--- /dev/null
+++ b/config/versions/ncurses.in
@@ -0,0 +1,68 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of ncurses"
+
+config NCURSES_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config NCURSES_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if NCURSES_SRC_CUSTOM
+
+config NCURSES_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config NCURSES_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of ncurses"
+ help
+ For a released version, select the version of ncurses to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building ncurses.
+
+config NCURSES_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on NCURSES_SRC_DEVEL || NCURSES_SRC_CUSTOM
+
+config NCURSES_V_6_0
+ bool "6.0"
+
+config NCURSES_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on NCURSES_SRC_DEVEL || NCURSES_SRC_CUSTOM
+
+endchoice
+
+
+
+config NCURSES_VERSION
+ string
+ default "6.0" if NCURSES_V_6_0
+ default "unknown"
+
+
diff --git a/config/versions/newlib.in b/config/versions/newlib.in
new file mode 100644
index 0000000..55aa6b3
--- /dev/null
+++ b/config/versions/newlib.in
@@ -0,0 +1,377 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+choice
+ bool "Show newlib versions from"
+
+config NEWLIB_USE_REDHAT
+ bool "RedHat"
+ help
+newlib from RedHat.
+
+config NEWLIB_USE_LINARO
+ bool "Linaro"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ help
+ Linaro is maintaining some advanced/more stable/experimental versions
+ of binutils, gcc, glibc and gdb, especially for the ARM architecture.
+ These versions contain some changes that are not (yet?) merged into
+ their respective upstream repositories.
+
+endchoice
+
+config NEWLIB_USE
+ string
+ default "NEWLIB" if NEWLIB_USE_REDHAT
+ default "NEWLIB_LINARO" if NEWLIB_USE_LINARO
+
+
+if NEWLIB_USE_REDHAT
+
+if EXPERIMENTAL
+choice
+ bool "Source of newlib"
+
+config NEWLIB_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config NEWLIB_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://sourceware.org/git/newlib-cygwin.git
+
+if NEWLIB_SRC_DEVEL
+
+config NEWLIB_DEVEL_VCS
+ string
+ default "git"
+
+config NEWLIB_DEVEL_URL
+ string
+ default "git://sourceware.org/git/newlib-cygwin.git"
+
+config NEWLIB_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config NEWLIB_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config NEWLIB_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if NEWLIB_SRC_CUSTOM
+
+config NEWLIB_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config NEWLIB_MIRRORS_ARRAY
+ string
+ default "ftp://sourceware.org/pub/newlib http://mirrors.kernel.org/sourceware/newlib http://mirrors.kernel.org/sources.redhat.com/newlib"
+
+choice
+ bool "Version of newlib"
+ help
+ For a released version, select the version of newlib to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building newlib.
+
+config NEWLIB_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on NEWLIB_SRC_DEVEL || NEWLIB_SRC_CUSTOM
+ select NEWLIB_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_2_or_older
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_V_2_5_0_20170323
+ bool "2.5.0.20170323"
+ select NEWLIB_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_2_or_older
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_V_2_4_0_20161025
+ bool "2.4.0.20161025 (OBSOLETE)"
+ depends on OBSOLETE
+ select NEWLIB_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_2_or_older
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_V_2_3_0_20160226
+ bool "2.3.0.20160226 (OBSOLETE)"
+ depends on OBSOLETE
+ select NEWLIB_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_2_or_older
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_V_2_2_0_20151023
+ bool "2.2.0.20151023 (OBSOLETE)"
+ depends on OBSOLETE
+ select NEWLIB_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_2_or_older
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_V_2_1_0
+ bool "2.1.0 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_V_2_0_0
+ bool "2.0.0 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_later
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_V_1_20_0
+ bool "1.20.0 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_later
+
+config NEWLIB_V_1_19_0
+ bool "1.19.0 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_later
+
+config NEWLIB_V_1_18_0
+ bool "1.18.0 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_later
+
+config NEWLIB_V_1_17_0
+ bool "1.17.0 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_later
+
+config NEWLIB_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on NEWLIB_SRC_DEVEL || NEWLIB_SRC_CUSTOM
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_later
+
+endchoice
+
+
+endif
+
+config NEWLIB_VERSION
+ string
+ default "2.5.0.20170323" if NEWLIB_V_2_5_0_20170323
+ default "2.4.0.20161025" if NEWLIB_V_2_4_0_20161025
+ default "2.3.0.20160226" if NEWLIB_V_2_3_0_20160226
+ default "2.2.0.20151023" if NEWLIB_V_2_2_0_20151023
+ default "2.1.0" if NEWLIB_V_2_1_0
+ default "2.0.0" if NEWLIB_V_2_0_0
+ default "1.20.0" if NEWLIB_V_1_20_0
+ default "1.19.0" if NEWLIB_V_1_19_0
+ default "1.18.0" if NEWLIB_V_1_18_0
+ default "1.17.0" if NEWLIB_V_1_17_0
+ default "unknown"
+
+if NEWLIB_USE_LINARO
+
+if EXPERIMENTAL
+choice
+ bool "Source of newlib-linaro"
+
+config NEWLIB_LINARO_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config NEWLIB_LINARO_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.linaro.org/toolchain/newlib.git
+
+if NEWLIB_LINARO_SRC_DEVEL
+
+config NEWLIB_LINARO_DEVEL_VCS
+ string
+ default "git"
+
+config NEWLIB_LINARO_DEVEL_URL
+ string
+ default "https://git.linaro.org/toolchain/newlib.git"
+
+config NEWLIB_LINARO_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config NEWLIB_LINARO_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config NEWLIB_LINARO_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if NEWLIB_LINARO_SRC_CUSTOM
+
+config NEWLIB_LINARO_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config NEWLIB_LINARO_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of newlib-linaro"
+ help
+ For a released version, select the version of newlib-linaro to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building newlib-linaro.
+
+config NEWLIB_LINARO_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on NEWLIB_LINARO_SRC_DEVEL || NEWLIB_LINARO_SRC_CUSTOM
+ select NEWLIB_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_2_or_older
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_LINARO_V_2_2_0_2015_01
+ bool "2.2.0-2015.01 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ select NEWLIB_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_2_or_older
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_LINARO_V_2_1_0_2014_09
+ bool "2.1.0-2014.09 (OBSOLETE,EXPERIMENTAL)"
+ depends on OBSOLETE
+ depends on EXPERIMENTAL
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ select NEWLIB_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_older
+ select NEWLIB_2_0_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_older
+
+config NEWLIB_LINARO_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on NEWLIB_LINARO_SRC_DEVEL || NEWLIB_LINARO_SRC_CUSTOM
+ depends on !NEWLIB_REQUIRE_2_2_or_later
+ depends on !NEWLIB_REQUIRE_2_1_or_later
+ depends on !NEWLIB_REQUIRE_2_0_or_later
+
+endchoice
+
+
+endif
+
+config NEWLIB_LINARO_VERSION
+ string
+ default "2.2.0-2015.01" if NEWLIB_LINARO_V_2_2_0_2015_01
+ default "2.1.0-2014.09" if NEWLIB_LINARO_V_2_1_0_2014_09
+ default "unknown"
+
+
+config NEWLIB_2_2_or_later
+ bool
+
+config NEWLIB_REQUIRE_2_2_or_later
+ bool
+
+config NEWLIB_REQUIRE_2_2_or_older
+ bool
+
+config NEWLIB_2_1_or_later
+ bool
+
+config NEWLIB_REQUIRE_2_1_or_later
+ bool
+
+config NEWLIB_REQUIRE_2_1_or_older
+ bool
+
+config NEWLIB_2_0_or_later
+ bool
+
+config NEWLIB_REQUIRE_2_0_or_later
+ bool
+
+config NEWLIB_REQUIRE_2_0_or_older
+ bool
+
diff --git a/config/versions/strace.in b/config/versions/strace.in
new file mode 100644
index 0000000..56e8dee
--- /dev/null
+++ b/config/versions/strace.in
@@ -0,0 +1,163 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of strace"
+
+config STRACE_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config STRACE_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://git.code.sf.net/p/strace/code
+
+if STRACE_SRC_DEVEL
+
+config STRACE_DEVEL_VCS
+ string
+ default "git"
+
+config STRACE_DEVEL_URL
+ string
+ default "https://git.code.sf.net/p/strace/code"
+
+config STRACE_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config STRACE_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config STRACE_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if STRACE_SRC_CUSTOM
+
+config STRACE_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config STRACE_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of strace"
+ help
+ For a released version, select the version of strace to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building strace.
+
+config STRACE_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on STRACE_SRC_DEVEL || STRACE_SRC_CUSTOM
+
+config STRACE_V_4_16
+ bool "4.16"
+
+config STRACE_V_4_15
+ bool "4.15"
+
+config STRACE_V_4_14
+ bool "4.14 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_13
+ bool "4.13 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_12
+ bool "4.12 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_11
+ bool "4.11 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_10
+ bool "4.10 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_9
+ bool "4.9 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_8
+ bool "4.8 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_7
+ bool "4.7 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_6
+ bool "4.6 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_5_20
+ bool "4.5.20 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_5_19
+ bool "4.5.19 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_V_4_5_18
+ bool "4.5.18 (OBSOLETE)"
+ depends on OBSOLETE
+
+config STRACE_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on STRACE_SRC_DEVEL || STRACE_SRC_CUSTOM
+
+endchoice
+
+
+
+config STRACE_VERSION
+ string
+ default "4.16" if STRACE_V_4_16
+ default "4.15" if STRACE_V_4_15
+ default "4.14" if STRACE_V_4_14
+ default "4.13" if STRACE_V_4_13
+ default "4.12" if STRACE_V_4_12
+ default "4.11" if STRACE_V_4_11
+ default "4.10" if STRACE_V_4_10
+ default "4.9" if STRACE_V_4_9
+ default "4.8" if STRACE_V_4_8
+ default "4.7" if STRACE_V_4_7
+ default "4.6" if STRACE_V_4_6
+ default "4.5.20" if STRACE_V_4_5_20
+ default "4.5.19" if STRACE_V_4_5_19
+ default "4.5.18" if STRACE_V_4_5_18
+ default "unknown"
+
+
diff --git a/config/versions/uClibc-ng.in b/config/versions/uClibc-ng.in
new file mode 100644
index 0000000..b4932ab
--- /dev/null
+++ b/config/versions/uClibc-ng.in
@@ -0,0 +1,316 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+choice
+ bool "Show uClibc-ng versions from"
+
+config UCLIBC_NG_USE_UCLIBC_NG_ORG
+ bool "uclibc-ng.org"
+ help
+uClibc-ng from uclibc-ng.org.
+
+config UCLIBC_NG_USE_UCLIBC_ORG
+ bool "uclibc.org"
+ depends on OBSOLETE
+ help
+uClibc-ng from uclibc.org.
+
+endchoice
+
+config UCLIBC_NG_USE
+ string
+ default "UCLIBC_NG" if UCLIBC_NG_USE_UCLIBC_NG_ORG
+ default "UCLIBC" if UCLIBC_NG_USE_UCLIBC_ORG
+
+
+if UCLIBC_NG_USE_UCLIBC_NG_ORG
+
+if EXPERIMENTAL
+choice
+ bool "Source of uClibc-ng"
+
+config UCLIBC_NG_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config UCLIBC_NG_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://uclibc-ng.org/git/uclibc-ng
+
+if UCLIBC_NG_SRC_DEVEL
+
+config UCLIBC_NG_DEVEL_VCS
+ string
+ default "git"
+
+config UCLIBC_NG_DEVEL_URL
+ string
+ default "git://uclibc-ng.org/git/uclibc-ng"
+
+config UCLIBC_NG_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config UCLIBC_NG_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config UCLIBC_NG_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if UCLIBC_NG_SRC_CUSTOM
+
+config UCLIBC_NG_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config UCLIBC_NG_MIRRORS_ARRAY
+ string
+ default "http://downloads.uclibc-ng.org/releases/${CT_UCLIBC_NG_VERSION}"
+
+choice
+ bool "Version of uClibc-ng"
+ help
+ For a released version, select the version of uClibc-ng to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building uClibc-ng.
+
+config UCLIBC_NG_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on UCLIBC_NG_SRC_DEVEL || UCLIBC_NG_SRC_CUSTOM
+ select UCLIBC_NG_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_older
+ select UCLIBC_NG_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_older
+ select UCLIBC_NG_0_9_33_2_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_older
+
+config UCLIBC_NG_V_1_0_24
+ bool "1.0.24"
+ select UCLIBC_NG_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_older
+ select UCLIBC_NG_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_older
+ select UCLIBC_NG_0_9_33_2_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_older
+
+config UCLIBC_NG_V_1_0_23
+ bool "1.0.23"
+ select UCLIBC_NG_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_older
+ select UCLIBC_NG_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_older
+ select UCLIBC_NG_0_9_33_2_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_older
+
+config UCLIBC_NG_V_1_0_22
+ bool "1.0.22"
+ select UCLIBC_NG_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_older
+ select UCLIBC_NG_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_older
+ select UCLIBC_NG_0_9_33_2_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_older
+
+config UCLIBC_NG_V_1_0_21
+ bool "1.0.21 (OBSOLETE)"
+ depends on OBSOLETE
+ select UCLIBC_NG_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_older
+ select UCLIBC_NG_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_older
+ select UCLIBC_NG_0_9_33_2_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_older
+
+config UCLIBC_NG_V_1_0_20
+ bool "1.0.20 (OBSOLETE)"
+ depends on OBSOLETE
+ select UCLIBC_NG_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_older
+ select UCLIBC_NG_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_older
+ select UCLIBC_NG_0_9_33_2_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_older
+
+config UCLIBC_NG_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on UCLIBC_NG_SRC_DEVEL || UCLIBC_NG_SRC_CUSTOM
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_later
+
+endchoice
+
+
+endif
+
+config UCLIBC_NG_VERSION
+ string
+ default "1.0.24" if UCLIBC_NG_V_1_0_24
+ default "1.0.23" if UCLIBC_NG_V_1_0_23
+ default "1.0.22" if UCLIBC_NG_V_1_0_22
+ default "1.0.21" if UCLIBC_NG_V_1_0_21
+ default "1.0.20" if UCLIBC_NG_V_1_0_20
+ default "unknown"
+
+if UCLIBC_NG_USE_UCLIBC_ORG
+
+if EXPERIMENTAL
+choice
+ bool "Source of uClibc"
+
+config UCLIBC_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config UCLIBC_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ git://git.busybox.net/uClibc
+
+if UCLIBC_SRC_DEVEL
+
+config UCLIBC_DEVEL_VCS
+ string
+ default "git"
+
+config UCLIBC_DEVEL_URL
+ string
+ default "git://git.busybox.net/uClibc"
+
+config UCLIBC_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config UCLIBC_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config UCLIBC_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if UCLIBC_SRC_CUSTOM
+
+config UCLIBC_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config UCLIBC_MIRRORS_ARRAY
+ string
+ default "http://www.uclibc.org/downloads http://www.uclibc.org/downloads/old-releases"
+
+choice
+ bool "Version of uClibc"
+ help
+ For a released version, select the version of uClibc to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building uClibc.
+
+config UCLIBC_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on UCLIBC_SRC_DEVEL || UCLIBC_SRC_CUSTOM
+ select UCLIBC_NG_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_older
+ select UCLIBC_NG_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_older
+ select UCLIBC_NG_0_9_33_2_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_older
+
+config UCLIBC_V_0_9_33_2
+ bool "0.9.33.2 (OBSOLETE)"
+ depends on OBSOLETE
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_later
+ select UCLIBC_NG_0_9_33_2_or_later
+
+config UCLIBC_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on UCLIBC_SRC_DEVEL || UCLIBC_SRC_CUSTOM
+ depends on !UCLIBC_NG_REQUIRE_1_0_15_or_later
+ depends on !UCLIBC_NG_REQUIRE_1_0_0_or_later
+ depends on !UCLIBC_NG_REQUIRE_0_9_33_2_or_later
+
+endchoice
+
+
+endif
+
+config UCLIBC_VERSION
+ string
+ default "0.9.33.2" if UCLIBC_V_0_9_33_2
+ default "unknown"
+
+
+config UCLIBC_NG_1_0_15_or_later
+ bool
+
+config UCLIBC_NG_REQUIRE_1_0_15_or_later
+ bool
+
+config UCLIBC_NG_REQUIRE_1_0_15_or_older
+ bool
+
+config UCLIBC_NG_1_0_0_or_later
+ bool
+
+config UCLIBC_NG_REQUIRE_1_0_0_or_later
+ bool
+
+config UCLIBC_NG_REQUIRE_1_0_0_or_older
+ bool
+
+config UCLIBC_NG_0_9_33_2_or_later
+ bool
+
+config UCLIBC_NG_REQUIRE_0_9_33_2_or_later
+ bool
+
+config UCLIBC_NG_REQUIRE_0_9_33_2_or_older
+ bool
+
diff --git a/config/versions/zlib.in b/config/versions/zlib.in
new file mode 100644
index 0000000..1efa69e
--- /dev/null
+++ b/config/versions/zlib.in
@@ -0,0 +1,99 @@
+#
+# DO NOT EDIT! This file is automatically generated.
+#
+
+
+if EXPERIMENTAL
+choice
+ bool "Source of zlib"
+
+config ZLIB_SRC_RELEASE
+ bool "Released tarball"
+ help
+ Download a released tarball.
+
+config ZLIB_SRC_DEVEL
+ bool "Vendor repository"
+ help
+ Check out from vendor repository at:
+ https://github.com/madler/zlib.git
+
+if ZLIB_SRC_DEVEL
+
+config ZLIB_DEVEL_VCS
+ string
+ default "git"
+
+config ZLIB_DEVEL_URL
+ string
+ default "https://github.com/madler/zlib.git"
+
+config ZLIB_DEVEL_BRANCH
+ string "Branch to check out"
+ default "master"
+ help
+ Git: branch to be checked out
+ Subversion: directories to append to the repository URL.
+
+config ZLIB_DEVEL_REVISION
+ string "Revision/changeset"
+ default "HEAD"
+ help
+ Commit ID or revision ID to check out.
+
+endif
+
+config ZLIB_SRC_CUSTOM
+ bool "Custom location"
+ depends on EXPERIMENTAL
+ help
+ Custom directory or tarball.
+
+if ZLIB_SRC_CUSTOM
+
+config ZLIB_CUSTOM_LOCATION
+ string "Custom source location"
+ help
+ Path to the directory or tarball with the sources.
+
+endif
+
+endchoice
+endif
+
+config ZLIB_MIRRORS_ARRAY
+ string
+ default ""
+
+choice
+ bool "Version of zlib"
+ help
+ For a released version, select the version of zlib to download
+ and build. For sources out of the vendor repository or from a custom
+ location, select the version that describes those custom sources.
+ Based on this version, crosstool-NG may apply some version-specific
+ quirks while building zlib.
+
+config ZLIB_VERY_NEW
+ bool "newer than anything below"
+ depends on EXPERIMENTAL
+ depends on ZLIB_SRC_DEVEL || ZLIB_SRC_CUSTOM
+
+config ZLIB_V_1_2_11
+ bool "1.2.11"
+
+config ZLIB_VERY_OLD
+ bool "older than anything above"
+ depends on OBSOLETE && EXPERIMENTAL
+ depends on ZLIB_SRC_DEVEL || ZLIB_SRC_CUSTOM
+
+endchoice
+
+
+
+config ZLIB_VERSION
+ string
+ default "1.2.11" if ZLIB_V_1_2_11
+ default "unknown"
+
+
diff --git a/configure.ac b/configure.ac
index d10bf71..869226c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,10 +65,9 @@ AC_DEFUN(
AC_DEFUN(
[ACX_SET_KCONFIG_OPTION],
[AS_IF(
- [test -n "$$1"],
- [kconfig_options="$kconfig_options has_$1=y"],
- [kconfig_options="$kconfig_options has_$1"])
- ])
+ [test -n "$$1"],
+ [AC_SUBST([KCONFIG_$1], ["def_bool y"])],
+ [AC_SUBST([KCONFIG_$1], ["bool"])])])
# Check if a given program is available with a particular version.
# ACX_PROG_VERSION(VAR, HELP, PROG, SRCH, VERSION_CHECK[, CONFIG_OPT])
@@ -466,5 +465,5 @@ AS_IF(
#--------------------------------------------------------------------
# Finally, generate the output file(s)
#--------------------------------------------------------------------
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([Makefile config/configure.in])
AC_OUTPUT
diff --git a/ct-ng.in b/ct-ng.in
index 1204908..09ba89c 100644
--- a/ct-ng.in
+++ b/ct-ng.in
@@ -111,7 +111,6 @@ help-clean::
@echo ' clean - Remove generated files'
@echo ' distclean - Remove generated files, configuration and build directories'
-include $(CT_LIB_DIR)/config/config.mk
include $(CT_LIB_DIR)/kconfig/kconfig.mk
include $(CT_LIB_DIR)/steps.mk
include $(CT_LIB_DIR)/samples/samples.mk
diff --git a/kconfig/Makefile b/kconfig/Makefile
index ee838aa..4a33ac8 100644
--- a/kconfig/Makefile
+++ b/kconfig/Makefile
@@ -2,7 +2,12 @@
# Hmmm! Cheesy build!
# Or: where I can unveil my make-fu... :-]
-all: conf mconf nconf
+__silent = $(if $(V),,@printf ' %-7s %s\n' '$1' '$(if $2,$2,$(strip $<))' && )
+__silent_rm = $(call __silent,RM,$1)rm -f $1
+
+PROGS = conf mconf nconf
+
+all: $(PROGS)
@true # Just be silent, you fscking son of a fscking beach...
# Build flags
@@ -64,8 +69,7 @@ DEPS += $(nconf_DEP)
# Build the dependency for C files
%.dep: %.c
- @echo " DEP '$@'"
- @$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
+ $(call __silent,DEP,$@)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MM $< |$(sed) -r -e 's|([^:]+.o)( *:+)|$(<:.c=.o) $@\2|;' >$@
# Generate the grammar parser
zconf.tab.o: zconf.tab.c zconf.hash.c zconf.lex.c
@@ -73,39 +77,39 @@ zconf.tab.dep: zconf.tab.c zconf.hash.c zconf.lex.c
.PRECIOUS: zconf.tab.c
zconf.tab.c: zconf.y
- @echo " BISON '$@'"
- @bison -l -b zconf -p zconf $<
+ $(call __silent,BISON)bison -l -b zconf -p zconf $<
zconf.hash.c: zconf.gperf
- @echo " GPERF '$@'"
- @$(gperf) -C < $< > $@
+ $(call __silent,GPERF)$(gperf) -C < $< > $@
zconf.lex.c: zconf.l
- @echo " LEX '$@'"
- @flex -L -Pzconf -o$@ $<
+ $(call __silent,LEX)flex -L -Pzconf -o$@ $<
# Build C files
%.o: %.c
- @echo " CC '$@'"
- @$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
+ $(call __silent,CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -o $@ -c $<
# Actual link
mconf: $(COMMON_OBJ) $(LX_OBJ) $(mconf_OBJ)
- @echo " LD '$@'"
- @$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
+ $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
nconf: $(COMMON_OBJ) $(nconf_OBJ)
- @echo " LD '$@'"
- @$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
+ $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
conf: $(COMMON_OBJ) $(conf_OBJ)
- @echo " LD '$@'"
- @$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
+ $(call __silent,LD,$@)$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
+
+#-----------------------------------------------------------
+# Installation
+install: $(patsubst %,install-%,$(PROGS)) install-kconfig.mk
+
+install-%: %
+ $(call __silent,INSTALL,$<)install $< $(DESTDIR)/$<
#-----------------------------------------------------------
# Cleaning up the mess...
clean:
- @echo " RM 'kconfig'"
- @rm -f conf mconf nconf $(ALL_OBJS) $(ALL_DEPS)
- @rm -f rm -f zconf.tab.c zconf.hash.c zconf.lex.c lex.backup
+ $(call __silent,RM,objs)rm -f $(ALL_OBJS) $(ALL_DEPS)
+ $(call __silent_rm,$(PROGS))
+ $(call __silent_rm,zconf.tab.c zconf.hash.c zconf.lex.c lex.backup)
diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk
index 3d330b4..c82e502 100644
--- a/kconfig/kconfig.mk
+++ b/kconfig/kconfig.mk
@@ -5,31 +5,27 @@
#-----------------------------------------------------------
# The configurators rules
-configurators = menuconfig nconfig oldconfig savedefconfig defconfig
-PHONY += $(configurators)
-
-$(configurators): config_files
-
-export CT_IS_A_BACKEND:=$(CT_IS_A_BACKEND)
-export CT_BACKEND_ARCH:=$(CT_BACKEND_ARCH)
-export CT_BACKEND_KERNEL:=$(CT_BACKEND_KERNEL)
-export CT_BACKEND_LIBC:=$(CT_BACKEND_LIBC)
+# Top file of crosstool-NG configuration
+export KCONFIG_TOP = $(CT_LIB_DIR)/config/config.in
# We need CONF for savedefconfig in scripts/saveSample.sh
export CONF := $(CT_LIB_DIR)/kconfig/conf
MCONF := $(CT_LIB_DIR)/kconfig/mconf
NCONF := $(CT_LIB_DIR)/kconfig/nconf
+# Used by conf/mconf/nconf to find the .in files
+export srctree=$(CT_LIB_DIR)
+
menuconfig:
- @$(CT_ECHO) " CONF $(KCONFIG_TOP)"
+ @$(CT_ECHO) " CONF $@"
$(SILENT)$(MCONF) $(KCONFIG_TOP)
nconfig:
- @$(CT_ECHO) " CONF $(KCONFIG_TOP)"
+ @$(CT_ECHO) " CONF $@"
$(SILENT)$(NCONF) $(KCONFIG_TOP)
oldconfig: .config
- @$(CT_ECHO) " CONF $(KCONFIG_TOP)"
+ @$(CT_ECHO) " CONF $@"
$(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)
savedefconfig: .config
diff --git a/scripts/gen_in_frags.sh b/maintainer/gen-kconfig.sh
index 9fbb871..364844d 100755
--- a/scripts/gen_in_frags.sh
+++ b/maintainer/gen-kconfig.sh
@@ -1,15 +1,19 @@
-#!/bin/sh
+#!/bin/bash
+
set -e
-# This scripts generates either a choice or a menuconfig
-# with the specified entries.
+# Accept overrides from command line if needed
+sed=${SED:-sed}
+grep=${GREP:-grep}
+
+# Generate either a choice or a menuconfig with the specified entries.
#
# Usage:
# generate a choice:
-# gen_in_frags.sh choice <out-file> <label> <config-prefix> <base-dir> <conditionals> entry [entry...]
+# gen_choice <out-file> <label> <config-prefix> <base-dir>
#
# generate a menuconfig:
-# gen_in_frags.sh menu <out-file> <label> <config-prefix> <base-dir> entry [entry...]
+# gen_menu <out-file> <label> <config-prefix> <base-dir>
#
# where:
# out-file
@@ -29,19 +33,17 @@ set -e
# base directory containing config files
# eg. config/arch, config/kernel...
#
-# conditionals (valid only for choice)
-# generate backend conditionals if Y/y, don't if anything else
-# if 'Y' (or 'y'), a dependency on the backen mode will be added
-# to each entry
-#
-# entry [entry...]
-# a list of entry/ies toadd to the choice/menuconfig
-# eg.:
-# arm mips sh x86...
-# linux cygwin mingw32 solaris...
-# ...
-#
-#------------------------------------------------------------------------------
+
+# Helper: find the base names of all *.in files in a given directory
+get_components() {
+ local dir="${1}"
+ local f b
+
+ for f in ${dir}/*.in; do
+ b=${f#${dir}/}
+ echo ${b%.in}
+ done
+}
# Generate a choice
# See above for usage
@@ -50,8 +52,6 @@ gen_choice() {
local label="${2}"
local cfg_prefix="${3}"
local base_dir="${4}"
- local cond="${5}"
- shift 5
local file entry _entry
# Generate the part-1
@@ -63,15 +63,12 @@ gen_choice() {
printf ' bool\n'
printf ' prompt "%s"\n' "${label}"
printf '\n'
- for entry in "${@}"; do
+ for entry in `get_components ${base_dir}`; do
file="${base_dir}/${entry}.in"
_entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;')
printf 'config %s_%s\n' "${cfg_prefix}" "${_entry}"
printf ' bool\n'
printf ' prompt "%s"\n' "${entry}"
- if [ "${cond}" = "Y" -o "${cond}" = "y" ]; then
- printf ' depends on %s_%s_AVAILABLE\n' "${cfg_prefix}" "${_entry}"
- fi
"${sed}" -r -e '/^## depends on /!d; s/^## / /;' ${file} 2>/dev/null
"${sed}" -r -e '/^## select /!d; s/^## / /;' ${file} 2>/dev/null
if "${grep}" -E '^## help' ${file} >/dev/null 2>&1; then
@@ -82,21 +79,19 @@ gen_choice() {
done
printf 'endchoice\n'
- for entry in "${@}"; do
+ printf '\n'
+ printf 'config %s\n' "${cfg_prefix}"
+ for entry in `get_components ${base_dir}`; do
file="${base_dir}/${entry}.in"
_entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;')
- printf '\n'
- if [ "${cond}" = "Y" -o "${cond}" = "y" ]; then
- printf 'config %s_%s_AVAILABLE\n' "${cfg_prefix}" "${_entry}"
- printf ' bool\n'
- printf ' default y if'
- printf ' BACKEND_%s = "%s"' "${cfg_prefix}" "${entry}"
- printf ' || BACKEND_%s = ""' "${cfg_prefix}"
- printf ' || ! BACKEND\n'
- fi
- printf 'if %s_%s\n' "${cfg_prefix}" "${_entry}"
- printf 'config %s\n' "${cfg_prefix}"
printf ' default "%s" if %s_%s\n' "${entry}" "${cfg_prefix}" "${_entry}"
+ done
+
+ printf '\n'
+ for entry in `get_components ${base_dir}`; do
+ file="${base_dir}/${entry}.in"
+ _entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;')
+ printf 'if %s_%s\n' "${cfg_prefix}" "${_entry}"
printf 'source "%s"\n' "${file}"
printf 'endif\n'
done
@@ -105,7 +100,7 @@ gen_choice() {
exec >"${out_file}.2"
printf '# %s second part options\n' "${label}"
printf '# Generated file, do not edit!!!\n'
- for entry in "${@}"; do
+ for entry in `get_components ${base_dir}`; do
file="${base_dir}/${entry}.in"
_entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;')
if [ -f "${file}.2" ]; then
@@ -125,7 +120,6 @@ gen_menu() {
local label="${2}"
local cfg_prefix="${3}"
local base_dir="${4}"
- shift 4
local file entry _entry
# Generate the menuconfig
@@ -133,7 +127,7 @@ gen_menu() {
printf '# %s menu\n' "${label}"
printf '# Generated file, do not edit!!!\n'
printf '\n'
- for entry in "${@}"; do
+ for entry in `get_components ${base_dir}`; do
file="${base_dir}/${entry}.in"
_entry=$(printf '%s\n' "${entry}" |"${sed}" -r -s -e 's/[-.+]/_/g;')
printf 'menuconfig %s_%s\n' "${cfg_prefix}" "${_entry}"
@@ -156,6 +150,11 @@ gen_menu() {
done
}
-type="${1}"
-shift
-"gen_${type}" "${@}"
+mkdir -p config/gen
+gen_choice config/gen/arch.in "Target Architecture" "ARCH" "config/arch"
+gen_choice config/gen/kernel.in "Target OS" "KERNEL" "config/kernel"
+gen_choice config/gen/cc.in "Compiler" "CC" "config/cc"
+gen_choice config/gen/binutils.in "Binutils" "BINUTILS" "config/binutils"
+gen_choice config/gen/libc.in "C library" "LIBC" "config/libc"
+gen_menu config/gen/debug.in "Debug facilities" "DEBUG" "config/debug"
+gen_menu config/gen/companion_tools.in "Companion tools" "COMP_TOOLS" "config/companion_tools"
diff --git a/patches/gcc/4.8.5/111-alpha-bad-eh_frame.patch b/patches/gcc/4.8.5/111-alpha-bad-eh_frame.patch
new file mode 100644
index 0000000..93f6e94
--- /dev/null
+++ b/patches/gcc/4.8.5/111-alpha-bad-eh_frame.patch
@@ -0,0 +1,13 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80037
+
+diff --git a/libgcc/config/alpha/t-alpha b/libgcc/config/alpha/t-alpha
+index 0b6ffb1..0c2f840 100644
+--- a/libgcc/config/alpha/t-alpha
++++ b/libgcc/config/alpha/t-alpha
+@@ -1,2 +1,6 @@
+ # This is a support routine for longlong.h, used by libgcc2.c.
+ LIB2ADD += $(srcdir)/config/alpha/qrnnd.S
++
++# When GAS-generated unwind tables are created, they get created
++# after the __FRAME_END__ terminator, which causes an ld error.
++CRTSTUFF_T_CFLAGS = -fno-unwind-tables
diff --git a/patches/gcc/4.8.5/874-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/4.8.5/874-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..6013fef
--- /dev/null
+++ b/patches/gcc/4.8.5/874-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,73 @@
+From 0343a584d6b5128908eabf1db43c70bed7114989 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index dbc5bd3..466adb5 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1772,7 +1772,7 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call8\t0x%lx", INTVAL (tgt));
++ sprintf (result, "call8\t" HOST_WIDE_INT_PRINT_HEX, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx8\t%%%d", callop);
+ else
+@@ -2347,14 +2347,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2368,7 +2368,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2437,7 +2437,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/4.9.4/1100-msp430-string-literals.patch b/patches/gcc/4.9.4/1100-msp430-string-literals.patch
new file mode 100644
index 0000000..346842e
--- /dev/null
+++ b/patches/gcc/4.9.4/1100-msp430-string-literals.patch
@@ -0,0 +1,27 @@
+commit 9d247a3d78b97c004e7ca5e7d6cc9964dba870c7
+Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed May 13 01:11:13 2015 +0000
+
+ gcc/
+ * config/mmix/mmix.c, config/msp430/msp430.c: Add space between
+ string literal and macro name.
+ gcc/ada/
+ * sigtramp-vxworks.c: Add space between string literal and macro
+ name.
+
+ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223106 138bc75d-0d04-0410-961f-82ee72b054a4
+
+[4.9 change: remove non-applicable parts of the patch]
+diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
+index bec168ca2ae..58d0efea1de 100644
+--- a/gcc/config/msp430/msp430.c
++++ b/gcc/config/msp430/msp430.c
+@@ -2248,7 +2248,7 @@ static struct
+ }
+ const_shift_helpers[] =
+ {
+-#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G }
++#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G }
+
+ CSH ("slli", 1, 1, slli_1),
+ CSH ("slll", 1, 1, slll_1),
diff --git a/patches/gcc/4.9.4/111-alpha-bad-eh_frame.patch b/patches/gcc/4.9.4/111-alpha-bad-eh_frame.patch
new file mode 100644
index 0000000..93f6e94
--- /dev/null
+++ b/patches/gcc/4.9.4/111-alpha-bad-eh_frame.patch
@@ -0,0 +1,13 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80037
+
+diff --git a/libgcc/config/alpha/t-alpha b/libgcc/config/alpha/t-alpha
+index 0b6ffb1..0c2f840 100644
+--- a/libgcc/config/alpha/t-alpha
++++ b/libgcc/config/alpha/t-alpha
+@@ -1,2 +1,6 @@
+ # This is a support routine for longlong.h, used by libgcc2.c.
+ LIB2ADD += $(srcdir)/config/alpha/qrnnd.S
++
++# When GAS-generated unwind tables are created, they get created
++# after the __FRAME_END__ terminator, which causes an ld error.
++CRTSTUFF_T_CFLAGS = -fno-unwind-tables
diff --git a/patches/gcc/4.9.4/875-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/4.9.4/875-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..052ffc3
--- /dev/null
+++ b/patches/gcc/4.9.4/875-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,73 @@
+From 0f32ae7bc51725cd500e2877b571fd914d77852e Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index d8c8298..3c00961 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1785,7 +1785,7 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call8\t0x%lx", INTVAL (tgt));
++ sprintf (result, "call8\t" HOST_WIDE_INT_PRINT_HEX, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx8\t%%%d", callop);
+ else
+@@ -2360,14 +2360,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2381,7 +2381,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2450,7 +2450,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/5.4.0/1100-msp430-string-literals.patch b/patches/gcc/5.4.0/1100-msp430-string-literals.patch
new file mode 100644
index 0000000..819d6d2
--- /dev/null
+++ b/patches/gcc/5.4.0/1100-msp430-string-literals.patch
@@ -0,0 +1,81 @@
+commit 9d247a3d78b97c004e7ca5e7d6cc9964dba870c7
+Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed May 13 01:11:13 2015 +0000
+
+ gcc/
+ * config/mmix/mmix.c, config/msp430/msp430.c: Add space between
+ string literal and macro name.
+ gcc/ada/
+ * sigtramp-vxworks.c: Add space between string literal and macro
+ name.
+
+ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223106 138bc75d-0d04-0410-961f-82ee72b054a4
+
+diff --git a/gcc/ada/sigtramp-vxworks.c b/gcc/ada/sigtramp-vxworks.c
+index 2119296dc1d..c697626a03e 100644
+--- a/gcc/ada/sigtramp-vxworks.c
++++ b/gcc/ada/sigtramp-vxworks.c
+@@ -342,16 +342,16 @@ CR("") \
+ TCR("# Allocate frame and save the non-volatile") \
+ TCR("# registers we're going to modify") \
+ TCR("mov ip, sp") \
+-TCR("stmfd sp!, {r"S(CFA_REG)", fp, ip, lr, pc}") \
++TCR("stmfd sp!, {r" S(CFA_REG)", fp, ip, lr, pc}") \
+ TCR("# Setup CFA_REG = context, which we'll retrieve as our CFA value") \
+-TCR("ldr r"S(CFA_REG)", [ip]") \
++TCR("ldr r" S(CFA_REG)", [ip]") \
+ TCR("") \
+ TCR("# Call the real handler. The signo, siginfo and sigcontext") \
+ TCR("# arguments are the same as those we received in r0, r1 and r2") \
+ TCR("sub fp, ip, #4") \
+ TCR("blx r3") \
+ TCR("# Restore our callee-saved items, release our frame and return") \
+-TCR("ldmfd sp, {r"S(CFA_REG)", fp, sp, pc}")
++TCR("ldmfd sp, {r" S(CFA_REG)", fp, sp, pc}")
+
+ #else
+ Not_implemented;
+diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
+index 6e991207dbc..e0699854e25 100644
+--- a/gcc/config/mmix/mmix.c
++++ b/gcc/config/mmix/mmix.c
+@@ -2520,7 +2520,7 @@ mmix_output_shiftvalue_op_from_str (FILE *stream,
+ if (! mmix_shiftable_wyde_value (value))
+ {
+ char s[sizeof ("0xffffffffffffffff")];
+- sprintf (s, "%#"PRIx64, value);
++ sprintf (s, "%#" PRIx64, value);
+ internal_error ("MMIX Internal: %s is not a shiftable int", s);
+ }
+
+@@ -2562,7 +2562,7 @@ mmix_output_octa (FILE *stream, int64_t value, int do_begin_end)
+ fprintf (stream, "#" HOST_WIDE_INT_PRINT_HEX_PURE,
+ (HOST_WIDE_INT) value);
+ else /* Need to avoid the hex output; there's no ...WIDEST...HEX_PURE. */
+- fprintf (stream, "%"PRIu64, value);
++ fprintf (stream, "%" PRIu64, value);
+
+ if (do_begin_end)
+ fprintf (stream, "\n");
+@@ -2579,7 +2579,7 @@ mmix_output_shifted_value (FILE *stream, int64_t value)
+ if (! mmix_shiftable_wyde_value (value))
+ {
+ char s[16+2+1];
+- sprintf (s, "%#"PRIx64, value);
++ sprintf (s, "%#" PRIx64, value);
+ internal_error ("MMIX Internal: %s is not a shiftable int", s);
+ }
+
+diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
+index bec168ca2ae..58d0efea1de 100644
+--- a/gcc/config/msp430/msp430.c
++++ b/gcc/config/msp430/msp430.c
+@@ -2248,7 +2248,7 @@ static struct
+ }
+ const_shift_helpers[] =
+ {
+-#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G }
++#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G }
+
+ CSH ("slli", 1, 1, slli_1),
+ CSH ("slll", 1, 1, slll_1),
diff --git a/patches/gcc/5.4.0/111-alpha-bad-eh_frame.patch b/patches/gcc/5.4.0/111-alpha-bad-eh_frame.patch
new file mode 100644
index 0000000..93f6e94
--- /dev/null
+++ b/patches/gcc/5.4.0/111-alpha-bad-eh_frame.patch
@@ -0,0 +1,13 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80037
+
+diff --git a/libgcc/config/alpha/t-alpha b/libgcc/config/alpha/t-alpha
+index 0b6ffb1..0c2f840 100644
+--- a/libgcc/config/alpha/t-alpha
++++ b/libgcc/config/alpha/t-alpha
+@@ -1,2 +1,6 @@
+ # This is a support routine for longlong.h, used by libgcc2.c.
+ LIB2ADD += $(srcdir)/config/alpha/qrnnd.S
++
++# When GAS-generated unwind tables are created, they get created
++# after the __FRAME_END__ terminator, which causes an ld error.
++CRTSTUFF_T_CFLAGS = -fno-unwind-tables
diff --git a/patches/gcc/5.4.0/879-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/5.4.0/879-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..e75e258
--- /dev/null
+++ b/patches/gcc/5.4.0/879-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,74 @@
+From 1117c8be9e712f778739d751aa61038794437d7d Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index 36ab1e3..8e62d63 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1811,7 +1811,8 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call%d\t0x%lx", WINDOW_SIZE, INTVAL (tgt));
++ sprintf (result, "call%d\t" HOST_WIDE_INT_PRINT_HEX,
++ WINDOW_SIZE, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx%d\t%%%d", WINDOW_SIZE, callop);
+ else
+@@ -2382,14 +2383,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2403,7 +2404,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2472,7 +2473,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/6.3.0/1100-ubsan-fix-check-empty-string.patch b/patches/gcc/6.3.0/1100-ubsan-fix-check-empty-string.patch
new file mode 100644
index 0000000..c012719
--- /dev/null
+++ b/patches/gcc/6.3.0/1100-ubsan-fix-check-empty-string.patch
@@ -0,0 +1,28 @@
+From 8db2cf6353c13f2a84cbe49b689654897906c499 Mon Sep 17 00:00:00 2001
+From: kyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 3 Sep 2016 10:57:05 +0000
+Subject: [PATCH] gcc/ * ubsan.c (ubsan_use_new_style_p): Fix check for empty
+ string.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239971 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
+
+---
+ gcc/ubsan.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+Index: gcc-6.3.0/gcc/ubsan.c
+===================================================================
+--- gcc-6.3.0.orig/gcc/ubsan.c
++++ gcc-6.3.0/gcc/ubsan.c
+@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc)
+
+ expanded_location xloc = expand_location (loc);
+ if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
+- || xloc.file == '\0' || xloc.file[0] == '\xff'
++ || xloc.file[0] == '\0' || xloc.file[0] == '\xff'
+ || xloc.file[1] == '\xff')
+ return false;
+
diff --git a/patches/gcc/6.3.0/111-alpha-bad-eh_frame.patch b/patches/gcc/6.3.0/111-alpha-bad-eh_frame.patch
new file mode 100644
index 0000000..93f6e94
--- /dev/null
+++ b/patches/gcc/6.3.0/111-alpha-bad-eh_frame.patch
@@ -0,0 +1,13 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80037
+
+diff --git a/libgcc/config/alpha/t-alpha b/libgcc/config/alpha/t-alpha
+index 0b6ffb1..0c2f840 100644
+--- a/libgcc/config/alpha/t-alpha
++++ b/libgcc/config/alpha/t-alpha
+@@ -1,2 +1,6 @@
+ # This is a support routine for longlong.h, used by libgcc2.c.
+ LIB2ADD += $(srcdir)/config/alpha/qrnnd.S
++
++# When GAS-generated unwind tables are created, they get created
++# after the __FRAME_END__ terminator, which causes an ld error.
++CRTSTUFF_T_CFLAGS = -fno-unwind-tables
diff --git a/patches/gcc/6.3.0/873-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/6.3.0/873-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..a5b0624
--- /dev/null
+++ b/patches/gcc/6.3.0/873-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,74 @@
+From a3d07c8a2a9564b57ebcae8463c1541a37c97c34 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index 70f698a..2bdf5cc 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1776,7 +1776,8 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call%d\t0x%lx", WINDOW_SIZE, INTVAL (tgt));
++ sprintf (result, "call%d\t" HOST_WIDE_INT_PRINT_HEX,
++ WINDOW_SIZE, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx%d\t%%%d", WINDOW_SIZE, callop);
+ else
+@@ -2347,14 +2348,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2368,7 +2369,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2433,7 +2434,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (GET_MODE (x), XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/6.3.0/951-bionic-ndk.patch b/patches/gcc/6.3.0/951-bionic-ndk.patch
new file mode 100644
index 0000000..59c50a8
--- /dev/null
+++ b/patches/gcc/6.3.0/951-bionic-ndk.patch
@@ -0,0 +1,58 @@
+commit d38d37bdfe24b7ce1bdcb55642fb6b904718e68f
+Author: Howard Chu <hyc@symas.com>
+Date: Tue Apr 25 19:02:18 2017 -0700
+
+ Fix ctype for newer NDK headers
+
+diff --git a/libstdc++-v3/config/os/bionic/ctype_base.h b/libstdc++-v3/config/os/bionic/ctype_base.h
+index 33978f3..c36e63c 100644
+--- a/libstdc++-v3/config/os/bionic/ctype_base.h
++++ b/libstdc++-v3/config/os/bionic/ctype_base.h
+@@ -28,6 +28,18 @@
+
+ // Information as gleaned from /usr/include/ctype.h
+
++// _CTYPE prefix was added in NDK r14 unified headers
++#ifndef _CTYPE_U
++#define _CTYPE_U _U
++#define _CTYPE_L _L
++#define _CTYPE_D _N
++#define _CTYPE_S _S
++#define _CTYPE_P _P
++#define _CTYPE_C _C
++#define _CTYPE_X _X
++#define _CTYPE_B _B
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,17 +53,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+ typedef char mask;
+- static const mask upper = _U;
+- static const mask lower = _L;
+- static const mask alpha = _U | _L;
+- static const mask digit = _N;
+- static const mask xdigit = _X | _N;
+- static const mask space = _S;
+- static const mask print = _P | _U | _L | _N | _B;
+- static const mask graph = _P | _U | _L | _N;
+- static const mask cntrl = _C;
+- static const mask punct = _P;
+- static const mask alnum = _U | _L | _N;
++ static const mask upper = _CTYPE_U;
++ static const mask lower = _CTYPE_L;
++ static const mask alpha = _CTYPE_U | _CTYPE_L;
++ static const mask digit = _CTYPE_D;
++ static const mask xdigit = _CTYPE_X | _CTYPE_D;
++ static const mask space = _CTYPE_S;
++ static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_D | _CTYPE_B;
++ static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_D;
++ static const mask cntrl = _CTYPE_C;
++ static const mask punct = _CTYPE_P;
++ static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_D;
+ #if __cplusplus >= 201103L
+ static const mask blank = space;
+ #endif
diff --git a/patches/gcc/6.3.0/952-bionic-errno.patch b/patches/gcc/6.3.0/952-bionic-errno.patch
new file mode 100644
index 0000000..91f6ca3
--- /dev/null
+++ b/patches/gcc/6.3.0/952-bionic-errno.patch
@@ -0,0 +1,19 @@
+commit 6cd4ad106ef87a3c58b0c3478e78409b47000de0
+Author: Howard Chu <hyc@symas.com>
+Date: Tue Apr 25 20:17:03 2017 -0700
+
+ Fix, errno is volatile int
+
+diff --git a/libstdc++-v3/src/filesystem/dir.cc b/libstdc++-v3/src/filesystem/dir.cc
+index 6ff12d0..5bbd664 100644
+--- a/libstdc++-v3/src/filesystem/dir.cc
++++ b/libstdc++-v3/src/filesystem/dir.cc
+@@ -147,7 +147,7 @@ fs::_Dir::advance(error_code* ec, directory_options options)
+
+ int err = std::exchange(errno, 0);
+ const auto entp = readdir(dirp);
+- std::swap(errno, err);
++ std::swap((int&)errno, err);
+
+ if (entp)
+ {
diff --git a/patches/gcc/6.3.0/970-crystax.patch b/patches/gcc/6.3.0/970-crystax.patch
new file mode 100644
index 0000000..e3109cc
--- /dev/null
+++ b/patches/gcc/6.3.0/970-crystax.patch
@@ -0,0 +1,551 @@
+commit 080803512c8f6f87c2f1f711170d54033144d628
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Wed Jul 29 11:28:29 2015 +0300
+
+ [android] Apply Android-related modifications
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+[Edited: keep libstdc++, drop libcrystax-related modifications]
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index f66e48cd1..1c253496b 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -942,13 +942,17 @@ aarch64*-*-elf | aarch64*-*-rtems*)
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
+ ;;
+ aarch64*-*-linux*)
+- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h"
+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
++ extra_options="${extra_options} linux-android.opt"
+ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
+ case $target in
+ aarch64_be-*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
++ aarch64*-*-linux-android*)
++ tm_file="${tm_file} aarch64/aarch64-linux-android.h"
++ ;;
+ esac
+ aarch64_multilibs="${with_multilib_list}"
+ if test "$aarch64_multilibs" = "default"; then
+@@ -2055,6 +2059,17 @@ mips*-*-linux*) # Linux MIPS, either endian.
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
+ extra_options="${extra_options} linux-android.opt"
+ case ${target} in
++ mips64*android*)
++ default_mips_arch=mips64r6
++ default_mips_abi=64
++ tm_file="${tm_file} mips/android.h"
++ tmake_file="${tmake_file} mips/t-linux-android64"
++ ;;
++ mips*android*)
++ default_mips_arch=mips32
++ tm_file="${tm_file} mips/android.h"
++ tmake_file="$tmake_file mips/t-linux-android"
++ ;;
+ mipsisa32r6*)
+ default_mips_arch=mips32r6
+ ;;
+diff --git a/gcc/config/aarch64/aarch64-linux-android.h b/gcc/config/aarch64/aarch64-linux-android.h
+new file mode 100644
+index 000000000..db1288fd0
+--- /dev/null
++++ b/gcc/config/aarch64/aarch64-linux-android.h
+@@ -0,0 +1,59 @@
++/* Machine description for AArch64 architecture.
++ Copyright (C) 2014 Free Software Foundation, Inc.
++
++ This file is part of GCC.
++
++ GCC is free software; you can redistribute it and/or modify it
++ under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3, or (at your option)
++ any later version.
++
++ GCC is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with GCC; see the file COPYING3. If not see
++ <http://www.gnu.org/licenses/>. */
++
++#ifndef GCC_AARCH64_LINUX_ANDROID_H
++#define GCC_AARCH64_LINUX_ANDROID_H
++
++
++#undef TARGET_OS_CPP_BUILTINS
++#define TARGET_OS_CPP_BUILTINS() \
++ do \
++ { \
++ GNU_USER_TARGET_OS_CPP_BUILTINS(); \
++ ANDROID_TARGET_OS_CPP_BUILTINS(); \
++ } \
++ while (0)
++
++#undef LINK_SPEC
++#define LINK_SPEC \
++ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
++ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
++
++#undef CC1_SPEC
++#define CC1_SPEC \
++ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
++ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic"))
++
++#define CC1PLUS_SPEC \
++ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
++
++#undef LIB_SPEC
++#define LIB_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
++ GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC " " ANDROID_LIB_SPEC)
++
++#undef STARTFILE_SPEC
++#define STARTFILE_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
++
++#undef ENDFILE_SPEC
++#define ENDFILE_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
++
++#endif /* GCC_AARCH64_LINUX_ANDROID_H */
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index 5fcaa59a3..6864195ee 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,14 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#ifndef RUNTIME_ROOT_PREFIX
++#define RUNTIME_ROOT_PREFIX ""
++#endif
++#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#ifdef BIONIC_DYNAMIC_LINKER
++#undef BIONIC_DYNAMIC_LINKER
++#endif
++#define BIONIC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/system/bin/linker64"
+
+ #undef MUSL_DYNAMIC_LINKER
+ #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
+index ad123dde9..97b059de6 100644
+--- a/gcc/config/arm/arm.h
++++ b/gcc/config/arm/arm.h
+@@ -1888,10 +1888,11 @@ enum arm_auto_incmodes
+
+ #define CASE_VECTOR_PC_RELATIVE (TARGET_THUMB2 \
+ || (TARGET_THUMB1 \
++ && !inline_thumb1_jump_table \
+ && (optimize_size || flag_pic)))
+
+ #define CASE_VECTOR_SHORTEN_MODE(min, max, body) \
+- (TARGET_THUMB1 \
++ (TARGET_THUMB1 && !inline_thumb1_jump_table \
+ ? (min >= 0 && max < 512 \
+ ? (ADDR_DIFF_VEC_FLAGS (body).offset_unsigned = 1, QImode) \
+ : min >= -256 && max < 256 \
+diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
+index 47171b996..eb22d1181 100644
+--- a/gcc/config/arm/arm.md
++++ b/gcc/config/arm/arm.md
+@@ -8179,7 +8179,7 @@
+ (match_operand:SI 2 "const_int_operand" "") ; total range
+ (match_operand:SI 3 "" "") ; table label
+ (match_operand:SI 4 "" "")] ; Out of range label
+- "TARGET_32BIT || optimize_size || flag_pic"
++ "TARGET_32BIT || ((optimize_size || flag_pic) && !inline_thumb1_jump_table)"
+ "
+ {
+ enum insn_code code;
+diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
+index 0ebe01743..772453889 100644
+--- a/gcc/config/arm/arm.opt
++++ b/gcc/config/arm/arm.opt
+@@ -193,6 +193,10 @@ mthumb-interwork
+ Target Report Mask(INTERWORK)
+ Support calls between Thumb and ARM instruction sets.
+
++minline-thumb1-jumptable
++Target Report Var(inline_thumb1_jump_table)
++Inline Thumb1 Jump table code
++
+ mtls-dialect=
+ Target RejectNegative Joined Enum(tls_type) Var(target_tls_dialect) Init(TLS_GNU)
+ Specify thread local storage scheme.
+diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
+index 77f30554d..32158ed65 100644
+--- a/gcc/config/arm/elf.h
++++ b/gcc/config/arm/elf.h
+@@ -56,8 +56,7 @@
+ #undef SUBSUBTARGET_EXTRA_SPECS
+ #define SUBSUBTARGET_EXTRA_SPECS
+
+-#ifndef ASM_SPEC
+-#define ASM_SPEC "\
++#define DEFAULT_ASM_SPEC "\
+ %{mbig-endian:-EB} \
+ %{mlittle-endian:-EL} \
+ %(asm_cpu_spec) \
+@@ -66,6 +65,9 @@
+ %{mthumb-interwork:-mthumb-interwork} \
+ %{mfloat-abi=*} %{mfpu=*} \
+ %(subtarget_extra_asm_spec)"
++
++#ifndef ASM_SPEC
++#define ASM_SPEC DEFAULT_ASM_SPEC
+ #endif
+
+ /* The ARM uses @ are a comment character so we need to redefine
+@@ -104,7 +106,8 @@
+ the code more efficient, but for Thumb-1 it's better to put them out of
+ band unless we are generating compressed tables. */
+ #define JUMP_TABLES_IN_TEXT_SECTION \
+- (TARGET_32BIT || (TARGET_THUMB && (optimize_size || flag_pic)))
++ (TARGET_32BIT || (TARGET_THUMB && !inline_thumb1_jump_table \
++ && (optimize_size || flag_pic)))
+
+ #ifndef LINK_SPEC
+ #define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index ace84816e..8c8fa6553 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -108,11 +108,16 @@
+ #define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC, \
+ GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \
+- ANDROID_CC1_SPEC)
++ ANDROID_CC1_SPEC("-fpic"))
+
+ #define CC1PLUS_SPEC \
+ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
++#undef ASM_SPEC
++#define ASM_SPEC \
++ LINUX_OR_ANDROID_CC (DEFAULT_ASM_SPEC, \
++ DEFAULT_ASM_SPEC " " ANDROID_ASM_SPEC)
++
+ #undef LIB_SPEC
+ #define LIB_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
+diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
+index fee33a3ef..22fb2ced9 100644
+--- a/gcc/config/i386/gnu-user.h
++++ b/gcc/config/i386/gnu-user.h
+@@ -65,9 +65,14 @@ along with GCC; see the file COPYING3. If not see
+ When the -shared link option is used a final link is not being
+ done. */
+
++#undef ANDROID_TARGET_CC1_SPEC
++#define ANDROID_TARGET_CC1_SPEC \
++ " -mssse3 -fno-short-enums " \
++
+ #undef ASM_SPEC
+ #define ASM_SPEC \
+- "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
++ "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}} " \
++ LINUX_OR_ANDROID_CC ("", ANDROID_ASM_SPEC)
+
+ #undef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
+index 7a02a7eb4..cac4179bc 100644
+--- a/gcc/config/i386/gnu-user64.h
++++ b/gcc/config/i386/gnu-user64.h
+@@ -46,6 +46,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define SPEC_X32 "mx32"
+ #endif
+
++#undef ANDROID_TARGET_CC1_SPEC
++#define ANDROID_TARGET_CC1_SPEC \
++ "%{m32:-mssse3 -fno-short-enums}" \
++ "%{!m32:-msse4.2 -mpopcnt}"
++
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{" SPEC_32 ":--32} \
+ %{" SPEC_64 ":--64} \
+diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
+index 4b9910fa9..3b11ed086 100644
+--- a/gcc/config/i386/linux-common.h
++++ b/gcc/config/i386/linux-common.h
+@@ -30,7 +30,13 @@ along with GCC; see the file COPYING3. If not see
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+- GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
++ GNU_USER_TARGET_CC1_SPEC \
++ ANDROID_TARGET_CC1_SPEC \
++ " " \
++ ANDROID_CC1_SPEC("-fPIC"))
++
++#define CC1PLUS_SPEC \
++ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
+index 301a41ccd..9623c88d0 100644
+--- a/gcc/config/linux-android.h
++++ b/gcc/config/linux-android.h
+@@ -38,15 +39,18 @@
+ "%{" NOANDROID "|tno-android-ld:" LINUX_SPEC ";:" ANDROID_SPEC "}"
+
+ #define ANDROID_LINK_SPEC \
+- "%{shared: -Bsymbolic}"
++ "%{shared: -Bsymbolic} -z noexecstack -z relro -z now"
+
+-#define ANDROID_CC1_SPEC \
++#define ANDROID_CC1_SPEC(ANDROID_PIC_DEFAULT) \
+ "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \
+- "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
++ "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: " ANDROID_PIC_DEFAULT "}}}}"
+
+ #define ANDROID_CC1PLUS_SPEC \
+- "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \
+- "%{!frtti:%{!fno-rtti: -fno-rtti}}"
++ "%{!fexceptions:%{!fno-exceptions: -fexceptions}} " \
++ "%{!frtti:%{!fno-rtti: -frtti}}"
++
++#define ANDROID_ASM_SPEC \
++ "--noexecstack"
+
+ #define ANDROID_LIB_SPEC \
+ "%{!static: -ldl}"
+diff --git a/gcc/config/mips/android.h b/gcc/config/mips/android.h
+new file mode 100644
+index 000000000..32c539c8d
+--- /dev/null
++++ b/gcc/config/mips/android.h
+@@ -0,0 +1,49 @@
++/* Target macros for mips*-*android* targets.
++ Copyright (C) 2014 Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 3, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>. */
++
++#undef DRIVER_SELF_SPECS
++#define DRIVER_SELF_SPECS \
++ /* Make sure a -mips option is present. This helps us to pick \
++ the right multilib, and also makes the later specs easier \
++ to write. */ \
++ MIPS_ISA_LEVEL_SPEC, \
++ \
++ /* Infer the default float setting from -march. */ \
++ MIPS_ARCH_FLOAT_SPEC, \
++ \
++ /* Infer the -msynci setting from -march if not explicitly set. */ \
++ MIPS_ISA_SYNCI_SPEC, \
++ \
++ /* If no ABI option is specified, infer one from the ISA level \
++ or -mgp setting. */ \
++ "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=64}}", \
++ \
++ /* If no FP ABI option is specified, infer one from the \
++ ABI/ISA level unless there is a conflicting option. */ \
++ "%{!msoft-float: %{!msingle-float: %{!mfp*: %{!mmsa: %{mabi=32: %{" \
++ MIPS_FPXX_OPTION_SPEC ": -mfpxx}}}}}}", \
++ \
++ /* If no odd-spreg option is specified, infer one from the ISA. */ \
++ "%{!modd-spreg: %{mabi=32: %{mips32r6: -mno-odd-spreg}}}", \
++ \
++ /* Base SPECs. */ \
++ BASE_DRIVER_SELF_SPECS, \
++ \
++ /* Use the standard linux specs for everything else. */ \
++ LINUX_DRIVER_SELF_SPECS
+diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
+index 15b549c08..4a2816014 100644
+--- a/gcc/config/mips/gnu-user.h
++++ b/gcc/config/mips/gnu-user.h
+@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
+ /* The GNU C++ standard library requires this. */ \
+ if (c_dialect_cxx ()) \
+ builtin_define ("_GNU_SOURCE"); \
++ ANDROID_TARGET_OS_CPP_BUILTINS(); \
+ } while (0)
+
+ #undef SUBTARGET_CPP_SPEC
+@@ -71,7 +72,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef SUBTARGET_ASM_SPEC
+ #define SUBTARGET_ASM_SPEC \
+- "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}"
++ "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}} " \
++ LINUX_OR_ANDROID_CC ("", ANDROID_ASM_SPEC)
+
+ /* The MIPS assembler has different syntax for .set. We set it to
+ .dummy to trap any errors. */
+@@ -120,7 +122,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
+ #endif
+
+ #define LINUX_DRIVER_SELF_SPECS \
+- NO_SHARED_SPECS \
++ LINUX_OR_ANDROID_CC(NO_SHARED_SPECS, "") \
+ MARCH_MTUNE_NATIVE_SPECS, \
+ /* -mplt has no effect without -mno-shared. Simplify later \
+ specs handling by removing a redundant option. */ \
+diff --git a/gcc/config/mips/linux-common.h b/gcc/config/mips/linux-common.h
+index 8429a7ca2..8bfacf994 100644
+--- a/gcc/config/mips/linux-common.h
++++ b/gcc/config/mips/linux-common.h
+@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
+ #undef SUBTARGET_CC1_SPEC
+ #define SUBTARGET_CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+- GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
++ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic"))
+
+ #undef CC1PLUS_SPEC
+ #define CC1PLUS_SPEC \
+diff --git a/gcc/config/mips/t-linux-android b/gcc/config/mips/t-linux-android
+new file mode 100644
+index 000000000..39f512c81
+--- /dev/null
++++ b/gcc/config/mips/t-linux-android
+@@ -0,0 +1,3 @@
++MULTILIB_OPTIONS = mips32r2/mips32r6
++MULTILIB_DIRNAMES = mips-r2 mips-r6
++MULTILIB_OSDIRNAMES = ../libr2 ../libr6
+diff --git a/gcc/config/mips/t-linux-android64 b/gcc/config/mips/t-linux-android64
+new file mode 100644
+index 000000000..55cab7d62
+--- /dev/null
++++ b/gcc/config/mips/t-linux-android64
+@@ -0,0 +1,4 @@
++MULTILIB_OPTIONS = mabi=32 mips32/mips32r2/mips32r6/mips64r2/mips64r6
++MULTILIB_DIRNAMES = 32 mips-r1 mips-r2 mips-r6 mips64-r2 mips64-r6
++MULTILIB_OSDIRNAMES = ../lib ../lib ../libr2 ../libr6 ../lib64r2 ../lib64
++MULTILIB_REQUIRED = mabi=32/mips32 mabi=32/mips32r2 mabi=32/mips32r6 mips64r2 mips64r6
+diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h
+index 555c0fe24..47c8655f9 100644
+--- a/libgcc/gthr-posix.h
++++ b/libgcc/gthr-posix.h
+@@ -32,6 +32,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define __GTHREADS 1
+ #define __GTHREADS_CXX0X 1
+
++/* The following should normally be in a different header file,
++ * but I couldn't find the right location. The point of the macro
++ * definition below is to prevent libsupc++ and libstdc++ to reference
++ * weak symbols in their static C++ constructors. Such code crashes
++ * when a shared object linked statically to these libraries is
++ * loaded on Android 2.1 (Eclair) and older platform releases, due
++ * to a dynamic linker bug.
++ */
++#ifdef __ANDROID__
++#undef GTHREAD_USE_WEAK
++#define GTHREAD_USE_WEAK 0
++#endif
++
+ #include <pthread.h>
+
+ #if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 41797a971..f746e8353 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -78319,6 +78341,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <sys/syscall.h>
+ int lk;
++#if !defined(SYS_gettid)
++#define SYS_gettid __NR_gettid
++#endif
++#if !defined(SYS_futex)
++#define SYS_futex __NR_futex
++#endif
+ int
+ main ()
+ {
+@@ -78377,6 +78405,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <sys/syscall.h>
+ int lk;
++#if !defined(SYS_gettid)
++#define SYS_gettid __NR_gettid
++#endif
++#if !defined(SYS_futex)
++#define SYS_futex __NR_futex
++#endif
+ int
+ main ()
+ {
+diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
+index e3e206b7d..e85dc2c76 100644
+--- a/libstdc++-v3/include/bits/locale_facets.h
++++ b/libstdc++-v3/include/bits/locale_facets.h
+@@ -47,6 +47,20 @@
+ #include <ext/numeric_traits.h>
+ #include <bits/streambuf_iterator.h>
+
++#if !__clang__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && __i386__
++// CrystaX: for some reason, x86 gcc-4.9 makes ctype<char>::do_widen() and
++// ctype<char>::_M_widen_init() methods working wrong if optimization enabled.
++// For ctype<char>::do_widen(), values of passed arguments (__lo, __hi and __to)
++// are completely messed up and don't correspond to passed values. In case if
++// we disable optimization for those methods, things become correct so we apply
++// this workaround here for a time.
++// TODO: figure out what exactly wrong here - is it bug in GCC optimization
++// algorithm or smth else?
++#define __CRYSTAX_X86_DONT_OPTIMIZE __attribute__((optimize(0)))
++#else
++#define __CRYSTAX_X86_DONT_OPTIMIZE
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1102,7 +1116,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ * @return @a __hi.
+ */
+ virtual const char*
+- do_widen(const char* __lo, const char* __hi, char_type* __to) const
++ do_widen(const char* __lo, const char* __hi, char_type* __to) const __CRYSTAX_X86_DONT_OPTIMIZE
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+@@ -1163,7 +1177,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ private:
+ void _M_narrow_init() const;
+- void _M_widen_init() const;
++ void _M_widen_init() const __CRYSTAX_X86_DONT_OPTIMIZE;
+ };
+
+ #ifdef _GLIBCXX_USE_WCHAR_T
+diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
+index 9b617998f..c149169bb 100644
+--- a/libstdc++-v3/libsupc++/guard.cc
++++ b/libstdc++-v3/libsupc++/guard.cc
+@@ -33,7 +33,12 @@
+ #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
+ && (ATOMIC_INT_LOCK_FREE > 1) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
+ # include <climits>
++#if defined(__ANDROID__)
++# include <sys/syscall.h>
++# define SYS_futex __NR_futex
++#else
+ # include <syscall.h>
++#endif
+ # include <unistd.h>
+ # define _GLIBCXX_USE_FUTEX
+ # define _GLIBCXX_FUTEX_WAIT 0
diff --git a/patches/gcc/6.3.0/971-crystax.patch b/patches/gcc/6.3.0/971-crystax.patch
new file mode 100644
index 0000000..748a381
--- /dev/null
+++ b/patches/gcc/6.3.0/971-crystax.patch
@@ -0,0 +1,25 @@
+commit 9f057b62caafe08c968103d39b5df82486a175c2
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Thu Aug 13 16:11:54 2015 +0300
+
+ [android] Add additional multilib option: mfloat-abi=hard
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/arm/t-linux-androideabi b/gcc/config/arm/t-linux-androideabi
+index 8f1307c55..cbbec5bd2 100644
+--- a/gcc/config/arm/t-linux-androideabi
++++ b/gcc/config/arm/t-linux-androideabi
+@@ -1,8 +1,9 @@
+-MULTILIB_OPTIONS = march=armv7-a mthumb
+-MULTILIB_DIRNAMES = armv7-a thumb
+-MULTILIB_EXCEPTIONS =
++MULTILIB_OPTIONS = march=armv7-a mthumb mfloat-abi=hard
++MULTILIB_DIRNAMES = armv7-a thumb hard
++MULTILIB_EXCEPTIONS = mfloat-abi=hard* mthumb/mfloat-abi=hard*
+ MULTILIB_MATCHES =
+ MULTILIB_OSDIRNAMES =
++MULTILIB_EXTRA_OPTS = Wl,--no-warn-mismatch
+
+ # The "special" multilib can be used to build native applications for Android,
+ # as opposed to native shared libraries that are then called via JNI.
diff --git a/patches/gcc/6.3.0/972-crystax.patch b/patches/gcc/6.3.0/972-crystax.patch
new file mode 100644
index 0000000..b9077be
--- /dev/null
+++ b/patches/gcc/6.3.0/972-crystax.patch
@@ -0,0 +1,302 @@
+commit 44a81ebb7698dac41ffa7acd5e0cc1578e5ab1fd
+Author: H.J. Lu <hongjiu.lu@intel.com>
+Date: Mon Apr 14 15:59:47 2014 -0700
+
+ [android] Always enable --eh-frame-hdr for static executable
+
+ See 5e6cdf76af295c9a39b695ca228cff675e8ff4ae and
+ 23e3137ee2897464b051599b85a09f130d3ad05d
+
+ Change-Id: Ibda473188e5a10f2a0592f2494ad00ad1f91e04b
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config.in b/gcc/config.in
+index 115cb6163..933916833 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -2119,6 +2119,12 @@
+ #endif
+
+
++/* Define if your system supports PT_GNU_EH_FRAME for static executable. */
++#ifndef USED_FOR_TARGET
++#undef USE_EH_FRAME_HDR_FOR_STATIC
++#endif
++
++
+ /* Define to 1 if the 'long long' type is wider than 'long' but still
+ efficiently supported by the host hardware. */
+ #ifndef USED_FOR_TARGET
+diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
+index 093c38bba..54b3e0c91 100644
+--- a/gcc/config/alpha/elf.h
++++ b/gcc/config/alpha/elf.h
+@@ -168,5 +168,9 @@ extern int alpha_this_gpdisp_sequence_number;
+ I imagine that other systems will catch up. In the meantime, it
+ doesn't harm to make sure that the data exists to be used later. */
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h
+index 5ded869d2..5f51ac81d 100644
+--- a/gcc/config/freebsd.h
++++ b/gcc/config/freebsd.h
+@@ -45,8 +45,12 @@ along with GCC; see the file COPYING3. If not see
+ #define LIB_SPEC FBSD_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
+index b0bf40a95..d1874bc29 100644
+--- a/gcc/config/gnu-user.h
++++ b/gcc/config/gnu-user.h
+@@ -118,8 +118,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #undef LINK_GCC_C_SEQUENCE_SPEC
+ #define LINK_GCC_C_SEQUENCE_SPEC \
+diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
+index 37ecfc43f..a5f1b9955 100644
+--- a/gcc/config/openbsd.h
++++ b/gcc/config/openbsd.h
+@@ -136,8 +136,12 @@ while (0)
+ #define LIB_SPEC OBSD_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #undef LIB_SPEC
+ #define LIB_SPEC OBSD_LIB_SPEC
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index cbf909722..eb2217fad 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -789,7 +789,11 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++# ifdef USE_EH_FRAME_HDR_FOR_STATIC
++# define LINK_EH_SPEC "--eh-frame-hdr "
++# else
++# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++# endif
+ #endif
+
+ #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
+diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
+index 5160e1fda..7632a5081 100644
+--- a/gcc/config/sol2.h
++++ b/gcc/config/sol2.h
+@@ -347,7 +347,11 @@ along with GCC; see the file COPYING3. If not see
+ /* Solaris 11 build 135+ implements dl_iterate_phdr. GNU ld needs
+ --eh-frame-hdr to create the required .eh_frame_hdr sections. */
+ #if defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#endif
+ #endif /* HAVE_LD_EH_FRAME && TARGET_DL_ITERATE_PHDR */
+ #endif
+
+diff --git a/gcc/configure b/gcc/configure
+index 1c6e3407c..28ad05004 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -934,6 +934,7 @@ enable_fix_cortex_a53_835769
+ enable_fix_cortex_a53_843419
+ with_glibc_version
+ enable_gnu_unique_object
++enable_eh_frame_hdr_for_static
+ enable_linker_build_id
+ enable_default_ssp
+ with_long_double_128
+@@ -1670,6 +1671,9 @@ Optional Features:
+ --enable-gnu-unique-object
+ enable the use of the @gnu_unique_object ELF
+ extension on glibc systems
++ --enable-eh-frame-hdr-for-static
++ enable linker PT_GNU_EH_FRAME support for static
++ executable
+ --enable-linker-build-id
+ compiler will always pass --build-id to linker
+ --enable-default-ssp enable Stack Smashing Protection as default
+@@ -27703,6 +27707,38 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+
+ $as_echo "#define HAVE_LD_EH_FRAME_HDR 1" >>confdefs.h
+
++ # Check whether --enable-eh-frame-hdr-for-static was given.
++if test "${enable_eh_frame_hdr_for_static+set}" = set; then :
++ enableval=$enable_eh_frame_hdr_for_static; case $enable_eh_frame_hdr_for_static in
++ yes | no) ;;
++ *) as_fn_error "'$enable_eh_frame_hdr_for_static' is an invalid
++value for --enable-eh-frame-hdr-for-static.
++Valid choices are 'yes' and 'no'." "$LINENO" 5 ;;
++ esac
++else
++ # Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from
++# Linux kernel.
++ if test x$host = x$build -a x$host = x$target &&
++ ldd --version 2>&1 >/dev/null &&
++ glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
++ glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
++ glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
++ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
++ if test "$glibcnum" -ge 2003 ; then
++ auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null`
++ if echo "$auvx" | grep AT_PHDR > /dev/null &&
++ echo "$auvx" | grep AT_PHNUM > /dev/null; then
++ enable_eh_frame_hdr_for_static=yes
++ fi
++ fi
++ fi
++fi
++
++ if test x$enable_eh_frame_hdr_for_static = xyes; then
++
++$as_echo "#define USE_EH_FRAME_HDR_FOR_STATIC 1" >>confdefs.h
++
++ fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_hdr" >&5
+ $as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; }
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 6c1dcd9ae..0cf7419e7 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4828,6 +4828,35 @@ GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HDR])
+ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+ AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1,
+ [Define if your linker supports .eh_frame_hdr.])
++ AC_ARG_ENABLE(eh-frame-hdr-for-static,
++ [AS_HELP_STRING([--enable-eh-frame-hdr-for-static],
++ [enable linker PT_GNU_EH_FRAME support for static executable])],
++ [case $enable_eh_frame_hdr_for_static in
++ yes | no) ;;
++ *) AC_MSG_ERROR(['$enable_eh_frame_hdr_for_static' is an invalid
++value for --enable-eh-frame-hdr-for-static.
++Valid choices are 'yes' and 'no'.]) ;;
++ esac],
++# Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from
++# Linux kernel.
++ [[if test x$host = x$build -a x$host = x$target &&
++ ldd --version 2>&1 >/dev/null &&
++ glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
++ glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
++ glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
++ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
++ if test "$glibcnum" -ge 2003 ; then
++ auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null`
++ if echo "$auvx" | grep AT_PHDR > /dev/null &&
++ echo "$auvx" | grep AT_PHNUM > /dev/null; then
++ enable_eh_frame_hdr_for_static=yes
++ fi
++ fi
++ fi]])
++ if test x$enable_eh_frame_hdr_for_static = xyes; then
++ AC_DEFINE(USE_EH_FRAME_HDR_FOR_STATIC, 1,
++[Define if your system supports PT_GNU_EH_FRAME for static executable.])
++ fi
+ fi
+ AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
+
+diff --git a/gcc/testsuite/g++.dg/eh/spec3-static.C b/gcc/testsuite/g++.dg/eh/spec3-static.C
+new file mode 100644
+index 000000000..15408effa
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/eh/spec3-static.C
+@@ -0,0 +1,25 @@
++// PR c++/4381
++// Test that exception-specs work properly for classes with virtual bases.
++
++// { dg-do run }
++// { dg-options "-static" }
++
++class Base {};
++
++struct A : virtual public Base
++{
++ A() {}
++};
++
++struct B {};
++
++void func() throw (B,A)
++{
++ throw A();
++}
++
++int main(void)
++{
++ try { func(); }
++ catch (A& a) { }
++}
+diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
+index f3343fc4f..d42647779 100644
+--- a/libgcc/crtstuff.c
++++ b/libgcc/crtstuff.c
+@@ -88,7 +88,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(BSD_DL_ITERATE_PHDR_AVAILABLE)
+ #include <link.h>
+ # define USE_PT_GNU_EH_FRAME
+@@ -97,7 +98,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(__sun__) && defined(__svr4__)
+ #include <link.h>
+ # define USE_PT_GNU_EH_FRAME
+@@ -106,7 +108,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(__GLIBC__) && __GLIBC__ >= 2
+ #include <link.h>
+ /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+@@ -121,7 +124,7 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(CRTSTUFFT_O) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(inhibit_libc) \
+ && (defined(__GLIBC__) || defined(__gnu_linux__) || defined(__GNU__))
+ /* On systems using glibc, an inhibit_libc build of libgcc is only
diff --git a/patches/gcc/6.3.0/973-crystax.patch b/patches/gcc/6.3.0/973-crystax.patch
new file mode 100644
index 0000000..b96ece3
--- /dev/null
+++ b/patches/gcc/6.3.0/973-crystax.patch
@@ -0,0 +1,20 @@
+commit 778a9ef107f51544d583f110e92b75f4d9d79117
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Thu Aug 20 19:11:07 2015 +0300
+
+ [android] Don't use PIE copyrelocs for x86/x86_64
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
+index 3d044e8bd..5c89fcab0 100644
+--- a/gcc/config/i386/i386.c
++++ b/gcc/config/i386/i386.c
+@@ -14631,6 +14631,7 @@ legitimate_pic_address_disp_p (rtx disp)
+ else if (!SYMBOL_REF_FAR_ADDR_P (op0)
+ && (SYMBOL_REF_LOCAL_P (op0)
+ || (HAVE_LD_PIE_COPYRELOC
++ && !TARGET_HAS_BIONIC
+ && flag_pie
+ && !SYMBOL_REF_WEAK (op0)
+ && !SYMBOL_REF_FUNCTION_P (op0)))
diff --git a/patches/gcc/6.3.0/974-crystax.patch b/patches/gcc/6.3.0/974-crystax.patch
new file mode 100644
index 0000000..9db4f54
--- /dev/null
+++ b/patches/gcc/6.3.0/974-crystax.patch
@@ -0,0 +1,24 @@
+commit dbeae1190cabad83999f2540523f045acc1bb4ec
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Fri Aug 21 17:41:59 2015 +0300
+
+ [android] Always use gthr-posix.h instead of gthr-default.h
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/libgcc/gthr.h b/libgcc/gthr.h
+index 47a7d061a..67a680f90 100644
+--- a/libgcc/gthr.h
++++ b/libgcc/gthr.h
+@@ -145,7 +145,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define GTHREAD_USE_WEAK 1
+ #endif
+ #endif
++#if __ANDROID__
++#include "gthr-posix.h"
++#else
+ #include "gthr-default.h"
++#endif
+
+ #ifndef HIDE_EXPORTS
+ #pragma GCC visibility pop
diff --git a/patches/gcc/6.3.0/975-crystax.patch b/patches/gcc/6.3.0/975-crystax.patch
new file mode 100644
index 0000000..9efc2a4
--- /dev/null
+++ b/patches/gcc/6.3.0/975-crystax.patch
@@ -0,0 +1,31 @@
+commit 8a66d422721ae5999737d7825701ff22097d287b
+Author: Andrew Hsieh <andrewhsieh@google.com>
+Date: Mon Apr 14 21:05:51 2014 -0700
+
+ [android] Fix ARM generates insufficient alignment for NEON vst/vld
+
+ See d909af3e2469aad87d5c3e79b93c778fd26c03a9
+
+ Change-Id: Ie1de9f946f397196bb6f1623f5add86933739484
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
+index 5974c65d3..71b2c7aa9 100644
+--- a/gcc/config/arm/arm.c
++++ b/gcc/config/arm/arm.c
+@@ -22403,9 +22403,13 @@ arm_print_operand (FILE *stream, rtx x, int code)
+ memsize = MEM_SIZE (x);
+
+ /* Only certain alignment specifiers are supported by the hardware. */
+- if (memsize == 32 && (align % 32) == 0)
++ /* Note that ARM EABI only guarentees 8-byte stack alignment. While GCC
++ honors stricter alignment of composite type in user code, it doesn't
++ observe the alignment of memory passed as an extra argument for function
++ returning large composite type. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57271 */
++ if (memsize == 32 && (align % 32) == 0 && !TARGET_AAPCS_BASED)
+ align_bits = 256;
+- else if ((memsize == 16 || memsize == 32) && (align % 16) == 0)
++ else if ((memsize == 16 || memsize == 32) && (align % 16) == 0 && !TARGET_AAPCS_BASED)
+ align_bits = 128;
+ else if (memsize >= 8 && (align % 8) == 0)
+ align_bits = 64;
diff --git a/patches/gcc/6.3.0/976-crystax.patch b/patches/gcc/6.3.0/976-crystax.patch
new file mode 100644
index 0000000..790d4a9
--- /dev/null
+++ b/patches/gcc/6.3.0/976-crystax.patch
@@ -0,0 +1,21 @@
+commit 89d27bc45ee7325dcfff6748da0f8b9c1dc1f234
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Sat Aug 22 09:55:55 2015 +0300
+
+ [android][i386] Remove throw() declaration from posix_memalign() proto
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
+index a1f98d3d1..3725799be 100644
+--- a/gcc/config/i386/pmm_malloc.h
++++ b/gcc/config/i386/pmm_malloc.h
+@@ -31,7 +31,7 @@
+ #ifndef __cplusplus
+ extern int posix_memalign (void **, size_t, size_t);
+ #else
+-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
++extern "C" int posix_memalign (void **, size_t, size_t);
+ #endif
+
+ static __inline void *
diff --git a/patches/gcc/6.3.0/977-crystax.patch b/patches/gcc/6.3.0/977-crystax.patch
new file mode 100644
index 0000000..0211d72
--- /dev/null
+++ b/patches/gcc/6.3.0/977-crystax.patch
@@ -0,0 +1,33 @@
+commit 9ae82f7cfc1073820092dd9f957559667e77db0d
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Tue Aug 25 09:36:42 2015 +0300
+
+ [android] Explicitly make _Unwind_Resume visible for arm64/mips64
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/aarch64/aarch64-linux-android.h b/gcc/config/aarch64/aarch64-linux-android.h
+index db1288fd0..38bc64d61 100644
+--- a/gcc/config/aarch64/aarch64-linux-android.h
++++ b/gcc/config/aarch64/aarch64-linux-android.h
+@@ -57,4 +57,8 @@
+ #define ENDFILE_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+
++#ifdef IN_LIBGCC2
++#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((visibility("default")))
++#endif
++
+ #endif /* GCC_AARCH64_LINUX_ANDROID_H */
+diff --git a/gcc/config/mips/linux-common.h b/gcc/config/mips/linux-common.h
+index 8bfacf994..262a9a341 100644
+--- a/gcc/config/mips/linux-common.h
++++ b/gcc/config/mips/linux-common.h
+@@ -63,3 +63,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* The default value isn't sufficient in 64-bit mode. */
+ #define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024)
++
++#ifdef IN_LIBGCC2
++#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((visibility("default")))
++#endif
diff --git a/patches/gcc/linaro-6.3-2017.02/100-uclibc-conf.patch b/patches/gcc/7.1.0/100-uclibc-conf.patch
index 73d1f0d..73d1f0d 100644
--- a/patches/gcc/linaro-6.3-2017.02/100-uclibc-conf.patch
+++ b/patches/gcc/7.1.0/100-uclibc-conf.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/1000-libtool-leave-framework-alone.patch b/patches/gcc/7.1.0/1000-libtool-leave-framework-alone.patch
index bce09eb..bce09eb 100644
--- a/patches/gcc/linaro-6.3-2017.02/1000-libtool-leave-framework-alone.patch
+++ b/patches/gcc/7.1.0/1000-libtool-leave-framework-alone.patch
diff --git a/patches/gcc/7.1.0/111-alpha-bad-eh_frame.patch b/patches/gcc/7.1.0/111-alpha-bad-eh_frame.patch
new file mode 100644
index 0000000..93f6e94
--- /dev/null
+++ b/patches/gcc/7.1.0/111-alpha-bad-eh_frame.patch
@@ -0,0 +1,13 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80037
+
+diff --git a/libgcc/config/alpha/t-alpha b/libgcc/config/alpha/t-alpha
+index 0b6ffb1..0c2f840 100644
+--- a/libgcc/config/alpha/t-alpha
++++ b/libgcc/config/alpha/t-alpha
+@@ -1,2 +1,6 @@
+ # This is a support routine for longlong.h, used by libgcc2.c.
+ LIB2ADD += $(srcdir)/config/alpha/qrnnd.S
++
++# When GAS-generated unwind tables are created, they get created
++# after the __FRAME_END__ terminator, which causes an ld error.
++CRTSTUFF_T_CFLAGS = -fno-unwind-tables
diff --git a/patches/gcc/linaro-6.3-2017.02/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/7.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
index d8986d5..d8986d5 100644
--- a/patches/gcc/linaro-6.3-2017.02/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
+++ b/patches/gcc/7.1.0/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/380-gcc-plugin-POSIX-include-sys-select-h.patch b/patches/gcc/7.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
index 12ef48e..12ef48e 100644
--- a/patches/gcc/linaro-6.3-2017.02/380-gcc-plugin-POSIX-include-sys-select-h.patch
+++ b/patches/gcc/7.1.0/380-gcc-plugin-POSIX-include-sys-select-h.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/810-arm-softfloat-libgcc.patch b/patches/gcc/7.1.0/810-arm-softfloat-libgcc.patch
index 5efa7fd..5efa7fd 100644
--- a/patches/gcc/linaro-6.3-2017.02/810-arm-softfloat-libgcc.patch
+++ b/patches/gcc/7.1.0/810-arm-softfloat-libgcc.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/860-cilk-wchar.patch b/patches/gcc/7.1.0/860-cilk-wchar.patch
index 1d9916f..1d9916f 100644
--- a/patches/gcc/linaro-6.3-2017.02/860-cilk-wchar.patch
+++ b/patches/gcc/7.1.0/860-cilk-wchar.patch
diff --git a/patches/gcc/7.1.0/870-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/7.1.0/870-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..cf21584
--- /dev/null
+++ b/patches/gcc/7.1.0/870-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,74 @@
+From 06689e5973647f5c65d1984b164f2531f5418d7a Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index 0181dde..25e4a28 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1780,7 +1780,8 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call%d\t0x%lx", WINDOW_SIZE, INTVAL (tgt));
++ sprintf (result, "call%d\t" HOST_WIDE_INT_PRINT_HEX,
++ WINDOW_SIZE, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx%d\t%%%d", WINDOW_SIZE, callop);
+ else
+@@ -2351,14 +2352,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2372,7 +2373,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2437,7 +2438,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (GET_MODE (x), XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/linaro-6.3-2017.02/891-fix-m68k-uclinux.patch b/patches/gcc/7.1.0/891-fix-m68k-uclinux.patch
index 4e186bd..4e186bd 100644
--- a/patches/gcc/linaro-6.3-2017.02/891-fix-m68k-uclinux.patch
+++ b/patches/gcc/7.1.0/891-fix-m68k-uclinux.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/900-libgfortran-missing-include.patch b/patches/gcc/7.1.0/900-libgfortran-missing-include.patch
index 1f47469..1f47469 100644
--- a/patches/gcc/linaro-6.3-2017.02/900-libgfortran-missing-include.patch
+++ b/patches/gcc/7.1.0/900-libgfortran-missing-include.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/910-nios2-bad-multilib-default.patch b/patches/gcc/7.1.0/910-nios2-bad-multilib-default.patch
index 61989e5..61989e5 100644
--- a/patches/gcc/linaro-6.3-2017.02/910-nios2-bad-multilib-default.patch
+++ b/patches/gcc/7.1.0/910-nios2-bad-multilib-default.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/930-libgcc-disable-split-stack-nothreads.patch b/patches/gcc/7.1.0/930-libgcc-disable-split-stack-nothreads.patch
index 07f9a73..07f9a73 100644
--- a/patches/gcc/linaro-6.3-2017.02/930-libgcc-disable-split-stack-nothreads.patch
+++ b/patches/gcc/7.1.0/930-libgcc-disable-split-stack-nothreads.patch
diff --git a/patches/gcc/7.1.0/951-bionic-ndk.patch b/patches/gcc/7.1.0/951-bionic-ndk.patch
new file mode 100644
index 0000000..59c50a8
--- /dev/null
+++ b/patches/gcc/7.1.0/951-bionic-ndk.patch
@@ -0,0 +1,58 @@
+commit d38d37bdfe24b7ce1bdcb55642fb6b904718e68f
+Author: Howard Chu <hyc@symas.com>
+Date: Tue Apr 25 19:02:18 2017 -0700
+
+ Fix ctype for newer NDK headers
+
+diff --git a/libstdc++-v3/config/os/bionic/ctype_base.h b/libstdc++-v3/config/os/bionic/ctype_base.h
+index 33978f3..c36e63c 100644
+--- a/libstdc++-v3/config/os/bionic/ctype_base.h
++++ b/libstdc++-v3/config/os/bionic/ctype_base.h
+@@ -28,6 +28,18 @@
+
+ // Information as gleaned from /usr/include/ctype.h
+
++// _CTYPE prefix was added in NDK r14 unified headers
++#ifndef _CTYPE_U
++#define _CTYPE_U _U
++#define _CTYPE_L _L
++#define _CTYPE_D _N
++#define _CTYPE_S _S
++#define _CTYPE_P _P
++#define _CTYPE_C _C
++#define _CTYPE_X _X
++#define _CTYPE_B _B
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,17 +53,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+ typedef char mask;
+- static const mask upper = _U;
+- static const mask lower = _L;
+- static const mask alpha = _U | _L;
+- static const mask digit = _N;
+- static const mask xdigit = _X | _N;
+- static const mask space = _S;
+- static const mask print = _P | _U | _L | _N | _B;
+- static const mask graph = _P | _U | _L | _N;
+- static const mask cntrl = _C;
+- static const mask punct = _P;
+- static const mask alnum = _U | _L | _N;
++ static const mask upper = _CTYPE_U;
++ static const mask lower = _CTYPE_L;
++ static const mask alpha = _CTYPE_U | _CTYPE_L;
++ static const mask digit = _CTYPE_D;
++ static const mask xdigit = _CTYPE_X | _CTYPE_D;
++ static const mask space = _CTYPE_S;
++ static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_D | _CTYPE_B;
++ static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_D;
++ static const mask cntrl = _CTYPE_C;
++ static const mask punct = _CTYPE_P;
++ static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_D;
+ #if __cplusplus >= 201103L
+ static const mask blank = space;
+ #endif
diff --git a/patches/gcc/7.1.0/952-bionic-errno.patch b/patches/gcc/7.1.0/952-bionic-errno.patch
new file mode 100644
index 0000000..91f6ca3
--- /dev/null
+++ b/patches/gcc/7.1.0/952-bionic-errno.patch
@@ -0,0 +1,19 @@
+commit 6cd4ad106ef87a3c58b0c3478e78409b47000de0
+Author: Howard Chu <hyc@symas.com>
+Date: Tue Apr 25 20:17:03 2017 -0700
+
+ Fix, errno is volatile int
+
+diff --git a/libstdc++-v3/src/filesystem/dir.cc b/libstdc++-v3/src/filesystem/dir.cc
+index 6ff12d0..5bbd664 100644
+--- a/libstdc++-v3/src/filesystem/dir.cc
++++ b/libstdc++-v3/src/filesystem/dir.cc
+@@ -147,7 +147,7 @@ fs::_Dir::advance(error_code* ec, directory_options options)
+
+ int err = std::exchange(errno, 0);
+ const auto entp = readdir(dirp);
+- std::swap(errno, err);
++ std::swap((int&)errno, err);
+
+ if (entp)
+ {
diff --git a/patches/gcc/7.1.0/970-crystax.patch b/patches/gcc/7.1.0/970-crystax.patch
new file mode 100644
index 0000000..7324d7f
--- /dev/null
+++ b/patches/gcc/7.1.0/970-crystax.patch
@@ -0,0 +1,553 @@
+commit 080803512c8f6f87c2f1f711170d54033144d628
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Wed Jul 29 11:28:29 2015 +0300
+
+ [android] Apply Android-related modifications
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+[Edited: keep libstdc++, drop libcrystax-related modifications]
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index f66e48cd1..1c253496b 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -942,13 +942,17 @@ aarch64*-*-elf | aarch64*-*-rtems*)
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
+ ;;
+ aarch64*-*-linux*)
+- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h"
+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
++ extra_options="${extra_options} linux-android.opt"
+ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
+ case $target in
+ aarch64_be-*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
++ aarch64*-*-linux-android*)
++ tm_file="${tm_file} aarch64/aarch64-linux-android.h"
++ ;;
+ esac
+ aarch64_multilibs="${with_multilib_list}"
+ if test "$aarch64_multilibs" = "default"; then
+@@ -2055,6 +2059,17 @@ mips*-*-linux*) # Linux MIPS, either endian.
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
+ extra_options="${extra_options} linux-android.opt"
+ case ${target} in
++ mips64*android*)
++ default_mips_arch=mips64r6
++ default_mips_abi=64
++ tm_file="${tm_file} mips/android.h"
++ tmake_file="${tmake_file} mips/t-linux-android64"
++ ;;
++ mips*android*)
++ default_mips_arch=mips32
++ tm_file="${tm_file} mips/android.h"
++ tmake_file="$tmake_file mips/t-linux-android"
++ ;;
+ mipsisa32r6*)
+ default_mips_arch=mips32r6
+ ;;
+diff --git a/gcc/config/aarch64/aarch64-linux-android.h b/gcc/config/aarch64/aarch64-linux-android.h
+new file mode 100644
+index 000000000..db1288fd0
+--- /dev/null
++++ b/gcc/config/aarch64/aarch64-linux-android.h
+@@ -0,0 +1,59 @@
++/* Machine description for AArch64 architecture.
++ Copyright (C) 2014 Free Software Foundation, Inc.
++
++ This file is part of GCC.
++
++ GCC is free software; you can redistribute it and/or modify it
++ under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3, or (at your option)
++ any later version.
++
++ GCC is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with GCC; see the file COPYING3. If not see
++ <http://www.gnu.org/licenses/>. */
++
++#ifndef GCC_AARCH64_LINUX_ANDROID_H
++#define GCC_AARCH64_LINUX_ANDROID_H
++
++
++#undef TARGET_OS_CPP_BUILTINS
++#define TARGET_OS_CPP_BUILTINS() \
++ do \
++ { \
++ GNU_USER_TARGET_OS_CPP_BUILTINS(); \
++ ANDROID_TARGET_OS_CPP_BUILTINS(); \
++ } \
++ while (0)
++
++#undef LINK_SPEC
++#define LINK_SPEC \
++ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
++ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
++
++#undef CC1_SPEC
++#define CC1_SPEC \
++ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
++ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic"))
++
++#define CC1PLUS_SPEC \
++ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
++
++#undef LIB_SPEC
++#define LIB_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
++ GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC " " ANDROID_LIB_SPEC)
++
++#undef STARTFILE_SPEC
++#define STARTFILE_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
++
++#undef ENDFILE_SPEC
++#define ENDFILE_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
++
++#endif /* GCC_AARCH64_LINUX_ANDROID_H */
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index 5fcaa59a3..6864195ee 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,14 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#ifndef RUNTIME_ROOT_PREFIX
++#define RUNTIME_ROOT_PREFIX ""
++#endif
++#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#ifdef BIONIC_DYNAMIC_LINKER
++#undef BIONIC_DYNAMIC_LINKER
++#endif
++#define BIONIC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/system/bin/linker64"
+
+ #undef MUSL_DYNAMIC_LINKER
+ #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
+index ad123dde9..97b059de6 100644
+--- a/gcc/config/arm/arm.h
++++ b/gcc/config/arm/arm.h
+@@ -1888,10 +1888,11 @@ enum arm_auto_incmodes
+
+ #define CASE_VECTOR_PC_RELATIVE (TARGET_THUMB2 \
+ || (TARGET_THUMB1 \
++ && !inline_thumb1_jump_table \
+ && (optimize_size || flag_pic)))
+
+ #define CASE_VECTOR_SHORTEN_MODE(min, max, body) \
+- (TARGET_THUMB1 \
++ (TARGET_THUMB1 && !inline_thumb1_jump_table \
+ ? (min >= 0 && max < 512 \
+ ? (ADDR_DIFF_VEC_FLAGS (body).offset_unsigned = 1, QImode) \
+ : min >= -256 && max < 256 \
+diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
+index 47171b996..eb22d1181 100644
+--- a/gcc/config/arm/arm.md
++++ b/gcc/config/arm/arm.md
+@@ -8179,7 +8179,7 @@
+ (match_operand:SI 2 "const_int_operand" "") ; total range
+ (match_operand:SI 3 "" "") ; table label
+ (match_operand:SI 4 "" "")] ; Out of range label
+- "(TARGET_32BIT || optimize_size || flag_pic) && !target_pure_code"
++ "(TARGET_32BIT || ((optimize_size || flag_pic) && !inline_thumb1_jump_table)) && !target_pure_code"
+ "
+ {
+ enum insn_code code;
+diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
+index 0ebe01743..772453889 100644
+--- a/gcc/config/arm/arm.opt
++++ b/gcc/config/arm/arm.opt
+@@ -193,6 +193,10 @@ mthumb-interwork
+ Target Report Mask(INTERWORK)
+ Support calls between Thumb and ARM instruction sets.
+
++minline-thumb1-jumptable
++Target Report Var(inline_thumb1_jump_table)
++Inline Thumb1 Jump table code
++
+ mtls-dialect=
+ Target RejectNegative Joined Enum(tls_type) Var(target_tls_dialect) Init(TLS_GNU)
+ Specify thread local storage scheme.
+diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
+index 77f30554d..32158ed65 100644
+--- a/gcc/config/arm/elf.h
++++ b/gcc/config/arm/elf.h
+@@ -56,8 +56,7 @@
+ #undef SUBSUBTARGET_EXTRA_SPECS
+ #define SUBSUBTARGET_EXTRA_SPECS
+
+-#ifndef ASM_SPEC
+-#define ASM_SPEC "\
++#define DEFAULT_ASM_SPEC "\
+ %{mbig-endian:-EB} \
+ %{mlittle-endian:-EL} \
+ %(asm_cpu_spec) \
+@@ -66,6 +65,9 @@
+ %{mthumb-interwork:-mthumb-interwork} \
+ %{mfloat-abi=*} %{mfpu=*} \
+ %(subtarget_extra_asm_spec)"
++
++#ifndef ASM_SPEC
++#define ASM_SPEC DEFAULT_ASM_SPEC
+ #endif
+
+ /* The ARM uses @ are a comment character so we need to redefine
+@@ -104,8 +106,9 @@
+ the code more efficient, but for Thumb-1 it's better to put them out of
+ band unless we are generating compressed tables. */
+ #define JUMP_TABLES_IN_TEXT_SECTION \
+- ((TARGET_32BIT || (TARGET_THUMB && (optimize_size || flag_pic))) \
+- && !target_pure_code)
++ ((TARGET_32BIT || (TARGET_THUMB && !inline_thumb1_jump_table \
++ && (optimize_size || flag_pic))) \
++ && !target_pure_code)
+
+ #ifndef LINK_SPEC
+ #define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index ace84816e..8c8fa6553 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -108,11 +108,16 @@
+ #define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC, \
+ GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \
+- ANDROID_CC1_SPEC)
++ ANDROID_CC1_SPEC("-fpic"))
+
+ #define CC1PLUS_SPEC \
+ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
++#undef ASM_SPEC
++#define ASM_SPEC \
++ LINUX_OR_ANDROID_CC (DEFAULT_ASM_SPEC, \
++ DEFAULT_ASM_SPEC " " ANDROID_ASM_SPEC)
++
+ #undef LIB_SPEC
+ #define LIB_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
+diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
+index fee33a3ef..22fb2ced9 100644
+--- a/gcc/config/i386/gnu-user.h
++++ b/gcc/config/i386/gnu-user.h
+@@ -65,9 +65,14 @@ along with GCC; see the file COPYING3. If not see
+ When the -shared link option is used a final link is not being
+ done. */
+
++#undef ANDROID_TARGET_CC1_SPEC
++#define ANDROID_TARGET_CC1_SPEC \
++ " -mssse3 -fno-short-enums " \
++
+ #undef ASM_SPEC
+ #define ASM_SPEC \
+- "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
++ "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}} " \
++ LINUX_OR_ANDROID_CC ("", ANDROID_ASM_SPEC)
+
+ #undef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
+index 7a02a7eb4..cac4179bc 100644
+--- a/gcc/config/i386/gnu-user64.h
++++ b/gcc/config/i386/gnu-user64.h
+@@ -46,6 +46,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define SPEC_X32 "mx32"
+ #endif
+
++#undef ANDROID_TARGET_CC1_SPEC
++#define ANDROID_TARGET_CC1_SPEC \
++ "%{m32:-mssse3 -fno-short-enums}" \
++ "%{!m32:-msse4.2 -mpopcnt}"
++
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{" SPEC_32 ":--32} \
+ %{" SPEC_64 ":--64} \
+diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
+index 4b9910fa9..3b11ed086 100644
+--- a/gcc/config/i386/linux-common.h
++++ b/gcc/config/i386/linux-common.h
+@@ -30,7 +30,13 @@ along with GCC; see the file COPYING3. If not see
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+- GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
++ GNU_USER_TARGET_CC1_SPEC \
++ ANDROID_TARGET_CC1_SPEC \
++ " " \
++ ANDROID_CC1_SPEC("-fPIC"))
++
++#define CC1PLUS_SPEC \
++ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
+index 301a41ccd..9623c88d0 100644
+--- a/gcc/config/linux-android.h
++++ b/gcc/config/linux-android.h
+@@ -38,15 +39,18 @@
+ "%{" NOANDROID "|tno-android-ld:" LINUX_SPEC ";:" ANDROID_SPEC "}"
+
+ #define ANDROID_LINK_SPEC \
+- "%{shared: -Bsymbolic}"
++ "%{shared: -Bsymbolic} -z noexecstack -z relro -z now"
+
+-#define ANDROID_CC1_SPEC \
++#define ANDROID_CC1_SPEC(ANDROID_PIC_DEFAULT) \
+ "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \
+- "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
++ "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: " ANDROID_PIC_DEFAULT "}}}}"
+
+ #define ANDROID_CC1PLUS_SPEC \
+- "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \
+- "%{!frtti:%{!fno-rtti: -fno-rtti}}"
++ "%{!fexceptions:%{!fno-exceptions: -fexceptions}} " \
++ "%{!frtti:%{!fno-rtti: -frtti}}"
++
++#define ANDROID_ASM_SPEC \
++ "--noexecstack"
+
+ #define ANDROID_LIB_SPEC \
+ "%{!static: -ldl}"
+diff --git a/gcc/config/mips/android.h b/gcc/config/mips/android.h
+new file mode 100644
+index 000000000..32c539c8d
+--- /dev/null
++++ b/gcc/config/mips/android.h
+@@ -0,0 +1,49 @@
++/* Target macros for mips*-*android* targets.
++ Copyright (C) 2014 Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 3, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>. */
++
++#undef DRIVER_SELF_SPECS
++#define DRIVER_SELF_SPECS \
++ /* Make sure a -mips option is present. This helps us to pick \
++ the right multilib, and also makes the later specs easier \
++ to write. */ \
++ MIPS_ISA_LEVEL_SPEC, \
++ \
++ /* Infer the default float setting from -march. */ \
++ MIPS_ARCH_FLOAT_SPEC, \
++ \
++ /* Infer the -msynci setting from -march if not explicitly set. */ \
++ MIPS_ISA_SYNCI_SPEC, \
++ \
++ /* If no ABI option is specified, infer one from the ISA level \
++ or -mgp setting. */ \
++ "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=64}}", \
++ \
++ /* If no FP ABI option is specified, infer one from the \
++ ABI/ISA level unless there is a conflicting option. */ \
++ "%{!msoft-float: %{!msingle-float: %{!mfp*: %{!mmsa: %{mabi=32: %{" \
++ MIPS_FPXX_OPTION_SPEC ": -mfpxx}}}}}}", \
++ \
++ /* If no odd-spreg option is specified, infer one from the ISA. */ \
++ "%{!modd-spreg: %{mabi=32: %{mips32r6: -mno-odd-spreg}}}", \
++ \
++ /* Base SPECs. */ \
++ BASE_DRIVER_SELF_SPECS, \
++ \
++ /* Use the standard linux specs for everything else. */ \
++ LINUX_DRIVER_SELF_SPECS
+diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
+index 15b549c08..4a2816014 100644
+--- a/gcc/config/mips/gnu-user.h
++++ b/gcc/config/mips/gnu-user.h
+@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
+ /* The GNU C++ standard library requires this. */ \
+ if (c_dialect_cxx ()) \
+ builtin_define ("_GNU_SOURCE"); \
++ ANDROID_TARGET_OS_CPP_BUILTINS(); \
+ } while (0)
+
+ #undef SUBTARGET_CPP_SPEC
+@@ -71,7 +72,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef SUBTARGET_ASM_SPEC
+ #define SUBTARGET_ASM_SPEC \
+- "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}"
++ "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}} " \
++ LINUX_OR_ANDROID_CC ("", ANDROID_ASM_SPEC)
+
+ /* The MIPS assembler has different syntax for .set. We set it to
+ .dummy to trap any errors. */
+@@ -120,7 +122,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
+ #endif
+
+ #define LINUX_DRIVER_SELF_SPECS \
+- NO_SHARED_SPECS \
++ LINUX_OR_ANDROID_CC(NO_SHARED_SPECS, "") \
+ MARCH_MTUNE_NATIVE_SPECS, \
+ /* -mplt has no effect without -mno-shared. Simplify later \
+ specs handling by removing a redundant option. */ \
+diff --git a/gcc/config/mips/linux-common.h b/gcc/config/mips/linux-common.h
+index 8429a7ca2..8bfacf994 100644
+--- a/gcc/config/mips/linux-common.h
++++ b/gcc/config/mips/linux-common.h
+@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
+ #undef SUBTARGET_CC1_SPEC
+ #define SUBTARGET_CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+- GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
++ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic"))
+
+ #undef CC1PLUS_SPEC
+ #define CC1PLUS_SPEC \
+diff --git a/gcc/config/mips/t-linux-android b/gcc/config/mips/t-linux-android
+new file mode 100644
+index 000000000..39f512c81
+--- /dev/null
++++ b/gcc/config/mips/t-linux-android
+@@ -0,0 +1,3 @@
++MULTILIB_OPTIONS = mips32r2/mips32r6
++MULTILIB_DIRNAMES = mips-r2 mips-r6
++MULTILIB_OSDIRNAMES = ../libr2 ../libr6
+diff --git a/gcc/config/mips/t-linux-android64 b/gcc/config/mips/t-linux-android64
+new file mode 100644
+index 000000000..55cab7d62
+--- /dev/null
++++ b/gcc/config/mips/t-linux-android64
+@@ -0,0 +1,4 @@
++MULTILIB_OPTIONS = mabi=32 mips32/mips32r2/mips32r6/mips64r2/mips64r6
++MULTILIB_DIRNAMES = 32 mips-r1 mips-r2 mips-r6 mips64-r2 mips64-r6
++MULTILIB_OSDIRNAMES = ../lib ../lib ../libr2 ../libr6 ../lib64r2 ../lib64
++MULTILIB_REQUIRED = mabi=32/mips32 mabi=32/mips32r2 mabi=32/mips32r6 mips64r2 mips64r6
+diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h
+index 555c0fe24..47c8655f9 100644
+--- a/libgcc/gthr-posix.h
++++ b/libgcc/gthr-posix.h
+@@ -32,6 +32,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define __GTHREADS 1
+ #define __GTHREADS_CXX0X 1
+
++/* The following should normally be in a different header file,
++ * but I couldn't find the right location. The point of the macro
++ * definition below is to prevent libsupc++ and libstdc++ to reference
++ * weak symbols in their static C++ constructors. Such code crashes
++ * when a shared object linked statically to these libraries is
++ * loaded on Android 2.1 (Eclair) and older platform releases, due
++ * to a dynamic linker bug.
++ */
++#ifdef __ANDROID__
++#undef GTHREAD_USE_WEAK
++#define GTHREAD_USE_WEAK 0
++#endif
++
+ #include <pthread.h>
+
+ #if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 41797a971..f746e8353 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -78319,6 +78341,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <sys/syscall.h>
+ int lk;
++#if !defined(SYS_gettid)
++#define SYS_gettid __NR_gettid
++#endif
++#if !defined(SYS_futex)
++#define SYS_futex __NR_futex
++#endif
+ int
+ main ()
+ {
+@@ -78377,6 +78405,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <sys/syscall.h>
+ int lk;
++#if !defined(SYS_gettid)
++#define SYS_gettid __NR_gettid
++#endif
++#if !defined(SYS_futex)
++#define SYS_futex __NR_futex
++#endif
+ int
+ main ()
+ {
+diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
+index e3e206b7d..e85dc2c76 100644
+--- a/libstdc++-v3/include/bits/locale_facets.h
++++ b/libstdc++-v3/include/bits/locale_facets.h
+@@ -47,6 +47,20 @@
+ #include <ext/numeric_traits.h>
+ #include <bits/streambuf_iterator.h>
+
++#if !__clang__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && __i386__
++// CrystaX: for some reason, x86 gcc-4.9 makes ctype<char>::do_widen() and
++// ctype<char>::_M_widen_init() methods working wrong if optimization enabled.
++// For ctype<char>::do_widen(), values of passed arguments (__lo, __hi and __to)
++// are completely messed up and don't correspond to passed values. In case if
++// we disable optimization for those methods, things become correct so we apply
++// this workaround here for a time.
++// TODO: figure out what exactly wrong here - is it bug in GCC optimization
++// algorithm or smth else?
++#define __CRYSTAX_X86_DONT_OPTIMIZE __attribute__((optimize(0)))
++#else
++#define __CRYSTAX_X86_DONT_OPTIMIZE
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1102,7 +1116,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ * @return @a __hi.
+ */
+ virtual const char*
+- do_widen(const char* __lo, const char* __hi, char_type* __to) const
++ do_widen(const char* __lo, const char* __hi, char_type* __to) const __CRYSTAX_X86_DONT_OPTIMIZE
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+@@ -1163,7 +1177,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ private:
+ void _M_narrow_init() const;
+- void _M_widen_init() const;
++ void _M_widen_init() const __CRYSTAX_X86_DONT_OPTIMIZE;
+ };
+
+ #ifdef _GLIBCXX_USE_WCHAR_T
+diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
+index 9b617998f..c149169bb 100644
+--- a/libstdc++-v3/libsupc++/guard.cc
++++ b/libstdc++-v3/libsupc++/guard.cc
+@@ -33,7 +33,12 @@
+ #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
+ && (ATOMIC_INT_LOCK_FREE > 1) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
+ # include <climits>
++#if defined(__ANDROID__)
++# include <sys/syscall.h>
++# define SYS_futex __NR_futex
++#else
+ # include <syscall.h>
++#endif
+ # include <unistd.h>
+ # define _GLIBCXX_USE_FUTEX
+ # define _GLIBCXX_FUTEX_WAIT 0
diff --git a/patches/gcc/7.1.0/971-crystax.patch b/patches/gcc/7.1.0/971-crystax.patch
new file mode 100644
index 0000000..748a381
--- /dev/null
+++ b/patches/gcc/7.1.0/971-crystax.patch
@@ -0,0 +1,25 @@
+commit 9f057b62caafe08c968103d39b5df82486a175c2
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Thu Aug 13 16:11:54 2015 +0300
+
+ [android] Add additional multilib option: mfloat-abi=hard
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/arm/t-linux-androideabi b/gcc/config/arm/t-linux-androideabi
+index 8f1307c55..cbbec5bd2 100644
+--- a/gcc/config/arm/t-linux-androideabi
++++ b/gcc/config/arm/t-linux-androideabi
+@@ -1,8 +1,9 @@
+-MULTILIB_OPTIONS = march=armv7-a mthumb
+-MULTILIB_DIRNAMES = armv7-a thumb
+-MULTILIB_EXCEPTIONS =
++MULTILIB_OPTIONS = march=armv7-a mthumb mfloat-abi=hard
++MULTILIB_DIRNAMES = armv7-a thumb hard
++MULTILIB_EXCEPTIONS = mfloat-abi=hard* mthumb/mfloat-abi=hard*
+ MULTILIB_MATCHES =
+ MULTILIB_OSDIRNAMES =
++MULTILIB_EXTRA_OPTS = Wl,--no-warn-mismatch
+
+ # The "special" multilib can be used to build native applications for Android,
+ # as opposed to native shared libraries that are then called via JNI.
diff --git a/patches/gcc/7.1.0/972-crystax.patch b/patches/gcc/7.1.0/972-crystax.patch
new file mode 100644
index 0000000..b9077be
--- /dev/null
+++ b/patches/gcc/7.1.0/972-crystax.patch
@@ -0,0 +1,302 @@
+commit 44a81ebb7698dac41ffa7acd5e0cc1578e5ab1fd
+Author: H.J. Lu <hongjiu.lu@intel.com>
+Date: Mon Apr 14 15:59:47 2014 -0700
+
+ [android] Always enable --eh-frame-hdr for static executable
+
+ See 5e6cdf76af295c9a39b695ca228cff675e8ff4ae and
+ 23e3137ee2897464b051599b85a09f130d3ad05d
+
+ Change-Id: Ibda473188e5a10f2a0592f2494ad00ad1f91e04b
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config.in b/gcc/config.in
+index 115cb6163..933916833 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -2119,6 +2119,12 @@
+ #endif
+
+
++/* Define if your system supports PT_GNU_EH_FRAME for static executable. */
++#ifndef USED_FOR_TARGET
++#undef USE_EH_FRAME_HDR_FOR_STATIC
++#endif
++
++
+ /* Define to 1 if the 'long long' type is wider than 'long' but still
+ efficiently supported by the host hardware. */
+ #ifndef USED_FOR_TARGET
+diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
+index 093c38bba..54b3e0c91 100644
+--- a/gcc/config/alpha/elf.h
++++ b/gcc/config/alpha/elf.h
+@@ -168,5 +168,9 @@ extern int alpha_this_gpdisp_sequence_number;
+ I imagine that other systems will catch up. In the meantime, it
+ doesn't harm to make sure that the data exists to be used later. */
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h
+index 5ded869d2..5f51ac81d 100644
+--- a/gcc/config/freebsd.h
++++ b/gcc/config/freebsd.h
+@@ -45,8 +45,12 @@ along with GCC; see the file COPYING3. If not see
+ #define LIB_SPEC FBSD_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
+index b0bf40a95..d1874bc29 100644
+--- a/gcc/config/gnu-user.h
++++ b/gcc/config/gnu-user.h
+@@ -118,8 +118,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #undef LINK_GCC_C_SEQUENCE_SPEC
+ #define LINK_GCC_C_SEQUENCE_SPEC \
+diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
+index 37ecfc43f..a5f1b9955 100644
+--- a/gcc/config/openbsd.h
++++ b/gcc/config/openbsd.h
+@@ -136,8 +136,12 @@ while (0)
+ #define LIB_SPEC OBSD_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #undef LIB_SPEC
+ #define LIB_SPEC OBSD_LIB_SPEC
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index cbf909722..eb2217fad 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -789,7 +789,11 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++# ifdef USE_EH_FRAME_HDR_FOR_STATIC
++# define LINK_EH_SPEC "--eh-frame-hdr "
++# else
++# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++# endif
+ #endif
+
+ #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
+diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
+index 5160e1fda..7632a5081 100644
+--- a/gcc/config/sol2.h
++++ b/gcc/config/sol2.h
+@@ -347,7 +347,11 @@ along with GCC; see the file COPYING3. If not see
+ /* Solaris 11 build 135+ implements dl_iterate_phdr. GNU ld needs
+ --eh-frame-hdr to create the required .eh_frame_hdr sections. */
+ #if defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#endif
+ #endif /* HAVE_LD_EH_FRAME && TARGET_DL_ITERATE_PHDR */
+ #endif
+
+diff --git a/gcc/configure b/gcc/configure
+index 1c6e3407c..28ad05004 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -934,6 +934,7 @@ enable_fix_cortex_a53_835769
+ enable_fix_cortex_a53_843419
+ with_glibc_version
+ enable_gnu_unique_object
++enable_eh_frame_hdr_for_static
+ enable_linker_build_id
+ enable_default_ssp
+ with_long_double_128
+@@ -1670,6 +1671,9 @@ Optional Features:
+ --enable-gnu-unique-object
+ enable the use of the @gnu_unique_object ELF
+ extension on glibc systems
++ --enable-eh-frame-hdr-for-static
++ enable linker PT_GNU_EH_FRAME support for static
++ executable
+ --enable-linker-build-id
+ compiler will always pass --build-id to linker
+ --enable-default-ssp enable Stack Smashing Protection as default
+@@ -27703,6 +27707,38 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+
+ $as_echo "#define HAVE_LD_EH_FRAME_HDR 1" >>confdefs.h
+
++ # Check whether --enable-eh-frame-hdr-for-static was given.
++if test "${enable_eh_frame_hdr_for_static+set}" = set; then :
++ enableval=$enable_eh_frame_hdr_for_static; case $enable_eh_frame_hdr_for_static in
++ yes | no) ;;
++ *) as_fn_error "'$enable_eh_frame_hdr_for_static' is an invalid
++value for --enable-eh-frame-hdr-for-static.
++Valid choices are 'yes' and 'no'." "$LINENO" 5 ;;
++ esac
++else
++ # Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from
++# Linux kernel.
++ if test x$host = x$build -a x$host = x$target &&
++ ldd --version 2>&1 >/dev/null &&
++ glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
++ glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
++ glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
++ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
++ if test "$glibcnum" -ge 2003 ; then
++ auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null`
++ if echo "$auvx" | grep AT_PHDR > /dev/null &&
++ echo "$auvx" | grep AT_PHNUM > /dev/null; then
++ enable_eh_frame_hdr_for_static=yes
++ fi
++ fi
++ fi
++fi
++
++ if test x$enable_eh_frame_hdr_for_static = xyes; then
++
++$as_echo "#define USE_EH_FRAME_HDR_FOR_STATIC 1" >>confdefs.h
++
++ fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_hdr" >&5
+ $as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; }
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 6c1dcd9ae..0cf7419e7 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4828,6 +4828,35 @@ GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HDR])
+ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+ AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1,
+ [Define if your linker supports .eh_frame_hdr.])
++ AC_ARG_ENABLE(eh-frame-hdr-for-static,
++ [AS_HELP_STRING([--enable-eh-frame-hdr-for-static],
++ [enable linker PT_GNU_EH_FRAME support for static executable])],
++ [case $enable_eh_frame_hdr_for_static in
++ yes | no) ;;
++ *) AC_MSG_ERROR(['$enable_eh_frame_hdr_for_static' is an invalid
++value for --enable-eh-frame-hdr-for-static.
++Valid choices are 'yes' and 'no'.]) ;;
++ esac],
++# Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from
++# Linux kernel.
++ [[if test x$host = x$build -a x$host = x$target &&
++ ldd --version 2>&1 >/dev/null &&
++ glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
++ glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
++ glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
++ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
++ if test "$glibcnum" -ge 2003 ; then
++ auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null`
++ if echo "$auvx" | grep AT_PHDR > /dev/null &&
++ echo "$auvx" | grep AT_PHNUM > /dev/null; then
++ enable_eh_frame_hdr_for_static=yes
++ fi
++ fi
++ fi]])
++ if test x$enable_eh_frame_hdr_for_static = xyes; then
++ AC_DEFINE(USE_EH_FRAME_HDR_FOR_STATIC, 1,
++[Define if your system supports PT_GNU_EH_FRAME for static executable.])
++ fi
+ fi
+ AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
+
+diff --git a/gcc/testsuite/g++.dg/eh/spec3-static.C b/gcc/testsuite/g++.dg/eh/spec3-static.C
+new file mode 100644
+index 000000000..15408effa
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/eh/spec3-static.C
+@@ -0,0 +1,25 @@
++// PR c++/4381
++// Test that exception-specs work properly for classes with virtual bases.
++
++// { dg-do run }
++// { dg-options "-static" }
++
++class Base {};
++
++struct A : virtual public Base
++{
++ A() {}
++};
++
++struct B {};
++
++void func() throw (B,A)
++{
++ throw A();
++}
++
++int main(void)
++{
++ try { func(); }
++ catch (A& a) { }
++}
+diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
+index f3343fc4f..d42647779 100644
+--- a/libgcc/crtstuff.c
++++ b/libgcc/crtstuff.c
+@@ -88,7 +88,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(BSD_DL_ITERATE_PHDR_AVAILABLE)
+ #include <link.h>
+ # define USE_PT_GNU_EH_FRAME
+@@ -97,7 +98,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(__sun__) && defined(__svr4__)
+ #include <link.h>
+ # define USE_PT_GNU_EH_FRAME
+@@ -106,7 +108,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(__GLIBC__) && __GLIBC__ >= 2
+ #include <link.h>
+ /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+@@ -121,7 +124,7 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(CRTSTUFFT_O) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(inhibit_libc) \
+ && (defined(__GLIBC__) || defined(__gnu_linux__) || defined(__GNU__))
+ /* On systems using glibc, an inhibit_libc build of libgcc is only
diff --git a/patches/gcc/7.1.0/973-crystax.patch b/patches/gcc/7.1.0/973-crystax.patch
new file mode 100644
index 0000000..b96ece3
--- /dev/null
+++ b/patches/gcc/7.1.0/973-crystax.patch
@@ -0,0 +1,20 @@
+commit 778a9ef107f51544d583f110e92b75f4d9d79117
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Thu Aug 20 19:11:07 2015 +0300
+
+ [android] Don't use PIE copyrelocs for x86/x86_64
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
+index 3d044e8bd..5c89fcab0 100644
+--- a/gcc/config/i386/i386.c
++++ b/gcc/config/i386/i386.c
+@@ -14631,6 +14631,7 @@ legitimate_pic_address_disp_p (rtx disp)
+ else if (!SYMBOL_REF_FAR_ADDR_P (op0)
+ && (SYMBOL_REF_LOCAL_P (op0)
+ || (HAVE_LD_PIE_COPYRELOC
++ && !TARGET_HAS_BIONIC
+ && flag_pie
+ && !SYMBOL_REF_WEAK (op0)
+ && !SYMBOL_REF_FUNCTION_P (op0)))
diff --git a/patches/gcc/7.1.0/974-crystax.patch b/patches/gcc/7.1.0/974-crystax.patch
new file mode 100644
index 0000000..9db4f54
--- /dev/null
+++ b/patches/gcc/7.1.0/974-crystax.patch
@@ -0,0 +1,24 @@
+commit dbeae1190cabad83999f2540523f045acc1bb4ec
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Fri Aug 21 17:41:59 2015 +0300
+
+ [android] Always use gthr-posix.h instead of gthr-default.h
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/libgcc/gthr.h b/libgcc/gthr.h
+index 47a7d061a..67a680f90 100644
+--- a/libgcc/gthr.h
++++ b/libgcc/gthr.h
+@@ -145,7 +145,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define GTHREAD_USE_WEAK 1
+ #endif
+ #endif
++#if __ANDROID__
++#include "gthr-posix.h"
++#else
+ #include "gthr-default.h"
++#endif
+
+ #ifndef HIDE_EXPORTS
+ #pragma GCC visibility pop
diff --git a/patches/gcc/7.1.0/975-crystax.patch b/patches/gcc/7.1.0/975-crystax.patch
new file mode 100644
index 0000000..9efc2a4
--- /dev/null
+++ b/patches/gcc/7.1.0/975-crystax.patch
@@ -0,0 +1,31 @@
+commit 8a66d422721ae5999737d7825701ff22097d287b
+Author: Andrew Hsieh <andrewhsieh@google.com>
+Date: Mon Apr 14 21:05:51 2014 -0700
+
+ [android] Fix ARM generates insufficient alignment for NEON vst/vld
+
+ See d909af3e2469aad87d5c3e79b93c778fd26c03a9
+
+ Change-Id: Ie1de9f946f397196bb6f1623f5add86933739484
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
+index 5974c65d3..71b2c7aa9 100644
+--- a/gcc/config/arm/arm.c
++++ b/gcc/config/arm/arm.c
+@@ -22403,9 +22403,13 @@ arm_print_operand (FILE *stream, rtx x, int code)
+ memsize = MEM_SIZE (x);
+
+ /* Only certain alignment specifiers are supported by the hardware. */
+- if (memsize == 32 && (align % 32) == 0)
++ /* Note that ARM EABI only guarentees 8-byte stack alignment. While GCC
++ honors stricter alignment of composite type in user code, it doesn't
++ observe the alignment of memory passed as an extra argument for function
++ returning large composite type. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57271 */
++ if (memsize == 32 && (align % 32) == 0 && !TARGET_AAPCS_BASED)
+ align_bits = 256;
+- else if ((memsize == 16 || memsize == 32) && (align % 16) == 0)
++ else if ((memsize == 16 || memsize == 32) && (align % 16) == 0 && !TARGET_AAPCS_BASED)
+ align_bits = 128;
+ else if (memsize >= 8 && (align % 8) == 0)
+ align_bits = 64;
diff --git a/patches/gcc/7.1.0/976-crystax.patch b/patches/gcc/7.1.0/976-crystax.patch
new file mode 100644
index 0000000..790d4a9
--- /dev/null
+++ b/patches/gcc/7.1.0/976-crystax.patch
@@ -0,0 +1,21 @@
+commit 89d27bc45ee7325dcfff6748da0f8b9c1dc1f234
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Sat Aug 22 09:55:55 2015 +0300
+
+ [android][i386] Remove throw() declaration from posix_memalign() proto
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
+index a1f98d3d1..3725799be 100644
+--- a/gcc/config/i386/pmm_malloc.h
++++ b/gcc/config/i386/pmm_malloc.h
+@@ -31,7 +31,7 @@
+ #ifndef __cplusplus
+ extern int posix_memalign (void **, size_t, size_t);
+ #else
+-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
++extern "C" int posix_memalign (void **, size_t, size_t);
+ #endif
+
+ static __inline void *
diff --git a/patches/gcc/7.1.0/977-crystax.patch b/patches/gcc/7.1.0/977-crystax.patch
new file mode 100644
index 0000000..0211d72
--- /dev/null
+++ b/patches/gcc/7.1.0/977-crystax.patch
@@ -0,0 +1,33 @@
+commit 9ae82f7cfc1073820092dd9f957559667e77db0d
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Tue Aug 25 09:36:42 2015 +0300
+
+ [android] Explicitly make _Unwind_Resume visible for arm64/mips64
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/aarch64/aarch64-linux-android.h b/gcc/config/aarch64/aarch64-linux-android.h
+index db1288fd0..38bc64d61 100644
+--- a/gcc/config/aarch64/aarch64-linux-android.h
++++ b/gcc/config/aarch64/aarch64-linux-android.h
+@@ -57,4 +57,8 @@
+ #define ENDFILE_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+
++#ifdef IN_LIBGCC2
++#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((visibility("default")))
++#endif
++
+ #endif /* GCC_AARCH64_LINUX_ANDROID_H */
+diff --git a/gcc/config/mips/linux-common.h b/gcc/config/mips/linux-common.h
+index 8bfacf994..262a9a341 100644
+--- a/gcc/config/mips/linux-common.h
++++ b/gcc/config/mips/linux-common.h
+@@ -63,3 +63,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* The default value isn't sufficient in 64-bit mode. */
+ #define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024)
++
++#ifdef IN_LIBGCC2
++#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((visibility("default")))
++#endif
diff --git a/patches/gcc/linaro-4.8-2015.06/874-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/linaro-4.8-2015.06/874-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..6013fef
--- /dev/null
+++ b/patches/gcc/linaro-4.8-2015.06/874-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,73 @@
+From 0343a584d6b5128908eabf1db43c70bed7114989 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index dbc5bd3..466adb5 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1772,7 +1772,7 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call8\t0x%lx", INTVAL (tgt));
++ sprintf (result, "call8\t" HOST_WIDE_INT_PRINT_HEX, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx8\t%%%d", callop);
+ else
+@@ -2347,14 +2347,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2368,7 +2368,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2437,7 +2437,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/linaro-4.9-2017.01/1100-msp430-string-literals.patch b/patches/gcc/linaro-4.9-2017.01/1100-msp430-string-literals.patch
new file mode 100644
index 0000000..346842e
--- /dev/null
+++ b/patches/gcc/linaro-4.9-2017.01/1100-msp430-string-literals.patch
@@ -0,0 +1,27 @@
+commit 9d247a3d78b97c004e7ca5e7d6cc9964dba870c7
+Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed May 13 01:11:13 2015 +0000
+
+ gcc/
+ * config/mmix/mmix.c, config/msp430/msp430.c: Add space between
+ string literal and macro name.
+ gcc/ada/
+ * sigtramp-vxworks.c: Add space between string literal and macro
+ name.
+
+ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223106 138bc75d-0d04-0410-961f-82ee72b054a4
+
+[4.9 change: remove non-applicable parts of the patch]
+diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
+index bec168ca2ae..58d0efea1de 100644
+--- a/gcc/config/msp430/msp430.c
++++ b/gcc/config/msp430/msp430.c
+@@ -2248,7 +2248,7 @@ static struct
+ }
+ const_shift_helpers[] =
+ {
+-#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G }
++#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G }
+
+ CSH ("slli", 1, 1, slli_1),
+ CSH ("slll", 1, 1, slll_1),
diff --git a/patches/gcc/linaro-4.9-2017.01/875-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/linaro-4.9-2017.01/875-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..052ffc3
--- /dev/null
+++ b/patches/gcc/linaro-4.9-2017.01/875-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,73 @@
+From 0f32ae7bc51725cd500e2877b571fd914d77852e Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index d8c8298..3c00961 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1785,7 +1785,7 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call8\t0x%lx", INTVAL (tgt));
++ sprintf (result, "call8\t" HOST_WIDE_INT_PRINT_HEX, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx8\t%%%d", callop);
+ else
+@@ -2360,14 +2360,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2381,7 +2381,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2450,7 +2450,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/linaro-5.4-2017.01/100-uclibc-conf.patch b/patches/gcc/linaro-5.4-2017.05/100-uclibc-conf.patch
index 73d1f0d..73d1f0d 100644
--- a/patches/gcc/linaro-5.4-2017.01/100-uclibc-conf.patch
+++ b/patches/gcc/linaro-5.4-2017.05/100-uclibc-conf.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/1000-libtool-leave-framework-alone.patch b/patches/gcc/linaro-5.4-2017.05/1000-libtool-leave-framework-alone.patch
index 0f4912a..0f4912a 100644
--- a/patches/gcc/linaro-5.4-2017.01/1000-libtool-leave-framework-alone.patch
+++ b/patches/gcc/linaro-5.4-2017.05/1000-libtool-leave-framework-alone.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/110-xtensa-implement-trap-pattern.patch b/patches/gcc/linaro-5.4-2017.05/110-xtensa-implement-trap-pattern.patch
index 3304532..3304532 100644
--- a/patches/gcc/linaro-5.4-2017.01/110-xtensa-implement-trap-pattern.patch
+++ b/patches/gcc/linaro-5.4-2017.05/110-xtensa-implement-trap-pattern.patch
diff --git a/patches/gcc/linaro-5.4-2017.05/1100-msp430-string-literals.patch b/patches/gcc/linaro-5.4-2017.05/1100-msp430-string-literals.patch
new file mode 100644
index 0000000..819d6d2
--- /dev/null
+++ b/patches/gcc/linaro-5.4-2017.05/1100-msp430-string-literals.patch
@@ -0,0 +1,81 @@
+commit 9d247a3d78b97c004e7ca5e7d6cc9964dba870c7
+Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed May 13 01:11:13 2015 +0000
+
+ gcc/
+ * config/mmix/mmix.c, config/msp430/msp430.c: Add space between
+ string literal and macro name.
+ gcc/ada/
+ * sigtramp-vxworks.c: Add space between string literal and macro
+ name.
+
+ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223106 138bc75d-0d04-0410-961f-82ee72b054a4
+
+diff --git a/gcc/ada/sigtramp-vxworks.c b/gcc/ada/sigtramp-vxworks.c
+index 2119296dc1d..c697626a03e 100644
+--- a/gcc/ada/sigtramp-vxworks.c
++++ b/gcc/ada/sigtramp-vxworks.c
+@@ -342,16 +342,16 @@ CR("") \
+ TCR("# Allocate frame and save the non-volatile") \
+ TCR("# registers we're going to modify") \
+ TCR("mov ip, sp") \
+-TCR("stmfd sp!, {r"S(CFA_REG)", fp, ip, lr, pc}") \
++TCR("stmfd sp!, {r" S(CFA_REG)", fp, ip, lr, pc}") \
+ TCR("# Setup CFA_REG = context, which we'll retrieve as our CFA value") \
+-TCR("ldr r"S(CFA_REG)", [ip]") \
++TCR("ldr r" S(CFA_REG)", [ip]") \
+ TCR("") \
+ TCR("# Call the real handler. The signo, siginfo and sigcontext") \
+ TCR("# arguments are the same as those we received in r0, r1 and r2") \
+ TCR("sub fp, ip, #4") \
+ TCR("blx r3") \
+ TCR("# Restore our callee-saved items, release our frame and return") \
+-TCR("ldmfd sp, {r"S(CFA_REG)", fp, sp, pc}")
++TCR("ldmfd sp, {r" S(CFA_REG)", fp, sp, pc}")
+
+ #else
+ Not_implemented;
+diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
+index 6e991207dbc..e0699854e25 100644
+--- a/gcc/config/mmix/mmix.c
++++ b/gcc/config/mmix/mmix.c
+@@ -2520,7 +2520,7 @@ mmix_output_shiftvalue_op_from_str (FILE *stream,
+ if (! mmix_shiftable_wyde_value (value))
+ {
+ char s[sizeof ("0xffffffffffffffff")];
+- sprintf (s, "%#"PRIx64, value);
++ sprintf (s, "%#" PRIx64, value);
+ internal_error ("MMIX Internal: %s is not a shiftable int", s);
+ }
+
+@@ -2562,7 +2562,7 @@ mmix_output_octa (FILE *stream, int64_t value, int do_begin_end)
+ fprintf (stream, "#" HOST_WIDE_INT_PRINT_HEX_PURE,
+ (HOST_WIDE_INT) value);
+ else /* Need to avoid the hex output; there's no ...WIDEST...HEX_PURE. */
+- fprintf (stream, "%"PRIu64, value);
++ fprintf (stream, "%" PRIu64, value);
+
+ if (do_begin_end)
+ fprintf (stream, "\n");
+@@ -2579,7 +2579,7 @@ mmix_output_shifted_value (FILE *stream, int64_t value)
+ if (! mmix_shiftable_wyde_value (value))
+ {
+ char s[16+2+1];
+- sprintf (s, "%#"PRIx64, value);
++ sprintf (s, "%#" PRIx64, value);
+ internal_error ("MMIX Internal: %s is not a shiftable int", s);
+ }
+
+diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
+index bec168ca2ae..58d0efea1de 100644
+--- a/gcc/config/msp430/msp430.c
++++ b/gcc/config/msp430/msp430.c
+@@ -2248,7 +2248,7 @@ static struct
+ }
+ const_shift_helpers[] =
+ {
+-#define CSH(N,C,X,G) { "__mspabi_"N, C, X, gen_##G }
++#define CSH(N,C,X,G) { "__mspabi_" N, C, X, gen_##G }
+
+ CSH ("slli", 1, 1, slli_1),
+ CSH ("slll", 1, 1, slll_1),
diff --git a/patches/gcc/linaro-5.4-2017.01/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch b/patches/gcc/linaro-5.4-2017.05/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
index c11ad35..c11ad35 100644
--- a/patches/gcc/linaro-5.4-2017.01/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
+++ b/patches/gcc/linaro-5.4-2017.05/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/301-missing-execinfo_h.patch b/patches/gcc/linaro-5.4-2017.05/301-missing-execinfo_h.patch
index 2d0e7ba..2d0e7ba 100644
--- a/patches/gcc/linaro-6.3-2017.02/301-missing-execinfo_h.patch
+++ b/patches/gcc/linaro-5.4-2017.05/301-missing-execinfo_h.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/linaro-5.4-2017.05/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
index d8986d5..d8986d5 100644
--- a/patches/gcc/linaro-5.4-2017.01/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
+++ b/patches/gcc/linaro-5.4-2017.05/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/380-gcc-plugin-POSIX-include-sys-select-h.patch b/patches/gcc/linaro-5.4-2017.05/380-gcc-plugin-POSIX-include-sys-select-h.patch
index 12ef48e..12ef48e 100644
--- a/patches/gcc/linaro-5.4-2017.01/380-gcc-plugin-POSIX-include-sys-select-h.patch
+++ b/patches/gcc/linaro-5.4-2017.05/380-gcc-plugin-POSIX-include-sys-select-h.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/810-arm-softfloat-libgcc.patch b/patches/gcc/linaro-5.4-2017.05/810-arm-softfloat-libgcc.patch
index 5efa7fd..5efa7fd 100644
--- a/patches/gcc/linaro-5.4-2017.01/810-arm-softfloat-libgcc.patch
+++ b/patches/gcc/linaro-5.4-2017.05/810-arm-softfloat-libgcc.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/830-arm_unbreak_armv4t.patch b/patches/gcc/linaro-5.4-2017.05/830-arm_unbreak_armv4t.patch
index b730059..b730059 100644
--- a/patches/gcc/linaro-6.3-2017.02/830-arm_unbreak_armv4t.patch
+++ b/patches/gcc/linaro-5.4-2017.05/830-arm_unbreak_armv4t.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/840-microblaze-enable-dwarf-eh-support.patch b/patches/gcc/linaro-5.4-2017.05/840-microblaze-enable-dwarf-eh-support.patch
index 9d29090..9d29090 100644
--- a/patches/gcc/linaro-5.4-2017.01/840-microblaze-enable-dwarf-eh-support.patch
+++ b/patches/gcc/linaro-5.4-2017.05/840-microblaze-enable-dwarf-eh-support.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/850-libstdcxx-uclibc-c99.patch b/patches/gcc/linaro-5.4-2017.05/850-libstdcxx-uclibc-c99.patch
index 9e97d94..9e97d94 100644
--- a/patches/gcc/linaro-5.4-2017.01/850-libstdcxx-uclibc-c99.patch
+++ b/patches/gcc/linaro-5.4-2017.05/850-libstdcxx-uclibc-c99.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/860-cilk-wchar.patch b/patches/gcc/linaro-5.4-2017.05/860-cilk-wchar.patch
index 1d9916f..1d9916f 100644
--- a/patches/gcc/linaro-5.4-2017.01/860-cilk-wchar.patch
+++ b/patches/gcc/linaro-5.4-2017.05/860-cilk-wchar.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/870-xtensa-add-mauto-litpools-option.patch b/patches/gcc/linaro-5.4-2017.05/870-xtensa-add-mauto-litpools-option.patch
index aa1376c..aa1376c 100644
--- a/patches/gcc/linaro-5.4-2017.01/870-xtensa-add-mauto-litpools-option.patch
+++ b/patches/gcc/linaro-5.4-2017.05/870-xtensa-add-mauto-litpools-option.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/871-xtensa-reimplement-register-spilling.patch b/patches/gcc/linaro-5.4-2017.05/871-xtensa-reimplement-register-spilling.patch
index 4056f8b..4056f8b 100644
--- a/patches/gcc/linaro-5.4-2017.01/871-xtensa-reimplement-register-spilling.patch
+++ b/patches/gcc/linaro-5.4-2017.05/871-xtensa-reimplement-register-spilling.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch b/patches/gcc/linaro-5.4-2017.05/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
index 9707f68..9707f68 100644
--- a/patches/gcc/linaro-5.4-2017.01/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
+++ b/patches/gcc/linaro-5.4-2017.05/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch b/patches/gcc/linaro-5.4-2017.05/873-xtensa-fix-_Unwind_GetCFA.patch
index 2d8eb7c..2d8eb7c 100644
--- a/patches/gcc/linaro-5.4-2017.01/873-xtensa-fix-_Unwind_GetCFA.patch
+++ b/patches/gcc/linaro-5.4-2017.05/873-xtensa-fix-_Unwind_GetCFA.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/874-xtensa-add-uclinux-support.patch b/patches/gcc/linaro-5.4-2017.05/874-xtensa-add-uclinux-support.patch
index 23db3d8..23db3d8 100644
--- a/patches/gcc/linaro-5.4-2017.01/874-xtensa-add-uclinux-support.patch
+++ b/patches/gcc/linaro-5.4-2017.05/874-xtensa-add-uclinux-support.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch b/patches/gcc/linaro-5.4-2017.05/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch
index d128596..d128596 100644
--- a/patches/gcc/linaro-5.4-2017.01/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch
+++ b/patches/gcc/linaro-5.4-2017.05/875-xtensa-fix-xtensa_fallback_frame_state-for-call0-ABI.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/876-xtensa-fix-libgcc-build-with-text-section-literals.patch b/patches/gcc/linaro-5.4-2017.05/876-xtensa-fix-libgcc-build-with-text-section-literals.patch
index 4b2334a..4b2334a 100644
--- a/patches/gcc/linaro-5.4-2017.01/876-xtensa-fix-libgcc-build-with-text-section-literals.patch
+++ b/patches/gcc/linaro-5.4-2017.05/876-xtensa-fix-libgcc-build-with-text-section-literals.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch b/patches/gcc/linaro-5.4-2017.05/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
index 6e0ce6e..6e0ce6e 100644
--- a/patches/gcc/linaro-5.4-2017.01/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
+++ b/patches/gcc/linaro-5.4-2017.05/877-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/878-xtensa-Fix-PR-target-78603.patch b/patches/gcc/linaro-5.4-2017.05/878-xtensa-Fix-PR-target-78603.patch
index 4646d3c..4646d3c 100644
--- a/patches/gcc/linaro-5.4-2017.01/878-xtensa-Fix-PR-target-78603.patch
+++ b/patches/gcc/linaro-5.4-2017.05/878-xtensa-Fix-PR-target-78603.patch
diff --git a/patches/gcc/linaro-5.4-2017.05/879-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/linaro-5.4-2017.05/879-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..e75e258
--- /dev/null
+++ b/patches/gcc/linaro-5.4-2017.05/879-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,74 @@
+From 1117c8be9e712f778739d751aa61038794437d7d Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index 36ab1e3..8e62d63 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1811,7 +1811,8 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call%d\t0x%lx", WINDOW_SIZE, INTVAL (tgt));
++ sprintf (result, "call%d\t" HOST_WIDE_INT_PRINT_HEX,
++ WINDOW_SIZE, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx%d\t%%%d", WINDOW_SIZE, callop);
+ else
+@@ -2382,14 +2383,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2403,7 +2404,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2472,7 +2473,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/linaro-6.3-2017.02/890-fix-m68k-compile.patch b/patches/gcc/linaro-5.4-2017.05/890-fix-m68k-compile.patch
index 6e63de0..6e63de0 100644
--- a/patches/gcc/linaro-6.3-2017.02/890-fix-m68k-compile.patch
+++ b/patches/gcc/linaro-5.4-2017.05/890-fix-m68k-compile.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/891-fix-m68k-uclinux.patch b/patches/gcc/linaro-5.4-2017.05/891-fix-m68k-uclinux.patch
index 4e186bd..4e186bd 100644
--- a/patches/gcc/linaro-5.4-2017.01/891-fix-m68k-uclinux.patch
+++ b/patches/gcc/linaro-5.4-2017.05/891-fix-m68k-uclinux.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/892-microblaze-uclibc.patch b/patches/gcc/linaro-5.4-2017.05/892-microblaze-uclibc.patch
index a8eb5a6..a8eb5a6 100644
--- a/patches/gcc/linaro-5.4-2017.01/892-microblaze-uclibc.patch
+++ b/patches/gcc/linaro-5.4-2017.05/892-microblaze-uclibc.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/902-unwind-fix-for-musl.patch b/patches/gcc/linaro-5.4-2017.05/902-unwind-fix-for-musl.patch
index ef47054..ef47054 100644
--- a/patches/gcc/linaro-5.4-2017.01/902-unwind-fix-for-musl.patch
+++ b/patches/gcc/linaro-5.4-2017.05/902-unwind-fix-for-musl.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/910-nios2-bad-multilib-default.patch b/patches/gcc/linaro-5.4-2017.05/910-nios2-bad-multilib-default.patch
index d94697f..d94697f 100644
--- a/patches/gcc/linaro-5.4-2017.01/910-nios2-bad-multilib-default.patch
+++ b/patches/gcc/linaro-5.4-2017.05/910-nios2-bad-multilib-default.patch
diff --git a/patches/gcc/linaro-5.4-2017.01/930-libgcc-disable-split-stack-nothreads.patch b/patches/gcc/linaro-5.4-2017.05/930-libgcc-disable-split-stack-nothreads.patch
index 07f9a73..07f9a73 100644
--- a/patches/gcc/linaro-5.4-2017.01/930-libgcc-disable-split-stack-nothreads.patch
+++ b/patches/gcc/linaro-5.4-2017.05/930-libgcc-disable-split-stack-nothreads.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/940-uclinux-enable-threads.patch b/patches/gcc/linaro-5.4-2017.05/940-uclinux-enable-threads.patch
index 490a55b..490a55b 100644
--- a/patches/gcc/linaro-6.3-2017.02/940-uclinux-enable-threads.patch
+++ b/patches/gcc/linaro-5.4-2017.05/940-uclinux-enable-threads.patch
diff --git a/patches/gcc/linaro-6.3-2017.05/100-uclibc-conf.patch b/patches/gcc/linaro-6.3-2017.05/100-uclibc-conf.patch
new file mode 100644
index 0000000..73d1f0d
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/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/linaro-6.3-2017.05/1000-libtool-leave-framework-alone.patch b/patches/gcc/linaro-6.3-2017.05/1000-libtool-leave-framework-alone.patch
new file mode 100644
index 0000000..bce09eb
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/1000-libtool-leave-framework-alone.patch
@@ -0,0 +1,14 @@
+--- gcc-6.2.0/libtool-ldflags 2016-12-20 11:13:12.669668125 -0800
++++ gcc-6.2.0/libtool-ldflags 2016-12-20 11:28:34.894826286 -0800
+@@ -36,6 +36,11 @@
+ for arg
+ do
+ case $arg in
++ -framework)
++ # libtool handles this option. It should not be prefixed with
++ # -Xcompiler, as that would split it from the argument that
++ # follows.
++ ;;
+ -f*|--*|-static-lib*|-shared-lib*|-B*)
+ # Libtool does not ascribe any special meaning options
+ # that begin with -f or with a double-dash. So, it will
diff --git a/patches/gcc/linaro-5.4-2017.01/301-missing-execinfo_h.patch b/patches/gcc/linaro-6.3-2017.05/301-missing-execinfo_h.patch
index 2d0e7ba..2d0e7ba 100644
--- a/patches/gcc/linaro-5.4-2017.01/301-missing-execinfo_h.patch
+++ b/patches/gcc/linaro-6.3-2017.05/301-missing-execinfo_h.patch
diff --git a/patches/gcc/linaro-6.3-2017.05/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/patches/gcc/linaro-6.3-2017.05/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
new file mode 100644
index 0000000..d8986d5
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/370-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
@@ -0,0 +1,160 @@
+diff -urN gcc-5.3.0.orig/config/gcc-plugin.m4 gcc-5.3.0/config/gcc-plugin.m4
+--- gcc-5.3.0.orig/config/gcc-plugin.m4 2015-12-19 14:39:04.120734900 +0000
++++ gcc-5.3.0/config/gcc-plugin.m4 2015-12-20 01:28:45.381965300 +0000
+@@ -20,6 +20,9 @@
+
+ pluginlibs=
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+@@ -30,6 +33,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -81,17 +89,17 @@
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- AC_MSG_CHECKING([for -fPIC -shared])
++ AC_MSG_CHECKING([for ${PICFLAG} -shared])
+ AC_TRY_LINK(
+- [extern int X;],[return X == 0;],
++ [${UNDEFINEDPREAMBLE}],[${UNDEFINEDCODE}],
+ [AC_MSG_RESULT([yes]); have_pic_shared=yes],
+ [AC_MSG_RESULT([no]); have_pic_shared=no])
+ if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
+diff -urN gcc-5.3.0.orig/gcc/configure gcc-5.3.0/gcc/configure
+--- gcc-5.3.0.orig/gcc/configure 2015-12-19 14:40:16.893975900 +0000
++++ gcc-5.3.0/gcc/configure 2015-12-20 01:28:45.472476700 +0000
+@@ -28386,6 +28386,9 @@
+
+ pluginlibs=
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+@@ -28396,6 +28399,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -28508,23 +28516,23 @@
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
+-$as_echo_n "checking for -fPIC -shared... " >&6; }
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
++$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-extern int X;
++${UNDEFINEDPREAMBLE}
+ int
+ main ()
+ {
+-return X == 0;
++${UNDEFINEDCODE}
+ ;
+ return 0;
+ }
+diff -urN gcc-5.3.0.orig/libcc1/configure gcc-5.3.0/libcc1/configure
+--- gcc-5.3.0.orig/libcc1/configure 2015-12-19 14:40:20.855979000 +0000
++++ gcc-5.3.0/libcc1/configure 2015-12-20 01:28:45.504980900 +0000
+@@ -14500,6 +14500,9 @@
+
+ pluginlibs=
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-darwin*)
+ if test x$build = x$host; then
+@@ -14510,6 +14513,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -14622,23 +14630,23 @@
+ case "${host}" in
+ *-*-darwin*)
+ CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
+- CFLAGS="$CFLAGS -fPIC"
++ CFLAGS="$CFLAGS ${PICFLAG}"
+ LDFLAGS="$LDFLAGS -shared -undefined dynamic_lookup"
+ ;;
+ *)
+- CFLAGS="$CFLAGS -fPIC"
+- LDFLAGS="$LDFLAGS -fPIC -shared"
++ CFLAGS="$CFLAGS ${PICFLAG}"
++ LDFLAGS="$LDFLAGS ${PICFLAG} -shared"
+ ;;
+ esac
+- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fPIC -shared" >&5
+-$as_echo_n "checking for -fPIC -shared... " >&6; }
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${PICFLAG} -shared" >&5
++$as_echo_n "checking for ${PICFLAG} -shared... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-extern int X;
++${UNDEFINEDPREAMBLE}
+ int
+ main ()
+ {
+-return X == 0;
++${UNDEFINEDCODE}
+ ;
+ return 0;
+ }
diff --git a/patches/gcc/linaro-6.3-2017.05/380-gcc-plugin-POSIX-include-sys-select-h.patch b/patches/gcc/linaro-6.3-2017.05/380-gcc-plugin-POSIX-include-sys-select-h.patch
new file mode 100644
index 0000000..12ef48e
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/380-gcc-plugin-POSIX-include-sys-select-h.patch
@@ -0,0 +1,11 @@
+diff -urN gcc-5.3.0.orig/libcc1/connection.cc gcc-5.3.0/libcc1/connection.cc
+--- gcc-5.3.0.orig/libcc1/connection.cc 2015-12-19 14:40:20.860479600 +0000
++++ gcc-5.3.0/libcc1/connection.cc 2015-12-20 01:31:04.346611500 +0000
+@@ -21,6 +21,7 @@
+ #include <string>
+ #include <unistd.h>
+ #include <sys/types.h>
++#include <sys/select.h>
+ #include <string.h>
+ #include <errno.h>
+ #include "marshall.hh"
diff --git a/patches/gcc/linaro-6.3-2017.05/810-arm-softfloat-libgcc.patch b/patches/gcc/linaro-6.3-2017.05/810-arm-softfloat-libgcc.patch
new file mode 100644
index 0000000..5efa7fd
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/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/linaro-5.4-2017.01/830-arm_unbreak_armv4t.patch b/patches/gcc/linaro-6.3-2017.05/830-arm_unbreak_armv4t.patch
index b730059..b730059 100644
--- a/patches/gcc/linaro-5.4-2017.01/830-arm_unbreak_armv4t.patch
+++ b/patches/gcc/linaro-6.3-2017.05/830-arm_unbreak_armv4t.patch
diff --git a/patches/gcc/linaro-6.3-2017.05/860-cilk-wchar.patch b/patches/gcc/linaro-6.3-2017.05/860-cilk-wchar.patch
new file mode 100644
index 0000000..1d9916f
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/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/linaro-6.3-2017.02/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch b/patches/gcc/linaro-6.3-2017.05/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
index 6e0ce6e..6e0ce6e 100644
--- a/patches/gcc/linaro-6.3-2017.02/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
+++ b/patches/gcc/linaro-6.3-2017.05/870-xtensa-don-t-use-unwind-dw2-fde-dip-with-elf-targets.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/871-xtensa-Fix-PR-target-78118.patch b/patches/gcc/linaro-6.3-2017.05/871-xtensa-Fix-PR-target-78118.patch
index c6ae103..c6ae103 100644
--- a/patches/gcc/linaro-6.3-2017.02/871-xtensa-Fix-PR-target-78118.patch
+++ b/patches/gcc/linaro-6.3-2017.05/871-xtensa-Fix-PR-target-78118.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/872-xtensa-Fix-PR-target-78603.patch b/patches/gcc/linaro-6.3-2017.05/872-xtensa-Fix-PR-target-78603.patch
index 669097c..669097c 100644
--- a/patches/gcc/linaro-6.3-2017.02/872-xtensa-Fix-PR-target-78603.patch
+++ b/patches/gcc/linaro-6.3-2017.05/872-xtensa-Fix-PR-target-78603.patch
diff --git a/patches/gcc/linaro-6.3-2017.05/873-gcc-xtensa-fix-fprintf-format-specifiers.patch b/patches/gcc/linaro-6.3-2017.05/873-gcc-xtensa-fix-fprintf-format-specifiers.patch
new file mode 100644
index 0000000..a5b0624
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/873-gcc-xtensa-fix-fprintf-format-specifiers.patch
@@ -0,0 +1,74 @@
+From a3d07c8a2a9564b57ebcae8463c1541a37c97c34 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 28 May 2017 19:56:56 -0700
+Subject: [PATCH] gcc: xtensa: fix fprintf format specifiers
+
+HOST_WIDE_INT may not be long as assumed in print_operand and
+xtensa_emit_call. Use HOST_WIDE_INT_PRINT_DEC/HOST_WIDE_INT_PRINT_HEX
+format strings instead of %ld/0x%lx. This fixes incorrect assembly code
+generation by the compiler running on armhf host.
+
+2017-05-28 Max Filippov <jcmvbkbc@gmail.com>
+gcc/
+ * config/xtensa/xtensa.c (xtensa_emit_call): Use
+ HOST_WIDE_INT_PRINT_HEX instead of 0x%lx format string.
+ (print_operand): Use HOST_WIDE_INT_PRINT_DEC instead of %ld
+ format string.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.c | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
+index 70f698a..2bdf5cc 100644
+--- a/gcc/config/xtensa/xtensa.c
++++ b/gcc/config/xtensa/xtensa.c
+@@ -1776,7 +1776,8 @@ xtensa_emit_call (int callop, rtx *operands)
+ rtx tgt = operands[callop];
+
+ if (GET_CODE (tgt) == CONST_INT)
+- sprintf (result, "call%d\t0x%lx", WINDOW_SIZE, INTVAL (tgt));
++ sprintf (result, "call%d\t" HOST_WIDE_INT_PRINT_HEX,
++ WINDOW_SIZE, INTVAL (tgt));
+ else if (register_operand (tgt, VOIDmode))
+ sprintf (result, "callx%d\t%%%d", WINDOW_SIZE, callop);
+ else
+@@ -2347,14 +2348,14 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'L':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", (32 - INTVAL (x)) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, (32 - INTVAL (x)) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%L value");
+ break;
+
+ case 'R':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x) & 0x1f);
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0x1f);
+ else
+ output_operand_lossage ("invalid %%R value");
+ break;
+@@ -2368,7 +2369,7 @@ print_operand (FILE *file, rtx x, int letter)
+
+ case 'd':
+ if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_operand_lossage ("invalid %%d value");
+ break;
+@@ -2433,7 +2434,7 @@ print_operand (FILE *file, rtx x, int letter)
+ else if (GET_CODE (x) == MEM)
+ output_address (GET_MODE (x), XEXP (x, 0));
+ else if (GET_CODE (x) == CONST_INT)
+- fprintf (file, "%ld", INTVAL (x));
++ fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ else
+ output_addr_const (file, x);
+ }
+--
+2.1.4
+
diff --git a/patches/gcc/linaro-5.4-2017.01/890-fix-m68k-compile.patch b/patches/gcc/linaro-6.3-2017.05/890-fix-m68k-compile.patch
index 6e63de0..6e63de0 100644
--- a/patches/gcc/linaro-5.4-2017.01/890-fix-m68k-compile.patch
+++ b/patches/gcc/linaro-6.3-2017.05/890-fix-m68k-compile.patch
diff --git a/patches/gcc/linaro-6.3-2017.05/891-fix-m68k-uclinux.patch b/patches/gcc/linaro-6.3-2017.05/891-fix-m68k-uclinux.patch
new file mode 100644
index 0000000..4e186bd
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/891-fix-m68k-uclinux.patch
@@ -0,0 +1,18 @@
+avoids internal compiler error while compiling linux-atomic.c
+See here:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-5.3.0.orig/libgcc/config.host gcc-5.3.0/libgcc/config.host
+--- gcc-5.3.0.orig/libgcc/config.host 2015-10-01 14:01:18.000000000 +0200
++++ gcc-5.3.0/libgcc/config.host 2016-04-26 21:30:25.353691745 +0200
+@@ -794,7 +794,7 @@
+ m68k*-*-openbsd*)
+ ;;
+ m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc
+- tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux"
++ tmake_file="$tmake_file m68k/t-floatlib"
+ md_unwind_header=m68k/linux-unwind.h
+ ;;
+ m68k-*-linux*) # Motorola m68k's running GNU/Linux
diff --git a/patches/gcc/linaro-6.3-2017.02/892-libgcc-mkmap-symver-support-skip_underscore.patch b/patches/gcc/linaro-6.3-2017.05/892-libgcc-mkmap-symver-support-skip_underscore.patch
index 73ee6c5..73ee6c5 100644
--- a/patches/gcc/linaro-6.3-2017.02/892-libgcc-mkmap-symver-support-skip_underscore.patch
+++ b/patches/gcc/linaro-6.3-2017.05/892-libgcc-mkmap-symver-support-skip_underscore.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch b/patches/gcc/linaro-6.3-2017.05/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch
index 454295d..454295d 100644
--- a/patches/gcc/linaro-6.3-2017.02/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch
+++ b/patches/gcc/linaro-6.3-2017.05/893-libgcc-config-bfin-use-the-generic-linker-version-in.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch b/patches/gcc/linaro-6.3-2017.05/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
index ce49de7..ce49de7 100644
--- a/patches/gcc/linaro-6.3-2017.02/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
+++ b/patches/gcc/linaro-6.3-2017.05/894-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
diff --git a/patches/gcc/linaro-6.3-2017.02/895-bfin-define-REENTRANT.patch b/patches/gcc/linaro-6.3-2017.05/895-bfin-define-REENTRANT.patch
index e2828a5..e2828a5 100644
--- a/patches/gcc/linaro-6.3-2017.02/895-bfin-define-REENTRANT.patch
+++ b/patches/gcc/linaro-6.3-2017.05/895-bfin-define-REENTRANT.patch
diff --git a/patches/gcc/linaro-6.3-2017.05/900-libgfortran-missing-include.patch b/patches/gcc/linaro-6.3-2017.05/900-libgfortran-missing-include.patch
new file mode 100644
index 0000000..1f47469
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/900-libgfortran-missing-include.patch
@@ -0,0 +1,10 @@
+--- gcc-6.3.0/libgfortran/io/close.c.org 2017-01-17 09:43:48.395850000 +0100
++++ gcc-6.3.0/libgfortran/io/close.c 2017-01-17 09:21:05.000000000 +0100
+@@ -25,6 +25,7 @@
+ #include "io.h"
+ #include "unix.h"
+ #include <limits.h>
++#include <stdlib.h>
+
+ typedef enum
+ { CLOSE_DELETE, CLOSE_KEEP, CLOSE_UNSPECIFIED }
diff --git a/patches/gcc/linaro-6.3-2017.05/910-nios2-bad-multilib-default.patch b/patches/gcc/linaro-6.3-2017.05/910-nios2-bad-multilib-default.patch
new file mode 100644
index 0000000..61989e5
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/910-nios2-bad-multilib-default.patch
@@ -0,0 +1,28 @@
+diff -ur gcc-6.2.0.orig/gcc/config/nios2/nios2.h gcc-6.2.0/gcc/config/nios2/nios2.h
+--- gcc-6.2.0.orig/gcc/config/nios2/nios2.h 2016-11-29 10:27:50.364479625 -0800
++++ gcc-6.2.0/gcc/config/nios2/nios2.h 2016-11-29 10:29:55.069624746 -0800
+@@ -63,11 +63,11 @@
+ #if TARGET_ENDIAN_DEFAULT == 0
+ # define ASM_SPEC "%{!meb:-EL} %{meb:-EB} %{march=*:-march=%*}"
+ # define LINK_SPEC_ENDIAN "%{!meb:-EL} %{meb:-EB}"
+-# define MULTILIB_DEFAULTS { "EL" }
++# define MULTILIB_DEFAULTS { "mel" }
+ #else
+ # define ASM_SPEC "%{!mel:-EB} %{mel:-EL} %{march=*:-march=%*}"
+ # define LINK_SPEC_ENDIAN "%{!mel:-EB} %{mel:-EL}"
+-# define MULTILIB_DEFAULTS { "EB" }
++# define MULTILIB_DEFAULTS { "meb" }
+ #endif
+
+ #define LINK_SPEC LINK_SPEC_ENDIAN \
+diff -ur gcc-6.2.0.orig/gcc/config/nios2/t-nios2 gcc-6.2.0/gcc/config/nios2/t-nios2
+--- gcc-6.2.0.orig/gcc/config/nios2/t-nios2 2016-11-29 10:27:50.364479625 -0800
++++ gcc-6.2.0/gcc/config/nios2/t-nios2 2016-11-29 10:29:03.517151014 -0800
+@@ -22,6 +22,5 @@
+ # MULTILIB_DIRNAMES = nomul mulx fpu-60-1 fpu-60-2
+ # MULTILIB_EXCEPTIONS =
+
+-# MULTILIB_OPTIONS += EL/EB
++# MULTILIB_OPTIONS += mel/meb
+ # MULTILIB_DIRNAMES += le be
+-# MULTILIB_MATCHES += EL=mel EB=meb
diff --git a/patches/gcc/linaro-6.3-2017.05/930-libgcc-disable-split-stack-nothreads.patch b/patches/gcc/linaro-6.3-2017.05/930-libgcc-disable-split-stack-nothreads.patch
new file mode 100644
index 0000000..07f9a73
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/930-libgcc-disable-split-stack-nothreads.patch
@@ -0,0 +1,14 @@
+disable split-stack for non-thread builds
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+diff -Nur gcc-5.3.0.orig/libgcc/config/t-stack gcc-5.3.0/libgcc/config/t-stack
+--- gcc-5.3.0.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200
++++ gcc-5.3.0/libgcc/config/t-stack 2016-03-07 03:25:32.000000000 +0100
+@@ -1,4 +1,6 @@
+ # Makefile fragment to provide generic support for -fsplit-stack.
+ # This should be used in config.host for any host which supports
+ # -fsplit-stack.
++ifeq ($(enable_threads),yes)
+ LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c
++endif
diff --git a/patches/gcc/linaro-5.4-2017.01/940-uclinux-enable-threads.patch b/patches/gcc/linaro-6.3-2017.05/940-uclinux-enable-threads.patch
index 490a55b..490a55b 100644
--- a/patches/gcc/linaro-5.4-2017.01/940-uclinux-enable-threads.patch
+++ b/patches/gcc/linaro-6.3-2017.05/940-uclinux-enable-threads.patch
diff --git a/patches/gcc/linaro-6.3-2017.05/951-bionic-ndk.patch b/patches/gcc/linaro-6.3-2017.05/951-bionic-ndk.patch
new file mode 100644
index 0000000..59c50a8
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/951-bionic-ndk.patch
@@ -0,0 +1,58 @@
+commit d38d37bdfe24b7ce1bdcb55642fb6b904718e68f
+Author: Howard Chu <hyc@symas.com>
+Date: Tue Apr 25 19:02:18 2017 -0700
+
+ Fix ctype for newer NDK headers
+
+diff --git a/libstdc++-v3/config/os/bionic/ctype_base.h b/libstdc++-v3/config/os/bionic/ctype_base.h
+index 33978f3..c36e63c 100644
+--- a/libstdc++-v3/config/os/bionic/ctype_base.h
++++ b/libstdc++-v3/config/os/bionic/ctype_base.h
+@@ -28,6 +28,18 @@
+
+ // Information as gleaned from /usr/include/ctype.h
+
++// _CTYPE prefix was added in NDK r14 unified headers
++#ifndef _CTYPE_U
++#define _CTYPE_U _U
++#define _CTYPE_L _L
++#define _CTYPE_D _N
++#define _CTYPE_S _S
++#define _CTYPE_P _P
++#define _CTYPE_C _C
++#define _CTYPE_X _X
++#define _CTYPE_B _B
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,17 +53,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ // NB: Offsets into ctype<char>::_M_table force a particular size
+ // on the mask type. Because of this, we don't use an enum.
+ typedef char mask;
+- static const mask upper = _U;
+- static const mask lower = _L;
+- static const mask alpha = _U | _L;
+- static const mask digit = _N;
+- static const mask xdigit = _X | _N;
+- static const mask space = _S;
+- static const mask print = _P | _U | _L | _N | _B;
+- static const mask graph = _P | _U | _L | _N;
+- static const mask cntrl = _C;
+- static const mask punct = _P;
+- static const mask alnum = _U | _L | _N;
++ static const mask upper = _CTYPE_U;
++ static const mask lower = _CTYPE_L;
++ static const mask alpha = _CTYPE_U | _CTYPE_L;
++ static const mask digit = _CTYPE_D;
++ static const mask xdigit = _CTYPE_X | _CTYPE_D;
++ static const mask space = _CTYPE_S;
++ static const mask print = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_D | _CTYPE_B;
++ static const mask graph = _CTYPE_P | _CTYPE_U | _CTYPE_L | _CTYPE_D;
++ static const mask cntrl = _CTYPE_C;
++ static const mask punct = _CTYPE_P;
++ static const mask alnum = _CTYPE_U | _CTYPE_L | _CTYPE_D;
+ #if __cplusplus >= 201103L
+ static const mask blank = space;
+ #endif
diff --git a/patches/gcc/linaro-6.3-2017.05/952-bionic-errno.patch b/patches/gcc/linaro-6.3-2017.05/952-bionic-errno.patch
new file mode 100644
index 0000000..91f6ca3
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/952-bionic-errno.patch
@@ -0,0 +1,19 @@
+commit 6cd4ad106ef87a3c58b0c3478e78409b47000de0
+Author: Howard Chu <hyc@symas.com>
+Date: Tue Apr 25 20:17:03 2017 -0700
+
+ Fix, errno is volatile int
+
+diff --git a/libstdc++-v3/src/filesystem/dir.cc b/libstdc++-v3/src/filesystem/dir.cc
+index 6ff12d0..5bbd664 100644
+--- a/libstdc++-v3/src/filesystem/dir.cc
++++ b/libstdc++-v3/src/filesystem/dir.cc
+@@ -147,7 +147,7 @@ fs::_Dir::advance(error_code* ec, directory_options options)
+
+ int err = std::exchange(errno, 0);
+ const auto entp = readdir(dirp);
+- std::swap(errno, err);
++ std::swap((int&)errno, err);
+
+ if (entp)
+ {
diff --git a/patches/gcc/linaro-6.3-2017.05/970-crystax.patch b/patches/gcc/linaro-6.3-2017.05/970-crystax.patch
new file mode 100644
index 0000000..e3109cc
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/970-crystax.patch
@@ -0,0 +1,551 @@
+commit 080803512c8f6f87c2f1f711170d54033144d628
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Wed Jul 29 11:28:29 2015 +0300
+
+ [android] Apply Android-related modifications
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+[Edited: keep libstdc++, drop libcrystax-related modifications]
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index f66e48cd1..1c253496b 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -942,13 +942,17 @@ aarch64*-*-elf | aarch64*-*-rtems*)
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
+ ;;
+ aarch64*-*-linux*)
+- tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
++ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h"
+ tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
++ extra_options="${extra_options} linux-android.opt"
+ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
+ case $target in
+ aarch64_be-*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
++ aarch64*-*-linux-android*)
++ tm_file="${tm_file} aarch64/aarch64-linux-android.h"
++ ;;
+ esac
+ aarch64_multilibs="${with_multilib_list}"
+ if test "$aarch64_multilibs" = "default"; then
+@@ -2055,6 +2059,17 @@ mips*-*-linux*) # Linux MIPS, either endian.
+ tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
+ extra_options="${extra_options} linux-android.opt"
+ case ${target} in
++ mips64*android*)
++ default_mips_arch=mips64r6
++ default_mips_abi=64
++ tm_file="${tm_file} mips/android.h"
++ tmake_file="${tmake_file} mips/t-linux-android64"
++ ;;
++ mips*android*)
++ default_mips_arch=mips32
++ tm_file="${tm_file} mips/android.h"
++ tmake_file="$tmake_file mips/t-linux-android"
++ ;;
+ mipsisa32r6*)
+ default_mips_arch=mips32r6
+ ;;
+diff --git a/gcc/config/aarch64/aarch64-linux-android.h b/gcc/config/aarch64/aarch64-linux-android.h
+new file mode 100644
+index 000000000..db1288fd0
+--- /dev/null
++++ b/gcc/config/aarch64/aarch64-linux-android.h
+@@ -0,0 +1,59 @@
++/* Machine description for AArch64 architecture.
++ Copyright (C) 2014 Free Software Foundation, Inc.
++
++ This file is part of GCC.
++
++ GCC is free software; you can redistribute it and/or modify it
++ under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3, or (at your option)
++ any later version.
++
++ GCC is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ General Public License for more details.
++
++ You should have received a copy of the GNU General Public License
++ along with GCC; see the file COPYING3. If not see
++ <http://www.gnu.org/licenses/>. */
++
++#ifndef GCC_AARCH64_LINUX_ANDROID_H
++#define GCC_AARCH64_LINUX_ANDROID_H
++
++
++#undef TARGET_OS_CPP_BUILTINS
++#define TARGET_OS_CPP_BUILTINS() \
++ do \
++ { \
++ GNU_USER_TARGET_OS_CPP_BUILTINS(); \
++ ANDROID_TARGET_OS_CPP_BUILTINS(); \
++ } \
++ while (0)
++
++#undef LINK_SPEC
++#define LINK_SPEC \
++ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
++ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
++
++#undef CC1_SPEC
++#define CC1_SPEC \
++ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
++ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic"))
++
++#define CC1PLUS_SPEC \
++ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
++
++#undef LIB_SPEC
++#define LIB_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
++ GNU_USER_TARGET_NO_PTHREADS_LIB_SPEC " " ANDROID_LIB_SPEC)
++
++#undef STARTFILE_SPEC
++#define STARTFILE_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
++
++#undef ENDFILE_SPEC
++#define ENDFILE_SPEC \
++ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
++
++#endif /* GCC_AARCH64_LINUX_ANDROID_H */
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index 5fcaa59a3..6864195ee 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,14 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#ifndef RUNTIME_ROOT_PREFIX
++#define RUNTIME_ROOT_PREFIX ""
++#endif
++#define GLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#ifdef BIONIC_DYNAMIC_LINKER
++#undef BIONIC_DYNAMIC_LINKER
++#endif
++#define BIONIC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/system/bin/linker64"
+
+ #undef MUSL_DYNAMIC_LINKER
+ #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
+index ad123dde9..97b059de6 100644
+--- a/gcc/config/arm/arm.h
++++ b/gcc/config/arm/arm.h
+@@ -1888,10 +1888,11 @@ enum arm_auto_incmodes
+
+ #define CASE_VECTOR_PC_RELATIVE (TARGET_THUMB2 \
+ || (TARGET_THUMB1 \
++ && !inline_thumb1_jump_table \
+ && (optimize_size || flag_pic)))
+
+ #define CASE_VECTOR_SHORTEN_MODE(min, max, body) \
+- (TARGET_THUMB1 \
++ (TARGET_THUMB1 && !inline_thumb1_jump_table \
+ ? (min >= 0 && max < 512 \
+ ? (ADDR_DIFF_VEC_FLAGS (body).offset_unsigned = 1, QImode) \
+ : min >= -256 && max < 256 \
+diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
+index 47171b996..eb22d1181 100644
+--- a/gcc/config/arm/arm.md
++++ b/gcc/config/arm/arm.md
+@@ -8179,7 +8179,7 @@
+ (match_operand:SI 2 "const_int_operand" "") ; total range
+ (match_operand:SI 3 "" "") ; table label
+ (match_operand:SI 4 "" "")] ; Out of range label
+- "TARGET_32BIT || optimize_size || flag_pic"
++ "TARGET_32BIT || ((optimize_size || flag_pic) && !inline_thumb1_jump_table)"
+ "
+ {
+ enum insn_code code;
+diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
+index 0ebe01743..772453889 100644
+--- a/gcc/config/arm/arm.opt
++++ b/gcc/config/arm/arm.opt
+@@ -193,6 +193,10 @@ mthumb-interwork
+ Target Report Mask(INTERWORK)
+ Support calls between Thumb and ARM instruction sets.
+
++minline-thumb1-jumptable
++Target Report Var(inline_thumb1_jump_table)
++Inline Thumb1 Jump table code
++
+ mtls-dialect=
+ Target RejectNegative Joined Enum(tls_type) Var(target_tls_dialect) Init(TLS_GNU)
+ Specify thread local storage scheme.
+diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
+index 77f30554d..32158ed65 100644
+--- a/gcc/config/arm/elf.h
++++ b/gcc/config/arm/elf.h
+@@ -56,8 +56,7 @@
+ #undef SUBSUBTARGET_EXTRA_SPECS
+ #define SUBSUBTARGET_EXTRA_SPECS
+
+-#ifndef ASM_SPEC
+-#define ASM_SPEC "\
++#define DEFAULT_ASM_SPEC "\
+ %{mbig-endian:-EB} \
+ %{mlittle-endian:-EL} \
+ %(asm_cpu_spec) \
+@@ -66,6 +65,9 @@
+ %{mthumb-interwork:-mthumb-interwork} \
+ %{mfloat-abi=*} %{mfpu=*} \
+ %(subtarget_extra_asm_spec)"
++
++#ifndef ASM_SPEC
++#define ASM_SPEC DEFAULT_ASM_SPEC
+ #endif
+
+ /* The ARM uses @ are a comment character so we need to redefine
+@@ -104,7 +106,8 @@
+ the code more efficient, but for Thumb-1 it's better to put them out of
+ band unless we are generating compressed tables. */
+ #define JUMP_TABLES_IN_TEXT_SECTION \
+- (TARGET_32BIT || (TARGET_THUMB && (optimize_size || flag_pic)))
++ (TARGET_32BIT || (TARGET_THUMB && !inline_thumb1_jump_table \
++ && (optimize_size || flag_pic)))
+
+ #ifndef LINK_SPEC
+ #define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index ace84816e..8c8fa6553 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -108,11 +108,16 @@
+ #define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC, \
+ GNU_USER_TARGET_CC1_SPEC " " ASAN_CC1_SPEC " " \
+- ANDROID_CC1_SPEC)
++ ANDROID_CC1_SPEC("-fpic"))
+
+ #define CC1PLUS_SPEC \
+ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
++#undef ASM_SPEC
++#define ASM_SPEC \
++ LINUX_OR_ANDROID_CC (DEFAULT_ASM_SPEC, \
++ DEFAULT_ASM_SPEC " " ANDROID_ASM_SPEC)
++
+ #undef LIB_SPEC
+ #define LIB_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC, \
+diff --git a/gcc/config/i386/gnu-user.h b/gcc/config/i386/gnu-user.h
+index fee33a3ef..22fb2ced9 100644
+--- a/gcc/config/i386/gnu-user.h
++++ b/gcc/config/i386/gnu-user.h
+@@ -65,9 +65,14 @@ along with GCC; see the file COPYING3. If not see
+ When the -shared link option is used a final link is not being
+ done. */
+
++#undef ANDROID_TARGET_CC1_SPEC
++#define ANDROID_TARGET_CC1_SPEC \
++ " -mssse3 -fno-short-enums " \
++
+ #undef ASM_SPEC
+ #define ASM_SPEC \
+- "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
++ "--32 %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}} " \
++ LINUX_OR_ANDROID_CC ("", ANDROID_ASM_SPEC)
+
+ #undef SUBTARGET_EXTRA_SPECS
+ #define SUBTARGET_EXTRA_SPECS \
+diff --git a/gcc/config/i386/gnu-user64.h b/gcc/config/i386/gnu-user64.h
+index 7a02a7eb4..cac4179bc 100644
+--- a/gcc/config/i386/gnu-user64.h
++++ b/gcc/config/i386/gnu-user64.h
+@@ -46,6 +46,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define SPEC_X32 "mx32"
+ #endif
+
++#undef ANDROID_TARGET_CC1_SPEC
++#define ANDROID_TARGET_CC1_SPEC \
++ "%{m32:-mssse3 -fno-short-enums}" \
++ "%{!m32:-msse4.2 -mpopcnt}"
++
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{" SPEC_32 ":--32} \
+ %{" SPEC_64 ":--64} \
+diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
+index 4b9910fa9..3b11ed086 100644
+--- a/gcc/config/i386/linux-common.h
++++ b/gcc/config/i386/linux-common.h
+@@ -30,7 +30,13 @@ along with GCC; see the file COPYING3. If not see
+ #undef CC1_SPEC
+ #define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+- GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
++ GNU_USER_TARGET_CC1_SPEC \
++ ANDROID_TARGET_CC1_SPEC \
++ " " \
++ ANDROID_CC1_SPEC("-fPIC"))
++
++#define CC1PLUS_SPEC \
++ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
+index 301a41ccd..9623c88d0 100644
+--- a/gcc/config/linux-android.h
++++ b/gcc/config/linux-android.h
+@@ -38,15 +39,18 @@
+ "%{" NOANDROID "|tno-android-ld:" LINUX_SPEC ";:" ANDROID_SPEC "}"
+
+ #define ANDROID_LINK_SPEC \
+- "%{shared: -Bsymbolic}"
++ "%{shared: -Bsymbolic} -z noexecstack -z relro -z now"
+
+-#define ANDROID_CC1_SPEC \
++#define ANDROID_CC1_SPEC(ANDROID_PIC_DEFAULT) \
+ "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \
+- "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
++ "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: " ANDROID_PIC_DEFAULT "}}}}"
+
+ #define ANDROID_CC1PLUS_SPEC \
+- "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \
+- "%{!frtti:%{!fno-rtti: -fno-rtti}}"
++ "%{!fexceptions:%{!fno-exceptions: -fexceptions}} " \
++ "%{!frtti:%{!fno-rtti: -frtti}}"
++
++#define ANDROID_ASM_SPEC \
++ "--noexecstack"
+
+ #define ANDROID_LIB_SPEC \
+ "%{!static: -ldl}"
+diff --git a/gcc/config/mips/android.h b/gcc/config/mips/android.h
+new file mode 100644
+index 000000000..32c539c8d
+--- /dev/null
++++ b/gcc/config/mips/android.h
+@@ -0,0 +1,49 @@
++/* Target macros for mips*-*android* targets.
++ Copyright (C) 2014 Free Software Foundation, Inc.
++
++This file is part of GCC.
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 3, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING3. If not see
++<http://www.gnu.org/licenses/>. */
++
++#undef DRIVER_SELF_SPECS
++#define DRIVER_SELF_SPECS \
++ /* Make sure a -mips option is present. This helps us to pick \
++ the right multilib, and also makes the later specs easier \
++ to write. */ \
++ MIPS_ISA_LEVEL_SPEC, \
++ \
++ /* Infer the default float setting from -march. */ \
++ MIPS_ARCH_FLOAT_SPEC, \
++ \
++ /* Infer the -msynci setting from -march if not explicitly set. */ \
++ MIPS_ISA_SYNCI_SPEC, \
++ \
++ /* If no ABI option is specified, infer one from the ISA level \
++ or -mgp setting. */ \
++ "%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=64}}", \
++ \
++ /* If no FP ABI option is specified, infer one from the \
++ ABI/ISA level unless there is a conflicting option. */ \
++ "%{!msoft-float: %{!msingle-float: %{!mfp*: %{!mmsa: %{mabi=32: %{" \
++ MIPS_FPXX_OPTION_SPEC ": -mfpxx}}}}}}", \
++ \
++ /* If no odd-spreg option is specified, infer one from the ISA. */ \
++ "%{!modd-spreg: %{mabi=32: %{mips32r6: -mno-odd-spreg}}}", \
++ \
++ /* Base SPECs. */ \
++ BASE_DRIVER_SELF_SPECS, \
++ \
++ /* Use the standard linux specs for everything else. */ \
++ LINUX_DRIVER_SELF_SPECS
+diff --git a/gcc/config/mips/gnu-user.h b/gcc/config/mips/gnu-user.h
+index 15b549c08..4a2816014 100644
+--- a/gcc/config/mips/gnu-user.h
++++ b/gcc/config/mips/gnu-user.h
+@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
+ /* The GNU C++ standard library requires this. */ \
+ if (c_dialect_cxx ()) \
+ builtin_define ("_GNU_SOURCE"); \
++ ANDROID_TARGET_OS_CPP_BUILTINS(); \
+ } while (0)
+
+ #undef SUBTARGET_CPP_SPEC
+@@ -71,7 +72,8 @@ along with GCC; see the file COPYING3. If not see
+
+ #undef SUBTARGET_ASM_SPEC
+ #define SUBTARGET_ASM_SPEC \
+- "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}}"
++ "%{!mno-abicalls:%{mplt:-call_nonpic;:-KPIC}} " \
++ LINUX_OR_ANDROID_CC ("", ANDROID_ASM_SPEC)
+
+ /* The MIPS assembler has different syntax for .set. We set it to
+ .dummy to trap any errors. */
+@@ -120,7 +122,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
+ #endif
+
+ #define LINUX_DRIVER_SELF_SPECS \
+- NO_SHARED_SPECS \
++ LINUX_OR_ANDROID_CC(NO_SHARED_SPECS, "") \
+ MARCH_MTUNE_NATIVE_SPECS, \
+ /* -mplt has no effect without -mno-shared. Simplify later \
+ specs handling by removing a redundant option. */ \
+diff --git a/gcc/config/mips/linux-common.h b/gcc/config/mips/linux-common.h
+index 8429a7ca2..8bfacf994 100644
+--- a/gcc/config/mips/linux-common.h
++++ b/gcc/config/mips/linux-common.h
+@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
+ #undef SUBTARGET_CC1_SPEC
+ #define SUBTARGET_CC1_SPEC \
+ LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC, \
+- GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
++ GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC("-fpic"))
+
+ #undef CC1PLUS_SPEC
+ #define CC1PLUS_SPEC \
+diff --git a/gcc/config/mips/t-linux-android b/gcc/config/mips/t-linux-android
+new file mode 100644
+index 000000000..39f512c81
+--- /dev/null
++++ b/gcc/config/mips/t-linux-android
+@@ -0,0 +1,3 @@
++MULTILIB_OPTIONS = mips32r2/mips32r6
++MULTILIB_DIRNAMES = mips-r2 mips-r6
++MULTILIB_OSDIRNAMES = ../libr2 ../libr6
+diff --git a/gcc/config/mips/t-linux-android64 b/gcc/config/mips/t-linux-android64
+new file mode 100644
+index 000000000..55cab7d62
+--- /dev/null
++++ b/gcc/config/mips/t-linux-android64
+@@ -0,0 +1,4 @@
++MULTILIB_OPTIONS = mabi=32 mips32/mips32r2/mips32r6/mips64r2/mips64r6
++MULTILIB_DIRNAMES = 32 mips-r1 mips-r2 mips-r6 mips64-r2 mips64-r6
++MULTILIB_OSDIRNAMES = ../lib ../lib ../libr2 ../libr6 ../lib64r2 ../lib64
++MULTILIB_REQUIRED = mabi=32/mips32 mabi=32/mips32r2 mabi=32/mips32r6 mips64r2 mips64r6
+diff --git a/libgcc/gthr-posix.h b/libgcc/gthr-posix.h
+index 555c0fe24..47c8655f9 100644
+--- a/libgcc/gthr-posix.h
++++ b/libgcc/gthr-posix.h
+@@ -32,6 +32,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define __GTHREADS 1
+ #define __GTHREADS_CXX0X 1
+
++/* The following should normally be in a different header file,
++ * but I couldn't find the right location. The point of the macro
++ * definition below is to prevent libsupc++ and libstdc++ to reference
++ * weak symbols in their static C++ constructors. Such code crashes
++ * when a shared object linked statically to these libraries is
++ * loaded on Android 2.1 (Eclair) and older platform releases, due
++ * to a dynamic linker bug.
++ */
++#ifdef __ANDROID__
++#undef GTHREAD_USE_WEAK
++#define GTHREAD_USE_WEAK 0
++#endif
++
+ #include <pthread.h>
+
+ #if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 41797a971..f746e8353 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -78319,6 +78341,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <sys/syscall.h>
+ int lk;
++#if !defined(SYS_gettid)
++#define SYS_gettid __NR_gettid
++#endif
++#if !defined(SYS_futex)
++#define SYS_futex __NR_futex
++#endif
+ int
+ main ()
+ {
+@@ -78377,6 +78405,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+ #include <sys/syscall.h>
+ int lk;
++#if !defined(SYS_gettid)
++#define SYS_gettid __NR_gettid
++#endif
++#if !defined(SYS_futex)
++#define SYS_futex __NR_futex
++#endif
+ int
+ main ()
+ {
+diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
+index e3e206b7d..e85dc2c76 100644
+--- a/libstdc++-v3/include/bits/locale_facets.h
++++ b/libstdc++-v3/include/bits/locale_facets.h
+@@ -47,6 +47,20 @@
+ #include <ext/numeric_traits.h>
+ #include <bits/streambuf_iterator.h>
+
++#if !__clang__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && __i386__
++// CrystaX: for some reason, x86 gcc-4.9 makes ctype<char>::do_widen() and
++// ctype<char>::_M_widen_init() methods working wrong if optimization enabled.
++// For ctype<char>::do_widen(), values of passed arguments (__lo, __hi and __to)
++// are completely messed up and don't correspond to passed values. In case if
++// we disable optimization for those methods, things become correct so we apply
++// this workaround here for a time.
++// TODO: figure out what exactly wrong here - is it bug in GCC optimization
++// algorithm or smth else?
++#define __CRYSTAX_X86_DONT_OPTIMIZE __attribute__((optimize(0)))
++#else
++#define __CRYSTAX_X86_DONT_OPTIMIZE
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -1102,7 +1116,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ * @return @a __hi.
+ */
+ virtual const char*
+- do_widen(const char* __lo, const char* __hi, char_type* __to) const
++ do_widen(const char* __lo, const char* __hi, char_type* __to) const __CRYSTAX_X86_DONT_OPTIMIZE
+ {
+ __builtin_memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+@@ -1163,7 +1177,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ private:
+ void _M_narrow_init() const;
+- void _M_widen_init() const;
++ void _M_widen_init() const __CRYSTAX_X86_DONT_OPTIMIZE;
+ };
+
+ #ifdef _GLIBCXX_USE_WCHAR_T
+diff --git a/libstdc++-v3/libsupc++/guard.cc b/libstdc++-v3/libsupc++/guard.cc
+index 9b617998f..c149169bb 100644
+--- a/libstdc++-v3/libsupc++/guard.cc
++++ b/libstdc++-v3/libsupc++/guard.cc
+@@ -33,7 +33,12 @@
+ #if defined(__GTHREADS) && defined(__GTHREAD_HAS_COND) \
+ && (ATOMIC_INT_LOCK_FREE > 1) && defined(_GLIBCXX_HAVE_LINUX_FUTEX)
+ # include <climits>
++#if defined(__ANDROID__)
++# include <sys/syscall.h>
++# define SYS_futex __NR_futex
++#else
+ # include <syscall.h>
++#endif
+ # include <unistd.h>
+ # define _GLIBCXX_USE_FUTEX
+ # define _GLIBCXX_FUTEX_WAIT 0
diff --git a/patches/gcc/linaro-6.3-2017.05/971-crystax.patch b/patches/gcc/linaro-6.3-2017.05/971-crystax.patch
new file mode 100644
index 0000000..748a381
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/971-crystax.patch
@@ -0,0 +1,25 @@
+commit 9f057b62caafe08c968103d39b5df82486a175c2
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Thu Aug 13 16:11:54 2015 +0300
+
+ [android] Add additional multilib option: mfloat-abi=hard
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/arm/t-linux-androideabi b/gcc/config/arm/t-linux-androideabi
+index 8f1307c55..cbbec5bd2 100644
+--- a/gcc/config/arm/t-linux-androideabi
++++ b/gcc/config/arm/t-linux-androideabi
+@@ -1,8 +1,9 @@
+-MULTILIB_OPTIONS = march=armv7-a mthumb
+-MULTILIB_DIRNAMES = armv7-a thumb
+-MULTILIB_EXCEPTIONS =
++MULTILIB_OPTIONS = march=armv7-a mthumb mfloat-abi=hard
++MULTILIB_DIRNAMES = armv7-a thumb hard
++MULTILIB_EXCEPTIONS = mfloat-abi=hard* mthumb/mfloat-abi=hard*
+ MULTILIB_MATCHES =
+ MULTILIB_OSDIRNAMES =
++MULTILIB_EXTRA_OPTS = Wl,--no-warn-mismatch
+
+ # The "special" multilib can be used to build native applications for Android,
+ # as opposed to native shared libraries that are then called via JNI.
diff --git a/patches/gcc/linaro-6.3-2017.05/972-crystax.patch b/patches/gcc/linaro-6.3-2017.05/972-crystax.patch
new file mode 100644
index 0000000..b9077be
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/972-crystax.patch
@@ -0,0 +1,302 @@
+commit 44a81ebb7698dac41ffa7acd5e0cc1578e5ab1fd
+Author: H.J. Lu <hongjiu.lu@intel.com>
+Date: Mon Apr 14 15:59:47 2014 -0700
+
+ [android] Always enable --eh-frame-hdr for static executable
+
+ See 5e6cdf76af295c9a39b695ca228cff675e8ff4ae and
+ 23e3137ee2897464b051599b85a09f130d3ad05d
+
+ Change-Id: Ibda473188e5a10f2a0592f2494ad00ad1f91e04b
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config.in b/gcc/config.in
+index 115cb6163..933916833 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -2119,6 +2119,12 @@
+ #endif
+
+
++/* Define if your system supports PT_GNU_EH_FRAME for static executable. */
++#ifndef USED_FOR_TARGET
++#undef USE_EH_FRAME_HDR_FOR_STATIC
++#endif
++
++
+ /* Define to 1 if the 'long long' type is wider than 'long' but still
+ efficiently supported by the host hardware. */
+ #ifndef USED_FOR_TARGET
+diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
+index 093c38bba..54b3e0c91 100644
+--- a/gcc/config/alpha/elf.h
++++ b/gcc/config/alpha/elf.h
+@@ -168,5 +168,9 @@ extern int alpha_this_gpdisp_sequence_number;
+ I imagine that other systems will catch up. In the meantime, it
+ doesn't harm to make sure that the data exists to be used later. */
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+diff --git a/gcc/config/freebsd.h b/gcc/config/freebsd.h
+index 5ded869d2..5f51ac81d 100644
+--- a/gcc/config/freebsd.h
++++ b/gcc/config/freebsd.h
+@@ -45,8 +45,12 @@ along with GCC; see the file COPYING3. If not see
+ #define LIB_SPEC FBSD_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+diff --git a/gcc/config/gnu-user.h b/gcc/config/gnu-user.h
+index b0bf40a95..d1874bc29 100644
+--- a/gcc/config/gnu-user.h
++++ b/gcc/config/gnu-user.h
+@@ -118,8 +118,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #undef LINK_GCC_C_SEQUENCE_SPEC
+ #define LINK_GCC_C_SEQUENCE_SPEC \
+diff --git a/gcc/config/openbsd.h b/gcc/config/openbsd.h
+index 37ecfc43f..a5f1b9955 100644
+--- a/gcc/config/openbsd.h
++++ b/gcc/config/openbsd.h
+@@ -136,8 +136,12 @@ while (0)
+ #define LIB_SPEC OBSD_LIB_SPEC
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #undef LIB_SPEC
+ #define LIB_SPEC OBSD_LIB_SPEC
+diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
+index cbf909722..eb2217fad 100644
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -789,7 +789,11 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEFAULT_ASM_ENDIAN)
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++# ifdef USE_EH_FRAME_HDR_FOR_STATIC
++# define LINK_EH_SPEC "--eh-frame-hdr "
++# else
++# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++# endif
+ #endif
+
+ #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
+diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
+index 5160e1fda..7632a5081 100644
+--- a/gcc/config/sol2.h
++++ b/gcc/config/sol2.h
+@@ -347,7 +347,11 @@ along with GCC; see the file COPYING3. If not see
+ /* Solaris 11 build 135+ implements dl_iterate_phdr. GNU ld needs
+ --eh-frame-hdr to create the required .eh_frame_hdr sections. */
+ #if defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
++#ifdef USE_EH_FRAME_HDR_FOR_STATIC
++#define LINK_EH_SPEC "--eh-frame-hdr "
++#else
+ #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
++#endif
+ #endif /* HAVE_LD_EH_FRAME && TARGET_DL_ITERATE_PHDR */
+ #endif
+
+diff --git a/gcc/configure b/gcc/configure
+index 1c6e3407c..28ad05004 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -934,6 +934,7 @@ enable_fix_cortex_a53_835769
+ enable_fix_cortex_a53_843419
+ with_glibc_version
+ enable_gnu_unique_object
++enable_eh_frame_hdr_for_static
+ enable_linker_build_id
+ enable_default_ssp
+ with_long_double_128
+@@ -1670,6 +1671,9 @@ Optional Features:
+ --enable-gnu-unique-object
+ enable the use of the @gnu_unique_object ELF
+ extension on glibc systems
++ --enable-eh-frame-hdr-for-static
++ enable linker PT_GNU_EH_FRAME support for static
++ executable
+ --enable-linker-build-id
+ compiler will always pass --build-id to linker
+ --enable-default-ssp enable Stack Smashing Protection as default
+@@ -27703,6 +27707,38 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+
+ $as_echo "#define HAVE_LD_EH_FRAME_HDR 1" >>confdefs.h
+
++ # Check whether --enable-eh-frame-hdr-for-static was given.
++if test "${enable_eh_frame_hdr_for_static+set}" = set; then :
++ enableval=$enable_eh_frame_hdr_for_static; case $enable_eh_frame_hdr_for_static in
++ yes | no) ;;
++ *) as_fn_error "'$enable_eh_frame_hdr_for_static' is an invalid
++value for --enable-eh-frame-hdr-for-static.
++Valid choices are 'yes' and 'no'." "$LINENO" 5 ;;
++ esac
++else
++ # Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from
++# Linux kernel.
++ if test x$host = x$build -a x$host = x$target &&
++ ldd --version 2>&1 >/dev/null &&
++ glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
++ glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
++ glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
++ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
++ if test "$glibcnum" -ge 2003 ; then
++ auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null`
++ if echo "$auvx" | grep AT_PHDR > /dev/null &&
++ echo "$auvx" | grep AT_PHNUM > /dev/null; then
++ enable_eh_frame_hdr_for_static=yes
++ fi
++ fi
++ fi
++fi
++
++ if test x$enable_eh_frame_hdr_for_static = xyes; then
++
++$as_echo "#define USE_EH_FRAME_HDR_FOR_STATIC 1" >>confdefs.h
++
++ fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_hdr" >&5
+ $as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; }
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 6c1dcd9ae..0cf7419e7 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4828,6 +4828,35 @@ GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HDR])
+ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+ AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1,
+ [Define if your linker supports .eh_frame_hdr.])
++ AC_ARG_ENABLE(eh-frame-hdr-for-static,
++ [AS_HELP_STRING([--enable-eh-frame-hdr-for-static],
++ [enable linker PT_GNU_EH_FRAME support for static executable])],
++ [case $enable_eh_frame_hdr_for_static in
++ yes | no) ;;
++ *) AC_MSG_ERROR(['$enable_eh_frame_hdr_for_static' is an invalid
++value for --enable-eh-frame-hdr-for-static.
++Valid choices are 'yes' and 'no'.]) ;;
++ esac],
++# Only support for glibc 2.3.0 or higher with AT_PHDR/AT_PHNUM from
++# Linux kernel.
++ [[if test x$host = x$build -a x$host = x$target &&
++ ldd --version 2>&1 >/dev/null &&
++ glibcver=`ldd --version 2>/dev/null | sed 's/.* //;q'`; then
++ glibcmajor=`expr "$glibcver" : "\([0-9]*\)"`
++ glibcminor=`expr "$glibcver" : "[2-9]*\.\([0-9]*\)"`
++ glibcnum=`expr $glibcmajor \* 1000 + $glibcminor`
++ if test "$glibcnum" -ge 2003 ; then
++ auvx=`LD_SHOW_AUXV=1 ldd 2>/dev/null`
++ if echo "$auvx" | grep AT_PHDR > /dev/null &&
++ echo "$auvx" | grep AT_PHNUM > /dev/null; then
++ enable_eh_frame_hdr_for_static=yes
++ fi
++ fi
++ fi]])
++ if test x$enable_eh_frame_hdr_for_static = xyes; then
++ AC_DEFINE(USE_EH_FRAME_HDR_FOR_STATIC, 1,
++[Define if your system supports PT_GNU_EH_FRAME for static executable.])
++ fi
+ fi
+ AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
+
+diff --git a/gcc/testsuite/g++.dg/eh/spec3-static.C b/gcc/testsuite/g++.dg/eh/spec3-static.C
+new file mode 100644
+index 000000000..15408effa
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/eh/spec3-static.C
+@@ -0,0 +1,25 @@
++// PR c++/4381
++// Test that exception-specs work properly for classes with virtual bases.
++
++// { dg-do run }
++// { dg-options "-static" }
++
++class Base {};
++
++struct A : virtual public Base
++{
++ A() {}
++};
++
++struct B {};
++
++void func() throw (B,A)
++{
++ throw A();
++}
++
++int main(void)
++{
++ try { func(); }
++ catch (A& a) { }
++}
+diff --git a/libgcc/crtstuff.c b/libgcc/crtstuff.c
+index f3343fc4f..d42647779 100644
+--- a/libgcc/crtstuff.c
++++ b/libgcc/crtstuff.c
+@@ -88,7 +88,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(BSD_DL_ITERATE_PHDR_AVAILABLE)
+ #include <link.h>
+ # define USE_PT_GNU_EH_FRAME
+@@ -97,7 +98,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(__sun__) && defined(__svr4__)
+ #include <link.h>
+ # define USE_PT_GNU_EH_FRAME
+@@ -106,7 +108,8 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
++ && !defined(inhibit_libc) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(__GLIBC__) && __GLIBC__ >= 2
+ #include <link.h>
+ /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+@@ -121,7 +124,7 @@ call_ ## FUNC (void) \
+ #if defined(OBJECT_FORMAT_ELF) \
+ && !defined(OBJECT_FORMAT_FLAT) \
+ && defined(HAVE_LD_EH_FRAME_HDR) \
+- && !defined(CRTSTUFFT_O) \
++ && (defined(USE_EH_FRAME_HDR_FOR_STATIC) || !defined(CRTSTUFFT_O)) \
+ && defined(inhibit_libc) \
+ && (defined(__GLIBC__) || defined(__gnu_linux__) || defined(__GNU__))
+ /* On systems using glibc, an inhibit_libc build of libgcc is only
diff --git a/patches/gcc/linaro-6.3-2017.05/973-crystax.patch b/patches/gcc/linaro-6.3-2017.05/973-crystax.patch
new file mode 100644
index 0000000..b96ece3
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/973-crystax.patch
@@ -0,0 +1,20 @@
+commit 778a9ef107f51544d583f110e92b75f4d9d79117
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Thu Aug 20 19:11:07 2015 +0300
+
+ [android] Don't use PIE copyrelocs for x86/x86_64
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
+index 3d044e8bd..5c89fcab0 100644
+--- a/gcc/config/i386/i386.c
++++ b/gcc/config/i386/i386.c
+@@ -14631,6 +14631,7 @@ legitimate_pic_address_disp_p (rtx disp)
+ else if (!SYMBOL_REF_FAR_ADDR_P (op0)
+ && (SYMBOL_REF_LOCAL_P (op0)
+ || (HAVE_LD_PIE_COPYRELOC
++ && !TARGET_HAS_BIONIC
+ && flag_pie
+ && !SYMBOL_REF_WEAK (op0)
+ && !SYMBOL_REF_FUNCTION_P (op0)))
diff --git a/patches/gcc/linaro-6.3-2017.05/974-crystax.patch b/patches/gcc/linaro-6.3-2017.05/974-crystax.patch
new file mode 100644
index 0000000..9db4f54
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/974-crystax.patch
@@ -0,0 +1,24 @@
+commit dbeae1190cabad83999f2540523f045acc1bb4ec
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Fri Aug 21 17:41:59 2015 +0300
+
+ [android] Always use gthr-posix.h instead of gthr-default.h
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/libgcc/gthr.h b/libgcc/gthr.h
+index 47a7d061a..67a680f90 100644
+--- a/libgcc/gthr.h
++++ b/libgcc/gthr.h
+@@ -145,7 +145,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define GTHREAD_USE_WEAK 1
+ #endif
+ #endif
++#if __ANDROID__
++#include "gthr-posix.h"
++#else
+ #include "gthr-default.h"
++#endif
+
+ #ifndef HIDE_EXPORTS
+ #pragma GCC visibility pop
diff --git a/patches/gcc/linaro-6.3-2017.05/975-crystax.patch b/patches/gcc/linaro-6.3-2017.05/975-crystax.patch
new file mode 100644
index 0000000..9efc2a4
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/975-crystax.patch
@@ -0,0 +1,31 @@
+commit 8a66d422721ae5999737d7825701ff22097d287b
+Author: Andrew Hsieh <andrewhsieh@google.com>
+Date: Mon Apr 14 21:05:51 2014 -0700
+
+ [android] Fix ARM generates insufficient alignment for NEON vst/vld
+
+ See d909af3e2469aad87d5c3e79b93c778fd26c03a9
+
+ Change-Id: Ie1de9f946f397196bb6f1623f5add86933739484
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
+index 5974c65d3..71b2c7aa9 100644
+--- a/gcc/config/arm/arm.c
++++ b/gcc/config/arm/arm.c
+@@ -22403,9 +22403,13 @@ arm_print_operand (FILE *stream, rtx x, int code)
+ memsize = MEM_SIZE (x);
+
+ /* Only certain alignment specifiers are supported by the hardware. */
+- if (memsize == 32 && (align % 32) == 0)
++ /* Note that ARM EABI only guarentees 8-byte stack alignment. While GCC
++ honors stricter alignment of composite type in user code, it doesn't
++ observe the alignment of memory passed as an extra argument for function
++ returning large composite type. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57271 */
++ if (memsize == 32 && (align % 32) == 0 && !TARGET_AAPCS_BASED)
+ align_bits = 256;
+- else if ((memsize == 16 || memsize == 32) && (align % 16) == 0)
++ else if ((memsize == 16 || memsize == 32) && (align % 16) == 0 && !TARGET_AAPCS_BASED)
+ align_bits = 128;
+ else if (memsize >= 8 && (align % 8) == 0)
+ align_bits = 64;
diff --git a/patches/gcc/linaro-6.3-2017.05/976-crystax.patch b/patches/gcc/linaro-6.3-2017.05/976-crystax.patch
new file mode 100644
index 0000000..790d4a9
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/976-crystax.patch
@@ -0,0 +1,21 @@
+commit 89d27bc45ee7325dcfff6748da0f8b9c1dc1f234
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Sat Aug 22 09:55:55 2015 +0300
+
+ [android][i386] Remove throw() declaration from posix_memalign() proto
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/i386/pmm_malloc.h b/gcc/config/i386/pmm_malloc.h
+index a1f98d3d1..3725799be 100644
+--- a/gcc/config/i386/pmm_malloc.h
++++ b/gcc/config/i386/pmm_malloc.h
+@@ -31,7 +31,7 @@
+ #ifndef __cplusplus
+ extern int posix_memalign (void **, size_t, size_t);
+ #else
+-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
++extern "C" int posix_memalign (void **, size_t, size_t);
+ #endif
+
+ static __inline void *
diff --git a/patches/gcc/linaro-6.3-2017.05/977-crystax.patch b/patches/gcc/linaro-6.3-2017.05/977-crystax.patch
new file mode 100644
index 0000000..0211d72
--- /dev/null
+++ b/patches/gcc/linaro-6.3-2017.05/977-crystax.patch
@@ -0,0 +1,33 @@
+commit 9ae82f7cfc1073820092dd9f957559667e77db0d
+Author: Dmitry Moskalchuk <dm@crystax.net>
+Date: Tue Aug 25 09:36:42 2015 +0300
+
+ [android] Explicitly make _Unwind_Resume visible for arm64/mips64
+
+ Signed-off-by: Dmitry Moskalchuk <dm@crystax.net>
+
+diff --git a/gcc/config/aarch64/aarch64-linux-android.h b/gcc/config/aarch64/aarch64-linux-android.h
+index db1288fd0..38bc64d61 100644
+--- a/gcc/config/aarch64/aarch64-linux-android.h
++++ b/gcc/config/aarch64/aarch64-linux-android.h
+@@ -57,4 +57,8 @@
+ #define ENDFILE_SPEC \
+ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+
++#ifdef IN_LIBGCC2
++#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((visibility("default")))
++#endif
++
+ #endif /* GCC_AARCH64_LINUX_ANDROID_H */
+diff --git a/gcc/config/mips/linux-common.h b/gcc/config/mips/linux-common.h
+index 8bfacf994..262a9a341 100644
+--- a/gcc/config/mips/linux-common.h
++++ b/gcc/config/mips/linux-common.h
+@@ -63,3 +63,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* The default value isn't sufficient in 64-bit mode. */
+ #define STACK_CHECK_PROTECT (TARGET_64BIT ? 16 * 1024 : 12 * 1024)
++
++#ifdef IN_LIBGCC2
++#define LIBGCC2_UNWIND_ATTRIBUTE __attribute__((visibility("default")))
++#endif
diff --git a/patches/gdb/7.12.1/200-allow-android.patch b/patches/gdb/7.12.1/200-allow-android.patch
new file mode 100644
index 0000000..7954477
--- /dev/null
+++ b/patches/gdb/7.12.1/200-allow-android.patch
@@ -0,0 +1,42 @@
+diff -urpN gdb-7.12.1.orig/gdb/gdbserver/configure gdb-7.12.1/gdb/gdbserver/configure
+--- gdb-7.12.1.orig/gdb/gdbserver/configure 2017-05-14 17:02:46.742711695 -0700
++++ gdb-7.12.1/gdb/gdbserver/configure 2017-05-14 17:03:22.147058607 -0700
+@@ -6671,17 +6671,6 @@ fi
+
+
+ case "${target}" in
+- *-android*)
+- # Starting with NDK version 9, <elf.h> actually includes definitions
+- # of Elf32_auxv_t and Elf64_auxv_t. But sadly, <elf.h> includes
+- # <sys/exec_elf.h> which defines some of the ELF types incorrectly,
+- # leading to conflicts with the defintions from <linux/elf.h>.
+- # This makes it impossible for us to include both <elf.h> and
+- # <linux/elf.h>, which means that, in practice, we do not have
+- # access to Elf32_auxv_t and Elf64_auxv_t on this platform.
+- # Therefore, do not try to auto-detect availability, as it would
+- # get it wrong on this platform.
+- ;;
+ *)
+ ac_fn_c_check_type "$LINENO" "Elf32_auxv_t" "ac_cv_type_Elf32_auxv_t" "#include <elf.h>
+
+diff -urpN gdb-7.12.1.orig/gdb/gdbserver/configure.ac gdb-7.12.1/gdb/gdbserver/configure.ac
+--- gdb-7.12.1.orig/gdb/gdbserver/configure.ac 2017-05-14 17:02:46.742711695 -0700
++++ gdb-7.12.1/gdb/gdbserver/configure.ac 2017-05-14 17:03:53.219361720 -0700
+@@ -179,17 +179,6 @@ AC_CHECK_TYPES(socklen_t, [], [],
+ ])
+
+ case "${target}" in
+- *-android*)
+- # Starting with NDK version 9, <elf.h> actually includes definitions
+- # of Elf32_auxv_t and Elf64_auxv_t. But sadly, <elf.h> includes
+- # <sys/exec_elf.h> which defines some of the ELF types incorrectly,
+- # leading to conflicts with the defintions from <linux/elf.h>.
+- # This makes it impossible for us to include both <elf.h> and
+- # <linux/elf.h>, which means that, in practice, we do not have
+- # access to Elf32_auxv_t and Elf64_auxv_t on this platform.
+- # Therefore, do not try to auto-detect availability, as it would
+- # get it wrong on this platform.
+- ;;
+ *)
+ AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [],
+ #include <elf.h>
diff --git a/patches/gdb/8.0/100-musl_fix.patch b/patches/gdb/8.0/100-musl_fix.patch
new file mode 100644
index 0000000..c0c1e0a
--- /dev/null
+++ b/patches/gdb/8.0/100-musl_fix.patch
@@ -0,0 +1,28 @@
+--- a/gdb/linux-nat.c
++++ b/gdb/linux-nat.c
+@@ -17,6 +17,7 @@
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
++#include "stopcode.h"
+ #include "defs.h"
+ #include "inferior.h"
+ #include "infrun.h"
+@@ -73,6 +74,10 @@
+ #define SPUFS_MAGIC 0x23c9b64e
+ #endif
+
++#ifndef __SIGRTMIN
++#define __SIGRTMIN SIGRTMIN
++#endif
++
+ /* This comment documents high-level logic of this file.
+
+ Waiting for events in sync mode
+--- /dev/null
++++ b/gdb/stopcode.h
+@@ -0,0 +1,4 @@
++#ifndef W_STOPCODE
++#define W_STOPCODE(sig) ((sig) << 8 | 0x7f)
++#endif
++
diff --git a/patches/gdb/8.0/101-uclibc-no-gettimeofday-clobber.patch b/patches/gdb/8.0/101-uclibc-no-gettimeofday-clobber.patch
new file mode 100644
index 0000000..cd7a4c6
--- /dev/null
+++ b/patches/gdb/8.0/101-uclibc-no-gettimeofday-clobber.patch
@@ -0,0 +1,30 @@
+Improve gnulib in gdb's guess work, gettimeofday() works in uClibcm promise.
+
+This patch helps building x86_64-unknown-linux-uclibc toolchains, the final
+gdb-native step otherwise fails when linking the libinproctrace.so
+
+Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
+Signed-off-by: Alexey Neyman <stilor@att.net>
+
+diff -urpN gdb-7.12.orig/gdb/gnulib/configure gdb-7.12/gdb/gnulib/configure
+--- gdb-7.12.orig/gdb/gnulib/configure 2017-01-13 13:42:11.773027566 -0800
++++ gdb-7.12/gdb/gnulib/configure 2017-01-13 13:44:32.518082618 -0800
+@@ -13522,6 +13522,7 @@ else
+ case "$host_os" in
+ # Guess all is fine on glibc systems.
+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
++ *-uclibc*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ esac
+diff -urpN gdb-7.12.orig/gdb/gnulib/import/m4/gettimeofday.m4 gdb-7.12/gdb/gnulib/import/m4/gettimeofday.m4
+--- gdb-7.12.orig/gdb/gnulib/import/m4/gettimeofday.m4 2017-01-13 13:42:11.777027595 -0800
++++ gdb-7.12/gdb/gnulib/import/m4/gettimeofday.m4 2017-01-13 13:43:55.781797640 -0800
+@@ -111,6 +111,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
+ case "$host_os" in
+ # Guess all is fine on glibc systems.
+ *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
++ *-uclibc*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
+ # If we don't know, assume the worst.
+ *) gl_cv_func_gettimeofday_clobber="guessing yes" ;;
+ esac
diff --git a/patches/gdb/8.0/111-xtensa-make-sure-ar_base-is-initialized.patch b/patches/gdb/8.0/111-xtensa-make-sure-ar_base-is-initialized.patch
new file mode 100644
index 0000000..982bd7f
--- /dev/null
+++ b/patches/gdb/8.0/111-xtensa-make-sure-ar_base-is-initialized.patch
@@ -0,0 +1,35 @@
+From 208ea73d38c9c16cf983b6419f58050dbadcb6a9 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 7 Jun 2015 22:43:49 +0300
+Subject: [PATCH 2/2] xtensa: make sure ar_base is initialized
+
+ar_base is uninitialized for cores w/o windowed registers as their
+regmap doesn't have register 0x0100.
+Check that ar_base is initialized and if not initialize it with a0_base.
+
+gdb/
+ * xtensa-tdep.c (xtensa_derive_tdep): Make sure ar_base is
+ initialized.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gdb/xtensa-tdep.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
+index 55e7d98..41f5ec1 100644
+--- a/gdb/xtensa-tdep.c
++++ b/gdb/xtensa-tdep.c
+@@ -3175,6 +3175,9 @@ xtensa_derive_tdep (struct gdbarch_tdep *tdep)
+ tdep->num_regs = n;
+ }
+
++ if (tdep->ar_base == -1)
++ tdep->ar_base = tdep->a0_base;
++
+ /* Number of pseudo registers. */
+ tdep->num_pseudo_regs = n - tdep->num_regs;
+
+--
+1.8.1.4
+
diff --git a/patches/gdb/8.0/112-WIP-end-of-prologue-detection-hack.patch b/patches/gdb/8.0/112-WIP-end-of-prologue-detection-hack.patch
new file mode 100644
index 0000000..506a57c
--- /dev/null
+++ b/patches/gdb/8.0/112-WIP-end-of-prologue-detection-hack.patch
@@ -0,0 +1,31 @@
+From 7f8eacbb468575fb67db7fd1155a3aedaa91911b Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 7 Jun 2015 23:15:39 +0300
+Subject: [PATCH] WIP: *end of prologue* detection hack
+
+see
+ http://www.esp8266.com/viewtopic.php?p=18461#p18461
+ http://www.esp8266.com/viewtopic.php?p=19026#p19026
+ http://www.esp8266.com/viewtopic.php?p=19683#p19683
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gdb/xtensa-tdep.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
+index 41f5ec1..6a7dba7 100644
+--- a/gdb/xtensa-tdep.c
++++ b/gdb/xtensa-tdep.c
+@@ -2410,7 +2410,7 @@ call0_analyze_prologue (struct gdbarch *gdbarch,
+ /* Find out, if we have an information about the prologue from DWARF. */
+ prologue_sal = find_pc_line (start, 0);
+ if (prologue_sal.line != 0) /* Found debug info. */
+- body_pc = prologue_sal.end;
++ body_pc = prologue_sal.end + 40;
+
+ /* If we are going to analyze the prologue in general without knowing about
+ the current PC, make the best assumtion for the end of the prologue. */
+--
+1.8.1.4
+
diff --git a/patches/gdb/8.0/200-allow-android.patch b/patches/gdb/8.0/200-allow-android.patch
new file mode 100644
index 0000000..7954477
--- /dev/null
+++ b/patches/gdb/8.0/200-allow-android.patch
@@ -0,0 +1,42 @@
+diff -urpN gdb-7.12.1.orig/gdb/gdbserver/configure gdb-7.12.1/gdb/gdbserver/configure
+--- gdb-7.12.1.orig/gdb/gdbserver/configure 2017-05-14 17:02:46.742711695 -0700
++++ gdb-7.12.1/gdb/gdbserver/configure 2017-05-14 17:03:22.147058607 -0700
+@@ -6671,17 +6671,6 @@ fi
+
+
+ case "${target}" in
+- *-android*)
+- # Starting with NDK version 9, <elf.h> actually includes definitions
+- # of Elf32_auxv_t and Elf64_auxv_t. But sadly, <elf.h> includes
+- # <sys/exec_elf.h> which defines some of the ELF types incorrectly,
+- # leading to conflicts with the defintions from <linux/elf.h>.
+- # This makes it impossible for us to include both <elf.h> and
+- # <linux/elf.h>, which means that, in practice, we do not have
+- # access to Elf32_auxv_t and Elf64_auxv_t on this platform.
+- # Therefore, do not try to auto-detect availability, as it would
+- # get it wrong on this platform.
+- ;;
+ *)
+ ac_fn_c_check_type "$LINENO" "Elf32_auxv_t" "ac_cv_type_Elf32_auxv_t" "#include <elf.h>
+
+diff -urpN gdb-7.12.1.orig/gdb/gdbserver/configure.ac gdb-7.12.1/gdb/gdbserver/configure.ac
+--- gdb-7.12.1.orig/gdb/gdbserver/configure.ac 2017-05-14 17:02:46.742711695 -0700
++++ gdb-7.12.1/gdb/gdbserver/configure.ac 2017-05-14 17:03:53.219361720 -0700
+@@ -179,17 +179,6 @@ AC_CHECK_TYPES(socklen_t, [], [],
+ ])
+
+ case "${target}" in
+- *-android*)
+- # Starting with NDK version 9, <elf.h> actually includes definitions
+- # of Elf32_auxv_t and Elf64_auxv_t. But sadly, <elf.h> includes
+- # <sys/exec_elf.h> which defines some of the ELF types incorrectly,
+- # leading to conflicts with the defintions from <linux/elf.h>.
+- # This makes it impossible for us to include both <elf.h> and
+- # <linux/elf.h>, which means that, in practice, we do not have
+- # access to Elf32_auxv_t and Elf64_auxv_t on this platform.
+- # Therefore, do not try to auto-detect availability, as it would
+- # get it wrong on this platform.
+- ;;
+ *)
+ AC_CHECK_TYPES([Elf32_auxv_t, Elf64_auxv_t], [], [],
+ #include <elf.h>
diff --git a/patches/glibc/2.12.1/920-fix-rpc_parse-format.patch b/patches/glibc/2.12.1/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.12.1/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.12.1/940-nis-bogus-conditional.patch b/patches/glibc/2.12.1/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.12.1/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.12.2/920-fix-rpc_parse-format.patch b/patches/glibc/2.12.2/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.12.2/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.12.2/940-nis-bogus-conditional.patch b/patches/glibc/2.12.2/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.12.2/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.13/920-fix-rpc_parse-format.patch b/patches/glibc/2.13/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.13/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.13/940-nis-bogus-conditional.patch b/patches/glibc/2.13/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.13/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.14.1/920-fix-rpc_parse-format.patch b/patches/glibc/2.14.1/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.14.1/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.14.1/940-nis-bogus-conditional.patch b/patches/glibc/2.14.1/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.14.1/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.14/920-fix-rpc_parse-format.patch b/patches/glibc/2.14/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.14/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.14/940-nis-bogus-conditional.patch b/patches/glibc/2.14/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.14/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.15/920-fix-rpc_parse-format.patch b/patches/glibc/2.15/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.15/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.15/940-nis-bogus-conditional.patch b/patches/glibc/2.15/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.15/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.16.0/920-fix-rpc_parse-format.patch b/patches/glibc/2.16.0/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.16.0/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.16.0/940-nis-bogus-conditional.patch b/patches/glibc/2.16.0/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.16.0/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.17/920-fix-rpc_parse-format.patch b/patches/glibc/2.17/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.17/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.17/940-nis-bogus-conditional.patch b/patches/glibc/2.17/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.17/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.18/920-fix-rpc_parse-format.patch b/patches/glibc/2.18/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.18/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.18/940-nis-bogus-conditional.patch b/patches/glibc/2.18/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.18/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.19/920-fix-rpc_parse-format.patch b/patches/glibc/2.19/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.19/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.19/930-explicit-boolean.patch b/patches/glibc/2.19/930-explicit-boolean.patch
new file mode 100644
index 0000000..780fae6
--- /dev/null
+++ b/patches/glibc/2.19/930-explicit-boolean.patch
@@ -0,0 +1,33 @@
+commit e223d1fe72e820d96f43831412ab267a1ace04d0
+Author: steve ellcey-CA Eng-Software <sellcey@sellcey-thinkpad.caveonetworks.com>
+Date: Fri Oct 14 12:53:27 2016 -0700
+
+ Fix warnings from latest GCC.
+
+ * sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
+ boolean.
+
+diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
+index 663fa392c2..bd758b5979 100644
+--- a/sysdeps/ieee754/dbl-64/e_pow.c
++++ b/sysdeps/ieee754/dbl-64/e_pow.c
+@@ -466,15 +466,15 @@ checkint (double x)
+ return (n & 1) ? -1 : 1; /* odd or even */
+ if (k > 20)
+ {
+- if (n << (k - 20))
++ if (n << (k - 20) != 0)
+ return 0; /* if not integer */
+- return (n << (k - 21)) ? -1 : 1;
++ return (n << (k - 21) != 0) ? -1 : 1;
+ }
+ if (n)
+ return 0; /*if not integer */
+ if (k == 20)
+ return (m & 1) ? -1 : 1;
+- if (m << (k + 12))
++ if (m << (k + 12) != 0)
+ return 0;
+- return (m << (k + 11)) ? -1 : 1;
++ return (m << (k + 11) != 0) ? -1 : 1;
+ }
diff --git a/patches/glibc/2.19/940-nis-bogus-conditional.patch b/patches/glibc/2.19/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.19/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.20/920-fix-rpc_parse-format.patch b/patches/glibc/2.20/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.20/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.20/930-explicit-boolean.patch b/patches/glibc/2.20/930-explicit-boolean.patch
new file mode 100644
index 0000000..780fae6
--- /dev/null
+++ b/patches/glibc/2.20/930-explicit-boolean.patch
@@ -0,0 +1,33 @@
+commit e223d1fe72e820d96f43831412ab267a1ace04d0
+Author: steve ellcey-CA Eng-Software <sellcey@sellcey-thinkpad.caveonetworks.com>
+Date: Fri Oct 14 12:53:27 2016 -0700
+
+ Fix warnings from latest GCC.
+
+ * sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
+ boolean.
+
+diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
+index 663fa392c2..bd758b5979 100644
+--- a/sysdeps/ieee754/dbl-64/e_pow.c
++++ b/sysdeps/ieee754/dbl-64/e_pow.c
+@@ -466,15 +466,15 @@ checkint (double x)
+ return (n & 1) ? -1 : 1; /* odd or even */
+ if (k > 20)
+ {
+- if (n << (k - 20))
++ if (n << (k - 20) != 0)
+ return 0; /* if not integer */
+- return (n << (k - 21)) ? -1 : 1;
++ return (n << (k - 21) != 0) ? -1 : 1;
+ }
+ if (n)
+ return 0; /*if not integer */
+ if (k == 20)
+ return (m & 1) ? -1 : 1;
+- if (m << (k + 12))
++ if (m << (k + 12) != 0)
+ return 0;
+- return (m << (k + 11)) ? -1 : 1;
++ return (m << (k + 11) != 0) ? -1 : 1;
+ }
diff --git a/patches/glibc/2.20/940-nis-bogus-conditional.patch b/patches/glibc/2.20/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.20/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.21/920-fix-rpc_parse-format.patch b/patches/glibc/2.21/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.21/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.21/930-explicit-boolean.patch b/patches/glibc/2.21/930-explicit-boolean.patch
new file mode 100644
index 0000000..780fae6
--- /dev/null
+++ b/patches/glibc/2.21/930-explicit-boolean.patch
@@ -0,0 +1,33 @@
+commit e223d1fe72e820d96f43831412ab267a1ace04d0
+Author: steve ellcey-CA Eng-Software <sellcey@sellcey-thinkpad.caveonetworks.com>
+Date: Fri Oct 14 12:53:27 2016 -0700
+
+ Fix warnings from latest GCC.
+
+ * sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
+ boolean.
+
+diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
+index 663fa392c2..bd758b5979 100644
+--- a/sysdeps/ieee754/dbl-64/e_pow.c
++++ b/sysdeps/ieee754/dbl-64/e_pow.c
+@@ -466,15 +466,15 @@ checkint (double x)
+ return (n & 1) ? -1 : 1; /* odd or even */
+ if (k > 20)
+ {
+- if (n << (k - 20))
++ if (n << (k - 20) != 0)
+ return 0; /* if not integer */
+- return (n << (k - 21)) ? -1 : 1;
++ return (n << (k - 21) != 0) ? -1 : 1;
+ }
+ if (n)
+ return 0; /*if not integer */
+ if (k == 20)
+ return (m & 1) ? -1 : 1;
+- if (m << (k + 12))
++ if (m << (k + 12) != 0)
+ return 0;
+- return (m << (k + 11)) ? -1 : 1;
++ return (m << (k + 11) != 0) ? -1 : 1;
+ }
diff --git a/patches/glibc/2.21/940-nis-bogus-conditional.patch b/patches/glibc/2.21/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.21/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.21/950-dlclose-assert.patch b/patches/glibc/2.21/950-dlclose-assert.patch
new file mode 100644
index 0000000..6e2fcff
--- /dev/null
+++ b/patches/glibc/2.21/950-dlclose-assert.patch
@@ -0,0 +1,40 @@
+commit 2bd2cad9e8a410643e80efa0b15f6f2882e1271b
+Author: Roland McGrath <roland@hack.frob.com>
+Date: Fri Apr 17 14:29:40 2015 -0700
+
+ Avoid confusing compiler with dynamically impossible statically invalid dereference in _dl_close_worker.
+
+diff --git a/elf/dl-close.c b/elf/dl-close.c
+index cf8f9e0465..412f71d70b 100644
+--- a/elf/dl-close.c
++++ b/elf/dl-close.c
+@@ -641,9 +641,16 @@ _dl_close_worker (struct link_map *map)
+ DL_UNMAP (imap);
+
+ /* Finally, unlink the data structure and free it. */
+- if (imap->l_prev != NULL)
+- imap->l_prev->l_next = imap->l_next;
+- else
++#if DL_NNS == 1
++ /* The assert in the (imap->l_prev == NULL) case gives
++ the compiler license to warn that NS points outside
++ the dl_ns array bounds in that case (as nsid != LM_ID_BASE
++ is tantamount to nsid >= DL_NNS). That should be impossible
++ in this configuration, so just assert about it instead. */
++ assert (nsid == LM_ID_BASE);
++ assert (imap->l_prev != NULL);
++#else
++ if (imap->l_prev == NULL)
+ {
+ assert (nsid != LM_ID_BASE);
+ ns->_ns_loaded = imap->l_next;
+@@ -652,6 +659,9 @@ _dl_close_worker (struct link_map *map)
+ we leave for debuggers to examine. */
+ r->r_map = (void *) ns->_ns_loaded;
+ }
++ else
++#endif
++ imap->l_prev->l_next = imap->l_next;
+
+ --ns->_ns_nloaded;
+ if (imap->l_next != NULL)
diff --git a/patches/glibc/2.22/920-fix-rpc_parse-format.patch b/patches/glibc/2.22/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.22/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.22/930-explicit-boolean.patch b/patches/glibc/2.22/930-explicit-boolean.patch
new file mode 100644
index 0000000..780fae6
--- /dev/null
+++ b/patches/glibc/2.22/930-explicit-boolean.patch
@@ -0,0 +1,33 @@
+commit e223d1fe72e820d96f43831412ab267a1ace04d0
+Author: steve ellcey-CA Eng-Software <sellcey@sellcey-thinkpad.caveonetworks.com>
+Date: Fri Oct 14 12:53:27 2016 -0700
+
+ Fix warnings from latest GCC.
+
+ * sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
+ boolean.
+
+diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
+index 663fa392c2..bd758b5979 100644
+--- a/sysdeps/ieee754/dbl-64/e_pow.c
++++ b/sysdeps/ieee754/dbl-64/e_pow.c
+@@ -466,15 +466,15 @@ checkint (double x)
+ return (n & 1) ? -1 : 1; /* odd or even */
+ if (k > 20)
+ {
+- if (n << (k - 20))
++ if (n << (k - 20) != 0)
+ return 0; /* if not integer */
+- return (n << (k - 21)) ? -1 : 1;
++ return (n << (k - 21) != 0) ? -1 : 1;
+ }
+ if (n)
+ return 0; /*if not integer */
+ if (k == 20)
+ return (m & 1) ? -1 : 1;
+- if (m << (k + 12))
++ if (m << (k + 12) != 0)
+ return 0;
+- return (m << (k + 11)) ? -1 : 1;
++ return (m << (k + 11) != 0) ? -1 : 1;
+ }
diff --git a/patches/glibc/2.22/940-nis-bogus-conditional.patch b/patches/glibc/2.22/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.22/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.23/920-fix-rpc_parse-format.patch b/patches/glibc/2.23/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.23/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.23/930-explicit-boolean.patch b/patches/glibc/2.23/930-explicit-boolean.patch
new file mode 100644
index 0000000..780fae6
--- /dev/null
+++ b/patches/glibc/2.23/930-explicit-boolean.patch
@@ -0,0 +1,33 @@
+commit e223d1fe72e820d96f43831412ab267a1ace04d0
+Author: steve ellcey-CA Eng-Software <sellcey@sellcey-thinkpad.caveonetworks.com>
+Date: Fri Oct 14 12:53:27 2016 -0700
+
+ Fix warnings from latest GCC.
+
+ * sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
+ boolean.
+
+diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
+index 663fa392c2..bd758b5979 100644
+--- a/sysdeps/ieee754/dbl-64/e_pow.c
++++ b/sysdeps/ieee754/dbl-64/e_pow.c
+@@ -466,15 +466,15 @@ checkint (double x)
+ return (n & 1) ? -1 : 1; /* odd or even */
+ if (k > 20)
+ {
+- if (n << (k - 20))
++ if (n << (k - 20) != 0)
+ return 0; /* if not integer */
+- return (n << (k - 21)) ? -1 : 1;
++ return (n << (k - 21) != 0) ? -1 : 1;
+ }
+ if (n)
+ return 0; /*if not integer */
+ if (k == 20)
+ return (m & 1) ? -1 : 1;
+- if (m << (k + 12))
++ if (m << (k + 12) != 0)
+ return 0;
+- return (m << (k + 11)) ? -1 : 1;
++ return (m << (k + 11) != 0) ? -1 : 1;
+ }
diff --git a/patches/glibc/2.23/940-nis-bogus-conditional.patch b/patches/glibc/2.23/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.23/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.24/920-fix-rpc_parse-format.patch b/patches/glibc/2.24/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/2.24/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/2.24/930-explicit-boolean.patch b/patches/glibc/2.24/930-explicit-boolean.patch
new file mode 100644
index 0000000..780fae6
--- /dev/null
+++ b/patches/glibc/2.24/930-explicit-boolean.patch
@@ -0,0 +1,33 @@
+commit e223d1fe72e820d96f43831412ab267a1ace04d0
+Author: steve ellcey-CA Eng-Software <sellcey@sellcey-thinkpad.caveonetworks.com>
+Date: Fri Oct 14 12:53:27 2016 -0700
+
+ Fix warnings from latest GCC.
+
+ * sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
+ boolean.
+
+diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
+index 663fa392c2..bd758b5979 100644
+--- a/sysdeps/ieee754/dbl-64/e_pow.c
++++ b/sysdeps/ieee754/dbl-64/e_pow.c
+@@ -466,15 +466,15 @@ checkint (double x)
+ return (n & 1) ? -1 : 1; /* odd or even */
+ if (k > 20)
+ {
+- if (n << (k - 20))
++ if (n << (k - 20) != 0)
+ return 0; /* if not integer */
+- return (n << (k - 21)) ? -1 : 1;
++ return (n << (k - 21) != 0) ? -1 : 1;
+ }
+ if (n)
+ return 0; /*if not integer */
+ if (k == 20)
+ return (m & 1) ? -1 : 1;
+- if (m << (k + 12))
++ if (m << (k + 12) != 0)
+ return 0;
+- return (m << (k + 11)) ? -1 : 1;
++ return (m << (k + 11) != 0) ? -1 : 1;
+ }
diff --git a/patches/glibc/2.24/940-nis-bogus-conditional.patch b/patches/glibc/2.24/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/2.24/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/glibc/2.25/960-sh4-trap-divdi3.patch b/patches/glibc/2.25/960-sh4-trap-divdi3.patch
new file mode 100644
index 0000000..99fad46
--- /dev/null
+++ b/patches/glibc/2.25/960-sh4-trap-divdi3.patch
@@ -0,0 +1,340 @@
+commit db3d848e154b00071f4a5e729d5884efad410109
+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Wed Mar 15 15:44:59 2017 -0300
+
+ Build divdi3 only for architecture that required it
+
+ As noted in [1], divdi3 object is only exported in a handful ABIs
+ (i386, m68k, powerpc32, s390-32, and ia64), however it is built
+ for all current architectures regardless.
+
+ This patch refact the make rules for this object to so only the
+ aforementioned architectures that actually require it builds it.
+
+ Also, to avoid internal PLT calls to the exported symbol from the
+ module, glibc uses an internal header (symbol-hacks.h) which is
+ unrequired (and in fact breaks the build for architectures that
+ intend to get symbol definitions from libgcc.a). The patch also
+ changes it to create its own header (divdi3-symbol-hacks.h) and
+ adjust the architectures that require it accordingly.
+
+ I checked the build/check (with run-built-tests=no) on the
+ following architectures (which I think must cover all supported
+ ABI/builds) using GCC 6.3:
+
+ aarch64-linux-gnu
+ alpha-linux-gnu
+ arm-linux-gnueabihf
+ hppa-linux-gnu
+ ia64-linux-gnu
+ m68k-linux-gnu
+ microblaze-linux-gnu
+ mips64-n32-linux-gnu
+ mips-linux-gnu
+ mips64-linux-gnu
+ nios2-linux-gnu
+ powerpc-linux-gnu
+ powerpc-linux-gnu-power4
+ powerpc64-linux-gnu
+ powerpc64le-linux-gnu
+ s390x-linux-gnu
+ s390-linux-gnu
+ sh4-linux-gnu
+ sh4-linux-gnu-soft
+ sparc64-linux-gnu
+ sparcv9-linux-gnu
+ tilegx-linux-gnu
+ tilegx-linux-gnu-32
+ tilepro-linux-gnu
+ x86_64-linux-gnu
+ x86_64-linux-gnu-x32
+ i686-linux-gnu
+
+ I only saw one regression on sparcv9-linux-gnu (extra PLT call to
+ .udiv) which I address in next patch in the set. It also correctly
+ build SH with GCC 7.0.1 (without any regression from c89721e25d).
+
+ [1] https://sourceware.org/ml/libc-alpha/2017-03/msg00243.html
+
+ * sysdeps/i386/symbol-hacks.h: New file.
+ * sysdeps/m68k/symbol-hacks.h: New file.
+ * sysdeps/powerpc/powerpc32/symbol-hacks.h: New file.
+ * sysdeps/s390/s390-32/symbol-hacks.h: New file.
+ * sysdeps/unix/sysv/linux/i386/Makefile
+ [$(subdir) = csu] (sysdep_routines): New rule: divdi3 object.
+ [$(subdir) = csu] (sysdep-only-routines): Likewise.
+ [$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
+ * sysdeps/unix/sysv/linux/m68k/Makefile
+ [$(subdir) = csu] (sysdep_routines): Likewise.
+ [$(subdir) = csu] (sysdep-only-routines): Likewise.
+ [$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
+ [$(subdir) = csu] (sysdep_routines): Likewise.
+ [$(subdir) = csu] (sysdep-only-routines): Likewise.
+ [$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/Makefile
+ [$(subdir) = csu] (sysdep_routines): Likewise.
+ [$(subdir) = csu] (sysdep-only-routines): Likewise.
+ [$(subdir) = csu] (CFLAGS-divdi3.c): Likewise.
+ * sysdeps/wordsize-32/Makefile: Remove file.
+ * sysdeps/wordsize-32/symbol-hacks.h: Definitions move to ...
+ * sysdeps/wordsize-32/divdi3-symbol-hacks.h: ... here.
+
+diff --git a/sysdeps/i386/symbol-hacks.h b/sysdeps/i386/symbol-hacks.h
+new file mode 100644
+index 0000000000..36a13c83f7
+--- /dev/null
++++ b/sysdeps/i386/symbol-hacks.h
+@@ -0,0 +1,21 @@
++/* Hacks needed for symbol manipulation. i386 version.
++ Copyright (C) 2017 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++#include <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
++
++#include_next "symbol-hacks.h"
+diff --git a/sysdeps/m68k/symbol-hacks.h b/sysdeps/m68k/symbol-hacks.h
+new file mode 100644
+index 0000000000..e449d29810
+--- /dev/null
++++ b/sysdeps/m68k/symbol-hacks.h
+@@ -0,0 +1,21 @@
++/* Hacks needed for symbol manipulation. m68k version.
++ Copyright (C) 2017 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++#include <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
++
++#include_next "symbol-hacks.h"
+diff --git a/sysdeps/powerpc/powerpc32/symbol-hacks.h b/sysdeps/powerpc/powerpc32/symbol-hacks.h
+new file mode 100644
+index 0000000000..dbb3141621
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/symbol-hacks.h
+@@ -0,0 +1,21 @@
++/* Hacks needed for symbol manipulation. powerpc version.
++ Copyright (C) 2017 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++#include <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
++
++#include_next "symbol-hacks.h"
+diff --git a/sysdeps/s390/s390-32/symbol-hacks.h b/sysdeps/s390/s390-32/symbol-hacks.h
+new file mode 100644
+index 0000000000..585c42365a
+--- /dev/null
++++ b/sysdeps/s390/s390-32/symbol-hacks.h
+@@ -0,0 +1,21 @@
++/* Hacks needed for symbol manipulation. s390 version.
++ Copyright (C) 2017 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++#include <sysdeps/wordsize-32/divdi3-symbol-hacks.h>
++
++#include_next "symbol-hacks.h"
+diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
+index 6aac0dfe15..4080b8c966 100644
+--- a/sysdeps/unix/sysv/linux/i386/Makefile
++++ b/sysdeps/unix/sysv/linux/i386/Makefile
+@@ -26,6 +26,11 @@ endif
+
+ ifeq ($(subdir),csu)
+ sysdep-dl-routines += sysdep
++ifeq (yes,$(build-shared))
++sysdep_routines += divdi3
++shared-only-routines += divdi3
++CPPFLAGS-divdi3.c = -Din_divdi3_c
++endif
+ endif
+
+ ifeq ($(subdir),nptl)
+diff --git a/sysdeps/unix/sysv/linux/m68k/Makefile b/sysdeps/unix/sysv/linux/m68k/Makefile
+index 5c50ce6927..ce1f696a6f 100644
+--- a/sysdeps/unix/sysv/linux/m68k/Makefile
++++ b/sysdeps/unix/sysv/linux/m68k/Makefile
+@@ -4,6 +4,11 @@ m68k-syntax-flag = -DMOTOROLA_SYNTAX
+
+ ifeq ($(subdir),csu)
+ sysdep_routines += m68k-helpers
++ifeq (yes,$(build-shared))
++sysdep_routines += divdi3
++shared-only-routines += divdi3
++CPPFLAGS-divdi3.c = -Din_divdi3_c
++endif
+ endif
+
+ ifeq ($(subdir),misc)
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
+index 3d6c150582..1f45659ed1 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makefile
+@@ -1,2 +1,10 @@
+ # See Makeconfig regarding the use of default-abi.
+ default-abi := 32
++
++ifeq ($(subdir),csu)
++ifeq (yes,$(build-shared))
++sysdep_routines += divdi3
++shared-only-routines += divdi3
++CPPFLAGS-divdi3.c = -Din_divdi3_c
++endif
++endif
+diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/Makefile b/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
+index da3b3c76b4..fd8cf92633 100644
+--- a/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
++++ b/sysdeps/unix/sysv/linux/s390/s390-32/Makefile
+@@ -21,3 +21,11 @@ endif
+ ifeq ($(subdir),stdlib)
+ sysdep_routines += __makecontext_ret
+ endif
++
++ifeq ($(subdir),csu)
++ifeq (yes,$(build-shared))
++sysdep_routines += divdi3
++shared-only-routines += divdi3
++CPPFLAGS-divdi3.c = -Din_divdi3_c
++endif
++endif
+diff --git a/sysdeps/wordsize-32/Makefile b/sysdeps/wordsize-32/Makefile
+deleted file mode 100644
+index 82beac44ed..0000000000
+--- a/sysdeps/wordsize-32/Makefile
++++ /dev/null
+@@ -1,7 +0,0 @@
+-ifeq ($(subdir),csu)
+-ifeq (yes,$(build-shared))
+-sysdep_routines += divdi3
+-shared-only-routines += divdi3
+-CPPFLAGS-divdi3.c = -Din_divdi3_c
+-endif
+-endif
+diff --git a/sysdeps/wordsize-32/divdi3-symbol-hacks.h b/sysdeps/wordsize-32/divdi3-symbol-hacks.h
+new file mode 100644
+index 0000000000..6c90cb796d
+--- /dev/null
++++ b/sysdeps/wordsize-32/divdi3-symbol-hacks.h
+@@ -0,0 +1,31 @@
++/* Hacks needed for divdi3 symbol manipulation.
++ Copyright (C) 2004-2017 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, see
++ <http://www.gnu.org/licenses/>. */
++
++/* A very dirty trick: gcc emits references to __divdi3, __udivdi3,
++ __moddi3, and __umoddi3. These functions are exported and
++ therefore we get PLTs. Unnecessarily so. Changing gcc is a big
++ task which might not be worth it so we play tricks with the
++ assembler.
++ Note: in_divdi3_c is only used to avoid symbol alias on divdi3
++ build itself. */
++#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) && defined SHARED
++asm ("__divdi3 = __divdi3_internal");
++asm ("__udivdi3 = __udivdi3_internal");
++asm ("__moddi3 = __moddi3_internal");
++asm ("__umoddi3 = __umoddi3_internal");
++#endif
+diff --git a/sysdeps/wordsize-32/symbol-hacks.h b/sysdeps/wordsize-32/symbol-hacks.h
+deleted file mode 100644
+index 0aec1e0b97..0000000000
+--- a/sysdeps/wordsize-32/symbol-hacks.h
++++ /dev/null
+@@ -1,31 +0,0 @@
+-/* Hacks needed for symbol manipulation.
+- Copyright (C) 2004-2017 Free Software Foundation, Inc.
+- This file is part of the GNU C Library.
+-
+- The GNU C Library is free software; you can redistribute it and/or
+- modify it under the terms of the GNU Lesser General Public
+- License as published by the Free Software Foundation; either
+- version 2.1 of the License, or (at your option) any later version.
+-
+- The GNU C Library is distributed in the hope that it will be useful,
+- but WITHOUT ANY WARRANTY; without even the implied warranty of
+- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+- Lesser General Public License for more details.
+-
+- You should have received a copy of the GNU Lesser General Public
+- License along with the GNU C Library; if not, see
+- <http://www.gnu.org/licenses/>. */
+-
+-#include_next "symbol-hacks.h"
+-
+-/* A very dirty trick: gcc emits references to __divdi3, __udivdi3,
+- __moddi3, and __umoddi3. These functions are exported and
+- therefore we get PLTs. Unnecessarily so. Changing gcc is a big
+- task which might not be worth it so we play tricks with the
+- assembler. */
+-#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) && defined SHARED
+-asm ("__divdi3 = __divdi3_internal");
+-asm ("__udivdi3 = __udivdi3_internal");
+-asm ("__moddi3 = __moddi3_internal");
+-asm ("__umoddi3 = __umoddi3_internal");
+-#endif
diff --git a/patches/glibc/2.25/961-sparc-extra-plt-call.patch b/patches/glibc/2.25/961-sparc-extra-plt-call.patch
new file mode 100644
index 0000000..3781cf0
--- /dev/null
+++ b/patches/glibc/2.25/961-sparc-extra-plt-call.patch
@@ -0,0 +1,65 @@
+commit bdc543e338281da051b3dc06eae96c330a485ce6
+Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
+Date: Thu Mar 16 09:15:57 2017 -0300
+
+ sparc: Fix .udiv plt on libc
+
+ With the removal of divdi3 object from sparcv9-linux-gnu build, its
+ definition came from libgcc and its functions internall calls .udiv.
+ Since glibc also exports these symbols for compatibility reasons, it
+ will end up creating PLT calls internally in libc.so.
+
+ To avoid it, this patch uses the linker option --wrap to replace all
+ the internal libc.so .udiv calls to the wrapper __wrap_.udiv. Along
+ with strong alias in the udiv implementations, it makes linker do
+ local calls.
+
+ Checked on sparcv9-linux-gnu.
+
+ * sysdeps/sparc/sparc32/Makefile (libc.so-gnulib): New rule.
+ * sysdeps/sparc/sparc32/sparcv8/udiv.S (.udiv): Make a strong_alias
+ to __wrap_.udiv.
+ * sysdeps/sparc/sparc32/sparcv9/udiv.S (.udiv): Likewise.
+ * sysdeps/sparc/sparc32/udiv.S (.udiv): Likewise.
+
+diff --git a/sysdeps/sparc/sparc32/Makefile b/sysdeps/sparc/sparc32/Makefile
+index da205898cf..14d6e03c6f 100644
+--- a/sysdeps/sparc/sparc32/Makefile
++++ b/sysdeps/sparc/sparc32/Makefile
+@@ -47,3 +47,9 @@ $(divrem:%=$(sysdep_dir)/sparc/sparc32/%.S): $(sysdep_dir)/sparc/sparc32/divrem.
+ mv -f $@-tmp $@
+
+ sysdep-realclean := $(sysdep-realclean) $(divrem:%=sysdeps/sparc/sparc32/%.S)
++
++# libgcc __divdi3 and __moddi3 uses .udiv and since it is also exported by
++# libc.so linker will create PLTs for the symbol. To avoid it we strong alias
++# the exported libc one to __wrap_.udiv and use linker option --wrap to make any
++# call to .udiv to call the wrapper symbol.
++libc.so-gnulib += -Wl,--wrap=.udiv
+diff --git a/sysdeps/sparc/sparc32/sparcv8/udiv.S b/sysdeps/sparc/sparc32/sparcv8/udiv.S
+index d71954351e..e9cab4e4ef 100644
+--- a/sysdeps/sparc/sparc32/sparcv8/udiv.S
++++ b/sysdeps/sparc/sparc32/sparcv8/udiv.S
+@@ -13,3 +13,4 @@ ENTRY(.udiv)
+ udiv %o0, %o1, %o0
+
+ END(.udiv)
++strong_alias (.udiv, __wrap_.udiv)
+diff --git a/sysdeps/sparc/sparc32/sparcv9/udiv.S b/sysdeps/sparc/sparc32/sparcv9/udiv.S
+index de79899756..368f85ede2 100644
+--- a/sysdeps/sparc/sparc32/sparcv9/udiv.S
++++ b/sysdeps/sparc/sparc32/sparcv9/udiv.S
+@@ -15,3 +15,4 @@ ENTRY(.udiv)
+ udiv %o0, %o1, %o0
+
+ END(.udiv)
++strong_alias (.udiv, __wrap_.udiv)
+diff --git a/sysdeps/sparc/sparc32/udiv.S b/sysdeps/sparc/sparc32/udiv.S
+index 8dfff66158..ade0afdf40 100644
+--- a/sysdeps/sparc/sparc32/udiv.S
++++ b/sysdeps/sparc/sparc32/udiv.S
+@@ -344,3 +344,4 @@ LOC(got_result):
+ mov %o2, %o0
+
+ END(.udiv)
++strong_alias (.udiv, __wrap_.udiv)
diff --git a/patches/glibc/linaro-2.20-2014.11/920-fix-rpc_parse-format.patch b/patches/glibc/linaro-2.20-2014.11/920-fix-rpc_parse-format.patch
new file mode 100644
index 0000000..37e58da
--- /dev/null
+++ b/patches/glibc/linaro-2.20-2014.11/920-fix-rpc_parse-format.patch
@@ -0,0 +1,60 @@
+commit 5874510faaf3cbd0bb112aaacab9f225002beed1
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Nov 8 23:44:51 2016 +0000
+
+ Fix rpcgen buffer overrun (bug 20790).
+
+ Building with GCC 7 produces an error building rpcgen:
+
+ rpc_parse.c: In function 'get_prog_declaration':
+ rpc_parse.c:543:25: error: may write a terminating nul past the end of the destination [-Werror=format-length=]
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ~~~~^
+ rpc_parse.c:543:5: note: format output between 5 and 14 bytes into a destination of size 10
+ sprintf (name, "%s%d", ARGNAME, num); /* default name of argument */
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ That buffer overrun is for the case where the .x file declares a
+ program with a million arguments. The strcpy two lines above can
+ generate a buffer overrun much more simply for a long argument name.
+
+ The limit on length of line read by rpcgen (MAXLINESIZE == 1024)
+ provides a bound on the buffer size needed, so this patch just changes
+ the buffer size to MAXLINESIZE to avoid both possible buffer
+ overruns. A testcase is added that rpcgen does not crash with a
+ 500-character argument name, where it previously crashed.
+
+ It would not at all surprise me if there are many other ways of
+ crashing rpcgen with either valid or invalid input; fuzz testing would
+ likely find various such bugs, though I don't think they are that
+ important to fix (rpcgen is not that likely to be used with untrusted
+ .x files as input). (As well as fuzz-findable bugs there are probably
+ also issues when various int variables get overflowed on very large
+ input.) The test infrastructure for rpcgen-not-crashing tests would
+ need extending if tests are to be added for cases where rpcgen should
+ produce an error, as opposed to cases where it should succeed.
+
+ Tested for x86_64 and x86.
+
+ [BZ #20790]
+ * sunrpc/rpc_parse.c (get_prog_declaration): Increase buffer size
+ to MAXLINESIZE.
+ * sunrpc/bug20790.x: New file.
+ * sunrpc/Makefile [$(run-built-tests) = yes] (rpcgen-tests): New
+ variable.
+ [$(run-built-tests) = yes] (tests-special): Add $(rpcgen-tests).
+ [$(run-built-tests) = yes] ($(rpcgen-tests)): New rule.
+
+diff --git a/sunrpc/rpc_parse.c b/sunrpc/rpc_parse.c
+index 1a1df6d8c2..505a6554cf 100644
+--- a/sunrpc/rpc_parse.c
++++ b/sunrpc/rpc_parse.c
+@@ -521,7 +521,7 @@ static void
+ get_prog_declaration (declaration * dec, defkind dkind, int num /* arg number */ )
+ {
+ token tok;
+- char name[10]; /* argument name */
++ char name[MAXLINESIZE]; /* argument name */
+
+ if (dkind == DEF_PROGRAM)
+ {
diff --git a/patches/glibc/linaro-2.20-2014.11/930-explicit-boolean.patch b/patches/glibc/linaro-2.20-2014.11/930-explicit-boolean.patch
new file mode 100644
index 0000000..780fae6
--- /dev/null
+++ b/patches/glibc/linaro-2.20-2014.11/930-explicit-boolean.patch
@@ -0,0 +1,33 @@
+commit e223d1fe72e820d96f43831412ab267a1ace04d0
+Author: steve ellcey-CA Eng-Software <sellcey@sellcey-thinkpad.caveonetworks.com>
+Date: Fri Oct 14 12:53:27 2016 -0700
+
+ Fix warnings from latest GCC.
+
+ * sysdeps/ieee754/dbl-64/e_pow.c (checkint) Make conditions explicitly
+ boolean.
+
+diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
+index 663fa392c2..bd758b5979 100644
+--- a/sysdeps/ieee754/dbl-64/e_pow.c
++++ b/sysdeps/ieee754/dbl-64/e_pow.c
+@@ -466,15 +466,15 @@ checkint (double x)
+ return (n & 1) ? -1 : 1; /* odd or even */
+ if (k > 20)
+ {
+- if (n << (k - 20))
++ if (n << (k - 20) != 0)
+ return 0; /* if not integer */
+- return (n << (k - 21)) ? -1 : 1;
++ return (n << (k - 21) != 0) ? -1 : 1;
+ }
+ if (n)
+ return 0; /*if not integer */
+ if (k == 20)
+ return (m & 1) ? -1 : 1;
+- if (m << (k + 12))
++ if (m << (k + 12) != 0)
+ return 0;
+- return (m << (k + 11)) ? -1 : 1;
++ return (m << (k + 11) != 0) ? -1 : 1;
+ }
diff --git a/patches/glibc/linaro-2.20-2014.11/940-nis-bogus-conditional.patch b/patches/glibc/linaro-2.20-2014.11/940-nis-bogus-conditional.patch
new file mode 100644
index 0000000..09b38cf
--- /dev/null
+++ b/patches/glibc/linaro-2.20-2014.11/940-nis-bogus-conditional.patch
@@ -0,0 +1,62 @@
+commit f88759ea9bd3c8d8fef28f123ba9767cb0e421a3
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Dec 21 23:44:01 2016 +0000
+
+ Fix nss_nisplus build with mainline GCC (bug 20978).
+
+ glibc build with current mainline GCC fails because
+ nis/nss_nisplus/nisplus-alias.c contains code
+
+ if (name != NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
+ }
+
+ char buf[strlen (name) + 9 + tablename_len];
+
+ producing an error about strlen being called on a pointer that is
+ always NULL (and a subsequent use of that pointer with a %s format in
+ snprintf).
+
+ As Andreas noted, the bogus conditional comes from a 1997 change:
+
+ - if (name == NULL || strlen(name) > 8)
+ - return NSS_STATUS_NOTFOUND;
+ - else
+ + if (name != NULL || strlen(name) <= 8)
+
+ So the intention is clearly to return an error for NULL name.
+
+ This patch duly inverts the sense of the conditional. It fixes the
+ build with GCC mainline, and passes usual glibc testsuite testing for
+ x86_64. However, I have not tried any actual substantive nisplus
+ testing, do not have an environment for such testing, and do not know
+ whether it is possible that strlen (name) or tablename_len might be
+ large so that the VLA for buf is actually a security issue. However,
+ if it is a security issue, there are plenty of other similar instances
+ in the nisplus code (that haven't been hidden by a bogus comparison
+ with NULL) - and nis_table.c:__create_ib_request uses strdupa on the
+ string passed to nis_list, so a local fix in the caller wouldn't
+ suffice anyway (see bug 20987). (Calls to strdupa and other such
+ macros that use alloca must be considered equally questionable
+ regarding stack overflow issues as direct calls to alloca and VLA
+ declarations.)
+
+ [BZ #20978]
+ * nis/nss_nisplus/nisplus-alias.c (_nss_nisplus_getaliasbyname_r):
+ Compare name == NULL, not name != NULL.
+
+diff --git a/nis/nss_nisplus/nisplus-alias.c b/nis/nss_nisplus/nisplus-alias.c
+index 7f698b4e6d..cb5acce01d 100644
+--- a/nis/nss_nisplus/nisplus-alias.c
++++ b/nis/nss_nisplus/nisplus-alias.c
+@@ -291,7 +291,7 @@ _nss_nisplus_getaliasbyname_r (const char *name, struct aliasent *alias,
+ return status;
+ }
+
+- if (name != NULL)
++ if (name == NULL)
+ {
+ *errnop = EINVAL;
+ return NSS_STATUS_UNAVAIL;
diff --git a/patches/mingw-w64/v5.0.2/100-mingw64-malloc.patch b/patches/mingw-w64/v5.0.2/100-mingw64-malloc.patch
new file mode 100644
index 0000000..3d05b63
--- /dev/null
+++ b/patches/mingw-w64/v5.0.2/100-mingw64-malloc.patch
@@ -0,0 +1,55 @@
+diff -urpN mingw-w64-v5.0.1.orig/mingw-w64-tools/genidl/src/genidl_cfg.h mingw-w64-v5.0.1/mingw-w64-tools/genidl/src/genidl_cfg.h
+--- mingw-w64-v5.0.1.orig/mingw-w64-tools/genidl/src/genidl_cfg.h 2017-03-10 16:20:09.000000000 -0800
++++ mingw-w64-v5.0.1/mingw-w64-tools/genidl/src/genidl_cfg.h 2017-03-10 16:25:26.000000000 -0800
+@@ -26,7 +26,9 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#if defined(HAVE_MALLOC_H)
+ #include <malloc.h>
++#endif
+ #include <memory.h>
+ #include <stdarg.h>
+ #include <stdint.h>
+diff -urpN mingw-w64-v5.0.1.orig/mingw-w64-tools/genidl/src/genidl_typinfo.c mingw-w64-v5.0.1/mingw-w64-tools/genidl/src/genidl_typinfo.c
+--- mingw-w64-v5.0.1.orig/mingw-w64-tools/genidl/src/genidl_typinfo.c 2017-03-10 16:20:09.000000000 -0800
++++ mingw-w64-v5.0.1/mingw-w64-tools/genidl/src/genidl_typinfo.c 2017-03-10 16:25:49.000000000 -0800
+@@ -21,7 +21,10 @@
+ #include "genidl_cfg.h"
+ #include "genidl_typeinfo.h"
+ #include "genidl_typinfo.h"
++#if defined(HAVE_MALLOC_H)
+ #include <malloc.h>
++#endif
++#include <stdlib.h>
+ #include <string.h>
+ #include <memory.h>
+
+diff -urpN mingw-w64-v5.0.1.orig/mingw-w64-tools/widl/include/pathtools.h mingw-w64-v5.0.1/mingw-w64-tools/widl/include/pathtools.h
+--- mingw-w64-v5.0.1.orig/mingw-w64-tools/widl/include/pathtools.h 2017-03-10 16:20:09.000000000 -0800
++++ mingw-w64-v5.0.1/mingw-w64-tools/widl/include/pathtools.h 2017-03-10 16:26:21.000000000 -0800
+@@ -12,9 +12,8 @@
+ #define PATHTOOLS_H
+
+ #include <unistd.h>
+-#if defined(__APPLE__)
+ #include <stdlib.h>
+-#else
++#if defined(HAVE_MALLOC_H)
+ #include <malloc.h>
+ #endif
+ #include <stdio.h>
+diff -urpN mingw-w64-v5.0.1.orig/mingw-w64-tools/widl/src/pathtools.c mingw-w64-v5.0.1/mingw-w64-tools/widl/src/pathtools.c
+--- mingw-w64-v5.0.1.orig/mingw-w64-tools/widl/src/pathtools.c 2017-03-10 16:20:09.000000000 -0800
++++ mingw-w64-v5.0.1/mingw-w64-tools/widl/src/pathtools.c 2017-03-10 16:26:40.000000000 -0800
+@@ -8,9 +8,8 @@
+ .email: <mingw.android@gmail.com>.
+ */
+
+-#if defined(__APPLE__)
+ #include <stdlib.h>
+-#else
++#if defined(HAVE_MALLOC_H)
+ #include <malloc.h>
+ #endif
+ #include <limits.h>
diff --git a/patches/newlib/2.5.0.20170323/110-fix-eabihf.patch b/patches/newlib/2.5.0.20170323/110-fix-eabihf.patch
deleted file mode 100644
index 21ed2d3..0000000
--- a/patches/newlib/2.5.0.20170323/110-fix-eabihf.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -urpN newlib-2.5.0.20170323.orig/libgloss/arm/configure newlib-2.5.0.20170323/libgloss/arm/configure
---- newlib-2.5.0.20170323.orig/libgloss/arm/configure 2017-04-11 00:41:25.464880809 -0700
-+++ newlib-2.5.0.20170323/libgloss/arm/configure 2017-04-11 00:43:12.333789062 -0700
-@@ -2531,7 +2531,7 @@ test "${CCASFLAGS+set}" = set || CCASFLA
-
-
- case "${target}" in
-- *-*-elf | *-*-eabi | *-*-tirtos*)
-+ *-*-elf | *-*-eabi* | *-*-tirtos*)
- objtype=elf-
- ;;
- *-*-coff)
-diff -urpN newlib-2.5.0.20170323.orig/libgloss/arm/configure.in newlib-2.5.0.20170323/libgloss/arm/configure.in
---- newlib-2.5.0.20170323.orig/libgloss/arm/configure.in 2017-04-11 00:41:25.464880809 -0700
-+++ newlib-2.5.0.20170323/libgloss/arm/configure.in 2017-04-11 00:43:12.333789062 -0700
-@@ -49,7 +49,7 @@ AC_PROG_RANLIB
- LIB_AM_PROG_AS
-
- case "${target}" in
-- *-*-elf | *-*-eabi | *-*-tirtos*)
-+ *-*-elf | *-*-eabi* | *-*-tirtos*)
- objtype=elf-
- ;;
- *-*-coff)
diff --git a/patches/newlib/2.5.0.20170323/100-fix-unaligned-access-memcpy-m68k.patch b/patches/newlib/2.5.0.20170519/100-fix-unaligned-access-memcpy-m68k.patch
index 1d0b49b..1d0b49b 100644
--- a/patches/newlib/2.5.0.20170323/100-fix-unaligned-access-memcpy-m68k.patch
+++ b/patches/newlib/2.5.0.20170519/100-fix-unaligned-access-memcpy-m68k.patch
diff --git a/patches/newlib/2.5.0.20170323/200-fix-mt-cflags.patch b/patches/newlib/2.5.0.20170519/200-fix-mt-cflags.patch
index cc15551..cc15551 100644
--- a/patches/newlib/2.5.0.20170323/200-fix-mt-cflags.patch
+++ b/patches/newlib/2.5.0.20170519/200-fix-mt-cflags.patch
diff --git a/patches/uClibc-ng/1.0.20/700-features.h-c11.patch b/patches/uClibc-ng/1.0.20/700-features.h-c11.patch
new file mode 100644
index 0000000..cb1d2a8
--- /dev/null
+++ b/patches/uClibc-ng/1.0.20/700-features.h-c11.patch
@@ -0,0 +1,61 @@
+From 5b0f49037e8ea8500b05c8f31ee88529ccac4cee Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Sun, 7 May 2017 16:28:14 +0200
+Subject: sync features.h with GNU C library, fixes gcc 7.1 toolchain creation
+
+---
+ include/features.h | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/features.h b/include/features.h
+index e76bbba..f982079 100644
+--- a/include/features.h
++++ b/include/features.h
+@@ -55,6 +55,7 @@
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
++ __USE_ISOC11 Define ISO C11 things.
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+@@ -91,6 +92,7 @@
+
+
+ /* Undefine everything, so we get a clean slate. */
++#undef __USE_ISOC11
+ #undef __USE_ISOC99
+ #undef __USE_ISOC95
+ #undef __USE_POSIX
+@@ -151,6 +153,8 @@
+ #ifdef _GNU_SOURCE
+ # undef _ISOC99_SOURCE
+ # define _ISOC99_SOURCE 1
++# undef _ISOC11_SOURCE
++# define _ISOC11_SOURCE 1
+ # undef _POSIX_SOURCE
+ # define _POSIX_SOURCE 1
+ # undef _POSIX_C_SOURCE
+@@ -223,11 +227,14 @@
+ # define _SVID_SOURCE 1
+ #endif
+
+-/* This is to enable the ISO C99 extension. Also recognize the old macro
+- which was used prior to the standard acceptance. This macro will
+- eventually go away and the features enabled by default once the ISO C99
+- standard is widely adopted. */
+-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
++/* This is to enable the ISO C11 extension. */
++#if (defined _ISOC11_SOURCE \
++ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
++# define __USE_ISOC11 1
++#endif
++
++/* This is to enable the ISO C99 extension. */
++#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+ # define __USE_ISOC99 1
+ #endif
+--
+cgit v0.11.2-3-g2eb4
+
diff --git a/patches/uClibc-ng/1.0.21/700-features.h-c11.patch b/patches/uClibc-ng/1.0.21/700-features.h-c11.patch
new file mode 100644
index 0000000..cb1d2a8
--- /dev/null
+++ b/patches/uClibc-ng/1.0.21/700-features.h-c11.patch
@@ -0,0 +1,61 @@
+From 5b0f49037e8ea8500b05c8f31ee88529ccac4cee Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Sun, 7 May 2017 16:28:14 +0200
+Subject: sync features.h with GNU C library, fixes gcc 7.1 toolchain creation
+
+---
+ include/features.h | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/features.h b/include/features.h
+index e76bbba..f982079 100644
+--- a/include/features.h
++++ b/include/features.h
+@@ -55,6 +55,7 @@
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
++ __USE_ISOC11 Define ISO C11 things.
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+@@ -91,6 +92,7 @@
+
+
+ /* Undefine everything, so we get a clean slate. */
++#undef __USE_ISOC11
+ #undef __USE_ISOC99
+ #undef __USE_ISOC95
+ #undef __USE_POSIX
+@@ -151,6 +153,8 @@
+ #ifdef _GNU_SOURCE
+ # undef _ISOC99_SOURCE
+ # define _ISOC99_SOURCE 1
++# undef _ISOC11_SOURCE
++# define _ISOC11_SOURCE 1
+ # undef _POSIX_SOURCE
+ # define _POSIX_SOURCE 1
+ # undef _POSIX_C_SOURCE
+@@ -223,11 +227,14 @@
+ # define _SVID_SOURCE 1
+ #endif
+
+-/* This is to enable the ISO C99 extension. Also recognize the old macro
+- which was used prior to the standard acceptance. This macro will
+- eventually go away and the features enabled by default once the ISO C99
+- standard is widely adopted. */
+-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
++/* This is to enable the ISO C11 extension. */
++#if (defined _ISOC11_SOURCE \
++ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
++# define __USE_ISOC11 1
++#endif
++
++/* This is to enable the ISO C99 extension. */
++#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+ # define __USE_ISOC99 1
+ #endif
+--
+cgit v0.11.2-3-g2eb4
+
diff --git a/patches/uClibc-ng/1.0.22/700-features.h-c11.patch b/patches/uClibc-ng/1.0.22/700-features.h-c11.patch
new file mode 100644
index 0000000..cb1d2a8
--- /dev/null
+++ b/patches/uClibc-ng/1.0.22/700-features.h-c11.patch
@@ -0,0 +1,61 @@
+From 5b0f49037e8ea8500b05c8f31ee88529ccac4cee Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Sun, 7 May 2017 16:28:14 +0200
+Subject: sync features.h with GNU C library, fixes gcc 7.1 toolchain creation
+
+---
+ include/features.h | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/features.h b/include/features.h
+index e76bbba..f982079 100644
+--- a/include/features.h
++++ b/include/features.h
+@@ -55,6 +55,7 @@
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
++ __USE_ISOC11 Define ISO C11 things.
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+@@ -91,6 +92,7 @@
+
+
+ /* Undefine everything, so we get a clean slate. */
++#undef __USE_ISOC11
+ #undef __USE_ISOC99
+ #undef __USE_ISOC95
+ #undef __USE_POSIX
+@@ -151,6 +153,8 @@
+ #ifdef _GNU_SOURCE
+ # undef _ISOC99_SOURCE
+ # define _ISOC99_SOURCE 1
++# undef _ISOC11_SOURCE
++# define _ISOC11_SOURCE 1
+ # undef _POSIX_SOURCE
+ # define _POSIX_SOURCE 1
+ # undef _POSIX_C_SOURCE
+@@ -223,11 +227,14 @@
+ # define _SVID_SOURCE 1
+ #endif
+
+-/* This is to enable the ISO C99 extension. Also recognize the old macro
+- which was used prior to the standard acceptance. This macro will
+- eventually go away and the features enabled by default once the ISO C99
+- standard is widely adopted. */
+-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
++/* This is to enable the ISO C11 extension. */
++#if (defined _ISOC11_SOURCE \
++ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
++# define __USE_ISOC11 1
++#endif
++
++/* This is to enable the ISO C99 extension. */
++#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+ # define __USE_ISOC99 1
+ #endif
+--
+cgit v0.11.2-3-g2eb4
+
diff --git a/patches/uClibc-ng/1.0.23/700-features.h-c11.patch b/patches/uClibc-ng/1.0.23/700-features.h-c11.patch
new file mode 100644
index 0000000..cb1d2a8
--- /dev/null
+++ b/patches/uClibc-ng/1.0.23/700-features.h-c11.patch
@@ -0,0 +1,61 @@
+From 5b0f49037e8ea8500b05c8f31ee88529ccac4cee Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Sun, 7 May 2017 16:28:14 +0200
+Subject: sync features.h with GNU C library, fixes gcc 7.1 toolchain creation
+
+---
+ include/features.h | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/features.h b/include/features.h
+index e76bbba..f982079 100644
+--- a/include/features.h
++++ b/include/features.h
+@@ -55,6 +55,7 @@
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
++ __USE_ISOC11 Define ISO C11 things.
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+@@ -91,6 +92,7 @@
+
+
+ /* Undefine everything, so we get a clean slate. */
++#undef __USE_ISOC11
+ #undef __USE_ISOC99
+ #undef __USE_ISOC95
+ #undef __USE_POSIX
+@@ -151,6 +153,8 @@
+ #ifdef _GNU_SOURCE
+ # undef _ISOC99_SOURCE
+ # define _ISOC99_SOURCE 1
++# undef _ISOC11_SOURCE
++# define _ISOC11_SOURCE 1
+ # undef _POSIX_SOURCE
+ # define _POSIX_SOURCE 1
+ # undef _POSIX_C_SOURCE
+@@ -223,11 +227,14 @@
+ # define _SVID_SOURCE 1
+ #endif
+
+-/* This is to enable the ISO C99 extension. Also recognize the old macro
+- which was used prior to the standard acceptance. This macro will
+- eventually go away and the features enabled by default once the ISO C99
+- standard is widely adopted. */
+-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
++/* This is to enable the ISO C11 extension. */
++#if (defined _ISOC11_SOURCE \
++ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
++# define __USE_ISOC11 1
++#endif
++
++/* This is to enable the ISO C99 extension. */
++#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+ # define __USE_ISOC99 1
+ #endif
+--
+cgit v0.11.2-3-g2eb4
+
diff --git a/patches/uClibc-ng/1.0.24/700-features.h-c11.patch b/patches/uClibc-ng/1.0.24/700-features.h-c11.patch
new file mode 100644
index 0000000..cb1d2a8
--- /dev/null
+++ b/patches/uClibc-ng/1.0.24/700-features.h-c11.patch
@@ -0,0 +1,61 @@
+From 5b0f49037e8ea8500b05c8f31ee88529ccac4cee Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Sun, 7 May 2017 16:28:14 +0200
+Subject: sync features.h with GNU C library, fixes gcc 7.1 toolchain creation
+
+---
+ include/features.h | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/include/features.h b/include/features.h
+index e76bbba..f982079 100644
+--- a/include/features.h
++++ b/include/features.h
+@@ -55,6 +55,7 @@
+ These are defined by this file and are used by the
+ header files to decide what to declare or define:
+
++ __USE_ISOC11 Define ISO C11 things.
+ __USE_ISOC99 Define ISO C99 things.
+ __USE_ISOC95 Define ISO C90 AMD1 (C95) things.
+ __USE_POSIX Define IEEE Std 1003.1 things.
+@@ -91,6 +92,7 @@
+
+
+ /* Undefine everything, so we get a clean slate. */
++#undef __USE_ISOC11
+ #undef __USE_ISOC99
+ #undef __USE_ISOC95
+ #undef __USE_POSIX
+@@ -151,6 +153,8 @@
+ #ifdef _GNU_SOURCE
+ # undef _ISOC99_SOURCE
+ # define _ISOC99_SOURCE 1
++# undef _ISOC11_SOURCE
++# define _ISOC11_SOURCE 1
+ # undef _POSIX_SOURCE
+ # define _POSIX_SOURCE 1
+ # undef _POSIX_C_SOURCE
+@@ -223,11 +227,14 @@
+ # define _SVID_SOURCE 1
+ #endif
+
+-/* This is to enable the ISO C99 extension. Also recognize the old macro
+- which was used prior to the standard acceptance. This macro will
+- eventually go away and the features enabled by default once the ISO C99
+- standard is widely adopted. */
+-#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
++/* This is to enable the ISO C11 extension. */
++#if (defined _ISOC11_SOURCE \
++ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L))
++# define __USE_ISOC11 1
++#endif
++
++/* This is to enable the ISO C99 extension. */
++#if (defined _ISOC99_SOURCE || defined _ISOC11_SOURCE \
+ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+ # define __USE_ISOC99 1
+ #endif
+--
+cgit v0.11.2-3-g2eb4
+
diff --git a/patches/zlib/1.2.11/120-mingw-static-only.patch b/patches/zlib/1.2.11/120-mingw-static-only.patch
new file mode 100644
index 0000000..9eef00b
--- /dev/null
+++ b/patches/zlib/1.2.11/120-mingw-static-only.patch
@@ -0,0 +1,25 @@
+diff -urpN zlib-1.2.11.orig/win32/Makefile.gcc zlib-1.2.11/win32/Makefile.gcc
+--- zlib-1.2.11.orig/win32/Makefile.gcc 2017-05-23 18:52:07.937730080 -0700
++++ zlib-1.2.11/win32/Makefile.gcc 2017-05-23 19:02:24.068666463 -0700
+@@ -71,7 +71,11 @@ OBJS = adler32.o compress.o crc32.o defl
+ gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
+ OBJA =
+
+-all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) example.exe minigzip.exe example_d.exe minigzip_d.exe
++all: $(STATICLIB) example.exe minigzip.exe
++
++ifeq ($(SHARED_MODE),1)
++all: $(SHAREDLIB) $(IMPLIB) example_d.exe minigzip_d.exe
++endif
+
+ test: example.exe minigzip.exe
+ ./example
+@@ -125,7 +129,7 @@ zlibrc.o: win32/zlib1.rc
+ .PHONY: install uninstall clean
+
+ install: zlib.h zconf.h $(STATICLIB) $(IMPLIB)
+- @if test -z "$(DESTDIR)$(INCLUDE_PATH)" -o -z "$(DESTDIR)$(LIBRARY_PATH)" -o -z "$(DESTDIR)$(BINARY_PATH)"; then \
++ @if test -z "$(INCLUDE_PATH)" -o -z "$(LIBRARY_PATH)" -o -z "$(BINARY_PATH)"; then \
+ echo INCLUDE_PATH, LIBRARY_PATH, and BINARY_PATH must be specified; \
+ exit 1; \
+ fi
diff --git a/samples/aarch64-rpi3-linux-gnueabi/crosstool.config b/samples/aarch64-rpi3-linux-gnueabi/crosstool.config
index 01605ac..6d51c12 100644
--- a/samples/aarch64-rpi3-linux-gnueabi/crosstool.config
+++ b/samples/aarch64-rpi3-linux-gnueabi/crosstool.config
@@ -7,5 +7,6 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
diff --git a/samples/aarch64-unknown-linux-android/crosstool.config b/samples/aarch64-unknown-linux-android/crosstool.config
new file mode 100644
index 0000000..295b219
--- /dev/null
+++ b/samples/aarch64-unknown-linux-android/crosstool.config
@@ -0,0 +1,11 @@
+CT_EXPERIMENTAL=y
+CT_ARCH_arm=y
+CT_ARCH_64=y
+CT_ARCH_ARCH="armv8-a"
+CT_STATIC_TOOLCHAIN=y
+CT_KERNEL_linux=y
+CT_LIBC_BIONIC_V_14b=y
+CT_ANDROID_API_21=y
+CT_CC_LANG_CXX=y
+CT_DEBUG_gdb=y
+CT_GETTEXT=y
diff --git a/samples/aarch64-unknown-linux-android/reported.by b/samples/aarch64-unknown-linux-android/reported.by
new file mode 100644
index 0000000..fb4b9ec
--- /dev/null
+++ b/samples/aarch64-unknown-linux-android/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Howard Chu"
+reporter_url="http://www.symas.com"
+reporter_comment="Config to build cross-compiler for Android/bionic on ARM64"
diff --git a/samples/aarch64-unknown-linux-gnueabi/crosstool.config b/samples/aarch64-unknown-linux-gnueabi/crosstool.config
index e3a393a..8ff183c 100644
--- a/samples/aarch64-unknown-linux-gnueabi/crosstool.config
+++ b/samples/aarch64-unknown-linux-gnueabi/crosstool.config
@@ -6,5 +6,6 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
diff --git a/samples/arm-cortex_a15-linux-gnueabihf/crosstool.config b/samples/arm-cortex_a15-linux-gnueabihf/crosstool.config
index 5d0ab9c..76174b6 100644
--- a/samples/arm-cortex_a15-linux-gnueabihf/crosstool.config
+++ b/samples/arm-cortex_a15-linux-gnueabihf/crosstool.config
@@ -8,6 +8,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_GCC_SHOW_LINARO=y
CT_CC_LANG_CXX=y
CT_DEBUG_duma=y
diff --git a/samples/arm-cortex_a8-linux-gnueabi/crosstool.config b/samples/arm-cortex_a8-linux-gnueabi/crosstool.config
index f5245e2..7b7a74b 100644
--- a/samples/arm-cortex_a8-linux-gnueabi/crosstool.config
+++ b/samples/arm-cortex_a8-linux-gnueabi/crosstool.config
@@ -7,6 +7,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_LANG_CXX=y
CT_DEBUG_duma=y
CT_DEBUG_gdb=y
diff --git a/samples/arm-cortexa9_neon-linux-gnueabihf/crosstool.config b/samples/arm-cortexa9_neon-linux-gnueabihf/crosstool.config
index 9330cce..f5a57dd 100644
--- a/samples/arm-cortexa9_neon-linux-gnueabihf/crosstool.config
+++ b/samples/arm-cortexa9_neon-linux-gnueabihf/crosstool.config
@@ -10,6 +10,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_LIBC_ADDONS_LIST="libidn"
CT_LIBC_LOCALES=y
CT_LIBC_GLIBC_KERNEL_VERSION_NONE=y
diff --git a/samples/arm-unknown-linux-gnueabi/crosstool.config b/samples/arm-unknown-linux-gnueabi/crosstool.config
index 85909e5..20157cf 100644
--- a/samples/arm-unknown-linux-gnueabi/crosstool.config
+++ b/samples/arm-unknown-linux-gnueabi/crosstool.config
@@ -6,6 +6,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
# CT_CC_GCC_SJLJ_EXCEPTIONS is not set
CT_CC_LANG_CXX=y
CT_DEBUG_duma=y
diff --git a/samples/armeb-unknown-linux-gnueabi/crosstool.config b/samples/armeb-unknown-linux-gnueabi/crosstool.config
index eb72062..983c33d 100644
--- a/samples/armeb-unknown-linux-gnueabi/crosstool.config
+++ b/samples/armeb-unknown-linux-gnueabi/crosstool.config
@@ -7,6 +7,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
# CT_CC_GCC_SJLJ_EXCEPTIONS is not set
CT_CC_LANG_CXX=y
CT_DEBUG_duma=y
diff --git a/samples/armv6-rpi-linux-gnueabi/crosstool.config b/samples/armv6-rpi-linux-gnueabi/crosstool.config
index 0affdb7..22fbfaa 100644
--- a/samples/armv6-rpi-linux-gnueabi/crosstool.config
+++ b/samples/armv6-rpi-linux-gnueabi/crosstool.config
@@ -9,6 +9,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_LIBC_LOCALES=y
CT_LIBC_GLIBC_KERNEL_VERSION_CHOSEN=y
CT_LIBC_GLIBC_MIN_KERNEL_VERSION="3.2.27"
diff --git a/samples/armv7-rpi2-linux-gnueabihf/crosstool.config b/samples/armv7-rpi2-linux-gnueabihf/crosstool.config
index 08f903d..30b678d 100644
--- a/samples/armv7-rpi2-linux-gnueabihf/crosstool.config
+++ b/samples/armv7-rpi2-linux-gnueabihf/crosstool.config
@@ -9,5 +9,6 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
diff --git a/samples/armv8-rpi3-linux-gnueabihf/crosstool.config b/samples/armv8-rpi3-linux-gnueabihf/crosstool.config
index 117560e..6d1d0f8 100644
--- a/samples/armv8-rpi3-linux-gnueabihf/crosstool.config
+++ b/samples/armv8-rpi3-linux-gnueabihf/crosstool.config
@@ -9,5 +9,6 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
diff --git a/samples/i686-centos6-linux-gnu/crosstool.config b/samples/i686-centos6-linux-gnu/crosstool.config
index 204f9fb..86ec1f6 100644
--- a/samples/i686-centos6-linux-gnu/crosstool.config
+++ b/samples/i686-centos6-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_ARCH="i686"
CT_TARGET_VENDOR="centos6"
CT_KERNEL_linux=y
CT_KERNEL_V_2_6_32=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_12_2=y
CT_CC_LANG_CXX=y
diff --git a/samples/i686-centos7-linux-gnu/crosstool.config b/samples/i686-centos7-linux-gnu/crosstool.config
index bb9f007..b6403bb 100644
--- a/samples/i686-centos7-linux-gnu/crosstool.config
+++ b/samples/i686-centos7-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_ARCH="i686"
CT_TARGET_VENDOR="centos7"
CT_KERNEL_linux=y
CT_KERNEL_V_3_10=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_17=y
CT_CC_LANG_CXX=y
diff --git a/samples/i686-nptl-linux-gnu/crosstool.config b/samples/i686-nptl-linux-gnu/crosstool.config
index a59823c..1f14d67 100644
--- a/samples/i686-nptl-linux-gnu/crosstool.config
+++ b/samples/i686-nptl-linux-gnu/crosstool.config
@@ -6,6 +6,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_LANG_CXX=y
CT_DEBUG_duma=y
CT_DEBUG_gdb=y
diff --git a/samples/i686-ubuntu12.04-linux-gnu/crosstool.config b/samples/i686-ubuntu12.04-linux-gnu/crosstool.config
index 030c109..01c4312 100644
--- a/samples/i686-ubuntu12.04-linux-gnu/crosstool.config
+++ b/samples/i686-ubuntu12.04-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_ARCH="i686"
CT_TARGET_VENDOR="ubuntu12.04"
CT_KERNEL_linux=y
CT_KERNEL_V_3_2=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_15=y
CT_CC_LANG_CXX=y
diff --git a/samples/i686-ubuntu14.04-linux-gnu/crosstool.config b/samples/i686-ubuntu14.04-linux-gnu/crosstool.config
index a67103a..e3f459b 100644
--- a/samples/i686-ubuntu14.04-linux-gnu/crosstool.config
+++ b/samples/i686-ubuntu14.04-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_ARCH="i686"
CT_TARGET_VENDOR="ubuntu14.04"
CT_KERNEL_linux=y
CT_KERNEL_V_3_13=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_19=y
CT_CC_LANG_CXX=y
diff --git a/samples/i686-ubuntu16.04-linux-gnu/crosstool.config b/samples/i686-ubuntu16.04-linux-gnu/crosstool.config
index 3ceac41..9eec3c1 100644
--- a/samples/i686-ubuntu16.04-linux-gnu/crosstool.config
+++ b/samples/i686-ubuntu16.04-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_ARCH="i686"
CT_TARGET_VENDOR="ubuntu16.04"
CT_KERNEL_linux=y
CT_KERNEL_V_4_4=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_23=y
CT_CC_LANG_CXX=y
diff --git a/samples/mips-ar2315-linux-gnu/crosstool.config b/samples/mips-ar2315-linux-gnu/crosstool.config
index 579c801..55ae935 100644
--- a/samples/mips-ar2315-linux-gnu/crosstool.config
+++ b/samples/mips-ar2315-linux-gnu/crosstool.config
@@ -5,6 +5,7 @@ CT_ARCH_FLOAT_SW=y
CT_TARGET_VENDOR="ar2315"
CT_KERNEL_linux=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_GCC_mips_plt=y
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
diff --git a/samples/mips-malta-linux-gnu/crosstool.config b/samples/mips-malta-linux-gnu/crosstool.config
index 308a4d8..624d01d 100644
--- a/samples/mips-malta-linux-gnu/crosstool.config
+++ b/samples/mips-malta-linux-gnu/crosstool.config
@@ -2,6 +2,7 @@ CT_ARCH_mips=y
CT_TARGET_VENDOR="malta"
CT_KERNEL_linux=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_GCC_mips_plt=y
CT_CC_LANG_CXX=y
CT_DEBUG_gdb=y
diff --git a/samples/mipsel-multilib-linux-gnu/crosstool.config b/samples/mipsel-multilib-linux-gnu/crosstool.config
index 656541c..6f767a3 100644
--- a/samples/mipsel-multilib-linux-gnu/crosstool.config
+++ b/samples/mipsel-multilib-linux-gnu/crosstool.config
@@ -5,6 +5,7 @@ CT_ARCH_FLOAT_SW=y
CT_TARGET_VENDOR="multilib"
CT_KERNEL_linux=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY="--enable-targets=all"
CT_CC_GCC_EXTRA_CONFIG_ARRAY="--enable-targets=all"
CT_CC_GCC_mips_plt=y
diff --git a/samples/mipsel-unknown-linux-gnu/crosstool.config b/samples/mipsel-unknown-linux-gnu/crosstool.config
index 39ed4d6..11320bf 100644
--- a/samples/mipsel-unknown-linux-gnu/crosstool.config
+++ b/samples/mipsel-unknown-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_ARCH="mips1"
CT_ARCH_FLOAT_SW=y
CT_KERNEL_linux=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_CC_GCC_mips_plt=y
CT_CC_LANG_CXX=y
CT_DEBUG_duma=y
diff --git a/samples/msp430-unknown-elf/crosstool.config b/samples/msp430-unknown-elf/crosstool.config
new file mode 100644
index 0000000..1f25ed8
--- /dev/null
+++ b/samples/msp430-unknown-elf/crosstool.config
@@ -0,0 +1,2 @@
+CT_ARCH_msp430=y
+CT_DEBUG_gdb=y
diff --git a/samples/msp430-unknown-elf/reported.by b/samples/msp430-unknown-elf/reported.by
new file mode 100644
index 0000000..2518b77
--- /dev/null
+++ b/samples/msp430-unknown-elf/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Andrew Wygle"
+reporter_url="https://github.com/awygle"
+reporter_comment="MSP430 16-bit toolchain"
diff --git a/samples/samples.mk b/samples/samples.mk
index 5c8f130..ce7e7c9 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -48,7 +48,7 @@ show-config: .config
# Prints the details of a sample
PHONY += $(patsubst %,show-%,$(CT_SAMPLES))
-$(patsubst %,show-%,$(CT_SAMPLES)): show-%: config_files
+$(patsubst %,show-%,$(CT_SAMPLES)): show-%:
@KCONFIG_CONFIG=$$(pwd)/.config.sample \
$(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \
$(KCONFIG_TOP) >/dev/null
@@ -72,7 +72,7 @@ list-samples-pre: FORCE
@echo 'Status Sample name'
PHONY += $(patsubst %,list-%,$(CT_SAMPLES))
-$(patsubst %,list-%,$(CT_SAMPLES)): list-%: config_files
+$(patsubst %,list-%,$(CT_SAMPLES)): list-%:
@KCONFIG_CONFIG=$$(pwd)/.config.sample \
$(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \
$(KCONFIG_TOP) >/dev/null
@@ -87,7 +87,7 @@ list-samples-short: FORCE
# Check one sample
PHONY += $(patsubst %,check-%,$(CT_SAMPLES))
-$(patsubst %,check-%,$(CT_SAMPLES)): check-%: config_files
+$(patsubst %,check-%,$(CT_SAMPLES)): check-%:
@export KCONFIG_CONFIG=$$(pwd)/.config.sample; \
CT_NG_SAMPLE=$(call sample_dir,$*)/crosstool.config; \
$(CONF) -s --defconfig=$${CT_NG_SAMPLE} $(KCONFIG_TOP) &>/dev/null; \
@@ -119,7 +119,7 @@ wiki-samples-pre: FORCE
wiki-samples-post: FORCE
$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -W $(CT_SAMPLES)
-$(patsubst %,wiki-%,$(CT_SAMPLES)): wiki-%: config_files
+$(patsubst %,wiki-%,$(CT_SAMPLES)): wiki-%:
$(SILENT)KCONFIG_CONFIG=$$(pwd)/.config.sample \
$(CONF) --defconfig=$(call sample_dir,$*)/crosstool.config \
$(KCONFIG_TOP) >/dev/null
@@ -146,8 +146,8 @@ endef
# How we do recall one sample
PHONY += $(CT_SAMPLES)
-$(CT_SAMPLES): config_files
- @$(CT_ECHO) " CONF $(KCONFIG_TOP)"
+$(CT_SAMPLES):
+ @$(CT_ECHO) " CONF $@"
$(SILENT)$(CONF) --defconfig=$(call sample_dir,$@)/crosstool.config $(KCONFIG_TOP)
@echo
@echo '***********************************************************'
@@ -225,7 +225,7 @@ endif # MAKECMDGOALS contains a build sample rule
endif # MAKECMDGOALS != ""
# Build a single sample
-$(patsubst %,build-%,$(CT_SAMPLES)): build-%: config_files
+$(patsubst %,build-%,$(CT_SAMPLES)): build-%:
$(call build_sample,$*)
# Cross samples (build==host)
diff --git a/samples/sparc-leon-linux-uclibc/crosstool.config b/samples/sparc-leon-linux-uclibc/crosstool.config
index e5fa5ee..02c346d 100644
--- a/samples/sparc-leon-linux-uclibc/crosstool.config
+++ b/samples/sparc-leon-linux-uclibc/crosstool.config
@@ -9,6 +9,7 @@ CT_LIBC_uClibc=y
CT_LIBC_UCLIBC_CONFIG_FILE="${CT_LIB_DIR}/samples/${CT_TARGET}/uClibc.config"
CT_LIBC_UCLIBC_IPV6=y
CT_LIBC_UCLIBC_WCHAR=y
-CT_CC_GCC_V_4_9_4=y
+CT_CC_GCC_V_6_3_0=y
CT_CC_GCC_EXTRA_CONFIG_ARRAY="--disable-libitm"
CT_CC_LANG_CXX=y
+CT_DEBUG_gdb=y
diff --git a/samples/sparc-leon-linux-uclibc/uClibc.config b/samples/sparc-leon-linux-uclibc/uClibc.config
index abcfe40..c81724c 100644
--- a/samples/sparc-leon-linux-uclibc/uClibc.config
+++ b/samples/sparc-leon-linux-uclibc/uClibc.config
@@ -2,6 +2,8 @@ TARGET_sparc=y
# UCLIBC_HAS_FPU is not set
DO_C99_MATH=y
UCLIBC_HAS_THREADS_NATIVE=y
+UCLIBC_HAS_UTMPX=y
+UCLIBC_HAS_UTMP=y
UCLIBC_SUSV3_LEGACY=y
UCLIBC_SUSV4_LEGACY=y
# UNIX98PTY_ONLY is not set
@@ -9,9 +11,6 @@ UCLIBC_HAS_LIBUTIL=y
UCLIBC_HAS_SHA256_CRYPT_IMPL=y
UCLIBC_HAS_SHA512_CRYPT_IMPL=y
UCLIBC_HAS_IPV6=y
-UCLIBC_HAS_RPC=y
-UCLIBC_HAS_FULL_RPC=y
-UCLIBC_HAS_REENTRANT_RPC=y
UCLIBC_USE_NETLINK=y
UCLIBC_HAS_RESOLVER_SUPPORT=y
UCLIBC_HAS_LIBRESOLV_STUB=y
diff --git a/samples/x86_64-centos6-linux-gnu/crosstool.config b/samples/x86_64-centos6-linux-gnu/crosstool.config
index 4eb4611..ad84a6c 100644
--- a/samples/x86_64-centos6-linux-gnu/crosstool.config
+++ b/samples/x86_64-centos6-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_64=y
CT_TARGET_VENDOR="centos6"
CT_KERNEL_linux=y
CT_KERNEL_V_2_6_32=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_12_2=y
CT_CC_LANG_CXX=y
diff --git a/samples/x86_64-centos7-linux-gnu/crosstool.config b/samples/x86_64-centos7-linux-gnu/crosstool.config
index 4a441ef..8ca023c 100644
--- a/samples/x86_64-centos7-linux-gnu/crosstool.config
+++ b/samples/x86_64-centos7-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_64=y
CT_TARGET_VENDOR="centos7"
CT_KERNEL_linux=y
CT_KERNEL_V_3_10=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_17=y
CT_CC_LANG_CXX=y
diff --git a/samples/x86_64-multilib-linux-gnu/crosstool.config b/samples/x86_64-multilib-linux-gnu/crosstool.config
index c2e4f69..d3e5b63 100644
--- a/samples/x86_64-multilib-linux-gnu/crosstool.config
+++ b/samples/x86_64-multilib-linux-gnu/crosstool.config
@@ -7,6 +7,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_LIBC_GLIBC_KERNEL_VERSION_NONE=y
CT_CC_GCC_MULTILIB_LIST="m64,m32,mx32"
CT_CC_GCC_LNK_HASH_STYLE_BOTH=y
diff --git a/samples/x86_64-ubuntu12.04-linux-gnu/crosstool.config b/samples/x86_64-ubuntu12.04-linux-gnu/crosstool.config
index c09ab9d..3e2bc3f 100644
--- a/samples/x86_64-ubuntu12.04-linux-gnu/crosstool.config
+++ b/samples/x86_64-ubuntu12.04-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_64=y
CT_TARGET_VENDOR="ubuntu12.04"
CT_KERNEL_linux=y
CT_KERNEL_V_3_2=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_15=y
CT_CC_LANG_CXX=y
diff --git a/samples/x86_64-ubuntu14.04-linux-gnu/crosstool.config b/samples/x86_64-ubuntu14.04-linux-gnu/crosstool.config
index 68b3102..4aa16c7 100644
--- a/samples/x86_64-ubuntu14.04-linux-gnu/crosstool.config
+++ b/samples/x86_64-ubuntu14.04-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_64=y
CT_TARGET_VENDOR="ubuntu14.04"
CT_KERNEL_linux=y
CT_KERNEL_V_3_13=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_19=y
CT_CC_LANG_CXX=y
diff --git a/samples/x86_64-ubuntu16.04-linux-gnu/crosstool.config b/samples/x86_64-ubuntu16.04-linux-gnu/crosstool.config
index fc10edb..37be385 100644
--- a/samples/x86_64-ubuntu16.04-linux-gnu/crosstool.config
+++ b/samples/x86_64-ubuntu16.04-linux-gnu/crosstool.config
@@ -4,6 +4,7 @@ CT_ARCH_64=y
CT_TARGET_VENDOR="ubuntu16.04"
CT_KERNEL_linux=y
CT_KERNEL_V_4_4=y
+CT_LIBC_glibc=y
# CT_KERNEL_LINUX_INSTALL_CHECK is not set
CT_LIBC_GLIBC_V_2_23=y
CT_CC_LANG_CXX=y
diff --git a/samples/x86_64-unknown-linux-gnu/crosstool.config b/samples/x86_64-unknown-linux-gnu/crosstool.config
index e88ae77..3f7c338 100644
--- a/samples/x86_64-unknown-linux-gnu/crosstool.config
+++ b/samples/x86_64-unknown-linux-gnu/crosstool.config
@@ -5,6 +5,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_PLUGINS=y
+CT_LIBC_glibc=y
CT_LIBC_GLIBC_KERNEL_VERSION_NONE=y
CT_CC_GCC_LNK_HASH_STYLE_BOTH=y
CT_CC_LANG_CXX=y
diff --git a/samples/x86_64-w64-mingw32,arm-cortexa9_neon-linux-gnueabihf/crosstool.config b/samples/x86_64-w64-mingw32,arm-cortexa9_neon-linux-gnueabihf/crosstool.config
index 5690be3..34d1ea1 100644
--- a/samples/x86_64-w64-mingw32,arm-cortexa9_neon-linux-gnueabihf/crosstool.config
+++ b/samples/x86_64-w64-mingw32,arm-cortexa9_neon-linux-gnueabihf/crosstool.config
@@ -11,6 +11,7 @@ CT_KERNEL_linux=y
CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
+CT_LIBC_glibc=y
CT_LIBC_ADDONS_LIST="libidn"
CT_LIBC_LOCALES=y
CT_LIBC_GLIBC_KERNEL_VERSION_NONE=y
diff --git a/samples/x86_64-w64-mingw32,x86_64-pc-linux-gnu/crosstool.config b/samples/x86_64-w64-mingw32,x86_64-pc-linux-gnu/crosstool.config
index 631e8f0..efd43a0 100644
--- a/samples/x86_64-w64-mingw32,x86_64-pc-linux-gnu/crosstool.config
+++ b/samples/x86_64-w64-mingw32,x86_64-pc-linux-gnu/crosstool.config
@@ -10,6 +10,7 @@ CT_BINUTILS_LINKER_LD_GOLD=y
CT_BINUTILS_GOLD_THREADS=y
CT_BINUTILS_LD_WRAPPER=y
CT_BINUTILS_FOR_TARGET=y
+CT_LIBC_glibc=y
CT_CC_LANG_CXX=y
CT_DEBUG_ltrace=y
CT_DEBUG_strace=y
diff --git a/scripts/build/arch/arm.sh b/scripts/build/arch/arm.sh
index eeffc7d..8733ac3 100644
--- a/scripts/build/arch/arm.sh
+++ b/scripts/build/arch/arm.sh
@@ -18,6 +18,7 @@ CT_DoArchTupleValues() {
*glibc,y) CT_TARGET_SYS=gnueabi;;
uClibc,y) CT_TARGET_SYS=uclibc${CT_LIBC_UCLIBC_USE_GNU_SUFFIX:+gnu}eabi;;
musl,y) CT_TARGET_SYS=musleabi;;
+ bionic,y) CT_TARGET_SYS=android;;
*,y) CT_TARGET_SYS=eabi;;
esac
diff --git a/scripts/build/arch/mips.sh b/scripts/build/arch/mips.sh
index f91a80a..acb8851 100644
--- a/scripts/build/arch/mips.sh
+++ b/scripts/build/arch/mips.sh
@@ -48,6 +48,17 @@ CT_DoArchUClibcConfig() {
CT_KconfigDeleteOption "CONFIG_MIPS_ISA_MIPS64R2" "${cfg}"
}
+CT_DoArchUClibcHeaderDir() {
+ local dir_var="${1}"
+ local cflags="${2}"
+
+ # If it is non-default multilib, add a suffix with architecture (reported by gcc)
+ # to the headers installation path.
+ if [ -n "${cflags}" ]; then
+ eval "${dir_var}="$( ${CT_TARGET}-${CT_CC} -print-multiarch ${cflags} )
+ fi
+}
+
CT_DoArchUClibcCflags() {
local cfg="${1}"
local cflags="${2}"
diff --git a/scripts/build/arch/msp430.sh b/scripts/build/arch/msp430.sh
new file mode 100644
index 0000000..8edb72a
--- /dev/null
+++ b/scripts/build/arch/msp430.sh
@@ -0,0 +1,5 @@
+# Compute MSP430-specific values
+
+CT_DoArchTupleValues() {
+ CT_TARGET_ARCH="${CT_ARCH}"
+}
diff --git a/scripts/build/cc/100-gcc.sh b/scripts/build/cc/100-gcc.sh
index 190aec8..c45253a 100644
--- a/scripts/build/cc/100-gcc.sh
+++ b/scripts/build/cc/100-gcc.sh
@@ -337,10 +337,8 @@ do_gcc_core_backend() {
CT_DoLog EXTRA "Configuring final gcc compiler"
extra_user_config=( "${CT_CC_GCC_EXTRA_CONFIG_ARRAY[@]}" )
log_txt="final gcc compiler"
- if [ "${CT_CC_GCC_TARGET_FINAL}" = "y" ]; then
- # to inhibit the libiberty and libgcc tricks later on
- build_libgcc=no
- fi
+ # to inhibit the libiberty and libgcc tricks later on
+ build_libgcc=no
;;
*)
CT_Abort "Internal Error: 'build_step' must be one of: 'core1', 'core2', 'gcc_build' or 'gcc_host', not '${build_step:-(empty)}'"
@@ -663,10 +661,8 @@ do_gcc_core_backend() {
case "${build_step}" in
gcc_build|gcc_host)
- if [ "${CT_CC_GCC_TARGET_FINAL}" = "y" ]; then
- core_targets_all=all
- core_targets_install=install
- fi
+ core_targets_all=all
+ core_targets_install=install
;;
esac
diff --git a/scripts/build/companion_libs/050-zlib.sh b/scripts/build/companion_libs/050-zlib.sh
index 10779af..a3ba638 100644
--- a/scripts/build/companion_libs/050-zlib.sh
+++ b/scripts/build/companion_libs/050-zlib.sh
@@ -76,30 +76,51 @@ do_zlib_backend() {
local ldflags
local arg
local -a extra_config
+ local -a extra_make
for arg in "$@"; do
eval "${arg// /\\ }"
done
- CT_DoLog EXTRA "Configuring zlib"
-
- CT_DoExecLog CFG \
- CFLAGS="${cflags}" \
- LDFLAGS="${ldflags}" \
- CHOST="${host}" \
- ${CONFIG_SHELL} \
- "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/configure" \
- --prefix="${prefix}" \
- --static \
- "${extra_config[@]}"
+ case "${host}" in
+ *-mingw32)
+ # zlib treats mingw host differently and requires using a different
+ # makefile rather than configure+make. It also does not support
+ # out-of-tree building.
+ cp -av "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/." .
+ extra_make=( -f win32/Makefile.gcc \
+ PREFIX="${host}-" \
+ SHAREDLIB= \
+ IMPLIB= \
+ LIBRARY_PATH="${prefix}/lib" \
+ INCLUDE_PATH="${prefix}/include" \
+ BINARY_PATH="${prefix}/bin" \
+ prefix="${prefix}" \
+ )
+ ;;
+
+ *)
+ CT_DoLog EXTRA "Configuring zlib"
+
+ CT_DoExecLog CFG \
+ CFLAGS="${cflags}" \
+ LDFLAGS="${ldflags}" \
+ CHOST="${host}" \
+ ${CONFIG_SHELL} \
+ "${CT_SRC_DIR}/zlib-${CT_ZLIB_VERSION}/configure" \
+ --prefix="${prefix}" \
+ --static \
+ "${extra_config[@]}"
+ ;;
+ esac
CT_DoLog EXTRA "Building zlib"
- CT_DoExecLog ALL make ${JOBSFLAGS}
+ CT_DoExecLog ALL make "${extra_make[@]}" ${JOBSFLAGS}
if [ "${CT_COMPLIBS_CHECK}" = "y" ]; then
if [ "${host}" = "${CT_BUILD}" ]; then
CT_DoLog EXTRA "Checking zlib"
- CT_DoExecLog ALL make ${JOBSFLAGS} -s check
+ CT_DoExecLog ALL make "${extra_make[@]}" -s test
else
# Cannot run host binaries on build in a canadian cross
CT_DoLog EXTRA "Skipping check for zlib on the host"
@@ -107,7 +128,7 @@ do_zlib_backend() {
fi
CT_DoLog EXTRA "Installing zlib"
- CT_DoExecLog ALL make install
+ CT_DoExecLog ALL make "${extra_make[@]}" install
}
fi # CT_ZLIB
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 68510e1..98ef5e5 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -190,6 +190,7 @@ do_debug_gdb_build() {
CT_EndStep
fi
+ # TBD combine GDB native and gdbserver backends, build either or both in a single pass.
if [ "${CT_GDB_NATIVE}" = "y" ]; then
local -a native_extra_config
@@ -198,7 +199,9 @@ do_debug_gdb_build() {
native_extra_config=("${extra_config[@]}")
# We may not have C++ language configured for target
- native_extra_config+=("--disable-build-with-cxx")
+ if [ "${GDB_TARGET_DISABLE_CXX_BUILD}" = "y" ]; then
+ native_extra_config+=("--disable-build-with-cxx")
+ fi
# GDB on Mingw depends on PDcurses, not ncurses
if [ "${CT_MINGW32}" != "y" ]; then
@@ -317,7 +320,9 @@ do_debug_gdb_build() {
gdbserver_extra_config=("${extra_config[@]}")
# We may not have C++ language configured for target
- gdbserver_extra_config+=("--disable-build-with-cxx")
+ if [ "${GDB_TARGET_DISABLE_CXX_BUILD}" = "y" ]; then
+ gdbserver_extra_config+=("--disable-build-with-cxx")
+ fi
if [ "${CT_GDB_GDBSERVER_HAS_IPA_LIB}" = "y" ]; then
if [ "${CT_GDB_GDBSERVER_BUILD_IPA_LIB}" = "y" ]; then
diff --git a/scripts/build/libc/bionic.sh b/scripts/build/libc/bionic.sh
new file mode 100644
index 0000000..fcdc57f
--- /dev/null
+++ b/scripts/build/libc/bionic.sh
@@ -0,0 +1,43 @@
+# This file adds functions to extract the bionic C library from the Android NDK
+# Copyright 2017 Howard Chu
+# Licensed under the GPL v2. See COPYING in the root of this package
+
+do_libc_get() {
+ if [ "${CT_LIBC_BIONIC_CUSTOM}" = "y" ]; then
+ CT_GetCustom "bionic" "${CT_LIBC_BIONIC_CUSTOM_VERSION}" \
+ "${CT_LIBC_BIONIC_CUSTOM_LOCATION}"
+ else # ! custom location
+ CT_GetFile "android-ndk-${CT_LIBC_VERSION}-linux-x86_64.zip" https://dl.google.com/android/repository
+ fi # ! custom location
+}
+
+do_libc_extract() {
+ CT_Extract "android-ndk-${CT_LIBC_VERSION}-linux-x86_64"
+ CT_Pushd "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/"
+ CT_Patch nochdir bionic "${CT_LIBC_VERSION}"
+ CT_Popd
+}
+
+# Install Unified headers
+do_libc_start_files() {
+ CT_DoStep INFO "Installing C library headers"
+ CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/sysroot/usr" "${CT_SYSROOT_DIR}"
+}
+
+do_libc() {
+ local arch="${CT_ARCH}"
+ if [ "${CT_ARCH_64}" = "y" ]; then
+ if [ "${CT_ARCH}" = "x86" ]; then
+ arch="${arch}_"
+ fi
+ arch="${arch}64"
+ fi
+ CT_DoStep INFO "Installing C library binaries"
+ CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk-${CT_LIBC_VERSION}/platforms/android-${CT_ANDROID_API}/arch-${arch}/usr" "${CT_SYSROOT_DIR}"
+ CT_EnvModify CT_TARGET_CFLAGS "${CT_TARGET_CFLAGS} -D__ANDROID_API__=${CT_ANDROID_API}"
+}
+
+do_libc_post_cc() {
+ :
+}
+
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 68d6847..1464f0f 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -60,6 +60,8 @@ CT_TestAndAbort "Don't set CPLUS_INCLUDE_PATH. It screws up the build." -n "${CP
CT_TestAndAbort "Don't set OBJC_INCLUDE_PATH. It screws up the build." -n "${OBJC_INCLUDE_PATH}"
CT_TestAndAbort "Don't set CFLAGS. It screws up the build." -n "${CFLAGS}"
CT_TestAndAbort "Don't set CXXFLAGS. It screws up the build." -n "${CXXFLAGS}"
+CT_TestAndAbort "Don't set CC. It screws up the build." -n "${CC}"
+CT_TestAndAbort "Don't set CXX. It screws up the build." -n "${CXX}"
CT_Test "GREP_OPTIONS screws up the build. Resetting." -n "${GREP_OPTIONS}"
export GREP_OPTIONS=
# Workaround against openSUSE 12.1 that breaks ./configure for cross-compilation:
diff --git a/scripts/functions b/scripts/functions
index 39ec2b4..c1b99ce 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -1368,6 +1368,7 @@ CT_DoBuildTargetTuple() {
*glibc) CT_TARGET_SYS=gnu;;
uClibc) CT_TARGET_SYS=uclibc;;
musl) CT_TARGET_SYS=musl;;
+ bionic) CT_TARGET_SYS=android;;
avr-libc)
# avr-libc only seems to work with the non-canonical "avr" target.
CT_TARGET_SKIP_CONFIG_SUB=y
diff --git a/scripts/saveSample.sh.in b/scripts/saveSample.sh.in
index 2e413bd..2eb1f40 100644
--- a/scripts/saveSample.sh.in
+++ b/scripts/saveSample.sh.in
@@ -86,7 +86,7 @@ fi
# Now, actually save the defconfig
export KCONFIG_CONFIG="$(pwd)/.defconfig"
-${CONF} --savedefconfig="${samp_dir}/crosstool.config" "${KCONFIG_TOP}"
+srctree="${CT_LIB_DIR}" ${CONF} --savedefconfig="${samp_dir}/crosstool.config" "${KCONFIG_TOP}"
rm -f .defconfig
# Fill-in the reported-by info
diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh
index f3a21d2..e60e29f 100755
--- a/scripts/showSamples.sh
+++ b/scripts/showSamples.sh
@@ -101,7 +101,7 @@ dump_single_sample() {
cc=$(echo ${CT_CC} | ${awk} '{ print toupper($0)}')
version=$(eval echo \${CT_CC_${cc}_VERSION})
compiler=$(echo $cc | ${awk} '{print tolower($0)}')
- printf " $compiler | $version"
+ printf " $compiler-$version"
printf "\n"
printf " %-*s : %s" ${width} "Languages" "C"
[ "${CT_CC_LANG_CXX}" = "y" ] && printf ",C++"