summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore11
-rw-r--r--Makefile.am31
-rw-r--r--config/arch/arc.in16
-rw-r--r--config/arch/arm.in1
-rw-r--r--config/arch/riscv.in3
-rw-r--r--config/cc/gcc.in4
-rw-r--r--config/configure.in.in12
-rw-r--r--config/debug/gdb.in7
-rw-r--r--config/debug/gdb.in.gdbserver1
-rw-r--r--config/global/download.in5
-rw-r--r--config/global/extract.in18
-rw-r--r--config/global/paths.in2
-rw-r--r--config/libc/glibc.in12
-rw-r--r--configure.ac49
-rw-r--r--ct-ng.in23
-rw-r--r--debian/control3
-rwxr-xr-xdebian/rules4
-rw-r--r--kconfig/symbol.c8
-rw-r--r--m4/ctng_log.m429
-rw-r--r--m4/ctng_prog.m417
-rw-r--r--m4/ctng_prog_stat.m410
-rw-r--r--m4/ctng_version_check.m427
-rwxr-xr-xmaintainer/create-release.sh63
-rwxr-xr-xmaintainer/git-version-gen227
-rw-r--r--maintainer/kconfig-versions.template40
-rw-r--r--packages/android-ndk/r17c/chksum4
-rw-r--r--packages/android-ndk/r17c/version.desc (renamed from packages/linux/4.9.93/version.desc)0
-rw-r--r--packages/android-ndk/r18/DO_NOT_IMPORT2
-rw-r--r--packages/automake/1.11.6/0000-escape-left-brace.patch27
-rw-r--r--packages/automake/1.14.1/0000-escape-left-brace.patch27
-rw-r--r--packages/binutils/2.23.2/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.23.2/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.24/0003-ld_makefile_patch.patch (renamed from packages/binutils/2.24/0003-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.24/0004-check_ldrunpath_length.patch (renamed from packages/binutils/2.24/0004-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.25.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.25.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.26.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.26.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.27/0002-ld_makefile_patch.patch (renamed from packages/binutils/2.27/0002-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.27/0003-check_ldrunpath_length.patch (renamed from packages/binutils/2.27/0003-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.28.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.28.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.29.1/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.30/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.29.1/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.30/0001-ld_makefile_patch.patch (renamed from packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch)0
-rw-r--r--packages/binutils/2.30/0002-check_ldrunpath_length.patch (renamed from packages/binutils/2.30/0002-012_check_ldrunpath_length.patch)0
-rw-r--r--packages/binutils/2.31.1/0000-sh-conf.patch34
-rw-r--r--packages/binutils/2.31.1/0001-ld_makefile_patch.patch27
-rw-r--r--packages/binutils/2.31.1/0002-check_ldrunpath_length.patch24
-rw-r--r--packages/binutils/2.31.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch15
-rw-r--r--packages/binutils/2.31.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch105
-rw-r--r--packages/binutils/2.31.1/0005-Darwin-gold-binary-cc-include-string-not-cstring.patch15
-rw-r--r--packages/binutils/2.31.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch70
-rw-r--r--packages/binutils/2.31.1/0007-sysroot.patch41
-rw-r--r--packages/binutils/2.31.1/0008-poison-system-directories.patch279
-rw-r--r--packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch43
-rw-r--r--packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch85
-rw-r--r--packages/binutils/2.31.1/0011-Restore-build-on-x86_64-w64-mingw32.patch122
-rw-r--r--packages/binutils/2.31.1/chksum12
-rw-r--r--packages/binutils/2.31.1/version.desc (renamed from packages/linux/4.16.1/version.desc)0
-rw-r--r--packages/elf2flt/git-6d80ab6c/0000-diagnostics.h.patch30
-rw-r--r--packages/expat/2.2.5/chksum4
-rw-r--r--packages/expat/2.2.6/chksum4
-rw-r--r--packages/expat/2.2.6/version.desc (renamed from packages/linux/4.15/version.desc)0
-rw-r--r--packages/gcc-linaro/6.4-2017.11/chksum4
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0000-libtool-leave-framework-alone.patch (renamed from packages/gcc-linaro/7.2-2017.11/0000-libtool-leave-framework-alone.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0001-uclibc-conf.patch (renamed from packages/gcc-linaro/7.2-2017.11/0001-uclibc-conf.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0002-missing-execinfo_h.patch (renamed from packages/gcc-linaro/6.4-2017.11/0002-missing-execinfo_h.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0003-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch (renamed from packages/gcc-linaro/6.4-2017.11/0003-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch)6
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0004-gcc-plugin-POSIX-include-sys-select-h.patch (renamed from packages/gcc-linaro/6.4-2017.11/0004-gcc-plugin-POSIX-include-sys-select-h.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0005-arm-softfloat-libgcc.patch (renamed from packages/gcc-linaro/6.4-2017.11/0005-arm-softfloat-libgcc.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0006-arm_unbreak_armv4t.patch (renamed from packages/gcc-linaro/6.4-2017.11/0006-arm_unbreak_armv4t.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0007-cilk-wchar.patch (renamed from packages/gcc-linaro/6.4-2017.11/0007-cilk-wchar.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0008-fix-m68k-compile.patch (renamed from packages/gcc-linaro/6.4-2017.11/0008-fix-m68k-compile.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0009-fix-m68k-uclinux.patch (renamed from packages/gcc-linaro/6.4-2017.11/0009-fix-m68k-uclinux.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0010-libgcc-mkmap-symver-support-skip_underscore.patch (renamed from packages/gcc-linaro/6.4-2017.11/0010-libgcc-mkmap-symver-support-skip_underscore.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0011-libgcc-config-bfin-use-the-generic-linker-version-in.patch (renamed from packages/gcc-linaro/6.4-2017.11/0011-libgcc-config-bfin-use-the-generic-linker-version-in.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0012-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch (renamed from packages/gcc-linaro/6.4-2017.11/0012-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0013-bfin-define-REENTRANT.patch (renamed from packages/gcc-linaro/6.4-2017.11/0013-bfin-define-REENTRANT.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0014-libgfortran-missing-include.patch (renamed from packages/gcc-linaro/6.4-2017.11/0014-libgfortran-missing-include.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0015-nios2-bad-multilib-default.patch (renamed from packages/gcc-linaro/6.4-2017.11/0015-nios2-bad-multilib-default.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0016-libgcc-disable-split-stack-nothreads.patch (renamed from packages/gcc-linaro/6.4-2017.11/0016-libgcc-disable-split-stack-nothreads.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0017-uclinux-enable-threads.patch (renamed from packages/gcc-linaro/6.4-2017.11/0017-uclinux-enable-threads.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0018-bionic-ndk.patch (renamed from packages/gcc-linaro/6.4-2017.11/0018-bionic-ndk.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0019-bionic-errno.patch (renamed from packages/gcc-linaro/6.4-2017.11/0019-bionic-errno.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0020-crystax.patch (renamed from packages/gcc-linaro/6.4-2017.11/0020-crystax.patch)8
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0021-crystax.patch (renamed from packages/gcc-linaro/6.4-2017.11/0021-crystax.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0022-crystax.patch (renamed from packages/gcc-linaro/6.4-2017.11/0022-crystax.patch)6
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0023-crystax.patch (renamed from packages/gcc-linaro/6.4-2017.11/0023-crystax.patch)2
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0024-crystax.patch (renamed from packages/gcc-linaro/6.4-2017.11/0024-crystax.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0025-crystax.patch (renamed from packages/gcc-linaro/6.4-2017.11/0025-crystax.patch)2
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0026-crystax.patch (renamed from packages/gcc-linaro/6.4-2017.11/0026-crystax.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0027-crystax.patch (renamed from packages/gcc-linaro/6.4-2017.11/0027-crystax.patch)0
-rw-r--r--packages/gcc-linaro/6.4-2018.05/0028-isl-0.20.patch26
-rw-r--r--packages/gcc-linaro/6.4-2018.05/chksum4
-rw-r--r--packages/gcc-linaro/6.4-2018.05/version.desc (renamed from packages/linux/4.15.16/version.desc)0
-rw-r--r--packages/gcc-linaro/7.2-2017.11/chksum4
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0000-libtool-leave-framework-alone.patch (renamed from packages/gcc-linaro/6.4-2017.11/0000-libtool-leave-framework-alone.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0001-uclibc-conf.patch (renamed from packages/gcc-linaro/6.4-2017.11/0001-uclibc-conf.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch (renamed from packages/gcc-linaro/7.2-2017.11/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch)6
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0003-gcc-plugin-POSIX-include-sys-select-h.patch (renamed from packages/gcc-linaro/7.2-2017.11/0003-gcc-plugin-POSIX-include-sys-select-h.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0004-arm-softfloat-libgcc.patch (renamed from packages/gcc-linaro/7.2-2017.11/0004-arm-softfloat-libgcc.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0005-cilk-wchar.patch (renamed from packages/gcc-linaro/7.2-2017.11/0005-cilk-wchar.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0006-fix-m68k-uclinux.patch (renamed from packages/gcc-linaro/7.2-2017.11/0006-fix-m68k-uclinux.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0007-libgfortran-missing-include.patch (renamed from packages/gcc-linaro/7.2-2017.11/0007-libgfortran-missing-include.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0008-nios2-bad-multilib-default.patch (renamed from packages/gcc-linaro/7.2-2017.11/0008-nios2-bad-multilib-default.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0009-libgcc-disable-split-stack-nothreads.patch (renamed from packages/gcc-linaro/7.2-2017.11/0009-libgcc-disable-split-stack-nothreads.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0010-bionic-ndk.patch (renamed from packages/gcc-linaro/7.2-2017.11/0010-bionic-ndk.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0011-bionic-errno.patch (renamed from packages/gcc-linaro/7.2-2017.11/0011-bionic-errno.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0012-crystax.patch (renamed from packages/gcc-linaro/7.2-2017.11/0012-crystax.patch)10
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0013-crystax.patch (renamed from packages/gcc-linaro/7.2-2017.11/0013-crystax.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0014-crystax.patch (renamed from packages/gcc-linaro/7.2-2017.11/0014-crystax.patch)6
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0015-crystax.patch (renamed from packages/gcc-linaro/7.2-2017.11/0015-crystax.patch)2
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0016-crystax.patch (renamed from packages/gcc-linaro/7.2-2017.11/0016-crystax.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0017-crystax.patch (renamed from packages/gcc-linaro/7.2-2017.11/0017-crystax.patch)2
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0018-crystax.patch (renamed from packages/gcc-linaro/7.2-2017.11/0018-crystax.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0019-crystax.patch (renamed from packages/gcc-linaro/7.2-2017.11/0019-crystax.patch)0
-rw-r--r--packages/gcc-linaro/7.3-2018.05/0020-isl-0.20.patch26
-rw-r--r--packages/gcc-linaro/7.3-2018.05/chksum4
-rw-r--r--packages/gcc-linaro/7.3-2018.05/version.desc (renamed from packages/linux/4.14.33/version.desc)0
-rw-r--r--packages/gcc/5.5.0/0034-xtensa-fix-PR-target-65416.patch96
-rw-r--r--packages/gcc/6.4.0/0032-xtensa-fix-PR-target-65416.patch96
-rw-r--r--packages/gcc/6.4.0/0033-isl-0.20.patch26
-rw-r--r--packages/gcc/7.3.0/0022-xtensa-fix-PR-target-65416.patch96
-rw-r--r--packages/gcc/7.3.0/0023-isl-0.20.patch26
-rw-r--r--packages/gcc/8.2.0/0000-libtool-leave-framework-alone.patch18
-rw-r--r--packages/gcc/8.2.0/0001-uclibc-conf.patch17
-rw-r--r--packages/gcc/8.2.0/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch163
-rw-r--r--packages/gcc/8.2.0/0003-gcc-plugin-POSIX-include-sys-select-h.patch14
-rw-r--r--packages/gcc/8.2.0/0004-arm-softfloat-libgcc.patch31
-rw-r--r--packages/gcc/8.2.0/0005-fix-m68k-uclinux.patch21
-rw-r--r--packages/gcc/8.2.0/0006-libgfortran-missing-include.patch14
-rw-r--r--packages/gcc/8.2.0/0007-nios2-bad-multilib-default.patch31
-rw-r--r--packages/gcc/8.2.0/0008-libgcc-disable-split-stack-nothreads.patch17
-rw-r--r--packages/gcc/8.2.0/0009-bionic-ndk.patch60
-rw-r--r--packages/gcc/8.2.0/0010-crystax.patch523
-rw-r--r--packages/gcc/8.2.0/0011-crystax.patch27
-rw-r--r--packages/gcc/8.2.0/0012-crystax.patch293
-rw-r--r--packages/gcc/8.2.0/0013-crystax.patch22
-rw-r--r--packages/gcc/8.2.0/0014-crystax.patch26
-rw-r--r--packages/gcc/8.2.0/0015-crystax.patch33
-rw-r--r--packages/gcc/8.2.0/0016-crystax.patch23
-rw-r--r--packages/gcc/8.2.0/0017-crystax.patch34
-rw-r--r--packages/gcc/8.2.0/0018-ARC-Add-multilib-support-for-linux-targets.patch68
-rw-r--r--packages/gcc/8.2.0/0019-isl-0.20.patch26
-rw-r--r--packages/gcc/8.2.0/0020-ARM-fix-cmse.patch69
-rw-r--r--packages/gcc/8.2.0/0021-arm-Make-arm_cmse.h-C99-compatible.patch40
-rw-r--r--packages/gcc/8.2.0/chksum8
-rw-r--r--packages/gcc/8.2.0/version.desc (renamed from packages/linux/3.16.56/version.desc)0
-rw-r--r--packages/gdb/8.1.1/0000-musl_fix.patch (renamed from packages/gdb/8.1/0000-musl_fix.patch)0
-rw-r--r--packages/gdb/8.1.1/0001-uclibc-no-gettimeofday-clobber.patch (renamed from packages/gdb/8.1/0001-uclibc-no-gettimeofday-clobber.patch)0
-rw-r--r--packages/gdb/8.1.1/0002-xtensa-make-sure-ar_base-is-initialized.patch (renamed from packages/gdb/8.1/0002-xtensa-make-sure-ar_base-is-initialized.patch)0
-rw-r--r--packages/gdb/8.1.1/0003-WIP-end-of-prologue-detection-hack.patch (renamed from packages/gdb/8.1/0003-WIP-end-of-prologue-detection-hack.patch)0
-rw-r--r--packages/gdb/8.1.1/0004-allow-android.patch (renamed from packages/gdb/8.1/0004-allow-android.patch)0
-rw-r--r--packages/gdb/8.1.1/chksum8
-rw-r--r--packages/gdb/8.1.1/version.desc (renamed from packages/gdb/8.1/version.desc)0
-rw-r--r--packages/gdb/8.1/chksum8
-rw-r--r--packages/gdb/8.2/0000-musl_fix.patch33
-rw-r--r--packages/gdb/8.2/0001-uclibc-no-gettimeofday-clobber.patch33
-rw-r--r--packages/gdb/8.2/0002-xtensa-make-sure-ar_base-is-initialized.patch30
-rw-r--r--packages/gdb/8.2/0003-WIP-end-of-prologue-detection-hack.patch26
-rw-r--r--packages/gdb/8.2/0004-allow-android.patch45
-rw-r--r--packages/gdb/8.2/chksum8
-rw-r--r--packages/gdb/8.2/version.desc (renamed from packages/gcc-linaro/7.2-2017.11/version.desc)0
-rw-r--r--packages/gdb/package.desc2
-rw-r--r--packages/glibc-linaro/2.20-2014.11/0011-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc-linaro/2.20-2014.11/0012-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc-linaro/2.20-2014.11/0013-utmp-nonstring.patch80
-rw-r--r--packages/glibc-linaro/2.20-2014.11/0014-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc-linaro/2.20-2014.11/0015-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.12.1/0045-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.12.1/0046-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.12.1/0047-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.12.1/0048-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.12.1/0049-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.12.2/0008-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.12.2/0009-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.12.2/0010-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.12.2/0011-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.12.2/0012-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.13/0044-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.13/0045-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.13/0046-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.13/0047-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.13/0048-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.14.1/0044-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.14.1/0045-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.14.1/0046-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.14.1/0047-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.14/998-obstack-common.patch30
-rw-r--r--packages/glibc/2.15/0045-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.15/0046-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.15/0047-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.15/0048-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.15/0049-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.15/0050-fdivp-order.patch27
-rw-r--r--packages/glibc/2.16.0/0037-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.16.0/0038-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.16.0/0039-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.16.0/0040-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.16.0/0041-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.17/0013-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.17/0014-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.17/0015-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.17/0016-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.17/0017-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.18/0014-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.18/0015-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.18/0016-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.18/0017-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.18/0018-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.19/0012-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.19/0013-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.19/0014-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.19/0015-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.19/0016-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.20/0012-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.20/0013-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.20/0014-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.20/0015-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.20/0016-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.21/0012-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.21/0013-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.21/0014-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.21/0015-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.21/0016-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.22/0012-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.22/0013-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.22/0014-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.22/0015-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.22/0016-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.23/0008-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.23/0009-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.23/0010-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.23/0011-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.23/0012-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.24/0008-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.24/0009-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.24/0010-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.24/0011-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.24/0012-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.25/0007-strftime-multiple-stmts.patch73
-rw-r--r--packages/glibc/2.25/0008-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.25/0009-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.25/0010-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.25/0011-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.26/0002-if_nametoindex-size-check.patch29
-rw-r--r--packages/glibc/2.26/0003-utmp-nonstring.patch80
-rw-r--r--packages/glibc/2.26/0004-getlogin_r-use-strnlen.patch47
-rw-r--r--packages/glibc/2.26/0005-zic.c-use-memcpy.patch25
-rw-r--r--packages/glibc/2.27/version.desc1
-rw-r--r--packages/glibc/2.28/0000-typedef-caddr.patch17
-rw-r--r--packages/glibc/2.28/chksum12
-rw-r--r--packages/glibc/2.28/version.desc1
-rw-r--r--packages/glibc/package.desc2
-rw-r--r--packages/isl/0.20/chksum12
-rw-r--r--packages/isl/0.20/version.desc (renamed from packages/gcc-linaro/6.4-2017.11/version.desc)0
-rw-r--r--packages/isl/package.desc2
-rw-r--r--packages/linux/2.6.32.27/0000-unifdef-strclpy.patch15
-rw-r--r--packages/linux/2.6.32.27/chksum12
-rw-r--r--packages/linux/2.6.32.71/chksum8
-rw-r--r--packages/linux/2.6.32.71/version.desc (renamed from packages/linux/2.6.32.27/version.desc)2
-rw-r--r--packages/linux/3.16.56/chksum8
-rw-r--r--packages/linux/3.16.57/chksum8
-rw-r--r--packages/linux/3.16.57/version.desc (renamed from packages/expat/2.2.5/version.desc)0
-rw-r--r--packages/linux/3.18.104/chksum8
-rw-r--r--packages/linux/3.18.104/version.desc1
-rw-r--r--packages/linux/3.18.122/chksum8
-rw-r--r--packages/linux/3.18.122/version.desc (renamed from packages/linux/4.10.8/version.desc)0
-rw-r--r--packages/linux/4.14.33/chksum8
-rw-r--r--packages/linux/4.14.71/chksum8
-rw-r--r--packages/linux/4.14.71/version.desc0
-rw-r--r--packages/linux/4.15.16/chksum8
-rw-r--r--packages/linux/4.15.18/chksum8
-rw-r--r--packages/linux/4.15.18/version.desc0
-rw-r--r--packages/linux/4.15/chksum8
-rw-r--r--packages/linux/4.16.1/chksum8
-rw-r--r--packages/linux/4.16.18/chksum8
-rw-r--r--packages/linux/4.16.18/version.desc0
-rw-r--r--packages/linux/4.17.19/chksum8
-rw-r--r--packages/linux/4.17.19/version.desc0
-rw-r--r--packages/linux/4.18.9/chksum8
-rw-r--r--packages/linux/4.18.9/version.desc0
-rw-r--r--packages/linux/4.4.127/chksum8
-rw-r--r--packages/linux/4.4.157/chksum8
-rw-r--r--packages/linux/4.4.157/version.desc (renamed from packages/linux/4.4.127/version.desc)0
-rw-r--r--packages/linux/4.9.128/chksum8
-rw-r--r--packages/linux/4.9.128/version.desc0
-rw-r--r--packages/linux/4.9.93/chksum8
-rw-r--r--packages/linux/package.desc2
-rw-r--r--packages/m4/1.4.18/0000-fix-glibc-2.28.patch144
-rw-r--r--packages/make/4.2.1/0000-glob-v2.patch39
-rw-r--r--packages/make/4.2.1/0001-glob-v2-gl_lstat.patch64
-rw-r--r--packages/mingw-w64/v5.0.3/0001-xgetbv.patch32
-rw-r--r--packages/mingw-w64/v6.0.0/0000-mingw64-malloc.patch58
-rw-r--r--packages/mingw-w64/v6.0.0/chksum8
-rw-r--r--packages/mingw-w64/v6.0.0/version.desc0
-rw-r--r--packages/mpfr/4.0.1/0001-Fix-obsolete-ARC-asm-constraints.patch37
-rw-r--r--packages/musl/1.1.20/chksum4
-rw-r--r--packages/musl/1.1.20/version.desc0
-rw-r--r--packages/newlib/3.0.0.20180226/chksum4
-rw-r--r--packages/newlib/3.0.0.20180831/0000-fix-unaligned-access-memcpy-m68k.patch (renamed from packages/newlib/3.0.0.20180226/0000-fix-unaligned-access-memcpy-m68k.patch)0
-rw-r--r--packages/newlib/3.0.0.20180831/0001-fix-mt-cflags.patch (renamed from packages/newlib/3.0.0.20180226/0001-fix-mt-cflags.patch)0
-rw-r--r--packages/newlib/3.0.0.20180831/chksum4
-rw-r--r--packages/newlib/3.0.0.20180831/version.desc (renamed from packages/newlib/3.0.0.20180226/version.desc)0
-rw-r--r--packages/newlib/package.desc2
-rw-r--r--packages/strace/4.23/chksum4
-rw-r--r--packages/strace/4.23/version.desc0
-rw-r--r--packages/strace/4.24/chksum4
-rw-r--r--packages/strace/4.24/version.desc0
-rw-r--r--packages/uClibc-ng/1.0.30/chksum16
-rw-r--r--packages/uClibc-ng/1.0.30/version.desc0
-rw-r--r--paths.sh.in4
-rw-r--r--samples/arc-arc700-linux-uclibc/crosstool.config7
-rw-r--r--samples/arc-arc700-linux-uclibc/reported.by3
-rw-r--r--samples/arc-multilib-elf32/crosstool.config4
-rw-r--r--samples/arc-multilib-elf32/reported.by3
-rw-r--r--samples/arc-multilib-linux-uclibc/crosstool.config7
-rw-r--r--samples/arc-multilib-linux-uclibc/reported.by3
-rw-r--r--samples/riscv64-unknown-elf/crosstool.config7
-rw-r--r--samples/riscv64-unknown-elf/reported.by3
-rw-r--r--samples/riscv64-unknown-linux-gnu/crosstool.config12
-rw-r--r--samples/riscv64-unknown-linux-gnu/reported.by3
-rw-r--r--samples/samples.mk2
-rw-r--r--scripts/build/arch/arc.sh34
-rw-r--r--scripts/build/arch/arm.sh1
-rw-r--r--scripts/build/arch/powerpc.sh8
-rw-r--r--scripts/build/binutils/binutils.sh9
-rw-r--r--scripts/build/cc/gcc.sh18
-rw-r--r--scripts/build/companion_libs/200-libelf.sh2
-rw-r--r--scripts/build/companion_libs/210-expat.sh2
-rw-r--r--scripts/build/companion_libs/220-ncurses.sh2
-rw-r--r--scripts/build/debug/200-duma.sh4
-rw-r--r--scripts/build/debug/300-gdb.sh39
-rw-r--r--scripts/build/debug/400-ltrace.sh2
-rw-r--r--scripts/build/debug/500-strace.sh7
-rw-r--r--scripts/build/libc/bionic.sh6
-rw-r--r--scripts/build/libc/glibc.sh8
-rw-r--r--scripts/build/libc/mingw-w64.sh18
-rw-r--r--scripts/build/libc/newlib.sh12
-rw-r--r--scripts/crosstool-NG.sh40
-rw-r--r--scripts/functions160
-rw-r--r--scripts/override/__default3
-rw-r--r--testing/docker/archlinux/Dockerfile13
-rw-r--r--testing/docker/centos6/Dockerfile11
-rw-r--r--testing/docker/centos7/Dockerfile11
-rwxr-xr-xtesting/docker/common-scripts/ctng-build-sample5
-rwxr-xr-xtesting/docker/common-scripts/ctng-install7
-rwxr-xr-xtesting/docker/common-scripts/ctng-test-all12
-rwxr-xr-xtesting/docker/common-scripts/ctng-test-basic7
-rwxr-xr-xtesting/docker/common-scripts/su-as-user16
-rwxr-xr-xtesting/docker/dmgr.sh104
-rwxr-xr-xtesting/docker/docker-remove-all.sh8
-rw-r--r--testing/docker/fedora28/Dockerfile11
-rw-r--r--testing/docker/gentoo-amd64/Dockerfile9
-rw-r--r--testing/docker/mint19-amd64/Dockerfile12
-rw-r--r--testing/docker/ubuntu16.04/Dockerfile14
-rw-r--r--testing/docker/ubuntu18.04/Dockerfile14
-rw-r--r--testing/docker/ubuntu18.10/Dockerfile14
360 files changed, 8998 insertions, 470 deletions
diff --git a/.gitignore b/.gitignore
index f96b59b..8010036 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,8 +18,11 @@ config/versions/
verbatim-data.mk
maintainer/package-versions
-*.tar.xz
-*.tar.bz2
+# Compressed files
+*.tar*
+*.zip
+*.xz
+*.7zip
# Temporaries
.*.swp
@@ -29,7 +32,9 @@ temp.*
stamp-h1
# Testing
-testing/docker/build-*
+testing/docker/*/build
+testing/docker/*/install
+testing/docker/*/xtools
# This is the place where toolchains are built
.build/
diff --git a/Makefile.am b/Makefile.am
index 5ee3682..92b8af5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,8 @@ SUBDIRS = kconfig
bin_SCRIPTS = ct-ng
CLEANFILES = ct-ng bash-completion/ct-ng docs/ct-ng.1
-EXTRA_DIST = bootstrap ct-ng.in bash-completion/ct-ng.in docs/ct-ng.1.in maintainer
+EXTRA_DIST = bootstrap ct-ng.in bash-completion/ct-ng.in \
+ docs/ct-ng.1.in packages maintainer
if INSTALL_BASH_COMPLETION
compdir = @BASH_COMPLETION_DIR@
@@ -64,14 +65,34 @@ bash-completion/ct-ng: bash-completion/ct-ng.in Makefile
install-data-hook:
rm -f $(DESTDIR)$(man1dir)/$(ctng_progname).1.gz
gzip -9 $(DESTDIR)$(man1dir)/$(ctng_progname).1
- chmod +x $(DESTDIR)$(pkgdatadir)/scripts/config.guess
- chmod +x $(DESTDIR)$(pkgdatadir)/scripts/config.sub
+ chmod a+x $(DESTDIR)$(pkgdatadir)/scripts/config.guess
+ chmod a+x $(DESTDIR)$(pkgdatadir)/scripts/config.sub
if INSTALL_BASH_COMPLETION
- chmod -x $(DESTDIR)$(compdir)/$(ctng_progname)
+ chmod a-x $(DESTDIR)$(compdir)/$(ctng_progname)
endif
uninstall-hook:
rm -f $(DESTDIR)$(man1dir)/$(ctng_progname).1.gz
-dist-hook: maintainer/download-docs.sh
+dist-hook: fetch-docs gen-tarball-version
+
+.PHONY: fetch-docs
+fetch-docs: maintainer/download-docs.sh
$< $(top_distdir) $(USER_MANUAL_FILES)
+
+.PHONY: gen-tarball-version
+gen-tarball-version:
+ echo $(VERSION) > $(distdir)/.tarball-version
+
+DIGESTS = md5 sha1 sha512
+USE_GPG = yes
+
+dist-create-release: distcheck
+ for a in $(DIST_ARCHIVES); do \
+ for d in $(DIGESTS); do \
+ $${d}sum $${a} > $${a}.$${d}; \
+ done; \
+ if [ "$(USE_GPG)" = "yes" ]; then \
+ gpg --detach-sign $${a}; \
+ fi; \
+ done
diff --git a/config/arch/arc.in b/config/arch/arc.in
new file mode 100644
index 0000000..d7c6e04
--- /dev/null
+++ b/config/arch/arc.in
@@ -0,0 +1,16 @@
+# ARC specific configuration file
+
+## no-package
+## select ARCH_SUPPORTS_32
+## select ARCH_DEFAULT_32
+## select ARCH_SUPPORTS_BOTH_MMU
+## select ARCH_DEFAULT_HAS_MMU
+## select ARCH_SUPPORTS_EITHER_ENDIAN
+## select ARCH_DEFAULT_LE
+## select ARCH_SUPPORTS_WITH_CPU
+## select GCC_REQUIRE_7_or_later
+## select BINUTILS_REQUIRE_2_30_or_later
+## select LINUX_REQUIRE_4_8_or_later if KERNEL_LINUX
+##
+## help The Synopsys DesignWare ARC architecture, see more info here:
+## help https://www.synopsys.com/designware-ip/processor-solutions/arc-processors.html
diff --git a/config/arch/arm.in b/config/arch/arm.in
index 7ce7ef0..37575aa 100644
--- a/config/arch/arm.in
+++ b/config/arch/arm.in
@@ -15,6 +15,7 @@
## select ARCH_SUPPORTS_WITH_FLOAT if ARCH_32
## select ARCH_SUPPORTS_WITH_FPU if ARCH_32
## select ARCH_SUPPORTS_SOFTFP if ARCH_32
+## select LINUX_REQUIRE_3_7_or_later if ARCH_64 && KERNEL_LINUX
## help The ARM architecture, as defined by:
## help http://www.arm.com/
diff --git a/config/arch/riscv.in b/config/arch/riscv.in
index 4efde97..109556a 100644
--- a/config/arch/riscv.in
+++ b/config/arch/riscv.in
@@ -4,9 +4,12 @@
## depends on EXPERIMENTAL
##
## select ARCH_SUPPORTS_32
+## select ARCH_SUPPORTS_64
## select ARCH_DEFAULT_32
+## select ARCH_SUPPORTS_BOTH_MMU
## select ARCH_SUPPORTS_WITH_ABI
## select ARCH_SUPPORTS_WITH_ARCH
+## select ARCH_SUPPORTS_WITH_TUNE
## select GCC_REQUIRE_7_or_later
## help The RISC-V architecture, as defined by:
diff --git a/config/cc/gcc.in b/config/cc/gcc.in
index 48ec556..74fbb70 100644
--- a/config/cc/gcc.in
+++ b/config/cc/gcc.in
@@ -11,8 +11,10 @@
## select ISL_REQUIRE_0_15_or_later if ISL_NEEDED && GCC_7_or_later
# GCC6 requires ISL 0.14+ (it says 0.14-0.16, but accepts newer ISL as well)
## select ISL_REQUIRE_0_14_or_later if ISL_NEEDED && GCC_6_or_later
-# GCC5 requires ISL 0.12+ (again, it says 0.12-0.16, but also accepts newer ISL)
+# GCC5 requires ISL 0.12+ (again, it says 0.12-0.16, but also accepts newer ISL up to 0.18;
+# fails to compile with 0.19+)
## select ISL_REQUIRE_0_12_or_later if ISL_NEEDED && GCC_5_or_later
+## select ISL_REQUIRE_0_18_or_older if ISL_NEEDED && GCC_5_or_later && !GCC_6_or_later
# GCC4.9 requires ISL 0.10..0.15
# GCC4.8 requires ISL 0.10..0.14
## select ISL_REQUIRE_0_10_or_later if ISL_NEEDED && GCC_4_8_or_later
diff --git a/config/configure.in.in b/config/configure.in.in
index c8003a0..3d6a628 100644
--- a/config/configure.in.in
+++ b/config/configure.in.in
@@ -45,5 +45,17 @@ config CONFIGURE_has_svn
config CONFIGURE_has_git
@KCONFIG_git@
+config CONFIGURE_has_md5sum
+ @KCONFIG_md5sum@
+
+config CONFIGURE_has_sha1sum
+ @KCONFIG_sha1sum@
+
+config CONFIGURE_has_sha256sum
+ @KCONFIG_sha256sum@
+
+config CONFIGURE_has_sha512sum
+ @KCONFIG_sha512sum@
+
config CONFIGURE_has_install_with_strip_program
@KCONFIG_install_with_strip_program@
diff --git a/config/debug/gdb.in b/config/debug/gdb.in
index 02882aa..a9fab10 100644
--- a/config/debug/gdb.in
+++ b/config/debug/gdb.in
@@ -17,3 +17,10 @@ config GDB_HAS_PYTHON
config GDB_INSTALL_GDBINIT
bool
default y if GDB_7_0_or_later
+
+# GDB 8.0 now requires C++ for build. GDB 7.12 offered a configure
+# switch to fall back to C. We want to use that option because
+# the conversion in 7.12 was incomplete and had some breakages.
+config GDB_HAS_DISABLE_CXX_BUILD
+ def_bool y
+ depends on GDB_7_12_or_later && !GDB_8_0_or_later
diff --git a/config/debug/gdb.in.gdbserver b/config/debug/gdb.in.gdbserver
index 8e999b4..d7f1bb8 100644
--- a/config/debug/gdb.in.gdbserver
+++ b/config/debug/gdb.in.gdbserver
@@ -16,7 +16,6 @@ config GDB_GDBSERVER_HAS_IPA_LIB
depends on GDB_7_2_or_later
default y
-# gdbserver is then linked with "-static -Wl,--dynamic-list=..." which
config GDB_GDBSERVER_STATIC
bool
prompt "Build a static gdbserver"
diff --git a/config/global/download.in b/config/global/download.in
index 89b05ce..57f42e6 100644
--- a/config/global/download.in
+++ b/config/global/download.in
@@ -135,6 +135,7 @@ endif # USE_MIRROR
config VERIFY_DOWNLOAD_DIGEST
bool "Verify download digests (checksums)"
default y
+ depends on CONFIGURE_has_sha512sum || CONFIGURE_has_sha256sum || CONFIGURE_has_sha1sum || CONFIGURE_has_md5sum
if VERIFY_DOWNLOAD_DIGEST
@@ -143,14 +144,18 @@ choice
config VERIFY_DOWNLOAD_DIGEST_SHA512
bool "SHA-512"
+ depends on CONFIGURE_has_sha512sum
config VERIFY_DOWNLOAD_DIGEST_SHA256
+ depends on CONFIGURE_has_sha256sum
bool "SHA-256"
config VERIFY_DOWNLOAD_DIGEST_SHA1
+ depends on CONFIGURE_has_sha1sum
bool "SHA-1"
config VERIFY_DOWNLOAD_DIGEST_MD5
+ depends on CONFIGURE_has_md5sum
bool "MD5"
endchoice
diff --git a/config/global/extract.in b/config/global/extract.in
index 58f7b95..ba7f5f4 100644
--- a/config/global/extract.in
+++ b/config/global/extract.in
@@ -40,19 +40,16 @@ config ONLY_EXTRACT
Useful to look at the code before doing the build itself.
choice
- prompt "Patches origin"
- bool
+ bool "Patches origin"
default PATCH_BUNDLED
config PATCH_BUNDLED
- bool
- prompt "Bundled only"
+ bool "Bundled only"
help
Only apply patches bundled with crosstool-NG.
config PATCH_LOCAL
- bool
- prompt "Local only (EXPERIMENTAL)"
+ bool "Local only"
select PATCH_USE_LOCAL
depends on EXPERIMENTAL
help
@@ -61,16 +58,14 @@ config PATCH_LOCAL
copy them into your local directory if needed.
config PATCH_BUNDLED_LOCAL
- bool
- prompt "Bundled, then local"
+ bool "Bundled, then local"
select PATCH_USE_LOCAL
help
Apply the patches bundled with crosstool-NG, then apply your local
patches.
config PATCH_LOCAL_BUNDLED
- bool
- prompt "Local, then bundled"
+ bool "Local, then bundled"
select PATCH_USE_LOCAL
depends on EXPERIMENTAL
help
@@ -79,8 +74,7 @@ config PATCH_LOCAL_BUNDLED
to apply on top of your local patches.
config PATCH_NONE
- bool
- prompt "None"
+ bool "None"
depends on EXPERIMENTAL
help
Don't use any patch at all.
diff --git a/config/global/paths.in b/config/global/paths.in
index 39e15f3..b4e93ee 100644
--- a/config/global/paths.in
+++ b/config/global/paths.in
@@ -42,7 +42,7 @@ config WORK_DIR
config BUILD_TOP_DIR
string
- default "${CT_WORK_DIR}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
+ default "${CT_WORK_DIR:-${CT_TOP_DIR}/.build}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
config PREFIX_DIR
string
diff --git a/config/libc/glibc.in b/config/libc/glibc.in
index a297bb1..5916a83 100644
--- a/config/libc/glibc.in
+++ b/config/libc/glibc.in
@@ -320,4 +320,16 @@ config GLIBC_MIN_KERNEL
default LINUX_VERSION if GLIBC_KERNEL_VERSION_AS_HEADERS
default GLIBC_MIN_KERNEL_VERSION if GLIBC_KERNEL_VERSION_CHOSEN
+# All supported versions of glibc build cleanly with GCC7 and earlier.
+# GCC8-related fixes were only available in glibc 2.27.
+config GLIBC_ENABLE_WERROR
+ bool "Enable -Werror during the build"
+ default y if GCC_7_or_older
+ default y if GCC_8_or_later && GLIBC_2_27_or_later
+ help
+ By default, glibc enables strict warning checks during the build.
+ However, older version of glibc may not build with newer versions
+ of the compiler than there were available at the time of a glibc
+ release (because newer compilers typically have better diagnostics).
+
endif # KERNEL_LINUX
diff --git a/configure.ac b/configure.ac
index 765eae1..791cb7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,11 +3,9 @@
AC_PREREQ([2.67])
-# FIXME Temporary hack until the next release (we'll switch to plain numeric tags then)
-# FIXME need to quote sed expression
AC_INIT(
[crosstool-NG],
- [m4_esyscmd_s([git describe --always --dirty | sed s,^crosstool-ng-,,])],
+ [m4_esyscmd_s([maintainer/git-version-gen --prefix crosstool-ng- .tarball-version])],
[crossgcc@sourceware.org],
[crosstool-ng],
[http://crosstool-ng.org])
@@ -21,6 +19,9 @@ AC_CONFIG_MACRO_DIR([m4])
# - Request new tar format (old, tar-v7, breaks on long paths we have)
AM_INIT_AUTOMAKE([-Wall -Werror foreign no-dist-gzip dist-xz dist-bzip2 subdir-objects tar-pax])
+# To avoid stubbing autotools with missing script
+AM_MAINTAINER_MODE([enable])
+
# Safety check per autoconf best practices
AC_CONFIG_SRCDIR([ct-ng.in])
@@ -80,13 +81,15 @@ CTNG_PROG_VERSION_REQ_STRICT([SED],
[GNU sed >= 4.0],
[sed],
[gsed sed],
- ['GNU sed[^0-9]* [4-9]\.'])
+ [GNU sed[^0-9]* [4-9]\.])
AC_ARG_VAR([SED], [Specify the full path to GNU sed])
AC_CONFIG_HEADERS([config.h])
# Modern GCC/GDB releases require C++ support in the compiler
AC_PROG_CC
+# Add for legacy reasons (automake < 1.14)
+AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_LEX
@@ -120,7 +123,9 @@ CTNG_CHECK_PROGS_REQ([tar], [tar])
CTNG_CHECK_PROGS_REQ([gzip], [gzip])
CTNG_CHECK_PROGS_REQ([bzip2], [bzip2])
CTNG_CHECK_PROGS_REQ([xz], [xz])
+CTNG_CHECK_PROGS_REQ([unzip], [unzip])
CTNG_CHECK_PROGS_REQ([help2man], [help2man])
+CTNG_CHECK_PROGS_REQ([file], [file])
# Not a fatal failure even if we have neither - the tarballs may
# be provided in a local directory.
@@ -143,14 +148,14 @@ CTNG_PROG_VERSION_REQ_STRICT([BASH_SHELL],
[GNU bash >= 3.1],
[bash],
[bash],
- ['^GNU bash, version (3\.[1-9]|4)'])
+ [^GNU bash, version (3\.[1-9]|4)])
# We need a awk that *is* GNU awk
CTNG_PROG_VERSION_REQ_STRICT([AWK],
[GNU awk],
[awk],
[gawk awk],
- ['^GNU Awk '])
+ [^GNU Awk ])
# FIXME This checks for tools at the time configure runs. If a tool is later updated
# to satisfy our version requirement, we still won't be able to see that. Or worse,
@@ -163,50 +168,50 @@ CTNG_PROG_VERSION_REQ_ANY([MAKE],
[GNU make >= 3.81],
[make],
[gmake make],
- ['^GNU Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)'],
+ [^GNU Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)],
[make_3_81_or_newer])
# Check other companion tools that we may or may not build.
-CTNG_PROG_VERSION_REQ_STRICT([LIBTOOL],
+CTNG_PROG_VERSION([LIBTOOL],
[GNU libtool >= 2.4],
[libtool],
[glibtool libtool],
- ['\(GNU libtool\) ([3-9]\.|2.[4-9]|2.[1-3][0-9])'],
+ [\(GNU libtool\) ([3-9]\.|2.[4-9]|2.[1-3][0-9])],
[libtool_2_4_or_newer])
CTNG_PROG_VERSION([LIBTOOLIZE],
[GNU libtoolize >= 2.4],
[libtoolize],
[glibtoolize libtoolize],
- ['\(GNU libtool\) ([3-9]\.|2.[4-9]|2.[1-3][0-9])'],
+ [\(GNU libtool\) ([3-9]\.|2.[4-9]|2.[1-3][0-9])],
[libtoolize_2_4_or_newer])
CTNG_PROG_VERSION([AUTOCONF],
[GNU autoconf >= 2.65],
[autoconf],
[autoconf],
- ['\(GNU Autoconf\) ([3-9]\.|2\.[7-9][0-9]|2\.6[5-9])'],
+ [\(GNU Autoconf\) ([3-9]\.|2\.[7-9][0-9]|2\.6[5-9])],
[autoconf_2_65_or_newer])
CTNG_PROG_VERSION([AUTORECONF],
[GNU autoreconf >= 2.63],
[autoreconf],
[autoreconf],
- ['\(GNU Autoconf\) ([3-9]\.|2\.[7-9][0-9]|2\.6[5-9])'],
+ [\(GNU Autoconf\) ([3-9]\.|2\.[7-9][0-9]|2\.6[5-9])],
[autoreconf_2_65_or_newer])
CTNG_PROG_VERSION([AUTOMAKE],
[GNU automake >= 1.15],
[automake],
[automake],
- ['\(GNU automake\) ([2-9]\.|1\.[2-9][0-9]|1\.1[5-9])'],
+ [\(GNU automake\) ([2-9]\.|1\.[2-9][0-9]|1\.1[5-9])],
[automake_1_15_or_newer])
CTNG_PROG_VERSION([M4],
[GNU m4 >= 1.4.12],
[m4],
[gm4 m4],
- ['\(GNU M4\) ([2-9]\.|1\.[5-9]|1\.[1-4][0-9]|1\.4\.[2-9][0-9]|1\.4\.1[2-9])'],
+ [\(GNU M4\) ([2-9]\.|1\.[5-9]|1\.[1-4][0-9]|1\.4\.[2-9][0-9]|1\.4\.1[2-9])],
[gnu_m4_1_4_12_or_newer])
AC_SUBST([kconfig_options])
@@ -220,6 +225,16 @@ CTNG_SET_KCONFIG_OPTION([svn])
AC_CHECK_PROGS([git], [git])
CTNG_SET_KCONFIG_OPTION([git])
+# Check which tools we have for verifying the digest
+AC_PATH_PROGS([md5sum], [gmd5sum md5sum])
+AC_PATH_PROGS([sha1sum], [gsha1sum sha1sum])
+AC_PATH_PROGS([sha256sum], [gsha256sum sha256sum])
+AC_PATH_PROGS([sha512sum], [gsha512sum sha512sum])
+CTNG_SET_KCONFIG_OPTION([md5sum])
+CTNG_SET_KCONFIG_OPTION([sha1sum])
+CTNG_SET_KCONFIG_OPTION([sha256sum])
+CTNG_SET_KCONFIG_OPTION([sha512sum])
+
# FIXME why checking if not using the result? We don't provide replacemant malloc/alloca/...
AC_C_INLINE
AC_HEADER_STDC
@@ -284,12 +299,6 @@ AM_CONDITIONAL([INSTALL_USER_MANUAL], [test ! -f "${srcdir}/docs/MANUAL_ONLINE"]
AC_MSG_CHECKING([if the manual needs to be installed])
AM_COND_IF([INSTALL_USER_MANUAL], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
-# FIXME Retire? We don't want to debug a version that has been mislabeled by a user
-# Decorate the version string per user-supplied version.sh, if any
-AS_IF(
- [test -f version.sh -a -x version.sh],
- [PACKAGE_VERSION=$(./version.sh "${PACKAGE_VERSION}")])
-
AC_CONFIG_FILES([
Makefile
paths.sh
diff --git a/ct-ng.in b/ct-ng.in
index 2331b86..75f3354 100644
--- a/ct-ng.in
+++ b/ct-ng.in
@@ -17,9 +17,9 @@ export CT_TOP_DIR:=$(shell pwd)
ifeq (@enable_local@,yes)
# automake does not allow to set pkgxxxdir, they are always derived from
# a respective xxxdir. So, for enable-local case, set them directly here.
-export CT_LIB_DIR:=$(shell cd "@srcdir@" && pwd)
-export CT_LIBEXEC_DIR:=$(CT_TOP_DIR)/kconfig
-export CT_DOC_DIR:=$(CT_TOP_DIR)/docs
+export CT_LIB_DIR:=$(dir $(CT_NG))
+export CT_LIBEXEC_DIR:=$(CT_LIB_DIR)/kconfig
+export CT_DOC_DIR:=$(CT_LIB_DIR)/docs
else
# Paths and values set by ./configure
# Don't bother to change it other than with a new ./configure!
@@ -101,26 +101,29 @@ NCONF := $(CT_LIBEXEC_DIR)/nconf
# TBD needed? We do supply the defconfig name explicitly below
export srctree=$(CT_LIB_DIR)
-.PHONY: menuconfig nconfig oldconfig savedefconfig defconfig
+.PHONY: menuconfig nconfig oldconfig savedefconfig defconfig check-config
-menuconfig:
+check-config:
+ @[ ! -e .config -o -f .config ] || { echo ".config is not a regular file:"; ls -dl .config; exit 1; } >&2
+
+menuconfig: check-config
@$(CT_ECHO) " CONF $@"
$(SILENT)$(MCONF) $(KCONFIG_TOP)
-nconfig:
+nconfig: check-config
@$(CT_ECHO) " CONF $@"
$(SILENT)$(NCONF) $(KCONFIG_TOP)
-oldconfig: .config
+oldconfig: .config check-config
@$(CT_ECHO) " CONF $@"
$(SILENT)$(sed) -i -r -f $(CT_LIB_DIR)/scripts/upgrade.sed $<
$(SILENT)$(CONF) --silent$@ $(KCONFIG_TOP)
-savedefconfig: .config
+savedefconfig: .config check-config
@$(CT_ECHO) ' GEN $@'
$(SILENT)$(CONF) --savedefconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP)
-defconfig:
+defconfig: check-config
@$(CT_ECHO) ' CONF $@'
$(SILENT)$(CONF) --defconfig=$${DEFCONFIG-defconfig} $(KCONFIG_TOP)
@@ -229,7 +232,7 @@ source: .config
$(SILENT)CT_SOURCE=y $(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh
build: .config
- $(SILENT)BUILD_NCPUS=`@@CT_cpucount@@ 2>/dev/null || echo 0` \
+ $(SILENT)BUILD_NCPUS=`@CPU_COUNT@ 2>/dev/null || echo 0` \
$(bash) $(CT_LIB_DIR)/scripts/crosstool-NG.sh
build.%:
diff --git a/debian/control b/debian/control
index 4c2a95e..02be637 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: devel
Priority: optional
Maintainer: Multiple Candidates <open@example.com>
Build-Depends: debhelper (>= 9), autoconf, automake, autotools-dev,
- libncursesw5-dev, libncurses5-dev, bison, flex,
+ libncursesw5-dev, libncurses5-dev, bison, flex, curl, wget,
texinfo, help2man, gawk, git, subversion, bzip2, libtool-bin
Standards-Version: 3.9.8
Homepage: http://crosstool-ng.org/
@@ -11,6 +11,7 @@ Homepage: http://crosstool-ng.org/
Package: crosstool-ng
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, build-essential, texinfo
+Recommends: curl | wget
Description: create your own cross toolchains
Crosstool-NG aims at building toolchains. Toolchains are an essential
component in a software development project. It will compile, assemble and
diff --git a/debian/rules b/debian/rules
index 4a3a8e3..f766567 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,9 +26,5 @@ override_dh_auto_configure:
test -e configure || ./bootstrap
dh_auto_configure
-#Make sure to include bash completion file in the package
-override_dh_auto_install:
- dh_auto_install
-
override_dh_update_autotools_config:
@:
diff --git a/kconfig/symbol.c b/kconfig/symbol.c
index 3c8bd9b..35e0937 100644
--- a/kconfig/symbol.c
+++ b/kconfig/symbol.c
@@ -1150,8 +1150,7 @@ static void sym_check_print_recursive(struct symbol *last_sym)
if (stack->sym == last_sym)
fprintf(stderr, "%s:%d:error: recursive dependency detected!\n",
prop->file->name, prop->lineno);
- fprintf(stderr, "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n");
- fprintf(stderr, "subsection \"Kconfig recursive dependency limitations\"\n");
+
if (stack->expr) {
fprintf(stderr, "%s:%d:\tsymbol %s %s value contains %s\n",
prop->file->name, prop->lineno,
@@ -1181,6 +1180,11 @@ static void sym_check_print_recursive(struct symbol *last_sym)
}
}
+ fprintf(stderr,
+ "For a resolution refer to Documentation/kbuild/kconfig-language.txt\n"
+ "subsection \"Kconfig recursive dependency limitations\"\n"
+ "\n");
+
if (check_top == &cv_stack)
dep_stack_remove();
}
diff --git a/m4/ctng_log.m4 b/m4/ctng_log.m4
new file mode 100644
index 0000000..3f1428c
--- /dev/null
+++ b/m4/ctng_log.m4
@@ -0,0 +1,29 @@
+# CTNG_MSG_LOG(MSG)
+# Log the MSG message to config.log
+AC_DEFUN([CTNG_MSG_LOG],
+ [AS_ECHO(["$as_me:${as_lineno-$LINENO}: AS_ESCAPE([$1])"]) >&AS_MESSAGE_LOG_FD])
+
+# CTNG_MSG_LOG_CMD(CMD, [DESC])
+# Log the output of a command CMD to config.log, prepending the
+# description DESC.
+AC_DEFUN([CTNG_MSG_LOG_CMD],
+ [AS_IF([test -n "AS_ESCAPE([$2])"],
+ [AS_ECHO(["$as_me:${as_lineno-$LINENO}: AS_ESCAPE([$2]):"]) >&AS_MESSAGE_LOG_FD],
+ [AS_ECHO(["$as_me:${as_lineno-$LINENO}: output from command '$1':"]) >&AS_MESSAGE_LOG_FD])
+ $1 | sed 's/^/| /' >&AS_MESSAGE_LOG_FD])
+
+# CTNG_MSG_LOG_ENVVAR(VAR, [DESC])
+# Log the contents of an environment variable VAR to config.log, prepending the
+# description DESC.
+AC_DEFUN([CTNG_MSG_LOG_ENVVAR],
+ [AS_IF([test -n "AS_ESCAPE([$2])"],
+ [CTNG_MSG_LOG_CMD([AS_ECHO(["$$1"])], [$2])],
+ [CTNG_MSG_LOG_CMD([AS_ECHO(["$$1"])], [variable $1 is set to])])])
+
+# CTNG_MSG_LOG_FILE(FILE, [DESC])
+# Log the contents of a file FILE to config.log, prepending the
+# description DESC.
+AC_DEFUN([CTNG_MSG_LOG_FILE],
+ [AS_IF([test -n "AS_ESCAPE([$2])"],
+ [CTNG_MSG_LOG_CMD([cat $1], [$2])],
+ [CTNG_MSG_LOG_CMD([cat $1], [contents of $1])])])
diff --git a/m4/ctng_prog.m4 b/m4/ctng_prog.m4
index ebbe333..7ac9ef3 100644
--- a/m4/ctng_prog.m4
+++ b/m4/ctng_prog.m4
@@ -1,5 +1,15 @@
# Several convenience wrappers for checking the programs
+# Convert a pre-set tool variable to absolute path if it is not already.
+AC_DEFUN([CTNG_PATH_ABSNAME],
+ [CTNG_MSG_LOG_ENVVAR([$1], [must determine absolute path for '$$1'])
+ AS_CASE([$$1],
+ [/*],,
+ [*\ *],,
+ [?*],[AC_MSG_CHECKING([for absolute path to $$1])
+ $1=$(which $$1)
+ AC_MSG_RESULT([$$1])])])
+
# Check for required tool
AC_DEFUN([CTNG_CHECK_TOOL_REQ],
[AC_CHECK_TOOLS([$1], [$2])
@@ -12,12 +22,7 @@ AC_DEFUN([CTNG_CHECK_TOOL_REQ],
AC_DEFUN([CTNG_PATH_TOOL_REQ],
[AC_ARG_VAR([$1], [Specify the full path to GNU $3])
CTNG_CHECK_TOOL_REQ([$1], [$2])
- AS_CASE(
- [$$1],
- [/*],,
- [?*],[AC_MSG_CHECKING([for absolute path to $$1])
- $1=$(which $$1)
- AC_MSG_RESULT([$$1])])])
+ CTNG_PATH_ABSNAME([$1])])
# Check for required program
AC_DEFUN([CTNG_CHECK_PROGS_REQ],
diff --git a/m4/ctng_prog_stat.m4 b/m4/ctng_prog_stat.m4
index 6bee076..8a0b26a 100644
--- a/m4/ctng_prog_stat.m4
+++ b/m4/ctng_prog_stat.m4
@@ -7,9 +7,13 @@ AC_DEFUN([CTNG_PROG_STAT_FORMAT],
[ctng_cv_stat_flavor],
[touch conftest
chmod 642 conftest
- attr_bsd=$(stat -f '%Lp' conftest 2>/dev/null)
- attr_gnu=$(stat -c '%a' conftest 2>/dev/null)
- rm -f conftest
+ attr_bsd=$(stat -f '%Lp' conftest 2>conftest.stderr.bsd)
+ CTNG_MSG_LOG_ENVVAR([attr_bsd], [stat -f output])
+ CTNG_MSG_LOG_FILE([conftest.stderr.bsd])
+ attr_gnu=$(stat -c '%a' conftest 2>conftest.stderr.gnu)
+ CTNG_MSG_LOG_ENVVAR([attr_gnu], [stat -c output])
+ CTNG_MSG_LOG_FILE([conftest.stderr.gnu])
+ rm -f conftest conftest.stderr.*
AS_IF([test "$attr_bsd" = "642"],
[ctng_cv_stat_flavor=BSD],
[test "$attr_gnu" = "642"],
diff --git a/m4/ctng_version_check.m4 b/m4/ctng_version_check.m4
index 703661b..4518e0c 100644
--- a/m4/ctng_version_check.m4
+++ b/m4/ctng_version_check.m4
@@ -11,14 +11,27 @@ AC_DEFUN([CTNG_PROG_VERSION],
CTNG_WITH_DEPRECATED([$3], [$1])
AC_ARG_VAR([$1], [Specify the full path to $2])
ctng_version_$1_ok=false
- AC_CACHE_CHECK([for $3], [ac_cv_path_$1],
- [AC_PATH_PROGS_FEATURE_CHECK([$1], [$4],
- [[ver=$($ac_path_$1 --version 2>/dev/null| $EGREP $5)
- test -z "$ac_cv_path_$1" && ac_cv_path_$1=$ac_path_$1
- test -n "$ver" && ac_cv_path_$1="$ac_path_$1" ac_path_$1_found=: ctng_version_$1_ok=:]])])
+ # If a variable is already set, check if it an absolute path and convert if not.
+ # Autoconf's AC_PATH_PROGS* macros just blindly trust $1 to be correct - but
+ # AWK is set to just the command name by AC_INIT.
AS_IF([test -n "$$1"],
- [[ver=$($ac_cv_path_$1 --version 2>/dev/null| $EGREP $5)
- test -n "$ver" && ctng_version_$1_ok=:]])
+ [ac_cv_path_$1="$$1"
+ CTNG_PATH_ABSNAME([ac_cv_path_$1])
+ CTNG_MSG_LOG_ENVVAR([ac_cv_path_$1])
+ ver=$($ac_cv_path_$1 --version 2>/dev/null)
+ CTNG_MSG_LOG([looking for '[$5]' regexp in])
+ CTNG_MSG_LOG_ENVVAR([ver], [version info for $ac_cv_path_$1])
+ ver=$(AS_ECHO(["$ver"]) | $EGREP '[$5]')
+ test -n "$ver" && ctng_version_$1_ok=:],
+ [AC_CACHE_CHECK([for $3], [ac_cv_path_$1],
+ [AC_PATH_PROGS_FEATURE_CHECK([$1], [$4],
+ [CTNG_MSG_LOG_ENVVAR([ac_path_$1], [checking $1 at])
+ ver=$($ac_path_$1 --version 2>/dev/null)
+ CTNG_MSG_LOG([looking for '[$5]' regexp in])
+ CTNG_MSG_LOG_ENVVAR([ver], [version info])
+ ver=$(AS_ECHO(["$ver"]) | $EGREP '[$5]')
+ test -z "$ac_cv_path_$1" && ac_cv_path_$1=$ac_path_$1
+ test -n "$ver" && ac_cv_path_$1="$ac_path_$1" ac_path_$1_found=: ctng_version_$1_ok=:])])])
AC_MSG_CHECKING([for $2])
AS_IF([$ctng_version_$1_ok],
[AC_MSG_RESULT([yes])],
diff --git a/maintainer/create-release.sh b/maintainer/create-release.sh
index 498fc0a..ae6e8ec 100755
--- a/maintainer/create-release.sh
+++ b/maintainer/create-release.sh
@@ -1,20 +1,6 @@
#!/bin/bash
-formats=( "bz2" "xz" )
-declare -A tar_opt=( ["bz2"]=j ["xz"]=J )
-digests=( md5 sha1 sha512 )
-use_gpg=yes
-
-do_trace()
-{
- echo " --> $@" >&2
-}
-
-do_abort()
-{
- echo "ERROR: $@" >&2
- exit 1
-}
+set -ex
# Go to the top-level
topdir=`git rev-parse --show-toplevel`
@@ -22,49 +8,6 @@ if [ -z "${topdir}" ]; then
do_abort "Not in the Git clone"
fi
cd "${topdir}"
-
-# Determine the version. Replace the dashes with dots, as packaging
-# systems don't expect dashes in versions, but they're ok in package
-# name.
-version=`git describe | sed -r -e 's,-,.,g' -e 's,^crosstool\.ng\.,crosstool-ng-,'`
-do_trace "Creating release for ${version}"
-
-# Create the base working directory
-if [ -e "release" -a ! -d "release" ]; then
- do_abort "File 'release' already exists but is not a directory"
-fi
-mkdir -p "release"
-
-# Copy the base stuff
-do_trace "Copying crosstool-NG"
-rm -rf "release/${version}"
-git archive --prefix="${version}/" HEAD | tar xf - -C "release"
-
-# The rest of modifications are inside the release directory
-cd "release/${version}"
-
-# Run bootstrap before it is removed
-do_trace "Bootstrapping"
./bootstrap
-rm -f bootstrap
-
-# Remove other things not for the end user
-do_trace "Removing unreleased files"
-rm -f .travis.*
-find -name .gitignore | xargs rm
-rm -rf autom4te.cache maintainer
-
-# Go back to top level
-cd ../..
-
-# Package up
-do_trace "Packaging"
-for fmt in "${formats[@]}"; do
- tar c${tar_opt[$fmt]}f "release/${version}.tar.${fmt}" -C "release" "${version}"
- for h in "${digests[@]}"; do
- (cd "release" && ${h}sum "${version}.tar.${fmt}") > "release/${version}.tar.${fmt}.${h}"
- done
- if [ "${use_gpg}" = "yes" ]; then
- (cd "release" && gpg --detach-sign "${version}.tar.${fmt}")
- fi
-done
+./configure --enable-local
+make dist-create-release
diff --git a/maintainer/git-version-gen b/maintainer/git-version-gen
new file mode 100755
index 0000000..6d073fc
--- /dev/null
+++ b/maintainer/git-version-gen
@@ -0,0 +1,227 @@
+#!/bin/sh
+# Print a version string.
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 2007-2018 Free Software Foundation, Inc.
+#
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
+
+# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/.
+# It may be run two ways:
+# - from a git repository in which the "git describe" command below
+# produces useful output (thus requiring at least one signed tag)
+# - from a non-git-repo directory containing a .tarball-version file, which
+# presumes this script is invoked like "./git-version-gen .tarball-version".
+
+# In order to use intra-version strings in your project, you will need two
+# separate generated version string files:
+#
+# .tarball-version - present only in a distribution tarball, and not in
+# a checked-out repository. Created with contents that were learned at
+# the last time autoconf was run, and used by git-version-gen. Must not
+# be present in either $(srcdir) or $(builddir) for git-version-gen to
+# give accurate answers during normal development with a checked out tree,
+# but must be present in a tarball when there is no version control system.
+# Therefore, it cannot be used in any dependencies. GNUmakefile has
+# hooks to force a reconfigure at distribution time to get the value
+# correct, without penalizing normal development with extra reconfigures.
+#
+# .version - present in a checked-out repository and in a distribution
+# tarball. Usable in dependencies, particularly for files that don't
+# want to depend on config.h but do want to track version changes.
+# Delete this file prior to any autoconf run where you want to rebuild
+# files to pick up a version string change; and leave it stale to
+# minimize rebuild time after unrelated changes to configure sources.
+#
+# As with any generated file in a VC'd directory, you should add
+# /.version to .gitignore, so that you don't accidentally commit it.
+# .tarball-version is never generated in a VC'd directory, so needn't
+# be listed there.
+#
+# Use the following line in your configure.ac, so that $(VERSION) will
+# automatically be up-to-date each time configure is run (and note that
+# since configure.ac no longer includes a version string, Makefile rules
+# should not depend on configure.ac for version updates).
+#
+# AC_INIT([GNU project],
+# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+# [bug-project@example])
+#
+# Then use the following lines in your Makefile.am, so that .version
+# will be present for dependencies, and so that .version and
+# .tarball-version will exist in distribution tarballs.
+#
+# EXTRA_DIST = $(top_srcdir)/.version
+# BUILT_SOURCES = $(top_srcdir)/.version
+# $(top_srcdir)/.version:
+# echo $(VERSION) > $@-t && mv $@-t $@
+# dist-hook:
+# echo $(VERSION) > $(distdir)/.tarball-version
+
+
+me=$0
+
+version="git-version-gen $scriptversion
+
+Copyright 2011 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+
+usage="\
+Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
+Print a version string.
+
+Options:
+
+ --prefix PREFIX prefix of git tags (default 'v')
+ --fallback VERSION
+ fallback version to use if \"git --version\" fails
+
+ --help display this help and exit
+ --version output version information and exit
+
+Running without arguments will suffice in most cases."
+
+prefix=v
+fallback=
+
+while test $# -gt 0; do
+ case $1 in
+ --help) echo "$usage"; exit 0;;
+ --version) echo "$version"; exit 0;;
+ --prefix) shift; prefix=${1?};;
+ --fallback) shift; fallback=${1?};;
+ -*)
+ echo "$0: Unknown option '$1'." >&2
+ echo "$0: Try '--help' for more information." >&2
+ exit 1;;
+ *)
+ if test "x$tarball_version_file" = x; then
+ tarball_version_file="$1"
+ elif test "x$tag_sed_script" = x; then
+ tag_sed_script="$1"
+ else
+ echo "$0: extra non-option argument '$1'." >&2
+ exit 1
+ fi;;
+ esac
+ shift
+done
+
+if test "x$tarball_version_file" = x; then
+ echo "$usage"
+ exit 1
+fi
+
+tag_sed_script="${tag_sed_script:-s/x/x/}"
+
+nl='
+'
+
+# Avoid meddling by environment variable of the same name.
+v=
+v_from_git=
+
+# First see if there is a tarball-only version file.
+# then try "git describe", then default.
+if test -f $tarball_version_file
+then
+ v=`cat $tarball_version_file` || v=
+ case $v in
+ *$nl*) v= ;; # reject multi-line output
+ [0-9]*) ;;
+ *) v= ;;
+ esac
+ test "x$v" = x \
+ && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
+fi
+
+if test "x$v" != x
+then
+ : # use $v
+# Otherwise, if there is at least one git commit involving the working
+# directory, and "git describe" output looks sensible, use that to
+# derive a version string.
+elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
+ && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \
+ || git describe --abbrev=4 HEAD 2>/dev/null` \
+ && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
+ && case $v in
+ $prefix[0-9]*) ;;
+ *) (exit 1) ;;
+ esac
+then
+ # Is this a new git that lists number of commits since the last
+ # tag or the previous older version that did not?
+ # Newer: v6.10-77-g0f8faeb
+ # Older: v6.10-g0f8faeb
+ vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v
+ case $vprefix in
+ *-*) : git describe is probably okay three part flavor ;;
+ *)
+ : git describe is older two part flavor
+ # Recreate the number of commits and rewrite such that the
+ # result is the same as if we were using the newer version
+ # of git describe.
+ vtag=`echo "$v" | sed 's/-.*//'`
+ commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
+ || { commit_list=failed;
+ echo "$0: WARNING: git rev-list failed" 1>&2; }
+ numcommits=`echo "$commit_list" | wc -l`
+ v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
+ test "$commit_list" = failed && v=UNKNOWN
+ ;;
+ esac
+
+ # Change the penultimate "-" to ".", for version-comparing tools.
+ # Remove the "g" to save a byte.
+ v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
+ v_from_git=1
+elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
+ v=UNKNOWN
+else
+ v=$fallback
+fi
+
+v=`echo "$v" |sed "s/^$prefix//"`
+
+# Test whether to append the "-dirty" suffix only if the version
+# string we're using came from git. I.e., skip the test if it's "UNKNOWN"
+# or if it came from .tarball-version.
+if test "x$v_from_git" != x; then
+ # Don't declare a version "dirty" merely because a timestamp has changed.
+ git update-index --refresh > /dev/null 2>&1
+
+ dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
+ case "$dirty" in
+ '') ;;
+ *) # Append the suffix only if there isn't one already.
+ case $v in
+ *-dirty) ;;
+ *) v="$v-dirty" ;;
+ esac ;;
+ esac
+fi
+
+# Omit the trailing newline, so that m4_esyscmd can use the result directly.
+printf %s "$v"
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/maintainer/kconfig-versions.template b/maintainer/kconfig-versions.template
index d5d4cc8..3db512e 100644
--- a/maintainer/kconfig-versions.template
+++ b/maintainer/kconfig-versions.template
@@ -1,3 +1,5 @@
+#!// This file is not automatically generated, but we want this banner to
+#!// appear in the files produced from it.
#
# DO NOT EDIT! This file is automatically generated.
#
@@ -167,6 +169,44 @@ endif
endchoice
+if EXPERIMENTAL
+choice
+ bool "@@pkg_label@@ patches origin"
+ default @@fork|@@_PATCH_GLOBAL
+
+config @@fork|@@_PATCH_GLOBAL
+ bool "Per global policy"
+
+config @@fork|@@_PATCH_BUNDLED
+ bool "Bundled only"
+
+config @@fork|@@_PATCH_LOCAL
+ bool "Local only"
+ select PATCH_USE_LOCAL
+
+config @@fork|@@_PATCH_BUNDLED_LOCAL
+ bool "Bundled, then local"
+ select PATCH_USE_LOCAL
+
+config @@fork|@@_PATCH_LOCAL_BUNDLED
+ bool "Local, then bundled"
+ select PATCH_USE_LOCAL
+
+config @@fork|@@_PATCH_NONE
+ bool "None"
+
+endchoice
+endif
+
+config @@fork|@@_PATCH_ORDER
+ string
+ default "bundled" if @@fork|@@_PATCH_BUNDLED
+ default "local" if @@fork|@@_PATCH_LOCAL
+ default "bundled,local" if @@fork|@@_PATCH_BUNDLED_LOCAL
+ default "local,bundled" if @@fork|@@_PATCH_LOCAL_BUNDLED
+ default "none" if @@fork|@@_PATCH_NONE
+ default "global"
+
#!// Below, we explicitly select all milestones to which a given version
#!// compares greater-or-equal. We don't select just the latest applicable
#!// (and letting milestones chain-select each other, with FOO_6_or_later
diff --git a/packages/android-ndk/r17c/chksum b/packages/android-ndk/r17c/chksum
new file mode 100644
index 0000000..fd5b6f9
--- /dev/null
+++ b/packages/android-ndk/r17c/chksum
@@ -0,0 +1,4 @@
+md5 android-ndk-r17c-linux-x86_64.zip a4b6b8281e7d101efd994d31e64af746
+sha1 android-ndk-r17c-linux-x86_64.zip 12cacc70c3fd2f40574015631c00f41fb8a39048
+sha256 android-ndk-r17c-linux-x86_64.zip 3f541adbd0330a9205ba12697f6d04ec90752c53d6b622101a2a8a856e816589
+sha512 android-ndk-r17c-linux-x86_64.zip b8ad2aae0ea8caa7043c390c94c638c9499db22050c46b5e4f4b005fef6b47b7abdfb76c340c5a7e6024d8e6be926e07ab5556002c02919ba88f8b9469ed831e
diff --git a/packages/linux/4.9.93/version.desc b/packages/android-ndk/r17c/version.desc
index e69de29..e69de29 100644
--- a/packages/linux/4.9.93/version.desc
+++ b/packages/android-ndk/r17c/version.desc
diff --git a/packages/android-ndk/r18/DO_NOT_IMPORT b/packages/android-ndk/r18/DO_NOT_IMPORT
new file mode 100644
index 0000000..f2d097f
--- /dev/null
+++ b/packages/android-ndk/r18/DO_NOT_IMPORT
@@ -0,0 +1,2 @@
+r18 removed the support for GCC and is therefore useless in
+crosstool-NG (unless clang is supported).
diff --git a/packages/automake/1.11.6/0000-escape-left-brace.patch b/packages/automake/1.11.6/0000-escape-left-brace.patch
new file mode 100644
index 0000000..128f871
--- /dev/null
+++ b/packages/automake/1.11.6/0000-escape-left-brace.patch
@@ -0,0 +1,27 @@
+commit 13f00eb4493c217269b76614759e452d8302955e
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu Mar 31 16:35:29 2016 -0700
+
+ automake: port to Perl 5.22 and later
+
+ Without this change, Perl 5.22 complains "Unescaped left brace in
+ regex is deprecated" and this is planned to become a hard error in
+ Perl 5.26. See:
+ http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22{%22_should_now_be_escaped_in_a_pattern
+ * bin/automake.in (substitute_ac_subst_variables): Escape left brace.
+
+---
+ automake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/automake.in
++++ b/automake.in
+@@ -4156,7 +4156,7 @@
+ sub substitute_ac_subst_variables ($)
+ {
+ my ($text) = @_;
+- $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
++ $text =~ s/\$[{]([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge;
+ return $text;
+ }
+
diff --git a/packages/automake/1.14.1/0000-escape-left-brace.patch b/packages/automake/1.14.1/0000-escape-left-brace.patch
new file mode 100644
index 0000000..8a09d18
--- /dev/null
+++ b/packages/automake/1.14.1/0000-escape-left-brace.patch
@@ -0,0 +1,27 @@
+commit 13f00eb4493c217269b76614759e452d8302955e
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu Mar 31 16:35:29 2016 -0700
+
+ automake: port to Perl 5.22 and later
+
+ Without this change, Perl 5.22 complains "Unescaped left brace in
+ regex is deprecated" and this is planned to become a hard error in
+ Perl 5.26. See:
+ http://search.cpan.org/dist/perl-5.22.0/pod/perldelta.pod#A_literal_%22{%22_should_now_be_escaped_in_a_pattern
+ * bin/automake.in (substitute_ac_subst_variables): Escape left brace.
+
+---
+ bin/automake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/bin/automake.in
++++ b/bin/automake.in
+@@ -3872,7 +3872,7 @@
+ sub substitute_ac_subst_variables
+ {
+ my ($text) = @_;
+- $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
++ $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
+ return $text;
+ }
+
diff --git a/packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch b/packages/binutils/2.23.2/0001-ld_makefile_patch.patch
index 3992be3..3992be3 100644
--- a/packages/binutils/2.23.2/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.23.2/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.23.2/0002-check_ldrunpath_length.patch
index a24df5e..a24df5e 100644
--- a/packages/binutils/2.23.2/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.23.2/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.24/0003-001_ld_makefile_patch.patch b/packages/binutils/2.24/0003-ld_makefile_patch.patch
index ab6a74f..ab6a74f 100644
--- a/packages/binutils/2.24/0003-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.24/0003-ld_makefile_patch.patch
diff --git a/packages/binutils/2.24/0004-012_check_ldrunpath_length.patch b/packages/binutils/2.24/0004-check_ldrunpath_length.patch
index ce28120..ce28120 100644
--- a/packages/binutils/2.24/0004-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.24/0004-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.25.1/0001-ld_makefile_patch.patch
index c47d7d1..c47d7d1 100644
--- a/packages/binutils/2.25.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.25.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.25.1/0002-check_ldrunpath_length.patch
index 712eb19..712eb19 100644
--- a/packages/binutils/2.25.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.25.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.26.1/0001-ld_makefile_patch.patch
index d2e1cd9..d2e1cd9 100644
--- a/packages/binutils/2.26.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.26.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.26.1/0002-check_ldrunpath_length.patch
index e3d6508..e3d6508 100644
--- a/packages/binutils/2.26.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.26.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.27/0002-001_ld_makefile_patch.patch b/packages/binutils/2.27/0002-ld_makefile_patch.patch
index 79c4719..79c4719 100644
--- a/packages/binutils/2.27/0002-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.27/0002-ld_makefile_patch.patch
diff --git a/packages/binutils/2.27/0003-012_check_ldrunpath_length.patch b/packages/binutils/2.27/0003-check_ldrunpath_length.patch
index 7433351..7433351 100644
--- a/packages/binutils/2.27/0003-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.27/0003-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.28.1/0001-ld_makefile_patch.patch
index 36940de..36940de 100644
--- a/packages/binutils/2.28.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.28.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.28.1/0002-check_ldrunpath_length.patch
index 78f05ae..78f05ae 100644
--- a/packages/binutils/2.28.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.28.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.30/0001-001_ld_makefile_patch.patch b/packages/binutils/2.29.1/0001-ld_makefile_patch.patch
index 4623653..4623653 100644
--- a/packages/binutils/2.30/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.29.1/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.29.1/0002-check_ldrunpath_length.patch
index 9bdc413..9bdc413 100644
--- a/packages/binutils/2.29.1/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.29.1/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch b/packages/binutils/2.30/0001-ld_makefile_patch.patch
index 4623653..4623653 100644
--- a/packages/binutils/2.29.1/0001-001_ld_makefile_patch.patch
+++ b/packages/binutils/2.30/0001-ld_makefile_patch.patch
diff --git a/packages/binutils/2.30/0002-012_check_ldrunpath_length.patch b/packages/binutils/2.30/0002-check_ldrunpath_length.patch
index 026f279..026f279 100644
--- a/packages/binutils/2.30/0002-012_check_ldrunpath_length.patch
+++ b/packages/binutils/2.30/0002-check_ldrunpath_length.patch
diff --git a/packages/binutils/2.31.1/0000-sh-conf.patch b/packages/binutils/2.31.1/0000-sh-conf.patch
new file mode 100644
index 0000000..f4fb760
--- /dev/null
+++ b/packages/binutils/2.31.1/0000-sh-conf.patch
@@ -0,0 +1,34 @@
+r10231 | lethal | 2005-05-02 09:58:00 -0400 (Mon, 02 May 2005) | 13 lines
+
+Likewise, binutils has no idea about any of these new targets either, so we
+fix that up too.. now we're able to actually build a real toolchain for
+sh2a_nofpu- and other more ineptly named toolchains (and yes, there are more
+inept targets than that one, really. Go look, I promise).
+
+---
+ configure | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/configure
++++ b/configure
+@@ -3855,7 +3855,7 @@
+ nvptx*-*-*)
+ noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
+ ;;
+- sh-*-*)
++ sh*-*-*)
+ case "${target}" in
+ sh*-*-elf)
+ ;;
+--- a/configure.ac
++++ b/configure.ac
+@@ -1152,7 +1152,7 @@
+ nvptx*-*-*)
+ noconfigdirs="$noconfigdirs target-libssp target-libstdc++-v3 target-libobjc"
+ ;;
+- sh-*-*)
++ sh*-*-*)
+ case "${target}" in
+ sh*-*-elf)
+ ;;
diff --git a/packages/binutils/2.31.1/0001-ld_makefile_patch.patch b/packages/binutils/2.31.1/0001-ld_makefile_patch.patch
new file mode 100644
index 0000000..f73ff26
--- /dev/null
+++ b/packages/binutils/2.31.1/0001-ld_makefile_patch.patch
@@ -0,0 +1,27 @@
+---
+ ld/Makefile.am | 2 +-
+ ld/Makefile.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/ld/Makefile.am
++++ b/ld/Makefile.am
+@@ -57,7 +57,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+--- a/ld/Makefile.in
++++ b/ld/Makefile.in
+@@ -563,7 +563,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
diff --git a/packages/binutils/2.31.1/0002-check_ldrunpath_length.patch b/packages/binutils/2.31.1/0002-check_ldrunpath_length.patch
new file mode 100644
index 0000000..c0803d6
--- /dev/null
+++ b/packages/binutils/2.31.1/0002-check_ldrunpath_length.patch
@@ -0,0 +1,24 @@
+---
+ ld/emultempl/elf32.em | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -1471,6 +1471,8 @@
+ && command_line.rpath == NULL)
+ {
+ path = (const char *) getenv ("LD_RUN_PATH");
++ if ((path) && (strlen (path) == 0))
++ path = NULL;
+ if (path
+ && gld${EMULATION_NAME}_search_needed (path, &n, force))
+ break;
+@@ -1751,6 +1753,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (*rpath == '\0'))
++ rpath = NULL;
+
+ for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
+ if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
diff --git a/packages/binutils/2.31.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch b/packages/binutils/2.31.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch
new file mode 100644
index 0000000..99dee96
--- /dev/null
+++ b/packages/binutils/2.31.1/0003-MinGW-w64-winpthreads-doesnt-have-pthread_mutexattr_settype.patch
@@ -0,0 +1,15 @@
+---
+ gold/gold-threads.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/gold/gold-threads.cc
++++ b/gold/gold-threads.cc
+@@ -101,7 +101,7 @@
+ int err = pthread_mutexattr_init(&attr);
+ if (err != 0)
+ gold_fatal(_("pthead_mutexattr_init failed: %s"), strerror(err));
+-#ifdef PTHREAD_MUTEX_ADAPTIVE_NP
++#if defined(PTHREAD_MUTEX_ADAPTIVE_NP) && !defined(_WIN32)
+ err = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
+ if (err != 0)
+ gold_fatal(_("pthread_mutexattr_settype failed: %s"), strerror(err));
diff --git a/packages/binutils/2.31.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch b/packages/binutils/2.31.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch
new file mode 100644
index 0000000..9e9138b
--- /dev/null
+++ b/packages/binutils/2.31.1/0004-Dont-link-to-libfl-as-its-unnecessary.patch
@@ -0,0 +1,105 @@
+---
+ binutils/configure | 3 +++
+ binutils/configure.ac | 3 +++
+ gas/configure | 3 +++
+ gas/configure.ac | 3 +++
+ ld/configure | 3 +++
+ ld/configure.ac | 3 +++
+ 6 files changed, 18 insertions(+)
+
+--- a/binutils/configure
++++ b/binutils/configure
+@@ -12445,6 +12445,7 @@
+ done
+ test -n "$YACC" || YACC="yacc"
+
++save_LIBS=$LIBS
+ for ac_prog in flex lex
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+@@ -12608,6 +12609,8 @@
+ if test "$LEX" = :; then
+ LEX=${am_missing_run}flex
+ fi
++LIBS=$save_LIBS
++LEXLIB=
+
+ ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW"
+ # If we haven't got the data from the intl directory,
+--- a/binutils/configure.ac
++++ b/binutils/configure.ac
+@@ -86,7 +86,10 @@
+ fi
+
+ AC_PROG_YACC
++save_LIBS=$LIBS
+ AM_PROG_LEX
++LIBS=$save_LIBS
++LEXLIB=
+
+ ALL_LINGUAS="bg ca da es fi fr hr id it ja pt ro ru rw sk sr sv tr uk vi zh_CN zh_TW"
+ ZW_GNU_GETTEXT_SISTER_DIR
+--- a/gas/configure
++++ b/gas/configure
+@@ -13344,6 +13344,7 @@
+ done
+ test -n "$YACC" || YACC="yacc"
+
++save_LIBS=$LIBS
+ for ac_prog in flex lex
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+@@ -13507,6 +13508,8 @@
+ if test "$LEX" = :; then
+ LEX=${am_missing_run}flex
+ fi
++LIBS=$save_LIBS
++LEXLIB=
+
+ ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN"
+ # If we haven't got the data from the intl directory,
+--- a/gas/configure.ac
++++ b/gas/configure.ac
+@@ -795,7 +795,10 @@
+ AC_DEFINE_UNQUOTED(TARGET_OS, "${target_os}", [Target OS.])
+
+ AC_PROG_YACC
++save_LIBS=$LIBS
+ AM_PROG_LEX
++LIBS=$save_LIBS
++LEXLIB=
+
+ ALL_LINGUAS="es fi fr id ja ru rw sv tr uk zh_CN"
+ ZW_GNU_GETTEXT_SISTER_DIR
+--- a/ld/configure
++++ b/ld/configure
+@@ -16536,6 +16536,7 @@
+ done
+ test -n "$YACC" || YACC="yacc"
+
++save_LIBS=$LIBS
+ for ac_prog in flex lex
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+@@ -16699,6 +16700,8 @@
+ if test "$LEX" = :; then
+ LEX=${am_missing_run}flex
+ fi
++LIBS=$save_LIBS
++LEXLIB=
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+--- a/ld/configure.ac
++++ b/ld/configure.ac
+@@ -243,7 +243,10 @@
+ AC_EXEEXT
+
+ AC_PROG_YACC
++save_LIBS=$LIBS
+ AM_PROG_LEX
++LIBS=$save_LIBS
++LEXLIB=
+
+ AM_MAINTAINER_MODE
+ AM_CONDITIONAL(GENINSRC_NEVER, false)
diff --git a/packages/binutils/2.31.1/0005-Darwin-gold-binary-cc-include-string-not-cstring.patch b/packages/binutils/2.31.1/0005-Darwin-gold-binary-cc-include-string-not-cstring.patch
new file mode 100644
index 0000000..fbc4041
--- /dev/null
+++ b/packages/binutils/2.31.1/0005-Darwin-gold-binary-cc-include-string-not-cstring.patch
@@ -0,0 +1,15 @@
+---
+ gold/binary.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/gold/binary.cc
++++ b/gold/binary.cc
+@@ -23,7 +23,7 @@
+ #include "gold.h"
+
+ #include <cerrno>
+-#include <cstring>
++#include <string>
+
+ #include "elfcpp.h"
+ #include "stringpool.h"
diff --git a/packages/binutils/2.31.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch b/packages/binutils/2.31.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch
new file mode 100644
index 0000000..8e71dbb
--- /dev/null
+++ b/packages/binutils/2.31.1/0006-Darwin-Two-fixes-from-Android-NDK-PTHREAD_ONCE_INIT-wcsncasecmp.patch
@@ -0,0 +1,70 @@
+From c39479f4ab4d372b518957871e1f205a03e7c3d6 Mon Sep 17 00:00:00 2001
+From: Andrew Hsieh <andrewhsieh@google.com>
+Date: Wed, 18 Mar 2015 10:57:24 +0800
+Subject: [PATCH] Fix darwin build
+
+1. In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4
+ doesn't support ended initializer list
+2. wcsncasecmp doesn't exist in MacSDK10.6.x
+
+Change-Id: I69204a72f853f5263dffedc448379d75ed4eca2e
+---
+ bfd/peXXigen.c | 22 ++++++++++++++++++++++
+ gold/gold-threads.cc | 15 ++++++++++++---
+ 2 files changed, 34 insertions(+), 3 deletions(-)
+
+--- a/bfd/peXXigen.c
++++ b/bfd/peXXigen.c
+@@ -3621,6 +3621,28 @@
+ }
+ #endif /* HAVE_WCHAR_H and not Cygwin/Mingw */
+
++#if defined __APPLE__ && __DARWIN_C_LEVEL < 200809L
++/* wcsncasecmp isn't always defined in Mac SDK */
++static int
++wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n)
++{
++ wchar_t c1, c2;
++
++ if (n == 0)
++ return (0);
++ for (; *s1; s1++, s2++)
++ {
++ c1 = towlower(*s1);
++ c2 = towlower(*s2);
++ if (c1 != c2)
++ return ((int)c1 - c2);
++ if (--n == 0)
++ return (0);
++ }
++ return (-*s2);
++}
++#endif
++
+ /* Perform a comparison of two entries. */
+ static signed int
+ rsrc_cmp (bfd_boolean is_name, rsrc_entry * a, rsrc_entry * b)
+--- a/gold/gold-threads.cc
++++ b/gold/gold-threads.cc
+@@ -284,9 +284,18 @@
+ class Once_initialize
+ {
+ public:
+- Once_initialize()
+- : once_(PTHREAD_ONCE_INIT)
+- { }
++ Once_initialize()
++#if !defined(__APPLE__)
++ : once_(PTHREAD_ONCE_INIT)
++ { }
++#else
++// In Drawin PTHREAD_ONCE_INIT is {0x30B1BCBA, {0}} and the GCC < 4.4 doesn't support
++// extended initializer list as above */
++ {
++ pthread_once_t once_2 = PTHREAD_ONCE_INIT;
++ once_ = once_2;
++ }
++#endif
+
+ // Return a pointer to the pthread_once_t variable.
+ pthread_once_t*
diff --git a/packages/binutils/2.31.1/0007-sysroot.patch b/packages/binutils/2.31.1/0007-sysroot.patch
new file mode 100644
index 0000000..ba7940a
--- /dev/null
+++ b/packages/binutils/2.31.1/0007-sysroot.patch
@@ -0,0 +1,41 @@
+Signed-off-by: Sven Rebhan <odinshorse@googlemail.com>
+
+Always try to prepend the sysroot prefix to absolute filenames first.
+
+http://bugs.gentoo.org/275666
+http://sourceware.org/bugzilla/show_bug.cgi?id=10340
+
+---
+ ld/ldfile.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -338,18 +338,25 @@
+ directory first. */
+ if (!entry->flags.maybe_archive)
+ {
+- if (entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename))
++ /* For absolute pathnames, try to always open the file in the
++ sysroot first. If this fails, try to open the file at the
++ given location. */
++ entry->flags.sysrooted = is_sysrooted_pathname (entry->filename);
++ if (!entry->flags.sysrooted && IS_ABSOLUTE_PATH (entry->filename)
++ && ld_sysroot)
+ {
+ char *name = concat (ld_sysroot, entry->filename,
+ (const char *) NULL);
+ if (ldfile_try_open_bfd (name, entry))
+ {
+ entry->filename = name;
++ entry->flags.sysrooted = TRUE;
+ return TRUE;
+ }
+ free (name);
+ }
+- else if (ldfile_try_open_bfd (entry->filename, entry))
++
++ if (ldfile_try_open_bfd (entry->filename, entry))
+ return TRUE;
+
+ if (IS_ABSOLUTE_PATH (entry->filename))
diff --git a/packages/binutils/2.31.1/0008-poison-system-directories.patch b/packages/binutils/2.31.1/0008-poison-system-directories.patch
new file mode 100644
index 0000000..0a8079f
--- /dev/null
+++ b/packages/binutils/2.31.1/0008-poison-system-directories.patch
@@ -0,0 +1,279 @@
+Patch adapted to binutils 2.23.2 and extended to use
+BR_COMPILER_PARANOID_UNSAFE_PATH by Thomas Petazzoni.
+
+[Gustavo: adapt to binutils 2.25]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+
+Patch originally created by Mark Hatle, forward-ported to
+binutils 2.21 by Scott Garman.
+
+purpose: warn for uses of system directories when cross linking
+
+Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
+
+2008-07-02 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * ld.h (args_type): Add error_poison_system_directories.
+ * ld.texinfo (--error-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.error_poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.error_poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --error-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-06-13 Joseph Myers <joseph@codesourcery.com>
+
+ ld/
+ * config.in: Regenerate.
+ * ld.h (args_type): Add poison_system_directories.
+ * ld.texinfo (--no-poison-system-directories): Document.
+ * ldfile.c (ldfile_add_library_path): Check
+ command_line.poison_system_directories.
+ * ldmain.c (main): Initialize
+ command_line.poison_system_directories.
+ * lexsup.c (enum option_values): Add
+ OPTION_NO_POISON_SYSTEM_DIRECTORIES.
+ (ld_options): Add --no-poison-system-directories.
+ (parse_args): Handle new option.
+
+2007-04-20 Joseph Myers <joseph@codesourcery.com>
+
+ Merge from Sourcery G++ binutils 2.17:
+
+ 2007-03-20 Joseph Myers <joseph@codesourcery.com>
+ Based on patch by Mark Hatle <mark.hatle@windriver.com>.
+ ld/
+ * configure.ac (--enable-poison-system-directories): New option.
+ * configure, config.in: Regenerate.
+ * ldfile.c (ldfile_add_library_path): If
+ ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
+ /usr/lib, /usr/local/lib or /usr/X11R6/lib.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+---
+ ld/config.in | 3 +++
+ ld/configure | 14 ++++++++++++++
+ ld/configure.ac | 10 ++++++++++
+ ld/ld.h | 8 ++++++++
+ ld/ld.texi | 12 ++++++++++++
+ ld/ldfile.c | 17 +++++++++++++++++
+ ld/ldlex.h | 2 ++
+ ld/ldmain.c | 2 ++
+ ld/lexsup.c | 21 +++++++++++++++++++++
+ 9 files changed, 89 insertions(+)
+
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -31,6 +31,9 @@
+ language is requested. */
+ #undef ENABLE_NLS
+
++/* Define to warn for use of native system library directories */
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++
+ /* Additional extension a shared object might have. */
+ #undef EXTRA_SHLIB_EXTENSION
+
+--- a/ld/configure
++++ b/ld/configure
+@@ -822,6 +822,7 @@
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_compressed_debug_sections
+@@ -1486,6 +1487,8 @@
+ --disable-largefile omit support for large files
+ --enable-targets alternative target configurations
+ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
++ --enable-poison-system-directories
++ warn for use of native system library directories
+ --enable-gold[=ARG] build gold [ARG={default,yes,no}]
+ --enable-got=<type> GOT handling scheme (target, single, negative,
+ multigot)
+@@ -15803,7 +15806,18 @@
+ fi
+
+
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++ enableval=$enable_poison_system_directories;
++else
++ enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
+
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
+
+ # Check whether --enable-got was given.
+ if test "${enable_got+set}" = set; then :
+--- a/ld/configure.ac
++++ b/ld/configure.ac
+@@ -94,6 +94,16 @@
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+
++AC_ARG_ENABLE([poison-system-directories],
++ AS_HELP_STRING([--enable-poison-system-directories],
++ [warn for use of native system library directories]),,
++ [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++ [1],
++ [Define to warn for use of native system library directories])
++fi
++
+ dnl Use --enable-gold to decide if this linker should be the default.
+ dnl "install_as_default" is set to false if gold is the default linker.
+ dnl "installed_linker" is the installed BFD linker name.
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -175,6 +175,14 @@
+ /* If set, display the target memory usage (per memory region). */
+ bfd_boolean print_memory_usage;
+
++ /* If TRUE (the default) warn for uses of system directories when
++ cross linking. */
++ bfd_boolean poison_system_directories;
++
++ /* If TRUE (default FALSE) give an error for uses of system
++ directories when cross linking instead of a warning. */
++ bfd_boolean error_poison_system_directories;
++
+ /* Should we force section groups to be resolved? Controlled with
+ --force-group-allocation on the command line or FORCE_GROUP_ALLOCATION
+ in the linker script. */
+--- a/ld/ld.texi
++++ b/ld/ld.texi
+@@ -2479,6 +2479,18 @@
+
+ Passing @code{none} for @var{style} disables the setting from any
+ @code{--build-id} options earlier on the command line.
++
++@kindex --no-poison-system-directories
++@item --no-poison-system-directories
++Do not warn for @option{-L} options using system directories such as
++@file{/usr/lib} when cross linking. This option is intended for use
++in chroot environments when such directories contain the correct
++libraries for the target system rather than the host.
++
++@kindex --error-poison-system-directories
++@item --error-poison-system-directories
++Give an error instead of a warning for @option{-L} options using
++system directories when cross linking.
+ @end table
+
+ @c man end
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -116,6 +116,23 @@
+ new_dirs->name = concat (ld_sysroot, name + strlen ("$SYSROOT"), (const char *) NULL);
+ else
+ new_dirs->name = xstrdup (name);
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++ if (command_line.poison_system_directories
++ && ((!strncmp (name, "/lib", 4))
++ || (!strncmp (name, "/usr/lib", 8))
++ || (!strncmp (name, "/usr/local/lib", 14))
++ || (!strncmp (name, "/usr/X11R6/lib", 14))))
++ {
++ if (command_line.error_poison_system_directories)
++ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ else
++ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
++ "cross-compilation\n"), name);
++ }
++#endif
++
+ }
+
+ /* Try to open a BFD for a lang_input_statement. */
+--- a/ld/ldlex.h
++++ b/ld/ldlex.h
+@@ -148,6 +148,8 @@
+ OPTION_REQUIRE_DEFINED_SYMBOL,
+ OPTION_ORPHAN_HANDLING,
+ OPTION_FORCE_GROUP_ALLOCATION,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
+ };
+
+ /* The initial parser states. */
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -268,6 +268,8 @@
+ command_line.warn_mismatch = TRUE;
+ command_line.warn_search_mismatch = TRUE;
+ command_line.check_section_addresses = -1;
++ command_line.poison_system_directories = TRUE;
++ command_line.error_poison_system_directories = FALSE;
+
+ /* We initialize DEMANGLING based on the environment variable
+ COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -543,6 +543,14 @@
+ { {"orphan-handling", required_argument, NULL, OPTION_ORPHAN_HANDLING},
+ '\0', N_("=MODE"), N_("Control how orphan sections are handled."),
+ TWO_DASHES },
++ { {"no-poison-system-directories", no_argument, NULL,
++ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Do not warn for -L options using system directories"),
++ TWO_DASHES },
++ { {"error-poison-system-directories", no_argument, NULL,
++ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
++ '\0', NULL, N_("Give an error for -L options using system directories"),
++ TWO_DASHES },
+ };
+
+ #define OPTION_COUNT ARRAY_SIZE (ld_options)
+@@ -555,6 +563,7 @@
+ int ingroup = 0;
+ char *default_dirlist = NULL;
+ char *shortopts;
++ char *BR_paranoid_env;
+ struct option *longopts;
+ struct option *really_longopts;
+ int last_optind;
+@@ -1543,6 +1552,14 @@
+ }
+ break;
+
++ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
++ command_line.poison_system_directories = FALSE;
++ break;
++
++ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
++ command_line.error_poison_system_directories = TRUE;
++ break;
++
+ case OPTION_PUSH_STATE:
+ input_flags.pushed = xmemdup (&input_flags,
+ sizeof (input_flags),
+@@ -1586,6 +1603,10 @@
+ command_line.soname = NULL;
+ }
+
++ BR_paranoid_env = getenv("BR_COMPILER_PARANOID_UNSAFE_PATH");
++ if (BR_paranoid_env && strlen(BR_paranoid_env) > 0)
++ command_line.error_poison_system_directories = TRUE;
++
+ while (ingroup)
+ {
+ lang_leave_group ();
diff --git a/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch b/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch
new file mode 100644
index 0000000..2c70bd2
--- /dev/null
+++ b/packages/binutils/2.31.1/0009-xtensa-fix-relaxation-of-undefined-weak-references-i.patch
@@ -0,0 +1,43 @@
+From 5d3a462f05cba5b0c0c96de899b84fb84155c760 Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 22 Jul 2018 13:52:28 -0700
+Subject: [PATCH] xtensa: fix relaxation of undefined weak references in
+ shared objects
+
+The change c451bb34ae8b ("xtensa: don't emit dynamic relocation for weak
+undefined symbol") didn't properly handle shrinking of relocation
+sections due to coalescing of references to a dynamic undefined weak
+symbol in a shared object, which resulted in the following assertion
+failure in ld when linking uClibc-ng libthread_db for xtensa:
+
+ BFD (GNU Binutils) 2.31 internal error, aborting at elf32-xtensa.c:3269
+ in elf_xtensa_finish_dynamic_sections
+
+Shrink dynamic relocations section for dynamic undefined weak symbols
+when linking a shared object.
+
+bfd/
+2018-07-23 Max Filippov <jcmvbkbc@gmail.com>
+
+ * elf32-xtensa.c (shrink_dynamic_reloc_sections): Shrink dynamic
+ relocations section for dynamic undefined weak symbols when
+ linking a shared object.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Backported from: 5d3a462f05cba5b0c0c96de899b84fb84155c760
+---
+ bfd/elf32-xtensa.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -10022,7 +10022,8 @@
+ if ((r_type == R_XTENSA_32 || r_type == R_XTENSA_PLT)
+ && (input_section->flags & SEC_ALLOC) != 0
+ && (dynamic_symbol || bfd_link_pic (info))
+- && (!h || h->root.type != bfd_link_hash_undefweak))
++ && (!h || h->root.type != bfd_link_hash_undefweak
++ || (dynamic_symbol && bfd_link_dll (info))))
+ {
+ asection *srel;
+ bfd_boolean is_plt = FALSE;
diff --git a/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch b/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch
new file mode 100644
index 0000000..710d368
--- /dev/null
+++ b/packages/binutils/2.31.1/0010-xtensa-move-dynamic-relocations-sections-consistency.patch
@@ -0,0 +1,85 @@
+From f82863d797e461b936dff2b659a3aa65088ee87e Mon Sep 17 00:00:00 2001
+From: Max Filippov <jcmvbkbc@gmail.com>
+Date: Sun, 22 Jul 2018 18:59:11 -0700
+Subject: [PATCH] xtensa: move dynamic relocations sections consistency
+ check
+
+The function elf_xtensa_finish_dynamic_sections checks that sizes of
+sections .rela.dyn and .rela.plt match number of corresponding relocation
+records, but the check is only done when .rela.plt is non-empty, so, e.g.
+it is never run for the static PIE.
+Rearrange the test so that .rela.dyn and .rela.plt are checked always.
+
+bfd/
+2018-07-23 Max Filippov <jcmvbkbc@gmail.com>
+
+ * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Move
+ relocation sections consistency check to always check both
+ .rela.dyn and .rela.plt when they exist. Rearrange variable
+ definition and assignment places.
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+Backported from: f82863d797e461b936dff2b659a3aa65088ee87e
+---
+ bfd/elf32-xtensa.c | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+--- a/bfd/elf32-xtensa.c
++++ b/bfd/elf32-xtensa.c
+@@ -3156,7 +3156,7 @@
+ {
+ struct elf_xtensa_link_hash_table *htab;
+ bfd *dynobj;
+- asection *sdyn, *srelplt, *sgot, *sxtlit, *sgotloc;
++ asection *sdyn, *srelplt, *srelgot, *sgot, *sxtlit, *sgotloc;
+ Elf32_External_Dyn *dyncon, *dynconend;
+ int num_xtlit_entries = 0;
+
+@@ -3186,15 +3186,15 @@
+ }
+
+ srelplt = htab->elf.srelplt;
++ srelgot = htab->elf.srelgot;
+ if (srelplt && srelplt->size != 0)
+ {
+- asection *sgotplt, *srelgot, *spltlittbl;
++ asection *sgotplt, *spltlittbl;
+ int chunk, plt_chunks, plt_entries;
+ Elf_Internal_Rela irela;
+ bfd_byte *loc;
+ unsigned rtld_reloc;
+
+- srelgot = htab->elf.srelgot;
+ spltlittbl = htab->spltlittbl;
+ BFD_ASSERT (srelgot != NULL && spltlittbl != NULL);
+
+@@ -3260,14 +3260,6 @@
+ spltlittbl->contents + (chunk * 8) + 4);
+ }
+
+- /* All the dynamic relocations have been emitted at this point.
+- Make sure the relocation sections are the correct size. */
+- if (srelgot->size != (sizeof (Elf32_External_Rela)
+- * srelgot->reloc_count)
+- || srelplt->size != (sizeof (Elf32_External_Rela)
+- * srelplt->reloc_count))
+- abort ();
+-
+ /* The .xt.lit.plt section has just been modified. This must
+ happen before the code below which combines adjacent literal
+ table entries, and the .xt.lit.plt contents have to be forced to
+@@ -3282,6 +3274,14 @@
+ spltlittbl->flags &= ~SEC_HAS_CONTENTS;
+ }
+
++ /* All the dynamic relocations have been emitted at this point.
++ Make sure the relocation sections are the correct size. */
++ if ((srelgot && srelgot->size != (sizeof (Elf32_External_Rela)
++ * srelgot->reloc_count))
++ || (srelplt && srelplt->size != (sizeof (Elf32_External_Rela)
++ * srelplt->reloc_count)))
++ abort ();
++
+ /* Combine adjacent literal table entries. */
+ BFD_ASSERT (! bfd_link_relocatable (info));
+ sxtlit = bfd_get_section_by_name (output_bfd, ".xt.lit");
diff --git a/packages/binutils/2.31.1/0011-Restore-build-on-x86_64-w64-mingw32.patch b/packages/binutils/2.31.1/0011-Restore-build-on-x86_64-w64-mingw32.patch
new file mode 100644
index 0000000..d94293d
--- /dev/null
+++ b/packages/binutils/2.31.1/0011-Restore-build-on-x86_64-w64-mingw32.patch
@@ -0,0 +1,122 @@
+From be07c0ea2b943fe0bc8009432eadf157bbc2b718 Mon Sep 17 00:00:00 2001
+From: Alexey Neyman <stilor@att.net>
+Date: Sun, 7 Oct 2018 11:57:49 -0700
+Subject: [PATCH] Restore build on x86_64-w64-mingw32
+
+ * gold/configure.ac: Add checks for link, mkdtemp.
+ * gold/configure: Regenerated.
+ * gold/config.in: Regenerated.
+ * gold/plugin.cc (Plugin_recorder::init): Fall back to mktemp
+ if mkdtemp is not available.
+ (link_or_copy_file): Fall back to copy if link() is not available.
+
+Signed-off-by: Alexey Neyman <stilor@att.net>
+---
+ gold/config.in | 6 ++++++
+ gold/configure | 9 ++++++++-
+ gold/configure.ac | 5 ++++-
+ gold/plugin.cc | 14 ++++++++++++++
+ 4 files changed, 32 insertions(+), 2 deletions(-)
+
+--- a/gold/config.in
++++ b/gold/config.in
+@@ -103,6 +103,9 @@
+ /* Define if your <locale.h> file defines LC_MESSAGES. */
+ #undef HAVE_LC_MESSAGES
+
++/* Define to 1 if you have the `link' function. */
++#undef HAVE_LINK
++
+ /* Define to 1 if you have the <locale.h> header file. */
+ #undef HAVE_LOCALE_H
+
+@@ -112,6 +115,9 @@
+ /* Define to 1 if you have the <memory.h> header file. */
+ #undef HAVE_MEMORY_H
+
++/* Define to 1 if you have the `mkdtemp' function. */
++#undef HAVE_MKDTEMP
++
+ /* Define to 1 if you have the `mmap' function. */
+ #undef HAVE_MMAP
+
+--- a/gold/configure
++++ b/gold/configure
+@@ -7977,7 +7977,7 @@
+
+ done
+
+-for ac_func in chsize mmap
++for ac_func in chsize mmap link
+ do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+@@ -9878,6 +9878,13 @@
+ fi
+ done
+
++ac_fn_cxx_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
++if test "x$ac_cv_func_mkdtemp" = xyes; then :
++
++$as_echo "#define HAVE_MKDTEMP 1" >>confdefs.h
++
++fi
++
+ ac_fn_cxx_check_decl "$LINENO" "basename" "ac_cv_have_decl_basename" "$ac_includes_default"
+ if test "x$ac_cv_have_decl_basename" = xyes; then :
+ ac_have_decl=1
+--- a/gold/configure.ac
++++ b/gold/configure.ac
+@@ -529,7 +529,7 @@
+ AC_SUBST(LFS_CFLAGS)
+
+ AC_CHECK_HEADERS(sys/mman.h)
+-AC_CHECK_FUNCS(chsize mmap)
++AC_CHECK_FUNCS(chsize mmap link)
+ AC_REPLACE_FUNCS(pread ftruncate ffsll)
+
+ AC_CACHE_CHECK([mremap with MREMAP_MAYMOVE], [gold_cv_lib_mremap_maymove],
+@@ -614,6 +614,9 @@
+ AC_SUBST(DLOPEN_LIBS)
+
+ AC_CHECK_FUNCS(mallinfo posix_fallocate fallocate readv sysconf times)
++AC_CHECK_FUNC([mkdtemp],
++ AC_DEFINE([HAVE_MKDTEMP], 1,
++ [Define to 1 if you have the `mkdtemp' function.]))
+ AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp, strndup, memmem])
+
+ # Use of ::std::tr1::unordered_map::rehash causes undefined symbols
+--- a/gold/plugin.cc
++++ b/gold/plugin.cc
+@@ -508,8 +508,20 @@
+ // Create a temporary directory where we can stash the log and
+ // copies of replacement files.
+ char dir_template[] = "gold-recording-XXXXXX";
++#ifdef HAVE_MKDTEMP
+ if (mkdtemp(dir_template) == NULL)
+ return false;
++#else
++ if (mktemp(dir_template) == NULL)
++ return false;
++#if defined (_WIN32) && !defined (__CYGWIN32__)
++ if (mkdir(dir_template) != 0)
++ return false;
++#else
++ if (mkdir(dir_template, 0700) != 0)
++ return false;
++#endif
++#endif
+
+ size_t len = strlen(dir_template) + 1;
+ char* tempdir = new char[len];
+@@ -562,8 +574,10 @@
+ {
+ static char buf[4096];
+
++#ifdef HAVE_LINK
+ if (::link(inname, outname) == 0)
+ return true;
++#endif
+
+ int in = ::open(inname, O_RDONLY);
+ if (in < 0)
diff --git a/packages/binutils/2.31.1/chksum b/packages/binutils/2.31.1/chksum
new file mode 100644
index 0000000..a94831b
--- /dev/null
+++ b/packages/binutils/2.31.1/chksum
@@ -0,0 +1,12 @@
+md5 binutils-2.31.1.tar.xz 5b7c9d4ce96f507d95c1b9a255e52418
+sha1 binutils-2.31.1.tar.xz 3b031410897fe224412f3a6a1b052402d2fbcc6a
+sha256 binutils-2.31.1.tar.xz 5d20086ecf5752cc7d9134246e9588fa201740d540f7eb84d795b1f7a93bca86
+sha512 binutils-2.31.1.tar.xz 0fca326feb1d5f5fe505a827b20237fe3ec9c13eaf7ec7e35847fd71184f605ba1cefe1314b1b8f8a29c0aa9d88162849ee1c1a3e70c2f7407d88339b17edb30
+md5 binutils-2.31.1.tar.bz2 84edf97113788f106d6ee027f10b046a
+sha1 binutils-2.31.1.tar.bz2 1c5b0801b4857031d5626d917808cbd5c6401a4b
+sha256 binutils-2.31.1.tar.bz2 ffcc382695bf947da6135e7436b8ed52d991cf270db897190f19d6f9838564d0
+sha512 binutils-2.31.1.tar.bz2 b42954e6f49a0adcd2676bdd77dfb59bfc25cec8184b007521d1e2b1d5d0593b58639e3d9448d5a40fe024c3cea386a37743627d6bb16d502f52a4a32b9573bd
+md5 binutils-2.31.1.tar.gz b88812a18c7d850e015235c1cea75a23
+sha1 binutils-2.31.1.tar.gz 1c18b9375eb1d3a1ee118ddbd9ab08bfd7dc7b27
+sha256 binutils-2.31.1.tar.gz e88f8d36bd0a75d3765a4ad088d819e35f8d7ac6288049780e2fefcad18dde88
+sha512 binutils-2.31.1.tar.gz 6e8867cacf58a6f79122ccee00afbb894c1709375580afc14b523dc7d123029bf2532f9f71e4c6c7072b2d708cc97a370c922d80fa17b3ee3ddeb49110cd749b
diff --git a/packages/linux/4.16.1/version.desc b/packages/binutils/2.31.1/version.desc
index e69de29..e69de29 100644
--- a/packages/linux/4.16.1/version.desc
+++ b/packages/binutils/2.31.1/version.desc
diff --git a/packages/elf2flt/git-6d80ab6c/0000-diagnostics.h.patch b/packages/elf2flt/git-6d80ab6c/0000-diagnostics.h.patch
new file mode 100644
index 0000000..b74a0ac
--- /dev/null
+++ b/packages/elf2flt/git-6d80ab6c/0000-diagnostics.h.patch
@@ -0,0 +1,30 @@
+commit 2c8ab83ec84662f4916b5237da3e4330956a32eb
+Author: Alexey Neyman <stilor@att.net>
+Date: Sat Sep 29 13:12:08 2018 -0700
+
+ Create symlink to <bfd/diagnostics.h> in bfd-headers
+
+ Included by <bfd/bfd.h>.
+
+ Signed-off-by: Alexey Neyman <stilor@att.net>
+
+diff --git a/Makefile.in b/Makefile.in
+index cfad06c..8162cba 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -123,11 +123,14 @@ sinclude .deps
+ $(CC) -MM $(CPPFLAGS) $(srcdir)/*.c > .deps
+
+
++# Not all versions of binutils have all these headers, some may end up
++# as dangling symlinks
+ bfd-headers/.stamp:
+ rm -rf bfd-headers
+ mkdir bfd-headers
+ ln -sf $(BFD_INCLUDE_DIR)/bfd.h bfd-headers/bfd.h
+- for f in ansidecl filenames hashtab libiberty symcat; do \
++ ln -sf $(BFD_INCLUDE_DIR)/diagnostics.h bfd-headers/diagnostics.h
++ for f in ansidecl filenames hashtab libiberty symcat diagnostics; do \
+ ln -sf $(BINUTILS_INCLUDE_DIR)/$$f.h bfd-headers/$$f.h || exit 1; \
+ done
+ ln -sf $(BINUTILS_INCLUDE_DIR)/elf bfd-headers/elf
diff --git a/packages/expat/2.2.5/chksum b/packages/expat/2.2.5/chksum
deleted file mode 100644
index aefa26a..0000000
--- a/packages/expat/2.2.5/chksum
+++ /dev/null
@@ -1,4 +0,0 @@
-md5 expat-2.2.5.tar.bz2 789e297f547980fc9ecc036f9a070d49
-sha1 expat-2.2.5.tar.bz2 490659abd7d6c6d4cb4e60c945a15fbf081564f6
-sha256 expat-2.2.5.tar.bz2 d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6
-sha512 expat-2.2.5.tar.bz2 8226970a7e5d2b8d7818081758ca59bb6ce2d655feaa9d3a92481629000b73fde4782f50343d58ec4e1cebe75649e1980f636775a731d8aa4b55ceb843d9f637
diff --git a/packages/expat/2.2.6/chksum b/packages/expat/2.2.6/chksum
new file mode 100644
index 0000000..16ea962
--- /dev/null
+++ b/packages/expat/2.2.6/chksum
@@ -0,0 +1,4 @@
+md5 expat-2.2.6.tar.bz2 ca047ae951b40020ac831c28859161b2
+sha1 expat-2.2.6.tar.bz2 c8947fc3119a797b55485f2f7bdaaeb49cc9df01
+sha256 expat-2.2.6.tar.bz2 17b43c2716d521369f82fc2dc70f359860e90fa440bea65b3b85f0b246ea81f2
+sha512 expat-2.2.6.tar.bz2 dbfb635a5fe7b190722664263a0dd437b512fdf519bc53bd4905567f4bfb4b1e89a021562da63df8cacd48b706d1dea60ccde47f279e57400ad3c846b6e9c4e6
diff --git a/packages/linux/4.15/version.desc b/packages/expat/2.2.6/version.desc
index e69de29..e69de29 100644
--- a/packages/linux/4.15/version.desc
+++ b/packages/expat/2.2.6/version.desc
diff --git a/packages/gcc-linaro/6.4-2017.11/chksum b/packages/gcc-linaro/6.4-2017.11/chksum
deleted file mode 100644
index 1531c08..0000000
--- a/packages/gcc-linaro/6.4-2017.11/chksum
+++ /dev/null
@@ -1,4 +0,0 @@
-md5 gcc-linaro-6.4-2017.11.tar.xz 0620b19d8f58828b64c67513fb7c3476
-sha1 gcc-linaro-6.4-2017.11.tar.xz 2f4a43b52e61215a4f4b608dc6a26dcd9fb61796
-sha256 gcc-linaro-6.4-2017.11.tar.xz 3c17387177f15b855070ca42ed7f4f16b6b151b9216a445fd64a4463653492b3
-sha512 gcc-linaro-6.4-2017.11.tar.xz f5f7803f16d4c3ca3f55b4dd8c89f9e2609eb2421ffa520c0adedc657b5bf47a9b1b80be627b7cf052817ffd913ad32423fe2091adcc7975d72149d443da9d01
diff --git a/packages/gcc-linaro/7.2-2017.11/0000-libtool-leave-framework-alone.patch b/packages/gcc-linaro/6.4-2018.05/0000-libtool-leave-framework-alone.patch
index 1a86e41..1a86e41 100644
--- a/packages/gcc-linaro/7.2-2017.11/0000-libtool-leave-framework-alone.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0000-libtool-leave-framework-alone.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0001-uclibc-conf.patch b/packages/gcc-linaro/6.4-2018.05/0001-uclibc-conf.patch
index aef750a..aef750a 100644
--- a/packages/gcc-linaro/7.2-2017.11/0001-uclibc-conf.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0001-uclibc-conf.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0002-missing-execinfo_h.patch b/packages/gcc-linaro/6.4-2018.05/0002-missing-execinfo_h.patch
index c90222a..c90222a 100644
--- a/packages/gcc-linaro/6.4-2017.11/0002-missing-execinfo_h.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0002-missing-execinfo_h.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0003-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/packages/gcc-linaro/6.4-2018.05/0003-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
index fe0f146..7efd956 100644
--- a/packages/gcc-linaro/6.4-2017.11/0003-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0003-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
@@ -53,7 +53,7 @@
if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
--- a/gcc/configure
+++ b/gcc/configure
-@@ -29200,6 +29200,9 @@
+@@ -29239,6 +29239,9 @@
pluginlibs=
@@ -63,7 +63,7 @@
case "${host}" in
*-*-darwin*)
if test x$build = x$host; then
-@@ -29210,6 +29213,11 @@
+@@ -29249,6 +29252,11 @@
export_sym_check=
fi
;;
@@ -75,7 +75,7 @@
*)
if test x$build = x$host; then
export_sym_check="objdump${exeext} -T"
-@@ -29322,23 +29330,23 @@
+@@ -29361,23 +29369,23 @@
case "${host}" in
*-*-darwin*)
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
diff --git a/packages/gcc-linaro/6.4-2017.11/0004-gcc-plugin-POSIX-include-sys-select-h.patch b/packages/gcc-linaro/6.4-2018.05/0004-gcc-plugin-POSIX-include-sys-select-h.patch
index 5f9a07a..5f9a07a 100644
--- a/packages/gcc-linaro/6.4-2017.11/0004-gcc-plugin-POSIX-include-sys-select-h.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0004-gcc-plugin-POSIX-include-sys-select-h.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0005-arm-softfloat-libgcc.patch b/packages/gcc-linaro/6.4-2018.05/0005-arm-softfloat-libgcc.patch
index 350857d..350857d 100644
--- a/packages/gcc-linaro/6.4-2017.11/0005-arm-softfloat-libgcc.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0005-arm-softfloat-libgcc.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0006-arm_unbreak_armv4t.patch b/packages/gcc-linaro/6.4-2018.05/0006-arm_unbreak_armv4t.patch
index 7c37445..7c37445 100644
--- a/packages/gcc-linaro/6.4-2017.11/0006-arm_unbreak_armv4t.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0006-arm_unbreak_armv4t.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0007-cilk-wchar.patch b/packages/gcc-linaro/6.4-2018.05/0007-cilk-wchar.patch
index 300837f..300837f 100644
--- a/packages/gcc-linaro/6.4-2017.11/0007-cilk-wchar.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0007-cilk-wchar.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0008-fix-m68k-compile.patch b/packages/gcc-linaro/6.4-2018.05/0008-fix-m68k-compile.patch
index 9437f25..9437f25 100644
--- a/packages/gcc-linaro/6.4-2017.11/0008-fix-m68k-compile.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0008-fix-m68k-compile.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0009-fix-m68k-uclinux.patch b/packages/gcc-linaro/6.4-2018.05/0009-fix-m68k-uclinux.patch
index 20d7c4a..20d7c4a 100644
--- a/packages/gcc-linaro/6.4-2017.11/0009-fix-m68k-uclinux.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0009-fix-m68k-uclinux.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0010-libgcc-mkmap-symver-support-skip_underscore.patch b/packages/gcc-linaro/6.4-2018.05/0010-libgcc-mkmap-symver-support-skip_underscore.patch
index c6421d0..c6421d0 100644
--- a/packages/gcc-linaro/6.4-2017.11/0010-libgcc-mkmap-symver-support-skip_underscore.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0010-libgcc-mkmap-symver-support-skip_underscore.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0011-libgcc-config-bfin-use-the-generic-linker-version-in.patch b/packages/gcc-linaro/6.4-2018.05/0011-libgcc-config-bfin-use-the-generic-linker-version-in.patch
index ac75cfa..ac75cfa 100644
--- a/packages/gcc-linaro/6.4-2017.11/0011-libgcc-config-bfin-use-the-generic-linker-version-in.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0011-libgcc-config-bfin-use-the-generic-linker-version-in.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0012-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch b/packages/gcc-linaro/6.4-2018.05/0012-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
index f0ada67..f0ada67 100644
--- a/packages/gcc-linaro/6.4-2017.11/0012-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0012-libgcc-fix-DWARF-compilation-with-FDPIC-targets.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0013-bfin-define-REENTRANT.patch b/packages/gcc-linaro/6.4-2018.05/0013-bfin-define-REENTRANT.patch
index 633084b..633084b 100644
--- a/packages/gcc-linaro/6.4-2017.11/0013-bfin-define-REENTRANT.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0013-bfin-define-REENTRANT.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0014-libgfortran-missing-include.patch b/packages/gcc-linaro/6.4-2018.05/0014-libgfortran-missing-include.patch
index 701e7b4..701e7b4 100644
--- a/packages/gcc-linaro/6.4-2017.11/0014-libgfortran-missing-include.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0014-libgfortran-missing-include.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0015-nios2-bad-multilib-default.patch b/packages/gcc-linaro/6.4-2018.05/0015-nios2-bad-multilib-default.patch
index 4acc491..4acc491 100644
--- a/packages/gcc-linaro/6.4-2017.11/0015-nios2-bad-multilib-default.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0015-nios2-bad-multilib-default.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0016-libgcc-disable-split-stack-nothreads.patch b/packages/gcc-linaro/6.4-2018.05/0016-libgcc-disable-split-stack-nothreads.patch
index df91a9f..df91a9f 100644
--- a/packages/gcc-linaro/6.4-2017.11/0016-libgcc-disable-split-stack-nothreads.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0016-libgcc-disable-split-stack-nothreads.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0017-uclinux-enable-threads.patch b/packages/gcc-linaro/6.4-2018.05/0017-uclinux-enable-threads.patch
index 8e4e0a2..8e4e0a2 100644
--- a/packages/gcc-linaro/6.4-2017.11/0017-uclinux-enable-threads.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0017-uclinux-enable-threads.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0018-bionic-ndk.patch b/packages/gcc-linaro/6.4-2018.05/0018-bionic-ndk.patch
index 474dd8c..474dd8c 100644
--- a/packages/gcc-linaro/6.4-2017.11/0018-bionic-ndk.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0018-bionic-ndk.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0019-bionic-errno.patch b/packages/gcc-linaro/6.4-2018.05/0019-bionic-errno.patch
index 0a1a632..0a1a632 100644
--- a/packages/gcc-linaro/6.4-2017.11/0019-bionic-errno.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0019-bionic-errno.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0020-crystax.patch b/packages/gcc-linaro/6.4-2018.05/0020-crystax.patch
index 461be72..8d519dc 100644
--- a/packages/gcc-linaro/6.4-2017.11/0020-crystax.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0020-crystax.patch
@@ -152,7 +152,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
-@@ -1922,10 +1922,11 @@
+@@ -1923,10 +1923,11 @@
#define CASE_VECTOR_PC_RELATIVE (TARGET_THUMB2 \
|| (TARGET_THUMB1 \
@@ -167,7 +167,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
: min >= -256 && max < 256 \
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
-@@ -8657,7 +8657,7 @@
+@@ -8654,7 +8654,7 @@
(match_operand:SI 2 "const_int_operand" "") ; total range
(match_operand:SI 3 "" "") ; table label
(match_operand:SI 4 "" "")] ; Out of range label
@@ -446,7 +446,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
#if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
-@@ -78389,6 +78389,12 @@
+@@ -78391,6 +78391,12 @@
/* end confdefs.h. */
#include <sys/syscall.h>
int lk;
@@ -459,7 +459,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
int
main ()
{
-@@ -78447,6 +78453,12 @@
+@@ -78449,6 +78455,12 @@
/* end confdefs.h. */
#include <sys/syscall.h>
int lk;
diff --git a/packages/gcc-linaro/6.4-2017.11/0021-crystax.patch b/packages/gcc-linaro/6.4-2018.05/0021-crystax.patch
index f1f9eb1..f1f9eb1 100644
--- a/packages/gcc-linaro/6.4-2017.11/0021-crystax.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0021-crystax.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0022-crystax.patch b/packages/gcc-linaro/6.4-2018.05/0022-crystax.patch
index 64d1126..9c020e1 100644
--- a/packages/gcc-linaro/6.4-2017.11/0022-crystax.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0022-crystax.patch
@@ -26,7 +26,7 @@ Date: Mon Apr 14 15:59:47 2014 -0700
--- a/gcc/config.in
+++ b/gcc/config.in
-@@ -2144,6 +2144,12 @@
+@@ -2150,6 +2150,12 @@
#endif
@@ -145,7 +145,7 @@ Date: Mon Apr 14 15:59:47 2014 -0700
--enable-linker-build-id
compiler will always pass --build-id to linker
--enable-default-ssp enable Stack Smashing Protection as default
-@@ -27786,6 +27790,38 @@
+@@ -27825,6 +27829,38 @@
$as_echo "#define HAVE_LD_EH_FRAME_HDR 1" >>confdefs.h
@@ -186,7 +186,7 @@ Date: Mon Apr 14 15:59:47 2014 -0700
$as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; }
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
-@@ -4861,6 +4861,35 @@
+@@ -4874,6 +4874,35 @@
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.])
diff --git a/packages/gcc-linaro/6.4-2017.11/0023-crystax.patch b/packages/gcc-linaro/6.4-2018.05/0023-crystax.patch
index 34df80a..2ddd723 100644
--- a/packages/gcc-linaro/6.4-2017.11/0023-crystax.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0023-crystax.patch
@@ -12,7 +12,7 @@ Date: Thu Aug 20 19:11:07 2015 +0300
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
-@@ -14690,6 +14690,7 @@
+@@ -15020,6 +15020,7 @@
else if (!SYMBOL_REF_FAR_ADDR_P (op0)
&& (SYMBOL_REF_LOCAL_P (op0)
|| (HAVE_LD_PIE_COPYRELOC
diff --git a/packages/gcc-linaro/6.4-2017.11/0024-crystax.patch b/packages/gcc-linaro/6.4-2018.05/0024-crystax.patch
index 8f2eb43..8f2eb43 100644
--- a/packages/gcc-linaro/6.4-2017.11/0024-crystax.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0024-crystax.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0025-crystax.patch b/packages/gcc-linaro/6.4-2018.05/0025-crystax.patch
index f555f27..88ac37c 100644
--- a/packages/gcc-linaro/6.4-2017.11/0025-crystax.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0025-crystax.patch
@@ -15,7 +15,7 @@ Date: Mon Apr 14 21:05:51 2014 -0700
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
-@@ -22178,9 +22178,13 @@
+@@ -22205,9 +22205,13 @@
memsize = MEM_SIZE (x);
/* Only certain alignment specifiers are supported by the hardware. */
diff --git a/packages/gcc-linaro/6.4-2017.11/0026-crystax.patch b/packages/gcc-linaro/6.4-2018.05/0026-crystax.patch
index 8c21a1c..8c21a1c 100644
--- a/packages/gcc-linaro/6.4-2017.11/0026-crystax.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0026-crystax.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0027-crystax.patch b/packages/gcc-linaro/6.4-2018.05/0027-crystax.patch
index ccb81fd..ccb81fd 100644
--- a/packages/gcc-linaro/6.4-2017.11/0027-crystax.patch
+++ b/packages/gcc-linaro/6.4-2018.05/0027-crystax.patch
diff --git a/packages/gcc-linaro/6.4-2018.05/0028-isl-0.20.patch b/packages/gcc-linaro/6.4-2018.05/0028-isl-0.20.patch
new file mode 100644
index 0000000..f253eab
--- /dev/null
+++ b/packages/gcc-linaro/6.4-2018.05/0028-isl-0.20.patch
@@ -0,0 +1,26 @@
+commit 9fabe086c9f5c3896297f7f35491d785ba6f49a0
+Author: Alexey Neyman <stilor@att.net>
+Date: Mon Sep 24 22:50:11 2018 -0700
+
+ Fix build with ISL 0.20
+
+ * gcc/graphite.h: Include <isl/id.h> and <isl/space.h>; these
+ headers are no longer pulled in by <isl/val.h>.
+
+ Signed-off-by: Alexey Neyman <stilor@att.net>
+
+---
+ gcc/graphite.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/gcc/graphite.h
++++ b/gcc/graphite.h
+@@ -26,6 +26,8 @@
+ #include <isl/options.h>
+ #include <isl/ctx.h>
+ #include <isl/val_gmp.h>
++#include <isl/id.h>
++#include <isl/space.h>
+ #include <isl/set.h>
+ #include <isl/union_set.h>
+ #include <isl/map.h>
diff --git a/packages/gcc-linaro/6.4-2018.05/chksum b/packages/gcc-linaro/6.4-2018.05/chksum
new file mode 100644
index 0000000..ceaa225
--- /dev/null
+++ b/packages/gcc-linaro/6.4-2018.05/chksum
@@ -0,0 +1,4 @@
+md5 gcc-linaro-6.4-2018.05.tar.xz a58a8b7166db4a01964d8f21b0f636e9
+sha1 gcc-linaro-6.4-2018.05.tar.xz ef5ed3d31b356117162122fe450ca2bd91f9618f
+sha256 gcc-linaro-6.4-2018.05.tar.xz c547014d687535ec2a72dae55edbf55621db220fffff257ea0beece83715ac2f
+sha512 gcc-linaro-6.4-2018.05.tar.xz 91a1cc04efc72a1f5fda0a7a6797241eb218e6656eb7907f7a86210f452a3fc650815a5cd1bedfe9338b38d2609c17b1d4f09287495e485621dcb7458927a451
diff --git a/packages/linux/4.15.16/version.desc b/packages/gcc-linaro/6.4-2018.05/version.desc
index e69de29..e69de29 100644
--- a/packages/linux/4.15.16/version.desc
+++ b/packages/gcc-linaro/6.4-2018.05/version.desc
diff --git a/packages/gcc-linaro/7.2-2017.11/chksum b/packages/gcc-linaro/7.2-2017.11/chksum
deleted file mode 100644
index c9e6a03..0000000
--- a/packages/gcc-linaro/7.2-2017.11/chksum
+++ /dev/null
@@ -1,4 +0,0 @@
-md5 gcc-linaro-7.2-2017.11.tar.xz 67f7ed9541b6117143a4b405529e984e
-sha1 gcc-linaro-7.2-2017.11.tar.xz 7963644acea5208acac2f94f098c0dc90d0bfa51
-sha256 gcc-linaro-7.2-2017.11.tar.xz 7b07095df50a10789f446cec421468f10c57fe8bb6a789a73dc758acf8475cb0
-sha512 gcc-linaro-7.2-2017.11.tar.xz 9195cf66f312af286d63db1c07889b9bfed9ab44db2725c4cfb9a46cd7351961f4c5278b48a2bc35576719618ddf4239e2d84f386071fe1ca2171b76f109b564
diff --git a/packages/gcc-linaro/6.4-2017.11/0000-libtool-leave-framework-alone.patch b/packages/gcc-linaro/7.3-2018.05/0000-libtool-leave-framework-alone.patch
index 1a86e41..1a86e41 100644
--- a/packages/gcc-linaro/6.4-2017.11/0000-libtool-leave-framework-alone.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0000-libtool-leave-framework-alone.patch
diff --git a/packages/gcc-linaro/6.4-2017.11/0001-uclibc-conf.patch b/packages/gcc-linaro/7.3-2018.05/0001-uclibc-conf.patch
index aef750a..aef750a 100644
--- a/packages/gcc-linaro/6.4-2017.11/0001-uclibc-conf.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0001-uclibc-conf.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/packages/gcc-linaro/7.3-2018.05/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
index f5a82fa..ac628f3 100644
--- a/packages/gcc-linaro/7.2-2017.11/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
@@ -53,7 +53,7 @@
if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
--- a/gcc/configure
+++ b/gcc/configure
-@@ -29479,6 +29479,9 @@
+@@ -29519,6 +29519,9 @@
pluginlibs=
@@ -63,7 +63,7 @@
case "${host}" in
*-*-darwin*)
if test x$build = x$host; then
-@@ -29489,6 +29492,11 @@
+@@ -29529,6 +29532,11 @@
export_sym_check=
fi
;;
@@ -75,7 +75,7 @@
*)
if test x$build = x$host; then
export_sym_check="objdump${exeext} -T"
-@@ -29601,23 +29609,23 @@
+@@ -29641,23 +29649,23 @@
case "${host}" in
*-*-darwin*)
CFLAGS=`echo $CFLAGS | sed s/-mdynamic-no-pic//g`
diff --git a/packages/gcc-linaro/7.2-2017.11/0003-gcc-plugin-POSIX-include-sys-select-h.patch b/packages/gcc-linaro/7.3-2018.05/0003-gcc-plugin-POSIX-include-sys-select-h.patch
index 5f9a07a..5f9a07a 100644
--- a/packages/gcc-linaro/7.2-2017.11/0003-gcc-plugin-POSIX-include-sys-select-h.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0003-gcc-plugin-POSIX-include-sys-select-h.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0004-arm-softfloat-libgcc.patch b/packages/gcc-linaro/7.3-2018.05/0004-arm-softfloat-libgcc.patch
index d980036..d980036 100644
--- a/packages/gcc-linaro/7.2-2017.11/0004-arm-softfloat-libgcc.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0004-arm-softfloat-libgcc.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0005-cilk-wchar.patch b/packages/gcc-linaro/7.3-2018.05/0005-cilk-wchar.patch
index d2230cd..d2230cd 100644
--- a/packages/gcc-linaro/7.2-2017.11/0005-cilk-wchar.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0005-cilk-wchar.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0006-fix-m68k-uclinux.patch b/packages/gcc-linaro/7.3-2018.05/0006-fix-m68k-uclinux.patch
index 8b9e725..8b9e725 100644
--- a/packages/gcc-linaro/7.2-2017.11/0006-fix-m68k-uclinux.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0006-fix-m68k-uclinux.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0007-libgfortran-missing-include.patch b/packages/gcc-linaro/7.3-2018.05/0007-libgfortran-missing-include.patch
index 701e7b4..701e7b4 100644
--- a/packages/gcc-linaro/7.2-2017.11/0007-libgfortran-missing-include.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0007-libgfortran-missing-include.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0008-nios2-bad-multilib-default.patch b/packages/gcc-linaro/7.3-2018.05/0008-nios2-bad-multilib-default.patch
index 4acc491..4acc491 100644
--- a/packages/gcc-linaro/7.2-2017.11/0008-nios2-bad-multilib-default.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0008-nios2-bad-multilib-default.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0009-libgcc-disable-split-stack-nothreads.patch b/packages/gcc-linaro/7.3-2018.05/0009-libgcc-disable-split-stack-nothreads.patch
index df91a9f..df91a9f 100644
--- a/packages/gcc-linaro/7.2-2017.11/0009-libgcc-disable-split-stack-nothreads.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0009-libgcc-disable-split-stack-nothreads.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0010-bionic-ndk.patch b/packages/gcc-linaro/7.3-2018.05/0010-bionic-ndk.patch
index 474dd8c..474dd8c 100644
--- a/packages/gcc-linaro/7.2-2017.11/0010-bionic-ndk.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0010-bionic-ndk.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0011-bionic-errno.patch b/packages/gcc-linaro/7.3-2018.05/0011-bionic-errno.patch
index 0a1a632..0a1a632 100644
--- a/packages/gcc-linaro/7.2-2017.11/0011-bionic-errno.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0011-bionic-errno.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0012-crystax.patch b/packages/gcc-linaro/7.3-2018.05/0012-crystax.patch
index 753fca2..d35fd34 100644
--- a/packages/gcc-linaro/7.2-2017.11/0012-crystax.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0012-crystax.patch
@@ -52,7 +52,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
esac
aarch64_multilibs="${with_multilib_list}"
if test "$aarch64_multilibs" = "default"; then
-@@ -2084,6 +2088,17 @@
+@@ -2092,6 +2096,17 @@
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
@@ -152,7 +152,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
-@@ -1878,10 +1878,11 @@
+@@ -1885,10 +1885,11 @@
#define CASE_VECTOR_PC_RELATIVE (TARGET_THUMB2 \
|| (TARGET_THUMB1 \
@@ -167,7 +167,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
: min >= -256 && max < 256 \
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
-@@ -8741,7 +8741,7 @@
+@@ -8738,7 +8738,7 @@
(match_operand:SI 2 "const_int_operand" "") ; total range
(match_operand:SI 3 "" "") ; table label
(match_operand:SI 4 "" "")] ; Out of range label
@@ -445,7 +445,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
#if ((defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)) \
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
-@@ -78536,6 +78536,12 @@
+@@ -78564,6 +78564,12 @@
/* end confdefs.h. */
#include <sys/syscall.h>
int lk;
@@ -458,7 +458,7 @@ Date: Wed Jul 29 11:28:29 2015 +0300
int
main ()
{
-@@ -78594,6 +78600,12 @@
+@@ -78622,6 +78628,12 @@
/* end confdefs.h. */
#include <sys/syscall.h>
int lk;
diff --git a/packages/gcc-linaro/7.2-2017.11/0013-crystax.patch b/packages/gcc-linaro/7.3-2018.05/0013-crystax.patch
index f1f9eb1..f1f9eb1 100644
--- a/packages/gcc-linaro/7.2-2017.11/0013-crystax.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0013-crystax.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0014-crystax.patch b/packages/gcc-linaro/7.3-2018.05/0014-crystax.patch
index 4505294..823e24a 100644
--- a/packages/gcc-linaro/7.2-2017.11/0014-crystax.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0014-crystax.patch
@@ -26,7 +26,7 @@ Date: Mon Apr 14 15:59:47 2014 -0700
--- a/gcc/config.in
+++ b/gcc/config.in
-@@ -2180,6 +2180,12 @@
+@@ -2186,6 +2186,12 @@
#endif
@@ -145,7 +145,7 @@ Date: Mon Apr 14 15:59:47 2014 -0700
--enable-linker-build-id
compiler will always pass --build-id to linker
--enable-default-ssp enable Stack Smashing Protection as default
-@@ -28051,6 +28055,38 @@
+@@ -28091,6 +28095,38 @@
$as_echo "#define HAVE_LD_EH_FRAME_HDR 1" >>confdefs.h
@@ -186,7 +186,7 @@ Date: Mon Apr 14 15:59:47 2014 -0700
$as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; }
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
-@@ -4981,6 +4981,35 @@
+@@ -4994,6 +4994,35 @@
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.])
diff --git a/packages/gcc-linaro/7.2-2017.11/0015-crystax.patch b/packages/gcc-linaro/7.3-2018.05/0015-crystax.patch
index ffdf340..2081e2a 100644
--- a/packages/gcc-linaro/7.2-2017.11/0015-crystax.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0015-crystax.patch
@@ -12,7 +12,7 @@ Date: Thu Aug 20 19:11:07 2015 +0300
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
-@@ -15763,6 +15763,7 @@
+@@ -16103,6 +16103,7 @@
else if (!SYMBOL_REF_FAR_ADDR_P (op0)
&& (SYMBOL_REF_LOCAL_P (op0)
|| (HAVE_LD_PIE_COPYRELOC
diff --git a/packages/gcc-linaro/7.2-2017.11/0016-crystax.patch b/packages/gcc-linaro/7.3-2018.05/0016-crystax.patch
index 8f2eb43..8f2eb43 100644
--- a/packages/gcc-linaro/7.2-2017.11/0016-crystax.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0016-crystax.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0017-crystax.patch b/packages/gcc-linaro/7.3-2018.05/0017-crystax.patch
index 50ee371..a8f7264 100644
--- a/packages/gcc-linaro/7.2-2017.11/0017-crystax.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0017-crystax.patch
@@ -15,7 +15,7 @@ Date: Mon Apr 14 21:05:51 2014 -0700
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
-@@ -22293,9 +22293,13 @@
+@@ -22325,9 +22325,13 @@
memsize = MEM_SIZE (x);
/* Only certain alignment specifiers are supported by the hardware. */
diff --git a/packages/gcc-linaro/7.2-2017.11/0018-crystax.patch b/packages/gcc-linaro/7.3-2018.05/0018-crystax.patch
index 8c21a1c..8c21a1c 100644
--- a/packages/gcc-linaro/7.2-2017.11/0018-crystax.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0018-crystax.patch
diff --git a/packages/gcc-linaro/7.2-2017.11/0019-crystax.patch b/packages/gcc-linaro/7.3-2018.05/0019-crystax.patch
index ccb81fd..ccb81fd 100644
--- a/packages/gcc-linaro/7.2-2017.11/0019-crystax.patch
+++ b/packages/gcc-linaro/7.3-2018.05/0019-crystax.patch
diff --git a/packages/gcc-linaro/7.3-2018.05/0020-isl-0.20.patch b/packages/gcc-linaro/7.3-2018.05/0020-isl-0.20.patch
new file mode 100644
index 0000000..3e14966
--- /dev/null
+++ b/packages/gcc-linaro/7.3-2018.05/0020-isl-0.20.patch
@@ -0,0 +1,26 @@
+commit 9fabe086c9f5c3896297f7f35491d785ba6f49a0
+Author: Alexey Neyman <stilor@att.net>
+Date: Mon Sep 24 22:50:11 2018 -0700
+
+ Fix build with ISL 0.20
+
+ * gcc/graphite.h: Include <isl/id.h> and <isl/space.h>; these
+ headers are no longer pulled in by <isl/val.h>.
+
+ Signed-off-by: Alexey Neyman <stilor@att.net>
+
+---
+ gcc/graphite.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/gcc/graphite.h
++++ b/gcc/graphite.h
+@@ -26,6 +26,8 @@
+ #include <isl/options.h>
+ #include <isl/ctx.h>
+ #include <isl/val.h>
++#include <isl/id.h>
++#include <isl/space.h>
+ #include <isl/set.h>
+ #include <isl/union_set.h>
+ #include <isl/map.h>
diff --git a/packages/gcc-linaro/7.3-2018.05/chksum b/packages/gcc-linaro/7.3-2018.05/chksum
new file mode 100644
index 0000000..38d9f94
--- /dev/null
+++ b/packages/gcc-linaro/7.3-2018.05/chksum
@@ -0,0 +1,4 @@
+md5 gcc-linaro-7.3-2018.05.tar.xz bc996f77c8c893f227f5b6057cc3765c
+sha1 gcc-linaro-7.3-2018.05.tar.xz 9e74ddeaa3576a60fc6927bcf8f0a748754d3839
+sha256 gcc-linaro-7.3-2018.05.tar.xz 5864b46120e120949413ab698a5104cfd43b82246254cc4928a2d9e8cc1884e7
+sha512 gcc-linaro-7.3-2018.05.tar.xz 8cdb7603c305299b1fa2e4f109a727857e13f5440e2662b982871bb096eb7c9a71804b3c68dc6c0f27cb0491dc77dec766497c7bf98d08d2b71bc91ecaa35377
diff --git a/packages/linux/4.14.33/version.desc b/packages/gcc-linaro/7.3-2018.05/version.desc
index e69de29..e69de29 100644
--- a/packages/linux/4.14.33/version.desc
+++ b/packages/gcc-linaro/7.3-2018.05/version.desc
diff --git a/packages/gcc/5.5.0/0034-xtensa-fix-PR-target-65416.patch b/packages/gcc/5.5.0/0034-xtensa-fix-PR-target-65416.patch
new file mode 100644
index 0000000..31356a0
--- /dev/null
+++ b/packages/gcc/5.5.0/0034-xtensa-fix-PR-target-65416.patch
@@ -0,0 +1,96 @@
+From 7ed283a583a8c37330d38093ea703e441129a02c Mon Sep 17 00:00:00 2001
+From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 19 Jun 2018 18:26:07 +0000
+Subject: [PATCH] xtensa: fix PR target/65416
+
+The issue is caused by reordering of stack pointer update after stack
+space allocation with instructions that write to the allocated stack
+space. In windowed ABI register spill area for the previous call frame
+is located just below the stack pointer and may be reloaded back into
+the register file on movsp.
+Implement allocate_stack pattern for windowed ABI configuration and
+insert an instruction that prevents reordering of frame memory access
+and stack pointer update.
+
+gcc/
+2018-06-19 Max Filippov <jcmvbkbc@gmail.com>
+
+ * config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec
+ constant.
+ (allocate_stack, frame_blockage, *frame_blockage): New patterns.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261755 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.md | 46 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+--- a/gcc/config/xtensa/xtensa.md
++++ b/gcc/config/xtensa/xtensa.md
+@@ -38,6 +38,7 @@
+ (UNSPEC_MEMW 11)
+ (UNSPEC_LSETUP_START 12)
+ (UNSPEC_LSETUP_END 13)
++ (UNSPEC_FRAME_BLOCKAGE 14)
+
+ (UNSPECV_SET_FP 1)
+ (UNSPECV_ENTRY 2)
+@@ -1676,6 +1677,32 @@
+
+ ;; Miscellaneous instructions.
+
++;; In windowed ABI stack pointer adjustment must happen before any access
++;; to the space allocated on stack is allowed, otherwise register spill
++;; area may be clobbered. That's what frame blockage is supposed to enforce.
++
++(define_expand "allocate_stack"
++ [(set (match_operand 0 "nonimmed_operand")
++ (minus (reg A1_REG) (match_operand 1 "add_operand")))
++ (set (reg A1_REG)
++ (minus (reg A1_REG) (match_dup 1)))]
++ "TARGET_WINDOWED_ABI"
++{
++ if (CONST_INT_P (operands[1]))
++ {
++ rtx neg_op0 = GEN_INT (-INTVAL (operands[1]));
++ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
++ }
++ else
++ {
++ emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
++ operands[1]));
++ }
++ emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
++ emit_insn (gen_frame_blockage ());
++ DONE;
++})
++
+ (define_expand "prologue"
+ [(const_int 0)]
+ ""
+@@ -1767,6 +1794,25 @@
+ [(set_attr "length" "0")
+ (set_attr "type" "nop")])
+
++;; Do not schedule instructions accessing memory before this point.
++
++(define_expand "frame_blockage"
++ [(set (match_dup 0)
++ (unspec:BLK [(match_dup 1)] UNSPEC_FRAME_BLOCKAGE))]
++ ""
++{
++ operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
++ MEM_VOLATILE_P (operands[0]) = 1;
++ operands[1] = stack_pointer_rtx;
++})
++
++(define_insn "*frame_blockage"
++ [(set (match_operand:BLK 0 "" "")
++ (unspec:BLK [(match_operand:SI 1 "" "")] UNSPEC_FRAME_BLOCKAGE))]
++ ""
++ ""
++ [(set_attr "length" "0")])
++
+ (define_insn "trap"
+ [(trap_if (const_int 1) (const_int 0))]
+ ""
diff --git a/packages/gcc/6.4.0/0032-xtensa-fix-PR-target-65416.patch b/packages/gcc/6.4.0/0032-xtensa-fix-PR-target-65416.patch
new file mode 100644
index 0000000..14fd30f
--- /dev/null
+++ b/packages/gcc/6.4.0/0032-xtensa-fix-PR-target-65416.patch
@@ -0,0 +1,96 @@
+From fa0a207efdfca73fdcd1798789b7121e9e9ae90f Mon Sep 17 00:00:00 2001
+From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 19 Jun 2018 18:26:07 +0000
+Subject: [PATCH] xtensa: fix PR target/65416
+
+The issue is caused by reordering of stack pointer update after stack
+space allocation with instructions that write to the allocated stack
+space. In windowed ABI register spill area for the previous call frame
+is located just below the stack pointer and may be reloaded back into
+the register file on movsp.
+Implement allocate_stack pattern for windowed ABI configuration and
+insert an instruction that prevents reordering of frame memory access
+and stack pointer update.
+
+gcc/
+2018-06-19 Max Filippov <jcmvbkbc@gmail.com>
+
+ * config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec
+ constant.
+ (allocate_stack, frame_blockage, *frame_blockage): New patterns.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261755 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.md | 46 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+--- a/gcc/config/xtensa/xtensa.md
++++ b/gcc/config/xtensa/xtensa.md
+@@ -38,6 +38,7 @@
+ (UNSPEC_MEMW 11)
+ (UNSPEC_LSETUP_START 12)
+ (UNSPEC_LSETUP_END 13)
++ (UNSPEC_FRAME_BLOCKAGE 14)
+
+ (UNSPECV_SET_FP 1)
+ (UNSPECV_ENTRY 2)
+@@ -1676,6 +1677,32 @@
+
+ ;; Miscellaneous instructions.
+
++;; In windowed ABI stack pointer adjustment must happen before any access
++;; to the space allocated on stack is allowed, otherwise register spill
++;; area may be clobbered. That's what frame blockage is supposed to enforce.
++
++(define_expand "allocate_stack"
++ [(set (match_operand 0 "nonimmed_operand")
++ (minus (reg A1_REG) (match_operand 1 "add_operand")))
++ (set (reg A1_REG)
++ (minus (reg A1_REG) (match_dup 1)))]
++ "TARGET_WINDOWED_ABI"
++{
++ if (CONST_INT_P (operands[1]))
++ {
++ rtx neg_op0 = GEN_INT (-INTVAL (operands[1]));
++ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
++ }
++ else
++ {
++ emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
++ operands[1]));
++ }
++ emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
++ emit_insn (gen_frame_blockage ());
++ DONE;
++})
++
+ (define_expand "prologue"
+ [(const_int 0)]
+ ""
+@@ -1767,6 +1794,25 @@
+ [(set_attr "length" "0")
+ (set_attr "type" "nop")])
+
++;; Do not schedule instructions accessing memory before this point.
++
++(define_expand "frame_blockage"
++ [(set (match_dup 0)
++ (unspec:BLK [(match_dup 1)] UNSPEC_FRAME_BLOCKAGE))]
++ ""
++{
++ operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
++ MEM_VOLATILE_P (operands[0]) = 1;
++ operands[1] = stack_pointer_rtx;
++})
++
++(define_insn "*frame_blockage"
++ [(set (match_operand:BLK 0 "" "")
++ (unspec:BLK [(match_operand:SI 1 "" "")] UNSPEC_FRAME_BLOCKAGE))]
++ ""
++ ""
++ [(set_attr "length" "0")])
++
+ (define_insn "trap"
+ [(trap_if (const_int 1) (const_int 0))]
+ ""
diff --git a/packages/gcc/6.4.0/0033-isl-0.20.patch b/packages/gcc/6.4.0/0033-isl-0.20.patch
new file mode 100644
index 0000000..f253eab
--- /dev/null
+++ b/packages/gcc/6.4.0/0033-isl-0.20.patch
@@ -0,0 +1,26 @@
+commit 9fabe086c9f5c3896297f7f35491d785ba6f49a0
+Author: Alexey Neyman <stilor@att.net>
+Date: Mon Sep 24 22:50:11 2018 -0700
+
+ Fix build with ISL 0.20
+
+ * gcc/graphite.h: Include <isl/id.h> and <isl/space.h>; these
+ headers are no longer pulled in by <isl/val.h>.
+
+ Signed-off-by: Alexey Neyman <stilor@att.net>
+
+---
+ gcc/graphite.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/gcc/graphite.h
++++ b/gcc/graphite.h
+@@ -26,6 +26,8 @@
+ #include <isl/options.h>
+ #include <isl/ctx.h>
+ #include <isl/val_gmp.h>
++#include <isl/id.h>
++#include <isl/space.h>
+ #include <isl/set.h>
+ #include <isl/union_set.h>
+ #include <isl/map.h>
diff --git a/packages/gcc/7.3.0/0022-xtensa-fix-PR-target-65416.patch b/packages/gcc/7.3.0/0022-xtensa-fix-PR-target-65416.patch
new file mode 100644
index 0000000..37dc7f8
--- /dev/null
+++ b/packages/gcc/7.3.0/0022-xtensa-fix-PR-target-65416.patch
@@ -0,0 +1,96 @@
+From 213fda1983bc80fbcc738ecd841a60a078f52111 Mon Sep 17 00:00:00 2001
+From: jcmvbkbc <jcmvbkbc@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 19 Jun 2018 18:26:07 +0000
+Subject: [PATCH] xtensa: fix PR target/65416
+
+The issue is caused by reordering of stack pointer update after stack
+space allocation with instructions that write to the allocated stack
+space. In windowed ABI register spill area for the previous call frame
+is located just below the stack pointer and may be reloaded back into
+the register file on movsp.
+Implement allocate_stack pattern for windowed ABI configuration and
+insert an instruction that prevents reordering of frame memory access
+and stack pointer update.
+
+gcc/
+2018-06-19 Max Filippov <jcmvbkbc@gmail.com>
+
+ * config/xtensa/xtensa.md (UNSPEC_FRAME_BLOCKAGE): New unspec
+ constant.
+ (allocate_stack, frame_blockage, *frame_blockage): New patterns.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261755 138bc75d-0d04-0410-961f-82ee72b054a4
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+---
+ gcc/config/xtensa/xtensa.md | 46 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+--- a/gcc/config/xtensa/xtensa.md
++++ b/gcc/config/xtensa/xtensa.md
+@@ -38,6 +38,7 @@
+ (UNSPEC_MEMW 11)
+ (UNSPEC_LSETUP_START 12)
+ (UNSPEC_LSETUP_END 13)
++ (UNSPEC_FRAME_BLOCKAGE 14)
+
+ (UNSPECV_SET_FP 1)
+ (UNSPECV_ENTRY 2)
+@@ -1676,6 +1677,32 @@
+
+ ;; Miscellaneous instructions.
+
++;; In windowed ABI stack pointer adjustment must happen before any access
++;; to the space allocated on stack is allowed, otherwise register spill
++;; area may be clobbered. That's what frame blockage is supposed to enforce.
++
++(define_expand "allocate_stack"
++ [(set (match_operand 0 "nonimmed_operand")
++ (minus (reg A1_REG) (match_operand 1 "add_operand")))
++ (set (reg A1_REG)
++ (minus (reg A1_REG) (match_dup 1)))]
++ "TARGET_WINDOWED_ABI"
++{
++ if (CONST_INT_P (operands[1]))
++ {
++ rtx neg_op0 = GEN_INT (-INTVAL (operands[1]));
++ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, neg_op0));
++ }
++ else
++ {
++ emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
++ operands[1]));
++ }
++ emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
++ emit_insn (gen_frame_blockage ());
++ DONE;
++})
++
+ (define_expand "prologue"
+ [(const_int 0)]
+ ""
+@@ -1767,6 +1794,25 @@
+ [(set_attr "length" "0")
+ (set_attr "type" "nop")])
+
++;; Do not schedule instructions accessing memory before this point.
++
++(define_expand "frame_blockage"
++ [(set (match_dup 0)
++ (unspec:BLK [(match_dup 1)] UNSPEC_FRAME_BLOCKAGE))]
++ ""
++{
++ operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
++ MEM_VOLATILE_P (operands[0]) = 1;
++ operands[1] = stack_pointer_rtx;
++})
++
++(define_insn "*frame_blockage"
++ [(set (match_operand:BLK 0 "" "")
++ (unspec:BLK [(match_operand:SI 1 "" "")] UNSPEC_FRAME_BLOCKAGE))]
++ ""
++ ""
++ [(set_attr "length" "0")])
++
+ (define_insn "trap"
+ [(trap_if (const_int 1) (const_int 0))]
+ ""
diff --git a/packages/gcc/7.3.0/0023-isl-0.20.patch b/packages/gcc/7.3.0/0023-isl-0.20.patch
new file mode 100644
index 0000000..3e14966
--- /dev/null
+++ b/packages/gcc/7.3.0/0023-isl-0.20.patch
@@ -0,0 +1,26 @@
+commit 9fabe086c9f5c3896297f7f35491d785ba6f49a0
+Author: Alexey Neyman <stilor@att.net>
+Date: Mon Sep 24 22:50:11 2018 -0700
+
+ Fix build with ISL 0.20
+
+ * gcc/graphite.h: Include <isl/id.h> and <isl/space.h>; these
+ headers are no longer pulled in by <isl/val.h>.
+
+ Signed-off-by: Alexey Neyman <stilor@att.net>
+
+---
+ gcc/graphite.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/gcc/graphite.h
++++ b/gcc/graphite.h
+@@ -26,6 +26,8 @@
+ #include <isl/options.h>
+ #include <isl/ctx.h>
+ #include <isl/val.h>
++#include <isl/id.h>
++#include <isl/space.h>
+ #include <isl/set.h>
+ #include <isl/union_set.h>
+ #include <isl/map.h>
diff --git a/packages/gcc/8.2.0/0000-libtool-leave-framework-alone.patch b/packages/gcc/8.2.0/0000-libtool-leave-framework-alone.patch
new file mode 100644
index 0000000..1a86e41
--- /dev/null
+++ b/packages/gcc/8.2.0/0000-libtool-leave-framework-alone.patch
@@ -0,0 +1,18 @@
+---
+ libtool-ldflags | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/libtool-ldflags
++++ b/libtool-ldflags
+@@ -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/packages/gcc/8.2.0/0001-uclibc-conf.patch b/packages/gcc/8.2.0/0001-uclibc-conf.patch
new file mode 100644
index 0000000..aef750a
--- /dev/null
+++ b/packages/gcc/8.2.0/0001-uclibc-conf.patch
@@ -0,0 +1,17 @@
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- 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/packages/gcc/8.2.0/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch b/packages/gcc/8.2.0/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
new file mode 100644
index 0000000..20a88df
--- /dev/null
+++ b/packages/gcc/8.2.0/0002-gcc-plugin-Win-Dont-need-undefined-extern-var-refs-nor-fpic.patch
@@ -0,0 +1,163 @@
+---
+ config/gcc-plugin.m4 | 18 +++++++++++++-----
+ gcc/configure | 22 +++++++++++++++-------
+ libcc1/configure | 22 +++++++++++++++-------
+ 3 files changed, 43 insertions(+), 19 deletions(-)
+
+--- a/config/gcc-plugin.m4
++++ b/config/gcc-plugin.m4
+@@ -21,6 +21,9 @@
+ pluginlibs=
+ plugin_check=yes
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-mingw*)
+ # Since plugin support under MinGW is not as straightforward as on
+@@ -43,6 +46,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -94,17 +102,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
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -29805,6 +29805,9 @@
+ pluginlibs=
+ plugin_check=yes
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-mingw*)
+ # Since plugin support under MinGW is not as straightforward as on
+@@ -29827,6 +29830,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -29939,23 +29947,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;
+ }
+--- a/libcc1/configure
++++ b/libcc1/configure
+@@ -14554,6 +14554,9 @@
+ pluginlibs=
+ plugin_check=yes
+
++ PICFLAG="-fPIC"
++ UNDEFINEDPREAMBLE="extern int X;"
++ UNDEFINEDCODE="return X == 0;"
+ case "${host}" in
+ *-*-mingw*)
+ # Since plugin support under MinGW is not as straightforward as on
+@@ -14576,6 +14579,11 @@
+ export_sym_check=
+ fi
+ ;;
++ *-*-mingw*|*-*-cygwin*|*-*-msys*)
++ PICFLAG=""
++ UNDEFINEDPREAMBLE=""
++ UNDEFINEDCODE=""
++ ;;
+ *)
+ if test x$build = x$host; then
+ export_sym_check="objdump${exeext} -T"
+@@ -14688,23 +14696,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/packages/gcc/8.2.0/0003-gcc-plugin-POSIX-include-sys-select-h.patch b/packages/gcc/8.2.0/0003-gcc-plugin-POSIX-include-sys-select-h.patch
new file mode 100644
index 0000000..5f9a07a
--- /dev/null
+++ b/packages/gcc/8.2.0/0003-gcc-plugin-POSIX-include-sys-select-h.patch
@@ -0,0 +1,14 @@
+---
+ libcc1/connection.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/libcc1/connection.cc
++++ b/libcc1/connection.cc
+@@ -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/packages/gcc/8.2.0/0004-arm-softfloat-libgcc.patch b/packages/gcc/8.2.0/0004-arm-softfloat-libgcc.patch
new file mode 100644
index 0000000..d980036
--- /dev/null
+++ b/packages/gcc/8.2.0/0004-arm-softfloat-libgcc.patch
@@ -0,0 +1,31 @@
+---
+ gcc/config/arm/linux-elf.h | 2 +-
+ libgcc/config/arm/t-linux | 7 ++++++-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -58,7 +58,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"
+
+--- 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/packages/gcc/8.2.0/0005-fix-m68k-uclinux.patch b/packages/gcc/8.2.0/0005-fix-m68k-uclinux.patch
new file mode 100644
index 0000000..02b53bd
--- /dev/null
+++ b/packages/gcc/8.2.0/0005-fix-m68k-uclinux.patch
@@ -0,0 +1,21 @@
+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>
+
+---
+ libgcc/config.host | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/libgcc/config.host
++++ b/libgcc/config.host
+@@ -847,7 +847,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/packages/gcc/8.2.0/0006-libgfortran-missing-include.patch b/packages/gcc/8.2.0/0006-libgfortran-missing-include.patch
new file mode 100644
index 0000000..701e7b4
--- /dev/null
+++ b/packages/gcc/8.2.0/0006-libgfortran-missing-include.patch
@@ -0,0 +1,14 @@
+---
+ libgfortran/io/close.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/libgfortran/io/close.c
++++ b/libgfortran/io/close.c
+@@ -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/packages/gcc/8.2.0/0007-nios2-bad-multilib-default.patch b/packages/gcc/8.2.0/0007-nios2-bad-multilib-default.patch
new file mode 100644
index 0000000..4acc491
--- /dev/null
+++ b/packages/gcc/8.2.0/0007-nios2-bad-multilib-default.patch
@@ -0,0 +1,31 @@
+---
+ gcc/config/nios2/nios2.h | 4 ++--
+ gcc/config/nios2/t-nios2 | 3 +--
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+--- a/gcc/config/nios2/nios2.h
++++ b/gcc/config/nios2/nios2.h
+@@ -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 \
+--- a/gcc/config/nios2/t-nios2
++++ b/gcc/config/nios2/t-nios2
+@@ -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/packages/gcc/8.2.0/0008-libgcc-disable-split-stack-nothreads.patch b/packages/gcc/8.2.0/0008-libgcc-disable-split-stack-nothreads.patch
new file mode 100644
index 0000000..df91a9f
--- /dev/null
+++ b/packages/gcc/8.2.0/0008-libgcc-disable-split-stack-nothreads.patch
@@ -0,0 +1,17 @@
+disable split-stack for non-thread builds
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+
+---
+ libgcc/config/t-stack | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/libgcc/config/t-stack
++++ b/libgcc/config/t-stack
+@@ -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/packages/gcc/8.2.0/0009-bionic-ndk.patch b/packages/gcc/8.2.0/0009-bionic-ndk.patch
new file mode 100644
index 0000000..474dd8c
--- /dev/null
+++ b/packages/gcc/8.2.0/0009-bionic-ndk.patch
@@ -0,0 +1,60 @@
+commit d38d37bdfe24b7ce1bdcb55642fb6b904718e68f
+Author: Howard Chu <hyc@symas.com>
+Date: Tue Apr 25 19:02:18 2017 -0700
+
+ Fix ctype for newer NDK headers
+
+---
+ libstdc++-v3/config/os/bionic/ctype_base.h | 34 +++++++++++++++++++----------
+ 1 file changed, 23 insertions(+), 11 deletions(-)
+
+--- 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 @@
+ // 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/packages/gcc/8.2.0/0010-crystax.patch b/packages/gcc/8.2.0/0010-crystax.patch
new file mode 100644
index 0000000..0db3b69
--- /dev/null
+++ b/packages/gcc/8.2.0/0010-crystax.patch
@@ -0,0 +1,523 @@
+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]
+---
+ gcc/config.gcc | 17 +++++++-
+ gcc/config/aarch64/aarch64-linux-android.h | 59 +++++++++++++++++++++++++++++
+ gcc/config/aarch64/aarch64-linux.h | 9 +++-
+ gcc/config/arm/arm.h | 3 -
+ gcc/config/arm/arm.md | 2
+ gcc/config/arm/arm.opt | 4 +
+ gcc/config/arm/elf.h | 9 ++--
+ gcc/config/arm/linux-eabi.h | 7 ++-
+ gcc/config/i386/gnu-user.h | 7 ++-
+ gcc/config/i386/gnu-user64.h | 5 ++
+ gcc/config/i386/linux-common.h | 8 +++
+ gcc/config/linux-android.h | 13 +++---
+ gcc/config/mips/android.h | 49 ++++++++++++++++++++++++
+ gcc/config/mips/gnu-user.h | 6 +-
+ gcc/config/mips/linux-common.h | 2
+ gcc/config/mips/t-linux-android | 3 +
+ gcc/config/mips/t-linux-android64 | 4 +
+ libgcc/gthr-posix.h | 13 ++++++
+ libstdc++-v3/configure | 12 +++++
+ libstdc++-v3/include/bits/locale_facets.h | 18 +++++++-
+ libstdc++-v3/libsupc++/guard.cc | 5 ++
+ 21 files changed, 235 insertions(+), 20 deletions(-)
+
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -981,14 +981,18 @@
+ tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
+ ;;
+ 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"
+ tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
+ 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
+@@ -2130,6 +2134,17 @@
+ 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
+ ;;
+--- /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 */
+--- 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"
+--- a/gcc/config/arm/arm.h
++++ b/gcc/config/arm/arm.h
+@@ -1840,10 +1840,11 @@
+
+ #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 \
+--- a/gcc/config/arm/arm.md
++++ b/gcc/config/arm/arm.md
+@@ -8640,7 +8640,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;
+--- a/gcc/config/arm/arm.opt
++++ b/gcc/config/arm/arm.opt
+@@ -202,6 +202,10 @@
+ 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.
+--- 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=auto: %{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
+@@ -95,7 +97,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))) \
+ && !target_pure_code)
+
+ #ifndef LINK_SPEC
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -102,11 +102,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, \
+--- a/gcc/config/i386/gnu-user.h
++++ b/gcc/config/i386/gnu-user.h
+@@ -65,9 +65,14 @@
+ 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 \
+--- a/gcc/config/i386/gnu-user64.h
++++ b/gcc/config/i386/gnu-user64.h
+@@ -46,6 +46,11 @@
+ #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} \
+--- a/gcc/config/i386/linux-common.h
++++ b/gcc/config/i386/linux-common.h
+@@ -30,7 +30,13 @@
+ #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 \
+--- a/gcc/config/linux-android.h
++++ b/gcc/config/linux-android.h
+@@ -38,15 +38,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}"
+--- /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
+--- a/gcc/config/mips/gnu-user.h
++++ b/gcc/config/mips/gnu-user.h
+@@ -36,6 +36,7 @@
+ /* 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 @@
+
+ #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 @@
+ #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. */ \
+--- a/gcc/config/mips/linux-common.h
++++ b/gcc/config/mips/linux-common.h
+@@ -35,7 +35,7 @@
+ #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 \
+--- /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
+--- /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
+--- a/libgcc/gthr-posix.h
++++ b/libgcc/gthr-posix.h
+@@ -32,6 +32,19 @@
+ #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)) \
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -78491,6 +78491,18 @@
+ /* 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
++#if !defined(SYS_gettid)
++#define SYS_gettid __NR_gettid
++#endif
++#if !defined(SYS_futex)
++#define SYS_futex __NR_futex
++#endif
+ int
+ main ()
+ {
+--- 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 @@
+ * @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 @@
+
+ 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
+--- a/libstdc++-v3/libsupc++/guard.cc
++++ b/libstdc++-v3/libsupc++/guard.cc
+@@ -34,7 +34,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/packages/gcc/8.2.0/0011-crystax.patch b/packages/gcc/8.2.0/0011-crystax.patch
new file mode 100644
index 0000000..f1f9eb1
--- /dev/null
+++ b/packages/gcc/8.2.0/0011-crystax.patch
@@ -0,0 +1,27 @@
+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>
+
+---
+ gcc/config/arm/t-linux-androideabi | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- 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/packages/gcc/8.2.0/0012-crystax.patch b/packages/gcc/8.2.0/0012-crystax.patch
new file mode 100644
index 0000000..2bf6cc7
--- /dev/null
+++ b/packages/gcc/8.2.0/0012-crystax.patch
@@ -0,0 +1,293 @@
+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>
+
+---
+ gcc/config.in | 6 +++++
+ gcc/config/alpha/elf.h | 4 +++
+ gcc/config/freebsd.h | 4 +++
+ gcc/config/gnu-user.h | 4 +++
+ gcc/config/openbsd.h | 4 +++
+ gcc/config/rs6000/sysv4.h | 6 ++++-
+ gcc/config/sol2.h | 4 +++
+ gcc/configure | 36 +++++++++++++++++++++++++++++++++
+ gcc/configure.ac | 29 ++++++++++++++++++++++++++
+ gcc/testsuite/g++.dg/eh/spec3-static.C | 25 ++++++++++++++++++++++
+ libgcc/crtstuff.c | 11 ++++++----
+ 11 files changed, 128 insertions(+), 5 deletions(-)
+
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -2219,6 +2219,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
+--- a/gcc/config/alpha/elf.h
++++ b/gcc/config/alpha/elf.h
+@@ -168,5 +168,9 @@
+ 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|static-pie:--eh-frame-hdr} "
+ #endif
++#endif
+--- a/gcc/config/freebsd.h
++++ b/gcc/config/freebsd.h
+@@ -45,8 +45,12 @@
+ #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|static-pie:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #ifdef TARGET_LIBC_PROVIDES_SSP
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+--- a/gcc/config/gnu-user.h
++++ b/gcc/config/gnu-user.h
+@@ -133,8 +133,12 @@
+ #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|static-pie:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #undef LINK_GCC_C_SEQUENCE_SPEC
+ #define LINK_GCC_C_SEQUENCE_SPEC \
+--- a/gcc/config/openbsd.h
++++ b/gcc/config/openbsd.h
+@@ -136,8 +136,12 @@
+ #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|static-pie:--eh-frame-hdr} "
+ #endif
++#endif
+
+ #undef LIB_SPEC
+ #define LIB_SPEC OBSD_LIB_SPEC
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -816,7 +816,11 @@
+ -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}"
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+-# define LINK_EH_SPEC "%{!static|static-pie:--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__ \
+--- a/gcc/config/sol2.h
++++ b/gcc/config/sol2.h
+@@ -400,7 +400,11 @@
+ /* 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|static-pie:--eh-frame-hdr} "
++#endif
+ #endif /* HAVE_LD_EH_FRAME && TARGET_DL_ITERATE_PHDR */
+ #endif
+
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -943,6 +943,7 @@
+ enable_fix_cortex_a53_843419
+ with_glibc_version
+ enable_gnu_unique_object
++enable_eh_frame_hdr_for_static
+ enable_linker_build_id
+ enable_libssp
+ enable_default_ssp
+@@ -1684,6 +1685,9 @@
+ --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-libssp enable linking against libssp
+@@ -28319,6 +28323,38 @@
+
+ $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; }
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5140,6 +5140,35 @@
+ 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)
+
+--- /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) { }
++}
+--- a/libgcc/crtstuff.c
++++ b/libgcc/crtstuff.c
+@@ -88,7 +88,8 @@
+ #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 @@
+ #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 @@
+ #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 @@
+ #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/packages/gcc/8.2.0/0013-crystax.patch b/packages/gcc/8.2.0/0013-crystax.patch
new file mode 100644
index 0000000..3b9347a
--- /dev/null
+++ b/packages/gcc/8.2.0/0013-crystax.patch
@@ -0,0 +1,22 @@
+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>
+
+---
+ gcc/config/i386/i386.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/gcc/config/i386/i386.c
++++ b/gcc/config/i386/i386.c
+@@ -15916,6 +15916,7 @@
+ 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/packages/gcc/8.2.0/0014-crystax.patch b/packages/gcc/8.2.0/0014-crystax.patch
new file mode 100644
index 0000000..8f2eb43
--- /dev/null
+++ b/packages/gcc/8.2.0/0014-crystax.patch
@@ -0,0 +1,26 @@
+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>
+
+---
+ libgcc/gthr.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/libgcc/gthr.h
++++ b/libgcc/gthr.h
+@@ -145,7 +145,11 @@
+ #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/packages/gcc/8.2.0/0015-crystax.patch b/packages/gcc/8.2.0/0015-crystax.patch
new file mode 100644
index 0000000..05d67f9
--- /dev/null
+++ b/packages/gcc/8.2.0/0015-crystax.patch
@@ -0,0 +1,33 @@
+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>
+
+---
+ gcc/config/arm/arm.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/gcc/config/arm/arm.c
++++ b/gcc/config/arm/arm.c
+@@ -22608,9 +22608,13 @@
+ 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/packages/gcc/8.2.0/0016-crystax.patch b/packages/gcc/8.2.0/0016-crystax.patch
new file mode 100644
index 0000000..8c21a1c
--- /dev/null
+++ b/packages/gcc/8.2.0/0016-crystax.patch
@@ -0,0 +1,23 @@
+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>
+
+---
+ gcc/config/i386/pmm_malloc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- 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/packages/gcc/8.2.0/0017-crystax.patch b/packages/gcc/8.2.0/0017-crystax.patch
new file mode 100644
index 0000000..ccb81fd
--- /dev/null
+++ b/packages/gcc/8.2.0/0017-crystax.patch
@@ -0,0 +1,34 @@
+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>
+
+---
+ gcc/config/aarch64/aarch64-linux-android.h | 4 ++++
+ gcc/config/mips/linux-common.h | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+--- a/gcc/config/aarch64/aarch64-linux-android.h
++++ b/gcc/config/aarch64/aarch64-linux-android.h
+@@ -56,4 +56,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 */
+--- a/gcc/config/mips/linux-common.h
++++ b/gcc/config/mips/linux-common.h
+@@ -62,3 +62,7 @@
+
+ /* 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/packages/gcc/8.2.0/0018-ARC-Add-multilib-support-for-linux-targets.patch b/packages/gcc/8.2.0/0018-ARC-Add-multilib-support-for-linux-targets.patch
new file mode 100644
index 0000000..6c0ff27
--- /dev/null
+++ b/packages/gcc/8.2.0/0018-ARC-Add-multilib-support-for-linux-targets.patch
@@ -0,0 +1,68 @@
+From 0eacfbcb2bf1834294f468a2bb41fe5d5e8d3883 Mon Sep 17 00:00:00 2001
+From: claziss <claziss@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 21 May 2018 09:56:57 +0000
+Subject: [PATCH] [ARC] Add multilib support for linux targets
+
+We used to build baremetal (AKA Elf32) multilibbed toolchains for years
+now but never made that for Linux targets since there were problems with
+uClibc n multilib setup. Now with help of Crosstool-NG it is finally
+possible to create uClibc-based multilibbed toolchains and so we add
+relevant CPUs for multilib in case of configuration for "arc*-*-linux*".
+
+This will be essentially useful for glibc-based multilibbbed toolchains
+in the future.
+
+gcc/
+2018-05-16 Alexey Brodkin <abrodkin@synopsys.com>
+
+ * config.gcc: Add arc/t-multilib-linux to tmake_file for
+ arc*-*-linux*.
+ * config/arc/t-multilib-linux: Specify MULTILIB_OPTIONS and
+ MULTILIB_DIRNAMES
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260434 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/config.gcc | 2 +-
+ gcc/config/arc/t-multilib-linux | 25 +++++++++++++++++++++++++
+ 2 files changed, 26 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/config/arc/t-multilib-linux
+
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -1063,7 +1063,7 @@
+ ;;
+ arc*-*-linux*)
+ tm_file="arc/arc-arch.h dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arc/linux.h ${tm_file}"
+- tmake_file="${tmake_file} arc/t-arc"
++ tmake_file="${tmake_file} arc/t-multilib-linux arc/t-arc"
+ extra_gcc_objs="driver-arc.o"
+ if test "x$with_cpu" != x; then
+ tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
+--- /dev/null
++++ b/gcc/config/arc/t-multilib-linux
+@@ -0,0 +1,25 @@
++# Copyright (C) 2018 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/>.
++
++MULTILIB_OPTIONS = mcpu=hs/mcpu=archs/mcpu=hs38/mcpu=hs38_linux/mcpu=arc700/mcpu=nps400
++
++MULTILIB_DIRNAMES = hs archs hs38 hs38_linux arc700 nps400
++
++# Aliases:
++MULTILIB_MATCHES += mcpu?arc700=mA7
++MULTILIB_MATCHES += mcpu?arc700=mARC700
diff --git a/packages/gcc/8.2.0/0019-isl-0.20.patch b/packages/gcc/8.2.0/0019-isl-0.20.patch
new file mode 100644
index 0000000..3e14966
--- /dev/null
+++ b/packages/gcc/8.2.0/0019-isl-0.20.patch
@@ -0,0 +1,26 @@
+commit 9fabe086c9f5c3896297f7f35491d785ba6f49a0
+Author: Alexey Neyman <stilor@att.net>
+Date: Mon Sep 24 22:50:11 2018 -0700
+
+ Fix build with ISL 0.20
+
+ * gcc/graphite.h: Include <isl/id.h> and <isl/space.h>; these
+ headers are no longer pulled in by <isl/val.h>.
+
+ Signed-off-by: Alexey Neyman <stilor@att.net>
+
+---
+ gcc/graphite.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/gcc/graphite.h
++++ b/gcc/graphite.h
+@@ -26,6 +26,8 @@
+ #include <isl/options.h>
+ #include <isl/ctx.h>
+ #include <isl/val.h>
++#include <isl/id.h>
++#include <isl/space.h>
+ #include <isl/set.h>
+ #include <isl/union_set.h>
+ #include <isl/map.h>
diff --git a/packages/gcc/8.2.0/0020-ARM-fix-cmse.patch b/packages/gcc/8.2.0/0020-ARM-fix-cmse.patch
new file mode 100644
index 0000000..4a501a2
--- /dev/null
+++ b/packages/gcc/8.2.0/0020-ARM-fix-cmse.patch
@@ -0,0 +1,69 @@
+From 8155b998a328748ca3d2cd1d012feb5c8286cd65 Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 17 May 2018 16:36:36 +0000
+Subject: [PATCH] 2018-05-17 Jerome Lambourg <lambourg@adacore.com>
+
+ gcc/
+ * config/arm/arm_cmse.h (cmse_nsfptr_create, cmse_is_nsfptr): Remove
+ #include <stdint.h>. Replace intptr_t with __INTPTR_TYPE__.
+
+ libgcc/
+ * config/arm/cmse.c (cmse_check_address_range): Replace
+ UINTPTR_MAX with __UINTPTR_MAX__ and uintptr_t with __UINTPTR_TYPE__.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260330 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/config/arm/arm_cmse.h | 5 ++---
+ libgcc/config/arm/cmse.c | 5 +++--
+ 4 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/arm/arm_cmse.h b/gcc/config/arm/arm_cmse.h
+index 367e212dc9c..f972e23659d 100644
+--- a/gcc/config/arm/arm_cmse.h
++++ b/gcc/config/arm/arm_cmse.h
+@@ -35,7 +35,6 @@ extern "C" {
+ #if __ARM_FEATURE_CMSE & 1
+
+ #include <stddef.h>
+-#include <stdint.h>
+
+ #ifdef __ARM_BIG_ENDIAN
+
+@@ -174,9 +173,9 @@ cmse_nonsecure_caller (void)
+ #define CMSE_MPU_NONSECURE 16
+ #define CMSE_NONSECURE 18
+
+-#define cmse_nsfptr_create(p) ((typeof ((p))) ((intptr_t) (p) & ~1))
++#define cmse_nsfptr_create(p) ((typeof ((p))) ((__INTPTR_TYPE__) (p) & ~1))
+
+-#define cmse_is_nsfptr(p) (!((intptr_t) (p) & 1))
++#define cmse_is_nsfptr(p) (!((__INTPTR_TYPE__) (p) & 1))
+
+ #endif /* __ARM_FEATURE_CMSE & 2 */
+
+diff --git a/libgcc/config/arm/cmse.c b/libgcc/config/arm/cmse.c
+index 3ded385693a..2ad0af2ecd8 100644
+--- a/libgcc/config/arm/cmse.c
++++ b/libgcc/config/arm/cmse.c
+@@ -36,7 +36,7 @@ cmse_check_address_range (void *p, size_t size, int flags)
+ char *pb = (char *) p, *pe;
+
+ /* Check if the range wraps around. */
+- if (UINTPTR_MAX - (uintptr_t) p < size)
++ if (__UINTPTR_MAX__ - (__UINTPTR_TYPE__) p < size)
+ return NULL;
+
+ /* Check if an unknown flag is present. */
+@@ -51,7 +51,8 @@ cmse_check_address_range (void *p, size_t size, int flags)
+
+ /* Execute the right variant of the TT instructions. */
+ pe = pb + size - 1;
+- const int singleCheck = (((uintptr_t) pb ^ (uintptr_t) pe) < 32);
++ const int singleCheck
++ = (((__UINTPTR_TYPE__) pb ^ (__UINTPTR_TYPE__) pe) < 32);
+ switch (flags & known_secure_level)
+ {
+ case 0:
+--
+2.14.4
+
diff --git a/packages/gcc/8.2.0/0021-arm-Make-arm_cmse.h-C99-compatible.patch b/packages/gcc/8.2.0/0021-arm-Make-arm_cmse.h-C99-compatible.patch
new file mode 100644
index 0000000..0989910
--- /dev/null
+++ b/packages/gcc/8.2.0/0021-arm-Make-arm_cmse.h-C99-compatible.patch
@@ -0,0 +1,40 @@
+From 02a72c22044c079becd5307c8b5c9552ba0c7f53 Mon Sep 17 00:00:00 2001
+From: avieira <avieira@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Tue, 5 Jun 2018 15:07:09 +0000
+Subject: [PATCH] [arm] Make arm_cmse.h C99 compatible
+
+gcc/ChangeLog
+2018-06-05 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * config/arm/arm_cmse.h (cmse_nsfptr_create): Change typeof to
+ __typeof__.
+ (cmse_check_pointed_object): Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261204 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/config/arm/arm_cmse.h | 4 ++--
+ 4 files changed, 16 insertions(+), 2 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.target/arm/cmse/cmse-1c99.c
+
+diff --git a/gcc/config/arm/arm_cmse.h b/gcc/config/arm/arm_cmse.h
+index f972e23659d..9b35537cd33 100644
+--- a/gcc/config/arm/arm_cmse.h
++++ b/gcc/config/arm/arm_cmse.h
+@@ -173,7 +173,7 @@ cmse_nonsecure_caller (void)
+ #define CMSE_MPU_NONSECURE 16
+ #define CMSE_NONSECURE 18
+
+-#define cmse_nsfptr_create(p) ((typeof ((p))) ((__INTPTR_TYPE__) (p) & ~1))
++#define cmse_nsfptr_create(p) ((__typeof__ ((p))) ((__INTPTR_TYPE__) (p) & ~1))
+
+ #define cmse_is_nsfptr(p) (!((__INTPTR_TYPE__) (p) & 1))
+
+@@ -187,7 +187,7 @@ __extension__ void *
+ cmse_check_address_range (void *, size_t, int);
+
+ #define cmse_check_pointed_object(p, f) \
+- ((typeof ((p))) cmse_check_address_range ((p), sizeof (*(p)), (f)))
++ ((__typeof__ ((p))) cmse_check_address_range ((p), sizeof (*(p)), (f)))
+
+ #endif /* __ARM_FEATURE_CMSE & 1 */
+
diff --git a/packages/gcc/8.2.0/chksum b/packages/gcc/8.2.0/chksum
new file mode 100644
index 0000000..2035f37
--- /dev/null
+++ b/packages/gcc/8.2.0/chksum
@@ -0,0 +1,8 @@
+md5 gcc-8.2.0.tar.xz 4ab282f414676496483b3e1793d07862
+sha1 gcc-8.2.0.tar.xz 19926bdb6c4b58891015929853d41aeff019d400
+sha256 gcc-8.2.0.tar.xz 196c3c04ba2613f893283977e6011b2345d1cd1af9abeac58e916b1aab3e0080
+sha512 gcc-8.2.0.tar.xz 64898a165f67e136d802a92e7633bf1b06c85266027e52127ea025bf5fc2291b5e858288aac0bdba246e6cdf7c6ec88bc8e0e7f3f6f1985f4297710cafde56ed
+md5 gcc-8.2.0.tar.gz ee04f0c22a941f5f17d93809387f2729
+sha1 gcc-8.2.0.tar.gz 3895bb765c2ceecccd6dee86467f6d1bb1994cbd
+sha256 gcc-8.2.0.tar.gz 1b0f36be1045ff58cbb9c83743835367b860810f17f0195a4e093458b372020f
+sha512 gcc-8.2.0.tar.gz 3182cd248a37ce4c36ad2a43f1910da13325452472ea80855afc21f134c4e4792c29887f5e070fe21c3ff8e5953e59f69343e1d3b968ee1eb2d8b5c8ae9f48fa
diff --git a/packages/linux/3.16.56/version.desc b/packages/gcc/8.2.0/version.desc
index e69de29..e69de29 100644
--- a/packages/linux/3.16.56/version.desc
+++ b/packages/gcc/8.2.0/version.desc
diff --git a/packages/gdb/8.1/0000-musl_fix.patch b/packages/gdb/8.1.1/0000-musl_fix.patch
index 6829780..6829780 100644
--- a/packages/gdb/8.1/0000-musl_fix.patch
+++ b/packages/gdb/8.1.1/0000-musl_fix.patch
diff --git a/packages/gdb/8.1/0001-uclibc-no-gettimeofday-clobber.patch b/packages/gdb/8.1.1/0001-uclibc-no-gettimeofday-clobber.patch
index c8b4a5e..c8b4a5e 100644
--- a/packages/gdb/8.1/0001-uclibc-no-gettimeofday-clobber.patch
+++ b/packages/gdb/8.1.1/0001-uclibc-no-gettimeofday-clobber.patch
diff --git a/packages/gdb/8.1/0002-xtensa-make-sure-ar_base-is-initialized.patch b/packages/gdb/8.1.1/0002-xtensa-make-sure-ar_base-is-initialized.patch
index 4a046fd..4a046fd 100644
--- a/packages/gdb/8.1/0002-xtensa-make-sure-ar_base-is-initialized.patch
+++ b/packages/gdb/8.1.1/0002-xtensa-make-sure-ar_base-is-initialized.patch
diff --git a/packages/gdb/8.1/0003-WIP-end-of-prologue-detection-hack.patch b/packages/gdb/8.1.1/0003-WIP-end-of-prologue-detection-hack.patch
index 90cfc51..90cfc51 100644
--- a/packages/gdb/8.1/0003-WIP-end-of-prologue-detection-hack.patch
+++ b/packages/gdb/8.1.1/0003-WIP-end-of-prologue-detection-hack.patch
diff --git a/packages/gdb/8.1/0004-allow-android.patch b/packages/gdb/8.1.1/0004-allow-android.patch
index cd47494..cd47494 100644
--- a/packages/gdb/8.1/0004-allow-android.patch
+++ b/packages/gdb/8.1.1/0004-allow-android.patch
diff --git a/packages/gdb/8.1.1/chksum b/packages/gdb/8.1.1/chksum
new file mode 100644
index 0000000..50dc2ae
--- /dev/null
+++ b/packages/gdb/8.1.1/chksum
@@ -0,0 +1,8 @@
+md5 gdb-8.1.1.tar.xz 372fa63a53adeee1bfbfd581d8da9e34
+sha1 gdb-8.1.1.tar.xz 8c04c12f11b5ba74e7506785632c7fc593ead90f
+sha256 gdb-8.1.1.tar.xz 97dcc3169bd430270fc29adb65145846a58c1b55cdbb73382a4a89307bdad03c
+sha512 gdb-8.1.1.tar.xz 7dcd5e8c90de92f577834d887b5f54edb93a07083bfe661bc46c270a6cc4919f0b348e7e2fe8ae4511298a570ef150eeefdc667ef7cf527f0cf60943177ab6c9
+md5 gdb-8.1.1.tar.gz 73919964409462c28879134853fbb8da
+sha1 gdb-8.1.1.tar.gz 815dfd374fc8d8613e819bf518b834d78a4c3114
+sha256 gdb-8.1.1.tar.gz 038623e5693d40a3048b014cd62c965e720f7bdbf326ff341b25de344a33fe11
+sha512 gdb-8.1.1.tar.gz 28ddf36fdf15e8f6ae0e4367756325f22b5eb72e689af1797f4265eea7551362a42850510bf67d4ca7fdb2e45a14ba198973c9fe8e19c89b7512af930026a5a6
diff --git a/packages/gdb/8.1/version.desc b/packages/gdb/8.1.1/version.desc
index e69de29..e69de29 100644
--- a/packages/gdb/8.1/version.desc
+++ b/packages/gdb/8.1.1/version.desc
diff --git a/packages/gdb/8.1/chksum b/packages/gdb/8.1/chksum
deleted file mode 100644
index c75924e..0000000
--- a/packages/gdb/8.1/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 gdb-8.1.tar.xz f46487561f9a16916a8102316f7fd105
-sha1 gdb-8.1.tar.xz 641861f7d3f22b6a23bc3e801f0ff29a78375490
-sha256 gdb-8.1.tar.xz af61a0263858e69c5dce51eab26662ff3d2ad9aa68da9583e8143b5426be4b34
-sha512 gdb-8.1.tar.xz ffd82f415d7652d62dad1716c307836f594217a363429609beb7d70239e8bf06b73b393345b0e000796228e56681ed7656ac3c8be05e91d6d652ab0d5b1dc357
-md5 gdb-8.1.tar.gz 0c85ecbb43569ec43b1c9230622e84ab
-sha1 gdb-8.1.tar.gz b28d9349ccd45c0aa208cda3a1ecf7e17eca0552
-sha256 gdb-8.1.tar.gz e54a2322da050e4b00785370a282b9b8f0b25861ec7cfbbce0115e253eea910e
-sha512 gdb-8.1.tar.gz 4a51e491061f97708ec1cebf9973ea451f9b9499ee2b898fa1631dbe78ffecec9c09e8a95f04c888dee4664957583b1982efd468088878b203a125bbcf9ee516
diff --git a/packages/gdb/8.2/0000-musl_fix.patch b/packages/gdb/8.2/0000-musl_fix.patch
new file mode 100644
index 0000000..6829780
--- /dev/null
+++ b/packages/gdb/8.2/0000-musl_fix.patch
@@ -0,0 +1,33 @@
+---
+ gdb/linux-nat.c | 5 +++++
+ gdb/stopcode.h | 4 ++++
+ 2 files changed, 9 insertions(+)
+
+--- 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"
+@@ -71,6 +72,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/packages/gdb/8.2/0001-uclibc-no-gettimeofday-clobber.patch b/packages/gdb/8.2/0001-uclibc-no-gettimeofday-clobber.patch
new file mode 100644
index 0000000..3bb6c20
--- /dev/null
+++ b/packages/gdb/8.2/0001-uclibc-no-gettimeofday-clobber.patch
@@ -0,0 +1,33 @@
+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>
+
+---
+ gdb/gnulib/configure | 1 +
+ gdb/gnulib/import/m4/gettimeofday.m4 | 1 +
+ 2 files changed, 2 insertions(+)
+
+--- a/gdb/gnulib/configure
++++ b/gdb/gnulib/configure
+@@ -17214,6 +17214,7 @@
+ 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
+--- a/gdb/gnulib/import/m4/gettimeofday.m4
++++ b/gdb/gnulib/import/m4/gettimeofday.m4
+@@ -111,6 +111,7 @@
+ 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/packages/gdb/8.2/0002-xtensa-make-sure-ar_base-is-initialized.patch b/packages/gdb/8.2/0002-xtensa-make-sure-ar_base-is-initialized.patch
new file mode 100644
index 0000000..8c0ffa1
--- /dev/null
+++ b/packages/gdb/8.2/0002-xtensa-make-sure-ar_base-is-initialized.patch
@@ -0,0 +1,30 @@
+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(+)
+
+--- a/gdb/xtensa-tdep.c
++++ b/gdb/xtensa-tdep.c
+@@ -3151,6 +3151,9 @@
+ if (tdep->num_regs == 0)
+ tdep->num_regs = tdep->num_nopriv_regs;
+
++ if (tdep->ar_base == -1)
++ tdep->ar_base = tdep->a0_base;
++
+ /* Number of pseudo registers. */
+ tdep->num_pseudo_regs = n - tdep->num_regs;
+
diff --git a/packages/gdb/8.2/0003-WIP-end-of-prologue-detection-hack.patch b/packages/gdb/8.2/0003-WIP-end-of-prologue-detection-hack.patch
new file mode 100644
index 0000000..dca5a2f
--- /dev/null
+++ b/packages/gdb/8.2/0003-WIP-end-of-prologue-detection-hack.patch
@@ -0,0 +1,26 @@
+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(-)
+
+--- a/gdb/xtensa-tdep.c
++++ b/gdb/xtensa-tdep.c
+@@ -2399,7 +2399,7 @@
+ /* 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. */
diff --git a/packages/gdb/8.2/0004-allow-android.patch b/packages/gdb/8.2/0004-allow-android.patch
new file mode 100644
index 0000000..c14d3df
--- /dev/null
+++ b/packages/gdb/8.2/0004-allow-android.patch
@@ -0,0 +1,45 @@
+---
+ gdb/gdbserver/configure | 11 -----------
+ gdb/gdbserver/configure.ac | 11 -----------
+ 2 files changed, 22 deletions(-)
+
+--- a/gdb/gdbserver/configure
++++ b/gdb/gdbserver/configure
+@@ -7645,17 +7645,6 @@
+
+
+ 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>
+
+--- a/gdb/gdbserver/configure.ac
++++ b/gdb/gdbserver/configure.ac
+@@ -193,17 +193,6 @@
+ ])
+
+ 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/packages/gdb/8.2/chksum b/packages/gdb/8.2/chksum
new file mode 100644
index 0000000..c384f48
--- /dev/null
+++ b/packages/gdb/8.2/chksum
@@ -0,0 +1,8 @@
+md5 gdb-8.2.tar.xz b5a49dbff00d9a87fbe114d14b3101c0
+sha1 gdb-8.2.tar.xz ee66294d87a109f88a459d0da5d0bb2da5135f45
+sha256 gdb-8.2.tar.xz c3a441a29c7c89720b734e5a9c6289c0a06be7e0c76ef538f7bbcef389347c39
+sha512 gdb-8.2.tar.xz 11cc481bebc51eb6db73249ecb62b8c07455cf3db169f4860b3a83114849fbd2b5860a2db64488ba6c5909cf07b255c04770f1e36059eae6bee16d2a3581be90
+md5 gdb-8.2.tar.gz 0783c6d86775c5aff06cccc8a3d7cad8
+sha1 gdb-8.2.tar.gz 86711a2d14b420b6d7d20418e98c60178fd5a1e0
+sha256 gdb-8.2.tar.gz 847e4b65e5a7b872e86019dd59659029e2b06cae962e0ef345f169dcb4b851b8
+sha512 gdb-8.2.tar.gz 2ce38e6c5e550cb2f9529abd4dd9bf1fcd172fed783cc15cd86950c1eb00f3dfde300942aa4e61d5683ba07e7601de3704e844735a5f26d435ece3ae1d8511fe
diff --git a/packages/gcc-linaro/7.2-2017.11/version.desc b/packages/gdb/8.2/version.desc
index e69de29..e69de29 100644
--- a/packages/gcc-linaro/7.2-2017.11/version.desc
+++ b/packages/gdb/8.2/version.desc
diff --git a/packages/gdb/package.desc b/packages/gdb/package.desc
index 0ca1dc6..b432cf9 100644
--- a/packages/gdb/package.desc
+++ b/packages/gdb/package.desc
@@ -1,5 +1,5 @@
origin='GNU'
repository='git git://sourceware.org/git/binutils-gdb.git'
mirrors='$(CT_Mirrors GNU gdb) $(CT_Mirrors sourceware gdb/releases)'
-milestones='7.0 7.2 8.0'
+milestones='7.0 7.2 7.12 8.0'
archive_formats='.tar.xz .tar.gz'
diff --git a/packages/glibc-linaro/2.20-2014.11/0011-strftime-multiple-stmts.patch b/packages/glibc-linaro/2.20-2014.11/0011-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..0f97e7d
--- /dev/null
+++ b/packages/glibc-linaro/2.20-2014.11/0011-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -738,12 +738,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc-linaro/2.20-2014.11/0012-if_nametoindex-size-check.patch b/packages/glibc-linaro/2.20-2014.11/0012-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..7976fdd
--- /dev/null
+++ b/packages/glibc-linaro/2.20-2014.11/0012-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -43,6 +43,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc-linaro/2.20-2014.11/0013-utmp-nonstring.patch b/packages/glibc-linaro/2.20-2014.11/0013-utmp-nonstring.patch
new file mode 100644
index 0000000..a4570fb
--- /dev/null
+++ b/packages/glibc-linaro/2.20-2014.11/0013-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -393,6 +393,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc-linaro/2.20-2014.11/0014-getlogin_r-use-strnlen.patch b/packages/glibc-linaro/2.20-2014.11/0014-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..ff19964
--- /dev/null
+++ b/packages/glibc-linaro/2.20-2014.11/0014-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -82,7 +82,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -91,7 +91,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc-linaro/2.20-2014.11/0015-zic.c-use-memcpy.patch b/packages/glibc-linaro/2.20-2014.11/0015-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..ef768aa
--- /dev/null
+++ b/packages/glibc-linaro/2.20-2014.11/0015-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1713,7 +1713,7 @@
+ }
+ #define DO(field) ((void) fwrite(tzh.field, sizeof tzh.field, 1, fp))
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.12.1/0045-strftime-multiple-stmts.patch b/packages/glibc/2.12.1/0045-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..e544b33
--- /dev/null
+++ b/packages/glibc/2.12.1/0045-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -742,12 +742,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.12.1/0046-if_nametoindex-size-check.patch b/packages/glibc/2.12.1/0046-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..5803db5
--- /dev/null
+++ b/packages/glibc/2.12.1/0046-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -54,6 +54,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.12.1/0047-utmp-nonstring.patch b/packages/glibc/2.12.1/0047-utmp-nonstring.patch
new file mode 100644
index 0000000..b789724
--- /dev/null
+++ b/packages/glibc/2.12.1/0047-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -350,6 +350,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.12.1/0048-getlogin_r-use-strnlen.patch b/packages/glibc/2.12.1/0048-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..15a16bd
--- /dev/null
+++ b/packages/glibc/2.12.1/0048-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -83,7 +83,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -92,7 +92,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.12.1/0049-zic.c-use-memcpy.patch b/packages/glibc/2.12.1/0049-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..4c89446
--- /dev/null
+++ b/packages/glibc/2.12.1/0049-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1648,7 +1648,7 @@
+ #define DO(field) (void) fwrite((void *) tzh.field, \
+ (size_t) sizeof tzh.field, (size_t) 1, fp)
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.12.2/0008-strftime-multiple-stmts.patch b/packages/glibc/2.12.2/0008-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..e544b33
--- /dev/null
+++ b/packages/glibc/2.12.2/0008-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -742,12 +742,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.12.2/0009-if_nametoindex-size-check.patch b/packages/glibc/2.12.2/0009-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..5803db5
--- /dev/null
+++ b/packages/glibc/2.12.2/0009-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -54,6 +54,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.12.2/0010-utmp-nonstring.patch b/packages/glibc/2.12.2/0010-utmp-nonstring.patch
new file mode 100644
index 0000000..b789724
--- /dev/null
+++ b/packages/glibc/2.12.2/0010-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -350,6 +350,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.12.2/0011-getlogin_r-use-strnlen.patch b/packages/glibc/2.12.2/0011-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..15a16bd
--- /dev/null
+++ b/packages/glibc/2.12.2/0011-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -83,7 +83,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -92,7 +92,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.12.2/0012-zic.c-use-memcpy.patch b/packages/glibc/2.12.2/0012-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..4c89446
--- /dev/null
+++ b/packages/glibc/2.12.2/0012-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1648,7 +1648,7 @@
+ #define DO(field) (void) fwrite((void *) tzh.field, \
+ (size_t) sizeof tzh.field, (size_t) 1, fp)
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.13/0044-strftime-multiple-stmts.patch b/packages/glibc/2.13/0044-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..e544b33
--- /dev/null
+++ b/packages/glibc/2.13/0044-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -742,12 +742,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.13/0045-if_nametoindex-size-check.patch b/packages/glibc/2.13/0045-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..5803db5
--- /dev/null
+++ b/packages/glibc/2.13/0045-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -54,6 +54,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.13/0046-utmp-nonstring.patch b/packages/glibc/2.13/0046-utmp-nonstring.patch
new file mode 100644
index 0000000..b789724
--- /dev/null
+++ b/packages/glibc/2.13/0046-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -350,6 +350,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.13/0047-getlogin_r-use-strnlen.patch b/packages/glibc/2.13/0047-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..15a16bd
--- /dev/null
+++ b/packages/glibc/2.13/0047-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -83,7 +83,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -92,7 +92,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.13/0048-zic.c-use-memcpy.patch b/packages/glibc/2.13/0048-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..4c89446
--- /dev/null
+++ b/packages/glibc/2.13/0048-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1648,7 +1648,7 @@
+ #define DO(field) (void) fwrite((void *) tzh.field, \
+ (size_t) sizeof tzh.field, (size_t) 1, fp)
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.14.1/0044-strftime-multiple-stmts.patch b/packages/glibc/2.14.1/0044-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..e544b33
--- /dev/null
+++ b/packages/glibc/2.14.1/0044-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -742,12 +742,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.14.1/0045-if_nametoindex-size-check.patch b/packages/glibc/2.14.1/0045-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..5803db5
--- /dev/null
+++ b/packages/glibc/2.14.1/0045-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -54,6 +54,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.14.1/0046-utmp-nonstring.patch b/packages/glibc/2.14.1/0046-utmp-nonstring.patch
new file mode 100644
index 0000000..b789724
--- /dev/null
+++ b/packages/glibc/2.14.1/0046-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -350,6 +350,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.14.1/0047-getlogin_r-use-strnlen.patch b/packages/glibc/2.14.1/0047-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..15a16bd
--- /dev/null
+++ b/packages/glibc/2.14.1/0047-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -83,7 +83,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -92,7 +92,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch b/packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..4c89446
--- /dev/null
+++ b/packages/glibc/2.14.1/0048-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1648,7 +1648,7 @@
+ #define DO(field) (void) fwrite((void *) tzh.field, \
+ (size_t) sizeof tzh.field, (size_t) 1, fp)
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.14/998-obstack-common.patch b/packages/glibc/2.14/998-obstack-common.patch
deleted file mode 100644
index 4b95f06..0000000
--- a/packages/glibc/2.14/998-obstack-common.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-commit 39b1f6172a2f9ddc74a8f82d6e84dd13b22dbaf2
-Author: Peter Collingbourne <pcc@google.com>
-Date: Wed May 15 20:28:08 2013 +0200
-
- Move _obstack_compat out of common
-
- it is impossible to create an alias of a common symbol (as
- compat_symbol does), because common symbols do not have a section or
- an offset until linked. GNU as tolerates aliases of common symbols by
- simply creating another common symbol, but other assemblers (notably
- LLVM's integrated assembler) are less tolerant.
-
- 2013-05-15 Peter Collingbourne <pcc@google.com>
-
- * malloc/obstack.c (_obstack_compat): Add initializer.
- -
-
-diff --git a/malloc/obstack.c b/malloc/obstack.c
-index 25a90514f7..c3c7db4a96 100644
---- a/malloc/obstack.c
-+++ b/malloc/obstack.c
-@@ -115,7 +115,7 @@ int obstack_exit_failure = EXIT_FAILURE;
- /* A looong time ago (before 1994, anyway; we're not sure) this global variable
- was used by non-GNU-C macros to avoid multiple evaluation. The GNU C
- library still exports it because somebody might use it. */
--struct obstack *_obstack_compat;
-+struct obstack *_obstack_compat = 0;
- compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0);
- # endif
- # endif
diff --git a/packages/glibc/2.15/0045-strftime-multiple-stmts.patch b/packages/glibc/2.15/0045-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..e544b33
--- /dev/null
+++ b/packages/glibc/2.15/0045-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -742,12 +742,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.15/0046-if_nametoindex-size-check.patch b/packages/glibc/2.15/0046-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..5803db5
--- /dev/null
+++ b/packages/glibc/2.15/0046-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -54,6 +54,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.15/0047-utmp-nonstring.patch b/packages/glibc/2.15/0047-utmp-nonstring.patch
new file mode 100644
index 0000000..3943cdf
--- /dev/null
+++ b/packages/glibc/2.15/0047-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -375,6 +375,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -61,10 +61,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.15/0048-getlogin_r-use-strnlen.patch b/packages/glibc/2.15/0048-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..15a16bd
--- /dev/null
+++ b/packages/glibc/2.15/0048-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -83,7 +83,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -92,7 +92,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.15/0049-zic.c-use-memcpy.patch b/packages/glibc/2.15/0049-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..4c89446
--- /dev/null
+++ b/packages/glibc/2.15/0049-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1648,7 +1648,7 @@
+ #define DO(field) (void) fwrite((void *) tzh.field, \
+ (size_t) sizeof tzh.field, (size_t) 1, fp)
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.15/0050-fdivp-order.patch b/packages/glibc/2.15/0050-fdivp-order.patch
new file mode 100644
index 0000000..159c9c4
--- /dev/null
+++ b/packages/glibc/2.15/0050-fdivp-order.patch
@@ -0,0 +1,27 @@
+commit 751728a1f10cdaf35c499c1d508a3a28ccfddc92
+Author: Marek Polacek <polacek@redhat.com>
+Date: Mon Apr 16 11:03:41 2012 +0200
+
+ Reverse arguments of fdivp in i386 code.
+
+---
+ sysdeps/i386/fpu/bits/fenv.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/i386/fpu/bits/fenv.h
++++ b/sysdeps/i386/fpu/bits/fenv.h
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 1997, 1998, 1999, 2000, 2011 Free Software Foundation, Inc.
++/* Copyright (C) 1997-2012 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
+@@ -122,7 +122,7 @@
+ # ifdef __SSE_MATH__
+ __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
+ # else
+- __asm__ __volatile__ ("fdivp %%st(1), %%st; fwait"
++ __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait"
+ : "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
+ # endif
+ (void) &__f;
diff --git a/packages/glibc/2.16.0/0037-strftime-multiple-stmts.patch b/packages/glibc/2.16.0/0037-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..88e658b
--- /dev/null
+++ b/packages/glibc/2.16.0/0037-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -737,12 +737,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.16.0/0038-if_nametoindex-size-check.patch b/packages/glibc/2.16.0/0038-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..375bb95
--- /dev/null
+++ b/packages/glibc/2.16.0/0038-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -44,6 +44,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.16.0/0039-utmp-nonstring.patch b/packages/glibc/2.16.0/0039-utmp-nonstring.patch
new file mode 100644
index 0000000..1f47956
--- /dev/null
+++ b/packages/glibc/2.16.0/0039-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -375,6 +375,15 @@
+ # define __glibc_unlikely(cond) (cond)
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -60,10 +60,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.16.0/0040-getlogin_r-use-strnlen.patch b/packages/glibc/2.16.0/0040-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..ff19964
--- /dev/null
+++ b/packages/glibc/2.16.0/0040-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -82,7 +82,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -91,7 +91,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.16.0/0041-zic.c-use-memcpy.patch b/packages/glibc/2.16.0/0041-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..8679c0a
--- /dev/null
+++ b/packages/glibc/2.16.0/0041-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1695,7 +1695,7 @@
+ #define DO(field) (void) fwrite((void *) tzh.field, \
+ (size_t) sizeof tzh.field, (size_t) 1, fp)
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.17/0013-strftime-multiple-stmts.patch b/packages/glibc/2.17/0013-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..88e658b
--- /dev/null
+++ b/packages/glibc/2.17/0013-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -737,12 +737,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.17/0014-if_nametoindex-size-check.patch b/packages/glibc/2.17/0014-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..375bb95
--- /dev/null
+++ b/packages/glibc/2.17/0014-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -44,6 +44,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.17/0015-utmp-nonstring.patch b/packages/glibc/2.17/0015-utmp-nonstring.patch
new file mode 100644
index 0000000..0ffcbcc
--- /dev/null
+++ b/packages/glibc/2.17/0015-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -382,6 +382,15 @@
+ # define __glibc_unlikely(cond) (cond)
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -60,10 +60,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.17/0016-getlogin_r-use-strnlen.patch b/packages/glibc/2.17/0016-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..ff19964
--- /dev/null
+++ b/packages/glibc/2.17/0016-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -82,7 +82,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -91,7 +91,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.17/0017-zic.c-use-memcpy.patch b/packages/glibc/2.17/0017-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..e5ab81e
--- /dev/null
+++ b/packages/glibc/2.17/0017-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1609,7 +1609,7 @@
+ }
+ #define DO(field) ((void) fwrite(tzh.field, sizeof tzh.field, 1, fp))
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.18/0014-strftime-multiple-stmts.patch b/packages/glibc/2.18/0014-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..88e658b
--- /dev/null
+++ b/packages/glibc/2.18/0014-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -737,12 +737,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.18/0015-if_nametoindex-size-check.patch b/packages/glibc/2.18/0015-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..375bb95
--- /dev/null
+++ b/packages/glibc/2.18/0015-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -44,6 +44,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.18/0016-utmp-nonstring.patch b/packages/glibc/2.18/0016-utmp-nonstring.patch
new file mode 100644
index 0000000..378d62e
--- /dev/null
+++ b/packages/glibc/2.18/0016-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -382,6 +382,15 @@
+ # define __glibc_likely(cond) (cond)
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.18/0017-getlogin_r-use-strnlen.patch b/packages/glibc/2.18/0017-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..ff19964
--- /dev/null
+++ b/packages/glibc/2.18/0017-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -82,7 +82,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -91,7 +91,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.18/0018-zic.c-use-memcpy.patch b/packages/glibc/2.18/0018-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..e5ab81e
--- /dev/null
+++ b/packages/glibc/2.18/0018-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1609,7 +1609,7 @@
+ }
+ #define DO(field) ((void) fwrite(tzh.field, sizeof tzh.field, 1, fp))
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = ZIC_VERSION;
+ convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+ convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.19/0012-strftime-multiple-stmts.patch b/packages/glibc/2.19/0012-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..88e658b
--- /dev/null
+++ b/packages/glibc/2.19/0012-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -737,12 +737,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.19/0013-if_nametoindex-size-check.patch b/packages/glibc/2.19/0013-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..375bb95
--- /dev/null
+++ b/packages/glibc/2.19/0013-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -44,6 +44,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.19/0014-utmp-nonstring.patch b/packages/glibc/2.19/0014-utmp-nonstring.patch
new file mode 100644
index 0000000..378d62e
--- /dev/null
+++ b/packages/glibc/2.19/0014-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -382,6 +382,15 @@
+ # define __glibc_likely(cond) (cond)
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.19/0015-getlogin_r-use-strnlen.patch b/packages/glibc/2.19/0015-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..ff19964
--- /dev/null
+++ b/packages/glibc/2.19/0015-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -82,7 +82,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -91,7 +91,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.19/0016-zic.c-use-memcpy.patch b/packages/glibc/2.19/0016-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..8b2b480
--- /dev/null
+++ b/packages/glibc/2.19/0016-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1676,7 +1676,7 @@
+ }
+ #define DO(field) ((void) fwrite(tzh.field, sizeof tzh.field, 1, fp))
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.20/0012-strftime-multiple-stmts.patch b/packages/glibc/2.20/0012-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..0f97e7d
--- /dev/null
+++ b/packages/glibc/2.20/0012-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -738,12 +738,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.20/0013-if_nametoindex-size-check.patch b/packages/glibc/2.20/0013-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..7976fdd
--- /dev/null
+++ b/packages/glibc/2.20/0013-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -43,6 +43,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.20/0014-utmp-nonstring.patch b/packages/glibc/2.20/0014-utmp-nonstring.patch
new file mode 100644
index 0000000..5a3da64
--- /dev/null
+++ b/packages/glibc/2.20/0014-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -392,6 +392,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.20/0015-getlogin_r-use-strnlen.patch b/packages/glibc/2.20/0015-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..ff19964
--- /dev/null
+++ b/packages/glibc/2.20/0015-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -82,7 +82,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -91,7 +91,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.20/0016-zic.c-use-memcpy.patch b/packages/glibc/2.20/0016-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..ef768aa
--- /dev/null
+++ b/packages/glibc/2.20/0016-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1713,7 +1713,7 @@
+ }
+ #define DO(field) ((void) fwrite(tzh.field, sizeof tzh.field, 1, fp))
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.21/0012-strftime-multiple-stmts.patch b/packages/glibc/2.21/0012-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..0f97e7d
--- /dev/null
+++ b/packages/glibc/2.21/0012-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -738,12 +738,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.21/0013-if_nametoindex-size-check.patch b/packages/glibc/2.21/0013-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..7976fdd
--- /dev/null
+++ b/packages/glibc/2.21/0013-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -43,6 +43,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.21/0014-utmp-nonstring.patch b/packages/glibc/2.21/0014-utmp-nonstring.patch
new file mode 100644
index 0000000..dab4e02
--- /dev/null
+++ b/packages/glibc/2.21/0014-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -399,6 +399,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #include <bits/wordsize.h>
+
+ #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.21/0015-getlogin_r-use-strnlen.patch b/packages/glibc/2.21/0015-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..ff19964
--- /dev/null
+++ b/packages/glibc/2.21/0015-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -82,7 +82,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -91,7 +91,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.21/0016-zic.c-use-memcpy.patch b/packages/glibc/2.21/0016-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..ef768aa
--- /dev/null
+++ b/packages/glibc/2.21/0016-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1713,7 +1713,7 @@
+ }
+ #define DO(field) ((void) fwrite(tzh.field, sizeof tzh.field, 1, fp))
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.22/0012-strftime-multiple-stmts.patch b/packages/glibc/2.22/0012-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..0f97e7d
--- /dev/null
+++ b/packages/glibc/2.22/0012-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -738,12 +738,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.22/0013-if_nametoindex-size-check.patch b/packages/glibc/2.22/0013-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..7976fdd
--- /dev/null
+++ b/packages/glibc/2.22/0013-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -43,6 +43,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.22/0014-utmp-nonstring.patch b/packages/glibc/2.22/0014-utmp-nonstring.patch
new file mode 100644
index 0000000..98f142c
--- /dev/null
+++ b/packages/glibc/2.22/0014-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -399,6 +399,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #if (!defined _Static_assert && !defined __cplusplus \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.22/0015-getlogin_r-use-strnlen.patch b/packages/glibc/2.22/0015-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..ff19964
--- /dev/null
+++ b/packages/glibc/2.22/0015-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -82,7 +82,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -91,7 +91,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.22/0016-zic.c-use-memcpy.patch b/packages/glibc/2.22/0016-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..ef768aa
--- /dev/null
+++ b/packages/glibc/2.22/0016-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1713,7 +1713,7 @@
+ }
+ #define DO(field) ((void) fwrite(tzh.field, sizeof tzh.field, 1, fp))
+ tzh = tzh0;
+- (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.23/0008-strftime-multiple-stmts.patch b/packages/glibc/2.23/0008-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..51983e4
--- /dev/null
+++ b/packages/glibc/2.23/0008-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -715,12 +715,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.23/0009-if_nametoindex-size-check.patch b/packages/glibc/2.23/0009-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..7976fdd
--- /dev/null
+++ b/packages/glibc/2.23/0009-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -43,6 +43,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.23/0010-utmp-nonstring.patch b/packages/glibc/2.23/0010-utmp-nonstring.patch
new file mode 100644
index 0000000..98f142c
--- /dev/null
+++ b/packages/glibc/2.23/0010-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -399,6 +399,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #if (!defined _Static_assert && !defined __cplusplus \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.23/0011-getlogin_r-use-strnlen.patch b/packages/glibc/2.23/0011-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..110adcd
--- /dev/null
+++ b/packages/glibc/2.23/0011-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -80,7 +80,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -89,7 +89,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.23/0012-zic.c-use-memcpy.patch b/packages/glibc/2.23/0012-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..96d0f1d
--- /dev/null
+++ b/packages/glibc/2.23/0012-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1819,7 +1819,7 @@
+ }
+ #define DO(field) fwrite(tzh.field, sizeof tzh.field, 1, fp)
+ tzh = tzh0;
+- strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.24/0008-strftime-multiple-stmts.patch b/packages/glibc/2.24/0008-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..51983e4
--- /dev/null
+++ b/packages/glibc/2.24/0008-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -715,12 +715,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.24/0009-if_nametoindex-size-check.patch b/packages/glibc/2.24/0009-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..7976fdd
--- /dev/null
+++ b/packages/glibc/2.24/0009-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -43,6 +43,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.24/0010-utmp-nonstring.patch b/packages/glibc/2.24/0010-utmp-nonstring.patch
new file mode 100644
index 0000000..5aad8a3
--- /dev/null
+++ b/packages/glibc/2.24/0010-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -404,6 +404,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #if (!defined _Static_assert && !defined __cplusplus \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.24/0011-getlogin_r-use-strnlen.patch b/packages/glibc/2.24/0011-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..110adcd
--- /dev/null
+++ b/packages/glibc/2.24/0011-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -80,7 +80,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -89,7 +89,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.24/0012-zic.c-use-memcpy.patch b/packages/glibc/2.24/0012-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..96d0f1d
--- /dev/null
+++ b/packages/glibc/2.24/0012-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1819,7 +1819,7 @@
+ }
+ #define DO(field) fwrite(tzh.field, sizeof tzh.field, 1, fp)
+ tzh = tzh0;
+- strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.25/0007-strftime-multiple-stmts.patch b/packages/glibc/2.25/0007-strftime-multiple-stmts.patch
new file mode 100644
index 0000000..51983e4
--- /dev/null
+++ b/packages/glibc/2.25/0007-strftime-multiple-stmts.patch
@@ -0,0 +1,73 @@
+commit e4043b84c49e1cf9bcf1e8320233343ecc34f8eb
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Tue Jun 27 17:12:13 2017 +0000
+
+ Fix strftime build with GCC 8.
+
+ Building with current GCC mainline fails with:
+
+ strftime_l.c: In function '__strftime_internal':
+ strftime_l.c:719:4: error: macro expands to multiple statements [-Werror=multistatement-macros]
+ digits = d > width ? d : width; \
+ ^
+ strftime_l.c:1260:6: note: in expansion of macro 'DO_NUMBER'
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+ ^~~~~~~~~
+ strftime_l.c:1259:4: note: some parts of macro expansion are not guarded by this 'else' clause
+ else
+ ^~~~
+
+ In fact this particular instance is harmless; the code looks like:
+
+ if (modifier == L_('O'))
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ and because of the goto, it doesn't matter that part of the expansion
+ isn't under the "else" conditional. But it's also clearly bad style
+ to rely on that. This patch changes DO_NUMBER and DO_NUMBER_SPACEPAD
+ to use do { } while (0) to avoid such problems.
+
+ Tested (full testsuite) for x86_64 (GCC 6), and with
+ build-many-glibcs.py with GCC mainline, in conjunction with my libgcc
+ patch <https://gcc.gnu.org/ml/gcc-patches/2017-06/msg02032.html>.
+
+ * time/strftime_l.c (DO_NUMBER): Define using do { } while (0).
+ (DO_NUMBER_SPACEPAD): Likewise.
+
+---
+ time/strftime_l.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -715,12 +715,22 @@
+ format_char = *f;
+ switch (format_char)
+ {
+-#define DO_NUMBER(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number
+-#define DO_NUMBER_SPACEPAD(d, v) \
+- digits = d > width ? d : width; \
+- number_value = v; goto do_number_spacepad
++#define DO_NUMBER(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number; \
++ } \
++ while (0)
++#define DO_NUMBER_SPACEPAD(d, v) \
++ do \
++ { \
++ digits = d > width ? d : width; \
++ number_value = v; \
++ goto do_number_spacepad; \
++ } \
++ while (0)
+
+ case L_('%'):
+ if (modifier != 0)
diff --git a/packages/glibc/2.25/0008-if_nametoindex-size-check.patch b/packages/glibc/2.25/0008-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..7976fdd
--- /dev/null
+++ b/packages/glibc/2.25/0008-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -43,6 +43,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.25/0009-utmp-nonstring.patch b/packages/glibc/2.25/0009-utmp-nonstring.patch
new file mode 100644
index 0000000..e5dd6f4
--- /dev/null
+++ b/packages/glibc/2.25/0009-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -430,6 +430,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #if (!defined _Static_assert && !defined __cplusplus \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.25/0010-getlogin_r-use-strnlen.patch b/packages/glibc/2.25/0010-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..110adcd
--- /dev/null
+++ b/packages/glibc/2.25/0010-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -80,7 +80,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -89,7 +89,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.25/0011-zic.c-use-memcpy.patch b/packages/glibc/2.25/0011-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..96d0f1d
--- /dev/null
+++ b/packages/glibc/2.25/0011-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1819,7 +1819,7 @@
+ }
+ #define DO(field) fwrite(tzh.field, sizeof tzh.field, 1, fp)
+ tzh = tzh0;
+- strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.26/0002-if_nametoindex-size-check.patch b/packages/glibc/2.26/0002-if_nametoindex-size-check.patch
new file mode 100644
index 0000000..7976fdd
--- /dev/null
+++ b/packages/glibc/2.26/0002-if_nametoindex-size-check.patch
@@ -0,0 +1,29 @@
+commit 2180fee114b778515b3f560e5ff1e795282e60b0
+Author: Steve Ellcey <sellcey@caviumnetworks.com>
+Date: Wed Nov 15 08:58:48 2017 -0800
+
+ Check length of ifname before copying it into to ifreq structure.
+
+ [BZ #22442]
+ * sysdeps/unix/sysv/linux/if_index.c (__if_nametoindex):
+ Check if ifname is too long.
+
+---
+ sysdeps/unix/sysv/linux/if_index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/sysdeps/unix/sysv/linux/if_index.c
++++ b/sysdeps/unix/sysv/linux/if_index.c
+@@ -43,6 +43,12 @@
+ if (fd < 0)
+ return 0;
+
++ if (strlen (ifname) >= IFNAMSIZ)
++ {
++ __set_errno (ENODEV);
++ return 0;
++ }
++
+ strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (__ioctl (fd, SIOCGIFINDEX, &ifr) < 0)
+ {
diff --git a/packages/glibc/2.26/0003-utmp-nonstring.patch b/packages/glibc/2.26/0003-utmp-nonstring.patch
new file mode 100644
index 0000000..bfcaad8
--- /dev/null
+++ b/packages/glibc/2.26/0003-utmp-nonstring.patch
@@ -0,0 +1,80 @@
+commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c
+Author: Martin Sebor <msebor@redhat.com>
+Date: Wed Nov 15 17:39:59 2017 -0700
+
+ The -Wstringop-truncation option new in GCC 8 detects common misuses
+ of the strncat and strncpy function that may result in truncating
+ the copied string before the terminating NUL. To avoid false positive
+ warnings for correct code that intentionally creates sequences of
+ characters that aren't guaranteed to be NUL-terminated, arrays that
+ are intended to store such sequences should be decorated with a new
+ nonstring attribute. This change add this attribute to Glibc and
+ uses it to suppress such false positives.
+
+ ChangeLog:
+ * misc/sys/cdefs.h (__attribute_nonstring__): New macro.
+ * sysdeps/gnu/bits/utmp.h (struct utmp): Use it.
+ * sysdeps/unix/sysv/linux/s390/bits/utmp.h (struct utmp): Same.
+
+---
+ misc/sys/cdefs.h | 9 +++++++++
+ sysdeps/gnu/bits/utmp.h | 9 ++++++---
+ sysdeps/unix/sysv/linux/s390/bits/utmp.h | 9 ++++++---
+ 3 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/misc/sys/cdefs.h
++++ b/misc/sys/cdefs.h
+@@ -408,6 +408,15 @@
+ # endif
+ #endif
+
++#if __GNUC_PREREQ (8, 0)
++/* Describes a char array whose address can safely be passed as the first
++ argument to strncpy and strncat, as the char array is not necessarily
++ a NUL-terminated string. */
++# define __attribute_nonstring__ __attribute__ ((__nonstring__))
++#else
++# define __attribute_nonstring__
++#endif
++
+ #if (!defined _Static_assert && !defined __cplusplus \
+ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+ && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
+--- a/sysdeps/gnu/bits/utmp.h
++++ b/sysdeps/gnu/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
+--- a/sysdeps/unix/sysv/linux/s390/bits/utmp.h
++++ b/sysdeps/unix/sysv/linux/s390/bits/utmp.h
+@@ -59,10 +59,13 @@
+ {
+ short int ut_type; /* Type of login. */
+ pid_t ut_pid; /* Process ID of login process. */
+- char ut_line[UT_LINESIZE]; /* Devicename. */
++ char ut_line[UT_LINESIZE]
++ __attribute_nonstring__; /* Devicename. */
+ char ut_id[4]; /* Inittab ID. */
+- char ut_user[UT_NAMESIZE]; /* Username. */
+- char ut_host[UT_HOSTSIZE]; /* Hostname for remote login. */
++ char ut_user[UT_NAMESIZE]
++ __attribute_nonstring__; /* Username. */
++ char ut_host[UT_HOSTSIZE]
++ __attribute_nonstring__; /* Hostname for remote login. */
+ struct exit_status ut_exit; /* Exit status of a process marked
+ as DEAD_PROCESS. */
+ /* The ut_session and ut_tv fields must be the same size when compiled
diff --git a/packages/glibc/2.26/0004-getlogin_r-use-strnlen.patch b/packages/glibc/2.26/0004-getlogin_r-use-strnlen.patch
new file mode 100644
index 0000000..110adcd
--- /dev/null
+++ b/packages/glibc/2.26/0004-getlogin_r-use-strnlen.patch
@@ -0,0 +1,47 @@
+commit 4bae615022cb5a5da79ccda83cc6c9ba9f2d479c
+Author: Joseph Myers <joseph@codesourcery.com>
+Date: Wed Nov 22 18:44:23 2017 +0000
+
+ Avoid use of strlen in getlogin_r (bug 22447).
+
+ Building glibc with current mainline GCC fails, among other reasons,
+ because of an error for use of strlen on the nonstring ut_user field.
+ This patch changes the problem code in getlogin_r to use __strnlen
+ instead. It also needs to set the trailing NUL byte of the result
+ explicitly, because of the case where ut_user does not have such a
+ trailing NUL byte (but the result should always have one).
+
+ Tested for x86_64. Also tested that, in conjunction with
+ <https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html>, it fixes
+ the build for arm with mainline GCC.
+
+ [BZ #22447]
+ * sysdeps/unix/getlogin_r.c (__getlogin_r): Use __strnlen not
+ strlen to compute length of ut_user and set trailing NUL byte of
+ result explicitly.
+
+---
+ sysdeps/unix/getlogin_r.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/unix/getlogin_r.c
++++ b/sysdeps/unix/getlogin_r.c
+@@ -80,7 +80,7 @@
+
+ if (result == 0)
+ {
+- size_t needed = strlen (ut->ut_user) + 1;
++ size_t needed = __strnlen (ut->ut_user, UT_NAMESIZE) + 1;
+
+ if (needed > name_len)
+ {
+@@ -89,7 +89,8 @@
+ }
+ else
+ {
+- memcpy (name, ut->ut_user, needed);
++ memcpy (name, ut->ut_user, needed - 1);
++ name[needed - 1] = 0;
+ result = 0;
+ }
+ }
diff --git a/packages/glibc/2.26/0005-zic.c-use-memcpy.patch b/packages/glibc/2.26/0005-zic.c-use-memcpy.patch
new file mode 100644
index 0000000..34ebbc5
--- /dev/null
+++ b/packages/glibc/2.26/0005-zic.c-use-memcpy.patch
@@ -0,0 +1,25 @@
+commit e69897bf202e18034cbef26f363bae64de70a196
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Nov 12 22:00:28 2017 -0800
+
+ timezone: pacify GCC -Wstringop-truncation
+
+ Problem reported by Martin Sebor in:
+ https://sourceware.org/ml/libc-alpha/2017-11/msg00336.html
+ * timezone/zic.c (writezone): Use memcpy, not strncpy.
+
+---
+ timezone/zic.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/timezone/zic.c
++++ b/timezone/zic.c
+@@ -1949,7 +1949,7 @@
+ }
+ #define DO(field) fwrite(tzh.field, sizeof tzh.field, 1, fp)
+ tzh = tzh0;
+- strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
++ memcpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+ tzh.tzh_version[0] = version;
+ convert(thistypecnt, tzh.tzh_ttisgmtcnt);
+ convert(thistypecnt, tzh.tzh_ttisstdcnt);
diff --git a/packages/glibc/2.27/version.desc b/packages/glibc/2.27/version.desc
index e69de29..50a6247 100644
--- a/packages/glibc/2.27/version.desc
+++ b/packages/glibc/2.27/version.desc
@@ -0,0 +1 @@
+# Not obsolete (Ubuntu 18.04, EOL 04/2023)
diff --git a/packages/glibc/2.28/0000-typedef-caddr.patch b/packages/glibc/2.28/0000-typedef-caddr.patch
new file mode 100644
index 0000000..a328da1
--- /dev/null
+++ b/packages/glibc/2.28/0000-typedef-caddr.patch
@@ -0,0 +1,17 @@
+---
+ posix/sys/types.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/posix/sys/types.h
++++ b/posix/sys/types.h
+@@ -112,7 +112,10 @@
+ #ifdef __USE_MISC
+ # ifndef __daddr_t_defined
+ typedef __daddr_t daddr_t;
++# if ! defined(caddr_t) && ! defined(__caddr_t_defined)
+ typedef __caddr_t caddr_t;
++# define __caddr_t_defined
++# endif
+ # define __daddr_t_defined
+ # endif
+ #endif
diff --git a/packages/glibc/2.28/chksum b/packages/glibc/2.28/chksum
new file mode 100644
index 0000000..256382f
--- /dev/null
+++ b/packages/glibc/2.28/chksum
@@ -0,0 +1,12 @@
+md5 glibc-2.28.tar.xz c81d2388896379997bc359d4f2084239
+sha1 glibc-2.28.tar.xz ccb5dc9e51a9884df8488f86982439d47b283b2a
+sha256 glibc-2.28.tar.xz b1900051afad76f7a4f73e71413df4826dce085ef8ddb785a945b66d7d513082
+sha512 glibc-2.28.tar.xz 521f820953ff07c69ece4c2186f59fc061a7f9747932cd70ef2995c2b2deee76eeb6de700d85071cdca5949179aa8ccee75eda7feca1394121ec7b821ad0a3f3
+md5 glibc-2.28.tar.bz2 191dc6cff5cc9a5a711ca94f56c97681
+sha1 glibc-2.28.tar.bz2 48a5dac8b4ef5c07d2da26de4afd52ef2d6cf286
+sha256 glibc-2.28.tar.bz2 da9e45260c0cd3dbf6a585082a602521092ae7b3ecb17092cd7347603ef1e2cb
+sha512 glibc-2.28.tar.bz2 9947355cc73a0c2c2e5d2e614092869ec26aa6e62753e82d6e2dc4e917309b7ad7b853fb2395445b60d2a5e73ae78106125425929d203fc2761e256fd2ee4729
+md5 glibc-2.28.tar.gz d5fea592406659df50d00666ff9d0c53
+sha1 glibc-2.28.tar.gz 3640cf2e373030f47622e4c89f3fd2a2bb912c6a
+sha256 glibc-2.28.tar.gz f318d6e3f1f4ed0b74d2832ac4f491d0fb928e451c9eda594cbf1c3bee7af47c
+sha512 glibc-2.28.tar.gz b603f92321c062c8d4a667a8c07a39318a1faf857226c5f4d6a86e239c2b08a33f099afb175fb8952063e053bc77cb91dabf94d50989dca86f70a8fbbabbfdbe
diff --git a/packages/glibc/2.28/version.desc b/packages/glibc/2.28/version.desc
new file mode 100644
index 0000000..50a6247
--- /dev/null
+++ b/packages/glibc/2.28/version.desc
@@ -0,0 +1 @@
+# Not obsolete (Ubuntu 18.04, EOL 04/2023)
diff --git a/packages/glibc/package.desc b/packages/glibc/package.desc
index 71ea200..ea03e69 100644
--- a/packages/glibc/package.desc
+++ b/packages/glibc/package.desc
@@ -1,6 +1,6 @@
origin='GNU'
repository='git git://sourceware.org/git/glibc.git'
mirrors='$(CT_Mirrors GNU glibc)'
-milestones='2.14 2.17 2.20 2.23 2.24 2.26'
+milestones='2.14 2.17 2.20 2.23 2.24 2.26 2.27'
archive_formats='.tar.xz .tar.bz2 .tar.gz'
signature_format='packed/.sig'
diff --git a/packages/isl/0.20/chksum b/packages/isl/0.20/chksum
new file mode 100644
index 0000000..3262b34
--- /dev/null
+++ b/packages/isl/0.20/chksum
@@ -0,0 +1,12 @@
+md5 isl-0.19.tar.xz 1ae893020fa078531e6158cb243880a5
+sha1 isl-0.19.tar.xz 3447b208786a81be396912bc160f6c01bd679892
+sha256 isl-0.19.tar.xz 6d6c1aa00e2a6dfc509fa46d9a9dbe93af0c451e196a670577a148feecf6b8a5
+sha512 isl-0.19.tar.xz eeda0405d38f77a18c6e69128948dc29af7e44ce827e9fb538d3844c6e22db3b4126287ca0937d9bee7b528bbab7aad8d3729db36e74864196f57e81943dade4
+md5 isl-0.19.tar.bz2 7850d46a96e5ea31e34913190895e154
+sha1 isl-0.19.tar.bz2 dba7264419ba995a0f6b4fde135993677f7c85fd
+sha256 isl-0.19.tar.bz2 d59726f34f7852a081fbd3defd1ab2136f174110fc2e0c8d10bb122173fa9ed8
+sha512 isl-0.19.tar.bz2 08f4db964d9e02ec8aa9779378ed76e0ddf1d56f81f87664dbf787555ce496cdc87e836f8a51ae137f45e648c604870cce07ee45919eafb549e404afb8f27083
+md5 isl-0.19.tar.gz 5a2dc001276a227509b2bab3382e461f
+sha1 isl-0.19.tar.gz db4e0b8d79b14de65ff6d90b446e5d5643bfaeba
+sha256 isl-0.19.tar.gz dc56525cac8581b13c84a26a73d3142008912b7157f89b8d8d7b08f1a8fd1eec
+sha512 isl-0.19.tar.gz 55a37c118ec427273399c20d268911152304a8686453dbf2ce0c45a045509c60a6fc8ffeb2299dce0cdde4506111c8f709d37340f4e136b346cb38d763968e12
diff --git a/packages/gcc-linaro/6.4-2017.11/version.desc b/packages/isl/0.20/version.desc
index e69de29..e69de29 100644
--- a/packages/gcc-linaro/6.4-2017.11/version.desc
+++ b/packages/isl/0.20/version.desc
diff --git a/packages/isl/package.desc b/packages/isl/package.desc
index 727bd30..3e1e9ca 100644
--- a/packages/isl/package.desc
+++ b/packages/isl/package.desc
@@ -1,5 +1,5 @@
repository='git git://repo.or.cz/isl.git'
bootstrap='./autogen.sh'
mirrors='http://isl.gforge.inria.fr'
-milestones='0.12 0.13 0.14 0.15'
+milestones='0.12 0.13 0.14 0.15 0.18'
archive_formats='.tar.xz .tar.bz2 .tar.gz'
diff --git a/packages/linux/2.6.32.27/0000-unifdef-strclpy.patch b/packages/linux/2.6.32.27/0000-unifdef-strclpy.patch
deleted file mode 100644
index 6b67cf0..0000000
--- a/packages/linux/2.6.32.27/0000-unifdef-strclpy.patch
+++ /dev/null
@@ -1,15 +0,0 @@
----
- scripts/unifdef.c | 2 --
- 1 file changed, 2 deletions(-)
-
---- a/scripts/unifdef.c
-+++ b/scripts/unifdef.c
-@@ -72,8 +72,6 @@
- #include <string.h>
- #include <unistd.h>
-
--size_t strlcpy(char *dst, const char *src, size_t siz);
--
- /* types of input lines: */
- typedef enum {
- LT_TRUEI, /* a true #if with ignore flag */
diff --git a/packages/linux/2.6.32.27/chksum b/packages/linux/2.6.32.27/chksum
deleted file mode 100644
index c3f135d..0000000
--- a/packages/linux/2.6.32.27/chksum
+++ /dev/null
@@ -1,12 +0,0 @@
-md5 linux-2.6.32.27.tar.xz a0a450d15cd65b8ca9c772b01ac66a88
-sha1 linux-2.6.32.27.tar.xz bbf9a89ad7ec034027765b88f8eddff038e05eef
-sha256 linux-2.6.32.27.tar.xz 96c20c370ed440db61624d93f34721a09a69b12bb81b1b03bb735041983fb1bd
-sha512 linux-2.6.32.27.tar.xz 8db6e5e27f8fec846e18843fd6fced682ebf0c3d8e4d5b22dec6ad6d22127eb1d84a6035b15334c0abe5db4e4c8c97f7a97fb6f67b5a30e8209b0ab03f5b3890
-md5 linux-2.6.32.27.tar.bz2 c8df8bed01a3b7e4ce13563e74181d71
-sha1 linux-2.6.32.27.tar.bz2 8a96a5d337226613fa6773f8bcf0e53611d48835
-sha256 linux-2.6.32.27.tar.bz2 ac78fab9ebe96bc48ed0571b9fe2b7251bb7b4564c785a77401f43a77d0df223
-sha512 linux-2.6.32.27.tar.bz2 a0969b6c94ede74b4707e256bbf98173c730db19b6f2c0607a37ba8a45a9d64a9f18447e0d879c114f5a4acc9e27406100001aae8d4c69c753ee8acb8498a0c8
-md5 linux-2.6.32.27.tar.gz 4c7b2c1f39a23027dcd1d9ae53e98805
-sha1 linux-2.6.32.27.tar.gz 7666f87577e0b788925d4bc4815db91d3227d04a
-sha256 linux-2.6.32.27.tar.gz db0fc93c43e8832bede50ca7f78e812f48519ced5da14e901ab5460eb7bdac01
-sha512 linux-2.6.32.27.tar.gz 5c49af75cd3261e2308d0a34accb1afd8dbd6b37d7010dd3626cd4bf696d5c384767438b3216136495b22c4046cbb87f66081d26e176442b4620ef53f5865080
diff --git a/packages/linux/2.6.32.71/chksum b/packages/linux/2.6.32.71/chksum
new file mode 100644
index 0000000..ef9cfe3
--- /dev/null
+++ b/packages/linux/2.6.32.71/chksum
@@ -0,0 +1,8 @@
+md5 linux-2.6.32.71.tar.xz 1dcf8eaa41fc479169be80d015bce4d9
+sha1 linux-2.6.32.71.tar.xz bbce5984437bb5efa3a3e3aae368d3bc8bcbbbbe
+sha256 linux-2.6.32.71.tar.xz 60a5ffe0206a0ea8997c29ccc595aa7dae55f6cb20c7d92aab88029ca4fef598
+sha512 linux-2.6.32.71.tar.xz e61c7a393d7b51ea9f8ee23bea3c107a9e97d247bce4906f5a6a9b8ce3fcfc488674854c114a22f93d1d2b2c4afd6880c3cd7fffeb8e1365b358bc911391e0e3
+md5 linux-2.6.32.71.tar.gz 41758c9100616611a6ab2e8db61e698b
+sha1 linux-2.6.32.71.tar.gz 62c2226187491621ead7dd6d2f1aedc04695970e
+sha256 linux-2.6.32.71.tar.gz 640af1c1a9aad730b1e733f3be3671d503842be42d40adffd2af72dd21ca41be
+sha512 linux-2.6.32.71.tar.gz 2277eaf4c34192047ddc806a0af3beaf2bd6f6ff9b97c5fb9de3ba459da1c3b7187686e024268d8e4e7a8b03583fbd3626dccdfd67b1c2adbd5c48f068f3fd79
diff --git a/packages/linux/2.6.32.27/version.desc b/packages/linux/2.6.32.71/version.desc
index 1199456..9a7c522 100644
--- a/packages/linux/2.6.32.27/version.desc
+++ b/packages/linux/2.6.32.71/version.desc
@@ -1,2 +1,2 @@
# Not obsolete: used by CentOS6.x, EOL 11/2020
-archive_formats='.tar.xz .tar.bz2 .tar.gz'
+archive_formats='.tar.xz .tar.gz'
diff --git a/packages/linux/3.16.56/chksum b/packages/linux/3.16.56/chksum
deleted file mode 100644
index 8930342..0000000
--- a/packages/linux/3.16.56/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 linux-3.16.56.tar.xz d97888ca7ede8a52cedb7ce3eb2f495f
-sha1 linux-3.16.56.tar.xz 7d8d4803c5ab0e99e6a7d857a8a5ab2a3bbf6668
-sha256 linux-3.16.56.tar.xz 50a69d586b197b1f0dead9fef7232a39ecb25fafdcd6045e1d80db4d9e753cbb
-sha512 linux-3.16.56.tar.xz 10710fc2008fa6c76f71a7aabb0e075a333e7ea4e6714e2a1282929ea4c91e4108e6cc6a434e2434c3813f0b92139c7bb921969f8e090be4d85888bbc5bad1ad
-md5 linux-3.16.56.tar.gz 1a37c8dbe835e99e1ee582331831298f
-sha1 linux-3.16.56.tar.gz 742fee1c5ef5f0baf4ed2de96d932ff9cb740167
-sha256 linux-3.16.56.tar.gz d67e3894a66a1fceaea933d29f8633ebb4aab8769f01becd842294195243c768
-sha512 linux-3.16.56.tar.gz 5e506cc0c548e114a3b8dca9a643ec6df7fa6af8898da4c20be3453fcbc206fcd380c78bd194f96899d68ae4988d39713f2758b932d98f2dd095b61f84f8c058
diff --git a/packages/linux/3.16.57/chksum b/packages/linux/3.16.57/chksum
new file mode 100644
index 0000000..b2e04db
--- /dev/null
+++ b/packages/linux/3.16.57/chksum
@@ -0,0 +1,8 @@
+md5 linux-3.16.57.tar.xz 83fd3fc94f11fd0232ad2b8285f342f8
+sha1 linux-3.16.57.tar.xz 7174d3d6024e75913a418335e1b755b1f2dd2e4f
+sha256 linux-3.16.57.tar.xz eee0d048c595c07c1a4d09e506ae91f7ec432fe936d0672fc1fd1c788cc5775c
+sha512 linux-3.16.57.tar.xz 8efae7b2017b1df5b040b393f763772ab5b4d9351656afed086bef69e2f123bf263ba34cc17165041a83c3e49886597e0aa4c3d40a9cca4ee787f18ca3c5df8d
+md5 linux-3.16.57.tar.gz 0251f083c9783abfcdfafd90dd57fabb
+sha1 linux-3.16.57.tar.gz 12c9c1b24b414f31350edc719b37b7be7bd0328b
+sha256 linux-3.16.57.tar.gz fe8a452698c57efa38da87fd6ac08c9edbc1182dd573bd78ff158e0e0e310f73
+sha512 linux-3.16.57.tar.gz e26b2ccb490149113e34a5c58bb38486b2a1eb70610872d6434c00b1ba86a258c26a1b406a261c58818d64366687d13fdd94d36575c2404ee768cc1f4ca482f7
diff --git a/packages/expat/2.2.5/version.desc b/packages/linux/3.16.57/version.desc
index e69de29..e69de29 100644
--- a/packages/expat/2.2.5/version.desc
+++ b/packages/linux/3.16.57/version.desc
diff --git a/packages/linux/3.18.104/chksum b/packages/linux/3.18.104/chksum
deleted file mode 100644
index 35d4339..0000000
--- a/packages/linux/3.18.104/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 linux-3.18.104.tar.xz b93fd791ddfcdf25ab57a431ab910ecb
-sha1 linux-3.18.104.tar.xz 6b42933e48e6f07b8f5775a632dc2fcfb5275b47
-sha256 linux-3.18.104.tar.xz e45c3bce562a0efcf67d2f36ef79b2f85dc0e4b7724c61a93040ebcf2da0c1a1
-sha512 linux-3.18.104.tar.xz a9c7aae3be94900c4b0196c273abbd91380d29ae620d0eb4288592bf23e635076f6ce48957159919d52ad68f8777e534eec06501f4fc44dff761305ead609191
-md5 linux-3.18.104.tar.gz 4af7ea30a67b8df33ae26eefedf14258
-sha1 linux-3.18.104.tar.gz 0f2676409309506e43fb0ec61aa923a97b784b96
-sha256 linux-3.18.104.tar.gz 93cb078ba816cd47955e925f17e8bdfcb061a0f73ed4b1d71f15cc88a50f4eab
-sha512 linux-3.18.104.tar.gz ee8b973676f3db8b3529f76c5ea974cae6a91c4bb32e7a68d05066621317226e22b454d741c7facd68366a298d6f9453ce30ff1771ac76d4e7ac6a7b515419e6
diff --git a/packages/linux/3.18.104/version.desc b/packages/linux/3.18.104/version.desc
deleted file mode 100644
index fcfe389..0000000
--- a/packages/linux/3.18.104/version.desc
+++ /dev/null
@@ -1 +0,0 @@
-obsolete='yes'
diff --git a/packages/linux/3.18.122/chksum b/packages/linux/3.18.122/chksum
new file mode 100644
index 0000000..1662406
--- /dev/null
+++ b/packages/linux/3.18.122/chksum
@@ -0,0 +1,8 @@
+md5 linux-3.18.122.tar.xz 2eff408b8aff35792c2512e4b998fed1
+sha1 linux-3.18.122.tar.xz 4c7d2aa0d2e5ceabacbdd9b941463379ff67b59c
+sha256 linux-3.18.122.tar.xz 675b1ce36af23caa500cb1d4f0ec2976791fb0a97ebb6486a5e2ebcb5527ade5
+sha512 linux-3.18.122.tar.xz 4d86edec87e4fe6bfbecb67f6ad8e0d73a3d55046f71a73ffc3eb6f786c324b8bce634e4a6d5df829ea3c6305cec96d568c1ae029f3d8f3e9c9a297035438ba4
+md5 linux-3.18.122.tar.gz 5cbf54fdf3803402460621a169b2dbaf
+sha1 linux-3.18.122.tar.gz 50d71682f2f477dc6c6115dd40c6c8b0d1936413
+sha256 linux-3.18.122.tar.gz 4f279558c91f646c888f05cbb95170bd2ec4b40c19ebcf00498b63ffc4da9990
+sha512 linux-3.18.122.tar.gz 94c8c24fdecf83b93f7fbef38746654e00d60f49f0c7f85ff0161d1210e9ae2cd51387e70590b9993b5f79726350f643fb716da0b706c44cdffdc76ddad2ecde
diff --git a/packages/linux/4.10.8/version.desc b/packages/linux/3.18.122/version.desc
index fcfe389..fcfe389 100644
--- a/packages/linux/4.10.8/version.desc
+++ b/packages/linux/3.18.122/version.desc
diff --git a/packages/linux/4.14.33/chksum b/packages/linux/4.14.33/chksum
deleted file mode 100644
index e90e76b..0000000
--- a/packages/linux/4.14.33/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 linux-4.14.33.tar.xz 2f360c8caf7ee2efa416ee742394ba20
-sha1 linux-4.14.33.tar.xz c7818be83edb7d0b7cb6494044b06aa8a92c8939
-sha256 linux-4.14.33.tar.xz c380e2b4318d9ef0517c29145cf6fa1f6f437f38e93827ccd772184f77b90831
-sha512 linux-4.14.33.tar.xz 9809828f1dfaeddd5b663b0d9a607baaa11491a7ddce41042a076353e713ff40000efff96a4a3c69c865cdcdfc333eee14f7d82c6a79341dd38889b973a86c92
-md5 linux-4.14.33.tar.gz 2300dc006363943f02b2d90bebdeba80
-sha1 linux-4.14.33.tar.gz c3e50721804b7eefd8fffca6d9f7a7ceec786bc7
-sha256 linux-4.14.33.tar.gz f1569e37cda1aa99346ce51c472777e07c37d15345161a104959afc4e19564f7
-sha512 linux-4.14.33.tar.gz b67231e5d7797fa2324ea438c80a92595d7e9e55344e31818822a6026ed79713eb22483c11f75a8fa5cc88358b9290f9ea53de392b0f0329171db8c8084b834c
diff --git a/packages/linux/4.14.71/chksum b/packages/linux/4.14.71/chksum
new file mode 100644
index 0000000..0aa9525
--- /dev/null
+++ b/packages/linux/4.14.71/chksum
@@ -0,0 +1,8 @@
+md5 linux-4.14.71.tar.xz 14b21e5f11e8e195731c89a14794a0fc
+sha1 linux-4.14.71.tar.xz ba79733491f2555fcc7a43e60d49c54e96f77b51
+sha256 linux-4.14.71.tar.xz 76a4473dbcbd922c23a16130414829a36eb7e2f4e5859bd1b742fffdff907489
+sha512 linux-4.14.71.tar.xz eac04b59428f41be24aa2ac117d49e72f8ec10d46fbb779e1703fb46c720f8cfce714abe5be2f936a9e7148e6fae94bba12b74fcbdbe8b6d965cd7ad39fd44b4
+md5 linux-4.14.71.tar.gz 899d706698fbacf2881cba56dc1680c4
+sha1 linux-4.14.71.tar.gz dc39a8b320b58eca88100230b40d5dbaf836e2cb
+sha256 linux-4.14.71.tar.gz cc7e596d813c6430a34e7c774f6e3f7ac62df748b74950670a8cdd066876df29
+sha512 linux-4.14.71.tar.gz 419b900aa2510ae9ef19c1e4d9c5d98f1de12fa84e35d66bc12012bd2ff8f6b7d438c6f0eea0cc909c3fca3d87eb367283f0d6c668b3aa9e1e1b7c4b55580a99
diff --git a/packages/linux/4.14.71/version.desc b/packages/linux/4.14.71/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/linux/4.14.71/version.desc
diff --git a/packages/linux/4.15.16/chksum b/packages/linux/4.15.16/chksum
deleted file mode 100644
index 6f4d682..0000000
--- a/packages/linux/4.15.16/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 linux-4.15.16.tar.xz b243f89da2ceaec029e62daeb80f1da0
-sha1 linux-4.15.16.tar.xz acb18ea9d7030a267b4f2bb4bf63024dbede77e3
-sha256 linux-4.15.16.tar.xz e7daf2592d5eb51e5252782b1bb39e298a31517ff13759681cf882e40058c503
-sha512 linux-4.15.16.tar.xz 87fb17f17e2b3daeeacadd72ba074ca8d7cf18aa0dd60869d98a1f7c8240779d9470ddd198da2f684774dbe9a93c03b1292d0a85d5021abb330ef4ac6adf73dd
-md5 linux-4.15.16.tar.gz f933b3dbc1a67627058345b60c361360
-sha1 linux-4.15.16.tar.gz 3a6afc968d0530db415e9e4bb5c9c28a3459b171
-sha256 linux-4.15.16.tar.gz 82d7dc5d9d23883ea5040664c8999429b36708e6508108fac775c39f6e957bf2
-sha512 linux-4.15.16.tar.gz f58d8d4a4fd505386869e3bbba47c42002709f031acf0490629aaa42bdca11e2a852edf6756d5280773e7cd9788215e4f7fe197947b2dac5174c8c5722e3f7d1
diff --git a/packages/linux/4.15.18/chksum b/packages/linux/4.15.18/chksum
new file mode 100644
index 0000000..3a92b9a
--- /dev/null
+++ b/packages/linux/4.15.18/chksum
@@ -0,0 +1,8 @@
+md5 linux-4.15.18.tar.xz 2c7a9404ddf29580f14c61eb87e50c6e
+sha1 linux-4.15.18.tar.xz 3d9caaa4abc3fa1522976b37edb193dac42df501
+sha256 linux-4.15.18.tar.xz 3f89cd717e0d497ba4818e145a33002f4c15032e355c1ad6d3d7f31f122caf41
+sha512 linux-4.15.18.tar.xz d0f6819ef6cf809769ceb717419c57b422bea611da23db63d7d0de15545278bafc9a3de04491dfe2f669eb5f62a718c000bebbe8e7b508796b9c461794d3deec
+md5 linux-4.15.18.tar.gz d0f38e59bee1377048ce1f4df1ba0fda
+sha1 linux-4.15.18.tar.gz 9c985114a956f8660a112b9ac3032cfcf8199fe9
+sha256 linux-4.15.18.tar.gz ca13fa5c6e3a6b434556530d92bc1fc86532c2f4f5ae0ed766f6b709322d6495
+sha512 linux-4.15.18.tar.gz 08578937a10d73e6a8232294a3245ea7420865cd9108914b04e9b2e8f5209ec6f5e56460b3a3e51d700f41f73585f3c8a585cc70e8a865d8b9f3e84d21c98bd3
diff --git a/packages/linux/4.15.18/version.desc b/packages/linux/4.15.18/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/linux/4.15.18/version.desc
diff --git a/packages/linux/4.15/chksum b/packages/linux/4.15/chksum
deleted file mode 100644
index 2707761..0000000
--- a/packages/linux/4.15/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 linux-4.15.tar.xz 0d701ac1e2a67d47ce7127432df2c32b
-sha1 linux-4.15.tar.xz 5cf2693d2c6bf1e69a9216dceca6183c60eb11d5
-sha256 linux-4.15.tar.xz 5a26478906d5005f4f809402e981518d2b8844949199f60c4b6e1f986ca2a769
-sha512 linux-4.15.tar.xz c00d92659df815a53dcac7dde145b742b1f20867d380c07cb09ddb3295d6ff10f8931b21ef0b09d7156923a3957b39d74d87c883300173b2e20690d2b4ec35ea
-md5 linux-4.15.tar.gz dd5a75343cd956de12e8d26e1805ca92
-sha1 linux-4.15.tar.gz f5691dd96fda55d4405b361a664db3b85ab4c81b
-sha256 linux-4.15.tar.gz c33b8ba5c45a40b689979caa2421c4d933864cd70eb93c00eb69adf43e9a24fc
-sha512 linux-4.15.tar.gz 0fab606a295e0857f774f8adaa9d56bf2cb227fbab2daed374415da216391b156f49e606ba37ac402987c5796d408807da5d1a42c0d85a8552f109a3e279443d
diff --git a/packages/linux/4.16.1/chksum b/packages/linux/4.16.1/chksum
deleted file mode 100644
index 44c6173..0000000
--- a/packages/linux/4.16.1/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 linux-4.16.1.tar.xz 16123b843ad2efa394a060d8f72c91c2
-sha1 linux-4.16.1.tar.xz f4d0b204a1ea5cabde8740e1fe2c9dad502793ab
-sha256 linux-4.16.1.tar.xz 5ba1c270ca6bc7927ad5f4698e0d61e558cce1a62249156a7aa44a6b4e0060c3
-sha512 linux-4.16.1.tar.xz 3b215fac12ea01af1048fd8167bc735a15523ba2a179a27ba41a20b17de2d0e68fcdc18949318e2baec5e4a1307054041bd69951798f18f9ea37309653230e54
-md5 linux-4.16.1.tar.gz 46a041deb9f89ccb893c23eb7a8f9ec5
-sha1 linux-4.16.1.tar.gz cf502b4b8de5f3f2ff9189f6bff265bfd77ad521
-sha256 linux-4.16.1.tar.gz 0c3c5f5aae95f81322dd0b289cf8e203d35a9684454ce5a0ab98fa56faec1320
-sha512 linux-4.16.1.tar.gz c2c6287a7e99210ee9c5e8583764285c16d5883cf8e0c2e8377759d1a8039e17d34f51111d055813fc5ecaa0457722b6928ad2c8b5e2157494d159c7365e7628
diff --git a/packages/linux/4.16.18/chksum b/packages/linux/4.16.18/chksum
new file mode 100644
index 0000000..64f127a
--- /dev/null
+++ b/packages/linux/4.16.18/chksum
@@ -0,0 +1,8 @@
+md5 linux-4.16.18.tar.xz 7f44e39f689765814d1e539ffd98fd9c
+sha1 linux-4.16.18.tar.xz 141587f63ce70eb542a74d4db6af191d5d2d8001
+sha256 linux-4.16.18.tar.xz 41026d713ba4f7a5e9d514b876ce4ed28a1d993c0c58b42b2a2597d6a0e83021
+sha512 linux-4.16.18.tar.xz 8fee4164ff5bb9f9561a15d0df5d9d8f4890189bc923c9ca1ce5fb78e8d286a68f9b975ea2ea9f49cad1c6bbf2fd2ec3ec1042ec5fa2ad95249bc2f2a23aef6a
+md5 linux-4.16.18.tar.gz 303949459171379aa4c81df45f03e970
+sha1 linux-4.16.18.tar.gz d98ac29efd6f6b176da572eeafd70bc54b038d91
+sha256 linux-4.16.18.tar.gz 34800382ce7b68a34ed57a861e583a0ecf195c6a3355f863ac4e43192836e950
+sha512 linux-4.16.18.tar.gz 950d411e4b9bb97eacc9eeeada73fb430d06a0fd9fe4fd47d5cd51934b3dd20b1d10c377e51251b40907cdf3532d0ece9b9ed92c3295fdcff56465467f3edf0e
diff --git a/packages/linux/4.16.18/version.desc b/packages/linux/4.16.18/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/linux/4.16.18/version.desc
diff --git a/packages/linux/4.17.19/chksum b/packages/linux/4.17.19/chksum
new file mode 100644
index 0000000..544bfe2
--- /dev/null
+++ b/packages/linux/4.17.19/chksum
@@ -0,0 +1,8 @@
+md5 linux-4.17.19.tar.xz ca4579babf2958aac4f686d49b6b8c66
+sha1 linux-4.17.19.tar.xz eb1262cba52cc7dfb588749a4e78f4eda2c41dc0
+sha256 linux-4.17.19.tar.xz ba9b3ef7f1a14b1bc6a237c52b01f98f66827f759fffd0b8836e8183b1399f17
+sha512 linux-4.17.19.tar.xz 548f91d8de4ec776cd5b559339da993ad8021030006d6b11a1788128f9866dbed7282962ebc489b71c7fe2d2a46c5c547b693e815c224f57d0818a80f5437d08
+md5 linux-4.17.19.tar.gz e18a9490b7799232e5db6bac4cf5c3a0
+sha1 linux-4.17.19.tar.gz bc67c7594eb3e0d715cfd93ceebe533743fa2659
+sha256 linux-4.17.19.tar.gz c01b28fac3fc252b9419d746cdee57d00e1a539ab97d72581be9c449cb9a420f
+sha512 linux-4.17.19.tar.gz df6e8bebacfc5864f1de99cc0f5fbbf983ad00ff6ff654332eadd693e1e0315189303c2441e9cee2197b50317be21e366f415a747eaddc71a9dc389e3259352e
diff --git a/packages/linux/4.17.19/version.desc b/packages/linux/4.17.19/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/linux/4.17.19/version.desc
diff --git a/packages/linux/4.18.9/chksum b/packages/linux/4.18.9/chksum
new file mode 100644
index 0000000..4a88ae7
--- /dev/null
+++ b/packages/linux/4.18.9/chksum
@@ -0,0 +1,8 @@
+md5 linux-4.18.9.tar.xz 6f082741ab20f03a334fe533d533880e
+sha1 linux-4.18.9.tar.xz 229ed4bedc5b8256bdd761845b1d7e20e1df12d7
+sha256 linux-4.18.9.tar.xz 4c995351e57902a04a94e43796407b4ba295c8eae070c27e99f8f99c321e917a
+sha512 linux-4.18.9.tar.xz f0b8137a60ea3b7edb257a31d9c2b432db0d9af01f9b45b3ca3d8277f276ec1b8112e2daa744aa8eeee39df1ededed38495b952f22b0387b57822fde31eaa255
+md5 linux-4.18.9.tar.gz 7e6f4935da3d37aede14a33cb224447b
+sha1 linux-4.18.9.tar.gz fe9314f0c4f7ceb103cf0e2a94fbf1358dd62d33
+sha256 linux-4.18.9.tar.gz 51cf88bcaff518d5077e31538af75577a339871436350073ebe035e74a8bc3f6
+sha512 linux-4.18.9.tar.gz 54dcab5de555300e9fd62c28ca49a6353b4c7deba2a82dc5682864225057e1b27c37ccbcea21604387ffb86e94fa274cf9956b7b72670b49d67d4beaef2f0ebc
diff --git a/packages/linux/4.18.9/version.desc b/packages/linux/4.18.9/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/linux/4.18.9/version.desc
diff --git a/packages/linux/4.4.127/chksum b/packages/linux/4.4.127/chksum
deleted file mode 100644
index 652bb3a..0000000
--- a/packages/linux/4.4.127/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 linux-4.4.127.tar.xz 7d510d1aaa17001fa4b6f3de12c95003
-sha1 linux-4.4.127.tar.xz c0ad26256bb3e702b5f33908d7d7833790adfbac
-sha256 linux-4.4.127.tar.xz 0a8f25393cc8a8692c4f7dd8ca8a7773c8bf69c7d04a3835b844cc28e3d64cbf
-sha512 linux-4.4.127.tar.xz 29c1ea1b56f4c9aa0a45c0ea9ade0fe28dc2cb51063ff695ece2bc517f961412c37cd406d45506b989fec22440a195c95f6a01a1ba44e9cfee610a96acbfb736
-md5 linux-4.4.127.tar.gz 850ef1da45a430937334b93812e0df8d
-sha1 linux-4.4.127.tar.gz 99b433ba43db5390d70fadeba0bc9b599ed5ae13
-sha256 linux-4.4.127.tar.gz 8c87bd4f8e45d345b5ae9a6f36daf7efabc39139a3a11d69b936e96e5449e7a8
-sha512 linux-4.4.127.tar.gz 2d099adaf0f70f231299648473511033f7a3f072094595d23b0a29f310f1856cbc0ee7d2a5ee0f247d9bf3df6831b95679dd4b4043719e5e58717fbd6ecddb13
diff --git a/packages/linux/4.4.157/chksum b/packages/linux/4.4.157/chksum
new file mode 100644
index 0000000..8b83eb1
--- /dev/null
+++ b/packages/linux/4.4.157/chksum
@@ -0,0 +1,8 @@
+md5 linux-4.4.157.tar.xz f43d0326a423ef0935f15886023144be
+sha1 linux-4.4.157.tar.xz 6ba64a589f986cc8353794e5ead36892e5da7a40
+sha256 linux-4.4.157.tar.xz 0010bc0aa64bc9cf55aaebd662dd0971f18284e925c74562ced31e0cf01d624d
+sha512 linux-4.4.157.tar.xz 522b29270af2a03d65b75ab65de9229bfe8f66d4c2026e0ed2fb97c9e23e6ac9586324c457fc300d7912108a672c4aba5c1e18df869e7e21091df9dca8a70377
+md5 linux-4.4.157.tar.gz e5f2628635afae8cbfcf4478609ecd5b
+sha1 linux-4.4.157.tar.gz 668e7f314920d207428eb9a4a395f1355296681e
+sha256 linux-4.4.157.tar.gz ba4a1deab4a05f0b46bf17c10f40e3a629a8e7493723793f279656b537b9ca97
+sha512 linux-4.4.157.tar.gz 1571b0cface6a1476eb822d74ee202a9ba2d7d161bf06481eec4498d241160f60c0bda62955ef0093b78b237c4dce24811169cebd3759cc1a812905ebd56fd28
diff --git a/packages/linux/4.4.127/version.desc b/packages/linux/4.4.157/version.desc
index 7d5188f..7d5188f 100644
--- a/packages/linux/4.4.127/version.desc
+++ b/packages/linux/4.4.157/version.desc
diff --git a/packages/linux/4.9.128/chksum b/packages/linux/4.9.128/chksum
new file mode 100644
index 0000000..fd7f064
--- /dev/null
+++ b/packages/linux/4.9.128/chksum
@@ -0,0 +1,8 @@
+md5 linux-4.9.128.tar.xz e2210448406e945deb527dbf937a0bf5
+sha1 linux-4.9.128.tar.xz 16943ec0ee17b5ff2641fe18cd0ae7ea4b9d7597
+sha256 linux-4.9.128.tar.xz bdb76f48491a6aadc89c0f0f7fdc240d77cee54da5aac59da0b5d98e226b6f12
+sha512 linux-4.9.128.tar.xz 057577268a019dd6f0d63a202dbff2d38ae363b655103b5e13d0e9a5ce7701f7948678b873c22f88620f61c0b086d0f56018e8631676de366cdbfd61b7445e31
+md5 linux-4.9.128.tar.gz 1d0cc7324cd1dc46f29c3fa67f0393e5
+sha1 linux-4.9.128.tar.gz 1262fe1fedcad1e1faeb7bc5abec30eeb0e6618a
+sha256 linux-4.9.128.tar.gz c44b362bec398d81d7d192b2a20360d1bb591a5a2e7ca11b8f7a603a0a3a0769
+sha512 linux-4.9.128.tar.gz 3054b5e2b37d8600e87983ba7b83ded058ad9cdf4e98db1a910e6e3110da8fe20073fb316d5e0b264346175e383b18ae4bb9355ef8d5a513b66df4a69ae55a0a
diff --git a/packages/linux/4.9.128/version.desc b/packages/linux/4.9.128/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/linux/4.9.128/version.desc
diff --git a/packages/linux/4.9.93/chksum b/packages/linux/4.9.93/chksum
deleted file mode 100644
index 9519296..0000000
--- a/packages/linux/4.9.93/chksum
+++ /dev/null
@@ -1,8 +0,0 @@
-md5 linux-4.9.93.tar.xz 0630ba8824d663186a03c9f30def867a
-sha1 linux-4.9.93.tar.xz 9c23d234d3fd0fabe3aa88bd9d5f193913df6349
-sha256 linux-4.9.93.tar.xz 58f78ab6c945c64a7c7c246256dc8b516b009c9ef1c90572ae396e7a8d6a5903
-sha512 linux-4.9.93.tar.xz fd85a34f578fdf9a72286cfa1094c66a432d2212fee912e2291f748cc98adba8b557c29ddc285ce01343af68094dddcb32368ca0d4e69af1f5d48dbc8feb833a
-md5 linux-4.9.93.tar.gz 3c2a7d1f1a3734a2e6c3fadc55a59f98
-sha1 linux-4.9.93.tar.gz 25a2bf904cd156586affa8eace8dbd19c47d470f
-sha256 linux-4.9.93.tar.gz 6dd69641fa5c299c2c4912449376f02785901b1f76ae1b85238233201d9ba841
-sha512 linux-4.9.93.tar.gz 39c748e45ff411f9467fca666c259751b68b902668163834128329bd1315ed7b1568e444d774422e0325d44591715876b1b971ca6c052d156b34926736e1cfba
diff --git a/packages/linux/package.desc b/packages/linux/package.desc
index bbf2cbd..184e6dd 100644
--- a/packages/linux/package.desc
+++ b/packages/linux/package.desc
@@ -1,6 +1,6 @@
repository='git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git'
mirrors='$(CT_Mirrors kernel.org linux ${CT_LINUX_VERSION})'
relevantpattern='2.*.*|. *.*|.'
-milestones='3.2'
+milestones='3.2 3.7 4.8'
archive_formats='.tar.xz .tar.gz'
signature_format='unpacked/.sign'
diff --git a/packages/m4/1.4.18/0000-fix-glibc-2.28.patch b/packages/m4/1.4.18/0000-fix-glibc-2.28.patch
new file mode 100644
index 0000000..d47a709
--- /dev/null
+++ b/packages/m4/1.4.18/0000-fix-glibc-2.28.patch
@@ -0,0 +1,144 @@
+commit 4af4a4a71827c0bc5e0ec67af23edef4f15cee8e
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Mon Mar 5 10:56:29 2018 -0800
+
+ fflush: adjust to glibc 2.28 libio.h removal
+
+ Problem reported by Daniel P. Berrangé in:
+ https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html
+ * lib/fbufmode.c (fbufmode):
+ * lib/fflush.c (clear_ungetc_buffer_preserving_position)
+ (disable_seek_optimization, rpl_fflush):
+ * lib/fpending.c (__fpending):
+ * lib/fpurge.c (fpurge):
+ * lib/freadable.c (freadable):
+ * lib/freadahead.c (freadahead):
+ * lib/freading.c (freading):
+ * lib/freadptr.c (freadptr):
+ * lib/freadseek.c (freadptrinc):
+ * lib/fseeko.c (fseeko):
+ * lib/fseterr.c (fseterr):
+ * lib/fwritable.c (fwritable):
+ * lib/fwriting.c (fwriting):
+ Check _IO_EOF_SEEN instead of _IO_ftrylockfile.
+ * lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]:
+ Define if not already defined.
+
+---
+ lib/fflush.c | 6 +++---
+ lib/fpending.c | 2 +-
+ lib/fpurge.c | 2 +-
+ lib/freadahead.c | 2 +-
+ lib/freading.c | 2 +-
+ lib/fseeko.c | 4 ++--
+ lib/stdio-impl.h | 6 ++++++
+ 7 files changed, 15 insertions(+), 9 deletions(-)
+
+--- a/lib/fflush.c
++++ b/lib/fflush.c
+@@ -33,7 +33,7 @@
+ #undef fflush
+
+
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+
+ /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */
+ static void
+@@ -72,7 +72,7 @@
+
+ #endif
+
+-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+
+ # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+@@ -148,7 +148,7 @@
+ if (stream == NULL || ! freading (stream))
+ return fflush (stream);
+
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+
+ clear_ungetc_buffer_preserving_position (stream);
+
+--- a/lib/fpending.c
++++ b/lib/fpending.c
+@@ -32,7 +32,7 @@
+ /* Most systems provide FILE as a struct and the necessary bitmask in
+ <stdio.h>, because they need it for implementing getc() and putc() as
+ fast macros. */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ return fp->_IO_write_ptr - fp->_IO_write_base;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+--- a/lib/fpurge.c
++++ b/lib/fpurge.c
+@@ -62,7 +62,7 @@
+ /* Most systems provide FILE as a struct and the necessary bitmask in
+ <stdio.h>, because they need it for implementing getc() and putc() as
+ fast macros. */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ fp->_IO_read_end = fp->_IO_read_ptr;
+ fp->_IO_write_ptr = fp->_IO_write_base;
+ /* Avoid memory leak when there is an active ungetc buffer. */
+--- a/lib/freadahead.c
++++ b/lib/freadahead.c
+@@ -25,7 +25,7 @@
+ size_t
+ freadahead (FILE *fp)
+ {
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ if (fp->_IO_write_ptr > fp->_IO_write_base)
+ return 0;
+ return (fp->_IO_read_end - fp->_IO_read_ptr)
+--- a/lib/freading.c
++++ b/lib/freading.c
+@@ -31,7 +31,7 @@
+ /* Most systems provide FILE as a struct and the necessary bitmask in
+ <stdio.h>, because they need it for implementing getc() and putc() as
+ fast macros. */
+-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ return ((fp->_flags & _IO_NO_WRITES) != 0
+ || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
+ && fp->_IO_read_base != NULL));
+--- a/lib/fseeko.c
++++ b/lib/fseeko.c
+@@ -47,7 +47,7 @@
+ #endif
+
+ /* These tests are based on fpurge.c. */
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ if (fp->_IO_read_end == fp->_IO_read_ptr
+ && fp->_IO_write_ptr == fp->_IO_write_base
+ && fp->_IO_save_base == NULL)
+@@ -123,7 +123,7 @@
+ return -1;
+ }
+
+-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+ fp->_flags &= ~_IO_EOF_SEEN;
+ fp->_offset = pos;
+ #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
+--- a/lib/stdio-impl.h
++++ b/lib/stdio-impl.h
+@@ -18,6 +18,12 @@
+ the same implementation of stdio extension API, except that some fields
+ have different naming conventions, or their access requires some casts. */
+
++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this
++ problem by defining it ourselves. FIXME: Do not rely on glibc
++ internals. */
++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN
++# define _IO_IN_BACKUP 0x100
++#endif
+
+ /* BSD stdio derived implementations. */
+
diff --git a/packages/make/4.2.1/0000-glob-v2.patch b/packages/make/4.2.1/0000-glob-v2.patch
new file mode 100644
index 0000000..ad8ddd8
--- /dev/null
+++ b/packages/make/4.2.1/0000-glob-v2.patch
@@ -0,0 +1,39 @@
+commit 48c8a116a914a325a0497721f5d8b58d5bba34d4
+Author: Paul Smith <psmith@gnu.org>
+Date: Sun Nov 19 15:09:16 2017 -0500
+
+ * configure.ac: Support GLIBC glob interface version 2
+
+---
+ configure | 3 +--
+ configure.ac | 3 +--
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -399,10 +399,9 @@
+ #include <glob.h>
+ #include <fnmatch.h>
+
+-#define GLOB_INTERFACE_VERSION 1
+ #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
+ # include <gnu-versions.h>
+-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
++# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
+ gnu glob
+ # endif
+ #endif],
+--- a/configure
++++ b/configure
+@@ -11481,10 +11481,9 @@
+ #include <glob.h>
+ #include <fnmatch.h>
+
+-#define GLOB_INTERFACE_VERSION 1
+ #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
+ # include <gnu-versions.h>
+-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
++# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
+ gnu glob
+ # endif
+ #endif
diff --git a/packages/make/4.2.1/0001-glob-v2-gl_lstat.patch b/packages/make/4.2.1/0001-glob-v2-gl_lstat.patch
new file mode 100644
index 0000000..ae755e3
--- /dev/null
+++ b/packages/make/4.2.1/0001-glob-v2-gl_lstat.patch
@@ -0,0 +1,64 @@
+commit 193f1e81edd6b1b56b0eb0ff8aa4b41c7b4257b4
+Author: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sun Sep 24 09:12:58 2017 -0400
+
+ glob: Do not assume glibc glob internals.
+
+ It has been proposed that glibc glob start using gl_lstat,
+ which the API allows it to do. GNU 'make' should not get in
+ the way of this. See:
+ https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html
+
+ * dir.c (local_lstat): New function, like local_stat.
+ (dir_setup_glob): Use it to initialize gl_lstat too, as the API
+ requires.
+
+---
+ dir.c | 29 +++++++++++++++++++++++++++--
+ 1 file changed, 27 insertions(+), 2 deletions(-)
+
+--- a/dir.c
++++ b/dir.c
+@@ -1299,15 +1299,40 @@
+ }
+ #endif
+
++/* Similarly for lstat. */
++#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
++# ifndef VMS
++# ifndef HAVE_SYS_STAT_H
++int lstat (const char *path, struct stat *sbuf);
++# endif
++# else
++ /* We are done with the fake lstat. Go back to the real lstat */
++# ifdef lstat
++# undef lstat
++# endif
++# endif
++# define local_lstat lstat
++#elif defined(WINDOWS32)
++/* Windows doesn't support lstat(). */
++# define local_lstat local_stat
++#else
++static int
++local_lstat (const char *path, struct stat *buf)
++{
++ int e;
++ EINTRLOOP (e, lstat (path, buf));
++ return e;
++}
++#endif
++
+ void
+ dir_setup_glob (glob_t *gl)
+ {
+ gl->gl_opendir = open_dirstream;
+ gl->gl_readdir = read_dirstream;
+ gl->gl_closedir = free;
++ gl->gl_lstat = local_lstat;
+ gl->gl_stat = local_stat;
+- /* We don't bother setting gl_lstat, since glob never calls it.
+- The slot is only there for compatibility with 4.4 BSD. */
+ }
+
+ void
diff --git a/packages/mingw-w64/v5.0.3/0001-xgetbv.patch b/packages/mingw-w64/v5.0.3/0001-xgetbv.patch
new file mode 100644
index 0000000..2884609
--- /dev/null
+++ b/packages/mingw-w64/v5.0.3/0001-xgetbv.patch
@@ -0,0 +1,32 @@
+commit 3ce3e27f044935f19e93e80c43ca695262d484e1
+Author: Mateusz <mateuszb@poczta.onet.pl>
+Date: Mon Jan 22 20:58:48 2018 +0100
+
+ intrin-impl.h: do not define _xgetbv for GCC 8
+
+ GCC 8 from r248028 has defined function _xgetbv and we should
+ avoid double definition of this function.
+
+ Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl>
+ Signed-off-by: Martin Storsjö <martin@martin.st>
+
+diff --git a/mingw-w64-headers/include/psdk_inc/intrin-impl.h b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
+index ff9e6aff..88af804c 100644
+--- a/mingw-w64-headers/include/psdk_inc/intrin-impl.h
++++ b/mingw-w64-headers/include/psdk_inc/intrin-impl.h
+@@ -1775,6 +1775,7 @@ __buildmov(__movsd, unsigned __LONG32, "d")
+ #define __INTRINSIC_DEFINED___movsd
+ #endif /* __INTRINSIC_PROLOG */
+
++#if !defined(__GNUC__) || __GNUC__ < 8 /* GCC 8 has already defined _xgetbv */
+ /* NOTE: This should be in immintrin.h */
+ #if __INTRINSIC_PROLOG(_xgetbv)
+ unsigned __int64 _xgetbv(unsigned int);
+@@ -1798,6 +1799,7 @@ unsigned __int64 _xgetbv(unsigned int index)
+ #endif
+ #define __INTRINSIC_DEFINED__xgetbv
+ #endif /* __INTRINSIC_PROLOG */
++#endif /* __GNUC__ < 8 */
+
+ #endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__i386__) || defined(_X86_) */
+
diff --git a/packages/mingw-w64/v6.0.0/0000-mingw64-malloc.patch b/packages/mingw-w64/v6.0.0/0000-mingw64-malloc.patch
new file mode 100644
index 0000000..f19e8ce
--- /dev/null
+++ b/packages/mingw-w64/v6.0.0/0000-mingw64-malloc.patch
@@ -0,0 +1,58 @@
+---
+ mingw-w64-tools/genidl/src/genidl_cfg.h | 2 ++
+ mingw-w64-tools/genidl/src/genidl_typinfo.c | 3 +++
+ mingw-w64-tools/widl/include/pathtools.h | 3 +--
+ mingw-w64-tools/widl/src/pathtools.c | 3 +--
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+--- a/mingw-w64-tools/genidl/src/genidl_cfg.h
++++ b/mingw-w64-tools/genidl/src/genidl_cfg.h
+@@ -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>
+--- a/mingw-w64-tools/genidl/src/genidl_typinfo.c
++++ b/mingw-w64-tools/genidl/src/genidl_typinfo.c
+@@ -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>
+
+--- a/mingw-w64-tools/widl/include/pathtools.h
++++ b/mingw-w64-tools/widl/include/pathtools.h
+@@ -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>
+--- a/mingw-w64-tools/widl/src/pathtools.c
++++ b/mingw-w64-tools/widl/src/pathtools.c
+@@ -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/packages/mingw-w64/v6.0.0/chksum b/packages/mingw-w64/v6.0.0/chksum
new file mode 100644
index 0000000..87e2ef3
--- /dev/null
+++ b/packages/mingw-w64/v6.0.0/chksum
@@ -0,0 +1,8 @@
+md5 mingw-w64-v6.0.0.tar.bz2 cf5673f6d689bb5e02863e6284cc3d03
+sha1 mingw-w64-v6.0.0.tar.bz2 4cffb043060d88d6bf0f382e4d92019263670ca6
+sha256 mingw-w64-v6.0.0.tar.bz2 805e11101e26d7897fce7d49cbb140d7bac15f3e085a91e0001e80b2adaf48f0
+sha512 mingw-w64-v6.0.0.tar.bz2 e3d3663e0cb33a16f90b1a33e81b5a30d26f7e34270b14e865c10068f2a2d32da9ef8cbbb0c3fed9c71429ae11c82152ff3b87d81558929b2a4993dc99cfc11e
+md5 mingw-w64-v6.0.0.zip aa1254acd7a569fc1c56fe53ab6a69c8
+sha1 mingw-w64-v6.0.0.zip daa825798ebac6dba3b67e95371aca57bbbc4ae0
+sha256 mingw-w64-v6.0.0.zip b4120b15424916b10c381b4949686c51b44a9f7aee1e4733c4379ae6ae41bedf
+sha512 mingw-w64-v6.0.0.zip 551e93498786908b7dad27876b5cc2fc1891cae88281f038dfba60e980599268fbe32cd26c224086261b3729d15a34b9613af8f99ff9cb78e0b96206f21ee048
diff --git a/packages/mingw-w64/v6.0.0/version.desc b/packages/mingw-w64/v6.0.0/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/mingw-w64/v6.0.0/version.desc
diff --git a/packages/mpfr/4.0.1/0001-Fix-obsolete-ARC-asm-constraints.patch b/packages/mpfr/4.0.1/0001-Fix-obsolete-ARC-asm-constraints.patch
new file mode 100644
index 0000000..12590cf
--- /dev/null
+++ b/packages/mpfr/4.0.1/0001-Fix-obsolete-ARC-asm-constraints.patch
@@ -0,0 +1,37 @@
+mpfr-longlong.h: Fix obsolete ARC asm constraints
+
+This patch replaces obsolete ARC "J" asm constraint with
+up-to-date "Cal" constraint.
+The patch should be applied to upstream "mpfr" library and
+after that it should be removed from buildroot as soon as
+mpfr version with current fix will come up.
+
+Signed-off-by: Vlad Zakharov <vzakhar@synopsys.com>
+Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
+---
+Index: /src/mpfr-longlong.h
+===================================================================
+--- /src/mpfr-longlong.h (revision 10963)
++++ /src/mpfr-longlong.h (working copy)
+@@ -416,17 +416,17 @@
+ : "=r" (sh), \
+ "=&r" (sl) \
+ : "r" ((USItype) (ah)), \
+- "rIJ" ((USItype) (bh)), \
++ "rICal" ((USItype) (bh)), \
+ "%r" ((USItype) (al)), \
+- "rIJ" ((USItype) (bl)))
++ "rICal" ((USItype) (bl)))
+ #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub.f\t%1, %4, %5\n\tsbc\t%0, %2, %3" \
+ : "=r" (sh), \
+ "=&r" (sl) \
+ : "r" ((USItype) (ah)), \
+- "rIJ" ((USItype) (bh)), \
++ "rICal" ((USItype) (bh)), \
+ "r" ((USItype) (al)), \
+- "rIJ" ((USItype) (bl)))
++ "rICal" ((USItype) (bl)))
+ #endif
+
+ #if defined (__arm__) && (defined (__thumb2__) || !defined (__thumb__)) \
diff --git a/packages/musl/1.1.20/chksum b/packages/musl/1.1.20/chksum
new file mode 100644
index 0000000..d40bf26
--- /dev/null
+++ b/packages/musl/1.1.20/chksum
@@ -0,0 +1,4 @@
+md5 musl-1.1.20.tar.gz 8d5dc34a4778b24b5b60f56330c75fee
+sha1 musl-1.1.20.tar.gz 469b3af68a49188c8db4cc94077719152c0d41f1
+sha256 musl-1.1.20.tar.gz 44be8771d0e6c6b5f82dd15662eb2957c9a3173a19a8b49966ac0542bbd40d61
+sha512 musl-1.1.20.tar.gz d3a7a30aa375ca50d7dcfbd618581d59e1aa5378417f50a0ca5510099336fd74cc9db468e05c93dda3067abd890f6bd47af226c3446bb833adf0a5054bff2e5d
diff --git a/packages/musl/1.1.20/version.desc b/packages/musl/1.1.20/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/musl/1.1.20/version.desc
diff --git a/packages/newlib/3.0.0.20180226/chksum b/packages/newlib/3.0.0.20180226/chksum
deleted file mode 100644
index d3a346b..0000000
--- a/packages/newlib/3.0.0.20180226/chksum
+++ /dev/null
@@ -1,4 +0,0 @@
-md5 newlib-3.0.0.20180226.tar.gz 33a44ea81296aad794ebc542cc008a30
-sha1 newlib-3.0.0.20180226.tar.gz 60359b20ccc14333a1272ebf8db9731d9d217aab
-sha256 newlib-3.0.0.20180226.tar.gz d0b40c874c3047eccbf06fe916d3fc746bd94e8a4cd14c54381b2f72f68c5665
-sha512 newlib-3.0.0.20180226.tar.gz b494c9870880ff9f3a2a6108f7c944e6232600b1e4a93ba195621a5251941b2d99ea7d6c748572a173b582db9f09bb869c431e1270a92f130d24c84f7eab62ec
diff --git a/packages/newlib/3.0.0.20180226/0000-fix-unaligned-access-memcpy-m68k.patch b/packages/newlib/3.0.0.20180831/0000-fix-unaligned-access-memcpy-m68k.patch
index b6709d5..b6709d5 100644
--- a/packages/newlib/3.0.0.20180226/0000-fix-unaligned-access-memcpy-m68k.patch
+++ b/packages/newlib/3.0.0.20180831/0000-fix-unaligned-access-memcpy-m68k.patch
diff --git a/packages/newlib/3.0.0.20180226/0001-fix-mt-cflags.patch b/packages/newlib/3.0.0.20180831/0001-fix-mt-cflags.patch
index 24a9215..24a9215 100644
--- a/packages/newlib/3.0.0.20180226/0001-fix-mt-cflags.patch
+++ b/packages/newlib/3.0.0.20180831/0001-fix-mt-cflags.patch
diff --git a/packages/newlib/3.0.0.20180831/chksum b/packages/newlib/3.0.0.20180831/chksum
new file mode 100644
index 0000000..99de808
--- /dev/null
+++ b/packages/newlib/3.0.0.20180831/chksum
@@ -0,0 +1,4 @@
+md5 newlib-3.0.0.20180831.tar.gz b55db6531699879591e9fc7e4c2adc51
+sha1 newlib-3.0.0.20180831.tar.gz 375fdf790bbce1f06c28aa7ce78231965f90e3bf
+sha256 newlib-3.0.0.20180831.tar.gz 3ad3664f227357df15ff34e954bfd9f501009a647667cd307bf0658aefd6eb5b
+sha512 newlib-3.0.0.20180831.tar.gz c195111ac61458fccbd700345cd8ed7806776b3d16557e9a86fbcdf0ff5f544bff7eb701e84defb3f6b4d6fc00674163fa89aead1b171ed3281470a4f6306d1f
diff --git a/packages/newlib/3.0.0.20180226/version.desc b/packages/newlib/3.0.0.20180831/version.desc
index 76f1447..76f1447 100644
--- a/packages/newlib/3.0.0.20180226/version.desc
+++ b/packages/newlib/3.0.0.20180831/version.desc
diff --git a/packages/newlib/package.desc b/packages/newlib/package.desc
index 5d09a77..0d2819b 100644
--- a/packages/newlib/package.desc
+++ b/packages/newlib/package.desc
@@ -1,5 +1,7 @@
origin='RedHat'
repository='git git://sourceware.org/git/newlib-cygwin.git'
+# Do not use "$(CT_Mirrors sourceware newlib)" here: the mirrors (kernel.org
+# and gnu.org) only store some older releases of newlib (2.0.0 and before).
mirrors='ftp://sourceware.org/pub/newlib'
milestones='2.0 2.1 2.2'
relevantpattern='*.*.*|.'
diff --git a/packages/strace/4.23/chksum b/packages/strace/4.23/chksum
new file mode 100644
index 0000000..be39fdd
--- /dev/null
+++ b/packages/strace/4.23/chksum
@@ -0,0 +1,4 @@
+md5 strace-4.23.tar.xz fad4bba0947553cef34d46a9fd78f039
+sha1 strace-4.23.tar.xz a40a46f4861deb122da45dcc715fb39fd68f9120
+sha256 strace-4.23.tar.xz 7860a6965f1dd832747bd8281a04738274398d32c56e9fbd0a68b1bb9ec09aad
+sha512 strace-4.23.tar.xz b54df972dc86e27668784ea4619e8c55230816b249e0a7fcca99a37b7f9ec37710742aca08c9e39b508522accb654a83c98207bab9ccac1197bb8e73e51ab116
diff --git a/packages/strace/4.23/version.desc b/packages/strace/4.23/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/strace/4.23/version.desc
diff --git a/packages/strace/4.24/chksum b/packages/strace/4.24/chksum
new file mode 100644
index 0000000..b9a10a8
--- /dev/null
+++ b/packages/strace/4.24/chksum
@@ -0,0 +1,4 @@
+md5 strace-4.24.tar.xz 8780136849c85acf76ad3a522aa4462a
+sha1 strace-4.24.tar.xz 09a8c9638fd02622157af9d744ad7c7f991c75df
+sha256 strace-4.24.tar.xz 1f4e59fc1edfa2bfb4adf2a748623dc25b105ec79713dd84404199f91b0b0634
+sha512 strace-4.24.tar.xz 69cbf8b2c32c7ea90ebe5955bc71b454316a3494ae6975203fe61ce1f42ec539438cec5ba8ee7f529f89661d964b4aa53656712706aacff6bf018304b7a09813
diff --git a/packages/strace/4.24/version.desc b/packages/strace/4.24/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/strace/4.24/version.desc
diff --git a/packages/uClibc-ng/1.0.30/chksum b/packages/uClibc-ng/1.0.30/chksum
new file mode 100644
index 0000000..2e09522
--- /dev/null
+++ b/packages/uClibc-ng/1.0.30/chksum
@@ -0,0 +1,16 @@
+md5 uClibc-ng-1.0.30.tar.bz2 4d1fef5287f52daff83624dd117645ae
+sha1 uClibc-ng-1.0.30.tar.bz2 150fda99d9eb122a0962852bb4d2816c9911021b
+sha256 uClibc-ng-1.0.30.tar.bz2 3e0f057f24882823d697126015aa4d7d48fa2542be3939985cb3c26dcbcab5a8
+sha512 uClibc-ng-1.0.30.tar.bz2 ddd1d91dcfdf7be8471afecf13196563ad348c41e2fa8b63ae50b83f103cf8ed8d9f003b51a54a58db2935b84692b7c011a4779582f30610ede44cb583aae742
+md5 uClibc-ng-1.0.30.tar.gz 5f15d8d229ded008f6b7082795be390f
+sha1 uClibc-ng-1.0.30.tar.gz c9665a4625f3af88f9d0032b0a33026a4d1393a1
+sha256 uClibc-ng-1.0.30.tar.gz f1c4d25a84a83673099a1811b4e57da3a11e0db3e7bb907fc45009dfe70c6c2c
+sha512 uClibc-ng-1.0.30.tar.gz d3dc48ee9ebe9dc806ae9b9479880f9cb03341ed075ee8e3678ef0abe6efff53d8beb22537646edb281e8bf0b15d34ab30967405314534d5a8a214ef1604d0b8
+md5 uClibc-ng-1.0.30.tar.lz 2dc64b0ede7d7ebba393797bc35f92b3
+sha1 uClibc-ng-1.0.30.tar.lz 867d25c9ba1b9abb918ee8c6d716a1a0edb10493
+sha256 uClibc-ng-1.0.30.tar.lz 1a6f3b3b80e1acbdbeb3041c0e89dca513b93defef7e729b2b48522f30cae37d
+sha512 uClibc-ng-1.0.30.tar.lz 9c9e4b88c7a392254a155668bcac2b1f0726326843bca897975e83c64ee250dae9b68fa3eb63d8938b984336eebe336be6f75d61240552ed00d0eed808571b6d
+md5 uClibc-ng-1.0.30.tar.xz 81009d1364c7301d39d867beabd16fcb
+sha1 uClibc-ng-1.0.30.tar.xz 47beed76875aaf424c7ed179a57a8dcbef8823dc
+sha256 uClibc-ng-1.0.30.tar.xz 992bd9a2889ea385902b87e3d3d30603741eb16728288fbf537ff2027f770496
+sha512 uClibc-ng-1.0.30.tar.xz 603b14107dfa64146f17956c6a1a8f2f30ce5467a7731f0aa1039846350d9204c465cc985061a12f233bfadde6c6fa5cc6e15f7fc17ab231c2c85f8f687fc58d
diff --git a/packages/uClibc-ng/1.0.30/version.desc b/packages/uClibc-ng/1.0.30/version.desc
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packages/uClibc-ng/1.0.30/version.desc
diff --git a/paths.sh.in b/paths.sh.in
index c1ba0bd..ad42916 100644
--- a/paths.sh.in
+++ b/paths.sh.in
@@ -10,3 +10,7 @@ export objcopy="@OBJCOPY@"
export objdump="@OBJDUMP@"
export readelf="@READELF@"
export patch="@PATCH@"
+export md5sum="@md5sum@"
+export sha1sum="@sha1sum@"
+export sha256sum="@sha256sum@"
+export sha512sum="@sha512sum@"
diff --git a/samples/arc-arc700-linux-uclibc/crosstool.config b/samples/arc-arc700-linux-uclibc/crosstool.config
new file mode 100644
index 0000000..66a0b52
--- /dev/null
+++ b/samples/arc-arc700-linux-uclibc/crosstool.config
@@ -0,0 +1,7 @@
+CT_ARCH_ARC=y
+CT_TARGET_ALIAS="arc-linux"
+CT_TARGET_CFLAGS="-mno-atomic"
+CT_TARGET_VENDOR="snps"
+CT_KERNEL_LINUX=y
+CT_LIBC_UCLIBC=y
+CT_ARCH_CPU="arc700"
diff --git a/samples/arc-arc700-linux-uclibc/reported.by b/samples/arc-arc700-linux-uclibc/reported.by
new file mode 100644
index 0000000..a493696
--- /dev/null
+++ b/samples/arc-arc700-linux-uclibc/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Alexey Brodkin"
+reporter_url="http://embarc.org"
+reporter_comment="ARCompact uClibc Linux toolchain without atomics"
diff --git a/samples/arc-multilib-elf32/crosstool.config b/samples/arc-multilib-elf32/crosstool.config
new file mode 100644
index 0000000..19e8e89
--- /dev/null
+++ b/samples/arc-multilib-elf32/crosstool.config
@@ -0,0 +1,4 @@
+CT_ARCH_ARC=y
+CT_MULTILIB=y
+CT_TARGET_VENDOR="multilib"
+CT_TARGET_ALIAS="arc-elf32"
diff --git a/samples/arc-multilib-elf32/reported.by b/samples/arc-multilib-elf32/reported.by
new file mode 100644
index 0000000..4e6b14d
--- /dev/null
+++ b/samples/arc-multilib-elf32/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Alexey Brodkin"
+reporter_url="http://embarc.org"
+reporter_comment="ARC multilib baremetal/elf32 toolchain"
diff --git a/samples/arc-multilib-linux-uclibc/crosstool.config b/samples/arc-multilib-linux-uclibc/crosstool.config
new file mode 100644
index 0000000..b56c8a8
--- /dev/null
+++ b/samples/arc-multilib-linux-uclibc/crosstool.config
@@ -0,0 +1,7 @@
+CT_ARCH_ARC=y
+CT_TARGET_ALIAS="arc-linux"
+CT_TARGET_CFLAGS="-matomic"
+CT_TARGET_VENDOR="multilib"
+CT_KERNEL_LINUX=y
+CT_LIBC_UCLIBC=y
+CT_MULTILIB=y
diff --git a/samples/arc-multilib-linux-uclibc/reported.by b/samples/arc-multilib-linux-uclibc/reported.by
new file mode 100644
index 0000000..59fc53a
--- /dev/null
+++ b/samples/arc-multilib-linux-uclibc/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Alexey Brodkin"
+reporter_url="http://embarc.org"
+reporter_comment="ARC multilib uClibc Linux toolchain"
diff --git a/samples/riscv64-unknown-elf/crosstool.config b/samples/riscv64-unknown-elf/crosstool.config
new file mode 100644
index 0000000..221ef20
--- /dev/null
+++ b/samples/riscv64-unknown-elf/crosstool.config
@@ -0,0 +1,7 @@
+CT_EXPERIMENTAL=y
+CT_ARCH_RISCV=y
+# CT_DEMULTILIB is not set
+CT_ARCH_USE_MMU=y
+CT_ARCH_64=y
+CT_DEBUG_GDB=y
+# CT_GDB_CROSS_PYTHON is not set
diff --git a/samples/riscv64-unknown-elf/reported.by b/samples/riscv64-unknown-elf/reported.by
new file mode 100644
index 0000000..9456e59
--- /dev/null
+++ b/samples/riscv64-unknown-elf/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Paul Walmsley <paul.walmsley@sifive.com>"
+reporter_url="https://www.sifive.com/"
+reporter_comment=""
diff --git a/samples/riscv64-unknown-linux-gnu/crosstool.config b/samples/riscv64-unknown-linux-gnu/crosstool.config
new file mode 100644
index 0000000..66c288d
--- /dev/null
+++ b/samples/riscv64-unknown-linux-gnu/crosstool.config
@@ -0,0 +1,12 @@
+CT_EXPERIMENTAL=y
+CT_ARCH_RISCV=y
+# CT_DEMULTILIB is not set
+CT_ARCH_USE_MMU=y
+CT_ARCH_64=y
+CT_KERNEL_LINUX=y
+CT_DEBUG_GDB=y
+# CT_GDB_CROSS_PYTHON is not set
+# CT_GDB_GDBSERVER is not set
+CT_ZLIB_NEEDED=y
+CT_TARGET_VENDOR="unknown"
+CT_ARCH_ARCH="rv64gc"
diff --git a/samples/riscv64-unknown-linux-gnu/reported.by b/samples/riscv64-unknown-linux-gnu/reported.by
new file mode 100644
index 0000000..9456e59
--- /dev/null
+++ b/samples/riscv64-unknown-linux-gnu/reported.by
@@ -0,0 +1,3 @@
+reporter_name="Paul Walmsley <paul.walmsley@sifive.com>"
+reporter_url="https://www.sifive.com/"
+reporter_comment=""
diff --git a/samples/samples.mk b/samples/samples.mk
index 7b356dd..13f8779 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -130,7 +130,7 @@ endef
# How we do recall one sample
PHONY += $(CT_SAMPLES)
-$(CT_SAMPLES):
+$(CT_SAMPLES): check-config
@$(CT_ECHO) " CONF $@"
$(SILENT)$(CONF) --defconfig=$(call sample_dir,$@)/crosstool.config $(KCONFIG_TOP)
@echo
diff --git a/scripts/build/arch/arc.sh b/scripts/build/arch/arc.sh
new file mode 100644
index 0000000..2b48e4b
--- /dev/null
+++ b/scripts/build/arch/arc.sh
@@ -0,0 +1,34 @@
+# Compute ARC-specific values
+
+CT_DoArchTupleValues() {
+ # The architecture part of the tuple:
+ CT_TARGET_ARCH="${CT_ARCH}${CT_ARCH_SUFFIX:-${target_endian_eb}}"
+
+ # The system part of the tuple:
+ case "${CT_LIBC}" in
+ glibc) CT_TARGET_SYS=gnu;;
+ uClibc) CT_TARGET_SYS=uclibc;;
+ esac
+}
+
+CT_DoArchUClibcConfig() {
+ local cfg="${1}"
+
+ CT_DoArchUClibcSelectArch "${cfg}" "arc"
+}
+
+CT_DoArchUClibcCflags() {
+ local cfg="${1}"
+ local cflags="${2}"
+ local f
+
+ CT_KconfigDisableOption "CONFIG_ARC_HAS_ATOMICS" "${cfg}"
+
+ for f in ${cflags}; do
+ case "${f}" in
+ -matomic)
+ CT_KconfigEnableOption "CONFIG_ARC_HAS_ATOMICS" "${cfg}"
+ ;;
+ esac
+ done
+}
diff --git a/scripts/build/arch/arm.sh b/scripts/build/arch/arm.sh
index 7433c92..4873df1 100644
--- a/scripts/build/arch/arm.sh
+++ b/scripts/build/arch/arm.sh
@@ -96,6 +96,7 @@ CT_DoArchUClibcCflags() {
case "${f}" in
-mthumb)
CT_KconfigEnableOption "COMPILE_IN_THUMB_MODE" "${cfg}"
+ CT_KconfigDisableOption "UCLIBC_HAS_CONTEXT_FUNCS" "${cfg}"
;;
-marm)
CT_KconfigDisableOption "COMPILE_IN_THUMB_MODE" "${cfg}"
diff --git a/scripts/build/arch/powerpc.sh b/scripts/build/arch/powerpc.sh
index 52f3f8b..36a727a 100644
--- a/scripts/build/arch/powerpc.sh
+++ b/scripts/build/arch/powerpc.sh
@@ -12,18 +12,18 @@ CT_DoArchTupleValues () {
;;
spe)
case "${CT_LIBC}" in
- none|newlib) CT_TARGET_SYS="spe";;
+ none|newlib) CT_TARGET_SYS="elfspe";;
*glibc) CT_TARGET_SYS="gnuspe";;
uClibc) CT_TARGET_SYS="uclibcgnuspe";;
esac
;;
esac
- # Add extra flags for SPE if needed
+ # Add extra flags for SPE if needed. SPE is obsolete in GCC8.
if [ "${CT_ARCH_powerpc_ABI_SPE}" = "y" ]; then
CT_ARCH_TARGET_CFLAGS="-mabi=spe -mspe"
- CT_ARCH_CC_CORE_EXTRA_CONFIG="--enable-e500_double"
- CT_ARCH_CC_EXTRA_CONFIG="--enable-e500_double"
+ CT_ARCH_CC_CORE_EXTRA_CONFIG="--enable-e500_double --enable-obsolete"
+ CT_ARCH_CC_EXTRA_CONFIG="--enable-e500_double --enable-obsolete"
fi
}
diff --git a/scripts/build/binutils/binutils.sh b/scripts/build/binutils/binutils.sh
index 703a6fa..f61b556 100644
--- a/scripts/build/binutils/binutils.sh
+++ b/scripts/build/binutils/binutils.sh
@@ -223,13 +223,14 @@ do_binutils_backend() {
sed -r -e "s/@@DEFAULT_LD@@/${CT_BINUTILS_LINKER_DEFAULT}/" \
"${CT_LIB_DIR}/scripts/build/binutils/binutils-ld.in" \
>"${prefix}/bin/${CT_TARGET}-ld"
- chmod +x "${prefix}/bin/${CT_TARGET}-ld"
+ chmod a+x "${prefix}/bin/${CT_TARGET}-ld"
cp -a "${prefix}/bin/${CT_TARGET}-ld" \
"${prefix}/${CT_TARGET}/bin/ld"
- # If needed, force using ld.bfd during the toolchain build
- if [ "${CT_BINUTILS_FORCE_LD_BFD}" = "y" ]; then
- export CTNG_LD_IS=bfd
+ # If needed, force using ld.bfd during the toolchain build.
+ # Note that
+ if [ "${CT_BINUTILS_FORCE_LD_BFD_DEFAULT}" = "y" ]; then
+ CT_EnvModify export CTNG_LD_IS bfd
fi
fi
}
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh
index c95c5b9..7aceee3 100644
--- a/scripts/build/cc/gcc.sh
+++ b/scripts/build/cc/gcc.sh
@@ -171,13 +171,13 @@ cc_gcc_multilib_housekeeping() {
fi
done
CT_DoLog DEBUG "Filtered target CFLAGS: '${new_cflags}'"
- CT_EnvModify CT_TARGET_CFLAGS "${new_cflags} ${CT_TARGET_CFLAGS}"
+ CT_EnvModify CT_ALL_TARGET_CFLAGS "${new_cflags} ${CT_TARGET_CFLAGS}"
CT_EnvModify CT_ARCH_TARGET_CFLAGS_MULTILIB ""
# Currently, the only LDFLAGS are endianness-related
CT_DoLog DEBUG "Configured target LDFLAGS: '${CT_ARCH_TARGET_LDFLAGS_MULTILIB}'"
if [ "${ml_endian}" != "seen" ]; then
- CT_EnvModify CT_TARGET_LDFLAGS "${CT_ARCH_TARGET_LDFLAGS_MULTILIB} ${CT_TARGET_LDFLAGS}"
+ CT_EnvModify CT_ALL_TARGET_LDFLAGS "${CT_ARCH_TARGET_LDFLAGS_MULTILIB} ${CT_TARGET_LDFLAGS}"
CT_EnvModify CT_ARCH_TARGET_LDFLAGS_MULTILIB ""
fi
CT_DoLog DEBUG "Filtered target LDFLAGS: '${CT_ARCH_TARGET_LDFLAGS_MULTILIB}'"
@@ -467,7 +467,11 @@ do_gcc_core_backend() {
local glibc_version
CT_GetPkgVersion GLIBC glibc_version
- glibc_version=`echo "${glibc_version}" | sed 's/\([1-9][0-9]*\.[1-9][0-9]*\).*/\1/'`
+ case "${glibc_version}" in
+ new) glibc_version=99.99;;
+ old) glibc_version=1.0;;
+ *) glibc_version=`echo "${glibc_version}" | sed 's/\([1-9][0-9]*\.[1-9][0-9]*\).*/\1/'`;;
+ esac
extra_config+=("--with-glibc-version=${glibc_version}")
fi
@@ -560,7 +564,11 @@ do_gcc_core_backend() {
fi
fi
- # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532)
+ # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532).
+ # Pass only user-specified CFLAGS/LDFLAGS in CFLAGS_FOR_TARGET/LDFLAGS_FOR_TARGET: during
+ # the build of, for example, libatomic, GCC tried to compile multiple variants for runtime
+ # selection and passing architecture/CPU selectors, as detemined by crosstool-NG, may
+ # miscompile or outright fail.
CT_DoExecLog CFG \
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS="${cflags}" \
@@ -1109,6 +1117,8 @@ do_gcc_backend() {
fi
fi
+ # NB: not using CT_ALL_TARGET_CFLAGS/CT_ALL_TARGET_LDFLAGS here!
+ # See do_gcc_core_backend for explanation.
CT_DoExecLog CFG \
CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS="${cflags}" \
diff --git a/scripts/build/companion_libs/200-libelf.sh b/scripts/build/companion_libs/200-libelf.sh
index 5f1a8d7..f0d8be4 100644
--- a/scripts/build/companion_libs/200-libelf.sh
+++ b/scripts/build/companion_libs/200-libelf.sh
@@ -81,7 +81,7 @@ do_libelf_for_target() {
libelf_opts+=( "destdir=${CT_SYSROOT_DIR}" )
libelf_opts+=( "host=${CT_TARGET}" )
- libelf_opts+=( "cflags=${CT_TARGET_CFLAGS}" )
+ libelf_opts+=( "cflags=${CT_ALL_TARGET_CFLAGS}" )
libelf_opts+=( "prefix=${prefix}" )
libelf_opts+=( "shared=${CT_SHARED_LIBS}" )
do_libelf_backend "${libelf_opts[@]}"
diff --git a/scripts/build/companion_libs/210-expat.sh b/scripts/build/companion_libs/210-expat.sh
index f848541..75a78bf 100644
--- a/scripts/build/companion_libs/210-expat.sh
+++ b/scripts/build/companion_libs/210-expat.sh
@@ -54,7 +54,7 @@ do_expat_for_target() {
prefix="/usr"
;;
esac
- expat_opts+=( "cflags=${CT_TARGET_CFLAGS}" )
+ expat_opts+=( "cflags=${CT_ALL_TARGET_CFLAGS}" )
expat_opts+=( "prefix=${prefix}" )
expat_opts+=( "destdir=${CT_SYSROOT_DIR}" )
expat_opts+=( "shared=${CT_SHARED_LIBS}" )
diff --git a/scripts/build/companion_libs/220-ncurses.sh b/scripts/build/companion_libs/220-ncurses.sh
index 97fb834..b5dee13 100644
--- a/scripts/build/companion_libs/220-ncurses.sh
+++ b/scripts/build/companion_libs/220-ncurses.sh
@@ -97,7 +97,7 @@ do_ncurses_for_target() {
prefix="${prefix}" \
destdir="${CT_SYSROOT_DIR}" \
shared="${CT_SHARED_LIBS}" \
- cflags="${CT_TARGET_CFLAGS}" \
+ cflags="${CT_ALL_TARGET_CFLAGS}" \
"${opts[@]}"
CT_Popd
CT_EndStep
diff --git a/scripts/build/debug/200-duma.sh b/scripts/build/debug/200-duma.sh
index 0d98c38..9e2379e 100644
--- a/scripts/build/debug/200-duma.sh
+++ b/scripts/build/debug/200-duma.sh
@@ -19,8 +19,8 @@ do_debug_duma_build() {
make_args=(
prefix="${CT_DEBUGROOT_DIR}/usr"
HOSTCC="${CT_BUILD}-gcc"
- CC="${CT_TARGET}-${CT_CC} ${CT_TARGET_CFLAGS}"
- CXX="${CT_TARGET}-g++ ${CT_TARGET_CFLAGS}"
+ CC="${CT_TARGET}-${CT_CC} ${CT_ALL_TARGET_CFLAGS}"
+ CXX="${CT_TARGET}-g++ ${CT_ALL_TARGET_CFLAGS}"
RANLIB="${CT_TARGET}-ranlib"
OS="${CT_KERNEL}"
)
diff --git a/scripts/build/debug/300-gdb.sh b/scripts/build/debug/300-gdb.sh
index 74744cc..c73e430 100644
--- a/scripts/build/debug/300-gdb.sh
+++ b/scripts/build/debug/300-gdb.sh
@@ -22,7 +22,7 @@ do_debug_gdb_build() {
local CT_HOST_LD="${CT_HOST}-ld"
local CT_CXXFLAGS_FOR_HOST=${CT_CFLAGS_FOR_HOST}
- local CT_TARGET_CXXFLAGS=${CT_TARGET_CFLAGS}
+ local CT_TARGET_CXXFLAGS=${CT_ALL_TARGET_CFLAGS}
gdb_src_dir="${CT_SRC_DIR}/gdb"
@@ -34,7 +34,7 @@ do_debug_gdb_build() {
if [ "${CT_GDB_CROSS}" = "y" ]; then
local -a cross_extra_config
local gcc_version p _p
- local cross_CPPFLAGS cross_CFLAGS cross_CXXFLAGS cross_LDFLAGS
+ local cross_CFLAGS cross_CXXFLAGS cross_LDFLAGS
CT_DoStep INFO "Installing cross-gdb"
CT_DoLog EXTRA "Configuring cross-gdb"
@@ -44,6 +44,10 @@ do_debug_gdb_build() {
cross_extra_config=("${extra_config[@]}")
+ if [ "${CT_GDB_HAS_DISABLE_CXX_BUILD}" = "y" ]; then
+ cross_extra_config+=("--disable-build-with-cxx")
+ fi
+
# For gdb-cross this combination of flags forces
# gdb configure to fall back to default '-lexpat' flag
# which is acceptable.
@@ -90,7 +94,6 @@ do_debug_gdb_build() {
cross_extra_config+=("--disable-nls")
fi
- cross_CPPFLAGS="${CT_CPPFLAGS_FOR_HOST}"
cross_CFLAGS="${CT_CFLAGS_FOR_HOST}"
cross_CXXFLAGS="${CT_CXXFLAGS_FOR_HOST}"
cross_LDFLAGS="${CT_LDFLAGS_FOR_HOST}"
@@ -118,7 +121,6 @@ do_debug_gdb_build() {
# are multiple consecutive spaces: sub-configure scripts replace them with a
# single space and then complain that $CC value changed from that in
# the master directory.
- cross_CPPFLAGS=`echo ${cross_CPPFLAGS}`
cross_CFLAGS=`echo ${cross_CFLAGS}`
cross_CXXFLAGS=`echo ${cross_CXXFLAGS}`
cross_LDFLAGS=`echo ${cross_LDFLAGS}`
@@ -135,7 +137,6 @@ do_debug_gdb_build() {
CC="${CT_HOST_CC}" \
CXX="${CT_HOST_CXX}" \
LD="${CT_HOST_LD}" \
- CPPFLAGS="${cross_CPPFLAGS}" \
CFLAGS="${cross_CFLAGS}" \
CXXFLAGS="${cross_CXXFLAGS}" \
LDFLAGS="${cross_LDFLAGS}" \
@@ -187,7 +188,7 @@ do_debug_gdb_build() {
# 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
- local native_CPPFLAGS native_CFLAGS native_CXXFLAGS native_LDFLAGS
+ local native_CFLAGS native_CXXFLAGS native_LDFLAGS
CT_DoStep INFO "Installing native gdb"
CT_DoLog EXTRA "Configuring native gdb"
@@ -198,7 +199,7 @@ do_debug_gdb_build() {
native_extra_config=("${extra_config[@]}")
# We may not have C++ language configured for target
- if [ "${GDB_TARGET_DISABLE_CXX_BUILD}" = "y" ]; then
+ if [ "${CT_GDB_HAS_DISABLE_CXX_BUILD}" = "y" ]; then
native_extra_config+=("--disable-build-with-cxx")
fi
@@ -239,10 +240,9 @@ do_debug_gdb_build() {
native_extra_config+=("--disable-nls")
fi
- native_CPPFLAGS="${CT_TARGET_CPPFLAGS}"
- native_CFLAGS="${CT_TARGET_CFLAGS}"
- native_CXXFLAGS="${CT_TARGET_CXXFLAGS}"
- native_LDFLAGS="${CT_TARGET_LDFLAGS}"
+ native_CFLAGS="${CT_ALL_TARGET_CFLAGS}"
+ native_CXXFLAGS="${CT_ALL_TARGET_CFLAGS}"
+ native_LDFLAGS="${CT_ALL_TARGET_LDFLAGS}"
if [ "${CT_GDB_NATIVE_STATIC}" = "y" ]; then
native_CFLAGS+=" -static"
@@ -257,7 +257,6 @@ do_debug_gdb_build() {
native_extra_config+=("--disable-ld")
native_extra_config+=("--disable-gas")
- native_CPPFLAGS=`echo ${native_CPPFLAGS}`
native_CFLAGS=`echo ${native_CFLAGS}`
native_CXXFLAGS=`echo ${native_CXXFLAGS}`
native_LDFLAGS=`echo ${native_LDFLAGS}`
@@ -269,7 +268,6 @@ do_debug_gdb_build() {
CC="${CT_TARGET_CC}" \
CXX="${CT_TARGET_CXX}" \
LD="${CT_TARGET_LD}" \
- CPPFLAGS="${native_CPPFLAGS}" \
CFLAGS="${native_CFLAGS}" \
CXXFLAGS="${native_CXXFLAGS}" \
LDFLAGS="${native_LDFLAGS}" \
@@ -306,7 +304,7 @@ do_debug_gdb_build() {
if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
local -a gdbserver_extra_config
- local gdbserver_CPPFLAGS gdbserver_CFLAGS gdbserver_CXXFLAGS gdbserver_LDFLAGS
+ local gdbserver_CFLAGS gdbserver_CXXFLAGS gdbserver_LDFLAGS
CT_DoStep INFO "Installing gdbserver"
CT_DoLog EXTRA "Configuring gdbserver"
@@ -317,12 +315,12 @@ do_debug_gdb_build() {
# Workaround for bad versions, where the configure
# script for gdbserver is not executable...
# Bah, GNU folks strike again... :-(
- chmod +x "${gdb_src_dir}/gdb/gdbserver/configure"
+ chmod a+x "${gdb_src_dir}/gdb/gdbserver/configure"
gdbserver_extra_config=("${extra_config[@]}")
# We may not have C++ language configured for target
- if [ "${GDB_TARGET_DISABLE_CXX_BUILD}" = "y" ]; then
+ if [ "${CT_GDB_HAS_DISABLE_CXX_BUILD}" = "y" ]; then
gdbserver_extra_config+=("--disable-build-with-cxx")
fi
@@ -339,10 +337,9 @@ do_debug_gdb_build() {
gdbserver_extra_config+=("--disable-ld")
gdbserver_extra_config+=("--disable-gas")
- gdbserver_CPPFLAGS="${CT_TARGET_CPPFLAGS}"
- gdbserver_CFLAGS="${CT_TARGET_CFLAGS}"
- gdbserver_CXXFLAGS="${CT_TARGET_CXXFLAGS}"
- gdbserver_LDFLAGS="${CT_TARGET_LDFLAGS}"
+ gdbserver_CFLAGS="${CT_ALL_TARGET_CFLAGS}"
+ gdbserver_CXXFLAGS="${CT_ALL_TARGET_CFLAGS}"
+ gdbserver_LDFLAGS="${CT_ALL_TARGET_LDFLAGS}"
if [ "${CT_GDB_GDBSERVER_STATIC}" = "y" ]; then
gdbserver_CFLAGS+=" -static"
@@ -354,7 +351,6 @@ do_debug_gdb_build() {
gdbserver_LDFLAGS+=" -static-libstdc++"
fi
- gdbserver_CPPFLAGS=`echo ${gdbserver_CPPFLAGS}`
gdbserver_CFLAGS=`echo ${gdbserver_CFLAGS}`
gdbserver_CXXFLAGS=`echo ${gdbserver_CXXFLAGS}`
gdbserver_LDFLAGS=`echo ${gdbserver_LDFLAGS}`
@@ -366,7 +362,6 @@ do_debug_gdb_build() {
CC="${CT_TARGET_CC}" \
CXX="${CT_TARGET_CXX}" \
LD="${CT_TARGET_LD}" \
- CPPFLAGS="${gdbserver_CPPFLAGS}" \
CFLAGS="${gdbserver_CFLAGS}" \
CXXFLAGS="${gdbserver_CXXFLAGS}" \
LDFLAGS="${gdbserver_LDFLAGS}" \
diff --git a/scripts/build/debug/400-ltrace.sh b/scripts/build/debug/400-ltrace.sh
index ce299c2..3f08226 100644
--- a/scripts/build/debug/400-ltrace.sh
+++ b/scripts/build/debug/400-ltrace.sh
@@ -34,7 +34,7 @@ do_debug_ltrace_build() {
AR="${CT_TARGET}-ar" \
HOST="${ltrace_host}" \
HOST_OS="${CT_TARGET_KERNEL}" \
- CFLAGS="${CT_TARGET_CFLAGS}" \
+ CFLAGS="${CT_ALL_TARGET_CFLAGS}"\
${CONFIG_SHELL} \
./configure --prefix=/usr
else
diff --git a/scripts/build/debug/500-strace.sh b/scripts/build/debug/500-strace.sh
index 305a76c..4f6d6aa 100644
--- a/scripts/build/debug/500-strace.sh
+++ b/scripts/build/debug/500-strace.sh
@@ -12,7 +12,7 @@ do_debug_strace_extract()
do_debug_strace_build()
{
- local cflags="${CT_TARGET_CFLAGS}"
+ local cflags="${CT_ALL_TARGET_CFLAGS}"
CT_DoStep INFO "Installing strace"
@@ -30,14 +30,15 @@ do_debug_strace_build()
CT_DoExecLog CFG \
CC="${CT_TARGET}-${CT_CC}" \
CFLAGS="${cflags}" \
- LDFLAGS="${CT_TARGET_LDFLAGS}" \
+ LDFLAGS="${CT_ALL_TARGET_LDFLAGS}" \
CPP="${CT_TARGET}-cpp" \
LD="${CT_TARGET}-ld" \
${CONFIG_SHELL} \
"${CT_SRC_DIR}/strace/configure" \
--build=${CT_BUILD} \
--host=${CT_TARGET} \
- --prefix=/usr
+ --prefix=/usr \
+ --enable-mpers=check
CT_DoLog EXTRA "Building strace"
CT_DoExecLog ALL make
diff --git a/scripts/build/libc/bionic.sh b/scripts/build/libc/bionic.sh
index 027493d..93dcea0 100644
--- a/scripts/build/libc/bionic.sh
+++ b/scripts/build/libc/bionic.sh
@@ -26,6 +26,12 @@ do_libc() {
fi
CT_DoStep INFO "Installing C library binaries"
CT_DoExecLog ALL cp -r "${CT_SRC_DIR}/android-ndk/platforms/android-${CT_ANDROID_API}/arch-${arch}/usr" "${CT_SYSROOT_DIR}"
+
+ # NB: Modifying CT_TARGET_CFLAGS here, not CT_ALL_TARGET_CFLAGS: the __ANDROID_API__
+ # definition needs to be passed into GCC build, or the resulting libstdc++ gets
+ # miscompiled (attempt to link against it results in unresolved symbols to stdout/...).
+ # And since __ANDROID_API__ is a user config option, placing it with other user-supplied
+ # options isn't completely out of character.
CT_EnvModify CT_TARGET_CFLAGS "${CT_TARGET_CFLAGS} -D__ANDROID_API__=${CT_ANDROID_API}"
}
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 3b4b626..125ccf7 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -23,10 +23,9 @@ do_libc_extract() {
# we do not support concurrent use of the source directory
# and next run, if using different glibc-ports source, will override
# this symlink anyway.
- CT_DoExecLog ALL ln -sf "${CT_GLIBC_PORTS_SRC_DIR}/${CT_GLIBC_PORTS_BASENAME}" \
- "${CT_GLIBC_SRC_DIR}/${CT_GLIBC_BASENAME}/ports"
+ CT_DoExecLog ALL ln -sf "${CT_SRC_DIR}/${CT_GLIBC_PORTS_DIR_NAME}" \
+ "${CT_SRC_DIR}/${CT_GLIBC_DIR_NAME}/ports"
fi
- # TBD make the configure timestamp fix in all patched packages (e.g. part of CT_ExtractPatch)
}
# Build and install headers and start files
@@ -171,6 +170,7 @@ do_libc_backend_once() {
*) extra_config+=("--enable-add-ons=$(do_libc_add_ons_list ,)");;
esac
+ [ "${CT_GLIBC_ENABLE_WERROR}" != "y" ] && extra_config+=("--disable-werror")
[ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}")
[ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}")
@@ -196,7 +196,7 @@ do_libc_backend_once() {
esac
# In the order of increasing precedence. Flags common to compiler and linker.
- glibc_cflags+=" ${CT_TARGET_CFLAGS}"
+ glibc_cflags+=" ${CT_ALL_TARGET_CFLAGS}"
glibc_cflags+=" ${CT_GLIBC_EXTRA_CFLAGS}"
glibc_cflags+=" ${multi_flags}"
diff --git a/scripts/build/libc/mingw-w64.sh b/scripts/build/libc/mingw-w64.sh
index 21afb29..3026b87 100644
--- a/scripts/build/libc/mingw-w64.sh
+++ b/scripts/build/libc/mingw-w64.sh
@@ -161,11 +161,29 @@ do_mingw_pthreads()
CT_DoLog EXTRA "Installing mingw-w64-winpthreads"
CT_DoExecLog ALL make install DESTDIR=${CT_SYSROOT_DIR}
+ # Post-install hackery: all libwinpthread-1.dll end up being installed
+ # into /bin, which is broken on multilib install. Hence, stash it back
+ # into /lib - and after iterating over multilibs, copy the default one
+ # back into /bin.
+ if [ "${multi_index}" != 1 -o "${multi_count}" != 1 ]; then
+ CT_DoExecLog ALL mv "${CT_SYSROOT_DIR}${MINGW_INSTALL_PREFIX}/bin/libwinpthread-1.dll" \
+ "${CT_SYSROOT_DIR}${libprefix}/libwinpthread-1.dll"
+ if [ "${multi_index}" = 1 ]; then
+ default_libprefix="${libprefix}"
+ elif [ "${multi_index}" = "${multi_count}" ]; then
+ CT_DoExecLog ALL cp "${CT_SYSROOT_DIR}${default_libprefix}/libwinpthread-1.dll" \
+ "${CT_SYSROOT_DIR}${MINGW_INSTALL_PREFIX}/bin/libwinpthread-1.dll"
+ fi
+ fi
+
CT_EndStep
}
do_libc()
{
+ # Used when iterating over libwinpthread
+ local default_libprefix
+
do_check_mingw_vendor_tuple
CT_DoStep INFO "Building mingw-w64"
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
index 5c4a356..6449d68 100644
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -38,7 +38,7 @@ do_libc() {
# Multilib is the default, so if it is not enabled, disable it.
if [ "${CT_MULTILIB}" != "y" ]; then
- extra_config+=("--disable-multilib")
+ newlib_opts+=("--disable-multilib")
fi
if [ "${CT_LIBC_NEWLIB_IO_FLOAT}" = "y" ]; then
@@ -65,13 +65,13 @@ IO_LL:newlib-io-long-long
NEWLIB_REGISTER_FINI:newlib-register-fini
NANO_MALLOC:newlib-nano-malloc
NANO_FORMATTED_IO:newlib-nano-formatted-io
-ATEXIT_DYNAMIC_ALLOC:atexit-dynamic-alloc
+ATEXIT_DYNAMIC_ALLOC:newlib-atexit-dynamic-alloc
GLOBAL_ATEXIT:newlib-global-atexit
LITE_EXIT:lite-exit
-REENT_SMALL:reent-small
-MULTITHREAD:multithread
+REENT_SMALL:newlib-reent-small
+MULTITHREAD:newlib-multithread
WIDE_ORIENT:newlib-wide-orient
-UNBUF_STREAM_OPT:unbuf-stream-opt
+UNBUF_STREAM_OPT:newlib-unbuf-stream-opt
ENABLE_TARGET_OPTSPACE:target-optspace
"
@@ -94,7 +94,7 @@ ENABLE_TARGET_OPTSPACE:target-optspace
[ "${CT_LIBC_NEWLIB_LTO}" = "y" ] && \
CT_LIBC_NEWLIB_TARGET_CFLAGS="${CT_LIBC_NEWLIB_TARGET_CFLAGS} -flto"
- cflags_for_target="${CT_TARGET_CFLAGS} ${CT_LIBC_NEWLIB_TARGET_CFLAGS}"
+ cflags_for_target="${CT_ALL_TARGET_CFLAGS} ${CT_LIBC_NEWLIB_TARGET_CFLAGS}"
# Note: newlib handles the build/host/target a little bit differently
# than one would expect:
diff --git a/scripts/crosstool-NG.sh b/scripts/crosstool-NG.sh
index d4414b5..ccfe29c 100644
--- a/scripts/crosstool-NG.sh
+++ b/scripts/crosstool-NG.sh
@@ -74,6 +74,7 @@ for d in \
LOCAL_TARBALLS \
WORK \
PREFIX \
+ BUILD_TOP \
INSTALL \
; do
eval dir="\${CT_${d}_DIR}"
@@ -88,6 +89,17 @@ for d in \
CT_Abort "'CT_${d}_DIR'='${dir}' contains a comma in it.\nDon't use commas in paths, it breaks things."
;;
esac
+ case "${dir}" in
+ /*)
+ # Absolute path, okay
+ ;;
+ *)
+ # Relative path from CT_TOP_DIR, make absolute
+ eval CT_${d}_DIR="${CT_TOP_DIR}/${dir}"
+ # Having .. inside CT_PREFIX breaks relocatability.
+ CT_SanitizeVarDir CT_${d}_DIR
+ ;;
+ esac
done
# Where will we work?
@@ -115,11 +127,14 @@ cat "${paths_sh_location}" |while read trash line; do
tool="${line%%=*}"
# Suppress extra quoting
eval path=${line#*=}
- if [ -r "${CT_LIB_DIR}/scripts/override/$tool" ]; then
- tmpl="${CT_LIB_DIR}/scripts/override/$tool"
- else
- tmpl="${CT_LIB_DIR}/scripts/override/__default"
+ if [ ! -r "${CT_LIB_DIR}/scripts/override/$tool" ]; then
+ if [ -n "${path}" ]; then
+ CT_DoExecLog ALL rm -f "${CT_TOOLS_OVERRIDE_DIR}/bin/${tool}"
+ CT_DoExecLog ALL ln -s "${path}" "${CT_TOOLS_OVERRIDE_DIR}/bin/${tool}"
+ fi
+ continue
fi
+ tmpl="${CT_LIB_DIR}/scripts/override/$tool"
CT_DoLog DEBUG "Creating script-override for '${tool}' -> '${path}' using '${tmpl}' template"
CT_DoExecLog ALL cp "${tmpl}" "${CT_TOOLS_OVERRIDE_DIR}/bin/${tool}"
CT_DoExecLog ALL ${sed} -i -r \
@@ -163,8 +178,8 @@ CT_PREFIX_DIR="$( ${sed} -r -e 's:/+:/:g; s:/*$::;' <<<"${CT_PREFIX_DIR}" )"
# Second kludge: merge user-supplied target CFLAGS with architecture-provided
# target CFLAGS. Do the same for LDFLAGS in case it happens in the future.
# Put user-supplied flags at the end, so that they take precedence.
-CT_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_TARGET_CFLAGS}"
-CT_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_TARGET_LDFLAGS}"
+CT_ALL_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_TARGET_CFLAGS}"
+CT_ALL_TARGET_LDFLAGS="${CT_ARCH_TARGET_LDFLAGS} ${CT_TARGET_LDFLAGS}"
# FIXME move to gcc.sh
CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY=( ${CT_ARCH_CC_CORE_EXTRA_CONFIG} "${CT_CC_GCC_CORE_EXTRA_CONFIG_ARRAY[@]}" )
@@ -193,7 +208,7 @@ CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs"
CT_COMMON_SRC_DIR="${CT_WORK_DIR}/src"
CT_SRC_DIR="${CT_BUILD_TOP_DIR}/src"
CT_BUILDTOOLS_PREFIX_DIR="${CT_BUILD_TOP_DIR}/buildtools"
-CT_STATE_DIR="${CT_WORK_DIR}/${CT_TARGET}/state"
+CT_STATE_DIR="${CT_BUILD_TOP_DIR}/state"
# Note about HOST_COMPLIBS_DIR: it's always gonna be in the buildtools dir, or a
# sub-dir. So we won't have to save/restore it, not even create it.
# In case of cross or native, host-complibs are used for build-complibs;
@@ -301,20 +316,17 @@ CT_DoExecLog ALL mkdir -p "${CT_HOST_COMPLIBS_DIR}"
# Only create the state dir if asked for a restartable build
[ -n "${CT_DEBUG_CT_SAVE_STEPS}" ] && CT_DoExecLog ALL mkdir -p "${CT_STATE_DIR}"
+# Kludge: CT_PREFIX_DIR might have grown read-only if
+# the previous build was successful.
+CT_DoExecLog ALL chmod -R u+w "${CT_PREFIX_DIR}"
+
# Check install file system case-sensitiveness
CT_DoExecLog DEBUG touch "${CT_PREFIX_DIR}/foo"
CT_TestAndAbort "Your file system in '${CT_PREFIX_DIR}' is *not* case-sensitive!" -f "${CT_PREFIX_DIR}/FOO"
CT_DoExecLog DEBUG rm -f "${CT_PREFIX_DIR}/foo"
-# Kludge: CT_PREFIX_DIR might have grown read-only if
-# the previous build was successful.
-CT_DoExecLog ALL chmod -R u+w "${CT_PREFIX_DIR}"
-
# Setting up the rest of the environment only if not restarting
if [ -z "${CT_RESTART}" ]; then
- # Having .. inside CT_PREFIX breaks relocatability.
- CT_SanitizeVarDir CT_PREFIX_DIR
-
case "${CT_SYSROOT_NAME}" in
"") CT_SYSROOT_NAME="sysroot";;
.) CT_Abort "Sysroot name is set to '.' which is forbidden";;
diff --git a/scripts/functions b/scripts/functions
index 0b8fba5..ab235d8 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -13,7 +13,7 @@ CT_LoadConfig() {
# It also sets KERNEL/ARCH/... for file inclusion below. Does not handle
# recursive definitions yet. We don't need arrays at this point.
CT_TestOrAbort "Configuration file not found. Please create one." -r .config
- . .config
+ . ./.config # Prefixing with ./ prevents Bash from searching $PATH
# Include sub-scripts instead of calling them: that way, we do not have to
# export any variable, nor re-parse the configuration and functions files.
@@ -37,7 +37,7 @@ CT_LoadConfig() {
oldvals=""
try=0
while [ "$try" -le 10 ]; do
- . .config
+ . ./.config # Prefixing with ./ prevents Bash from searching $PATH
vals=`set | ${grep} -E '^CT_'`
if [ "$oldvals" = "$vals" ]; then
break
@@ -287,6 +287,7 @@ CT_DoLog() {
y,*"warning:"*) cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};;
y,*"WARNING:"*) cur_L=WARN; cur_l=${CT_LOG_LEVEL_WARN};;
*"error:"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};;
+ *"Error:"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};;
*"make["*"]: ***"*) cur_L=ERROR; cur_l=${CT_LOG_LEVEL_ERROR};;
*) cur_L="${LEVEL}"; cur_l="${level}";;
esac
@@ -751,7 +752,9 @@ CT_DoGetFile()
}
# This function saves the specified to local storage if possible,
-# and if so, symlinks it for later usage
+# and if so, symlinks it for later usage. This function is called from
+# the `if' condition (via the CT_GetFile) and therefore must return
+# on error rather than relying on the shell's ERR trap to catch it.
# Usage: CT_SaveLocal </full/path/file.name>
CT_SaveLocal()
{
@@ -761,9 +764,22 @@ CT_SaveLocal()
if [ "${CT_SAVE_TARBALLS}" = "y" ]; then
CT_DoLog EXTRA "Saving '${basename}' to local storage"
# The file may already exist if downloads are forced: remove it first
- CT_DoExecLog ALL rm -f "${CT_LOCAL_TARBALLS_DIR}/${basename}"
- CT_DoExecLog ALL mv -f "${file}" "${CT_LOCAL_TARBALLS_DIR}"
- CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${basename}" "${file}"
+ if ! CT_DoExecLog ALL rm -f "${CT_LOCAL_TARBALLS_DIR}/${basename}"; then
+ return 1
+ fi
+ if ! CT_DoExecLog ALL mv -f "${file}" "${CT_LOCAL_TARBALLS_DIR}"; then
+ # Move may have failed if the local tarball storage is on a different
+ # filesystem. Fallback to copy+delete.
+ if ! CT_DoExecLog ALL cp -f "${file}" "${CT_LOCAL_TARBALLS_DIR}"; then
+ return 1
+ fi
+ if ! CT_DoExecLog ALL rm -f "${file}"; then
+ return 1
+ fi
+ fi
+ if ! CT_DoExecLog ALL ln -s "${CT_LOCAL_TARBALLS_DIR}/${basename}" "${file}"; then
+ return 1
+ fi
fi
}
@@ -886,7 +902,12 @@ CT_DoVerifySignature()
CT_Popd
# If we get here, verification succeeded.
- CT_SaveLocal "${CT_TARBALLS_DIR}/${sigfile}${ext}"
+ if ! CT_SaveLocal "${CT_TARBALLS_DIR}/${sigfile}${ext}"; then
+ CT_Popd
+ return 1
+ fi
+
+ return 0
}
# Download the file from one of the URLs passed as argument
@@ -971,7 +992,9 @@ CT_GetFile()
CT_DoExecLog ALL rm "${CT_TARBALLS_DIR}/${basename}${ext}"
return 1
fi
- CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}${ext}"
+ if ! CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}${ext}"; then
+ return 1
+ fi
return 0
fi
done
@@ -1003,9 +1026,15 @@ CT_DoConfigSub() {
# Normally, each step is executed in a sub-shell and thus cannot modify the
# environment for the next step(s). When this is needed, it can do so by
# invoking this function.
-# Usage: CT_EnvModify VAR VALUE
+# Usage: CT_EnvModify [export] VAR VALUE
CT_EnvModify() {
- echo "${1}=\"${2}\"" >> "${CT_BUILD_DIR}/env.modify.sh"
+ local e
+ if [ "$1" = "export" ]; then
+ shift
+ e="export "
+ fi
+ eval "${e}${1}=\"${2}\""
+ echo "${e}${1}=\"${2}\"" >> "${CT_BUILD_DIR}/env.modify.sh"
}
# Compute the target tuple from what is provided by the user
@@ -1793,7 +1822,6 @@ CT_GetVersion_hg()
# to clone if cset is not known and a branch is given.
if [ -z "${devel_revision}" ]; then
if [ -z "${devel_branch}" ]; then
- # Mercurial does not allow querying branches
devel_revision=`hg identify "${devel_url}"`
else
CT_DoLog WARN "${pkg_name}: Mercurial cannot query non-default branch, will clone"
@@ -1830,46 +1858,97 @@ CT_GetVersion_git()
CT_Abort "${pkg_name}: cannot specify both branch and changeset for Git"
fi
- devel_branch="${devel_branch:-master}"
+ # Do not modify devel_branch so that we can check if it has been set by user
+ # in CT_Download_git.
+ local branch="${devel_branch:-master}"
+
if [ -z "${devel_revision}" ]; then
- local matches=`git ls-remote --exit-code "${devel_url}" --refs "${devel_branch}" \
+ local matches=`git ls-remote --exit-code "${devel_url}" --refs "${branch}" \
|| echo "not found"`
local best using ref
# Cannot test $?, setting a trap on ERR prevents bash from returning the
# status code.
if [ "${matches}" = "not found" ]; then
- CT_Abort "Failed to find git ref ${devel_branch} at ${devel_url}"
+ CT_Abort "Failed to find git ref ${branch} at ${devel_url}"
fi
if [ `echo "${matches}" | wc -l` -gt 1 ]; then
- if echo "${matches}" | grep '[[:space:]]\(refs/heads/\)\?'"${devel_branch}\$" >/dev/null; then
+ if echo "${matches}" | grep '[[:space:]]\(refs/heads/\)\?'"${branch}\$" >/dev/null; then
# Try exact match, or prepended with "refs/heads". Some projects (e.g. binutils)
# have refs/original/refs/heads/master as well as refs/heads/master, and
# `git ls-remote refs/heads/master` prints both.
- best=`echo "${matches}" | grep '[[:space:]]\(refs/heads/\)\?'"${devel_branch}\$"`
+ best=`echo "${matches}" | grep '[[:space:]]\(refs/heads/\)\?'"${branch}\$"`
using="best match"
else
best=`echo "${matches}" | head -n1`
using="first"
fi
ref=`echo "${best}" | sed 's/.*[[:space:]]//'`
- CT_DoLog WARN "Ambiguous ref ${devel_branch} at ${devel_url}, using ${using} (${ref})"
+ CT_DoLog WARN "Ambiguous ref ${branch} at ${devel_url}, using ${using} (${ref})"
else
best="${matches}"
fi
- devel_revision=`echo "${best}" | cut -c1-8`
- CT_DoLog DEBUG "ref ${devel_branch} at ${devel_url} has cset of ${devel_revision}"
+ # Similarly, do not modify the devel_revision, we'll need to know if it
+ # has been set by the user in CT_Download_git.
+ unique_id=`echo "${best}" | cut -c1-8`
+ CT_DoLog DEBUG "ref ${branch} at ${devel_url} has cset of ${unique_id}"
+ else
+ unique_id=`echo "${devel_revision}" | cut -c1-8`
fi
- unique_id="${devel_revision}"
}
# Retrieve sources from Git.
CT_Download_git()
{
- # Git does not allow making a shallow clone of a specific commit.
- CT_DoExecLog ALL git clone "${devel_url}" "${pkg_name}"
- CT_Pushd "${pkg_name}"
- CT_DoExecLog ALL git checkout "${devel_revision}" --
+ local new_unique_id fetched=n shallow_id
+
+ # Some of these operations are part of a `git clone`, but fetching a specific commit
+ # (if it is supported by the server) is not expressable as a `git clone`.
+ CT_mkdir_pushd "${pkg_name}"
+ CT_DoExecLog ALL git init
+ CT_DoExecLog ALL git remote add origin "${devel_url}"
+
+ if [ -z "${devel_revision}" ]; then
+ # Configuration didn't care about a specific commit; we'll use the most recent
+ # commit on the branch and will update the unique_id (and warn the user) if it
+ # differs from what we've previously determined.
+ shallow_id="${devel_branch:-master}"
+ else
+ local tmp=`echo "${devel_revision}" | sed 's/^[0-9a-z]\{40\}//'`
+
+ if [ -z "${tmp}" ]; then
+ shallow_id="${devel_revision}"
+ else
+ CT_DoLog WARN "Git only allows full 40-character SHA-1 hashes to identify a commit for shallow clone."
+ fi
+ fi
+
+ if [ -n "${shallow_id}" ]; then
+ if CT_DoExecLog ALL git fetch --quiet --depth 1 origin "${shallow_id}"; then
+ CT_DoExecLog ALL git checkout --quiet FETCH_HEAD --
+ else
+ # Git 2.15 and newer (which must be the case on both the client and the server)
+ # allows fetching a single commit so long as the server is configured
+ # to allow it (by having uploadpack.allowReachableSHA1InWant=true set
+ # in its config).
+ CT_DoLog WARN "Shallow clone failed (likely disallowed on the server)."
+ shallow_id=
+ fi
+ fi
+
+ if [ -z "${shallow_id}" ]; then
+ # In this case, we already determined the changeset we need
+ CT_DoLog WARN "Falling back to full clone; may take some time..."
+ CT_DoExecLog ALL git fetch --quiet origin
+ CT_DoExecLog ALL git checkout --quiet "${unique_id}" --
+ fi
+
+ new_unique_id=`git rev-parse HEAD | cut -c1-8`
+ if [ "${new_unique_id}" != "${unique_id}" ]; then
+ CT_DoLog EXTRA "Revision being fetched changed to ${new_unique_id}; source repository had more revisions pushed?"
+ unique_id="${new_unique_id}"
+ fi
+
CT_DoExecLog ALL rm -rf .git
CT_Popd
}
@@ -1897,7 +1976,7 @@ CT_PackageRun()
for v in basename pkg_name version pkg_dir \
src_release mirrors archive_filename archive_dirname archive_formats signature_format \
src_devel devel_vcs devel_url devel_branch devel_revision devel_subdir devel_bootstrap \
- src_custom custom_location; do
+ src_custom custom_location patch_order; do
eval "local ${v}=\${CT_${use}_${v^^}}"
done
@@ -1980,10 +2059,10 @@ CT_DoFetch()
if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
CT_DoLog WARN "Downloads forbidden, not trying ${devel_vcs} retrieval"
- return 1
+ CT_Abort "${pkg_name}: cannot check out"
fi
- CT_DoLog EXTRA "Retrieving '${basename}' (${devel_vcs} ${devel_url} ${devel_branch} ${devel_revision})"
+ CT_DoLog EXTRA "Checking out '${basename}' (${devel_vcs} ${devel_url}${devel_branch:+, branch ${devel_branch}}${devel_revision:+, revision ${devel_revision}})"
CT_MktempDir tmp_dir
CT_Pushd "${tmp_dir}"
CT_Download_${devel_vcs}
@@ -1995,7 +2074,9 @@ CT_DoFetch()
CT_DoExecLog ALL mv "${pkg_name}${devel_subdir:+/${devel_subdir}}" "${basename}"
CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${basename}"
- CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}.tar.bz2"
+ if ! CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}.tar.bz2"; then
+ CT_Abort "${pkg_name}: failed to save to local storage"
+ fi
CT_Popd
CT_DoExecLog ALL rm -rf "${tmp_dir}"
@@ -2055,6 +2136,11 @@ CT_DoExtractPatch()
local local_patch_dir
local overlay
+ # Inherit global value if requested
+ if [ "${patch_order}" = "global" ]; then
+ patch_order="${CT_PATCH_ORDER}"
+ fi
+
# If using overlay, prepare it first - we need to determine where to unpack
# this component.
if [ "${CT_TARGET_USE_OVERLAY}" = "y" -a ! -d "${CT_BUILD_DIR}/overlay" ]; then
@@ -2071,7 +2157,7 @@ CT_DoExtractPatch()
# and no overlays. Otherwise, this source directory is custom-tailored for this
# particular configuration and cannot be reused by different configurations.
if [ "${src_custom}" != "y" -a \
- "${CT_PATCH_ORDER}" = "bundled" -a \
+ "${patch_order}" = "bundled" -a \
! -d "${CT_BUILD_DIR}/overlay/${dir_name}" ]; then
src_dir="${CT_COMMON_SRC_DIR}"
else
@@ -2120,7 +2206,7 @@ CT_DoExtractPatch()
bundled_patch_dir="${CT_LIB_DIR}/packages/${pkg_dir}"
local_patch_dir="${CT_LOCAL_PATCH_DIR}/${pkg_dir}"
- case "${CT_PATCH_ORDER}" in
+ case "${patch_order}" in
bundled) patch_dirs=("${bundled_patch_dir}");;
local) patch_dirs=("${local_patch_dir}");;
bundled,local) patch_dirs=("${bundled_patch_dir}" "${local_patch_dir}");;
@@ -2159,6 +2245,20 @@ CT_DoExtractPatch()
CT_DoExecLog ALL "${CT_CONFIG_SHELL}" -c "${devel_bootstrap}"
fi
+ # Fix up the timestamps on the file we may be patching: otherwise, we may
+ # have a circular dependency. For example, we need make to build autoconf
+ # and automake companion tools, but we need autoconf and automake to regenerate
+ # aclocal.m4 or config.h.in after the patch touches configure.ac. Instead,
+ # assume the patch fixes all the files it needs.
+ find . -type f -name "aclocal.m4" \
+ -exec touch {} \; -exec echo touch {} \; | CT_DoLog ALL
+ find . -type f -name "config.h.in" \
+ -exec touch {} \; -exec echo touch {} \; | CT_DoLog ALL
+ find . -type f -name "Makefile.in" \
+ -exec touch {} \; -exec echo touch {} \; | CT_DoLog ALL
+ find . -type f -name "configure" \
+ -exec touch {} \; -exec echo touch {} \; | CT_DoLog ALL
+
if [ -n "${patchfunc}" ]; then
${patchfunc}
fi
diff --git a/scripts/override/__default b/scripts/override/__default
deleted file mode 100644
index 977b1f5..0000000
--- a/scripts/override/__default
+++ /dev/null
@@ -1,3 +0,0 @@
-#!@CONFIG_SHELL@
-
-exec @TOOL_PATH@ "$@"
diff --git a/testing/docker/archlinux/Dockerfile b/testing/docker/archlinux/Dockerfile
index eee2f47..5f2b717 100644
--- a/testing/docker/archlinux/Dockerfile
+++ b/testing/docker/archlinux/Dockerfile
@@ -1,3 +1,12 @@
-FROM hoverbear/archlinux
+FROM base/archlinux:latest
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
RUN pacman -Syu --noconfirm
-RUN pacman -S --noconfirm base-devel git help2man python
+RUN pacman -S --noconfirm base-devel git help2man python unzip wget
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+RUN echo 'export MENUCONFIG_COLOR=mono' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
diff --git a/testing/docker/centos6/Dockerfile b/testing/docker/centos6/Dockerfile
new file mode 100644
index 0000000..02a261f
--- /dev/null
+++ b/testing/docker/centos6/Dockerfile
@@ -0,0 +1,11 @@
+FROM centos:6
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
+RUN yum install -y autoconf gperf bison flex texinfo help2man gcc-c++ libtool libtool-bin patch \
+ ncurses-devel python-devel perl-Thread-Queue bzip2 git wget xz unzip
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
diff --git a/testing/docker/centos7/Dockerfile b/testing/docker/centos7/Dockerfile
new file mode 100644
index 0000000..b0f928d
--- /dev/null
+++ b/testing/docker/centos7/Dockerfile
@@ -0,0 +1,11 @@
+FROM centos:7
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
+RUN yum install -y autoconf gperf bison file flex texinfo help2man gcc-c++ libtool make patch \
+ ncurses-devel python-devel perl-Thread-Queue bzip2 git wget which xz unzip
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
diff --git a/testing/docker/common-scripts/ctng-build-sample b/testing/docker/common-scripts/ctng-build-sample
new file mode 100755
index 0000000..ef823ee
--- /dev/null
+++ b/testing/docker/common-scripts/ctng-build-sample
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+set -e
+cd work
+ct-ng build-all ${1+CT_SAMPLES="$*"}
diff --git a/testing/docker/common-scripts/ctng-install b/testing/docker/common-scripts/ctng-install
index f29093a..6994fd5 100755
--- a/testing/docker/common-scripts/ctng-install
+++ b/testing/docker/common-scripts/ctng-install
@@ -1,10 +1,7 @@
#!/bin/bash
set -e
-cd
-rm -rf bld-ctng
-mkdir bld-ctng
-cd bld-ctng
-/crosstool-ng/configure --prefix=$HOME/inst-ctng
+cd work
+/crosstool-ng/configure --prefix=/opt/ctng
make
make install
diff --git a/testing/docker/common-scripts/ctng-test-all b/testing/docker/common-scripts/ctng-test-all
deleted file mode 100755
index f0ba266..0000000
--- a/testing/docker/common-scripts/ctng-test-all
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-set -e
-cd
-rm -rf bld-samples
-mkdir bld-samples
-cd bld-samples
-export PATH=$HOME/inst-ctng/bin:$PATH
-ct-ng help
-ct-ng list-samples
-ct-ng list-steps
-ct-ng build-all
diff --git a/testing/docker/common-scripts/ctng-test-basic b/testing/docker/common-scripts/ctng-test-basic
new file mode 100755
index 0000000..a811ec6
--- /dev/null
+++ b/testing/docker/common-scripts/ctng-test-basic
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+set -e
+cd
+ct-ng help
+ct-ng list-samples
+ct-ng list-steps
diff --git a/testing/docker/common-scripts/su-as-user b/testing/docker/common-scripts/su-as-user
deleted file mode 100755
index 99246f2..0000000
--- a/testing/docker/common-scripts/su-as-user
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-usr=$1
-uid=$2
-grp=$3
-gid=$4
-shift 4
-
-groupadd -g ${gid} ${grp}
-useradd -d /home/${usr} -m -g ${gid} -u ${uid} ${usr}
-ln -sf /src /home/${usr}/src
-if [ -z "$*" ]; then
- exec su -l ${usr}
-else
- exec su -l -c "/bin/bash -c '$*'" ${usr}
-fi
diff --git a/testing/docker/dmgr.sh b/testing/docker/dmgr.sh
index 5dbb8b2..1330867 100755
--- a/testing/docker/dmgr.sh
+++ b/testing/docker/dmgr.sh
@@ -19,24 +19,42 @@ usage()
cat >&2 <<EOF
${1:+ERROR :: $1
-}Usage: $0 [action] [containters]
+}Usage: $0 [action] [containter] [args...]
Action is one of:
build Build or rebuild the specified containers.
-
-If containers are not specified, the action is applied to all available containers.
+ install Install crosstool-NG in specified containers.
+ sample Build a sample or if no sample name specified, all.
+ enter Spawn a shell in the specified container.
+ root Spawn a root shell in the specified container.
+ clean Clean up in the specified container.
+
+If a special container name 'all' is used, the action is performed
+on all the containers.
EOF
exit 1
}
+do_cleanup()
+{
+ local d
+
+ for d in "$@"; do
+ [ -d "$d" ] || continue
+ chmod -R a+w "$d"
+ rm -rf "$d"
+ done
+}
+
# Build a docker container, store its ID.
action_build()
{
local cntr=$1
msg "Building Docker container for ${cntr}"
- docker build -t "ctng-${cntr}" "${cntr}"
+set -x
+ docker build --no-cache -t "ctng-${cntr}" --build-arg CTNG_GID=`id -g` --build-arg CTNG_UID=`id -u` "${cntr}"
}
# Common backend for enter/test
@@ -44,37 +62,67 @@ _dckr()
{
local topdir=`cd ../.. && pwd`
local cntr=$1
+ local scmd prefix
shift
- mkdir -p build-${cntr}
- docker run --rm -i -t \
- -v `pwd`/common-scripts:/setup-scripts:ro \
+ mkdir -p ${cntr}/{build,install,xtools}
+ prefix="docker run --rm -i -t \
+ -v `pwd`/common-scripts:/common-scripts:ro \
-v ${topdir}:/crosstool-ng:ro \
- -v `pwd`/build-${cntr}:/home \
- -v $HOME/src:/src:ro \
- ctng-${cntr} \
- /setup-scripts/su-as-user `id -un` `id -u` `id -gn` `id -g` "$@"
+ -v `pwd`/${cntr}/build:/home/ctng/work \
+ -v `pwd`/${cntr}/install:/opt/ctng \
+ -v `pwd`/${cntr}/xtools:/home/ctng/x-tools \
+ -v $HOME/src:/home/ctng/src:ro \
+ ctng-${cntr}"
+ if [ -n "${AS_ROOT}" ]; then
+ $prefix "$@"
+ elif [ -n "$*" ]; then
+ $prefix su -l ctng -c "$*"
+ else
+ $prefix su -l ctng
+ fi
}
# Run the test
-action_test()
+action_install()
{
local cntr=$1
# The test assumes the top directory is bootstrapped, but clean.
msg "Setting up crosstool-NG in ${cntr}"
- _dckr "${cntr}" /setup-scripts/ctng-install
- msg "Running build-all in ${cntr}"
- _dckr "${cntr}" /setup-scripts/ctng-test-all
+ do_cleanup ${cntr}/build
+ _dckr "${cntr}" /common-scripts/ctng-install && \
+ _dckr "${cntr}" /common-scripts/ctng-test-basic
+}
+
+# Run the test
+action_sample()
+{
+ local cntr=$1
+ shift
+
+ msg "Building samples in ${cntr} [$@]"
+ do_cleanup ${cntr}/build
+ _dckr "${cntr}" /common-scripts/ctng-build-sample "$@"
}
# Enter the container using the same user account/environment as for testing.
action_enter()
{
local cntr=$1
+ shift
msg "Entering ${cntr}"
- _dckr "${cntr}"
+ _dckr "${cntr}" "$@"
+}
+
+# Enter the container using the same user account/environment as for testing.
+action_root()
+{
+ local cntr=$1
+
+ msg "Entering ${cntr} as root"
+ AS_ROOT=y _dckr "${cntr}" /bin/bash
}
# Clean up after test suite run
@@ -83,18 +131,30 @@ action_clean()
local cntr=$1
msg "Cleaning up after ${cntr}"
- rm -rf build-${cntr}
+ do_cleanup ${cntr}/build
+}
+
+# Clean up after test suite run
+action_distclean()
+{
+ local cntr=$1
+
+ msg "Dist cleaning ${cntr}"
+ do_cleanup ${cntr}/{build,install,xtools}
}
-action=$1
-shift
all_containers=`ls */Dockerfile | sed 's,/Dockerfile,,'`
-selected_containers="${*:-${all_containers}}"
+action=$1
+selected_containers=$2
+shift 2
+if [ "${selected_containers}" = "all" ]; then
+ selected_containers="${all_containers}"
+fi
case "${action}" in
- build|test|enter|clean)
+ build|install|sample|enter|root|clean|distclean)
for c in ${selected_containers}; do
- eval "action_${action} $c"
+ eval "action_${action} ${c} \"$@\""
done
;;
"")
diff --git a/testing/docker/docker-remove-all.sh b/testing/docker/docker-remove-all.sh
new file mode 100755
index 0000000..d73ba1e
--- /dev/null
+++ b/testing/docker/docker-remove-all.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+for c in `docker ps -a -q`; do
+ docker rm $c
+done
+for i in `docker images -q`; do
+ docker rmi --force $i
+done
diff --git a/testing/docker/fedora28/Dockerfile b/testing/docker/fedora28/Dockerfile
new file mode 100644
index 0000000..20363c9
--- /dev/null
+++ b/testing/docker/fedora28/Dockerfile
@@ -0,0 +1,11 @@
+FROM fedora:28
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
+RUN yum install -y autoconf gperf bison file flex texinfo help2man gcc-c++ libtool make patch \
+ ncurses-devel python-devel perl-Thread-Queue bzip2 git wget which xz unzip
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
diff --git a/testing/docker/gentoo-amd64/Dockerfile b/testing/docker/gentoo-amd64/Dockerfile
new file mode 100644
index 0000000..ec5c131
--- /dev/null
+++ b/testing/docker/gentoo-amd64/Dockerfile
@@ -0,0 +1,9 @@
+FROM gentoo/stage3-amd64-hardened
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
diff --git a/testing/docker/mint19-amd64/Dockerfile b/testing/docker/mint19-amd64/Dockerfile
new file mode 100644
index 0000000..7a0e4ba
--- /dev/null
+++ b/testing/docker/mint19-amd64/Dockerfile
@@ -0,0 +1,12 @@
+FROM linuxmintd/mint19-amd64
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
+RUN apt-get update
+RUN apt-get install -y gcc gperf bison flex texinfo help2man make libncurses5-dev \
+ python-dev autoconf automake libtool libtool-bin gawk wget
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
diff --git a/testing/docker/ubuntu16.04/Dockerfile b/testing/docker/ubuntu16.04/Dockerfile
new file mode 100644
index 0000000..7a76712
--- /dev/null
+++ b/testing/docker/ubuntu16.04/Dockerfile
@@ -0,0 +1,14 @@
+FROM ubuntu:16.04
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
+RUN apt-get update
+RUN apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \
+ python-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \
+ patch libstdc++6
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
+
diff --git a/testing/docker/ubuntu18.04/Dockerfile b/testing/docker/ubuntu18.04/Dockerfile
new file mode 100644
index 0000000..9fe27b2
--- /dev/null
+++ b/testing/docker/ubuntu18.04/Dockerfile
@@ -0,0 +1,14 @@
+FROM ubuntu:18.04
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
+RUN apt-get update
+RUN apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \
+ python-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \
+ patch libstdc++6
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
+
diff --git a/testing/docker/ubuntu18.10/Dockerfile b/testing/docker/ubuntu18.10/Dockerfile
new file mode 100644
index 0000000..468175e
--- /dev/null
+++ b/testing/docker/ubuntu18.10/Dockerfile
@@ -0,0 +1,14 @@
+FROM ubuntu:18.10
+ARG CTNG_UID
+ARG CTNG_GID
+RUN groupadd -g $CTNG_GID ctng
+RUN useradd -d /home/ctng -m -g $CTNG_GID -u $CTNG_UID -s /bin/bash ctng
+RUN apt-get update
+RUN apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \
+ python-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \
+ patch libstdc++6
+RUN wget -O /sbin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
+RUN chmod a+x /sbin/dumb-init
+RUN echo 'export PATH=/opt/ctng/bin:$PATH' >> /etc/profile
+ENTRYPOINT [ "/sbin/dumb-init", "--" ]
+