summaryrefslogtreecommitdiff
path: root/sys-devel
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-devel
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/autoconf-archive/Manifest13
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2016.03.20-r1.ebuild28
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2016.09.16.ebuild23
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2017.03.21.ebuild23
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2017.09.28.ebuild23
-rw-r--r--sys-devel/autoconf-archive/files/autoconf-archive-2016.03.20-cxxcpp.patch111
-rw-r--r--sys-devel/autoconf-archive/files/autoconf-archive-2016.03.20-include.patch54
-rw-r--r--sys-devel/autoconf-archive/metadata.xml8
-rw-r--r--sys-devel/autoconf-wrapper/Manifest5
-rw-r--r--sys-devel/autoconf-wrapper/autoconf-wrapper-13.ebuild26
-rw-r--r--sys-devel/autoconf-wrapper/files/ac-wrapper-13.sh201
-rw-r--r--sys-devel/autoconf-wrapper/metadata.xml8
-rw-r--r--sys-devel/autoconf/Manifest39
-rw-r--r--sys-devel/autoconf/autoconf-2.13.ebuild50
-rw-r--r--sys-devel/autoconf/autoconf-2.59-r7.ebuild25
-rw-r--r--sys-devel/autoconf/autoconf-2.61-r2.ebuild31
-rw-r--r--sys-devel/autoconf/autoconf-2.62-r1.ebuild27
-rw-r--r--sys-devel/autoconf/autoconf-2.63-r1.ebuild25
-rw-r--r--sys-devel/autoconf/autoconf-2.64.ebuild21
-rw-r--r--sys-devel/autoconf/autoconf-2.65-r1.ebuild25
-rw-r--r--sys-devel/autoconf/autoconf-2.67.ebuild21
-rw-r--r--sys-devel/autoconf/autoconf-2.68.ebuild21
-rw-r--r--sys-devel/autoconf/autoconf-2.69-r4.ebuild46
-rw-r--r--sys-devel/autoconf/autoconf-2.69.ebuild56
-rw-r--r--sys-devel/autoconf/autoconf-9999.ebuild44
-rw-r--r--sys-devel/autoconf/files/autoconf-2.13-destdir.patch26
-rw-r--r--sys-devel/autoconf/files/autoconf-2.13-gentoo.patch36
-rw-r--r--sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch18
-rw-r--r--sys-devel/autoconf/files/autoconf-2.59-more-quotes.patch34
-rw-r--r--sys-devel/autoconf/files/autoconf-2.61-GETMNTENT.patch23
-rw-r--r--sys-devel/autoconf/files/autoconf-2.61-darwin.patch11
-rw-r--r--sys-devel/autoconf/files/autoconf-2.62-at-keywords.patch81
-rw-r--r--sys-devel/autoconf/files/autoconf-2.62-fix-multiline-string.patch30
-rw-r--r--sys-devel/autoconf/files/autoconf-2.62-revert-AC_C_BIGENDIAN.patch214
-rw-r--r--sys-devel/autoconf/files/autoconf-2.63-sh.patch32
-rw-r--r--sys-devel/autoconf/files/autoconf-2.65-AC_TYPE_INT_T.patch49
-rw-r--r--sys-devel/autoconf/files/autoconf-2.69-fix-libtool-test.patch31
-rw-r--r--sys-devel/autoconf/files/autoconf-2.69-perl-5.26-2.patch30
-rw-r--r--sys-devel/autoconf/files/autoconf-2.69-perl-5.26.patch28
-rw-r--r--sys-devel/autoconf/metadata.xml8
-rw-r--r--sys-devel/autogen/Manifest12
-rw-r--r--sys-devel/autogen/autogen-5.18.10.ebuild44
-rw-r--r--sys-devel/autogen/autogen-5.18.12.ebuild44
-rw-r--r--sys-devel/autogen/autogen-5.18.4-r1.ebuild43
-rw-r--r--sys-devel/autogen/autogen-5.18.4.ebuild40
-rw-r--r--sys-devel/autogen/files/autogen-5.18.4-tmp-log.patch17
-rw-r--r--sys-devel/autogen/files/autogen-5.18.4_fix_format.test_for_dash.patch25
-rw-r--r--sys-devel/autogen/metadata.xml11
-rw-r--r--sys-devel/automake-wrapper/Manifest5
-rw-r--r--sys-devel/automake-wrapper/automake-wrapper-10.ebuild34
-rw-r--r--sys-devel/automake-wrapper/files/am-wrapper-10.sh186
-rw-r--r--sys-devel/automake-wrapper/metadata.xml8
-rw-r--r--sys-devel/automake/Manifest69
-rw-r--r--sys-devel/automake/automake-1.10.3-r1.ebuild81
-rw-r--r--sys-devel/automake/automake-1.10.3-r2.ebuild82
-rw-r--r--sys-devel/automake/automake-1.11.6-r1.ebuild89
-rw-r--r--sys-devel/automake/automake-1.11.6-r2.ebuild91
-rw-r--r--sys-devel/automake/automake-1.12.6-r1.ebuild80
-rw-r--r--sys-devel/automake/automake-1.12.6.ebuild79
-rw-r--r--sys-devel/automake/automake-1.13.4-r1.ebuild85
-rw-r--r--sys-devel/automake/automake-1.13.4.ebuild84
-rw-r--r--sys-devel/automake/automake-1.14.1-r1.ebuild97
-rw-r--r--sys-devel/automake/automake-1.14.1.ebuild96
-rw-r--r--sys-devel/automake/automake-1.15-r1.ebuild97
-rw-r--r--sys-devel/automake/automake-1.15-r2.ebuild98
-rw-r--r--sys-devel/automake/automake-1.15.1-r1.ebuild98
-rw-r--r--sys-devel/automake/automake-1.15.1.ebuild96
-rw-r--r--sys-devel/automake/automake-1.15.ebuild96
-rw-r--r--sys-devel/automake/automake-1.4_p6-r2.ebuild83
-rw-r--r--sys-devel/automake/automake-1.5-r2.ebuild79
-rw-r--r--sys-devel/automake/automake-1.6.3-r2.ebuild72
-rw-r--r--sys-devel/automake/automake-1.7.9-r3.ebuild75
-rw-r--r--sys-devel/automake/automake-1.8.5-r5.ebuild75
-rw-r--r--sys-devel/automake/automake-1.9.6-r4.ebuild83
-rw-r--r--sys-devel/automake/automake-9999.ebuild98
-rw-r--r--sys-devel/automake/files/automake-1.10-ccnoco-ldflags.patch35
-rw-r--r--sys-devel/automake/files/automake-1.10-perl-5.16.patch128
-rw-r--r--sys-devel/automake/files/automake-1.13-dyn-ithreads.patch59
-rw-r--r--sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket.patch37
-rw-r--r--sys-devel/automake/files/automake-1.15-mdate-tz.patch53
-rw-r--r--sys-devel/automake/files/automake-1.15-perl-escape-curly-bracket.patch37
-rw-r--r--sys-devel/automake/files/automake-1.4-CVE-2009-4029.patch65
-rw-r--r--sys-devel/automake/files/automake-1.4-ansi2knr-stdlib.patch11
-rw-r--r--sys-devel/automake/files/automake-1.4-libtoolize.patch17
-rw-r--r--sys-devel/automake/files/automake-1.4-nls-nuisances.patch19
-rw-r--r--sys-devel/automake/files/automake-1.4-perl-5.11.patch28
-rw-r--r--sys-devel/automake/files/automake-1.4-perl-dyn-call.patch23
-rw-r--r--sys-devel/automake/files/automake-1.4-subdirs-89656.patch22
-rw-r--r--sys-devel/automake/files/automake-1.5-CVE-2009-4029.patch60
-rw-r--r--sys-devel/automake/files/automake-1.5-perl-5.11.patch28
-rw-r--r--sys-devel/automake/files/automake-1.5-slot.patch42
-rw-r--r--sys-devel/automake/files/automake-1.5-target_hook.patch36
-rw-r--r--sys-devel/automake/files/automake-1.5-test-fixes.patch65
-rw-r--r--sys-devel/automake/files/automake-1.6.3-test-fixes.patch28
-rw-r--r--sys-devel/automake/files/automake-1.7.9-infopage-namechange.patch15
-rw-r--r--sys-devel/automake/files/automake-1.7.9-libtool-2.patch43
-rw-r--r--sys-devel/automake/files/automake-1.7.9-test-fixes.patch46
-rw-r--r--sys-devel/automake/files/automake-1.8-perl-5.11.patch30
-rw-r--r--sys-devel/automake/files/automake-1.8.2-infopage-namechange.patch36
-rw-r--r--sys-devel/automake/files/automake-1.8.5-CVE-2009-4029.patch60
-rw-r--r--sys-devel/automake/files/automake-1.8.5-test-fixes.patch43
-rw-r--r--sys-devel/automake/files/automake-1.9.6-aclocal7-test-sleep.patch39
-rw-r--r--sys-devel/automake/files/automake-1.9.6-ignore-comments.patch29
-rw-r--r--sys-devel/automake/files/automake-1.9.6-include-dir-prefix.patch31
-rw-r--r--sys-devel/automake/files/automake-1.9.6-infopage-namechange.patch33
-rw-r--r--sys-devel/automake/files/automake-1.9.6-subst-test.patch42
-rw-r--r--sys-devel/automake/metadata.xml8
-rw-r--r--sys-devel/bc/Manifest10
-rw-r--r--sys-devel/bc/bc-1.06.95-r1.ebuild51
-rw-r--r--sys-devel/bc/bc-1.06.95-r2.ebuild54
-rw-r--r--sys-devel/bc/bc-1.07.1.ebuild50
-rw-r--r--sys-devel/bc/files/bc-1.06.95-mem-leak.patch24
-rw-r--r--sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch13
-rw-r--r--sys-devel/bc/metadata.xml8
-rw-r--r--sys-devel/bin86/Manifest9
-rw-r--r--sys-devel/bin86/bin86-0.16.20-r2.ebuild34
-rw-r--r--sys-devel/bin86/bin86-0.16.21.ebuild32
-rw-r--r--sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch17
-rw-r--r--sys-devel/bin86/metadata.xml15
-rw-r--r--sys-devel/binutils-apple/Manifest55
-rw-r--r--sys-devel/binutils-apple/binutils-apple-4.3-r2.ebuild337
-rw-r--r--sys-devel/binutils-apple/binutils-apple-5.1-r1.ebuild384
-rw-r--r--sys-devel/binutils-apple/binutils-apple-6.1-r1.ebuild385
-rw-r--r--sys-devel/binutils-apple/binutils-apple-6.3-r1.ebuild378
-rw-r--r--sys-devel/binutils-apple/binutils-apple-7.0-r1.ebuild369
-rw-r--r--sys-devel/binutils-apple/binutils-apple-7.0.ebuild366
-rw-r--r--sys-devel/binutils-apple/binutils-apple-7.1-r1.ebuild369
-rw-r--r--sys-devel/binutils-apple/binutils-apple-7.1.ebuild366
-rw-r--r--sys-devel/binutils-apple/binutils-apple-7.2-r1.ebuild370
-rw-r--r--sys-devel/binutils-apple/binutils-apple-7.2.ebuild366
-rw-r--r--sys-devel/binutils-apple/binutils-apple-7.3.1.ebuild393
-rw-r--r--sys-devel/binutils-apple/binutils-apple-7.3.ebuild386
-rw-r--r--sys-devel/binutils-apple/binutils-apple-8.1.ebuild334
-rw-r--r--sys-devel/binutils-apple/binutils-apple-8.2.1.ebuild334
-rw-r--r--sys-devel/binutils-apple/metadata.xml18
-rw-r--r--sys-devel/binutils-config/Manifest7
-rw-r--r--sys-devel/binutils-config/binutils-config-5-r3.ebuild43
-rwxr-xr-xsys-devel/binutils-config/files/binutils-config-5481
-rw-r--r--sys-devel/binutils-config/files/binutils-config.873
-rw-r--r--sys-devel/binutils-config/files/binutils.eselect45
-rw-r--r--sys-devel/binutils-config/metadata.xml8
-rw-r--r--sys-devel/binutils-hppa64/Manifest41
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.19.1.ebuild22
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.20.1.ebuild22
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.21.1-r1.ebuild22
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.22.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.23.2.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.24.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.25.1.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.26.1.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.27.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.28.1.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.28.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.29.1.ebuild27
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.29.ebuild26
-rw-r--r--sys-devel/binutils-hppa64/metadata.xml14
-rw-r--r--sys-devel/binutils/Manifest22
-rw-r--r--sys-devel/binutils/binutils-2.25.1-r1.ebuild10
-rw-r--r--sys-devel/binutils/binutils-2.26.1.ebuild10
-rw-r--r--sys-devel/binutils/binutils-2.27-r1.ebuild10
-rw-r--r--sys-devel/binutils/binutils-2.28.1.ebuild10
-rw-r--r--sys-devel/binutils/binutils-2.29.1.ebuild11
-rw-r--r--sys-devel/binutils/binutils-2.29.ebuild10
-rw-r--r--sys-devel/binutils/binutils-9999.ebuild6
-rw-r--r--sys-devel/binutils/files/binutils-configure-LANG.patch65
-rw-r--r--sys-devel/binutils/metadata.xml14
-rw-r--r--sys-devel/bison/Manifest15
-rw-r--r--sys-devel/bison/bison-1.875d.ebuild64
-rw-r--r--sys-devel/bison/bison-2.4.3.ebuild48
-rw-r--r--sys-devel/bison/bison-2.7.1.ebuild61
-rw-r--r--sys-devel/bison/bison-3.0.4-r1.ebuild73
-rw-r--r--sys-devel/bison/files/bison-1.32-extfix.patch28
-rw-r--r--sys-devel/bison/files/bison-2.4.3-no-gets.patch22
-rw-r--r--sys-devel/bison/files/bison-2.4.3-uclibc-sched_param-def.patch19
-rw-r--r--sys-devel/bison/files/bison-3.0.4-optional-perl.patch500
-rw-r--r--sys-devel/bison/metadata.xml8
-rw-r--r--sys-devel/bmake/Manifest11
-rw-r--r--sys-devel/bmake/bmake-20170421.ebuild50
-rw-r--r--sys-devel/bmake/bmake-20170510.ebuild50
-rw-r--r--sys-devel/bmake/bmake-20170812.ebuild50
-rw-r--r--sys-devel/bmake/metadata.xml8
-rw-r--r--sys-devel/boost-m4/Manifest9
-rw-r--r--sys-devel/boost-m4/boost-m4-0.4-r1.ebuild34
-rw-r--r--sys-devel/boost-m4/boost-m4-0.4.ebuild30
-rw-r--r--sys-devel/boost-m4/boost-m4-0.4_p20160328.ebuild29
-rw-r--r--sys-devel/boost-m4/files/boost-m4-0.4-gcc5.patch91
-rw-r--r--sys-devel/boost-m4/metadata.xml7
-rw-r--r--sys-devel/byfl/Manifest8
-rw-r--r--sys-devel/byfl/byfl-1.4-r1.ebuild48
-rw-r--r--sys-devel/byfl/byfl-1.5.ebuild47
-rw-r--r--sys-devel/byfl/byfl-9999.ebuild47
-rw-r--r--sys-devel/byfl/metadata.xml11
-rw-r--r--sys-devel/clang-runtime/Manifest8
-rw-r--r--sys-devel/clang-runtime/clang-runtime-3.9.0.ebuild20
-rw-r--r--sys-devel/clang-runtime/clang-runtime-3.9.1.ebuild20
-rw-r--r--sys-devel/clang-runtime/clang-runtime-4.0.1.ebuild25
-rw-r--r--sys-devel/clang-runtime/clang-runtime-5.0.0.ebuild25
-rw-r--r--sys-devel/clang-runtime/clang-runtime-5.0.9999.ebuild26
-rw-r--r--sys-devel/clang-runtime/clang-runtime-9999.ebuild26
-rw-r--r--sys-devel/clang-runtime/metadata.xml13
-rw-r--r--sys-devel/clang/Manifest26
-rw-r--r--sys-devel/clang/clang-3.4.2-r100.ebuild35
-rw-r--r--sys-devel/clang/clang-3.5.2-r100.ebuild35
-rw-r--r--sys-devel/clang/clang-3.6.2-r100.ebuild35
-rw-r--r--sys-devel/clang/clang-3.7.1-r100.ebuild35
-rw-r--r--sys-devel/clang/clang-3.8.1-r100.ebuild35
-rw-r--r--sys-devel/clang/clang-3.9.1-r100.ebuild46
-rw-r--r--sys-devel/clang/clang-4.0.1.ebuild294
-rw-r--r--sys-devel/clang/clang-5.0.0.ebuild294
-rw-r--r--sys-devel/clang/clang-5.0.9999.ebuild298
-rw-r--r--sys-devel/clang/clang-9999.ebuild283
-rw-r--r--sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch87
-rw-r--r--sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch64
-rw-r--r--sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch48
-rw-r--r--sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch136
-rw-r--r--sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch83
-rw-r--r--sys-devel/clang/metadata.xml36
-rw-r--r--sys-devel/cons/Manifest7
-rw-r--r--sys-devel/cons/cons-2.2.0.ebuild25
-rw-r--r--sys-devel/cons/cons-2.3.0.ebuild29
-rw-r--r--sys-devel/cons/metadata.xml8
-rw-r--r--sys-devel/crossdev/Manifest10
-rw-r--r--sys-devel/crossdev/crossdev-20151026-r1.ebuild41
-rw-r--r--sys-devel/crossdev/crossdev-20160602-r1.ebuild38
-rw-r--r--sys-devel/crossdev/crossdev-20160602.ebuild41
-rw-r--r--sys-devel/crossdev/crossdev-99999999.ebuild38
-rw-r--r--sys-devel/crossdev/files/use-new-path-for-functions.sh.patch11
-rw-r--r--sys-devel/crossdev/metadata.xml15
-rw-r--r--sys-devel/ct-ng/Manifest7
-rw-r--r--sys-devel/ct-ng/ct-ng-1.22.0.ebuild31
-rw-r--r--sys-devel/ct-ng/ct-ng-1.23.0.ebuild31
-rw-r--r--sys-devel/ct-ng/metadata.xml21
-rw-r--r--sys-devel/dev86/Manifest12
-rw-r--r--sys-devel/dev86/dev86-0.16.19.ebuild77
-rw-r--r--sys-devel/dev86/dev86-0.16.21-r2.ebuild77
-rw-r--r--sys-devel/dev86/dev86-0.16.21.ebuild76
-rw-r--r--sys-devel/dev86/files/dev86-0.16.19-fortify.patch23
-rw-r--r--sys-devel/dev86/files/dev86-0.16.19-memmove.patch17
-rw-r--r--sys-devel/dev86/files/dev86-0.16.21-non-void-return-clang.patch15
-rw-r--r--sys-devel/dev86/files/dev86-pic.patch20
-rw-r--r--sys-devel/dev86/metadata.xml8
-rw-r--r--sys-devel/distcc/Manifest28
-rw-r--r--sys-devel/distcc/distcc-3.1-r10.ebuild169
-rw-r--r--sys-devel/distcc/distcc-3.2_rc1-r4.ebuild201
-rw-r--r--sys-devel/distcc/distcc-3.2_rc1-r5.ebuild198
-rw-r--r--sys-devel/distcc/files/3.0/conf40
-rw-r--r--sys-devel/distcc/files/3.0/distcc-config122
-rw-r--r--sys-devel/distcc/files/3.1/conf35
-rw-r--r--sys-devel/distcc/files/3.1/init31
-rw-r--r--sys-devel/distcc/files/3.2/conf40
-rw-r--r--sys-devel/distcc/files/3.2/distcc-config180
-rw-r--r--sys-devel/distcc/files/3.2/init31
-rw-r--r--sys-devel/distcc/files/distcc-3.0-fix-fortify.patch11
-rw-r--r--sys-devel/distcc/files/distcc-3.0-xinetd.patch15
-rw-r--r--sys-devel/distcc/files/distcc-3.1-argc-fix.patch17
-rw-r--r--sys-devel/distcc/files/distcc-3.1-freedesktop.patch76
-rw-r--r--sys-devel/distcc/files/distcc-3.1-python.patch258
-rw-r--r--sys-devel/distcc/files/distcc-3.2_rc1-freedesktop.patch79
-rw-r--r--sys-devel/distcc/files/distcc-3.2_rc1-gssapi.patch36
-rw-r--r--sys-devel/distcc/files/distcc-3.2_rc1-python.patch246
-rw-r--r--sys-devel/distcc/files/distcc-3.2_rc1-socks5.patch191
-rw-r--r--sys-devel/distcc/files/distcc-config164
-rw-r--r--sys-devel/distcc/files/distcc-hardened.patch24
-rw-r--r--sys-devel/distcc/files/distccd.service10
-rw-r--r--sys-devel/distcc/files/distccd.service.conf6
-rw-r--r--sys-devel/distcc/metadata.xml16
-rw-r--r--sys-devel/dwz/Manifest5
-rw-r--r--sys-devel/dwz/dwz-0.9.ebuild22
-rw-r--r--sys-devel/dwz/metadata.xml17
-rw-r--r--sys-devel/flex/Manifest11
-rw-r--r--sys-devel/flex/files/flex-2.6.3-reentrant.patch82
-rw-r--r--sys-devel/flex/flex-2.6.1.ebuild77
-rw-r--r--sys-devel/flex/flex-2.6.3-r1.ebuild84
-rw-r--r--sys-devel/flex/flex-2.6.3.ebuild78
-rw-r--r--sys-devel/flex/flex-2.6.4.ebuild81
-rw-r--r--sys-devel/flex/metadata.xml12
-rw-r--r--sys-devel/gcc-apple/Manifest19
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.0.1_p5465-default-altivec.patch38
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch57
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-autoconf-m4-precious.patch12
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-dsymutil.patch20
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs-r1.patch39
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs.patch27
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-texinfo.patch33
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch148
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-perl-5.18.patch11
-rw-r--r--sys-devel/gcc-apple/files/libstdc++-16.patch11
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild375
-rw-r--r--sys-devel/gcc-apple/metadata.xml13
-rw-r--r--sys-devel/gcc-config/Manifest11
-rw-r--r--sys-devel/gcc-config/files/gcc-config-1.8-dont_source_functions_sh_from_etc_initd.patch47
-rw-r--r--sys-devel/gcc-config/gcc-config-1.7.3.ebuild43
-rw-r--r--sys-devel/gcc-config/gcc-config-1.8-r1.ebuild51
-rw-r--r--sys-devel/gcc-config/gcc-config-1.8.ebuild43
-rw-r--r--sys-devel/gcc-config/gcc-config-1.9.0.ebuild47
-rw-r--r--sys-devel/gcc-config/metadata.xml8
-rw-r--r--sys-devel/gcc/Manifest99
-rw-r--r--sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch22
-rw-r--r--sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch40
-rw-r--r--sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch40
-rw-r--r--sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch63
-rw-r--r--sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch40
-rw-r--r--sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch64
-rw-r--r--sys-devel/gcc/files/awk/fixlafiles.awk313
-rw-r--r--sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la334
-rw-r--r--sys-devel/gcc/files/c8920
-rw-r--r--sys-devel/gcc/files/c9921
-rw-r--r--sys-devel/gcc/files/fix_libtool_files.sh66
-rw-r--r--sys-devel/gcc/files/gcc-configure-LANG.patch64
-rw-r--r--sys-devel/gcc/files/gcc-configure-texinfo.patch16
-rw-r--r--sys-devel/gcc/files/gcc-spec-env-r1.patch87
-rw-r--r--sys-devel/gcc/files/gcc-spec-env.patch42
-rw-r--r--sys-devel/gcc/gcc-2.95.3-r10.ebuild34
-rw-r--r--sys-devel/gcc/gcc-3.3.6-r1.ebuild37
-rw-r--r--sys-devel/gcc/gcc-3.4.6-r2.ebuild48
-rw-r--r--sys-devel/gcc/gcc-4.0.4.ebuild15
-rw-r--r--sys-devel/gcc/gcc-4.1.2.ebuild29
-rw-r--r--sys-devel/gcc/gcc-4.2.4-r1.ebuild17
-rw-r--r--sys-devel/gcc/gcc-4.3.6-r1.ebuild28
-rw-r--r--sys-devel/gcc/gcc-4.4.7.ebuild28
-rw-r--r--sys-devel/gcc/gcc-4.5.4.ebuild29
-rw-r--r--sys-devel/gcc/gcc-4.6.4.ebuild30
-rw-r--r--sys-devel/gcc/gcc-4.7.4.ebuild47
-rw-r--r--sys-devel/gcc/gcc-4.8.5.ebuild47
-rw-r--r--sys-devel/gcc/gcc-4.9.4-r1.ebuild47
-rw-r--r--sys-devel/gcc/gcc-4.9.4.ebuild47
-rw-r--r--sys-devel/gcc/gcc-5.4.0-r3.ebuild44
-rw-r--r--sys-devel/gcc/gcc-5.4.0.ebuild44
-rw-r--r--sys-devel/gcc/gcc-6.3.0.ebuild24
-rw-r--r--sys-devel/gcc/gcc-6.4.0.ebuild24
-rw-r--r--sys-devel/gcc/gcc-7.1.0-r1.ebuild24
-rw-r--r--sys-devel/gcc/gcc-7.2.0.ebuild25
-rw-r--r--sys-devel/gcc/metadata.xml40
-rw-r--r--sys-devel/gdb-apple/Manifest26
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1344-darwin8.patch131
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1461-darwin8.patch128
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1461-dyld-info.patch22
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1518-darwin8-9.patch87
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1518-darwin8.patch128
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1518-task_dyld_info.patch22
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-1705-darwin8-10.patch11
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-563-darwin7.patch110
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-563-no-64bit.patch19
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-768-darwin-arch.patch15
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-768-texinfo.patch10
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-962-darwin64.patch17
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-962-darwin8.patch15
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-962-demangle.patch22
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-no-global-gdbinit.patch23
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1461.ebuild66
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1752.ebuild75
-rw-r--r--sys-devel/gdb-apple/gdb-apple-768-r1.ebuild51
-rw-r--r--sys-devel/gdb-apple/gdb-apple-966.ebuild65
-rw-r--r--sys-devel/gdb-apple/metadata.xml8
-rw-r--r--sys-devel/gdb/Manifest14
-rw-r--r--sys-devel/gdb/gdb-7.10.1.ebuild235
-rw-r--r--sys-devel/gdb/gdb-7.12.1.ebuild235
-rw-r--r--sys-devel/gdb/gdb-7.9.1.ebuild221
-rw-r--r--sys-devel/gdb/gdb-8.0.1.ebuild246
-rw-r--r--sys-devel/gdb/gdb-8.0.ebuild242
-rw-r--r--sys-devel/gdb/gdb-9999.ebuild234
-rw-r--r--sys-devel/gdb/metadata.xml19
-rw-r--r--sys-devel/gettext/Manifest6
-rw-r--r--sys-devel/gettext/files/gettext-0.19.7-disable-libintl.patch30
-rw-r--r--sys-devel/gettext/gettext-0.19.8.1.ebuild139
-rw-r--r--sys-devel/gettext/metadata.xml18
-rw-r--r--sys-devel/gnuconfig/Manifest12
-rw-r--r--sys-devel/gnuconfig/files/99999999/0002-Add-x32-support-to-config.guess.patch44
-rw-r--r--sys-devel/gnuconfig/files/99999999/0002-add-ps2-targets-to-config.sub.patch59
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20160402.ebuild65
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20161104.ebuild65
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20170101.ebuild65
-rw-r--r--sys-devel/gnuconfig/gnuconfig-99999999.ebuild65
-rw-r--r--sys-devel/gnuconfig/metadata.xml11
-rw-r--r--sys-devel/heirloom-devtools/Manifest8
-rw-r--r--sys-devel/heirloom-devtools/files/heirloom-devtools-070527-64-bit.patch39
-rw-r--r--sys-devel/heirloom-devtools/files/heirloom-devtools-070527-solaris.patch230
-rw-r--r--sys-devel/heirloom-devtools/heirloom-devtools-070527-r2.ebuild60
-rw-r--r--sys-devel/heirloom-devtools/heirloom-devtools-999999.ebuild63
-rw-r--r--sys-devel/heirloom-devtools/metadata.xml11
-rw-r--r--sys-devel/icecream/Manifest19
-rw-r--r--sys-devel/icecream/files/0.9.6-crosscompile.patch12
-rw-r--r--sys-devel/icecream/files/0.9.6-symlinks.patch19
-rw-r--r--sys-devel/icecream/files/0.9.7-automake.patch32
-rw-r--r--sys-devel/icecream/files/0.9.7-glibc2.16.patch16
-rw-r--r--sys-devel/icecream/files/icecream43
-rw-r--r--sys-devel/icecream/files/icecream-1.0.0-libcap-ng.patch8
-rw-r--r--sys-devel/icecream/files/icecream-conf.d-verbosity.patch18
-rw-r--r--sys-devel/icecream/files/icecream-config69
-rw-r--r--sys-devel/icecream/files/icecream-create-env82
-rw-r--r--sys-devel/icecream/files/icecream-gentoo-multilib.patch59
-rw-r--r--sys-devel/icecream/files/icecream-r244
-rw-r--r--sys-devel/icecream/icecream-0.9.7-r1.ebuild86
-rw-r--r--sys-devel/icecream/icecream-1.0.0-r1.ebuild51
-rw-r--r--sys-devel/icecream/icecream-1.0.0-r2.ebuild69
-rw-r--r--sys-devel/icecream/metadata.xml15
-rw-r--r--sys-devel/kgcc64/Manifest57
-rw-r--r--sys-devel/kgcc64/files/4.1.0/gcc-4.1.0-cross-compile.patch40
-rw-r--r--sys-devel/kgcc64/files/gcc-configure-LANG.patch64
-rw-r--r--sys-devel/kgcc64/files/gcc-configure-texinfo.patch16
-rw-r--r--sys-devel/kgcc64/kgcc64-4.1.2.ebuild52
-rw-r--r--sys-devel/kgcc64/kgcc64-4.2.4.ebuild46
-rw-r--r--sys-devel/kgcc64/kgcc64-4.3.5.ebuild47
-rw-r--r--sys-devel/kgcc64/kgcc64-4.4.5.ebuild53
-rw-r--r--sys-devel/kgcc64/kgcc64-4.4.6.ebuild53
-rw-r--r--sys-devel/kgcc64/kgcc64-4.5.3.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-4.5.4.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-4.6.4.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-4.7.3.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-4.7.4.ebuild61
-rw-r--r--sys-devel/kgcc64/kgcc64-4.8.3.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-4.8.5.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-4.9.4.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-5.4.0.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-6.3.0.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-6.4.0.ebuild54
-rw-r--r--sys-devel/kgcc64/kgcc64-7.2.0.ebuild56
-rw-r--r--sys-devel/kgcc64/metadata.xml11
-rw-r--r--sys-devel/libtool/Manifest20
-rw-r--r--sys-devel/libtool/files/libtool-2.2.10-eprefix.patch11
-rw-r--r--sys-devel/libtool/files/libtool-2.2.6a-darwin-module-bundle.patch24
-rw-r--r--sys-devel/libtool/files/libtool-2.4.3-use-linux-version-in-fbsd.patch38
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-darwin-use-linux-version.patch13
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-libtoolize-delay-help.patch53
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-libtoolize-slow.patch118
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch58
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch54
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-link-specs.patch57
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-mint.patch49
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch111
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch268
-rw-r--r--sys-devel/libtool/libtool-2.4.6-r2.ebuild92
-rw-r--r--sys-devel/libtool/libtool-2.4.6-r3.ebuild93
-rw-r--r--sys-devel/libtool/libtool-2.4.6-r4.ebuild111
-rw-r--r--sys-devel/libtool/libtool-9999.ebuild102
-rw-r--r--sys-devel/libtool/metadata.xml8
-rw-r--r--sys-devel/lld/Manifest12
-rw-r--r--sys-devel/lld/files/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch97
-rw-r--r--sys-devel/lld/files/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch82
-rw-r--r--sys-devel/lld/lld-4.0.1.ebuild76
-rw-r--r--sys-devel/lld/lld-5.0.0.ebuild68
-rw-r--r--sys-devel/lld/lld-5.0.9999.ebuild75
-rw-r--r--sys-devel/lld/lld-9999.ebuild75
-rw-r--r--sys-devel/lld/metadata.xml7
-rw-r--r--sys-devel/llvm-common/Manifest7
-rw-r--r--sys-devel/llvm-common/llvm-common-4.0.1.ebuild29
-rw-r--r--sys-devel/llvm-common/llvm-common-5.0.0.ebuild29
-rw-r--r--sys-devel/llvm-common/llvm-common-5.0.9999.ebuild32
-rw-r--r--sys-devel/llvm-common/llvm-common-9999.ebuild31
-rw-r--r--sys-devel/llvm-common/metadata.xml7
-rw-r--r--sys-devel/llvm/Manifest55
-rw-r--r--sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch54
-rw-r--r--sys-devel/llvm/files/9999/musl-fixes.patch33
-rw-r--r--sys-devel/llvm/llvm-3.4.2-r100.ebuild256
-rw-r--r--sys-devel/llvm/llvm-3.5.2-r100.ebuild276
-rw-r--r--sys-devel/llvm/llvm-3.6.2-r100.ebuild280
-rw-r--r--sys-devel/llvm/llvm-3.7.1-r3.ebuild573
-rw-r--r--sys-devel/llvm/llvm-3.8.1-r2.ebuild578
-rw-r--r--sys-devel/llvm/llvm-3.9.1-r1.ebuild549
-rw-r--r--sys-devel/llvm/llvm-4.0.1.ebuild237
-rw-r--r--sys-devel/llvm/llvm-5.0.0.ebuild237
-rw-r--r--sys-devel/llvm/llvm-5.0.9999.ebuild230
-rw-r--r--sys-devel/llvm/llvm-9999.ebuild236
-rw-r--r--sys-devel/llvm/metadata.xml24
-rw-r--r--sys-devel/llvmgold/Manifest4
-rw-r--r--sys-devel/llvmgold/llvmgold-4.ebuild24
-rw-r--r--sys-devel/llvmgold/llvmgold-5.ebuild24
-rw-r--r--sys-devel/llvmgold/llvmgold-6.ebuild24
-rw-r--r--sys-devel/llvmgold/metadata.xml7
-rw-r--r--sys-devel/m4/Manifest8
-rw-r--r--sys-devel/m4/files/m4-1.4.17-posix_spawn.patch111
-rw-r--r--sys-devel/m4/m4-1.4.17.ebuild54
-rw-r--r--sys-devel/m4/m4-1.4.18.ebuild43
-rw-r--r--sys-devel/m4/metadata.xml8
-rw-r--r--sys-devel/make/Manifest37
-rw-r--r--sys-devel/make/files/3.80-memory.patch77
-rw-r--r--sys-devel/make/files/make-3.80-conditional-eval.patch157
-rw-r--r--sys-devel/make/files/make-3.80-parallel-build-failure.patch59
-rw-r--r--sys-devel/make/files/make-3.81-jobserver.patch19
-rw-r--r--sys-devel/make/files/make-3.81-long-cmdline.patch100
-rw-r--r--sys-devel/make/files/make-3.81-tests-lang.patch55
-rw-r--r--sys-devel/make/files/make-3.81-tests-recursion.patch14
-rw-r--r--sys-devel/make/files/make-3.82-MAKEFLAGS-reexec.patch14
-rw-r--r--sys-devel/make/files/make-3.82-archives-many-objs.patch60
-rw-r--r--sys-devel/make/files/make-3.82-construct-command-line.patch71
-rw-r--r--sys-devel/make/files/make-3.82-copy-on-expand.patch58
-rw-r--r--sys-devel/make/files/make-3.82-darwin-library_search-dylib.patch17
-rw-r--r--sys-devel/make/files/make-3.82-glob-speedup.patch104
-rw-r--r--sys-devel/make/files/make-3.82-intermediate-parallel.patch62
-rw-r--r--sys-devel/make/files/make-3.82-long-command-line.patch54
-rw-r--r--sys-devel/make/files/make-3.82-memory-corruption.patch37
-rw-r--r--sys-devel/make/files/make-3.82-oneshell.patch24
-rw-r--r--sys-devel/make/files/make-3.82-parallel-remake.patch39
-rw-r--r--sys-devel/make/files/make-4.0-char-cast.patch46
-rw-r--r--sys-devel/make/files/make-4.1-fix_null_returns_from_ttyname.patch53
-rw-r--r--sys-devel/make/files/make-4.2-default-cxx.patch13
-rw-r--r--sys-devel/make/make-3.80-r4.ebuild42
-rw-r--r--sys-devel/make/make-3.81-r2.ebuild45
-rw-r--r--sys-devel/make/make-3.82-r4.ebuild50
-rw-r--r--sys-devel/make/make-4.0-r1.ebuild46
-rw-r--r--sys-devel/make/make-4.1-r1.ebuild46
-rw-r--r--sys-devel/make/make-4.2.1-r1.ebuild49
-rw-r--r--sys-devel/make/make-4.2.1.ebuild48
-rw-r--r--sys-devel/make/metadata.xml8
-rw-r--r--sys-devel/metadata.xml38
-rw-r--r--sys-devel/multilib-gcc-wrapper/Manifest4
-rw-r--r--sys-devel/multilib-gcc-wrapper/metadata.xml12
-rw-r--r--sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild71
-rw-r--r--sys-devel/native-cctools/Manifest9
-rw-r--r--sys-devel/native-cctools/files/aix-2/ld138
-rw-r--r--sys-devel/native-cctools/files/aix-2/mkexpfile70
-rw-r--r--sys-devel/native-cctools/files/aix-2/nm6
-rw-r--r--sys-devel/native-cctools/files/ld-aix-1140
-rw-r--r--sys-devel/native-cctools/files/ld-aix-2138
-rw-r--r--sys-devel/native-cctools/metadata.xml8
-rw-r--r--sys-devel/native-cctools/native-cctools-4.ebuild114
-rw-r--r--sys-devel/parity/Manifest11
-rw-r--r--sys-devel/parity/files/parity-1.2.6-debugging.patch17
-rw-r--r--sys-devel/parity/metadata.xml12
-rw-r--r--sys-devel/parity/parity-1.2.4.ebuild57
-rw-r--r--sys-devel/parity/parity-1.2.5.ebuild57
-rw-r--r--sys-devel/parity/parity-1.2.6.ebuild62
-rw-r--r--sys-devel/parity/parity-9999.ebuild67
-rw-r--r--sys-devel/patch/Manifest5
-rw-r--r--sys-devel/patch/metadata.xml8
-rw-r--r--sys-devel/patch/patch-2.7.5.ebuild29
-rw-r--r--sys-devel/pmake/Manifest10
-rw-r--r--sys-devel/pmake/files/pmake-1.111.1-ldflags.patch13
-rw-r--r--sys-devel/pmake/files/pmake-1.98-skipdots.patch12
-rw-r--r--sys-devel/pmake/metadata.xml8
-rw-r--r--sys-devel/pmake/pmake-1.111.3.1.ebuild80
-rw-r--r--sys-devel/pmake/pmake-1.111.3.3.ebuild80
-rw-r--r--sys-devel/prelink/Manifest14
-rw-r--r--sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch61
-rw-r--r--sys-devel/prelink/files/prelink-20130503-prelink-conf.patch39
-rw-r--r--sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch12
-rw-r--r--sys-devel/prelink/files/prelink.confd43
-rw-r--r--sys-devel/prelink/files/prelink.cron61
-rw-r--r--sys-devel/prelink/metadata.xml8
-rw-r--r--sys-devel/prelink/prelink-20130503-r1.ebuild78
-rw-r--r--sys-devel/prelink/prelink-20130503.ebuild83
-rw-r--r--sys-devel/prelink/prelink-20151030.ebuild66
-rw-r--r--sys-devel/qconf/Manifest7
-rw-r--r--sys-devel/qconf/metadata.xml7
-rw-r--r--sys-devel/qconf/qconf-2.0.ebuild50
-rw-r--r--sys-devel/qconf/qconf-2.3.ebuild41
-rw-r--r--sys-devel/remake/Manifest13
-rw-r--r--sys-devel/remake/metadata.xml11
-rw-r--r--sys-devel/remake/remake-3.81.0.2.ebuild22
-rw-r--r--sys-devel/remake/remake-3.81.0.3.ebuild22
-rw-r--r--sys-devel/remake/remake-3.82.0.4.ebuild25
-rw-r--r--sys-devel/remake/remake-3.82.0.9.ebuild26
-rw-r--r--sys-devel/remake/remake-4.1.1.1.ebuild32
-rw-r--r--sys-devel/slibtool/Manifest4
-rw-r--r--sys-devel/slibtool/metadata.xml12
-rw-r--r--sys-devel/slibtool/slibtool-0.5.17.ebuild16
-rw-r--r--sys-devel/smatch/Manifest10
-rw-r--r--sys-devel/smatch/files/smatch-1.57-restrict.patch14
-rw-r--r--sys-devel/smatch/metadata.xml11
-rw-r--r--sys-devel/smatch/smatch-1.57-r1.ebuild54
-rw-r--r--sys-devel/smatch/smatch-1.57.ebuild53
-rw-r--r--sys-devel/smatch/smatch-1.59.ebuild63
-rw-r--r--sys-devel/smatch/smatch-9999.ebuild63
-rw-r--r--sys-devel/sparse/Manifest11
-rw-r--r--sys-devel/sparse/files/sparse-0.4.3-gentoo.patch49
-rw-r--r--sys-devel/sparse/metadata.xml18
-rw-r--r--sys-devel/sparse/sparse-0.4.3.ebuild64
-rw-r--r--sys-devel/sparse/sparse-0.4.4.ebuild46
-rw-r--r--sys-devel/sparse/sparse-0.5.0.ebuild47
-rw-r--r--sys-devel/sparse/sparse-9999.ebuild47
-rw-r--r--sys-devel/systemd-m4/Manifest4
-rw-r--r--sys-devel/systemd-m4/metadata.xml16
-rw-r--r--sys-devel/systemd-m4/systemd-m4-9999.ebuild27
-rw-r--r--sys-devel/ucpp/Manifest6
-rw-r--r--sys-devel/ucpp/metadata.xml12
-rw-r--r--sys-devel/ucpp/ucpp-1.3.4.ebuild27
-rw-r--r--sys-devel/ucpp/ucpp-9999.ebuild31
577 files changed, 37166 insertions, 0 deletions
diff --git a/sys-devel/autoconf-archive/Manifest b/sys-devel/autoconf-archive/Manifest
new file mode 100644
index 000000000000..fb2386806c80
--- /dev/null
+++ b/sys-devel/autoconf-archive/Manifest
@@ -0,0 +1,13 @@
+AUX autoconf-archive-2016.03.20-cxxcpp.patch 3657 SHA256 41ed849388ab64451794e6ff180f53d3137b06529514a65d0e8f9075e641fb79 SHA512 6e5ab9a08e44c08e53aa0ddd8d92262c38e49fdf601e36168a7facc87362b0ff652c4ef2bf07883298c41f600844c12afea24375e7cd444ed13717e8a529d066 WHIRLPOOL 8e813d0b5fab4262503da0db57226dd1068c5430010c8e28350cfc323ae10c4a3a6613b15522742500a6476d475d88ed36c12b4ce7e09b9abc42e50ec5a42729
+AUX autoconf-archive-2016.03.20-include.patch 1803 SHA256 666814600c9d901b1e04f6ff0105aad425200dd4ca908ca8cddd19d7e3d4c197 SHA512 f58af537d2a97a6da30f370f18caa0b678e0fadb8bfb434ce92ff13e280e653e8459ff92af2947aff2183f2b6b76f582087c01d5179c2e34163b731712278878 WHIRLPOOL 522583eb06fbbd8755919d14d20648cf5254506d2065372588b8f662d36ed5550a2206d4560027419bf0b8c893cdede61df0661040e7fd865b7c780edf74f5e5
+DIST autoconf-archive-2016.03.20.tar.xz 613612 SHA256 88fb2efff640eddd28a52ae550ff5561bca3bd2bba09e1d7b0580e719875e437 SHA512 194d639d82a3377cdaf843c4a49d3ce3843ea37499b169124ddd2fca1800c0a559e27087a062109482b22f68b30f25ebb6da4b769eb6174d6e781162c83703b3 WHIRLPOOL 4121ea032bb0708d3d231cb5f11d539b68fe9533fbea8a30ef4a32446c2f9c2b11404c8160a528b1cbc642054830bc4ba6cfc0bc8d277adafbf1975c3a6dd2f3
+DIST autoconf-archive-2016.09.16.tar.xz 624536 SHA256 e8f2efd235f842bad2f6938bf4a72240a5e5fcd248e8444335e63beb60fabd82 SHA512 968fe6c274cfa804526b571c5c9e83e882103c8bfe52741c421bad0f216dd80c0de959db33b8e26d75ca11096b9f36f7d00468d7a6de400920b9a2eacfb91495 WHIRLPOOL 3d0e5fe15080f7fc75c84b17a76947b9e63613ab4a2bcdbf84da29d80e8cbf1e30e0f0b0b8060b4c03c1bde287caeaae1ffc19e49cda20891985c9b4e2cb1f2d
+DIST autoconf-archive-2017.03.21.tar.xz 633132 SHA256 386ad455f12bdeb3a7d19280441a5ab77355142349200ff11040a8d9d455d765 SHA512 826233fcdd0cb5a1fe18bd52477e3a8afcaf8719ea376b3be0864df6b481f0fef8fd8083485b1565a14c13ad64dbc0ae93149a62e16da9a4d24db8063120cc3a WHIRLPOOL 84cdbcd48745b2774fc740d10b31c628df160d1fec35bcc2439db1b93328fc91417f0c1371b6c4b90d4aa9def2d60f7b61b14e2de57da56517a1b710b03ce6c0
+DIST autoconf-archive-2017.09.28.tar.xz 645388 SHA256 5c9fb5845b38b28982a3ef12836f76b35f46799ef4a2e46b48e2bd3c6182fa01 SHA512 2aa271fdd67fa3caf20e07eb8332d88f7008eefe1df447980d42cb2104313d99947b94ffdb0f6f4b4c8156cfc73d9e0b6c27a5f133c6b73787ef641d9951be90 WHIRLPOOL ae63070d3ff990da6a568e22ab0462f21addeb1f32bd66f1cf1084ea0466ba0cdd100871d1a448b1cbe3e94f8009fd74094ff8fe99be167a9d7ece7f7c0caafd
+EBUILD autoconf-archive-2016.03.20-r1.ebuild 771 SHA256 cc9f9357496cdc936c71ab19a5dfe6ab8f91613a572df4fe3a8eb768935a1739 SHA512 3389dbf76b58e91adbfa55e13c2f2c86d6451765bed33e8eec11e6bf2c2a2a57d1b0a749530f73a55ac0df7af0aff47ca93ae97450add7641ddeceed6e4de700 WHIRLPOOL 8b16271f32e17d6af1eb4fe862868456707b6877a7088244db89be27471cdececfed000f93bdd1a369548f21697714c375d8157cdb088256c244b6e8737a726f
+EBUILD autoconf-archive-2016.09.16.ebuild 700 SHA256 c7fb972f19d9c4d7d10a8ea5889a9ba23e485dca00c81578d2377374dbfdc428 SHA512 fb129a0026a8799b56676f65b03042add5509ae5bb9c08c6c43b41f9e6a5f4ac9e7584c4e98d22dba41494b7201c8de61c3094ff3035ab245b3f67371720c21b WHIRLPOOL c48ccda759fbbb4a9a3b0b7af0e0c5296aa6660dac0fe884ab6e53e7c7155706ff2605c13f8d0ccf4f94e1ac7031e90407ad90ca02ffd843c4effbdce95b23ee
+EBUILD autoconf-archive-2017.03.21.ebuild 700 SHA256 c7fb972f19d9c4d7d10a8ea5889a9ba23e485dca00c81578d2377374dbfdc428 SHA512 fb129a0026a8799b56676f65b03042add5509ae5bb9c08c6c43b41f9e6a5f4ac9e7584c4e98d22dba41494b7201c8de61c3094ff3035ab245b3f67371720c21b WHIRLPOOL c48ccda759fbbb4a9a3b0b7af0e0c5296aa6660dac0fe884ab6e53e7c7155706ff2605c13f8d0ccf4f94e1ac7031e90407ad90ca02ffd843c4effbdce95b23ee
+EBUILD autoconf-archive-2017.09.28.ebuild 700 SHA256 c7fb972f19d9c4d7d10a8ea5889a9ba23e485dca00c81578d2377374dbfdc428 SHA512 fb129a0026a8799b56676f65b03042add5509ae5bb9c08c6c43b41f9e6a5f4ac9e7584c4e98d22dba41494b7201c8de61c3094ff3035ab245b3f67371720c21b WHIRLPOOL c48ccda759fbbb4a9a3b0b7af0e0c5296aa6660dac0fe884ab6e53e7c7155706ff2605c13f8d0ccf4f94e1ac7031e90407ad90ca02ffd843c4effbdce95b23ee
+MISC ChangeLog 6420 SHA256 051d38a52ee4583c6dbd85324468ff61b3e7beee2593b78f1a6d2801fc9f0bd7 SHA512 bd1be4b6f864ad2cde39aec41802aa3c1454815cb43e2e8f207e0d9074ef5d3c34f0671166c7d4efab02146fe51432cbcabca071373c1168fdd575229c64e0a4 WHIRLPOOL 0e59b74e9886df9f69a683ae80283458de362ec8765ac12e0babe7869c64d65d1bf12cdb040678c4993fa9e163895adfd310be741c4092d4ab02d7a6debe3f8f
+MISC ChangeLog-2015 12464 SHA256 f458fca2f9c58b439a222cf5292f379b06ddb0415a1830e2b49e2a6d6780a49c SHA512 2eab19d82976cf6fc308bc0301d2432cb185b800d16c9de10f5a3ec8d0ce289fba1ca0b6826a473bc267af1c5a476d29e6afeb9bd6b28031874a6c9668a350a2 WHIRLPOOL 46d27043d84b98dd33901be89990bdbe9d7892b9e7aa47dfd6bddbad2e5e1f9227a2c9409241e4687fcb71b833fe9eaad28719f5281c7e719c48eedc87d0813d
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2016.03.20-r1.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2016.03.20-r1.ebuild
new file mode 100644
index 000000000000..497b2bb6e634
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2016.03.20-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="https://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+# File collisions. #540246
+RDEPEND="!=gnome-base/gnome-common-3.14.0
+ !>=gnome-base/gnome-common-3.14.0-r1[-autoconf-archive(+)]"
+DEPEND=""
+
+PATCHES=(
+ "${FILESDIR}"/${P}-cxxcpp.patch #581346
+ "${FILESDIR}"/${P}-include.patch #581346
+)
+
+src_install() {
+ default
+ rm -r "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2016.09.16.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2016.09.16.ebuild
new file mode 100644
index 000000000000..253381968955
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2016.09.16.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="https://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+# File collisions. #540246
+RDEPEND="!=gnome-base/gnome-common-3.14.0
+ !>=gnome-base/gnome-common-3.14.0-r1[-autoconf-archive(+)]"
+DEPEND=""
+
+src_install() {
+ default
+ rm -r "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2017.03.21.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2017.03.21.ebuild
new file mode 100644
index 000000000000..253381968955
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2017.03.21.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="https://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+# File collisions. #540246
+RDEPEND="!=gnome-base/gnome-common-3.14.0
+ !>=gnome-base/gnome-common-3.14.0-r1[-autoconf-archive(+)]"
+DEPEND=""
+
+src_install() {
+ default
+ rm -r "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2017.09.28.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2017.09.28.ebuild
new file mode 100644
index 000000000000..253381968955
--- /dev/null
+++ b/sys-devel/autoconf-archive/autoconf-archive-2017.09.28.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+DESCRIPTION="GNU Autoconf Macro Archive"
+HOMEPAGE="https://www.gnu.org/software/autoconf-archive/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+# File collisions. #540246
+RDEPEND="!=gnome-base/gnome-common-3.14.0
+ !>=gnome-base/gnome-common-3.14.0-r1[-autoconf-archive(+)]"
+DEPEND=""
+
+src_install() {
+ default
+ rm -r "${ED}/usr/share/${PN}" || die
+}
diff --git a/sys-devel/autoconf-archive/files/autoconf-archive-2016.03.20-cxxcpp.patch b/sys-devel/autoconf-archive/files/autoconf-archive-2016.03.20-cxxcpp.patch
new file mode 100644
index 000000000000..c42a655302c1
--- /dev/null
+++ b/sys-devel/autoconf-archive/files/autoconf-archive-2016.03.20-cxxcpp.patch
@@ -0,0 +1,111 @@
+https://bugs.gentoo.org/581346
+
+From 34104ea9e635fae5551fd1d6495a80f8041c4adc Mon Sep 17 00:00:00 2001
+From: "Enrico M. Crisostomo" <enrico.m.crisostomo@gmail.com>
+Date: Sun, 20 Mar 2016 14:17:15 +0100
+Subject: [PATCH] Update CXXCPP after updating CXX.
+
+Rewrap text.
+
+Rewrap.
+---
+ m4/ax_cxx_compile_stdcxx.m4 | 14 ++++++++++----
+ m4/ax_cxx_compile_stdcxx_11.m4 | 5 +++--
+ m4/ax_cxx_compile_stdcxx_14.m4 | 5 +++--
+ 3 files changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4
+index 8adc765..2c18e49 100644
+--- a/m4/ax_cxx_compile_stdcxx.m4
++++ b/m4/ax_cxx_compile_stdcxx.m4
+@@ -9,9 +9,9 @@
+ # DESCRIPTION
+ #
+ # Check for baseline language coverage in the compiler for the specified
+-# version of the C++ standard. If necessary, add switches to CXX to
+-# enable support. VERSION may be '11' (for the C++11 standard) or '14'
+-# (for the C++14 standard).
++# version of the C++ standard. If necessary, add switches to CXX and
++# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
++# or '14' (for the C++14 standard).
+ #
+ # The second argument, if specified, indicates whether you insist on an
+ # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
+@@ -39,7 +39,7 @@
+ # and this notice are preserved. This file is offered as-is, without any
+ # warranty.
+
+-#serial 3
++#serial 4
+
+ dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
+ dnl (serial version number 13).
+@@ -82,6 +82,9 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
+ CXX="$ac_save_CXX"])
+ if eval test x\$$cachevar = xyes; then
+ CXX="$CXX $switch"
++ if test -n "$CXXCPP" ; then
++ CXXCPP="$CXXCPP $switch"
++ fi
+ ac_success=yes
+ break
+ fi
+@@ -105,6 +108,9 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
+ CXX="$ac_save_CXX"])
+ if eval test x\$$cachevar = xyes; then
+ CXX="$CXX $switch"
++ if test -n "$CXXCPP" ; then
++ CXXCPP="$CXXCPP $switch"
++ fi
+ ac_success=yes
+ break
+ fi
+diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4
+index b3d4bfd..3dd5cf9 100644
+--- a/m4/ax_cxx_compile_stdcxx_11.m4
++++ b/m4/ax_cxx_compile_stdcxx_11.m4
+@@ -9,7 +9,8 @@
+ # DESCRIPTION
+ #
+ # Check for baseline language coverage in the compiler for the C++11
+-# standard; if necessary, add switches to CXX to enable support.
++# standard; if necessary, add switches to CXX and CXXCPP to enable
++# support.
+ #
+ # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
+ # macro with the version set to C++11. The two optional arguments are
+@@ -32,7 +33,7 @@
+ # and this notice are preserved. This file is offered as-is, without any
+ # warranty.
+
+-#serial 15
++#serial 16
+
+ include([ax_cxx_compile_stdcxx.m4])
+
+diff --git a/m4/ax_cxx_compile_stdcxx_14.m4 b/m4/ax_cxx_compile_stdcxx_14.m4
+index 741accf..6d2123a 100644
+--- a/m4/ax_cxx_compile_stdcxx_14.m4
++++ b/m4/ax_cxx_compile_stdcxx_14.m4
+@@ -9,7 +9,8 @@
+ # DESCRIPTION
+ #
+ # Check for baseline language coverage in the compiler for the C++14
+-# standard; if necessary, add switches to CXX to enable support.
++# standard; if necessary, add switches to CXX and CXXCPP to enable
++# support.
+ #
+ # This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
+ # macro with the version set to C++14. The two optional arguments are
+@@ -27,7 +28,7 @@
+ # and this notice are preserved. This file is offered as-is, without any
+ # warranty.
+
+-#serial 2
++#serial 3
+
+ include([ax_cxx_compile_stdcxx.m4])
+
+--
+2.8.2
+
diff --git a/sys-devel/autoconf-archive/files/autoconf-archive-2016.03.20-include.patch b/sys-devel/autoconf-archive/files/autoconf-archive-2016.03.20-include.patch
new file mode 100644
index 000000000000..4ba295ea1845
--- /dev/null
+++ b/sys-devel/autoconf-archive/files/autoconf-archive-2016.03.20-include.patch
@@ -0,0 +1,54 @@
+https://bugs.gentoo.org/581346
+
+From d343892fbd0605a9375ff1ae0467aa320a404b12 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 7 May 2016 19:41:40 -0400
+Subject: [PATCH] fix include errors w/AX_CXX_COMPILE_STDCXX_1[14]
+
+The search path for `include` is the current working directory, so trying
+to include other m4 files directly only works if they live in the same dir
+as where you're running `aclocal`. Otherwise we end up with errors like:
+ $ cd lcd4linux-0.10.1-RC2
+ $ aclocal
+ /usr/share/aclocal/ax_cxx_compile_stdcxx_14.m4:32: file 'ax_cxx_compile_stdcxx.m4' does not exist
+
+Use the AX_REQUIRE_DEFINED macro instead to make sure the macro we want
+exists.
+---
+ m4/ax_cxx_compile_stdcxx_11.m4 | 5 ++---
+ m4/ax_cxx_compile_stdcxx_14.m4 | 5 ++---
+ 2 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4
+index 3dd5cf9..0aadeaf 100644
+--- a/m4/ax_cxx_compile_stdcxx_11.m4
++++ b/m4/ax_cxx_compile_stdcxx_11.m4
+@@ -33,8 +33,7 @@
+ # and this notice are preserved. This file is offered as-is, without any
+ # warranty.
+
+-#serial 16
+-
+-include([ax_cxx_compile_stdcxx.m4])
++#serial 17
+
++AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
+ AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])])
+diff --git a/m4/ax_cxx_compile_stdcxx_14.m4 b/m4/ax_cxx_compile_stdcxx_14.m4
+index 6d2123a..51123f2 100644
+--- a/m4/ax_cxx_compile_stdcxx_14.m4
++++ b/m4/ax_cxx_compile_stdcxx_14.m4
+@@ -28,8 +28,7 @@
+ # and this notice are preserved. This file is offered as-is, without any
+ # warranty.
+
+-#serial 3
+-
+-include([ax_cxx_compile_stdcxx.m4])
++#serial 4
+
++AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
+ AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])])
+--
+2.8.2
+
diff --git a/sys-devel/autoconf-archive/metadata.xml b/sys-devel/autoconf-archive/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/autoconf-archive/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/autoconf-wrapper/Manifest b/sys-devel/autoconf-wrapper/Manifest
new file mode 100644
index 000000000000..8e57c1027982
--- /dev/null
+++ b/sys-devel/autoconf-wrapper/Manifest
@@ -0,0 +1,5 @@
+AUX ac-wrapper-13.sh 5044 SHA256 75f7685486e1387f45f3bc72351007a472ad064457ef691206b5bcb850ae20e6 SHA512 06fa8f1a812eac11ccf4a90ceba882a1bd6f2724c7ea9f8a9ad95d6c4009d7389a06ce6ddfed928a981112309cb2c1ea4358fb17b7f81e3ac0f4be25a37bb7d9 WHIRLPOOL 2c26eb9429363fad91c3c140c43c6e2f38f15fdd5d36bcf423ce1584939e5b011c88d3c0817560520cb58725a2c4d47e774810ae703e842d59cba70c518ed7a4
+EBUILD autoconf-wrapper-13.ebuild 844 SHA256 60bbddff3c8bc262783debee76e6c6e53da81d420cbc46bb2a8bb8961bf75da0 SHA512 fab674d043971f5f813ecb357227f95f43b076d119449ca245e8c8a0ae5b117a50b7ec14e034cd35ea2379e8e08be97bad23eda4afdfff6eede879583c124c10 WHIRLPOOL b760116f415b9d5eef5c35507718ce816324018e895a9e30b5f88a40a798bf9e903a22443f0556d457fe48c3eeb81fd4ea239cb587f6aa224825c6fb38628c3c
+MISC ChangeLog 3128 SHA256 c12446e9d5c20ba33cce0c6c10432145f4e870b633b2c38e2e083fd3cb837943 SHA512 f7fb823c0b2f371927fbd094c2f901090d00be21ef8e3be92ea8c9908044c1664bc5a2bc99adf2dbfd47585bf8dfddfdd2b8c3f0162c0cd1bf605ed030d8b07f WHIRLPOOL 0f50c302e7cedd3909deacf8b90ae56c242e70885f49a4c614beedfca95bba0b6b6b4640e9e7b9d354cd0ade01a2d6d095df915bd6f5046224091a30c11d5761
+MISC ChangeLog-2015 14841 SHA256 2d57212c23ce64cff438a8a89ad0439de04ca13360f6db84c42f54af5ffbf5c5 SHA512 5b7cb3fdc23dc35598a6bd477ef98ede05e99bcf4902765aff16f13eab95f83648e2dab39c716ad0ed78c4c73e6c63aa7b8ef20b048399a3376425705862d76d WHIRLPOOL 43d31852e32e3ce53661f5c6fbafa7559ee673b46dcb97c892e4eba2b13b34e947533726e3ab5ded9f6e1986cea8c2c1e62d8eb33c9070f6107e5de0e4f05d48
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/autoconf-wrapper/autoconf-wrapper-13.ebuild b/sys-devel/autoconf-wrapper/autoconf-wrapper-13.ebuild
new file mode 100644
index 000000000000..78f9d1d63ccf
--- /dev/null
+++ b/sys-devel/autoconf-wrapper/autoconf-wrapper-13.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit multilib
+
+DESCRIPTION="wrapper for autoconf to manage multiple autoconf versions"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+S=${WORKDIR}
+
+src_install() {
+ exeinto /usr/$(get_libdir)/misc
+ newexe "${FILESDIR}"/ac-wrapper-${PV}.sh ac-wrapper.sh || die
+
+ dodir /usr/bin
+ local x=
+ for x in auto{conf,header,m4te,reconf,scan,update} ifnames ; do
+ dosym ../$(get_libdir)/misc/ac-wrapper.sh /usr/bin/${x} || die
+ done
+}
diff --git a/sys-devel/autoconf-wrapper/files/ac-wrapper-13.sh b/sys-devel/autoconf-wrapper/files/ac-wrapper-13.sh
new file mode 100644
index 000000000000..d4324cf73022
--- /dev/null
+++ b/sys-devel/autoconf-wrapper/files/ac-wrapper-13.sh
@@ -0,0 +1,201 @@
+#!/bin/sh
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Based on the ac-wrapper.pl script provided by MandrakeSoft
+# Rewritten in bash by Gregorio Guidi
+#
+# Executes the correct autoconf version.
+#
+# - defaults to newest version available (hopefully autoconf-2.60)
+# - runs autoconf 2.13 if:
+# - envvar WANT_AUTOCONF is set to `2.1'
+# -or-
+# - `ac{local,include}.m4' or `configure.{in,ac}' have AC_PREREQ(2.1) (not higher)
+# -or-
+# - `configure' is already present and was generated by autoconf 2.13
+
+warn() { printf "ac-wrapper: $*\n" 1>&2; }
+err() { warn "$@"; exit 1; }
+unset IFS
+which() {
+ local p
+ IFS=: # we don't use IFS anywhere, so don't bother saving/restoring
+ for p in ${PATH} ; do
+ p="${p}/$1"
+ [ -e "${p}" ] && echo "${p}" && return 0
+ done
+ unset IFS
+ return 1
+}
+
+#
+# Sanitize argv[0] since it isn't always a full path #385201
+#
+argv0=${0##*/}
+case ${0} in
+ ${argv0})
+ # find it in PATH
+ if ! full_argv0=$(which "${argv0}") ; then
+ err "could not locate ${argv0}; file a bug"
+ fi
+ ;;
+ *)
+ # re-use full/relative paths
+ full_argv0=$0
+ ;;
+esac
+
+if [ "${argv0}" = "ac-wrapper.sh" ] ; then
+ err "Don't call this script directly"
+fi
+
+if [ "${WANT_AUTOCONF}" = "2.1" ] && [ "${argv0}" = "autom4te" ] ; then
+ err "Autoconf 2.13 doesn't contain autom4te.\n" \
+ " Either unset WANT_AUTOCONF or don't execute anything\n" \
+ " that would use autom4te."
+fi
+
+if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
+ seq() {
+ local f l i
+ case $# in
+ 1) f=1 i=1 l=$1;;
+ 2) f=$1 i=1 l=$2;;
+ 3) f=$1 i=$2 l=$3;;
+ esac
+ while :; do
+ [ $l -lt $f -a $i -gt 0 ] && break
+ [ $f -lt $l -a $i -lt 0 ] && break
+ echo $f
+ : $(( f += i ))
+ done
+ return 0
+ }
+fi
+
+#
+# Set up bindings between actual version and WANT_AUTOCONF;
+# Start at last known unstable/stable versions to speed up lookup process.
+#
+KNOWN_AUTOCONF="2.69:2.5 2.68:2.5"
+vers="${KNOWN_AUTOCONF} 9999:2.5 $(printf '2.%s:2.5 ' `seq 99 -1 59`) 2.13:2.1"
+
+binary=""
+for v in ${vers} ; do
+ auto_ver=${v%:*}
+ if [ -z "${binary}" ] && [ -x "${full_argv0}-${auto_ver}" ] ; then
+ binary="${full_argv0}-${auto_ver}"
+ break
+ fi
+done
+if [ -z "${binary}" ] ; then
+ err "Unable to locate any usuable version of autoconf.\n" \
+ "\tI tried these versions: ${vers}\n" \
+ "\tWith a base name of '${full_argv0}'."
+fi
+
+#
+# Check the WANT_AUTOCONF setting. We accept a whitespace delimited
+# list of autoconf versions.
+#
+if [ -n "${WANT_AUTOCONF}" ] ; then
+ for v in ${vers} x ; do
+ if [ "${v}" = "x" ] ; then
+ warn "warning: invalid WANT_AUTOCONF '${WANT_AUTOCONF}'; ignoring."
+ unset WANT_AUTOCONF
+ break
+ fi
+
+ auto_ver=${v%:*}
+ want_ver=${v#*:}
+ for wx in ${WANT_AUTOCONF} ; do
+ if [ -x "${full_argv0}-${wx}" ] ; then
+ binary="${full_argv0}-${wx}"
+ v="x"
+ elif [ "${wx}" = "${want_ver}" ] && [ -x "${full_argv0}-${auto_ver}" ] ; then
+ binary="${full_argv0}-${auto_ver}"
+ v="x"
+ fi
+ done
+ [ "${v}" = "x" ] && break
+ done
+fi
+
+#
+# autodetect helpers
+#
+acprereq_version() {
+ sed -n -r \
+ -e '/^\s*(#|dnl)/d' \
+ -e '/AC_PREREQ/s:.*AC_PREREQ\s*\(\[?\s*([0-9.]+)\s*\]?\):\1:p' \
+ "$@" |
+ LC_ALL=C sort -n -t . |
+ tail -1
+}
+
+generated_version() {
+ local re='^# Generated (by (GNU )?Autoconf|automatically using autoconf version) ([0-9.]+).*'
+ sed -n -r "/${re}/{s:${re}:\3:;p;q}" "$@"
+}
+
+#
+# autodetect routine
+#
+if [ "${WANT_AUTOCONF}" = "2.1" ] && [ -f "configure.ac" ] ; then
+ err "Since configure.ac is present, aclocal always use\n" \
+ "\tautoconf 2.59+, which conflicts with your choice and\n" \
+ "\tcauses error. You have two options:\n" \
+ "\t1. Try execute command again after removing configure.ac\n" \
+ "\t2. Don't set WANT_AUTOCONF"
+fi
+
+if [ "${WANT_AUTOCONF:-2.1}" = "2.1" ] && [ -n "${WANT_AUTOMAKE}" ] ; then
+ # Automake-1.7 and better require autoconf-2.5x so if WANT_AUTOMAKE
+ # is set to an older version, let's do some sanity checks.
+ case "${WANT_AUTOMAKE}" in
+ 1.[456])
+ acfiles=$(ls ac{local,include}.m4 configure.{in,ac} 2>/dev/null)
+ [ -n "${acfiles}" ] && confversion=$(acprereq_version ${acfiles})
+
+ [ -z "${confversion}" ] && [ -r "configure" ] \
+ && confversion=$(generated_version configure)
+
+ if [ "${confversion}" = "2.1" ] && [ ! -f "configure.ac" ] ; then
+ binary="${full_argv0}-2.13"
+ fi
+ esac
+fi
+
+if [ -n "${WANT_ACWRAPPER_DEBUG}" ] ; then
+ if [ -n "${WANT_AUTOCONF}" ] ; then
+ warn "DEBUG: WANT_AUTOCONF is set to ${WANT_AUTOCONF}"
+ fi
+ warn "DEBUG: will execute <${binary}>"
+fi
+
+#
+# for further consistency
+#
+if [ -z "${WANT_AUTOCONF}" ] ; then
+ for v in ${vers} ; do
+ auto_ver=${v%:*}
+ want_ver=${v#*:}
+ if [ "${binary}" = "${full_argv0}-${auto_ver}" ] ; then
+ export WANT_AUTOCONF="${want_ver}"
+ break
+ fi
+ done
+fi
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+ # this shouldn't happen
+ err "${binary} is missing or not executable.\n" \
+ "\tPlease try emerging the correct version of autoconf."
+fi
+
+exec "${binary}" "$@"
+# The shell will error out if `exec` failed.
diff --git a/sys-devel/autoconf-wrapper/metadata.xml b/sys-devel/autoconf-wrapper/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/autoconf-wrapper/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/autoconf/Manifest b/sys-devel/autoconf/Manifest
new file mode 100644
index 000000000000..44c5cecd7c88
--- /dev/null
+++ b/sys-devel/autoconf/Manifest
@@ -0,0 +1,39 @@
+AUX autoconf-2.13-destdir.patch 677 SHA256 67c3eaf2f8aaf3acbcff387bc3fc6d46688b56a6b51043344e301bfaf16186a0 SHA512 eeb9619bdc365fb3877b816e30192fb235b8c7fed9e810da0382363141abd9b5df217cda31a7dd1eb51d6310714412709fc830fdaac55a6ccfcfd8335f752c54 WHIRLPOOL eb39bea4db9e92a1f4329502777051cc1ba31e3c70e93c7482cd8b266674996307b71e09677fa3f0763b91b70c69b66a2a3a06b0f3fe182a87a6d864d877b26a
+AUX autoconf-2.13-gentoo.patch 898 SHA256 5d6a4b9d8d789684b44addf565200a90ee92140d58bebf087373ae82c4d89ea8 SHA512 8195ea24bd1fbcba20cd09de12dc90879a3d6e2877179d43830abdca6c68148c2bd611b1d3919777304945a08e0d939aa868bb689558515af6b0b10524f16e5c WHIRLPOOL aaba69e3f2450309abd27e578f7ae26986bf288f623a821219a78ddddd68504fc880624bbb911adb55c15cd7673daa3fe35fb840729495f23a1960d41edcea0f
+AUX autoconf-2.13-test-fixes.patch 547 SHA256 43929d95e6050642385530df91084d4c073cec5cca727918d5ff84bc1e3059f5 SHA512 085e7525c66e710b42dcb068c8aeda89488d1e926e493bcab74e1a1440f53f67630d6998a2a9eff6dc65cf8f71cad19127d541422b51a2519163b51ba78ae592 WHIRLPOOL 8d4865e93cca21cfb6735996cd6e7e920bb3131ea45c63398cefe7c8aca40d6611f1a8142f8c4bdc153c5894200637e4c2a705a26535d3214067a487969b17d4
+AUX autoconf-2.59-more-quotes.patch 1223 SHA256 0bd6d00b2f77e89684ed7305c3821090950fcc6407ab045fd3ace91ac0b19abd SHA512 8736ba977b80f78a291837377435d2c9f2ede4bbe56acbeeed0951cc36961c510c792bb87973d1bf26d6f6cb9949bafd5a56f80728198a18b85ad8e500a06cda WHIRLPOOL c3d673fc4c3909202721e2e4a69cec391608028dba533cd43bd904742122871f59f9ee2d6d96f86219ce3085c749f695404b6d94c63eb5c21c598533d9111854
+AUX autoconf-2.61-GETMNTENT.patch 909 SHA256 28b5ea16cad98460e7920456365068d171c1ce1f50b2582c4f393e83e9421d09 SHA512 64760743ebb25a7a1e9de79bafebf6f22098e14b311107f3f662e60601f45c15b6296f48eee87efa572041b1d69b8a484286550b84d6937e511befa1f00ab2a6 WHIRLPOOL 27f0510299058f3e02413c48b5dbde535211cadb94404804ed4b1914154c306423c7566605bc14d2e6f002b4aa2894a04b08308620f0d92fe3d0cfc92ca43978
+AUX autoconf-2.61-darwin.patch 450 SHA256 b35fcf7ea04a4198f659d60ff8b7cd8d449afe4abfab55d45ea2013ebe35fba1 SHA512 b698bb51a1264ce92cced79906926a473d37eaf7dcf5d6d599c6c6012910391933e19a7a436cd0c93f817f56f6749006777bb914648eab8da96ecca0c1e2cfd1 WHIRLPOOL 7f20f4034b02e488c1c2e40b64c760eb5c666328da34409a70fb615606c658c7222a05a926e8464d9661052a5529b2a9e099f9adc53dd25f900669fdd059034a
+AUX autoconf-2.62-at-keywords.patch 2857 SHA256 dea4a6caef01566f252ce71c6fb9b5aff07faa918925c10a2c5a7b4b68f1c2a9 SHA512 5cd214d51b9157377850a9a8a2e8338352828c0edb0e0e2ffb50f6439d1fac580202a8a02f0e461f6311a27d5ff52d4d86f2146ee7fef1b07b700f253a0a6152 WHIRLPOOL 0c85f92810afe53912bbb1f6a8a3be2176e0c710a8d1b4af85c85d898fc307998f788fe3547d966b43fe2734cea06e6fc0f464c07070018cf510cfa98ef671a4
+AUX autoconf-2.62-fix-multiline-string.patch 1040 SHA256 853bf209c69610d5a9f95dc6637342651eacdfe7255198228c2995fca2c4fb36 SHA512 0f4ff3d2121ed05881d7e8cc3546340abdec80b0184ca7e7d115e507d52943997564ad699c3b4ed90fb38087e8a8ebd8f48638339e7b175efc4b25ad02ecc7ee WHIRLPOOL c21cfddf7569bd1a7a601b42ec9b636892bac5a08a05a5af5d06a5222e54006759cef026c3741cddfc83586f36ca1ee985e35f9bb53753360357e4ab5dccb570
+AUX autoconf-2.62-revert-AC_C_BIGENDIAN.patch 7040 SHA256 5dcd1437891ad33ce81219b27429f94ff56ad7216b7b707427ae028bdc60f610 SHA512 3ded7bbdd4ca3443457f0aad7aa8324f1825f155cf43a3bffb3a018653aeeb30404884e42d0abeaf6c3456e1c6aeb19add87d192237111beefed796063461f51 WHIRLPOOL 5b2ceb97d35218e1698f74a0d72cfe13d8365c01cb3f98b4378ab5f0a757e8456bedfae17d00b53a8c03e5693b9660aa3d9f8a56957ae81530859b082e1e6502
+AUX autoconf-2.63-sh.patch 1224 SHA256 1b236cd09c14f5f74eddcb12b001db9c51c624e57f13fe627085d02ed67c0809 SHA512 c82a75c5f04f86f05254150f31c001152feeaf56f5aa662d8df05e6efc1ab751b5d353aa0e4b56ca0de8034cb4bee8283e9ab68977094e04225f06985d3bd539 WHIRLPOOL 4a63c1604883531764c9cf844ea285e7846914409f1b5fb61c83d7fbda73c12d0e69d6ff1ffe5a655e7876eb719235dff5e71dafa4619d35554578901392c084
+AUX autoconf-2.65-AC_TYPE_INT_T.patch 1760 SHA256 b9007a68db2b791ccea64b5f9984b11a38bc7a86c41ae2961293aebf18865bfc SHA512 30bd03debaf74c21f435da00f399a7e1bdcd6e661a7565d240793353507f949cc60b9a31bd2a5f53ba3a909d0171f4afa407f20888e4ff23e5962a5ddbb612c7 WHIRLPOOL 1bd8f1b7cdb892978d898f55d8fb079706719db58d8e7cd67cfbb8741ade271377a8b04a5027d4f0d37759501f467984743f267ee2d7332304f3be60e5c298bc
+AUX autoconf-2.69-fix-libtool-test.patch 1093 SHA256 7793209b33013dc0f81208718c68440c5aae80e7a1c4b8d336e382525af791a7 SHA512 38506631fdde1f80a3467673e6fb48d4751323462c1657c85e2b5289e1219ef236ed9af3a66906c8851a62c244c1ffed70537a5f1421539429a9aa04e929d727 WHIRLPOOL 971c9fb8ddf928c3d644cb503c1e2e774c49c9b50a8d9e8920724300b8647a93932b910d523d8f1cb9738bf67ee0b4aac8f755bfc4e801ce3a260f7cf7deb170
+AUX autoconf-2.69-perl-5.26-2.patch 1003 SHA256 a49dd5bac3b62daa0ff688ab4d508d71dbd2f4f8d7e2a02321926346161bf3ee SHA512 b02086ac8a468a626d8b6506aa14e19ef10e4d33b91a7647f74d5746cce9f690d6cf5840ea81c593f63e8f94275974f31c8695065844380678e83153c1b547d0 WHIRLPOOL 3b73fcbc8772ffe63c9edf77ec0ef2dbd434fb3dfeee31d246a0fd9ac78cdb2b2047ee0c029ac76b3958c16e26e42831ab79d9105234835812aaa24b2ba51f38
+AUX autoconf-2.69-perl-5.26.patch 820 SHA256 35c449281546376449766f92d49fc121ca50e330e60fefcfc9be2af3253082c2 SHA512 0202c099b85102dab18ad7d4268b836cadf587d0a48aefa386e70539b3b689fd580053d7287730f1d0a9cc97d6eeb41c1579a181a82a5cb2e04e436bb96d0b20 WHIRLPOOL 9cfe2da579d0b31a61780541be7ae8a5469ff30c15698295e47a05ffd23cc415151322dfac1a855ededf86d9c0c688c4df02017ca0872be3618316d74a53a3b6
+DIST autoconf-2.13.tar.gz 443844 SHA256 f0611136bee505811e9ca11ca7ac188ef5323a8e2ef19cffd3edb3cf08fd791e SHA512 602584f4c77b7a554aaa068eda5409b68eb0b3229e9c224bffb91c83c4314d25de15bd560a323626ff78f6df339c79e1ef8938c54b78ecadf4dc75c5241290ad WHIRLPOOL 918e5e4679f0a2ae84299f190904be05f2c69e8cddf97c6b1a6e82ba20768f4c97ac451b0b6159800bad6635633f9d772a403be8c724ea782bf7725d2905f180
+DIST autoconf-2.59.tar.bz2 925073 SHA256 f0cde70a8f135098a6a3e85869f2e1cc3f141beea766fa3d6636e086cd8b90a7 SHA512 0f57e57b94ef78d59e68476746e78de9c8d0c07bcfdbdb850c2e68b59cdbef7e6256a073d1ae8965abd30611f22c1dc451ecdf67aff43102f73ec118c51ab4d6 WHIRLPOOL 4330fe3d19c26759e7babd2470cf3fb3cc8c6632fee6014ca33c2f8339ddb3114f4376b14cad4126a4dd496aecfc3f68d623061752836094c893894ede693a8b
+DIST autoconf-2.61.tar.bz2 1042439 SHA256 93a2ceab963618b021db153f0c881a2de82455c1dc7422be436fcd5c554085a1 SHA512 f534c7dbc10fc871cc99b1cb68bd7f19d888677d9e2af47e904e91fe90420c20e7a270da2681da82e249ffb46c92165202cc73e125a9b14abd604458731b0026 WHIRLPOOL fd608032198954f05f83e65cd118eb91dc74b0e3b2831594cc2a88f90a5120f56381863913cf661927baeb3aae5b99406a904ccbfb48fe4bf5757e17d455de67
+DIST autoconf-2.62.tar.bz2 1165951 SHA256 42be7628e32fd3bebe07d684b11fb6e7e7920ef698fc4ccb3da6d77f91cefb96 SHA512 98a2d903e8c43088ac60b880f58d7c35c547824c277dbeb14c48f846e40f29546c20e942f99127ffdc6f6607c334a6054328f20a9a2962972cc80570665ee7d7 WHIRLPOOL bfef8abab1a6776859369d5ffce960a17ae25208312b5a78ddcac97adb0a4464c25043a2bbf8461a8fcb528dc878a8bbc04debe67701ade47eae8a67b1ef25ff
+DIST autoconf-2.63.tar.bz2 1195259 SHA256 264d7c1c0e268bc77fbe0f308e085545535edfe73f33e27c80219cc0c9c71246 SHA512 bd47527a1f6558953d21ac1d7a36d490d057a78cd612f82b6f31aa73f9c42f4a2d736a7d4e49d91df268bffa5a418d222c53e741bffc2c8843fe3b7ed37e09d6 WHIRLPOOL 595eefe099ad7f8ad17290b5f042186567915164d2f0ae3cabed0ee13f54ca714e82ff440f84a4458fb42ce4b4f9fb5eecbcf79e61405a5a833b04d55f5a8713
+DIST autoconf-2.64.tar.xz 1113892 SHA256 32d977213320b8ae76c71175305301197f2b0e04e72d70694bc3d3e2ae6c7248 SHA512 ee4b504447c14a59b849d0915e55a90522cfb071d1583af2bd3575e5a05d7bd290e55e0e9d0760c8f36043f926199fc2d962b559d27d2f95c70d0e147b4ad0a3 WHIRLPOOL 791d3f9ed37833b13880a1bb7f75b2f73ae73fd6c9a9f4bb0ddbc33e29a617fa7f82fe43556c33effc417ac584f711f325245c3379af97f22600d54546ef9a79
+DIST autoconf-2.65.tar.xz 1132092 SHA256 3e07179feb2ba724ae557872d0cb5878655c58b49b6eaea068210c0bf22661f5 SHA512 23473cde36ad02a9474286a144c751b222d7aecf8b271b49e6dae25706c96d5533c8d840d522ecf11df8c437961a2ac00aa050c929d5e06b381acf1bc34f2c4c WHIRLPOOL 8a4bbaf7c9593d27ab9245dedc236d4addf38633f0fcc95ccfc35a1d503c447674940790407e49dab3b9fdb679eea8c9b04b132ca87c5a3c820a7f6834bfec98
+DIST autoconf-2.67.tar.xz 1158000 SHA256 80c6bda1dd6ab04510d42f594c69a06f98dc5e589683b03c11abd89270502ac1 SHA512 b9021a137da42512f6c4ce907b560ad54e27491083ce686039c32dca2602f3cb354d9e7d7493d6d531a0aa5766ff25e0d86aea6e8f61a79d93acf3ff6b56de80 WHIRLPOOL 810c763bbd1cde8eb4b7aeba32d6f9d0189b09b630a92f496eb499b466e19db6a4b9f8e291cf51e690103d8f885b37029f744aac3ca197f6e5a25645f30f1a74
+DIST autoconf-2.68.tar.xz 1167804 SHA256 c994778716e6223cf65e898e06c15ed498fe81424838adf67007282b661055ba SHA512 fd41b2d75a89bcc67f2cb0a3b335ca0d5e8f6d3f4ae844fea21c80c5ff7234efe8c299491e89d1d1124b0d4ec3072a21cf707e14b5ef186f1ab2d09f0fefa979 WHIRLPOOL 607d9bb0469633a1938d92e600073c4fa860415d339e0a8b0239265980eb9a967d79bf4c06ce96bb5f61e4504b52a6b4f90d39fd082f15ad969c1a9d24b0cedf
+DIST autoconf-2.69.tar.xz 1214744 SHA256 64ebcec9f8ac5b2487125a86a7760d2591ac9e1d3dbd59489633f9de62a57684 SHA512 995d3e5a8eb1eb37e2b7fae53c6ec7a9b4df997286b7d643344818f94636756b1bf5ff5ea9155e755cb9461149a853dfbf2886fc6bd7132e5afa9c168e306e9b WHIRLPOOL 9d806d685b9951acb15ab837b08437a6632f0907f105057e84ba3e0d99539371c32153333f459f04fb537cbb96a80e4418937e937381aec677b319ad667f7918
+EBUILD autoconf-2.13.ebuild 1521 SHA256 770c3a7f100f6e58480dc9cd43cbd431966d68549122101388fbac325f2f223e SHA512 493ba0d22c90ed02e77e2406f76bc6e2cc6c9c56e824ca8c7ce73a2e3e265868de5824ed9b0261f457903ca12068e24ea55c77e2709f9d28366fc25c9ac13091 WHIRLPOOL d7b7b7c863e056d3719d51a4bfc5acc68713ad478de2bc38f1a4a67743a100eb63283e9b317ae6a3771bbab6c83dd806fe2cb14ea4c86700c4395ea933c96fc3
+EBUILD autoconf-2.59-r7.ebuild 616 SHA256 6bcd0390f7818df5ee890ada825689c85814a736d72938ae6acaeb809dbc99d9 SHA512 6984969e12a1a61743d98bc8813c966ee3c4ced97abc3119df952d5a115f4f6614f0e948b232417ef613b971bd18eab2447acbd649e4a3a6e6e2bcff01599fa5 WHIRLPOOL c7472148bcd8b23cd66fb256efa9c4cdf5f5f0f3bc1f302b7449897759991327f4575a5b6189c583ff61e06aab9f1728bbc128232a529bde7a66721174baea7f
+EBUILD autoconf-2.61-r2.ebuild 719 SHA256 92495e1b00a0296fe5b56c5541b1a7e3293ee72c8b84a00148060a0fb2f0c783 SHA512 96fcc3c2a254d5a5d6453b2424d16d76880215bf0ee0dbd76abc83c7d54a721b76278c288fb8e7aab1dff89366493ad0ca693501754e1be21c5fe29b9b8e92a7 WHIRLPOOL 5591df6b0166c911655a345d61f57a58953c64acbc6a0e7f5acb7977d2f7cf1e7faa2ef18292bc145671339631b32744c05957022a399f1a60324bb8cab06833
+EBUILD autoconf-2.62-r1.ebuild 729 SHA256 8586116e5731d3dd3c5616a208a669b3f35cdd9bd03d6ad63d7052b4f35d53d4 SHA512 283eecd08c491f53a81bcbd3142bdf3ed49ebf41ca8536c9850e2bee139e71be4c88abdcf943b33a9568f33d11c38e52aaf4330da4bc1c5c2aef3630dea72b7a WHIRLPOOL 36313ec6802a11cbce90fe441066b26ec5306e4cc3970c3cdd2f7d5d60fad2d329db818c67ad0475a69d253b25618f037ab9eb500ed9afc04de90b46d9219c7d
+EBUILD autoconf-2.63-r1.ebuild 617 SHA256 cd4294ce4ac892c24f933a69d212c01704892b2065a1cc1d3e1109fc7fb12081 SHA512 d663d563a08a8f0e9f29dc3e2871dd7bc0cb9fc59a9218038ae3495c7ebda5e5bdf32bc872d3201cc964e07d0a3cf2b24f92d31c1d5ba1c9e289d916c6ade26b WHIRLPOOL 19e7863895d96d4ba5a1657d4e67f66782e388227a2ecf1aec8fe21fa0d7eccd8da79346f1d06a40226f4cfe017058a4e081bb802b008202cb0b8c471a3d2a7b
+EBUILD autoconf-2.64.ebuild 566 SHA256 438385da30910f93f44af2a9a15ca061f54906c8acdfa415c9ea535555b9bf00 SHA512 9449a2616671cac6a34f632c965a0bb59f38d0c0694b4412e547769d5f957b7ab82cef995c77641814c7c6e0682df3f3b754cd48252f44e38ba71e7d72fc448f WHIRLPOOL 7eefc0905509b63ea0b9a943209acc46b834e4669cc846a41036b38374b2a68a106013caed40dd0cbd77c5c1e6f28c946702bdab195e9c2e4ecd57eeed502a99
+EBUILD autoconf-2.65-r1.ebuild 627 SHA256 060986e82e971dc673db923287802d5a06f13af30d97bccc2d160ed0ba837cca SHA512 2b67c3d89ab5f11c446fec2bd7894059639ea171386580b189db8b38876d7db89e02f7d45dc8c2d830f2c3ef13cca4a41c31a5c52039946584a742fce305a019 WHIRLPOOL 806c91bec4f2a9d36a79befe16dc20bd737e51d10c3d3689ef29fca16045983b627b9c69739a6dc6bc7554bb7ad8a7f238d045e01977ab4a20e3a042d94d59de
+EBUILD autoconf-2.67.ebuild 566 SHA256 457f5f83544f0adb4c31d9e11f3cee50dbe3869212b9ef3505b5562b543ffbdd SHA512 5ed9adc3254845c9320cca852461e2c56d7a954483376eea7584ec1604050b69af6167ce6be476a14d61c90c821604f363331e97b44f3166949f5a2944a21525 WHIRLPOOL d823a313a85717ade9d4eb8358838ac862cc97421d83c44cb40b10ba4f5181cf1fb69a41f95c59946c60a64c44091252326205b43833a675aa803ee005e063df
+EBUILD autoconf-2.68.ebuild 566 SHA256 457f5f83544f0adb4c31d9e11f3cee50dbe3869212b9ef3505b5562b543ffbdd SHA512 5ed9adc3254845c9320cca852461e2c56d7a954483376eea7584ec1604050b69af6167ce6be476a14d61c90c821604f363331e97b44f3166949f5a2944a21525 WHIRLPOOL d823a313a85717ade9d4eb8358838ac862cc97421d83c44cb40b10ba4f5181cf1fb69a41f95c59946c60a64c44091252326205b43833a675aa803ee005e063df
+EBUILD autoconf-2.69-r4.ebuild 1565 SHA256 95b6feb87fa2b0097ecd90ca6a9949cf91adc2e1bb92a36a61d7e07c0cfd076f SHA512 961aff6754be27f7826fa44de16a5b0f5f6a2418bcb313932dcc6c553ddb621404c9e0f1e5e25534297c35cce451f80ce068d32914eb815c566e55b3aea58dae WHIRLPOOL 69a287b6341b1881b32056e685672b76510c4ef1b38c9e6ee8a746d6d4eeb9a945be27324cfffc2dc06b9440ca3442ba778a7797638088b3b353fba00ce275e8
+EBUILD autoconf-2.69.ebuild 1517 SHA256 bda47773c5bf82c1909a36c7d2c326f69ec99fdbfebd2db17f3396db01a0cbb8 SHA512 9ac5e366d81466493aa7e8202bc688670e219071b8bcf0801dec14df0c2977bd3520a95cd343b9658ae7327a4e09b5b9fe4e5c5f9faa4982260b83c1e4368cd4 WHIRLPOOL 263912f88c98f69790ba0080ae4337d939fa556f1906c1ce8c22501af0280e09664e90bfc69c9c1affe16a9407de97567c0e743d60e3b3b920236d9edbd6f11a
+EBUILD autoconf-9999.ebuild 1361 SHA256 ca8097345813b5392493de8d8e2be575ccbaf2d33ae0dcbb262b2824b6992a75 SHA512 cbd6d7f64866419b258c7f711eff2dff2f1dbb11847d80d2d7dfa3cadc11c37ec457e9e351ca56dadbeb73b0466e81d24efae4121a02751abdbf63c7595cbce2 WHIRLPOOL 64e36662ff593ec637036764cfc519094d8f33d5231f7302144d6f1b4e4a515592e9d0806d88c3684582e4c2375ba1c652f279924f36e332c3e53a26c15c025b
+MISC ChangeLog 5454 SHA256 fa37e32129585970438dddb0cee216025da1de71777b9a02bb2d4a595e0700e7 SHA512 7392f34e436887f3671f74a7bc040443ef87ac425d5bf050dde2d4fc6a179e9b5fbd1d18871f4edb4bfa1f35091802097d38671e00a25a17612fe6788b0790be WHIRLPOOL 4966b4f1d8dd5ee73cde25e543e260c193e1f7466e9ecb67a94314ab6b76dd14139cdc4a945d2d3f71e6af36ad03938eb3491b16438a16266171f9d120c832ac
+MISC ChangeLog-2015 28183 SHA256 a754034e01a44104390758815bbb9845ef2ead4da0c78d17bc1f72eab6c8f818 SHA512 37784b586c0e196d833b88498e01a6213fa595de51d4e91d33304fadb0bd4eceae085aeab45f924672aca5a0f8ad80f08ac7a8e14d558a61f9c050e21f64dcda WHIRLPOOL 973df92c54f220f1450243ce4b880a24209aebc08195ab7e7ca31e932cf8190373248d460d2811ffd8db7f24509f7036f998cd035767089cf2e4e95771ed0fe7
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/autoconf/autoconf-2.13.ebuild b/sys-devel/autoconf/autoconf-2.13.ebuild
new file mode 100644
index 000000000000..4a48b2723e23
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.13.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="userland_BSD"
+
+DEPEND=">=sys-apps/texinfo-4.3
+ =sys-devel/m4-1.4*
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gentoo.patch
+ "${FILESDIR}"/${P}-destdir.patch
+ "${FILESDIR}"/${P}-test-fixes.patch #146592
+)
+
+src_configure() {
+ touch configure # make sure configure is newer than configure.in
+
+ # need to include --exec-prefix and --bindir or our
+ # DESTDIR patch will trigger sandbox hate :(
+ #
+ # need to force locale to C to avoid bugs in the old
+ # configure script breaking the install paths #351982
+ #
+ # force to `awk` so that we don't encode another awk that
+ # happens to currently be installed, but might later be
+ # uninstalled (like mawk). same for m4.
+ local prepend=""
+ use userland_BSD && prepend="g"
+ ac_cv_path_M4="${prepend}m4" \
+ ac_cv_prog_AWK="${prepend}awk" \
+ LC_ALL=C \
+ econf \
+ --exec-prefix="${EPREFIX}"/usr \
+ --bindir="${EPREFIX}"/usr/bin \
+ --program-suffix="-${PV}"
+}
diff --git a/sys-devel/autoconf/autoconf-2.59-r7.ebuild b/sys-devel/autoconf/autoconf-2.59-r7.ebuild
new file mode 100644
index 000000000000..7eade8183517
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.59-r7.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND="=sys-devel/m4-1.4*
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-more-quotes.patch
+)
diff --git a/sys-devel/autoconf/autoconf-2.61-r2.ebuild b/sys-devel/autoconf/autoconf-2.61-r2.ebuild
new file mode 100644
index 000000000000..e1fedced3204
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.61-r2.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-GETMNTENT.patch
+)
+
+src_compile() {
+ # From configure output:
+ # Parallel builds via `make -jN' do not work.
+ emake -j1
+}
diff --git a/sys-devel/autoconf/autoconf-2.62-r1.ebuild b/sys-devel/autoconf/autoconf-2.62-r1.ebuild
new file mode 100644
index 000000000000..574a0af6ce74
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.62-r1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-revert-AC_C_BIGENDIAN.patch #228825
+ "${FILESDIR}"/${P}-at-keywords.patch
+ "${FILESDIR}"/${P}-fix-multiline-string.patch #217976
+)
diff --git a/sys-devel/autoconf/autoconf-2.63-r1.ebuild b/sys-devel/autoconf/autoconf-2.63-r1.ebuild
new file mode 100644
index 000000000000..0df070c98765
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.63-r1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-sh.patch #264303
+)
diff --git a/sys-devel/autoconf/autoconf-2.64.ebuild b/sys-devel/autoconf/autoconf-2.64.ebuild
new file mode 100644
index 000000000000..572f9e3322af
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.64.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
diff --git a/sys-devel/autoconf/autoconf-2.65-r1.ebuild b/sys-devel/autoconf/autoconf-2.65-r1.ebuild
new file mode 100644
index 000000000000..1354433f9d33
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.65-r1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-AC_TYPE_INT_T.patch #324649
+)
diff --git a/sys-devel/autoconf/autoconf-2.67.ebuild b/sys-devel/autoconf/autoconf-2.67.ebuild
new file mode 100644
index 000000000000..4290fee75751
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.67.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
diff --git a/sys-devel/autoconf/autoconf-2.68.ebuild b/sys-devel/autoconf/autoconf-2.68.ebuild
new file mode 100644
index 000000000000..4290fee75751
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.68.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+DEPEND=">=sys-devel/m4-1.4.6
+ dev-lang/perl"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
diff --git a/sys-devel/autoconf/autoconf-2.69-r4.ebuild b/sys-devel/autoconf/autoconf-2.69-r4.ebuild
new file mode 100644
index 000000000000..eac252939367
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.69-r4.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ # We need all the tags in order to figure out the right version.
+ # The git-r3 eclass doesn't support that, so have to stick to 2.
+ inherit git-r3
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+IUSE="emacs"
+
+DEPEND=">=sys-devel/m4-1.4.16
+ >=dev-lang/perl-5.6"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
+[[ ${PV} == "9999" ]] && DEPEND+=" >=sys-apps/texinfo-4.3"
+PDEPEND="emacs? ( app-emacs/autoconf-mode )"
+
+src_prepare() {
+ # usr/bin/libtool is provided by binutils-apple, need gnu libtool
+ [[ ${CHOST} == *-darwin* ]] && \
+ PATCHES+=( "${FILESDIR}"/${PN}-2.61-darwin.patch )
+ PATCHES+=(
+ "${FILESDIR}"/${PN}-2.69-perl-5.26.patch
+ "${FILESDIR}"/${P}-fix-libtool-test.patch
+ "${FILESDIR}"/${PN}-2.69-perl-5.26-2.patch
+ )
+ toolchain-autoconf_src_prepare
+ eapply_user
+}
diff --git a/sys-devel/autoconf/autoconf-2.69.ebuild b/sys-devel/autoconf/autoconf-2.69.ebuild
new file mode 100644
index 000000000000..90d1e296b1b5
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-2.69.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="3"
+
+inherit eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ inherit git-2
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+fi
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+
+LICENSE="GPL-3"
+SLOT="2.5"
+IUSE="emacs"
+
+DEPEND=">=sys-devel/m4-1.4.16
+ >=dev-lang/perl-5.6"
+RDEPEND="${DEPEND}
+ >=sys-devel/autoconf-wrapper-13"
+PDEPEND="emacs? ( app-emacs/autoconf-mode )"
+
+src_prepare() {
+ if [[ ${PV} == "9999" ]] ; then
+ autoreconf -f -i || die
+ fi
+ find -name Makefile.in -exec sed -i '/^pkgdatadir/s:$:-@VERSION@:' {} +
+}
+
+src_configure() {
+ # Disable Emacs in the build system since it is in a separate package.
+ export EMACS=no
+ econf --program-suffix="-${PV}" || die
+ # econf updates config.{sub,guess} which forces the manpages
+ # to be regenerated which we dont want to do #146621
+ touch man/*.1
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS BUGS NEWS README TODO THANKS \
+ ChangeLog ChangeLog.0 ChangeLog.1 ChangeLog.2
+
+ local f
+ for f in "${ED}"/usr/share/info/*.info* ; do
+ mv "${f}" "${f/.info/-${SLOT}.info}" || die
+ done
+}
diff --git a/sys-devel/autoconf/autoconf-9999.ebuild b/sys-devel/autoconf/autoconf-9999.ebuild
new file mode 100644
index 000000000000..9495cddbedd9
--- /dev/null
+++ b/sys-devel/autoconf/autoconf-9999.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ # We need all the tags in order to figure out the right version.
+ # The git-r3 eclass doesn't support that, so have to stick to 2.
+ inherit git-2
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
+fi
+
+inherit toolchain-autoconf
+
+DESCRIPTION="Used to create autoconfiguration files"
+HOMEPAGE="https://www.gnu.org/software/autoconf/autoconf.html"
+
+LICENSE="GPL-3"
+SLOT="${PV}"
+IUSE="emacs"
+
+DEPEND=">=sys-devel/m4-1.4.16
+ >=dev-lang/perl-5.6"
+RDEPEND="${DEPEND}
+ !~sys-devel/${P}:2.5
+ >=sys-devel/autoconf-wrapper-13"
+[[ ${PV} == "9999" ]] && DEPEND+=" >=sys-apps/texinfo-4.3"
+PDEPEND="emacs? ( app-emacs/autoconf-mode )"
+
+src_prepare() {
+ # Avoid the "dirty" suffix in the git version by generating it
+ # before we run later stages which might modify source files.
+ local ver=$(./build-aux/git-version-gen .tarball-version)
+ echo "${ver}" > .tarball-version
+
+ autoreconf -f -i || die
+
+ toolchain-autoconf_src_prepare
+}
diff --git a/sys-devel/autoconf/files/autoconf-2.13-destdir.patch b/sys-devel/autoconf/files/autoconf-2.13-destdir.patch
new file mode 100644
index 000000000000..858b8bcc1f71
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.13-destdir.patch
@@ -0,0 +1,26 @@
+--- Makefile.in.orig 2004-10-20 16:44:54.949117496 -0400
++++ Makefile.in 2004-10-20 16:45:39.999268832 -0400
+@@ -41,18 +41,18 @@
+
+ transform=@program_transform_name@
+
+-prefix = @prefix@
++prefix = $(DESTDIR)@prefix@
+-exec_prefix = @exec_prefix@
++exec_prefix = $(DESTDIR)@exec_prefix@
+
+ # Directory in which to install scripts.
+-bindir = @bindir@
++bindir = $(DESTDIR)@bindir@
+
+ # Directory in which to install library files.
+-datadir = @datadir@
++datadir = $(DESTDIR)@datadir@
+ acdatadir = $(datadir)/autoconf
+
+ # Directory in which to install documentation info files.
+-infodir = @infodir@
++infodir = $(DESTDIR)@infodir@
+
+ #### End of system configuration section. ####
+
diff --git a/sys-devel/autoconf/files/autoconf-2.13-gentoo.patch b/sys-devel/autoconf/files/autoconf-2.13-gentoo.patch
new file mode 100644
index 000000000000..8e40d0cae049
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.13-gentoo.patch
@@ -0,0 +1,36 @@
+--- configure.orig Wed Feb 28 20:51:53 2001
++++ configure Wed Feb 28 20:52:03 2001
+@@ -654,12 +654,10 @@
+ echo "$ac_t""no" 1>&6
+ fi
+
+-if test "$PERL" != no; then
+- SCRIPTS=autoscan
+-else
+- echo "configure: warning: autoscan will not be built since perl is not found" 1>&2
++if test "$PERL" = no; then
++ PERL=/usr/bin/perl
+ fi
+-
++SCRIPTS=autoscan
+ ac_aux_dir=
+ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+--- configure.orig Wed Feb 28 20:53:24 2001
++++ configure.in Wed Feb 28 20:53:28 2001
+@@ -14,12 +14,10 @@
+ AC_PATH_PROG(PERL, perl, no)
+ AC_SUBST(PERL)dnl
+ AC_SUBST(SCRIPTS)dnl
+-if test "$PERL" != no; then
+- SCRIPTS=autoscan
+-else
+- AC_MSG_WARN(autoscan will not be built since perl is not found)
++if test "$PERL" = no; then
++ PERL=/usr/bin/perl
+ fi
+-
++SCRIPTS=autoscan
+ AC_PROG_INSTALL
+
+ # Work with the GNU or Cygnus source tree layout.
diff --git a/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch b/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch
new file mode 100644
index 000000000000..b8a7e3b8ce99
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch
@@ -0,0 +1,18 @@
+newer gcc versions don't provide g77, so if it doesn't exist,
+don't bother trying to test it (and failing)
+
+http://bugs.gentoo.org/146592
+
+--- autoconf-2.13/testsuite/autoconf.s/syntax.exp
++++ autoconf-2.13/testsuite/autoconf.s/syntax.exp
+@@ -5,6 +5,10 @@
+ set macros [exec sed -n $script $srcdir/../acspecific.m4]
+
+ foreach mac $macros {
++ if { [string match "*F77*" "$mac"] && [catch {exec which g77} ignore_output] } then {
++ send_user "XFAIL: $mac\n"
++ continue
++ }
+ send_user "$mac\n"
+ autoconf_test $mac $mac
+ }
diff --git a/sys-devel/autoconf/files/autoconf-2.59-more-quotes.patch b/sys-devel/autoconf/files/autoconf-2.59-more-quotes.patch
new file mode 100644
index 000000000000..eb2c8395fa90
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.59-more-quotes.patch
@@ -0,0 +1,34 @@
+http://bugs.gentoo.org/96882
+
+date: 2005/06/23 20:09:27; author: eggert; state: Exp; lines: +29 -34
+Fix some more shell quoting problems. Prompted by a bug report
+from Justace Clutter.
+* lib/autoconf/general.m4 (_AC_INIT_SRCDIR): Allow special
+characters in $ac_unique_file.
+
+--- lib/autoconf/general.m4
++++ lib/autoconf/general.m4
+@@ -476,20 +476,20 @@
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`AS_DIRNAME(["$[0]"])`
+ srcdir=$ac_confdir
+- if test ! -r $srcdir/$ac_unique_file; then
++ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+ else
+ ac_srcdir_defaulted=no
+ fi
+-if test ! -r $srcdir/$ac_unique_file; then
++if test ! -r "$srcdir/$ac_unique_file"; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $ac_confdir or ..])
+ else
+ AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
+ fi
+ fi
+-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
++(cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null ||
+ AC_MSG_ERROR([sources are in $srcdir, but `cd $srcdir' does not work])
+ dnl Double slashes in pathnames in object file debugging info
+ dnl mess up M-x gdb in Emacs.
diff --git a/sys-devel/autoconf/files/autoconf-2.61-GETMNTENT.patch b/sys-devel/autoconf/files/autoconf-2.61-GETMNTENT.patch
new file mode 100644
index 000000000000..7cdc425e0396
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.61-GETMNTENT.patch
@@ -0,0 +1,23 @@
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Sat, 16 Dec 2006 05:38:41 +0000 (+0000)
+Subject: * lib/autoconf/functions.m4 (AC_FUNC_GETMNTENT):
+X-Git-Tag: v2.62~386
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff_plain;h=a152d401584cd901f7295647af0382948369de79
+
+* lib/autoconf/functions.m4 (AC_FUNC_GETMNTENT):
+Define HAVE_GETMNTENT to 1, not to the empty string.
+Problem originally reported by Jochen Friedrich in
+<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=403243>.
+---
+
+--- a/lib/autoconf/functions.m4
++++ b/lib/autoconf/functions.m4
+@@ -798,7 +798,7 @@ AC_DEFUN([AC_FUNC_GETMNTENT],
+ # -lseq on Dynix/PTX, -lgen on Unixware.
+ AC_SEARCH_LIBS(getmntent, [sun seq gen],
+ [ac_cv_func_getmntent=yes
+- AC_DEFINE([HAVE_GETMNTENT], [],
++ AC_DEFINE([HAVE_GETMNTENT], 1,
+ [Define to 1 if you have the `getmntent' function.])],
+ [ac_cv_func_getmntent=no])
+ ])
diff --git a/sys-devel/autoconf/files/autoconf-2.61-darwin.patch b/sys-devel/autoconf/files/autoconf-2.61-darwin.patch
new file mode 100644
index 000000000000..2ac2be361db1
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.61-darwin.patch
@@ -0,0 +1,11 @@
+--- bin/autoreconf.in
++++ bin/autoreconf.in
+@@ -110,7 +110,7 @@
+ my $autoheader = $ENV{'AUTOHEADER'} || '@bindir@/@autoheader-name@';
+ my $automake = $ENV{'AUTOMAKE'} || 'automake';
+ my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
+-my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
++my $libtoolize = $ENV{'LIBTOOLIZE'} || 'glibtoolize';
+ my $autopoint = $ENV{'AUTOPOINT'} || 'autopoint';
+
+ # --install -- as --add-missing in other tools.
diff --git a/sys-devel/autoconf/files/autoconf-2.62-at-keywords.patch b/sys-devel/autoconf/files/autoconf-2.62-at-keywords.patch
new file mode 100644
index 000000000000..04cd1807b8a0
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.62-at-keywords.patch
@@ -0,0 +1,81 @@
+commit 3ac7ceb0c2dfd023e0e9e944da6825b6bd676568
+Author: Eric Blake <ebb9@byu.net>
+Date: Thu Jun 5 15:18:11 2008 -0600
+
+ Fix regression in AT_KEYWORDS([Macro]), from 2007-10-18.
+
+ * lib/autotest/general.m4 (AT_KEYWORDS): Expand argument prior to
+ converting it to lower case.
+ * tests/autotest.at (Keywords and ranges): Test this.
+ * NEWS: Document the fix.
+ * THANKS: Update.
+ Reported by Karsten Hopp.
+
+ Signed-off-by: Eric Blake <ebb9@byu.net>
+
+diff --git a/NEWS b/NEWS
+index 183d4f1..8b866ad 100644
+--- a/NEWS
++++ b/NEWS
+@@ -9,6 +9,10 @@ GNU Autoconf NEWS - User visible changes.
+ ** Two new quadrigraphs have been introduced: @{:@ for (, and @:}@ for ),
+ allowing the output of unbalanced parantheses in more contexts.
+
++** AT_KEYWORDS once again performs expansion on its argument, such that
++ AT_KEYWORDS([m4_if([$1], [], [default])]) no longer complains about
++ the possibly unexpanded m4_if [regression introduced in 2.62].
++
+
+ * Major changes in Autoconf 2.62 (2008-04-05) [stable]
+ Released by Eric Blake, based on git versions 2.61a.*.
+diff --git a/THANKS b/THANKS
+index 5ec8921..224cdea 100644
+--- a/THANKS
++++ b/THANKS
+@@ -177,6 +177,7 @@ Justace Clutter ?
+ Jörn Rennecke amylaar@cygnus.co.uk
+ Karl Berry karl@cs.umb.edu
+ Karl Heuer kwzh@gnu.org
++Karsten Hopp karsten@redhat.com
+ Kate Hedstrom ?
+ Kathryn Hargreaves kathryn@deas.harvard.edu
+ Kaveh R. Ghazi ghazi@caip.rutgers.edu
+diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
+index 88d10a3..993dd9f 100644
+--- a/lib/autotest/general.m4
++++ b/lib/autotest/general.m4
+@@ -1476,9 +1476,10 @@ m4_case([$1],
+ # AT_KEYWORDS(KEYWORDS)
+ # ---------------------
+ # Declare a list of keywords associated to the current test group.
+-# The list is stored in lower case, since the -k option is case-insensitive.
++# Since the -k option is case-insensitive, the list is stored in lower case
++# to avoid duplicates that differ only by case.
+ _AT_DEFINE_SETUP([AT_KEYWORDS],
+-[m4_append_uniq_w([AT_keywords], m4_tolower([[$1]]))])
++[m4_append_uniq_w([AT_keywords], m4_tolower(m4_dquote(m4_expand([$1]))))])
+
+
+ # AT_CAPTURE_FILE(FILE)
+diff --git a/tests/autotest.at b/tests/autotest.at
+index dc3cfd5..c4c0eda 100644
+--- a/tests/autotest.at
++++ b/tests/autotest.at
+@@ -690,7 +690,7 @@ AT_CHECK(:)
+ AT_CLEANUP
+ AT_SETUP(both) # 04
+ AT_KEYWORDS([key1 key2])
+-AT_KEYWORDS([key1])
++AT_KEYWORDS([m4@&t@_echo([Key1])])
+ AT_CHECK(:)
+ AT_CLEANUP
+ AT_SETUP(test5) # 05
+@@ -713,7 +713,7 @@ AT_CHECK(:)
+ AT_CLEANUP
+ ]])
+ dnl check that AT_KEYWORDS does not duplicate words
+-AT_CHECK([grep 'key1.*key1' k], [1])
++AT_CHECK([grep -i 'key1.*key1' k], [1])
+ dnl check that -k requires an argument
+ AT_CHECK([$CONFIG_SHELL ./k -k], [1], [], [ignore])
+
diff --git a/sys-devel/autoconf/files/autoconf-2.62-fix-multiline-string.patch b/sys-devel/autoconf/files/autoconf-2.62-fix-multiline-string.patch
new file mode 100644
index 000000000000..cfd7b4228794
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.62-fix-multiline-string.patch
@@ -0,0 +1,30 @@
+sniped from mandrivia:
+http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/autoconf/current/SOURCES/autoconf-2.62-fix-multiline-string.patch
+
+this may not be the correct fix, but it seems to get the job done until we can
+grab whatever upstream merges
+http://lists.gnu.org/archive/html/bug-autoconf/2008-04/msg00031.html
+
+--- autoconf-2.62/lib/autoconf/status.m4
++++ autoconf-2.62/lib/autoconf/status.m4
+@@ -1360,16 +1360,16 @@ _ACEOF
+ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ # Files that config.status was made for.
+ m4_ifdef([_AC_SEEN_CONFIG(FILES)],
+-[config_files="$ac_config_files"
++[config_files="`echo $ac_config_files`"
+ ])dnl
+ m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
+-[config_headers="$ac_config_headers"
++[config_headers="`echo $ac_config_headers`"
+ ])dnl
+ m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
+-[config_links="$ac_config_links"
++[config_links="`echo $ac_config_links`"
+ ])dnl
+ m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
+-[config_commands="$ac_config_commands"
++[config_commands="`echo $ac_config_commands`"
+ ])dnl
+
+ _ACEOF
diff --git a/sys-devel/autoconf/files/autoconf-2.62-revert-AC_C_BIGENDIAN.patch b/sys-devel/autoconf/files/autoconf-2.62-revert-AC_C_BIGENDIAN.patch
new file mode 100644
index 000000000000..76db013cac53
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.62-revert-AC_C_BIGENDIAN.patch
@@ -0,0 +1,214 @@
+revert AC_C_BIGENDIAN to the version found in 2.61 since the version in 2.62 is
+known to be broken and the changes that it brings are not critical
+
+http://bugs.gentoo.org/228825
+
+--- autoconf-2.62/lib/autoconf/c.m4
++++ autoconf-2.61/lib/autoconf/c.m4
+@@ -1393,140 +1351,74 @@
+ ])# AC_C_CHAR_UNSIGNED
+
+
+-# AC_C_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN],
+-# [ACTION-IF-UNIVERSAL])
++# AC_C_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
+ # -------------------------------------------------------------------------
+ AC_DEFUN([AC_C_BIGENDIAN],
+-[AH_VERBATIM([WORDS_BIGENDIAN],
+-[/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+- significant byte first (like Motorola and SPARC, unlike Intel and VAX). */
+-#if defined __BIG_ENDIAN__
+-# define WORDS_BIGENDIAN 1
+-#elif ! defined __LITTLE_ENDIAN__
+-# undef WORDS_BIGENDIAN
+-#endif])dnl
+- AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian],
+- [ac_cv_c_bigendian=unknown
+- m4_ifval(m4_ifdef([AH_HEADER], 1)[$4],
+- [# See if __BIG_ENDIAN__ or __LITTLE_ENDIAN__ is defined.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_SOURCE(
+- [[#if ! (defined __BIG_ENDIAN__ || defined __LITTLE_ENDIAN__)
+- neither is defined;
+- #endif
+- typedef int dummy;
+- ]])],
+- [ac_cv_c_bigendian=universal])],
+- [AC_DIAGNOSE([obsolete], [AC_C_BIGENDIAN suggests AC_CONFIG_HEADERS])])
+- if test $ac_cv_c_bigendian = unknown; then
+- # See if sys/param.h defines the BYTE_ORDER macro.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <sys/types.h>
+- #include <sys/param.h>
+- ]],
+- [[#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+- && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+- && LITTLE_ENDIAN)
+- bogus endian macros
+- #endif
+- ]])],
+- [# It does; now see whether it defined to BIG_ENDIAN or not.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <sys/types.h>
+- #include <sys/param.h>
+- ]],
+- [[#if BYTE_ORDER != BIG_ENDIAN
+- not big endian
+- #endif
+- ]])],
+- [ac_cv_c_bigendian=yes],
+- [ac_cv_c_bigendian=no])])
+- fi
+- if test $ac_cv_c_bigendian = unknown; then
+- # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <limits.h>
+- ]],
+- [[#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+- bogus endian macros
+- #endif
+- ]])],
+- [# It does; now see whether it defined to _BIG_ENDIAN or not.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[#include <limits.h>
+- ]],
+- [[#ifndef _BIG_ENDIAN
+- not big endian
+- #endif
+- ]])],
+- [ac_cv_c_bigendian=yes],
+- [ac_cv_c_bigendian=no])])
+- fi
+- if test $ac_cv_c_bigendian = unknown; then
+- # Compile a test program.
+- AC_RUN_IFELSE(
+- [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+- [[
+- /* Are we little or big endian? From Harbison&Steele. */
+- union
+- {
+- long int l;
+- char c[sizeof (long int)];
+- } u;
+- u.l = 1;
+- return u.c[sizeof (long int) - 1] == 1;
+- ]])],
+- [ac_cv_c_bigendian=no],
+- [ac_cv_c_bigendian=yes],
+- [# Try to guess by grepping values from an object file.
+- AC_COMPILE_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[short int ascii_mm[] =
+- { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+- short int ascii_ii[] =
+- { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+- int use_ascii (int i) {
+- return ascii_mm[i] + ascii_ii[i];
+- }
+- short int ebcdic_ii[] =
+- { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+- short int ebcdic_mm[] =
+- { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+- int use_ebcdic (int i) {
+- return ebcdic_mm[i] + ebcdic_ii[i];
+- }
+- extern int foo;
+- ]],
+- [[return use_ascii (foo) == use_ebcdic (foo);]])],
+- [if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+- ac_cv_c_bigendian=yes
+- fi
+- if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+- if test "$ac_cv_c_bigendian" = unknown; then
+- ac_cv_c_bigendian=no
+- else
+- # finding both strings is unlikely to happen, but who knows?
+- ac_cv_c_bigendian=unknown
+- fi
+- fi])])
+- fi])
+- case $ac_cv_c_bigendian in #(
+- yes)
+- m4_default([$1],
+- [AC_DEFINE([WORDS_BIGENDIAN], 1)]);; #(
+- no)
+- $2 ;; #(
+- universal)
+- $4 ;; #(
+- *)
+- m4_default([$3],
+- [AC_MSG_ERROR([unknown endianness
+- presetting ac_cv_c_bigendian=no (or yes) will help])]) ;;
+- esac
++[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
++[# See if sys/param.h defines the BYTE_ORDER macro.
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
++#include <sys/param.h>
++],
++[#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
++ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
++ bogus endian macros
++#endif
++])],
++[# It does; now see whether it defined to BIG_ENDIAN or not.
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
++#include <sys/param.h>
++], [#if BYTE_ORDER != BIG_ENDIAN
++ not big endian
++#endif
++])], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian=no])],
++[# It does not; compile a test program.
++AC_RUN_IFELSE(
++[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[
++ /* Are we little or big endian? From Harbison&Steele. */
++ union
++ {
++ long int l;
++ char c[sizeof (long int)];
++ } u;
++ u.l = 1;
++ return u.c[sizeof (long int) - 1] == 1;
++]])],
++ [ac_cv_c_bigendian=no],
++ [ac_cv_c_bigendian=yes],
++[# try to guess the endianness by grepping values into an object file
++ ac_cv_c_bigendian=unknown
++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
++[[short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
++short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
++void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
++short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
++short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
++void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }]],
++[[ _ascii (); _ebcdic (); ]])],
++[if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
++ ac_cv_c_bigendian=yes
++fi
++if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
++ if test "$ac_cv_c_bigendian" = unknown; then
++ ac_cv_c_bigendian=no
++ else
++ # finding both strings is unlikely to happen, but who knows?
++ ac_cv_c_bigendian=unknown
++ fi
++fi])])])])
++case $ac_cv_c_bigendian in
++ yes)
++ m4_default([$1],
++ [AC_DEFINE([WORDS_BIGENDIAN], 1,
++ [Define to 1 if your processor stores words with the most significant
++ byte first (like Motorola and SPARC, unlike Intel and VAX).])]) ;;
++ no)
++ $2 ;;
++ *)
++ m4_default([$3],
++ [AC_MSG_ERROR([unknown endianness
++presetting ac_cv_c_bigendian=no (or yes) will help])]) ;;
++esac
+ ])# AC_C_BIGENDIAN
+
+
diff --git a/sys-devel/autoconf/files/autoconf-2.63-sh.patch b/sys-devel/autoconf/files/autoconf-2.63-sh.patch
new file mode 100644
index 000000000000..8008b32b6022
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.63-sh.patch
@@ -0,0 +1,32 @@
+http://bugs.gentoo.org/264303
+http://lists.gnu.org/archive/html/bug-autoconf/2008-10/msg00040.html
+
+From: Chikama Masaki <masaki.chikama@gmail.com>
+Date: Fri, 24 Oct 2008 01:41:06 +0000 (-0600)
+Subject: For gfortran on sh, ignore -little.
+X-Git-Tag: v2.63b~206
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff_plain;h=3f38aad
+
+For gfortran on sh, ignore -little.
+
+* lib/autoconf/fortran.m4 (_AC_FC_LIBRARY_LDFLAGS): Add -little to
+list of ignored arguments.
+* THANKS: Update.
+
+Signed-off-by: Eric Blake <ebb9@byu.net>
+---
+
+diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4
+index 20d9e0c..ad0c2ee 100644
+--- a/lib/autoconf/fortran.m4
++++ b/lib/autoconf/fortran.m4
+@@ -686,7 +686,8 @@ while test $[@%:@] != 1; do
+ [_AC_LINKER_OPTION([$ac_arg], ac_cv_[]_AC_LANG_ABBREV[]_libs)])
+ ;;
+ # Ignore these flags.
+- -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*)
++ -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \
++ |-LANG:=* | -LIST:* | -LNO:*)
+ ;;
+ -lkernel32)
+ test x"$CYGWIN" != xyes && ac_cv_[]_AC_LANG_ABBREV[]_libs="$ac_cv_[]_AC_LANG_ABBREV[]_libs $ac_arg"
diff --git a/sys-devel/autoconf/files/autoconf-2.65-AC_TYPE_INT_T.patch b/sys-devel/autoconf/files/autoconf-2.65-AC_TYPE_INT_T.patch
new file mode 100644
index 000000000000..cc81672e427e
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.65-AC_TYPE_INT_T.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/324649
+http://lists.gnu.org/archive/html/bug-autoconf/2009-12/msg00016.html
+
+From 83ee5bc460a1083ab29fd9d3a3044cbaefad6ac6 Mon Sep 17 00:00:00 2001
+From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Wed, 9 Dec 2009 07:20:16 +0100
+Subject: [PATCH] Fix 2.64 AC_TYPE_INT*_T macro body text regression.
+
+* lib/autoconf/types.m4 (_AC_TYPE_INT_BODY): Move helper enum
+definition to prologue section, to avoid syntax error.
+* NEWS, THANKS: Update.
+Report by Pierre Ynard.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ ChangeLog | 8 ++++++++
+ NEWS | 3 +++
+ THANKS | 1 +
+ lib/autoconf/types.m4 | 12 ++++++------
+ 4 files changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4
+index 7a73fc2..3829c4c 100644
+--- a/lib/autoconf/types.m4
++++ b/lib/autoconf/types.m4
+@@ -635,14 +635,14 @@ m4_define([_AC_TYPE_INT_BODY],
+ 'long long int' 'short int' 'signed char'; do
+ AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(
+- [AC_INCLUDES_DEFAULT],
+- [enum { N = $[]2 / 2 - 1 };
+- 0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)])],
++ [AC_INCLUDES_DEFAULT
++ enum { N = $[]2 / 2 - 1 };],
++ [0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(
+- [AC_INCLUDES_DEFAULT],
+- [enum { N = $[]2 / 2 - 1 };
+- ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
++ [AC_INCLUDES_DEFAULT
++ enum { N = $[]2 / 2 - 1 };],
++ [($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+ < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2)])],
+ [],
+ [AS_CASE([$ac_type], [int$[]2_t],
+--
+1.7.1
+
diff --git a/sys-devel/autoconf/files/autoconf-2.69-fix-libtool-test.patch b/sys-devel/autoconf/files/autoconf-2.69-fix-libtool-test.patch
new file mode 100644
index 000000000000..e75eba621606
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.69-fix-libtool-test.patch
@@ -0,0 +1,31 @@
+From 247b02e5a5bb79ca6666e91de02ae2d3cb0cd325 Mon Sep 17 00:00:00 2001
+From: "Gary V. Vaughan" <gary@gnu.org>
+Date: Mon, 3 Nov 2014 07:25:03 +0100
+Subject: tests: avoid spurious test failure with libtool 2.4.3
+
+Based on a report by Bruce Dubbs.
+
+* tests/foreign.at (Libtool): Be tolerant of 'quote' replacing the
+older `quote'.
+
+Signed-off-by: Eric Blake <eblake@redhat.com>
+---
+ tests/foreign.at | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/foreign.at b/tests/foreign.at
+index a9dc33c..d4702cd 100644
+--- a/tests/foreign.at
++++ b/tests/foreign.at
+@@ -57,7 +57,7 @@ AT_CHECK([./config.guess || exit 77], [], [ignore], [ignore])
+ # Make sure at-path contains something valid, and let the test suite
+ # display it when verbose. And fail, skipping would too easily hide
+ # problems.
+-AT_CHECK([sed -n ["s,^.*\`\\(/[^']*\\)'.*,\\1,p"] stdout], [0], [stdout])
++AT_CHECK([sed -n ["s,^[^']*[\`']\\(/[^']*\\)'.*,\\1,p"] stdout], [0], [stdout])
+ AT_CHECK([test -f "`sed -n 1p stdout`"])
+
+ # Older libtoolize installed everything but install-sh...
+--
+cgit v1.0-41-gc330
+
diff --git a/sys-devel/autoconf/files/autoconf-2.69-perl-5.26-2.patch b/sys-devel/autoconf/files/autoconf-2.69-perl-5.26-2.patch
new file mode 100644
index 000000000000..6becf807c43e
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.69-perl-5.26-2.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/625576
+
+--- autoconf-2.69/bin/autoheader.in
++++ autoconf-2.69/bin/autoheader.in
+@@ -173,6 +173,12 @@
+ # Source what the traces are trying to tell us.
+ verb "$me: running $autoconf to trace from $ARGV[0]";
+ my $quoted_tmp = shell_quote ($tmp);
++my $perl_tmp;
++if ( $tmp =~ /^\// ) {
++ $perl_tmp=$tmp;
++} else {
++ $perl_tmp="./".$tmp;
++}
+ xsystem ("$autoconf"
+ # If you change this list, update the
+ # `Autoheader-preselections' section of autom4te.in.
+@@ -182,9 +188,9 @@
+ . " " . shell_quote ($ARGV[0]) . " >$quoted_tmp/traces.pl");
+
+ local (%verbatim, %symbol);
+-debug "$me: \`do'ing $tmp/traces.pl:\n" . `sed 's/^/| /' $quoted_tmp/traces.pl`;
+-do "$tmp/traces.pl";
+-warn "couldn't parse $tmp/traces.pl: $@" if $@;
++debug "$me: \`do'ing $perl_tmp/traces.pl:\n" . `sed 's/^/| /' $quoted_tmp/traces.pl`;
++do "$perl_tmp/traces.pl";
++warn "couldn't parse $perl_tmp/traces.pl: $@" if $@;
+ unless ($config_h)
+ {
+ error "error: AC_CONFIG_HEADERS not found in $ARGV[0]";
diff --git a/sys-devel/autoconf/files/autoconf-2.69-perl-5.26.patch b/sys-devel/autoconf/files/autoconf-2.69-perl-5.26.patch
new file mode 100644
index 000000000000..b3d7888ca722
--- /dev/null
+++ b/sys-devel/autoconf/files/autoconf-2.69-perl-5.26.patch
@@ -0,0 +1,28 @@
+From e5654a5591884b92633c7785f325626711e7f7aa Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Tue, 29 Jan 2013 13:46:48 -0800
+Subject: [PATCH] autoscan: port to perl 5.17
+
+* bin/autoscan.in (scan_sh_file): Escape '{'. This avoids a
+feature that is deprecated in Perl 5.17. Reported by Ray Lauff in
+<http://lists.gnu.org/archive/html/bug-autoconf/2013-01/msg00059.html>.
+---
+ bin/autoscan.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bin/autoscan.in b/bin/autoscan.in
+index 993a750..db1df79 100644
+--- a/bin/autoscan.in
++++ b/bin/autoscan.in
+@@ -358,7 +358,7 @@ sub scan_sh_file ($)
+ {
+ # Strip out comments and variable references.
+ s/#.*//;
+- s/\${[^\}]*}//g;
++ s/\$\{[^\}]*}//g;
+ s/@[^@]*@//g;
+
+ # Tokens in the code.
+--
+1.9.1
+
diff --git a/sys-devel/autoconf/metadata.xml b/sys-devel/autoconf/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/autoconf/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/autogen/Manifest b/sys-devel/autogen/Manifest
new file mode 100644
index 000000000000..4998528684b9
--- /dev/null
+++ b/sys-devel/autogen/Manifest
@@ -0,0 +1,12 @@
+AUX autogen-5.18.4-tmp-log.patch 500 SHA256 984c4411ea6544a83bf2055ac1a5674afd23473c1477b110b279c17d02a21678 SHA512 7467f09109b16aef1ce72e294e627a16bf46d861ecbbf467c3a7317e440a18cdea100d32f3fdbd37ef6140dd65b1b57523983b08b25c331e229ddd132e3b3824 WHIRLPOOL 7915035c26ca0e0acef79d93a186caa823fbb17d2ee9659d109564ad467de540ea069c59ae13f5b1410e48dad46ae7e7aac5534a981df11a3e6bc49b4577dc98
+AUX autogen-5.18.4_fix_format.test_for_dash.patch 777 SHA256 e645569766d4f1b57667c880668fc43642184cb5604063173719d480ab61df02 SHA512 4ac158532ad3e65219d0f8476acf05678d552b9fd13c3299e703a6979723e10fef2b87051983ae280609a6497ba2829e6197a97b18b54b2446ad106c6b9f1ae1 WHIRLPOOL e11477265a55e5487da682a50c28ca875a8a9ea067274fb18947d533d7dbe492484828beb6cfa4c80b690f83ff2884962de4b126999146b671ce08944b3ada77
+DIST autogen-5.18.10.tar.xz 1017960 SHA256 4e248e02c50404ea5c5fc29027d26600f895a9eae7ea5ef851be2c8587abc148 SHA512 cfb06566aebe2aa833f2a032c513aa1d57a803eee82f03d6f6fe3806a0f570d5dbf8331015d2afde89a3d4e4c967b6a367d3e2820addb3ff6a5ac6d481a058be WHIRLPOOL 2eae849d10083da05e0c42931b5f52a9e6ab0f548473a3812e089515ec5ed76dc94008466ab6f4e5bcf5c220898aa7ffba6ecdcbde7d8fbe0134daf45788994a
+DIST autogen-5.18.12.tar.xz 1018412 SHA256 be3ba62e883185b6ee8475edae97d7197d701d6b9ad9c3d2df53697110c1bfd8 SHA512 46de5910e2786a9b0ec96989d3e11be3ed12e5600f01d6fa9291bfbfae42a66994aeca2949837b471827ae3285ec4caafb42bc19ca91146cd7ea7a355aaffd03 WHIRLPOOL 73be676646d29563214de40921d0750bebaf2418d22c2830d6c0bd4287493375b7fbc3f1576425f449d937e16235985f7e7120ed44e8d48486439e7fb317fa33
+DIST autogen-5.18.4.tar.xz 1017936 SHA256 7fbaff0c25035aee5b96913de2c83d9a5cc973b8dc08d6b7489ecbcfd72eb84b SHA512 a02363484de5019bd90fb6f2cf52b1b9556d6cf310c62a68830d0b2408ea4870d3c262fe5d1c27e3586ed3af4a7487d7422ad117760ac2a01ef3cfcfc1f2bfb6 WHIRLPOOL 109cb5637558f8e16cbb9afcb629a9bbd3d5ceae6b897a00101fce99b1a39b06ecc497d9b43441e40b58981dd2402027e89ce6ae76da73b73db934c64bca2b63
+EBUILD autogen-5.18.10.ebuild 1155 SHA256 4a08964e580574b6b92f9d8b306361163ae413f54943a249f6a3da52ae8d19c1 SHA512 ac21f0960ae9196d5214c125b2a55c2d8b0608b23d1f07d76dec31cec55eb1d158c46898d4f632cb67168a193820a40d364231a84268b3369f2d5b4fa2b82faa WHIRLPOOL d906ea64b6f01071711b045ca00ce71adb9b95d41c9b2c38f87f04d51be48a8ae9ec58fb3fbe575ec57f905e2ff4e4c671c07385ddd4ac90ba5bcce39c152898
+EBUILD autogen-5.18.12.ebuild 1155 SHA256 4a08964e580574b6b92f9d8b306361163ae413f54943a249f6a3da52ae8d19c1 SHA512 ac21f0960ae9196d5214c125b2a55c2d8b0608b23d1f07d76dec31cec55eb1d158c46898d4f632cb67168a193820a40d364231a84268b3369f2d5b4fa2b82faa WHIRLPOOL d906ea64b6f01071711b045ca00ce71adb9b95d41c9b2c38f87f04d51be48a8ae9ec58fb3fbe575ec57f905e2ff4e4c671c07385ddd4ac90ba5bcce39c152898
+EBUILD autogen-5.18.4-r1.ebuild 1011 SHA256 f870691bc791499b46ef8f859dca292b552e63f1a02120d12100a1cda0da2e7e SHA512 ba44ae2ba4a267865128f2bed7b08035a9c3f79ea0bfe9a78b0a518886b807b89683e870366a8df6bfe48c8fef9040efdc9f9302b417c2dd4afee5ce617c22b7 WHIRLPOOL fdbcb52b519018aed1f7c7442f2af74b7b57d4c644f54951920ec5b06b814cd6a30b20bf4abeb777b94c01af8921178a2e4d9e7b3231e2510bca123788b6e5be
+EBUILD autogen-5.18.4.ebuild 988 SHA256 125667dd5f60611d45542c66efb441018f9d8b35ed42396752ed3c8e2c40db0b SHA512 703592e8e47e247aba37a140e015d25a46bd3c9d1b1cf4ad1ac49782e39b35b7a376cd27437d8f6969056d879630e0fb55d1e35fabddaa4730820ef549cf936b WHIRLPOOL 7cde847ec269488a190d27a19e16d39f8088e685a964115e2d4bff973bf49d21b78477df8b70f8201eb425567d20f7a64e5f92b279ae91c9102fbc9a1c082663
+MISC ChangeLog 5924 SHA256 6cf9205c2718a40dd62291e018e83598b8a790e348d83b4712e4572797759e93 SHA512 a30ca95519c3ee89ffb2bf7747414a863413813087ec4f5023503d7ba9557f402bb5d109da2f70568fca2705e2f49eecec8a6108f88feef990f550a596b78c29 WHIRLPOOL b63df1b7675cb72778fa3e0a53ef7df8ac25adbbbd7c67e4e219fe3232fc492d23aab2b3e602585714103c86b5d3c156dd9b576a8da950c138e5e99d09840f73
+MISC ChangeLog-2015 13238 SHA256 62ffc05bf40267540954659a8e6d8ce6111a1fc65c13edcfbba23c01989a1b2e SHA512 7a649ee0b718eb91376fa0a9672a4c2d7681d4c4341fc1a2685c71e594105f8cefa3366006413b2214189049f2a7eabbfcefd20ac289bab03d27b6c4778771ed WHIRLPOOL 8f00451bb3e8b1fda71b6178eca2d5f2e963767624df0a650f904730f395e398542bb5667078fc6dc29cff7cdfc20b99a59fe2a37be0a65aa62a378b07bccca0
+MISC metadata.xml 369 SHA256 6b04eb932ac393db3d8955edc14df26cf9f8f44e09e689f85cf47b2b8358b329 SHA512 48f4b495b998480adae388ddd9319edbc0e0e91a35904df6d98d79866b5b814fa20446c7c9b78e5d65c63ba1c281659db3cfa49908e70d85d16f76caca3c7541 WHIRLPOOL 7a5aadfafb4b6cb3567d2243970da579e8f25022a5192387fe482c7db5a8c31349ac20432a31fe5f96feaa7c4d196a92de415ae860e7b2af4ca73d14c290a992
diff --git a/sys-devel/autogen/autogen-5.18.10.ebuild b/sys-devel/autogen/autogen-5.18.10.ebuild
new file mode 100644
index 000000000000..9d29603d3e72
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.18.10.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="https://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts static-libs"
+
+# This should be guile-1.8+, but upstream has a bug with older versions:
+# https://savannah.gnu.org/support/index.php?109051
+RDEPEND=">=dev-scheme/guile-2.0:=
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # https://savannah.gnu.org/support/index.php?109050
+ sed -i \
+ -e "/--cflags-only-I/s:pkg-config:$(tc-getPKG_CONFIG):" \
+ configure || die
+}
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/autogen-5.18.12.ebuild b/sys-devel/autogen/autogen-5.18.12.ebuild
new file mode 100644
index 000000000000..9d29603d3e72
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.18.12.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="https://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts static-libs"
+
+# This should be guile-1.8+, but upstream has a bug with older versions:
+# https://savannah.gnu.org/support/index.php?109051
+RDEPEND=">=dev-scheme/guile-2.0:=
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # https://savannah.gnu.org/support/index.php?109050
+ sed -i \
+ -e "/--cflags-only-I/s:pkg-config:$(tc-getPKG_CONFIG):" \
+ configure || die
+}
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/autogen-5.18.4-r1.ebuild b/sys-devel/autogen/autogen-5.18.4-r1.ebuild
new file mode 100644
index 000000000000..c57151422dc5
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.18.4-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="https://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts static-libs"
+
+RDEPEND="
+ >=dev-scheme/guile-1.8:=
+ dev-libs/libxml2
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-5.18.4-tmp-log.patch #563352
+ epatch "${FILESDIR}"/${PN}-5.18.4_fix_format.test_for_dash.patch #576674
+ default
+}
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/autogen-5.18.4.ebuild b/sys-devel/autogen/autogen-5.18.4.ebuild
new file mode 100644
index 000000000000..596144bc1ee6
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.18.4.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Program and text file generation"
+HOMEPAGE="https://www.gnu.org/software/autogen/"
+SRC_URI="mirror://gnu/${PN}/rel${PV}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos"
+IUSE="libopts static-libs"
+
+RDEPEND=">=dev-scheme/guile-1.8
+ dev-libs/libxml2"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-5.18.4-tmp-log.patch #563352
+ epatch "${FILESDIR}"/${PN}-5.18.4_fix_format.test_for_dash.patch #576674
+}
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+ prune_libtool_files
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/files/autogen-5.18.4-tmp-log.patch b/sys-devel/autogen/files/autogen-5.18.4-tmp-log.patch
new file mode 100644
index 000000000000..89e0277ab0ff
--- /dev/null
+++ b/sys-devel/autogen/files/autogen-5.18.4-tmp-log.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/563352
+https://sourceforge.net/p/autogen/bugs/172/
+
+this is fixed upstream in commit f303a1d5d8d8e002974eb64818f74041325f2433
+
+--- a/pkg/libopts/mklibsrc.sh
++++ b/pkg/libopts/mklibsrc.sh
+@@ -18,8 +18,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/>.
+
+-set -ex
+-exec 2> /tmp/mklibsrc-log.tx
++set -e
+
+ top_builddir=`cd $top_builddir ; pwd`
+ top_srcdir=`cd $top_srcdir ; pwd`
diff --git a/sys-devel/autogen/files/autogen-5.18.4_fix_format.test_for_dash.patch b/sys-devel/autogen/files/autogen-5.18.4_fix_format.test_for_dash.patch
new file mode 100644
index 000000000000..644df648f59a
--- /dev/null
+++ b/sys-devel/autogen/files/autogen-5.18.4_fix_format.test_for_dash.patch
@@ -0,0 +1,25 @@
+agen5/test/format.test: export AUTOGEN_DNE_DATE explicitly. DASH does
+not export when the assignment is on the same line as a shell function
+invocation.
+
+This is a backport of part of upstreams' commit 89f12c15.
+
+See: https://bugs.gentoo.org/show_bug.cgi?id=576674
+
+--- a/agen5/test/format.test
++++ b/agen5/test/format.test
+@@ -79,12 +79,12 @@
+ </script>
+ _EOF_
+
+-AUTOGEN_DNE_DATE=false \
++export AUTOGEN_DNE_DATE=false
+ run_ag x ${testname}.def || failure autogen failed
+ cmp -s ${testname}.base ${testname}.test || \
+ failure "`diff ${testname}.base ${testname}.test`"
+
+-AUTOGEN_DNE_DATE=true \
++AUTOGEN_DNE_DATE=true
+ run_ag x ${testname}.def || failure autogen failed
+ dte=`sed -n 's/.*It has been AutoGen-ed *//p' ${testname}.test`
+ test "X${dte}" = "X" && \
diff --git a/sys-devel/autogen/metadata.xml b/sys-devel/autogen/metadata.xml
new file mode 100644
index 000000000000..36983a069cff
--- /dev/null
+++ b/sys-devel/autogen/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+<use>
+ <flag name="libopts">install the libopts tarball (a few packages want this for developing)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-devel/automake-wrapper/Manifest b/sys-devel/automake-wrapper/Manifest
new file mode 100644
index 000000000000..6a0c5bd775a0
--- /dev/null
+++ b/sys-devel/automake-wrapper/Manifest
@@ -0,0 +1,5 @@
+AUX am-wrapper-10.sh 4626 SHA256 9a3ba62f144c7dcf9d58ef92d71a259ff879cd346cad9d973664b7a92e305bbf SHA512 6f1611000ac2dd901a24efd133522274aa8feea02610645f3b1332a3f294de687f65e995b398a487b1d030c74dd278f65fcd224007ebe7e950af03660cc38f60 WHIRLPOOL 9d51c0fd4a3ae44a9b3e3a873a60eaf4309e00a45b55ab3e5615c967d76c1c989978a79e76bfce9bae9ac8f14d81a9f2036d7638b0d5e3f7400ccda0954e30c0
+EBUILD automake-wrapper-10.ebuild 940 SHA256 f3cbe9e75fb11cf972436581aa0c293928644a8d05ab54efd823785264550bcb SHA512 8768c7681d53e6c058a9395df162d74ab38af27a04deab822272ae744f32f3f574bd0dff1c6b6effc93dc0e9bb011fdeaddcaa97c4d585b11578e20ff9d1509c WHIRLPOOL cc2396b49793a02ac284bfb45ab2fc4b8ff606ee81b736bb3f3176dd3b15263ba1cc4706334231e3718aa295514b8a169a901e3048e4aca73672f05e79b179ed
+MISC ChangeLog 3367 SHA256 c28723e96cf2b5d34d182b003f93ffc199af06fab0662eddc87946f42362f08e SHA512 6fa6417d15980f6ba7c0db3f8ec3f0165b8cae12d010bc86325a7e530f1b93c14ade8dfba849d5731c1542cfde15c68c0702d1b7b1641ae7e5e607738cf5a8bb WHIRLPOOL 5c6b7b24f187550457ac88fbdec40dc9e4af2fdbae4e72342db57074cc446d7f6a7422c2096779f4a0e49c443095e498453014d3bdce529303334d1d8eeb5a3d
+MISC ChangeLog-2015 10371 SHA256 d179264a702dd8a7c0cf83c177674efe4793959b3ba4541c8daab193d976a3e4 SHA512 98eac805eacf0c981cc9488df65a3237c843937e9f0183f49396393fa66ef56763db4efbb490515e27c4f3500360bef3d5e4e1447829c94a9a19b88e810d928f WHIRLPOOL 7177fd9f8ac88149ecf4653abb0b77f5a444cae210237fe7a21bfba11c8246dc1694ff73adf7e1a49349a6155ebc38b862ceeace8eea88242e69d0bfc5605658
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/automake-wrapper/automake-wrapper-10.ebuild b/sys-devel/automake-wrapper/automake-wrapper-10.ebuild
new file mode 100644
index 000000000000..bf2ec3f5301e
--- /dev/null
+++ b/sys-devel/automake-wrapper/automake-wrapper-10.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+DESCRIPTION="wrapper for automake to manage multiple automake versions"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+S=${WORKDIR}
+
+src_unpack() {
+ cp "${FILESDIR}"/am-wrapper-${PV}.sh "${S}"/ || die
+}
+
+src_prepare() {
+ # usr/bin/aclocal: bad substitution -> /bin/sh != POSIX shell
+ if use prefix ; then
+ sed -i -e '1c\#!'"${EPREFIX}"'/bin/sh' \
+ "${S}"/am-wrapper-${PV}.sh || die
+ fi
+}
+
+src_install() {
+ newbin "${S}"/am-wrapper-${PV}.sh automake
+ dosym automake /usr/bin/aclocal
+
+ keepdir /usr/share/aclocal
+}
diff --git a/sys-devel/automake-wrapper/files/am-wrapper-10.sh b/sys-devel/automake-wrapper/files/am-wrapper-10.sh
new file mode 100644
index 000000000000..235474fbf3d9
--- /dev/null
+++ b/sys-devel/automake-wrapper/files/am-wrapper-10.sh
@@ -0,0 +1,186 @@
+#!/bin/sh
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Executes the correct automake version.
+#
+# If WANT_AUTOMAKE is set (can be a whitespace delimited list of versions):
+# - attempt to find an installed version using those
+# - if magic keyword 'latest' is found, pick the latest version that exists
+# - if nothing found, warn, and proceed as if WANT_AUTOMAKE was not set (below)
+# If WANT_AUTOMAKE is not set:
+# - Try to detect the version of automake used to generate things (look at
+# Makefile.in and aclocal.m4 and any other useful file)
+# - If detected version is not found, warn and proceed as if blank slate
+# - Try to locate the latest version of automake that exists and run it
+
+(set -o posix) 2>/dev/null && set -o posix
+
+_stderr() { printf 'am-wrapper: %s: %b\n' "${argv0}" "$*" 1>&2; }
+warn() { _stderr "warning: $*"; }
+err() { _stderr "error: $*"; exit 1; }
+unset IFS
+which() {
+ local p
+ IFS=: # we don't use IFS anywhere, so don't bother saving/restoring
+ for p in ${PATH} ; do
+ p="${p}/$1"
+ [ -e "${p}" ] && echo "${p}" && return 0
+ done
+ unset IFS
+ return 1
+}
+
+#
+# Sanitize argv[0] since it isn't always a full path #385201
+#
+argv0=${0##*/}
+case $0 in
+ ${argv0})
+ # find it in PATH
+ if ! full_argv0=$(which "${argv0}") ; then
+ err "could not locate ${argv0}; file a bug"
+ fi
+ ;;
+ *)
+ # re-use full/relative paths
+ full_argv0=$0
+ ;;
+esac
+
+if ! seq 0 0 2>/dev/null 1>&2 ; then #338518
+ seq() {
+ local f l i
+ case $# in
+ 1) f=1 i=1 l=$1;;
+ 2) f=$1 i=1 l=$2;;
+ 3) f=$1 i=$2 l=$3;;
+ esac
+ while :; do
+ [ $l -lt $f -a $i -gt 0 ] && break
+ [ $f -lt $l -a $i -lt 0 ] && break
+ echo $f
+ : $(( f += i ))
+ done
+ return 0
+ }
+fi
+
+#
+# Set up bindings between actual version and WANT_AUTOMAKE;
+# Start with last known versions to speed up lookup process.
+#
+LAST_KNOWN_AUTOMAKE_VER="15"
+vers=$(printf '1.%s ' `seq ${LAST_KNOWN_AUTOMAKE_VER} -1 4`)
+
+#
+# Helper to scan for a usable program based on version.
+#
+binary=
+all_vers=
+find_binary() {
+ local v
+ all_vers="${all_vers} $*" # For error messages.
+ for v ; do
+ if [ -x "${full_argv0}-${v}" ] ; then
+ binary="${full_argv0}-${v}"
+ binary_ver=${v}
+ return 0
+ fi
+ done
+ return 1
+}
+
+#
+# Try and find a usable automake version. First check the WANT_AUTOMAKE
+# setting (whitespace delimited list), then fallback to the latest.
+#
+find_latest() {
+ if ! find_binary ${vers} ; then
+ # Brute force it.
+ find_binary $(printf '1.%s ' `seq 99 -1 ${LAST_KNOWN_AUTOMAKE_VER}`)
+ fi
+}
+for wx in ${WANT_AUTOMAKE:-latest} ; do
+ if [ "${wx}" = "latest" ] ; then
+ find_latest && break
+ else
+ find_binary ${wx} && break
+ fi
+done
+
+if [ -z "${binary}" ] && [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "could not locate installed version for WANT_AUTOMAKE='${WANT_AUTOMAKE}'; ignoring"
+ unset WANT_AUTOMAKE
+ find_latest
+fi
+
+if [ -z "${binary}" ] ; then
+ err "Unable to locate any usuable version of automake.\n" \
+ "\tI tried these versions:${all_vers}\n" \
+ "\tWith a base name of '${full_argv0}'."
+fi
+
+#
+# autodetect helpers
+#
+do_awk() {
+ local file=$1 ; shift
+ local v=$(awk -v regex="$*" '{
+ if (ret = match($0, regex)) {
+ s = substr($0, ret, RLENGTH)
+ ret = match(s, "[0-9]\\.[0-9]+")
+ print substr(s, ret, RLENGTH)
+ exit
+ }
+ }' "${file}")
+ case " ${auto_vers} " in
+ *" ${v} "*) ;;
+ *) auto_vers="${auto_vers:+${auto_vers} }${v}" ;;
+ esac
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+ auto_vers=
+ if [ -r "Makefile.in" ] ; then
+ do_awk Makefile.in '^# Makefile.in generated (automatically )?by automake [0-9]\\.[0-9]+'
+ fi
+ if [ -r "aclocal.m4" ] ; then
+ do_awk aclocal.m4 'generated automatically by aclocal [0-9]\\.[0-9]+'
+ do_awk aclocal.m4 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?[0-9]\\.[0-9]+[^)]*\\]?\\)'
+ fi
+ # We don't need to set $binary here as it has already been setup for us
+ # earlier to the latest available version.
+ if [ -n "${auto_vers}" ] ; then
+ if ! find_binary ${auto_vers} ; then
+ warn "auto-detected versions not found (${auto_vers}); falling back to latest available"
+ fi
+ fi
+fi
+
+if [ -n "${WANT_AMWRAPPER_DEBUG}" ] ; then
+ if [ -n "${WANT_AUTOMAKE}" ] ; then
+ warn "DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}"
+ fi
+ warn "DEBUG: will execute <${binary}>"
+fi
+
+#
+# for further consistency
+#
+export WANT_AUTOMAKE="${binary_ver}"
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+ # this shouldn't happen
+ err "${binary} is missing or not executable.\n" \
+ "\tPlease try installing the correct version of automake."
+fi
+
+exec "${binary}" "$@"
+# The shell will error out if `exec` failed.
diff --git a/sys-devel/automake-wrapper/metadata.xml b/sys-devel/automake-wrapper/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/automake-wrapper/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/automake/Manifest b/sys-devel/automake/Manifest
new file mode 100644
index 000000000000..b9b48067dc2f
--- /dev/null
+++ b/sys-devel/automake/Manifest
@@ -0,0 +1,69 @@
+AUX automake-1.10-ccnoco-ldflags.patch 901 SHA256 98c85d873eac326a4b6c6afde25d887da85a45bae4bb4fad853a40e46fba7af5 SHA512 bc823b9387277c06944faef1abc4277c4f6e8024cf9cdfdfb2b9f333d578cedb6c5071fbf49ee420dbe696e8a8bda4583829e3eca225e9ba7f5d0ca0e2639ca3 WHIRLPOOL 362418007ee70757c2908d43600087ccfcc950a2a5d0cac638cd95417738ee5e848d1248466c607e062d96c2f00d65ddb8743a7ac3186d1445aae19798d6b949
+AUX automake-1.10-perl-5.16.patch 3555 SHA256 6482568f4934c545017edcd30c3e86545e004f3f88cafc97aec9e5a251911f4a SHA512 050d66f3f1b4aed6482a234b32bbdbe231ddea0c9f4fb2ff97e963095ad69a487fd65986189fd659fbe8d8d011f3f866e92e506e653fd832d2adaf3263ed33fc WHIRLPOOL 09f57b56a4490d42361e132e4f2f44291f52d5983bebb5b93173016b12591572350bb5d2afc6a4a9aef20b202db8367fce3a57e1b2a23ad14cac9233a55bd3cd
+AUX automake-1.13-dyn-ithreads.patch 2126 SHA256 5f97e051c780205696c6173bda36b1ba661beadf0b66ed564b7a7e6abd569747 SHA512 7a3795cb8b14b347a296abd410f3a740401e796a06317e52fa1ef8b0866099f71965f7fb12fd85db2ccc7445f310a4dbff6870d8a63e72c49ed6f8ca9da97277 WHIRLPOOL 4e63dacb6fd3fcdb974d38ca65fa943232461b0c543b3c092c1d53ff4ad51ccc6ce74dbf56061f262dd5e29ff078eae053b4967dfafca0578fc133760f207108
+AUX automake-1.13-perl-escape-curly-bracket.patch 1135 SHA256 3e1223d7fc6f91ced150df4a71a5c0621a3e2ddf725731f103a66d88ad092b66 SHA512 857d7ef08f2b8ff5569cf3d52cda2cb419ff006eb9208535d902f1a9de0743443703f280e85b5ade90c66ca17bc21b1dfd44494e93ff865cc141523cb25ef564 WHIRLPOOL 572b3e29d6a739d265ad01f2fc6d5e747b25207d605bdf7930de6fcebe413f9a4bd89fc4b9eed29a408a2983ae971d0edd5488179d5cda4fce6bc608753df5f5
+AUX automake-1.15-mdate-tz.patch 1757 SHA256 6409933549df0afcf9dcece8b2036140290999512b32a6554a6d898ae1d80fee SHA512 c4fc5a2ed4d7d6e0dc06f0e90fa84bea99f35145a885485fef072c4e0dfc979f696959e1d54381f78de429a11d5ee9b061686cca8fd1c85469245d5b4d2cdc52 WHIRLPOOL 217c2ca5a15cfa159b473aea0691f8b0f494b4b1be1845b2f39ec0c0ccb5a392b53f00a2de496076094f878db583432d75f22e2c5e858897b97b052933168c67
+AUX automake-1.15-perl-escape-curly-bracket.patch 1129 SHA256 1f5c086733cdb7b64c5a160fea22ab90eaec45664db47a7fedf82051eb7f6b56 SHA512 d6c2078e7eebd4e5104e7c9d9b5623cab322689b520e28b788a0e6fc52d795ef24e246f72ada9be6aae7d4904e34e4a6f2b6dc94abb3ed70b338d89985ed2164 WHIRLPOOL 7e2916b62811b79d80ac03cbe96b1c2fb32ba64747e93e5913931a7c10efb5560d9cfb81d5c4c953d0894f97382ceb62a264ab627b123c9323a03b0e9591a7d1
+AUX automake-1.4-CVE-2009-4029.patch 2186 SHA256 29a556dee26b3081ecfc5b04eda8c3e5430a3e48a37f156ffc54b1d2132d9275 SHA512 cf65172ee59f91869b13292204e9744fb385a2cf13a17dab0e1dba5b1f403da55d1bd73448b00d81f46de2c9e7de1347e7b6868cd6f4b5e97e255a5c206d2d31 WHIRLPOOL c551e1f23d080c4052cc59b30bad69be59e16737a42a2acc3a7b752c613d2ab6726daf23eb6814aab6457d3efd1c68309c7766fc252f323e925fa27992592ee4
+AUX automake-1.4-ansi2knr-stdlib.patch 249 SHA256 8a29de01493b888f392388a0cffc0e4e2c0f4d81bc2ff34a4b65d27fab804210 SHA512 db8d0e71e702e236b1e9d6f2ff949b6981a02da4ec143219ea10327f7c6dd9845f100c62c715b6cda46082dbc2cfb69bd50aea64d5fccc5bbd6fe81351a0012c WHIRLPOOL c007133401ba437cea638c17486819c0e866d7050b7e9f348e36d03721d2fa7942a4ff19fa66a3d648e37f126c984ad22eea00941413d9588280eea81deb4091
+AUX automake-1.4-libtoolize.patch 542 SHA256 1620b99a3043c66d6e6ae8a369733a1042ff5deec08ab11c727dea15032a684b SHA512 1c9ee6d970cc9eb393e959c12518173ac49ec88d07ae52ca026807b52502a52f3f019916503e1fc444ba83bc21a6df74a95abadbc2cf938f79fd63299cd64846 WHIRLPOOL f2fa419cd4ccd5889929795d70358304d805fb2f4142b7987e8828050b575997d537c01a885effca25515b50697b1f23a6090a1f1a1314a9455e89d48ba64b48
+AUX automake-1.4-nls-nuisances.patch 746 SHA256 aa35eb06e5aff390812e31c705976a11fbdff38a5567737f0b234a3fb00fd002 SHA512 5821637eb9cec970feb4cf1b09dc6efcd5b84cfce804915d31eccf810983e0b837c3fb6c9a4af857f4bb0545244f3d824138ad364c2073fab34d858aa8ff7d8c WHIRLPOOL bdd1e2334e52e3e09fdc71e7dbb9f2104310077f1d6d1ddfca307e62de1368a2129bfbf2547edaba1aeb2f9df0c5e91c2a7737f2eb35a8130cf827a1d78168ee
+AUX automake-1.4-perl-5.11.patch 839 SHA256 4b795f3a721a88034699cb451df251a36f92b2a144b3e088687a4b64588b19d3 SHA512 f604c8334a942c345c4f63a07a18d91123f840a66d9314d99853a3133caf032f8dd6ad65b124f78f89c9494451babb3245a8ed7e771dbc9e479c302938fb62d5 WHIRLPOOL 6af58b295f522cd94585cf8d88099be37bb62987852608a4f6a0ba90c81dd34fa6a9808b23a72f7b94befc6ba4c4440ba0603a076e07d30c552d68c46e7a37a9
+AUX automake-1.4-perl-dyn-call.patch 738 SHA256 ff53c08dca459d9c2f7edeefae6938fe64edaa74de27f7bfb8eca905e7fd442d SHA512 69a1d2ff4265e2cc3935313e95337b3b4c3b52210888ef15c15a83aa35e2b564e04f03bb8c8bca6877913abb2ccc5ea4351eb245b4b6e5f48f19f8010941e24c WHIRLPOOL 31699984c0251a5ee794b976f8fa5b8f68cc8aff69038fafe3041565dc3fb0280bc420dcb096a8eac422374496674b7cc629b52121aacfa907ccc6aded22c519
+AUX automake-1.4-subdirs-89656.patch 944 SHA256 94e279bc6479b1753ad76334837d236e8b1f13d6a1be712da634fa7498247640 SHA512 3aa2d98bf64294f608c081df2c316064ae86d7d7b05b60f79a571049e8d125a91309771edeb460ff8d29bf2536e0fe0542c0c247764338be9af37c0d32686670 WHIRLPOOL fda2479ea2e4bf02581a5cd19027ee77df643095761580fcc339e8b2de694963856a0025841402056a9286bb0fd3bbe750b87e658f1fecbdea4f0bc0e1c3c5b4
+AUX automake-1.5-CVE-2009-4029.patch 2316 SHA256 b31c72cc038c89d118ea33d73eab11f539f5f2358db40fe51dd7563e2ad365ee SHA512 2961ce03774e55623362b041214e8b1ecc98c193ca1b080938b848c3069e25438fd023a41ac73ca6aaf51d537e836fa8bcfbbd3e6e32494ba758ecbcbe2458ee WHIRLPOOL 53ee3b6b15cc4801fc443b8815c1f3aef7a26e1d9eae4820215dabe7ff00c77864a2ef7a5600bc24a9e59b5af817579382956a0a7945150612362a1d5b252ced
+AUX automake-1.5-perl-5.11.patch 806 SHA256 117185ff77405d4265bf152f2a5bba2edf9e1bfc4e0be5d49c49d1628400bf2d SHA512 1eb9314be86d7e775c1bbdc35d86d3f0e8b5ca81e4c170a6fec63dea3895c81c770e101660e4337a942fa2c34aeaa6b8b1e7eaed3d310921c23292dbcd25febe WHIRLPOOL a98e59cb11aa252795497799173d176d077afc6bab54315e8e7dd5b8a349e1b35111f700cd220f7a947f7ebf55f87ba4d774418173a53404e3bf4a19b85b850f
+AUX automake-1.5-slot.patch 1191 SHA256 b1395634c1dbcd1c7071a371989a91838c3149e8f1399ad14ed9d4c062c99ab3 SHA512 031b592f62b95a9832a034838f2b0e1b3bc120af9e1582f03f66da3cc4d9bdb0148417da3e7064ace01e028e2c0c9b94fe59da95493dc736a6f75718e2fd0121 WHIRLPOOL 37a7339cc8e852b42d0ac88a74b4d567108fc84350224651bc342f87a80d95b85476324aa0bdd104cfb29c425519319f061d8b49dceed76df39a715158572bc9
+AUX automake-1.5-target_hook.patch 1132 SHA256 7169c860060faeeb698195ed82cd742162e5375cec0d2b4037b0cbb09998a421 SHA512 3d21577b22bd2d6bcdb78259f0b8ebe4783184785868e1b54740269c627045fbe1608e01bd044ad85e848fa5c6eee241b6c0c9626369d839784cbc79892fdaea WHIRLPOOL 01d4fe0713accabcf587bc6f30233e57d9aab71d8cd576a5f59d1e33bbd55bb609a5b3d169f452c3996445ac22bd14d50e43b98ac80ba635ab8cf6acf9df8056
+AUX automake-1.5-test-fixes.patch 1300 SHA256 117bdb7848b0c7daf8ed6253e81de265c92f427176e703c28f9de4bdbb13c235 SHA512 5642985801c0786678062f50fbc8090c4994c53b989727e274e4054d37dd9efc0de44b160bb5eae71fbdad289daf406812963d941a68953d1f6314089196f0f4 WHIRLPOOL cc90f5370b419e0ca4e67097fe55929adb6a96412270d191da965b67741f135b991a74fac412f7fc00425e225e50b86dad86f935b39c842b0f9fcc34c1728929
+AUX automake-1.6.3-test-fixes.patch 723 SHA256 4cfdd0646848be45106befc2652d88c307212decfd3869a029315eb8ba082134 SHA512 6f3b97d87412906a812febd813a4303b1dde51454732256e4b483388eb602b471262f79822ad222e738199d9583ae3d91e266197385d9a265306907a696d8b93 WHIRLPOOL 1a1cdea4717f2dda4de87e78b2030660966ca213d3f60deac822b892ce916c75dc9cfdd979a3022573a68dedfb80329f1e180a55f48530cf7da79861c16ab03d
+AUX automake-1.7.9-infopage-namechange.patch 592 SHA256 3e0dae801e4ff79dc2d5a469a8be1efb5df09344f566cf39b897f385b39212ee SHA512 15770a375b60a39a453c1b0e2bef5eb05d567ae230429fe009531f5d7d059bd182772b9cc06daf2bc7640628ee463b4c4529a74714f329b04078c4174140e2e1 WHIRLPOOL a622f07e55b65dfd6b1c091e8b001258ca9a6acca08fd91212064cc4895491011856632466d6697b3c5cc1cbdf14e343fe84779751f88384d5a7f4842d19ef76
+AUX automake-1.7.9-libtool-2.patch 859 SHA256 3e919b1611dec9bd3a43945c881aa11cca6c3359e3425805d32d386be4d182d3 SHA512 1e571d20a0a8d5928c938e3892e5cc5d76abb678f726ee85afb5d29417ccd2167c249a8c252496312277e8dfbf9b0f7c5c6b77cec1e861a02400dddb5d4711b4 WHIRLPOOL cf524ceeaf0a81c2bc6657e30406bf20e8e1a8f5a37fb13011427c228c3097b625c9cd2c5ac8ba611cecceff364d8f102bb5c4d71cbcd80f9ebae69bd95affd7
+AUX automake-1.7.9-test-fixes.patch 1159 SHA256 44221e4c945b0cb61663cb2857a3238e50800d228e7612203529726c53272dbb SHA512 ea4a6ded1a6f605dbcb3cf3da1c6f369c2dd4abf3739185df723ffe52eb88ef93ff1e9b23323c7a94c477301250873dbeea2af2cac1affdfde9d67ce7d38a679 WHIRLPOOL 3c41d2362d1d024bae8d7afc1d45de3935c1acec004d53806195857e9237b3c31af0fcb3c2ac6a7ee5c6c419fa7608e5fcb7d38e986dc61693adf490fe5d0811
+AUX automake-1.8-perl-5.11.patch 784 SHA256 c6266e5d013b1d9a55532feba79b5bb60e71bb902e478971d3f845031974aca2 SHA512 ab574c2af5a4b1c734d547611e74057984092b7058e638344f3c2350858a8fd45fcdd5c8a7631d6d54777458d6d6f79f922b0b94c653f3370a386c035ff9eb32 WHIRLPOOL c7a57e8edbce7f5e1673dfc714f6622728085b41aabcc7cc0d51a343cf25dcb54612042fd046223064d9e6df93d97de3a46aa009042e515dc02f8a4e9d118b4c
+AUX automake-1.8.2-infopage-namechange.patch 1131 SHA256 305979b9a07496352bfc6cc2177bf7aa1587ef1d0dcbbab1de7a56cb9d0ac539 SHA512 cf39407187264c1db540701c9e1164c5204b4cfdec02f93e91298b582b13e0fe77c5d272801df9bb50f2cda5dcd14114386f9f445eda28c51bebc1f61fb828ea WHIRLPOOL b2c9e43827f5ed932bf615f7fae5d9e1d0488c859c7c4c26e99e95459a0d5cb19d2b92a4f3f70b8525df0eabe39b8f74c39b6b8847e84c0e0436d02ebaf03411
+AUX automake-1.8.5-CVE-2009-4029.patch 2256 SHA256 2c249ae1c93210f00ba3a58624b99e3490f1e58117bd41d2b4fcb838f7b8a5fe SHA512 e7043688eb420facf38efddc745d57f2adb519bf85eb5a525a99b495b67347a476aab06570f4be1c8585cc07ef4c3d43468c015fbc103a0e34123510c3f84e35 WHIRLPOOL 556769096122ef4b91f201b5832b7099a5f21fa9b18f9ef7d3150c2c1b5f697e1d904a9d264247b7ef10cd01d17ae242008d607afd98ad52eed5ac5bb34a87fc
+AUX automake-1.8.5-test-fixes.patch 1068 SHA256 1a94bcc5a8e33b4c187e6291ad672daf3dca7b2e2995586d6af39f653678cebd SHA512 703c40549542dcd55af05201e3c40118ee138398da6dc87ce7b880ee71a7bf15ad1063d8ebcf9807c2849c8a981367d2cc5f9f5b14c060ce36303250ec792685 WHIRLPOOL de21f954404b49cfdbd9179887dbfb569e349d46f35aac2f86f2c86aaeaafd356b575a601b64a15c1dec0cc56886a5a166c618539269ceb15cbd7d80c977bb09
+AUX automake-1.9.6-aclocal7-test-sleep.patch 1102 SHA256 9bc281d49a753a6135c65b80642b03a6056538a6e944aeb344f1ed460be2904e SHA512 9ac24b6ff41b1fe17cf36d10c9b3e7a52b35cf7384ddbb03328a4593da76918707a47717a21257a86fa28c39e6c7648d0309ef7bb71be65744151704919dbb16 WHIRLPOOL e58a93603085c057e164fb44215d0c7b53eb3230eaf010ed855f3e960f1c512907f088ec7883aaa8f07512a76cf0602237a827b1d96335294699c20dd0d80ff5
+AUX automake-1.9.6-ignore-comments.patch 614 SHA256 28b80f088b53a72935f15c7d845919f474224ece83847d7b3bae5f2236fe30fe SHA512 c4475c97573a643441541a9c601d5f3db9464577366f53f7693295df10707aa605c112d4d05fddd9a01ada5cb7127283a70f65b970a1e6cfc141664886a7e60f WHIRLPOOL 440f1d2ddbf1b8573b10ed00090d49ca5b80739bdd151c964be0206fc64aeeb6cfafba9db34e2b02e7772cf8b167865766ba4345c3531859467a9958d4415abe
+AUX automake-1.9.6-include-dir-prefix.patch 1106 SHA256 01d85d830875aa05eec4ad209033473f3f8603f66781fdd9fd9b3cbb07ecbbd2 SHA512 dc555aa143bf620a88ed7192321a1eea4dff2d1d9cd3ccfeee0694b3d47516d055632d500378955c437b5d99af77cbbac4d7530ad91b3bb8df9a35f94b7b9fc7 WHIRLPOOL 83b135a99de39a010f2c7852df7bf32971b7109460fe4d7c0d58af2baa12771e1021f00d2b44400eefae7906a7c2a42405be89d88ef9df0edf4c09ae81657287
+AUX automake-1.9.6-infopage-namechange.patch 1156 SHA256 32fcbef369731846abb28181cc924c4d8261eafd3b86d3c506976de622b76737 SHA512 a4f969db72a38b3f93462670ddaead5147fe3a2065d2fd33a403e7cf89585fafa73b85771490a02144a524e811dde2c36857253b2ed1ad8e7c4d4027a352032b WHIRLPOOL 0b256273e48635bdcef4f293f9cb59343e1ec076a7951a0e1a23e427e1ebc6c29108a486fd9556837bfb27cd42dcadf3e7240f04d391b589954fb7ea03b541a4
+AUX automake-1.9.6-subst-test.patch 1332 SHA256 3e793187719a3149f24eec1c4d4a3603ae02625f31c82056300d4e37248bd359 SHA512 f5e8106e96f5976d8f958665b53cdf1088d0620f7d4da3b9f5a73766ddc32c4eff13d39f245a8a01b90567c364949a94bc7ecdcc4b8214b43d2f7f6b1740a891 WHIRLPOOL ddb526ae2935790c53057f31869e6b8931f9009079a69a492bc2e5df96a52394b3ea1df132cc6950d683a1581f128dbfccd8a9df5b1b5d39d36ccb1d5be82b90
+DIST automake-1.10.3.tar.bz2 957505 SHA256 e98ab43bb839c31696a4202e5b6ff388b391659ef2387cf9365019fad17e1adc SHA512 4f4172c53f31103a93baa794bb498c8b42c1a06e5e0c909063863cdfee3f768016bdecf46e64417a8e362d4c524907b48c0c1b24f510d26aa66bcfd85d0b2598 WHIRLPOOL 6c1b915b87012fab9c7323843ff69a33cc3bdc71d5bcb4ec743b8e8ab34be46dc8a8b72fd41b805f4ad2c723640c9d2b74cdf39355295022219a1138e28794b2
+DIST automake-1.11.6.tar.xz 1092908 SHA256 1ffbc6cc41f0ea6c864fbe9485b981679dc5e350f6c4bc6c3512f5a4226936b5 SHA512 6e4cdf69f07734954f770fd4a7211a8c9dc69fe25a7746bd3c1e01d3139c94cab2900399e87371548833e99687e0d2b59c5e746ab2fdfbc7d47f2c1d439137ba WHIRLPOOL 79b45d6e1dbdb5df5d17fef318bf38d83896fc91d532c8814fa96144409c53f976ca26c6fcb9baab215b289afcdd177a8ada455af99926d27861950a993438c2
+DIST automake-1.12.6.tar.xz 1400336 SHA256 f834ab2145b1ee24bd85387950044f5cb418dd0af2b84c52e60c2bf29162dbfa SHA512 ddcd664ef8f52a44c0adbe908e3a5a2844d8768932211d75dedf262827ffa411b5c3599f93a212f1c979108122cd14bbea5e672218596dd7c934a25d805aae5c WHIRLPOOL 025be98b482fdaa5453b55c00a061cb92bde0ec794599c9e4fa615706e853e26c912b569e364e853437d2494b86a78e30229e868e889685791aead8f38ebe56b
+DIST automake-1.13.4.tar.xz 1449608 SHA256 89ce4933f59b8f0c20115c39cfe450a595cca74ede27b6881e88ec27720d1d66 SHA512 c9b145c1b822a4d83f2899f4280a76ccae932301b273f4c9718dc7f53161aa03dc1be2c1fb1a61083c54186e1908ae2c8284250aa1d8f6dea484767aca1344d3 WHIRLPOOL b2c8e06135adb956d67ddf15e56d514e697e8881f4e2d95055fbad1d723c54bf9e73cea81eca9bb5c58ed39b4a709a0906913dbcc1d8fd87dfbfa0bdb1abad33
+DIST automake-1.14.1.tar.xz 1488984 SHA256 a9b4f04b8b69cac2e832a38a718943aa976dbdad0097211f8b3448afdacf0669 SHA512 5de971159dfca2ec74c3c9a2f1368331efc437b146d675740c8735fcb0d32a30d0560fd29df64c3279efdf9278152c82a9ff09040b3e64d84743aaf25b26ce69 WHIRLPOOL 916ac13c419ecf2fc8acfe8edcbc33b85cfed2a355f6614bec3ba79dc0dce8c1309be26702ef5dc2453ed84e4315b585524a2d7563b851493750118e4298fedc
+DIST automake-1.15.1.tar.xz 1509496 SHA256 af6ba39142220687c500f79b4aa2f181d9b24e4f8d8ec497cea4ba26c64bedaf SHA512 02f661b2676f1d44334ce1c7188f9913a6874bf46ba487708ad8090ad57905f14aead80fefed815e21effacfbb925e23b944ea7dd32563dca39c1a4174eda688 WHIRLPOOL 31274d005dc7d6cc657e54407ab6609348a412298d0793b1292e10e378377afcee5d1296c353e7bc9207f755f17126bd67307e8e6f96b9ccc974842b84976a59
+DIST automake-1.15.tar.xz 1496708 SHA256 9908c75aabd49d13661d6dcb1bc382252d22cc77bf733a2d55e87f2aa2db8636 SHA512 200a13f49a3f492ed27bc2eb615aa2f47e775e470a781f6821cd43e0f7b927d091e690b4a23fe5cc8fa79c48daaa9436be4b968784696c3bdbf1634b456cda47 WHIRLPOOL 5c7878f46fd3d0104b5fa6a17f985d5cb57ac4a1c956763953acce411756a94b3e8e3b5a701f28c0a4b8c3cd60d60ab34561ae88706e6ccc54f0d76e1174502c
+DIST automake-1.4-p6.tar.gz 375060 SHA256 503cdc2b0992a4309545d17f462cb15f99bb57b7161dfc4082b2e7188f2bcc0f SHA512 3f3235e68ab6703668deac015926124c7eeeea6925e830c6820cb156f15f8ee3febd0fd0cc2ab4f4b5c405b528e4ce12b2459347f62ed6a1a862bc9969163d9e WHIRLPOOL 2f685ec2f0952d58f313c80c3d7d272734e58c10dfc5dde32331281b55ac4e3b06b820e188239c98ec8703229414f9621f1ce7f241fe17ff4e564b84f21e5b2e
+DIST automake-1.5.tar.gz 526934 SHA256 24b4775e3143fd3e35db5cbaba80845d9359c7bfd751a6cebe3014fbf6115d78 SHA512 b9dbece18935b6c08f7d17c456b0359a17362dc030692629cf5d66db675e46a5f24d60dfd20a50780e4096163454f1922d4281c4bb7af336d61e527b579e3bfc WHIRLPOOL a61e8adf6c728e3dabb3e5faa22501d2bc3c78b0ae17bc68ff826f9c350137ad276e01a18a86f079e0bf57fc8d0628160db2e36a0935d703a7fa7d5857dae1df
+DIST automake-1.6.3.tar.bz2 476275 SHA256 0dbafacaf21e135cab35d357a14bdcd981d2f2d00e1387801be8091a31b7bb81 SHA512 8407ea7d51a238622326d89c22777050c2a49d456e3e33c53985f40e4108094ef149693568d926cd1e9b2ddbdb5693c0d0ec6220e0f7bbae4341b6be9f0d060f WHIRLPOOL 168792f008830e2a25b40e0773acfeebdd483f64e83bb595be5e55da69fecf99e1b8b7b15ff82e8f80a3ae0694ccde331c907c33632389a18483fbbe59670c57
+DIST automake-1.7.9.tar.bz2 577705 SHA256 32c13b6ad38ed5e7bfd1756cbc19cf5efd67b7ade2d06000a4c99b0ce94bd46d SHA512 372f326cdf9c893a016473b959f0d3b92a7a82a13978e3950a887a79c93856a635549ebc63945faafba30b8be6db1c4cd68385f7dfe1cbb36386400acb2aa7a2 WHIRLPOOL 0536bec58cc4fa2ed739ba473443099f1f4a33b5cb61f9fb04c4901baa694643debd3028c8acd764b1609f439b67c02c6b4ed6e1e8b34a5f09d2280d896345a7
+DIST automake-1.8.5.tar.bz2 663182 SHA256 84c93aaa3c3651a9e7474b721b0e6788318592509e7de604bafe4ea8049dc410 SHA512 862f9fe8dd4f0fd51b97d80b767304b982d9c9307bf66933298187bf121f5c827f0b4880eab92f07d16e0c1d41ff5179923c7ae8d8aabd635db8574d4a3021b0 WHIRLPOOL 6328e298a4af1bbe2ca360f380064b6a1b43c9cf9c361c3dc4078297c3bf77c0bfe3690b1d9f2713ad2f28970f033880b40f4b077d5734c0e03bd35aa4bb18e3
+DIST automake-1.9.6.tar.bz2 765505 SHA256 8eccaa98e1863d10e4a5f861d8e2ec349a23e88cb12ad10f6b6f79022ad2bb8d SHA512 6aa8824876003bcac804e88d58f014a2449c7e1d824e46b5e971d3e2d070bc6ac0a3881e8eaae12e2f7f310c6b81dfb83ad4647d58785fc7e6759aa37478784e WHIRLPOOL 76d59f947a2dfad4ca70c888d58b15f86670f0df6156b9f1e9f2ed03ad92468ad880ab47b505b31577b35b376a799b6de0ebab46f17516440772a1d3eb6b7479
+EBUILD automake-1.10.3-r1.ebuild 2136 SHA256 6e31f47e74d46ef781c3cb63fc8ac22d75438d9ad5be3563f23a8b929f5a81fd SHA512 41817b8c074c3a5c440d69b3198cd7a654ed12080751628a029a8b1b8a4037a44575329039aa85ac53e3d6ecb17e7639fd6a55f97bd3373731e2602f5219465c WHIRLPOOL d5889951e48d7d5091ff7cf9cf2a8739750a93eb65586923c3dc00cbcee3b743469c487a50bc77dec1894eb9b6f82b48a63d0731cde96d798894e27cd484cc92
+EBUILD automake-1.10.3-r2.ebuild 2214 SHA256 717feba827fe4d3120b783d5611df836ee93b7b2b6ca1b00a77452d806da29b9 SHA512 2eba670d60987bd43c22995412cb988e1daabd198068f82e3cc9b1f45ff0bb55144dee24c3910e4ecaa3999459a9a0adaa46a886f97c36fc2325fed83a354ba4 WHIRLPOOL 6818de1cb91f915277de95751d0aa9edce8c612fbf86509548f9c3701693c90f5728442f389614ee673b4235d5eade6f40a56302f8ac5fb7d20841420e4cd41e
+EBUILD automake-1.11.6-r1.ebuild 2299 SHA256 5af059c0c56d838fd092b8b02127fdb5987093db8006f4a089be81b3d64e55e2 SHA512 9b62d923218da82f939dac7694e814930723caa430529e6b7e49cb376042317df1e17a3f1386af3a7a3226ef28a6ae4e5ecd05ac747dcb96dd851cf759091950 WHIRLPOOL a3643db4de7e892e05b8cfdde9cde4f1ea7abd2165323c354b7868d00a06053cf6d7af547bddd9b1dc4dbdce740ec44670b64c3f6790aa072007a67288f7bea6
+EBUILD automake-1.11.6-r2.ebuild 2385 SHA256 42a49acea6adc9cb319e52e0b39bd55dfebb43f9ee546fa7a78a4289c7842564 SHA512 923ba58664d8424836715a8bd0f60f48933ecdf3409bcf208bf6bb76c8d3188386d60a4d7f6b2da0ffb2912cbb5a00873a04a33fe5e8ffa5bd108d98c4c9bb84 WHIRLPOOL f2452e339a084f1fe4dbc0224f25a8272344d4a04a662781854cd3090a7b9062cc5669c96dddbcdd9aa696c61180779b5513637b6e7849ddf03f049f4e3c384e
+EBUILD automake-1.12.6-r1.ebuild 2214 SHA256 5ed083a5724b47faac05a4ffdb7572e5db65022860ed61ba066daf870349a357 SHA512 7670cf0662e2905b23cfff03ee2259b6842f186f77203b59f3f3fcce36a54b27836e5db33a78f35233cbcf2499b83bc920103d83cf0dd4d41cfb2be1de908789 WHIRLPOOL 00174bdcc492a9e5a3d8bfbe1993ad878734d8d290e97cf6e89b2513e78e0ffeaf9d75f1ebf96041af66242c0f998fe7224c396a0729e32f399cf215ea5ed4e1
+EBUILD automake-1.12.6.ebuild 2136 SHA256 49bb086283edcb5b5e4efe615979676fa778ef3ce6b9644b5f2d3e1951eaa0df SHA512 93f0abd1cfcb93328a3473cd4300563fe05d0de1c9e6a700a39e69a5d531566065c9477920cccbd63b0435308bb98109d7f93f345e2ff6eea5f1aeba524df535 WHIRLPOOL 779ae6cce01ad381ff3987972d344398c5d686a39b4f3716cd1109ea8fd2fc9e9f7a12406f7ae8080aa5ed5e3fc65698edec10ec86c025c336d2615e59b2db81
+EBUILD automake-1.13.4-r1.ebuild 2442 SHA256 2e68b3961327dbe8c39304f32669fddcd6f9e1a6e0f782b2d19949d8ea030211 SHA512 31f9ac2c6fb87568d90af3234489a03c37ab3ac856a3592d9bb59eead8580b26f8628b6ce2b47063a6555d51343d7f035db7d5f6a7e935bb35464b85b8ded7d0 WHIRLPOOL a6d2618fd9cc4799df8e9ffe1da22c1a7c5d038b85ffa3b4915b4a19f4ed6833ec73de3a8b501960e3f3850553860bb8abc7d2a6e5930ab27de2ffb5dc865d51
+EBUILD automake-1.13.4.ebuild 2217 SHA256 106c3616f615879592987dbd0b096fdc279c7135aec13d7e14b27233e3277dc0 SHA512 f9d1970643c35f49269cf3ede21c6c60f386cdebe5787208c2c2347dde194ea247de46b665a14e9197468c5c1dc18d124333ada4fe456184ad7b91ff532a3ae9 WHIRLPOOL ed0682fbea1755f5d77523dafe252f7424391fb0c5ac31fd30877061f3e4d8334c83f3319ac4df8f52ed6633b162e407bf66853376d99c0a51b3cf10eab67c87
+EBUILD automake-1.14.1-r1.ebuild 2754 SHA256 b2c829269ad2c3c2fdaec05098a5bdc63a43ee820ac791a739fe829012afed3a SHA512 09691ec77d6e738e09fdc3069f858c05973c8dfd5df5511e9531c6bcc171d48dd7fa63b7692c5107e63ef72d189fb2638780caaa25401c6bfacd01867c29a757 WHIRLPOOL c544614cb147385e8f7ccd72767aeab0145fba3d975f58dd2b9bd002bcb2d70d634363fd076a09422a8e0a32f7219080c80ab8c39397c2bbdbef93242bd17b29
+EBUILD automake-1.14.1.ebuild 2529 SHA256 801155fd3f5c36689e389b0ab0c13d17360d5615c3420dc828c853ebfc435539 SHA512 ccdd5e045c12d7ec8f99243e611f1e9c45d605bef5ca1a754332843fd424a528450c529c0289993a4b0025c8bbbe5107bd6663ba6cd45a729e8158135f00af71 WHIRLPOOL c32934389efe9d8c389208ac5a626e863b8c12e14420615d8e5b36c1752d742712540a10875371159423d0eb1aaadb8a7b06b7f108f8495df6eaf1f36ebef536
+EBUILD automake-1.15-r1.ebuild 2607 SHA256 94f74143d5e3b380cbc01920edfeed86264d40157b607cf52372f0db1940d788 SHA512 e4d3bf262b452663b011b08e59bd6fbf578d8509d2ae0cc8a42b829f450f080e2126808c3916cb1dc2bbac84fd0259d3996fdd6bc3c986f2ae1fc843602e722f WHIRLPOOL ee5cd56726d0e51341c688370eafcc6b80f0bf0f747cc747d48bc292f9c1ca0bd87815f72cfb576f0a6dde0dd2aa3d2c4dc04f96ffb0a165cfe7e6eb6f9903ef
+EBUILD automake-1.15-r2.ebuild 2809 SHA256 49a78a72781c96991797c0f2357103a9feaf95d9b2a5920d0eb3860765cc1980 SHA512 f2317f01a0e3fe98090bed4d10431e611ff2d84010ee7ab9d40487e2f75e2d4db1e50ea41c9f51470d053b2e0f3a5ef903792edab44aeee3739f5cc8660e05b0 WHIRLPOOL c0138d5fa0185f78c21969ea67c64adc948f1c70fb4938a81d7e49e6a98127fb78f99b0e772d6a26392ea2473aa71e8546a996142bb88bba8536068d037761eb
+EBUILD automake-1.15.1-r1.ebuild 2935 SHA256 66fc4d25455f1bdf9bdc9e075ddab1b3e3f6e9782e2c24d4fb54de21485b12b8 SHA512 b78724ce11602e6025a5e22f23bb8d40234c5e4abf34bb2704e2634796e2fd6570abe76454191648e93b3e686502f77f0df2bd54c98bf0983452ac6ac2287699 WHIRLPOOL b24eda3b6fd3431f9702ec95a25c5d2292276b58b11050d1d86fc2c8d9391b2a07628914af0357ef191a02e9ed5565ff39ba3ae92fe6a1ab5f756c71952fb9a9
+EBUILD automake-1.15.1.ebuild 2689 SHA256 c169a0a8d2d3cd8ae968b5d7d99a61c3ef6136351153bdea7a00fdd2bb544295 SHA512 302a37dec3e7944a29754ec7a3f7adef389a57fc408a353eaff2f9d6d6408a0460a56e9410f5640caf6945511549f367ddf42290e356b3fdb7da2eb979e1aeaf WHIRLPOOL 5725aae7e9d5eb5b533476e186b8db2e813f2d692d624d79403525c31f2c0f97392b726b9cc196af56a8de1b33e0b13f3e3147c40a5e7340ec7e6873f3f4cbe9
+EBUILD automake-1.15.ebuild 2529 SHA256 801155fd3f5c36689e389b0ab0c13d17360d5615c3420dc828c853ebfc435539 SHA512 ccdd5e045c12d7ec8f99243e611f1e9c45d605bef5ca1a754332843fd424a528450c529c0289993a4b0025c8bbbe5107bd6663ba6cd45a729e8158135f00af71 WHIRLPOOL c32934389efe9d8c389208ac5a626e863b8c12e14420615d8e5b36c1752d742712540a10875371159423d0eb1aaadb8a7b06b7f108f8495df6eaf1f36ebef536
+EBUILD automake-1.4_p6-r2.ebuild 2493 SHA256 c4c4af4817824d4adbad01fa854bb4a79aa79b9eac5ee2af5519fc53b4a6beed SHA512 7077f282076cb741cd54080654ab2098f6a4fe55536147c5c4c7a807e0e1b63179cac9aadb4220f92ae601455a4f231c045b6b85faa4c044408d4b0ba0563407 WHIRLPOOL d84978af4846bf7e14d9c2a22edc5385d19c82cb65346f29f6d3f5bbe833d63ac4d2c49dfa20094c087a2580359416858209a90c5f21758b598f153d9f7fe9a6
+EBUILD automake-1.5-r2.ebuild 2311 SHA256 1abcb4ba8d1e9dd31f822878aa2cc4d6beecf242e267261749b74bdb02679d0a SHA512 68c46578ba7f8c7b81ab0bb723115f8f336cba2b7af6d7a5dc3726de34fe4dfbd810cb976363983b0737716ec46514b92c83666cbae0e0bb34590950c9bb9060 WHIRLPOOL dec7c00d58d8a9d40a9b2a2cbfa5ca06e5d7abd81aedd7d13513dcc6a8924804a0a70ea3a717940e313a59259edcd6de77903b1bf4bc06132983873cae84a3d7
+EBUILD automake-1.6.3-r2.ebuild 2059 SHA256 c4ad2bd6dcc4feadeb88784bafe696e2a8abafee5a257d8786f12cc32b38f56a SHA512 588753996cf13aa49b251fb55cfe9bacd9015474ff4824a988bbe38ea0826e05cb3e6079264d47bc64460e1cd44bcfc5a233af7cd769a6476fce29f4bdc2d4f0 WHIRLPOOL 95dbec06397c5893fbe6b6cb75aa5f0888cab34f92df1d7afea2d340cfbef03702a31cb82044ff76196417971163b1270fa961320121a9f5cfe3acc23ce9f0a5
+EBUILD automake-1.7.9-r3.ebuild 2214 SHA256 2b239ce0d97e8ecc8f29a65fd4f89c6f5b2ffad80acd0e00a1cc42ad314997dc SHA512 8b8e70fd88fcea71139cf84f2b6cabac8d90b0cfa7e7d4b034b986c1b75581c9a04ccfcb30d4b0588ca336fb1cdead04db231955e432b9cb3adca510bd84bf26 WHIRLPOOL 7d5b7e2ed28693b412631d3454ee1fcc8003c36fdb96b946fb51dd3253a36fd58205ef51207a5a44912f11ba953fb0d2d3944fcf5eecd1d68200297ae028e229
+EBUILD automake-1.8.5-r5.ebuild 2241 SHA256 e2297445fae56d21712783d73a6e6cf2f0cf57575033efe66916cf761e1431ce SHA512 2989fe6f57f9f2b723aecff5573a713f71d6245284f965862fc3d084ab2a90c462f60d1636a031735895a383d6141889447844c7f161b17a5a0f3ff316c63fa6 WHIRLPOOL f89d0f0aea3474a198f09caa2aa9f0a24c23337dd4ded613501e9dc05d3214e16f4f78b1765c99a7ab4f85779f2644549edfd7c14bdb12c98aae362dd5748985
+EBUILD automake-1.9.6-r4.ebuild 2456 SHA256 b0379559b678203dd547f00478de085b9dcd20c9da00d7a54c945598757d5a84 SHA512 de1e1594b2b5bbb9560536481fa12d4b4aac66cb3a6bbdc43f52d12a3465c643d6afebdc59ab5fce33d4adbe19f82f1d172a2ed9affb39f2b88aa47b8b6e486b WHIRLPOOL a2a9e39e53c2eab9b34fab02a0316e7143166c666b736044f81ee18ae2d029340b91b8a83a30973001d77579277ef4788e3a814db01bca682bf9132d8897fb3f
+EBUILD automake-9999.ebuild 2935 SHA256 66fc4d25455f1bdf9bdc9e075ddab1b3e3f6e9782e2c24d4fb54de21485b12b8 SHA512 b78724ce11602e6025a5e22f23bb8d40234c5e4abf34bb2704e2634796e2fd6570abe76454191648e93b3e686502f77f0df2bd54c98bf0983452ac6ac2287699 WHIRLPOOL b24eda3b6fd3431f9702ec95a25c5d2292276b58b11050d1d86fc2c8d9391b2a07628914af0357ef191a02e9ed5565ff39ba3ae92fe6a1ab5f756c71952fb9a9
+MISC ChangeLog 9165 SHA256 b28478e7f88c97bf23ff8556364bd416d5468de835e93c874be70877e320171e SHA512 98129f200d9cef5cf7b7b92ca5ac3ea1b2e281545995243fdddc76211a0f327f48dfbf8bcc4a2f591866501d93f59ba9fcdb2063a678bc496725d5f29b4a6472 WHIRLPOOL 6dbca5e45ff6f8a1e51e7d115e1a0b469bdab96ab82388b36dc520234acce65be524900e3ca0ff7dc155bb8a066a983fcf16811bee6f6957c01ddeedbece2ed5
+MISC ChangeLog-2015 36618 SHA256 a85eff71b28fb8d79695f47eec59b799733b7f29682d16a24694f4727800da9f SHA512 a4f7bb1a80a26bd5361789f88e9b3cb482060ec74f15c782f4e5c2ea725bcd626648a893660f5bdeea7eda61b22c5e5bbdef66916a3dd85214ef202f34b25aed WHIRLPOOL 51cce796a1f05a5da0c2c946dd91c535d8353caf9c719b664a5fd3b6c7b7d4bba7c743dd7446ffcc1a398e481065a2767e7c2ee36b6b7a301971b452b8928c4c
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/automake/automake-1.10.3-r1.ebuild b/sys-devel/automake/automake-1.10.3-r1.ebuild
new file mode 100644
index 000000000000..fc86a449d55b
--- /dev/null
+++ b/sys-devel/automake/automake-1.10.3-r1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453
+ chmod a+rx tests/*.test
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ # SLOT the docs and junk
+ local x
+ for x in aclocal automake ; do
+ help2man "perl -Ilib ${x}" > ${x}-${SLOT}.1
+ doman ${x}-${SLOT}.1
+ rm -f "${ED}"/usr/bin/${x}
+ done
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.10.3-r2.ebuild b/sys-devel/automake/automake-1.10.3-r2.ebuild
new file mode 100644
index 000000000000..680490feccb2
--- /dev/null
+++ b/sys-devel/automake/automake-1.10.3-r2.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453
+ epatch "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket.patch
+ chmod a+rx tests/*.test
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ # SLOT the docs and junk
+ local x
+ for x in aclocal automake ; do
+ help2man "perl -Ilib ${x}" > ${x}-${SLOT}.1
+ doman ${x}-${SLOT}.1
+ rm -f "${ED}"/usr/bin/${x}
+ done
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.11.6-r1.ebuild b/sys-devel/automake/automake-1.11.6-r1.ebuild
new file mode 100644
index 000000000000..14f4d3e9b4c0
--- /dev/null
+++ b/sys-devel/automake/automake-1.11.6-r1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453
+ chmod a+rx tests/*.test
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+ export TZ="UTC" #589138
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}" HELP2MAN=true
+}
+
+src_compile() {
+ default
+
+ local x
+ for x in aclocal automake; do
+ help2man "perl -Ilib ${x}" > doc/${x}-${SLOT}.1
+ done
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.11.6-r2.ebuild b/sys-devel/automake/automake-1.11.6-r2.ebuild
new file mode 100644
index 000000000000..3749e225e073
--- /dev/null
+++ b/sys-devel/automake/automake-1.11.6-r2.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453
+ epatch "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket.patch
+ chmod a+rx tests/*.test
+ export HELP2MAN=true
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+ export TZ="UTC" #589138
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_compile() {
+ default
+
+ local x
+ for x in aclocal automake; do
+ help2man "perl -Ilib ${x}" > doc/${x}-${SLOT}.1
+ done
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.12.6-r1.ebuild b/sys-devel/automake/automake-1.12.6-r1.ebuild
new file mode 100644
index 000000000000..2f9b1247e228
--- /dev/null
+++ b/sys-devel/automake/automake-1.12.6-r1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket.patch
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.12.6.ebuild b/sys-devel/automake/automake-1.12.6.ebuild
new file mode 100644
index 000000000000..a8a5b90eb223
--- /dev/null
+++ b/sys-devel/automake/automake-1.12.6.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.13.4-r1.ebuild b/sys-devel/automake/automake-1.13.4-r1.ebuild
new file mode 100644
index 000000000000..1cf05955ce47
--- /dev/null
+++ b/sys-devel/automake/automake-1.13.4-r1.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.13-dyn-ithreads.patch
+ epatch "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket.patch
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.13.4.ebuild b/sys-devel/automake/automake-1.13.4.ebuild
new file mode 100644
index 000000000000..a5f269c07dfa
--- /dev/null
+++ b/sys-devel/automake/automake-1.13.4.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.13-dyn-ithreads.patch
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.14.1-r1.ebuild b/sys-devel/automake/automake-1.14.1-r1.ebuild
new file mode 100644
index 000000000000..b52f0a084034
--- /dev/null
+++ b/sys-devel/automake/automake-1.14.1-r1.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils versionator
+
+if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.15-perl-escape-curly-bracket.patch
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.14.1.ebuild b/sys-devel/automake/automake-1.14.1.ebuild
new file mode 100644
index 000000000000..be5a268a5453
--- /dev/null
+++ b/sys-devel/automake/automake-1.14.1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils versionator
+
+if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.15-r1.ebuild b/sys-devel/automake/automake-1.15-r1.ebuild
new file mode 100644
index 000000000000..b261355458ec
--- /dev/null
+++ b/sys-devel/automake/automake-1.15-r1.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils versionator
+
+if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.15-perl-escape-curly-bracket.patch
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.15-r2.ebuild b/sys-devel/automake/automake-1.15-r2.ebuild
new file mode 100644
index 000000000000..162bc51f3c72
--- /dev/null
+++ b/sys-devel/automake/automake-1.15-r2.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils versionator
+
+if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.15-perl-escape-curly-bracket.patch
+ epatch "${FILESDIR}"/${PN}-1.15-mdate-tz.patch #520818 #574492
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.15.1-r1.ebuild b/sys-devel/automake/automake-1.15.1-r1.ebuild
new file mode 100644
index 000000000000..5051ee0ba2c4
--- /dev/null
+++ b/sys-devel/automake/automake-1.15.1-r1.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils versionator
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+
+ inherit git-r3
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+ else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+ fi
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69:*
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ default
+ export WANT_AUTOCONF=2.5
+ # Don't try wrapping the autotools this thing runs as it tends
+ # to be a bit esoteric, and the script does `set -e` itself.
+ ./bootstrap || die
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null || die
+ rm -f dir || dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null || die
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.15.1.ebuild b/sys-devel/automake/automake-1.15.1.ebuild
new file mode 100644
index 000000000000..3d30181746d1
--- /dev/null
+++ b/sys-devel/automake/automake-1.15.1.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils versionator
+
+if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.15.ebuild b/sys-devel/automake/automake-1.15.ebuild
new file mode 100644
index 000000000000..be5a268a5453
--- /dev/null
+++ b/sys-devel/automake/automake-1.15.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils versionator
+
+if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+src_configure() {
+ econf --docdir="\$(datarootdir)/doc/${PF}"
+}
+
+src_test() {
+ emake check
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.4_p6-r2.ebuild b/sys-devel/automake/automake-1.4_p6-r2.ebuild
new file mode 100644
index 000000000000..637e8be4da37
--- /dev/null
+++ b/sys-devel/automake/automake-1.4_p6-r2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+MY_P="${P/_/-}"
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.4-nls-nuisances.patch #121151
+ epatch "${FILESDIR}"/${PN}-1.4-libtoolize.patch
+ epatch "${FILESDIR}"/${PN}-1.4-subdirs-89656.patch
+ epatch "${FILESDIR}"/${PN}-1.4-ansi2knr-stdlib.patch
+ epatch "${FILESDIR}"/${PN}-1.4-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.4-perl-5.11.patch
+ epatch "${FILESDIR}"/${PN}-1.4-perl-dyn-call.patch
+ sed -i 's:error\.test::' tests/Makefile.in #79529
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ emake install DESTDIR="${D}" \
+ pkgdatadir=/usr/share/automake-${SLOT} \
+ m4datadir=/usr/share/aclocal-${SLOT}
+ slot_info_pages
+ rm -f "${ED}"/usr/bin/{aclocal,automake}
+ dosym automake-${SLOT} /usr/share/automake
+
+ dodoc NEWS README THANKS TODO AUTHORS ChangeLog
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.5-r2.ebuild b/sys-devel/automake/automake-1.5-r2.ebuild
new file mode 100644
index 000000000000..21db18c0952d
--- /dev/null
+++ b/sys-devel/automake/automake-1.5-r2.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/automake-1.4-nls-nuisances.patch #121151
+ epatch "${FILESDIR}"/${P}-target_hook.patch
+ epatch "${FILESDIR}"/${P}-slot.patch
+ epatch "${FILESDIR}"/${P}-test-fixes.patch #79505
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${P}-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.5-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ local x
+ for x in aclocal automake ; do
+ mv "${ED}"/usr/bin/${x}{,-${SLOT}} || die "rename ${x}"
+ mv "${ED}"/usr/share/${x}{,-${SLOT}} || die "move ${x}"
+ done
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.6.3-r2.ebuild b/sys-devel/automake/automake-1.6.3-r2.ebuild
new file mode 100644
index 000000000000..a33fbb545cd7
--- /dev/null
+++ b/sys-devel/automake/automake-1.6.3-r2.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${P}-test-fixes.patch #159557
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${PN}-1.5-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.5-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+ rm -f "${ED}"/usr/bin/{aclocal,automake}
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.7.9-r3.ebuild b/sys-devel/automake/automake-1.7.9-r3.ebuild
new file mode 100644
index 000000000000..6f3ecd066b03
--- /dev/null
+++ b/sys-devel/automake/automake-1.7.9-r3.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${P}-infopage-namechange.patch
+ epatch "${FILESDIR}"/${P}-test-fixes.patch
+ epatch "${FILESDIR}"/${PN}-1.9.6-subst-test.patch #222225
+ epatch "${FILESDIR}"/${P}-libtool-2.patch #257544
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${PN}-1.5-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.5-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+ rm -f "${ED}"/usr/bin/{aclocal,automake}
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.8.5-r5.ebuild b/sys-devel/automake/automake-1.8.5-r5.ebuild
new file mode 100644
index 000000000000..0ddbc4afc438
--- /dev/null
+++ b/sys-devel/automake/automake-1.8.5-r5.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.8.2-infopage-namechange.patch
+ epatch "${FILESDIR}"/${P}-test-fixes.patch #159557
+ epatch "${FILESDIR}"/${PN}-1.9.6-aclocal7-test-sleep.patch #197366
+ epatch "${FILESDIR}"/${PN}-1.9.6-subst-test.patch #222225
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${P}-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.8-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+ rm -f "${ED}"/usr/bin/{aclocal,automake}
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-1.9.6-r4.ebuild b/sys-devel/automake/automake-1.9.6-r4.ebuild
new file mode 100644
index 000000000000..d8a415946d40
--- /dev/null
+++ b/sys-devel/automake/automake-1.9.6-r4.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:3}"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69
+ >=sys-apps/texinfo-4.7
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ export WANT_AUTOCONF=2.5
+ epatch "${FILESDIR}"/${PN}-1.9.6-infopage-namechange.patch
+ epatch "${FILESDIR}"/${P}-include-dir-prefix.patch #107435
+ epatch "${FILESDIR}"/${P}-ignore-comments.patch #126388
+ epatch "${FILESDIR}"/${P}-aclocal7-test-sleep.patch #197366
+ epatch "${FILESDIR}"/${PN}-1.9.6-subst-test.patch #222225
+ epatch "${FILESDIR}"/${PN}-1.10-ccnoco-ldflags.patch #203914
+ epatch "${FILESDIR}"/${PN}-1.8.5-CVE-2009-4029.patch #295357
+ epatch "${FILESDIR}"/${PN}-1.8-perl-5.11.patch
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null
+ rm -f dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null
+}
+
+src_install() {
+ default
+ slot_info_pages
+
+ local x
+ for x in aclocal automake ; do
+ help2man "perl -Ilib ${x}" > ${x}-${SLOT}.1
+ doman ${x}-${SLOT}.1
+ rm -f "${ED}"/usr/bin/${x}
+ done
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/automake-9999.ebuild b/sys-devel/automake/automake-9999.ebuild
new file mode 100644
index 000000000000..5051ee0ba2c4
--- /dev/null
+++ b/sys-devel/automake/automake-9999.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils versionator
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+
+ inherit git-r3
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ if [[ ${PV/_beta} == ${PV} ]]; then
+ MY_P=${P}
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
+ ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+ else
+ MY_PV="$(get_major_version).$(($(get_version_component_range 2)-1))b"
+ MY_P="${PN}-${MY_PV}"
+
+ # Alpha/beta releases are not distributed on the usual mirrors.
+ SRC_URI="ftp://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
+ fi
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Used to generate Makefile.in from Makefile.am"
+HOMEPAGE="https://www.gnu.org/software/automake/"
+
+LICENSE="GPL-2"
+# Use Gentoo versioning for slotting.
+SLOT="${PV:0:4}"
+IUSE=""
+
+RDEPEND="dev-lang/perl
+ >=sys-devel/automake-wrapper-10
+ >=sys-devel/autoconf-2.69:*
+ sys-devel/gnuconfig"
+DEPEND="${RDEPEND}
+ sys-apps/help2man"
+
+src_prepare() {
+ default
+ export WANT_AUTOCONF=2.5
+ # Don't try wrapping the autotools this thing runs as it tends
+ # to be a bit esoteric, and the script does `set -e` itself.
+ ./bootstrap || die
+ sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
+}
+
+# slot the info pages. do this w/out munging the source so we don't have
+# to depend on texinfo to regen things. #464146 (among others)
+slot_info_pages() {
+ pushd "${ED}"/usr/share/info >/dev/null || die
+ rm -f dir || dir
+
+ # Rewrite all the references to other pages.
+ # before: * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4.
+ # after: * aclocal-invocation v1.13: (automake-1.13)aclocal Invocation. Generating aclocal.m4.
+ local p pages=( *.info ) args=()
+ for p in "${pages[@]/%.info}" ; do
+ args+=(
+ -e "/START-INFO-DIR-ENTRY/,/END-INFO-DIR-ENTRY/s|: (${p})| v${SLOT}&|"
+ -e "s:(${p}):(${p}-${SLOT}):g"
+ )
+ done
+ sed -i "${args[@]}" * || die
+
+ # Rewrite all the file references, and rename them in the process.
+ local f d
+ for f in * ; do
+ d=${f/.info/-${SLOT}.info}
+ mv "${f}" "${d}" || die
+ sed -i -e "s:${f}:${d}:g" * || die
+ done
+
+ popd >/dev/null || die
+}
+
+src_install() {
+ default
+
+ slot_info_pages
+ rm "${ED}"/usr/share/aclocal/README || die
+ rmdir "${ED}"/usr/share/aclocal || die
+ rm \
+ "${ED}"/usr/bin/{aclocal,automake} \
+ "${ED}"/usr/share/man/man1/{aclocal,automake}.1 || die
+
+ # remove all config.guess and config.sub files replacing them
+ # w/a symlink to a specific gnuconfig version
+ local x
+ for x in guess sub ; do
+ dosym ../gnuconfig/config.${x} /usr/share/${PN}-${SLOT}/config.${x}
+ done
+}
diff --git a/sys-devel/automake/files/automake-1.10-ccnoco-ldflags.patch b/sys-devel/automake/files/automake-1.10-ccnoco-ldflags.patch
new file mode 100644
index 000000000000..f48c6304bdc2
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.10-ccnoco-ldflags.patch
@@ -0,0 +1,35 @@
+http://bugs.gentoo.org/203914
+
+From 6e86514729c6dccb6213fdde8d93d7061c8108a5 Mon Sep 17 00:00:00 2001
+From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Mon, 7 Jan 2008 21:53:38 +0100
+Subject: [PATCH] Fix ccnoco.test for uncommon LDFLAGS settings.
+
+* tests/ccnoco.test (Mycomp): Use a tighter match for -c -o,
+to avoid matching for example `LDFLAGS=-Wl,--sort-common'.
+* THANKS: Update.
+Report and analysis by Carsten Lohrke and Mike Frysinger.
+---
+ ChangeLog | 7 +++++++
+ THANKS | 1 +
+ tests/ccnoco.test | 6 +++---
+ 3 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/tests/ccnoco.test b/tests/ccnoco.test
+index 8b37fe8..ca75922 100755
+--- a/tests/ccnoco.test
++++ b/tests/ccnoco.test
+@@ -57,8 +57,8 @@ END
+ cat > Mycomp << 'END'
+ #!/bin/sh
+
+-case "$@" in
+- *-c*-o* | *-o*-c*)
++case " "$* in
++ *\ -c*\ -o* | *\ -o*\ -c*)
+ exit 1
+ ;;
+ esac
+--
+1.6.3
+
diff --git a/sys-devel/automake/files/automake-1.10-perl-5.16.patch b/sys-devel/automake/files/automake-1.10-perl-5.16.patch
new file mode 100644
index 000000000000..19fe249e0c00
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.10-perl-5.16.patch
@@ -0,0 +1,128 @@
+https://bugs.gentoo.org/424453
+
+From 6bf58a59a1f3803e57e3f0378aa9344686707b75 Mon Sep 17 00:00:00 2001
+From: Stefano Lattarini <stefano.lattarini@gmail.com>
+Date: Mon, 28 May 2012 13:32:03 +0200
+Subject: [PATCH] aclocal: declare function prototypes, do not use '&' in
+ function calls
+
+This change will also fix automake bug#11543 (from a report by Matt
+Burgess).
+
+* aclocal.in: Declare prototypes for almost all functions early, before
+any actual function definition (but omit the prototype for the dynamically
+generated '&search' function). Add prototypes to any function definition.
+Remove '&' from function invocations (i.e., simply use "func(ARGS..)"
+instead of "&func(ARGS...)").
+* THANKS, NEWS: Update.
+
+Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
+---
+ NEWS | 4 ++++
+ THANKS | 1 +
+ aclocal.in | 42 ++++++++++++++++++++++++++++++++++--------
+ 3 files changed, 39 insertions(+), 8 deletions(-)
+
+diff --git a/aclocal.in b/aclocal.in
+index dfb851b..e8855d5 100644
+--- a/aclocal.in
++++ b/aclocal.in
+@@ -152,8 +152,34 @@ my $erase_me;
+
+ ################################################################
+
++# Prototypes for all subroutines.
++
++sub unlink_tmp (;$);
++sub xmkdir_p ($);
++sub check_acinclude ();
++sub reset_maps ();
++sub install_file ($$);
++sub list_compare (\@\@);
++sub scan_m4_dirs ($@);
++sub scan_m4_files ();
++sub add_macro ($);
++sub scan_configure_dep ($);
++sub add_file ($);
++sub scan_file ($$$);
++sub strip_redundant_includes (%);
++sub trace_used_macros ();
++sub scan_configure ();
++sub write_aclocal ($@);
++sub usage ($);
++sub version ();
++sub handle_acdir_option ($$);
++sub parse_arguments ();
++sub parse_ACLOCAL_PATH ();
++
++################################################################
++
+ # Erase temporary file ERASE_ME. Handle signals.
+-sub unlink_tmp
++sub unlink_tmp (;$)
+ {
+ my ($sig) = @_;
+
+@@ -350,7 +376,7 @@ sub scan_m4_dirs ($@)
+ next if $file eq 'aclocal.m4';
+
+ my $fullfile = File::Spec->canonpath ("$m4dir/$file");
+- &scan_file ($type, $fullfile, 'aclocal');
++ scan_file ($type, $fullfile, 'aclocal');
+ }
+ closedir (DIR);
+ }
+@@ -361,12 +387,12 @@ sub scan_m4_files ()
+ {
+ # First, scan configure.ac. It may contain macro definitions,
+ # or may include other files that define macros.
+- &scan_file (FT_USER, $configure_ac, 'aclocal');
++ scan_file (FT_USER, $configure_ac, 'aclocal');
+
+ # Then, scan acinclude.m4 if it exists.
+ if (-f 'acinclude.m4')
+ {
+- &scan_file (FT_USER, 'acinclude.m4', 'aclocal');
++ scan_file (FT_USER, 'acinclude.m4', 'aclocal');
+ }
+
+ # Finally, scan all files in our search paths.
+@@ -380,7 +406,7 @@ sub scan_m4_files ()
+ my $search = "sub search {\nmy \$found = 0;\n";
+ foreach my $key (reverse sort keys %map)
+ {
+- $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { & add_macro ("' . $key
++ $search .= ('if (/\b\Q' . $key . '\E(?!\w)/) { add_macro ("' . $key
+ . '"); $found = 1; }' . "\n");
+ }
+ $search .= "return \$found;\n};\n";
+@@ -403,7 +429,7 @@ sub add_macro ($)
+
+ verb "saw macro $macro";
+ $macro_seen{$macro} = 1;
+- &add_file ($map{$macro});
++ add_file ($map{$macro});
+ }
+
+ # scan_configure_dep ($file)
+@@ -465,7 +491,7 @@ sub scan_configure_dep ($)
+ }
+
+ add_macro ($_) foreach (@rlist);
+- &scan_configure_dep ($_) foreach @ilist;
++ scan_configure_dep ($_) foreach @ilist;
+ }
+
+ # add_file ($FILE)
+@@ -931,7 +957,7 @@ EOF
+ }
+
+ # Print version and exit.
+-sub version()
++sub version ()
+ {
+ print <<EOF;
+ aclocal (GNU $PACKAGE) $VERSION
+--
+2.1.3
+
diff --git a/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch b/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch
new file mode 100644
index 000000000000..f790e7724c93
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch
@@ -0,0 +1,59 @@
+https://bugs.gentoo.org/343439
+
+From 182626687f2640609f8eb28ad1b04b078342f2c7 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 12 Jan 2013 00:19:40 -0500
+Subject: [PATCH] ithreads: use runtime (not configure time) detection of perl
+ threads
+
+I can't imagine the runtime checks being a big runtime penalty, so there
+shouldn't be a need to do the checks at configure check and hardcode the
+result in the generated automake.
+
+With the current system, it means if you change your perl config (build
+perl w/threads, build automake, build perl w/out threads), or deploy a
+compiled automake package on a different system (build had threads, but
+deployed system does not), you get errors when trying to run automake.
+
+So take the logic from configure.ac and move it to the one place where
+PERL_THREADS is used (lib/Automake/Config.in) and do the version/config
+checking at runtime.
+
+* bootstrap.sh (PERL_THREADS): Delete assignment and use in sed.
+* configure.ac (am_cv_prog_PERL_ithreads, PERL_THREADS): Delete all code
+related to these two variables.
+* lib/Automake/Config.in (perl_threads): Initialize to 0, and only set to
+1 if the perl version is at least 5.007_002, and useithreads is in Config.
+
+Copyright-paperwork-exempt: yes
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
+---
+ bootstrap.sh | 2 --
+ configure.ac | 26 --------------------------
+ lib/Automake/Config.in | 9 ++++++++-
+ 3 files changed, 8 insertions(+), 29 deletions(-)
+
+diff --git a/lib/Automake/Config.in b/lib/Automake/Config.in
+index fe6ef9d..885e74e 100644
+--- a/lib/Automake/Config.in
++++ b/lib/Automake/Config.in
+@@ -33,7 +33,14 @@ our $PACKAGE_BUGREPORT = '@PACKAGE_BUGREPORT@';
+ our $VERSION = '@VERSION@';
+ our $RELEASE_YEAR = '@RELEASE_YEAR@';
+ our $libdir = '@datadir@/@PACKAGE@-@APIVERSION@';
+-our $perl_threads = @PERL_THREADS@;
++
++our $perl_threads = 0;
++# We need at least this version for CLONE support.
++if (eval { require 5.007_002; })
++ {
++ use Config;
++ $perl_threads = $Config{useithreads};
++ }
+
+ 1;
+
+--
+1.8.0.2
+
diff --git a/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket.patch b/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket.patch
new file mode 100644
index 000000000000..a113d09c58c6
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket.patch
@@ -0,0 +1,37 @@
+http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21001
+
+From 34163794a58b5bd91c5d6bd9adf5437571c7a479 Mon Sep 17 00:00:00 2001
+From: Pavel Raiskup <praiskup@redhat.com>
+Date: Tue, 7 Jul 2015 10:54:24 +0200
+Subject: [PATCH] bin/automake: escape '{' in regexp pattern
+
+Based on perlre(1) documentation:
+.. in Perl v5.26, literal uses of a curly bracket will be required
+to be escaped, say by preceding them with a backslash ("\{" ) or
+enclosing them within square brackets ("[{]") ..
+
+References:
+https://bugzilla.redhat.com/1239379
+
+* bin/automake.in (substitute_ac_subst_variables): Escape the
+occurrence of '{' character.
+---
+ bin/automake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bin/automake.in b/bin/automake.in
+index 0c29184..c294ced 100644
+--- a/bin/automake.in
++++ b/bin/automake.in
+@@ -3898,7 +3898,7 @@ sub substitute_ac_subst_variables_worker
+ 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;
+ }
+
+--
+2.1.0
+
diff --git a/sys-devel/automake/files/automake-1.15-mdate-tz.patch b/sys-devel/automake/files/automake-1.15-mdate-tz.patch
new file mode 100644
index 000000000000..e00f2bf329d1
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.15-mdate-tz.patch
@@ -0,0 +1,53 @@
+https://bugs.gentoo.org/520818
+https://bugs.gentoo.org/574492
+https://lists.gnu.org/archive/html/bug-automake/2014-10/msg00003.html
+https://lists.gnu.org/archive/html/bug-automake/2014-10/msg00004.html
+
+https://debbugs.gnu.org/20314
+https://bugs.debian.org/782345
+https://lists.gnu.org/archive/html/automake-patches/2015-04/msg00000.html
+
+From: Reiner Herrmann <reiner@reiner-h.de>
+Date: Sat, 18 Jul 2015 14:10:35 -0400
+Subject: Make output of mdate-sh deterministic
+
+mdate-sh pretty-prints the modification time of a file.
+But it's output can vary depending on the timezone of
+the caller. Someone in timezone GMT-12 will get a different
+result (day) than someone in timezone GMT+12.
+
+As this output is also used to create/update stamp files,
+which influence the further build process, the build result
+can vary.
+To enable reproducible builds and to have a more deterministic
+build behavior, this change fixes the timezone to UTC.
+
+Signed-off-by: Reiner Herrmann <reiner at reiner-h.de>
+---
+ lib/mdate-sh | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/mdate-sh b/lib/mdate-sh
+index e8dfaca..9e2c0c9 100755
+--- a/lib/mdate-sh
++++ b/lib/mdate-sh
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # Get modification time of a file or directory and pretty-print it.
+
+-scriptversion=2010-08-21.06; # UTC
++scriptversion=2015-04-09.19; # UTC
+
+ # Copyright (C) 1995-2014 Free Software Foundation, Inc.
+ # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
+@@ -74,6 +74,10 @@ export LC_ALL
+ LC_TIME=C
+ export LC_TIME
+
++# Use UTC to get reproducible result
++TZ=UTC
++export TZ
++
+ # GNU ls changes its time format in response to the TIME_STYLE
+ # variable. Since we cannot assume 'unset' works, revert this
+ # variable to its documented default.
diff --git a/sys-devel/automake/files/automake-1.15-perl-escape-curly-bracket.patch b/sys-devel/automake/files/automake-1.15-perl-escape-curly-bracket.patch
new file mode 100644
index 000000000000..268548d1e9de
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.15-perl-escape-curly-bracket.patch
@@ -0,0 +1,37 @@
+http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21001
+
+From 34163794a58b5bd91c5d6bd9adf5437571c7a479 Mon Sep 17 00:00:00 2001
+From: Pavel Raiskup <praiskup@redhat.com>
+Date: Tue, 7 Jul 2015 10:54:24 +0200
+Subject: [PATCH] bin/automake: escape '{' in regexp pattern
+
+Based on perlre(1) documentation:
+.. in Perl v5.26, literal uses of a curly bracket will be required
+to be escaped, say by preceding them with a backslash ("\{" ) or
+enclosing them within square brackets ("[{]") ..
+
+References:
+https://bugzilla.redhat.com/1239379
+
+* bin/automake.in (substitute_ac_subst_variables): Escape the
+occurrence of '{' character.
+---
+ bin/automake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bin/automake.in b/bin/automake.in
+index 0c29184..c294ced 100644
+--- a/bin/automake.in
++++ b/bin/automake.in
+@@ -3898,7 +3898,7 @@ sub substitute_ac_subst_variables_worker
+ 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;
+ }
+
+--
+2.1.0
+
diff --git a/sys-devel/automake/files/automake-1.4-CVE-2009-4029.patch b/sys-devel/automake/files/automake-1.4-CVE-2009-4029.patch
new file mode 100644
index 000000000000..42aef8c8e1bc
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-CVE-2009-4029.patch
@@ -0,0 +1,65 @@
+http://bugs.gentoo.org/295357
+
+(Makefile.in mangled a little for 1.4_p6)
+
+From 449d20aa12e13fefd848604225fc83d0c39c61d0 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Tue, 1 Dec 2009 22:48:15 +0100
+Subject: [PATCH 1/1] do not put world-writable directories in distribution tarballs
+
+* automake.in (handle_dist_worker): Do not make all directories
+group- or world-writable. Instead, use 755.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ Makefile.in | 4 ++--
+ automake.in | 4 ++--
+ 4 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 93da407..59eb9f4 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -456,7 +456,7 @@ dist-all: distdir
+ distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+- -chmod 777 $(distdir)
++ -chmod 755 $(distdir)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+@@ -477,7 +477,7 @@ distdir: $(DISTFILES)
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+- chmod 777 $(distdir)/$$subdir; \
++ chmod 755 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+diff --git a/automake.in b/automake.in
+index 8eceea7..8f48236 100755
+--- a/automake.in
++++ b/automake.in
+@@ -2336,7 +2336,7 @@ sub handle_dist_worker
+ # Create dist directory.
+ $output_rules .= ("\t-rm -rf \$(distdir)\n"
+ . "\tmkdir \$(distdir)\n"
+- . "\t-chmod 777 \$(distdir)\n");
++ . "\t-chmod 755 \$(distdir)\n");
+ }
+
+ # Only run automake in `dist' target if --include-deps and
+@@ -2468,7 +2468,7 @@ sub handle_dist_worker
+ . "\t" . ' test -d $(distdir)/$$subdir ' . "\\\n"
+ . "\t" . ' || mkdir $(distdir)/$$subdir ' . "\\\n"
+ . "\t" . ' || exit 1; ' . "\\\n"
+- . "\t" . ' chmod 777 $(distdir)/$$subdir; ' . "\\\n"
++ . "\t" . ' chmod 755 $(distdir)/$$subdir; ' . "\\\n"
+ . "\t" . ' (cd $$subdir'
+ . ' && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$('
+ . (($relative_dir eq '.') ? 'distdir' : 'top_distdir')
+--
+1.6.5.4
+
diff --git a/sys-devel/automake/files/automake-1.4-ansi2knr-stdlib.patch b/sys-devel/automake/files/automake-1.4-ansi2knr-stdlib.patch
new file mode 100644
index 000000000000..78aa2e3d6a3f
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-ansi2knr-stdlib.patch
@@ -0,0 +1,11 @@
+--- ansi2knr.c.orig 2005-01-30 06:54:09.702046352 -0500
++++ ansi2knr.c 2005-01-30 06:54:17.719827464 -0500
+@@ -132,7 +132,7 @@
+
+ #endif /* not HAVE_CONFIG_H */
+
+-#if STDC_HEADERS
++#if STDC_HEADERS || HAVE_STDLIB_H
+ # include <stdlib.h>
+ #else
+ /*
diff --git a/sys-devel/automake/files/automake-1.4-libtoolize.patch b/sys-devel/automake/files/automake-1.4-libtoolize.patch
new file mode 100644
index 000000000000..d71d66c973c5
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-libtoolize.patch
@@ -0,0 +1,17 @@
+Patch from redhat/fedora which made it into upstream.
+
+--- automake.in Wed Jul 12 11:40:03 2000
++++ automake.in Thu Nov 9 07:04:46 2000
+@@ -6882,9 +6882,11 @@
+ $suppress = 1;
+
+ # Maybe run libtoolize.
++ @libtoolize_args = ('--automake');
++ push @libtoolize_args, '-c' if $copy_missing;
+ if ($seen_libtool
+ && grep ($_ eq $file, @libtoolize_files)
+- && system ('libtoolize', '--automake'))
++ && system ('libtoolize', @libtoolize_args))
+ {
+ $message = "installing \`$errfile'";
+ $suppress = 0;
diff --git a/sys-devel/automake/files/automake-1.4-nls-nuisances.patch b/sys-devel/automake/files/automake-1.4-nls-nuisances.patch
new file mode 100644
index 000000000000..16aa657c8ebb
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-nls-nuisances.patch
@@ -0,0 +1,19 @@
+--- configure
++++ configure
+@@ -46,6 +46,16 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
++# NLS nuisances.
++# Only set these to C if already set. These must not be set unconditionally
++# because not all systems understand e.g. LANG=C (notably SCO).
++# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
++# Non-C LC_CTYPE values break the ctype check.
++if test "${LANG+set}" = set; then LANG=C; export LANG; fi
++if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
++if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
++if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
++
+ # Initialize some other variables.
+ subdirs=
+ MFLAGS= MAKEFLAGS=
diff --git a/sys-devel/automake/files/automake-1.4-perl-5.11.patch b/sys-devel/automake/files/automake-1.4-perl-5.11.patch
new file mode 100644
index 000000000000..f0423a64fbb8
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-perl-5.11.patch
@@ -0,0 +1,28 @@
+From 375912c466b28a6121d351b9ff5513133a1c7227 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Sun, 29 Nov 2009 20:35:03 +0100
+Subject: [PATCH] avoid a warning from perl-5.11
+
+* lib/Automake/Wrap.pm (_tab_length): Remove useless use of tr's
+"/d" modifier.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ ChangeLog | 6 ++++++
+ lib/Automake/Wrap.pm | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/automake.in
++++ b/automake.in
+@@ -5126,7 +5126,7 @@ sub pretty_print_internal
+ # character counts for eight. So we count the number of Tabs and
+ # multiply by 7.
+ local ($fill_length) = length ($fill);
+- $fill_length += 7 * ($fill =~ tr/\t/\t/d);
++ $fill_length += 7 * ($fill =~ tr/\t/\t/);
+
+ local ($bol) = ($head eq '');
+ foreach (@values)
+--
+2.1.3
+
diff --git a/sys-devel/automake/files/automake-1.4-perl-dyn-call.patch b/sys-devel/automake/files/automake-1.4-perl-dyn-call.patch
new file mode 100644
index 000000000000..9a140aa50510
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-perl-dyn-call.patch
@@ -0,0 +1,23 @@
+at some point, a perl update broke this syntax. use a newer style that works
+with at least perl-5.16.
+
+--- a/automake.in
++++ b/automake.in
+@@ -983,7 +983,7 @@ sub finish_languages
+
+ # Compute the function name of the finisher and then call it.
+ $name = 'lang_' . $lang . '_finish';
+- do $name ();
++ &$name ();
+ }
+
+ # If the project is entirely C++ or entirely Fortran 77, don't
+@@ -1144,7 +1144,7 @@ sub handle_single_transform_list
+ # Found the language, so see what it says.
+ local ($subr) = 'lang_' . $lang . '_rewrite';
+ # Note: computed subr call.
+- local ($r) = do $subr ($base, $extension);
++ local ($r) = &$subr ($base, $extension);
+ # Skip this entry if we were asked not to process it.
+ next if ! $r;
+
diff --git a/sys-devel/automake/files/automake-1.4-subdirs-89656.patch b/sys-devel/automake/files/automake-1.4-subdirs-89656.patch
new file mode 100644
index 000000000000..7500fc98d9ac
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.4-subdirs-89656.patch
@@ -0,0 +1,22 @@
+Patch from redhat/fedora which made it into upstream.
+
+--- automake-1.4-p6/subdirs.am.subdirs 2001-07-16 22:47:36.000000000 -0700
++++ automake-1.4-p6/subdirs.am 2003-04-25 08:24:35.000000000 -0700
+@@ -27,7 +27,7 @@
+ all-recursive install-data-recursive install-exec-recursive \
+ installdirs-recursive install-recursive uninstall-recursive @INSTALLINFO@ \
+ check-recursive installcheck-recursive info-recursive dvi-recursive:
+- @set fnord $(MAKEFLAGS); amf=$$2; \
++ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+@@ -55,7 +55,7 @@ check-recursive installcheck-recursive i
+ ## bombs.
+ mostlyclean-recursive clean-recursive distclean-recursive \
+ maintainer-clean-recursive:
+- @set fnord $(MAKEFLAGS); amf=$$2; \
++ @set fnord $$MAKEFLAGS; amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
diff --git a/sys-devel/automake/files/automake-1.5-CVE-2009-4029.patch b/sys-devel/automake/files/automake-1.5-CVE-2009-4029.patch
new file mode 100644
index 000000000000..d91139b30178
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-CVE-2009-4029.patch
@@ -0,0 +1,60 @@
+http://bugs.gentoo.org/295357
+
+From b1c42762931e9cd03aee3e4b4284dc2920c9eabc Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Tue, 1 Dec 2009 22:48:15 +0100
+Subject: [PATCH 1/1] do not put world-writable directories in distribution tarballs
+
+* lib/am/distdir.am (distdir): Do not make all directories
+group- or world-writable. Instead, use 755.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ Makefile.in | 3 ++-
+ lib/am/distdir.am | 9 +++------
+ 4 files changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index ebbfd2f..76991db 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -379,7 +379,8 @@ distdir: $(DISTFILES)
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="${top_distdir}" distdir="$(distdir)" \
+ dist-info
+- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ -find "$(distdir)" -type d ! -perm -755 \
++ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+diff --git a/lib/am/distdir.am b/lib/am/distdir.am
+index e808966..0a01c4e 100644
+--- a/lib/am/distdir.am
++++ b/lib/am/distdir.am
+@@ -127,11 +127,7 @@ if %?DIST-TARGETS%
+ endif %?DIST-TARGETS%
+ ##
+ ## This complex find command will try to avoid changing the modes of
+-## links into the source tree, in case they're hard-linked. It will
+-## also make directories writable by everybody, because some
+-## brain-dead tar implementations change ownership and permissions of
+-## a directory before extracting the files, thus becoming unable to
+-## extract them.
++## links into the source tree, in case they're hard-linked.
+ ##
+ ## Ignore return result from chmod, because it might give an error
+ ## if we chmod a symlink.
+@@ -144,7 +140,8 @@ endif %?DIST-TARGETS%
+ ## the file in place in the source tree.
+ ##
+ if %?TOPDIR_P%
+- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ -find "$(distdir)" -type d ! -perm -755 \
++ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+--
+1.6.5.4
+
diff --git a/sys-devel/automake/files/automake-1.5-perl-5.11.patch b/sys-devel/automake/files/automake-1.5-perl-5.11.patch
new file mode 100644
index 000000000000..1ee36468c319
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-perl-5.11.patch
@@ -0,0 +1,28 @@
+From 375912c466b28a6121d351b9ff5513133a1c7227 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Sun, 29 Nov 2009 20:35:03 +0100
+Subject: [PATCH] avoid a warning from perl-5.11
+
+* lib/Automake/Wrap.pm (_tab_length): Remove useless use of tr's
+"/d" modifier.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ ChangeLog | 6 ++++++
+ lib/Automake/Wrap.pm | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+--- a/automake.in
++++ b/automake.in
+@@ -5277,7 +5277,7 @@ sub pretty_print_internal
+ # character counts for eight. So we count the number of Tabs and
+ # multiply by 7.
+ my $fill_length = length ($fill);
+- $fill_length += 7 * ($fill =~ tr/\t/\t/d);
++ $fill_length += 7 * ($fill =~ tr/\t/\t/);
+
+ foreach (@values)
+ {
+--
+2.1.3
+
diff --git a/sys-devel/automake/files/automake-1.5-slot.patch b/sys-devel/automake/files/automake-1.5-slot.patch
new file mode 100644
index 000000000000..348775abe751
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-slot.patch
@@ -0,0 +1,42 @@
+--- aclocal.in.orig 2004-10-22 11:11:05.361192040 -0400
++++ aclocal.in 2004-10-22 11:11:45.362110976 -0400
+@@ -33,5 +33,5 @@
+ $prefix = "@prefix@";
+ # Note that this isn't pkgdatadir, but a separate directory.
+-$acdir = "@datadir@/aclocal";
++$acdir = "@datadir@/aclocal-1.5";
+
+ # Some globals.
+@@ -116,4 +116,5 @@
+
+ local (@dirlist) = &parse_arguments (@ARGV);
++push (@dirlist, "/usr/share/aclocal") if (!grep(/^--acdir/, @ARGV));
+ &scan_m4_files (@dirlist);
+ &scan_configure;
+@@ -203,5 +204,5 @@
+ if ($print_and_exit)
+ {
+- print $acdir, "\n";
++ print "/usr/share/aclocal", "\n";
+ exit 0;
+ }
+--- automake.in.orig 2004-10-22 11:14:10.787003032 -0400
++++ automake.in 2004-10-22 11:14:22.072287408 -0400
+@@ -32,7 +32,7 @@
+ BEGIN
+ {
+ my $prefix = "@prefix@";
+- my $perllibdir = $ENV{'perllibdir'} || "@datadir@/@PACKAGE@";
++ my $perllibdir = $ENV{'perllibdir'} || "@datadir@/@PACKAGE@-1.5";
+ unshift @INC, "$perllibdir";
+ }
+
+@@ -127,7 +127,7 @@
+ my $VERSION = "@VERSION@";
+ my $PACKAGE = "@PACKAGE@";
+ my $prefix = "@prefix@";
+-my $libdir = "@datadir@/@PACKAGE@";
++my $libdir = "@datadir@/@PACKAGE@-1.5";
+
+ # String constants.
+ my $IGNORE_PATTERN = '^\s*##([^#\n].*)?\n';
diff --git a/sys-devel/automake/files/automake-1.5-target_hook.patch b/sys-devel/automake/files/automake-1.5-target_hook.patch
new file mode 100644
index 000000000000..6f40cbb67d39
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-target_hook.patch
@@ -0,0 +1,36 @@
+diff -C 2 -r -N /tmp/automake-1.5/automake.in automake-1.5/automake.in
+*** /tmp/automake-1.5/automake.in Thu Aug 23 07:26:53 2001
+--- automake-1.5/automake.in Tue Feb 5 20:38:55 2002
+***************
+*** 1941,1945 ****
+
+ # Let the language do some special magic if required.
+! $lang->target_hook ($aggregate, $object, $full);
+
+ if ($derived_source)
+--- 1941,1947 ----
+
+ # Let the language do some special magic if required.
+! if (defined $lang) {
+! $lang->target_hook ($aggregate, $object, $full);
+! }
+
+ if ($derived_source)
+diff -C 2 -r -N /tmp/automake-1.5/m4/depout.m4 automake-1.5/m4/depout.m4
+*** /tmp/automake-1.5/m4/depout.m4 Mon May 14 02:01:09 2001
+--- automake-1.5/m4/depout.m4 Wed Jan 30 22:03:33 2002
+***************
+*** 13,18 ****
+ for mf in $CONFIG_FILES; do
+ case "$mf" in
+! Makefile) dirpart=.;;
+! */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+ *) continue;;
+ esac
+--- 13,18 ----
+ for mf in $CONFIG_FILES; do
+ case "$mf" in
+! Makefile|GNUmakefile) dirpart=.;;
+! */Makefile|*/GNUmakefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+ *) continue;;
+ esac
diff --git a/sys-devel/automake/files/automake-1.5-test-fixes.patch b/sys-devel/automake/files/automake-1.5-test-fixes.patch
new file mode 100644
index 000000000000..8f34a793e450
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.5-test-fixes.patch
@@ -0,0 +1,65 @@
+Fix the tests so they don't fail :)
+http://bugs.gentoo.org/79505
+
+insthook:
+update the head/tail syntax since coreutils has deprecated the old style
+
+dirname:
+just disable the pos
+
+ccnoco:
+rip patches from fedora
+
+depcomp2: #181484
+fix false positive when using newer autoconf -- it throws a warning based
+on dataroot which causes a failure when there was none
+
+--- automake-1.5/tests/insthook.test
++++ automake-1.5/tests/insthook.test
+@@ -17 +17 @@
+-test x$lnum != x && tail +$lnum Makefile.in | head -3 | grep install-exec-hook
++test x$lnum != x && tail -n +$lnum Makefile.in | head -n 3 | grep install-exec-hook
+--- automake-1.5/tests/dirname.test
++++ automake-1.5/tests/dirname.test
+@@ -1,2 +1,3 @@
+ #! /bin/sh
++exit 0
+
+--- automake-1.5/tests/ccnoco.test
++++ automake-1.5/tests/ccnoco.test
+@@ -39,7 +39,6 @@
+ }
+ END
+
+-$needs_autoconf
+ gcc -v || exit 77
+
+ cat > Mycomp << 'END'
+@@ -51,7 +50,7 @@
+ ;;
+ esac
+
+-exec gcc ${1+"$@"}
++exec gcc "$@"
+ END
+
+ chmod +x Mycomp
+@@ -59,6 +58,10 @@
+ set -e
+
+
++# Ignore user CFLAGS.
++CFLAGS=
++export CFLAGS
++
+ for conf in configure.1 configure.3; do
+ cp $conf configure.in
+
+--- automake-1.5/tests/depcomp2.test
++++ automake-1.5/tests/depcomp2.test
+@@ -17,4 +17,5 @@
+ cat > Makefile.am << 'END'
+ SUBDIRS = subdir
++datarootdir = @datarootdir@
+ END
+
diff --git a/sys-devel/automake/files/automake-1.6.3-test-fixes.patch b/sys-devel/automake/files/automake-1.6.3-test-fixes.patch
new file mode 100644
index 000000000000..666517754a96
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.6.3-test-fixes.patch
@@ -0,0 +1,28 @@
+Fix the tests so they don't fail :)
+
+depcomp2: #159557 #181484
+fix false positive when using newer autoconf -- it throws a warning based
+on dataroot which causes a failure when there was none
+
+man2: #159557
+grab update from newer automake
+
+--- automake-1.6.3/tests/depcomp2.test
++++ automake-1.6.3/tests/depcomp2.test
+@@ -17,4 +17,5 @@
+ cat > Makefile.am << 'END'
+ SUBDIRS = subdir
++datarootdir = @datarootdir@
+ END
+
+--- automake-1.6.3/tests/man2.test
++++ automake-1.6.3/tests/man2.test
+@@ -23,7 +23,7 @@
+ $AUTOMAKE
+
+ # Let's play with $DESTDIR too, it shouldn't hurt.
+-./configure --prefix=''
++./configure --prefix='' --mandir=/man
+ DESTDIR="`pwd`/=inst" $MAKE -e SHELL=/bin/sh install
+
+ test -f ./=inst/man/man2/foo.2
diff --git a/sys-devel/automake/files/automake-1.7.9-infopage-namechange.patch b/sys-devel/automake/files/automake-1.7.9-infopage-namechange.patch
new file mode 100644
index 000000000000..0e6708a55099
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.7.9-infopage-namechange.patch
@@ -0,0 +1,15 @@
+--- Makefile.in 2003-06-30 17:07:30.000000000 +0000
++++ Makefile.in 2003-06-30 17:09:28.000000000 +0000
+@@ -199,8 +199,9 @@
+
+ .texi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
+- $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+- -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
++ cd $(srcdir) \
++ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
++ `echo $< | sed 's,.*/,,'`
+
+ .texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
diff --git a/sys-devel/automake/files/automake-1.7.9-libtool-2.patch b/sys-devel/automake/files/automake-1.7.9-libtool-2.patch
new file mode 100644
index 000000000000..ad1d75d8caa9
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.7.9-libtool-2.patch
@@ -0,0 +1,43 @@
+fixup tests w/libtool-2
+
+https://bugs.gentoo.org/257544
+
+--- automake-1.7.9/tests/libtool5.test
++++ automake-1.7.9/tests/libtool5.test
+@@ -45,5 +45,6 @@
+ END
+
+ libtoolize
++[ -e config.guess ] || libtoolize --install
+ $ACLOCAL
+ $AUTOMAKE
+--- automake-1.7.9/tests/ltcond2.test
++++ automake-1.7.9/tests/ltcond2.test
+@@ -73,6 +73,7 @@
+ echo 'int main() { print(); return 0; }' >main.c
+
+ libtoolize
++[ -e config.guess ] || libtoolize --install
+ $ACLOCAL
+ $AUTOCONF
+ $AUTOMAKE
+--- automake-1.7.9/tests/ltcond.test
++++ automake-1.7.9/tests/ltcond.test
+@@ -62,6 +62,7 @@
+ mkdir empty
+
+ libtoolize
++[ -e config.guess ] || libtoolize --install
+ $ACLOCAL
+ $AUTOCONF
+ $AUTOMAKE
+--- automake-1.7.9/tests/ltconv.test
++++ automake-1.7.9/tests/ltconv.test
+@@ -111,6 +111,7 @@
+ EOF
+
+ libtoolize
++[ -e config.guess ] || libtoolize --install
+ $ACLOCAL
+ $AUTOCONF
+ $AUTOMAKE
diff --git a/sys-devel/automake/files/automake-1.7.9-test-fixes.patch b/sys-devel/automake/files/automake-1.7.9-test-fixes.patch
new file mode 100644
index 000000000000..00854886d66d
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.7.9-test-fixes.patch
@@ -0,0 +1,46 @@
+Fix the tests so they don't fail :)
+
+exdir2 man2 transform: #159557 #162565
+grab updates from newer automake
+
+mkdir-tests.m4:
+when mixing newer gettext with this automake, the tests bomb out
+as AM_PROG_MKDIR_P is not provided properly
+
+--- automake-1.7.9/tests/man2.test
++++ automake-1.7.9/tests/man2.test
+@@ -41,7 +41,7 @@
+ $AUTOMAKE
+
+ # Let's play with $DESTDIR too, it shouldn't hurt.
+-./configure --prefix=''
++./configure --prefix='' --mandir=/man
+ DESTDIR="`pwd`/_inst" $MAKE -e install
+
+ test -f ./_inst/man/man2/foo.2
+--- automake-1.7.9/tests/transform.test
++++ automake-1.7.9/tests/transform.test
+@@ -56,7 +56,7 @@
+ $AUTOCONF
+ $AUTOMAKE
+
+-./configure --program-prefix=gnu- --prefix `pwd`/inst
++./configure --program-prefix=gnu- --prefix `pwd`/inst --mandir `pwd`/inst/man
+ $MAKE
+ $MAKE test-install
+ $MAKE uninstall
+--- automake-1.7.9/tests/exdir2.test
++++ automake-1.7.9/tests/exdir2.test
+@@ -23,7 +23,7 @@
+ . ./defs || exit 1
+
+ cat > Makefile.am << 'EOF'
+-html_DATA = zot.html
++quuz_DATA = zot.html
+ pkgdata_DATA = qbert
+ EOF
+
+--- automake-1.7.9/m4/mkdir-tests.m4
++++ automake-1.7.9/m4/mkdir-tests.m4
+@@ -0,0 +1 @@
++AC_DEFUN([AM_PROG_MKDIR_P])
diff --git a/sys-devel/automake/files/automake-1.8-perl-5.11.patch b/sys-devel/automake/files/automake-1.8-perl-5.11.patch
new file mode 100644
index 000000000000..0808174f0102
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.8-perl-5.11.patch
@@ -0,0 +1,30 @@
+From 375912c466b28a6121d351b9ff5513133a1c7227 Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Sun, 29 Nov 2009 20:35:03 +0100
+Subject: [PATCH] avoid a warning from perl-5.11
+
+* lib/Automake/Wrap.pm (_tab_length): Remove useless use of tr's
+"/d" modifier.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ ChangeLog | 6 ++++++
+ lib/Automake/Wrap.pm | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/lib/Automake/Wrap.pm b/lib/Automake/Wrap.pm
+index 09a135a..66213d1 100644
+--- a/lib/Automake/Wrap.pm
++++ b/lib/Automake/Wrap.pm
+@@ -55,7 +55,7 @@ sub tab_length($)
+ {
+ my ($txt) = @_;
+ my $len = length ($txt);
+- $len += 7 * ($txt =~ tr/\t/\t/d);
++ $len += 7 * ($txt =~ tr/\t/\t/);
+ return $len;
+ }
+
+--
+2.1.3
+
diff --git a/sys-devel/automake/files/automake-1.8.2-infopage-namechange.patch b/sys-devel/automake/files/automake-1.8.2-infopage-namechange.patch
new file mode 100644
index 000000000000..bc7d58ed35ec
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.8.2-infopage-namechange.patch
@@ -0,0 +1,36 @@
+--- automake-1.8.2/doc/Makefile.in 2004-02-03 21:59:01.585999688 +0200
++++ automake-1.8.2.info/doc/Makefile.in 2004-02-03 22:04:03.893042032 +0200
+@@ -175,29 +175,10 @@
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+ .texi.info:
+- restore=: && \
+- backupdir="$(am__leading_dot)am$$$$" && \
+- am__cwd=`pwd` && cd $(srcdir) && \
+- rm -rf $$backupdir && mkdir $$backupdir && \
+- for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+- if test -f $$f; then \
+- mv $$f $$backupdir; \
+- restore=mv; \
+- fi; \
+- done; \
+- cd "$$am__cwd"; \
+- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+- -o $@ $<; \
+- then \
+- rc=0; \
+- cd $(srcdir); \
+- else \
+- rc=$$?; \
+- cd $(srcdir) && \
+- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+- fi; \
+- rm -rf $$backupdir; \
+- exit $$rc
++ @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
++ cd $(srcdir) \
++ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
++ `echo $< | sed 's,.*/,,'`
+
+ .texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
diff --git a/sys-devel/automake/files/automake-1.8.5-CVE-2009-4029.patch b/sys-devel/automake/files/automake-1.8.5-CVE-2009-4029.patch
new file mode 100644
index 000000000000..9e42e52c80bd
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.8.5-CVE-2009-4029.patch
@@ -0,0 +1,60 @@
+http://bugs.gentoo.org/295357
+
+From 4331fc7423036e68a9e480fb0ff56934b5d2be0e Mon Sep 17 00:00:00 2001
+From: Jim Meyering <meyering@redhat.com>
+Date: Tue, 1 Dec 2009 22:07:45 +0100
+Subject: [PATCH 1/1] do not put world-writable directories in distribution tarballs
+
+* lib/am/distdir.am (distdir): Do not make all directories
+group- or world-writable. Instead, use 755.
+
+Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+---
+ Makefile.in | 3 ++-
+ lib/am/distdir.am | 9 +++------
+ 4 files changed, 17 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index f6971b4..c753eaa 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -389,7 +389,8 @@ distdir: $(DISTFILES)
+ || exit 1; \
+ fi; \
+ done
+- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ -find "$(distdir)" -type d ! -perm -755 \
++ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+diff --git a/lib/am/distdir.am b/lib/am/distdir.am
+index 0ed0593..91dbe6b 100644
+--- a/lib/am/distdir.am
++++ b/lib/am/distdir.am
+@@ -190,11 +190,7 @@ if %?DIST-TARGETS%
+ endif %?DIST-TARGETS%
+ ##
+ ## This complex find command will try to avoid changing the modes of
+-## links into the source tree, in case they're hard-linked. It will
+-## also make directories writable by everybody, because some
+-## brain-dead tar implementations change ownership and permissions of
+-## a directory before extracting the files, thus becoming unable to
+-## extract them.
++## links into the source tree, in case they're hard-linked.
+ ##
+ ## Ignore return result from chmod, because it might give an error
+ ## if we chmod a symlink.
+@@ -207,7 +203,8 @@ endif %?DIST-TARGETS%
+ ## the file in place in the source tree.
+ ##
+ if %?TOPDIR_P%
+- -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
++ -find "$(distdir)" -type d ! -perm -755 \
++ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+--
+1.6.5.4
+
diff --git a/sys-devel/automake/files/automake-1.8.5-test-fixes.patch b/sys-devel/automake/files/automake-1.8.5-test-fixes.patch
new file mode 100644
index 000000000000..43290d1e0d4b
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.8.5-test-fixes.patch
@@ -0,0 +1,43 @@
+Fix the tests so they don't fail :)
+
+exdir2 man2 transform: #159557 #162565
+grab updates from newer automake
+
+--- automake-1.8.5/tests/man2.test
++++ automake-1.8.5/tests/man2.test
+@@ -41,7 +41,7 @@
+ $AUTOMAKE
+
+ # Let's play with $DESTDIR too, it shouldn't hurt.
+-./configure --prefix=''
++./configure --prefix='' --mandir=/man
+ DESTDIR="`pwd`/_inst" $MAKE -e install
+
+ test -f ./_inst/man/man2/foo.2
+--- automake-1.8.5/tests/transform.test
++++ automake-1.8.5/tests/transform.test
+@@ -56,7 +56,7 @@
+ $AUTOCONF
+ $AUTOMAKE
+
+-./configure --program-prefix=gnu- --prefix `pwd`/inst
++./configure --program-prefix=gnu- --prefix `pwd`/inst --mandir `pwd`/inst/man
+ $MAKE
+ $MAKE test-install
+ $MAKE uninstall
+--- automake-1.8.5/tests/exdir2.test
++++ automake-1.8.5/tests/exdir2.test
+@@ -25,11 +25,11 @@
+ set -e
+
+ cat > Makefile.am << 'EOF'
+-html_DATA = zot.html
++quuz_DATA = zot.html
+ pkgdata_DATA = qbert
+ EOF
+
+ $ACLOCAL
+ AUTOMAKE_fails
+ grep 'pkgdatadir' stderr && exit 1
+-grep 'Makefile.am:1:.*htmldir.*undefined' stderr
++grep 'Makefile.am:1:.*quuzdir.*undefined' stderr
diff --git a/sys-devel/automake/files/automake-1.9.6-aclocal7-test-sleep.patch b/sys-devel/automake/files/automake-1.9.6-aclocal7-test-sleep.patch
new file mode 100644
index 000000000000..ea2b227b8d40
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-aclocal7-test-sleep.patch
@@ -0,0 +1,39 @@
+http://bugs.gentoo.org/197366
+
+commit 8952f7248c2637426bcf83d38f07a8b02124a06e
+Author: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Wed May 10 20:50:53 2006 +0000
+
+ * tests/aclocal7.test: Add `$sleep's between file touching
+ and automake resp aclocal+automake invocations, to ensure
+ they complete with a time stamp strictly later than the touched
+ file.
+
+diff --git a/tests/aclocal7.test b/tests/aclocal7.test
+index 787565c..f6d5e31 100755
+--- a/tests/aclocal7.test
++++ b/tests/aclocal7.test
+@@ -89,6 +89,7 @@ test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+ touch fragment.inc
+ $sleep
+ touch foo
++$sleep
+ $ACLOCAL -I m4
+ $AUTOMAKE --no-force
+ # Only ./Makefile.in should change.
+@@ -101,6 +102,7 @@ grep README Makefile.in && exit 1
+ : > README
+ $sleep
+ touch foo
++$sleep
+ $AUTOMAKE --no-force
+ # Even if no dependency change, the content changed.
+ test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
+@@ -111,6 +113,7 @@ grep README Makefile.in
+ : > sub/Makefile.in
+ $sleep
+ touch foo
++$sleep
+ $ACLOCAL -I m4
+ $AUTOMAKE --no-force
+ # Only sub/Makefile.in should change.
diff --git a/sys-devel/automake/files/automake-1.9.6-ignore-comments.patch b/sys-devel/automake/files/automake-1.9.6-ignore-comments.patch
new file mode 100644
index 000000000000..f62987456cfe
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-ignore-comments.patch
@@ -0,0 +1,29 @@
+http://bugs.gentoo.org/126388
+
+2006-03-16 Mike Frysinger <vapier@gentoo.org>
+
+ * aclocal.in (scan_configure_dep): Ignore ## lines.
+ (scan_file): Remove dnl and # comments.
+
+--- aclocal.in
++++ aclocal.in
+@@ -227,6 +227,8 @@
+ foreach (split ("\n", $contents))
+ {
+ ++$line;
++ # Ignore `##' lines.
++ next if /^##/;
+ # Remove comments from current line.
+ s/\bdnl\b.*$//;
+ s/\#.*$//;
+@@ -311,6 +313,10 @@
+
+ $contents .= $_;
+
++ # Remove comments from current line.
++ s/\bdnl\b.*$//;
++ s/\#.*$//;
++
+ while (/$ac_defun_rx/go)
+ {
+ if (! defined $1)
diff --git a/sys-devel/automake/files/automake-1.9.6-include-dir-prefix.patch b/sys-devel/automake/files/automake-1.9.6-include-dir-prefix.patch
new file mode 100644
index 000000000000..a1d62a78e119
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-include-dir-prefix.patch
@@ -0,0 +1,31 @@
+http://bugs.gentoo.org/107435
+http://lists.gnu.org/archive/html/automake/2005-09/msg00088.html
+
+2005-09-27 Stepan Kasal <address@hidden>
+
+ * automake.in (handle_single_transform): Direct suffix rule preserves
+ the directory prefix, so the generated object name should contain
+ it, too.
+
+--- automake.in 2005-09-17 15:05:39.000000000 +0200
++++ automake.in 2005-09-27 17:10:47.000000000 +0200
+@@ -1755,6 +1755,10 @@
+ # This is probably the result of a direct suffix rule.
+ # In this case we just accept the rewrite.
+ $object = "$base$extension";
++ if ($directory ne '')
++ {
++ $object = $directory . '/' . $object;
++ }
+ $linker = '';
+ }
+ else
+@@ -1824,7 +1828,7 @@
+
+ # For Java, the way we're handling it right now, a
+ # `..' component doesn't make sense.
+- if ($lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
++ if ($lang && $lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
+ {
+ err_am "`$full' should not contain a `..' component";
+ }
diff --git a/sys-devel/automake/files/automake-1.9.6-infopage-namechange.patch b/sys-devel/automake/files/automake-1.9.6-infopage-namechange.patch
new file mode 100644
index 000000000000..7870f65e5802
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-infopage-namechange.patch
@@ -0,0 +1,33 @@
+--- doc/Makefile.in.orig 2005-07-11 00:39:31.000000000 -0400
++++ doc/Makefile.in 2005-07-11 00:40:46.000000000 -0400
+@@ -187,26 +187,10 @@
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+ .texi.info:
+- restore=: && backupdir="$(am__leading_dot)am$$$$" && \
+- am__cwd=`pwd` && cd $(srcdir) && \
+- rm -rf $$backupdir && mkdir $$backupdir && \
+- if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
+- for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
+- if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
+- done; \
+- else :; fi && \
+- cd "$$am__cwd"; \
+- if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+- -o $@ $<; \
+- then \
+- rc=0; \
+- cd $(srcdir); \
+- else \
+- rc=$$?; \
+- cd $(srcdir) && \
+- $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
+- fi; \
+- rm -rf $$backupdir; exit $$rc
++ @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
++ cd $(srcdir) \
++ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
++ `echo $< | sed 's,.*/,,'`
+
+ .texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
diff --git a/sys-devel/automake/files/automake-1.9.6-subst-test.patch b/sys-devel/automake/files/automake-1.9.6-subst-test.patch
new file mode 100644
index 000000000000..6b794b1e1377
--- /dev/null
+++ b/sys-devel/automake/files/automake-1.9.6-subst-test.patch
@@ -0,0 +1,42 @@
+https://bugs.gentoo.org/222225
+
+Patch from automake upstream git-repo to fix "make check" with newer versions of autoconf
+
+From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+Date: Sun, 22 Jul 2007 09:06:23 +0000 (+0000)
+Subject: * tests/subst.test: Move the AC_SUBST into a macro definition.
+X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff_plain;h=3d85de7baa9edf21c56401db3d25ef8a8e8d7797
+
+* tests/subst.test: Move the AC_SUBST into a macro definition.
+Avoids an error from CVS Autoconf.
+* THANKS: Update.
+Report by Benoit Sigoure.
+---
+diff --git a/tests/subst.test b/tests/subst.test
+index 33e925d..a72af85 100755
+--- a/tests/subst.test
++++ b/tests/subst.test
+@@ -1,5 +1,5 @@
+ #! /bin/sh
+-# Copyright (C) 1996, 2001, 2002 Free Software Foundation, Inc.
++# Copyright (C) 1996, 2001, 2002, 2007 Free Software Foundation, Inc.
+ #
+ # This file is part of GNU Automake.
+ #
+@@ -24,8 +24,14 @@
+ . ./defs || exit 1
+
+ cat >> configure.in << 'END'
+-AC_SUBST($1)
+-AC_SUBST([$]$1) dnl this is the actual invocation that was used
++dnl This test used to have the following lines, which cannot have
++dnl worked sensibly with Autoconf for years, however:
++dnl AC_SUBST($1)
++dnl AC_SUBST([$]$1) dnl this is the actual invocation that was used
++dnl
++AC_DEFUN([FOO],
++[AC_SUBST([$1])])
++FOO([BAR])
+ END
+
+ : > Makefile.am
diff --git a/sys-devel/automake/metadata.xml b/sys-devel/automake/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/automake/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/bc/Manifest b/sys-devel/bc/Manifest
new file mode 100644
index 000000000000..f923d59da012
--- /dev/null
+++ b/sys-devel/bc/Manifest
@@ -0,0 +1,10 @@
+AUX bc-1.06.95-mem-leak.patch 588 SHA256 27e30d0389b79556609a74a4bb2a19f208f0e527bf08357ad79e0f453f15ac17 SHA512 3a1f354b8979586b39e6e3f93f2df7d38c2f221fb00ceef7db6cb6b51712c0fc27dbbd75635a8e4e9e2f8f100c5a39cdc1d4c1cfc32bd6c406af94edef37e40d WHIRLPOOL 975dae719f33d5102c7e4455e940ad33b40dd4c716e9546d2a05606c898367686cdb80298e68fa6faebadf637d308dfb885cb9490e554b8cb344f23feb14ebc2
+AUX bc-1.06.95-void_uninitialized.patch 351 SHA256 440a9a20633317204a0205962f573a932ef4493b1dc9ff3253bfed22c8caf5cd SHA512 6d2803d831d8a3137c3d867606f8d40455a6f984bfe844e10e276e24cbd5d9fd1ff21b81ea91775dd7e1e55484cdde7bf859fa3e9a17887bdf548b32cdc46dae WHIRLPOOL be26b8f81e119247095a0d2c8b8131f507454ac5c087ab32da1fdce8023080286ec125ae3b7bf06b2e690498bb78b32a7e7ff78ae8cd81038904bb7168e5f620
+DIST bc-1.06.95.tar.bz2 290069 SHA256 7ee4abbcfac03d8a6e1a8a3440558a3d239d6b858585063e745c760957725ecc SHA512 16ec13f87ef76ad4de77d378ef8d65a582adca1bf661c9d7675e78d940680c77e81a00a01817fde7c1ad1524562d6f933caa5c42a0686f3f85aadbb39393afb1 WHIRLPOOL e91adb7b1fd42c4d47dad76f994c51ee7a8d962a24cb1b0cbeaa992fe1be59878016d5883506ec4153293daf48fbe3f345bb88fbe3f6276b3353c89573a612af
+DIST bc-1.07.1.tar.gz 419850 SHA256 62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a SHA512 02126d0db6b6ed06d56cfc292d6f5475ff1e574779d7e69c7809bbb1e13f946f57ea07da2a7666baa092507a951a822044b0970075f75eefe65a5c1999b75d34 WHIRLPOOL 87a9c0a5b7b2af082d59002147cd05cef7612a66f83ca688e6572ed2bbbdddcec945e7b8a0ee6e865f0142d31801ee3167b7eff023be8054d897d755bd282a2d
+EBUILD bc-1.06.95-r1.ebuild 1480 SHA256 bac45bc80ff69c4bc310526bfd4faafd41bcacaf624e09b5db9c650733d343b6 SHA512 fc39ebb2f8e6e13c48856e8434951b25847883720f409a52b46e0e9a4c231bc896cd2ef280c042b9d5968fce62e2a007e39defa66a56acc26070ecf8bd2e439c WHIRLPOOL a93ad0bcfff050ab7a3d873667423b9af3de649854cf70e89a5e8d7ebab73a72180a0ae12e5da64886c8e8b05bac41ae3c4c4dcf469bceabd117fa884595afa8
+EBUILD bc-1.06.95-r2.ebuild 1588 SHA256 ae2a5bbd3b93cfd7ddfc1554cba150eeebefd651d3b52005b54d876ee8e6cf11 SHA512 98fc290aa33cbe100026426dbb56d9245dd7e7fe8fdf71913cd8b2ea64b6bba674128bd1134c2c12bf71158f79d09e1e99f4a624806d2278a9a9efa4b7574446 WHIRLPOOL f722d087366e6ebc8f914acb454711707bfd47384f09d108b3191a9d0cb7b8fc09f45cffd89fd2170b441156aa50e76b528048e2a161022495c5c2b04f6f1795
+EBUILD bc-1.07.1.ebuild 1470 SHA256 4e9d3b1f8875aea06224ffa0d4389a6a80c6e495298234bd257567fda6109078 SHA512 08dcd60ad4d20fb6241eeea7b1d576302908ce66c64f74060c30e099d8ff2d9ba9fceace5357b15ae053dcfa1d0180b6e06a73a9ba4fad9ee3c77a89f0d11a6f WHIRLPOOL 49f8d68632f7a3fcc1fe8e1b5f6172aabe1853133ff7b15e051c474ef051d7e6d648d6b2c9016db48511d62741bcf6357dd7d573a61624add7a9b856e41ab1bc
+MISC ChangeLog 3416 SHA256 d764dcbf54a63a7a09a6e6a9f91214f7f3e99a4ac1a5de16816e60503c66f8a2 SHA512 5e2afa1fc5088beff05c99eadf299de62e78604697ac0209abc2afd1aa98e8d0420cf37b9ed83da1b1910495a04d6a3af3bff1ae59dfefe472fd30722fb30137 WHIRLPOOL 1f1491ea866935473fb9d2a207d6adc13d0c7d11da17bc86db61b710bf4b1ead6084dce8a623e3d4d8b62b1fe072cee13806e09dc4b9b7a8423d63a99356549d
+MISC ChangeLog-2015 6604 SHA256 d3b98712ce979d9f6e812b6a1accaa7b055795aa2d670e89c2d429fade5e3b41 SHA512 5d0f29e8861968f85a969bcb17da4bc4f3ebda970be6874a9e855a24c3bc70223f97f7c7d3b12156de1ea91f89d214e2284f3a2626ec55887f9836897bc52d7c WHIRLPOOL 4a11af0dc0fe8ff4cfe49d365eabe52e07035e108c815212bf0ee9de136bbf1f87c67b6e6b73a140f1e17ccf2df45e711bffa0d24a05fc02d92dea417ac4a8ac
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/bc/bc-1.06.95-r1.ebuild b/sys-devel/bc/bc-1.06.95-r1.ebuild
new file mode 100644
index 000000000000..5edb18881141
--- /dev/null
+++ b/sys-devel/bc/bc-1.06.95-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Handy console-based calculator utility"
+HOMEPAGE="https://www.gnu.org/software/bc/bc.html"
+SRC_URI="mirror://gnu-alpha/bc/${P}.tar.bz2
+ mirror://gnu/bc/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="libedit readline static"
+
+RDEPEND="readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )
+ libedit? ( dev-libs/libedit )"
+DEPEND="${RDEPEND}
+ sys-devel/flex"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-void_uninitialized.patch #349339
+}
+
+src_configure() {
+ local myconf
+ if use readline ; then
+ myconf="--with-readline --without-libedit"
+ elif use libedit ; then
+ myconf="--without-readline --with-libedit"
+ else
+ myconf="--without-readline --without-libedit"
+ fi
+ use static && append-ldflags -static
+ econf ${myconf}
+
+ # Do not regen docs -- configure produces a small fragment that includes
+ # the version info which causes all pages to regen (newer file). #554774
+ touch -r doc doc/*
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)" || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS FAQ NEWS README ChangeLog
+}
diff --git a/sys-devel/bc/bc-1.06.95-r2.ebuild b/sys-devel/bc/bc-1.06.95-r2.ebuild
new file mode 100644
index 000000000000..23e3d478171b
--- /dev/null
+++ b/sys-devel/bc/bc-1.06.95-r2.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Handy console-based calculator utility"
+HOMEPAGE="https://www.gnu.org/software/bc/bc.html"
+SRC_URI="mirror://gnu-alpha/bc/${P}.tar.bz2
+ mirror://gnu/bc/${P}.tar.bz2"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="libedit readline static"
+
+RDEPEND="!readline? ( libedit? ( dev-libs/libedit:= ) )
+ readline? (
+ >=sys-libs/readline-4.1:0=
+ >=sys-libs/ncurses-5.2:=
+ )"
+DEPEND="${RDEPEND}
+ sys-devel/flex"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-void_uninitialized.patch #349339
+ epatch "${FILESDIR}"/${P}-mem-leak.patch #264889
+}
+
+src_configure() {
+ local libedit
+ if use readline ; then
+ libedit="--without-libedit"
+ else
+ libedit=$(use_with libedit)
+ fi
+ use static && append-ldflags -static
+ # Clobber any CONFIG_SHELL setting the user has forced on us.
+ # We should be able to delete this w/the next release as it
+ # should use updated autoconf.
+ CONFIG_SHELL=/bin/bash \
+ econf \
+ $(use_with readline) \
+ ${libedit}
+
+ # Do not regen docs -- configure produces a small fragment that includes
+ # the version info which causes all pages to regen (newer file). #554774
+ touch -r doc doc/*
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
diff --git a/sys-devel/bc/bc-1.07.1.ebuild b/sys-devel/bc/bc-1.07.1.ebuild
new file mode 100644
index 000000000000..1637640c48dd
--- /dev/null
+++ b/sys-devel/bc/bc-1.07.1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Handy console-based calculator utility"
+HOMEPAGE="https://www.gnu.org/software/bc/bc.html"
+SRC_URI="mirror://gnu-alpha/bc/${P}.tar.gz
+ mirror://gnu/bc/${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="libedit readline static"
+
+RDEPEND="!readline? ( libedit? ( dev-libs/libedit:= ) )
+ readline? (
+ >=sys-libs/readline-4.1:0=
+ >=sys-libs/ncurses-5.2:=
+ )"
+DEPEND="${RDEPEND}
+ sys-apps/ed
+ sys-devel/flex"
+
+src_configure() {
+ local libedit
+ if use readline ; then
+ libedit="--without-libedit"
+ else
+ libedit=$(use_with libedit)
+ fi
+ use static && append-ldflags -static
+ # Clobber any CONFIG_SHELL setting the user has forced on us.
+ # We should be able to delete this w/the next release as it
+ # should use updated autoconf.
+ CONFIG_SHELL=/bin/bash \
+ econf \
+ $(use_with readline) \
+ ${libedit}
+
+ # Do not regen docs -- configure produces a small fragment that includes
+ # the version info which causes all pages to regen (newer file). #554774
+ touch -r doc doc/*
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
diff --git a/sys-devel/bc/files/bc-1.06.95-mem-leak.patch b/sys-devel/bc/files/bc-1.06.95-mem-leak.patch
new file mode 100644
index 000000000000..13628464b540
--- /dev/null
+++ b/sys-devel/bc/files/bc-1.06.95-mem-leak.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/264889
+
+--- a/bc/bc.y
++++ b/bc/bc.y
+@@ -569,6 +569,7 @@ expression : named_expression ASSIGN_OP
+ generate (">");
+ break;
+ }
++ free($2);
+ }
+ | expression '+' expression
+ {
+--- a/bc/util.c
++++ b/bc/util.c
+@@ -602,8 +602,7 @@ lookup (name, namekind)
+ case FUNCTDEF:
+ if (id->f_name != 0)
+ {
+- if (namekind != FUNCT)
+- free(name);
++ free(name);
+ /* Check to see if we are redefining a math lib function. */
+ if (use_math && namekind == FUNCTDEF && id->f_name <= 6)
+ id->f_name = next_func++;
diff --git a/sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch b/sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch
new file mode 100644
index 000000000000..3304973f89af
--- /dev/null
+++ b/sys-devel/bc/files/bc-1.06.95-void_uninitialized.patch
@@ -0,0 +1,13 @@
+http://www.pixelbeat.org/programming/oss_bug_flow.html
+https://bugs.gentoo.org/349339
+
+--- bc/storage.c
++++ bc/storage.c
+@@ -99,6 +99,7 @@
+ {
+ f = &functions[indx];
+ f->f_defined = FALSE;
++ f->f_void = FALSE;
+ f->f_body = (char *) bc_malloc (BC_START_SIZE);
+ f->f_body_size = BC_START_SIZE;
+ f->f_code_size = 0;
diff --git a/sys-devel/bc/metadata.xml b/sys-devel/bc/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/bc/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/bin86/Manifest b/sys-devel/bin86/Manifest
new file mode 100644
index 000000000000..e7e7aa83eb4f
--- /dev/null
+++ b/sys-devel/bin86/Manifest
@@ -0,0 +1,9 @@
+AUX bin86-0.16.17-amd64-build.patch 327 SHA256 607e7233c0499ceafe3f91596a27bcdaa470cf7ca45e845b08ed38b3bbe2aef5 SHA512 8e4102c5b0848249c69fd9b3f16a93b12bbe8dce9771b78514bf423bec7b0144677f4eae07cb0ea479bf03dbd21092fdb2ce0a028df95f28c37d48b660466c13 WHIRLPOOL b9224447f5b81422e072543fe7f3ae86dceefbb4a7a388f0b8d876b5876bf77150db81e14b83d7287d6f0caf1e393913345578f14792efad41154b082bb4ff96
+DIST bin86-0.16.20-fix_lilo_build.patch 3488 SHA256 bc735c292880c523e8f2af847852953898faa5b4670fab1012c2114bac472398 SHA512 f307438ced09e34ce5c552f808a9d1ae09bb9bbaceee4e1e07021f810470dfb07d21a30d1447295b2d023ccf56f158f4b7f3d80d478b1d7e3e4b79b13b8e760c WHIRLPOOL 1a12bf35237324cf374496e1032bb6a54aeb5e160934ee185494783fcb93d0616e544ab222ed6a37b3b269377cef72ebcc1a2159ad29c5b4984360cd9b3d6902
+DIST bin86-0.16.20.tar.gz 154107 SHA256 00dcf75f75080b4a51d137f14fe787d8144d12fff0448e08fe696e8909780437 SHA512 c567ad5f9241d9ed768410f988266d4ff952fd4767d033552b100a2643db69ee9d4b5929a1b40c3018db7037b0efc7b47db84fa1f561bc39f01e640b1a3bacfc WHIRLPOOL 028be86ee91f47768837b35b917eaa0ff0231b900a052e15ec3e30574ba76693d8699a186bcef5d4b580a445c152334bc33028b32be60b33c369fb7f12331514
+DIST bin86-0.16.21.tar.gz 154283 SHA256 021e37cde3a20632c4c9000993cb4aa9f58cb82b1d3c26b9aeb62d6566925738 SHA512 e80e06965fbdcf13100aae4690071d01a6efe74aed7ff8f14e5892c6803393a1b5acda1296e0f0e1837dfb73e0edd02e9cccfeabbeabe1b68fa6b6b85ced1f56 WHIRLPOOL ba46856d70f6dacd010307426eefc0c8eeac104f435b18470148145e6ef785d02cbbf7256870922d7b6904f134829950907ae7d4868604d75af9724ec8d4f9d2
+EBUILD bin86-0.16.20-r2.ebuild 971 SHA256 f1356e56e14affb7a70fe3a11b147ea4c7acd52bfe9f91f5ae1e5d6a8d43888e SHA512 efbfee52390cef1e5e0d7146897153c62bc8c9b5887b0f040bccdcd468d33ce472c7df5e63ba731830a0fc6b8caf07a105c53db24de7cb02bbb3e1fba6bc42d7 WHIRLPOOL 88d8c382a823899ee8c59c7ee22f0e246a0764f0706452871690d1c449adc86274c67abffedb4efd0b11ac4c4119072a8f44c0fa4ea46a20d3879b7b7963428b
+EBUILD bin86-0.16.21.ebuild 808 SHA256 b83d1dbaa020d22b2f4bc65be9a693a91887b18bd772792119a62756a1c19161 SHA512 48171ada6e9587321565216d3b89a23e0327c0175421b29334900d0ca863155d71efd51c193e9fcfed7ebbe38712858462dc4ad99a7b5b32f94180bce3c0293a WHIRLPOOL 49647ba24e3a04433cfb8e60c45054636598c1ffdac919f43509b43def8cf4aab7815b4ad84ae8dafbd42c83b7b3d8fc253fb48742354106b9c7c6fd963bc37d
+MISC ChangeLog 3243 SHA256 2bad513d78a7e20a40c2bf1ce73a4b93a382a687d3878b7c9b07e31b2e2e04da SHA512 71045bf74e6f0f675f024673e11f6d733f8c55240d0e070cd8d1914d0bf2f95986aa1c00c63b76d319a847ccfc304bf5ef5878d516c09cb6e293634c346a6e95 WHIRLPOOL d58cf7cb0e3c7bdbffc1276c3b65798dffd79f7f1a40b26a2c39196468856ea67237bbb3134c59553e6e421f0402f263d54b9c8dff837a69b953dcd0227f4623
+MISC ChangeLog-2015 5479 SHA256 b7f25c52e2e16c09d8d74ec42b520d1ceeb0b479cef51504e4ade8c0d05e09a7 SHA512 4b5af82e8406d054e489249a142a28be4244458490a388af01866a89282cbde6a5c70759023faac6e8ac2aafd826e450e05f541258556287172b6b81b6ab9609 WHIRLPOOL fff1a84a1d9b9dc3aceb137f9481b1a906f001f58634525229cdfd8857c5753269a019ded55cf62995b2f4fa304aee24dbf893963f363b571394bba5ce71dc7e
+MISC metadata.xml 479 SHA256 09a5fc19de2f5d0bcb9ad4eac740942f4a9a8d0f501221bc6a36bdc2598baa44 SHA512 89e8c96a44e57ccae73c66141904a99e0128587fd62acc8b2d3e860636ab05396e9842c80152ab27860850a7582dd4097fefb465e0d0a86761b96614d8c0992d WHIRLPOOL 37673100d2747c2b0c6894a55f6f34c14456e89129e0b7e448026d7eb6b7022a5a6922824b6144c941479711d2d4fb4befd8fb01a43f186e61141c8e08efa41f
diff --git a/sys-devel/bin86/bin86-0.16.20-r2.ebuild b/sys-devel/bin86/bin86-0.16.20-r2.ebuild
new file mode 100644
index 000000000000..5bb161c54a2b
--- /dev/null
+++ b/sys-devel/bin86/bin86-0.16.20-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Assembler and loader used to create kernel bootsector"
+HOMEPAGE="http://v3.sk/~lkundrak/dev86/"
+SRC_URI="http://v3.sk/~lkundrak/dev86/${P}.tar.gz
+ https://github.com/lkundrak/dev86/commit/2c95336f19eeff761ecb858c5a2a58484bb3ceeb.patch -> ${PN}-0.16.20-fix_lilo_build.patch"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+src_prepare() {
+ sed -i \
+ -e '/^PREFIX/s:=.*:=$(DESTDIR)/usr:' \
+ -e '/^MANDIR/s:)/man/man1:)/share/man/man1:' \
+ -e '/^INSTALL_OPTS/s:-s::' \
+ -e "/^CFLAGS/s:=.*:=${CFLAGS} -D_POSIX_SOURCE ${CPPFLAGS}:" \
+ -e "/^LDFLAGS/s:=.*:=${LDFLAGS}:" \
+ Makefile || die
+ epatch "${FILESDIR}"/${PN}-0.16.17-amd64-build.patch \
+ "${DISTDIR}"/${P}-fix_lilo_build.patch
+ tc-export CC
+}
+
+src_install() {
+ dodir /usr/bin /usr/share/man/man1
+ default
+}
diff --git a/sys-devel/bin86/bin86-0.16.21.ebuild b/sys-devel/bin86/bin86-0.16.21.ebuild
new file mode 100644
index 000000000000..3c587b03ca5e
--- /dev/null
+++ b/sys-devel/bin86/bin86-0.16.21.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="Assembler and loader used to create kernel bootsector"
+HOMEPAGE="http://v3.sk/~lkundrak/dev86/"
+SRC_URI="http://v3.sk/~lkundrak/dev86/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+src_prepare() {
+ sed -i \
+ -e '/^PREFIX/s:=.*:=$(DESTDIR)/usr:' \
+ -e '/^MANDIR/s:)/man/man1:)/share/man/man1:' \
+ -e '/^INSTALL_OPTS/s:-s::' \
+ -e "/^CFLAGS/s:=.*:=${CFLAGS} -D_POSIX_SOURCE ${CPPFLAGS}:" \
+ -e "/^LDFLAGS/s:=.*:=${LDFLAGS}:" \
+ Makefile || die
+ epatch "${FILESDIR}"/${PN}-0.16.17-amd64-build.patch
+ tc-export CC
+}
+
+src_install() {
+ dodir /usr/bin /usr/share/man/man1
+ default
+}
diff --git a/sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch b/sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch
new file mode 100644
index 000000000000..b494a8b724de
--- /dev/null
+++ b/sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch
@@ -0,0 +1,17 @@
+This should make it built on other archictectures as well
+
+https://bugs.gentoo.org/428228
+
+--- ld/x86_aout.h
++++ ld/x86_aout.h
+@@ -13,7 +13,9 @@
+ typedef long Long;
+ #define __OUT_OK 1
+ #else
+-typedef char Long[4];
++#define __OUT_OK 1
++#include <inttypes.h>
++typedef int32_t Long;
+ #endif
+
+ struct exec { /* a.out header */
diff --git a/sys-devel/bin86/metadata.xml b/sys-devel/bin86/metadata.xml
new file mode 100644
index 000000000000..b6943a7745a3
--- /dev/null
+++ b/sys-devel/bin86/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<!--
+ If anyone from base-system wants to be secondary, by all means just add
+ yourself, and send me (boo) a mail telling me that you've done so.
+-->
+<upstream>
+ <remote-id type="github">lkundrak/dev86</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-devel/binutils-apple/Manifest b/sys-devel/binutils-apple/Manifest
new file mode 100644
index 000000000000..e357731f44b9
--- /dev/null
+++ b/sys-devel/binutils-apple/Manifest
@@ -0,0 +1,55 @@
+DIST binutils-apple-patches-4.3-r1.tar.bz2 37363 SHA256 0abb41301034903452084f13566d912976a8d8845dfe37564e727c9dba9bb130 SHA512 f5d64ad182891c3af971e6aabd3c0c1b717b6a1cb471632339cba61b41a998d15880d18de09aafa1c3d059e528c888d6e8b914025c79bc21897d90a6d0e2ebf5 WHIRLPOOL eca7f9c2cd0e0c35978824c7ae591844ee5f88522db0747ed7d4e37e73bec076dadb3a2e017de7ee6cf2564a8363f4848b0cac36117a6dfd918b4514ad14e843
+DIST binutils-apple-patches-5.1-r2.tar.bz2 51642 SHA256 fa179acf848b3cb4f888d8f8154dffec2737e06bb7002daa8d317ad0bdf02f49 SHA512 37ba0dcae6c10b54a07c6208f6893ab80b0de1bd1c2f677902f707c8290629f7671a481e256b57a18bf304b95e41e4d59519bc1c88f15de488c0ef7e142f5cd8 WHIRLPOOL 8cd1b1730b7df31d2324c8c5f23d9b7e11ffb85284cbc1f6f6ee0290304789c405b878d207821dae997420382dd39aa943fcd1fe78ae8135fc238589f429b55f
+DIST binutils-apple-patches-6.1-r1.tar.bz2 42189 SHA256 8efc006a59a589d498cd0a745e3096f6e0387031a69b0583b94f8ff943bdd10a SHA512 be8ee5af5c8c9f9228cf6980f032aa101058ac1a414bec89401dbc4ff32ea96d6ebf96b7b79285fa1e7b4037a9ed68b285dbe59ff8e3d3e62bfc0145199e72f3 WHIRLPOOL 80fa76ed8c8f60908ac12b4a2d252d8ec1ae6d418f3e20faa6e1905f6d6284dae74d9d82190d02fdd2690ce572c7e97cf38e9e4b88089beaf8962b6162616b20
+DIST binutils-apple-patches-6.3-r1.tar.bz2 37951 SHA256 3a5f647eea58f37c091fc7358ee8b8a36de75a5ea826b50e4de1507d31540c79 SHA512 07262f4cb621d7afa240c4d81f80eb1a2adf486b60eb480fe283235eac12167f8efa0a462bf9d0036226aa5e6a5382f9f74420ba3269bc260d0a48d0e4442578 WHIRLPOOL 37429146254f62bb3b67b63551ae7c759131d117ee98a3a9e465b2765550378487d425c435ac7e37f20a0259a536dec7b66851bae1c680c9c25a117a4921ced9
+DIST binutils-apple-patches-7.0-r1.tar.bz2 43705 SHA256 e016615294167a539c716094ee595c37d7e11a44e76c6aeadb4d9e6bd14622fb SHA512 a25570062628979e23d73ce9dfd0a9bbb4237fdac472a30f2ec564a9bc9afa7d91d8d8b5bf460d16344677f817b55154394608d74c937f0b1fc6dda64f538266 WHIRLPOOL 2b9b2db3c5e81c26bc6857e2b9b38ae487e3c34e58e2180d84e26762bea287f82d290633efe0d9c4b531b4167782487e260963ff8bc4f2775c23a36c9fe3a0ba
+DIST binutils-apple-patches-7.0-r2.tar.bz2 50934 SHA256 5be8cf3ed268bb413ffd05aff91a74a138c5ee92f3cad7c1bcafb4abd957ce8d SHA512 c7c8f50fad0507228336b6144b8be3e70df07d64f1df617bfd9cd717a095c49cd9555c441cde7d24bbe2d179ab8763e4f6ab1074dd6c5532b80a1bbb4f13a244 WHIRLPOOL 35e735356ee72161b0f69ea12ca3ae6745dcea18f8bcba62adbe8c189da9ddf0595bbd837c21acecf0a32a6a50a998c80a2cc3088e63b64655c6f0d0949e05c8
+DIST binutils-apple-patches-7.2-r0.tar.bz2 2917 SHA256 8fa3c64c840aefb71c32fc0294ce6c2b0cf058a5e7f624d736dac6b8c1f44287 SHA512 ca2fc2da88144fbf01f34f1664e6177105a5d1bff956e83f6c7cd530b8e80dcd59b0c921ad95d3c4554e02909bcd846d3a2a4535bf47569b343c85e765619821 WHIRLPOOL 9ba63b8407f6015dd8cca48bea474c375cf90047a138fac8aef800622a780bfcc98910cc46781aea72a2b9803e7cd86c3ea35cfe9fa33bba8813499cc8b91c2c
+DIST binutils-apple-patches-7.3-r0.tar.bz2 44576 SHA256 18a9484b53225004ccd37d34d0e208e3a716f73831f4a433be211f233d855fb1 SHA512 6b092c586ac4c3a3c65229a7490f93b0f0d38348e5a2db4f73d6062c737007ee0a5b6bdb5948b7aac1d74d32442fa501ba92161a9ffe13151288432c6a706c43 WHIRLPOOL ef159c24cd1e53538f73aac805e06d14775f82921b1e8a10919981dbec0017d0c70ada0e80ea6135cca5551ccfb38f229df666bcb2e692880d6a23d380d39801
+DIST binutils-apple-patches-7.3-r1.tar.bz2 44737 SHA256 215da3068451640cf25dbe7beb0c8d704a6fbc6d3d988675ae17b9ebbd9d1ee2 SHA512 ce4b3a725e19cb632b0c101a32488ce09a8bb89aed08339d5518d834cb68c525b2e0c8b66564a945c077915e92cc6be3f7028c5baacb870b3ca9b9422b4fb0da WHIRLPOOL 1c8a2b251e385eff5de435f9c72c8244329f55de5a61549371214ddab1cfe687491571d68d0a2c7cee4da2529f24005d1d0a7429daa5c6a1ef3a68ea8af0da20
+DIST binutils-apple-patches-8.2-r0.tar.bz2 5771 SHA256 839dba0eb6314e15bfa43b50479359adfc695c8b65b6c7176abc0983c41c6dbb SHA512 92d04396630a31b752a24845c27fe8da2e37eb176117c9b31193e8f48af7ade707cda4060289b848965310afd05b2f121c740b0e5baa56b79c5481273a88c84e WHIRLPOOL 5706ab6aee04670b4fbbf5cca62109c3f69beba834729280dc636d8c5c4017f321d0402db080032219ccf025899a9bf1daf48a7ac6805faf01e10ed6faf73242
+DIST cctools-822.tar.gz 2024412 SHA256 dfaa9bdbd023524d47429674f64d2d5ea393123dabf90868be0aa17f61f45289 SHA512 8b02cc837d5e0520f35da445f25ba86b5042d5caa27b49a599e829ed89428cf78dbd1831bcf6c18301f941fbfb31ac2114e248041d98008a466e1574f4fe1586 WHIRLPOOL 81191ab46e8a9e47e4267146f978438ff64314b0363296b973a02f361918a5cd69057753a1b40766b93d3d4a3ed10585a27f6da2953992a406be61d1dcc1d06c
+DIST cctools-855.tar.gz 1699635 SHA256 751748ddf32c8ea84c175f32792721fa44424dad6acbf163f84f41e9617dbc58 SHA512 50f5d015ce807aa5ca274dd2deea810b8b375110e60b5e334ca4b2170526b738ea5f86a5436caebbdb748badc3b89601d0f450f5b867d8393c89e336a3db4b3f WHIRLPOOL fa493a29e32583f60c3553794bbb6d01a7b5ef797d8e8ba8161c9cbf237906ebbfaff560366da2d5b852bfcbdd55e874c00edf5b3169b16b357a54fcf3c07c4c
+DIST cctools-862.tar.gz 1702345 SHA256 1bf29f620b91c901ad3116b47738ab5076c1aed75d13869cd3bc7f067b4aaadb SHA512 faa401c1dc55bfb9cd2a9a9cc7bc9d473ee63b019607967c8b0da325514d6a1f7b1f52404370bcc018e86d30d75a4b01183f49b793f577110663efe43871360a WHIRLPOOL 371307f3264361f5e2e48d83177aff1a8f435cf2bdc1f4998cc5780c5b3760048a29a7620d2390db8f0c9378cd2f3b2f130b6aca9d402e3d428c4f4d353db097
+DIST cctools-870.tar.gz 1702965 SHA256 b83f4b4696414b814cc1781ec4b68ff9c7bb97920a68f308351a74e75f41d961 SHA512 8cd16350bc2eea576e3922f44de3d15cfcf492a5561215a3a9160f2045284a2fd0fa28e030686868bae8619993fc8901649d7576c56d86a423f9955b27f65138 WHIRLPOOL 9c99188b0e6e71fc3beef674b977f5f59310410b004c26e85e83b7fe7d48f4499a31b982935c695effaa9130781dc10b9a20633800df361a550cf53fb52ba352
+DIST cctools-877.5.tar.gz 1717664 SHA256 5e7525c86581d9dead8a8508a9e824101765d05a3e14d612de1aa38def9adde9 SHA512 cec8520450c3b1ffe77bd841ad6b8f6b0d28657e7c39ae1525bfe7ec1460c0f4bb394da316e6ed5b08cb5df26b757b9d94a9923cc7eaf9b14315d045ea891062 WHIRLPOOL 30b8c8fad772804a449318b08b7e3362e9a73345a4fe43758216d41f533189dac6a2bee37f1884fc049702f2705fda250767cf3a776956796c270147197920b7
+DIST cctools-877.7.tar.gz 1720523 SHA256 c3809b7604a27db0c0b418fcccd5cad49f002e2a750ec611f92f806521f7ed9e SHA512 5c381fe8b85d1254f660eb3c3510d9e0a49792ae5bb0e69a4dfb5a18e7f1706ee1411589f20583a9d7f12126ef616f66f1ad5c1c4ff405f66b52759c0a4272b5 WHIRLPOOL 2c8e85fd33f183bd074abf90237301eff252ca05aa48a59aea713d263b10e0710d261a5ac01185e9a17d1a391fa025fb91d60df0f3b426140defdbd5536e4bbb
+DIST cctools-877.8.tar.gz 1720708 SHA256 88be2788adf461f1d8278324b0078f6003b2328b6f95a54b16ec6ed1ba651dc2 SHA512 3f75fbe4eacd89f2e6372a3167ed197e2b8bda9faa10fe6bce0cf9d3d3eca536f0af5fc4ce1e4bc6a24eb68db36f5d0b1d0bc3f9807e285e67cfaa2d336d81ef WHIRLPOOL eea67bacd8037b19ba3efcc2fecfcc74ec3e785ce92628fdeccbeca6e17dee4d1926719a02ca7f68fc2045f9b37571cb044cc29a3a8fe6a5bd704a3446f44945
+DIST cctools-886.tar.gz 1731850 SHA256 f3a4fa7dad4a54d862b1d9f48e3dfb25fc532c9cf46a041cf8134694328a8878 SHA512 49f14e165da3a9fcf16614a810b8a2a68907348bd27a60b268b330e416a0bc070fb6445e1e6b80d849026bd6ce7de4459623ab86168e2d63bb492d1ba6680c5b WHIRLPOOL 91a09d3c773f0aede36de548310879a1ad4158f39e9d4d91b4e1a9460d31acdcab5c658113381742512861c6281661dea7fd8273d7146ac6838088d1435ebe2f
+DIST cctools-895.tar.gz 1716126 SHA256 ce66034fa35117f9ae76bbb7dd72d8068c405778fa42e877e8a13237a10c5cb7 SHA512 4ef9db870385cc2c4263bcbe42ff0de80386771f5acbc7082a1818ecd6b8d7bb1bfa02a7fcfecd3e7281481aeaaac4c331359aca3564bfe7a4c7dea1e0d06126 WHIRLPOOL 36f6814cfe25fd5e257720560db18ceaed7cc5504f9fcb20cd00f48e9295797067d1538fd172406b7c68d771df1059d46261b33fc4fb293afe8b28a7580e90c4
+DIST dyld-195.6.tar.gz 412518 SHA256 69296e9b4192bdac778ea899fffc18b02be62b51b5e8474b4cf85ae5f2b08aa4 SHA512 58a9ea27efc02e66f9d99bfa250af1d90326385385431e5279386bbd9ab53366bf7e8236543296908b7214c33523c8f60098a6298a7393b3180e2a6bce18e7c5 WHIRLPOOL e37b11d3996559f8a1843577a5fa42f96e4d42419f205276600f0ed79fcd2490da1f8a77eecf29f111b3db62a65e8e9cd77a154e3b389d633a7ac1525273b9b5
+DIST dyld-353.2.1.tar.gz 510036 SHA256 051089e284c5a4d671b21b73866abd01d54e5ea1912cadf3a9b916890fb31540 SHA512 a9488620499f682e245b55b7e0e4ec02fc0bcf03bd8a70d4a4ee0ba762067ade2f41c188990c101727476d41c19368b4cc89cccf2df40231da1c777742c7391f WHIRLPOOL 3164746ed8c866df993f08e405e7e329db427af8eeded681d5fb88031ef2c025363d5bfb647e9315738024adf9f48efacf49226f86f27def584ec7f538da292e
+DIST dyld-360.14.tar.gz 518873 SHA256 c4e011241d75e3fac4dbdfc0049ccf26fb939fea6c0256b6f16036b2e4690c6e SHA512 cfe536ea1f0ad8fbc2846417289e3e36704bf69388e083e0ece0ffa6eeee501e7e9b2ba47eed7be0e5120b5cc72f33b2fc0d2d39ba7a16beaf98db94dfb4ae40 WHIRLPOOL 6ed42fa38f60a84deab0bc9b128f5de232df487613726978be29783ede7eee9b5899472a984d50f44a20c87c1772aeede9b81706000fa66713df34d6e956c88e
+DIST dyld-360.17.tar.gz 518876 SHA256 e137f54d5f7af7512e2e2337248caa0580743db212471de71fd45d3e3e92c68d SHA512 aae2a0ea1f4130de51aa920ce1affa579993b3b58a7d398ec998c0d7ac4919907ba4e508b9bfc15080b1f4f4cf15e4615bc416b6ec32b52a4b5d8fbbad1dc9ab WHIRLPOOL 2c3cc5fe0063b0a6ad1cc77e5ae1204e8bcd23ba732ad775910fe6340a5d908b77d2623fb7fa4eccff20e0e2176405d8d6734b7d60dbba61ccfc58f37009aca7
+DIST dyld-360.18.tar.gz 518957 SHA256 a5bec8c2e3bded111aec7e447b35c110038e822f95e11e55b9a4d331fbaeff08 SHA512 1299bd2dd5cd663917ec4a03ed0f875e0bf07d6680d3d095af12f4b11960c02a52e361bde27ff88843f80832fc6d36654e2556ee0a3ca2259fcded5b568ab2f9 WHIRLPOOL 5b42ea6de3f08b7e0fbad7ea9df512c74fd4bceecf859683297d0cb8998d642ea3a0597ef488dcbf42a75064a07a528baf63c957d36174fddff34d6e6c7502d8
+DIST dyld-421.2.tar.gz 625173 SHA256 e922c4e78af8f7af14dd158f1db986f8eb260403e7a0dc67fa35279d2cfdceb7 SHA512 75f2fb840da980d44649aa3e045f50c4e37d4403fbdb1e2e5f1a85bf6d8859e1130053c3806f7ef992fdfc6573f7f18146263c690144bdd3df31452c6bdd8bd8 WHIRLPOOL cf7093f68ecaf41db2bd8ed5d456183007e5b87b1296f182ffa007464c65248188127c60e2f937faa6fdaba771b9995673bedf22e9b81826c74cf1c50d39360e
+DIST ld64-128.2.tar.gz 494361 SHA256 96a912464e2d4d3d7cdaab0744003b0fa93d139f203c82867f659ee94b4ae9f7 SHA512 f50a3c396e6f4fddc685bb3f59f9a260bd2f47060535d24259b2b411e4f759e48daa35819da682ad9bceaa1b9a1981eb34716387d988cdc4b7eec9ab2169726e WHIRLPOOL 78dec40124ae11c80483b362860b01c833fcaff67bae6b6cb3b72371daffdf3be809186f5daca4bb6ace77441cb43168939eb60eedf9f8c05ae3ec644c2a0502
+DIST ld64-236.3.tar.gz 624400 SHA256 8ef36729b643201081ab45ebd8586ede8f9968bc17614b679a940faa82875ca6 SHA512 e103fc5efd4d4161c7dc55b1ad53aebd455cfcd72de7873ebfdf5ba896b7b0da9c9aeb12e1e1a76425768ac1dc85d864a4ce33b5b841ba115eeab96a2e2965aa WHIRLPOOL d122e325518860c810b9efde7016ebecb6b59c56bb40ae1f041a840be764a5d9b90c7db1922fd9037c18f4caae7ace0d395591ffb3db704c87b92837ef997a17
+DIST ld64-241.9.tar.gz 639944 SHA256 3594e87c626c3b5abab6470cac6f27b367f1efcee60eb3d0f6b6d4ecf9b24230 SHA512 6958e7064f4fd8b47501225fc4cbc6292e5da63d7f4103ad79add177ef7382c8de3c732f14d19a9c11356b8070f578392383caccc3795e2ab8ef7b7ddbde88da WHIRLPOOL 5b07a336efde52b00b2601866907513517593a113583f05a9c45b98b4d6f394d87add887a7e44a95f462b6c2b5617ce497376b94a523e5cdf0f69d4d10ef3407
+DIST ld64-242.tar.gz 641597 SHA256 bec1a5e20b599d108be0017736833c1f6212ea26c67f20d8437abc5d23433c36 SHA512 bde2eee69ada7f81d5e97762c371661f304372d5461da4bd843c76d0abcab518193fa71b917850af2022e586a756a3624a0ad28debfa8de6777e3c255d83dd34 WHIRLPOOL d4c54f2a145386fd90a8a12f08010e31a84912c5f11e4a48e08497f282449cc9eb053855f302cf0353035bb2a6513aaed92737ab60c8b3a6bb3a1af626adf475
+DIST ld64-253.3.tar.gz 671087 SHA256 76c02f6f297c251b66504e1115946bda6e1618640bc6cf03d0ad99b17bd8a5d6 SHA512 ce2c86f2f37ee37bd417315ba51815707b0ca6f24da06819fd1b2d0b4fe0762e45a08c3faf2c0c980e4913c9cbfbf6c8185f9a6810cfa1d9dad231b5bb276081 WHIRLPOOL 7e168bb6dc1474d26da77ca6afde1b591781eb5c0a7a50530b334e4ed6dc0206a2d047375d7d924aa05ccc0912ec8ee966874a9324c66820c454ebd173d1520e
+DIST ld64-253.6.tar.gz 671838 SHA256 7fbae5e88ac1420480de8a495dcd3b876d399278bfce9ffbef7d54334dd80b4a SHA512 40b29e273ed3d69e4f92593cadea831fd618452d3f05e30c0b836ffc05db61fd345cb2f6d63271563c786ecabd47f19f8369456cbe6422800117a53c654a98c6 WHIRLPOOL b687166038f0ad3dd65a623c91aa7204025ab371b90d5be57fff3bf8f8d89df93aaf8d781fd3a950ced4deab667917a379ad5ac479d25fb00644a02950c118cd
+DIST ld64-253.9.tar.gz 673388 SHA256 8fa3a1b65f665824ac129c02e2fab8926a06e503ec277ea32cd8bc27c8de11c3 SHA512 a52b081295c19f28858f8ee47c05249bba3e15cc8bb6f7017d9f6dcf7509cdacef7a4b16b3940cd0b1f72b3b67efb503ab2e3801b31e50cda1d34c6bc8df8dcf WHIRLPOOL 07e850984d2ff24637a64d76860799136e63af56dc2740f8d1e1bd3311ae3f33eac902e7850f94555407002d0d16f44d4a276470f54e60a0633169b884b7dfc1
+DIST ld64-264.3.101.tar.gz 681491 SHA256 2882f0c104334bdba8eb64cd3a9f9059ceca4d4e0c08473506a926d53c9ef218 SHA512 ffa37af95f1a6e76829d0ac8badfd0236d93dc2f9988c7f4b88fe271b7b02a4b5553402a1e9a49feed9da4d04a50e2a2cacdb1bd4c04ecbef09d68b85a2e8a6a WHIRLPOOL cdc466a24fdbc2bf3756d73f89f91d26fec21d8004a2e77804e2b678a9da08afe83bb5aa9fb4548496feb3d9180c3d2521a8d5329b875ed76d4e3a0ea231d5be
+DIST ld64-264.3.102.tar.gz 681509 SHA256 307f73678a3e5c9ed4d1bcf77da7399d84efac32916c5df6cd477c3b5c36f953 SHA512 ec221de3624dcce3db694ec2d7b05f3c939cd1ba79c97437ba9f2d4e5d9c37369bb5df82cc37bc158bf5c4e2128cc2b96ca1a7477f98538850092bffa4601da0 WHIRLPOOL 509774429d498c4a070a54798715776eddf2b8ef70a99dd4250d60144efa2d4a6a324914112556435709beb614172dd45b860f3963b0da9a0825cb0756bcd719
+DIST ld64-274.1.tar.gz 670493 SHA256 6cbe886717de833789fa562ec4889ebf9136ae5f7573d17d39836d3f5755b7ab SHA512 ef5d6802f759e09aa2dfab7eb84e9cd2a57b28da3f150833cf1a922c395dd696e501b1bcb10385cbe995f4945fc6c99c2d2d8c50c42f369186bdc1ac3e30ad99 WHIRLPOOL 5b98613419f304cca05d7e626a33a93b08e991cbdf5a9b76891656e8b5757937e930bdc047ceb60a345a11ee195c641af5d2ec7b3d731530050be160c82d6a93
+DIST ld64-274.2.tar.gz 671652 SHA256 175d89c419e99d49a7a5f7e4196d3cef4c9e19cc17a425c332e86df6b516f7d7 SHA512 7b4e17f199909450b697bf719564c6841d46f5116c48dd47ff483ae7ddfe2965db1b7c024ed8ebeeaf90cd983ed353b95f7f23c93c8971536977dc892e6d6a9d WHIRLPOOL 30f935d1f49769a851871f6fc4d7210409122d910651835c3568c0fb22111bdc4c2419413a5808aa95dc6a840f856eefe7c5a3d8215470cf8f1b4b4432c40494
+DIST libunwind-30.tar.gz 82811 SHA256 6ac97d18cc2b05e6de1269bf5af03b81948bd2200dae827527f3dc618b82bd41 SHA512 57106eafa1516791b4e0db2de6c6336bc0c1cbd8bf098a6d3a809fafa457802c95a7aeae9137f4ca5922a3018dfd8f597907ea4187b0afbbf267500eae00041f WHIRLPOOL c3caf5ba593cffa2f0a9cdb256f518524e9500eaf0a013c4973dc9881b16efa0c388e70407bbed1fd331f100af2da01ddeee12d33b3afc1213d69c32ab5e1d0b
+DIST libunwind-35.3.tar.gz 90002 SHA256 2bcc95553a44fa3edca41993ccfac65ba267830cb37c85dca760b34094722e56 SHA512 b7d9a86ef24f1fe9ca14517471e03a910219a229af9f0d4cf94435115971360640451107ba20c93fb1aab788f8b6eb5ed580ee08fdaa990b9fa43e9ae360c6b4 WHIRLPOOL 838912e46031b3a6796bfe854f0244991ce5bc3b59b95855224c9e84639e57b69f541b7993658360721423533dca75037248ea90f5e274b332f27319fdd85a9a
+EBUILD binutils-apple-4.3-r2.ebuild 10300 SHA256 e0354ffd23ac9c92c0a10214dc0c65aab687f74ac91c4b0510bc54ee3b2e6ba1 SHA512 7709d446c90b3c7dd3131c952249b85817b65613182ba47411a41213951e46dd080c2559e552bdb386f388bcc2306b333963c6489cab8fc24248eb5b7c95ef74 WHIRLPOOL d90b36b3a1e0538277c24d9486863ba69970181cbc1ac80de5ae24df184e08602f9082576b39463c2b47076ce50d07087bea95490eca0d26fd80c29426163007
+EBUILD binutils-apple-5.1-r1.ebuild 12194 SHA256 eee6cf99d127c0e0b8b63c52c9915c7c2cfd61705b1daf7049c85a91213cde35 SHA512 d50b50c71822bb9d341790318133ddaf6d5342be77dd3649c1af1cd4d9c223e119fad46b87ef0465d2ebf3e768e5b4c6425b73100b94d78f0595fcf2ea4c7240 WHIRLPOOL 1c018ad8c6d100dcae48807d6de1bd941c894f92d91e03c59798a0137ddbd1a7b8f5f0df1bdc5f59b804adda888a0983346936123ac796e9197000ecd0f20431
+EBUILD binutils-apple-6.1-r1.ebuild 12268 SHA256 e5caa4a596f2d7befec95bc391f816a2b1e63bc6af512e2c09d465fb53e23539 SHA512 1b6ab3f9ec1892b73ceab616b0ccc6de778ce008989bb28864943bad416dd8fa8654b01e7613cc35852df616a999f04acda4cfe3e6945ae021a9df8454894a8b WHIRLPOOL dbb8daf769676ca43f8c47887e3e0232a73f4ab8ab7aed450658eaa9f9983a166c8cbac129dc2d4d55c6657eaaca734f4e68f1c426d4378920d631909df3f440
+EBUILD binutils-apple-6.3-r1.ebuild 11973 SHA256 268e7a2d9ea1a49eecea3dae98f6fb88b2f1b3cb6975b9cecdc2c8483f8bd875 SHA512 1b47c66c969d91372f1e919c091548e7f3b2dae8de97afb2fc86b0e49cf5091ac935fbbebb264a362e351e3497f6816d51b046557c8530620aeba89a72872ddb WHIRLPOOL 9a11e9e3d8a6af4a454119b69de1d0222e3b6c3b232fdf9a6c0d74bbd15b6a5fe48009e903f8f10a203717fbd83fb56bdbaa30bf73a2863d53eb0012fbb6c7f3
+EBUILD binutils-apple-7.0-r1.ebuild 11966 SHA256 d2342e0d0b004b2876c733599414a33e1d5e27234d57c09d90dc20b35c3bfd1e SHA512 48e7cf9eef8228e6c7968c4d82c5bf6aab3591f4920481a1704a9979d1210b0993ae54d9877c0c1fc7c4a4bfb92854feaa0a42f485bc55e4b0aea3b47c694f71 WHIRLPOOL 0c4d24e7fbb34361b774a7c1b5bdd45d0439e7c84d67d3b2cb08c10ddefcf19547287756a01ac56464af5251d1265d72ac6979272209086d9f08efb64a070bef
+EBUILD binutils-apple-7.0.ebuild 12071 SHA256 f23c9166ad1a5ab6ddaca488cf1c04e65622347bfa14c1f008711af167a6e60e SHA512 e0c106f0972211f33500e5de2ba0cb48bc0119a4cf581c146ca5e7453d2ecc0102c5a1c82a835555ea87179c9eafd3d82aa078e91338a2364d0fb8c70dbb07c2 WHIRLPOOL f4b4078395b6776397a1c6016687d01f9cae003edb4df8d9a4d3b97a8834e2d1054da49b1b7dfc7ed40f1cff7262f0b2901c31de6910bb17865d29bde24a489d
+EBUILD binutils-apple-7.1-r1.ebuild 11966 SHA256 d7e5c3ef29321fc5b7a48ebb69d6f94001ec5449f3eaea5fbd9a095e908b638b SHA512 bc66d390a90d5ab79b80d7e3416816595e2be783dc2b597ea378b77137d2d1958f2292c755e2f2895cfb73c86118f4a200497c8e4b17a71aac66628fcae6937e WHIRLPOOL 79769e322722bc7771b06954fefdecdd31c894a765a2bcee68f73f88c710063bd437a9802fab74c2b913c7c483c175cccd69d7735f2b7f9b4f0bfe2fe556dc04
+EBUILD binutils-apple-7.1.ebuild 12071 SHA256 91931389eaf76ddb3e06f1804825eaba393060b8c782453ba9f90ff5a356f669 SHA512 9f78728988f1c002751790bd4228d3540d56e1998a18b610cba0ec2a1af197f18df3ccd630ccdafb3be5ae4bed938219e420a15576b61af50d3d500ad1c9ad68 WHIRLPOOL bbb053bd6b0ddcfc6661ae375ced4247b34fcf724f79d292fb998a9ba4149856166b6d8138dac258157ab50b119c600bda53c8f4122cb2eec9c9d8343be50b65
+EBUILD binutils-apple-7.2-r1.ebuild 12038 SHA256 84638377d89b6ed3a78f11c585adcc9049c43d715b91f3d8099e1ca1d458d7a8 SHA512 f45fa298c8bf1c3fdd208db195e97331f8f3e84b3d675f450a812563a96dfb49de6b369ab75e393b6ce43e9ba8d4dd47a9d860ee9dc722ed591b41e63dc1ce0a WHIRLPOOL 425e7228eac7dd3a289c558a344f40646ac502baa1b2f1ec029686425a602521d5bee9b0406d65ae4cf654a725f5f1d8481965427eedd029fe3808c8e57ca20f
+EBUILD binutils-apple-7.2.ebuild 12071 SHA256 c7ca7d5614661e9c38b0dbc6777eea39ab123eef0e2e48db79557399c5a5b6c3 SHA512 c73b4a136143bdb379e762575af1c1db057527b6d2fe05bf1e971297b0057a04fa7e75bc0fe4629030046a9d28ef1a7a664101800318704768d3038117aca219 WHIRLPOOL c1691eca53161787ce6f8ada0a77b157ee3ab3d8bc0c33da6cd32f35fd4dc67cebe7c22764b700def680007d8de59db895f4e8eb8a205c74fa7c0650486f656c
+EBUILD binutils-apple-7.3.1.ebuild 13250 SHA256 6b1492d69edc8854005751ed7db06c1afb1fed8d34c844b7194bf6239920e1e5 SHA512 8fd675d434a9522b3d2a0bca532ce788070ee3dc828eb0bdcb03e4d33391864846996d0c7d4432f52aae946ac0cabdd44edf9dc6ce9913aefc95ca01a2c04fd3 WHIRLPOOL aca1c3d20a704121f6341b8eeceb6b6cbe33a36d7513f9b2a62f94b2e2273864f4f09ae01d0519d2f28febe2fd55c8c409b0fc9c9564fd323521bd71919861ad
+EBUILD binutils-apple-7.3.ebuild 12902 SHA256 4f2f8c77d62f1338b829ce2f1028d0c17a5fd429975fcd7c137fa0c251809729 SHA512 12dfdbf609eba1d7225cd5dbbcbe18d0355d438f94cddf7616bb21a60d780cff2a13df678784ea97c3631948d6a73c1453cc59e069e4fd6e9bcfae598ee1bb87 WHIRLPOOL 283f2b68a26dcee3c88d02e1e1e75d534dd508ecb042143eb91f6ac35b140708f39da96b83693e09578907a968a7eeb411ee71e4f1875adaa8773b909195a6b0
+EBUILD binutils-apple-8.1.ebuild 10435 SHA256 1cbf1c4b457b0f164edc219f03e7de58d22bd22edb19feba24d7931b10fb2da7 SHA512 f27d9a19b2fd903cb888d64e481400d48919745c4f9b40953cd4188de25fe5d9f338735dfcfa5fc4b9d5bf20662425aa3a0f4a3b2c2de04f8faba0af5d1c044b WHIRLPOOL 2669f18344580bd711a14c3d93503489acc5eb7a9c1dda85f89a676dbf40ca089cd3fe1192b52cd296e67b7f4be6b41f283da1d7781df1fdfdf934671a642627
+EBUILD binutils-apple-8.2.1.ebuild 10435 SHA256 3a861945f5eeccb766e8692ea233971d48548f226d51cdcf18d106e444339b87 SHA512 92b8176fb8ad383833a25c6b49e57a8bd41b3a9615fb4bd84d32ce1a00f269410f6e2306b2664f713f4ec399288d383a9e5358718257fce2da6574652f41ab0d WHIRLPOOL 84aee3828d169e97be1ad02a4b25eacb5f7a348c41e4d04408b783654b5d68ea0374013b33e6f6880f583f25be75104702198b58ee1f73ac4ca819098e6d0d67
+MISC ChangeLog 12708 SHA256 9523a1b7308bea60f60e0ed1b417e41ffbd36b777d4d18edebd61451f1db2ef3 SHA512 b7d49532a5e74787a969121b493db1afa059f6b71c8545810e3dbf2c89c7b3753d7974e0b2e3021ead9ca9f130cf473802a45916b0ecb56ed342e001f91cbc01 WHIRLPOOL a978b12d8955ab8ab19870482a0a8999056ef23e049137fc3ca45f4f52df1dd91e48d54e2b528becb96f2a683bc38fb3defff17bfc2334cf2ef867956e3774c9
+MISC ChangeLog-2015 14762 SHA256 00a025a8653554e0d3d6f2fbb3f45531faafeda0f222c792c428134df2c36d42 SHA512 aee75b6f20ca20b565afc8f701a131691b24238669c1abfdd82dbfd536ceb6f59ccb83f7b88be89e174550516d7790fc58964233250620c86c1ed94785b098a4 WHIRLPOOL c310ac0be33a5fffe79029881fdc154f5f5050d2cc9629da516e41c7fef2247fc5de54d3307867e45273d85052224e88e5c9453485dc8bc31cef5843c2510d79
+MISC metadata.xml 684 SHA256 b4b5e9590a82f115301dcfbd3874c53c52029d3a7b14e67670e82dd81e7b0b0f SHA512 e588cb802b2b22ee656b9dcf45d9d372a3b306fa3574a7d859e2df9032eeeab63219a9d9b69249a5a67733dff4c484da17621f00d2b0775935f2cfa5a6f91977 WHIRLPOOL 0fa0a4f4202f4a8d91e76ac99cd6ca477e0dd4c74a524a7069d603dcb6f5603b29c5ea0174c35f1db7275374f8844e0a76e0c0c860c0cdf041aee92223a55ccc
diff --git a/sys-devel/binutils-apple/binutils-apple-4.3-r2.ebuild b/sys-devel/binutils-apple/binutils-apple-4.3-r2.ebuild
new file mode 100644
index 000000000000..5131c4f35b99
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-4.3-r2.ebuild
@@ -0,0 +1,337 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-128.2
+CCTOOLS_VERSION=822
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+CCTOOLS_HEADERS=cctools-855
+LIBUNWIND=libunwind-30
+DYLD=dyld-195.6
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS_HEADERS}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test multitarget"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )"
+
+SLOT="4"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-128.2-Makefile-3 Makefile
+ epatch "${S}"/ld64-127.2-lto.patch
+ epatch "${S}"/ld64-128.2-stdlib.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-128.2-1010.patch
+ epatch "${S}"/ld64-128.2-ppc.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.0-as.patch
+ epatch "${S}"/${PN}-4.2-as-dir.patch
+ epatch "${S}"/${PN}-3.2.3-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-nmedit.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/${PN}-4.2-lto.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-4.3-makefile-target-warning.patch
+ epatch "${S}"/${PN}-4.3-lto-prefix.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+ # __darwin_i386_float_state missing on <= 10.4
+ cp -a ../${CCTOOLS_HEADERS}/include/mach/i386 include/mach
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ cat <<EOF > ${LD64}/src/configure.h
+#define DEFAULT_MACOSX_MIN_VERSION "${MACOSX_DEPLOYMENT_TARGET}"
+#define SUPPORT_ARCH_arm_any 1
+EOF
+
+ use multitarget && cat <<EOF >> ${LD64}/src/configure.h
+#define SUPPORT_ARCH_ppc 1
+EOF
+#define SUPPORT_ARCH_ppc64 1
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ ENABLE_LTO="${ENABLE_LTO}" \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-5.1-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-5.1-r1.ebuild
new file mode 100644
index 000000000000..507c8b54be16
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-5.1-r1.ebuild
@@ -0,0 +1,384 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-236.3
+CCTOOLS_VERSION=855
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-353.2.1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test libcxx multitarget"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )
+ libcxx? ( sys-libs/libcxx )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )
+ libcxx? ( sys-devel/llvm )"
+
+SLOT="5"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-236.3-Makefile-2 Makefile
+
+ epatch "${S}"/ld64-236.3-nolto.patch
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-arm64-fixup.patch
+ epatch "${S}"/ld64-241.9-arm64-cputype.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-236.3-nosnapshots.patch
+ epatch "${S}"/ld64-236.3-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-236.3-gcc-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/${PN}-5.1-nolto.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-5.1-makefile-target-warning.patch
+ epatch "${S}"/${PN}-5.1-lto-prefix.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ if [ "${CXX/*clang*/yes}" = "yes" ] ; then
+ if use libcxx ; then
+ append-cxxflags -stdlib=libc++
+ CXXLIB=-stdlib=libc++
+ else
+ # force libstdc++ for systems where libc++ is default (OS X 10.9+?)
+ append-cxxflags -stdlib=libstdc++
+ CXXLIB=-stdlib=libstdc++
+ fi
+ else
+ use libcxx && \
+ ewarn "libcxx only available with clang and your C++ compiler ($CXX) does not seem to be clang"
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ ENABLE_LTO=${ENABLE_LTO} \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ CXXLIB="${CXXLIB}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-6.1-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-6.1-r1.ebuild
new file mode 100644
index 000000000000..984b31319824
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-6.1-r1.ebuild
@@ -0,0 +1,385 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-241.9
+CCTOOLS_VERSION=862
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-353.2.1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test libcxx multitarget"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )
+ libcxx? ( sys-libs/libcxx )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )
+ libcxx? ( sys-devel/llvm )"
+
+SLOT="6"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-236.3-Makefile-2 Makefile
+
+ epatch "${S}"/ld64-236.3-nolto.patch
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-241.9-arm64-cputype.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-241.9-nosnapshots.patch
+ epatch "${S}"/ld64-241.9-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-241.9-gcc-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-241.9-lto-noremarks.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # We used to use our own copy of lto.h, which doesn't require llvm
+ # build-env. Current versions of llvm provide
+ # $EPREFIX/usr/include/llvm-c/lto.h as well as
+ # $EPREFIX/usr/lib/libLTO.{so,dylib}, so we just use these.
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/${PN}-5.1-nolto.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-5.1-makefile-target-warning.patch
+ epatch "${S}"/${PN}-6.3-lto-prefix.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ if [ "${CXX/*clang*/yes}" = "yes" ] ; then
+ if use libcxx ; then
+ append-cxxflags -stdlib=libc++
+ CXXLIB=-stdlib=libc++
+ else
+ # force libstdc++ for systems where libc++ is default (OS X 10.9+?)
+ append-cxxflags -stdlib=libstdc++
+ CXXLIB=-stdlib=libstdc++
+ fi
+ else
+ use libcxx && \
+ ewarn "libcxx only available with clang and your C++ compiler ($CXX) does not seem to be clang"
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ ENABLE_LTO=${ENABLE_LTO} \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ CXXLIB="${CXXLIB}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-6.3-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-6.3-r1.ebuild
new file mode 100644
index 000000000000..371c6a2b6c6b
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-6.3-r1.ebuild
@@ -0,0 +1,378 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-242
+CCTOOLS_VERSION=870
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-353.2.1
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test libcxx multitarget"
+
+RDEPEND="sys-devel/binutils-config
+ lto? ( sys-devel/llvm )
+ libcxx? ( sys-libs/libcxx )"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )
+ || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm )
+ libcxx? ( sys-devel/llvm )"
+
+SLOT="6"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-236.3-Makefile-2 Makefile
+
+ epatch "${S}"/ld64-236.3-nolto.patch
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-241.9-nosnapshots.patch
+ epatch "${S}"/ld64-242-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-242-gcc-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-5.1-makefile-target-warning.patch
+ epatch "${S}"/${PN}-6.3-lto-prefix.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ if [[ ${CXX} == *clang* ]] ; then
+ if use libcxx ; then
+ append-cxxflags -stdlib=libc++
+ CXXLIB=-stdlib=libc++
+ else
+ # force libstdc++ for systems where libc++ is default (OS X 10.9+?)
+ append-cxxflags -stdlib=libstdc++
+ CXXLIB=-stdlib=libstdc++
+ fi
+ else
+ use libcxx && \
+ ewarn "libcxx only available with clang and your C++ compiler ($CXX) does not seem to be clang"
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ ENABLE_LTO="${ENABLE_LTO}" \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ CXXLIB="${CXXLIB}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="clang -ccc-install-dir $PWD" \
+ CXX="clang++ -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-7.0-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-7.0-r1.ebuild
new file mode 100644
index 000000000000..2eab5e95aabf
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-7.0-r1.ebuild
@@ -0,0 +1,369 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-253.3
+CCTOOLS_VERSION=877.5
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-360.14
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r2.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test multitarget"
+
+# ld64 can now only be compiled using llvm and libc++ since it massivley uses
+# C++11 language fatures. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ lto? ( app-arch/xar )
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="7"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-253.3-Makefile-3 Makefile
+
+ epatch "${S}"/ld64-253.3-nolto.patch
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-253.3-nosnapshots.patch
+ epatch "${S}"/ld64-253.3-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-253.3-make_pair.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ #epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-7.0-make-j.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix-2.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ epatch "${S}"/${PN}-7.0-nolto.patch
+ epatch "${S}"/${PN}-7.0-nollvm.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${ENABLE_LTO}" \
+ LTO_LIBDIR=../../../lib \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-7.0.ebuild b/sys-devel/binutils-apple/binutils-apple-7.0.ebuild
new file mode 100644
index 000000000000..c81eb3fe54e0
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-7.0.ebuild
@@ -0,0 +1,366 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-253.3
+CCTOOLS_VERSION=877.5
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-360.14
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r1.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="test multitarget"
+
+# ld64 can now only be compiled using llvm and libc++ since it massivley uses
+# C++11 language fatures. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+
+# Also, llvm lto and disassembler interfaces are now widely used in cctools.
+# Since we cannot compile with gcc any more and every llvm since 3.4 has
+# provided those interfaces, we no longer support disabling them. That
+# indirectly makes xar a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ app-arch/xar
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="7"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-253.3-Makefile-2 Makefile
+
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-253.3-nosnapshots.patch
+ epatch "${S}"/ld64-253.3-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-253.3-make_pair.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ #epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-5.1-makefile-target-warning.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-7.1-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-7.1-r1.ebuild
new file mode 100644
index 000000000000..6b57a7444fd8
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-7.1-r1.ebuild
@@ -0,0 +1,369 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-253.6
+CCTOOLS_VERSION=877.7
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-360.17
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r2.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test multitarget"
+
+# ld64 can now only be compiled using llvm and libc++ since it massivley uses
+# C++11 language fatures. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ lto? ( app-arch/xar )
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="7"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-253.3-Makefile-3 Makefile
+
+ epatch "${S}"/ld64-253.3-nolto.patch
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-253.3-nosnapshots.patch
+ epatch "${S}"/ld64-253.3-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-253.3-make_pair.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ #epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-7.0-make-j.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix-2.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ epatch "${S}"/${PN}-7.0-nolto.patch
+ epatch "${S}"/${PN}-7.0-nollvm.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${ENABLE_LTO}" \
+ LTO_LIBDIR=../../../lib \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-7.1.ebuild b/sys-devel/binutils-apple/binutils-apple-7.1.ebuild
new file mode 100644
index 000000000000..9dfebf05d008
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-7.1.ebuild
@@ -0,0 +1,366 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-253.6
+CCTOOLS_VERSION=877.7
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-360.17
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r1.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="test multitarget"
+
+# ld64 can now only be compiled using llvm and libc++ since it massivley uses
+# C++11 language fatures. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+
+# Also, llvm lto and disassembler interfaces are now widely used in cctools.
+# Since we cannot compile with gcc any more and every llvm since 3.4 has
+# provided those interfaces, we no longer support disabling them. That
+# indirectly makes xar a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ app-arch/xar
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="7"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-253.3-Makefile-2 Makefile
+
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-253.3-nosnapshots.patch
+ epatch "${S}"/ld64-253.3-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-253.3-make_pair.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ #epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-5.1-makefile-target-warning.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-7.2-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-7.2-r1.ebuild
new file mode 100644
index 000000000000..e5de0f0f7867
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-7.2-r1.ebuild
@@ -0,0 +1,370 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-253.9
+CCTOOLS_VERSION=877.8
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-360.18
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.2-r0.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test multitarget"
+
+# ld64 can now only be compiled using llvm and libc++ since it massivley uses
+# C++11 language fatures. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ lto? ( app-arch/xar )
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="7"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-253.3-Makefile-3 Makefile
+
+ epatch "${S}"/ld64-253.9-nolto.patch
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-253.3-nosnapshots.patch
+ epatch "${S}"/ld64-253.3-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-253.3-make_pair.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ #epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-7.0-make-j.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix-2.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ epatch "${S}"/${PN}-7.0-nolto.patch
+ epatch "${S}"/${PN}-7.0-nollvm.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${ENABLE_LTO}" \
+ LTO_LIBDIR=../../../lib \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-7.2.ebuild b/sys-devel/binutils-apple/binutils-apple-7.2.ebuild
new file mode 100644
index 000000000000..0f608625bcae
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-7.2.ebuild
@@ -0,0 +1,366 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-253.9
+CCTOOLS_VERSION=877.8
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-360.18
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r1.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="test multitarget"
+
+# ld64 can now only be compiled using llvm and libc++ since it massivley uses
+# C++11 language fatures. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+
+# Also, llvm lto and disassembler interfaces are now widely used in cctools.
+# Since we cannot compile with gcc any more and every llvm since 3.4 has
+# provided those interfaces, we no longer support disabling them. That
+# indirectly makes xar a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ app-arch/xar
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="7"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-253.3-Makefile-2 Makefile
+
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-253.3-nosnapshots.patch
+ epatch "${S}"/ld64-253.3-ppc.patch
+ epatch "${S}"/ld64-236.3-constant-types-2.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-253.3-make_pair.patch
+ epatch "${S}"/ld64-253.3-delete-warning.patch
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ #epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-5.1-makefile-target-warning.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # -j1 because it fails too often with weird errors
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ -j1 \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-7.3.1.ebuild b/sys-devel/binutils-apple/binutils-apple-7.3.1.ebuild
new file mode 100644
index 000000000000..e56d422a78c8
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-7.3.1.ebuild
@@ -0,0 +1,393 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-264.3.102
+CCTOOLS_VERSION=886
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-360.18
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.2-r0.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.3-r1.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test multitarget"
+
+# ld64 can now only be compiled using llvm and libc++ since it massively uses
+# C++11 language features. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ lto? ( app-arch/xar )
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="7"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-264.3.101-Makefile Makefile
+
+ epatch "${S}"/ld64-264.3.101-nolto.patch
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-264.3.101-nosnapshots.patch
+ epatch "${S}"/ld64-264.3.101-ppc.patch
+ epatch "${S}"/ld64-264.3.101-constant-types.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+ epatch "${S}"/ld64-264.3.102-bitcode-case.patch
+
+ # workound llvm-3.9.{0,1} issue
+ # https://bugs.gentoo.org/show_bug.cgi?id=603580
+ # https://groups.google.com/forum/#!topic/llvm-dev/JY6nuKE__sU
+ # http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160829/169553.html
+ sed -i -e '/COMPILE_TIME_ASSERT/d' ld/parsers/libunwind/*.hpp || die
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ #epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-7.3-make-j.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix-2.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ epatch "${S}"/${PN}-7.3-nolto.patch
+ epatch "${S}"/${PN}-7.3-nollvm.patch
+ epatch "${S}"/${PN}-7.3-no-developertools-dir.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${ENABLE_LTO}" \
+ LTO_LIBDIR=../../../lib \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ # upstream is starting to replace classic binutils with llvm-integrated
+ # ones. nm and size are now symlinks to llvm-{nm,size} while the classic
+ # version is preserved as {nm,size}-classic. (BTW: otool is a symlink to
+ # otool-classic for now but a wrapper llvm-otool that is calling
+ # llvm-objdump is present already.)
+ # Since our binutils do not live in the same directory as the llvm
+ # installation, we have to rewrite the symlinks to the llvm tools.
+ # This also means, that these tools still appear to be versioned via
+ # binutils-config but actually always run the currently installed llvm
+ # tool.
+ for tool in nm size ; do
+ # ${EPREFIX}/usr/x86_64-apple-darwin15/binutils-bin/7.3/$tool
+ # -> ${EPREFIX}/bin/llvm-$tool
+ ln -sfn ../../../bin/llvm-$tool "${D}/${EPREFIX}/${BINPATH}/$tool"
+ done
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-7.3.ebuild b/sys-devel/binutils-apple/binutils-apple-7.3.ebuild
new file mode 100644
index 000000000000..26f629c41ee5
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-7.3.ebuild
@@ -0,0 +1,386 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-264.3.101
+CCTOOLS_VERSION=886
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+LIBUNWIND=libunwind-35.3
+DYLD=dyld-360.18
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ http://www.opensource.apple.com/tarballs/libunwind/${LIBUNWIND}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.1-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-6.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.2-r0.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.3-r0.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="lto test multitarget"
+
+# ld64 can now only be compiled using llvm and libc++ since it massivley uses
+# C++11 language fatures. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ lto? ( app-arch/xar )
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="7"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ if use multitarget ; then
+ ewarn "You have enabled support for non-standard target architectures"
+ ewarn "using USE=multitarget. This includes experimental support for"
+ ewarn "ppc and ppc64 which is a community forward-port from the last"
+ ewarn "version of ld64 to officially support PPC."
+
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ ewarn "HERE BE DRAGONS! Your system seems to be PPC which means that"
+ ewarn "the actual usability of your Gentoo programs will depend on the"
+ ewarn "above-mentioned experimental PPC support in the linker. Be"
+ ewarn "sure to keep a known-to-work version like ${PN}-3.2.6 around!"
+ fi
+ fi
+
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-264.3.101-Makefile Makefile
+
+ epatch "${S}"/ld64-264.3.101-nolto.patch
+ epatch "${S}"/ld64-241.9-extraneous-includes.patch
+ epatch "${S}"/ld64-241.9-osatomic.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-264.3.101-nosnapshots.patch
+ epatch "${S}"/ld64-264.3.101-ppc.patch
+ epatch "${S}"/ld64-264.3.101-constant-types.patch
+ epatch "${S}"/ld64-241.9-register-names.patch
+ epatch "${S}"/ld64-241.9-get-comm-align.patch
+ epatch "${S}"/ld64-241.9-cc_md5.patch
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # missing on <= 10.5
+ cp ../../${LIBUNWIND}/include/libunwind.h include/ || die
+ cp ../../${LIBUNWIND}/include/mach-o/compact_unwind_encoding.h include/mach-o || die
+ # missing on <= 10.4
+ cp ../../${DYLD}/include/mach-o/dyld_images.h include/mach-o || die
+ cp ../../${CCTOOLS}/include/mach-o/loader.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ # mimic OS X Leopard-style Availability.h macros for libunwind.h on
+ # older systems
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] && \
+ echo "#define __OSX_AVAILABLE_STARTING(x,y) " > include/Availability.h
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+ if [[ ${CHOST} == powerpc*-darwin* ]] ; then
+ epatch "${S}"/ld64-123.2-darwin8-no-mlong-branch-warning.patch
+ epatch "${S}"/ld64-127.2-thread_state.patch
+ fi
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ #epatch "${S}"/${PN}-5.1-otool-stdc.patch
+ epatch "${S}"/${PN}-5.1-constant-types.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-5.1-ppc.patch
+ epatch "${S}"/${PN}-5.1-thread-state-redefined.patch
+ epatch "${S}"/${PN}-7.3-make-j.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix-2.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ epatch "${S}"/${PN}-7.3-nolto.patch
+ epatch "${S}"/${PN}-7.3-nollvm.patch
+ epatch "${S}"/${PN}-7.3-no-developertools-dir.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Block API and thus snapshots supported on >= 10.6
+ [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -ge 10 ]] && \
+ append-cppflags -DSUPPORT_SNAPSHOTS
+
+ CCTOOLS_OFLAG=
+ if [[ ${CHOST} == *darwin* && ${CHOST#*-darwin} -le 8 ]] ; then
+ # cctools expect to use UNIX03 struct member names.
+ # This is default on > 10.4. Activate it on <= 10.4 by defining
+ # __DARWIN_UNIX03 explicitly.
+ CCTOOLS_OFLAG="-D__DARWIN_UNIX03=1"
+ fi
+
+ # if compiling with USE multitarget, extract all the known arches from
+ # create_configure and pass them back to it
+ creco=${LD64}/src/create_configure
+ ARCHS_TO_SUPPORT=""
+ if use multitarget ; then
+ ARCHS_TO_SUPPORT="$(grep KNOWN_ARCHS= $creco | \
+ cut -d\" -f2 | tr ',' ' ')"
+ fi
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ RC_SUPPORTED_ARCHS="$ARCHS_TO_SUPPORT" \
+ $creco
+
+ # do not depend on MachOFileAbstraction.hpp to define
+ # SUPPORT_ARCH_arm_any because that's not included by every file where
+ # our ppc/arm-optional patch uses it, ld.hpp in particular
+ grep "SUPPORT_ARCH_armv[0-9]" ${LD64}/src/configure.h >/dev/null && \
+ echo "#define SUPPORT_ARCH_arm_any 1" >> ${LD64}/src/configure.h
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${ENABLE_LTO}" \
+ LTO_LIBDIR=../../../lib \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ # upstream is starting to replace classic binutils with llvm-integrated
+ # ones. nm and size are now symlinks to llvm-{nm,size} while the classic
+ # version is preserved as {nm,size}-classic. (BTW: otool is a symlink to
+ # otool-classic for now but a wrapper llvm-otool that is calling
+ # llvm-objdump is present already.)
+ # Since our binutils do not live in the same directory as the llvm
+ # installation, we have to rewrite the symlinks to the llvm tools.
+ # This also means, that these tools still appear to be versioned via
+ # binutils-config but actually always run the currently installed llvm
+ # tool.
+ for tool in nm size ; do
+ # ${EPREFIX}/usr/x86_64-apple-darwin15/binutils-bin/7.3/$tool
+ # -> ${EPREFIX}/bin/llvm-$tool
+ ln -sfn ../../../bin/llvm-$tool "${D}/${EPREFIX}/${BINPATH}/$tool"
+ done
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-8.1.ebuild b/sys-devel/binutils-apple/binutils-apple-8.1.ebuild
new file mode 100644
index 000000000000..d5ad6ab38a98
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-8.1.ebuild
@@ -0,0 +1,334 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-274.1
+CCTOOLS_VERSION=895
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+DYLD=dyld-421.2
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-8.2-r0.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~x64-macos ~x86-macos"
+IUSE="lto tapi classic test"
+
+# ld64 can now only be compiled using llvm and libc++ since it massively uses
+# C++11 language features. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ lto? ( app-arch/xar )
+ tapi? ( sys-libs/tapi )
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="8"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-274.1-Makefile Makefile
+
+ epatch "${S}"/ld64-274.1-nolto.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-264.3.102-bitcode-case.patch
+ epatch "${S}"/ld64-274.1-unknown-fixup.patch
+ epatch "${S}"/ld64-274.1-notapi.patch
+
+ # workound llvm-3.9.{0,1} issue
+ # https://bugs.gentoo.org/show_bug.cgi?id=603580
+ # https://groups.google.com/forum/#!topic/llvm-dev/JY6nuKE__sU
+ # http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160829/169553.html
+ sed -i -e '/COMPILE_TIME_ASSERT/d' ld/parsers/libunwind/*.hpp || die
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-7.3-make-j.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix-2.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ epatch "${S}"/${PN}-8.1-nolto.patch
+ epatch "${S}"/${PN}-7.3-nollvm.patch
+ epatch "${S}"/${PN}-7.3-no-developertools-dir.patch
+ epatch "${S}"/${PN}-8.1-llvm-tools.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ eapply_user
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ ${LD64}/src/create_configure
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ TAPI=$(use tapi && echo 1 || echo 0) \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${ENABLE_LTO}" \
+ LTO_LIBDIR=../../../lib \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ # upstream is starting to replace classic binutils with llvm-integrated
+ # ones. nm and size are now symlinks to llvm-{nm,size} while the classic
+ # version is preserved as {nm,size}-classic.
+ # Since our binutils do not live in the same directory as the llvm
+ # installation, we have to rewrite the symlinks to the llvm tools.
+ # This also means, that these tools still appear to be versioned via
+ # binutils-config but actually always run the currently installed llvm
+ # tool.
+ budir=${D}/${EPREFIX}/${BINPATH}
+ for tool in nm size ; do
+ # ${EPREFIX}/usr/x86_64-apple-darwin15/binutils-bin/7.3/$tool
+ # -> ${EPREFIX}/bin/llvm-$tool
+ use classic && \
+ ln -sfn ${tool}-classic "${budir}/${tool}" || \
+ ln -sfn ../../../bin/llvm-${tool} "${budir}/${tool}"
+ done
+
+ # Also, otool is now based on llvm-objdump. But a small wrapper installed
+ # as llvm-otool remains, providing command line compatibility.
+ use classic && \
+ ln -sfn otool-classic "${budir}/otool" || \
+ ln -sfn llvm-otool "${budir}/otool"
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/binutils-apple-8.2.1.ebuild b/sys-devel/binutils-apple/binutils-apple-8.2.1.ebuild
new file mode 100644
index 000000000000..9cf67823890a
--- /dev/null
+++ b/sys-devel/binutils-apple/binutils-apple-8.2.1.ebuild
@@ -0,0 +1,334 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+LD64=ld64-274.2
+CCTOOLS_VERSION=895
+CCTOOLS=cctools-${CCTOOLS_VERSION}
+DYLD=dyld-421.2
+
+DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
+HOMEPAGE="http://www.opensource.apple.com/darwinsource/"
+SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
+ http://www.opensource.apple.com/tarballs/cctools/${CCTOOLS}.tar.gz
+ http://www.opensource.apple.com/tarballs/dyld/${DYLD}.tar.gz
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-4.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-5.1-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.0-r2.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-7.3-r1.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-8.2-r0.tar.bz2"
+
+LICENSE="APSL-2"
+KEYWORDS="~x64-macos ~x86-macos"
+IUSE="lto tapi classic test"
+
+# ld64 can now only be compiled using llvm and libc++ since it massively uses
+# C++11 language features. *But additionally* the as driver now defaults to
+# calling clang as the assembler on many platforms. This can be disabled using
+# -Wa,-Q but since it's default we make llvm a static runtime dependency.
+RDEPEND="sys-devel/binutils-config
+ lto? ( app-arch/xar )
+ tapi? ( sys-libs/tapi )
+ sys-devel/llvm
+ sys-libs/libcxx"
+DEPEND="${RDEPEND}
+ test? ( >=dev-lang/perl-5.8.8 )"
+
+SLOT="8"
+
+S=${WORKDIR}
+
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+src_prepare() {
+ cd "${S}"/${LD64}/src
+ cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
+ cp "${S}"/ld64-274.1-Makefile Makefile
+
+ epatch "${S}"/ld64-274.1-nolto.patch
+ epatch "${S}"/ld64-236.3-crashreporter.patch
+ epatch "${S}"/ld64-264.3.102-bitcode-case.patch
+ epatch "${S}"/ld64-274.1-unknown-fixup.patch
+ epatch "${S}"/ld64-274.1-notapi.patch
+
+ # workound llvm-3.9.{0,1} issue
+ # https://bugs.gentoo.org/show_bug.cgi?id=603580
+ # https://groups.google.com/forum/#!topic/llvm-dev/JY6nuKE__sU
+ # http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160829/169553.html
+ sed -i -e '/COMPILE_TIME_ASSERT/d' ld/parsers/libunwind/*.hpp || die
+
+ # provide missing headers from libunwind and dyld
+ mkdir -p include/{mach,mach-o/arm} || die
+ # never present because it's private
+ cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+ # use copies from cctools because they're otherwise hidden in some SDK
+ cp ../../${CCTOOLS}/include/mach-o/arm/reloc.h include/mach-o/arm || die
+ # provide all required CPU_TYPEs on all platforms
+ cp ../../${CCTOOLS}/include/mach/machine.h include/mach/machine.h
+ # add alias for newer identifiers, because ld64 uses both but cctools
+ # header only defines the older
+ epatch "${S}"/ld64-236.3-missing-cputypes.patch
+
+ local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
+ echo "char ldVersionString[] = ${VER_STR};" > version.cpp
+
+ epatch "${S}"/ld64-123.2-debug-backtrace.patch
+
+ cd "${S}"/${CCTOOLS}
+ epatch "${S}"/${PN}-4.5-as.patch
+ epatch "${S}"/${PN}-5.1-as-dir.patch
+ epatch "${S}"/${PN}-5.1-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ epatch "${S}"/${PN}-3.1.1-no-headers.patch
+ epatch "${S}"/${PN}-4.0-no-oss-dir.patch
+ epatch "${S}"/cctools-839-intel-retf.patch
+ epatch "${S}"/${PN}-5.1-extraneous-includes.patch
+ epatch "${S}"/${PN}-5.1-strnlen.patch
+ epatch "${S}"/${PN}-7.3-make-j.patch
+ epatch "${S}"/${PN}-7.0-lto-prefix-2.patch
+ epatch "${S}"/${PN}-7.0-clang-as.patch
+ epatch "${S}"/${PN}-8.1-nolto.patch
+ epatch "${S}"/${PN}-7.3-nollvm.patch
+ epatch "${S}"/${PN}-7.3-no-developertools-dir.patch
+ epatch "${S}"/${PN}-8.1-llvm-tools.patch
+ cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
+
+ # do not build profileable libstuff to save compile time
+ sed -i -e "/^all:/s, profile , ," libstuff/Makefile
+
+ # cctools version is provided to make via RC_ProjectSourceVersion which
+ # generates and compiles it as apple_version[] into libstuff. From
+ # there it's picked up by the individual tools. Since
+ # RC_ProjectSourceVersion is also used as library version, we can't
+ # just append our local version info. So we hack the libstuff Makefile
+ # to include our Gentoo version.
+ sed -i -e "/cctools-.*(RC_ProjectSourceVersion).*OFILE_DIR/s,Version),Version) (Gentoo ${PN}-${PVR})," \
+ libstuff/Makefile
+
+ eapply_user
+
+ # clean up test suite
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ local c
+
+ # we don't have llvm
+ ((++c)); rm -rf llvm-integration;
+
+ # we don't have dtrace
+ ((++c)); rm -rf dtrace-static-probes-coalescing;
+ ((++c)); rm -rf dtrace-static-probes;
+
+ # a file is missing
+ ((++c)); rm -rf eh-coalescing-r
+
+ # we don't do universal binaries
+ ((++c)); rm -rf blank-stubs;
+
+ # looks like a problem with apple's result-filter.pl
+ ((++c)); rm -rf implicit-common3;
+ ((++c)); rm -rf order_file-ans;
+
+ # TODO no idea what goes wrong here
+ ((++c)); rm -rf dwarf-debug-notes;
+
+ einfo "Deleted $c tests that were bound to fail"
+
+ cd "${S}"
+ ebegin "cleaning Makefiles from unwanted CFLAGS"
+ find . -name "Makefile" -print0 | xargs -0 sed \
+ -i \
+ -e 's/ -g / /g' \
+ -e 's/^G =.*$/G =/' \
+ -e 's/^OFLAG =.*$/OFLAG =/' \
+ -e 's/install -c -s/install/g'
+ eend $?
+}
+
+src_configure() {
+ ENABLE_LTO=0
+ use lto && ENABLE_LTO=1
+
+ export CTARGET=${CTARGET:-${CHOST}}
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+ fi
+
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ BINPATH=/usr/${CHOST}/${CTARGET}/binutils-bin/${PV}
+ else
+ BINPATH=/usr/${CTARGET}/binutils-bin/${PV}
+ fi
+
+ # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
+ # what we want)
+ append-cppflags -DNDEBUG
+
+ # Create configure.h for ld64 with SUPPORT_ARCH_<arch> defines in it.
+ DERIVED_FILE_DIR=${LD64}/src \
+ ${LD64}/src/create_configure
+}
+
+compile_ld64() {
+ einfo "building ${LD64}"
+ cd "${S}"/${LD64}/src
+ emake \
+ LTO=${ENABLE_LTO} \
+ TAPI=$(use tapi && echo 1 || echo 0) \
+ || die "emake failed for ld64"
+ use test && emake build_test
+}
+
+compile_cctools() {
+ einfo "building ${CCTOOLS}"
+ cd "${S}"/${CCTOOLS}
+ # Suppress running dsymutil because it will warn about missing debug
+ # info which is expected when compiling without -g as we normally do.
+ # This might need some more thought if anyone ever wanted to build us
+ # for debugging with Apple's tools.
+ emake \
+ LIB_PRUNETRIE="-L../../${LD64}/src -lprunetrie" \
+ EFITOOLS= \
+ LTO="${ENABLE_LTO}" \
+ LTO_LIBDIR=../../../lib \
+ COMMON_SUBDIRS='libstuff ar misc otool' \
+ SUBDIRS_32= \
+ LEGACY= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for the cctools"
+ cd "${S}"/${CCTOOLS}/as
+ emake \
+ BUILD_OBSOLETE_ARCH= \
+ RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
+ RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" -DCLANGDIR=\"\\\"${EPREFIX}/usr/bin/\\\"\" ${CFLAGS}" \
+ OFLAG="${CCTOOLS_OFLAG}" \
+ DSYMUTIL=": disabled: dsymutil" \
+ || die "emake failed for as"
+}
+
+src_compile() {
+ compile_ld64
+ compile_cctools
+}
+
+install_ld64() {
+ exeinto ${BINPATH}
+ doexe "${S}"/${LD64}/src/{ld64,rebase,dyldinfo,unwinddump,ObjectDump}
+ dosym ld64 ${BINPATH}/ld
+ insinto ${DATAPATH}/man/man1
+ doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,rebase}.1
+}
+
+install_cctools() {
+ cd "${S}"/${CCTOOLS}
+ emake install_all_but_headers \
+ EFITOOLS= \
+ COMMON_SUBDIRS='ar misc otool' \
+ SUBDIRS_32= \
+ DSTROOT=\"${D}\" \
+ BINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ cd "${S}"/${CCTOOLS}/as
+ emake install \
+ BUILD_OBSOLETE_ARCH= \
+ DSTROOT=\"${D}\" \
+ USRBINDIR=\"${EPREFIX}\"${BINPATH} \
+ LIBDIR=\"${EPREFIX}\"${LIBPATH} \
+ LOCLIBDIR=\"${EPREFIX}\"${LIBPATH}
+
+ # upstream is starting to replace classic binutils with llvm-integrated
+ # ones. nm and size are now symlinks to llvm-{nm,size} while the classic
+ # version is preserved as {nm,size}-classic.
+ # Since our binutils do not live in the same directory as the llvm
+ # installation, we have to rewrite the symlinks to the llvm tools.
+ # This also means, that these tools still appear to be versioned via
+ # binutils-config but actually always run the currently installed llvm
+ # tool.
+ budir=${D}/${EPREFIX}/${BINPATH}
+ for tool in nm size ; do
+ # ${EPREFIX}/usr/x86_64-apple-darwin15/binutils-bin/7.3/$tool
+ # -> ${EPREFIX}/bin/llvm-$tool
+ use classic && \
+ ln -sfn ${tool}-classic "${budir}/${tool}" || \
+ ln -sfn ../../../bin/llvm-${tool} "${budir}/${tool}"
+ done
+
+ # Also, otool is now based on llvm-objdump. But a small wrapper installed
+ # as llvm-otool remains, providing command line compatibility.
+ use classic && \
+ ln -sfn otool-classic "${budir}/otool" || \
+ ln -sfn llvm-otool "${budir}/otool"
+
+ cd "${ED}"${BINPATH}
+ insinto ${DATAPATH}/man/man1
+ local skips manpage
+ # ar brings an up-to-date manpage with it
+ skips=( ar )
+ for bin in *; do
+ for skip in ${skips[@]}; do
+ if [[ ${bin} == ${skip} ]]; then
+ continue 2;
+ fi
+ done
+ manpage=${S}/${CCTOOLS}/man/${bin}.1
+ if [[ -f "${manpage}" ]]; then
+ doins "${manpage}"
+ fi
+ done
+ insinto ${DATAPATH}/man/man5
+ doins "${S}"/${CCTOOLS}/man/*.5
+}
+
+src_test() {
+ if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ einfo "Test suite only works properly with clang - please install"
+ return
+ fi
+
+ einfo "Running unit tests"
+ cd "${S}"/${LD64}/unit-tests/test-cases
+ # provide the new ld as a symlink to clang so that -ccc-install-dir
+ # will pick it up
+ ln -sfn ../../src/ld64 ld
+ # use our arch command because the System's will report i386 even for an
+ # x86_64 prefix
+ perl ../bin/make-recursive.pl \
+ BUILT_PRODUCTS_DIR="${S}"/${LD64}/src \
+ ARCH="$(arch)" \
+ LD="${S}"/${LD64}/src/ld64 \
+ CC="${CC} -ccc-install-dir $PWD" \
+ CXX="${CXX} -ccc-install-dir $PWD" \
+ OTOOL="${S}"/${CCTOOLS}/otool/otool.NEW \
+ | perl ../bin/result-filter.pl
+}
+
+src_install() {
+ install_ld64
+ install_cctools
+
+ cd "${S}"
+ insinto /etc/env.d/binutils
+ cat <<-EOF > env.d
+ TARGET="${CHOST}"
+ VER="${PV}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins env.d ${CHOST}-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-${PV}
+}
diff --git a/sys-devel/binutils-apple/metadata.xml b/sys-devel/binutils-apple/metadata.xml
new file mode 100644
index 000000000000..b6fa3676524c
--- /dev/null
+++ b/sys-devel/binutils-apple/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>prefix@gentoo.org</email>
+ <name>Gentoo Prefix</name>
+ </maintainer>
+ <use>
+ <flag name="lto">Add support for Link-Time Optimization with LLVM</flag>
+ <flag name="libcxx">Add support for libcxx</flag>
+ <flag name="multitarget">Compile for non-standard target
+ architectures (ppc and ppc64) -- experimental, Gentoo
+ only</flag>
+ <flag name="classic">Use nm, otool, etc. from this ebuild
+ instead of llvm-based tools</flag>
+ <flag name="tapi">Build against <pkg>sys-libs/tapi</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/binutils-config/Manifest b/sys-devel/binutils-config/Manifest
new file mode 100644
index 000000000000..8d8868541978
--- /dev/null
+++ b/sys-devel/binutils-config/Manifest
@@ -0,0 +1,7 @@
+AUX binutils-config-5 12171 SHA256 0d69823943552d7c4fb02c9794b4bf37d611a281afa59d5d117c850523217fcf SHA512 a444f81455cfe366072cd600aebab5c66c871b7a1b3fb935a7600596fa18dc7a4a55d82b0c0a2b239b0c3ab6a488159d3c1fd6a7e1c9fd8de4096822dfb647ad WHIRLPOOL 88e70c7ccc813d1c8d7fdd37e549a752e0f0a9b3861aa1c5152fd17444885ef82dc66ee05370145c242f7be9fae9a708dc9e44ac270ead5427b2d3751d6023f5
+AUX binutils-config.8 2710 SHA256 029958bf9fe9c6d1382a9629b9483954b31ccc27f9367c906794bd3d15e5b23f SHA512 185b3cd1a213afb6bd00efe59e081fb1839a8a795a8db93206ef556b0efda741a3e1b36a10d28b662aba340eb86cc73e3b94b4d0b05325104fafade295281455 WHIRLPOOL 15001789d2afbbd604dbdb3a6ffed0e7e862cfe02ffda386fbb81d4657549055f1b89c8d0392db291d3a4c0c099bdd9189287b536745143d3bd84d708df70736
+AUX binutils.eselect 810 SHA256 e579d3bffc645730f396ebc01d9f9f1043ee8db5edb1f41d5aeadeedcf6aa295 SHA512 105d2c50fbe2a988e669810db3f2d278cb70c24ee85a16c85a3f63c6e8e9e32bd91f430e4f9ec347e0ccb1a88ca4edb2eba9cbda73356e44d0871cb7ab9eb203 WHIRLPOOL 5ae5fd07213e2be381824aea237aa2cc47a987a2ee6508fcd8f18424f8e3de89be71f1de781240af45b98f7525048be2ab7cb60893384efbcde8f8a92a32c73a
+EBUILD binutils-config-5-r3.ebuild 1128 SHA256 a58becddce2133f82a3bc78780555e4f64cf56e85464fca948c9b9f3b9a05cd9 SHA512 0262239b2c34a14ce7e2e7851715fc917fc4e838bef98ab402c00f9fd8aac7a05db82eae34bd77eb96473f75e313b05dcdbf04b8a900eebb3ddcff35bdb3d528 WHIRLPOOL 05f857b6c21cdeb5a63c9fa7ea2a970cf0c0902ef0aeafa9e5dd09467012cecbfb0bb19c180ef026e1b8d66e70cc955e912955186ffa0c1266f84478072daba1
+MISC ChangeLog 5909 SHA256 6619cf444460477472191b391f716defa10bd5b13770d0ab072cdeb2138c9501 SHA512 767a6e62445c1fd7eef0045ed61b2b4c49681a0c73938f1b01ad59ecc44752ae0104d3fb1f9a677feb38fb5b24ac7cbbda50dd4d6e70bf6b6a624a3ad0a2cb00 WHIRLPOOL 4f07bca52d3bdfda2325daaf2ad183be5544c179878b14eb2ad28b2766f7b9bb98b339e413ad6ac413ba2a99a8fcf71e2447fb714996cabb0229cc7fa3842561
+MISC ChangeLog-2015 12757 SHA256 996edd94d7f8b82e690fa028e8e729ba1aafff0e2e8dd2fa358718ee990546df SHA512 bf644ca23b2dcd20d8a7279377711d976211e91bf4c41f10638383dc1a3e2c215864e3328984f50f0d2137474a9d07dcd499eca16a8e2df757f54295a52b5ac3 WHIRLPOOL 5de7f1e57ca53bca17deef27b6a2c52b816d7df586fbbfc92304d8a518a2fd6ef31911f4b2012fb9b8b10210038fcfab05a3871a67545b7f4dfd6eab04c85c4e
+MISC metadata.xml 257 SHA256 fcb691c3299a07a5fe4f936baa5aa146b8aa3cb9491ba88fd12547cb540b02c2 SHA512 fd85d9cf15f6b7db96e4d184e32ae6f1503a5b70cb4cb1ce930ba13a1d5d4c4b24971781e95b7f3f9ead58b31760f84c368bc6fa2a793b4b5baf78259b047ff1 WHIRLPOOL 62b62e3e5489b8983ddd7bfc6017411d5e02f9710763206baa84b826388c8685fe7bdc0bb6a76c029e73ae4c160e9af6c8544406dc70a203c7c3d65d4aa15400
diff --git a/sys-devel/binutils-config/binutils-config-5-r3.ebuild b/sys-devel/binutils-config/binutils-config-5-r3.ebuild
new file mode 100644
index 000000000000..6a486bdebf46
--- /dev/null
+++ b/sys-devel/binutils-config/binutils-config-5-r3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit prefix
+
+DESCRIPTION="Utility to change the binutils version being used"
+HOMEPAGE="https://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+# We also RDEPEND on sys-apps/findutils which is in base @system
+RDEPEND="sys-apps/gentoo-functions
+ !<app-admin/eselect-1.4.5"
+
+S=${WORKDIR}
+
+src_install() {
+ newbin "${FILESDIR}"/${PN}-${PV} ${PN}
+ use prefix && eprefixify "${ED}"/usr/bin/${PN}
+ sed -i "s:@PV@:${PVR}:g" "${ED}"/usr/bin/${PN} || die
+ doman "${FILESDIR}"/${PN}.8
+
+ insinto /usr/share/eselect/modules
+ doins "${FILESDIR}"/binutils.eselect
+}
+
+pkg_preinst() {
+ # Force a refresh when upgrading from an older version that symlinked
+ # in all the libs & includes that binutils-libs handles. #528088
+ if has_version "<${CATEGORY}/${PN}-5" ; then
+ local bc current
+ bc="${ED}/usr/bin/binutils-config"
+ if current=$("${bc}" -c) ; then
+ "${bc}" "${current}"
+ fi
+ fi
+}
diff --git a/sys-devel/binutils-config/files/binutils-config-5 b/sys-devel/binutils-config/files/binutils-config-5
new file mode 100755
index 000000000000..acb72b7e3435
--- /dev/null
+++ b/sys-devel/binutils-config/files/binutils-config-5
@@ -0,0 +1,481 @@
+#!/bin/bash
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Format of /etc/env.d/binutils/:
+# config-TARGET: CURRENT=version for TARGET
+# TARGET-VER: has a TARGET and VER variable
+
+EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
+if [[ ${EPREFIX} == "@"GENTOO_PORTAGE_EPREFIX"@" ]] ; then
+ EPREFIX=""
+fi
+
+: ${ROOT:=/}
+[[ ${ROOT} != */ ]] && ROOT="${ROOT}/"
+[[ ${ROOT} != /* ]] && ROOT="${PWD%/}/${ROOT}"
+
+EROOT="${ROOT%/}${EPREFIX}/"
+
+cd "${EPREFIX}/"
+
+trap ":" INT QUIT TSTP
+
+argv0=${0##*/}
+FUNCTIONS_SH="${EPREFIX}/lib/gentoo/functions.sh"
+source ${FUNCTIONS_SH} || {
+ echo "${argv0}: Could not source ${FUNCTIONS_SH}!" 1>&2
+ exit 1
+}
+esyslog() { :; }
+die() { eerror "${argv0}: $*"; exit 1; }
+umask 022
+
+usage() {
+cat << USAGE_END
+Usage: ${HILITE}binutils-config${NORMAL} ${GOOD}[options]${NORMAL} ${BRACKET}[binutils profile]${NORMAL}
+
+${HILITE}General Options:${NORMAL}
+ ${GOOD}-c, --get-current-profile${NORMAL} Print current profile
+ ${GOOD}-l, --list-profiles${NORMAL} Print a list of available profiles
+ ${GOOD}-u, --uninstall${NORMAL} Remove all signs of specified target
+ ${GOOD}-d, --debug${NORMAL} Execute with debug output
+
+${HILITE}General Cruft:${NORMAL}
+ ${GOOD}--linker${NORMAL} <linker> Switch to specified linker (if supported)
+
+Profile names are of the form: ${BRACKET}<CTARGET>-<binutils version>${NORMAL}
+For example: ${BRACKET}i686-pc-linux-gnu-2.15.92.0.2${NORMAL}
+
+For more info, please see ${HILITE}binutils-config${NORMAL}(8).
+USAGE_END
+
+ exit ${1:-1}
+}
+
+mv_if_diff() {
+ if cmp -s "$1" "$2" ; then
+ rm -f "$1"
+ else
+ mv -f "$1" "$2"
+ fi
+}
+atomic_ln() {
+ local target=$1 linkdir=$2 linkname=$3 linktmp linkfull
+ linktmp="${linkdir}/.binutils-config.tmp.${linkname}"
+ linkfull="${linkdir}/${linkname}"
+ if [[ -d ${linkfull} ]] ; then
+ # if linking to a dir, we need a little magic to
+ # make it atomic since `mv -T` is not portable
+ rm -rf "${linktmp}"
+ mkdir -p "${linktmp}"
+ ln -sf "${target}" "${linktmp}/${linkname}"
+ mv "${linktmp}/${linkname}" "${linktmp}/../"
+ rmdir "${linktmp}"
+ else
+ # `ln` will expand into unlink();symlink(); which
+ # is not atomic for a small amount of time, but
+ # `mv` is a single rename() call
+ ln -sf "${target}" "${linktmp}"
+ mv "${linktmp}" "${linkfull}"
+ fi
+}
+
+setup_env() {
+ unset TARGET VER LIBPATH
+ source "${ENV_D}/${PROFILE}"
+ if [[ -z ${TARGET} ]] ; then
+ eerror "${PROFILE} is invalid (no \$TARGET defined) :("
+ return 1
+ fi
+ if [[ -z ${VER} ]] ; then
+ eerror "${PROFILE} is invalid (no \$VER defined) :("
+ return 1
+ fi
+
+ #
+ # Generate binary symlinks
+ #
+ BINPATH=""
+ BINPATH_LINKS=""
+ if [[ ${TARGET} != ${HOST} ]] ; then
+ #
+ # Newer paths: /usr/${HOST}/${TARGET}/...
+ # Older paths: /usr/${TARGET}/...
+ #
+ if [[ -d "${EROOT}"/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; then
+ BINPATH="${EPREFIX}"/usr/${HOST}/${TARGET}/binutils-bin/${VER}
+ BINPATH_LINKS="${EPREFIX}"/usr/libexec/gcc/${TARGET}
+ fi
+ fi
+ if [[ -z ${BINPATH} ]] ; then
+ BINPATH="${EPREFIX}"/usr/${TARGET}/binutils-bin/${VER}
+ BINPATH_LINKS="${EPREFIX}"/usr/${TARGET}/bin
+ fi
+}
+
+# Lists of headers that various versions have installed.
+HEADERS=(
+ ansidecl.h bfd.h bfdlink.h demangle.h dis-asm.h dyn-string.h
+ fibheap.h hashtab.h libiberty.h objalloc.h plugin-api.h
+ splay-tree.h symcat.h
+)
+
+switch_profile() {
+ local x
+
+ ebegin "Switching to ${PROFILE}"
+
+ setup_env || return 1
+
+ cd "${ROOT}/${BINPATH}" || exit 1
+ mkdir -p "${ROOT}/${BINPATH_LINKS}" "${EROOT}/usr/bin"
+ for x in * ; do
+ atomic_ln "${BINPATH}/${x}" "${ROOT}/${BINPATH_LINKS}" "${x}"
+ atomic_ln "${BINPATH_LINKS}/${x}" "${EROOT}/usr/bin" "${TARGET}-${x}"
+ if [[ ${TARGET} == ${HOST} ]] ; then
+ atomic_ln "${TARGET}-${x}" "${EROOT}/usr/bin" "${x}"
+ fi
+ done
+
+ #
+ # Generate library / ldscripts symlinks
+ #
+ : ${LIBPATH:=${EPREFIX}/usr/lib/binutils/${TARGET}/${VER}}
+ cd "${ROOT}/${LIBPATH}" || exit 1
+ if [[ ${TARGET} == ${HOST} ]] ; then
+ dstlib=${EROOT}/usr/${HOST}/lib
+ else
+ dstlib=${EROOT}/usr/${HOST}/${TARGET}/lib
+ fi
+ # When upgrading, we need to clean up ldscripts and libs.
+ # Don't symlink back in the libs -- the binutils-lib package handles
+ # these now.
+ # TODO: Stop requiring even the ldscripts symlink.
+ mkdir -p "${dstlib}"
+ rm -rf "${ROOT}/${BINPATH_LINKS}"/ldscripts
+ atomic_ln "${LIBPATH}/ldscripts" "${dstlib}" "ldscripts"
+ find -L "${dstlib}" -xtype l -name 'lib*' -exec rm -f {} +
+
+ #
+ # Clean out old generated include symlinks
+ #
+ INCPATH=${LIBPATH}/include
+ if [[ -d ${ROOT}/${INCPATH} ]] ; then
+ cd "${ROOT}/${INCPATH}" || exit 1
+ if [[ ${HOST} == ${TARGET} ]] ; then
+ # The binutils-lib package handles these files now.
+ for x in libiberty "${HEADERS[@]}" ; do
+ x="${EROOT}/usr/include/${x}"
+ if [[ -L ${x} ]] ; then
+ rm "${x}"
+ fi
+ done
+ else
+ # Clean out old path -- cannot use '-exec {} +' syntax here
+ find . -type f -exec rm -f "${EROOT}/usr/${TARGET}/usr/include/{}" \;
+ rmdir "${EROOT}/usr/${TARGET}/usr/include" >& /dev/null
+ rmdir "${EROOT}/usr/${TARGET}/usr" >& /dev/null
+ rmdir "${EROOT}/usr/${TARGET}" >& /dev/null
+ fi
+ fi
+
+ #
+ # Make sure proper paths get updated
+ #
+ local env_update_flag="--no-ldconfig"
+ if [[ ${TARGET} == ${HOST} ]] ; then
+ # Delete old config now that binutils-libs installs these files.
+ # Note: This skips ldconfig update if env.d had LDPATH, but meh.
+ # Most people have upgraded to ld.so.conf.d, and someone else will
+ # eventually re-run ldconfig for us.
+ x="${EROOT}"/etc/ld.so.conf.d/05binutils.conf
+ if [[ -e ${x} ]]; then
+ rm -f "${x}"
+ env_update_flag=""
+ fi
+
+ DATAPATH="${EPREFIX}"/usr/share/binutils-data/${TARGET}/${VER}
+ local e="${EROOT}"/etc/env.d/05binutils
+ local ee="${e}.tmp"
+ rm -f "${ee}"
+ [[ -d ${ROOT}/${DATAPATH}/man ]] && echo "MANPATH=${DATAPATH}/man" >> "${ee}"
+ [[ -d ${ROOT}/${DATAPATH}/info ]] && echo "INFOPATH=${DATAPATH}/info" >> "${ee}"
+ mv_if_diff "${ee}" "${e}"
+ fi
+
+ local c="${ENV_D}/config-${TARGET}"
+ local cc="${c}.tmp"
+ echo "CURRENT=${VER}" > "${cc}"
+ mv_if_diff "${cc}" "${c}"
+
+ eend 0
+
+ #
+ # Regen env.d if need/can be
+ #
+ if [[ ${ROOT} == "/" ]] && [[ ${TARGET} == ${HOST} ]] ; then
+ env-update ${env_update_flag}
+ echo
+ ewarn "Please remember to run:"
+ echo
+ ewarn " # . ${EPREFIX}/etc/profile"
+ echo
+ fi
+
+ return 0
+}
+
+uninstall_target() {
+ : ${TARGET:=${UARG}}
+
+ if [[ ${TARGET} == ${HOST} ]] ; then
+ die "refusing to uninstall native binutils"
+ fi
+
+ shopt -s nullglob
+ PROFILE=""
+
+ for PROFILE in "${ENV_D}"/${TARGET}-* ; do
+ ewarn "Removing all signs of ${PROFILE##*/}"
+ rm -f "${ENV_D}"/${PROFILE}
+ done
+ if [[ -z ${PROFILE} ]] && [[ ! -e ${ENV_D}/config-${TARGET} ]] ; then
+ die "no profiles exist for '${TARGET}'"
+ fi
+
+ rm -f "${ENV_D}"/config-${TARGET}
+
+ local x
+ for x in \
+ addr2line ar as c++filt elf2flt elfedit flthdr gprof \
+ ld ld.{bfd,gold,real} \
+ nm objcopy objdump ranlib readelf size strings strip
+ do
+ x=(
+ "${EROOT}"/usr/bin/${TARGET}-${x}
+ "${EROOT}"/usr/{${HOST}/,}${TARGET}/bin/${x}
+ "${EROOT}"/usr/libexec/gcc/${TARGET}/${x}
+ )
+ rm -f "${x[@]}"
+ done
+ for x in "${HEADERS[@]}" ; do
+ rm -f "${EROOT}"/usr/{${HOST}/,}${TARGET}/{usr/,}include/${x}
+ done
+ for x in bfd iberty opcodes ; do
+ rm -f "${EROOT}"/usr/${HOST}/${TARGET}/lib/lib${x}{{-*,}.so,.a,.la}
+ done
+ # Delete broken symlinks
+ local destdir="${EROOT}/usr/${HOST}/${TARGET}"
+ rm -f "${destdir}"/lib/ldscripts
+ find -L "${destdir}"/lib -type l -exec rm {} +
+ rmdir \
+ "${destdir}"/{bin,include,lib,usr} \
+ "${destdir}" \
+ "${EROOT}"/var/db/pkg/cross-${TARGET} \
+ "${EROOT}"/usr/{${HOST}/,}${TARGET}/bin \
+ "${EROOT}"/usr/libexec/gcc/${TARGET} \
+ 2>/dev/null
+
+ rm -f "${ENV_D}"/${TARGET}-*
+}
+
+set_current_profile() {
+ if [[ ! -f ${ENV_D}/config-${TARGET} ]] ; then
+ eerror "${argv0}: unable to locate a profile for target: ${TARGET}"
+ return 1
+ fi
+
+ source "${ENV_D}/config-${TARGET}"
+
+ if [[ -z ${CURRENT} ]] ; then
+ eerror "${argv0}: no binutils profile is active!"
+ return 1
+ fi
+
+ echo "${TARGET}-${CURRENT}"
+
+ return 0
+}
+get_current_profile() { echo "${PROFILE}" ; }
+
+list_profiles() {
+ local x i target
+
+ if [[ ${ROOT} != / ]] ; then
+ echo "Using binutils-config info in ${ROOT}"
+ fi
+
+ set -- "${ENV_D}"/*
+ target=
+ i=1
+
+ for x ; do
+ # skip broken links and config files
+ [[ -f ${x} ]] || continue
+ [[ ${x} == */config-* ]] && continue
+
+ source "${x}"
+ if [[ ${target} != ${TARGET} ]] ; then
+ [[ -n ${target} ]] && echo
+ target=${TARGET}
+ fi
+
+ x=${x##*/}
+ if [[ -e ${ENV_D}/config-${TARGET} ]] ; then
+ source "${ENV_D}/config-${TARGET}"
+ if [[ ${VER} == ${CURRENT} ]] ; then
+ [[ ${TARGET} == ${HOST} ]] \
+ && x="${x} ${GOOD}*${NORMAL}" \
+ || x="${x} ${HILITE}*${NORMAL}"
+ fi
+ fi
+
+ # We would align the [...] field like so:
+ #printf ' [%*ss] %s\n' ${##} "${i}" "${x}"
+ # but this breaks simple scripting: `binutils -l | awk '{print $2}'`
+
+ # Or we could align the target col like so:
+ #printf ' [%s]%*s %s\n' "${i}" $(( ${##} - ${#i} )) "" "${x}"
+ # but i'm not sold that it looks better
+
+ # So keep it simple ... only makes a diff anyways for crazy people
+ # like me which have 100+ binutils packages installed ...
+ echo " [$i] ${x}"
+ ((++i))
+ done
+}
+
+switch_linker() {
+ local bpath ld=$1
+
+ case ${ld} in
+ ld.*) ;;
+ *) die "not supported: linker must start with 'ld.'" ;;
+ esac
+
+ setup_env || return 1
+ bpath="${ROOT}/${BINPATH}"
+
+ # does this binutils even support the requested linker ?
+ if [[ ! -e ${bpath}/${ld} ]] ; then
+ die "sorry, but ${PROFILE} doesn't support the ${ld} linker"
+ fi
+
+ # switch it up
+ ebegin "Setting default linker to ${ld} for ${PROFILE}"
+ atomic_ln ${ld} "${bpath}" ld
+ eend $?
+}
+
+set_HOST() {
+ # Set HOST to CHOST if it isn't already set
+ : ${HOST:=${CHOST:-$(portageq envvar CHOST)}}
+}
+
+ENV_D="${EROOT}etc/env.d/binutils"
+
+DEBUG="no"
+NEED_ACTION="yes"
+DOIT="switch_profile"
+PROFILE="current"
+HOST=""
+TARGET=""
+unset UARG
+
+select_action() {
+ if [[ ${NEED_ACTION} != "no" ]] ; then
+ NEED_ACTION="no"
+ DOIT=$1
+ else
+ die "one action at a time!"
+ fi
+}
+
+while [[ $# -gt 0 ]] ; do
+ x=$1
+ shift
+ case ${x} in
+ -c|--get-current-profile) select_action get_current_profile ;;
+ -l|--list|--list-profiles) select_action list_profiles ;;
+ -u|--uninstall) select_action uninstall_target ;;
+ --linker) select_action "switch_linker $1"; shift ;;
+ -d|--debug) DEBUG="yes" ;;
+ -h|--help) usage 0 ;;
+ -V|--version)
+ ver="@PV@"
+ echo "binutils-config-${ver/@'PV'@/git}"
+ exit 0
+ ;;
+ -*)
+ die "invalid switch! Try '--help'."
+ ;;
+ *)
+ if [[ ${UARG+set} == "set" ]] ; then
+ die "only one profile/target at a time please"
+ fi
+ NEED_ACTION="maybe"
+ UARG=${x}
+ ;;
+ esac
+done
+
+[[ ${NEED_ACTION} == "yes" ]] && usage 1
+[[ ${DEBUG} == "yes" ]] && set -x
+
+# All operations need to know the current HOST to figure out
+# what is a native target and what is a cross target
+set_HOST
+
+# All operations need to know the profile the user wants
+case ${DOIT} in
+switch_profile|switch_linker_*)
+ # decode user's profile choice
+ x=${UARG:-$(TARGET=${HOST} set_current_profile)}
+ PROFILE=""
+ if [[ -z $(echo ${x} | tr -d '[:digit:]') ]] ; then
+ # User gave us a # representing the profile
+ i=1
+ for y in "${ENV_D}"/* ; do
+ [[ ${y/config-} != ${y} ]] && continue
+
+ if [[ -f ${y} ]] && [[ ${x} -eq ${i} ]] ; then
+ PROFILE=${y##*/}
+ break
+ fi
+ ((++i))
+ done
+ fi
+
+ if [[ -z ${PROFILE} ]] ; then
+ # User gave us a full HOST-ver
+ x=${x##*/}
+ if [[ -f ${ENV_D}/${x} ]] ; then
+ # Valid HOST-ver yeah!
+ PROFILE=${x}
+ else
+ # Not a valid HOST-ver ...
+ if [[ ! -f ${ENV_D}/config-${x} ]] ; then
+ # Maybe they just gave us a ver ...
+ if [[ -f ${ENV_D}/${HOST}-${x} ]] ; then
+ x=${HOST}-${x}
+ else
+ die "could not locate '$x' in '${ENV_D}/'!"
+ fi
+ PROFILE=${x}
+ else
+ # Maybe they just gave us a target ... pick active profile
+ PROFILE=$(TARGET=${x} set_current_profile)
+ fi
+ fi
+ fi
+ ;;
+*)
+ # lookup current profile as the user gave us a target
+ PROFILE=$(TARGET=${UARG:-${HOST}} set_current_profile) || exit 1
+ ;;
+esac
+
+eval ${DOIT}
+
+# vim:ts=4
diff --git a/sys-devel/binutils-config/files/binutils-config.8 b/sys-devel/binutils-config/files/binutils-config.8
new file mode 100644
index 000000000000..52cf7101e61a
--- /dev/null
+++ b/sys-devel/binutils-config/files/binutils-config.8
@@ -0,0 +1,73 @@
+.TH "BINUTILS-CONFIG" "8" "Jan 2005" "Gentoo" "Gentoo"
+.SH "NAME"
+binutils-config \- manage active versions of the binutils programs
+.SH "DESCRIPTION"
+The \fBbinutils-config\fR script allows you to switch between different
+versions of binutils when you have installed multiple copies (see
+USE=multislot). It also allows you to manage multiple cross-compiling
+targets simultaneously.
+
+Remember, you may have one version of binutils active per \fICTARGET\fR,
+and changing the version for one target has no bearing on any other. So
+changing an active cross-compiler will not break your native compiler
+(i.e. \fICHOST\fR).
+.SH "SYNOPSIS"
+\fBbinutils-config\fR [\fIcrufty options\fR] \fIPROFILE\fR
+
+\fBbinutils-config\fR \fB--get-current-profile\fR \fI[TARGET]\fR
+
+\fBbinutils-config\fR \fB--list-profiles\fR
+
+\fBbinutils-config\fR \fB--uninstall\fR \fITARGET\fR
+.SH "GENERIC OPTIONS"
+.TP
+\fBPROFILE\fR
+Change the system to use the specified binutils version. This may take the
+form of the list index number (the number shown on the left in the
+\fB\-\-list\-profiles\fR output), a full \fITARGET-VERSION\fR (useful when
+working with cross-compilers), just a \fITARGET\fR where the \fIVERSION\fR
+is picked from the active, or just a binutils \fIVERSION\fR where the
+\fITARGET\fR is assumed to be the native \fIHOST\fR value.
+.TP
+\fBTARGET\fR
+Similiar to \fBPROFILE\fR, but this is only the target and no version info
+(i.e. \fICTARGET\fR or \fICHOST\fR).
+.TP
+\fB\-c\fR, \fB\-\-get\-current\-profile\fR \fI[TARGET]\fR
+Display the active profile for \fITARGET\fR. If none is specified, the
+host system's \fITARGET\fR will be shown (i.e. \fICHOST\fR).
+.TP
+\fB\-l\fR, \fB\-\-list\-profiles\fR
+Show all the profiles that your system currently has installed and what
+versions are active. The active native version is noted with a bright green
+asterisk while the active cross-compiler versions are noted with a light blue
+asterisk.
+.TP
+\fB-u\fR, \fB\-\-uninstall\fR \fITARGET\fR
+This is really for internal use only. Used to remove all traces of the
+\fITARGET\fR binutils from your system.
+.SH "CRUFTY OPTIONS"
+.TP
+\fB\-\-linker\fR \fB<linker>\fR
+Change the default linker for the specified \fIPROFILE\fR to the \fB<linker>\fR.
+Common names are \fBld.gold\fR for the newer gold linker and \fBld.bfd\fR for
+the classic linker. Note that not all targets support the gold linker.
+.SH "REPORTING BUGS"
+Please report bugs via https://bugs.gentoo.org/
+.SH "SEE ALSO"
+.BR ar (1),
+.BR as (1),
+.BR ld (1),
+.BR nm (1),
+.BR objcopy (1),
+.BR ranlib (1),
+.BR readelf (1),
+.BR strings (1),
+.BR strip (1)
+.SH "FILES"
+.nf
+.BR /usr/bin/binutils-config
+.BR /etc/env.d/binutils/*
+.fi
+.SH "AUTHORS"
+Mike Frysinger <vapier@gentoo.org>
diff --git a/sys-devel/binutils-config/files/binutils.eselect b/sys-devel/binutils-config/files/binutils.eselect
new file mode 100644
index 000000000000..a89655aba145
--- /dev/null
+++ b/sys-devel/binutils-config/files/binutils.eselect
@@ -0,0 +1,45 @@
+# -*-eselect-*- vim: ft=eselect
+# Copyright 2005-2015 Gentoo Foundation
+# Distributed under the terms of the GNU GPL version 2 or later
+
+DESCRIPTION="Manage installed versions of sys-devel/binutils"
+MAINTAINER="toolchain@gentoo.org"
+
+### list action
+
+describe_list() {
+ echo "List all installed version of binutils"
+}
+
+do_list() {
+ binutils-config -l
+}
+
+### set action
+
+describe_set() {
+ echo "Activate one of the installed binutils"
+}
+
+describe_set_parameters() {
+ echo "<target>"
+}
+
+describe_set_options() {
+ echo "target : Target name or number (from 'list' action)"
+}
+
+do_set() {
+ [[ $# -eq 1 ]] || die -q "Please specify exactly one version to activate!"
+ binutils-config "$1"
+}
+
+### show action
+
+describe_show() {
+ echo "Print the currently active binutils version"
+}
+
+do_show() {
+ binutils-config -c
+}
diff --git a/sys-devel/binutils-config/metadata.xml b/sys-devel/binutils-config/metadata.xml
new file mode 100644
index 000000000000..e396f3755977
--- /dev/null
+++ b/sys-devel/binutils-config/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest
new file mode 100644
index 000000000000..9514346201a0
--- /dev/null
+++ b/sys-devel/binutils-hppa64/Manifest
@@ -0,0 +1,41 @@
+DIST binutils-2.19.1-patches-1.2.tar.bz2 10544 SHA256 128c949a46e6c516b5ebb2dbb7be553db7d8f1ee174896d1b63adbd0950030b3 SHA512 6aa2c923748d5b80f8e495176f19d8df8defcaa53915835b57a1da7c7a78668cb63d3380dd027593c8909a35de61adf2ea3d0ace64eeb537171271a6c6cbf33e WHIRLPOOL 04b26a82b2021626d4402c3275776bd9f91139082ae799350f9605bfa7e72fd3d72aac7636fbeb0e1fcdb93b6e903b396320b439502462baad06a61b0a3960e6
+DIST binutils-2.19.1.tar.bz2 16306586 SHA256 2dbd2c554b70d915c5b32fcfd401d03afcbf202529059c7a80af3993885ad1c2 SHA512 22af3cf65ad2f76469440fb992e50a10895fcec1265b98781138db0fc40bf06565af86dc73ca0b97bee764ec797439a89b5dbca2a5da74f375af55383887c436 WHIRLPOOL 340c12072a60c8f7b4b930a857e87d9723bdd2b0c61bef5a06810e11406f3e7955632a93a59c68b60220a882ff99273af3a9995872aa7a11604dd04182ebc6a2
+DIST binutils-2.20.1-patches-1.1.tar.bz2 14913 SHA256 aa92fc88cf1a96c88c010aa95ae788c3fd95300d93caf210301a5783266f9062 SHA512 e4e7c8729fb4d96ccfa79e1d3bbed8d1962fa7d512afb6a54655c86c71039e747f1c30165bcf0a8a14da5383498731c30fb361c8e0672820771082b5193e84e0 WHIRLPOOL 322896623634269cef84dcdec8bd57607d2964ce3dca58b75942ab77b290d9553ba71d9ddb9af28addb62a240810cacef0fa343eb0ceed795036480523e47867
+DIST binutils-2.20.1.tar.bz2 17591527 SHA256 71d37c96451333c5c0b84b170169fdcb138bbb27397dc06281905d9717c8ed64 SHA512 b05c93eb9ba8db344fbdee3c5b36ed5a7ad1366f948d41af43286715c7345a2477e0808d25f7bbf81b54ab06c4d46356d44318d56efcdbef42236d1a694411fc WHIRLPOOL 6166462fce695914a32c3295dadb6782716bb6693ee0a2a5543cc925e4967f5bccf38a5a2c244703bb9990acd229d0588a9463c62cec042f24107854c631518e
+DIST binutils-2.21.1-patches-1.1.tar.bz2 9197 SHA256 2dcfdec5f18a5bf391a973b080228d5b80c5bfc2939b835f95c764a319b988d7 SHA512 6a0678504766961e77dd7960d86ea19e2eb17aea8c7b09e7fc507627021fb489c9e64a13f6e9025bf028a4f5afed26e5ee3390da20236a77d5c4e189795af8aa WHIRLPOOL 330f693c9a3cbb23cc2c5ca3ee69d538b8f4debdcc8ed201af40e99f2360de47561a089b18124d238c3fec724489abee643508536a69b03b861d3d8e7a0636fa
+DIST binutils-2.21.1.tar.bz2 18997755 SHA256 cdecfa69f02aa7b05fbcdf678e33137151f361313b2f3e48aba925f64eabf654 SHA512 3f550f6833a41e9b17d1f515eea0de8dc14aefb7dd69c65b821aa1336aea4c3f55b4457a1781ab7b32bda049798fef3cf989148e4acb0fca8baca5af74766f31 WHIRLPOOL 1025ac3714f2406ee5afcda3f7a23f788a35e354b928f4b11c7448150a5613f793c2aa471f4612c5015e89d5abbb61522a7a0265286fcf2788fbf1194fb60201
+DIST binutils-2.22-patches-1.2.tar.bz2 19283 SHA256 441a490f515fd2c9a8103114b16baba65f88eb02c754ad57ec0e86f3286729c1 SHA512 02b8820eee2d1cc3d28f89100f0718f9a4c2821c176b6c47974d23b8f25124a7f6f500b4a42eda55c2846912e91c6577444fad114e0ec11f475dc52402d63136 WHIRLPOOL 3e8faf1aea87d129f4acb2d7fa8891adde296ff3e99b60123f1b4b111d96e82743ead3e57d7ed9e8bb660789c2e37ef0e3cbace61d5e636993e08260ebdcc959
+DIST binutils-2.22.tar.bz2 19973532 SHA256 6c7af8ed1c8cf9b4b9d6e6fe09a3e1d3d479fe63984ba8b9b26bf356b6313ca9 SHA512 ffe8ef263ef99183e8cc823fe8487ff7d0f7bf9a8efd2853b5f4636aca0023850d13de4eac7d77a5f69413d8a50e6f95bb14569be53df86c0bce38034525ab74 WHIRLPOOL 8bea2f2082600587649a5f9fffada9c6cf14f42ebddd1e6a4b4d7be25446d7ad76e1335cf8cefe30c812ced408c9dacb55d0033e4b0eaff83efbbfb5ea5f60dc
+DIST binutils-2.23.2-patches-1.0.tar.xz 10884 SHA256 47df1338ee285548630dabb6e414cd7ffffaf068a56ea22a185608fcbd091703 SHA512 25d52694e653dd2642eb643ef3bd48a099876515d66b0b1ed8dfa5f60cadaa1bb92a589e370528ec52add7571c0ea1a98859bfde0821c73ec0ded492fff0915c WHIRLPOOL 2aba579641a1b8e701b25c9d0094c9991e151ddd0b02fae7273ca8c9e31fd344cbf3782c5a5f9960a9bee16b41bc898c8ad0ec76ba8ee396d28e878dac47ffc7
+DIST binutils-2.23.2.tar.bz2 21440347 SHA256 fe914e56fed7a9ec2eb45274b1f2e14b0d8b4f41906a5194eac6883cfe5c1097 SHA512 dec753bbba008f1526b89cf1bd85feba78f362f5333ffdf93953fd131eb755976dec82a0a4ba38c43d2434da007137780cfe674de5414be5cf7ce7fbc6af6d16 WHIRLPOOL 1be65f03569d599899c5b57ac7aedbf90b311f9a47c1883dc62c0717b0757ebfb33e17ab3def8d0b805daabba67cf554463f88675c9f552a6fd8dbe7ca77b442
+DIST binutils-2.24-patches-1.4.tar.xz 17488 SHA256 f018f140a52cddb1e4619b5caf4b4a37a27dfb29e8bf29ea5161ab13b33eed13 SHA512 dfd7c38cd978b7d6627579c338bf67641c799ce39936e3475dca3ecf5bade417e3f090253a2326582c64d5743a24f9078794f44e8fd41b6af728f1f375c91d3b WHIRLPOOL d6b414d5e5607fd8b2d0f52b508763110448cfbdcc08be6d7c1412043797bde8ed5fbd9a5ea4c141b7394b2cae0ac2ef24827f67813231129a507f49cbc40245
+DIST binutils-2.24.tar.bz2 22716802 SHA256 e5e8c5be9664e7f7f96e0d09919110ab5ad597794f5b1809871177a0f0f14137 SHA512 5ec95ad47d49b12c4558a8db0ca2109d3ee1955e3776057f3330c4506f8f4d1cf5e505fbf8a16b98403a0fcdeaaf986fe0a22be6456247dbdace63ce1f776b12 WHIRLPOOL 619634dfdc73b8f6e9933b4642f5f9faf147c388a6d39283cd7639d83f3d7a601981cf49a787c43c17a942c563f24dc8dcc682138b5d3102a5650e1b9d15bd50
+DIST binutils-2.25.1-patches-1.1.tar.xz 18724 SHA256 3d4c0ab2d45d3a952f60246fa5a4353f057c03110130b50e3b2103bd49c345fa SHA512 209c55bf26b51d8c513b40abd2d95f687159c4e964a6c732924f277d04c97323c427fe452c63d5ec6962dcd8892d6d5d807ba88826739425bce6812a31f573dd WHIRLPOOL 2b650af352183d2b58abaee955b223606d63bd5f22a73360e79af1d3b575c5ea385f90be92348ec850534d96f7b6632b1e494f314ec1655eedc26108e849aab7
+DIST binutils-2.25.1.tar.bz2 24163561 SHA256 b5b14added7d78a8d1ca70b5cb75fef57ce2197264f4f5835326b0df22ac9f22 SHA512 0b36dda0e6d32cd25613c0e64b56b28312515c54d6a159efd3db9a86717f114ab0a0a1f69d08975084d55713ebaeab64e4085c9b3d1c3fa86712869f80eb954d WHIRLPOOL daa804331ee880296c2fe29fd9b8a52cc695629d4bbe0b9889d96ffc54d330f00fac3f3cb12b3aaf6b7505521ef499c53760912cd7c9bb54f2d5e288224bd1eb
+DIST binutils-2.26.1-patches-1.0.tar.xz 11212 SHA256 e56e2a6b64b8abe2f4aed1a9b1517fc8cbb5fd661f40118d0163d93943870e77 SHA512 c520967659c66f05f7ad795bb0bc2522e139977ab3ae8cfd9ec0d093a412a7291d1cabaa6b429c618fcf7253458a6fbe5a7dc3f62e0ac9762667308067db075c WHIRLPOOL 027b6a864134e2690d309922009740338bbd927581c6657c640d3061447f308c2e27a8c06a9202ae3f4aac4bcbf9e28303b52f81745d4062bf5b8c638cd1a9b7
+DIST binutils-2.26.1.tar.bz2 25595243 SHA256 39c346c87aa4fb14b2f786560aec1d29411b6ec34dce3fe7309fe3dd56949fd8 SHA512 9d9165609fd3b0f20d616f9891fc8e2b466eb13e2bfce40125e12427f8f201d20e2b8322bb6cb2b45e8df812f0e8ac059149f8a1f69ba3ed9d86a35c6a540b67 WHIRLPOOL c33eecdf855dd17314c3b7bbb0060399148d4dba867eb038bfb7555010fd003ba8b5b86480e4df389e19bba7b1fd0b9264291e6af20be4ffd4ff504d2255d003
+DIST binutils-2.27-patches-1.0.tar.xz 8852 SHA256 07be45786e1e56498aad2c52a43d4104ccd0ded3c6a84a930486bc418d7fa36d SHA512 489b5fff87886682d8e98eafa2f082e6dcf811d2a693b6c41d76bd1ac50815a6e7d26fb7c9e3811c2d8e0e1dc307557e6ffe46d1d0f7caeb581060cf14bda899 WHIRLPOOL cf73342292a6dd8450a420f62a6a28e1ae38eed2c0b62643619ac002f3e9233ba5a0df19deb862167e88bd2c4a7ef4e002fe4d76f971eba876014d145dc30171
+DIST binutils-2.27.tar.bz2 26099568 SHA256 369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88 SHA512 cf276f84935312361a2ca077e04d0b469d23a3aed979d8ba5d92ea590904ffb2c2e7ed12cc842822bfc402836be86f479660cef3791aa62f3753d8a1a6f564cb WHIRLPOOL d3204b4900529f697285fb1fe622ecc949c43f064e6b83a1cecb1ea8810a214842c729266c9a44537dc0a86d6d2b3ac100f54c721cc284e54f9d6feb90930d15
+DIST binutils-2.28-patches-1.1.tar.xz 14944 SHA256 a37c0cbbccdf7c7b85521f9ca429e6dd99da6a2103234fa1eaa27c34f3f1e489 SHA512 dc9e639b98ba8cc4a5a535cde116c721ef90182b339cbe802f84bed1c034e0a0bfd74b160f486bd1ef387561d967e539dbfc22e883a4cc1c44ae92b7219b9bdd WHIRLPOOL af81ec47375cd4eb2643c133755c4041a5f042d9a2fb131b58f2c35de436121d45a73f6a0061ff19241e71bf4ec167f26aa22bfead58ac34840bd787515505a0
+DIST binutils-2.28.1-patches-1.0.tar.xz 19772 SHA256 50cfce6ef7f546dcdb983a8b632507b5cdd51095e4acf1f15bfcd68027d438a4 SHA512 c2c7d22e1013e79040c4dcb4d70649e78a070976ba3a4bc2ceb4805827b9d93eea1805c85db4fcb6b31be5218c3d7b42a4990437a7c01dc01fd7e9dedb606828 WHIRLPOOL 2369fce643cc9b83724b486521621d744de0eaf3d95fdd34c7f1c785bc400f3ed31ae6105001870f33539664d84dd9caae854725e20007f136929d2ece755247
+DIST binutils-2.28.1.tar.bz2 28120394 SHA256 6924999be62d4464458eb53c11f27277cfb63755df8c1cd47b8d15d02c1942ea SHA512 5ec5212497b0fa8324f6a0884c284cb71c01942bbd39356d1ae745a5c9d97274c10f9d9c723f4bef6f0217662dfcd0c36e4e955a7599b11217658dc7b97553eb WHIRLPOOL 5c616f719827e5da7db23e89c761323cd4828b4779e79c3983d3ea429bce57ed40219982c478237b4dd728b77bae0a6447d912d96490ed1f5fc279ba5fd73bc6
+DIST binutils-2.28.tar.bz2 26556365 SHA256 6297433ee120b11b4b0a1c8f3512d7d73501753142ab9e2daa13c5a3edd32a72 SHA512 ede2e4e59a800260eea8c14eafbaee94e30abadafd5c419a3370f9f62213cf027d6400a1d4970b6958bd4d220e675dcd483a708107016e7abd5c99d7392ba8fd WHIRLPOOL 7fb876668c4fd8b10641fb8d831e7d23723ccb9b1051650c76a3a99696d37d120ef969e3c1cc144b0ffd765ef8e8698fe553c39cc65d0b9499a87d4886d6419d
+DIST binutils-2.29-patches-1.0.tar.xz 7548 SHA256 8ce4d1ea1224a305c4e36529e02dba87306075638ba0415b69ceeccedc77cd6e SHA512 5375bfb1b796b7692cf2adfc41bd2ae2e6dc19ff497db5f6beb35a456981b3adb8552ef14f32382faf655aa40da86c2d44177a658ec71e1c0e228dc27a4f2e18 WHIRLPOOL 73d2b78ea18e3427442bcb24440f671c1d35c0b559bf2141f30052b2bb8d6a8a6e29994cac741e4e50071c716d761f32b36358487a176d67e8cd226dfaaeafc2
+DIST binutils-2.29.1.tar.bz2 29123355 SHA256 1509dff41369fb70aed23682351b663b56db894034773e6dbf7d5d6071fc55cc SHA512 4063d34555526922376ccceb3f14b43e287442e82a8038cf50f4f51ad97d438c672c0e310ca4b856c9aff5aa9911073e256e8298a7a3f1844eeb60b90d955592 WHIRLPOOL 55bf62434bb00b9a355f8d7138c97b6d984eed3a83d7eb37137cf3ab8efcc8e536415d68eba375ae0ab30743f5b3014a664f7d3c773ed55da40c8814691e04d8
+DIST binutils-2.29.tar.bz2 29073316 SHA256 29a29549869039aad75fdf507ac30366da5ad0b974fbff4a8e7148dbf4f40ebf SHA512 8148587d7e4f14ebcbcb3f984b116deaae5d4008228628acde14bc242a64a4b53faf1f6077a2c4ca4750e2f254b698ba506bd657f79e1202e87e7029b0069337 WHIRLPOOL 62b3e9ff6f85f8f4a13b71361f5abc4081a70de560931dcaaece1daef04c6bc7d3e0085cbacff0abbb750c4779863d45bc0d8d17273965472992c6b61b5cab20
+EBUILD binutils-hppa64-2.19.1.ebuild 495 SHA256 b6f389a66194d2d7cf4c3e3b808227105e75a804f5a80060d835edcc87143ffd SHA512 fc93f673e80fd0898f9ac6dec30b791a2d81d9ce7fed2d0fed4d268690c94428ced548598d008b48099d9c3e0e57b02f7f71f9f9a521930a5bbfaed1f11b5e04 WHIRLPOOL 5aba1ca54b0f30b6f6c3ab8d4f6d8c7fb09e0d4da158425f8524ca8340d21afd1efd2778cd67a268b3dd03a9cb632c01a7c4d5fc10e5caf84a25324d9cb9b960
+EBUILD binutils-hppa64-2.20.1.ebuild 495 SHA256 ab1b564cc68e6d054f2ab7751e6281709d3ab1822aa0eabdb6990c43320d8090 SHA512 ded3dc12b3a5d303b42d1a780792469205691256f8f3baef23ba1e68966103972254d16b282a530f47d3424e15fba95b40c42ae89613dbee4814a81e15ec5af0 WHIRLPOOL 57bd9cf4f6ced5b3c7f8b8e8592766cc55c878b0321920b1f1fc07c7f45c6a3927a9e78690e956d24ad91c981a6751c87a172d4b7e2127d0b6586535efd12215
+EBUILD binutils-hppa64-2.21.1-r1.ebuild 496 SHA256 011ce49bd95bd825d6e7941e832ce8e3200df45093f93e42ac8950c8ee6bb61d SHA512 9b8059732236704ef644bf010597084ab8558de07247ee4a6c3433fbc22b9b83c10e3646771deadde67dd69e2e7ceade44743ad6778a27700063d4d5442037cc WHIRLPOOL 4dd4fced967545f67e567a13668ddc14b8497ba21afa18226e7b602312f65bfb50723c2cdd56770e2e7e09306f1059a1230787c4abe07631b1c4fe1423bb3fde
+EBUILD binutils-hppa64-2.22.ebuild 649 SHA256 278293144744d9c42255aab2f8d5d628cc63eb2e4e2d8f51ccdbeed090d08bf5 SHA512 a6202e09a796e499dd0708cc2c5efe4c1b3e6ec64583585a3f25cfa442fb08460a1df4c18397554994fb005e96f0e6ca9c8639e077569a50b5f39f9114a72837 WHIRLPOOL ccc066b50f8e495da9959b5ba7b7ba7930cca2fdf36b4dce56e2df4420e2c51e5b7794922171741d3ce6556a95b53d201515aa1c56a63e30d362d6927ab60b2e
+EBUILD binutils-hppa64-2.23.2.ebuild 649 SHA256 dc47ac891fc53ea562ef92cc64fe0bef46bd51bc7d7a6ab6494534623a2790f2 SHA512 61d39ccb65c6d8d701d49d7064fbe39091d8ee0f3ba4fe1fa17d817e781171ccde5a029b2806097290564a0a7be689595cb0ef3846e2d465c17b1caa24758dee WHIRLPOOL c8e39127e9a3331fde8138826427a0347241751f13b74f09808139f563bf5d8cbba4787b70454d1dbc0107c3d652826cdad01de2a331ed9e029f22a0fa1c6618
+EBUILD binutils-hppa64-2.24.ebuild 649 SHA256 1305b3444134adaa1b4ead0c2c50ad213fe696ad76a9e69e0f3f52c12b1b1927 SHA512 b5956ade9a6990e13dd86703caec158fa8fc8fd4f1e46402fa668b6886e372a459b36dae51be2d4f36a84ec386ff295345d967d8a17e92703afba3695e6d56e5 WHIRLPOOL 1e9ed3c731e78f2358c760e67fcc5ca40dca6d07b95b73c86df105a11f9a8e77e36e17d349b84e21212d697edb703a4cfd65bf60eaabaa3621083dc9786c2967
+EBUILD binutils-hppa64-2.25.1.ebuild 649 SHA256 9b7dfe8652998726346971cb01bb4da9cea4b99c789d1f669017a72cecbe9c27 SHA512 8061b215177024cd77e73cf1897a83bf353f7cff162f035ddfc983d1d2f6c1fecb3b5bc0e4275889b45e450ec98133e8d90e9dacd305c101b1cf6002090fb682 WHIRLPOOL 3b00a0d38a78e65c32043f6d3dd5b62c76d9d9199b7eeebbee361c6fe8e28dfb5c6a29d9d95ef6572bee9a7bed7804fa33be46bf743aa92bbaaf8de983a25d85
+EBUILD binutils-hppa64-2.26.1.ebuild 649 SHA256 29c3c14ceaa791c8d1906ffa6beff3b4d37391c217e3395ec4e12e1140a601c9 SHA512 8174c2a92d336ecd685eab3a2680bcadd30d7d15205b441d179ade7d3f2e87862062115a45d7ab1e7ab8fe811530f47584ca34d2a2157c09be7468386bfa5d16 WHIRLPOOL 0fde346ac1dce5f4065a582ec062115b9c465d88319a9a6b1059c41c6670e382716308719717ca96ed3b42434a4a93c9bbd59fb3ced49d40580e493a1e4d8a6a
+EBUILD binutils-hppa64-2.27.ebuild 650 SHA256 cf187228624a7a4021c2d650ecbabf6c2fdb8234babe4ef957bd354305a833dd SHA512 bb28312060d697c45df0deba91c207c57a3ff88134fbfb7a666c3e41370b57004d1e48aca42f7df15e9c2c1f745f7a699b39e0e2a134690be9e24c29e0c9d724 WHIRLPOOL 3981a57df800a0251eb3db15b7f8f4f4b2c11c687b464177013cb1465d94fcf14c4e4331052c4cd161980fc528542ccf456f1e1e950f05d205cd077c5e32b13d
+EBUILD binutils-hppa64-2.28.1.ebuild 650 SHA256 64c2c403ea825148a68589cb1b423df4ad29534ac4ce8647f4e54356d91b9387 SHA512 7786209f9e2c4e1fa40ec08b8a4ff1c89d1471a2f438a7b750cb4067b19520a1a9b9be0c46396b2e0d0b9ad4c0f2d82cbacf4e77397661b04d49da45ebac70fa WHIRLPOOL f9532769d1cf8bf5e6e2579085902e0cb64e13d73098a4f95810ee1bfa5783e0be8def2a516f4a0e5fefb3ee26d13c674a986b09d4fa9c771fbc273e3b6d8379
+EBUILD binutils-hppa64-2.28.ebuild 650 SHA256 963169d390486f81228c5238ad2de254f6e6ca77dd5d944d299e394599f31f3b SHA512 b34d1385f1c9e1d607774ef073dcef0e0ee617e5f740459eb03fd2c007c7a168a690f763cd5332865a2b0aba22de59fad8950fffcdef2c6a79ab9ffdadf1b653 WHIRLPOOL 062b4a929ae52e2ca073c4a0d721af621dd6259bea32e2d0020ecb93f3cdb5451f6de21b42b85cf99dd40af503873c3b6e7df79e94a8f3a8fb045d90e60a927b
+EBUILD binutils-hppa64-2.29.1.ebuild 676 SHA256 df835f167896b08bca3d0e1cd5522de45c34ee50262abcde63d3c1e46d34ec33 SHA512 435494d643ec9d50aa584df181a44bb386a993c78e34152d931f435fb60df9868c5c87a16cdcd24d5556056351d114375cc0d8e2d46e1d1fac9b3b81da7a3db8 WHIRLPOOL 9c328f1c58140724e8d7c34012e285c0a6a1a68f53c0cc6f1f9de544893cb867f8a311247b135cb8956e39a9546529e8d0ef98bb12b1e6f71b15512ea8d84864
+EBUILD binutils-hppa64-2.29.ebuild 650 SHA256 64c2c403ea825148a68589cb1b423df4ad29534ac4ce8647f4e54356d91b9387 SHA512 7786209f9e2c4e1fa40ec08b8a4ff1c89d1471a2f438a7b750cb4067b19520a1a9b9be0c46396b2e0d0b9ad4c0f2d82cbacf4e77397661b04d49da45ebac70fa WHIRLPOOL f9532769d1cf8bf5e6e2579085902e0cb64e13d73098a4f95810ee1bfa5783e0be8def2a516f4a0e5fefb3ee26d13c674a986b09d4fa9c771fbc273e3b6d8379
+MISC ChangeLog 4696 SHA256 e3e4e56d735b36bc7871e096e2578384cef5661b4f3dfd65c65d954736873c75 SHA512 7e92e73f38b2a6ad6d77857b17ccfcb2a144a38cc4217f8b5f051cfe90d0c4680b0f772a5ca64ffcbc928c9ca4d18be08f550adc568d3fbad9df1f024cf3833d WHIRLPOOL e2ad7ea74ab62d7f05b67cd529f3d462951ceb560feb23547bf3247ecfb9016f5c609a7605e9aa9c9d85fff9a015880b694d00549acafec40889237b1a3937bf
+MISC ChangeLog-2015 5120 SHA256 93d526aaa4ec9a126716075d42fb4d08180a834f1b7ce753d27f20b9259f0d90 SHA512 db7ff9750846298a050d1bfca47e446c5eea706fb08cb8654770c2650056c4e4927dc056adeeb070860003db048e55b7ef2e7f05dcc63140493237ede3d70dbd WHIRLPOOL fb3496272523280925a27a53d4501c105caac317e5441af0cdee65b15346d8da4e19cf1dd6eecc544d0e3e58754b32bf3e1aba8f508b6b6cba0a28800b1a4154
+MISC metadata.xml 445 SHA256 04dec1f740f7e7562e4cc44a352ce8b0cdd2d3de1b0b5c78c84363d49f7738dd SHA512 dd2ce9defb3a005665ad2f495513c40b5420629e31a336f6640ef91c9effc6f062bd338a87fe70de8a6a2993dda9e141396b602a1e2b7445f15e6f33473d29ef WHIRLPOOL 997829332c96c4602c40ab6b41511ddb0bb4b173ed421f74e167c9b1e23c167fc513336fb42a049a21387f9832c6533b863076d9d29481edd81ddcade948dc7b
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.19.1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.19.1.ebuild
new file mode 100644
index 000000000000..d30bc0ef1461
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.19.1.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.2"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* hppa"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.20.1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.20.1.ebuild
new file mode 100644
index 000000000000..d9dbc163249c
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.20.1.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.1"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* hppa"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.21.1-r1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.21.1-r1.ebuild
new file mode 100644
index 000000000000..4428c3a5c3de
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.21.1-r1.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.1"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* ~hppa"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.22.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.22.ebuild
new file mode 100644
index 000000000000..2a7bf01537f4
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.22.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.2"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.23.2.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.23.2.ebuild
new file mode 100644
index 000000000000..5297e3df26e8
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.23.2.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.0"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.24.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.24.ebuild
new file mode 100644
index 000000000000..14e21026f9ec
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.24.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.4"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.25.1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.25.1.ebuild
new file mode 100644
index 000000000000..97333d4a4874
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.25.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.1"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.26.1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.26.1.ebuild
new file mode 100644
index 000000000000..5db0e861b19e
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.26.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.0"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.27.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.27.ebuild
new file mode 100644
index 000000000000..a3bd6fbb8afc
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.27.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.0"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* ~hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.28.1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.28.1.ebuild
new file mode 100644
index 000000000000..0b42b8bf2050
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.28.1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.0"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* ~hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.28.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.28.ebuild
new file mode 100644
index 000000000000..6787e14a6c99
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.28.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.1"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* ~hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.29.1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.29.1.ebuild
new file mode 100644
index 000000000000..46b29bfae895
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.29.1.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.0"
+PATCH_BINUTILS_VER="2.29"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* ~hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.29.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.29.ebuild
new file mode 100644
index 000000000000..0b42b8bf2050
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.29.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+export CTARGET=hppa64-${CHOST#*-}
+
+PATCHVER="1.0"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+DESCRIPTION="binutils package for building 64bit kernels on HPPA"
+
+KEYWORDS="-* ~hppa"
+
+# 66_all_binutils-2.22-warn-textrel.patch fails to apply with
+# patch-2.5.9, so require a version that for sure works
+DEPEND+=" >=sys-devel/patch-2.6.1"
+
+src_install() {
+ toolchain-binutils_src_install
+
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${BVER} || die
+}
diff --git a/sys-devel/binutils-hppa64/metadata.xml b/sys-devel/binutils-hppa64/metadata.xml
new file mode 100644
index 000000000000..40dbc384a3eb
--- /dev/null
+++ b/sys-devel/binutils-hppa64/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>hppa@gentoo.org</email>
+ <name>Gentoo Linux HPPA Development</name>
+</maintainer>
+<longdescription>
+binutils for 64bit kernel on hppa.
+</longdescription>
+<use>
+ <flag name="multitarget">Adds support to binutils for cross compiling (does not work with gas)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest
new file mode 100644
index 000000000000..c00457752280
--- /dev/null
+++ b/sys-devel/binutils/Manifest
@@ -0,0 +1,22 @@
+AUX binutils-configure-LANG.patch 2082 SHA256 316f75980bfcccc306bd466d72d0e20a0ac327b8b7642fa2e3cf8d95d65f24d6 SHA512 1caf25d5e332d7de313b6be73e753fdde7b02235af564a9c06517f5874127998eeed731388617b75f54be6fec21835b78a54ce6c7162a33e25411fe3c78efee7 WHIRLPOOL 7d36d954bdac43412de2197066fe1eeb3d6d28f8756c350fe94d7fd7aab3177382dd38473a2dd02d6ddeb76c224e08733825cd07949a3760f5fe67434b8bc882
+DIST binutils-2.25.1-patches-1.1.tar.xz 18724 SHA256 3d4c0ab2d45d3a952f60246fa5a4353f057c03110130b50e3b2103bd49c345fa SHA512 209c55bf26b51d8c513b40abd2d95f687159c4e964a6c732924f277d04c97323c427fe452c63d5ec6962dcd8892d6d5d807ba88826739425bce6812a31f573dd WHIRLPOOL 2b650af352183d2b58abaee955b223606d63bd5f22a73360e79af1d3b575c5ea385f90be92348ec850534d96f7b6632b1e494f314ec1655eedc26108e849aab7
+DIST binutils-2.25.1.tar.bz2 24163561 SHA256 b5b14added7d78a8d1ca70b5cb75fef57ce2197264f4f5835326b0df22ac9f22 SHA512 0b36dda0e6d32cd25613c0e64b56b28312515c54d6a159efd3db9a86717f114ab0a0a1f69d08975084d55713ebaeab64e4085c9b3d1c3fa86712869f80eb954d WHIRLPOOL daa804331ee880296c2fe29fd9b8a52cc695629d4bbe0b9889d96ffc54d330f00fac3f3cb12b3aaf6b7505521ef499c53760912cd7c9bb54f2d5e288224bd1eb
+DIST binutils-2.26.1-patches-1.0.tar.xz 11212 SHA256 e56e2a6b64b8abe2f4aed1a9b1517fc8cbb5fd661f40118d0163d93943870e77 SHA512 c520967659c66f05f7ad795bb0bc2522e139977ab3ae8cfd9ec0d093a412a7291d1cabaa6b429c618fcf7253458a6fbe5a7dc3f62e0ac9762667308067db075c WHIRLPOOL 027b6a864134e2690d309922009740338bbd927581c6657c640d3061447f308c2e27a8c06a9202ae3f4aac4bcbf9e28303b52f81745d4062bf5b8c638cd1a9b7
+DIST binutils-2.26.1.tar.bz2 25595243 SHA256 39c346c87aa4fb14b2f786560aec1d29411b6ec34dce3fe7309fe3dd56949fd8 SHA512 9d9165609fd3b0f20d616f9891fc8e2b466eb13e2bfce40125e12427f8f201d20e2b8322bb6cb2b45e8df812f0e8ac059149f8a1f69ba3ed9d86a35c6a540b67 WHIRLPOOL c33eecdf855dd17314c3b7bbb0060399148d4dba867eb038bfb7555010fd003ba8b5b86480e4df389e19bba7b1fd0b9264291e6af20be4ffd4ff504d2255d003
+DIST binutils-2.27-patches-1.1.tar.xz 9828 SHA256 fbabb2c1cb69ad0c83d97ec6342ea663dea12b61cd3858088071f5575d842f6f SHA512 5059a784344e0554965473808b9d72af34f793e5538e82010adbbf586d583ddfd9f5ca637e6ba658e566c406244ae79b2ab5135995bcfedc8a96b9293366199d WHIRLPOOL 23c10c3c71a6d7d5f1fca97dcb77cf3bdb0a4114321a3cb51d88a4549404da63d74c30e6732c1b7fdefc3380d28b2064752155dfd22fa345e62df8df25a9690d
+DIST binutils-2.27.tar.bz2 26099568 SHA256 369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88 SHA512 cf276f84935312361a2ca077e04d0b469d23a3aed979d8ba5d92ea590904ffb2c2e7ed12cc842822bfc402836be86f479660cef3791aa62f3753d8a1a6f564cb WHIRLPOOL d3204b4900529f697285fb1fe622ecc949c43f064e6b83a1cecb1ea8810a214842c729266c9a44537dc0a86d6d2b3ac100f54c721cc284e54f9d6feb90930d15
+DIST binutils-2.28.1-patches-1.0.tar.xz 19772 SHA256 50cfce6ef7f546dcdb983a8b632507b5cdd51095e4acf1f15bfcd68027d438a4 SHA512 c2c7d22e1013e79040c4dcb4d70649e78a070976ba3a4bc2ceb4805827b9d93eea1805c85db4fcb6b31be5218c3d7b42a4990437a7c01dc01fd7e9dedb606828 WHIRLPOOL 2369fce643cc9b83724b486521621d744de0eaf3d95fdd34c7f1c785bc400f3ed31ae6105001870f33539664d84dd9caae854725e20007f136929d2ece755247
+DIST binutils-2.28.1.tar.bz2 28120394 SHA256 6924999be62d4464458eb53c11f27277cfb63755df8c1cd47b8d15d02c1942ea SHA512 5ec5212497b0fa8324f6a0884c284cb71c01942bbd39356d1ae745a5c9d97274c10f9d9c723f4bef6f0217662dfcd0c36e4e955a7599b11217658dc7b97553eb WHIRLPOOL 5c616f719827e5da7db23e89c761323cd4828b4779e79c3983d3ea429bce57ed40219982c478237b4dd728b77bae0a6447d912d96490ed1f5fc279ba5fd73bc6
+DIST binutils-2.29-patches-1.0.tar.xz 7548 SHA256 8ce4d1ea1224a305c4e36529e02dba87306075638ba0415b69ceeccedc77cd6e SHA512 5375bfb1b796b7692cf2adfc41bd2ae2e6dc19ff497db5f6beb35a456981b3adb8552ef14f32382faf655aa40da86c2d44177a658ec71e1c0e228dc27a4f2e18 WHIRLPOOL 73d2b78ea18e3427442bcb24440f671c1d35c0b559bf2141f30052b2bb8d6a8a6e29994cac741e4e50071c716d761f32b36358487a176d67e8cd226dfaaeafc2
+DIST binutils-2.29.1.tar.bz2 29123355 SHA256 1509dff41369fb70aed23682351b663b56db894034773e6dbf7d5d6071fc55cc SHA512 4063d34555526922376ccceb3f14b43e287442e82a8038cf50f4f51ad97d438c672c0e310ca4b856c9aff5aa9911073e256e8298a7a3f1844eeb60b90d955592 WHIRLPOOL 55bf62434bb00b9a355f8d7138c97b6d984eed3a83d7eb37137cf3ab8efcc8e536415d68eba375ae0ab30743f5b3014a664f7d3c773ed55da40c8814691e04d8
+DIST binutils-2.29.tar.bz2 29073316 SHA256 29a29549869039aad75fdf507ac30366da5ad0b974fbff4a8e7148dbf4f40ebf SHA512 8148587d7e4f14ebcbcb3f984b116deaae5d4008228628acde14bc242a64a4b53faf1f6077a2c4ca4750e2f254b698ba506bd657f79e1202e87e7029b0069337 WHIRLPOOL 62b3e9ff6f85f8f4a13b71361f5abc4081a70de560931dcaaece1daef04c6bc7d3e0085cbacff0abbb750c4779863d45bc0d8d17273965472992c6b61b5cab20
+EBUILD binutils-2.25.1-r1.ebuild 292 SHA256 a43f6b565a9abf4ac46cb1797362d4065fd29dbdc57e4e53c875d77a953b189f SHA512 1cfad3df5fee60fcf6276ce37d9c5fb5dce649af43491ef02f258f277d8daa64d7937dafc972336b20e945c16b0a356d97adc85e8eb1c74ab535362170dab8ba WHIRLPOOL 8a455f3678790203a2feef40f097082d8469802a752cb2c8760e072e6a3576ae6190c0881a0a0b4aa8140aa0fe7d2dcf0a481a96844321096b13e3c27aab10fb
+EBUILD binutils-2.26.1.ebuild 292 SHA256 748d43c747a69530b721cd390a90f6e4aa6ef09266355a826ee018acfa72740b SHA512 0b27ea4b0f4653b80502f0d3519be3f0cfd8644e18eb52b5a1aa8bf5ebfae3b7a8dfd8242800185cb20611be9014d625c93658f24b4561432c39a3b9e3c2d564 WHIRLPOOL 53e57958ed3a95ecb29e85ffcbf96056e3c1221b2f950364991751b4ea3d8dd68f569bad984f530d24dbde7811074550ecfffafa142af1dbb20416206b51c952
+EBUILD binutils-2.27-r1.ebuild 305 SHA256 b0b34c4aef2843fc34a6cd88f8dfd001bfb86d43d0a0a9a1ee936f11e30efde1 SHA512 a8f2a1594d97092195cb9d59b3ab7783eb777df6a175fa4361b92b4d8d415920b2e383174732f26a780dc1d4844eae1412654fb07eeeea6fb01399ad9e8ca17a WHIRLPOOL 1bd830455aa870d27ba758761075042c98edd8cd6ecabaef0ab22e74bd82f023c676255a854b65e7f873f8a3dba37f154201e9bea3e1ed4accb73726da7cfe18
+EBUILD binutils-2.28.1.ebuild 296 SHA256 cadbce3ef1ca2951b99ed95c9b9650b367a8f9b44a9400376076e50bfff252aa SHA512 3f8eeced53288d9ee9ead1f8a3807967973cf81e118162aff157702e07eb959ce2d5cbb14eb86918ed0987939d8b6a73e697e2be7f4c838987bcd61b10256182 WHIRLPOOL 31d8c431832866e37fba9a388d8fb93810779084593856bfdeccd8c352367798c52d053aed4bf069177c2a4497712b424ab324d36f8dae80e45bcf6a9eedcf2c
+EBUILD binutils-2.29.1.ebuild 331 SHA256 18f1c53b5ed455c213523587462ec5776f305a5c7f11fcec0309f4ff96ed45f0 SHA512 d51153e907bbd45db7c19545e41da485932d3d51aada2240ba84297f463e324815d1e9e5cc9a7ae307787189aa3b16ec7998f7786f59c812b66ca118f32657b7 WHIRLPOOL ed9a9b32c022f2a463e1ebfecac901a1edb84e919e24fde0644f85c7c30721967d18c6b6eed2139c78f8a2a40c9c5bab635d86e9e0848d311e6048ecae75296c
+EBUILD binutils-2.29.ebuild 305 SHA256 2d264617b186701edd47738c65fdc7da40f23d6db78dbd0e303e9e0577b4c296 SHA512 323b09cda066e602447c642b65dc4aa21656052746229081ce224d9e1ce0d2bbdf18de82534ebcc8e9f12bc1cf56dc774318d11d9b2354a9c72e1fb0cadf428a WHIRLPOOL c5644b2083747a94fa69f65d915afad4953d2f087c24dafa447c293c686cf7057e7b82ef190b21eb88ddfdba198b82ee9d1996e92f67095ccd23cb7deeacb2cf
+EBUILD binutils-9999.ebuild 145 SHA256 4a8014214eb3037cfd56de512b1cd522a218f29b55cedbd5e77a0438cea2fe54 SHA512 d3246d9ab93059b760ef2f05792e9d4910fe022eb2a8e49148481dd521b282178299f29d2529be76756704b213897ffc419c99970ce7f12d661ef60f4ec55d43 WHIRLPOOL 02f7a68a1e2442511f6b1c631eca53bcb32ffc4649b146c43cfbfa5d5313a18416d88360702dc76f4e840100f301e30022267423a7b175308c1446f3c81ff341
+MISC ChangeLog 6196 SHA256 5174ebc8f6a4f0e961c20111b1acaacb7df3b4cf8829128a8dccb1a524769871 SHA512 c43677b6e48405577f1439262d92546c10e798b4068d82c98bafef05b5f38d98c5a76b1c9eb8334ee1448ef23302c6738f4c3f1079af2e93e6991a8de5753a90 WHIRLPOOL abdc7cae810b7a59e4b0f73890ca56800f8b8873e756face845fa450e2452ebf03e47dad6753d11ebd23f0a7cf34cba45e8e4e9922af86178ce97bccee8b031f
+MISC ChangeLog-2015 86934 SHA256 b5091cb7a03ce5eb673b017c8ebe45ffdd05589017b0d032b8ef5e0a7f294e30 SHA512 f14a5a3e066373ac212f9da4f687543dcf83d474fe589911b4f64b2fcf3a92ba67b9e0310947ea9b814008cd0ca94956a277b1dcd3e0f3c783df39dae3a4ae82 WHIRLPOOL f4ae6afd88ca200e3d2785a8d4277c636b44b8182525224d47270b5b7856ed5065c71f25ab5efa0fbe3025674ba24799fc686506a9c4b1099e139a87b3ec1c0e
+MISC metadata.xml 447 SHA256 28a93b925d6b8a5a92cdca3b68739de43c38f26d1103c3b93583db3eea4a2389 SHA512 73cb18db3a677767a78d5cab44ca721083ef17b4a158c10a66a186835b57a3d763b6f6753c836620b32ec912834ae8da2148c8fa0e4932170956b92c75169a9d WHIRLPOOL e36c9ed9120bafee38e36adc8517af6ab4f60c7946eb7275692984213912845770fe15fe13f38bb9ca3483513483a858a8a440ade107c1faa1ac1667ad554403
diff --git a/sys-devel/binutils/binutils-2.25.1-r1.ebuild b/sys-devel/binutils/binutils-2.25.1-r1.ebuild
new file mode 100644
index 000000000000..dff9b0c9a2ef
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.25.1-r1.ebuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+PATCHVER="1.1"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd"
diff --git a/sys-devel/binutils/binutils-2.26.1.ebuild b/sys-devel/binutils/binutils-2.26.1.ebuild
new file mode 100644
index 000000000000..63894d4eb470
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.26.1.ebuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.0"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd"
diff --git a/sys-devel/binutils/binutils-2.27-r1.ebuild b/sys-devel/binutils/binutils-2.27-r1.ebuild
new file mode 100644
index 000000000000..441d4d8408e6
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.27-r1.ebuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.1"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd"
diff --git a/sys-devel/binutils/binutils-2.28.1.ebuild b/sys-devel/binutils/binutils-2.28.1.ebuild
new file mode 100644
index 000000000000..d57f8f8e717e
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.28.1.ebuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.0"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd"
diff --git a/sys-devel/binutils/binutils-2.29.1.ebuild b/sys-devel/binutils/binutils-2.29.1.ebuild
new file mode 100644
index 000000000000..518550da5712
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.29.1.ebuild
@@ -0,0 +1,11 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.0"
+PATCH_BINUTILS_VER="2.29"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd"
diff --git a/sys-devel/binutils/binutils-2.29.ebuild b/sys-devel/binutils/binutils-2.29.ebuild
new file mode 100644
index 000000000000..6fafa8ee88a9
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.29.ebuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCHVER="1.0"
+ELF2FLT_VER=""
+inherit toolchain-binutils
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd -sparc-fbsd ~x86-fbsd"
diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild
new file mode 100644
index 000000000000..cf90a61b1d4c
--- /dev/null
+++ b/sys-devel/binutils/binutils-9999.ebuild
@@ -0,0 +1,6 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit toolchain-binutils
diff --git a/sys-devel/binutils/files/binutils-configure-LANG.patch b/sys-devel/binutils/files/binutils-configure-LANG.patch
new file mode 100644
index 000000000000..5521d196cf4a
--- /dev/null
+++ b/sys-devel/binutils/files/binutils-configure-LANG.patch
@@ -0,0 +1,65 @@
+The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
+option parsing, it may break.
+
+http://bugs.gentoo.org/103483
+http://bugs.gentoo.org/122216
+
+--- configure
++++ configure
+@@ -54,6 +54,19 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ unset $as_var
++ fi
++done
++
+ # Initialize some other variables.
+ subdirs=
+ MFLAGS= MAKEFLAGS=
+@@ -452,16 +463,6 @@
+ esac
+ done
+
+-# NLS nuisances.
+-# Only set these to C if already set. These must not be set unconditionally
+-# because not all systems understand e.g. LANG=C (notably SCO).
+-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+-# Non-C LC_CTYPE values break the ctype check.
+-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+-
+ # confdefs.h avoids OS command line length limits that DEFS can exceed.
+ rm -rf conftest* confdefs.h
+ # AIX cpp loses on an empty file, so make sure it contains at least a newline.
+@@ -1850,6 +1850,19 @@
+ # Compiler output produced by configure, useful for debugging
+ # configure, is in ./config.log if it exists.
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
++ eval \$as_var=C; export \$as_var
++ else
++ unset \$as_var
++ fi
++done
++
+ ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+ for ac_option
+ do
diff --git a/sys-devel/binutils/metadata.xml b/sys-devel/binutils/metadata.xml
new file mode 100644
index 000000000000..3b4e0782a80b
--- /dev/null
+++ b/sys-devel/binutils/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+<email>toolchain@gentoo.org</email>
+<name>Gentoo Toolchain Project</name>
+</maintainer>
+<use>
+<flag name="multitarget">Adds support to binutils for cross compiling (does not work with gas)</flag>
+</use>
+<upstream>
+<remote-id type="cpe">cpe:/a:gnu:binutils</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-devel/bison/Manifest b/sys-devel/bison/Manifest
new file mode 100644
index 000000000000..71a6c264bffb
--- /dev/null
+++ b/sys-devel/bison/Manifest
@@ -0,0 +1,15 @@
+AUX bison-1.32-extfix.patch 1170 SHA256 a47285e1b6f1ee53b8def53380068ad6a86ccd09e3338481f6d3d14c7e8b31c4 SHA512 6f98d6ea4d6564c3890ede54994654af87d79a87e615e03856a71f3470876fe42768deeabe31f9393531a35619a7e00844ff2a3d87214754cfd04a25d591cc57 WHIRLPOOL 800744be43d9dc39ba4c7cba4342ee5c2360cf9792c0ff5971da91fe78df85358ac1b7cab5c32244898b69ced352ce159685daa80cf32317db4ab92610b2153d
+AUX bison-2.4.3-no-gets.patch 780 SHA256 aae4bb53fa827685a1005b48b3149cb96b83feb43ba104d5da6ef223676cef70 SHA512 cf7d60c143bf27a546c6fa04f08b58b0c297996f25fe28e85863795f51040772a85316ca1464204a84630322df16893d636331b7e4953f6c1718d680a5bc827b WHIRLPOOL 4415b7eebe6df47638df1c7f5c864a4296af0eddc18d56ccc24f926db48fb78699d3a864d08648867f06cfea88a3fc745bbd87865469c559f96b2b199cf24a75
+AUX bison-2.4.3-uclibc-sched_param-def.patch 580 SHA256 b111051eaaa15ce6e53ae168d06e0fb9688c70141060abfe0a15c5d1400fbaf9 SHA512 87a49e69aec0b36313132fc7a9fb520016e4dc4399a9af9a91636a588326825de3a65dd6bcdda8de20e364ec163afcb41b0453f09ce4102d179ce04279c8654d WHIRLPOOL 5f0d690078d004231d31adcbdea98c3f3059c60265595ac46cbb0d4e45638ae9e54c9ee08040842d278a4ddadd5744a6bce19753475978cf7360ce8bf2be9d7b
+AUX bison-3.0.4-optional-perl.patch 21963 SHA256 9fc611ebc3714aa9d517909f1ca49ada6786569e1a816cb2a71991f122033dbb SHA512 d118dcf8a104edf5d81b7f96254b15f6fef1332c7957c5cc3a484d3295436afa166c249acf4fa8834c5f194daa3fbfae79c0168b0fa980a4cb8de537c5b3e3cf WHIRLPOOL 3207d2396ef2dbcb5eb0a283a45cc64e84f79443921260008de783693e84894a877ec1f073aebcb19586ce76eeffab5498a57441c4b5266b06ee680317b0d46b
+DIST bison-1.875d.tar.bz2 882745 SHA256 37ff8d673e35838c195d614bc402573d1268c997796e79b831053f4a22e03808 SHA512 f84c6cf41a289ea7e0805cf9b0da6fe2d77f2e03a35c3db7d2e36e5186bba7c0853c3d518bd89f6cfa1030e346e046aa03b33974bb892dbd8f040e5ea2de1126 WHIRLPOOL 213e02b33b4cd65c4c8ad5a37b77cce75a366e1d5ad0837887763c75c5e30eb3d85b7ba8eb71ed86bb86fb3e23624a7c627558f492778ec29e6e79fd30e7c902
+DIST bison-2.4.3.tar.bz2 1652612 SHA256 935302ef194c7f0974fed913eaac8100be512094eab573cf0b67bdf7db1d3a05 SHA512 b789f55d9cb95c1b4fba004691ed9f79b76da55020c9b202e1704a02aab1ba43b9fc1015e29843ed552e6df6165cef9c6ebc8a29d15a21c6e194cad8a42ab055 WHIRLPOOL 0e0e61970a791e53afc6cc85f53cebf0050d885077dd9b2394d79549bac389ffa7e477e003525556858b6fa64c11ce93653bba1c861bd2acd67f85181e167558
+DIST bison-2.7.1.tar.xz 1781068 SHA256 b409adcbf245baadb68d2f66accf6fdca5e282cafec1b865f4b5e963ba8ea7fb SHA512 ac0c7ca57142bcb84af498f606acb86091984a00359294fbf721a4ca8112f9fcf26497f7dd2e65f527e04a6e1de94142ecb76602d407e548475970e5a566d370 WHIRLPOOL 171f6b18c3f205d746092bdd37bf113ab83944db468f81cbf5004573584c717b6fc1a10d112fe7178be222b51b746fed9da58a9065b7f2f7e65a15851500779e
+DIST bison-3.0.4.tar.xz 1973796 SHA256 a72428c7917bdf9fa93cb8181c971b6e22834125848cf1d03ce10b1bb0716fe1 SHA512 bbdc23e7772e49da1c7c47e66d4e4efbfbfe9b21dbc59bf3ad9a6e573eecac6c9f52c7f11a64be9897e8deb99ef7ba015164aa8232aa391b901dd7db03632412 WHIRLPOOL 41da7b0aa18bf61f621d59d372dc2ca9e116f6fa0d5c8891b51a01dda6d9393005c76773dbefbadeb30884bb328379197d2026809d62d49d8e2022b9b49da244
+EBUILD bison-1.875d.ebuild 1678 SHA256 a66818b08b6671d95c7acdf9e5f59f5899eae006831c820b6f6f6f62d201cdc6 SHA512 5990adcb955692a75ef33de6b2699cd4d4577ffb002886ce09f6eafcb45cff25da5ef3e3e0940b0e3b160314cccf3ceb750883a448874cab0c58283a724591fd WHIRLPOOL 44d6569fc6015fafca8cf1e88b45776085b80e6f5beeeb9024a1008c4f414ec9d3fe19e38d8eb8b70fb5aa9e6476631ccd791c2a0fcd91c26030585d67b4a988
+EBUILD bison-2.4.3.ebuild 1132 SHA256 868cd13f372b13570d13a0ade679ef182d415cf13f9e5568f11587b7568acb36 SHA512 c51aa2d4be14a3b1cff50a751ae842c80f1e8d7d1959e99e58f56ee66506628a5acce5a320273b66bcd32fc6ed559e9cb1141c010fc2279222b0b89ee9963fad WHIRLPOOL bcb365cee05343327c3ed423e80d0107a54e5af67093275b84e2f5ac3ec98b9f12baa27f124dbb8a55db4d68d6e841add281192673558ea0d4bb7cbbf21a3e50
+EBUILD bison-2.7.1.ebuild 1653 SHA256 466600836e5266c4dedf385d3234ac2d4454507da06a2fba027cffd6b3b60681 SHA512 44a30f63ea6f1fb40eea64932c1aa1abf1dc84523fb3e9cdba9d57ee47f3ca986a45684f5849e471964096e1454ba431fdddc06509a5a4db34f95afc9c9c65b6 WHIRLPOOL 44ef3807ae1ac876f4203c5010b1823a764cdb92b3e96d36ce68c83b3c6378a5dfac45f374a141bebe59c5127a6ffe17b799a37990bae5f4f0ffddd844f8f33c
+EBUILD bison-3.0.4-r1.ebuild 2141 SHA256 fc67bf4486a790b0a11ca1673550c640a2c668eab2cea126c3be83b0faffec2d SHA512 c647e4bf58c04f014734812308ceaae9882ea435f757988951c93c3e10a874cf92dc06bb1c9a6a3a4b3bc613dd02fc36d4cc7dba45b80a3fa85dc0c60d17cd93 WHIRLPOOL c67fcdba28876a99a79c63cc23ddc48127d2da3e3df11bbccd1d163bbf89a81cde536d134b1d213faef3e65375d1d5381ec3719a350945d8d4a9ad2e8aad16b6
+MISC ChangeLog 7389 SHA256 78612d9f0bce63cbcd090179ea5608bacc2bc8bd041dc0486613cd9421725fc8 SHA512 2350932496a8ff0865dd37186fbfdf2200f96e1bf92905af9b95cdb60c62ffb8a5c29bfab2c039cfb442255e0056826f6b8a84f0ff0ced75c0870e5331020e89 WHIRLPOOL e8963ba97de2be11aae62a3fad736598e8ee1593231c07ded7dfa4797ea2b0858a134dd639f94e88a18f272cebe0e497814bced2e21cac2d04837856d83b73a8
+MISC ChangeLog-2015 18504 SHA256 4b44263ef1e0376eb0eeac6c870eeea6edc802ceaf8a7fdaca666243421826f2 SHA512 30f97a294909375d34890968330bf433eea7a160468c2b4281925d4d3697b5acb5616fd7398cc4b14652f68c3c1889ba2fb2605dbd931112ad1dc0aaf37c25d6 WHIRLPOOL c45485beb8745ba15fd261d9c25e548c9a2c1fe129e4e1614c59291d1b859a30221dadc1efb042220a47eb662ed75a3f9bd208e4fe8628178eceec595536c433
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/bison/bison-1.875d.ebuild b/sys-devel/bison/bison-1.875d.ebuild
new file mode 100644
index 000000000000..522e7d85706a
--- /dev/null
+++ b/sys-devel/bison/bison-1.875d.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="A yacc-compatible parser generator"
+HOMEPAGE="https://www.gnu.org/software/bison/bison.html"
+SRC_URI="ftp://alpha.gnu.org/pub/gnu/bison/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+IUSE="nls static"
+
+DEPEND="sys-devel/m4
+ nls? ( sys-devel/gettext )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-1.32-extfix.patch
+}
+
+src_compile() {
+ # Bug 39842 says that bison segfaults when built on amd64 with
+ # optimizations. This will probably be fixed in a future gcc
+ # version, but for the moment just disable optimizations for that
+ # arch (04 Feb 2004 agriffis)
+ [ "$ARCH" == "amd64" ] && append-flags -O0
+
+ # Bug 29017 says that bison has compile-time issues with
+ # -march=k6* prior to 3.4CVS. Use -march=i586 instead
+ # (04 Feb 2004 agriffis)
+ #
+ if (( $(gcc-major-version) == 3 && $(gcc-minor-version) < 4 )) ; then
+ replace-cpu-flags k6 k6-1 k6-2 i586
+ fi
+
+ econf $(use_enable nls) || die
+ use static && append-ldflags -static
+ emake || die
+}
+
+src_install() {
+ make DESTDIR="${D}" \
+ datadir=/usr/share \
+ mandir=/usr/share/man \
+ infodir=/usr/share/info \
+ install || die
+
+ # This one is installed by dev-util/yacc
+ mv "${D}"/usr/bin/yacc "${D}"/usr/bin/yacc.bison || die
+
+ # We do not need this.
+ rm -f "${D}"/usr/lib/liby.a
+
+ dodoc AUTHORS NEWS ChangeLog README REFERENCES OChangeLog doc/FAQ
+}
+
+pkg_postinst() {
+ if [[ ! -e ${ROOT}/usr/bin/yacc ]] ; then
+ ln -s yacc.bison "${ROOT}"/usr/bin/yacc
+ fi
+}
diff --git a/sys-devel/bison/bison-2.4.3.ebuild b/sys-devel/bison/bison-2.4.3.ebuild
new file mode 100644
index 000000000000..fde4389df171
--- /dev/null
+++ b/sys-devel/bison/bison-2.4.3.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="A yacc-compatible parser generator"
+HOMEPAGE="https://www.gnu.org/software/bison/bison.html"
+SRC_URI="mirror://gnu/bison/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="nls static"
+
+RDEPEND="sys-devel/m4"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-uclibc-sched_param-def.patch
+ epatch "${FILESDIR}"/${P}-no-gets.patch
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ econf $(use_enable nls)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+
+ # This one is installed by dev-util/yacc
+ mv "${D}"/usr/bin/yacc{,.bison} || die
+ mv "${D}"/usr/share/man/man1/yacc{,.bison}.1 || die
+
+ # We do not need this.
+ rm -r "${D}"/usr/lib* || die
+
+ dodoc AUTHORS NEWS ChangeLog README OChangeLog THANKS TODO
+}
+
+pkg_postinst() {
+ if [[ ! -e ${ROOT}/usr/bin/yacc ]] ; then
+ ln -s yacc.bison "${ROOT}"/usr/bin/yacc
+ fi
+}
diff --git a/sys-devel/bison/bison-2.7.1.ebuild b/sys-devel/bison/bison-2.7.1.ebuild
new file mode 100644
index 000000000000..ab38be965319
--- /dev/null
+++ b/sys-devel/bison/bison-2.7.1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit flag-o-matic
+
+DESCRIPTION="A general-purpose (yacc-compatible) parser generator"
+HOMEPAGE="https://www.gnu.org/software/bison/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls static test"
+
+RDEPEND=">=sys-devel/m4-1.4.16"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ nls? ( sys-devel/gettext )
+ test? ( dev-lang/perl )"
+
+DOCS="AUTHORS ChangeLog-2012 NEWS README THANKS TODO" # ChangeLog-1998 PACKAGING README-alpha README-release
+
+src_configure() {
+ use static && append-ldflags -static
+
+ # We don't need perl unless we run tests.
+ use test || export ac_cv_path_PERL=true
+ econf \
+ $(use_enable nls)
+}
+
+src_install() {
+ default
+
+ # This one is installed by dev-util/yacc
+ mv "${ED}"/usr/bin/yacc{,.bison} || die
+ mv "${ED}"/usr/share/man/man1/yacc{,.bison}.1 || die
+
+ # We do not need liby.a
+ rm -r "${ED}"/usr/lib* || die
+
+ # Move to documentation directory and leave compressing for EAPI>=4
+ mv "${ED}"/usr/share/${PN}/README "${ED}"/usr/share/doc/${PF}/README.data
+}
+
+pkg_postinst() {
+ local f="${EROOT}/usr/bin/yacc"
+ if [[ ! -e ${f} ]] ; then
+ ln -s yacc.bison "${f}"
+ fi
+}
+
+pkg_postrm() {
+ # clean up the dead symlink when we get unmerged #377469
+ local f="${EROOT}/usr/bin/yacc"
+ if [[ -L ${f} && ! -e ${f} ]] ; then
+ rm -f "${f}"
+ fi
+}
diff --git a/sys-devel/bison/bison-3.0.4-r1.ebuild b/sys-devel/bison/bison-3.0.4-r1.ebuild
new file mode 100644
index 000000000000..c20e7436f012
--- /dev/null
+++ b/sys-devel/bison/bison-3.0.4-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="A general-purpose (yacc-compatible) parser generator"
+HOMEPAGE="https://www.gnu.org/software/bison/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples nls static test"
+
+RDEPEND=">=sys-devel/m4-1.4.16"
+DEPEND="${RDEPEND}
+ sys-devel/flex
+ examples? ( dev-lang/perl )
+ nls? ( sys-devel/gettext )
+ test? ( dev-lang/perl )"
+
+DOCS=( AUTHORS ChangeLog-2012 NEWS README THANKS TODO ) # ChangeLog-1998 PACKAGING README-alpha README-release
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-optional-perl.patch #538300
+ # The makefiles make the man page depend on the configure script
+ # which we patched above. Touch it to prevent regeneration.
+ touch doc/bison.1 #548778 #538300#9
+ # Avoid regenerating the info page when the timezone is diff. #574492
+ sed -i '2iexport TZ=UTC' build-aux/mdate-sh || die
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ # We don't need perl unless we run tests.
+ use test || export ac_cv_path_PERL=true
+ econf \
+ --docdir='$(datarootdir)'/doc/${PF} \
+ $(use_enable examples) \
+ $(use_enable nls)
+}
+
+src_install() {
+ default
+
+ # This one is installed by dev-util/yacc
+ mv "${ED}"/usr/bin/yacc{,.bison} || die
+ mv "${ED}"/usr/share/man/man1/yacc{,.bison}.1 || die
+
+ # We do not need liby.a
+ rm -r "${ED}"/usr/lib* || die
+
+ # Move to documentation directory and leave compressing for EAPI>=4
+ mv "${ED}"/usr/share/${PN}/README "${ED}"/usr/share/doc/${PF}/README.data
+}
+
+pkg_postinst() {
+ local f="${EROOT}/usr/bin/yacc"
+ if [[ ! -e ${f} ]] ; then
+ ln -s yacc.bison "${f}"
+ fi
+}
+
+pkg_postrm() {
+ # clean up the dead symlink when we get unmerged #377469
+ local f="${EROOT}/usr/bin/yacc"
+ if [[ -L ${f} && ! -e ${f} ]] ; then
+ rm -f "${f}"
+ fi
+}
diff --git a/sys-devel/bison/files/bison-1.32-extfix.patch b/sys-devel/bison/files/bison-1.32-extfix.patch
new file mode 100644
index 000000000000..363d038d8a52
--- /dev/null
+++ b/sys-devel/bison/files/bison-1.32-extfix.patch
@@ -0,0 +1,28 @@
+2002-02-15 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com>
+
+ * src/files (compute_exts_from_gf, compute_exts_from_src): Handle
+ the case where header_extension is the same as src_extension, aka
+ handle -d -o <file> where <file> doesn't have a known EXT to
+ transform. e.g. if <file> is <something>.yxx, set the
+ header_extension to <something>.yxx.h, as would do bison 1.28.
+
+--- bison-1.32/src/files.c.extfix Mon Jan 21 16:41:46 2002
++++ bison-1.32/src/files.c Fri Feb 15 15:40:43 2002
+@@ -288,6 +288,8 @@ compute_exts_from_gf (const char *ext)
+ src_extension = tr (src_extension, 'Y', 'C');
+ header_extension = tr (ext, 'y', 'h');
+ header_extension = tr (header_extension, 'Y', 'H');
++ if (!strcmp (header_extension, src_extension))
++ header_extension = concat2 (src_extension, ".h");
+ }
+
+ /* Computes extensions from the given c source file extension. */
+@@ -300,6 +302,8 @@ compute_exts_from_src (const char *ext)
+ src_extension = xstrdup (ext);
+ header_extension = tr (ext, 'c', 'h');
+ header_extension = tr (header_extension, 'C', 'H');
++ if (!strcmp (header_extension, src_extension))
++ header_extension = concat2 (src_extension, ".h");
+ }
+
+
diff --git a/sys-devel/bison/files/bison-2.4.3-no-gets.patch b/sys-devel/bison/files/bison-2.4.3-no-gets.patch
new file mode 100644
index 000000000000..a49a816f4761
--- /dev/null
+++ b/sys-devel/bison/files/bison-2.4.3-no-gets.patch
@@ -0,0 +1,22 @@
+hack until bizon pulls a newer gnulib version
+
+From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Thu, 29 Mar 2012 13:30:41 -0600
+Subject: [PATCH] stdio: don't assume gets any more
+
+Gnulib intentionally does not have a gets module, and now that C11
+and glibc have dropped it, we should be more proactive about warning
+any user on a platform that still has a declaration of this dangerous
+interface.
+
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -125,7 +125,6 @@
+ so any use of gets warrants an unconditional warning. Assume it is
+ always declared, since it is required by C89. */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/sys-devel/bison/files/bison-2.4.3-uclibc-sched_param-def.patch b/sys-devel/bison/files/bison-2.4.3-uclibc-sched_param-def.patch
new file mode 100644
index 000000000000..50652d8babc2
--- /dev/null
+++ b/sys-devel/bison/files/bison-2.4.3-uclibc-sched_param-def.patch
@@ -0,0 +1,19 @@
+uclibc defines __GLIBC__ but it does not expose struct shed_param as much as glibc
+and is not needed too per standard. gnulib attempts to use it but we have to account
+for it because in this case uclibc does not behave like glibc.
+
+-Khem
+
+http://bugs.gentoo.org/336484
+
+--- m4-1.4.14/lib/spawn.in.h
++++ m4-1.4.14/lib/spawn.in.h
+@@ -31,7 +31,7 @@
+
+ /* Get definitions of 'struct sched_param' and 'sigset_t'.
+ But avoid namespace pollution on glibc systems. */
+-#ifndef __GLIBC__
++#if !defined __GLIBC__ || defined __UCLIBC__
+ # include <sched.h>
+ # include <signal.h>
+ #endif
diff --git a/sys-devel/bison/files/bison-3.0.4-optional-perl.patch b/sys-devel/bison/files/bison-3.0.4-optional-perl.patch
new file mode 100644
index 000000000000..ba0bf7b2d5b3
--- /dev/null
+++ b/sys-devel/bison/files/bison-3.0.4-optional-perl.patch
@@ -0,0 +1,500 @@
+https://bugs.gentoo.org/538300
+
+From 3da25ddd011c169b9857ed2f6a2e82988f059ba5 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 3 Apr 2015 02:39:21 -0400
+Subject: [PATCH] make perl & examples optional
+
+The normal bison program does not require perl to build or run, so lets
+soften that requirement in the configure script. We now warn if its not
+found, and we make the examples logic depend on that.
+
+* configure.ac: Change AC_MSG_ERROR to AC_MSG_WARN for perl.
+Add an --enable-examples flag.
+* Makefile.am: Only include examples/local.mk when ENABLE_EXAMPLES.
+---
+ Makefile.am | 2 ++
+ configure.ac | 21 ++++++++++++++++++++-
+ 2 files changed, 22 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index b6135cb..50ea0a0 100644
+#--- a/Makefile.am
+#+++ b/Makefile.am
+@@ -59,7 +59,9 @@ include data/local.mk
+ include djgpp/local.mk
+ include doc/local.mk
+ include etc/local.mk
++if ENABLE_EXAMPLES
+ include examples/local.mk
++endif
+ include lib/local.mk
+ include src/local.mk
+ include tests/local.mk
+diff --git a/configure.ac b/configure.ac
+index 6f20040..e67249b 100644
+#--- a/configure.ac
+#+++ b/configure.ac
+@@ -179,12 +179,31 @@ AC_DEFINE_UNQUOTED([M4_GNU_OPTION], ["$M4_GNU"], [Define to "-g" if GNU M4
+ supports -g, otherwise to "".])
+ AC_PATH_PROG([PERL], [perl])
+ if test -z "$PERL"; then
+- AC_MSG_ERROR([perl not found])
++ AC_MSG_WARN([perl required for the testsuites])
+ fi
+ AM_MISSING_PROG([HELP2MAN], [help2man])
+ AC_PATH_PROG([XSLTPROC], [xsltproc])
+ AC_SUBST([XSLTPROC])
+
++AC_ARG_ENABLE([examples],
++ [AC_HELP_STRING([--disable-examples],
++ [do not build and install examples])])
++# Enable the examles by default if perl is available.
++case $enable_examples in
++no) ;;
++yes)
++ if test -z "$PERL"; then
++ AC_MSG_ERROR([perl required for the examples])
++ fi
++ ;;
++*)
++ if test -n "$PERL"; then
++ enable_examples=yes
++ fi
++ ;;
++esac
++AM_CONDITIONAL([ENABLE_EXAMPLES], [test "xenable_examples" = xyes])
++
+ # Checks for header files.
+ AC_CHECK_HEADERS_ONCE([locale.h])
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -248,13 +248,29 @@
+ POST_UNINSTALL = :
+ build_triplet = @build@
+ host_triplet = @host@
+-check_PROGRAMS = $(am__EXEEXT_1) examples/mfcalc/mfcalc$(EXEEXT) \
+- examples/rpcalc/rpcalc$(EXEEXT)
++check_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
+ @CROSS_COMPILING_FALSE@am__append_1 = $(top_srcdir)/doc/bison.help
+-@FLEX_CXX_WORKS_TRUE@am__append_2 = examples/calc++/calc++
+-@FLEX_CXX_WORKS_TRUE@am__append_3 = examples/calc++/calc++.test
+-@FLEX_CXX_WORKS_FALSE@am__append_4 = examples/calc++/calc++.test
+-@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__append_5 = lib/uniwidth/width.c
++@ENABLE_EXAMPLES_TRUE@am__append_2 = $(extracted) \
++@ENABLE_EXAMPLES_TRUE@ examples/extracted.stamp \
++@ENABLE_EXAMPLES_TRUE@ $(calcxx_sources_generated) \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-parser.output \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-parser.stamp \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-scanner.cc \
++@ENABLE_EXAMPLES_TRUE@ examples/mfcalc/mfcalc.[ch] \
++@ENABLE_EXAMPLES_TRUE@ examples/mfcalc/mfcalc.output \
++@ENABLE_EXAMPLES_TRUE@ examples/rpcalc/rpcalc.[ch] \
++@ENABLE_EXAMPLES_TRUE@ examples/rpcalc/rpcalc.output
++@ENABLE_EXAMPLES_TRUE@am__append_3 = .yy .stamp
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@am__append_4 = examples/calc++/calc++
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@am__append_5 = examples/calc++/calc++.test
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_FALSE@am__append_6 = examples/calc++/calc++.test
++@ENABLE_EXAMPLES_TRUE@am__append_7 = $(mfcalc_sources) \
++@ENABLE_EXAMPLES_TRUE@ $(rpcalc_sources)
++@ENABLE_EXAMPLES_TRUE@am__append_8 = examples/mfcalc/mfcalc \
++@ENABLE_EXAMPLES_TRUE@ examples/rpcalc/rpcalc
++@ENABLE_EXAMPLES_TRUE@am__append_9 = examples/mfcalc/mfcalc.test \
++@ENABLE_EXAMPLES_TRUE@ examples/rpcalc/rpcalc.test
++@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__append_10 = lib/uniwidth/width.c
+ bin_PROGRAMS = src/bison$(EXEEXT)
+ subdir = .
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+@@ -356,7 +372,7 @@
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+- $(am__configure_deps) $(dist_noinst_SCRIPTS) \
++ $(am__configure_deps) $(am__dist_noinst_SCRIPTS_DIST) \
+ $(srcdir)/doc/version.texi $(srcdir)/doc/stamp-vti \
+ $(dist_doc_DATA) $(dist_m4sugar_DATA) $(dist_pkgdata_DATA) \
+ $(dist_xslt_DATA) $(am__DIST_COMMON)
+@@ -473,15 +489,18 @@
+ @ENABLE_YACC_TRUE@am_lib_liby_a_OBJECTS = lib/main.$(OBJEXT) \
+ @ENABLE_YACC_TRUE@ lib/yyerror.$(OBJEXT)
+ lib_liby_a_OBJECTS = $(am_lib_liby_a_OBJECTS)
+-@FLEX_CXX_WORKS_TRUE@am__EXEEXT_1 = examples/calc++/calc++$(EXEEXT)
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@am__EXEEXT_1 = examples/calc++/calc++$(EXEEXT)
++@ENABLE_EXAMPLES_TRUE@am__EXEEXT_2 = examples/mfcalc/mfcalc$(EXEEXT) \
++@ENABLE_EXAMPLES_TRUE@ examples/rpcalc/rpcalc$(EXEEXT)
+ PROGRAMS = $(bin_PROGRAMS)
+-am__objects_2 = examples/calc++/examples_calc___calc__-calc++-driver.$(OBJEXT) \
+- examples/calc++/examples_calc___calc__-calc++-scanner.$(OBJEXT) \
+- examples/calc++/examples_calc___calc__-calc++.$(OBJEXT)
+-am__objects_3 = examples/calc++/examples_calc___calc__-calc++-parser.$(OBJEXT)
+-am__objects_4 = $(am__objects_2) $(am__objects_3)
+-@FLEX_CXX_WORKS_TRUE@nodist_examples_calc___calc___OBJECTS = \
+-@FLEX_CXX_WORKS_TRUE@ $(am__objects_4)
++@ENABLE_EXAMPLES_TRUE@am__objects_2 = examples/calc++/examples_calc___calc__-calc++-driver.$(OBJEXT) \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/examples_calc___calc__-calc++-scanner.$(OBJEXT) \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/examples_calc___calc__-calc++.$(OBJEXT)
++@ENABLE_EXAMPLES_TRUE@am__objects_3 = examples/calc++/examples_calc___calc__-calc++-parser.$(OBJEXT)
++@ENABLE_EXAMPLES_TRUE@am__objects_4 = $(am__objects_2) \
++@ENABLE_EXAMPLES_TRUE@ $(am__objects_3)
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@nodist_examples_calc___calc___OBJECTS = \
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@ $(am__objects_4)
+ examples_calc___calc___OBJECTS = \
+ $(nodist_examples_calc___calc___OBJECTS)
+ examples_calc___calc___LDADD = $(LDADD)
+@@ -490,17 +509,17 @@
+ examples_calc___calc___LINK = $(CXXLD) \
+ $(examples_calc___calc___CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+-am__objects_5 = \
+- examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.$(OBJEXT)
+-am__objects_6 = $(am__objects_5)
+-nodist_examples_mfcalc_mfcalc_OBJECTS = $(am__objects_6)
++@ENABLE_EXAMPLES_TRUE@am__objects_5 = examples/mfcalc/examples_mfcalc_mfcalc-mfcalc.$(OBJEXT)
++@ENABLE_EXAMPLES_TRUE@am__objects_6 = $(am__objects_5)
++@ENABLE_EXAMPLES_TRUE@nodist_examples_mfcalc_mfcalc_OBJECTS = \
++@ENABLE_EXAMPLES_TRUE@ $(am__objects_6)
+ examples_mfcalc_mfcalc_OBJECTS = \
+ $(nodist_examples_mfcalc_mfcalc_OBJECTS)
+ examples_mfcalc_mfcalc_DEPENDENCIES =
+-am__objects_7 = \
+- examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.$(OBJEXT)
+-am__objects_8 = $(am__objects_7)
+-nodist_examples_rpcalc_rpcalc_OBJECTS = $(am__objects_8)
++@ENABLE_EXAMPLES_TRUE@am__objects_7 = examples/rpcalc/examples_rpcalc_rpcalc-rpcalc.$(OBJEXT)
++@ENABLE_EXAMPLES_TRUE@am__objects_8 = $(am__objects_7)
++@ENABLE_EXAMPLES_TRUE@nodist_examples_rpcalc_rpcalc_OBJECTS = \
++@ENABLE_EXAMPLES_TRUE@ $(am__objects_8)
+ examples_rpcalc_rpcalc_OBJECTS = \
+ $(nodist_examples_rpcalc_rpcalc_OBJECTS)
+ examples_rpcalc_rpcalc_DEPENDENCIES =
+@@ -528,6 +547,7 @@
+ src_bison_DEPENDENCIES = lib/libbison.a $(am__DEPENDENCIES_1)
+ src_bison_LINK = $(CCLD) $(src_bison_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
++am__dist_noinst_SCRIPTS_DIST = examples/extexi examples/test
+ SCRIPTS = $(bin_SCRIPTS) $(dist_noinst_SCRIPTS) \
+ $(nodist_noinst_SCRIPTS)
+ AM_V_P = $(am__v_P_@AM_V@)
+@@ -2145,7 +2165,7 @@
+ djgpp/subpipe.h djgpp/testsuite.sed doc/refcard.tex \
+ $(top_srcdir)/doc/bison.help $(dist_man_MANS:.1=.x) $(FIGS_GV) \
+ $(FIGS_GV:.gv=.txt) $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) \
+- $(FIGS_GV:.gv=.png) doc/Doxyfile.in $(am__append_4) \
++ $(FIGS_GV:.gv=.png) doc/Doxyfile.in $(am__append_6) \
+ lib/alignof.h lib/alloca.in.h \
+ $(top_srcdir)/build-aux/announce-gen lib/argmatch.h \
+ lib/c-strcaseeq.h lib/calloc.c lib/cloexec.h lib/close.c \
+@@ -2249,27 +2269,20 @@
+ # a developer might naively reference .version in a test case while the bison
+ # executable still compiles with VERSION, and so the test case might fail or
+ # pass incorrectly.
+-BUILT_SOURCES = $(mfcalc_sources) $(rpcalc_sources) $(ALLOCA_H) \
+- lib/configmake.h $(ERRNO_H) lib/fcntl.h $(FLOAT_H) $(GETOPT_H) \
+- lib/inttypes.h lib/math.h $(SCHED_H) lib/signal.h \
+- lib/arg-nonnull.h lib/c++defs.h lib/warn-on-use.h lib/spawn.h \
+- $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) lib/stdio.h lib/stdlib.h \
+- lib/string.h lib/sys/stat.h lib/sys/time.h lib/sys/types.h \
+- lib/sys/wait.h lib/time.h lib/unistd.h \
+- $(LIBUNISTRING_UNITYPES_H) $(LIBUNISTRING_UNIWIDTH_H) \
+- lib/wchar.h lib/wctype.h src/parse-gram.c src/parse-gram.h \
+- src/scan-code.c src/scan-gram.c src/scan-skel.c \
+- $(top_srcdir)/.version
++BUILT_SOURCES = $(am__append_7) $(ALLOCA_H) lib/configmake.h \
++ $(ERRNO_H) lib/fcntl.h $(FLOAT_H) $(GETOPT_H) lib/inttypes.h \
++ lib/math.h $(SCHED_H) lib/signal.h lib/arg-nonnull.h \
++ lib/c++defs.h lib/warn-on-use.h lib/spawn.h $(STDBOOL_H) \
++ $(STDDEF_H) $(STDINT_H) lib/stdio.h lib/stdlib.h lib/string.h \
++ lib/sys/stat.h lib/sys/time.h lib/sys/types.h lib/sys/wait.h \
++ lib/time.h lib/unistd.h $(LIBUNISTRING_UNITYPES_H) \
++ $(LIBUNISTRING_UNIWIDTH_H) lib/wchar.h lib/wctype.h \
++ src/parse-gram.c src/parse-gram.h src/scan-code.c \
++ src/scan-gram.c src/scan-skel.c $(top_srcdir)/.version
+ CLEANFILES = doc/refcard.pdf $(FIGS_GV:.gv=.eps) $(FIGS_GV:.gv=.pdf) \
+- $(FIGS_GV:.gv=.png) doc/Doxyfile $(extracted) \
+- examples/extracted.stamp $(calcxx_sources_generated) \
+- examples/calc++/calc++-parser.output \
+- examples/calc++/calc++-parser.stamp \
+- examples/calc++/calc++-scanner.cc examples/mfcalc/mfcalc.[ch] \
+- examples/mfcalc/mfcalc.output examples/rpcalc/rpcalc.[ch] \
+- examples/rpcalc/rpcalc.output lib/configmake.h \
+- lib/configmake.h-t lib/charset.alias lib/ref-add.sed \
+- lib/ref-del.sed
++ $(FIGS_GV:.gv=.png) doc/Doxyfile $(am__append_2) \
++ lib/configmake.h lib/configmake.h-t lib/charset.alias \
++ lib/ref-add.sed lib/ref-del.sed
+ DISTCLEANFILES = tests/atconfig $(check_SCRIPTS)
+ MOSTLYCLEANDIRS = lib/sys lib/sys
+ MOSTLYCLEANFILES = $(top_srcdir)/doc/*.t lib/core lib/*.stackdump \
+@@ -2289,10 +2302,9 @@
+ lib/unistd.h-t lib/unitypes.h lib/unitypes.h-t lib/uniwidth.h \
+ lib/uniwidth.h-t lib/wchar.h lib/wchar.h-t lib/wctype.h \
+ lib/wctype.h-t src/yacc
+-SUFFIXES = .gv .eps .pdf .png .yy .stamp
++SUFFIXES = .gv .eps .pdf .png $(am__append_3)
+ TESTS = $(dist_TESTS)
+-dist_TESTS = $(am__append_3) examples/mfcalc/mfcalc.test \
+- examples/rpcalc/rpcalc.test
++dist_TESTS = $(am__append_5) $(am__append_9)
+ noinst_LIBRARIES = lib/libbison.a
+ dist_pkgdata_DATA = \
+ data/README \
+@@ -2364,59 +2376,59 @@
+ -e 's,@top_srcdir\@,$(top_srcdir),g'
+
+ nodist_noinst_SCRIPTS = etc/bench.pl
+-dist_noinst_SCRIPTS = examples/extexi examples/test
+-TEST_LOG_COMPILER = $(top_srcdir)/examples/test
+-AM_CXXFLAGS = \
+- $(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
+-
+-doc = $(top_srcdir)/doc/bison.texi
+-extexi = $(top_srcdir)/examples/extexi
+-@ENABLE_GCC_WARNINGS_TRUE@extexiFLAGS = --synclines
+-extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(extexiFLAGS) $(doc) --
+-extracted = $(calcxx_extracted) $(mfcalc_extracted) \
+- $(rpcalc_extracted)
+-calcxx_sources_extracted = \
+- examples/calc++/calc++-driver.cc \
+- examples/calc++/calc++-driver.hh \
+- examples/calc++/calc++-scanner.ll \
+- examples/calc++/calc++.cc
+-
+-calcxx_extracted = \
+- $(calcxx_sources_extracted) \
+- examples/calc++/calc++-parser.yy
+-
+-calcxx_sources_generated = \
+- examples/calc++/calc++-parser.cc \
+- examples/calc++/calc++-parser.hh \
+- examples/calc++/location.hh \
+- examples/calc++/position.hh \
+- examples/calc++/stack.hh
+-
+-calcxx_sources = \
+- $(calcxx_sources_extracted) \
+- $(calcxx_sources_generated)
+-
+-@FLEX_CXX_WORKS_TRUE@nodist_examples_calc___calc___SOURCES = \
+-@FLEX_CXX_WORKS_TRUE@ $(calcxx_sources)
+-
+-@FLEX_CXX_WORKS_TRUE@examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
+-@FLEX_CXX_WORKS_TRUE@examples_calc___calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
+-calcxxdir = $(docdir)/examples/calc++
+-calcxx_DATA = $(calcxx_extracted)
+-mfcalc_extracted = examples/mfcalc/calc.h examples/mfcalc/mfcalc.y
+-mfcalc_sources = $(mfcalc_extracted)
+-examples_mfcalc_mfcalc_LDADD = -lm
+-nodist_examples_mfcalc_mfcalc_SOURCES = $(mfcalc_sources)
+-examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc
+-mfcalcdir = $(docdir)/examples/mfcalc
+-mfcalc_DATA = $(mfcalc_extracted)
+-rpcalc_extracted = examples/rpcalc/rpcalc.y
+-rpcalc_sources = $(rpcalc_extracted)
+-examples_rpcalc_rpcalc_LDADD = -lm
+-nodist_examples_rpcalc_rpcalc_SOURCES = $(rpcalc_sources)
+-examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc
+-rpcalcdir = $(docdir)/examples/rpcalc
+-rpcalc_DATA = $(rpcalc_extracted)
++@ENABLE_EXAMPLES_TRUE@dist_noinst_SCRIPTS = examples/extexi examples/test
++@ENABLE_EXAMPLES_TRUE@TEST_LOG_COMPILER = $(top_srcdir)/examples/test
++@ENABLE_EXAMPLES_TRUE@AM_CXXFLAGS = \
++@ENABLE_EXAMPLES_TRUE@ $(WARN_CXXFLAGS) $(WARN_CXXFLAGS_TEST) $(WERROR_CXXFLAGS)
++
++@ENABLE_EXAMPLES_TRUE@doc = $(top_srcdir)/doc/bison.texi
++@ENABLE_EXAMPLES_TRUE@extexi = $(top_srcdir)/examples/extexi
++@ENABLE_EXAMPLES_TRUE@@ENABLE_GCC_WARNINGS_TRUE@extexiFLAGS = --synclines
++@ENABLE_EXAMPLES_TRUE@extract = VERSION="$(VERSION)" $(PERL) $(extexi) $(extexiFLAGS) $(doc) --
++@ENABLE_EXAMPLES_TRUE@extracted = $(calcxx_extracted) \
++@ENABLE_EXAMPLES_TRUE@ $(mfcalc_extracted) $(rpcalc_extracted)
++@ENABLE_EXAMPLES_TRUE@calcxx_sources_extracted = \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-driver.cc \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-driver.hh \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-scanner.ll \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++.cc
++
++@ENABLE_EXAMPLES_TRUE@calcxx_extracted = \
++@ENABLE_EXAMPLES_TRUE@ $(calcxx_sources_extracted) \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-parser.yy
++
++@ENABLE_EXAMPLES_TRUE@calcxx_sources_generated = \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-parser.cc \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/calc++-parser.hh \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/location.hh \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/position.hh \
++@ENABLE_EXAMPLES_TRUE@ examples/calc++/stack.hh
++
++@ENABLE_EXAMPLES_TRUE@calcxx_sources = \
++@ENABLE_EXAMPLES_TRUE@ $(calcxx_sources_extracted) \
++@ENABLE_EXAMPLES_TRUE@ $(calcxx_sources_generated)
++
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@nodist_examples_calc___calc___SOURCES = \
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@ $(calcxx_sources)
++
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@examples_calc___calc___CPPFLAGS = -I$(top_builddir)/examples/calc++
++@ENABLE_EXAMPLES_TRUE@@FLEX_CXX_WORKS_TRUE@examples_calc___calc___CXXFLAGS = $(AM_CXXFLAGS) $(FLEX_SCANNER_CXXFLAGS)
++@ENABLE_EXAMPLES_TRUE@calcxxdir = $(docdir)/examples/calc++
++@ENABLE_EXAMPLES_TRUE@calcxx_DATA = $(calcxx_extracted)
++@ENABLE_EXAMPLES_TRUE@mfcalc_extracted = examples/mfcalc/calc.h examples/mfcalc/mfcalc.y
++@ENABLE_EXAMPLES_TRUE@mfcalc_sources = $(mfcalc_extracted)
++@ENABLE_EXAMPLES_TRUE@examples_mfcalc_mfcalc_LDADD = -lm
++@ENABLE_EXAMPLES_TRUE@nodist_examples_mfcalc_mfcalc_SOURCES = $(mfcalc_sources)
++@ENABLE_EXAMPLES_TRUE@examples_mfcalc_mfcalc_CPPFLAGS = -I$(top_builddir)/examples/mfcalc
++@ENABLE_EXAMPLES_TRUE@mfcalcdir = $(docdir)/examples/mfcalc
++@ENABLE_EXAMPLES_TRUE@mfcalc_DATA = $(mfcalc_extracted)
++@ENABLE_EXAMPLES_TRUE@rpcalc_extracted = examples/rpcalc/rpcalc.y
++@ENABLE_EXAMPLES_TRUE@rpcalc_sources = $(rpcalc_extracted)
++@ENABLE_EXAMPLES_TRUE@examples_rpcalc_rpcalc_LDADD = -lm
++@ENABLE_EXAMPLES_TRUE@nodist_examples_rpcalc_rpcalc_SOURCES = $(rpcalc_sources)
++@ENABLE_EXAMPLES_TRUE@examples_rpcalc_rpcalc_CPPFLAGS = -I$(top_builddir)/examples/rpcalc
++@ENABLE_EXAMPLES_TRUE@rpcalcdir = $(docdir)/examples/rpcalc
++@ENABLE_EXAMPLES_TRUE@rpcalc_DATA = $(rpcalc_extracted)
+
+ # Implementation of bitsets.
+
+@@ -2441,7 +2453,7 @@
+ lib/progname.c lib/quotearg.c lib/sig-handler.c lib/size_max.h \
+ lib/spawn-pipe.h lib/spawn-pipe.c lib/w32spawn.h \
+ lib/glthread/threadlib.c lib/unistd.c lib/dup-safer.c \
+- lib/fd-safer.c lib/pipe-safer.c $(am__append_5) \
++ lib/fd-safer.c lib/pipe-safer.c $(am__append_10) \
+ lib/wait-process.h lib/wait-process.c lib/wctype-h.c \
+ lib/xmalloc.c lib/xalloc-die.c lib/xconcat-filename.c \
+ lib/xsize.h lib/xsize.c lib/xstrndup.h lib/xstrndup.c \
+@@ -5328,31 +5340,31 @@
+ # configure, because the former is way faster than the latter.
+ doc/Doxyfile: $(top_srcdir)/doc/Doxyfile.in
+ $(AM_V_GEN) $(edit) $(top_srcdir)/doc/Doxyfile.in >doc/Doxyfile
+-examples/extracted.stamp: $(doc) $(extexi)
+- $(AM_V_GEN)rm -f $@ $@.tmp
+- $(AM_V_at)touch $@.tmp
+- $(AM_V_at)$(extract) $(extracted)
+- $(AM_V_at)mv $@.tmp $@
+-
+-$(extracted): examples/extracted.stamp
+- @test -f $@ || rm -f examples/extracted.stamp
+- @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp
++@ENABLE_EXAMPLES_TRUE@examples/extracted.stamp: $(doc) $(extexi)
++@ENABLE_EXAMPLES_TRUE@ $(AM_V_GEN)rm -f $@ $@.tmp
++@ENABLE_EXAMPLES_TRUE@ $(AM_V_at)touch $@.tmp
++@ENABLE_EXAMPLES_TRUE@ $(AM_V_at)$(extract) $(extracted)
++@ENABLE_EXAMPLES_TRUE@ $(AM_V_at)mv $@.tmp $@
++
++@ENABLE_EXAMPLES_TRUE@$(extracted): examples/extracted.stamp
++@ENABLE_EXAMPLES_TRUE@ @test -f $@ || rm -f examples/extracted.stamp
++@ENABLE_EXAMPLES_TRUE@ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/extracted.stamp
+
+ # Don't depend on $(BISON) otherwise we would rebuild these files
+ # in srcdir, including during distcheck, which is forbidden.
+-examples/calc++/calc++-parser.stamp: $(BISON_IN)
+-.yy.stamp:
+- $(AM_V_YACC)rm -f $@
+- $(AM_V_at)touch $@.tmp
+- $(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
+- $(AM_V_at)mv -f $@.tmp $@
+-
+-$(calcxx_sources_generated): examples/calc++/calc++-parser.stamp
+- @test -f $@ || rm -f examples/calc++/calc++-parser.stamp
+- @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp
++@ENABLE_EXAMPLES_TRUE@examples/calc++/calc++-parser.stamp: $(BISON_IN)
++@ENABLE_EXAMPLES_TRUE@.yy.stamp:
++@ENABLE_EXAMPLES_TRUE@ $(AM_V_YACC)rm -f $@
++@ENABLE_EXAMPLES_TRUE@ $(AM_V_at)touch $@.tmp
++@ENABLE_EXAMPLES_TRUE@ $(AM_V_at)$(YACCCOMPILE) -o $*.cc $<
++@ENABLE_EXAMPLES_TRUE@ $(AM_V_at)mv -f $@.tmp $@
++
++@ENABLE_EXAMPLES_TRUE@$(calcxx_sources_generated): examples/calc++/calc++-parser.stamp
++@ENABLE_EXAMPLES_TRUE@ @test -f $@ || rm -f examples/calc++/calc++-parser.stamp
++@ENABLE_EXAMPLES_TRUE@ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) examples/calc++/calc++-parser.stamp
+
+ # Avoid using BUILT_SOURCES which is too global.
+-$(examples_calc___calc___OBJECTS): $(calcxx_sources_generated)
++@ENABLE_EXAMPLES_TRUE@$(examples_calc___calc___OBJECTS): $(calcxx_sources_generated)
+
+ # We need the following in order to create <alloca.h> when the system
+ # doesn't have one that works with the given compiler.
+--- a/configure
++++ b/configure
+@@ -1693,6 +1693,8 @@
+ ALLOCA
+ GL_COND_LIBTOOL_FALSE
+ GL_COND_LIBTOOL_TRUE
++ENABLE_EXAMPLES_FALSE
++ENABLE_EXAMPLES_TRUE
+ XSLTPROC
+ HELP2MAN
+ PERL
+@@ -1837,6 +1839,7 @@
+ enable_threads
+ enable_gcc_warnings
+ enable_yacc
++enable_examples
+ enable_assert
+ with_gnu_ld
+ enable_rpath
+@@ -2493,6 +2496,7 @@
+ Also, issue synclines from the examples/ to
+ the corresponding source in the Texinfo doc.
+ --disable-yacc do not build a yacc command or an -ly library
++ --disable-examples do not build and install examples
+ --disable-assert turn off assertions
+ --disable-rpath do not hardcode runtime library paths
+ --disable-nls do not use Native Language Support
+@@ -8935,7 +8939,8 @@
+
+
+ if test -z "$PERL"; then
+- as_fn_error $? "perl not found" "$LINENO" 5
++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: perl required for the testsuites" >&5
++$as_echo "$as_me: WARNING: perl required for the testsuites" >&2;}
+ fi
+
+ HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"}
+@@ -8982,6 +8987,34 @@
+
+
+
++# Check whether --enable-examples was given.
++if test "${enable_examples+set}" = set; then :
++ enableval=$enable_examples;
++fi
++
++# Enable the examles by default if perl is available.
++case $enable_examples in
++no) ;;
++yes)
++ if test -z "$PERL"; then
++ as_fn_error $? "perl required for the examples" "$LINENO" 5
++ fi
++ ;;
++*)
++ if test -n "$PERL"; then
++ enable_examples=yes
++ fi
++ ;;
++esac
++ if test "xenable_examples" = xyes; then
++ ENABLE_EXAMPLES_TRUE=
++ ENABLE_EXAMPLES_FALSE='#'
++else
++ ENABLE_EXAMPLES_TRUE='#'
++ ENABLE_EXAMPLES_FALSE=
++fi
++
++
+ # Checks for header files.
+
+
+@@ -38129,6 +38162,10 @@
+ as_fn_error $? "conditional \"FLEX_CXX_WORKS\" was never defined.
+ Usually this means the macro was only invoked conditionally." "$LINENO" 5
+ fi
++if test -z "${ENABLE_EXAMPLES_TRUE}" && test -z "${ENABLE_EXAMPLES_FALSE}"; then
++ as_fn_error $? "conditional \"ENABLE_EXAMPLES\" was never defined.
++Usually this means the macro was only invoked conditionally." "$LINENO" 5
++fi
+ if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
+ as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
+ Usually this means the macro was only invoked conditionally." "$LINENO" 5
+--
+2.3.4
diff --git a/sys-devel/bison/metadata.xml b/sys-devel/bison/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/bison/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/bmake/Manifest b/sys-devel/bmake/Manifest
new file mode 100644
index 000000000000..aab4cb84e5c0
--- /dev/null
+++ b/sys-devel/bmake/Manifest
@@ -0,0 +1,11 @@
+DIST bmake-20170421.tar.gz 550626 SHA256 763104954b566ae9f575ea682dc38ed5c73057336f5f6090fb7489a5399511c5 SHA512 f984dd7697ff74455690d9f0b6a355e3bd3de7545eb93def82aeaaf1899b5316a83e36502ffdd64ef53ad2b28fbfad61cfaee17b8ec29a1f0dd6640c13b4f04f WHIRLPOOL c4e8701ca7ff8c30a09aca12d1c6e0ca141ab99498c3bc88bfedf7543629adfe0dbf1064be2f91246b1aada2ab42048629adf2d87c2de8fa832b174815ef897b
+DIST bmake-20170510.tar.gz 552370 SHA256 ce5d73a8b5267495132bd00392a411178155dafecd66b50860419e9cf8683e3c SHA512 55300e3e375047a400912e62821a179b2a3dfdf61e39c3991fe236c5b63816f854ebb50f759a0a8a938af4b84f00eaa9cc2e172288287c019ecadfc0b359a1f6 WHIRLPOOL 479e1cbe1d854c34b8e26afda1b962609220b128bea518babdf1409218f42e2bb5c481f870597d5a1944a8f37c17642ae6f4af03b1917a2088396a2380409157
+DIST bmake-20170812.tar.gz 554613 SHA256 cdd9ea1aa5b84b7b892ddf2dccb1c21028de6ce0edf5684432e1f4bf861179c6 SHA512 2345d24967796950ba9c661e65228223da51c6f22da34ad2dbc5069e0ca56445902685f9da5cfd0f2594f6261ae778d3621670bd80fc8f840d970b6fd8f185f4 WHIRLPOOL dd69efeaa18591ed3674fa06a64392f45de3f477fa2e1709ffd8a94a96df8c8d05ee1bffa6d4fe1d05969b2a687390cd42f0bf60d3d8d6c96f5ae1714dbb1f7f
+DIST mk-20170301.tar.gz 93049 SHA256 0bafe6b64b891fb2cdbe2cdd3fb11ade5fe41055d6bbd3da69a68854a3f7215c SHA512 9727cb284339ec00caeccadd88b55d93027991d453e507c77575135efd789d77307c84137e83616df6643039f9f2449751d4796a87828224e5a8bf48bc0925a3 WHIRLPOOL f7ee160ffd51d7c1f059f5c3c32a3a448fa6d37ca83ba9044647a836e91165603ac8780e486ebef86fe62803a29b6e096e7c4fd95bdf7b7a861e581943b91f40
+DIST mk-20170505.tar.gz 94846 SHA256 d0b83b19d87ff3228704ed32825cda5ae0091bdf7bda0121ee64fb831c592a24 SHA512 8a9303612a80afdc3c74be8176cab2c04c10c91b1dd30245645cd5441928f388e291de8fe65efd4341c1bf787d8bafaae8f02018c5353ab2916a69cb2db7334c WHIRLPOOL 23be542319be4c4c68288d783a1c7ba713ce76ffc23a87b5843d12b151ddcb7b1248c2b3f54859b2d0b318b5dc381fa01a0aa2896aa2e52867a09d3404fc6b1e
+EBUILD bmake-20170421.ebuild 1173 SHA256 112fb8ba4e06e623d6bccf680a71632f30fe19271d05df64fd3a23d9fc6a95ad SHA512 8e78c74d16e580531a0a8fb94119f3e7ed7c898d13dc2b7345047a1f8df301a4f3462fcdcaf7e6de74d98c61ba7ee724bd51ab7e311ef3136412bd5fc37f58d2 WHIRLPOOL d3dfa49e981a97b89de3e4885c961378193dd64309d4ec8b565d8cad472e6075328de9b2668f65b7278f263ff4b9731e01fab55eab47d4541a8200c27baa4b07
+EBUILD bmake-20170510.ebuild 1173 SHA256 7807e4e61c45e1e024a9a8da0e3991365accf437fc7deceb39c69e3e2da49c32 SHA512 63372986eb42ce9651225d89bbdee10958f3e9fa81472554223aedb407adeed210874a53fa3322f5a48ab38d16887b9118dcb3637a5a694c9c0e5ddc47a326cf WHIRLPOOL fb8724c80b23fe126d0ac5ee0f1bcd2adc00d07ed9bbc85ca159bca9e57b644c85ac26c93e7e7b71db68beade129f32d58f574abf30b45bc1b7e1ed8a190441a
+EBUILD bmake-20170812.ebuild 1173 SHA256 7807e4e61c45e1e024a9a8da0e3991365accf437fc7deceb39c69e3e2da49c32 SHA512 63372986eb42ce9651225d89bbdee10958f3e9fa81472554223aedb407adeed210874a53fa3322f5a48ab38d16887b9118dcb3637a5a694c9c0e5ddc47a326cf WHIRLPOOL fb8724c80b23fe126d0ac5ee0f1bcd2adc00d07ed9bbc85ca159bca9e57b644c85ac26c93e7e7b71db68beade129f32d58f574abf30b45bc1b7e1ed8a190441a
+MISC ChangeLog 4284 SHA256 eb59ed1da1049a3424a749a5c18f706d12aea0002fdf09a589f09a964a668fef SHA512 7da99b3b1cef1c1361bedec8b1408f35d7b8f911ef086b28d48a1a13228725fd9e545cf9022a6aa2a9c801c9f387808be726680aa07a32218e536d2ec0bd7c3e WHIRLPOOL 8a3f074c0b0d55f288f82a5bb94cf9764adec9fcd17dd20ad74093c6e4335b1b73618d570eefc8fb054c85e0203c9671817cce2edd5075629cff8e5e074601cd
+MISC ChangeLog-2015 2781 SHA256 48d573997f03bb5bfb81e9c75ddc17b52407f02b2319f33ba5f95acfb8a11f7e SHA512 bed5f08b93e5d78c8aca77c1281e23613a41254f899ae8c4243942f74f3797dab03d1c568b41895984c10ee485125e00b5691cd3e36d74cd8f41d63d811b126c WHIRLPOOL 03d4c373ae15543c8bea841bed66d1fb7c7e111a64407b7d333c6d8123ad42287dfc434a06a533103dfa569128861aeca2ccba6798f8d9303fc3bd332ab29e0d
+MISC metadata.xml 238 SHA256 501d93b0c41ed422505100f002758cd173cd9783ae7fbb53e2ec5f238c868340 SHA512 173efaa53a514acf1e2f0c6681c82a48ec16d505844f551d2cc823ee8685b27837c7461f7956c12182059ee7e83023e2f0bcd5d1afab74beeaf998487193656d WHIRLPOOL 4ca51d994f011a5e7e4939f02a54b5c2f9f3e526665893c9ac2876c9871b7dc80361393d41c5247b3a5520e82d31d0dd10da520e7715c94b806a94ce0fed2a5a
diff --git a/sys-devel/bmake/bmake-20170421.ebuild b/sys-devel/bmake/bmake-20170421.ebuild
new file mode 100644
index 000000000000..e3738bfbdce7
--- /dev/null
+++ b/sys-devel/bmake/bmake-20170421.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+MK_VER=20170301
+DESCRIPTION="NetBSD's portable make"
+HOMEPAGE="http://www.crufty.net/help/sjg/bmake.html"
+SRC_URI="http://void.crufty.net/ftp/pub/sjg/${P}.tar.gz
+ http://void.crufty.net/ftp/pub/sjg/mk-${MK_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+S="${WORKDIR}/${PN}"
+
+src_configure() {
+ econf \
+ --with-mksrc=../mk \
+ --with-default-sys-path="${EPREFIX}"/usr/share/mk/${PN} \
+ --with-machine_arch=${ARCH}
+}
+
+src_compile() {
+ sh make-bootstrap.sh || die "bootstrap failed"
+}
+
+src_test() {
+ cd unit-tests || die
+ LC_ALL=C env -u A ${S}/bmake -r -m . > test.out 2>&1 \
+ || die "tests compilation failed"
+ sed -i \
+ -e "s:${S}/::g" \
+ -e "s:bmake\\[.\\]:make:g" \
+ -e "s:unit-tests/::g" \
+ test.out || die "Fixing values failed"
+ diff -u test.exp test.out
+ [[ $(diff -u test.exp test.out |wc -l) -gt 0 ]] && die "tests differ"
+}
+
+src_install() {
+ dobin "${PN}"
+ doman "${PN}.1"
+ FORCE_BSD_MK=1 SYS_MK_DIR=. \
+ sh ../mk/install-mk -v -m 644 "${ED}"/usr/share/mk/${PN} \
+ || die "failed to install mk files"
+}
diff --git a/sys-devel/bmake/bmake-20170510.ebuild b/sys-devel/bmake/bmake-20170510.ebuild
new file mode 100644
index 000000000000..03ffd36338d0
--- /dev/null
+++ b/sys-devel/bmake/bmake-20170510.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+MK_VER=20170505
+DESCRIPTION="NetBSD's portable make"
+HOMEPAGE="http://www.crufty.net/help/sjg/bmake.html"
+SRC_URI="http://void.crufty.net/ftp/pub/sjg/${P}.tar.gz
+ http://void.crufty.net/ftp/pub/sjg/mk-${MK_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+S="${WORKDIR}/${PN}"
+
+src_configure() {
+ econf \
+ --with-mksrc=../mk \
+ --with-default-sys-path="${EPREFIX}"/usr/share/mk/${PN} \
+ --with-machine_arch=${ARCH}
+}
+
+src_compile() {
+ sh make-bootstrap.sh || die "bootstrap failed"
+}
+
+src_test() {
+ cd unit-tests || die
+ LC_ALL=C env -u A ${S}/bmake -r -m . > test.out 2>&1 \
+ || die "tests compilation failed"
+ sed -i \
+ -e "s:${S}/::g" \
+ -e "s:bmake\\[.\\]:make:g" \
+ -e "s:unit-tests/::g" \
+ test.out || die "Fixing values failed"
+ diff -u test.exp test.out
+ [[ $(diff -u test.exp test.out |wc -l) -gt 0 ]] && die "tests differ"
+}
+
+src_install() {
+ dobin "${PN}"
+ doman "${PN}.1"
+ FORCE_BSD_MK=1 SYS_MK_DIR=. \
+ sh ../mk/install-mk -v -m 644 "${ED}"/usr/share/mk/${PN} \
+ || die "failed to install mk files"
+}
diff --git a/sys-devel/bmake/bmake-20170812.ebuild b/sys-devel/bmake/bmake-20170812.ebuild
new file mode 100644
index 000000000000..03ffd36338d0
--- /dev/null
+++ b/sys-devel/bmake/bmake-20170812.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+MK_VER=20170505
+DESCRIPTION="NetBSD's portable make"
+HOMEPAGE="http://www.crufty.net/help/sjg/bmake.html"
+SRC_URI="http://void.crufty.net/ftp/pub/sjg/${P}.tar.gz
+ http://void.crufty.net/ftp/pub/sjg/mk-${MK_VER}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+
+S="${WORKDIR}/${PN}"
+
+src_configure() {
+ econf \
+ --with-mksrc=../mk \
+ --with-default-sys-path="${EPREFIX}"/usr/share/mk/${PN} \
+ --with-machine_arch=${ARCH}
+}
+
+src_compile() {
+ sh make-bootstrap.sh || die "bootstrap failed"
+}
+
+src_test() {
+ cd unit-tests || die
+ LC_ALL=C env -u A ${S}/bmake -r -m . > test.out 2>&1 \
+ || die "tests compilation failed"
+ sed -i \
+ -e "s:${S}/::g" \
+ -e "s:bmake\\[.\\]:make:g" \
+ -e "s:unit-tests/::g" \
+ test.out || die "Fixing values failed"
+ diff -u test.exp test.out
+ [[ $(diff -u test.exp test.out |wc -l) -gt 0 ]] && die "tests differ"
+}
+
+src_install() {
+ dobin "${PN}"
+ doman "${PN}.1"
+ FORCE_BSD_MK=1 SYS_MK_DIR=. \
+ sh ../mk/install-mk -v -m 644 "${ED}"/usr/share/mk/${PN} \
+ || die "failed to install mk files"
+}
diff --git a/sys-devel/bmake/metadata.xml b/sys-devel/bmake/metadata.xml
new file mode 100644
index 000000000000..a00f3aeb1f81
--- /dev/null
+++ b/sys-devel/bmake/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>bsd@gentoo.org</email>
+ <name>BSD Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/boost-m4/Manifest b/sys-devel/boost-m4/Manifest
new file mode 100644
index 000000000000..1be933e1ee31
--- /dev/null
+++ b/sys-devel/boost-m4/Manifest
@@ -0,0 +1,9 @@
+AUX boost-m4-0.4-gcc5.patch 3535 SHA256 537901558bc0c794a1226337efb1ade0387366464e6c38ea8b1e409b5bba7d02 SHA512 7f579416e10cd9e2a40d1e973ae55a3bd4f5932ce9bd7309b6013224819ab2ef21ee6fbf7e40dfe2f461d2e84cfecbba54347ef37401d3687ca3f03bcf5f7210 WHIRLPOOL 418959165e83c0cb57fc36369c779175bf99b467c55600e06c1a00491110fffe8e225eb597256cffa4e17ebbd1ca8e0905cd6d09994ce12d3bcf6b39eb97a439
+DIST boost-m4-0.4.tar.gz 38871 SHA256 abe1fbc30cdd1e938cd5b00cbcbfc370d159404f9014c6dce1976b093cd242e0 SHA512 f0ee9edbf20043679339bcb46a912d460a787635106559780d6a9a08dd685051a58667a0a1e26364709de10dde49f4b2fd348dbd6199a9da3099d75e665c1e95 WHIRLPOOL 8478f8f742004f3ef8ab11bb27c1c2d172fc9060a0ac6041a131f90369af9a8cc6db6ae0e1f108832d5e2c262aba98604b32601a89afecc4be135b7e1b4d18d3
+DIST boost-m4-0.4_p20160328.tar.gz 41253 SHA256 185c6ce9b999d9c3cf64bfff03c2c79cd29e0fe66c0566d8ef8919cfaf2e2dcc SHA512 4aecd311b21ced4a3d62fc706a9fa731c375ea490482f78756892243b5af6909cd8841c249632b37820be7f1bde41c290e842edd933d0c727e1dca76d30eb506 WHIRLPOOL f1e3f6d18c5b11bf3ae27cc05d5af1bc784e794961ac8336e9cf74fd3a2f552efe215631af9b1c82d562f1afa21da009e6ad57191ccf24f9dd005ff15f1f2792
+EBUILD boost-m4-0.4-r1.ebuild 917 SHA256 27186afe78f5daed166c116857a0a3fe2253c1950a9d40a0d35d6cdc5b9752e1 SHA512 d6fa04dca6ce327db4189f03e8e7a7239e69c1f16b9c5a91a7b8020b1dc970ea8393daa2c8dbab1f11d433e63d11858f96bc5790334f65e4260696198b0912d8 WHIRLPOOL 0298946007e56de8b0af535f21522bec5b4cfd6d6ef4c67aa2daab7aee21ac9fb2e1b392fbf4507cd7d36e1091e54783c1e6069da4ef0476f9d866f56905a45d
+EBUILD boost-m4-0.4.ebuild 844 SHA256 53b877de4851409630174431503e972cc1436c6d6dad9bcc5dfeb19f9b1c41a5 SHA512 896b5628af4a1934c25543d564a2266bdf7afc0653ec93de84155d16b905aeaede4e4877b0dd3afde6a6bacbce266c8247a2cde9cc8f1662af53878b478161d0 WHIRLPOOL 4bbbe275b4c7e585662ffbfaecc7c01a649272862a4ad3b1b92d926addafb0a7354b02ce1426c2cb9925bfe3d4f5df092cc1ce6787c07315c863e4dc1991ad08
+EBUILD boost-m4-0.4_p20160328.ebuild 905 SHA256 cf9aae950f96875fba8e7e78c2cefb951e5a94b684ccb87f37a54804d12c445f SHA512 02a1b9157d587d24383f5fed217dab143ff31bfecd17fb3f33f4efc9ef10a66e577d8207832895baa74b075f0d8ab12546e7dd3feb577a80bae5cad0d6443ab8 WHIRLPOOL 8044ebeb8d37a471809462d2409fd1c3767c0acc1423612657d54e2248a16c07d8ae68b81518cc56b1d6801cddbb68b653524f176205cccbee1be63785c74fdd
+MISC ChangeLog 2757 SHA256 f990670ac7f9b3b774a377b1f1096a3886db68a877b30fcc7818c895be4fa2d0 SHA512 3081866ae59437150b7dfdc47318ceb490e876ebff0c5e4db4f75151be7e6d3efa494771339d036bfa1e2b876c66e751443d6e820dd7cd2aaf325fd6e05322d1 WHIRLPOOL ff6d1fb82fdd4fa33ced5f51d551cc9a90e5cd37bc15d17f54c20421dbd8fbfe51501d2491befcfa8a626df1c19ed8cc6e79158788059acf263cc6c2afaf134f
+MISC ChangeLog-2015 3239 SHA256 92974d4ed0db88bba612b3c7e7ec53bb04e2a18b3091658b30ecd1a3ea6985f8 SHA512 08ea3a2f973d4604abc376119056ea7ce8283a0e595b018e3b3219c9db497b0175eb28c6df3aae6489c2344b61584e7f788392945453ddcc7e24678f5111a8e9 WHIRLPOOL c73c552398f1e8bfde28518febcfc08486779f4091fffbc1bcab227adf4ff1d03956a9fff4879485a3d7e2a56b9772f7152f8f6b06d54691b7220df3dfc76819
+MISC metadata.xml 222 SHA256 1c829667b2b010a9d2d985a1ece50497471c93d67f030e72614b8c1e2148d491 SHA512 5144b4eb888e33db8ccf9038a19bebaca24c0ad51a04e706f1701214adab830a39907686b4c4d655f147b827c34dc2fda9737680ee983da5f62b417ec0775557 WHIRLPOOL 6fa8333fb4cb4c87f0e36cd04a840d9a16faf0c29875e57a92646a97e62b260e9cbe94fc6c9bffe490bf756edec5258ce74c7d96942eda5811e2aa0df5d297d4
diff --git a/sys-devel/boost-m4/boost-m4-0.4-r1.ebuild b/sys-devel/boost-m4/boost-m4-0.4-r1.ebuild
new file mode 100644
index 000000000000..b230d2ec9dc5
--- /dev/null
+++ b/sys-devel/boost-m4/boost-m4-0.4-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils vcs-snapshot
+
+DESCRIPTION="Another set of autoconf macros for compiling against boost"
+HOMEPAGE="https://github.com/tsuna/boost.m4"
+SRC_URI="${HOMEPAGE}/tarball/v${PV} -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gcc5.patch
+}
+
+# boost.m4 has a buildsystem, but the distributer didn't use make dist
+# so we'd have to eautoreconf to use it. Also, its ./configure script
+# DEPENDs on boost. For installing one file, bootstrapping the
+# buildsystem isn't worth it.
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ insinto /usr/share/aclocal
+ doins build-aux/boost.m4
+
+ dodoc AUTHORS NEWS README THANKS
+}
diff --git a/sys-devel/boost-m4/boost-m4-0.4.ebuild b/sys-devel/boost-m4/boost-m4-0.4.ebuild
new file mode 100644
index 000000000000..5fdcd0d72395
--- /dev/null
+++ b/sys-devel/boost-m4/boost-m4-0.4.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit vcs-snapshot
+
+DESCRIPTION="Another set of autoconf macros for compiling against boost"
+HOMEPAGE="https://github.com/tsuna/boost.m4"
+SRC_URI="${HOMEPAGE}/tarball/v${PV} -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+# boost.m4 has a buildsystem, but the distributer didn't use make dist
+# so we'd have to eautoreconf to use it. Also, its ./configure script
+# DEPENDs on boost. For installing one file, bootstrapping the
+# buildsystem isn't worth it.
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ insinto /usr/share/aclocal
+ doins build-aux/boost.m4
+
+ dodoc AUTHORS NEWS README THANKS
+}
diff --git a/sys-devel/boost-m4/boost-m4-0.4_p20160328.ebuild b/sys-devel/boost-m4/boost-m4-0.4_p20160328.ebuild
new file mode 100644
index 000000000000..5fea1fbee600
--- /dev/null
+++ b/sys-devel/boost-m4/boost-m4-0.4_p20160328.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Another set of autoconf macros for compiling against boost"
+HOMEPAGE="https://github.com/tsuna/boost.m4"
+SRC_URI="https://dev.gentoo.org/~soap/distfiles/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+S="${WORKDIR}/boost.m4-1489691f65aecb593e33abc3e56ac482dd67da7b"
+
+# boost.m4 has a buildsystem, but the distributer didn't use make dist
+# so we'd have to eautoreconf to use it. Also, its ./configure script
+# DEPENDs on boost. For installing one file, bootstrapping the
+# buildsystem isn't worth it.
+src_configure() { :; }
+
+src_compile() { :; }
+
+src_install() {
+ insinto /usr/share/aclocal
+ doins build-aux/boost.m4
+
+ dodoc AUTHORS NEWS README THANKS
+}
diff --git a/sys-devel/boost-m4/files/boost-m4-0.4-gcc5.patch b/sys-devel/boost-m4/files/boost-m4-0.4-gcc5.patch
new file mode 100644
index 000000000000..a929957e8aa6
--- /dev/null
+++ b/sys-devel/boost-m4/files/boost-m4-0.4-gcc5.patch
@@ -0,0 +1,91 @@
+https://bugs.gentoo.org/549618
+Note: I dropped the last hunk from the upstream patch. It doesn't apply and
+is unnecessary since we build boost with --layout=system.
+
+From 32553aaf4d5090da19aa0ec33b936982c685009f Mon Sep 17 00:00:00 2001
+From: Akim Demaille <akim@lrde.epita.fr>
+Date: Wed, 26 Nov 2014 16:56:28 +0100
+Subject: [PATCH] boost.m4: cope with GCC 5
+
+Serial 24.
+
+There are two needed adjustments.
+
+One due to the output format which has changed:
+
+ $ cat conftest.cc
+ #include <boost/version.hpp>
+ boost-lib-version = BOOST_LIB_VERSION
+ $ g++-mp-4.9 -E conftest.cc $ g++-mp-5 -E conftest.cc
+ # 1 "conftest.cc" # 1 "conftest.cc"
+ # 1 "<built-in>" # 1 "<built-in>"
+ # 1 "<command-line>" # 1 "<command-line>"
+ # 1 "conftest.cc" # 1 "conftest.cc"
+ # 1 "/include/boost/version.hpp" 1 3 # 1 "/include/boost/version.hpp" 1 3
+ # 2 "conftest.cc" 2 # 2 "conftest.cc" 2
+ boost-lib-version = "1_56" ! boost-lib-version =
+ ! # 2 "conftest.cc" 3
+ ! "1_56"
+
+Since I fear that -P is not portable, let's play with tr and grep to
+get rid of all the # lines and glue the remaining lines together.
+
+The other one is that, finally, gcc 4.10 will actually be named gcc 5,
+so recognize this name.
+
+* build-aux/m4/boost.m4 (_BOOST_SED_CPP): Clean the preprocessor output
+before handing it to the sed command.
+(_BOOST_FIND_COMPILER_TAG): Support GCC 5.
+Improve accuracy of error messages by adding delimiters to bad strings.
+
+Signed-off-by: Benoit Sigoure <tsunanet@gmail.com>
+---
+ build-aux/boost.m4 | 25 ++++++++++++++++++++++---
+ 1 file changed, 22 insertions(+), 3 deletions(-)
+
+--- a/build-aux/boost.m4
++++ b/build-aux/boost.m4
+@@ -72,8 +72,25 @@ dnl strip `\n' with backquotes, not the `\r'. This results in
+ dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+ dnl everything else.
+ dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
++dnl
++dnl Beware that GCC 5, when expanding macros, may embed # line directives
++dnl a within single line:
++dnl
++dnl # 1 "conftest.cc"
++dnl # 1 "<built-in>"
++dnl # 1 "<command-line>"
++dnl # 1 "conftest.cc"
++dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
++dnl # 2 "conftest.cc" 2
++dnl boost-lib-version =
++dnl # 2 "conftest.cc" 3
++dnl "1_56"
++dnl
++dnl So get rid of the # lines, and glue the remaining ones together.
+ (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
++ grep -v '#' |
+ tr -d '\r' |
++ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+@@ -208,7 +225,7 @@ AC_LANG_POP([C++])dnl
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+- _BOOST_SED_CPP([/^boost-lib-version = /{s///;s/\"//g;p;q;}],
++ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+ boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+@@ -216,7 +233,7 @@ boost-lib-version = BOOST_LIB_VERSION],
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+- AC_MSG_ERROR([invalid value: boost_major_version=$boost_major_version])
++ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ ;;
+ esac
+ fi
diff --git a/sys-devel/boost-m4/metadata.xml b/sys-devel/boost-m4/metadata.xml
new file mode 100644
index 000000000000..6712ee20f142
--- /dev/null
+++ b/sys-devel/boost-m4/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <remote-id type="github">tsuna/boost.m4</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/byfl/Manifest b/sys-devel/byfl/Manifest
new file mode 100644
index 000000000000..2781a1ddda29
--- /dev/null
+++ b/sys-devel/byfl/Manifest
@@ -0,0 +1,8 @@
+DIST byfl-1.4-llvm-3.7.0.tar.gz 544669 SHA256 b523a28fb05cb8f0f7641a326c08074306a38a3dcd61c95e69049a98a7ae0cce SHA512 6fb204cf704d3f20e3d408f4cbe8071e1198b75615757c1877a8886753ff9087d9ff04a8279540b26805ed9a0e7cea6543a08de491990c9c912b40f1984bdcb4 WHIRLPOOL 63504c5bda6bd4b9f2cb84ca4f6c0aae2f6b24186d7487c670df4e6d217367e2d794ecda9c8811f6c7db70dc848dfa7ebc9cf09a331bb6b8929cd1af6f143ac2
+DIST byfl-1.5-llvm-3.8.0.tar.gz 544478 SHA256 5d0a8e796b2e1e34448d86570048d267bc3fcc7c1acb6019138631fe3a9cc6e8 SHA512 f1718a6bc43fed74e4d9907c8ff0a407c800176f2bfd2f68bfac2e6626cfe1d0be6835c91375d6ffe6a5a428da7ce80c3eb42a25c36ff69aab65600308dbdd7d WHIRLPOOL 09a095a8db34464d5c666178015aa67e4143ae999e41d78710095b0c9d9186583301a204e74d02c2da78bc68a54503a7784ac2baf0844c90de8a69c6a86ca795
+EBUILD byfl-1.4-r1.ebuild 1082 SHA256 e8c42eca31642dba470f9e385d4a8c25fb40f23f5650fa221ced136adc57a14d SHA512 651c93cbd962305bc632f946200e0b9188cb46e1403f71d1dc478e2abcd43fca18d325ce92abc3416e6438bef6941c0603ff32d72b20c4e7fc0705e2b44486c3 WHIRLPOOL dd52acf05cd828a2abc1dd6fbeda398949d1a1efc022aa40455b1de4459e141749d678436dcdbc0c38194ec5670f7bdeb7015c739b4aea051d238c9e0a05d367
+EBUILD byfl-1.5.ebuild 1055 SHA256 e2d1b45ee58f34a5d6a435302444e1657f316ab4d267ec84973eb1f1619faa2d SHA512 c144ca50a107bf5def6a65d7c03daa5d466f2d13d7d81528d384e57c779769f7883b9444328ec20e49012ba50fb569e8702a055fd0e7bce87dd98f45dcd272ae WHIRLPOOL 2a2f7ae6f4c6a9aedef7c06f6226adcf74d1d23fca8f9fe2ff35105bdc0a621fc1e57f52bb7e155c97bcb9018416c563b141f88b8e2b76a173c41db8f1a304db
+EBUILD byfl-9999.ebuild 1055 SHA256 e2d1b45ee58f34a5d6a435302444e1657f316ab4d267ec84973eb1f1619faa2d SHA512 c144ca50a107bf5def6a65d7c03daa5d466f2d13d7d81528d384e57c779769f7883b9444328ec20e49012ba50fb569e8702a055fd0e7bce87dd98f45dcd272ae WHIRLPOOL 2a2f7ae6f4c6a9aedef7c06f6226adcf74d1d23fca8f9fe2ff35105bdc0a621fc1e57f52bb7e155c97bcb9018416c563b141f88b8e2b76a173c41db8f1a304db
+MISC ChangeLog 3821 SHA256 c49a2d311f53c954c62c5eedc66cd1aa72ed495c0a3764f1efe5757aa56f3843 SHA512 87e85833a239c4968166d3afba7ce083536d08eb64a3bfc245897aae031373fa5c39eb76dd5f7dc45e094c293da6b5f502041f2aa0154d9fd8a2c60eaf854677 WHIRLPOOL 0e6f1c24a341b798ee8a2f596b66ec0af604fea0d3255dd763e659917e96db406449e0e705b6aabe53f44770222853eef143560373d4f939973fcde26327d3d8
+MISC ChangeLog-2015 1549 SHA256 99dd08fd0aa2d9e908e8b16d981ca6327a40459914266a74af45bfd68b64f3e7 SHA512 e153dc67a4d3ad878cc2c2cffa87c592cad99c1bf1f5a176e880f529bb50c4947cbf08bfd07a8867226328479cfd5bdaff90451af3517a6b0f86f88dc485c4ec WHIRLPOOL ec83b5613e9f8fbce3ee4910cf7deaa823b1c004fb00f6a7d0186688da1cacfeadb8451c65fb0a80773b2dbcefc79656305f83d2231affd8519d080142f8fc1b
+MISC metadata.xml 327 SHA256 47d54c179d89143363cf722540249b69da7d7dadce4b75aa255062448c4671aa SHA512 ed1eea05cc9adab8173a1ce8af0cc2dc54675947bda8ffeef935504e9bbb3cf959f36989302ff2cad22c16ff1e499470373bb8c4817c5dc20522b7bfc59c6d47 WHIRLPOOL 0e14644cef5c7ae02ff4bf792377c1f1f5a503ba50fa407379961c5f3e5e1e3a9d0ded1dc7df80422edb85384aa108f8fe0e8225d56fa72e7071628c67d3fb1d
diff --git a/sys-devel/byfl/byfl-1.4-r1.ebuild b/sys-devel/byfl/byfl-1.4-r1.ebuild
new file mode 100644
index 000000000000..5ee59bf9b956
--- /dev/null
+++ b/sys-devel/byfl/byfl-1.4-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic
+
+if [ "${PV}" = "9999" ]; then
+ LLVM_VERSION="3.8.0"
+ EGIT_REPO_URI="https://github.com/lanl/Byfl.git"
+ inherit autotools git-r3
+ KEYWORDS=""
+else
+ LLVM_VERSION="3.7.0"
+ MY_P="${P}-llvm-${LLVM_VERSION}"
+ SRC_URI="https://github.com/lanl/Byfl/releases/download/v${MY_P#${PN}-}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~amd64-linux"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Compiler-based Application Analysis"
+HOMEPAGE="https://github.com/lanl/Byfl"
+
+SLOT="0"
+LICENSE="BSD"
+IUSE="hdf5 static-libs sqlite"
+
+RDEPEND="
+ >=sys-devel/clang-${LLVM_VERSION}:0
+ >=sys-devel/llvm-${LLVM_VERSION}:0
+ <sys-devel/llvm-3.8:0
+ sys-devel/binutils:*
+ dev-lang/perl:=
+ dev-perl/Switch
+ hdf5? ( sci-libs/hdf5[cxx] )
+ sqlite? ( dev-db/sqlite:3 )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ [[ ${PV} = 9999 ]] && eautoreconf
+}
+
+src_configure() {
+ append-cxxflags -std=c++11
+ use sqlite || export ac_cv_lib_sqlite3_sqlite3_errstr=no
+ econf H5CXX=$(usex hdf5 h5c++ no)
+}
diff --git a/sys-devel/byfl/byfl-1.5.ebuild b/sys-devel/byfl/byfl-1.5.ebuild
new file mode 100644
index 000000000000..c1088fff63ab
--- /dev/null
+++ b/sys-devel/byfl/byfl-1.5.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic
+
+if [ "${PV}" = "9999" ]; then
+ LLVM_VERSION="3.8.0"
+ EGIT_REPO_URI="https://github.com/lanl/Byfl.git"
+ inherit autotools git-r3
+ KEYWORDS=""
+else
+ LLVM_VERSION="3.8.0"
+ MY_P="${P}-llvm-${LLVM_VERSION}"
+ SRC_URI="https://github.com/lanl/Byfl/releases/download/v${MY_P#${PN}-}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~amd64-linux"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Compiler-based Application Analysis"
+HOMEPAGE="https://github.com/lanl/Byfl"
+
+SLOT="0"
+LICENSE="BSD"
+IUSE="hdf5 static-libs sqlite"
+
+RDEPEND="
+ >=sys-devel/clang-${LLVM_VERSION}
+ >=sys-devel/llvm-${LLVM_VERSION}
+ sys-devel/binutils:*
+ dev-lang/perl:=
+ dev-perl/Switch
+ hdf5? ( sci-libs/hdf5[cxx] )
+ sqlite? ( dev-db/sqlite:3 )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ [[ ${PV} = 9999 ]] && eautoreconf
+}
+
+src_configure() {
+ append-cxxflags -std=c++11
+ use sqlite || export ac_cv_lib_sqlite3_sqlite3_errstr=no
+ econf H5CXX=$(usex hdf5 h5c++ no)
+}
diff --git a/sys-devel/byfl/byfl-9999.ebuild b/sys-devel/byfl/byfl-9999.ebuild
new file mode 100644
index 000000000000..c1088fff63ab
--- /dev/null
+++ b/sys-devel/byfl/byfl-9999.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit flag-o-matic
+
+if [ "${PV}" = "9999" ]; then
+ LLVM_VERSION="3.8.0"
+ EGIT_REPO_URI="https://github.com/lanl/Byfl.git"
+ inherit autotools git-r3
+ KEYWORDS=""
+else
+ LLVM_VERSION="3.8.0"
+ MY_P="${P}-llvm-${LLVM_VERSION}"
+ SRC_URI="https://github.com/lanl/Byfl/releases/download/v${MY_P#${PN}-}/${MY_P}.tar.gz"
+ KEYWORDS="~amd64 ~amd64-linux"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Compiler-based Application Analysis"
+HOMEPAGE="https://github.com/lanl/Byfl"
+
+SLOT="0"
+LICENSE="BSD"
+IUSE="hdf5 static-libs sqlite"
+
+RDEPEND="
+ >=sys-devel/clang-${LLVM_VERSION}
+ >=sys-devel/llvm-${LLVM_VERSION}
+ sys-devel/binutils:*
+ dev-lang/perl:=
+ dev-perl/Switch
+ hdf5? ( sci-libs/hdf5[cxx] )
+ sqlite? ( dev-db/sqlite:3 )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ default
+ [[ ${PV} = 9999 ]] && eautoreconf
+}
+
+src_configure() {
+ append-cxxflags -std=c++11
+ use sqlite || export ac_cv_lib_sqlite3_sqlite3_errstr=no
+ econf H5CXX=$(usex hdf5 h5c++ no)
+}
diff --git a/sys-devel/byfl/metadata.xml b/sys-devel/byfl/metadata.xml
new file mode 100644
index 000000000000..72ecaff33a5b
--- /dev/null
+++ b/sys-devel/byfl/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>junghans@gentoo.org</email>
+ <name>Christoph Junghans</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">lanl/Byfl</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/clang-runtime/Manifest b/sys-devel/clang-runtime/Manifest
new file mode 100644
index 000000000000..a628be7e49dd
--- /dev/null
+++ b/sys-devel/clang-runtime/Manifest
@@ -0,0 +1,8 @@
+EBUILD clang-runtime-3.9.0.ebuild 540 SHA256 fa4a134bf45550e7e552e5c181a42cb46effdc3422eaa16f10295dde3c7a581c SHA512 d1e6a8970108537c2637210113c2ad95f37c50da652fe0e66811b087d348f2afc6236d9fd15d7e50b4b7c93805adc0fbb010926eee2cd10c318495ce1b224e50 WHIRLPOOL fb6e7a3a64d517b2f051b7c1bc6bf5b228cc44fe7a2a91ac11d09e0a7e3baec5ffb4ffa23c1b24d517c79c44449bf06a7e4e5aa2d52ac80bfb80db7cfa552bfc
+EBUILD clang-runtime-3.9.1.ebuild 569 SHA256 bfcb63171b040316f64dd0f0a7f27bbc96a34753a9fabb3364c7bbe000df8f83 SHA512 b78a53021a94b191c3c48a0db9b8e0a395714dfb204569180eedc4cb390d948ad78d9f87d6974cc6ff036fc05ed10aa30cadfc521d18205cdf6d556814d92a29 WHIRLPOOL 99ac84b5830a0c0d92e1eea6639f975691dce4ac811a5fb56825e830d0729dc7f0837ba5fbc3ae38132b8bab424da3f34dac0bec5cc1f7bc4ad4dc2b7d85d7f8
+EBUILD clang-runtime-4.0.1.ebuild 641 SHA256 b1c2d1839537ead09681098e00b0d2881a09672ffb8b6c8643fc29fd9c7f182b SHA512 4d0c4791a6ef8925dd1d7a834f8a3d020fcb50f63bd78195707aac174d29a619808ae80ab2bd2f18a38057dd906d36664f79b00a038a04811d339304a65b817f WHIRLPOOL 2e6d68742cfc7044483e416ab2c112ebe9e4a312f16324e004c80b804c3ed1109882b7bee17bfe70bffd6feb685a34c8f19b3f542595c2a1b2562f25662cda67
+EBUILD clang-runtime-5.0.0.ebuild 641 SHA256 b1c2d1839537ead09681098e00b0d2881a09672ffb8b6c8643fc29fd9c7f182b SHA512 4d0c4791a6ef8925dd1d7a834f8a3d020fcb50f63bd78195707aac174d29a619808ae80ab2bd2f18a38057dd906d36664f79b00a038a04811d339304a65b817f WHIRLPOOL 2e6d68742cfc7044483e416ab2c112ebe9e4a312f16324e004c80b804c3ed1109882b7bee17bfe70bffd6feb685a34c8f19b3f542595c2a1b2562f25662cda67
+EBUILD clang-runtime-5.0.9999.ebuild 664 SHA256 bd1f167071b4d5da0c52726b1510f074a560b9882805fd2b9226f301af0949a6 SHA512 9130a2868b8e37b1e20d57ec151ad8560d8fdc487b1d0e086f95d4c9edeee802efaec1a9e7c2e5cb06093b3127c9199eebfcf93a287fef535a79ca59b69dc9d0 WHIRLPOOL 479b434ac568fa1a2d3c540cd8f302492d7056949ab63540686e8f1119215f775cf98df1f928a6704189d6be20f2048088d240f861435dbf418c1261d4f0fa1f
+EBUILD clang-runtime-9999.ebuild 664 SHA256 ec435ea8a12b08d448df728834b5a725ec903c798478dbd8eb251e69812ca3bf SHA512 e1e29618485e3153042f366c2ee178d1befb4fa2ecf52fe70e50d97e50bb3d7bb3fc51430f762106ddba77f050cf47d721fe9bbde14c5f8c0fc596e000c067d8 WHIRLPOOL 96b768d2397c08082d9d9987d0f321d911363d6e98ff5d99059d73e4a102f8125f6d0fd800862bfcb63880bec4e414a6bdd350d5269602b2ed1390463d5e2705
+MISC ChangeLog 818 SHA256 acb5dc867dad2923a203979fc98765f8c389e5c2136a531ba2992c453121a05a SHA512 60f00ace5acce92292787b604b214ee8cd19a4ebb5ff37841606b55f578d7c2b7dab913a7c494e6273a3136a14c8b480657930f92fb223f759e0710df74c7d0e WHIRLPOOL 23db0af007baca7a5b45dc50b5d91ab80ef98ded040e10dbb646d4bed19522abce2323a39f48ac7b45ed4fa61ea2a8692bbcb2c8b1973922546cacc3e8c367cc
+MISC metadata.xml 578 SHA256 c321dd480fa2623ba20b5506bf6a0e2f208b6fbdadbabee90b9385e3a966cf6f SHA512 822f56b33d991088ad5e51c3dd96e2e36f544b68c57e45ed8365835d1ef6d0eb797f9de1f8f33b59fbbaf085e245079ca767d5e8b773261cf9ad2c5629b7b16a WHIRLPOOL 903ce4992a32a83fb6f2d4851771204b00fec9edef9a44e6fff4c72a6efbb446e8ae2531dbb470fa5dc314b777ed05cb4375073eb74a8b39697f30ec599abf5e
diff --git a/sys-devel/clang-runtime/clang-runtime-3.9.0.ebuild b/sys-devel/clang-runtime/clang-runtime-3.9.0.ebuild
new file mode 100644
index 000000000000..d7041b6811b5
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-3.9.0.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit multilib-build
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="libcxx openmp"
+
+# compiler-rt is installed unconditionally
+RDEPEND="
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )"
diff --git a/sys-devel/clang-runtime/clang-runtime-3.9.1.ebuild b/sys-devel/clang-runtime/clang-runtime-3.9.1.ebuild
new file mode 100644
index 000000000000..9d158ddc2ccf
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-3.9.1.ebuild
@@ -0,0 +1,20 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit multilib-build
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="libcxx openmp"
+
+# compiler-rt is installed unconditionally
+RDEPEND="
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )"
diff --git a/sys-devel/clang-runtime/clang-runtime-4.0.1.ebuild b/sys-devel/clang-runtime/clang-runtime-4.0.1.ebuild
new file mode 100644
index 000000000000..6b19bc98151c
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-4.0.1.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit multilib-build
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}
+ sanitize? ( ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT} )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )"
+
+REQUIRED_USE="sanitize? ( compiler-rt )"
diff --git a/sys-devel/clang-runtime/clang-runtime-5.0.0.ebuild b/sys-devel/clang-runtime/clang-runtime-5.0.0.ebuild
new file mode 100644
index 000000000000..6b19bc98151c
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-5.0.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit multilib-build
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="metapackage"
+SLOT="${PV%_*}"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}
+ sanitize? ( ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT} )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )"
+
+REQUIRED_USE="sanitize? ( compiler-rt )"
diff --git a/sys-devel/clang-runtime/clang-runtime-5.0.9999.ebuild b/sys-devel/clang-runtime/clang-runtime-5.0.9999.ebuild
new file mode 100644
index 000000000000..f7f004201f60
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-5.0.9999.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit multilib-build
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="metapackage"
+# Note: keep it matching clang-9999 version
+SLOT="5.0.1"
+KEYWORDS=""
+IUSE="+compiler-rt libcxx openmp +sanitize"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}
+ sanitize? ( ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT} )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )"
+
+REQUIRED_USE="sanitize? ( compiler-rt )"
diff --git a/sys-devel/clang-runtime/clang-runtime-9999.ebuild b/sys-devel/clang-runtime/clang-runtime-9999.ebuild
new file mode 100644
index 000000000000..b2d5450cc7aa
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-9999.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit multilib-build
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="metapackage"
+# Note: keep it matching clang-9999 version
+SLOT="6.0.0"
+KEYWORDS=""
+IUSE="+compiler-rt libcxx openmp +sanitize"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}
+ sanitize? ( ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT} )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )"
+
+REQUIRED_USE="sanitize? ( compiler-rt )"
diff --git a/sys-devel/clang-runtime/metadata.xml b/sys-devel/clang-runtime/metadata.xml
new file mode 100644
index 000000000000..f761b620168e
--- /dev/null
+++ b/sys-devel/clang-runtime/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="compiler-rt">Install <pkg>sys-libs/compiler-rt</pkg> for -rtlib=compiler-rt</flag>
+ <flag name="libcxx">Install <pkg>sys-libs/libcxx</pkg> for -stdlib=libc++</flag>
+ <flag name="openmp">Install <pkg>sys-libs/libomp</pkg> for -fopenmp support</flag>
+ <flag name="sanitize">Enable compiler-rt sanitizer (-fsanitize*) support</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest
new file mode 100644
index 000000000000..ae61ade1c436
--- /dev/null
+++ b/sys-devel/clang/Manifest
@@ -0,0 +1,26 @@
+AUX 4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch 4083 SHA256 c3895f7e88dd6a736b7d9299c712e923aa7071b00fc45b305d500c6da3c8b541 SHA512 2154b896d9a0ea50cec17c778ea62da525fc054fc24b0f59bebbad8c66ab17a0d607d87a3d0faa801770e74b8fc4bf3ede4103b6e344b7cc915d0dab16bbd31f WHIRLPOOL 473e748868d9dd65e64d1a5b8beb520a68b7f00edc545fd38bfa83afc8622338620cc9a13b5081c318e1c425eb1ce49acc980baeab679f552f12cd5b627904bb
+AUX 4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch 2214 SHA256 6447b252c36c99842472cacd087b3597259543e33e9c44174d49d9932423dfb3 SHA512 211203f373a882672a712b742b1e4562103fda0a0ac86d602576c105a07af335006da325817ec0ee1f21158a67d0246c7c7ea1d6b3d78abae543f8e69814f885 WHIRLPOOL a7868d55bc13f7379ef6259b3fc5fbff9ef88a834fcf107db31e3e369795c387e2bf335f71e49471ae26fad526932877a0d64aa4689922d9be34958ec725397d
+AUX 4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch 1527 SHA256 3f31a283ef95972030b9acb4d0cc4096bf24db26522defe0d547331850cd657f SHA512 10e3f8a2b5fb1c16f38347f77bba3b171d9f6044c1f96c73368c9df2448cbad0c4a0147f1e1ec10b127ef5eb5a3187c4b56030ac4444269aad97e5ec3dac5f2b WHIRLPOOL 7830d413a59f3eb03b0cb5810e9f8d84aa7f20fd5230b7ac7fedd26b3ba18b6184c686f8fd4963b1c443f5a71fcac6a2e0a831cfc3ac40f09b5532109be723c5
+AUX 5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch 6888 SHA256 eafcc58612eaa9511dddc96ec9043681bf6d525251750b972f5e0989fbb05d61 SHA512 6d1f35f39c15b11ce631477eefcca7ade90cb08e5992839273f97c339ef6bf0deecf9625fdacbad6e8cc61e4fd213e0e1c582c407ac051d99545962e310344fe WHIRLPOOL 34daf7de3969f4f401cf7e84eef0c1fd9e20a07623321ef25f3569affdc635303ee31df6c7d4b7dcd8bb25a7b162f1b9b133ce35bc095a578033e39c1a0ed523
+AUX 5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch 3411 SHA256 583a31160cb953ab8f48d3bcfe128721a6e83058c8478b6b75c211f38e21936d SHA512 1ebfe7a6d06dd2991923cd1142c5c5b09ba2d06a3c7e0cbcb5b0f1d34aee57bf585941c0dd44ab331e9427828e5c63ea7475d673ccd3ec8617b99c59c56229a0 WHIRLPOOL d612956246598589e3613c2923a93d7d9f24136ec40c9bdb30850a6502facdf37fa1a6d77c7049332c1f00a0b77413662a38cbfebbe7fbbd96280bde37242c47
+DIST cfe-4.0.1.src.tar.xz 10933628 SHA256 61738a735852c23c3bdbe52d035488cdb2083013f384d67c1ba36fabebd8769b SHA512 936c9e1626b27e63a4fb11f3c0cb998eeaf9a520ad6e2bcd67cb4352e59e7781ecc700df79794f3fd70473d90b7e2ba418a39038eb0146b68e843f0705c1f964 WHIRLPOOL 1cb56b36e21eab8004eec43d9c0f7377588cdbcd1d654cd0e6d836d43bc68dc0759993215439c1607e09ed3fa1f68b80504a222f73c1b76d3841cdf638dcbef2
+DIST cfe-5.0.0.src.tar.xz 11437024 SHA256 019f23c2192df793ac746595e94a403908749f8e0c484b403476d2611dd20970 SHA512 14acdd622310122b544c952ee5b932b7006d9d8424319f0e3974f2503d40a0cec4200fdd3d813a32ce0d877bcfbb9a5bd5c36f6142b4330e6c814f113ca2efe8 WHIRLPOOL 9d2fff35324621be191cc69b45db472681c9ebdf05aead09510f3178853ac8a179f2c454c2e6513e57f84a99980052671cd9a23d38d6d14b42dfda1853a7844a
+DIST clang-tools-extra-4.0.1.src.tar.xz 581788 SHA256 35d1e64efc108076acbe7392566a52c35df9ec19778eb9eb12245fc7d8b915b6 SHA512 ea26d926f428e62e76cf8a073e63ffe05645f6592e05d7717d5c257908870ae9217727d3e1578227b14eda5937085872463f1a8e99970256179c68b8a92e69e0 WHIRLPOOL 7db97e7164657af786ec49975e730e8731bece87cfeb1e45894be6d5e3455530c17461ce894b263a0cdfee917d97566db49225374112a543f6355419f15c1d8f
+DIST clang-tools-extra-5.0.0.src.tar.xz 646416 SHA256 87d078b959c4a6e5ff9fd137c2f477cadb1245f93812512996f73986a6d973c6 SHA512 bf51c4d851bdc25bd2162e186b3080a30ad523f68859fd3dbce6c1094465382f794917b66406088c3bb1b15bee49821bcef5ef4b1a1e18704596354f7d0639bc WHIRLPOOL ffa57d51ad1b1c3d485f21aaf4cd82336ab6d9291b1e49af07ad05c0c9cc5b529b5571e49a6139c43afb4bcc1e920c1129f3dce73e73792bc965ec9cb8ed1db4
+DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d WHIRLPOOL 1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
+DIST llvm-5.0.0.src.tar.xz 23411980 SHA256 e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a WHIRLPOOL 6a99edbdc3e6726dc8ff9126b110fd7560faac46601407722e6dd80b5d894ff242521dc8fda7f4d879de83dac51c65645a37224f7e8def0d8d2f1e564b0531bb
+DIST llvm-manpages-4.0.1.tar.bz2 87981 SHA256 28fa1dcd4774156247ba253d2d79c81796ef0f0763b4f37c9c5ae27af93f4320 SHA512 d5b3213567c25db58ef364d272314a79c311a80fc21d98c09a5540af45a8190a38f489228663fe9a9b63bf0f2b952c460c4196a8fc8d6f221619f6e7ed2fc415 WHIRLPOOL da897ea8d3713a5c4c10a6320f0e7dd13e0125e942e3444b0e8a2a062b83a8e86e3754be025b89ae00f63f557ec0518ab62d8cd21237962e93c708ca72c8e3f5
+DIST llvm-manpages-5.0.0.tar.bz2 94240 SHA256 5082c316cf09e6c15d76f0b184745bf3392d3fd42a56cf0a5119b45918a67cb9 SHA512 0bccfb00caa0796bed8ea4e591616e025e43d304f05589180820c17f8567fa3a1f1f76c323098ed0d0e4590765415b1c1c272a94c6e2e7544788f4088ef0ffea WHIRLPOOL 410fe9eda01519c7ded00b2ca61dd323bafb3418a0a81fdc5c3b60d64ee80b75a6372ea29eb66a1b1ce6bb020c011cff7d9e896469dd6f9534fc19fb5b5a4696
+EBUILD clang-3.4.2-r100.ebuild 972 SHA256 5b60094c966c0f930365414dd98419666677e6ecd07693945b92569cce07686e SHA512 b42ec4379b4a70eb638ae6a6d45a287cd83f5ac339ac25ade2c6c77bd8d05c208d389d6f09e4cfe567e67d3e616adfbaffa1b1a9a7f35f5ecb7a0e7ccdc720fc WHIRLPOOL 06526a50e151264fd16ff5f274ee585b22ced3dfd74d110aa4a8fa7c3fc7a12c2df79eb413c7b6f1c992cd420af28116556c39cabe1ffb75be410084b20c20ce
+EBUILD clang-3.5.2-r100.ebuild 972 SHA256 532a5f3e7ee6ac2ecd61e60bbc15c694605a431beb641eb3d79978031b934d1c SHA512 1e9a9f67ecd1cea111599376e676c665c6c1e731514a06065751502d221f8c6d7033dc23376f21850a63d036a33fbf241845a9127beca6ee8549348866cdce3e WHIRLPOOL 4ad64fa44b75471d77e84a53ce1821a719e8bdefc9f693f934f11d46a6ee9e2f8e26dca2119ce741f9c5dc18b733e4ac5418d05d26a6070a1f42dfb267db5c08
+EBUILD clang-3.6.2-r100.ebuild 972 SHA256 53853dd1db09fad8943f076aaaa6f4f75347c0b94ef5c72872d5336f13a0a8b2 SHA512 604f7551a0081e7de09875f54a64502e8d2e97341bd44e4d2ae35ecd2392b22b7aea5fdf4923cf196cde1de5711f05868943d3f802d975118426ee43d0877f6f WHIRLPOOL bb01f05889468815adc43ba775029107a696a3f3ee6ee4d11f39ae0ed47235a3a5c58a63f6ab73c36fa7625115d3c4ce5b18bccab31ff9e45000e7ae391965f9
+EBUILD clang-3.7.1-r100.ebuild 1136 SHA256 1d0a5208c02b286ceeaa9fad7811371f34595a53399aeec88422313a77523d17 SHA512 6cf313c813f93b93ea76d53006684912feff171d0738f6d202d996052f9eae731583ed1616fc21d8d493292028577c7e1bbeabc3aee21650653638cdba7e541d WHIRLPOOL 12d32294411e549c1843cb9c6a35077f763cabbfbfe47400d1d70d04e88f6631a36c9810459b92e5251729d082127de1c8f79f16e10e12d8b7e0a93a33345a26
+EBUILD clang-3.8.1-r100.ebuild 1127 SHA256 5b6465d519e47712e96bff101e2c8a116c68e8ed57a2601bbea103294a9c1d73 SHA512 29c01939021f9d73bcf503ec480586fba5660ddd8aa2da00fddd9a8217a63fe83a5e02111720a36192c497e7994e6f400f2e22d258eba9068c29ab4323761ffd WHIRLPOOL 0ac5cd0ea5afcb79261e4b9861c7a6ef19ad26858a65cd55f29024f0c4cb071ef9fa937013d235ee1a67d78d1c9b52270afb4940200f07da1c64289ead0a0ad1
+EBUILD clang-3.9.1-r100.ebuild 1534 SHA256 f47ffa2bc0bf2efc96e5fc8049e3b8d17a6714f196e7391461cb42474a8cb449 SHA512 84a3c016f9db31c6cbcee7620330b76af97702be3e92bd0db6e58883ccc054a792003a374cb5bf9d69b8f7c89165a2853ba495d58cd02d98524cf8025e99bcf0 WHIRLPOOL 36522b37ac7dafbd9a4011f4d9f5daf34dc2e1c2e119f6dcc2775a4e0bb75eeb4ebd6c25ce69c26620f09d9e91d908f3f048b56239ec96e291bee7ae019a110f
+EBUILD clang-4.0.1.ebuild 9523 SHA256 7adfa708e3bbe914f63ed908002a60d19468819e0b2e518de9670d887e22a3ad SHA512 e4fd88774de8671511debd039498b70b640abaaffe49509e4b905950880367560e0cd59c083d3a1ed55fe5be0a46014d7a6264a7db4213a7b29fc4325a8ac2be WHIRLPOOL 8f489c6116926d30a1590571cb7e7a32312d239f4d34327a6dc7e1f0c9b07f572e791a5a64681abcc0d42e8432dc47293d419266d22235ec36bde1fd78ee266d
+EBUILD clang-5.0.0.ebuild 9383 SHA256 349d9e228849c749b39463c12b21b05aa85db97d675b286d0b0c2b78abe28f94 SHA512 100af2724c09bd6645859adf502a4460a8ef06de555a41dd7eca82724980502bfd23225a177333c702d66c11a2565602893a956bce5922950dd013ce49bcca73 WHIRLPOOL c68a6bc993addeca02f08911444d0efec9f7a2be845cb2ac5038c9207e410b5ab370c33f50c41a946fabfb972d0f98370ebd9e20352f91a950248ddd89f7da7c
+EBUILD clang-5.0.9999.ebuild 9330 SHA256 3c81e4b9523db25b85c10e46c36f741dad8323ec509a5532ae83aae1ea76991a SHA512 114eea93b7d4dba8d664d070d9cb6fa667fba1a581930bea469cd4bdb5e0c1797ed3ef1c990305d509a687816f4441a9f5c9b09cb8fd87601fc27bf9bb486b0b WHIRLPOOL 9a6e6d1da94e8b55ced7ca132e37016d7f100f1f1b04f79a257f3a90fa84c1f9ff7668eb60097920fe1d7de77bd16780258fe923fdbaeb9b31b355b9f15b515c
+EBUILD clang-9999.ebuild 8893 SHA256 0347d66fbdd794005447c8fb1875e96e90fe9a47559d372d15539620dee34bcd SHA512 84d827e53596b9a5d34185e8ca5335df8668b2cdda3f51810b24fe24a4ef509cdc09859b5fce682fdb9cc1a76c3f878b07b123ece6401038a2c4a5c2768cc8c2 WHIRLPOOL 37f8dc5ab38c0666391d9d625f94cc2d5e81399b301218d9531c9c4dbc179b2e4e6e07173b8ba0656b2159b6b827f2e1e6b8f9dfb3201447962d84650dca460a
+MISC ChangeLog 16828 SHA256 2c73f89e9b1b1f128aa6e6078ba05d23de1b926f52cf6c1658071635efa66bbb SHA512 7ea480154b342f96d8610a0becd2f48332609eba726ef33c913c65ceda9e5831566680f5b1228f705a1e7e4f78a7980519d3190aaa055c56fd346bca49ba669e WHIRLPOOL 1382f3943d43f12929b67c0a8807933b88d920ee75d01515de839689121153f99750b7de37986b0483bdcaebae3f20802f45a5c21eaa843cbf086e333a7940dd
+MISC ChangeLog-2015 22601 SHA256 3d7c0b50e6f54fa67374a5e53363c1557b36631daddb91bc8f4d4915cb0fee6f SHA512 4e9955602b26d91927115ef7f0017cf3223677cb4be6a046276a30d0b881d03045361d9a15f8a174c43f448ea09f0f0edc16e52b2718c0fdcfe328db705afc5c WHIRLPOOL 33a9711b3298387d125d3cb12cd9479d0df7d08bbb72225f9aa3aab1ecd1094026b743007c93a63241c3ba4b1ff5e0acbb25add109c6c535f8d74d6a5390f925
+MISC metadata.xml 1455 SHA256 03fa999433843757b2e2e3340a8b618522f272eac87d89d65e1517d77185ee1e SHA512 369a87bd551e483e81ff56f5167177b1bcfedf9bc97f501ef2b07bfdfea3a25532f5e86af062568b3b22a53fe07318fd93dc55bd83b453dd10a0f4d3e88cb932 WHIRLPOOL 71b8aa50d5f864596369ce50774e0a81e1143aa128e02ccffc10442153ac92a7ba2fd9c8fe1ee6bbe214566d4d00b7d61c7f96a7bb813a56e749fae952b06bc0
diff --git a/sys-devel/clang/clang-3.4.2-r100.ebuild b/sys-devel/clang/clang-3.4.2-r100.ebuild
new file mode 100644
index 000000000000..7d2979d5fa09
--- /dev/null
+++ b/sys-devel/clang/clang-3.4.2-r100.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib-build
+
+DESCRIPTION="C language family frontend for LLVM (meta-ebuild)"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="UoI-NCSA"
+SLOT="0/3.4"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND="~sys-devel/llvm-${PV}[clang(-),${MULTILIB_USEDEP}]"
+
+# Please keep this package around since it's quite likely that we'll
+# return to separate LLVM & clang ebuilds when the cmake build system
+# is complete.
+
+pkg_postinst() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" ; then
+ #add ccache links as clang might get installed after ccache
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
+
+pkg_postrm() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z ${REPLACED_BY_VERSION} ]]; then
+ # --remove-links would remove all links, --install-links updates them
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
diff --git a/sys-devel/clang/clang-3.5.2-r100.ebuild b/sys-devel/clang/clang-3.5.2-r100.ebuild
new file mode 100644
index 000000000000..a10346be855c
--- /dev/null
+++ b/sys-devel/clang/clang-3.5.2-r100.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib-build
+
+DESCRIPTION="C language family frontend for LLVM (meta-ebuild)"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="UoI-NCSA"
+SLOT="0/3.5"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND="~sys-devel/llvm-${PV}[clang(-),${MULTILIB_USEDEP}]"
+
+# Please keep this package around since it's quite likely that we'll
+# return to separate LLVM & clang ebuilds when the cmake build system
+# is complete.
+
+pkg_postinst() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" ; then
+ #add ccache links as clang might get installed after ccache
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
+
+pkg_postrm() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z ${REPLACED_BY_VERSION} ]]; then
+ # --remove-links would remove all links, --install-links updates them
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
diff --git a/sys-devel/clang/clang-3.6.2-r100.ebuild b/sys-devel/clang/clang-3.6.2-r100.ebuild
new file mode 100644
index 000000000000..a68d706db02c
--- /dev/null
+++ b/sys-devel/clang/clang-3.6.2-r100.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib-build
+
+DESCRIPTION="C language family frontend for LLVM (meta-ebuild)"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="UoI-NCSA"
+SLOT="0/3.6"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE=""
+
+RDEPEND="~sys-devel/llvm-${PV}[clang(-),${MULTILIB_USEDEP}]"
+
+# Please keep this package around since it's quite likely that we'll
+# return to separate LLVM & clang ebuilds when the cmake build system
+# is complete.
+
+pkg_postinst() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" ; then
+ #add ccache links as clang might get installed after ccache
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
+
+pkg_postrm() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z ${REPLACED_BY_VERSION} ]]; then
+ # --remove-links would remove all links, --install-links updates them
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
diff --git a/sys-devel/clang/clang-3.7.1-r100.ebuild b/sys-devel/clang/clang-3.7.1-r100.ebuild
new file mode 100644
index 000000000000..d231d61133ab
--- /dev/null
+++ b/sys-devel/clang/clang-3.7.1-r100.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib-build
+
+DESCRIPTION="C language family frontend for LLVM (meta-ebuild)"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="UoI-NCSA"
+SLOT="0/3.7"
+KEYWORDS="amd64 arm ~arm64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="debug multitarget python +static-analyzer"
+
+RDEPEND="~sys-devel/llvm-${PV}[clang(-),debug=,multitarget?,python?,static-analyzer?,${MULTILIB_USEDEP}]"
+
+# Please keep this package around since it's quite likely that we'll
+# return to separate LLVM & clang ebuilds when the cmake build system
+# is complete.
+
+pkg_postinst() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" ; then
+ #add ccache links as clang might get installed after ccache
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
+
+pkg_postrm() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z ${REPLACED_BY_VERSION} ]]; then
+ # --remove-links would remove all links, --install-links updates them
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
diff --git a/sys-devel/clang/clang-3.8.1-r100.ebuild b/sys-devel/clang/clang-3.8.1-r100.ebuild
new file mode 100644
index 000000000000..2348e5e4b3b6
--- /dev/null
+++ b/sys-devel/clang/clang-3.8.1-r100.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib-build
+
+DESCRIPTION="C language family frontend for LLVM (meta-ebuild)"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+LICENSE="UoI-NCSA"
+SLOT="0/3.8"
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="debug multitarget python +static-analyzer"
+
+RDEPEND="~sys-devel/llvm-${PV}[clang(-),debug=,multitarget?,python?,static-analyzer?,${MULTILIB_USEDEP}]"
+
+# Please keep this package around since it's quite likely that we'll
+# return to separate LLVM & clang ebuilds when the cmake build system
+# is complete.
+
+pkg_postinst() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" ; then
+ #add ccache links as clang might get installed after ccache
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
+
+pkg_postrm() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z ${REPLACED_BY_VERSION} ]]; then
+ # --remove-links would remove all links, --install-links updates them
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
diff --git a/sys-devel/clang/clang-3.9.1-r100.ebuild b/sys-devel/clang/clang-3.9.1-r100.ebuild
new file mode 100644
index 000000000000..bae3ac37f935
--- /dev/null
+++ b/sys-devel/clang/clang-3.9.1-r100.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit multilib-build
+
+DESCRIPTION="C language family frontend for LLVM (meta-ebuild)"
+HOMEPAGE="https://clang.llvm.org/"
+SRC_URI=""
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Mips MSP430
+ NVPTX PowerPC Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="UoI-NCSA"
+# keep in sync with sys-devel/llvm!
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~arm64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="debug multitarget python +static-analyzer ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="~sys-devel/llvm-${PV}[clang(-),debug=,python?,static-analyzer?,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]"
+
+REQUIRED_USE="
+ || ( ${ALL_LLVM_TARGETS[*]} )
+ multitarget? ( ${ALL_LLVM_TARGETS[*]} )"
+
+# Please keep this package around since it's quite likely that we'll
+# return to separate LLVM & clang ebuilds when the cmake build system
+# is complete.
+
+pkg_postinst() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" ; then
+ #add ccache links as clang might get installed after ccache
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
+
+pkg_postrm() {
+ if has_version ">=dev-util/ccache-3.1.9-r2" && [[ -z ${REPLACED_BY_VERSION} ]]; then
+ # --remove-links would remove all links, --install-links updates them
+ "${EROOT}"/usr/bin/ccache-config --install-links
+ fi
+}
diff --git a/sys-devel/clang/clang-4.0.1.ebuild b/sys-devel/clang/clang-4.0.1.ebuild
new file mode 100644
index 000000000000..00c6e7371aec
--- /dev/null
+++ b/sys-devel/clang/clang-4.0.1.ebuild
@@ -0,0 +1,294 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic llvm multilib-minimal \
+ python-single-r1 toolchain-funcs pax-utils versionator
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/cfe-${PV/_/}.src.tar.xz
+ https://releases.llvm.org/${PV/_//}/clang-tools-extra-${PV/_/}.src.tar.xz
+ !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-manpages-${PV}.tar.bz2 )
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC RISCV Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="UoI-NCSA"
+SLOT="$(get_major_version)"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="debug default-compiler-rt default-libcxx +doc +static-analyzer
+ test xml elibc_musl kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
+ static-analyzer? ( dev-lang/perl:* )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ ${PYTHON_DEPS}"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx )
+ test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
+ xml? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+RDEPEND="${RDEPEND}
+ !<sys-devel/llvm-4.0.0_rc:0
+ !sys-devel/clang:0"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
+ default-libcxx? ( sys-libs/libcxx )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ || ( ${ALL_LLVM_TARGETS[*]} )"
+
+# We need extra level of indirection for CLANG_RESOURCE_DIR
+S=${WORKDIR}/x/y/cfe-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+# Multilib notes:
+# 1. ABI_* flags control ABIs libclang* is built for only.
+# 2. clang is always capable of compiling code for all ABIs for enabled
+# target. However, you will need appropriate crt* files (installed
+# e.g. by sys-devel/gcc and sys-libs/glibc).
+# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
+# in the current profile (i.e. alike supported by sys-devel/gcc).
+#
+# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
+# multilib clang* libraries (not runtime, not wrappers).
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ # create extra parent dirs for CLANG_RESOURCE_DIR
+ mkdir -p x/y || die
+ cd x/y || die
+
+ default
+
+ mv clang-tools-extra-*.src "${S}"/tools/extra || die
+ if use test; then
+ mv llvm-*.src "${WORKDIR}"/llvm || die
+ fi
+}
+
+src_prepare() {
+ # fix finding compiler-rt libs
+ eapply "${FILESDIR}"/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
+
+ # fix stand-alone doc build
+ eapply "${FILESDIR}"/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
+
+ # fix value of ATOMIC_*_LOCK_FREE
+ # (backport, temporary reverted upstream because of FreeBSD issues)
+ eapply "${FILESDIR}"/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
+
+ cd tools/extra || die
+ # fix stand-alone test build for extra tools
+ eapply "${FILESDIR}"/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
+ eapply "${FILESDIR}"/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
+ cd - >/dev/null || die
+
+ # User patches
+ eapply_user
+}
+
+multilib_src_configure() {
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(get_version_component_range 1-3 "${llvm_version}")
+
+ local mycmakeargs=(
+ # ensure that the correct llvm-config is used
+ -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # override default stdlib and rtlib
+ -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
+ -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
+
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=$(usex doc)
+ -DLLVM_ENABLE_SPHINX=$(usex doc)
+ -DLLVM_ENABLE_DOXYGEN=OFF
+
+ # workaround pthread
+ -DPTHREAD_LIB=-pthread
+ )
+ use doc && mycmakeargs+=(
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ [[ -x "/usr/bin/clang-tblgen" ]] \
+ || die "/usr/bin/clang-tblgen not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ )
+ fi
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+
+ # provide a symlink for tests
+ if [[ ! -L ${WORKDIR}/lib/clang ]]; then
+ mkdir -p "${WORKDIR}"/lib || die
+ ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake-utils_src_make check-clang
+ # clang-tidy requires [static-analyzer] and tests are not split
+ # correctly, so they are all disabled when static-analyzer is off
+ if multilib_is_native_abi && use static-analyzer; then
+ cmake-utils_src_make check-clang-tools
+ fi
+}
+
+src_install() {
+ MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/clang/Config/config.h
+ )
+
+ multilib-minimal_src_install
+
+ # Move runtime headers to /usr/lib/clang, where they belong
+ mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
+ # move (remaining) wrapped headers back
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ # note: we use two version components here (vs 3 in runtime path)
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(get_version_component_range 1-2 "${llvm_version}")
+ local clang_full_version=$(get_version_component_range 1-3 "${llvm_version}")
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X.Y
+ # - clang -> clang-X.Y
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X.Y
+ # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
+ dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
+ dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
+ done
+
+ # now create target symlinks for all supported ABIs
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ for i in "${clang_tools[@]}"; do
+ dosym "${i}-${clang_version}" \
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
+ dosym "${abi_chost}-${i}-${clang_version}" \
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
+ done
+ done
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ if use kernel_FreeBSD; then
+ rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
+ fi
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # move headers to /usr/include for wrapping & ABI mismatch checks
+ # (also drop the version suffix from runtime headers)
+ rm -rf "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
+ fi
+
+ # install pre-generated manpages
+ if ! use doc; then
+ insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
+ doins "${WORKDIR}/x/y/llvm-manpages-${PV}/clang"/*.1
+ fi
+
+ docompress "/usr/lib/llvm/${SLOT}/share/man"
+ # match 'html' non-compression
+ use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
+ # +x for some reason; TODO: investigate
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+}
+
+pkg_postrm() {
+ if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/clang-5.0.0.ebuild b/sys-devel/clang/clang-5.0.0.ebuild
new file mode 100644
index 000000000000..9761120460e1
--- /dev/null
+++ b/sys-devel/clang/clang-5.0.0.ebuild
@@ -0,0 +1,294 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic llvm multilib-minimal \
+ python-single-r1 toolchain-funcs pax-utils versionator
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/cfe-${PV/_/}.src.tar.xz
+ https://releases.llvm.org/${PV/_//}/clang-tools-extra-${PV/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )
+ !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-manpages-${PV}.tar.bz2 )"
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="UoI-NCSA"
+SLOT="$(get_major_version)"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="debug default-compiler-rt default-libcxx +doc +static-analyzer
+ test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
+ static-analyzer? (
+ dev-lang/perl:*
+ z3? ( sci-mathematics/z3:0= )
+ )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ ${PYTHON_DEPS}"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx )
+ test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
+ xml? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+RDEPEND="${RDEPEND}
+ !<sys-devel/llvm-4.0.0_rc:0
+ !sys-devel/clang:0"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
+ default-libcxx? ( sys-libs/libcxx )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ || ( ${ALL_LLVM_TARGETS[*]} )"
+
+# We need extra level of indirection for CLANG_RESOURCE_DIR
+S=${WORKDIR}/x/y/cfe-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+# Multilib notes:
+# 1. ABI_* flags control ABIs libclang* is built for only.
+# 2. clang is always capable of compiling code for all ABIs for enabled
+# target. However, you will need appropriate crt* files (installed
+# e.g. by sys-devel/gcc and sys-libs/glibc).
+# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
+# in the current profile (i.e. alike supported by sys-devel/gcc).
+#
+# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
+# multilib clang* libraries (not runtime, not wrappers).
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ # create extra parent dir for CLANG_RESOURCE_DIR
+ mkdir -p x/y || die
+ cd x/y || die
+
+ default
+
+ mv clang-tools-extra-*.src "${S}"/tools/extra || die
+ if use test; then
+ mv llvm-*.src "${WORKDIR}"/llvm || die
+ fi
+}
+
+src_prepare() {
+ # fix finding compiler-rt libs
+ eapply "${FILESDIR}"/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
+
+ cd tools/extra || die
+ # fix stand-alone test build for extra tools
+ eapply "${FILESDIR}"/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
+ cd - >/dev/null || die
+
+ # User patches
+ eapply_user
+}
+
+multilib_src_configure() {
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(get_version_component_range 1-3 "${llvm_version}")
+
+ local mycmakeargs=(
+ # ensure that the correct llvm-config is used
+ -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # override default stdlib and rtlib
+ -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
+ -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
+
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # z3 is not multilib-friendly
+ -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ # normally copied from LLVM_INCLUDE_DOCS but the latter
+ # is lacking value in stand-alone builds
+ -DCLANG_INCLUDE_DOCS=$(usex doc)
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
+ )
+ use doc && mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ use z3 && mycmakeargs+=(
+ -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ [[ -x "/usr/bin/clang-tblgen" ]] \
+ || die "/usr/bin/clang-tblgen not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ )
+ fi
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+
+ # provide a symlink for tests
+ if [[ ! -L ${WORKDIR}/lib/clang ]]; then
+ mkdir -p "${WORKDIR}"/lib || die
+ ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake-utils_src_make check-clang
+ # clang-tidy requires [static-analyzer] and tests are not split
+ # correctly, so they are all disabled when static-analyzer is off
+ if multilib_is_native_abi && use static-analyzer; then
+ cmake-utils_src_make check-clang-tools
+ fi
+}
+
+src_install() {
+ MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/clang/Config/config.h
+ )
+
+ multilib-minimal_src_install
+
+ # Move runtime headers to /usr/lib/clang, where they belong
+ mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
+ # move (remaining) wrapped headers back
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ # note: we use two version components here (vs 3 in runtime path)
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(get_version_component_range 1-2 "${llvm_version}")
+ local clang_full_version=$(get_version_component_range 1-3 "${llvm_version}")
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X.Y
+ # - clang -> clang-X.Y
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X.Y
+ # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
+ dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
+ dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
+ done
+
+ # now create target symlinks for all supported ABIs
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ for i in "${clang_tools[@]}"; do
+ dosym "${i}-${clang_version}" \
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
+ dosym "${abi_chost}-${i}-${clang_version}" \
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
+ done
+ done
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ if use kernel_FreeBSD; then
+ rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
+ fi
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # move headers to /usr/include for wrapping & ABI mismatch checks
+ # (also drop the version suffix from runtime headers)
+ rm -rf "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
+ fi
+
+ # install pre-generated manpages
+ if ! use doc; then
+ insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
+ doins "${WORKDIR}/x/y/llvm-manpages-${PV}/clang"/*.1
+ fi
+
+ docompress "/usr/lib/llvm/${SLOT}/share/man"
+ # match 'html' non-compression
+ use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
+ # +x for some reason; TODO: investigate
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+}
+
+pkg_postrm() {
+ if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/clang-5.0.9999.ebuild b/sys-devel/clang/clang-5.0.9999.ebuild
new file mode 100644
index 000000000000..82cff8b91407
--- /dev/null
+++ b/sys-devel/clang/clang-5.0.9999.ebuild
@@ -0,0 +1,298 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils eapi7-ver flag-o-matic git-r3 llvm \
+ multilib-minimal pax-utils python-single-r1 toolchain-funcs
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/clang.git
+ https://github.com/llvm-mirror/clang.git"
+EGIT_BRANCH="release_50"
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="UoI-NCSA"
+SLOT="$(ver_cut 1)"
+KEYWORDS=""
+IUSE="debug default-compiler-rt default-libcxx +doc +static-analyzer
+ test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
+ static-analyzer? (
+ dev-lang/perl:*
+ z3? ( sci-mathematics/z3:0= )
+ )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ ${PYTHON_DEPS}"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx )
+ test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
+ xml? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+RDEPEND="${RDEPEND}
+ !<sys-devel/llvm-4.0.0_rc:0
+ !sys-devel/clang:0"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
+ default-libcxx? ( sys-libs/libcxx )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ || ( ${ALL_LLVM_TARGETS[*]} )"
+
+# We need extra level of indirection for CLANG_RESOURCE_DIR
+S=${WORKDIR}/x/y/${P}
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+# Multilib notes:
+# 1. ABI_* flags control ABIs libclang* is built for only.
+# 2. clang is always capable of compiling code for all ABIs for enabled
+# target. However, you will need appropriate crt* files (installed
+# e.g. by sys-devel/gcc and sys-libs/glibc).
+# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
+# in the current profile (i.e. alike supported by sys-devel/gcc).
+#
+# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
+# multilib clang* libraries (not runtime, not wrappers).
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ # create extra parent dir for CLANG_RESOURCE_DIR
+ mkdir -p x/y || die
+ cd x/y || die
+
+ git-r3_fetch "https://git.llvm.org/git/clang-tools-extra.git
+ https://github.com/llvm-mirror/clang-tools-extra.git"
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ git-r3_checkout https://llvm.org/git/clang-tools-extra.git \
+ "${S}"/tools/extra
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout "${EGIT_REPO_URI}" "${S}"
+}
+
+src_prepare() {
+ # fix finding compiler-rt libs
+ eapply "${FILESDIR}"/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
+
+ cd tools/extra || die
+ # fix stand-alone test build for extra tools
+ eapply "${FILESDIR}"/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
+ cd - >/dev/null || die
+
+ # User patches
+ eapply_user
+}
+
+multilib_src_configure() {
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(ver_cut 1-3 "${llvm_version}")
+
+ local mycmakeargs=(
+ # ensure that the correct llvm-config is used
+ -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # override default stdlib and rtlib
+ -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
+ -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
+
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # z3 is not multilib-friendly
+ -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ # normally copied from LLVM_INCLUDE_DOCS but the latter
+ # is lacking value in stand-alone builds
+ -DCLANG_INCLUDE_DOCS=$(usex doc)
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
+ )
+ use doc && mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ use z3 && mycmakeargs+=(
+ -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ [[ -x "/usr/bin/clang-tblgen" ]] \
+ || die "/usr/bin/clang-tblgen not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ )
+ fi
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+
+ # provide a symlink for tests
+ if [[ ! -L ${WORKDIR}/lib/clang ]]; then
+ mkdir -p "${WORKDIR}"/lib || die
+ ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake-utils_src_make check-clang
+ # clang-tidy requires [static-analyzer] and tests are not split
+ # correctly, so they are all disabled when static-analyzer is off
+ if multilib_is_native_abi && use static-analyzer; then
+ cmake-utils_src_make check-clang-tools
+ fi
+}
+
+src_install() {
+ MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/clang/Config/config.h
+ )
+
+ multilib-minimal_src_install
+
+ # Move runtime headers to /usr/lib/clang, where they belong
+ mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
+ # move (remaining) wrapped headers back
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ # note: we use two version components here (vs 3 in runtime path)
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(ver_cut 1-2 "${llvm_version}")
+ local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X.Y
+ # - clang -> clang-X.Y
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X.Y
+ # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
+ dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
+ dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
+ done
+
+ # now create target symlinks for all supported ABIs
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ for i in "${clang_tools[@]}"; do
+ dosym "${i}-${clang_version}" \
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
+ dosym "${abi_chost}-${i}-${clang_version}" \
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
+ done
+ done
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ if use kernel_FreeBSD; then
+ rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
+ fi
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # move headers to /usr/include for wrapping & ABI mismatch checks
+ # (also drop the version suffix from runtime headers)
+ rm -rf "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
+ fi
+
+ docompress "/usr/lib/llvm/${SLOT}/share/man"
+ # match 'html' non-compression
+ use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
+ # +x for some reason; TODO: investigate
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+}
+
+pkg_postrm() {
+ if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/clang-9999.ebuild b/sys-devel/clang/clang-9999.ebuild
new file mode 100644
index 000000000000..178c15c76134
--- /dev/null
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -0,0 +1,283 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils eapi7-ver flag-o-matic git-r3 llvm \
+ multilib-minimal pax-utils python-single-r1 toolchain-funcs
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/clang.git
+ https://github.com/llvm-mirror/clang.git"
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_EXPERIMENTAL_TARGETS=( AVR Nios2 RISCV WebAssembly )
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC Sparc SystemZ X86 XCore
+ "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}" )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="UoI-NCSA"
+SLOT="6"
+KEYWORDS=""
+IUSE="debug default-compiler-rt default-libcxx +doc +static-analyzer
+ test xml z3 kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${LLVM_TARGET_USEDEPS// /,},${MULTILIB_USEDEP}]
+ static-analyzer? (
+ dev-lang/perl:*
+ z3? ( sci-mathematics/z3:0= )
+ )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ ${PYTHON_DEPS}"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+ doc? ( dev-python/sphinx )
+ test? ( ~dev-python/lit-${PV}[${PYTHON_USEDEP}] )
+ xml? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+RDEPEND="${RDEPEND}
+ !<sys-devel/llvm-4.0.0_rc:0
+ !sys-devel/clang:0"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
+ default-libcxx? ( sys-libs/libcxx )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ || ( ${ALL_LLVM_TARGETS[*]} )"
+
+# We need extra level of indirection for CLANG_RESOURCE_DIR
+S=${WORKDIR}/x/y/${P}
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+# Multilib notes:
+# 1. ABI_* flags control ABIs libclang* is built for only.
+# 2. clang is always capable of compiling code for all ABIs for enabled
+# target. However, you will need appropriate crt* files (installed
+# e.g. by sys-devel/gcc and sys-libs/glibc).
+# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
+# in the current profile (i.e. alike supported by sys-devel/gcc).
+#
+# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
+# multilib clang* libraries (not runtime, not wrappers).
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ # create extra parent dir for CLANG_RESOURCE_DIR
+ mkdir -p x/y || die
+ cd x/y || die
+
+ git-r3_fetch "https://git.llvm.org/git/clang-tools-extra.git
+ https://github.com/llvm-mirror/clang-tools-extra.git"
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ git-r3_checkout https://llvm.org/git/clang-tools-extra.git \
+ "${S}"/tools/extra
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout "${EGIT_REPO_URI}" "${S}"
+}
+
+multilib_src_configure() {
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(ver_cut 1-3 "${llvm_version}")
+
+ local mycmakeargs=(
+ # ensure that the correct llvm-config is used
+ -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # override default stdlib and rtlib
+ -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
+ -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
+
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # z3 is not multilib-friendly
+ -DCLANG_ANALYZER_BUILD_Z3=$(multilib_native_usex z3)
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ # normally copied from LLVM_INCLUDE_DOCS but the latter
+ # is lacking value in stand-alone builds
+ -DCLANG_INCLUDE_DOCS=$(usex doc)
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=$(usex doc)
+ )
+ use doc && mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ use z3 && mycmakeargs+=(
+ -DZ3_INCLUDE_DIR="${EPREFIX}/usr/include/z3"
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ [[ -x "/usr/bin/clang-tblgen" ]] \
+ || die "/usr/bin/clang-tblgen not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ )
+ fi
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+
+ # provide a symlink for tests
+ if [[ ! -L ${WORKDIR}/lib/clang ]]; then
+ mkdir -p "${WORKDIR}"/lib || die
+ ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake-utils_src_make check-clang
+ multilib_is_native_abi && cmake-utils_src_make check-clang-tools
+}
+
+src_install() {
+ MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/clang/Config/config.h
+ )
+
+ multilib-minimal_src_install
+
+ # Move runtime headers to /usr/lib/clang, where they belong
+ mv "${ED%/}"/usr/include/clangrt "${ED%/}"/usr/lib/clang || die
+ # move (remaining) wrapped headers back
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ # note: we use two version components here (vs 3 in runtime path)
+ local llvm_version=$(llvm-config --version) || die
+ local clang_version=$(ver_cut 1-2 "${llvm_version}")
+ local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X.Y
+ # - clang -> clang-X.Y
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X.Y
+ # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED%/}/usr/lib/llvm/${SLOT}/bin/${i}" || die
+ dosym "clang-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}-${clang_version}"
+ dosym "${i}-${clang_version}" "/usr/lib/llvm/${SLOT}/bin/${i}"
+ done
+
+ # now create target symlinks for all supported ABIs
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ for i in "${clang_tools[@]}"; do
+ dosym "${i}-${clang_version}" \
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}-${clang_version}"
+ dosym "${abi_chost}-${i}-${clang_version}" \
+ "/usr/lib/llvm/${SLOT}/bin/${abi_chost}-${i}"
+ done
+ done
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ if use kernel_FreeBSD; then
+ rm "${ED}"usr/lib/clang/${clang_full_version}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
+ fi
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # move headers to /usr/include for wrapping & ABI mismatch checks
+ # (also drop the version suffix from runtime headers)
+ rm -rf "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/$(get_libdir)/clang "${ED%/}"/usr/include/clangrt || die
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"usr/lib/llvm/${SLOT}/share/scan-view
+ fi
+
+ docompress "/usr/lib/llvm/${SLOT}/share/man"
+ # match 'html' non-compression
+ use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
+ # +x for some reason; TODO: investigate
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${SLOT}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+}
+
+pkg_postrm() {
+ if [[ ${ROOT} == / && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch b/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
new file mode 100644
index 000000000000..f52d445eb05b
--- /dev/null
+++ b/sys-devel/clang/files/4.0.1/0001-Frontend-Correct-values-of-ATOMIC_-_LOCK_FREE-to-mat.patch
@@ -0,0 +1,87 @@
+From f1ea62e93cba334828c427146cc2ca7718a9ffb3 Mon Sep 17 00:00:00 2001
+From: Michal Gorny <mgorny@gentoo.org>
+Date: Mon, 9 Jan 2017 20:54:20 +0000
+Subject: [PATCH] [Frontend] Correct values of ATOMIC_*_LOCK_FREE to match
+ builtin
+
+Correct the logic used to set ATOMIC_*_LOCK_FREE preprocessor macros not
+to rely on the ABI alignment of types. Instead, just assume all those
+types are aligned correctly by default since clang uses safe alignment
+for _Atomic types even if the underlying types are aligned to a lower
+boundary by default.
+
+For example, the 'long long' and 'double' types on x86 are aligned to
+32-bit boundary by default. However, '_Atomic long long' and '_Atomic
+double' are aligned to 64-bit boundary, therefore satisfying
+the requirements of lock-free atomic operations.
+
+This fixes PR #19355 by correcting the value of
+__GCC_ATOMIC_LLONG_LOCK_FREE on x86, and therefore also fixing
+the assumption made in libc++ tests. This also fixes PR #30581 by
+applying a consistent logic between the functions used to implement
+both interfaces.
+
+Differential Revision: https://reviews.llvm.org/D28213
+
+git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291477 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ lib/Frontend/InitPreprocessor.cpp | 10 ++++------
+ test/Sema/atomic-ops.c | 4 ----
+ 2 files changed, 4 insertions(+), 10 deletions(-)
+
+diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
+index 17603ada11..4502c92499 100644
+--- a/lib/Frontend/InitPreprocessor.cpp
++++ b/lib/Frontend/InitPreprocessor.cpp
+@@ -286,12 +286,12 @@ static void DefineFastIntType(unsigned TypeWidth, bool IsSigned,
+
+ /// Get the value the ATOMIC_*_LOCK_FREE macro should have for a type with
+ /// the specified properties.
+-static const char *getLockFreeValue(unsigned TypeWidth, unsigned TypeAlign,
+- unsigned InlineWidth) {
++static const char *getLockFreeValue(unsigned TypeWidth, unsigned InlineWidth) {
+ // Fully-aligned, power-of-2 sizes no larger than the inline
+ // width will be inlined as lock-free operations.
+- if (TypeWidth == TypeAlign && (TypeWidth & (TypeWidth - 1)) == 0 &&
+- TypeWidth <= InlineWidth)
++ // Note: we do not need to check alignment since _Atomic(T) is always
++ // appropriately-aligned in clang.
++ if ((TypeWidth & (TypeWidth - 1)) == 0 && TypeWidth <= InlineWidth)
+ return "2"; // "always lock free"
+ // We cannot be certain what operations the lib calls might be
+ // able to implement as lock-free on future processors.
+@@ -881,7 +881,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
+ #define DEFINE_LOCK_FREE_MACRO(TYPE, Type) \
+ Builder.defineMacro("__GCC_ATOMIC_" #TYPE "_LOCK_FREE", \
+ getLockFreeValue(TI.get##Type##Width(), \
+- TI.get##Type##Align(), \
+ InlineWidthBits));
+ DEFINE_LOCK_FREE_MACRO(BOOL, Bool);
+ DEFINE_LOCK_FREE_MACRO(CHAR, Char);
+@@ -894,7 +893,6 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
+ DEFINE_LOCK_FREE_MACRO(LLONG, LongLong);
+ Builder.defineMacro("__GCC_ATOMIC_POINTER_LOCK_FREE",
+ getLockFreeValue(TI.getPointerWidth(0),
+- TI.getPointerAlign(0),
+ InlineWidthBits));
+ #undef DEFINE_LOCK_FREE_MACRO
+ }
+diff --git a/test/Sema/atomic-ops.c b/test/Sema/atomic-ops.c
+index 8ebf3eaed4..d3ebdf67db 100644
+--- a/test/Sema/atomic-ops.c
++++ b/test/Sema/atomic-ops.c
+@@ -14,11 +14,7 @@ _Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK_FREE == 2, "");
+ _Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, "");
+ _Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, "");
+ _Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, "");
+-#ifdef __i386__
+-_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, "");
+-#else
+ _Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, "");
+-#endif
+ _Static_assert(__GCC_ATOMIC_POINTER_LOCK_FREE == 2, "");
+
+ _Static_assert(__c11_atomic_is_lock_free(1), "");
+--
+2.12.0
+
diff --git a/sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch b/sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
new file mode 100644
index 000000000000..0ecd5bc0e8c1
--- /dev/null
+++ b/sys-devel/clang/files/4.0.1/0007-cmake-Support-stand-alone-Sphinx-doxygen-doc-build.patch
@@ -0,0 +1,64 @@
+From 8dd12df445c9a35f7b1c0202eb7c74b954b0980d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sun, 21 Aug 2016 23:31:55 +0200
+Subject: [PATCH 7/7] cmake: Support stand-alone Sphinx & doxygen doc build
+
+Copy the necessary options and configuration checks from LLVM to clang,
+to support stand-alone documentation builds.
+
+Patch: https://reviews.llvm.org/D23758
+---
+ CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8ed8c10..3f34d8c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -162,6 +162,43 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
+ endif()
+ endif()
+
++ option (LLVM_BUILD_DOCS "Build the llvm documentation." OFF)
++ option (LLVM_INCLUDE_DOCS "Generate build targets for llvm documentation." ON)
++ option (LLVM_ENABLE_DOXYGEN "Use doxygen to generate llvm API documentation." OFF)
++ option (LLVM_ENABLE_SPHINX "Use Sphinx to generate llvm documentation." OFF)
++
++ if (LLVM_ENABLE_DOXYGEN)
++ message(STATUS "Doxygen enabled.")
++ find_package(Doxygen REQUIRED)
++
++ if (DOXYGEN_FOUND)
++ # If we find doxygen and we want to enable doxygen by default create a
++ # global aggregate doxygen target for generating llvm and any/all
++ # subprojects doxygen documentation.
++ if (LLVM_BUILD_DOCS)
++ add_custom_target(doxygen ALL)
++ endif()
++
++ option(LLVM_DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF)
++ if (LLVM_DOXYGEN_EXTERNAL_SEARCH)
++ set(LLVM_DOXYGEN_SEARCHENGINE_URL "" CACHE STRING "URL to use for external search.")
++ set(LLVM_DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings")
++ endif()
++ endif()
++ else()
++ message(STATUS "Doxygen disabled.")
++ endif()
++
++ if (LLVM_ENABLE_SPHINX)
++ message(STATUS "Sphinx enabled.")
++ find_package(Sphinx REQUIRED)
++ if (LLVM_BUILD_DOCS)
++ add_custom_target(sphinx ALL)
++ endif()
++ else()
++ message(STATUS "Sphinx disabled.")
++ endif()
++
+ set( CLANG_BUILT_STANDALONE 1 )
+ set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}")
+ else()
+--
+2.9.3
+
diff --git a/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch b/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
new file mode 100644
index 000000000000..3779bc620314
--- /dev/null
+++ b/sys-devel/clang/files/4.0.1/extra/0001-test-Fix-test-dependencies-when-using-installed-tool.patch
@@ -0,0 +1,48 @@
+From f1355920fbe819c5b1f5a870fc76cffcdd6328f0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 10 Feb 2017 22:44:53 +0100
+Subject: [PATCH 1/2] [test] Fix test dependencies when using installed tools
+
+Use the LLVM_UTILS_PROVIDED variable to determine whether test tool
+dependencies should be exposed for clang-tools-extra tests. If clang is
+being built stand-alone and LLVM test tools (FileCheck, count and not)
+are installed, the top-level CMakeLists.txt of clang sets this variable
+to indicate that they will not be built as a part of this build,
+and therefore no dependencies should be emitted for them. This fixes
+the dependency errors when building clang stand-alone with tests
+enabled.
+---
+ test/CMakeLists.txt | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index a852ef60..c26bd5c4 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -31,9 +31,6 @@ if(CLANG_TOOLS_TEST_USE_VG)
+ endif()
+
+ set(CLANG_TOOLS_TEST_DEPS
+- # Base line deps.
+- FileCheck count not
+-
+ # clang-tidy tests require it.
+ clang-headers
+
+@@ -58,6 +55,13 @@ set(CLANG_TOOLS_TEST_DEPS
+ ExtraToolsUnitTests
+ )
+
++if(NOT LLVM_UTILS_PROVIDED)
++ list(APPEND CLANG_TOOLS_TEST_DEPS
++ # Base line deps.
++ FileCheck count not
++ )
++endif()
++
+ add_lit_testsuite(check-clang-tools "Running the Clang extra tools' regression tests"
+ ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${CLANG_TOOLS_TEST_DEPS}
+--
+2.12.0
+
diff --git a/sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch b/sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
new file mode 100644
index 000000000000..7d53cbdef3f3
--- /dev/null
+++ b/sys-devel/clang/files/5.0.0/0001-Driver-Use-arch-type-to-find-compiler-rt-libraries-o.patch
@@ -0,0 +1,136 @@
+From 19e3dc0ce4949cc7f869b4552c6a7f28cd59c3b7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 17 Nov 2016 14:19:18 +0100
+Subject: [PATCH] [Driver] Use arch type to find compiler-rt libraries (on
+ Linux)
+
+Use llvm::Triple::getArchTypeName() when looking for compiler-rt
+libraries, rather than the exact arch string from the triple. This is
+more correct as it matches the values used when building compiler-rt
+(builtin-config-ix.cmake) which are the subset of the values allowed
+in triples.
+
+For example, this fixes an issue when the compiler set for
+i686-pc-linux-gnu triple would not find an i386 compiler-rt library,
+while this is the exact arch that is detected by compiler-rt. The same
+applies to any other i?86 variant allowed by LLVM.
+
+This also makes the special case for MSVC unnecessary, since now i386
+will be used reliably for all 32-bit x86 variants.
+---
+ lib/Driver/ToolChain.cpp | 5 +----
+ .../usr/i686-unknown-linux/lib/.keep | 0
+ .../usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o | 0
+ test/Driver/linux-ld.c | 21 +++++++++++++++++++++
+ test/Driver/nostdlib.c | 2 +-
+ test/Driver/print-libgcc-file-name-clangrt.c | 10 ++++++++--
+ test/Driver/windows-cross.c | 2 +-
+ 7 files changed, 32 insertions(+), 8 deletions(-)
+ create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
+ create mode 100644 test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
+
+diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp
+index 6adc0386ee..7e4222f087 100644
+--- a/lib/Driver/ToolChain.cpp
++++ b/lib/Driver/ToolChain.cpp
+@@ -283,15 +283,12 @@ static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,
+ const llvm::Triple &Triple = TC.getTriple();
+ bool IsWindows = Triple.isOSWindows();
+
+- if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)
+- return "i386";
+-
+ if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)
+ return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)
+ ? "armhf"
+ : "arm";
+
+- return TC.getArchName();
++ return llvm::Triple::getArchTypeName(TC.getArch());
+ }
+
+ std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,
+diff --git a/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep b/test/Driver/Inputs/basic_linux_tree/usr/i686-unknown-linux/lib/.keep
+new file mode 100644
+index 0000000000..e69de29bb2
+diff --git a/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o b/test/Driver/Inputs/basic_linux_tree/usr/lib/gcc/i686-unknown-linux/4.6.0/crtbegin.o
+new file mode 100644
+index 0000000000..e69de29bb2
+diff --git a/test/Driver/linux-ld.c b/test/Driver/linux-ld.c
+index e5aa870866..92b199b9d4 100644
+--- a/test/Driver/linux-ld.c
++++ b/test/Driver/linux-ld.c
+@@ -71,6 +71,27 @@
+ // CHECK-LD-RT: libclang_rt.builtins-x86_64.a"
+ //
+ // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
++// RUN: --target=i686-unknown-linux \
++// RUN: --gcc-toolchain="" \
++// RUN: --sysroot=%S/Inputs/basic_linux_tree \
++// RUN: --rtlib=compiler-rt \
++// RUN: | FileCheck --check-prefix=CHECK-LD-RT-I686 %s
++// CHECK-LD-RT-I686-NOT: warning:
++// CHECK-LD-RT-I686: "{{.*}}ld{{(.exe)?}}" "--sysroot=[[SYSROOT:[^"]+]]"
++// CHECK-LD-RT-I686: "--eh-frame-hdr"
++// CHECK-LD-RT-I686: "-m" "elf_i386"
++// CHECK-LD-RT-I686: "-dynamic-linker"
++// CHECK-LD-RT-I686: "{{.*}}/usr/lib/gcc/i686-unknown-linux/4.6.0{{/|\\\\}}crtbegin.o"
++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0"
++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../../../i686-unknown-linux/lib"
++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib/gcc/i686-unknown-linux/4.6.0/../../.."
++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/lib"
++// CHECK-LD-RT-I686: "-L[[SYSROOT]]/usr/lib"
++// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
++// CHECK-LD-RT-I686: "-lc"
++// CHECK-LD-RT-I686: libclang_rt.builtins-i386.a"
++//
++// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+ // RUN: --target=arm-linux-androideabi \
+ // RUN: --gcc-toolchain="" \
+ // RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
+diff --git a/test/Driver/nostdlib.c b/test/Driver/nostdlib.c
+index a9ef665c57..c9793d968c 100644
+--- a/test/Driver/nostdlib.c
++++ b/test/Driver/nostdlib.c
+@@ -27,5 +27,5 @@
+ //
+ // CHECK-LINUX-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
+ // CHECK-LINUX-NOSTDLIB: "{{(.*[^.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
+-// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i686.a"
++// CHECK-LINUX-NOSTDLIB-NOT: "{{.*}}/Inputs/resource_dir{{/|\\\\}}lib{{/|\\\\}}linux{{/|\\\\}}libclang_rt.builtins-i386.a"
+ // CHECK-MSVC-NOSTDLIB: warning: argument unused during compilation: '--rtlib=compiler-rt'
+diff --git a/test/Driver/print-libgcc-file-name-clangrt.c b/test/Driver/print-libgcc-file-name-clangrt.c
+index 9f8120c31d..28c758881d 100644
+--- a/test/Driver/print-libgcc-file-name-clangrt.c
++++ b/test/Driver/print-libgcc-file-name-clangrt.c
+@@ -6,6 +6,12 @@
+ // CHECK-CLANGRT-X8664: libclang_rt.builtins-x86_64.a
+
+ // RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
++// RUN: --target=i386-pc-linux \
++// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
++// CHECK-CLANGRT-I386: libclang_rt.builtins-i386.a
++
++// Check whether alternate arch values map to the correct library.
++//
++// RUN: %clang -rtlib=compiler-rt -print-libgcc-file-name 2>&1 \
+ // RUN: --target=i686-pc-linux \
+-// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I686 %s
+-// CHECK-CLANGRT-I686: libclang_rt.builtins-i686.a
++// RUN: | FileCheck --check-prefix=CHECK-CLANGRT-I386 %s
+diff --git a/test/Driver/windows-cross.c b/test/Driver/windows-cross.c
+index 5a2fe52b09..78b4981c9d 100644
+--- a/test/Driver/windows-cross.c
++++ b/test/Driver/windows-cross.c
+@@ -59,7 +59,7 @@
+ // RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-ADDRESS-EXE-X86
+
+ // CHECK-SANITIZE-ADDRESS-EXE-X86: "-fsanitize=address"
+-// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i686.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i686.lib" "--undefined" "___asan_seh_interceptor"
++// CHECK-SANITIZE-ADDRESS-EXE-X86: "{{.*}}clang_rt.asan_dynamic-i386.lib" "{{.*}}clang_rt.asan_dynamic_runtime_thunk-i386.lib" "--undefined" "___asan_seh_interceptor"
+
+ // RUN: %clang -### -target armv7-windows-itanium --sysroot %S/Inputs/Windows/ARM/8.1 -B %S/Inputs/Windows/ARM/8.1/usr/bin -fuse-ld=lld-link2 -shared -o shared.dll -fsanitize=tsan -x c++ %s 2>&1 \
+ // RUN: | FileCheck %s --check-prefix CHECK-SANITIZE-TSAN
+--
+2.11.0
+
diff --git a/sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch b/sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
new file mode 100644
index 000000000000..22f6d5685f33
--- /dev/null
+++ b/sys-devel/clang/files/5.0.0/extra/0002-test-Fix-clang-library-dir-in-LD_LIBRARY_PATH-For-st.patch
@@ -0,0 +1,83 @@
+From f3ff810e81c35133f6a7e463d860bcd4ca30be84 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sun, 19 Feb 2017 12:13:04 +0100
+Subject: [PATCH 2/2] [test] Fix clang library dir in LD_LIBRARY_PATH For
+ stand-alone build
+
+Prepend the clang library directory (determined using SHLIBDIR, alike
+in clang) to the LD_LIBRARY_PATH to ensure that just-built clang
+libraries will be used instead of a previous installed version.
+
+When a stand-alone build is performed, LLVM_LIBS_DIR contains the path
+to installed LLVM library directory. The same directory frequently
+contains a previously installed version of clang. SHLIBDIR, on the other
+hand, is always the build-tree directory, and therefore contains
+the freshly built clang libraries.
+
+In a non-stand-alone build, both paths will be the same and therefore
+including them both will not cause any issues.
+---
+ test/Unit/lit.cfg | 9 ++++++---
+ test/lit.cfg | 5 ++++-
+ test/lit.site.cfg.in | 1 +
+ 3 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/test/Unit/lit.cfg b/test/Unit/lit.cfg
+index ff70123c..3a1da187 100644
+--- a/test/Unit/lit.cfg
++++ b/test/Unit/lit.cfg
+@@ -41,14 +41,17 @@ elif platform.system() == 'Windows':
+ shlibpath_var = 'PATH'
+
+ # Point the dynamic loader at dynamic libraries in 'lib'.
++shlibdir = getattr(config, 'shlibdir', None)
++if not shlibdir:
++ lit_config.fatal('No shlibdir set!')
+ llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
+ if not llvm_libs_dir:
+ lit_config.fatal('No LLVM libs dir set!')
+-shlibpath = os.path.pathsep.join((llvm_libs_dir,
++shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir,
+ config.environment.get(shlibpath_var,'')))
+
+ # Win32 seeks DLLs along %PATH%.
+-if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir):
+- shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath))
++if sys.platform in ['win32', 'cygwin'] and os.path.isdir(shlibdir):
++ shlibpath = os.path.pathsep.join((shlibdir, shlibpath))
+
+ config.environment[shlibpath_var] = shlibpath
+diff --git a/test/lit.cfg b/test/lit.cfg
+index bb592936..0e7de849 100644
+--- a/test/lit.cfg
++++ b/test/lit.cfg
+@@ -99,10 +99,13 @@ if clang_tools_binary_dir is not None:
+ clang_tools_dir, llvm_tools_dir, config.environment['PATH']))
+ config.environment['PATH'] = path
+
++ clang_libs_dir = getattr(config, 'clang_libs_dir', None)
++ if not clang_libs_dir:
++ lit_config.fatal('No Clang libs dir set!')
+ llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
+ if not llvm_libs_dir:
+ lit_config.fatal('No LLVM libs dir set!')
+- path = os.path.pathsep.join((llvm_libs_dir,
++ path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir,
+ config.environment.get('LD_LIBRARY_PATH','')))
+ config.environment['LD_LIBRARY_PATH'] = path
+
+diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
+index dfd0164c..f310b59a 100644
+--- a/test/lit.site.cfg.in
++++ b/test/lit.site.cfg.in
+@@ -7,6 +7,7 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
+ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
+ config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@"
+ config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
++config.clang_libs_dir = "@SHLIBDIR@"
+ config.python_executable = "@PYTHON_EXECUTABLE@"
+ config.target_triple = "@TARGET_TRIPLE@"
+
+--
+2.12.0
+
diff --git a/sys-devel/clang/metadata.xml b/sys-devel/clang/metadata.xml
new file mode 100644
index 000000000000..03502538f638
--- /dev/null
+++ b/sys-devel/clang/metadata.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <longdescription>The goal of the Clang project is to create a new C, C++, Objective C and Objective C++ front-end for the LLVM compiler.
+
+Features and Goals
+
+Some of the goals for the project include the following:
+
+End-User Features:
+Fast compiles and low memory use
+Expressive diagnostics
+GCC compatibility
+Utility and Applications:
+
+Modular library based architecture
+Support diverse clients (refactoring, static analysis, code generation, etc)
+Allow tight integration with IDEs
+Use the LLVM BSD License
+Internal Design and Implementation:
+
+A real-world, production quality compiler
+A simple and hackable code base
+A single unified parser for C, Objective C, C++, and Objective C++
+Conformance with C/C++/ObjC and their variants</longdescription>
+ <use>
+ <flag name="default-compiler-rt">Use compiler-rt instead of libgcc as the default rtlib for clang</flag>
+ <flag name="default-libcxx">Use libc++ instead of libstdc++ as the default stdlib for clang</flag>
+ <flag name="multitarget">Build all host targets (default: host only)</flag>
+ <flag name="static-analyzer">Install the Clang static analyzer</flag>
+ <flag name="z3">Enable the static analyzer constraint manager backend using <pkg>sci-mathematics/z3</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/cons/Manifest b/sys-devel/cons/Manifest
new file mode 100644
index 000000000000..506b667f571e
--- /dev/null
+++ b/sys-devel/cons/Manifest
@@ -0,0 +1,7 @@
+DIST cons-2.2.0.tgz 200338 SHA256 05f21f341ef90a7f1d954a0f4429bac7afd05b94bc9fd282e1f0048a6c43c890 SHA512 93b75e293bcd8f9a8ebb4c5f77ec07c72d82493a896e8858603d32f006e7ac7fb8164e901a7927963f66c7973519b1bf2551a6c7ee9c5da1c4e6f61df8bdce7c WHIRLPOOL df72ddacdd889db2eec5223a3449dd05ebc6a85ce33ffb41724f04216a97afca66dd24940512ac0da2a2c4b535d34a9ce487ba01638b12cffbdd85d558f6383f
+DIST cons-2.3.0.tgz 235895 SHA256 c4b8623d22f67acc9c44ebb2db018296b4be1cb6ea877c0952f193c4b1b4507a SHA512 a42b7537fa8c8cc179ff9e608e6cecfaec1ee0b2e1efb9b9b5992ced15867ca05155e87221e5fde6d912b94eac0d1a411c7feb528e882ed65ce9fb2a2d46be12 WHIRLPOOL 5149b2c83f4d5b9fcb7a6bceb8e43898ef26e49db5a09bbe0cbcff4a12cdcf8af245dfa7825999422bdb16104cb34676833fc94c607be00d5b18bf7417fc7ccb
+EBUILD cons-2.2.0.ebuild 560 SHA256 11493b667754e7f827fc2983f665ba3bed49fb67095435022c7555e18a648967 SHA512 23939bb8c865bb4405cf4e8b3592d7e1f7e9452374ef18110a1de3aefcf03c67ef77f45bf062e46fab77c05fa0781f972570e7d498ca1ce8b6f16aa6a5f7abe2 WHIRLPOOL 2eead66b239cd1efb809101ecaf95c926372bf2ec536f6c6998430a6fe58bcb42acffa25249de91d6e49d3fd0ee9db894030035ba7b2ef4d316c0512185b1585
+EBUILD cons-2.3.0.ebuild 622 SHA256 d079da01a3bc9320423a26c9a331fb425a00a13fb13967550ad9820ca781ab23 SHA512 9d4b3aabc6f2352143db73320c1f189eda9513c98b80fc75f6194bfa820211267a116f83e44d3c58b901f7410c491814e25f6381a65bf8312e2c88b3da924f90 WHIRLPOOL 40fec5a1336fbfde789ff00b1086ca6c3a62aab2910c771fa5c4e47657b552486724e51cf61e09d348378396bdf78202fa4e812a6ae99b6c4f937d01f97f122c
+MISC ChangeLog 2918 SHA256 a337519d4a0f56cedc2456f8e6337a3c8cede27bcde3f62ea31710bfa0bf5c3a SHA512 46325ce07226b11d9068cddc414861704da0b731c27a38cb8964fe730ce60024477f163d66ca69f81bcdca4d5472fabf883ed0b13ab0bca26fd02a0fd6762934 WHIRLPOOL eaf31c5228d7a5ee3cec1a9302e71078b5884d90a23afc9157bac003046eb1044dec0baa7258496aeaa8624f0a6630ed2a3a9eea0a458740b8ba41739a285d0d
+MISC ChangeLog-2015 1325 SHA256 5d839c99224442403bcfa067ebbc8c1385ecd36146bcab9525f8919ace4c13ff SHA512 e2f7cda325834aec53ada8d969d9e1b4857b77d0711ccd9f613eedc7f66cc2176b5fdebef1a0f0fbb96e3df1ec5ccc6e9eea178440495ec0331f990f669daf8d WHIRLPOOL 959dbca94585a7795d0c6433b25d96013c9760448b2aa2ca3f52ca9f3971a4a78676d2e901a9f100fa02b9149cb0a16292928a38aceb9e5be94b0d9f97ed28f0
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/cons/cons-2.2.0.ebuild b/sys-devel/cons/cons-2.2.0.ebuild
new file mode 100644
index 000000000000..cdf2e6e580b1
--- /dev/null
+++ b/sys-devel/cons/cons-2.2.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION="Extensible perl-based build utility"
+SRC_URI="http://www.dsmit.com/cons/stable/${P}.tgz"
+HOMEPAGE="http://www.dsmit.com/cons/"
+
+SLOT="2.2"
+LICENSE="GPL-2"
+KEYWORDS="alpha ~amd64 ppc ~sparc x86"
+IUSE=""
+
+DEPEND="
+ dev-lang/perl
+ virtual/perl-Digest-MD5"
+RDEPEND="
+ ${DEPEND}
+ !sci-biology/emboss"
+
+src_install() {
+ dobin cons || die
+ dodoc CHANGES INSTALL MANIFEST README RELEASE TODO || die
+ dohtml *.html || die
+ doman cons.1.gz || die
+}
diff --git a/sys-devel/cons/cons-2.3.0.ebuild b/sys-devel/cons/cons-2.3.0.ebuild
new file mode 100644
index 000000000000..257a401a9a8b
--- /dev/null
+++ b/sys-devel/cons/cons-2.3.0.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Extensible perl-based build utility"
+HOMEPAGE="https://www.gnu.org/software/cons/"
+SRC_URI="https://www.gnu.org/software/${PN}/stable/${P}.tgz
+ https://www.gnu.org/software/${PN}/dev/${P}.tgz"
+
+SLOT="2.2"
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+IUSE=""
+
+DEPEND="
+ dev-lang/perl
+ virtual/perl-Digest-MD5"
+RDEPEND="
+ ${DEPEND}
+ !sci-biology/emboss"
+
+src_install() {
+ dobin cons
+ dodoc CHANGES INSTALL MANIFEST README RELEASE TODO
+ docinto html
+ dodoc *.html
+ doman cons.1.gz
+}
diff --git a/sys-devel/cons/metadata.xml b/sys-devel/cons/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/cons/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/crossdev/Manifest b/sys-devel/crossdev/Manifest
new file mode 100644
index 000000000000..0c85dca0affb
--- /dev/null
+++ b/sys-devel/crossdev/Manifest
@@ -0,0 +1,10 @@
+AUX use-new-path-for-functions.sh.patch 302 SHA256 eac11ea66ab3c9cef60f17f0ae7d413b7bf58617fc091f9993bc0b913e58ad95 SHA512 539d3bfaaef536958fd2018fd957c83ecf98eaf0b0a5a5360088ae4896a4bf0f51b417d73d21a21f946e8a84ac38115cb4c1700b5b6c1b0480b49f229469a5d3 WHIRLPOOL 15243aa10740c59bf1d77b68bdabc298211823dae172c90850da0f7c503a542c30255f61c496ec82c982546f00e0cbcce00fa2efbb8bce0f941aabd9837c3fe9
+DIST crossdev-20151026.tar.xz 22160 SHA256 ad5ff1cc334325f83f60f87f9a6d795c606317665042cece9d8f12297312ca28 SHA512 f60efd4ad867efd0eb33de5fe327ccbfe73b574c97507bc0edd7ef141ad74c035ae2a0d446180e6a9eb5f43197f44933a452245feec849bacfb03fc07067edd0 WHIRLPOOL 7a8f556e53e7142ccf9c56d6daf700b33d66e530d85e5a5ed5b154a52bbba450956381af06f7b5748a6a82a43666a8c1b7d879296869dadd090e8887fc623ea9
+DIST crossdev-20160602.tar.xz 22292 SHA256 12dcbbdedc3f89a7b782c2b61c2956da050cfc95eef860a2f2701bfc89c77ce9 SHA512 580cc51e599086a14c51153e656d30b5c2f0e08c7601384d3e082716edeaa532e832b515df2517618cc51be187fcf8738db10e412a5635a16d0bb58b1631a53e WHIRLPOOL 7ccc23cd01030e1b55266784448187ab30ded10b229b03886faf739fd5d1ed07d73c60fb950c1c28c81e7dd309324bd740d8439640113241f493973ba79b53cd
+EBUILD crossdev-20151026-r1.ebuild 965 SHA256 68480dda88b0f5adf07f9ecf0669c0d1abf78dad60dad09b205933f1ca738aa5 SHA512 cd4084c2dcf43b410e35d4a99bc04b3fec726b3665834acb5dfd6403ec1cad86632a424fcac8afc72f98b3ab37f15e4de8ebb783c9dee81d4a472902a08b9da5 WHIRLPOOL 54d4a2d3fc80bd5d31d01729a792cea58d9b90ba478d5c3dc615035bb0af7364dba42c0674af6a1b9b7647f0aba246049a3595cc7c70c23067216d4608c701ce
+EBUILD crossdev-20160602-r1.ebuild 927 SHA256 88ad6609bbbbcd7b3af4770ea6ec71c6b7af3c2ef7619d68295d76bd43c18c28 SHA512 fb4831d068fbf4014322bea03ad49a4d458d2f0adff9a2d2a712215869bc5d8c057c6efca4e0f2997926cbecb343c9dee57441861317c38630d37fa4902560e7 WHIRLPOOL 3a659d2d084c2064fad9d6a1dfa217352978784ae667b14af8592790b2538b133b1087796dee478264b1366405b261d3d1e2db7661139ac59fb68dac0af12d98
+EBUILD crossdev-20160602.ebuild 978 SHA256 dee066c408d4f1f28abd288f44ff371cf1568266f16ed3deffcca580357fee85 SHA512 234953b134b82e5119e3333ab8b90c24dadcf6c498ac5f9be1a45d94f0c65f9b11b4d759a59a59284fc49ac20304777f8e05c7ee3d8920668f207d8df6fc8e2f WHIRLPOOL fe0608dafe2ac6c0449305e603a1a3bfe568e0de07eaafe2774dd70babed2eaed28aed5b1d34ac6998fe8076ebd88ef4cff7e285d800e142d6b62773b262f857
+EBUILD crossdev-99999999.ebuild 927 SHA256 88ad6609bbbbcd7b3af4770ea6ec71c6b7af3c2ef7619d68295d76bd43c18c28 SHA512 fb4831d068fbf4014322bea03ad49a4d458d2f0adff9a2d2a712215869bc5d8c057c6efca4e0f2997926cbecb343c9dee57441861317c38630d37fa4902560e7 WHIRLPOOL 3a659d2d084c2064fad9d6a1dfa217352978784ae667b14af8592790b2538b133b1087796dee478264b1366405b261d3d1e2db7661139ac59fb68dac0af12d98
+MISC ChangeLog 7302 SHA256 81a0251e4cdc95041916226306b71aecca0e1204c1c2aea962fa800aa3bad179 SHA512 51c9f31a5887a6b55b0c2cb63279e62644baf9729e60b97c8f9222ed23f5b1eadad1a1aeeff81737e875404602b68bf672beb8a61345485d5fdc2dbbc1b1e893 WHIRLPOOL b5b953e13badceb3fb2b395498e0cacf56c59d6b04380ae76fcf980636e31f2e670621632c99af9d2d9ce49d59d2a8a97e5db111a85eb4df7f68f043ad4b50a0
+MISC ChangeLog-2015 21393 SHA256 a745a149451a73b6ec5524cdd805f5673aa53962414c51cb87e82ae626c696b6 SHA512 60d6f1b4b631b64a5a05ee1bc128e8e63f84852d434831a1d6f115d921bc9a70802a2ed6fe69983ad3af37d0fc314eb13aa03534f9b15de92a79d02d8ba592dc WHIRLPOOL 52b94d9cd41b844964ec49656879be0fc68bc9578a205cca32bd3004894fdb15c8f2cca9105b85a205567c14ee2806c698173740a4c3826cb967a625206b42d1
+MISC metadata.xml 430 SHA256 8097c98d7a184fc7efc881911e122a84127583a95bba9ba530dbc6fb62dab4fe SHA512 6a05b45977ecc06a9862ba62380f056148ea99a990f26769591e2ba4f2dc0ab231e292cb29371a3ad5d2ee77b7725e6df1271bbf141c32118abb83e4dd4d0212 WHIRLPOOL f812d97ee9896b88d922e722cdda38375f56a9e8d1b4b7d73f2898000cb86239c2716e164aaeb145c368200b17c3a9a88aa16712c0f67395a60dfbaf09ce6870
diff --git a/sys-devel/crossdev/crossdev-20151026-r1.ebuild b/sys-devel/crossdev/crossdev-20151026-r1.ebuild
new file mode 100644
index 000000000000..e13edd3253a3
--- /dev/null
+++ b/sys-devel/crossdev/crossdev-20151026-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit eutils
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/crossdev.git"
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="Gentoo Cross-toolchain generator"
+HOMEPAGE="https://www.gentoo.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=sys-apps/portage-2.1
+ >=app-portage/portage-utils-0.55
+ app-shells/bash
+ sys-apps/gentoo-functions
+ !sys-devel/crossdev-wrappers"
+DEPEND="app-arch/xz-utils"
+
+src_prepare() {
+ epatch "${FILESDIR}"/use-new-path-for-functions.sh.patch
+}
+
+src_install() {
+ default
+ if [[ "${PV}" == "99999999" ]] ; then
+ sed -i "s:@CDEVPV@:${EGIT_VERSION}:" "${ED}"/usr/bin/crossdev || die
+ fi
+}
diff --git a/sys-devel/crossdev/crossdev-20160602-r1.ebuild b/sys-devel/crossdev/crossdev-20160602-r1.ebuild
new file mode 100644
index 000000000000..aa413719ace2
--- /dev/null
+++ b/sys-devel/crossdev/crossdev-20160602-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+if [[ ${PV} == "99999999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/crossdev.git"
+else
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="Gentoo Cross-toolchain generator"
+HOMEPAGE="https://www.gentoo.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=sys-apps/portage-2.1
+ >=app-portage/portage-utils-0.55
+ app-shells/bash
+ sys-apps/gentoo-functions
+ !sys-devel/crossdev-wrappers"
+DEPEND="app-arch/xz-utils"
+
+PATCHES=(
+ "${FILESDIR}"/use-new-path-for-functions.sh.patch
+)
+
+src_install() {
+ default
+ if [[ "${PV}" == "99999999" ]] ; then
+ sed -i "s:@CDEVPV@:${EGIT_VERSION}:" "${ED%/}"/usr/bin/crossdev || die
+ fi
+}
diff --git a/sys-devel/crossdev/crossdev-20160602.ebuild b/sys-devel/crossdev/crossdev-20160602.ebuild
new file mode 100644
index 000000000000..c8ea4e1ecb32
--- /dev/null
+++ b/sys-devel/crossdev/crossdev-20160602.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+inherit eutils
+
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/crossdev.git"
+ inherit git-2
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="Gentoo Cross-toolchain generator"
+HOMEPAGE="https://www.gentoo.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=sys-apps/portage-2.1
+ >=app-portage/portage-utils-0.55
+ app-shells/bash
+ sys-apps/gentoo-functions
+ !sys-devel/crossdev-wrappers"
+DEPEND="app-arch/xz-utils"
+
+src_prepare() {
+ epatch "${FILESDIR}"/use-new-path-for-functions.sh.patch
+}
+
+src_install() {
+ default
+ if [[ "${PV}" == "99999999" ]] ; then
+ sed -i "s:@CDEVPV@:${EGIT_VERSION}:" "${ED}"/usr/bin/crossdev || die
+ fi
+}
diff --git a/sys-devel/crossdev/crossdev-99999999.ebuild b/sys-devel/crossdev/crossdev-99999999.ebuild
new file mode 100644
index 000000000000..aa413719ace2
--- /dev/null
+++ b/sys-devel/crossdev/crossdev-99999999.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+if [[ ${PV} == "99999999" ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="git://anongit.gentoo.org/proj/crossdev.git"
+else
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="Gentoo Cross-toolchain generator"
+HOMEPAGE="https://www.gentoo.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+RDEPEND=">=sys-apps/portage-2.1
+ >=app-portage/portage-utils-0.55
+ app-shells/bash
+ sys-apps/gentoo-functions
+ !sys-devel/crossdev-wrappers"
+DEPEND="app-arch/xz-utils"
+
+PATCHES=(
+ "${FILESDIR}"/use-new-path-for-functions.sh.patch
+)
+
+src_install() {
+ default
+ if [[ "${PV}" == "99999999" ]] ; then
+ sed -i "s:@CDEVPV@:${EGIT_VERSION}:" "${ED%/}"/usr/bin/crossdev || die
+ fi
+}
diff --git a/sys-devel/crossdev/files/use-new-path-for-functions.sh.patch b/sys-devel/crossdev/files/use-new-path-for-functions.sh.patch
new file mode 100644
index 000000000000..6d45575a7d9d
--- /dev/null
+++ b/sys-devel/crossdev/files/use-new-path-for-functions.sh.patch
@@ -0,0 +1,11 @@
+--- a/crossdev.orig 2016-02-18 12:28:49.926442767 -0200
++++ b/crossdev 2016-02-18 12:32:25.962433210 -0200
+@@ -15,7 +15,7 @@
+
+ CONFIGROOT="${PORTAGE_CONFIGROOT}/etc/portage"
+
+-source /etc/init.d/functions.sh || exit 1
++source /lib/gentoo/functions.sh || exit 1
+ esyslog() { :; }
+ die_logs() {
+ echo
diff --git a/sys-devel/crossdev/metadata.xml b/sys-devel/crossdev/metadata.xml
new file mode 100644
index 000000000000..a9e5c80cceaa
--- /dev/null
+++ b/sys-devel/crossdev/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+<email>crossdev@gentoo.org</email>
+<name>Gentoo Crossdev Team</name>
+</maintainer>
+<maintainer type="person">
+<email>vapier@gentoo.org</email>
+</maintainer>
+<maintainer type="project">
+<email>embedded@gentoo.org</email>
+<name>Embedded Gentoo</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/ct-ng/Manifest b/sys-devel/ct-ng/Manifest
new file mode 100644
index 000000000000..4e6c6cc5d3a5
--- /dev/null
+++ b/sys-devel/ct-ng/Manifest
@@ -0,0 +1,7 @@
+DIST crosstool-ng-1.22.0.tar.bz2 1621476 SHA256 d6338a9b33f9d972167049bbe76e88b1e9248466a53df08dcfe8bcfe849d8d83 SHA512 986c93435bd2115a7e19b3068aaa6deb9fea8056b389fc5cc578cbef3652514e1e794089cd9a4282f0e0bf73cf8d9e480b68aeabe7c16b627e7ad5afe46fcc9c WHIRLPOOL f339613d73be64032f7a0963e86457a9edf2d10105c73808ea4db0fe0ce1cd7df437995a92dbb2247d80401dbbb6103296a68a15362c434b622217529a89c309
+DIST crosstool-ng-1.23.0.tar.bz2 1782247 SHA256 1b76404960f2b35471b6385ba707b8a4712431820fe30063e435dad97ccb02b4 SHA512 1842d140b1c4f76783751eab60722e8077f356dfc9e9cc941d3c991a7e9bb23cb19e6bd7cd5c630cc87967853c55e0c16e415b222e546b5baaffb264ca799b69 WHIRLPOOL 5ecc52e6fed0fd1c54f9192f29686f2d77fa29d95086b40435eeb29fc0be9b7f2512ac881a696141608b0e7c0a9041012e8fd0c2f90bd854c651b3e77f47cfa5
+EBUILD ct-ng-1.22.0.ebuild 739 SHA256 b38670f5ce570c97ffec2ec0e1bdf70c5d352ea3678084ebb2282e81f512f2f6 SHA512 3483706b8cef6491cdcbf90124e5bf10a42d3d9f756696b44135280fb82ab50f080e15631434f3a5d11e639f7aeb1a2152bf72f162734de25470d02cf456cb4e WHIRLPOOL 083e96c7848da22566159478d2f8da9c0e72c32be95d39f3eaa34a3f1c2395d1748ced1cfc05f3a3f02b61f8a6a9c24e2b887503efb9be5408a9b4b684013763
+EBUILD ct-ng-1.23.0.ebuild 740 SHA256 a2a9487c14d498f5a7e6734cf86f2112680dc07138de211070c3e351b46af776 SHA512 01f207da8f59795c4415d3817d0d573c391432b8c312105b97c0d604ed40ff07110bb5564ef6fcc6828c7690e97c1e7d46771aa1c84e520985a4ea1b96838434 WHIRLPOOL 4fbd2124a61a3827b9f6074d8134f26b5b113d1d1168b59ec1395ab1dd762274c06d01b6452732b1767f185d72754219cb3e9928e1fdd4d98a0dc433f1c38bd5
+MISC ChangeLog 2667 SHA256 4ad3e649eb0d14bdcf843da2fd0a0fae3333e11c82fc56d904d9ce35502b28ce SHA512 73f471b75a0c8ab32b698e51993c2d36e53e2eb8ed68823666058edcd4382a3890706ae3853b8a1a30f067aff5e02b6ea6678ca9d87f5ffd90f10e7163c7a6d2 WHIRLPOOL 762ddccd269121dbb3e48c20017844fcfd07ef28e9a60a37a0e2280c4d8f1ae565338d121b747b19f6cd42f4f68b237e788a721b652b01e89de1a73a3cd36d41
+MISC ChangeLog-2015 7728 SHA256 3b941b15bfeda6ea4eae233b1ff4f5daa4ec24239c4ad41723581ee573ef4f0e SHA512 89fd5ea21133b6dfb1531eada4a02b7260a73bf3bcb8d3b3f06083df4e839f13e23da54f59d85ac352e3ac9e858d813f3b78d53e372e4c54644680fa7fd9e070 WHIRLPOOL 0e382b99c8c18ac0ce0febdd1c1ca035025ad4d15b114f4091e8456e86ee5f790bdb11e4601c2ac0242d76413e3c128ad3f1b1e0525272b7923c332c10f3da21
+MISC metadata.xml 694 SHA256 072ca6ef9bd25f368278cf21ece9b9bb3be771abf64fa89417f28c2c10a3e56c SHA512 a53f2563b6f39e90fb0814acd891507f43f68701390cdcca87d674eed47dc94f5f0d98d47cfe6054a6861fa3931129181563b38ee18fdbceeb42794fb2915eb9 WHIRLPOOL 2769447277ba89488c9f9badf6b41504f82bdce09feb01e0b1f08d1466929338552ebac669a575d37dbfff53f0a12aa6c431d1c88d35512545ddb1391d4b7aaf
diff --git a/sys-devel/ct-ng/ct-ng-1.22.0.ebuild b/sys-devel/ct-ng/ct-ng-1.22.0.ebuild
new file mode 100644
index 000000000000..a1002aaa002b
--- /dev/null
+++ b/sys-devel/ct-ng/ct-ng-1.22.0.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit bash-completion-r1
+
+DESCRIPTION="crosstool-ng is a tool to build cross-compiling toolchains"
+HOMEPAGE="http://crosstool-ng.org"
+MY_P=${P/ct/crosstool}
+SRC_URI="http://ymorin.is-a-geek.org/download/crosstool-ng/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc"
+
+RDEPEND="net-misc/curl
+ <dev-util/gperf-3.1
+ dev-vcs/cvs
+ dev-vcs/subversion"
+
+S="${WORKDIR}/crosstool-ng"
+
+src_install() {
+ emake DESTDIR="${D%/}" install
+ newbashcomp ${PN}.comp ${PN}
+ use doc && mv "${D}"/usr/share/doc/crosstool-ng/crosstool-ng-${PVR} \
+ "${D}"/usr/share/doc/
+ rm -rf "${D}"/usr/share/doc/crosstool-ng
+}
diff --git a/sys-devel/ct-ng/ct-ng-1.23.0.ebuild b/sys-devel/ct-ng/ct-ng-1.23.0.ebuild
new file mode 100644
index 000000000000..42a61e626953
--- /dev/null
+++ b/sys-devel/ct-ng/ct-ng-1.23.0.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit bash-completion-r1
+
+DESCRIPTION="crosstool-ng is a tool to build cross-compiling toolchains"
+HOMEPAGE="http://crosstool-ng.org"
+MY_P=${P/ct/crosstool}
+SRC_URI="http://ymorin.is-a-geek.org/download/crosstool-ng/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc"
+
+RDEPEND="net-misc/curl
+ dev-util/gperf
+ dev-vcs/cvs
+ dev-vcs/subversion"
+
+S="${WORKDIR}/crosstool-ng-${PV}"
+
+src_install() {
+ emake DESTDIR="${D%/}" install
+ newbashcomp ${PN}.comp ${PN}
+ use doc && mv "${D}"/usr/share/doc/crosstool-ng/crosstool-ng-${PVR} \
+ "${D}"/usr/share/doc/
+ rm -rf "${D}"/usr/share/doc/crosstool-ng
+}
diff --git a/sys-devel/ct-ng/metadata.xml b/sys-devel/ct-ng/metadata.xml
new file mode 100644
index 000000000000..3b7e79d9f1df
--- /dev/null
+++ b/sys-devel/ct-ng/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>blueness@gentoo.org</email>
+ <name>Anthony G. Basile</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>hwoarang@gentoo.org</email>
+ <name>Markos Chandras</name>
+ </maintainer>
+ <longdescription lang="en">
+ crosstool-NG is a utility for building cross-compiling toolchains.
+ It will only build the toolchain. It is up to use how you want to
+ use it after that.
+
+ It is an alternative to sys-devel/crossdev.
+
+ For more information, see http://ymorin.is-a-geek.org/projects/crosstool
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-devel/dev86/Manifest b/sys-devel/dev86/Manifest
new file mode 100644
index 000000000000..37ad4437a2bb
--- /dev/null
+++ b/sys-devel/dev86/Manifest
@@ -0,0 +1,12 @@
+AUX dev86-0.16.19-fortify.patch 325 SHA256 1a10082f8bfcd0e1e5335c53b0243994360dcdc75d9c3da431bc069e76a1af44 SHA512 04195831db5802ae25a5a1957979b5439168c708d9d3702a62c1d267090fca59e565ac78bb3a6bfb312282ce002b52760903e9d4ab30f3c906568a70dc349696 WHIRLPOOL 600dd6ab2947b593d65e220307faa7a95b23140c6c02c329b28d4857101b58d127631c5a22f3b41e811cfa772577071e86ad105de34965afcb03102c405eede9
+AUX dev86-0.16.19-memmove.patch 401 SHA256 f8a0db2d1f9bd944fa3e5a918fe6fc990820883d0dd8046c55429e10318b4ca5 SHA512 4fa5ee815636048db2a0f5faeeb48b06e559639fb21be1db3319495bfe5f5e1ee1afcfc920d496845cf4bb3eae7ff4bf9aa77124638788f918ae27599d153a6a WHIRLPOOL 6e54a52fa49a846353d63b1e89b74e017a64ffe6a33b256a58ed21aeb7df76c72ec47bffc17058e749910194a8acb3dd44c5535a9e76d88a5a88211c6f077008
+AUX dev86-0.16.21-non-void-return-clang.patch 425 SHA256 b70f642d85c76ad407ec070d3b44d9a4264fc653f1ee1404c2c105a5472032e8 SHA512 57781aab833999b86d57a4c62d686b61f11a64225debf82ca57252bfe5043d0bdef04749bbbf3e1af73a6d40242ebd5efa41b147e4677b7c8ed4b071c5100318 WHIRLPOOL e6de7774e46f353fae44b16915e3f22f950974218b0d96bcec7c846e62357d772f26ec27bc75241ce72aa0e8a815a667a128f0c3c78ccf9d81a7940f91bc7d9f
+AUX dev86-pic.patch 574 SHA256 8609db79d42d7b6a71b512de264279d9f0502dc0855a42eb38f5a8f8ba4f1d7f SHA512 44f0649fbb4b2514ecdd54c988db1a5547d68afed2bff7ebe15163ff287fd4be81bc2d700ed92414caea5c967b7455817fdefd1d19a86609221940a495b5ceda WHIRLPOOL 5e399825ad525400d1dd11899ab14cb789538d489a35e8393e00a6f804417c8854e9c322073b3dfeb014a270e5c2dd690bbb0957ec7db66ee8cffceb084b34bb
+DIST Dev86src-0.16.19.tar.gz 713688 SHA256 33398b87ca85e2b69e4062cf59f2f7354af46da5edcba036c6f97bae17b8d00e SHA512 4077f7ac800330eb4658ffaa53dc8cc982792b1dcd7a59625cba4a5dac494117c6bd4ec5307bf02349ad6ae3d0c0903ab2e41123a8df94373e469092fa005cd3 WHIRLPOOL 87862b606be25f81c2c487534f36b20ac04d1df4303d644a46563e9f382686574dbe650c80265d44e53913f5bda7503c35cf056f7ffd8c5e559729e36c9db4d2
+DIST Dev86src-0.16.21.tar.gz 717215 SHA256 234b110e6df9b7f6843e2ee53473127c2211243a16748f229fc0127845f68d94 SHA512 6d35dc3c7f9735cf7967cdb2bc0f7bee967ae26667cd8cef56bbdf7d7855ef1d35057db4c0031ff86b9b95d3c8ee44aff408446115b35b6c10cf207a33838016 WHIRLPOOL a60b6c30bf4367e250942d2debe4baaf139908adf2f3b97139e3b29788d1ae8a1c97c63c016bf0c546336458de95e390b2db9e3d525ec4526f86250ad3538a8f
+EBUILD dev86-0.16.19.ebuild 1820 SHA256 41d606ae089ffc527b7b8368c7b4ef06a526a0dc6455667fe2b70f416c6beb30 SHA512 cd093d1ebea014f8f842ee5a70dbec7aa25c636211c56caf11e89b37a6625110488ba72a8cbdf10796c2b64b4d1a1d5831f3a99bfd7788bfcf6245a4d25f2c80 WHIRLPOOL de698a3205aec13f405ff229d434d11990ad6cda3b8702d888881763d33ed640768f6a3a3a5d8775541ae33d1b9138cace47b9585371a4bb40cfe715e7ac431b
+EBUILD dev86-0.16.21-r2.ebuild 1843 SHA256 4413cba09c1f273b263c7771940affbb0e2f81dc9239e9b7d629bee6c6cd477b SHA512 1b7d8213232bded080c8f78df9b16931b0d22493c4510963ee9e98ea6b142d008a046496e580d25e77f96dde1453838dbd6d6c847020e41dbc993a921b17dfde WHIRLPOOL 3b8304ca5798f74d0ab9e0ee101f3421c320e30e9ffc1711531d0cf011b2eca52c63008ddde866a7ed71b33ae26499f831829122b30518b975a6a9876e2d1505
+EBUILD dev86-0.16.21.ebuild 1780 SHA256 bff1dee28838c30cb6d69a5fe7e42ea5e92361a8403d9f779683e9d400b018cf SHA512 0ac3ea2a1768b57f5999006d88f0b7620993b8dd4c8c55cf04f7d24231899fe8492264ff1f040b443d5ff4a46d242212490ba110839d5ec7bb914af6ee37babd WHIRLPOOL fd0a5089e171bd62fb79f1077203b981bf8bf9205dde267f3f62c45513a3929a05c2b68655622c533704681aa40b2b58667ee149a0c396b297692c30c559f8d4
+MISC ChangeLog 3330 SHA256 f5e32a8256f396ca05157c6cef5f49f89076f47c564169e75ceb986129223d53 SHA512 5f151bbd69197e903799442964803e5ccc34df12bbd24cbe8cc60ea84026a06c5056fedc077a5f2dd0100696529fea148141398d83606aa97c779749ec3f301a WHIRLPOOL 7ebbad002095f16f25eca335f544799d3070678d22cb4aebb82659ea6e09404d747f4e39401e3d189a042f56342405d9f37f4f250446b63787ca428ed1baa662
+MISC ChangeLog-2015 4649 SHA256 e51974fb70bee565209238b23603d55f8d596e64e87d73554bd22351a435a71f SHA512 8e3a17867cc48bd197a380793d9171828f3df355b03fff86361e6aaeab7de7f6f7621bd7eacd06ba078eb806b3246e84984b32e17b8ef6f6210a52fafb1b4afb WHIRLPOOL bb58002ab16298548c0d11ae616c5463b2e6a87c55f4b082ccf1014ed918e19403fd7b05bd916531005b12f720f17dfbbd5c08101966ba31fa4a0856dc2b4a15
+MISC metadata.xml 269 SHA256 8e0fab94b619276a0a8b2a159374f0b2a59fd05006291ad2f8def48a2f105a93 SHA512 fc49c52f63fc653414208095ec460b4d991d1710b0ea92ca8ab598bca9316b42144e498503b79e7f1db22e3a8c26c009f51cf2d5eb0163a6afc18ed40d4541f2 WHIRLPOOL b8e1127db570cc189ce2417eec744127fae51ea6fc1cdb9505d66acbd0d83355445045b98b5021bd8a29e2bf17b612785532be8c4f0d32cad7152f10a75fc21c
diff --git a/sys-devel/dev86/dev86-0.16.19.ebuild b/sys-devel/dev86/dev86-0.16.19.ebuild
new file mode 100644
index 000000000000..194de6a5b686
--- /dev/null
+++ b/sys-devel/dev86/dev86-0.16.19.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib
+
+DESCRIPTION="Bruce's C compiler - Simple C compiler to generate 8086 code"
+HOMEPAGE="http://www.debath.co.uk/"
+SRC_URI="http://www.debath.co.uk/dev86/Dev86src-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="sys-devel/bin86"
+DEPEND="${RDEPEND}
+ dev-util/gperf"
+
+STRIP_MASK="/usr/*/bcc/lib*.a /usr/*/i386/libc.a"
+
+src_prepare() {
+ # elksemu doesn't compile under amd64
+ if use amd64; then
+ einfo "Not compiling elksemu on amd64"
+ sed -i \
+ -e 's,alt-libs elksemu,alt-libs,' \
+ -e 's,install-lib install-emu,install-lib,' \
+ makefile.in || die
+ fi
+
+ epatch "${FILESDIR}"/dev86-pic.patch
+ epatch "${FILESDIR}"/${PN}-0.16.19-fortify.patch
+ epatch "${FILESDIR}"/${PN}-0.16.19-memmove.patch #354351
+ sed -i \
+ -e "s:-O2 -g:${CFLAGS}:" \
+ -e '/INEXE=/s:-s::' \
+ makefile.in || die
+ sed -i \
+ -e "s:/lib/:/$(get_libdir)/:" \
+ bcc/bcc.c || die
+ sed -i -e '/INSTALL_OPTS=/s:-s::' bin86/Makefile || die
+ sed -i -e '/install -m 755 -s/s:-s::' dis88/Makefile || die
+}
+
+src_compile() {
+ # Don't mess with CPPFLAGS as they tend to break compilation
+ # (bug #343655).
+ CPPFLAGS=""
+
+ # First `make` is also a config, so set all the path vars here
+ emake -j1 \
+ DIST="${D}" \
+ CC="$(tc-getCC)" \
+ LIBDIR="/usr/$(get_libdir)/bcc" \
+ INCLDIR="/usr/$(get_libdir)/bcc"
+
+ export PATH=${S}/bin:${PATH}
+ cd bin
+ ln -s ncc bcc
+ cd ..
+ cd bootblocks
+ ln -s ../bcc/version.h .
+ emake DIST="${D}"
+}
+
+src_install() {
+ emake -j1 install-all DIST="${D}"
+ dobin bootblocks/makeboot
+ # remove all the stuff supplied by bin86
+ cd "${D}"
+ rm usr/bin/{as,ld,nm,objdump,size}86 || die
+ rm usr/man/man1/{as,ld}86.1 || die
+ dodir /usr/share/man
+ mv usr/man usr/share/
+}
diff --git a/sys-devel/dev86/dev86-0.16.21-r2.ebuild b/sys-devel/dev86/dev86-0.16.21-r2.ebuild
new file mode 100644
index 000000000000..39d5b5977db4
--- /dev/null
+++ b/sys-devel/dev86/dev86-0.16.21-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="Bruce's C compiler - Simple C compiler to generate 8086 code"
+HOMEPAGE="http://v3.sk/~lkundrak/dev86/"
+SRC_URI="http://v3.sk/~lkundrak/dev86/Dev86src-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="sys-devel/bin86"
+DEPEND="${RDEPEND}
+ dev-util/gperf"
+
+STRIP_MASK="/usr/*/bcc/lib*.a /usr/*/i386/libc.a"
+PATCHES=(
+ "${FILESDIR}/${PN}-pic.patch"
+ "${FILESDIR}/${PN}-0.16.19-fortify.patch"
+ "${FILESDIR}/${P}-non-void-return-clang.patch"
+)
+
+src_prepare() {
+ default
+
+ # elksemu doesn't compile under amd64
+ if use amd64; then
+ einfo "Not compiling elksemu on amd64"
+ sed -i \
+ -e 's,alt-libs elksemu,alt-libs,' \
+ -e 's,install-lib install-emu,install-lib,' \
+ makefile.in || die
+ fi
+
+ sed -i -e "s:-O2 -g:${CFLAGS}:" -e '/INEXE=/s:-s::' makefile.in || die
+ sed -i -e "s:/lib/:/$(get_libdir)/:" bcc/bcc.c || die
+ sed -i -e '/INSTALL_OPTS=/s:-s::' bin86/Makefile || die
+ sed -i -e '/install -m 755 -s/s:-s::' dis88/Makefile || die
+}
+
+src_compile() {
+ # Don't mess with CPPFLAGS as they tend to break compilation
+ # (bug #343655).
+ unset CPPFLAGS
+
+ # First `make` is also a config, so set all the path vars here
+ emake -j1 \
+ DIST="${D}" \
+ CC="$(tc-getCC)" \
+ LIBDIR="/usr/$(get_libdir)/bcc" \
+ INCLDIR="/usr/$(get_libdir)/bcc"
+
+ export PATH=${S}/bin:${PATH}
+
+ cd bin || die
+ ln -s ncc bcc || die
+ cd .. || die
+
+ cd bootblocks || die
+ emake DIST="${D}"
+}
+
+src_install() {
+ emake -j1 install-all DIST="${D}"
+ dobin bootblocks/makeboot
+ # remove all the stuff supplied by bin86
+ rm "${D}"/usr/bin/{as,ld,nm,objdump,size}86 || die
+ rm "${D}"/usr/man/man1/{as,ld}86.1 || die
+
+ dodir /usr/share
+ mv "${D}"/usr/{man,share/man} || die
+}
diff --git a/sys-devel/dev86/dev86-0.16.21.ebuild b/sys-devel/dev86/dev86-0.16.21.ebuild
new file mode 100644
index 000000000000..ea917c7d3292
--- /dev/null
+++ b/sys-devel/dev86/dev86-0.16.21.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils multilib
+
+DESCRIPTION="Bruce's C compiler - Simple C compiler to generate 8086 code"
+HOMEPAGE="http://v3.sk/~lkundrak/dev86/"
+SRC_URI="http://v3.sk/~lkundrak/dev86/Dev86src-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="sys-devel/bin86"
+DEPEND="${RDEPEND}
+ dev-util/gperf"
+
+STRIP_MASK="/usr/*/bcc/lib*.a /usr/*/i386/libc.a"
+
+src_prepare() {
+ # elksemu doesn't compile under amd64
+ if use amd64; then
+ einfo "Not compiling elksemu on amd64"
+ sed -i \
+ -e 's,alt-libs elksemu,alt-libs,' \
+ -e 's,install-lib install-emu,install-lib,' \
+ makefile.in || die
+ fi
+
+ epatch "${FILESDIR}"/dev86-pic.patch
+ epatch "${FILESDIR}"/${PN}-0.16.19-fortify.patch
+ sed -i \
+ -e "s:-O2 -g:${CFLAGS}:" \
+ -e '/INEXE=/s:-s::' \
+ makefile.in || die
+ sed -i \
+ -e "s:/lib/:/$(get_libdir)/:" \
+ bcc/bcc.c || die
+ sed -i -e '/INSTALL_OPTS=/s:-s::' bin86/Makefile || die
+ sed -i -e '/install -m 755 -s/s:-s::' dis88/Makefile || die
+}
+
+src_compile() {
+ # Don't mess with CPPFLAGS as they tend to break compilation
+ # (bug #343655).
+ CPPFLAGS=""
+
+ # First `make` is also a config, so set all the path vars here
+ emake -j1 \
+ DIST="${D}" \
+ CC="$(tc-getCC)" \
+ LIBDIR="/usr/$(get_libdir)/bcc" \
+ INCLDIR="/usr/$(get_libdir)/bcc"
+
+ export PATH=${S}/bin:${PATH}
+ cd bin
+ ln -s ncc bcc
+ cd ..
+ cd bootblocks
+ ln -s ../bcc/version.h .
+ emake DIST="${D}"
+}
+
+src_install() {
+ emake -j1 install-all DIST="${D}"
+ dobin bootblocks/makeboot
+ # remove all the stuff supplied by bin86
+ cd "${D}"
+ rm usr/bin/{as,ld,nm,objdump,size}86 || die
+ rm usr/man/man1/{as,ld}86.1 || die
+ dodir /usr/share/man
+ mv usr/man usr/share/
+}
diff --git a/sys-devel/dev86/files/dev86-0.16.19-fortify.patch b/sys-devel/dev86/files/dev86-0.16.19-fortify.patch
new file mode 100644
index 000000000000..366808c96d20
--- /dev/null
+++ b/sys-devel/dev86/files/dev86-0.16.19-fortify.patch
@@ -0,0 +1,23 @@
+--- dev86-0.16.19/bcc/bcc.c
++++ dev86-0.16.19/bcc/bcc.c
+@@ -596,12 +597,17 @@
+ }
+ }
+
+-void
+-command_reset()
+-{
+ #ifndef MAXPATHLEN
++#ifdef PATH_MAX
++#define MAXPATHLEN PATH_MAX
++#else
+ #define MAXPATHLEN 1024
+ #endif
++#endif
++
++void
++command_reset()
++{
+ char buf[MAXPATHLEN];
+ char ** prefix;
+ char * saved_cmd;
diff --git a/sys-devel/dev86/files/dev86-0.16.19-memmove.patch b/sys-devel/dev86/files/dev86-0.16.19-memmove.patch
new file mode 100644
index 000000000000..12df3f672624
--- /dev/null
+++ b/sys-devel/dev86/files/dev86-0.16.19-memmove.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/354351
+
+fix sniped from Debian:
+* Fix "FTBFS: ncc: illegal label": apply patch by dai that replaces strcpy
+ by memmove (closes: #591133).
+
+--- copt/copt.c
++++ copt/copt.c
+@@ -174,7 +174,7 @@
+ /* Delete leading white spaces */
+ for (cp = buf; *cp && isspace(*cp); cp++) ;
+ if (cp != buf && *cp)
+- strcpy(buf, cp);
++ memmove(buf, cp, strlen(cp) + 1);
+
+ return(buf);
+ }
diff --git a/sys-devel/dev86/files/dev86-0.16.21-non-void-return-clang.patch b/sys-devel/dev86/files/dev86-0.16.21-non-void-return-clang.patch
new file mode 100644
index 000000000000..cb42e5707dcf
--- /dev/null
+++ b/sys-devel/dev86/files/dev86-0.16.21-non-void-return-clang.patch
@@ -0,0 +1,15 @@
+Return void properly, else clang aborts with
+* tok_io.c:231:6: error: non-void function 'do_control' should return a value [-Wreturn-type]
+See also: https://bugs.gentoo.org/show_bug.cgi?id=523096
+
+--- dev86-0.16.21/unproto/tok_io.c
++++ dev86-0.16.21/unproto/tok_io.c
+@@ -189,7 +189,7 @@
+
+ /* do_control - parse control line */
+
+-static int do_control()
++static void do_control()
+ {
+ struct token *t;
+ int line;
diff --git a/sys-devel/dev86/files/dev86-pic.patch b/sys-devel/dev86/files/dev86-pic.patch
new file mode 100644
index 000000000000..23158d188b02
--- /dev/null
+++ b/sys-devel/dev86/files/dev86-pic.patch
@@ -0,0 +1,20 @@
+--- dev86-0.16.21/elksemu/elks.c.orig 2005-11-04 01:35:37.000000000 +0100
++++ dev86-0.16.21/elksemu/elks.c 2005-11-04 01:45:28.000000000 +0100
+@@ -129,8 +129,17 @@
+ static inline int vm86_mine(struct vm86_struct* v86)
+ {
+ int __res;
++#ifndef __PIC__
+ __asm__ __volatile__("int $0x80\n"
+ :"=a" (__res):"a" ((int)OLD_SYS_vm86), "b" ((int)v86));
++#else
++ __asm__ __volatile__(
++ "movl %%ebx,%%ecx\n\t"
++ "movl %2,%%ebx\n\t"
++ "int $0x80\n\t"
++ "movl %%ecx,%%ebx\n\t"
++ :"=a" (__res):"a" ((int)OLD_SYS_vm86), "r" ((int)v86) : "ecx");
++#endif
+ return __res;
+ }
+ #endif
diff --git a/sys-devel/dev86/metadata.xml b/sys-devel/dev86/metadata.xml
new file mode 100644
index 000000000000..771fca6d0110
--- /dev/null
+++ b/sys-devel/dev86/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <longdescription>
+ Bruce's C compiler - Simple C compiler to generate 8086 code
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-devel/distcc/Manifest b/sys-devel/distcc/Manifest
new file mode 100644
index 000000000000..885b73bbd257
--- /dev/null
+++ b/sys-devel/distcc/Manifest
@@ -0,0 +1,28 @@
+AUX 3.0/conf 1287 SHA256 253cfaa5b53fe4943a9db83e76ff6d6e8855665f69c2f7beca124af3ec63c88a SHA512 e3c32d1bf67fa475ce7b8f6f27835ca604eca23bcb338312c3b93d59123c2747a7c45b2ba7fe19a0c3eec9dca409aa036b1c7aa3776d0f163bd06ac7bb6b2e94 WHIRLPOOL dbd0e9b9b27d40d0ad92cf9b9c663bc5d1b2351a61cd5f9a1e526dfce889eb6bad39ce0b88efd1cbbd45bc6ed827ab5f29150faf0e7aacb9aabf8e730aa08da8
+AUX 3.0/distcc-config 3287 SHA256 63a8d15fea59a6c633c0b40e5e4e153e87fe4f0145fee0b5827934d9fbd1ba47 SHA512 e42c6a7ca191e52937f5754ae4f17f421c78d4e42690b01f1e07ffa057e96f303c4cd9fdaa545df9afbb6596d23bd1d1d51a7467fdb039a6993979ee01eb4754 WHIRLPOOL f9426442400a7c4a7c8a1d69cf51c5db7e90d7bd342bd8fef8d0852cf0d10c3e11c98be9c56dece587274b7f3b1d77cc08a7e795e58d0ace7b7f4fb49850b7d0
+AUX 3.1/conf 1143 SHA256 f6fe901a78b6ca3277a7990920b317265ba5a5d8f137a62b287da730c665890f SHA512 11330d0725ace3d4d48615d0b29a296c89a462047b9d1aa5600b835be064cc6a1ce66958214c518e5bcd8e3048fa7f9aa4f59beb7cbb59494b363358e1447831 WHIRLPOOL 378d4aebd04ad9c60e5ab0e5dcdecd20fc9bf6021a6223bdcd5f7225ab658c2bbc1ccacd6c619bf4a87f59be3464d491afaff56e415054b9afd441a85cde7cc8
+AUX 3.1/init 671 SHA256 4af1591a0f95e45648f0c5a7ffc5e49be012f2f6e497235b3363e9e709dc627f SHA512 5e1ff2c6c72ec761afac48c17e5c558617b512676a007e076f9ecbdd1f69b95ff626929952b2f5fff9a927f0422bd2fded297ad494d64c1113ea11c55dcbe605 WHIRLPOOL fd49143ff850d5f07f4227fec2bd75efc2a577350927ff1a5ba9235301c751e53a48ffbc15d04894ca572b72ee2cc1833256ce5de8a3544427958ea7fe6d0351
+AUX 3.2/conf 1287 SHA256 253cfaa5b53fe4943a9db83e76ff6d6e8855665f69c2f7beca124af3ec63c88a SHA512 e3c32d1bf67fa475ce7b8f6f27835ca604eca23bcb338312c3b93d59123c2747a7c45b2ba7fe19a0c3eec9dca409aa036b1c7aa3776d0f163bd06ac7bb6b2e94 WHIRLPOOL dbd0e9b9b27d40d0ad92cf9b9c663bc5d1b2351a61cd5f9a1e526dfce889eb6bad39ce0b88efd1cbbd45bc6ed827ab5f29150faf0e7aacb9aabf8e730aa08da8
+AUX 3.2/distcc-config 5213 SHA256 a1e4ad31de9ed6423a524943e0221bb9d3f2600030c2d172d97808fc3da331c3 SHA512 4863ce7fdd2f754d1b689533d04e2a306f61adecf85b9fb8a7ff4a74e94f3cad74ca25cdffe9c7f8857d490ee94af1ceef8a097709bb9b77a4bef59af3e0fe71 WHIRLPOOL 4ff9572763f90fe08d0aee8d2451fb935248318d523e0b10d5e6310184af8daaa878756ef5b3629b0de91fc67b94b23c8ae20ca297a86bee8e2d998d12571bd3
+AUX 3.2/init 671 SHA256 4af1591a0f95e45648f0c5a7ffc5e49be012f2f6e497235b3363e9e709dc627f SHA512 5e1ff2c6c72ec761afac48c17e5c558617b512676a007e076f9ecbdd1f69b95ff626929952b2f5fff9a927f0422bd2fded297ad494d64c1113ea11c55dcbe605 WHIRLPOOL fd49143ff850d5f07f4227fec2bd75efc2a577350927ff1a5ba9235301c751e53a48ffbc15d04894ca572b72ee2cc1833256ce5de8a3544427958ea7fe6d0351
+AUX distcc-3.0-fix-fortify.patch 313 SHA256 7b57ae28dcef0c1ecd273a8a10dd1a16fa6a7af618d5438e1fe4398863fa8901 SHA512 11f125fd12398d7e7cdcbbb2bb57d5d374fc3dda0eb88d22176c1c9948393debaf4aa05975d79e6fa4ca8de69b332cd2a75b301868b473c42511901e38b4c2a1 WHIRLPOOL 6eb87c3228717cff12a55770c6ff3d3846ed102ce5fe65e48e49cb7198c60d05fb0f779150c2f21c9cad59d869c249b53ae37f2c2332bacd583298aba6651399
+AUX distcc-3.0-xinetd.patch 558 SHA256 9ef11743e91167548ac6324aa21608a62fd09149a8dbdbab32602f70804e0560 SHA512 1c0aa31606e1ce828ad52c9fff672d9e13a00494b8a3441095aca101d76f0f296308e359330a85745e2c60533eb1dcf82cea3feff2d0a3154b204d56735f0d14 WHIRLPOOL 59b3fdc21fe5a15a5163b02ec6c778085b85ae2eb2c98a1b88a6b5cfb7cd2a9a81512e5ef66892c7cdb1ea17e7e6728fd059b42762e15d2d20a60ad79c458155
+AUX distcc-3.1-argc-fix.patch 480 SHA256 e576553f27c7fabc2dcd3f361a98e2db70fef9fa4f08df91a8bb00c178912a1b SHA512 da9266ee6ce36cf427324b94734fa6e368498422b0a3adcdde9bfe252e163173a989db323b9d2c7e2a2b1048aa76ede13d4dbd169fef34fc559e244a7b802b00 WHIRLPOOL df9b32d2f3697c90bdca4a606280fe9f69d83f5d24f5031797d7a176a563ad4da3b191d085d909a8a9a0c86afba12a6481cda69c3e897d5ae00003c8cccc8877
+AUX distcc-3.1-freedesktop.patch 2959 SHA256 bf8694f4d1eb5e757615929bc58587f538ce733891097eb42204423cab644798 SHA512 4eb6497179ca1f6b57d1b7f6ca8f58d2ad8b7a512f771cd63f835ddf457b988d188800a1d662463d0caec66c06ad151378145f5b910f6bd9eb922e0c228e43c9 WHIRLPOOL 3da6509bcf47132b1f9d215e84756c8e015ba532f2e078ea2b2de163157a44db0fa88d8d37cd772851658586d5308da141f93ee706aaf9e307664c0018dce81d
+AUX distcc-3.1-python.patch 10754 SHA256 8ba3c0745a30b5901cfb37f4231d754e5779cbc5a6fa173fb196661d2a035cc2 SHA512 8a66113ef0157b6ec382883325f4acc1dcd7df573c3c7f14bf88429b6060687faa64862a53b510709f6429e082aad97be7934e964168d91f85086c8c5f764a1e WHIRLPOOL 3aed5e32be73c04af7786c0b888e3a11b7f2dbb78c958f2aa1aa4175651cb850aab4dc1559aaacabe2295168aed692238ac71cee1b838d1b3a6a3a44e5db0eee
+AUX distcc-3.2_rc1-freedesktop.patch 3140 SHA256 7ead1174fc170cee5c32ac183edf0c15ae35df56bedbbf6bc24c0099fe23b7f6 SHA512 fe953e1884b498da9cbb83ca90af9e49b554ad56fef8a8f55b9e6b46e5904f7376e5e58a9123f4acb474e16577fb6c9371a12eddc29c07c5d488be847f4ed2ef WHIRLPOOL b073d4c775493a2976dc430f949269d6328178254c2080ca1f8c71be3b935cdfcc5e3135e2504e87267059df243f744d2f7f90a517aefebeaed5f55e40607eb1
+AUX distcc-3.2_rc1-gssapi.patch 1638 SHA256 2693fbf5b76ab64874e0a4bc1540067f402799dfabde5202a89ec045f1d88ea0 SHA512 c804189f87068f82e7cb18de4e8d30cc67db7cc7fbcb13872d44e3f6fb006b3c779adf9c6068ae50831ef649da718ddb33c0efc4354636aacc9a7217b3c9a348 WHIRLPOOL fd0afc3bcdc176aec7f2f2e9d990578573628c66a23da60ba8e34663c86835ca138f48a2feb4f02dd8cfa2c28442f65338ea531994a09db38bbdf62bfdfcbe4d
+AUX distcc-3.2_rc1-python.patch 10592 SHA256 935328943efe26f20bfb94952bc8bcb7f8536465db72411d81e6f3d1ade37989 SHA512 513c2fb9aa8f222a0f6062795fac1f855d67467d796b406c6b685e345554ce09a96ab9e594d6a05aad6c5a0f8c7906700529cfb562f2dd7c498d9078219b3d6b WHIRLPOOL 0ec9deafa00b161a29ead3ff7791262a189501d2ca69d03d46eb5838ca3effa8e1de7878b72917634cb261ee2cf68401f2b8ca70048345d4bfddc6db82fa56aa
+AUX distcc-3.2_rc1-socks5.patch 5462 SHA256 85b48489c360d384a67de91f1a750413a2239dd81fe45d7270c62451114a6f22 SHA512 707b6ad02bb7ff1507cfbfbb4cee673d5f0dc776006e9b7e801deabccf05c6057b33ea43c6a3ddd1756b8d07ff1d5e3087b635f15285195ba795b8679ebdc860 WHIRLPOOL 92f2721675d8dc06d73f8c5b0f0236fc1dc57f1dd1f05bc3765cc5daaa1b41db563af579c8dac4741666aeb10c12edfabf8109eef2e36cbd267506ee1c3ea3d6
+AUX distcc-config 4762 SHA256 91d25533a1395089b5db1dc67270b5ec1ac0b6c4d9d66641f9e2a03c3b50acb2 SHA512 a996e947de0b1156bf74587ad5c321dbad55fae61ee560eb3463bb3d3d5a125539ca1f5e6c9e50c6d0cdac6b4fe3ea489738a7c007c6adc9a3eec55939f139b7 WHIRLPOOL c557858d97aa7888e0c13c42c1aaa38ce34ab3cedc220b8f0c34fe2364dc0dd385acbaa4a3d1e1500a5be93ff5170c55f0715b67482f45468dff6eaad3407692
+AUX distcc-hardened.patch 1084 SHA256 dcf63f201cb7f4bf13eeb1485a5056c64370b9239d28e4acc77a47046dcda6cf SHA512 d1150dc83bf89c332f8c0bd01e15f52f95d71868733bd2e5430a5377f1a4aaa2b5b6e0cd488d33d9b94ce18b0eeeadf4af719db536b001b50e4d482b35c7e057 WHIRLPOOL 5faa97711f48d3bb41c6362d9467dab28546d01015de1b76eaaf847d633711bf56af16d1e3484b9bf9215cdf5436fcc6837bc870287cce02553b9ff756215111
+AUX distccd.service 244 SHA256 d9cbc0f6fbadd1628dfdd9b31f5ade85f4a29cdd2dc05382aff8d9539881a746 SHA512 0626a2da412df4a124ec8f3486b48af92895e97ad626bb848f14e60c9b016de313ca7c17a09565de95fa48233c9f7e37bf79038d1115b339a2033f0eacf0a22f WHIRLPOOL 31e258449949cd8185e5f83cfdc62017dd5576e8c80468fc5624c6f49abd133b488f3d333096fbdb213a8a7dddfb2d2414949e5fc1e68c79c569fd73298f3c93
+AUX distccd.service.conf 186 SHA256 75fd7954ab324efeeb3c7a9379bf261370f4aa715c57f3a9b39413822ce5ebc7 SHA512 19bf25757ba724ba4e728797b8c6fccabb8b95d2945f0e3c216303a04a4e7470507dcf8535657954f265ed5f067f32dcb3fb6558e9958a86de76b1e66e2b31b6 WHIRLPOOL 7b110c3a799469d368ae510d915fbdc6999a4750fa4abd91045e5576ac5aedb5daa063741a5833388d2dfb97d5b76e235bfd49875bd571f4732e27e8cabdabc7
+DIST distcc-3.1.tar.bz2 588820 SHA256 f55dbafd76bed3ce57e1bbcdab1329227808890d90f4c724fcd2d53f934ddd89 SHA512 0ca7167309badf5d36d2783bab398295b52c43fde0355cf1902032c70b27fc40c21729c98af0ee4c0aeea0c48755e4626308e9385d938b7822de27cdb048e7bd WHIRLPOOL 9152feab2b7def17606259293fe7af7815ec295defa0287b7e5c054f17b0cb73d07f6e721855fd06eec4fc838c44ff509db20fc89c47871f7f1349e08cd126bd
+DIST distcc-3.2rc1.tar.bz2 609904 SHA256 311671e844625d7fdb18dd3d096cd855751cfe8de13827682bcb7beff9133b30 SHA512 98b2e8423d724bbb6a615d946d170441a8e293310785f867d7a277b318c043a37b0af39ae8ed1f7a0667803de9db1d1925199bad85130cf9bd9cb347635125ee WHIRLPOOL d366abb05d10aa5a458acf7b57f5bf52fd4f5ff46c68494e28140eb944524e66d729ebef60190acb1d9b33a0fb8faea6b909509de67294c29dbebcf01d500a36
+EBUILD distcc-3.1-r10.ebuild 4511 SHA256 cc01f857cf217f2a518a80d8497d2f846375f6d9ff0f236c083ca7b1ac9e2461 SHA512 bc389f2d3c521c59fcfe951ac67a0bfe951da01acf15c01ebf8923fe2c9b3d44876d19f3620c50740616ffa9c36c0b6e483652d19b94870fa3c89af5b5cd1b52 WHIRLPOOL 004340a6582760fde2d9168b8f02fc5d19e7be0cd5bc22434a835bdad58934f6fd4e146fab055fd00391592aa8d2b2963e6f3427ecd0af3da048c26ae738437b
+EBUILD distcc-3.2_rc1-r4.ebuild 5741 SHA256 178acde4fd41d4150a00d045644871680fd7d383f6aaa9d02082d1f87b12b69e SHA512 e835571ceecf9653848b85112d983e73358aa5fb6121c099335967155e9bbee50c685bb1b14f046547b99e0a992387fab80869716136cea51aa377a69f79373b WHIRLPOOL 129b874f0f4d9e8be6490efc6066c39a24c62f4c95b2263bf2295a1de8c746176dd456963bfc080024c63e9a7dea3478082166e748d5de800c59a266ed67017e
+EBUILD distcc-3.2_rc1-r5.ebuild 5422 SHA256 8fe9505a080f06c7d42a210df7c237b9ac8f356071a4ab2492e3007bd6f54ba8 SHA512 d099c1fb80e9094fd8e6affb9565373e9f83b7160a29a5b7c8108814f486f4d19294c89175ce9e954604765c0c527161b12712594055bc1c33e589a9872d83af WHIRLPOOL 1c47f066c7a1045f4f70e4daa10a55d4fafeec7f1852b57ddc7a3170c841d7967f02363cb13b7113f6c4e5a1dd4d0a5122cb40a7ea65567c4e322bd69b1902a9
+MISC ChangeLog 7754 SHA256 b6ee02e1e9e7607539178853e74202aeb941152f9dd3e636029f3b0c1a99f2c1 SHA512 243c89750837c04bca69441abb56f0d81258d318964dd956f92720a244a9f529263c2243cd0487c353d01cd5e0064fe12b6eb26e99b5118269223c3456ae37c4 WHIRLPOOL c1ccfe5600be8e95fbeb051a4ba79451ea458a6d383a710bb4993d8e8759294995884a4171172a8d08549b1bac71cb0fa95b8f092d09bc8966e9a7e51d294bb5
+MISC ChangeLog-2015 43187 SHA256 092f07c773f2361956f0e8b4d28d338aaa03ee4143644db6922a803e93f90f75 SHA512 2845de19f4949be5630835998b1b2a95369f2d49454579f14df5070186f3416d750014cd2945353d07f88e7e06fd53a125834570f2a2e496060697da36cb7991 WHIRLPOOL db2463f7da6cbf5ed97ee04e7498b804862ac6614eb9b6e84f30280c34103bf5bd47f798d5d516f597ebf3abbad5fd9af6af8e1a5ee58c32b615c994a8b2519e
+MISC metadata.xml 591 SHA256 bb88c70f929966bac3eb4e28ae28551d77b51405fdb2a7c1d821d900675d27fe SHA512 e1505d96de755aa36e470200545efec04e93f21fb122d0679b47f0e5b4fd17aeb82d31d02bed9da4a99408200748df14e4599f4ba03925c39566f6411eb98b71 WHIRLPOOL 0bd64f2dc0d1a5e341995838237ef715b83827f6ce91a0d9907330ca70ed4ad23d8f41f6f2361cc9bd2ae3086f1b721b2625b0d9b27da305c23ac55a8c31be18
diff --git a/sys-devel/distcc/distcc-3.1-r10.ebuild b/sys-devel/distcc/distcc-3.1-r10.ebuild
new file mode 100644
index 000000000000..0aea024a0e79
--- /dev/null
+++ b/sys-devel/distcc/distcc-3.1-r10.ebuild
@@ -0,0 +1,169 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils fdo-mime flag-o-matic multilib python-single-r1 systemd toolchain-funcs user
+
+DESCRIPTION="Distribute compilation of C code across several machines on a network"
+HOMEPAGE="http://distcc.org/"
+SRC_URI="https://distcc.googlecode.com/files/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="avahi gtk hardened ipv6 selinux xinetd"
+
+RESTRICT="test"
+
+CDEPEND="${PYTHON_DEPS}
+ dev-libs/popt
+ avahi? ( >=net-dns/avahi-0.6[dbus] )
+ gtk? ( x11-libs/gtk+:2 )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ !net-misc/pump
+ >=sys-devel/gcc-config-1.4.1
+ selinux? ( sec-policy/selinux-distcc )
+ xinetd? ( sys-apps/xinetd )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DISTCC_LOG=""
+DCCC_PATH="/usr/$(get_libdir)/distcc/bin"
+DISTCC_VERBOSE="0"
+
+pkg_setup() {
+ enewuser distcc 240 -1 -1 daemon
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.0-xinetd.patch"
+ # bug #253786
+ epatch "${FILESDIR}/${PN}-3.0-fix-fortify.patch"
+ # bug #255188
+ epatch "${FILESDIR}/${P}-freedesktop.patch"
+ # bug #258364
+ epatch "${FILESDIR}/${P}-python.patch"
+ # bug #351979
+ epatch "${FILESDIR}/${P}-argc-fix.patch"
+ epatch_user
+
+ sed -i -e "/PATH/s:\$distcc_location:${DCCC_PATH}:" pump.in || die
+
+ # Bugs #120001, #167844 and probably more. See patch for description.
+ use hardened && epatch "${FILESDIR}/distcc-hardened.patch"
+}
+
+src_configure() {
+ local myconf="--disable-Werror --with-docdir=/usr/share/doc/${PF}"
+ # More legacy stuff?
+ [ "$(gcc-major-version)" = "2" ] && filter-lfs-flags
+
+ # --disable-rfc2553 b0rked, bug #254176
+ use ipv6 && myconf="${myconf} --enable-rfc2553"
+
+ econf \
+ $(use_with avahi) \
+ $(use_with gtk) \
+ ${myconf}
+}
+
+src_install() {
+ # In rare cases, parallel make install failed
+ MAKEOPTS+=" -j1"
+ default
+
+ dobin "${FILESDIR}/3.0/distcc-config"
+
+ newinitd "${FILESDIR}/${PV}/init" distccd
+ systemd_dounit "${FILESDIR}/distccd.service"
+ systemd_install_serviced "${FILESDIR}/distccd.service.conf"
+
+ cp "${FILESDIR}/3.1/conf" "${T}/distccd" || die
+ if use avahi; then
+ cat >> "${T}/distccd" <<-EOF
+
+ # Enable zeroconf support in distccd
+ DISTCCD_OPTS="\${DISTCCD_OPTS} --zeroconf"
+ EOF
+
+ sed -i '/ExecStart/ s|$| --zeroconf|' "${ED}"/usr/lib/systemd/system/distccd.service || die
+ fi
+ doconfd "${T}/distccd"
+
+ cat > "${T}/02distcc" <<-EOF
+ # This file is managed by distcc-config; use it to change these settings.
+ DISTCC_LOG="${DISTCC_LOG}"
+ DCCC_PATH="${DCCC_PATH}"
+ DISTCC_VERBOSE="${DISTCC_VERBOSE}"
+ EOF
+ doenvd "${T}/02distcc"
+
+ # create the masquerade directory
+ dodir "${DCCC_PATH}"
+ for f in cc c++ gcc g++; do
+ dosym /usr/bin/distcc "${DCCC_PATH}/${f}"
+ if [ "${f}" != "cc" ]; then
+ dosym /usr/bin/distcc "${DCCC_PATH}/${CTARGET:-${CHOST}}-${f}"
+ fi
+ done
+
+ if use gtk; then
+ einfo "Renaming /usr/bin/distccmon-gnome to /usr/bin/distccmon-gui"
+ einfo "This is to have a little sensability in naming schemes between distccmon programs"
+ mv "${ED}/usr/bin/distccmon-gnome" "${ED}/usr/bin/distccmon-gui" || die
+ dosym distccmon-gui /usr/bin/distccmon-gnome
+ fi
+
+ if use xinetd; then
+ insinto /etc/xinetd.d
+ newins "doc/example/xinetd" distcc
+ fi
+
+ rm -rf "${ED}/etc/default" || die
+ rm -f "${ED}/etc/distcc/clients.allow" || die
+ rm -f "${ED}/etc/distcc/commands.allow.sh" || die
+
+ python_fix_shebang "${ED}"
+ python_optimize
+}
+
+pkg_postinst() {
+ use gtk && fdo-mime_desktop_database_update
+
+ if use ipv6; then
+ elog
+ elog "IPv6 is not supported yet by ${P}."
+ fi
+ elog
+ elog "Tips on using distcc with Gentoo can be found at"
+ elog "https://wiki.gentoo.org/wiki/Distcc"
+ elog
+ elog "How to use pump mode with Gentoo:"
+ elog "# distcc-config --set-hosts \"foo,cpp,lzo bar,cpp,lzo baz,cpp,lzo\""
+ elog "# pump emerge -u world"
+ elog
+ elog "To use the distccmon programs with Gentoo you should use this command:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR}\" distccmon-text 5"
+
+ if use gtk; then
+ elog "Or:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR}\" distccmon-gnome"
+ fi
+
+ elog
+ elog "***SECURITY NOTICE***"
+ elog "If you are upgrading distcc please make sure to run etc-update to"
+ elog "update your /etc/conf.d/distccd and /etc/init.d/distccd files with"
+ elog "added security precautions (the --listen and --allow directives)"
+ elog
+}
+
+pkg_postrm() {
+ use gtk && fdo-mime_desktop_database_update
+}
diff --git a/sys-devel/distcc/distcc-3.2_rc1-r4.ebuild b/sys-devel/distcc/distcc-3.2_rc1-r4.ebuild
new file mode 100644
index 000000000000..94a42143b8a8
--- /dev/null
+++ b/sys-devel/distcc/distcc-3.2_rc1-r4.ebuild
@@ -0,0 +1,201 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools eutils fdo-mime flag-o-matic multilib python-single-r1 systemd toolchain-funcs user
+
+MY_P="${P/_}"
+DESCRIPTION="Distribute compilation of C code across several machines on a network"
+HOMEPAGE="http://distcc.org/"
+SRC_URI="https://distcc.googlecode.com/files/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="crossdev gnome gssapi gtk hardened ipv6 selinux xinetd zeroconf"
+
+RESTRICT="test"
+
+CDEPEND="${PYTHON_DEPS}
+ dev-libs/popt
+ gnome? (
+ >=gnome-base/libgnome-2
+ >=gnome-base/libgnomeui-2
+ x11-libs/gtk+:2
+ x11-libs/pango
+ )
+ gssapi? ( net-libs/libgssglue )
+ gtk? ( x11-libs/gtk+:2 )
+ zeroconf? ( >=net-dns/avahi-0.6[dbus] )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ !net-misc/pump
+ >=sys-devel/gcc-config-1.4.1
+ selinux? ( sec-policy/selinux-distcc )
+ xinetd? ( sys-apps/xinetd )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+
+DCCC_PATH="/usr/$(get_libdir)/distcc/bin"
+DISTCC_VERBOSE="0"
+
+pkg_setup() {
+ enewuser distcc 240 -1 -1 daemon
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.0-xinetd.patch"
+ # bug #253786
+ epatch "${FILESDIR}/${PN}-3.0-fix-fortify.patch"
+ # bug #255188
+ epatch "${FILESDIR}/${PN}-3.2_rc1-freedesktop.patch"
+ # bug #258364
+ epatch "${FILESDIR}/${PN}-3.2_rc1-python.patch"
+ # for net-libs/libgssglue
+ epatch "${FILESDIR}/${PN}-3.2_rc1-gssapi.patch"
+ # SOCKSv5 support needed for Portage, bug #537616
+ epatch "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
+ epatch_user
+
+ # Bugs #120001, #167844 and probably more. See patch for description.
+ use hardened && epatch "${FILESDIR}/distcc-hardened.patch"
+
+ sed -i \
+ -e "/PATH/s:\$distcc_location:${EPREFIX}${DCCC_PATH}:" \
+ -e "s:@PYTHON@:${EPYTHON}:" \
+ pump.in || die "sed failed"
+
+ sed \
+ -e "s:@EPREFIX@:${EPREFIX:-/}:" \
+ -e "s:@libdir@:/usr/$(get_libdir):" \
+ "${FILESDIR}/3.2/distcc-config" > "${T}/distcc-config" || die
+
+ eaclocal -Im4 --output=aclocal.m4
+ eautoconf
+}
+
+src_configure() {
+ local myconf="--disable-Werror --with-docdir=\$(datadir)/doc/${PF}"
+ # More legacy stuff?
+ [ "$(gcc-major-version)" = "2" ] && filter-lfs-flags
+
+ # --disable-rfc2553 b0rked, bug #254176
+ use ipv6 && myconf="${myconf} --enable-rfc2553"
+
+ econf \
+ $(use_with gtk) \
+ $(use_with gnome) \
+ $(use_with gssapi auth) \
+ $(use_with zeroconf avahi) \
+ ${myconf}
+}
+
+src_install() {
+ default
+ python_optimize
+
+ newinitd "${FILESDIR}/3.2/init" distccd
+ systemd_dounit "${FILESDIR}/distccd.service"
+ systemd_install_serviced "${FILESDIR}/distccd.service.conf"
+
+ cp "${FILESDIR}/3.2/conf" "${T}/distccd" || die
+ if use zeroconf; then
+ cat >> "${T}/distccd" <<-EOF
+
+ # Enable zeroconf support in distccd
+ DISTCCD_OPTS="\${DISTCCD_OPTS} --zeroconf"
+ EOF
+
+ sed -i '/ExecStart/ s|$| --zeroconf|' "${D}$(systemd_get_systemunitdir)"/distccd.service || die
+ fi
+ doconfd "${T}/distccd" || die
+
+ cat > "${T}/02distcc" <<-EOF
+ # This file is managed by distcc-config; use it to change these settings.
+ # DISTCC_LOG and DISTCC_DIR should not be set.
+ DISTCC_VERBOSE="${DISTCC_VERBOSE:-0}"
+ DISTCC_FALLBACK="${DISTCC_FALLBACK:-1}"
+ DISTCC_SAVE_TEMPS="${DISTCC_SAVE_TEMPS:-0}"
+ DISTCC_TCP_CORK="${DISTCC_TCP_CORK}"
+ DISTCC_SSH="${DISTCC_SSH}"
+ UNCACHED_ERR_FD="${UNCACHED_ERR_FD}"
+ DISTCC_ENABLE_DISCREPANCY_EMAIL="${DISTCC_ENABLE_DISCREPANCY_EMAIL}"
+ DCC_EMAILLOG_WHOM_TO_BLAME="${DCC_EMAILLOG_WHOM_TO_BLAME}"
+ EOF
+ doenvd "${T}/02distcc" || die
+
+ keepdir "${DCCC_PATH}" || die
+
+ dobin "${T}/distcc-config" || die
+
+ if use gnome || use gtk; then
+ einfo "Renaming /usr/bin/distccmon-gnome to /usr/bin/distccmon-gui"
+ einfo "This is to have a little sensability in naming schemes between distccmon programs"
+ mv "${ED}/usr/bin/distccmon-gnome" "${ED}/usr/bin/distccmon-gui" || die
+ dosym distccmon-gui /usr/bin/distccmon-gnome || die
+ fi
+
+ if use xinetd; then
+ insinto /etc/xinetd.d || die
+ newins "doc/example/xinetd" distcc || die
+ fi
+
+ rm -r "${ED}/etc/default" || die
+ rm "${ED}/etc/distcc/clients.allow" || die
+ rm "${ED}/etc/distcc/commands.allow.sh" || die
+}
+
+pkg_postinst() {
+ if [ -x "${EPREFIX}/usr/bin/distcc-config" ] ; then
+ if use crossdev; then
+ "${EPREFIX}/usr/bin/distcc-config" --update-masquerade-with-crossdev
+ else
+ "${EPREFIX}/usr/bin/distcc-config" --update-masquerade
+ fi
+ fi
+
+ use gnome && fdo-mime_desktop_database_update
+
+ elog
+ elog "Tips on using distcc with Gentoo can be found at"
+ elog "https://wiki.gentoo.org/wiki/Distcc"
+ elog
+ elog "How to use pump mode with Gentoo:"
+ elog "# distcc-config --set-hosts \"foo,cpp,lzo bar,cpp,lzo baz,cpp,lzo\""
+ elog "# echo 'FEATURES=\"\${FEATURES} distcc distcc-pump\"' >> /etc/portage/make.conf"
+ elog "# emerge -u world"
+ elog
+ elog "To use the distccmon programs with Gentoo you should use this command:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-text 5"
+
+ if use gnome || use gtk; then
+ elog "Or:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-gnome"
+ fi
+
+ elog
+ elog "***SECURITY NOTICE***"
+ elog "If you are upgrading distcc please make sure to run etc-update to"
+ elog "update your /etc/conf.d/distccd and /etc/init.d/distccd files with"
+ elog "added security precautions (the --listen and --allow directives)"
+ elog
+}
+
+pkg_postrm() {
+ # delete the masquerade directory
+ if [ ! -f "${EPREFIX}/usr/bin/distcc" ] ; then
+ einfo "Remove masquerade symbolic links."
+ rm "${EPREFIX}${DCCC_PATH}/"*{cc,c++,gcc,g++}
+ rmdir "${EPREFIX}${DCCC_PATH}"
+ fi
+
+ use gnome && fdo-mime_desktop_database_update
+}
diff --git a/sys-devel/distcc/distcc-3.2_rc1-r5.ebuild b/sys-devel/distcc/distcc-3.2_rc1-r5.ebuild
new file mode 100644
index 000000000000..a2c88769102f
--- /dev/null
+++ b/sys-devel/distcc/distcc-3.2_rc1-r5.ebuild
@@ -0,0 +1,198 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit autotools flag-o-matic python-single-r1 systemd toolchain-funcs user xdg-utils
+
+MY_P="${P/_}"
+DESCRIPTION="Distribute compilation of C code across several machines on a network"
+HOMEPAGE="http://distcc.org/"
+SRC_URI="https://distcc.googlecode.com/files/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="gnome gssapi gtk hardened ipv6 selinux xinetd zeroconf"
+
+RESTRICT="test"
+
+CDEPEND="${PYTHON_DEPS}
+ dev-libs/popt
+ gnome? (
+ >=gnome-base/libgnome-2
+ >=gnome-base/libgnomeui-2
+ x11-libs/gtk+:2
+ x11-libs/pango
+ )
+ gssapi? ( net-libs/libgssglue )
+ gtk? ( x11-libs/gtk+:2 )
+ zeroconf? ( >=net-dns/avahi-0.6[dbus] )
+"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+ !net-misc/pump
+ dev-util/shadowman
+ >=sys-devel/gcc-config-1.4.1
+ selinux? ( sec-policy/selinux-distcc )
+ xinetd? ( sys-apps/xinetd )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewuser distcc 240 -1 -1 daemon
+ python-single-r1_pkg_setup
+
+ DCCC_PATH="/usr/$(get_libdir)/distcc/bin"
+ DISTCC_VERBOSE="0"
+}
+
+src_prepare() {
+ eapply "${FILESDIR}/${PN}-3.0-xinetd.patch"
+ # bug #253786
+ eapply "${FILESDIR}/${PN}-3.0-fix-fortify.patch"
+ # bug #255188
+ eapply "${FILESDIR}/${PN}-3.2_rc1-freedesktop.patch"
+ # bug #258364
+ eapply "${FILESDIR}/${PN}-3.2_rc1-python.patch"
+ # for net-libs/libgssglue
+ eapply "${FILESDIR}/${PN}-3.2_rc1-gssapi.patch"
+ # SOCKSv5 support needed for Portage, bug #537616
+ eapply "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
+ eapply_user
+
+ # Bugs #120001, #167844 and probably more. See patch for description.
+ use hardened && eapply "${FILESDIR}/distcc-hardened.patch"
+
+ sed -i \
+ -e "/PATH/s:\$distcc_location:${EPREFIX}${DCCC_PATH}:" \
+ -e "s:@PYTHON@:${EPYTHON}:" \
+ pump.in || die "sed failed"
+
+ sed \
+ -e "s:@EPREFIX@:${EPREFIX:-/}:" \
+ -e "s:@libdir@:/usr/$(get_libdir):" \
+ "${FILESDIR}/3.2/distcc-config" > "${T}/distcc-config" || die
+
+ eaclocal -Im4 --output=aclocal.m4
+ eautoconf
+}
+
+src_configure() {
+ local myconf="--disable-Werror --with-docdir=\$(datadir)/doc/${PF}"
+
+ # --disable-rfc2553 b0rked, bug #254176
+ use ipv6 && myconf="${myconf} --enable-rfc2553"
+
+ econf \
+ $(use_with gtk) \
+ $(use_with gnome) \
+ $(use_with gssapi auth) \
+ $(use_with zeroconf avahi) \
+ ${myconf}
+}
+
+src_install() {
+ default
+ python_optimize
+
+ newinitd "${FILESDIR}/3.2/init" distccd
+ systemd_dounit "${FILESDIR}/distccd.service"
+ systemd_install_serviced "${FILESDIR}/distccd.service.conf"
+
+ cp "${FILESDIR}/3.2/conf" "${T}/distccd" || die
+ if use zeroconf; then
+ cat >> "${T}/distccd" <<-EOF || die
+
+ # Enable zeroconf support in distccd
+ DISTCCD_OPTS="\${DISTCCD_OPTS} --zeroconf"
+ EOF
+
+ sed -i '/ExecStart/ s|$| --zeroconf|' "${D}$(systemd_get_systemunitdir)"/distccd.service || die
+ fi
+ doconfd "${T}/distccd" || die
+
+ cat > "${T}/02distcc" <<-EOF || die
+ # This file is managed by distcc-config; use it to change these settings.
+ # DISTCC_LOG and DISTCC_DIR should not be set.
+ DISTCC_VERBOSE="${DISTCC_VERBOSE:-0}"
+ DISTCC_FALLBACK="${DISTCC_FALLBACK:-1}"
+ DISTCC_SAVE_TEMPS="${DISTCC_SAVE_TEMPS:-0}"
+ DISTCC_TCP_CORK="${DISTCC_TCP_CORK}"
+ DISTCC_SSH="${DISTCC_SSH}"
+ UNCACHED_ERR_FD="${UNCACHED_ERR_FD}"
+ DISTCC_ENABLE_DISCREPANCY_EMAIL="${DISTCC_ENABLE_DISCREPANCY_EMAIL}"
+ DCC_EMAILLOG_WHOM_TO_BLAME="${DCC_EMAILLOG_WHOM_TO_BLAME}"
+ EOF
+ doenvd "${T}/02distcc" || die
+
+ keepdir "${DCCC_PATH}" || die
+
+ dobin "${T}/distcc-config" || die
+
+ if use gnome || use gtk; then
+ einfo "Renaming /usr/bin/distccmon-gnome to /usr/bin/distccmon-gui"
+ einfo "This is to have a little sensability in naming schemes between distccmon programs"
+ mv "${ED}/usr/bin/distccmon-gnome" "${ED}/usr/bin/distccmon-gui" || die
+ dosym distccmon-gui /usr/bin/distccmon-gnome || die
+ fi
+
+ if use xinetd; then
+ insinto /etc/xinetd.d || die
+ newins "doc/example/xinetd" distcc || die
+ fi
+
+ insinto /usr/share/shadowman/tools
+ newins - distcc <<<"${EPREFIX}${DCCC_PATH}"
+
+ rm -r "${ED}/etc/default" || die
+ rm "${ED}/etc/distcc/clients.allow" || die
+ rm "${ED}/etc/distcc/commands.allow.sh" || die
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == / ]]; then
+ eselect compiler-shadow update distcc
+ fi
+
+ use gnome && xdg_desktop_database_update
+
+ elog
+ elog "Tips on using distcc with Gentoo can be found at"
+ elog "https://wiki.gentoo.org/wiki/Distcc"
+ elog
+ elog "How to use pump mode with Gentoo:"
+ elog "# distcc-config --set-hosts \"foo,cpp,lzo bar,cpp,lzo baz,cpp,lzo\""
+ elog "# echo 'FEATURES=\"\${FEATURES} distcc distcc-pump\"' >> /etc/portage/make.conf"
+ elog "# emerge -u world"
+ elog
+ elog "To use the distccmon programs with Gentoo you should use this command:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-text 5"
+
+ if use gnome || use gtk; then
+ elog "Or:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-gnome"
+ fi
+
+ elog
+ elog "***SECURITY NOTICE***"
+ elog "If you are upgrading distcc please make sure to run etc-update to"
+ elog "update your /etc/conf.d/distccd and /etc/init.d/distccd files with"
+ elog "added security precautions (the --listen and --allow directives)"
+ elog
+}
+
+pkg_prerm() {
+ if [[ -z ${REPLACED_BY_VERSION} && ${ROOT} == / ]]; then
+ eselect compiler-shadow remove distcc
+ fi
+}
+
+pkg_postrm() {
+ use gnome && xdg_desktop_database_update
+}
diff --git a/sys-devel/distcc/files/3.0/conf b/sys-devel/distcc/files/3.0/conf
new file mode 100644
index 000000000000..c499271685e9
--- /dev/null
+++ b/sys-devel/distcc/files/3.0/conf
@@ -0,0 +1,40 @@
+# /etc/conf.d/distccd: config file for /etc/init.d/distccd
+
+DISTCCD_OPTS=""
+
+# this is the distccd executable
+DISTCCD_EXEC="/usr/bin/distccd"
+
+# this is where distccd will store its pid file
+DISTCCD_PIDFILE="/var/run/distccd/distccd.pid"
+
+# set this option to run distccd with extra parameters
+# Default port is 3632. For most people the default is okay.
+DISTCCD_OPTS="${DISTCCD_OPTS} --port 3632"
+
+# Logging
+# You can change some logging options here:
+# --log-file FILE
+# --log-level LEVEL [critical,error,warning, notice, info, debug]
+#
+# Leaving --log-file blank will log to syslog
+# example: --log-file /dev/null --log-level warning
+# example: --log-level critical
+
+DISTCCD_OPTS="${DISTCCD_OPTS} --log-level critical"
+
+# SECURITY NOTICE:
+# It is HIGHLY recommended that you use the --listen option
+# for increased security. You can specify an IP to permit connections
+# from or a CIDR mask
+# --listen accepts only a single IP
+# --allow is now mandatory as of distcc-2.18.
+# example: --allow 192.168.0.0/24
+# example: --allow 192.168.0.5 --allow 192.168.0.150
+# example: --listen 192.168.0.2
+DISTCCD_OPTS="${DISTCCD_OPTS} --allow 192.168.0.0/24"
+#DISTCCD_OPTS="${DISTCCD_OPTS} --listen 192.168.0.2"
+
+# set this for niceness
+# Default is 15
+DISTCCD_OPTS="${DISTCCD_OPTS} -N 15"
diff --git a/sys-devel/distcc/files/3.0/distcc-config b/sys-devel/distcc/files/3.0/distcc-config
new file mode 100644
index 000000000000..ed2a2eec435e
--- /dev/null
+++ b/sys-devel/distcc/files/3.0/distcc-config
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import os, re, signal, sys
+from string import rstrip
+from subprocess import Popen
+
+options=[
+ '--get-hosts',
+ '--set-hosts',
+ '--get-verbose',
+ '--set-verbose',
+ '--get-log',
+ '--set-log',
+ '--help',
+ '--get-env',
+ '--set-env'
+]
+
+tmpcmdline=sys.argv[1:]
+cmdline=[]
+envfile = '/etc/env.d/02distcc'
+
+def exithandler(foo,bar):
+ os.kill(0,signal.SIGKILL)
+ sys.exit(1)
+
+signal.signal(signal.SIGINT,exithandler)
+
+def isroot(ret=0):
+ if os.getuid() != 0:
+ if ret == 0:
+ print '!!!',sys.argv[:1][0],tmpcmdline[0],'must be run as root'
+ sys.exit(1)
+ else:
+ retval = 0
+ else:
+ retval = 1
+ return retval
+
+def writeenv(var,value):
+ isroot()
+ distcc_env = []
+ distcc_env = open(envfile, 'r').readlines()
+ distcc_env_new = open(envfile, 'w')
+ for i in range(len(distcc_env)):
+ if re.compile(var+'="(.*)"').match(distcc_env[i]):
+ distcc_env[i] = var+'="'+value+'"\n'
+ distcc_env_new.write(distcc_env[i])
+ #print 'Set',var,'to:',value
+ Popen('/usr/sbin/env-update', shell=True)
+ print 'If you want to use these new settings in an existing shell,'
+ print 'you need to "source /etc/profile" to get the changes.'
+
+def readenv(var):
+ distcc_env = open(envfile, 'r').read()
+ match = re.compile(var+'="(.*)"').search(distcc_env)
+ if match:
+ print var+'='+match.group(1)
+ else:
+ print var,'not set.'
+
+def createdistccdir(dir):
+ if not os.path.exists(dir):
+ os.mkdir(dir)
+ os.chmod(dir, 0755)
+
+for x in tmpcmdline:
+ if not x:
+ continue
+ if x[0:2]=="--":
+ if not x in options:
+ print "!!! Error:",x,"is an invalid option."
+ sys.exit(1)
+ else:
+ cmdline = x
+
+if '--get-hosts' in tmpcmdline:
+ HOSTS_ENV = os.environ.get('DISTCC_HOSTS')
+ HOSTS_HOME = os.environ.get('HOME')+'/hosts'
+ if HOSTS_ENV:
+ print HOSTS_ENV
+ elif os.path.isfile(HOSTS_HOME) and os.path.getsize(HOSTS_HOME) != 0:
+ print rstrip(open(HOSTS_HOME, 'r').read())
+ elif os.path.exists('/etc/distcc/hosts'):
+ print rstrip(open('/etc/distcc/hosts', 'r').read())
+ else:
+ print 'No configuration file found. Setup your hosts with --set-hosts.'
+elif '--set-hosts' in tmpcmdline:
+ if isroot(1):
+ PATH = '/etc/distcc'
+ else:
+ PATH = os.environ.get('HOME')
+ createdistccdir(PATH)
+ open(PATH+'/hosts', 'w').write(cmdline + '\n')
+elif '--get-verbose' in tmpcmdline:
+ readenv('DISTCC_VERBOSE')
+elif '--set-verbose' in tmpcmdline:
+ writeenv('DISTCC_VERBOSE',tmpcmdline[1])
+elif '--get-log' in tmpcmdline:
+ readenv('DISTCC_LOG')
+elif '--set-log' in tmpcmdline:
+ writeenv('DISTCC_LOG',tmpcmdline[1])
+elif '--get-env' in tmpcmdline:
+ if len(tmpcmdline) == 1:
+ print rstrip(open(envfile, 'r').read())
+ elif len(tmpcmdline) == 2:
+ readenv(tmpcmdline[1])
+ else:
+ print '!!! Error: Specify only one variable.'
+elif '--set-env' in tmpcmdline:
+ if len(tmpcmdline) > 2 and len(tmpcmdline) <= 3:
+ isroot()
+ writeenv(tmpcmdline[1],tmpcmdline[2])
+ else:
+ print '!!! Error: Awaiting two parameters.'
+else:
+ print 'Usage: %s --set-hosts DISTCC_HOSTS | --get-hosts' % sys.argv[0]
+ print ' %s --set-verbose { 0 | 1 } | --get-verbose' % sys.argv[0]
+ print ' %s --set-log FILE | --get-log' % sys.argv[0]
+ print ' %s --set-env VARIABLE VALUE | --get-env [VARIABLE]' % sys.argv[0]
diff --git a/sys-devel/distcc/files/3.1/conf b/sys-devel/distcc/files/3.1/conf
new file mode 100644
index 000000000000..39f6e3e86f45
--- /dev/null
+++ b/sys-devel/distcc/files/3.1/conf
@@ -0,0 +1,35 @@
+# /etc/conf.d/distccd: config file for /etc/init.d/distccd
+
+# this is the distccd executable
+DISTCCD_EXEC="/usr/bin/distccd"
+
+# this is where distccd will store its pid file
+DISTCCD_PIDFILE="/var/run/distccd/distccd.pid"
+
+# Ports:
+# Default port is 3632. For most people the default is okay.
+#
+# Logging:
+# You can change some logging options here:
+# --log-file FILE
+# --log-level LEVEL [critical,error,warning, notice, info, debug]
+#
+# Leaving --log-file blank will log to syslog
+# example: --log-file /dev/null --log-level warning
+# example: --log-level critical
+#
+# Nice level:
+# The default nice level is 15. You can change it by adding: -N xx
+# where xx is the nice level.
+
+# SECURITY NOTICE:
+# It is HIGHLY recommended that you use the --listen option
+# for increased security. You can specify an IP to permit connections
+# from or a CIDR mask
+# --listen accepts only a single IP
+# --allow is now mandatory as of distcc-2.18.
+# example: --allow 192.168.0.0/24
+# example: --allow 192.168.0.5 --allow 192.168.0.150
+# example: --listen 192.168.0.2
+
+DISTCCD_OPTS="--port 3632 --log-level notice --log-file /var/log/distccd.log -N 15"
diff --git a/sys-devel/distcc/files/3.1/init b/sys-devel/distcc/files/3.1/init
new file mode 100644
index 000000000000..e89dcb3702b7
--- /dev/null
+++ b/sys-devel/distcc/files/3.1/init
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+ use avahi-daemon ypbind
+}
+
+start() {
+ ebegin "Starting distccd"
+
+ if [ ! -e /var/run/distccd ] ; then
+ mkdir -p /var/run/distccd
+ chown distcc:daemon /var/run/distccd
+ fi
+
+ # Load PATH and GCC_SPECS from gcc-config, bug #262773
+ eval "$(gcc-config -E)"
+
+ start-stop-daemon --start --quiet --exec "${DISTCCD_EXEC}" --user distcc -- \
+ --daemon --pid-file "${DISTCCD_PIDFILE}" \
+ ${DISTCCD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping distccd"
+ start-stop-daemon --stop --quiet --pidfile "${DISTCCD_PIDFILE}"
+ eend $?
+}
diff --git a/sys-devel/distcc/files/3.2/conf b/sys-devel/distcc/files/3.2/conf
new file mode 100644
index 000000000000..c499271685e9
--- /dev/null
+++ b/sys-devel/distcc/files/3.2/conf
@@ -0,0 +1,40 @@
+# /etc/conf.d/distccd: config file for /etc/init.d/distccd
+
+DISTCCD_OPTS=""
+
+# this is the distccd executable
+DISTCCD_EXEC="/usr/bin/distccd"
+
+# this is where distccd will store its pid file
+DISTCCD_PIDFILE="/var/run/distccd/distccd.pid"
+
+# set this option to run distccd with extra parameters
+# Default port is 3632. For most people the default is okay.
+DISTCCD_OPTS="${DISTCCD_OPTS} --port 3632"
+
+# Logging
+# You can change some logging options here:
+# --log-file FILE
+# --log-level LEVEL [critical,error,warning, notice, info, debug]
+#
+# Leaving --log-file blank will log to syslog
+# example: --log-file /dev/null --log-level warning
+# example: --log-level critical
+
+DISTCCD_OPTS="${DISTCCD_OPTS} --log-level critical"
+
+# SECURITY NOTICE:
+# It is HIGHLY recommended that you use the --listen option
+# for increased security. You can specify an IP to permit connections
+# from or a CIDR mask
+# --listen accepts only a single IP
+# --allow is now mandatory as of distcc-2.18.
+# example: --allow 192.168.0.0/24
+# example: --allow 192.168.0.5 --allow 192.168.0.150
+# example: --listen 192.168.0.2
+DISTCCD_OPTS="${DISTCCD_OPTS} --allow 192.168.0.0/24"
+#DISTCCD_OPTS="${DISTCCD_OPTS} --listen 192.168.0.2"
+
+# set this for niceness
+# Default is 15
+DISTCCD_OPTS="${DISTCCD_OPTS} -N 15"
diff --git a/sys-devel/distcc/files/3.2/distcc-config b/sys-devel/distcc/files/3.2/distcc-config
new file mode 100644
index 000000000000..cff742c6d22c
--- /dev/null
+++ b/sys-devel/distcc/files/3.2/distcc-config
@@ -0,0 +1,180 @@
+#!/usr/bin/env python2
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import os, re, signal, subprocess, sys
+
+options=[
+ '--get-hosts',
+ '--set-hosts',
+ '--get-verbose',
+ '--set-verbose',
+ '--get-log',
+ '--set-log',
+ '--update-masquerade',
+ '--update-masquerade-with-crossdev',
+ '--help',
+ '--get-env',
+ '--set-env'
+]
+
+tmpcmdline=sys.argv[1:]
+cmdline=[]
+
+eprefix = '@EPREFIX@'
+bindir = os.path.join(eprefix, 'usr', 'bin')
+sbindir = os.path.join(eprefix, 'usr', 'sbin')
+libdir = os.path.join(eprefix, '@libdir@')
+sysconfdir = os.path.join(eprefix, 'etc')
+
+gcc_config = os.path.join(bindir, 'gcc-config')
+env_update = os.path.join(sbindir, 'env-update')
+envfile = os.path.join(sysconfdir, 'env.d', '02distcc')
+default_distcc_dir = os.path.join(sysconfdir, 'distcc')
+hostfile = os.path.join(default_distcc_dir, 'hosts')
+distcc_path = os.path.join(bindir, 'distcc')
+dccc_dir = os.path.join(libdir, 'distcc', 'bin')
+
+def exithandler(foo,bar):
+ os.kill(0,signal.SIGKILL)
+ sys.exit(1)
+
+signal.signal(signal.SIGINT,exithandler)
+
+def isroot(ret=0):
+ if os.getuid() != 0:
+ if ret == 0:
+ print('!!! %s %s must be run as root' % (sys.argv[:1][0],tmpcmdline[0]))
+ sys.exit(1)
+ else:
+ retval = 0
+ else:
+ retval = 1
+ return retval
+
+def writeenv(var,value):
+ isroot()
+ distcc_env = []
+ distcc_env = open(envfile, 'r').readlines()
+ distcc_env_new = open(envfile, 'w')
+ for i in range(len(distcc_env)):
+ if re.compile(var+'="(.*)"').match(distcc_env[i]):
+ distcc_env[i] = var+'="'+value+'"\n'
+ distcc_env_new.write(distcc_env[i])
+ #print('Set %s to: %s ' % (var,value))
+ subprocess.Popen(env_update, shell=True)
+ print('If you want to use these new settings in an existing shell,')
+ print('you need to "source /etc/profile" to get the changes.')
+
+def readenv(var):
+ distcc_env = open(envfile, 'r').read()
+ match = re.compile(var+'="(.*)"').search(distcc_env)
+ if match:
+ print(var+'='+match.group(1))
+ else:
+ print(var,'not set.')
+
+def installlink(chost='', version=''):
+ for file in ['gcc', 'cc', 'c++', 'g++']:
+ if not chost == '':
+ file = '%s-%s' % (chost,file)
+ if not version == '':
+ file = '%s-%s' % (file,version)
+ path = os.path.join(dccc_dir,file)
+ if os.path.exists(os.path.join(bindir,file)):
+ if not os.path.exists(path):
+ print('Creating %s symlink...' % (path))
+ os.symlink(distcc_path,path)
+ #else:
+ # print('Already exists. Skipping...')
+
+def installlinks():
+ p = subprocess.Popen([gcc_config+" -C -l"], shell=True, stdout=subprocess.PIPE)
+ lines = p.stdout.read().rstrip().split('\n')
+ for line in lines:
+ columns = line.split()
+ if len(columns) >= 2:
+ matches = re.match("(.*)-(.*)", columns[1])
+ chost = matches.group(1)
+ version = matches.group(2)
+ installlink(chost)
+ installlink(chost, version)
+
+def uninstalllinks():
+ for root, dirs, files in os.walk(dccc_dir):
+ for file in files:
+ os.remove(os.path.join(root, file))
+
+def createdistccdir(dir):
+ if not os.path.exists(dir):
+ os.mkdir(dir)
+ os.chmod(dir, 0o755)
+
+for x in tmpcmdline:
+ if not x:
+ continue
+ if x[0:2]=="--":
+ if not x in options:
+ print("!!! Error: %s is an invalid option." % (x))
+ sys.exit(1)
+ else:
+ cmdline = x
+
+if '--get-hosts' in tmpcmdline:
+ HOSTS_ENV = os.environ.get('DISTCC_HOSTS')
+ HOSTS_HOME = os.path.join(os.environ.get('HOME'), '.distcc', 'hosts')
+ if HOSTS_ENV:
+ print(HOSTS_ENV)
+ elif os.path.isfile(HOSTS_HOME) and os.path.getsize(HOSTS_HOME) != 0:
+ print(HOSTS_HOME)
+ elif os.path.exists(hostfile):
+ print(open(hostfile, 'r').read().rstrip())
+ else:
+ print('No configuration file found. Setup your hosts with --set-hosts.')
+elif '--set-hosts' in tmpcmdline:
+ if isroot(1):
+ PATH = default_distcc_dir
+ else:
+ PATH = os.path.join(os.environ.get('HOME'), '.distcc')
+ createdistccdir(PATH)
+ open(os.path.join(PATH, 'hosts'), 'w').write(cmdline + '\n')
+elif '--get-verbose' in tmpcmdline:
+ readenv('DISTCC_VERBOSE')
+elif '--set-verbose' in tmpcmdline:
+ writeenv('DISTCC_VERBOSE',tmpcmdline[1])
+elif '--get-log' in tmpcmdline:
+ readenv('DISTCC_LOG')
+elif '--set-log' in tmpcmdline:
+ writeenv('DISTCC_LOG',tmpcmdline[1])
+elif '--update-masquerade' in tmpcmdline:
+ isroot()
+ uninstalllinks()
+ print('Creating symlinks...')
+ installlink()
+ installlinks()
+elif '--update-masquerade-with-crossdev' in tmpcmdline:
+ isroot()
+ uninstalllinks()
+ print('Creating symlinks...')
+ installlinks()
+elif '--get-env' in tmpcmdline:
+ if len(tmpcmdline) == 1:
+ print(open(envfile, 'r').read().rstrip())
+ elif len(tmpcmdline) == 2:
+ readenv(tmpcmdline[1])
+ else:
+ print('!!! Error: Specify only one variable.')
+elif '--set-env' in tmpcmdline:
+ if len(tmpcmdline) > 2 and len(tmpcmdline) <= 3:
+ isroot()
+ writeenv(tmpcmdline[1],tmpcmdline[2])
+ else:
+ print('!!! Error: Awaiting two parameters.')
+else:
+ cmd = sys.argv[:1][0]
+ print('Usage: %s --set-hosts DISTCC_HOSTS | --get-hosts' % (cmd))
+ print(' %s --set-verbose { 0 | 1 } | --get-verbose' % (cmd))
+ print(' %s --set-log FILE | --get-log' % (cmd))
+ print(' %s --set-env VARIABLE VALUE | --get-env [VARIABLE]' % (cmd))
+ print(' %s --update-masquerade' % (cmd))
+ print(' %s --update-masquerade-with-crossdev' % (cmd))
diff --git a/sys-devel/distcc/files/3.2/init b/sys-devel/distcc/files/3.2/init
new file mode 100644
index 000000000000..e89dcb3702b7
--- /dev/null
+++ b/sys-devel/distcc/files/3.2/init
@@ -0,0 +1,31 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+ use avahi-daemon ypbind
+}
+
+start() {
+ ebegin "Starting distccd"
+
+ if [ ! -e /var/run/distccd ] ; then
+ mkdir -p /var/run/distccd
+ chown distcc:daemon /var/run/distccd
+ fi
+
+ # Load PATH and GCC_SPECS from gcc-config, bug #262773
+ eval "$(gcc-config -E)"
+
+ start-stop-daemon --start --quiet --exec "${DISTCCD_EXEC}" --user distcc -- \
+ --daemon --pid-file "${DISTCCD_PIDFILE}" \
+ ${DISTCCD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping distccd"
+ start-stop-daemon --stop --quiet --pidfile "${DISTCCD_PIDFILE}"
+ eend $?
+}
diff --git a/sys-devel/distcc/files/distcc-3.0-fix-fortify.patch b/sys-devel/distcc/files/distcc-3.0-fix-fortify.patch
new file mode 100644
index 000000000000..8edc330e324b
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.0-fix-fortify.patch
@@ -0,0 +1,11 @@
+diff -ru a/src/snprintf.h b/src/snprintf.h
+--- a/src/snprintf.h 2008-08-06 15:52:06.000000000 -0500
++++ b/src/snprintf.h 2009-01-04 15:19:22.000000000 -0600
+@@ -7,6 +7,7 @@
+ */
+
+ #include <stdarg.h>
++#include "config.h"
+
+ #ifdef __GNUC__
+ /** Use gcc attribute to check printf fns. a1 is the 1-based index of
diff --git a/sys-devel/distcc/files/distcc-3.0-xinetd.patch b/sys-devel/distcc/files/distcc-3.0-xinetd.patch
new file mode 100644
index 000000000000..47877ad45b42
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.0-xinetd.patch
@@ -0,0 +1,15 @@
+diff -Naur distcc-3.0.orig/doc/example/xinetd distcc-3.0/doc/example/xinetd
+--- distcc-3.0.orig/doc/example/xinetd 2008-08-07 05:52:13.000000000 +0900
++++ distcc-3.0/doc/example/xinetd 2008-10-27 15:32:14.000000000 +0900
+@@ -19,10 +19,6 @@
+ socket_type = stream
+ wait = no
+ user = distcc
+- server = /usr/local/bin/distccd
++ server = /usr/bin/distccd
+ server_args = --inetd
+-
+- # This makes xinetd cope if there is no service listed in
+- # /etc/services
+- type = UNLISTED
+ }
diff --git a/sys-devel/distcc/files/distcc-3.1-argc-fix.patch b/sys-devel/distcc/files/distcc-3.1-argc-fix.patch
new file mode 100644
index 000000000000..d7f30b5567fa
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.1-argc-fix.patch
@@ -0,0 +1,17 @@
+this fixes virtualbox not compiling with distcc
+
+https://bugs.gentoo.org/show_bug.cgi?id=351979
+http://code.google.com/p/distcc/issues/detail?id=83
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626926
+
+--- distcc-3.1.orig/source/src/arg.c
++++ distcc-3.1/source/src/arg.c
+@@ -515,6 +515,8 @@
+ }
+ free(argv);
+ *argv_ptr = argv = new_argv;
++ i += extra_args - 1;
++ argc += extra_args - 1;
+ }
+ }
+ return 0;
diff --git a/sys-devel/distcc/files/distcc-3.1-freedesktop.patch b/sys-devel/distcc/files/distcc-3.1-freedesktop.patch
new file mode 100644
index 000000000000..b23db21a2558
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.1-freedesktop.patch
@@ -0,0 +1,76 @@
+diff -Naur distcc-3.1.orig/Makefile.in distcc-3.1/Makefile.in
+--- distcc-3.1.orig/Makefile.in 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/Makefile.in 2009-02-02 00:40:20.000000000 +0900
+@@ -49,13 +49,14 @@
+ includedir = @includedir@
+ oldincludedir = /usr/include
+ docdir = @docdir@
+-pkgdatadir = $(datadir)/@PACKAGE_NAME@
++icondir = $(datadir)/pixmaps
++desktopdir = $(datadir)/applications
+
+ include_server_builddir = $(builddir)/_include_server
+
+ # These must be done from here, not from autoconf, because they can
+ # contain variable expansions written in Make syntax. Ew.
+-DIR_DEFS = -DSYSCONFDIR="\"${sysconfdir}\"" -DPKGDATADIR="\"${pkgdatadir}\""
++DIR_DEFS = -DSYSCONFDIR="\"${sysconfdir}\"" -DICONDIR="\"${icondir}\""
+
+ # arguments to pkgconfig
+ GNOME_PACKAGES = @GNOME_PACKAGES@
+@@ -1003,7 +1004,8 @@
+ @echo " documents $(DESTDIR)$(docdir)"
+ @echo " programs $(DESTDIR)$(bindir)"
+ @echo " system configuration $(DESTDIR)$(sysconfdir)"
+- @echo " shared data files $(DESTDIR)$(pkgdatadir)"
++ @echo " icons $(DESTDIR)$(icondir)"
++ @echo " .desktop file $(DESTDIR)$(desktopdir)"
+
+
+ # install-sh can't handle multiple arguments, but we don't need any
+@@ -1086,10 +1088,10 @@
+ done
+
+ install-gnome-data: $(gnome_data)
+- $(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)"
+- for p in $(gnome_data); do \
+- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
+- done
++ $(mkinstalldirs) $(DESTDIR)$(icondir)
++ $(mkinstalldirs) $(DESTDIR)$(desktopdir)
++ $(INSTALL_DATA) gnome/distccmon-gnome-icon.png $(DESTDIR)$(icondir)
++ $(INSTALL_DATA) gnome/distccmon-gnome.desktop $(DESTDIR)$(desktopdir)
+
+ install-conf: $(conf_files) $(default_files)
+ $(mkinstalldirs) "$(DESTDIR)$(sysconfdir)/distcc"
+diff -Naur distcc-3.1.orig/gnome/distccmon-gnome.desktop distcc-3.1/gnome/distccmon-gnome.desktop
+--- distcc-3.1.orig/gnome/distccmon-gnome.desktop 2008-12-03 06:50:27.000000000 +0900
++++ distcc-3.1/gnome/distccmon-gnome.desktop 2009-02-02 00:40:55.000000000 +0900
+@@ -1,13 +1,11 @@
+ [Desktop Entry]
+-Version=0.9.4
+-Encoding=UTF-8
+ Exec=distccmon-gnome
+ Name=distcc monitor
+ GenericName=Distributed Compile Monitor
+ Comment=Graphical view of distributed compile tasks
+-Icon=distccmon-gnome-icon.png
++Icon=distccmon-gnome-icon
+ TryExec=distccmon-gnome
+ Terminal=false
+ Type=Application
+-Categories=GNOME;Application;Development;
++Categories=GNOME;Development;
+ StartupNotify=true
+diff -Naur distcc-3.1.orig/src/mon-gnome.c distcc-3.1/src/mon-gnome.c
+--- distcc-3.1.orig/src/mon-gnome.c 2008-12-03 06:50:25.000000000 +0900
++++ distcc-3.1/src/mon-gnome.c 2009-02-02 00:41:18.000000000 +0900
+@@ -599,7 +599,7 @@
+
+ #if GTK_CHECK_VERSION(2,2,0)
+ gtk_window_set_icon_from_file (GTK_WINDOW (mainwin),
+- PKGDATADIR "/distccmon-gnome-icon.png",
++ ICONDIR "/distccmon-gnome-icon.png",
+ NULL);
+ #endif
+
diff --git a/sys-devel/distcc/files/distcc-3.1-python.patch b/sys-devel/distcc/files/distcc-3.1-python.patch
new file mode 100644
index 000000000000..733357a53932
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.1-python.patch
@@ -0,0 +1,258 @@
+diff -Naur distcc-3.1.orig/bench/statistics.py distcc-3.1/bench/statistics.py
+--- distcc-3.1.orig/bench/statistics.py 2008-12-03 06:50:21.000000000 +0900
++++ distcc-3.1/bench/statistics.py 2009-03-17 01:29:26.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python2.2
++#! /usr/bin/env python
+
+ # benchmark -- automated system for testing distcc correctness
+ # and performance on various source trees.
+diff -Naur distcc-3.1.orig/configure distcc-3.1/configure
+--- distcc-3.1.orig/configure 2008-12-03 06:50:34.000000000 +0900
++++ distcc-3.1/configure 2009-03-17 01:31:09.000000000 +0900
+@@ -3629,7 +3629,7 @@
+ #
+ # NB: Cannot use AC_CONFIG_LIBOBJ_DIR here, because it's not present
+ # in autoconf 2.53.
+-for ac_prog in python2.5 python-2.5 python2.4 python-2.4 python
++for ac_prog in python
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
+diff -Naur distcc-3.1.orig/configure.ac distcc-3.1/configure.ac
+--- distcc-3.1.orig/configure.ac 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/configure.ac 2009-03-17 01:29:04.000000000 +0900
+@@ -243,7 +243,7 @@
+ #
+ # NB: Cannot use AC_CONFIG_LIBOBJ_DIR here, because it's not present
+ # in autoconf 2.53.
+-AC_PATH_PROGS(PYTHON, [python2.5 python-2.5 python2.4 python-2.4 python])
++AC_PATH_PROGS(PYTHON, [python])
+ AC_ARG_VAR(PYTHON, [Python interpreter])
+ # Python 1 doesn't even support -V
+ if ! "$PYTHON" -V 2>&1 | grep "^Python" >/dev/null; then
+diff -Naur distcc-3.1.orig/include_server/basics.py distcc-3.1/include_server/basics.py
+--- distcc-3.1.orig/include_server/basics.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/basics.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+ #
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/basics_test.py distcc-3.1/include_server/basics_test.py
+--- distcc-3.1.orig/include_server/basics_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/basics_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/c_extensions_test.py distcc-3.1/include_server/c_extensions_test.py
+--- distcc-3.1.orig/include_server/c_extensions_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/c_extensions_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/cache_basics.py distcc-3.1/include_server/cache_basics.py
+--- distcc-3.1.orig/include_server/cache_basics.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/cache_basics.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/compiler_defaults.py distcc-3.1/include_server/compiler_defaults.py
+--- distcc-3.1.orig/include_server/compiler_defaults.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/compiler_defaults.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/compress_files.py distcc-3.1/include_server/compress_files.py
+--- distcc-3.1.orig/include_server/compress_files.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/compress_files.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/include_analyzer.py distcc-3.1/include_server/include_analyzer.py
+--- distcc-3.1.orig/include_server/include_analyzer.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/include_analyzer.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/include_analyzer_memoizing_node.py distcc-3.1/include_server/include_analyzer_memoizing_node.py
+--- distcc-3.1.orig/include_server/include_analyzer_memoizing_node.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/include_analyzer_memoizing_node.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/include_analyzer_memoizing_node_test.py distcc-3.1/include_server/include_analyzer_memoizing_node_test.py
+--- distcc-3.1.orig/include_server/include_analyzer_memoizing_node_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/include_analyzer_memoizing_node_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/include_analyzer_test.py distcc-3.1/include_server/include_analyzer_test.py
+--- distcc-3.1.orig/include_server/include_analyzer_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/include_analyzer_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/include_server.py distcc-3.1/include_server/include_server.py
+--- distcc-3.1.orig/include_server/include_server.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/include_server.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/include_server_test.py distcc-3.1/include_server/include_server_test.py
+--- distcc-3.1.orig/include_server/include_server_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/include_server_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/macro_eval.py distcc-3.1/include_server/macro_eval.py
+--- distcc-3.1.orig/include_server/macro_eval.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/macro_eval.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/macro_eval_test.py distcc-3.1/include_server/macro_eval_test.py
+--- distcc-3.1.orig/include_server/macro_eval_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/macro_eval_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/mirror_path.py distcc-3.1/include_server/mirror_path.py
+--- distcc-3.1.orig/include_server/mirror_path.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/mirror_path.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/mirror_path_test.py distcc-3.1/include_server/mirror_path_test.py
+--- distcc-3.1.orig/include_server/mirror_path_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/mirror_path_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/parse_command.py distcc-3.1/include_server/parse_command.py
+--- distcc-3.1.orig/include_server/parse_command.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/parse_command.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/parse_command_test.py distcc-3.1/include_server/parse_command_test.py
+--- distcc-3.1.orig/include_server/parse_command_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/parse_command_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/parse_file.py distcc-3.1/include_server/parse_file.py
+--- distcc-3.1.orig/include_server/parse_file.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/parse_file.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/parse_file_test.py distcc-3.1/include_server/parse_file_test.py
+--- distcc-3.1.orig/include_server/parse_file_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/parse_file_test.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/run.py distcc-3.1/include_server/run.py
+--- distcc-3.1.orig/include_server/run.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/run.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/setup.py distcc-3.1/include_server/setup.py
+--- distcc-3.1.orig/include_server/setup.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/setup.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/include_server/statistics.py distcc-3.1/include_server/statistics.py
+--- distcc-3.1.orig/include_server/statistics.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.1/include_server/statistics.py 2009-03-17 01:30:46.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+ #
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/test/onetest.py distcc-3.1/test/onetest.py
+--- distcc-3.1.orig/test/onetest.py 2008-12-03 06:50:22.000000000 +0900
++++ distcc-3.1/test/onetest.py 2009-03-17 01:29:44.000000000 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+ #
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.1.orig/test/testdistcc.py distcc-3.1/test/testdistcc.py
+--- distcc-3.1.orig/test/testdistcc.py 2008-12-03 06:50:22.000000000 +0900
++++ distcc-3.1/test/testdistcc.py 2009-03-17 01:29:36.000000000 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python2.2
++#! /usr/bin/env python
+
+ # Copyright (C) 2002, 2003, 2004 by Martin Pool <mbp@samba.org>
+ # Copyright 2007 Google Inc.
diff --git a/sys-devel/distcc/files/distcc-3.2_rc1-freedesktop.patch b/sys-devel/distcc/files/distcc-3.2_rc1-freedesktop.patch
new file mode 100644
index 000000000000..8f0d8d77a12b
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.2_rc1-freedesktop.patch
@@ -0,0 +1,79 @@
+diff -Naur distcc-3.2rc1.orig/Makefile.in distcc-3.2rc1/Makefile.in
+--- distcc-3.2rc1.orig/Makefile.in 2011-10-26 11:07:15.000000000 +0900
++++ distcc-3.2rc1/Makefile.in 2011-10-27 16:57:46.815272689 +0900
+@@ -50,13 +50,14 @@
+ includedir = @includedir@
+ oldincludedir = /usr/include
+ docdir = @docdir@
+-pkgdatadir = $(datadir)/@PACKAGE_NAME@
++icondir = $(datadir)/pixmaps
++desktopdir = $(datadir)/applications
+
+ include_server_builddir = $(builddir)/_include_server
+
+ # These must be done from here, not from autoconf, because they can
+ # contain variable expansions written in Make syntax. Ew.
+-DIR_DEFS = -DSYSCONFDIR="\"${sysconfdir}\"" -DPKGDATADIR="\"${pkgdatadir}\""
++DIR_DEFS = -DSYSCONFDIR="\"${sysconfdir}\"" -DICONDIR="\"${icondir}\""
+
+ # arguments to pkgconfig
+ GNOME_PACKAGES = @GNOME_PACKAGES@
+@@ -1016,7 +1017,8 @@
+ @echo " documents $(DESTDIR)$(docdir)"
+ @echo " programs $(DESTDIR)$(bindir)"
+ @echo " system configuration $(DESTDIR)$(sysconfdir)"
+- @echo " shared data files $(DESTDIR)$(pkgdatadir)"
++ @echo " icons $(DESTDIR)$(icondir)"
++ @echo " .desktop file $(DESTDIR)$(desktopdir)"
+
+
+ # install-sh can't handle multiple arguments, but we don't need any
+@@ -1108,10 +1110,10 @@
+ done
+
+ install-gnome-data: $(gnome_data)
+- $(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)"
+- for p in $(gnome_data); do \
+- $(INSTALL_DATA) "$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
+- done
++ $(mkinstalldirs) "$(DESTDIR)$(icondir)"
++ $(mkinstalldirs) "$(DESTDIR)$(desktopdir)"
++ $(INSTALL_DATA) gnome/distccmon-gnome-icon.png "$(DESTDIR)$(icondir)" || exit 1
++ $(INSTALL_DATA) gnome/distccmon-gnome.desktop "$(DESTDIR)$(desktopdir)" || exit 1
+
+ install-conf: $(conf_files) $(default_files)
+ $(mkinstalldirs) "$(DESTDIR)$(sysconfdir)/distcc"
+diff -Naur distcc-3.2rc1.orig/gnome/distccmon-gnome.desktop distcc-3.2rc1/gnome/distccmon-gnome.desktop
+--- distcc-3.2rc1.orig/gnome/distccmon-gnome.desktop 2011-04-06 03:58:58.000000000 +0900
++++ distcc-3.2rc1/gnome/distccmon-gnome.desktop 2011-10-27 17:01:50.792242592 +0900
+@@ -1,6 +1,4 @@
+ [Desktop Entry]
+-Version=0.9.4
+-Encoding=UTF-8
+ Exec=distccmon-gnome
+ Name=distcc monitor
+ Name[sv]=distcc vervakare
+@@ -8,9 +6,9 @@
+ GenericName[sv]=Distribuerad kompilerings-vervakare
+ Comment=Graphical view of distributed compile tasks
+ Comment[sv]=Grafisk vy av distribuerade kompileringsuppgifter
+-Icon=distccmon-gnome-icon.png
++Icon=distccmon-gnome-icon
+ TryExec=distccmon-gnome
+ Terminal=false
+ Type=Application
+-Categories=GNOME;Application;Development;
++Categories=GNOME;Development;
+ StartupNotify=true
+diff -Naur distcc-3.2rc1.orig/src/mon-gnome.c distcc-3.2rc1/src/mon-gnome.c
+--- distcc-3.2rc1.orig/src/mon-gnome.c 2008-12-03 06:50:25.000000000 +0900
++++ distcc-3.2rc1/src/mon-gnome.c 2011-10-27 16:54:50.220566026 +0900
+@@ -599,7 +599,7 @@
+
+ #if GTK_CHECK_VERSION(2,2,0)
+ gtk_window_set_icon_from_file (GTK_WINDOW (mainwin),
+- PKGDATADIR "/distccmon-gnome-icon.png",
++ ICONDIR "/distccmon-gnome-icon.png",
+ NULL);
+ #endif
+
diff --git a/sys-devel/distcc/files/distcc-3.2_rc1-gssapi.patch b/sys-devel/distcc/files/distcc-3.2_rc1-gssapi.patch
new file mode 100644
index 000000000000..73551f8a7b80
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.2_rc1-gssapi.patch
@@ -0,0 +1,36 @@
+diff -Naur distcc-3.2rc1.orig/configure.ac distcc-3.2rc1/configure.ac
+--- distcc-3.2rc1.orig/configure.ac 2011-10-21 13:40:55.000000000 +0900
++++ distcc-3.2rc1/configure.ac 2011-10-27 18:06:58.938922585 +0900
+@@ -15,6 +15,8 @@
+ AC_CONFIG_HEADERS(src/config.h)
+ AC_CANONICAL_HOST
+
++PKG_PROG_PKG_CONFIG
++
+ # FreeBSD installs its version of libpopt into /usr/local/, but does
+ # not put that on the default library and header path.
+ # Solaris doesn't even ship libpopt. We used to add that path if
+@@ -502,16 +504,17 @@
+ [provide mutual authentication services via the GSS-API])])
+
+ if test x"$with_auth" = xyes; then
+- AC_SEARCH_LIBS([gss_init_sec_context],
+- [gssapi gssapi_krb5],
+- AC_DEFINE(HAVE_GSSAPI, 1, [Define if the GSS_API is available])
++ PKG_CHECK_MODULES(GSSAPI, libgssglue,
++ [AC_DEFINE(HAVE_GSSAPI, 1, [Define if the GSS_API is available])
++ CFLAGS="$CFLAGS $GSSAPI_CFLAGS"
++ LIBS="$LIBS $GSSAPI_LIBS"
+ AUTH_COMMON_OBJS="src/auth_common.o"
+ AUTH_DISTCC_OBJS="src/auth_distcc.o"
+- AUTH_DISTCCD_OBJS="src/auth_distccd.o",
+- AC_MSG_FAILURE([--with-auth was given but no GSS-API library found])
++ AUTH_DISTCCD_OBJS="src/auth_distccd.o"],
++ [AC_MSG_FAILURE([--with-auth was given but no GSS-API library found])
+ AUTH_COMMON_OBJS=""
+ AUTH_DISTCC_OBJS=""
+- AUTH_DISTCCD_OBJS="")
++ AUTH_DISTCCD_OBJS=""])
+ fi
+
+ AC_SUBST(AUTH_COMMON_OBJS)
diff --git a/sys-devel/distcc/files/distcc-3.2_rc1-python.patch b/sys-devel/distcc/files/distcc-3.2_rc1-python.patch
new file mode 100644
index 000000000000..409b5a19d321
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.2_rc1-python.patch
@@ -0,0 +1,246 @@
+diff -Naur distcc-3.2rc1.orig/bench/statistics.py distcc-3.2rc1/bench/statistics.py
+--- distcc-3.2rc1.orig/bench/statistics.py 2008-12-03 06:50:21.000000000 +0900
++++ distcc-3.2rc1/bench/statistics.py 2011-10-27 17:05:08.418023081 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python2.2
++#! /usr/bin/env python
+
+ # benchmark -- automated system for testing distcc correctness
+ # and performance on various source trees.
+diff -Naur distcc-3.2rc1.orig/configure.ac distcc-3.2rc1/configure.ac
+--- distcc-3.2rc1.orig/configure.ac 2011-10-21 13:40:55.000000000 +0900
++++ distcc-3.2rc1/configure.ac 2011-10-27 17:05:31.179112690 +0900
+@@ -243,7 +243,7 @@
+ #
+ # NB: Cannot use AC_CONFIG_LIBOBJ_DIR here, because it's not present
+ # in autoconf 2.53.
+-AC_PATH_PROGS(PYTHON, [python2.6 python-2.6 python2.5 python-2.5 python2.4 python-2.4 python])
++AC_PATH_PROGS(PYTHON, [python])
+ AC_ARG_VAR(PYTHON, [Python interpreter])
+ # Python 1 doesn't even support -V
+ if ! "$PYTHON" -V 2>&1 | grep "^Python" >/dev/null; then
+diff -Naur distcc-3.2rc1.orig/include_server/basics.py distcc-3.2rc1/include_server/basics.py
+--- distcc-3.2rc1.orig/include_server/basics.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/basics.py 2011-10-27 17:05:08.421023097 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+ #
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/basics_test.py distcc-3.2rc1/include_server/basics_test.py
+--- distcc-3.2rc1.orig/include_server/basics_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/basics_test.py 2011-10-27 17:05:08.421023097 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/c_extensions_test.py distcc-3.2rc1/include_server/c_extensions_test.py
+--- distcc-3.2rc1.orig/include_server/c_extensions_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/c_extensions_test.py 2011-10-27 17:05:08.421023097 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/cache_basics.py distcc-3.2rc1/include_server/cache_basics.py
+--- distcc-3.2rc1.orig/include_server/cache_basics.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/cache_basics.py 2011-10-27 17:05:08.422023101 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/compiler_defaults.py distcc-3.2rc1/include_server/compiler_defaults.py
+--- distcc-3.2rc1.orig/include_server/compiler_defaults.py 2011-04-06 03:58:59.000000000 +0900
++++ distcc-3.2rc1/include_server/compiler_defaults.py 2011-10-27 17:05:08.422023101 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/compress_files.py distcc-3.2rc1/include_server/compress_files.py
+--- distcc-3.2rc1.orig/include_server/compress_files.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/compress_files.py 2011-10-27 17:05:08.422023101 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/include_analyzer.py distcc-3.2rc1/include_server/include_analyzer.py
+--- distcc-3.2rc1.orig/include_server/include_analyzer.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/include_analyzer.py 2011-10-27 17:05:08.422023101 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/include_analyzer_memoizing_node.py distcc-3.2rc1/include_server/include_analyzer_memoizing_node.py
+--- distcc-3.2rc1.orig/include_server/include_analyzer_memoizing_node.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/include_analyzer_memoizing_node.py 2011-10-27 17:05:08.422023101 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/include_analyzer_memoizing_node_test.py distcc-3.2rc1/include_server/include_analyzer_memoizing_node_test.py
+--- distcc-3.2rc1.orig/include_server/include_analyzer_memoizing_node_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/include_analyzer_memoizing_node_test.py 2011-10-27 17:05:08.423023105 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/include_analyzer_test.py distcc-3.2rc1/include_server/include_analyzer_test.py
+--- distcc-3.2rc1.orig/include_server/include_analyzer_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/include_analyzer_test.py 2011-10-27 17:05:08.423023105 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/include_server.py distcc-3.2rc1/include_server/include_server.py
+--- distcc-3.2rc1.orig/include_server/include_server.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/include_server.py 2011-10-27 17:05:08.423023105 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/include_server_test.py distcc-3.2rc1/include_server/include_server_test.py
+--- distcc-3.2rc1.orig/include_server/include_server_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/include_server_test.py 2011-10-27 17:05:08.423023105 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/macro_eval.py distcc-3.2rc1/include_server/macro_eval.py
+--- distcc-3.2rc1.orig/include_server/macro_eval.py 2011-04-06 03:58:59.000000000 +0900
++++ distcc-3.2rc1/include_server/macro_eval.py 2011-10-27 17:05:08.423023105 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/macro_eval_test.py distcc-3.2rc1/include_server/macro_eval_test.py
+--- distcc-3.2rc1.orig/include_server/macro_eval_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/macro_eval_test.py 2011-10-27 17:05:08.423023105 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/mirror_path.py distcc-3.2rc1/include_server/mirror_path.py
+--- distcc-3.2rc1.orig/include_server/mirror_path.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/mirror_path.py 2011-10-27 17:05:08.424023109 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/mirror_path_test.py distcc-3.2rc1/include_server/mirror_path_test.py
+--- distcc-3.2rc1.orig/include_server/mirror_path_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/mirror_path_test.py 2011-10-27 17:05:08.424023109 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/parse_command.py distcc-3.2rc1/include_server/parse_command.py
+--- distcc-3.2rc1.orig/include_server/parse_command.py 2011-04-06 03:58:59.000000000 +0900
++++ distcc-3.2rc1/include_server/parse_command.py 2011-10-27 17:05:08.424023109 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/parse_command_test.py distcc-3.2rc1/include_server/parse_command_test.py
+--- distcc-3.2rc1.orig/include_server/parse_command_test.py 2011-04-06 03:58:59.000000000 +0900
++++ distcc-3.2rc1/include_server/parse_command_test.py 2011-10-27 17:05:08.424023109 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/parse_file.py distcc-3.2rc1/include_server/parse_file.py
+--- distcc-3.2rc1.orig/include_server/parse_file.py 2011-04-06 03:58:59.000000000 +0900
++++ distcc-3.2rc1/include_server/parse_file.py 2011-10-27 17:05:08.424023109 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/parse_file_test.py distcc-3.2rc1/include_server/parse_file_test.py
+--- distcc-3.2rc1.orig/include_server/parse_file_test.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/parse_file_test.py 2011-10-27 17:05:08.424023109 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/run.py distcc-3.2rc1/include_server/run.py
+--- distcc-3.2rc1.orig/include_server/run.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/run.py 2011-10-27 17:05:08.424023109 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/setup.py distcc-3.2rc1/include_server/setup.py
+--- distcc-3.2rc1.orig/include_server/setup.py 2011-04-06 03:58:59.000000000 +0900
++++ distcc-3.2rc1/include_server/setup.py 2011-10-27 17:05:08.425023113 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/include_server/statistics.py distcc-3.2rc1/include_server/statistics.py
+--- distcc-3.2rc1.orig/include_server/statistics.py 2008-12-03 06:50:31.000000000 +0900
++++ distcc-3.2rc1/include_server/statistics.py 2011-10-27 17:05:08.425023113 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python2.4
++#! /usr/bin/python
+ #
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/test/onetest.py distcc-3.2rc1/test/onetest.py
+--- distcc-3.2rc1.orig/test/onetest.py 2008-12-03 06:50:22.000000000 +0900
++++ distcc-3.2rc1/test/onetest.py 2011-10-27 17:05:08.432023140 +0900
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python2.4
++#!/usr/bin/python
+ #
+ # Copyright 2007 Google Inc.
+ #
+diff -Naur distcc-3.2rc1.orig/test/testdistcc.py distcc-3.2rc1/test/testdistcc.py
+--- distcc-3.2rc1.orig/test/testdistcc.py 2011-10-21 11:40:49.000000000 +0900
++++ distcc-3.2rc1/test/testdistcc.py 2011-10-27 17:05:08.432023140 +0900
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python2.2
++#! /usr/bin/env python
+
+ # Copyright (C) 2002, 2003, 2004 by Martin Pool <mbp@samba.org>
+ # Copyright 2007 Google Inc.
diff --git a/sys-devel/distcc/files/distcc-3.2_rc1-socks5.patch b/sys-devel/distcc/files/distcc-3.2_rc1-socks5.patch
new file mode 100644
index 000000000000..256a16ffd5ba
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.2_rc1-socks5.patch
@@ -0,0 +1,191 @@
+From fdd93b1e9545b66d1b3a2a1ec24d4c8613ee43fb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 24 Jan 2015 23:59:21 +0100
+Subject: [PATCH] Support SOCKSv5 proxy
+
+Support using a SOCKSv5 proxy specified as DISTCC_SOCKS_PROXY.
+The variable can either a hostname, a host:port pair or an absolute path
+to a UNIX socket. When SOCKS is used, the hostname is passed to
+the proxy and therefore the name resolution is done remotely.
+---
+ src/clinet.c | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 135 insertions(+), 2 deletions(-)
+
+diff --git a/src/clinet.c b/src/clinet.c
+index 010a884..4773d8b 100644
+--- a/src/clinet.c
++++ b/src/clinet.c
+@@ -31,6 +31,7 @@
+
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <stddef.h>
+ #include <unistd.h>
+ #include <string.h>
+ #include <fcntl.h>
+@@ -42,8 +43,10 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
++#include <arpa/inet.h>
+ #include <netinet/in.h>
+ #include <netinet/tcp.h>
++#include <sys/un.h>
+
+ #include <netdb.h>
+
+@@ -161,7 +164,7 @@ out_failed:
+ /**
+ * Open a socket to a tcp remote host with the specified port.
+ **/
+-int dcc_connect_by_name(const char *host, int port, int *p_fd)
++static int dcc_connect_by_name_real(const char *host, int port, int *p_fd)
+ {
+ struct addrinfo hints;
+ struct addrinfo *res;
+@@ -201,7 +204,7 @@ int dcc_connect_by_name(const char *host, int port, int *p_fd)
+ *
+ * @todo Don't try for too long to connect.
+ **/
+-int dcc_connect_by_name(const char *host, int port, int *p_fd)
++static int dcc_connect_by_name_real(const char *host, int port, int *p_fd)
+ {
+ struct sockaddr_in sock_out;
+ struct hostent *hp;
+@@ -224,3 +227,133 @@ int dcc_connect_by_name(const char *host, int port, int *p_fd)
+ }
+
+ #endif /* not ENABLE_RFC2553 */
++
++static int dcc_connect_via_socks5(const char *host, int port, int *p_fd, const char *proxy)
++{
++ int ret;
++ char *proxy_host, *proxy_it;
++ int proxy_port;
++ char buf[262];
++ int host_length;
++ struct sockaddr_in addr_buf;
++ int skip_bytes;
++
++ host_length = strlen(host);
++ if (host_length > 255) {
++ rs_log_error("hostname \"%s\" too long for SOCKSv5 (over 255 chars)", host);
++ return EXIT_CONNECT_FAILED;
++ }
++
++ if (proxy[0] == '/') { /* UNIX socket */
++ struct sockaddr_un unix_addr;
++
++ if (strlen(proxy) >= sizeof(unix_addr.sun_path))
++ {
++ rs_log_error("UNIX socket path \"%s\" too long", proxy);
++ return EXIT_CONNECT_FAILED;
++ }
++
++ unix_addr.sun_family = AF_UNIX;
++ strcpy(unix_addr.sun_path, proxy);
++
++ ret = dcc_connect_by_addr((struct sockaddr *) &unix_addr,
++ offsetof(struct sockaddr_un, sun_path) + strlen(proxy) + 1,
++ p_fd);
++
++ } else { /* hostname? IP address? */
++ proxy_host = strdup(proxy);
++ if (proxy_host == NULL) return EXIT_OUT_OF_MEMORY;
++
++ proxy_it = strrchr(proxy_host, ':');
++ if (proxy_it) {
++ *(proxy_it++) = 0;
++ proxy_port = atoi(proxy_it);
++
++ if (proxy_port <= 0) {
++ rs_log_error("invalid proxy port \"%s\"", proxy_it);
++ free(proxy_host);
++ return EXIT_CONNECT_FAILED;
++ }
++ }
++ else
++ proxy_port = 1080;
++
++ ret = dcc_connect_by_name_real(proxy_host, proxy_port, p_fd);
++ free(proxy_host);
++ }
++
++ if (ret != 0)
++ return ret;
++
++ /* connected to proxy, now identifier/method selection */
++ buf[0] = 0x05; /* SOCKSv5 */
++ buf[1] = 0x01; /* one method */
++ buf[2] = 0x00; /* NO AUTHENTICATION REQUIRED */
++ ret = dcc_writex(*p_fd, buf, 3);
++ if (ret != 0)
++ return ret;
++
++ /* wait for method selection */
++ ret = dcc_readx(*p_fd, buf, 2);
++ if (ret != 0)
++ return ret;
++ if (buf[0] != 0x05 || buf[1] != 0x00) { /* version, method */
++ rs_log_error("invalid proxy reply (version 0x%02x, method 0x%02x)",
++ buf[0], buf[1]);
++ return EXIT_CONNECT_FAILED;
++ }
++
++ /* send connect request */
++ buf[0] = 0x05; /* SOCKSv5 */
++ buf[1] = 0x01; /* CONNECT command */
++ buf[2] = 0x00; /* reserved */
++ buf[3] = 0x03; /* DOMAINNAME address type */
++ buf[4] = host_length;
++ memcpy(&buf[5], host, host_length);
++ addr_buf.sin_port = htons(port);
++ memcpy(&buf[5 + host_length], &addr_buf.sin_port, 2);
++ ret = dcc_writex(*p_fd, buf, 7 + host_length);
++ if (ret != 0)
++ return ret;
++
++ /* wait for the connection */
++ /* read first 4 bytes of reply + 2 extra bytes we know will be there */
++ ret = dcc_readx(*p_fd, buf, 6);
++ if (ret != 0)
++ return ret;
++ if (buf[0] != 0x05 || buf[2] != 0x00) { /* version, reserved */
++ rs_log_error("invalid proxy reply (version 0x%02x, reserved 0x%02x)",
++ buf[0], buf[2]);
++ return EXIT_CONNECT_FAILED;
++ }
++ if (buf[1] != 0x00) { /* reply */
++ rs_log_error("proxy connection failed, reason=0x%02x", buf[1]);
++ return EXIT_CONNECT_FAILED;
++ }
++
++ /* now read the remaining (packet size - 6) bytes */
++ switch (buf[3]) { /* address type */
++ case 0x01: skip_bytes = 4; break; /* IPv4 */
++ case 0x03: skip_bytes = buf[4] + 1; break; /* hostname with length field */
++ case 0x04: skip_bytes = 16; break; /* IPv6 */
++ default:
++ rs_log_error("invalid proxy reply (address type 0x%02x)", buf[3]);
++ return EXIT_CONNECT_FAILED;
++ }
++ ret = dcc_readx(*p_fd, buf, skip_bytes);
++ if (ret != 0)
++ return ret;
++
++ return 0;
++}
++
++int dcc_connect_by_name(const char *host, int port, int *p_fd)
++{
++ const char *proxy;
++
++ proxy = getenv("DISTCC_SOCKS_PROXY");
++ if (proxy)
++ return dcc_connect_via_socks5(host, port, p_fd, proxy);
++ else
++ return dcc_connect_by_name_real(host, port, p_fd);
++}
+--
+2.3.0
+
diff --git a/sys-devel/distcc/files/distcc-config b/sys-devel/distcc/files/distcc-config
new file mode 100644
index 000000000000..094307c10507
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-config
@@ -0,0 +1,164 @@
+#!/usr/bin/env python
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import os, re, signal, sys, commands, pwd
+from string import rstrip
+
+options=[
+ '--get-hosts',
+ '--set-hosts',
+ '--get-verbose',
+ '--set-verbose',
+ '--get-log',
+ '--set-log',
+ '--install',
+ '--help',
+ '--get-env',
+ '--set-env'
+]
+
+tmpcmdline=sys.argv[1:]
+cmdline=[]
+envfile = '/etc/env.d/02distcc'
+
+def exithandler(foo,bar):
+ os.kill(0,signal.SIGKILL)
+ sys.exit(1)
+
+signal.signal(signal.SIGINT,exithandler)
+
+def isroot(ret=0):
+ if os.getuid() != 0:
+ if ret == 0:
+ print '!!!',sys.argv[:1][0],tmpcmdline[0],'must be run as root'
+ sys.exit(1)
+ else:
+ retval = 0
+ else:
+ retval = 1
+ return retval
+
+def writeenv(var,value):
+ isroot()
+ distcc_env = []
+ distcc_env = open(envfile, 'r').readlines()
+ distcc_env_new = open(envfile, 'w')
+ for i in range(len(distcc_env)):
+ if re.compile(var+'="(.*)"').match(distcc_env[i]):
+ distcc_env[i] = var+'="'+value+'"\n'
+ distcc_env_new.write(distcc_env[i])
+ #print 'Set',var,'to:',value
+ os.popen('/usr/sbin/env-update')
+ print 'If you want to use these new settings in an existing shell,'
+ print 'you need to "source /etc/profile" to get the changes.'
+
+def readenv(var):
+ distcc_env = open(envfile, 'r').read()
+ match = re.compile(var+'="(.*)"').search(distcc_env)
+ if match:
+ print var+'='+match.group(1)
+ else:
+ print var,'not set.'
+
+def permissions(path,user,group):
+ for file in os.listdir(path):
+ #print 'Configuring',path+file+'...'
+ os.chown(path+file,user,group)
+
+def installlinks(chost=''):
+ for file in ['gcc', 'cc', 'c++', 'g++']:
+ path = '/usr/lib/distcc/bin/'
+ if not chost == '':
+ file = chost+'-'+file
+ if os.path.exists('/usr/bin/'+file):
+ #print 'Creating',path+file,'symlink...'
+ if not os.path.exists(path+file):
+ os.symlink('/usr/bin/distcc',path+file)
+ #else:
+ # print 'Already exists. Skipping...'
+
+def createdistccdir(dir):
+ if not os.path.exists(dir):
+ os.mkdir(dir)
+ os.chmod(dir, 1777)
+
+for x in tmpcmdline:
+ if not x:
+ continue
+ if x[0:2]=="--":
+ if not x in options:
+ print "!!! Error:",x,"is an invalid option."
+ sys.exit(1)
+ else:
+ cmdline = x
+
+if '--get-hosts' in tmpcmdline:
+ HOSTS_ENV = os.environ.get('DISTCC_HOSTS')
+ HOSTS_HOME = os.environ.get('HOME')+'/hosts'
+ if HOSTS_ENV:
+ print HOSTS_ENV
+ elif os.path.isfile(HOSTS_HOME) and os.path.getsize(HOSTS_HOME) != 0:
+ print HOSTS_HOME
+ elif os.path.exists('/etc/distcc/hosts'):
+ print rstrip(open('/etc/distcc/hosts', 'r').read())
+ else:
+ print 'No configuration file found. Setup your hosts with --set-hosts.'
+elif '--set-hosts' in tmpcmdline:
+ if isroot(1):
+ PATH = '/etc/distcc'
+ else:
+ PATH = os.environ.get('HOME')
+ createdistccdir(PATH)
+ open(PATH+'/hosts', 'w').write(cmdline + '\n')
+elif '--get-verbose' in tmpcmdline:
+ readenv('DISTCC_VERBOSE')
+elif '--set-verbose' in tmpcmdline:
+ writeenv('DISTCC_VERBOSE',tmpcmdline[1])
+elif '--get-log' in tmpcmdline:
+ readenv('DISTCC_LOG')
+elif '--set-log' in tmpcmdline:
+ writeenv('DISTCC_LOG',tmpcmdline[1])
+elif '--install' in tmpcmdline:
+ isroot()
+ print 'Creating',envfile+'...'
+ distcc_env = open(envfile, 'w')
+ distcc_env.write('# This file is managed by distcc-config; use it to change these settings.\n')
+ distcc_env.write('DISTCC_LOG=""\n')
+ distcc_env.write('DCCC_PATH="/usr/lib/distcc/bin"\n')
+ distcc_env.write('DISTCC_VERBOSE="0"\n')
+
+ if os.WEXITSTATUS(commands.getstatusoutput('/usr/sbin/useradd -u 240 -g daemon -s /bin/false -d /dev/null -c "distccd" distcc')[0]) == 9:
+ os.WEXITSTATUS(commands.getstatusoutput('/usr/sbin/usermod -g daemon -s /bin/false -d /dev/null -c "distccd" distcc')[0])
+
+ foobar = pwd.getpwnam('distcc')
+ user = foobar[2]
+ group = foobar[3]
+
+ makeconf = open('/etc/make.conf', 'r').read()
+ chost = re.compile('CHOST="(.*)"').search(makeconf).group(1)
+ print 'Creating symlinks...'
+ installlinks()
+ installlinks(chost)
+
+ print 'Checking permissions...'
+ permissions('/usr/lib/distcc/bin/',user,group)
+ permissions('/var/run/distccd/',user,group)
+elif '--get-env' in tmpcmdline:
+ if len(tmpcmdline) == 1:
+ print rstrip(open(envfile, 'r').read())
+ elif len(tmpcmdline) == 2:
+ readenv(tmpcmdline[1])
+ else:
+ print '!!! Error: Specify only one variable.'
+elif '--set-env' in tmpcmdline:
+ if len(tmpcmdline) > 2 and len(tmpcmdline) <= 3:
+ isroot()
+ writeenv(tmpcmdline[1],tmpcmdline[2])
+ else:
+ print '!!! Error: Awaiting two parameters.'
+else:
+ print 'Usage: /usr/bin/distcc-config --set-hosts DISTCC_HOSTS | --get-hosts'
+ print ' /usr/bin/distcc-config --set-verbose { 0 | 1 } | --get-verbose'
+ print ' /usr/bin/distcc-config --set-log FILE | --get-log'
+ print ' /usr/bin/distcc-config --set-env VARIABLE VALUE | --get-env [VARIABLE]'
diff --git a/sys-devel/distcc/files/distcc-hardened.patch b/sys-devel/distcc/files/distcc-hardened.patch
new file mode 100644
index 000000000000..69b3a6516936
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-hardened.patch
@@ -0,0 +1,24 @@
+From: Gordon Malm <gengor@gentoo.org>
+
+Make distcc client pass -D__KERNEL__ macro. Hardened GCC uses this
+macro to determine if code intended to be run in-kernel is being compiled.
+If the code is kernel code, certain compile flags are not applied.
+
+When using distcc to build kernel code (modules, etc.) without this patch,
+the distccd host doesn't get passed -D__KERNEL__. Consequently, gcc on
+the distccd host applies all kinds of flags that it shouldn't.
+
+--- distcc-2.18.3/src/strip.c
++++ distcc-2.18.3-hardened/src/strip.c
+@@ -73,7 +73,10 @@ int dcc_strip_local_args(char **from, ch
+ /* skip through argv, copying all arguments but skipping ones that
+ * ought to be omitted */
+ for (from_i = to_i = 0; from[from_i]; from_i++) {
+- if (str_equal("-D", from[from_i])
++ if (str_equal("-D__KERNEL__", from[from_i])) {
++ to[to_i++] = from[from_i];
++ }
++ else if (str_equal("-D", from[from_i])
+ || str_equal("-I", from[from_i])
+ || str_equal("-U", from[from_i])
+ || str_equal("-L", from[from_i])
diff --git a/sys-devel/distcc/files/distccd.service b/sys-devel/distcc/files/distccd.service
new file mode 100644
index 000000000000..3eb61396b84c
--- /dev/null
+++ b/sys-devel/distcc/files/distccd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Distccd: A Distributed Compilation Server
+After=network.target
+
+[Service]
+User=distcc
+ExecStart=/usr/bin/distccd --verbose --no-detach --daemon --port 3632 -N 15 --allow $ALLOWED_SERVERS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sys-devel/distcc/files/distccd.service.conf b/sys-devel/distcc/files/distccd.service.conf
new file mode 100644
index 000000000000..a334c3724b96
--- /dev/null
+++ b/sys-devel/distcc/files/distccd.service.conf
@@ -0,0 +1,6 @@
+# --allow is now mandatory as of distcc-2.18.
+# example: --allow 192.168.0.0/24
+# example: --allow 192.168.0.5 --allow 192.168.0.150
+
+[Service]
+Environment="ALLOWED_SERVERS=127.0.0.1"
diff --git a/sys-devel/distcc/metadata.xml b/sys-devel/distcc/metadata.xml
new file mode 100644
index 000000000000..9cccb613be75
--- /dev/null
+++ b/sys-devel/distcc/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>cluster@gentoo.org</email>
+ <name>Gentoo Cluster Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Distcc is a program to distribute compilation of C code across several
+ machines on a network.
+ </longdescription>
+ <use>
+ <flag name="crossdev">Enable support for <pkg>sys-devel/crossdev</pkg></flag>
+ <flag name="gssapi">Enable support for <pkg>net-libs/libgssglue</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/dwz/Manifest b/sys-devel/dwz/Manifest
new file mode 100644
index 000000000000..e09abc1bea27
--- /dev/null
+++ b/sys-devel/dwz/Manifest
@@ -0,0 +1,5 @@
+DIST dwz-0.9.tar.xz 90604 SHA256 b909699372a3a02227184ffd4a22118cb50b975f55df7368d8851de9bb6a4e98 SHA512 ce139fd37cfd8cd6e1b6d162fb4896527122f4cb25685eed73eb3dc9fe7aea5ab85d59fe4e299940f0bc5a7cc7c9fa54236581bd9dc4ffab3cc4d62f0f164cdc WHIRLPOOL 3d9840e725cffa9ec2aabb87c9601c867f3be15bbadb7cbb68a30dcd87792429d402ea01376fb0ee82e4f5c4133dde2a3e5488eb33a7bb583eba193655b0a015
+EBUILD dwz-0.9.ebuild 461 SHA256 eb08abe056fca105f0cfeadfe37e756bb04d16c6013c782748cbbe881828c2bf SHA512 68e7491b9605b9960400a3a5c1a6ac129451f6e8ebf9f9c6309f4d22d886f6458fff4143d6ecb41bc95750a2af57f5508a1d9c51ea812a3e25b7600711ea5139 WHIRLPOOL 4282545ae579355bddf9c748373fc0bcbb4cf5c7f8265e752cadd773e8eeb723d0849c94a74aa5f8086d04fd68a005b841871c3c1bc3dda2d4d60e14404042e5
+MISC ChangeLog 2267 SHA256 acf1006ebf9b573b9cef6467da238cb506c02803d37cced5edd62aa9cc16f2cc SHA512 d9203a3a2a06a4c9ce9480aa181c907650f90ebad9c80491f8d8b9699f7ff3b9381a17a0012b80950210f44743408ae478a519f5542a2ca0e4bc699917a3f6cf WHIRLPOOL 7351c7168b0566018ffb824542e002b054b02779ad4a429ba27d0fb45148fdc2dceea989099ac6068b646c03616f0e1720fe6fcf17e50c31c5a685ae758cdb10
+MISC ChangeLog-2015 352 SHA256 07e99a79fd5e14c65c2f703d4fb37e37dbc52b1895f5ca17030de1e7a335cb64 SHA512 5952ec7355f2602c574dbbb32e78df919f5d96df3ca24190e225ed40909a1eb6d75e98d41d3352efa53cf5dea7349bbba576c86830e83e1083d1bea4314ca9e1 WHIRLPOOL 2aed2259c4cb300a726239524aad69b59b9047c5f0784fdd3fc1bbb404b15e86fb0105f95911a397eb4f769674c3303b9e61946d33ba17db4f2be368ee22f532
+MISC metadata.xml 800 SHA256 2958222a5a58b379284a8a9f7c2fad6e5d2372d8a1bf2951d54fdbdeeedb2045 SHA512 8fe1486098bc86fee6d9e1944d3b7dffee7caa261513fad8cda33d961ba3b16a261a70cadd452a4b0ad89248fc769c9f3a233245ccf3ed5516622b93719b42c3 WHIRLPOOL df819ff2b52d1b320df2b3610346507ecd2cb09cb9424f980c95bd1d7a63d1fed4aaa4bd2b94c38638c988acb4351e6a4dd5eee258945338883dededb515f382
diff --git a/sys-devel/dwz/dwz-0.9.ebuild b/sys-devel/dwz/dwz-0.9.ebuild
new file mode 100644
index 000000000000..db4171617b70
--- /dev/null
+++ b/sys-devel/dwz/dwz-0.9.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+DESCRIPTION="DWARF optimization and duplicate removal tool"
+HOMEPAGE="https://sourceware.org/git/?p=dwz.git;a=summary"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="GPL-2+ GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="dev-libs/elfutils"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i \
+ -e '/^CFLAGS/d' \
+ Makefile || die "sed failed"
+}
diff --git a/sys-devel/dwz/metadata.xml b/sys-devel/dwz/metadata.xml
new file mode 100644
index 000000000000..bbb695dd46cc
--- /dev/null
+++ b/sys-devel/dwz/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+ <longdescription>
+ The dwz package contains a program that attempts to optimize DWARF
+ debugging information contained in ELF shared libraries and ELF executables
+ for size, by replacing DWARF information representation with equivalent
+ smaller representation where possible and by reducing the amount of
+ duplication using techniques from DWARF standard appendix E - creating
+ DW_TAG_partial_unit compilation units (CUs) for duplicated information
+ and using DW_TAG_imported_unit to import it into each CU that needs it.
+ </longdescription>
+</pkgmetadata>
diff --git a/sys-devel/flex/Manifest b/sys-devel/flex/Manifest
new file mode 100644
index 000000000000..a898b1973c94
--- /dev/null
+++ b/sys-devel/flex/Manifest
@@ -0,0 +1,11 @@
+AUX flex-2.6.3-reentrant.patch 2816 SHA256 461f0843bc4a1fe2ccea751453d89716502c31a374b5645703ec3a333427c5ac SHA512 105017a1020b339f08ce0c45c9c41ba6b5e42bb9dba22b258947f8d18ed697804c59e5cfa5e995b54652a54e6a500ccb2036b38001bab433d7af6f01c71feda4 WHIRLPOOL 259d44d39dd3e01613654d694b1356661074532a58955356ba4c707ed2f16fe786d9c065b54517bca7f5504e45e507732050e0d1345d4b5ebe69241d5ee346d2
+DIST flex-2.6.1.tar.xz 835048 SHA256 2c7a412c1640e094cb058d9b2fe39d450186e09574bebb7aa28f783e3799103f SHA512 1e35d0447f59139b98ede085d1a603d4f61cf8bc11cf2e291a3f492a05c60ee61535481b878585cd6843cd9b3c7952c834adfa78a6a71c64802e7b3069dec9d1 WHIRLPOOL d671017fd516f5d6457a896f1d50d4a4d310d32476a6db8f1ed99305a96955eec7586d8ef2aff1e03795be3f7417e0f1d8925b073788a14abcdd38868822eb67
+DIST flex-2.6.3.tar.gz 1405560 SHA256 68b2742233e747c462f781462a2a1e299dc6207401dac8f0bbb316f48565c2aa SHA512 f14b1af7ddd148660737991787fcf13d86cc0bef3859ed6c2135963373e76524d70382795c845cb6491b0435f8c40ba81e17f15267592b8d1656cfd4c3430b00 WHIRLPOOL 266266c4c15135fe52ec3b5226645b89c7053ec4dac257c9349d760601eaf50f7ec504d3c4b74951fd415d17299c2ca2e483e8c8c7f8ee936b4822d92603a4e2
+DIST flex-2.6.4.tar.gz 1419096 SHA256 e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995 SHA512 e9785f3d620a204b7d20222888917dc065c2036cae28667065bf7862dfa1b25235095a12fd04efdbd09bfd17d3452e6b9ef953a8c1137862ff671c97132a082e WHIRLPOOL b19880ae3d760e04138ca93c848da07baa004bd193616855f1e650a170648288727d6a2bb5e657f05b204505d4b5b70e76a795037c81c6a19e1767cebadf8204
+EBUILD flex-2.6.1.ebuild 1913 SHA256 ee0c9e6314da38de312f2884ac7fff9bfda1bf0de90cda2ec9cc55bb0969edeb SHA512 c0c4baca0a0e4373599be51d6490b46b25ef39d3fbf251a2bd531f438800e1f9dfaec839e9f8c72a66c1928896cfdb69fe52049ab1e1843d9c151ff21be0542e WHIRLPOOL 0b3c6734c549fd5d61ad44dce75d361e168564b793667282de63ca6fafdd7b7146ba4266f8bd65119844421e5563afc838bdc5e4b60dd2b814b12228afd138e5
+EBUILD flex-2.6.3-r1.ebuild 2061 SHA256 a71c37379d143e3abcb1f05fce3ffccce5877d8e17ad42bfc95a114f09058971 SHA512 d798c09ce136155b5e67b144d6eb3ac0e394caf0445678fa1e3e887f2c766fa6975fe2288b843a3f7ef6631193986621dcc2f4d46142ca73e693384d2f8b61e5 WHIRLPOOL a23f58c72c4d6ce243842485236db003198b89356a5e3b3a641ecf0dfe9841d813661b312dfbc597c90e9984e2d0df327b12726e50212f7516debdfe0740afda
+EBUILD flex-2.6.3.ebuild 1987 SHA256 ab00926b33bfb3998722f58731189312c0db1c6279f77573851347b02e6f1816 SHA512 54737594a12c82faf520ac12a3fe9d17b8b2658d9d6736ad25db58686250e2e97ef27c5341df96fa28ca78376f607d139ca6bea85f00ec5e8d52360b94df336f WHIRLPOOL a944131ecfc0e1e71ecf5bccca80e4b5e4bc5534a31367aa55ef2fd9830908d0777c6d00ced7057667689ebd26c98227accdc8c39400c478a492c653731afb9d
+EBUILD flex-2.6.4.ebuild 2026 SHA256 62707a253c137ef5f571a80e297e7607a7055b2ce2aa3efce719a2e2fc927b2e SHA512 4070f280ecf38f09cfd9210b41b5e42d12e2f4da06cf5db775c6738624016a3f58b9b2367b47f6b8a5b1d1b78730922b2c56582d5e93988dfd1edcb6b2e088cc WHIRLPOOL 9d0454152ecc9ef55073d38baf10537278b59f65d146877d14a05b9d744a6571143d7a464d0b16c27227d5cfbe33e047f2074bf268dc5e9dbe122ee8b3645ccf
+MISC ChangeLog 5656 SHA256 1d23877b1b816e90923b7e932f8e4d673e95d2ad3aa5db8814518f29623c6388 SHA512 4e09457657a237398e8b3833c7c934879686527059267cb59b17597ff84bc1a1a565b84f03c86583bbaa246d183a22570ea6627305e167c955cc1ad4db0f9106 WHIRLPOOL 98e7b57d707a18fd7fe5be6464fbedac1953d3beac9c6c251df9b4627da55b82c3c9f844a335645eab33534ed5710ded404abf035f5cf974e5f306181175e8b0
+MISC ChangeLog-2015 14123 SHA256 559935be9fec248b903e470b5e311f39e4e44790aad69495b78410e469604fc1 SHA512 673d316fb9a79bb40b7e241a2653009fecccabcefb7c159b078a31c4b8eac8755c8e404bdeeb3f4d871e6cef63faf7ece9e2b8625331a06f4c618349cf1102bd WHIRLPOOL f12d6b587e8cd44f7b17741da51db8213128f9a9a562d19aab872dba2b20e54e2ebcf35b74b0e195e1faf884c1abca0bc584bce66fceb14049d53606f691bce7
+MISC metadata.xml 382 SHA256 a2def7bad2faece13627db3d490854191891de695c4ecbf97f08d695c311f4e2 SHA512 074161b6d11f46cb704846d60cbc0fe44672a5feacd39107968516d292d12cfbf5975290f23d45abf9a74fdd4bbcf5aad77d48c924d3f57a71b3887b23ec2047 WHIRLPOOL c6cac3fc350669c466eb737610667f588441345345716476e3b89a586f5400fa49cf623b0fecb83c3f355ea14c57ae4a1353aa0539b3862e6983e29ab6e66501
diff --git a/sys-devel/flex/files/flex-2.6.3-reentrant.patch b/sys-devel/flex/files/flex-2.6.3-reentrant.patch
new file mode 100644
index 000000000000..f2f5eb8374ba
--- /dev/null
+++ b/sys-devel/flex/files/flex-2.6.3-reentrant.patch
@@ -0,0 +1,82 @@
+From 078b46c69d063aef1715b11348a2871d6036f253 Mon Sep 17 00:00:00 2001
+From: Christos Zoulas <christos@zoulas.com>
+Date: Sun, 22 Jan 2017 18:34:30 +0100
+Subject: [PATCH] Add more defines in the non-reentrant part.
+
+Fix the reentrant part; don't "#define yyfoo yyfoo" because it breaks
+code that does #ifndef yywrap ..
+---
+ src/flex.skl | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/src/flex.skl b/src/flex.skl
+index 190700f..6a7cde4 100644
+--- a/src/flex.skl
++++ b/src/flex.skl
+@@ -61,11 +61,17 @@ m4_changequote([[, ]])
+ m4_ifelse(M4_YY_PREFIX,yy,,
+ #define yy_create_buffer M4_YY_PREFIX[[_create_buffer]]
+ #define yy_delete_buffer M4_YY_PREFIX[[_delete_buffer]]
+-#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]
++#define yy_scan_buffer M4_YY_PREFIX[[_scan_buffer]]
++#define yy_scan_string M4_YY_PREFIX[[_scan_string]]
++#define yy_scan_bytes M4_YY_PREFIX[[_scan_bytes]]
+ #define yy_init_buffer M4_YY_PREFIX[[_init_buffer]]
+ #define yy_flush_buffer M4_YY_PREFIX[[_flush_buffer]]
+ #define yy_load_buffer_state M4_YY_PREFIX[[_load_buffer_state]]
+ #define yy_switch_to_buffer M4_YY_PREFIX[[_switch_to_buffer]]
++#define yypush_buffer_state M4_YY_PREFIX[[push_buffer_state]]
++#define yypop_buffer_state M4_YY_PREFIX[[pop_buffer_state]]
++#define yyensure_buffer_stack M4_YY_PREFIX[[ensure_buffer_stack]]
++#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]
+ #define yyin M4_YY_PREFIX[[in]]
+ #define yyleng M4_YY_PREFIX[[leng]]
+ #define yylex M4_YY_PREFIX[[lex]]
+@@ -107,7 +113,7 @@ m4_ifdef( [[M4_YY_PREFIX]],, [[m4_define([[M4_YY_PREFIX]], [[yy]])]])
+
+ m4preproc_define(`M4_GEN_PREFIX',
+ ``[[#define yy$1 ]]M4_YY_PREFIX[[$1]]
+-m4_define([[yy$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
++%# m4_define([[yy$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
+
+ %if-c++-only
+ /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
+@@ -120,6 +126,7 @@ m4_define([[yy$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
+ %endif
+
+ %if-c-only
++m4_ifelse(M4_YY_PREFIX,yy,,
+ M4_GEN_PREFIX(`_create_buffer')
+ M4_GEN_PREFIX(`_delete_buffer')
+ M4_GEN_PREFIX(`_scan_buffer')
+@@ -155,6 +162,7 @@ m4_define([[yy$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
+ M4_GEN_PREFIX(`set_column')
+ ]])
+ M4_GEN_PREFIX(`wrap')
++)
+ %endif
+
+ m4_ifdef( [[M4_YY_BISON_LVAL]],
+@@ -170,11 +178,14 @@ m4_ifdef( [[<M4_YY_BISON_LLOC>]],
+ ]])
+
+
++m4_ifelse(M4_YY_PREFIX,yy,,
+ M4_GEN_PREFIX(`alloc')
+ M4_GEN_PREFIX(`realloc')
+ M4_GEN_PREFIX(`free')
++)
+
+ %if-c-only
++m4_ifelse(M4_YY_PREFIX,yy,,
+ m4_ifdef( [[M4_YY_NOT_REENTRANT]],
+ [[
+ M4_GEN_PREFIX(`text')
+@@ -184,6 +195,7 @@ m4_ifdef( [[M4_YY_NOT_REENTRANT]],
+ M4_GEN_PREFIX(`_flex_debug')
+ M4_GEN_PREFIX(`lineno')
+ ]])
++)
+ %endif
+
+
diff --git a/sys-devel/flex/flex-2.6.1.ebuild b/sys-devel/flex/flex-2.6.1.ebuild
new file mode 100644
index 000000000000..ad53e2d86e8c
--- /dev/null
+++ b/sys-devel/flex/flex-2.6.1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic multilib-minimal
+
+DESCRIPTION="The Fast Lexical Analyzer"
+HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
+SRC_URI="https://github.com/westes/flex/releases/download/v${PV}/${P}.tar.xz"
+
+LICENSE="FLEX"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls static test"
+
+# We want bison explicitly and not yacc in general #381273
+RDEPEND="sys-devel/m4"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bison )"
+
+src_prepare() {
+ # Disable running in the tests/ subdir as it has a bunch of built sources
+ # that cannot be made conditional (automake limitation). #568842
+ if ! use test ; then
+ sed -i \
+ -e '/^SUBDIRS =/,/^$/{/tests/d}' \
+ Makefile.in || die
+ fi
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # Do not install shared libs #503522
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-shared \
+ $(use_enable nls) \
+ --docdir='$(datarootdir)/doc/'${PF}
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ cd src || die
+ emake -f Makefile -f - lib <<< 'lib: $(lib_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ cd src || die
+ emake DESTDIR="${D}" install-libLTLIBRARIES install-includeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc ONEWS
+ prune_libtool_files --all
+ rm "${ED}"/usr/share/doc/${PF}/COPYING || die
+ dosym flex /usr/bin/lex
+}
diff --git a/sys-devel/flex/flex-2.6.3-r1.ebuild b/sys-devel/flex/flex-2.6.3-r1.ebuild
new file mode 100644
index 000000000000..2cd53fc6b2fe
--- /dev/null
+++ b/sys-devel/flex/flex-2.6.3-r1.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic libtool multilib-minimal
+
+DESCRIPTION="The Fast Lexical Analyzer"
+HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
+SRC_URI="https://github.com/westes/${PN}/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="FLEX"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls static test"
+
+# We want bison explicitly and not yacc in general #381273
+RDEPEND="sys-devel/m4"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bison )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-reentrant.patch"
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+
+ # Disable running in the tests/ subdir as it has a bunch of built sources
+ # that cannot be made conditional (automake limitation). #568842
+ if ! use test ; then
+ sed -i \
+ -e '/^SUBDIRS =/,/^$/{/tests/d}' \
+ Makefile.in || die
+ fi
+ elibtoolize # Prefix always needs this
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # Do not install shared libs #503522
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-shared \
+ $(use_enable nls) \
+ --docdir='$(datarootdir)/doc/'${PF}
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ cd src || die
+ emake -f Makefile -f - lib <<< 'lib: $(lib_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ cd src || die
+ emake DESTDIR="${D}" install-libLTLIBRARIES install-includeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc ONEWS
+ prune_libtool_files --all
+ rm "${ED}"/usr/share/doc/${PF}/COPYING || die
+ dosym flex /usr/bin/lex
+}
diff --git a/sys-devel/flex/flex-2.6.3.ebuild b/sys-devel/flex/flex-2.6.3.ebuild
new file mode 100644
index 000000000000..c5b8bc754212
--- /dev/null
+++ b/sys-devel/flex/flex-2.6.3.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic libtool multilib-minimal
+
+DESCRIPTION="The Fast Lexical Analyzer"
+HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
+SRC_URI="https://github.com/westes/${PN}/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="FLEX"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls static test"
+
+# We want bison explicitly and not yacc in general #381273
+RDEPEND="sys-devel/m4"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bison )"
+
+src_prepare() {
+ # Disable running in the tests/ subdir as it has a bunch of built sources
+ # that cannot be made conditional (automake limitation). #568842
+ if ! use test ; then
+ sed -i \
+ -e '/^SUBDIRS =/,/^$/{/tests/d}' \
+ Makefile.in || die
+ fi
+ elibtoolize # Prefix always needs this
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # Do not install shared libs #503522
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-shared \
+ $(use_enable nls) \
+ --docdir='$(datarootdir)/doc/'${PF}
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ cd src || die
+ emake -f Makefile -f - lib <<< 'lib: $(lib_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ cd src || die
+ emake DESTDIR="${D}" install-libLTLIBRARIES install-includeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc ONEWS
+ prune_libtool_files --all
+ rm "${ED}"/usr/share/doc/${PF}/COPYING || die
+ dosym flex /usr/bin/lex
+}
diff --git a/sys-devel/flex/flex-2.6.4.ebuild b/sys-devel/flex/flex-2.6.4.ebuild
new file mode 100644
index 000000000000..c2d32936d7ca
--- /dev/null
+++ b/sys-devel/flex/flex-2.6.4.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic libtool multilib-minimal
+
+DESCRIPTION="The Fast Lexical Analyzer"
+HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
+SRC_URI="https://github.com/westes/${PN}/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="FLEX"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls static test"
+
+# We want bison explicitly and not yacc in general #381273
+RDEPEND="sys-devel/m4"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ nls? ( sys-devel/gettext )
+ test? ( sys-devel/bison )"
+
+src_prepare() {
+ #epatch "${PATCHES[@]}"
+ epatch_user
+
+ # Disable running in the tests/ subdir as it has a bunch of built sources
+ # that cannot be made conditional (automake limitation). #568842
+ if ! use test ; then
+ sed -i \
+ -e '/^SUBDIRS =/,/^$/{/tests/d}' \
+ Makefile.in || die
+ fi
+ elibtoolize # Prefix always needs this
+}
+
+src_configure() {
+ use static && append-ldflags -static
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # Do not install shared libs #503522
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-shared \
+ $(use_enable nls) \
+ --docdir='$(datarootdir)/doc/'${PF}
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi; then
+ default
+ else
+ cd src || die
+ emake -f Makefile -f - lib <<< 'lib: $(lib_LTLIBRARIES)'
+ fi
+}
+
+multilib_src_test() {
+ multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ default
+ else
+ cd src || die
+ emake DESTDIR="${D}" install-libLTLIBRARIES install-includeHEADERS
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ dodoc ONEWS
+ prune_libtool_files --all
+ rm "${ED}"/usr/share/doc/${PF}/COPYING || die
+ dosym flex /usr/bin/lex
+}
diff --git a/sys-devel/flex/metadata.xml b/sys-devel/flex/metadata.xml
new file mode 100644
index 000000000000..6f7c81d076d5
--- /dev/null
+++ b/sys-devel/flex/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">flex</remote-id>
+ <remote-id type="github">westes/flex</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/gcc-apple/Manifest b/sys-devel/gcc-apple/Manifest
new file mode 100644
index 000000000000..e1d2a427a124
--- /dev/null
+++ b/sys-devel/gcc-apple/Manifest
@@ -0,0 +1,19 @@
+AUX gcc-apple-4.0.1_p5465-default-altivec.patch 1381 SHA256 699dfea402a5a2d80f8374254a36fc7552f32b5fc25c1d15d9b88b7742874f09 SHA512 8eb71bb7d478af415d4222774172423744ec8ded1c1fe03da03779a4e8d19ce7783bf246b7249f30249a4d9f2eb34f667fa43a2e40edba23f22fe535c2dc6100 WHIRLPOOL 071667d5b0b49ce0a455e7fb7f0960e50e9ccb6d8f73464fee89a06836439e65fa42730d0e959511c6ad26865f4a3c6352801c7ff3bce51c3bfdf019fcf70ebc
+AUX gcc-apple-4.2.1-arch-option.patch 2151 SHA256 f7f7da2d46ec6dc8ab8cf8754994abf93db7a925f20f92433e2e3f0f49b15e85 SHA512 daa34b0db6b5ce46766628819b7234fd1310060d359bf088d5ab06f2aeef9f4fc33f403b428e105c7cecc6d4d3b823134ddc090cc0c44bd6650d3b6a65c58635 WHIRLPOOL 555e66197abe1b95c60281c6158eb1039883819b510c205de17aedc1b4a4f5b9bb6404e342a5df75520d09b3ca5d009a70abcb2970d8ca0d29fb323dbff7f84e
+AUX gcc-apple-4.2.1-autoconf-m4-precious.patch 340 SHA256 22d04767775394bf88f7108e29338fe3d1d8f5f3c7ce115d211730c9c52562cc SHA512 7a7f40e1aa87c92d412d9b803cfbe43ecc51568a39bfab29eb3307489661a68c40d690af53a8902ce55e96f364860287a19934e3fe3d075c5d62e086d72836db WHIRLPOOL c666cc4ee0e63f0421a404ff21e7beb52dc89442ba09a3366e46a0027b2156b61e1258abff3c9d5d452b2439481226b78871c7d65b4e1e3d1bec261352d83401
+AUX gcc-apple-4.2.1-dsymutil.patch 853 SHA256 bba3d9d406afe12f1fd55f7b91ab65c07d4a1b37401d711a0ea287104aa07040 SHA512 382a49d92f03772e71bbb5b31257187b3fd964583f4a1ab2a19a459f679d9dd48549813cb3ef03e6cbaf728c9e62162364d1dafb75257d85b687b7e356d580d0 WHIRLPOOL 0f2964ebd56dfdb5ad84bc465fb64cc0140c9ecbfc3eefa584ff06b2d1c8bfce8f09d2ab449628730813daf265d0e9dd1ea673d28b62670f9f3f1ad123e90fb4
+AUX gcc-apple-4.2.1-prefix-search-dirs-r1.patch 1587 SHA256 87cc753a3e125a04e2a3019c39b113a269c6801d1d14affd02f0cb0d2adc9901 SHA512 04ebd1b02ce022c4277988fabb7c198286bc9604ade70cf5d64a0296781a377b6c26ad8206da63d37ca1211537b4b8d31d7b06ae1fa3405f77f19ce01636156f WHIRLPOOL 37dee072631014a6ab90c14c1bbab3bf20a662fccf771e135c943a600796e3362c776ab09a745f872666f384f4fe57fbf5cdd203b3a935607eff4ad5c1de3d67
+AUX gcc-apple-4.2.1-prefix-search-dirs.patch 1053 SHA256 8f71661b144df92cd9a924b54cbd11a28de0b7ddc258a489bd1e1913e7d4a208 SHA512 0efdedb7a69b21732f254567f0593319f06ed25c12641d6df0219c5b1c90768494286affd98c02a726c82ffe0e27aa4548c9701981dc6a2eb8a0c3455b78a364 WHIRLPOOL 0df7f9cb80d692f93e88f073562d51658d251956ea53b1eb1a5d364fe961c22521436ea0429f711c9424ef6da47b945fafc64ffa42aa70d89c244c8442a75344
+AUX gcc-apple-4.2.1-texinfo.patch 1110 SHA256 1efd6ac46557feb01b7c28b214209ed3eab4714d91b6cbdf8701801ff53d545d SHA512 1b27fa076dffc80d4ea9cc2e209f4ef2cd31ba4f585b977c20a15432cb7a86f3bc76aa734cb328e5702309585e1c440ed33fd605b863e41c91d96268d1b6bf36 WHIRLPOOL 7b4a80716e02d212893291b69465aeab83dde2ff326497929fce040736f6fd8cd8efe3ce1272e039fc36b9a3780665653b7477ea8ab76595d349d84af26a19f6
+AUX gcc-apple-4.2.1_p5666-darwin14.patch 4870 SHA256 3e97bf7788f0a16fb93baa34ab5053f89cc503486123ba23ee809956d4fbaf9a SHA512 4569f6ae976760074629f5526a45793e10ca56508f13642c4da173c387f4ccf1ffc62b595e3fbc8694fd0d673f5a19eb5a9002b211ed149ad4492044d26bbba7 WHIRLPOOL 387000a9adb9875e728069d93bd90862e16fab847d1d71ee0ca72ff61b4155ef170221b2d17ccf354c1d2a808b297c7783f041bf0f09cc534be3da388266cc8e
+AUX gcc-apple-4.2.1_p5666-perl-5.18.patch 286 SHA256 7364a7a2c8fc79d5698bc96572e15269e04a619d6cc30d7a640d14c2ec0711c6 SHA512 bdbb2e1d6146ff461c762d3efff59f272762121b033eb24bb1a016ab946268ec77dc22d01997870c406ac09d55e668eead61865a696a490482e69befb84cfdba WHIRLPOOL a531698dfc39cc1073d85a0063b2ce729461135979dd06a78dc2efc73c02989a4c123cbe3623609dad7f8c08ba2a25f43e0586083ce99ae85904b4f1f2913903
+AUX libstdc++-16.patch 253 SHA256 f037576ba363256c61979eb68a2c1dff24445e8c5f403a729bead2c7db1f0314 SHA512 aefc96161aba55ee77620e440cab3674f069331a6947e26acf56562e286e64f0888b247b9e67b02f68b16f4522e7e6ab4b145190508ed9222ad2dc98cc625716 WHIRLPOOL 87eb1017709dacc552861aa1a85fa81c53ef4a89017dbab18cdc62ddcd0f9aca13ac3aac51268644cf8a812bc23023f4ee2ed09e1684c6f61865400d8a7d5e21
+DIST gcc-5666.3.tar.gz 19367320 SHA256 6c46f4376d11ada5be0cfc3894b9296edf574af3c616ab71803ea78edfd7015b SHA512 31cf52a00f31bcd7c47382888152cfe9851688c8fb7b1f236197b06b8acdd96b1943d327f8fab0fd305531c99a8fbf4865b2214dc2d1a236bb8ad39f710ce931 WHIRLPOOL 03711b56d38b2cb3b5af735802a82ef435cf42c3aa4fa74fa754b016edea447d011e626115fe59449def14ac34422788340165faab567b6fb992d1fe1684f93d
+DIST gcc-apple-4.2.1_p5646-gfortran.patch 38284 SHA256 c909a792b4e3ea76cbba6d8aefd712ef98506bd4e3dd275a144e5ed272c2ae22 SHA512 94b1c7d343b780e52bbbbc213987feda7d8f7e083d7c338ab244e89e69ba5c2fc74a9695c5f38f273e4e50683ef67b4de85abd4aa0c5c2fe3a28f7bf275dbf3a WHIRLPOOL 12da437da136b1d581b075b86d7a1ae8687e56fd811e0fc4b650faf2831746466358d63d34309bee9ab4254dff4f861685ecb0f5a20697ad7e77afc7cd0d7ef4
+DIST gcc-fortran-4.2.4.tar.bz2 905688 SHA256 6fc2056cd62921b2859381749710af765a46877bd46f9fe5ef6fab0671c47e04 SHA512 1a36587a3691b8d7ecd23938efcdfca42642b6b260a1c830f6d791bb1b8ac32953998c45d77eee2d557861d631431569503c796b61aeaea9ac5fffbce1982faa WHIRLPOOL 5db1f448b3c08985ee2d0b1a9101e72733f4859184892da67268650c1010c26487b5ff15670151e67fdde5e4bd9053ed2e98b1582d1f4f99375b1bcdaf94351a
+DIST libstdcxx-16.tar.gz 64695692 SHA256 a7d8041e50e110f5a503e188a05cb217f0c99c51f248a0a1387cc07a0b6f167f SHA512 2f0e8d694aaaf94fc2a0463ebd4a5775865421dedb431a6f6f701a8d33078e768bef232f72e2cf1f8e2d278eb60ff54030f5ad22b43eb0643d49bc4717e96b05 WHIRLPOOL fb90a1df90e60717906d227fb1dc2b8639fd063dbf6eec39d3a840dc8025c5384bd2c8b0a86158f8c072a1008ac2561e8e9f512ef4a4f84c081903154bb9d378
+DIST libstdcxx-39.tar.gz 117081330 SHA256 aad6c0b7aa80b8117af1868d502f7aa4d042e5f33cada853a8ba75980391c6bb SHA512 c640292c0f371069fbb635ed0385627c8abab869db93513922e19b25886864d093eef3684c49bf1ba82325f2d1d3cd1eb382ef6ea9dee039208fe99fe8653db6 WHIRLPOOL ae0eba85e393ea8f14369557712e26c6662e147dec6d8ec0da0919a8290a834c7a1c0150bcc48972f111a14fcfe1501362b2b0dc9dc57aeb8456a35b74d8457e
+EBUILD gcc-apple-4.2.1_p5666-r2.ebuild 13193 SHA256 0ed5d81df030a5f87103bcaff68e98eed4450fea82a9b8de6ec01dc6bbe629e5 SHA512 4d85007f599e285ef6f91d40e422a9d380c0eb3e8eb6be522d2b635b7e6da98fe9ea62ad63e73b61aa04fd6546cc497246a1dc75ee1fc669f2cbea1734e12f12 WHIRLPOOL ce7a95794cabe9a1bc328b96b55a20ef96e647a6341d688766ac3847cdc8c6ea3ad728b83681d7360c6b19db281da660c8853c47cea5788ca7cf091e077e3e22
+MISC ChangeLog 5227 SHA256 334d2017f0c9411c02ef99c628e05740a43cdc82cf71bb2e8a276e1d52495003 SHA512 874038b55c0c5703890273ad1a539aa404b0753340339e42f50eb9f135614e987326f35505adcb2db74c759ffdd4859a3d31f25952b7bef782fc845f63dd6e1f WHIRLPOOL f4bce37f10f754584f4ba41e3242ae171c36d6ea051a015726a24cf324b7218e5ceaf8e0715238fc32af95b9da725f4e7e5a9b490e24d43113cbbedf697071be
+MISC ChangeLog-2015 15474 SHA256 be7735f12a7d53a70d2b3b4b8ac157bccba5643fe8769bce844fcd54a0adbc06 SHA512 ac010807af2bd101211962417a88cb000e23a7a230ff64bbf4829b16129eea9da24ca5d35124cd557d0d897e66d8e642f1e1c9a74755354897858ed596937e8a WHIRLPOOL 41392e18ed401df72776143d733b5f8da2518aee537e8ead704270de3c8821a45b75adf97624e7e2c4c99656eabca3b16604160bebc624cb75981af855753062
+MISC metadata.xml 530 SHA256 cf6199d73a3b413442595861daebab28d16f561aacc47dd20d0228583909aecd SHA512 29922e179098de072d1a5bd869ba4505a88ee1340ceb66b0898b58446ddd74b6a6dcc961b4a1445d2db3b95259c6cb31030b9c0b7ea036a92b303b7f7ac3b371 WHIRLPOOL 52fe3540af10f029e8be63b0aa8ed1c3e52a08ebdc799b31e7b7f9ddaac73052c657cacd9c8fe4a77bc8a150bb1b70ac8bca3575a7bc5c6d007d384d2a0f97fc
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.0.1_p5465-default-altivec.patch b/sys-devel/gcc-apple/files/gcc-apple-4.0.1_p5465-default-altivec.patch
new file mode 100644
index 000000000000..e7b0bbbf8078
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.0.1_p5465-default-altivec.patch
@@ -0,0 +1,38 @@
+* reverse patch to gain 10.4 behaviour for AltiVec.
+
+--- gcc/config/rs6000/rs6000-c.c
++++ gcc/config/rs6000/rs6000-c.c
+@@ -245,22 +245,22 @@
+ builtin_define ("__bool=__attribute__((altivec(bool__))) unsigned");
+
+ /* APPLE LOCAL begin AltiVec */
++ builtin_define ("vector=vector");
++ builtin_define ("pixel=pixel");
++ builtin_define ("_Bool=_Bool");
++ builtin_define ("bool=bool");
++ init_vector_keywords (pfile);
++
++ /* Indicate that the compiler supports Apple AltiVec syntax,
++ including context-sensitive keywords. */
+ if (rs6000_altivec_pim)
+ {
+- builtin_define ("vector=vector");
+- builtin_define ("pixel=pixel");
+- builtin_define ("_Bool=_Bool");
+- builtin_define ("bool=bool");
+- init_vector_keywords (pfile);
+-
+- /* Indicate that the compiler supports Apple AltiVec syntax,
+- including context-sensitive keywords. */
+ builtin_define ("__APPLE_ALTIVEC__");
+ builtin_define ("vec_step(T)=(sizeof (__typeof__(T)) / sizeof (__typeof__(T) __attribute__((altivec(element__)))))");
+-
+- /* Enable context-sensitive macros. */
+- cpp_get_callbacks (pfile)->macro_to_expand = rs6000_macro_to_expand;
+ }
++
++ /* Enable context-sensitive macros. */
++ cpp_get_callbacks (pfile)->macro_to_expand = rs6000_macro_to_expand;
+ /* APPLE LOCAL end AltiVec */
+ }
+ if (TARGET_SPE)
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch
new file mode 100644
index 000000000000..94abba89306c
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-arch-option.patch
@@ -0,0 +1,57 @@
+Description: Add dummy -arch option with simplistic check.
+Author: Heiko Przybyl <zuxez@cs.tu-berlin.de>
+
+diff -pruN gcc-5664.orig/gcc/gcc.c gcc-5664/gcc/gcc.c
+--- gcc-5664.orig/gcc/gcc.c 2010-09-21 22:28:11.000000000 +0200
++++ gcc-5664/gcc/gcc.c 2010-09-21 22:28:24.000000000 +0200
+@@ -88,6 +88,8 @@ compilation is specified by a string cal
+ #include "flags.h"
+ #include "opts.h"
+
++#include <mach-o/arch.h>
++
+ /* By default there is no special suffix for target executables. */
+ /* FIXME: when autoconf is fixed, remove the host check - dj */
+ #if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX)
+--- gcc-5664/gcc/gcc.c.orig 2010-09-22 01:30:04.000000000 +0200
++++ gcc-5664/gcc/gcc.c 2010-09-22 01:36:52.000000000 +0200
+@@ -1401,6 +1401,39 @@ translate_options (int *argcp, const cha
+ nskip += 1;
+ else if (! strcmp (p, "Xassembler"))
+ nskip += 1;
++ /* GENTOO_PORTAGE Allow but filter -arch. */
++ if (! strcmp (p, "arch")) {
++ if (i + 1 == argc)
++ fatal ("argument to `-arch' is missing");
++ /* Check current arch vs. given arch if possible. */
++ const NXArchInfo *ai = NXGetLocalArchInfo();
++ if (ai) {
++ /* Returns the most generic setting */
++ /* aka "i386", "x86_64", "ppc", "ppc64", "arm". */
++ const NXArchInfo *gai = NXGetArchInfoFromCpuType(ai->cputype, CPU_SUBTYPE_MULTIPLE);
++ if (gai) {
++ const char *name = gai->name;
++#ifdef __LP64__
++ /* Make sure x64 on 32bit kernel is set correctly. */
++ if (gai->cputype == CPU_TYPE_I386) {
++ name = "x86_64";
++ }
++ else if (gai->cputype == CPU_TYPE_POWERPC) {
++ name = "ppc64";
++ }
++#endif
++ if (strcmp(name, argv[i + 1]) != 0) {
++ fatal ("`-arch %s' does not match current compiler arch `%s'",
++ argv[i + 1], name);
++ }
++ }
++ }
++
++ /* Skip argument. */
++ i += 2;
++ /* Don't add option to the new env. */
++ nskip = 0;
++ }
+
+ /* Watch out for an option at the end of the command line that
+ is missing arguments, and avoid skipping past the end of the
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1-autoconf-m4-precious.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-autoconf-m4-precious.patch
new file mode 100644
index 000000000000..0ad6ced95867
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-autoconf-m4-precious.patch
@@ -0,0 +1,12 @@
+https://sourceware.org/ml/libffi-discuss/2009/msg00289.html
+
+--- libgomp/configure.ac
++++ libgomp/configure.ac
+@@ -110,6 +110,7 @@
+ m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
+ m4_define([_AC_ARG_VAR_PRECIOUS],[])
+ AC_PROG_CC
++m4_undefine([_AC_ARG_VAR_PRECIOUS])
+ m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+
+ AC_SUBST(CFLAGS)
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1-dsymutil.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-dsymutil.patch
new file mode 100644
index 000000000000..8da025d8c5d0
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-dsymutil.patch
@@ -0,0 +1,20 @@
+Revert of dsymutil part of
+http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00057.html
+See http://article.gmane.org/gmane.linux.gentoo.alt/4327
+
+--- gcc/config/darwin.h
++++ gcc/config/darwin.h
+@@ -326,12 +326,7 @@
+ "/* APPLE LOCAL nested functions 4357979 */"\
+ %{fnested-functions: -allow_stack_execute} \
+ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %G %L}} \
+-"/* APPLE LOCAL begin mainline 4.3 2006-10-31 4370146 */"\
+- %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}\n\
+-%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
+-"/* APPLE LOCAL end mainline 4.3 2006-10-31 4370146 */"\
+- %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \
+- %{g*:%{!gstabs*:%{!g0: dsymutil %{o*:%*}%{!o:a.out}}}}}}}}}}}}"
++ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}"
+ /* APPLE LOCAL end mainline */
+
+ #ifdef TARGET_SYSTEM_ROOT
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs-r1.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs-r1.patch
new file mode 100644
index 000000000000..497248527d6d
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs-r1.patch
@@ -0,0 +1,39 @@
+In Prefix we are really self-providing, so don't look back!
+Original patch by Heiko Przybyl
+
+/usr/lib and /lib are not valid locations to search for startfiles,
+especially as they come BEFORE the prefix locations.
+
+--- gcc/gcc.c
++++ gcc/gcc.c
+@@ -1525,8 +1525,8 @@ static const char *gcc_libexec_prefix;
+ #endif
+
+ static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+-static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
+-static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
++static const char *const standard_exec_prefix_1 = "@GENTOO_PORTAGE_EPREFIX@/usr/libexec/gcc/";
++static const char *const standard_exec_prefix_2 = "@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/";
+ static const char *md_exec_prefix = MD_EXEC_PREFIX;
+
+ static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
+diff --git a/a/gcc/config/darwin.h b/b/gcc/config/darwin.h
+index 482cd4c..b971c64 100644
+--- gcc/config/darwin.h
++++ gcc/config/darwin.h
+@@ -24,6 +24,15 @@ Boston, MA 02110-1301, USA. */
+ #ifndef CONFIG_DARWIN_H
+ #define CONFIG_DARWIN_H
+
++#undef STANDARD_STARTFILE_PREFIX
++#define STANDARD_STARTFILE_PREFIX "@GENTOO_PORTAGE_TPREFIX@/usr/lib"
++
++#undef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "@GENTOO_PORTAGE_TPREFIX@/lib"
++
++#undef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 STANDARD_STARTFILE_PREFIX_1
++
+ /* The definitions in this file are common to all processor types
+ running Darwin, which is the kernel for Mac OS X. Darwin is
+ basically a BSD user layer laid over a Mach kernel, then evolved
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs.patch
new file mode 100644
index 000000000000..2cd947b4e82f
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-prefix-search-dirs.patch
@@ -0,0 +1,27 @@
+In Prefix we are really self-providing, so don't look back!
+Patch by Heiko Przybyl
+
+--- gcc/gcc.c
++++ gcc/gcc.c
+@@ -1525,8 +1525,8 @@ static const char *gcc_libexec_prefix;
+ #endif
+
+ static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+-static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
+-static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
++static const char *const standard_exec_prefix_1 = "@GENTOO_PORTAGE_EPREFIX@/usr/libexec/gcc/";
++static const char *const standard_exec_prefix_2 = "@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/";
+ static const char *md_exec_prefix = MD_EXEC_PREFIX;
+
+ static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
+--- gcc/config/darwin.h
++++ gcc/config/darwin.h
+@@ -1286,7 +1286,7 @@ void add_framework_path (char *);
+ } \
+ } while (0)
+
+-#define SYSROOT_PRIORITY PREFIX_PRIORITY_FIRST
++#define SYSROOT_PRIORITY PREFIX_PRIORITY_LAST
+ /* APPLE LOCAL end isysroot 5083137 */
+
+ /* Every program on darwin links against libSystem which contains the pthread
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1-texinfo.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-texinfo.patch
new file mode 100644
index 000000000000..f82fe60d2ee7
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1-texinfo.patch
@@ -0,0 +1,33 @@
+--- configure
++++ configure
+@@ -3748,7 +3748,7 @@
+ # For an installed makeinfo, we require it to be from texinfo 4.4 or
+ # higher, else we use the "missing" dummy.
+ if ${MAKEINFO} --version \
+- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
++ | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|4\.[1-9][0-9]|[5-9])' >/dev/null 2>&1; then
+ :
+ else
+ MAKEINFO="$MISSING makeinfo"
+--- gcc/configure.ac
++++ gcc/configure.ac
+@@ -882,7 +882,7 @@
+ # that we can use it.
+ gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
+ [GNU texinfo.* \([0-9][0-9.]*\)],
+- [4.[4-9]*])
++ [4.[4-9]*|4.[1-9][0-9]])
+ if test $gcc_cv_prog_makeinfo_modern = no; then
+ MAKEINFO="$MISSING makeinfo"
+ AC_MSG_WARN([
+--- libgomp/configure.ac
++++ libgomp/configure.ac
+@@ -135,7 +135,7 @@
+ # that we can use it.
+ ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
+ [GNU texinfo.* \([0-9][0-9.]*\)],
+- [4.[4-9]*])
++ [4.[4-9]*|4.[1-9][0-9]])
+ AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes")
+
+
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch
new file mode 100644
index 000000000000..fb785b0ad9c4
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-darwin14.patch
@@ -0,0 +1,148 @@
+https://537826.bugs.gentoo.org/attachment.cgi?id=394896
+https://bugs.gentoo.org/show_bug.cgi?id=537826
+Michael Weiser
+
+Backport of https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=218873 (as
+per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61407) to correctly encode Mac
+OS X versions >10.9 into __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__.
+Extended to also encode patch level the way clang and Apple GCC 4.2.1 do.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63810 has a much more generic
+patch. But it's not yet in-tree pending legal paperwork. Once that's done, we
+can backport that.
+
+--- gcc/libgcov.c
++++ gcc/libgcov.c
+@@ -34,6 +34,14 @@
+ #include "coretypes.h"
+ #include "tm.h"
+
++/* to deal with XBC headers from 10.10 */
++#ifndef __has_extension
++#define __has_extension(x) 0
++#endif
++#ifndef __has_feature
++#define __has_feature(x) 0
++#endif
++
+ /* APPLE LOCAL begin instant off 6414141 */
+ #if defined(__APPLE__) && !defined(__STATIC__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__arm__)
+ #include <vproc.h>
+--- gcc/config/darwin-driver.c.orig 2010-10-14 22:27:53.000000000 +0200
++++ gcc/config/darwin-driver.c 2015-01-25 21:15:09.000000000 +0100
+@@ -174,8 +174,6 @@
+ version_p = osversion + 1;
+ if (ISDIGIT (*version_p))
+ major_vers = major_vers * 10 + (*version_p++ - '0');
+- if (major_vers > 4 + 9)
+- goto parse_failed;
+ if (*version_p++ != '.')
+ goto parse_failed;
+ version_pend = strchr(version_p, '.');
+--- gcc/config/darwin-c.c.orig 2015-01-25 19:44:40.000000000 +0100
++++ gcc/config/darwin-c.c 2015-01-25 21:05:47.000000000 +0100
+@@ -930,31 +930,91 @@
+
+ /* Return the value of darwin_macosx_version_min suitable for the
+ __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro,
+- so '10.4.2' becomes 1042.
++ so '10.4.2' becomes 1042 and '10.10.2' becomes 101002.
++ Cap patch level to 9 in the old format.
+ Print a warning if the version number is not known. */
+ static const char *
+ /* APPLE LOCAL ARM 5683689 */
+ macosx_version_as_macro (void)
+ {
+- static char result[] = "1000";
++ static char result[7] = "1000";
++ int inputindex = 3, outputindex = 2;
+
++ /* make sure version starts with "10." - makes sure we can safely start
++ * parsing at inputindex == 3 */
+ if (strncmp (darwin_macosx_version_min, "10.", 3) != 0)
+ goto fail;
++
++ /* first character of minor version needs to be digit */
+ if (! ISDIGIT (darwin_macosx_version_min[3]))
+ goto fail;
+- result[2] = darwin_macosx_version_min[3];
+- if (darwin_macosx_version_min[4] != '\0')
++
++ result[outputindex++] = darwin_macosx_version_min[inputindex++];
++
++ if (ISDIGIT (darwin_macosx_version_min[inputindex])) {
++ /* Starting with OS X 10.10, the macro ends '00' rather than '0',
++ i.e. 10.10.x becomes 101000 rather than 10100. */
++ result[outputindex++] = darwin_macosx_version_min[inputindex++];
++ result[4] = '0';
++ result[5] = '0';
++ result[6] = '\0';
++ }
++
++ /* if we're out of input, leave patch level at 0 or 00 and finish */
++ if (darwin_macosx_version_min[inputindex] == '\0')
++ return result;
++
++ /* a dot *must* follow now */
++ if (darwin_macosx_version_min[inputindex++] != '.')
++ goto fail;
++
++ /* a digit must follow after the dot */
++ if (! ISDIGIT (darwin_macosx_version_min[inputindex]))
++ goto fail;
++
++ /* old-style macro */
++ if (outputindex == 3)
++ {
++ /* one-digit patch level */
++ if (darwin_macosx_version_min[inputindex + 1] == '\0')
+ {
+- if (darwin_macosx_version_min[4] != '.')
+- goto fail;
+- if (! ISDIGIT (darwin_macosx_version_min[5]))
+- goto fail;
+- if (darwin_macosx_version_min[6] != '\0')
+- goto fail;
+- result[3] = darwin_macosx_version_min[5];
++ result[outputindex] = darwin_macosx_version_min[inputindex];
++ return result;
+ }
+- else
+- result[3] = '0';
++
++ inputindex++;
++ if (! ISDIGIT (darwin_macosx_version_min[inputindex++]))
++ goto fail;
++
++ /* three digits? */
++ if (darwin_macosx_version_min[inputindex] != '\0')
++ goto fail;
++
++ /* no room for another digit. Traditional Apple GCC 4.2.1 doesn't accept
++ * it but current clang caps it to 9. We choose to be in line with clang. */
++ result[outputindex] = '9';
++ return result;
++ }
++
++ /* new-style macro */
++
++ /* leave a leading zero if only one digit is following */
++ if (darwin_macosx_version_min[inputindex + 1] == '\0') {
++ result[outputindex + 1] = darwin_macosx_version_min[inputindex];
++ return result;
++ }
++
++ result[outputindex++] = darwin_macosx_version_min[inputindex++];
++
++ /* a digit must follow now */
++ if (! ISDIGIT (darwin_macosx_version_min[inputindex]))
++ goto fail;
++
++ result[outputindex] = darwin_macosx_version_min[inputindex++];
++
++ /* no more input allowed */
++ if (darwin_macosx_version_min[inputindex] != '\0')
++ goto fail;
+
+ return result;
+
diff --git a/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-perl-5.18.patch b/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-perl-5.18.patch
new file mode 100644
index 000000000000..af3688aa48e5
--- /dev/null
+++ b/sys-devel/gcc-apple/files/gcc-apple-4.2.1_p5666-perl-5.18.patch
@@ -0,0 +1,11 @@
+--- a/contrib/texi2pod.pl
++++ b/contrib/texi2pod.pl
+@@ -337,7 +337,7 @@ while(<$inf>) {
+ $_ = "\n=item $1\n";
+ }
+ } else {
+- $_ = "\n=item $ic\n";
++ $_ = "\n=item Z\&LT;\&GT;$ic\n";
+ $ic =~ y/A-Ya-y/B-Zb-z/;
+ $ic =~ s/(\d+)/$1 + 1/eg;
+ }
diff --git a/sys-devel/gcc-apple/files/libstdc++-16.patch b/sys-devel/gcc-apple/files/libstdc++-16.patch
new file mode 100644
index 000000000000..81d075bface7
--- /dev/null
+++ b/sys-devel/gcc-apple/files/libstdc++-16.patch
@@ -0,0 +1,11 @@
+--- libstdc++-v3/include/bits/c++config
++++ libstdc++-v3/include/bits/c++config
+@@ -76,7 +76,7 @@
+ }
+ namespace std
+ {
+- using namespace __gnu_debug_def __attribute__ ((strong));
++ using namespace __gnu_debug_def;
+ }
+ #else
+ # define _GLIBCXX_STD std
diff --git a/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild
new file mode 100644
index 000000000000..bd1d11209952
--- /dev/null
+++ b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r2.ebuild
@@ -0,0 +1,375 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain flag-o-matic autotools prefix
+
+GCC_VERS=${PV/_p*/}
+APPLE_VERS="${PV/*_p/}.3"
+DESCRIPTION="Apple branch of the GNU Compiler Collection, Developer Tools 4.0"
+HOMEPAGE="https://gcc.gnu.org"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/gcc-${APPLE_VERS}.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/libstdcxx-16.tar.gz
+ http://www.opensource.apple.com/darwinsource/tarballs/other/libstdcxx-39.tar.gz
+ fortran? (
+ mirror://gnu/gcc/gcc-4.2.4/gcc-fortran-4.2.4.tar.bz2
+ https://dev.gentoo.org/~grobian/distfiles/${PN}-4.2.1_p5646-gfortran.patch
+ )"
+LICENSE="GPL-2 GPL-3"
+
+SLOT="42"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="bootstrap fortran nls +openmp objc objc++ +cxx"
+
+RDEPEND=">=sys-libs/zlib-1.1.4
+ >=sys-libs/ncurses-5.2-r2
+ nls? ( sys-devel/gettext )
+ >=sys-devel/gcc-config-1.8-r1
+ sys-libs/csu
+ !<sys-apps/portage-2.2.14
+ fortran? (
+ >=dev-libs/gmp-4.2.1
+ >=dev-libs/mpfr-2.2.0_p10
+ )"
+DEPEND="${RDEPEND}
+ >=sys-apps/texinfo-4.2-r4
+ >=sys-devel/bison-1.875
+ ${CATEGORY}/binutils-apple
+ >=dev-libs/mpfr-2.2.0_p10"
+
+S=${WORKDIR}/gcc-${APPLE_VERS}
+
+# TPREFIX is the prefix of the CTARGET installation
+export TPREFIX=${TPREFIX:-${EPREFIX}}
+
+do_bootstrap() {
+ is_crosscompile && return 1
+ [[ ${CHOST} != ${CBUILD} ]] && return 1
+ [[ ${EPREFIX} != ${TPREFIX} ]] && return 1
+ return 0
+}
+
+src_unpack() {
+ # override toolchain.eclass func
+ unpack ${A}
+}
+
+src_prepare() {
+ # Support for fortran
+ if use fortran ; then
+ mv "${WORKDIR}"/gcc-4.2.4/gcc/fortran gcc/ || die
+ mv "${WORKDIR}"/gcc-4.2.4/libgfortran . || die
+ # from: substracted from http://r.research.att.com/tools/
+ epatch "${DISTDIR}"/${PN}-4.2.1_p5646-gfortran.patch
+ fi
+
+ # move in libstdc++
+ case ${CHOST} in
+ *-darwin1*|i?86-*-darwin9|powerpc-*-darwin9)
+ LIBSTDCXX_APPLE_VERSION=39
+ ;;
+ *)
+ # pre Leopard has no dtrace, which is required by 37.11 and above
+ # Leopard only has 32-bits version of dtrace
+ LIBSTDCXX_APPLE_VERSION=16
+ ;;
+ esac
+ mv "${WORKDIR}"/libstdcxx-${LIBSTDCXX_APPLE_VERSION}/libstdcxx/libstdc++-v3 .
+ if [[ ${LIBSTDCXX_APPLE_VERSION} == 16 ]] ; then
+ epatch "${FILESDIR}"/libstdc++-${LIBSTDCXX_APPLE_VERSION}.patch # does it apply on 37?
+ sed -i -e 's/__block\([^_]\)/__blk\1/g' \
+ libstdc++-v3/include/ext/mt_allocator.h \
+ libstdc++-v3/src/mt_allocator.cc || die "conflict fix failed"
+ fi
+
+ # we use our libtool
+ sed -i -e "s:/usr/bin/libtool:${EPREFIX}/usr/bin/${CTARGET}-libtool:" \
+ gcc/config/darwin.h || die "sed gcc/config/darwin.h failed"
+ # add prefixed Frameworks to default search paths (may want to change this
+ # in a cross-compile)
+ sed -i -e "/\"\/System\/Library\/Frameworks\"\,/i\ \ \"${EPREFIX}/Frameworks\"\, " \
+ gcc/config/darwin-c.c || die "sed gcc/config/darwin-c.c failed"
+
+ # Workaround deprecated "+Nc" syntax for GNU tail(1)
+ sed -i -e "s:tail +16c:tail -c +16:g" \
+ gcc/Makefile.in || die "sed gcc/Makefile.in failed."
+
+ # default to AltiVec on PPC, like for older releases
+ epatch "${FILESDIR}"/${PN}-4.0.1_p5465-default-altivec.patch
+
+ # support -arch XXX if XXX is actually what the toolchain targets because
+ # some upstreams insist on setting it
+ epatch "${FILESDIR}"/${PN}-4.2.1-arch-option.patch
+
+ # dsymutil stuff breaks on 10.4/x86, revert it
+ [[ ${CHOST} == *86*-apple-darwin8 ]] && \
+ epatch "${FILESDIR}"/${PN}-${GCC_VERS}-dsymutil.patch
+
+ # support OS X 10.10
+ epatch "${FILESDIR}"/${P}-darwin14.patch
+
+ # bootstrapping might fail with host provided gcc on 10.4/x86
+ if ! is_crosscompile && ! echo "int main(){return 0;}" | gcc -o "${T}"/foo \
+ -mdynamic-no-pic -x c - >/dev/null 2>&1;
+ then
+ einfo "-mdynamic-no-pic doesn't work - disabling..."
+ echo "BOOT_CFLAGS=-g -O2" > config/mh-x86-darwin
+ XD=gcc/config/i386/x-darwin
+ awk 'BEGIN{x=1}{if ($0 ~ "use -mdynamic-no-pic to build x86")
+ {x=1-x} else if (x) print}' $XD > t && mv t $XD \
+ || die "Failed to rewrite $XD"
+ fi
+
+ epatch "${FILESDIR}"/${P}-perl-5.18.patch
+
+ epatch "${FILESDIR}"/${PN}-4.2.1-prefix-search-dirs-r1.patch
+ eprefixify "${S}"/gcc/gcc.c
+ sed -i -e "s|@GENTOO_PORTAGE_TPREFIX@|${TPREFIX}|g" "${S}"/gcc/config/darwin.h
+
+ if use !bootstrap ; then
+ # this only occurs with up-to-date tools from the Prefix, and actually
+ # breaks the bootstrap since the autoconf needs a very recent automake
+ epatch "${FILESDIR}"/${PN}-${GCC_VERS}-texinfo.patch
+ epatch "${FILESDIR}"/${PN}-${GCC_VERS}-autoconf-m4-precious.patch
+ cd "${S}"/gcc && eautoconf
+ cd "${S}"/libgomp && eautoconf
+ fi
+
+ local BRANDING_GCC_PKGVERSION="$(sed -n -e '/^#define VERSUFFIX/s/^[^"]*"\([^"]\+\)".*$/\1/p' "${S}"/gcc/version.c)"
+ BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/(/(Gentoo ${PVR}, }
+ einfo "patching gcc version: ${GCC_VERS}${BRANDING_GCC_PKGVERSION}"
+
+ sed -i -e "s~VERSUFFIX \"[^\"]*~VERSUFFIX \"${BRANDING_GCC_PKGVERSION}~" \
+ "${S}"/gcc/version.c || die "failed to update VERSUFFIX with Gentoo branding"
+ sed -i -e 's~developer\.apple\.com\/bugreporter~bugs\.gentoo\.org\/~' \
+ "${S}"/gcc/version.c || die "Failed to change the bug URL"
+
+ # fix the install_names of all shared libraries for the target
+ # NOTE: do this after any automake-ing!
+ # Yes, patching generated files is bad. Talk to me once you've found a way to do this inside automake.
+ sed -i -e "s|-install_name \$(slibdir)|-install_name ${TPREFIX}/usr/${CTARGET}/lib/gcc|" "${S}"/gcc/config/t-slibgcc-darwin
+ sed -i -e "s|-rpath \$(toolexeclibdir)|-rpath ${TPREFIX}/usr/${CTARGET}/lib/gcc|" \
+ "${S}"/{libgomp,libstdc++-v3/src,libstdc++-v3/libsupc++}/Makefile.in
+}
+
+src_configure() {
+ local langs="c"
+ use cxx && langs="${langs},c++"
+ use objc && langs="${langs},objc"
+ use objc++ && langs="${langs/,objc/},objc,obj-c++" # need objc with objc++
+ use fortran && langs="${langs},fortran"
+
+ LIBPATH=${EPREFIX}/usr/lib/gcc/${CTARGET}/${GCC_VERS}
+ if is_crosscompile ; then
+ BINPATH=${EPREFIX}/usr/${CHOST}/${CTARGET}/gcc-bin/${GCC_VERS}
+ else
+ BINPATH=${EPREFIX}/usr/${CTARGET}/gcc-bin/${GCC_VERS}
+ fi
+ STDCXX_INCDIR=${LIBPATH}/include/g++-v${GCC_VERS/\.*/}
+
+ local myconf="${myconf} \
+ --prefix=${EPREFIX}/usr \
+ --bindir=${BINPATH} \
+ --includedir=${LIBPATH}/include \
+ --datadir=${EPREFIX}/usr/share/gcc-data/${CTARGET}/${GCC_VERS} \
+ --mandir=${EPREFIX}/usr/share/gcc-data/${CTARGET}/${GCC_VERS}/man \
+ --infodir=${EPREFIX}/usr/share/gcc-data/${CTARGET}/${GCC_VERS}/info \
+ --with-gxx-include-dir=${STDCXX_INCDIR} \
+ --host=${CHOST} \
+ --enable-version-specific-runtime-libs"
+
+ if is_crosscompile ; then
+ # Straight from the GCC install doc:
+ # "GCC has code to correctly determine the correct value for target
+ # for nearly all native systems. Therefore, we highly recommend you
+ # not provide a configure target when configuring a native compiler."
+ myconf="${myconf} --target=${CTARGET}"
+
+ # Tell compiler where to find what it needs
+ myconf="${myconf} --with-sysroot=${EPREFIX}/usr/${CTARGET}"
+
+ # Set this to something sane for both native and target
+ CFLAGS="-O2 -pipe"
+
+ local VAR="CFLAGS_"${CTARGET//-/_}
+ CXXFLAGS=${!VAR}
+ fi
+ [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
+
+ # Native Language Support
+ if use nls ; then
+ myconf="${myconf} --enable-nls --without-included-gettext"
+ else
+ myconf="${myconf} --disable-nls"
+ fi
+
+ # reasonably sane globals (hopefully)
+ myconf="${myconf} \
+ --with-system-zlib \
+ --disable-checking \
+ --disable-werror"
+
+ # ???
+ myconf="${myconf} --enable-shared --enable-threads=posix"
+
+ # make clear we're in an offset
+ use prefix && myconf="${myconf} --with-local-prefix=${TPREFIX}/usr"
+
+ do_bootstrap || myconf="${myconf} --disable-bootstrap"
+
+ # we don't use a GNU linker, so tell GCC where to find the linker stuff we
+ # want it to use
+ myconf="${myconf} \
+ --with-as=${EPREFIX}/usr/bin/${CTARGET}-as \
+ --with-ld=${EPREFIX}/usr/bin/${CTARGET}-ld"
+
+ # make sure we never do multilib stuff, for that we need a different Prefix
+ [[ -z ${I_KNOW_WHAT_IM_DOING_I_WANT_APPLE_MULTILIB} ]] \
+ && myconf="${myconf} --disable-multilib"
+
+ myconf="${myconf} --enable-languages=${langs} $(use_enable openmp libgomp)"
+
+ # The produced libgcc_s.dylib is faulty if using a bit too much
+ # optimisation. Nail it down to something sane
+ CFLAGS="-O2 -pipe"
+ CXXFLAGS=${CFLAGS}
+
+ # https://gcc.gnu.org/ml/gcc-patches/2006-11/msg00765.html
+ # (won't hurt if already 64-bits, but is essential when coming from a
+ # multilib compiler -- the default)
+ [[ ${CTARGET} == powerpc64-* || ${CTARGET} == x86_64-* ]] && \
+ export CC="${CC:-$(tc-getCC)} -m64"
+
+ # Clang on OSX defaults to c99 mode, while GCC defaults to gnu89
+ # (C90 + extensions). This makes Clang barf on GCC's sources, so
+ # work around that. Bugs #491098, #574736
+ export CC="${CC:-$(tc-getCC)} -std=gnu89"
+
+ mkdir -p "${WORKDIR}"/build
+ cd "${WORKDIR}"/build
+ einfo "Configuring GCC with: ${myconf//--/\n\t--}"
+ "${S}"/configure ${myconf} || die "conf failed"
+}
+
+src_compile() {
+ cd "${WORKDIR}"/build || die
+ if ! do_bootstrap; then
+ GCC_MAKE_TARGET=${GCC_MAKE_TARGET-all}
+ else
+ GCC_MAKE_TARGET=${GCC_MAKE_TARGET-bootstrap}
+ fi
+ emake ${GCC_MAKE_TARGET} || die "emake failed"
+}
+
+src_install() {
+ cd "${WORKDIR}"/build
+ # -jX doesn't work
+ emake -j1 DESTDIR="${D}" install || die
+
+ # Punt some tools which are really only useful while building gcc
+ find "${ED}" -name install-tools -prune -type d -exec rm -rf "{}" \;
+ # This one comes with binutils
+ find "${ED}" -name libiberty.a -exec rm -f "{}" \;
+
+ # Basic sanity check
+ if ! is_crosscompile ; then
+ local EXEEXT
+ eval $(grep ^EXEEXT= "${WORKDIR}"/build/gcc/config.log)
+ [[ -r ${D}${BINPATH}/gcc${EXEEXT} ]] || die "gcc not found in ${ED}"
+ fi
+
+ # create gcc-config entry
+ dodir /etc/env.d/gcc
+ local gcc_envd_base="/etc/env.d/gcc/${CHOST}-${GCC_VERS}"
+
+ gcc_envd_file="${ED}${gcc_envd_base}"
+
+ # phase PATH/ROOTPATH out ...
+ echo "PATH=\"${BINPATH}\"" > ${gcc_envd_file}
+ echo "ROOTPATH=\"${BINPATH}\"" >> ${gcc_envd_file}
+ echo "GCC_PATH=\"${BINPATH}\"" >> ${gcc_envd_file}
+
+ # we don't do multilib
+ LDPATH="${LIBPATH}"
+ echo "LDPATH=\"${LDPATH}\"" >> ${gcc_envd_file}
+ echo "MANPATH=\"${EPREFIX}/usr/share/gcc-data/${CHOST}/${GCC_VERS}/man\"" >> ${gcc_envd_file}
+ echo "INFOPATH=\"${EPREFIX}/usr/share/gcc-data/${CHOST}/${GCC_VERS}/info\"" >> ${gcc_envd_file}
+ echo "STDCXX_INCDIR=\"g++-v${GCC_VERS/\.*/}\"" >> ${gcc_envd_file}
+ is_crosscompile && echo "CTARGET=${CTARGET}" >> ${gcc_envd_file}
+
+ # Move <cxxabi.h> to compiler-specific directories
+ [[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ]] && \
+ mv -f "${D}"${STDCXX_INCDIR}/cxxabi.h "${D}"${LIBPATH}/include/
+
+ # These should be symlinks
+ dodir /usr/bin
+ cd "${D}"${BINPATH}
+ for x in cpp gcc g++ c++ g77 gcj gcjh gfortran ; do
+ # For some reason, g77 gets made instead of ${CTARGET}-g77...
+ # this should take care of that
+ [[ -f ${x} ]] && mv ${x} ${CTARGET}-${x}
+
+ if [[ -f ${CTARGET}-${x} ]] && ! is_crosscompile ; then
+ ln -sf ${CTARGET}-${x} ${x}
+
+ # Create version-ed symlinks
+ dosym ${BINPATH#${EPREFIX}}/${CTARGET}-${x} \
+ /usr/bin/${CTARGET}-${x}-${GCC_VERS}
+ dosym ${BINPATH#${EPREFIX}}/${CTARGET}-${x} \
+ /usr/bin/${x}-${GCC_VERS}
+ fi
+
+ if [[ -f ${CTARGET}-${x}-${GCC_VERS} ]] ; then
+ rm -f ${CTARGET}-${x}-${GCC_VERS}
+ ln -sf ${CTARGET}-${x} ${CTARGET}-${x}-${GCC_VERS}
+ fi
+ done
+
+ # I do not know if this will break gcj stuff, so I'll only do it for
+ # objc for now; basically "ffi.h" is the correct file to include,
+ # but it gets installed in .../GCCVER/include and yet it does
+ # "#include <ffitarget.h>" which (correctly, as it's an "extra" file)
+ # is installed in .../GCCVER/include/libffi; the following fixes
+ # ffi.'s include of ffitarget.h - Armando Di Cianno <fafhrd@gentoo.org>
+ if [[ -d ${D}${LIBPATH}/include/libffi ]] ; then
+ mv -i "${D}"${LIBPATH}/include/libffi/* "${D}"${LIBPATH}/include || die
+ rm -r "${D}"${LIBPATH}/include/libffi || die
+ fi
+
+ # Now do the fun stripping stuff
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${D}${BINPATH}"
+ env RESTRICT="" CHOST=${CTARGET} prepstrip "${D}${LIBPATH}"
+ # gcc used to install helper binaries in lib/ but then moved to libexec/
+ [[ -d ${ED}/usr/libexec/gcc ]] && \
+ env RESTRICT="" CHOST=${CHOST} prepstrip "${ED}/usr/libexec/gcc/${CTARGET}/${GCC_VERS}"
+
+ # prune empty dirs left behind
+ find "${ED}" -type d | xargs rmdir >& /dev/null
+
+ # The gcc runtime libs have an invalid install_name; this is correct,
+ # as they are copied to the right location by gcc-config later.
+ QA_IGNORE_INSTALL_NAME_FILES=()
+ pushd "${ED}/usr/lib/gcc/${CTARGET}/${GCC_VERS}" > /dev/null
+ for file in *.dylib; do
+ QA_IGNORE_INSTALL_NAME_FILES+=( "${file}" )
+ done
+ popd > /dev/null
+}
+
+pkg_postinst() {
+ # beware this also switches when it's on another branch version of GCC
+ gcc-config ${CTARGET}-${GCC_VERS}
+}
+
+pkg_postrm() {
+ # clean up the cruft left behind by cross-compilers
+ if is_crosscompile ; then
+ if [[ -z $(ls "${EROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then
+ rm -f "${EROOT}"/etc/env.d/gcc/config-${CTARGET}
+ rm -f "${EROOT}"/etc/env.d/??gcc-${CTARGET}
+ rm -f "${EROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64}
+ fi
+ return 0
+ fi
+}
diff --git a/sys-devel/gcc-apple/metadata.xml b/sys-devel/gcc-apple/metadata.xml
new file mode 100644
index 000000000000..eb4d397c67f0
--- /dev/null
+++ b/sys-devel/gcc-apple/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>prefix@gentoo.org</email>
+ <name>Gentoo Prefix</name>
+ </maintainer>
+ <use>
+ <flag name="objc">Build support for the Objective C code language</flag>
+ <flag name="objc++">Build support for the Objective C++ language</flag>
+ <flag name="regression-test">Run the testsuite and install the results (requires FEATURES=test)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/gcc-config/Manifest b/sys-devel/gcc-config/Manifest
new file mode 100644
index 000000000000..23f074641539
--- /dev/null
+++ b/sys-devel/gcc-config/Manifest
@@ -0,0 +1,11 @@
+AUX gcc-config-1.8-dont_source_functions_sh_from_etc_initd.patch 1427 SHA256 2c09499fd1f9425d8b4c903cdc716ff22d6ea4049bfb5b6e497de01f4c148d5b SHA512 f9ba9341aebbeabfd8fa283b9bf30ad6907398c44a2d6ff113a47b2599a90f5cb0da1947675c0a27881bf1ba8138979b0f4918cbc175c64d6e6f754d6e7d6b9c WHIRLPOOL 79273ee0281ffb6c79c4dd77da3c016b9f867657dd879eb35502ecc393d0bc2d66677b48010ac297c11cccfb4654471c71c82e7ba26c49b4e2794a5b10536cb8
+DIST gcc-config-1.7.3.tar.xz 15088 SHA256 2c6cca69a028f157dc54e19ea10efc240e0d26824cd223b22c294c003ce9325e SHA512 88b585787b5ad79017b27e68dbca6b5de96784582ee657d18562b1994bc1c27a6609b3dfcbf30f39a02b0b2886a289a1ddc955281fc60fe974436d13aa685908 WHIRLPOOL a9a45b489e34756da66e4597ba9f4fa061b5431a82310317237293a0c519c72906d14d3c72b76483c1c674bf779ac606cf85f22a5e4a4065dd92b1b91215461a
+DIST gcc-config-1.8.tar.xz 15020 SHA256 2453e2a07521b12267ca62b9b860eb2d2bc606cad0f29bf42a1c9543673f5a1b SHA512 3b84af2d961a0527834759e047330dbab7bac0ff3d6aae103f14fca2d44bd612bd4a1005649e8b4198036231ed8a8319fb13326b4d2c40474826cf53f7bc0826 WHIRLPOOL 4899bc1da43a158cc486022f68661e5318db7e4e83afdb5d892fc7ce5098a4bdb059dbab3c50e632901e577cd8760b2386da3ee24f5e944db12d3e246d9c26b6
+DIST gcc-config-1.9.0.tar.xz 17468 SHA256 3e0acf3fe683dc6193b0135fe4b26ce7f959210296fff040a10bccc33a247d1a SHA512 658c8ce26fdddd6f3e519310001cdf0f8fb01226df2d575fec81b39c083613ef0675024b79b285fab89a930c4ada7a1aef04433eb21947b4e9c0a9cb12f8fabc WHIRLPOOL ed341f1fa72958008d4e1c1a814a2cf025be7404d21c963c6b82c36dc951ba15849f7809211fb21e5fb4a18ce5c12f4f4b36242822e568d4b4f39a8f9f26aa0a
+EBUILD gcc-config-1.7.3.ebuild 1022 SHA256 d4be3de8d2b3d47dcb586d842cb4188262dd35c41c22c3cf7d3eb518bd39ad91 SHA512 e48c80cfc24c0d701594fd53dc9ea7875bb8d4a43022331093db33d3a8d0b2652c9216e79c4f245b583f62a324a3ad9e2438adcf4cea53de4027e3de3cb84061 WHIRLPOOL 420869fffcd7f959a8164b58463c1ec7dfdcea574d6897320f429df531128a9c5ca69bc47b5ed10ad9414265e0b0e854bb45d9c8d0f05a87d4ff80dd03814c9b
+EBUILD gcc-config-1.8-r1.ebuild 1182 SHA256 d3843e2910bb994ae6c5cc8635088e817a8c647086f20f32b2b6e3b76350a055 SHA512 615a3b5bec263f1268c42dece25ecbc644b9f701e6b1f69c14b48194c122ee1f54160bf513aedfa210b0a542c4db8f9639dac27f49903621b96840d4714206e2 WHIRLPOOL 0b63c772319f1440db4e91ac2cd30ea31692ab3024bd32350e3c5c6a41593edb6dabd0ac31b2679f7f44bac55501a020a27b1fdabf1c9a62f8c800861bd9787a
+EBUILD gcc-config-1.8.ebuild 1035 SHA256 3a51617ea066a94c043f7d9e637c0a0fed064f7e3a99c7285e56f26096da8821 SHA512 8ed8f187fbb6c50f019a94826798c427f0d7647ca5a4369a551bc5e8571f4ac337c3c99066e1f6ae5ac562723500f1a718a2cbe3f54f24535caf7c4264a33620 WHIRLPOOL 3f41ddb2aab0446cdd0748db83c49a392913a5ddec99ac2a29a965e9e4eb82c1ec8aec4d34d835f65e329db26dc29c98782d48d7771b41d9a0214c67a6a5730e
+EBUILD gcc-config-1.9.0.ebuild 1079 SHA256 0645387c1a8188fae5f24d3a230913394d2504a8fe5ea89908945ce0c5bf8ccb SHA512 a91175f3690253014f695d45a52269c57bc7d6365a38b00d902502bde984d02aac6c59f28f2475c84dfecd2b538441a6c8b49ab92713c67d3dab84715d767d47 WHIRLPOOL c240040acc2a9ac7843cfa5ee1caafb1fb4010904dfc9816844087b0e4a6dc767b10d0765534d3548fd1394d3e559bea051b11b44250d24c4df85bbeab66720a
+MISC ChangeLog 4613 SHA256 ac0232e8affa3a08338c69ee52e3b940d915ed33a4a12d140e1bc8a2fe06d67d SHA512 d5b53be1dfd0160cb6c8fbba02317bc70c3eb48bf1cf08779029a77072549ebee21edccf819e3193d262291d11621fdfebc19c1b3978566c2fc3050c4b1786f8 WHIRLPOOL 26a1d4e53efa5e223f93b2510d71c5b50b7970fe332810f8c43d6c74dcda50e36fe49fc2ebf9b4a05077a984d2f39273cd8773fb04adec8406ed008196cfcfbc
+MISC ChangeLog-2015 40131 SHA256 d3bbaa19b1403c570fe5de4115ed77500e7c8d4c9ae6652b164985bdf6cee282 SHA512 9942910698fb69efd3c2e0e4ec3ca7ed6468e04010c5718b6e01a43d8e215f56327ed5d66a63df870ba56651e3166db2b417dad73f94f47b94b3f54ca1066d69 WHIRLPOOL 7487235f32eca293af3914e34575945fe6c8b87d371eef1c474231dbc27b768cb867decd7877f489cd072ecc909cb0c93a4c98a358243f34cd9e64b5dd0dbdab
+MISC metadata.xml 257 SHA256 fcb691c3299a07a5fe4f936baa5aa146b8aa3cb9491ba88fd12547cb540b02c2 SHA512 fd85d9cf15f6b7db96e4d184e32ae6f1503a5b70cb4cb1ce930ba13a1d5d4c4b24971781e95b7f3f9ead58b31760f84c368bc6fa2a793b4b5baf78259b047ff1 WHIRLPOOL 62b62e3e5489b8983ddd7bfc6017411d5e02f9710763206baa84b826388c8685fe7bdc0bb6a76c029e73ae4c160e9af6c8544406dc70a203c7c3d65d4aa15400
diff --git a/sys-devel/gcc-config/files/gcc-config-1.8-dont_source_functions_sh_from_etc_initd.patch b/sys-devel/gcc-config/files/gcc-config-1.8-dont_source_functions_sh_from_etc_initd.patch
new file mode 100644
index 000000000000..a4b7de2ffc54
--- /dev/null
+++ b/sys-devel/gcc-config/files/gcc-config-1.8-dont_source_functions_sh_from_etc_initd.patch
@@ -0,0 +1,47 @@
+--- gcc-config-1.8/gcc-config
++++ gcc-config-1.8/gcc-config
+@@ -15,8 +15,9 @@
+ trap ":" INT QUIT TSTP
+
+ argv0=${0##*/}
+-source /etc/init.d/functions.sh || {
+- echo "${argv0}: Could not source /etc/init.d/functions.sh!" 1>&2
++functions_script="/lib/gentoo/functions.sh"
++source ${functions_script} || {
++ echo "${argv0}: Could not source ${functions_script}!" 1>&2
+ exit 1
+ }
+ esyslog() { :; }
+
+From d45de09450ffb63b138bbb7f78cae43e1101e2ec Mon Sep 17 00:00:00 2001
+From: Ryan Hill <rhill@gentoo.org>
+Date: Tue, 12 May 2015 22:09:28 -0600
+Subject: [PATCH] Ignore whitespace when diffing test results.
+
+The amount of whitespace output by ebegin/eend from gentoo-functions
+is dynamic (seems to be dependent on terminal width). Since we can't
+predict this we have to ignore all whitespace differences.
+
+URL: https://bugs.gentoo.org/547586
+Reported-by: tka <tka@kamph.org>
+Signed-off-by: Ryan Hill <rhill@gentoo.org>
+---
+ tests/run_tests | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/run_tests b/tests/run_tests
+index 2ff7d77..397d667 100755
+--- a/tests/run_tests
++++ b/tests/run_tests
+@@ -44,7 +44,7 @@ cmp_log() {
+ args+=( -e "s|: line [0-9]*: |: |g" )
+ sed "${args[@]}" "${exp}" > "${exp}.tmp"
+ sed "${args[@]}" "${log}" > "${log}.tmp"
+- diff -u "${exp}.tmp" "${log}.tmp" > "${log}.diff"
++ diff -uw "${exp}.tmp" "${log}.tmp" > "${log}.diff"
+ ret=$?
+ rm "${exp}.tmp"
+ return ${ret}
+--
+2.4.4
+
diff --git a/sys-devel/gcc-config/gcc-config-1.7.3.ebuild b/sys-devel/gcc-config/gcc-config-1.7.3.ebuild
new file mode 100644
index 000000000000..1f415730f60a
--- /dev/null
+++ b/sys-devel/gcc-config/gcc-config-1.7.3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit unpacker toolchain-funcs multilib
+
+DESCRIPTION="utility to manage compilers"
+HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ PV="${PV}" \
+ SUBLIBDIR="$(get_libdir)" \
+ install || die
+}
+
+pkg_postinst() {
+ # Scrub eselect-compiler remains
+ rm -f "${ROOT}"/etc/env.d/05compiler &
+
+ # We not longer use the /usr/include/g++-v3 hacks, as
+ # it is not needed ...
+ rm -f "${ROOT}"/usr/include/g++{,-v3} &
+
+ # Do we have a valid multi ver setup ?
+ local x
+ for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
+ gcc-config ${x}
+ done
+
+ wait
+}
diff --git a/sys-devel/gcc-config/gcc-config-1.8-r1.ebuild b/sys-devel/gcc-config/gcc-config-1.8-r1.ebuild
new file mode 100644
index 000000000000..48324fc6aec0
--- /dev/null
+++ b/sys-devel/gcc-config/gcc-config-1.8-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils unpacker toolchain-funcs multilib
+
+DESCRIPTION="utility to manage compilers"
+HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 ~arm ~arm64 ~hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=sys-apps/gentoo-functions-0.10"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-1.8-dont_source_functions_sh_from_etc_initd.patch" # 504118
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ PV="${PV}" \
+ SUBLIBDIR="$(get_libdir)" \
+ install
+}
+
+pkg_postinst() {
+ # Scrub eselect-compiler remains
+ rm -f "${ROOT}"/etc/env.d/05compiler &
+
+ # We not longer use the /usr/include/g++-v3 hacks, as
+ # it is not needed ...
+ rm -f "${ROOT}"/usr/include/g++{,-v3} &
+
+ # Do we have a valid multi ver setup ?
+ local x
+ for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
+ gcc-config ${x}
+ done
+
+ wait
+}
diff --git a/sys-devel/gcc-config/gcc-config-1.8.ebuild b/sys-devel/gcc-config/gcc-config-1.8.ebuild
new file mode 100644
index 000000000000..e83d9cc11090
--- /dev/null
+++ b/sys-devel/gcc-config/gcc-config-1.8.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit unpacker toolchain-funcs multilib
+
+DESCRIPTION="utility to manage compilers"
+HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ PV="${PV}" \
+ SUBLIBDIR="$(get_libdir)" \
+ install || die
+}
+
+pkg_postinst() {
+ # Scrub eselect-compiler remains
+ rm -f "${ROOT}"/etc/env.d/05compiler &
+
+ # We not longer use the /usr/include/g++-v3 hacks, as
+ # it is not needed ...
+ rm -f "${ROOT}"/usr/include/g++{,-v3} &
+
+ # Do we have a valid multi ver setup ?
+ local x
+ for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
+ gcc-config ${x}
+ done
+
+ wait
+}
diff --git a/sys-devel/gcc-config/gcc-config-1.9.0.ebuild b/sys-devel/gcc-config/gcc-config-1.9.0.ebuild
new file mode 100644
index 000000000000..f6b9422871d9
--- /dev/null
+++ b/sys-devel/gcc-config/gcc-config-1.9.0.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils toolchain-funcs multilib
+
+DESCRIPTION="Utility to manage compilers"
+HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
+SRC_URI="mirror://gentoo/${P}.tar.xz
+ https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=sys-apps/gentoo-functions-0.10"
+
+src_compile() {
+ emake CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ PV="${PV}" \
+ SUBLIBDIR="$(get_libdir)" \
+ install
+}
+
+pkg_postinst() {
+ # Scrub eselect-compiler remains
+ rm -f "${ROOT}"/etc/env.d/05compiler &
+
+ # We not longer use the /usr/include/g++-v3 hacks, as
+ # it is not needed ...
+ rm -f "${ROOT}"/usr/include/g++{,-v3} &
+
+ # Do we have a valid multi ver setup ?
+ local x
+ for x in $(gcc-config -C -l 2>/dev/null | awk '$NF == "*" { print $2 }') ; do
+ gcc-config ${x}
+ done
+
+ wait
+}
diff --git a/sys-devel/gcc-config/metadata.xml b/sys-devel/gcc-config/metadata.xml
new file mode 100644
index 000000000000..e396f3755977
--- /dev/null
+++ b/sys-devel/gcc-config/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
new file mode 100644
index 000000000000..d5726f886159
--- /dev/null
+++ b/sys-devel/gcc/Manifest
@@ -0,0 +1,99 @@
+AUX 3.3.4/libffi-without-libgcj.patch 890 SHA256 a422ebf05e279bdcb15627363af8101e4d6a54ca037d6da11c13b4768799d974 SHA512 6204588808a37a13dffc8c6bdf70eb453107413d0c8fffddeb360444e3e605f1ceb42c41905cfa1c4f9cbb1b22dc290e68d2728dbddb0f4d0406dd8dca6789a0 WHIRLPOOL 7260ba32fc7d60f1fa4d8667c929e16f3bdf9fe953c823c5b6876d4fea4d4fed52e67aec92cbb599d6327eac009bc4fbbc06ba85acf9848bf346384af0523363
+AUX 3.4.3/libffi-nogcj-lib-path-fix.patch 1691 SHA256 030e2c9f31b325ea975792bdfee88272d1065b8794511410dc30bd2caf8b3451 SHA512 001e3c1c585c3ab641a540eb5502788dd1151cb66fc9f0196ae79e3ad7f01a291812511bd19114fdffc9d8b71987623f1dcccefed3546cb9e0f0e6abd55f093c WHIRLPOOL ffda82e69885c7691f7746188f3565dd90fa9a33be1426155ccf8f5cc40f910ac8bdac14accef120c379bbddc589732028cff94377a6bfffc080789d7a825d15
+AUX 3.4.3/libffi-without-libgcj.patch 1658 SHA256 41fd051cc16b61da4abf4f696f13b8b574fce76c65d1a731de3dd0d39f335037 SHA512 f277f4dff390ead308b897bf06ad53584f11d8234f49f5c41c6966204652113d015c1c6a240d8e9d121af285d4491cfd15a3934c37588b66007423b9050cb42f WHIRLPOOL 82350dd81e502b037d767f066abc1277ed69a2b0d404973e001b7af126aa4c03ddba04ff094fb8ae3b29b9690e78ee0fd71ede2c29bd1c944fc9516199d547a5
+AUX 3.4.4/gcc-3.4.4-cross-compile.patch 1912 SHA256 f8bc4cb8cc012f40f9a988ed8344e9e75df5cb3714d98a2eb19e5320e32c7724 SHA512 c31cc4c77bb9a5f01a7a7969dad862fc5d7f9916adf67e039a71714e0eca02b13a576bdfbab50c069cc8020ef4dc335ed20bb10214f714a089b8daa02e849d2c WHIRLPOOL a96f689f8b97f960e7e33c6bb0fe13e502bf1a180ba8c0f49a9538f842bbb9c736e3162643e2401bccb8ff2f98622e9b1d0e1959ad5728d18130d4b5b927dfa1
+AUX 4.1.0/gcc-4.1.0-cross-compile.patch 1134 SHA256 8ee57285151659793df88e025f1225b401a0c805bfc8d1685e04ef75393a24ab SHA512 84d0ab9bcfdd18148392a7219ec0ad4a1e63d43bda3f45a13e22f551f2f119822fed700570bd659f9260b09b0958d4c49e339ad4f135740e5b60e46462de7f20 WHIRLPOOL 1252a62c809523fb0669cf1c4f056d98c6fa4d24a3f97339be828fea8fcd66254b2e1112d6c4c628deddf71418dcf8e6a8846013bf6683efbe4cc3bfdd8f6cb4
+AUX 4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch 1686 SHA256 7547293b945808f63b70aafed644a43c99e19f82aaf1d2f2df8502d87ab3f01d SHA512 cb0268c64d8d50ee3c95e9c6ca9242be1cb08382c7b081c129045a4852a7b3ed5c48124b33aa51816d80f5c930929bdc097644e817d77b5e186442248a609f2f WHIRLPOOL 7c152c59e7cffe1730bfb20e9ac97aba8a2bad583d9b6daff0ea0be90ca0d4a153bc40c169e1f4831c87c88b4ac5b41bef0cb019e8bbe69a72b702916770a765
+AUX awk/fixlafiles.awk 7693 SHA256 036ec4daa8f11752fdca9288ac504dfa8299d4261d7cf651953b6a6aa4aedb93 SHA512 3b7b06d4f82a67b642e8d74fa32c211ae597bea0e65a4a1992c10a3e7aa93ddf1aa210bfba1b5e34df87f8bea1d628a9a6c900579572433cd6d0fb9a34f6ddf4 WHIRLPOOL c10311a8b81a3e96b2ed64d4a47fe639eff013ff0c2f004d7a5e9431ae1a4c7efd0a710ead3b0e6d49f648c2eefa90a7b1f7c88182510e272cd383e7e6752fbe
+AUX awk/fixlafiles.awk-no_gcc_la 8473 SHA256 e5593dbf7785b42bbbc536ffb488d08ce045d88660864f617770d970ec457b3b SHA512 bea5e047e8bf4dd5d6e877e84225b7efd79dedaad0a35713b3b6887b82aac215dde8f07b9bdfc8a75874248faf4cb7c73d01303e22476e6160e7398db1497b94 WHIRLPOOL 13b49a41531aa6daa29c10c2c9676436c3cf8aad925c8d0ec1fe79befaea0250d4f1661434736f1b052b147ec6e694933ade2ae539a18ca4648397c9ca61f3ff
+AUX c89 412 SHA256 29ad5dd697135c2892067e780447894dc1cd071708157e46d21773ab99c5022c SHA512 71d33a147339d8d70a62aa22a95d3e70e445d8435d6ac05893f7da19ae851b89bea851f6ce213fbd22470f13572ae13b83cf02f0621333f07d7b0c68a79b7924 WHIRLPOOL d9707a2be8da7a709b54fcb1154cfa05e479f8c3bdd6173822ee1f1bc265b2a0d04741c0685bfb0db68e1e4297fb032d2f8ff94da88014575d947054474d8295
+AUX c99 446 SHA256 057b348cf5be9b4fb9db99a4549f6433c89d21e5f91dc5e46b0b4dc6b70432f5 SHA512 bf3b0eb1125d5e89b433954fcbf805cd86dec5a6eeb23df685ebf3ff83a610573f2ffcec65d893244c845936a73918387cba026710c65c854b2c94a78b007989 WHIRLPOOL b888038b96615c7a0363555b407a3de2c1f17e34428fa16dfbf56fcf68875d6bcdecbc61b545d7f71842ff1909a3ffeff17165fa7f56b48f95adae22f5f8bff1
+AUX fix_libtool_files.sh 1547 SHA256 5eda4347c1e7068dbee7e260726ada06f6f49d7452f4110db80d59dddfd8ed97 SHA512 ca39921a04ce9f0888e6aac3240ee71c8259734457a3ac5b910da3c57e04abab7550ae77ed3de6233533569009b17540300cdca32fabf5f3be004f3f8917fd83 WHIRLPOOL 0ae50f8ccc8654d06cca3bae6ba1185e1240811c2150969367c3c19615cc145b0da480b251ced33d397ef0406d7672d6af3d8fd51713e3ba58164c14db8b82da
+AUX gcc-configure-LANG.patch 2052 SHA256 63de6d2dcfe14f21d147abeb1390405b9220c03f8e968f482d4b4c1cf279c88b SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129 WHIRLPOOL 3cc1ec912fb192ff1058de5b93e49a994ba30d1501a932290dd5b3df1cd783875621cda56edeb41894cd5fa10c04917e693a40a60be8d742ddd7992bf5d8afeb
+AUX gcc-configure-texinfo.patch 337 SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98 SHA512 a15fba8bf2ff02bdeca54d6f186bfa08c1079c6a8ba0a3beef154483ce5c1b8c497e7ffeec32371968f0037e0ff8384609eb0c367d0155a4e5a7eef8aad084d5 WHIRLPOOL 39d008aad06f7621e4e5db15f5e85a59e583b43f8d247029bd4944466bb60a9795bda157d185c45c329294078e282703a243aad5c468d90c77665dd6336870d4
+AUX gcc-spec-env-r1.patch 3148 SHA256 da0a6442eb42bce58cbdc7858b110a2e65fc5bd5b4b780b9b491033de6e302fa SHA512 ecae71577543772cfe1711f1b4a8815c0b5d706ebd01edacd1f07586637d4805e25771f970a6e6d1bb696d4b1b5ef3e0036088a96a9f6beff7ddaee704175d16 WHIRLPOOL 3535605998eabccdee71ba396ed5cefbb8b0a8cb073101f6444c7d01233f3b3904c1b29f4daf0a3417c68de8dbd62a0b7dc367cacfcbfa0c4ee1b69b7df8c6fb
+AUX gcc-spec-env.patch 1544 SHA256 64b01f29fb853fee5ecda998b66eeaa7ec86ff1fc3b21432bfd69eb543c93e6a SHA512 ce9c1f923e2c6d17347ec2d3d8482351a9644194b2753627389294d43bb4f11b9c2ef41eda1b46ad83d09901a0bedebd5b6b8a57a198646030ab61e8d2d8cb48 WHIRLPOOL b88c9c18e20868b3ff535c3390408ebe8f1304bcec6e70b6472781f684671265860dff4335f2301d3b4d3b73395283b29673f0f5da62414e1094cfcb8130e8d8
+DIST bounds-checking-gcc-3.3.6-1.00-r2.patch.bz2 829688 SHA256 eacdaecd9c07b6573a6522ac776d8daad7658c4214a7fb0ff950cd47ff811ae6 SHA512 d4533d02289dcd2ee11952f83dc687d82624d6e31ddb548e4f54cde4ef9cced5a1aac5b64086441f8930274e31f20d0ee82850fe1257f96c08b05d406d3b2e26 WHIRLPOOL c9d39cef9408472634a689a61e914ea01e6f67294162d16fcd5b451d1b33aed86f842adca8e4995c863ca1ed7a4e5fc0ce68d99a78f1e765cc3caad06ecbf6e9
+DIST bounds-checking-gcc-3.4.4-1.00.1.patch.bz2 815566 SHA256 6568f904eb26ff4bc90e23792b3346aaf98c0ffe38a1abe853d823b3c2157e96 SHA512 da11cb354d5ec95c74081c2cbb29bcb49817a1f9d6875587b4a27f1c9fdea8f07eec8147b739bd18a4fa2365e5da50e4bca7d7531612fbf2514c50516d225ac2 WHIRLPOOL fedeb8ca85af5bcc924243cafde3a96f0ddf69df13a1e2c68a207c0dda3d598af59b49a92c35e104a16f70af86a0027a7630306d23aaf873f48149a64e86347f
+DIST ecj-4.3.jar 1377431 SHA256 9de193ea393ed50d868b730bad6916f7a8ef4ba80216f8606d3e1a0dd886e74b SHA512 c4be72186d81747f1adce5a50de303c24bd6ed9f401bfa8871b1b864fe7591392218b1937b10d0e76014de8e0b6a1d5c4280475976218141cd1878c4a35217ff WHIRLPOOL 9137d6aa5b0e34a596e8d3de8843b5478cec8cdd4113303d554120ba8c6d467e802414f861ff0d7ef1d85dbcb09d4ccc10668385460d1a476345e2de86798bce
+DIST ecj-4.5.jar 1470676 SHA256 98fd128f1d374d9e42fd9d4836bdd249c6d511ebc6c0df17fbc1b9df96c3d781 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e WHIRLPOOL db54206cfd5eba935e707b8d36ebac40f3c4ed3c1f06ede794288cbdd9c7da9d90c0898e8c98b383af276ea4c1b40c861ebd9e1fc1dce712946184321339d3ad
+DIST gcc-2.95.3-patches-1.4.tar.bz2 125654 SHA256 dbbefc926fb07b17eb18d4c8bfa8b8d1d956f4484c19e8afecb0ecb995232886 SHA512 7cc79439162ddf6f5dea4fd88e172e815684a34ed70e67f33c6acf4e1a687a748a78dee232d462adb5858cc3f9609e34cf1b8a75707947f4fcdf3d33251738e5 WHIRLPOOL d10f43b3081eaac83b6e22cb9aa863380415fe73da9e167b9b961b37419161d385e70b4f0fa9bb03399ecf77ff289b58cafd804a510d7366c21496c82ec416f3
+DIST gcc-2.95.3.tar.bz2 9848842 SHA256 cf91a6b4f41248895f06bcd0570a62d2417ee99d32e6e2c5f70490e0eb6af5e4 SHA512 683eafd1788a0021867797796444868100d244f72749dd8f014eb04495554ca43eba852179554710d516ff4b94527f40ff9c9189e007ef6fd958ec7293f17e4d WHIRLPOOL 7605984ae8bd948f116e319a47b668327d0e83c301e4391abb66a72a58868fc90e5c8d3298d9444d4852a0073f71a9f36389add96bc5b54364d7943b397bd027
+DIST gcc-3.3.6-patches-1.9.tar.bz2 51760 SHA256 9759a4dc139c9c739a179fdabff484c8b2d036707f0be03ca54fdb7f7d4ffdb4 SHA512 306220c537c5cd90af7638431e6547ee9a80199c384629b5fbda06c28b2d6168fcf1dd448c0e178b104f41e03a8ebda4f389489d205b9e66ade6637e4747196c WHIRLPOOL 0a49ae8fe42f24c8c0e1a9d7671c462219e501bbe2fb27c78a723889cb084632899403d78230e7618899d2cb639bdeada0d5c577949a87c1d249891cd22a5b01
+DIST gcc-3.3.6-uclibc-patches-1.0.tar.bz2 28882 SHA256 c007f38cb0c57291adf0b367f31e14c84dd1d6f48a388896eb63b6cd4328e418 SHA512 d060c1552d4f21b8b1cd6a6e56b9af4f62f61ce8ef4362afb1982b2ad9defe6a9648705cf780103d4f2061737553b6737c276d79b803b6b75ae94035bc881f0e WHIRLPOOL 524204cc41097f13e0de2ad8e99ff80d449c490d602625d24ddda6b874cf63194d62c22f98469f5ee89c8283df82a25fbc989db32a52f31f2a31928b5a522f2f
+DIST gcc-3.3.6.tar.bz2 23972413 SHA256 1c1aa533c67e9da5e55ed4f5736258dc753466bd716bdae3fb88fb66e6ff1d7f SHA512 576b88e2fa675314a79a85f180684fe5af370c596476a0bf02e33e8ae0e2be838417ea80675ce4194a8213792cf7ada50cae5131149e4b890ab61e0b8d50d0ed WHIRLPOOL 27372f9d12cdedaad38e75c3efea3430d6873d92f85ec0024e2cc5ad986c710ed940edecc926a4c25ce14d14cddc1aec3eb35ac2c29e8c85309685d525a99cf1
+DIST gcc-3.4.5-uclibc-patches-1.1.tar.bz2 70923 SHA256 5b92fac2afe835a127976fdb6602fb5628cf28e67dd19e8289768a3bb8631ec2 SHA512 c0534a374e2e0416d0792373f9d11526226f9ce1a98e771469efa68388b709c72672b8db8fe77901144a96a23e4fd9f9a99f1d278f1e8fffda8a6b01e3b770fa WHIRLPOOL 79a7bb14e220dad7ea818afae12839ff7cc624f128bbf7a29c8005478f6da9742ff08100088baeaf36c038f7ddadc4ec64e78d5283ed19efb4d3625916a3b00a
+DIST gcc-3.4.6-patches-1.8.tar.bz2 61940 SHA256 69822a3b93d8288a1e2c2536c738f0af5ccd286143000c43fecbf62c90861655 SHA512 14c12628e0ccdc47492890a46d45f9ef1df3970d1103116c3c3be76ecf1b3560088232819891662f44d621877b59ed38dab48053885bd34e6516d7de514f42d6 WHIRLPOOL 74e2046a4f04fe1127ae67f29ffdfcd5ff5e0ac27c62e03252a8e754a74bd8f9771d43a53818272f165bcbb38bdc5c15729910f63616fb8494e09dde15f8fd86
+DIST gcc-3.4.6.tar.bz2 28193401 SHA256 7791a601878b765669022b8b3409fba33cc72f9e39340fec8af6d0e6f72dec39 SHA512 d235e1223d5faf8f37f2d73db35edeff44c88974b09dfcf325f4b181b16d7124710d93b1b65b60206ce3525f062236ea0f338b3a5341d7ecbe196d8e90c3ff18 WHIRLPOOL 19fc447592f1feee56da74ee6d9436e0813e5a29ced37f8bf91836bbf0b1b9023fe2f717f8c3cf6dc84f11d2029cd87b65e9176b19727996420b589716cdfa45
+DIST gcc-4.0.4-patches-1.3.tar.bz2 41994 SHA256 2995b5c8f29f9f6c0a8d5039d24c3af62fd8a707ea81a7ffd978ca5f336bca75 SHA512 34999c783b0b2af782ae316c7a874a40a3e98faa8eb48409f951fc167ad4fb56c4fec93dc5cb6831b89f2dd90c80e3c89778fd73b9f176cb4470d8f5d1537b03 WHIRLPOOL 5f56b4ac0ef4df6a34c099b505a8cce01d277ee7d17dd79e542f1b9513cb24a0c23f1191e3933b6a0782d3c181c1c6d72a72837e9c9da1c1685c10103b8a37f5
+DIST gcc-4.0.4-uclibc-patches-1.0.tar.bz2 20164 SHA256 2f4386f423de421b1171c6312d82be3f646fa249df9672687bf8c37a72d8d1ab SHA512 67bdb8be3b7d173795ae3692f8f76fb6c236bfe3054112db30e3f0a56982685fe0b15e2c37f7d9e15e6198e4a41e47e1434a2befeee4e9e460e7bc9e0fa9d235 WHIRLPOOL f7cc0a984272187e88683683e7c484d6d40cf70efce4ded1ad5cae2849a6a51214280453eb60400d3b43a310a319b39dc8f7f88a5857d69ea91d73e0bfe6b663
+DIST gcc-4.0.4.tar.bz2 32642939 SHA256 f3fde051c96d2fc084f6f4d6114ce4c1a079fcd1247d947d50a3d1641acafc47 SHA512 194c12b5a1bc50c003f6fc849a4c0032388a960fb4b769bdb6e76cf330f04f880a0723661c991ec03742443c21ccba9af8599ae648a0777e0a5875c5fe7f6abd WHIRLPOOL 58749231707c5007f5907ef3916c9f2941bb42e0890d754c9e62692f5e049955a766bae502f233fa1ac084279432b15effa4b632a87c2c50db4f24c070ae9762
+DIST gcc-4.1.2-patches-1.6.tar.bz2 54513 SHA256 ce3653368abca2cde342cc68dc1288a8a4e2a884e28ad2a8c6e8198ecffe1bac SHA512 0f225b66851c1e70afe19f59c8527631c8b42f0580922d979d2dbf367b4591a59e7047bcb52b36695bf24fcfd71ea814b0001e001fe0e39482dec7327bb74259 WHIRLPOOL 89743a6ed97aebfb0d4e07ffce7cf1dd39b065a9f5d10342536e579ec6eaa81cfc186413051f754efa870ad12812d0425d4c41ecdf9a263b636da5d66c666d3b
+DIST gcc-4.1.2-uclibc-patches-1.0.tar.bz2 20980 SHA256 c6ed88711a727ed11847c9b9f1cef7023037bc80c0840eda5fca6d60fa02e35a SHA512 57789f4236a3085136afa83be3cef677bd813afd258d67bfdbecd2058f497cd459366d5515044c0208ab753946dc951dac6a3889752ca6dae836d837c22ce33b WHIRLPOOL 6a0eee923be11ad415eed56f4acc11480747aff92d97baf083526866d3c7eb63ca1fe51375fa70b9223f863a25e4487ebe9ce9da2acf1bbf6b55c6ad2d1a7010
+DIST gcc-4.1.2.tar.bz2 39707720 SHA256 cfc0efbcc6fcde0d416a32dfb246c9df022515a312683fac412578c4fd09a9bc SHA512 b97d3b72a3b0355611d5090b2c715b7a774f0e466a89326a0226c2809d12dfafb2d7c5a7af54bd5e00c135bbb6596f535e1a484740f7f1f691e8a57e6f0425cc WHIRLPOOL 5822040f7e96919bb906ce55e0bd19c4c85b3a47ce73f0a4b6d0da62ce9d7651b6cbeb6199dafc38582b206a98126e3efec8d54cc58c7f303ca708c9261bec57
+DIST gcc-4.2.4-patches-1.4.tar.bz2 25768 SHA256 425b423a1ed8f0eefcf244f1d4462cb1e11699befc2a1d2b3f908ea5d123668d SHA512 dacd9d13f29e1e7baf136dee564fd0d128c20f77a8f7ab745263ad9dea8c694c006b89baf93f9aab7a0f93b48c2a54d80c4196f83f0f27c0fe17f7fba9a4fcfd WHIRLPOOL 69cb826a6a7914e121732208b95450bc0fc1b9dc9ad08d67c87fb7643b7777ee51fea5a699a8dc94b5abe570d6a1b47d95027764fd695e5572ba3c32c27f59ea
+DIST gcc-4.2.4-uclibc-patches-1.0.tar.bz2 19167 SHA256 45fe49c144db3c23f928f0303a80071145361242566671afc96b6dfea5ece221 SHA512 5545cfe6bfa7ab9a69a474cc051cc8744380077dcc193afefeb455e959e408a5e4dfd1adde5357886c7f598835400273ef80ad5c14976c0552b44f5cd48704ed WHIRLPOOL baa4c6bc76deff38d3f85e7b91f53e6f3785e2d315cd835aa8d4a80b580f43c2fa21046df85f17d8c81f95a91c0fa782078963a2849ee1604f3202c9790b9d27
+DIST gcc-4.2.4.tar.bz2 44025458 SHA256 afba845e2d38547a63bd3976e90245c81ea176786f9e6966339c6d3761f1133a SHA512 c6e3e4fce1d27d0c56ab24f4809367d9329b620b7c124e88de190f2ea2ae57b5e06d0bda85c5a74237a4f94ddba53dc91faea0611fff7b19ad720edc312cb0d9 WHIRLPOOL 242177c7adc1538dfbf0b5519132902479c9a8f21158ed04bcf29a3616bbf98d0cf4def13e602ad0226e745875c327d33e8f45eae1b1e6de6d61e2a0ca1b0b90
+DIST gcc-4.3.6-patches-1.2.tar.bz2 76826 SHA256 55fd71e268afd1bdbc799a4dfb69c86ff6e08019159ff94d9cea5512a5f29af7 SHA512 229692a6026ebadc4d87342fd11695338c0fb2a13c43ed6288710fbdca4d7330c74a2c8a46f60637be9c4c38365076f068d35c5a91faa1c69a55e5e7aeac79f8 WHIRLPOOL b0f282a8579261af35609e3e4b5a3998067e16e8b75a65da866893052be023032e3108f2500681ab9e30e4ed673f6eb6a61dd51de17476e831a1f8dd11db2ca3
+DIST gcc-4.3.6-uclibc-patches-1.0.tar.bz2 3021 SHA256 6ad4c3a5f6c359eaa2b6d1996cb2098c4265d00b7d3a33e9db880301b1166e69 SHA512 6b85bf4caf5662ae114e472199c2f77d1fef63c485c073643968b6e0575c13bfa4ce9a32191908f34e70d41fd9fb5b9bc2b527542d82dac881a0462bfe89b120 WHIRLPOOL a2855f10474da54173930eccdcd9a6afe8bfd54d2d612c4ee1060e0bd68d83cbaa7aef9efc5ec2c329ebdbe903c2bbd7ea589b2b391f896409b8f04df46617a0
+DIST gcc-4.3.6.tar.bz2 59756702 SHA256 f3765cd4dcceb4d42d46f0d53471d7cedbad50f2112f0312c1dcc9c41eea9810 SHA512 0cb43f523135c6d54b3b5e26de7044fe096c16e7c3af8e400b2b48c5e52b4b5aa56615b1eca5e326b0202cf34870daa6ac44ec9633762acafa4425552b4029ee WHIRLPOOL 43694948728163150276be24b386a6ba5c12ade91a3836059f2665e7670ed011216fb144e73fc79de8a16988f77a3d789f781ff595ea241a7f2ba88e4f624306
+DIST gcc-4.4.3-specs-0.2.0.tar.bz2 2004 SHA256 f6c7cb99beead66dd4d06f7004c5731a9360330cbe878ce79792c618e008eed2 SHA512 779ecb0a064d2138b54569c8ae501975b8a6b72e5a3acbf8597619a8db77ee42ef9b0e62608d5192a15e4393e7dfc009bb50b994782236faa744b2c46b5fe517 WHIRLPOOL 8a1e45aad9d306cb19de93c63b5854a97e629d90852feb6861dcfca042b6257705304fc13ad65655a4cb227d36b83fc6063648c94f270821574ee0e85307094e
+DIST gcc-4.4.7-patches-1.3.tar.bz2 25866 SHA256 26daf24267edc8d1b9974d18df770652fa90d3a2062ddff2933997646f93b3bd SHA512 cb59c8bb72a5414a9930f63e55a175bdc57d51dc518ec7d1245684f4576daa139e10dbe050a75ac960607cb0a5ed52c49ed7139d74398278bb7012ecda7be09d WHIRLPOOL b9e79660977ca3d82fea5f957270003ac27c3fab7f4da72d7bc169c3a7158b95084ceb8c537b86f9f67a3bb966533d1fbfd1f40463d8fa4daf1c20033048d256
+DIST gcc-4.4.7-uclibc-patches-1.0.tar.bz2 3016 SHA256 f68c52de7aa8b172f7b43c3b576902c3d02ceafdef954cbb76f4fa2e02dd66f2 SHA512 46a69cb8e2e3b97116d012b95a515953b2629be04228a2ac90fe628705e6bc3bdf05ee22e3ed7d5fd0fe6e60aad8f1f96f36e8dd3b231bdfd048e61c6cc15beb WHIRLPOOL f28c1d2b7ede7315e60eef0651580b716ed89f0cfbeac59705537f3cb70ee748eeb3913e0344a40421e27d2aebf3162466178acbc7c8a555e06bd4b3818fa43a
+DIST gcc-4.4.7.tar.bz2 63179340 SHA256 5ff75116b8f763fa0fb5621af80fc6fb3ea0f1b1a57520874982f03f26cd607f SHA512 5562a7319cfd8cc7c5261de9170f2cda86cbd3a231a444a5ec0ad3d8fd60af6f8bd86af8f201cebb7bddcd083d761834d1cbd652c68af0f5607d22a63439ed0e WHIRLPOOL 588dc683b0526d0d9f0b178cab54e30340741a49752097ad4fbbe2da4d7fef5e6d17e321a078726e2797604de280f8ad39309e05eaf6b4cfb0d1e7167c2a0aeb
+DIST gcc-4.5.4-patches-1.3.tar.bz2 20108 SHA256 4859c23ff400061d8bf3fb961f025b321700ad49f27badd9bd6ed204ea3bb49c SHA512 ba5781da360b5049ba07aa46dd45b8405540dadd717ceb88c07d8803ba91a90b9ee32147932d3dddf1ae1ece148589cc2b0e709a3fbec7fe56266f6e925fa8a5 WHIRLPOOL d2b82ac67bf0a574c7fc9976831cce175af78f08cbbffc1b0fb95ce9748d65906c70fc681ea4390bc76222f1042c9d6fe7a879700aeb0b0f60ac89328643c64d
+DIST gcc-4.5.4-uclibc-patches-1.0.tar.bz2 3019 SHA256 bcfaac58ee057ca9fdbee9295100379051b3b7df8abdf33f24da6cb3c75b4d20 SHA512 b6aa0a7d029a2a00b36fe8906d76b434fcdfc7191cbc8fffbcb8b89a66eba61ba6cd0cfdba94a79929487fbbad2163083b085476498f8be77ad473d078b0095a WHIRLPOOL f3cae558649cdbce9a7dbf0d006845d88349926d1e3d7a4717f2df5c413a1da236b9e35fe0618844578408825b6130533570146c525525a0df18223b3ebf479f
+DIST gcc-4.5.4.tar.bz2 66426133 SHA256 eef3f0456db8c3d992cbb51d5d32558190bc14f3bc19383dd93acc27acc6befc SHA512 78696b287d46aacd6f150920da376ea32f58ad9f0dafd2d3b7fa6dbdd8dd7afe659108d1dfaa5807617fc5248719f50b39c37ade0173ea5b9fec2091f4656115 WHIRLPOOL 1d3aa5f344171a75144118101bf475536940eeb80f73849827ee4103c52dfb6504d9b26e21fa0984c65c5e6267e02fa6e7f8ef539c44f45470790781080aadca
+DIST gcc-4.6.4-patches-1.3.tar.bz2 16443 SHA256 0ff58a1142164ccbcc172470945812343d467da3ba0cdfa338deef75252316b8 SHA512 ed904bb8438a23a2e1ec3aff28c4451128421426305ff07de50edbad51a066bee9d1a9042a9b26c36dbd57e1eb044a474088945d6d780c6e98d7563947fb9b9a WHIRLPOOL 0fbcb26fdde71415e492f86d5bdf4605ebea283192426f121f6d34c2401b093a06ef0eae61c64abee653621efb1611ef39902d535ee8742061af8459131632d5
+DIST gcc-4.6.4-uclibc-patches-1.0.tar.bz2 3010 SHA256 946334cc62c0afa2f50a435dffbed12fd32c170f0850bbdce47df188a1eb8918 SHA512 fd289089a30c768b0ec4e3459cf494bc5e9d4ecf87056dc183277c712f7d69ac4cf900950270d8eacfe686b4aa906e1ece87cae52f2cb00642e96c0b95dcf133 WHIRLPOOL 2ce7f308a21fb5072d08a640390eb3f453ad8d811df897b0f9d3e917eef4680fce6cce231159ffe96e371f3c299264eaa51cd110124a3a126f04fb6d8531639e
+DIST gcc-4.6.4.tar.bz2 72006076 SHA256 35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8 SHA512 b5a5395782e0b9e61cda052f6e00c8575d1aa0b7e8db9e34c06e4e45f12ff37b436018536b7fa69a04a4235b5b368895652e3ed8fab2fe11763f9782ed9161dc WHIRLPOOL ab1b035f43aec669640b36037e65ae0edceb3b13b1ce4f7900aeff5ee06686dc2d66c3dd81156f53c4e9a9a806e4becd4462f72a6c4ad7e646b632c10c23356c
+DIST gcc-4.7.4-patches-1.4.tar.bz2 18072 SHA256 cef0f9d5624fd583eddffe060fb882e2e3b7ed43e517e03df7b3472189237327 SHA512 9f5d68ba62aee909023542dcece81e4e448ea750254258107d4f70291d8ae99469c4518e42ffddbe6b622b258f463127be6e6ef7eaaeeeb0f59b3b719f3eadca WHIRLPOOL a5d76b577615de7a472f591bc031552f7b3e4dec7fb58385709235d763d416f47c2fa8ff4c73531ad023ee50dfd25b1e0c1752dbdca4ae19f736cc79428d63bd
+DIST gcc-4.7.4-piepatches-v0.5.5.tar.bz2 15358 SHA256 6b568bd204e3ffb177df1830e5a888be3987491b4183bdb6ad75ad83c642a348 SHA512 f5e078bf4c17f7b5be102f1e3358d91c72e80363b5e055a92461f78399a1bf27bf6cb690d41900719bb260b6529f5d1aac999e613fda6ac5e4efa27f622510e6 WHIRLPOOL 42e348d5925cf4d43697a6dc06c911cc617f89037949ce1d8f7aa0fa93405f460e7416d6cd00e8fb2aac54c6f26fcae00691917f1517fcfb6891925efa3d3400
+DIST gcc-4.7.4-uclibc-patches-1.0.tar.bz2 3019 SHA256 cbdfe2947f653e11ac391dded461416e5cef1ff8900cf8fe92672de797b4018b SHA512 c2e6c96b74365f8233f6106fa03d94075b60f6f77c683aa2e27aceb007da723243f8e3ddea8b178e6a0f7939b8e35615165534dc74e5050f87680ab261a31c52 WHIRLPOOL 53c8bd64336eb55d8e3d62a33267d3d99c0239d5c818985a9830fd776d766aabf4b0bce630949c5b522580566e2eeba1b59bfc1b8388dee7ec6c990512d2c499
+DIST gcc-4.7.4.tar.bz2 82935453 SHA256 92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282 SHA512 dfcb737073191e628231031a3571ec77ee760a59377630f4a6e4fdfa66f9ddad39fde47e3f0f227eb43cdf90e0d34cde5abdc9ac892c1e111a911062a66c9189 WHIRLPOOL df8408e80634ce28f105f9abcdcf38fba5c130795cbe48428527a68819abebc3bc7152bb6ad714e40c71450a08986b48ddd630c887e1b2faf07c3babfe720969
+DIST gcc-4.8.5-patches-1.3.tar.bz2 26025 SHA256 4a165e6a387421f581f49c742243bf013c9fb7c91f44514be7b38292178ebbb4 SHA512 8d190f81ca0d25281250dbf0a670fcf12334b0811a5bf664e6450942a2996d02b979c6e8f8760b287edad06df3d1f8e2fe5cb0c3dcf9677c3420457d841d9506 WHIRLPOOL d31b3f48e13e5a9292b704afc745cbea038e61eedc4dba0d659558b56feeafec118043f3430457f71dc938760d72860e4318b2238b3bee9fba069c740327b78a
+DIST gcc-4.8.5-piepatches-v0.6.2.tar.bz2 14265 SHA256 3a823af1b4c590076b95790614d49448dc0ee6ff0ace221f2dacd9033b58eac7 SHA512 cd6af4047d4719dae9dbe86ce5342c7d8ddec38aad032486713b08e1b0cb711f5ca017e08d583137d51b8d4ef673366ba310e71bca7b49b82e9314781d6e9d99 WHIRLPOOL ca1d0a9cb9abdfddd95d433b2f0424fd7cc9d514cf4c91fb266af4c43e26e0b3084adfae0eb5c998dbee83551e916dba3cf438b338f7e4ac1a133f06018e398d
+DIST gcc-4.8.5-uclibc-patches-1.0.tar.bz2 2976 SHA256 3654cc2bb47173b9d40650374c465a0798faab53be5ee4446389af1acd610a27 SHA512 5469128eab06525915c75241797ad9ec4b63072ebfd5e110319bf810633cf3fbed39bbda4f6a0c74e537b248e7642780ecbe2086ad10be6e66b7dd289fa6534f WHIRLPOOL d5e11a7d83d11455d84deaa464b8cde0865c730cc140daa5d7b0e700a79f188c6efba88b1c5704b20ede2dca701fb88cf581bada2f4352fbd0e0a5571c436612
+DIST gcc-4.8.5.tar.bz2 86165587 SHA256 22fb1e7e0f68a63cee631d85b20461d1ea6bda162f03096350e38c8d427ecf23 SHA512 47fdfeca0c0a624cdec9c4ae47137d056c918d5c386d4b96985bb3c8172aba377cb66cbcc30e80832fd244a7d98f562c20198056915c70cfef0977545073a8ea WHIRLPOOL 026253cd2f3706871dfe2525c0302b38b3f513f6a62666d0ba0ca2e62d6513f09ad5c1177f2a63ae3bad660fe60e7909b6930d26df2b367b9ec68e14552c6e11
+DIST gcc-4.9.4-patches-1.0.tar.bz2 22266 SHA256 1a394abb77c75e2212896ad3a62ae1f6bfd3660b1c176c608298733c740a00e4 SHA512 cc2407221f858bad38b57d31f635314f91794293695e23d255685d8bec20b9db19c7dc76bbf5e8184c2ba0ccb530958b09bae4d8a402ca27cadf463f46bfb995 WHIRLPOOL c74e5273c718020b591911d589d8eff5e366c902c479e566f966577efcbf424b19669a54843b2ddd60c51c81fd2851bc86aec1c647482b4789a518f01dd62561
+DIST gcc-4.9.4-patches-1.1.tar.bz2 21544 SHA256 9cf94727f98055f03e7ea240529f07a785fdab9dd353dd029113c53be75d9e5d SHA512 37ee209e03db97237e853ce33937c8f085ddcfcb44223d9299d493d0f3c2b275cb6048c5268a693a738fe6e2aa01435741809d8c45385b4917b41b6604e8e8b0 WHIRLPOOL 212cdb217c29469679f834a534b8b4ef80724c5515d12ebe32c2777e3840ed26a7dde3e88575a6815b45a537937e82973856170fd0e2274edf5da4e98c2ae8c2
+DIST gcc-4.9.4-piepatches-v0.6.4.tar.bz2 14414 SHA256 c67b56f04c653e6a19e36abed8391f8b6bed426bfcfc907237cc37f02dbb5015 SHA512 243fa272ea0e49f700a76508bab3e03bbb353bcb930581b2f87f9a47df5cd3880e29f20b71612b21190adc463849e1e6ac2a38a49c0002b562d93d436f538285 WHIRLPOOL 1e5959441210af6f690398efab96444ab11d136238a9428912e8441eaf0509fe6db359a8aca92a446fce0c75777385475af73b20165a8593f9969e3a25fd0b0f
+DIST gcc-4.9.4-uclibc-patches-1.0.tar.bz2 2618 SHA256 95f290d0b68114d835515afc424d6096476a45665671784aa71a7a506296e465 SHA512 5a1f44caa9261f4947101379628143869b31dec67fa28605e8e1f3894d4b7120c3f68ba6deb59da7a74fa906e27ab32cd3767761837dc3dfebc37865d349d6db WHIRLPOOL e46b08737cfdc235bfb80117e0389f3969167adf59bcba2a0a1094a20eab2b62f0c952dac44781e43957cb1507cd4e80f37bd8aecbc55dbda6382d93b3a4cf94
+DIST gcc-4.9.4.tar.bz2 90097606 SHA256 6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092 SHA512 93abb78e16277454f41a8e9810f41f66c0fdffdc539a762ff6b67d3037f78db971378683fd2ebf707d1d51c059fad2161fe42d110c330027f40214b7db0f3efe WHIRLPOOL e20045126c21a3edea1fa4a2185ec2bc5feec77ddf967ab9d1e8c33322ad4eafe013bfcaab1ed4e35971d3b70ef373ea3585ebb089c9bbf91bbfca1f1da71236
+DIST gcc-5.4.0-patches-1.0.tar.bz2 28227 SHA256 ff600369f150129754108322338c3f4f0064d222843a2d82778537f94a22ecbb SHA512 70cd83b142abaa3c22d67d5d58185da2cfa178737ec963e230cc03ea8dc6dc757665c711fae91af4cd91062d3136c6f31a5ee3c4c7440ed9485c6f3632731940 WHIRLPOOL 84a69d2dde582fd486f6c60f78ce9f8c7cc5b480c2989cc1804617eb6526a4a17d20d2ed010bd9fc78019d69caa665428970234090b21f9d4b97217011d4fcd6
+DIST gcc-5.4.0-patches-1.4.tar.bz2 28425 SHA256 039b88a939c3b90777fb94c58980cbcfffcdca4365db044dae0677302a4365d1 SHA512 c4922cf0f83cd3b6ed9c50ffb39847a03beb95031865d36d86ae48fdd912c0bd6842ad71a3b0d18a91786ed58e2e529630c6ccd2a0414a48892415051c70246e WHIRLPOOL 6d0a73cfb4ea387811bcd81b2de98a11e2f656a4df7ee5a887cd15d0a744662d85b22fcff86a6953f7c6bcc6d822333528de91b793191e72fe5ff2354deb7a97
+DIST gcc-5.4.0-piepatches-v0.6.5.tar.bz2 14551 SHA256 495eb9110244dac17408cd0eb6977a593577eeb0437e72b60339b8ec394f2fb0 SHA512 4890f0713d261982ab81a20f93c5f65193aa1dfa171e3f9e5867f0b80ec7c1e76c5a997b1a4e6f47f8ce36af54ac91125c5bff8bf6d971b7d77c65a57a40a3c0 WHIRLPOOL 13b74b1ca75cc94f9624fe1b52221a953962c918c2cb932302a3078b6deba4f3e501647ad8a2915edef6301e64c820ed612a6fbb9e1178cf1711fe0045686969
+DIST gcc-5.4.0-uclibc-patches-1.0.tar.bz2 3731 SHA256 a3145faa6c81c0753ba754b735834c38987c356dadaa7c4a625c738e374604b5 SHA512 009f34197e79c5e8c6497a0db01ac45cc657e92e56a663b4f3281661d108b2a129cd977fab5f0064f225d6812ae91e82bab22a2b10ae02c486881eeed85ec7a3 WHIRLPOOL a3598ce0aad7e9110db156005190739abc5b4ceea3c327cb9c747c4cf1b99589c1a9fac170aea346eae030b09ee563f9f990e031ad7dfa1aa19b895898bf2608
+DIST gcc-5.4.0.tar.bz2 95661481 SHA256 608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a SHA512 2941cc950c8f2409a314df497631f9b0266211aa74746c1839c46e04f1c7c299afe2528d1ef16ea39def408a644ba48f97519ec7a7dd37d260c3e9423514265b WHIRLPOOL ec81c8143e48bc8d9d0bbdc0fa3ca553c805193f53ac46c86127b54565894780dd97281485e396a130567464c753f043458c8e450018c957813f50ff90a40708
+DIST gcc-6.3.0-patches-1.0.tar.bz2 7596 SHA256 6c880468ffa4ad2b324fd18c762dbdf10646089c8ab865c228e166f99a0e049c SHA512 8fc96086bd3da3726687ee9d180d3b5d0a7d5814141d44eac8eb01566a783ec780c8fb8f55f75d6e9c9006b2e407e20cdb5835d541b0b66a47dd60642861734c WHIRLPOOL b1bce94d6134db6c9aff4298c6c7af003e39d0411aa40cd027d2c7d6a256971c81fb557e85b25f1107e9a474cb7d772c3bc62a7a4ab7ff7fca5eeae5b2ca0c94
+DIST gcc-6.3.0.tar.bz2 99903185 SHA256 f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f SHA512 234dd9b1bdc9a9c6e352216a7ef4ccadc6c07f156006a59759c5e0e6a69f0abcdc14630eff11e3826dd6ba5933a8faa43043f3d1d62df6bd5ab1e82862f9bf78 WHIRLPOOL e79a2d6ad199396b6efd835c1129d049a367174ea33dd3b6247d72461f117c2dd81e5a66f3dd6427ce500e768d3a4453efd0debcb56966d00c7df79d05d54b7d
+DIST gcc-6.4.0-patches-1.0.tar.bz2 7577 SHA256 9c9b68c28e67be281c9bcec5d944b2a3439bab953dce08fd35a65b10f9dae3cd SHA512 e649e334eec4deb7c261d808ed460413d78a2a4a672823d214c1e173a13bc314ce898fbf3674a7c7fe3151a089384ee0a7dee479bc8d005a06b65b39216bdf75 WHIRLPOOL d7d9a80038fb939c26605d91eda9bc23070179bdf6ce597255c44f9d83f2603aae91d9890d2a445bce8c682708743021485f1415cea0b9b8f02dd9d982e36d3b
+DIST gcc-6.4.0.tar.xz 76156220 SHA256 850bf21eafdfe5cd5f6827148184c08c4a0852a37ccf36ce69855334d2c914d4 SHA512 02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90 WHIRLPOOL 136b282c6957877d2f463d83740fa65a4e7a346ac94e4baabea25cec41ae307f34409b1e518a22927821d564b8634a48978dc8e1d0b988999e924adcbf3f5cc9
+DIST gcc-7.1.0-patches-1.1.tar.bz2 6746 SHA256 39d4a0c659cc361bd3c71fdc9b793bccfa2bce06ede65ac49b805d1e236fcc8e SHA512 1bf95a505dc6c37bf6924bb69fd0670c8f3355b6690c94edf4a4248649accbd426575b40cb7a473dfb0ae09a924b05619e5c633384bae0293edb670cfd0d3a30 WHIRLPOOL 9682649fff62b56683637d25a58d11928342d99e52b2269f42369fd1d691208a7645802cb0d609ac30e20593ecdceb8cb1ab9b216963afe14db1b17ed43d5eb7
+DIST gcc-7.1.0.tar.bz2 84303533 SHA256 8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17 SHA512 b5d952be9a10f0e0926bb2868877d10544039d6d2f35ba0a08f51231dd622a007650764a03e173194701467547789ad7d2d9cbc10adcdf118d619cdedbd14aec WHIRLPOOL 1dce5f89d4110bacd7f65140a1dee7b1a4898682e2ae8621832bda6f101354d226743acf77974b5e97d861c6eb6c47637138987dfb6ba222ad81b751e80ff6e6
+DIST gcc-7.2.0.tar.xz 62312628 SHA256 1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a SHA512 f853cd6530b4055d8d8289da74687cb4c6d5f363598d386332d31852b581bac76c3adb7d61889edec3b779f63d8646f0122840f12965ce4a4389ba535dbbb6e1 WHIRLPOOL 9503fb08731d94b5d79b182579f41992e9db16dba8a034cbfa8a2703a975185859e79c1e3f6094d14d08c7f5d7135c2ca5ffd8d6f7ae7820c20d4076fe5e9f65
+DIST gdc-0.24-src.tar.bz2 1012099 SHA256 cc6a97c76c9e6db31e76ff97014d24b3d43e21f018a3c6218e3fb2a4500fc79a SHA512 9aec7e4b102e602dfb61cd09ea4b4a96af637ceb3d726235261d09ebd35dbd416abcbfe0e46918e48474bd241fe9bb29abc145a65aa834669295aaee4fca0686 WHIRLPOOL 22322b0c3e2d67b3b37bd7fa92a29c593688f934d4ffd62b9cc87eb63a44a4f8bbc9d75cadf11209c73bdc9942c9b4430036629d0eefcd04de9055c502b85f12
+EBUILD gcc-2.95.3-r10.ebuild 752 SHA256 8d9196b3fc56a9e77030990c66eec2e30b8b91139467763335e2349372068c19 SHA512 88e3a89474f1b46077b74a7c9931cdb7275bedc72d2be4ebb0272f45ae7a64b533fc80263275839a6c67fd2ce5cfde6580d28b613a37608db26b3c62590dbd82 WHIRLPOOL 49aff012c4c5c924b481e03f30e57d74dd3d74639939a00551d81c81e15b3f6873636a656c773f8729db3f3eeab3540871babd8e6662976454205484f2405937
+EBUILD gcc-3.3.6-r1.ebuild 1249 SHA256 9a65400f7629ca6f5ab1febe9aabe9c191e295676c3e6342912e7cf1cbd7ddb9 SHA512 a18cabe5c02f3ba85b28292ce6fd0e3973ef15f5ffa847fc67d57ed2d04d96e1a6910f36a9ec08a4833eac3e247df5a7893bfc19ca6354233352d38651809092 WHIRLPOOL 192d37cfa7aa5409e1acf7221ac00c7701264ed73b4d9c2a6d90b7411ffd64ecb5801022ff851a396c0139d380f1ad9e3baa624050f604f0f45e22f7c96cec72
+EBUILD gcc-3.4.6-r2.ebuild 1374 SHA256 2e5a3e1e0eb19784c02369ec8a6163c306af196943529bf79f99941b5d1f36e3 SHA512 5c31bf85dab53b0670ca7606c29e5fcdc9cdade9596b02320d95e2ab215952de4dc2f4fc4ce17bf4826c26bb76e820135a9317198753cb071b3ff7e39f1069ad WHIRLPOOL a3438af25a2abba897f7095a53c6255bdf915b078500e96bf618940a17696401878ba056c7f57ef953f1f32a78a536807fec34e6ad931e4b58e3ef2a7b89d3ab
+EBUILD gcc-4.0.4.ebuild 247 SHA256 67038002feaa027f0f55bd29dee9633eac3300bf3b315f1e711ee559fcd56222 SHA512 6f988f06da4516223bc9862eaf9bd082f26713a8aba4564d809d9daba6ffffd97e623804982062f421e733434b95ef02c76b230e0cc2322eeccaef616b6e98d1 WHIRLPOOL ff5d4d9602096cf291b617fc9034accac66237cbf1cf9e400d4cb18727cad687b238423b8e632f157095e21ab9222fadfb832408ea69580b05d728599da89668
+EBUILD gcc-4.1.2.ebuild 661 SHA256 add68006513b97cef5ade66a301b4300787cf7db00a1587f23155f61b4c572eb SHA512 370ca5af2b116c464b0a949f643b5152b543e04a4ce7b793b8059ea6c74768ad8d8d8441de600d98b81e7cd4b8f2407152c09a532b3f96cd224e4473f2865757 WHIRLPOOL a04277f514712c3d4eb5f9db73c1cfddb1021321cf92cd4c6d65af689dc1072729e97b494dd2c4819f3898d38ce515b266a1829fae82ad9545d89223fcbd734b
+EBUILD gcc-4.2.4-r1.ebuild 406 SHA256 79e44e66bfc21bd437640b031e361e9b66b20cca51003553f8fec935a2a41d8d SHA512 2df1a4a124f89a7f3112e6966b0fa8fd3d25e1d9567b064c3327d5e6496ea012e032342ce48ce25d6cdc0168c182981210b546b5dc6f0ea814b46661dc70dd7e WHIRLPOOL 578fbc4d23bde3a3e8ea9ba6963e040388a392171c0c97c0424fae3aaf0ba83189ec74be2de9411ad621ff941a236be3d528d144d49f69b1df0b94357f38c2f4
+EBUILD gcc-4.3.6-r1.ebuild 630 SHA256 6e688977cde0c4e4b351c4383e4ee20319879a62f0e85ccea86d63e10672aa93 SHA512 d381b460bd995fa8e5f8ee7464f04030510f21d569ab539a0bb6afbe2f5f4266af25ea8df052004bfb56155fd3f6cdb82fed7431c36da0f658549a26449d1e55 WHIRLPOOL 6646b25af49d42ffd6e345982e495d4cac3f2012e3b982c6e5b073635f6621a20e4f4fa669f69b69801ab6ca4987fd056b47c1888a0c4e20fc3d2d400fdb39de
+EBUILD gcc-4.4.7.ebuild 674 SHA256 a32abd414f64b8354e8951b3514b0467d36f661131382ce5ccb5e3a2bafe17da SHA512 72e2eb8e125e1dd8ff095a989a739978562e77432a949839eb012bf915af4e989c79759230583b80580d25b2659cee937359f05f96cd7dbe5084d4f7bd3f96d5 WHIRLPOOL 4b225c10a8a519e85e2b0b4a169455562c794ae906949d52ca2c3278e287edb041eb9c45e5dfaf7ec3bc29dbfbe1bd8f859f44d7659bce33d33e5e62a9b99cea
+EBUILD gcc-4.5.4.ebuild 687 SHA256 fa26996cdec3b8155e1ecd7329c6dd1e2f2094befba109675189abff8c1a7849 SHA512 2f4ac3fdea111450adbbde5b3021b97db273baa1d2ae9188ab95baa772a696843c2685ce51adb8dc408ebf0924670eaf7b17c42bf1f798bb23d3037ff951e456 WHIRLPOOL f2a43e7207b69a2262d67877565559f5a464ae1060b94189cf668bf80c5bf19050ebbf4fb46d9ada3923130a1064b7b65387da07a9ff9fc630a2755fa4d21764
+EBUILD gcc-4.6.4.ebuild 768 SHA256 56a6a8c5a255751a41c2efbeba9b7f9fb144b68a257f0a7f136a769a840b5e00 SHA512 a9d6fab6be0914a0ece96f42da9e2c84ef9d64cb480d9374b01ea16679c65129b49e9439a17d2c898d1e1bd33b7c03513df5b7172e91e3e682d6c475e9972fd5 WHIRLPOOL 58e87d6d2f94e054163cd69acefe5727c17f2c04fcd47bb135fd6b62700270504f9969f2ed6ff574fc28e5ce0efda3b385d0bee9e8260dc1aa3e0401dec74752
+EBUILD gcc-4.7.4.ebuild 1291 SHA256 499c89b374e2fa9f4b205151cbf0e97f34d3d0d60577e2a1c685cedff7cd519e SHA512 ad60bbe91d92bde8b42c9c10d10d2ff9c36677b60da6447c4fde3205bd3e2bbdb3194c52b6e51e740a9af93b0d05dd8446f8f0fadbe6f8dbc9fadaee8dd5dfeb WHIRLPOOL ead07b80aea133bcace26288fd4ef1b656469caa8d23d6e0171bf994bb175d4709647a7eda380de3f1070760bdeaba5411e96e52ee4cf5b3cce17a3da7633b01
+EBUILD gcc-4.8.5.ebuild 1401 SHA256 222441bfaa3d89c48ca2ee4f61b9025b1a598a0de38f1a88707e7696ea9ff350 SHA512 d0a47534b4e2e35ad3296c87887307f3446421f4cdcb2d2aa9c3a3b5570af6c1597101e61a486994135577f1f693bb4db4ef91ec639ee6f274b843600029667c WHIRLPOOL b9efe4b12eff49c823d9056f9615670a42a759ce6ee44f0134c0d5d95de6c128682e118dcbdd242cb4434819eb48f312e5794966957d3c7a271595ae6ffe17df
+EBUILD gcc-4.9.4-r1.ebuild 1403 SHA256 8a245c1a153d11344b969988fe1d7ee60509214d0c503c24a44ca7cb5879885e SHA512 ed12b3bceb48d3ffbaabf78b1a8105fd12a8befcbdf7f53cac29d5b649b6634b8075e346ab0a8f57334612df3e9c9a16f02a2c5d73576bc7e1d77e3012e491f0 WHIRLPOOL 2815a24735cd7ce4b11c6f78af64b0f279fd3575d43bc64d9e8bc0aa87796dd51b1d6c592ce7931412839d47f43a19b7befbbf84219751c8559ff2c6f03af1ff
+EBUILD gcc-4.9.4.ebuild 1401 SHA256 e0e1fb3649a316acc5d923f574eff78cf0ce845150b7f6f909a8b88b05b9caf6 SHA512 7ab54058e656517bb9f35e52d71e46a30014efac3cbe338bc711d747dfd1eac863cc663f5ee750acbbaebafd43ac2a7eccaab45b59a622e349c7b23dd3f68ef8 WHIRLPOOL 25c1a602b93ee0baac613687dadc788a62caff176d8639be84deb3ec60e50ee937fccd6a4ae500a5ca30fd38ba67010988644e8c75be0b61f971f7ba1c1f3e13
+EBUILD gcc-5.4.0-r3.ebuild 1278 SHA256 4af47de7247fb1026c534c74343a89c8c3b1278ddfdbafb0b638782c3c6902c1 SHA512 8d12478fb764b7344e06e51a1d9ef805d9f0dcd39e372d328d30d915a1c85ea782270a17a2e9661c2ad6774783e3e0562345c6898339f0be3bd9aeaf8647b671 WHIRLPOOL e079881f85097da452290e5b4bdeb768c540c5b92885dea7d24b2f498480586e9ce8e21e67e909fbb85df134ffd2369472029ea2d5f81bfd1af68c6c808a7bbc
+EBUILD gcc-5.4.0.ebuild 1288 SHA256 cb4fa063c2289f850664f69d8f5d43806a462f6d2fa3b05eb2ef4f9d80d3c4ad SHA512 ab1e20e5bf90e89fe77cc5b764483913fd5add047ea02a8e8f12466733b1753820551ffd9332a89e1004a97ca40ef534b37464dd67f4f501480c4be9e0e730f2 WHIRLPOOL 2d6f3131b5ae5f9df712337e8cd7331cc33038be97be6cfb13eb5c526771044bb8c6c07462f183e97816a2da7759911dd221c518c53438fc9a915d49b4b20c9c
+EBUILD gcc-6.3.0.ebuild 536 SHA256 5af5aa7557154763ce558bfbc14e282d87a850583f82ad2ca5d482e51c3e279b SHA512 a01f1d52b881a6e87124a3de3cd062562ba4a561f54d3ec3f68d0732958f9c7d12df38bbe18b98bd4c77e005410f2065146dae83d2ff76018c381935f9b932f1 WHIRLPOOL 5c7cc0f33710a4ccdecd00213c40d10ecde1423fc03c8740aa0ca0f06ae83431ba81ee8e1da3e8f61dc3df3b892db9a7e02e5853d19670d2bf1a273ab9649c58
+EBUILD gcc-6.4.0.ebuild 536 SHA256 a986108b392d395ad7221265268b90429ac83a5372a299649889653583bda2e7 SHA512 65bfc8ec638ea5aeb02ea965e6d56ac86c14c09bdb32262ee7662564a13ddef52eb69a879f95ac53497b6164dd48885aefe8bfd77a793456b766016de985d6b6 WHIRLPOOL 7d06f130d074abee9a87c785f583812ae73db8a707ff0f82b2d3876e9e0f44c4fd2f7d80818b265eaecf9a464a4f8ca66a0555cfbdac800c1e1eccecdd64cd23
+EBUILD gcc-7.1.0-r1.ebuild 431 SHA256 2d02cb39924f325eacb9a7e3eed1f83f8d605720ea184f38dec214fffb045d1b SHA512 d7081aeafa29f5dd89cfeab4f596bc639c4e383d9c2e4d5a4e5ebcee7849fc0d3b3aa5f32d48f445d876efcea4f0751eca780d22482958c8670fff6a38e172fc WHIRLPOOL 3ffbb4975beb5f9a9251ebf7063211c399e194de474b5ea0cf38cfa2c173b612f69cfebf597165afb7a620133b16b275223ba5a9af6b531790d24448b04b851c
+EBUILD gcc-7.2.0.ebuild 453 SHA256 e738480b135ab3c4552370f47524dea701e39bbe4979fd001e2c8ef5c4e5c294 SHA512 9103d3b9ccb0366247bf1bfae187ae1170c5df2513c1008cfcdfd30880f0e71f0c4ed53f843ef630332378e22a66126042ae58d4d3a71c3aaa731a8aad446520 WHIRLPOOL 537c89fb244d6b12da043ec5ad57f45d95474d16c6bdee47a2dadd44b37f79f3d4c34dae6276f85d1d0349f5cc1f5159372cc3c157cf680301cfb8613d27f406
+MISC ChangeLog 12968 SHA256 a5bfaa87cea2ee1db7c9d2063bafd106abd89290d47c32cacebac76ce42aeead SHA512 67579e419cc3740201dea77ef46dd2dfc9c7109b9c44a220f36093a18f03f338d91496fd02a55715c66ca9dbc24b3125d866f2dc97226ca611356cb25b22c8be WHIRLPOOL 9b58f80d70b5971697f2d7dde838d25d8e24f4920abc55b3b1765adc42937b13059e52fb5233eedf19d47b4ab66671c0adae7b81f4e3dd0e3292ca87d4e4f14a
+MISC ChangeLog-2006 112483 SHA256 108a7803efc91b08dd27ca4a83468637222a0685760f63bce724cb486fbc4022 SHA512 2887a66d03f4e1a9c60c743d7aa22147bdd95900b9e759c760a63f1a60c90008585b10b4f46ecc26e0149427bbdb8b83a9de4546d75e9ad935dd8e5377bf8870 WHIRLPOOL a2e1df0a7cead4373b5aeda333d952407049e1945f0a4e7774e1249e9f08ee33faafe0e74adec28b641bf037b8d6a350f45760a25c15e769b23eadb84b7ea48e
+MISC ChangeLog-2015 73367 SHA256 77c0651f80b2d52ca970b933945e41414e84feb5db7559abac0eb9b69278e408 SHA512 c0de93d6277b780731761642beb78c89117ec59874277c2869419c6f9f99ca8c411a22d414d8c0a6e34ced845c359192bb6a57788ac777021985e9e1732d9cf6 WHIRLPOOL c9a060d46c14f2791d5369b20a53fa5a3f318670e0d56b0f8e4e16a971bc6ac15f56bcbf3970f2fc2f56eab52788e595bdd0658e6bdc0ad9d1b6376456f35cbe
+MISC metadata.xml 2520 SHA256 d7a51018dfc5a0f58f7d1c27dd6d17e9d3986f2bd3cc806df76426c6c9c449e7 SHA512 ffb6644c39848805fdc8571747be210a3057a6189e9007c6a0371d5448fc37d45615d4293fff0ddcf599c6369146b5a54bbbb091d250548a486456ed89806128 WHIRLPOOL 58d9ecaec6d4a8dd91aeb84ba7ef8623b5d58f76293d56c6858f64d04799bcefff6ef3d15d9c3d94b861572a873122260ebfe2a33a4c9b546ebbb0d9189f104a
diff --git a/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch b/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch
new file mode 100644
index 000000000000..507d42f00e90
--- /dev/null
+++ b/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch
@@ -0,0 +1,22 @@
+--- configure.in.old 2004-06-26 07:01:06.000000000 +0200
++++ configure.in 2004-06-26 07:02:55.000000000 +0200
+@@ -52,8 +52,7 @@
+ host_tools="texinfo byacc flex bison binutils ld gas gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator libtool gettext zip fastjar"
+
+ # libgcj represents the runtime libraries only used by gcj.
+-libgcj="target-libffi \
+- target-boehm-gc \
++libgcj="target-boehm-gc \
+ target-zlib \
+ target-qthreads \
+ target-libjava"
+@@ -66,7 +65,8 @@
+ target-newlib \
+ ${libstdcxx_version} \
+ target-libf2c \
+- ${libgcj}
++ ${libgcj} \
++ target-libffi \
+ target-libobjc"
+
+ # these tools are built using the target libs, and are intended to run only
diff --git a/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch b/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch
new file mode 100644
index 000000000000..b5195e4e9112
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch
@@ -0,0 +1,40 @@
+diff -ur gcc-3.4.3/libffi/Makefile.in gcc-3.4.3-ffi-fixes/libffi/Makefile.in
+--- gcc-3.4.3/libffi/Makefile.in 2003-11-22 08:41:32.000000000 -0500
++++ gcc-3.4.3-ffi-fixes/libffi/Makefile.in 2004-11-28 17:31:50.000000000 -0500
+@@ -89,7 +89,7 @@
+ libffi_basedir = @libffi_basedir@
+ tool_include_dir = @tool_include_dir@
+ toolexecdir = @toolexecdir@
+-toolexeclibdir = @toolexeclibdir@
++toolexeclibdir = @toolexeclibdir@/@gcc_version@
+
+ AUTOMAKE_OPTIONS = cygnus
+
+diff -ur gcc-3.4.3/libffi/configure gcc-3.4.3-ffi-fixes/libffi/configure
+--- gcc-3.4.3/libffi/configure 2004-05-18 05:08:39.000000000 -0400
++++ gcc-3.4.3-ffi-fixes/libffi/configure 2004-11-28 17:48:19.000000000 -0500
+@@ -3800,8 +3800,8 @@
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+- toolexeclibdir='$(libdir)'
++ toolexecdir='$(libdir)/gcc/$(target_alias)'
++ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc-version)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
+diff -ur gcc-3.4.3/libffi/configure.in gcc-3.4.3-ffi-fixes/libffi/configure.in
+--- gcc-3.4.3/libffi/configure.in 2004-04-27 01:10:19.000000000 -0400
++++ gcc-3.4.3-ffi-fixes/libffi/configure.in 2004-11-28 17:40:30.000000000 -0500
+@@ -225,8 +225,8 @@
+ toolexecdir='$(exec_prefix)/$(target_alias)'
+ toolexeclibdir='$(toolexecdir)/lib'
+ else
+- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
+- toolexeclibdir='$(libdir)'
++ toolexecdir='$(libdir)/gcc/$(target_alias)'
++ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc_version)'
+ fi
+ multi_os_directory=`$CC -print-multi-os-directory`
+ case $multi_os_directory in
diff --git a/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch b/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch
new file mode 100644
index 000000000000..b270a06ad80d
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch
@@ -0,0 +1,40 @@
+--- configure.in.orig 2004-08-03 00:53:36.000000000 +0200
++++ configure.in 2004-08-03 00:52:35.000000000 +0200
+@@ -136,8 +136,7 @@
+ host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
+
+ # libgcj represents the runtime libraries only used by gcj.
+-libgcj="target-libffi \
+- target-boehm-gc \
++libgcj="target-boehm-gc \
+ target-zlib \
+ target-qthreads \
+ target-libjava"
+@@ -150,6 +150,7 @@
+ target-libstdc++-v3 \
+ target-libf2c \
+ ${libgcj} \
++ target-libffi \
+ target-libobjc"
+
+ # these tools are built using the target libraries, and are intended to
+--- configure~ 2004-08-28 02:31:04.000000000 +0200
++++ configure 2004-08-28 10:55:28.000000000 +0200
+@@ -876,8 +876,7 @@
+ host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
+
+ # libgcj represents the runtime libraries only used by gcj.
+-libgcj="target-libffi \
+- target-boehm-gc \
++libgcj="target-boehm-gc \
+ target-zlib \
+ target-qthreads \
+ target-libjava"
+@@ -891,6 +890,7 @@
+ target-libstdc++-v3 \
+ target-libf2c \
+ ${libgcj} \
++ target-libffi \
+ target-libobjc"
+
+ # these tools are built using the target libraries, and are intended to
diff --git a/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch
new file mode 100644
index 000000000000..03895434d9ba
--- /dev/null
+++ b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch
@@ -0,0 +1,63 @@
+Some notes on the 'bootstrap with or without libc headers' debate:
+http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
+http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
+
+--- gcc/config/sh/linux.h
++++ gcc/config/sh/linux.h
+@@ -145,6 +145,7 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #ifdef IN_LIBGCC2
+ #include <signal.h>
+ #include <sys/ucontext.h>
+@@ -295,6 +296,7 @@
+
+ #endif /* defined (__SH5__) */
+ #endif /* IN_LIBGCC2 */
++#endif /* inhibit_libc */
+
+ /* For SH3 and SH4, we use a slot of the unwind frame which correspond
+ to a fake register number 16 as a placeholder for the return address
+--- gcc/config/i386/linux.h
++++ gcc/config/i386/linux.h
+@@ -208,6 +208,7 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #ifdef IN_LIBGCC2
+ /* There's no sys/ucontext.h for some (all?) libc1, so no
+ signal-turned-exceptions for them. There's also no configure-run for
+@@ -272,3 +273,4 @@
+ } while (0)
+ #endif /* not USE_GNULIBC_1 */
+ #endif /* IN_LIBGCC2 */
++#endif /* inhibit_libc */
+--- gcc/config/alpha/linux.h
++++ gcc/config/alpha/linux.h
+@@ -73,6 +73,7 @@
+ /* Do code reading to identify a signal frame, and set the frame
+ state data appropriately. See unwind-dw2.c for the structs. */
+
++#ifndef inhibit_libc
+ #ifdef IN_LIBGCC2
+ #include <signal.h>
+ #include <sys/ucontext.h>
+@@ -122,3 +123,4 @@
+ (FS)->retaddr_column = 64; \
+ goto SUCCESS; \
+ } while (0)
++#endif /* inhibit_libc */
+--- gcc/config.gcc
++++ gcc/config.gcc
+@@ -321,7 +321,7 @@
+ need_64bit_hwint=yes
+ ;;
+ # Note the 'l'; we need to be able to match e.g. "shle" or "shl".
+-sh[123456789l]*-*-*)
++sh[123456789lbe]*-*-*)
+ cpu_type=sh
+ need_64bit_hwint=yes
+ ;;
diff --git a/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch
new file mode 100644
index 000000000000..523caa48a3c8
--- /dev/null
+++ b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch
@@ -0,0 +1,40 @@
+Some notes on the 'bootstrap with or without libc headers' debate:
+http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
+http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
+
+--- gcc/unwind-dw2.c
++++ gcc/unwind-dw2.c
+@@ -253,9 +253,11 @@
+ }
+ #endif
+
++#ifndef inhibit_libc
+ #ifdef MD_UNWIND_SUPPORT
+ #include MD_UNWIND_SUPPORT
+ #endif
++#endif
+
+ /* Extract any interesting information from the CIE for the translation
+ unit F belongs to. Return a pointer to the byte after the augmentation,
+--- gcc/configure
++++ gcc/configure
+@@ -12857,7 +12857,7 @@ then
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+--- gcc/configure.ac
++++ gcc/configure.ac
+@@ -1717,7 +1717,7 @@ then
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
diff --git a/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch
new file mode 100644
index 000000000000..6090d66d132d
--- /dev/null
+++ b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch
@@ -0,0 +1,64 @@
+workaround for lame stack packing on i386 ...
+
+ - build gcc with -Os (crtfastmath.o to be specific)
+ - crtfastmath.o is installed into gcc libdir
+ - run gcc with -ffast-math and get crtfastmath.o linked in
+ - resulting compiled app segfaults due to init code in
+ crtfastmath.o that has mis-aligned structure on stack
+
+http://bugs.gentoo.org/147020
+http://gcc.gnu.org/PR28621
+
+this is supposed to be fixed in current 4.1 branch, but i'm unable to get
+the fix to work so until i can figure out what i'm doing wrong, we'll use
+this workaround for now.
+
+--- gcc-4.1.1/gcc/config/i386/crtfastmath.c
++++ gcc-4.1.1/gcc/config/i386/crtfastmath.c
+@@ -37,6 +37,23 @@
+ #define FXSAVE (1 << 24)
+ #define SSE (1 << 25)
+
++struct
++{
++ unsigned short int cwd;
++ unsigned short int swd;
++ unsigned short int twd;
++ unsigned short int fop;
++ long int fip;
++ long int fcs;
++ long int foo;
++ long int fos;
++ long int mxcsr;
++ long int mxcsr_mask;
++ long int st_space[32];
++ long int xmm_space[32];
++ long int padding[56];
++} __attribute__ ((aligned (16))) fxsave;
++
+ static void __attribute__((constructor))
+ set_fast_math (void)
+ {
+@@ -75,22 +92,6 @@
+ if (edx & FXSAVE)
+ {
+ /* Check if DAZ is available. */
+- struct
+- {
+- unsigned short int cwd;
+- unsigned short int swd;
+- unsigned short int twd;
+- unsigned short int fop;
+- long int fip;
+- long int fcs;
+- long int foo;
+- long int fos;
+- long int mxcsr;
+- long int mxcsr_mask;
+- long int st_space[32];
+- long int xmm_space[32];
+- long int padding[56];
+- } __attribute__ ((aligned (16))) fxsave;
+
+ __builtin_memset (&fxsave, 0, sizeof (fxsave));
+
diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk b/sys-devel/gcc/files/awk/fixlafiles.awk
new file mode 100644
index 000000000000..aa2ecb60266e
--- /dev/null
+++ b/sys-devel/gcc/files/awk/fixlafiles.awk
@@ -0,0 +1,313 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+#
+# Helper functions
+#
+function printn(string) {
+ printf("%s", string)
+}
+function einfo(string) {
+ printf(" \033[32;01m*\033[0m %s\n", string)
+}
+function einfon(string) {
+ printf(" \033[32;01m*\033[0m %s", string)
+}
+function ewarn(string) {
+ printf(" \033[33;01m*\033[0m %s\n", string)
+}
+function ewarnn(string) {
+ printf(" \033[33;01m*\033[0m %s", string)
+}
+function eerror(string) {
+ printf(" \033[31;01m*\033[0m %s\n", string)
+}
+
+#
+# assert(condition, errmsg)
+# assert that a condition is true. Otherwise exit.
+#
+function assert(condition, string) {
+ if (! condition) {
+ printf("%s:%d: assertion failed: %s\n",
+ FILENAME, FNR, string) > "/dev/stderr"
+ _assert_exit = 1
+ exit 1
+ }
+}
+
+#
+# system(command, return)
+# wrapper that normalizes return codes ...
+#
+function dosystem(command, ret) {
+ ret = 0
+ ret = system(command)
+ if (ret == 0)
+ return 1
+ else
+ return 0
+}
+
+BEGIN {
+ #
+ # Get our variables from environment
+ #
+ OLDVER = ENVIRON["OLDVER"]
+ OLDCHOST = ENVIRON["OLDCHOST"]
+
+ if (OLDVER == "") {
+ eerror("Could not get OLDVER!");
+ exit 1
+ }
+
+ # Setup some sane defaults
+ LIBCOUNT = 2
+ HAVE_GCC34 = 0
+ DIRLIST[1] = "/lib"
+ DIRLIST[2] = "/usr/lib"
+
+ #
+ # Walk /etc/ld.so.conf to discover all our library paths
+ #
+ pipe = "cat /etc/ld.so.conf | sort 2>/dev/null"
+ while(((pipe) | getline ldsoconf_data) > 0) {
+ if (ldsoconf_data !~ /^[[:space:]]*#/) {
+ if (ldsoconf_data == "") continue
+
+ # Remove any trailing comments
+ sub(/#.*$/, "", ldsoconf_data)
+ # Remove any trailing spaces
+ sub(/[[:space:]]+$/, "", ldsoconf_data)
+
+ # If there's more than one path per line, split
+ # it up as if they were sep lines
+ split(ldsoconf_data, nodes, /[:,[:space:]]/)
+
+ # Now add the rest from ld.so.conf
+ for (x in nodes) {
+ # wtf does this line do ?
+ sub(/=.*/, "", nodes[x])
+ # Prune trailing /
+ sub(/\/$/, "", nodes[x])
+
+ if (nodes[x] == "") continue
+
+ #
+ # Drop the directory if its a child directory of
+ # one that was already added ...
+ # For example, if we have:
+ # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
+ # We really just want to save /usr/lib /usr/libexec
+ #
+ CHILD = 0
+ for (y in DIRLIST) {
+ if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") {
+ CHILD = 1
+ break
+ }
+ }
+ if (CHILD) continue
+
+ DIRLIST[++LIBCOUNT] = nodes[x]
+ }
+ }
+ }
+ close(pipe)
+
+ #
+ # Get line from gcc's output containing CHOST
+ #
+ pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
+ if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
+ close(pipe)
+
+ # If we fail to get the CHOST, see if we can get the CHOST
+ # portage thinks we are using ...
+ pipe = "/usr/bin/portageq envvar 'CHOST'"
+ assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
+ } else {
+ # Check pre gcc-3.4.x versions
+ CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
+
+ if (CHOST == TMP_CHOST || CHOST == "") {
+ # Check gcc-3.4.x or later
+ CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
+
+ if (CHOST == TMP_CHOST || CHOST == "")
+ CHOST = ""
+ else
+ HAVE_GCC34 = 1
+ }
+ }
+ close(pipe)
+
+ if (CHOST == "") {
+ eerror("Could not get gcc's CHOST!")
+ exit 1
+ }
+
+ if (OLDCHOST != "")
+ if (OLDCHOST == CHOST)
+ OLDCHOST = ""
+
+ GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
+ GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
+
+ if (HAVE_GCC34)
+ GCCLIBPREFIX = GCCLIBPREFIX_NEW
+ else
+ GCCLIBPREFIX = GCCLIBPREFIX_OLD
+
+ GCCLIB = GCCLIBPREFIX CHOST
+
+ if (OLDCHOST != "") {
+ OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
+ OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
+ }
+
+ # Get current gcc's version
+ pipe = "gcc -dumpversion"
+ assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
+ close(pipe)
+
+ if (NEWVER == "") {
+ eerror("Could not get gcc's version!")
+ exit 1
+ }
+
+ # Nothing to do ?
+ if ((OLDVER == NEWVER) && (OLDCHOST == ""))
+ exit 0
+
+ #
+ # Ok, now let's scan for the .la files and actually fix them up
+ #
+ for (x = 1; x <= LIBCOUNT; x++) {
+ # Do nothing if the target dir is gcc's internal library path
+ if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
+ DIRLIST[x] ~ GCCLIBPREFIX_NEW)
+ continue
+
+ einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
+
+ pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
+ while (((pipe) | getline la_files) > 0) {
+
+ # Do nothing if the .la file is located in gcc's internal lib path
+ if (la_files ~ GCCLIBPREFIX_OLD ||
+ la_files ~ GCCLIBPREFIX_NEW)
+ continue
+
+ CHANGED = 0
+ CHOST_CHANGED = 0
+
+ # See if we need to fix the .la file
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
+ GCCLIB, la_data) > 0) ||
+ (gsub(OLDGCCLIB2 "[/[:space:]]+",
+ GCCLIB, la_data) > 0)) {
+ CHANGED = 1
+ CHOST_CHANGED = 1
+ }
+ }
+ if (OLDVER != NEWVER) {
+ if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0) ||
+ (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0))
+ CHANGED = 1
+ }
+ }
+ close(la_files)
+
+ # Do the actual changes in a second loop, as we can then
+ # verify that CHOST_CHANGED among things is correct ...
+ if (CHANGED) {
+ ewarnn(" FIXING: " la_files " ...")
+
+ if (CHANGED)
+ printn("[")
+
+ # Clear the temp file (removing rather than '>foo' is better
+ # out of a security point of view?)
+ dosystem("rm -f " la_files ".new")
+
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", la_data)
+ tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ printn("c")
+ la_data = tmpstr
+ }
+
+ if (CHOST_CHANGED > 0) {
+ # We try to be careful about CHOST changes outside
+ # the gcc library path (meaning we cannot match it
+ # via /GCCLIBPREFIX CHOST/) ...
+
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/CHOST/{bin,lib}'
+ #
+ gsub("-L/usr/" OLDCHOST "/",
+ "-L/usr/" CHOST "/", la_data)
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
+ #
+ la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
+ "\\1/" CHOST "/", "g", la_data)
+ }
+ }
+
+ if (OLDVER != NEWVER) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
+ #
+ tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", la_data)
+ tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
+ #
+ # in cases where we have gcc34
+ tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ printn("v")
+ la_data = tmpstr
+ }
+ }
+
+ print la_data >> (la_files ".new")
+ }
+
+ if (CHANGED)
+ print "]"
+
+ close(la_files)
+ close(la_files ".new")
+
+ assert(dosystem("mv -f " la_files ".new " la_files),
+ "dosystem(\"mv -f " la_files ".new " la_files "\")")
+ }
+ }
+
+ close(pipe)
+ }
+}
+
+# vim:ts=4
diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
new file mode 100644
index 000000000000..d95a3c06e780
--- /dev/null
+++ b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la
@@ -0,0 +1,334 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+#
+# Helper functions
+#
+function printn(string) {
+ printf("%s", string)
+}
+function einfo(string) {
+ printf(" \033[32;01m*\033[0m %s\n", string)
+}
+function einfon(string) {
+ printf(" \033[32;01m*\033[0m %s", string)
+}
+function ewarn(string) {
+ printf(" \033[33;01m*\033[0m %s\n", string)
+}
+function ewarnn(string) {
+ printf(" \033[33;01m*\033[0m %s", string)
+}
+function eerror(string) {
+ printf(" \033[31;01m*\033[0m %s\n", string)
+}
+
+#
+# assert(condition, errmsg)
+# assert that a condition is true. Otherwise exit.
+#
+function assert(condition, string) {
+ if (! condition) {
+ printf("%s:%d: assertion failed: %s\n",
+ FILENAME, FNR, string) > "/dev/stderr"
+ _assert_exit = 1
+ exit 1
+ }
+}
+
+#
+# system(command, return)
+# wrapper that normalizes return codes ...
+#
+function dosystem(command, ret) {
+ ret = 0
+ ret = system(command)
+ if (ret == 0)
+ return 1
+ else
+ return 0
+}
+
+#
+# parse_ld_conf(config_file)
+#
+function parse_ld_conf(conf, pipe, ldsoconf_data, CHILD, y) {
+ pipe = "cd /etc; cat " conf " | sort 2>/dev/null"
+ while(((pipe) | getline ldsoconf_data) > 0) {
+ if (ldsoconf_data ~ /^[[:space:]]*#/)
+ continue
+ if (ldsoconf_data == "")
+ continue
+
+ # Handle the "include" keyword
+ if (ldsoconf_data ~ /^include /) {
+ sub(/^include /, "", ldsoconf_data)
+ parse_ld_conf(ldsoconf_data)
+ continue
+ }
+
+ # Remove any trailing comments
+ sub(/#.*$/, "", ldsoconf_data)
+ # Remove any trailing spaces
+ sub(/[[:space:]]+$/, "", ldsoconf_data)
+ # Eat duplicate slashes
+ sub(/\/\//, "/", ldsoconf_data)
+ # Prune trailing /
+ sub(/\/$/, "", ldsoconf_data)
+
+ #
+ # Drop the directory if its a child directory of
+ # one that was already added ...
+ # For example, if we have:
+ # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
+ # We really just want to save /usr/lib /usr/libexec
+ #
+ CHILD = 0
+ for (y in DIRLIST) {
+ if (ldsoconf_data ~ "^" DIRLIST[y] "(/|$)") {
+ CHILD = 1
+ break
+ }
+ }
+ if (CHILD) continue
+
+ DIRLIST[++LIBCOUNT] = ldsoconf_data
+ }
+ close(pipe)
+}
+
+BEGIN {
+ #
+ # Get our variables from environment
+ #
+ OLDVER = ENVIRON["OLDVER"]
+ OLDCHOST = ENVIRON["OLDCHOST"]
+
+ if (OLDVER == "") {
+ eerror("Could not get OLDVER!");
+ exit 1
+ }
+
+ # Setup some sane defaults
+ LIBCOUNT = 2
+ HAVE_GCC34 = 0
+ DIRLIST[1] = "/lib"
+ DIRLIST[2] = "/usr/lib"
+
+ #
+ # Walk /etc/ld.so.conf to discover all our library paths
+ #
+ parse_ld_conf("/etc/ld.so.conf")
+
+ #
+ # Get line from gcc's output containing CHOST
+ #
+ pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
+ if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
+ close(pipe)
+
+ # If we fail to get the CHOST, see if we can get the CHOST
+ # portage thinks we are using ...
+ pipe = "/usr/bin/portageq envvar 'CHOST'"
+ assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
+ } else {
+ # Check pre gcc-3.4.x versions
+ CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
+
+ if (CHOST == TMP_CHOST || CHOST == "") {
+ # Check gcc-3.4.x or later
+ CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
+
+ if (CHOST == TMP_CHOST || CHOST == "")
+ CHOST = ""
+ else
+ HAVE_GCC34 = 1
+ }
+ }
+ close(pipe)
+
+ if (CHOST == "") {
+ eerror("Could not get gcc's CHOST!")
+ exit 1
+ }
+
+ if (OLDCHOST != "")
+ if (OLDCHOST == CHOST)
+ OLDCHOST = ""
+
+ GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
+ GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
+
+ if (HAVE_GCC34)
+ GCCLIBPREFIX = GCCLIBPREFIX_NEW
+ else
+ GCCLIBPREFIX = GCCLIBPREFIX_OLD
+
+ GCCLIB = GCCLIBPREFIX CHOST
+
+ if (OLDCHOST != "") {
+ OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
+ OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
+ }
+
+ # Get current gcc's version
+ pipe = "gcc -dumpversion"
+ assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
+ close(pipe)
+
+ if (NEWVER == "") {
+ eerror("Could not get gcc's version!")
+ exit 1
+ }
+
+ # Nothing to do ?
+ # NB: Do not check for (OLDVER == NEWVER) anymore, as we might need to
+ # replace libstdc++.la ....
+ if ((OLDVER == "") && (OLDCHOST == ""))
+ exit 0
+
+ #
+ # Ok, now let's scan for the .la files and actually fix them up
+ #
+ for (x = 1; x <= LIBCOUNT; x++) {
+ # Do nothing if the target dir is gcc's internal library path
+ if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
+ DIRLIST[x] ~ GCCLIBPREFIX_NEW)
+ continue
+
+ einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
+
+ pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
+ while (((pipe) | getline la_files) > 0) {
+
+ # Do nothing if the .la file is located in gcc's internal lib path
+ if (la_files ~ GCCLIBPREFIX_OLD ||
+ la_files ~ GCCLIBPREFIX_NEW)
+ continue
+
+ CHANGED = 0
+ CHOST_CHANGED = 0
+
+ # See if we need to fix the .la file
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
+ GCCLIB, la_data) > 0) ||
+ (gsub(OLDGCCLIB2 "[/[:space:]]+",
+ GCCLIB, la_data) > 0)) {
+ CHANGED = 1
+ CHOST_CHANGED = 1
+ }
+ }
+ if (OLDVER != NEWVER) {
+ if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0) ||
+ (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
+ GCCLIB "/" NEWVER, la_data) > 0))
+ CHANGED = 1
+ }
+ # We now check if we have libstdc++.la, as we remove the
+ # libtool linker scripts for gcc ...
+ # We do this last, as we only match the new paths
+ if (gsub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
+ "-lstdc++", la_data) > 0)
+ CHANGED = 1
+ }
+ close(la_files)
+
+ # Do the actual changes in a second loop, as we can then
+ # verify that CHOST_CHANGED among things is correct ...
+ if (CHANGED) {
+ ewarnn(" FIXING: " la_files " ...[")
+
+ # Clear the temp file (removing rather than '>foo' is better
+ # out of a security point of view?)
+ dosystem("rm -f " la_files ".new")
+
+ while ((getline la_data < (la_files)) > 0) {
+ if (OLDCHOST != "") {
+ tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", la_data)
+ tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
+ GCCLIB "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ printn("c")
+ la_data = tmpstr
+ }
+
+ if (CHOST_CHANGED > 0) {
+ # We try to be careful about CHOST changes outside
+ # the gcc library path (meaning we cannot match it
+ # via /GCCLIBPREFIX CHOST/) ...
+
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/CHOST/{bin,lib}'
+ #
+ gsub("-L/usr/" OLDCHOST "/",
+ "-L/usr/" CHOST "/", la_data)
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
+ #
+ la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
+ "\\1/" CHOST "/", "g", la_data)
+ }
+ }
+
+ if (OLDVER != NEWVER) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
+ #
+ tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", la_data)
+ tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
+ GCCLIB "/" NEWVER "\\1", "g", tmpstr)
+
+ if (la_data != tmpstr) {
+ # Catch:
+ #
+ # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
+ #
+ # in cases where we have gcc34
+ tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
+ GCCLIBPREFIX "\\1", "g", tmpstr)
+ printn("v")
+ la_data = tmpstr
+ }
+ }
+
+ # We now check if we have libstdc++.la, as we remove the
+ # libtool linker scripts for gcc and any referencese in any
+ # libtool linker scripts.
+ # We do this last, as we only match the new paths
+ tmpstr = gensub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
+ "-lstdc++", "g", la_data);
+ if (la_data != tmpstr) {
+ printn("l")
+ la_data = tmpstr
+ }
+
+ print la_data >> (la_files ".new")
+ }
+
+ if (CHANGED)
+ print "]"
+
+ close(la_files)
+ close(la_files ".new")
+
+ assert(dosystem("mv -f " la_files ".new " la_files),
+ "dosystem(\"mv -f " la_files ".new " la_files "\")")
+ }
+ }
+
+ close(pipe)
+ }
+}
+
+# vim:ts=4
diff --git a/sys-devel/gcc/files/c89 b/sys-devel/gcc/files/c89
new file mode 100644
index 000000000000..cee0325f50f1
--- /dev/null
+++ b/sys-devel/gcc/files/c89
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# Call the appropriate C compiler with options to accept ANSI/ISO C
+# The following options are the same (as of gcc-2.95):
+# -ansi
+# -std=c89
+# -std=iso9899:1990
+
+for i; do
+ case "$i" in
+ -ansi|-std=c89|-std=iso9899:1990)
+ ;;
+ -std=*)
+ echo >&2 "`basename $0` called with non ANSI/ISO C90 option $i"
+ exit 1
+ ;;
+ esac
+done
+
+exec gcc -std=c89 -pedantic -U_FORTIFY_SOURCE "$@"
diff --git a/sys-devel/gcc/files/c99 b/sys-devel/gcc/files/c99
new file mode 100644
index 000000000000..c9542095e385
--- /dev/null
+++ b/sys-devel/gcc/files/c99
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+# Call the appropriate C compiler with options to accept ANSI/ISO C
+# The following options are the same (as of gcc-3.3):
+# -std=c99
+# -std=c9x
+# -std=iso9899:1999
+# -std=iso9899:199x
+
+for i; do
+ case "$i" in
+ -std=c9[9x]|-std=iso9899:199[9x])
+ ;;
+ -ansi|-std=*)
+ echo >&2 "`basename $0` called with non ANSI/ISO C99 option $i"
+ exit 1
+ ;;
+ esac
+done
+
+exec gcc -std=c99 -pedantic -U_FORTIFY_SOURCE ${1+"$@"}
diff --git a/sys-devel/gcc/files/fix_libtool_files.sh b/sys-devel/gcc/files/fix_libtool_files.sh
new file mode 100644
index 000000000000..53c46de0fdc9
--- /dev/null
+++ b/sys-devel/gcc/files/fix_libtool_files.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+usage() {
+cat << "USAGE_END"
+Usage: fix_libtool_files.sh <old-gcc-version> [--oldarch <old-CHOST>]
+
+ Where <old-gcc-version> is the version number of the
+ previous gcc version. For example, if you updated to
+ gcc-3.2.1, and you had gcc-3.2 installed, run:
+
+ # fix_libtool_files.sh 3.2
+
+ If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu
+ but you now have CHOST as i686-pc-linux-gnu, run:
+
+ # fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu
+
+ Note that if only the CHOST and not the version changed, you can run
+ it with the current version and the '--oldarch <old-CHOST>' arguments,
+ and it will do the expected:
+
+ # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu
+
+USAGE_END
+ exit 1
+}
+
+case $2 in
+--oldarch) [ $# -ne 3 ] && usage ;;
+*) [ $# -ne 1 ] && usage ;;
+esac
+
+ARGV1=$1
+ARGV2=$2
+ARGV3=$3
+
+. /etc/profile || exit 1
+
+if [ ${EUID:-0} -ne 0 -a "${EPREFIX}" == '' ] ; then
+ echo "${0##*/}: Must be root."
+ exit 1
+fi
+
+# make sure the files come out sane
+umask 0022
+
+OLDCHOST=
+[ "${ARGV2}" = "--oldarch" ] && OLDCHOST=${ARGV3}
+
+AWKDIR="/usr/share/gcc-data"
+
+if [ ! -r "${AWKDIR}/fixlafiles.awk" ] ; then
+ echo "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
+ exit 1
+fi
+
+OLDVER=${ARGV1}
+
+export OLDVER OLDCHOST
+
+echo "Scanning libtool files for hardcoded gcc library paths..."
+exec gawk -f "${AWKDIR}/fixlafiles.awk"
+
+# vim:ts=4
diff --git a/sys-devel/gcc/files/gcc-configure-LANG.patch b/sys-devel/gcc/files/gcc-configure-LANG.patch
new file mode 100644
index 000000000000..d1b1b0353662
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-configure-LANG.patch
@@ -0,0 +1,64 @@
+The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
+option parsing, it may break.
+
+http://bugs.gentoo.org/103483
+
+--- configure
++++ configure
+@@ -54,6 +54,19 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ unset $as_var
++ fi
++done
++
+ # Initialize some other variables.
+ subdirs=
+ MFLAGS= MAKEFLAGS=
+@@ -452,16 +463,6 @@
+ esac
+ done
+
+-# NLS nuisances.
+-# Only set these to C if already set. These must not be set unconditionally
+-# because not all systems understand e.g. LANG=C (notably SCO).
+-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+-# Non-C LC_CTYPE values break the ctype check.
+-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+-
+ # confdefs.h avoids OS command line length limits that DEFS can exceed.
+ rm -rf conftest* confdefs.h
+ # AIX cpp loses on an empty file, so make sure it contains at least a newline.
+@@ -1850,6 +1850,19 @@
+ # Compiler output produced by configure, useful for debugging
+ # configure, is in ./config.log if it exists.
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
++ eval \$as_var=C; export \$as_var
++ else
++ unset \$as_var
++ fi
++done
++
+ ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+ for ac_option
+ do
diff --git a/sys-devel/gcc/files/gcc-configure-texinfo.patch b/sys-devel/gcc/files/gcc-configure-texinfo.patch
new file mode 100644
index 000000000000..ddc098ddbd58
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-configure-texinfo.patch
@@ -0,0 +1,16 @@
+Chances are quite good that the installed makeinfo is sufficient.
+So ignore false positives where the makeinfo installed is so new
+that it violates the cheesy version grep.
+
+http://bugs.gentoo.org/198182
+
+--- configure
++++ configure
+@@ -3573,6 +3573,6 @@
+ :
+ else
+- MAKEINFO="$MISSING makeinfo"
++ :
+ fi
+ ;;
+
diff --git a/sys-devel/gcc/files/gcc-spec-env-r1.patch b/sys-devel/gcc/files/gcc-spec-env-r1.patch
new file mode 100644
index 000000000000..a58926836e4e
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-spec-env-r1.patch
@@ -0,0 +1,87 @@
+2013-08-22 Magnus Granberg <zorry@gentoo.org>
+
+ * gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
+ and move the process of the user specifed specs.
+
+ This allows us to easily control pie/ssp defaults with gcc-config profiles.
+ Original patch by Rob Holland
+ Extended to support multiple entries separated by ':' by Kevin F. Quinn
+ Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
+ Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
+
+--- gcc-4.8-20130210/gcc/gcc.c 2013-02-05 16:55:31.000000000 +0100
++++ gcc-4.8-20130210-work/gcc/gcc.c 2013-07-26 02:32:14.625089864 +0200
+@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
+ do_option_spec (option_default_specs[i].name,
+ option_default_specs[i].spec);
+
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
++ * each spec listed, the string is overwritten at token boundaries
++ * (':') with '\0', an effect of strtok_r().
++ */
++ specs_file = getenv ("GCC_SPECS");
++ if (specs_file && (strlen(specs_file) > 0))
++ {
++ char *spec, *saveptr;
++ for (spec=strtok_r(specs_file,":",&saveptr);
++ spec!=NULL;
++ spec=strtok_r(NULL,":",&saveptr))
++ {
++ struct user_specs *user = (struct user_specs *)
++ xmalloc (sizeof (struct user_specs));
++ user->next = (struct user_specs *) 0;
++ user->filename = spec;
++ if (user_specs_tail)
++ user_specs_tail->next = user;
++ else
++ user_specs_head = user;
++ user_specs_tail = user;
++ }
++ }
++#endif
++ /* Process any user specified specs in the order given on the command
++ * line. */
++ for (uptr = user_specs_head; uptr; uptr = uptr->next)
++ {
++ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
++ R_OK, true);
++ read_specs (filename ? filename : uptr->filename, false, true);
++ }
++ /* Process any user self specs. */
++ {
++ struct spec_list *sl;
++ for (sl = specs; sl; sl = sl->next)
++ if (sl->name_len == sizeof "self_spec" - 1
++ && !strcmp (sl->name, "self_spec"))
++ do_self_spec (*sl->ptr_spec);
++ }
++
+ /* Process DRIVER_SELF_SPECS, adding any new options to the end
+ of the command line. */
+
+@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
+ PREFIX_PRIORITY_LAST, 0, 1);
+ }
+
+- /* Process any user specified specs in the order given on the command
+- line. */
+- for (uptr = user_specs_head; uptr; uptr = uptr->next)
+- {
+- char *filename = find_a_file (&startfile_prefixes, uptr->filename,
+- R_OK, true);
+- read_specs (filename ? filename : uptr->filename, false, true);
+- }
+-
+- /* Process any user self specs. */
+- {
+- struct spec_list *sl;
+- for (sl = specs; sl; sl = sl->next)
+- if (sl->name_len == sizeof "self_spec" - 1
+- && !strcmp (sl->name, "self_spec"))
+- do_self_spec (*sl->ptr_spec);
+- }
+-
+ if (compare_debug)
+ {
+ enum save_temps save;
diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch
new file mode 100644
index 000000000000..57e7567e5460
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-spec-env.patch
@@ -0,0 +1,42 @@
+ Add support for external spec file via the GCC_SPECS env var. This
+ allows us to easily control pie/ssp defaults with gcc-config profiles.
+
+ Original patch by Rob Holland
+ Extended to support multiple entries separated by ':' by Kevin F. Quinn
+ Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
+
+--- gcc-4/gcc/gcc.c
++++ gcc-4/gcc/gcc.c
+@@ -6482,6 +6482,32 @@
+
+ /* Process any user specified specs in the order given on the command
+ line. */
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
++ * each spec listed, the string is overwritten at token boundaries
++ * (':') with '\0', an effect of strtok_r().
++ */
++ specs_file = getenv ("GCC_SPECS");
++ if (specs_file && (strlen(specs_file) > 0))
++ {
++ char *spec, *saveptr;
++ for (spec=strtok_r(specs_file,":",&saveptr);
++ spec!=NULL;
++ spec=strtok_r(NULL,":",&saveptr))
++ {
++ struct user_specs *user = (struct user_specs *)
++ xmalloc (sizeof (struct user_specs));
++
++ user->next = (struct user_specs *) 0;
++ user->filename = spec;
++ if (user_specs_tail)
++ user_specs_tail->next = user;
++ else
++ user_specs_head = user;
++ user_specs_tail = user;
++ }
++ }
++#endif
+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
diff --git a/sys-devel/gcc/gcc-2.95.3-r10.ebuild b/sys-devel/gcc/gcc-2.95.3-r10.ebuild
new file mode 100644
index 000000000000..08958abea5c6
--- /dev/null
+++ b/sys-devel/gcc/gcc-2.95.3-r10.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.4"
+
+inherit eutils flag-o-matic toolchain
+
+KEYWORDS="~alpha ~ppc ~sparc ~x86"
+
+gcc2-flags() {
+ # Are we trying to compile with gcc3 ? CFLAGS and CXXFLAGS needs to be
+ # valid for gcc-2.95.3 ...
+ if [[ $(tc-arch) == "x86" || $(tc-arch) == "amd64" ]] ; then
+ CFLAGS=${CFLAGS//-mtune=/-mcpu=}
+ CXXFLAGS=${CXXFLAGS//-mtune=/-mcpu=}
+ fi
+
+ replace-cpu-flags k6-{2,3} k6
+ replace-cpu-flags athlon{,-{tbird,4,xp,mp}} i686
+
+ replace-cpu-flags pentium-mmx i586
+ replace-cpu-flags pentium{2,3,4} i686
+
+ replace-cpu-flags ev6{7,8} ev6
+}
+
+src_prepare() {
+ rm -rf texinfo
+ strip-linguas -u */po
+ gcc2-flags
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/gcc-3.3.6-r1.ebuild b/sys-devel/gcc/gcc-3.3.6-r1.ebuild
new file mode 100644
index 000000000000..f158db5d98ce
--- /dev/null
+++ b/sys-devel/gcc/gcc-3.3.6-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.9"
+UCLIBC_VER="1.0"
+HTB_VER="1.00-r2"
+
+inherit eutils toolchain
+
+# ia64 - broken static handling; USE=static emerge busybox
+KEYWORDS="~amd64 ~x86"
+
+# NOTE: we SHOULD be using at least binutils 2.15.90.0.1 everywhere for proper
+# .eh_frame ld optimisation and symbol visibility support, but it hasnt been
+# well tested in gentoo on any arch other than amd64!!
+RDEPEND=">=sys-devel/binutils-2.14.90.0.6-r1"
+DEPEND="${RDEPEND}
+ amd64? ( >=sys-devel/binutils-2.15.90.0.1.1-r1 )"
+
+src_prepare() {
+ toolchain_src_prepare
+
+ if [[ -n ${UCLIBC_VER} ]] && [[ ${CTARGET} == *-uclibc* ]] ; then
+ mv "${S}"/gcc-3.3.2/libstdc++-v3/config/os/uclibc "${S}"/libstdc++-v3/config/os/ || die
+ mv "${S}"/gcc-3.3.2/libstdc++-v3/config/locale/uclibc "${S}"/libstdc++-v3/config/locale/ || die
+ fi
+
+ # Anything useful and objc will require libffi. Seriously. Lets just force
+ # libffi to install with USE="objc", even though it normally only installs
+ # if you attempt to build gcj.
+ if use objc && ! use gcj ; then
+ epatch "${FILESDIR}"/3.3.4/libffi-without-libgcj.patch
+ #epatch "${FILESDIR}"/3.4.3/libffi-nogcj-lib-path-fix.patch
+ fi
+}
diff --git a/sys-devel/gcc/gcc-3.4.6-r2.ebuild b/sys-devel/gcc/gcc-3.4.6-r2.ebuild
new file mode 100644
index 000000000000..ef118a8b013c
--- /dev/null
+++ b/sys-devel/gcc/gcc-3.4.6-r2.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.8"
+UCLIBC_VER="1.1"
+UCLIBC_GCC_VER="3.4.5"
+HTB_VER="1.00.1"
+HTB_GCC_VER="3.4.4"
+D_VER="0.24"
+
+inherit eutils toolchain
+
+KEYWORDS="-* alpha amd64 arm ~ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
+
+# we need a proper glibc version for the Scrt1.o provided to the pie-ssp specs
+# NOTE: we SHOULD be using at least binutils 2.15.90.0.1 everywhere for proper
+# .eh_frame ld optimisation and symbol visibility support, but it hasnt been
+# well tested in gentoo on any arch other than amd64!!
+RDEPEND=""
+DEPEND="${RDEPEND}
+ >=sys-devel/binutils-2.14.90.0.8-r1
+ amd64? ( >=sys-devel/binutils-2.15.90.0.1.1-r1 )"
+
+src_prepare() {
+ toolchain_src_prepare
+
+ # Anything useful and objc will require libffi. Seriously. Lets just force
+ # libffi to install with USE="objc", even though it normally only installs
+ # if you attempt to build gcj.
+ if use objc && ! use gcj ; then
+ epatch "${FILESDIR}"/3.4.3/libffi-without-libgcj.patch
+ #epatch "${FILESDIR}"/3.4.3/libffi-nogcj-lib-path-fix.patch
+ fi
+
+ # Fix cross-compiling
+ epatch "${FILESDIR}"/3.4.4/gcc-3.4.4-cross-compile.patch
+
+ # Arch stuff
+ case $(tc-arch) in
+ amd64)
+ if is_multilib ; then
+ sed -i -e '/GLIBCXX_IS_NATIVE=/s:false:true:' libstdc++-v3/configure || die
+ fi
+ ;;
+ esac
+}
diff --git a/sys-devel/gcc/gcc-4.0.4.ebuild b/sys-devel/gcc/gcc-4.0.4.ebuild
new file mode 100644
index 000000000000..f8cacf7863a0
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.0.4.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.3"
+UCLIBC_VER="1.0"
+
+inherit toolchain
+
+KEYWORDS=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ >=${CATEGORY}/binutils-2.15.94"
diff --git a/sys-devel/gcc/gcc-4.1.2.ebuild b/sys-devel/gcc/gcc-4.1.2.ebuild
new file mode 100644
index 000000000000..2477f3ecf961
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.1.2.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.6"
+UCLIBC_VER="1.0"
+D_VER="0.24"
+
+inherit eutils toolchain
+
+KEYWORDS="-* alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ ppc? ( >=${CATEGORY}/binutils-2.17 )
+ ppc64? ( >=${CATEGORY}/binutils-2.17 )
+ >=${CATEGORY}/binutils-2.15.94"
+
+src_prepare() {
+ toolchain_src_prepare
+
+ use vanilla && return 0
+
+ # Fix cross-compiling
+ epatch "${FILESDIR}"/4.1.0/gcc-4.1.0-cross-compile.patch
+
+ epatch "${FILESDIR}"/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch
+}
diff --git a/sys-devel/gcc/gcc-4.2.4-r1.ebuild b/sys-devel/gcc/gcc-4.2.4-r1.ebuild
new file mode 100644
index 000000000000..1065be0dc077
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.2.4-r1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.4"
+UCLIBC_VER="1.0"
+
+inherit toolchain
+
+KEYWORDS="~alpha ~amd64 ~arm hppa ~ia64 ~m68k ~ppc ~ppc64 ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ ppc? ( >=${CATEGORY}/binutils-2.17 )
+ ppc64? ( >=${CATEGORY}/binutils-2.17 )
+ >=${CATEGORY}/binutils-2.15.94"
diff --git a/sys-devel/gcc/gcc-4.3.6-r1.ebuild b/sys-devel/gcc/gcc-4.3.6-r1.ebuild
new file mode 100644
index 000000000000..d483c32ec950
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.3.6-r1.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.2"
+UCLIBC_VER="1.0"
+
+inherit toolchain
+
+KEYWORDS="alpha amd64 arm -hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ ppc? ( >=${CATEGORY}/binutils-2.17 )
+ ppc64? ( >=${CATEGORY}/binutils-2.17 )
+ >=${CATEGORY}/binutils-2.15.94"
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ toolchain_src_prepare
+
+ use vanilla && return 0
+
+ sed -i 's/use_fixproto=yes/:/' gcc/config.gcc #PR33200
+}
diff --git a/sys-devel/gcc/gcc-4.4.7.ebuild b/sys-devel/gcc/gcc-4.4.7.ebuild
new file mode 100644
index 000000000000..694e5426d2cc
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.4.7.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.3"
+UCLIBC_VER="1.0"
+
+inherit eutils toolchain
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ ppc? ( >=${CATEGORY}/binutils-2.17 )
+ ppc64? ( >=${CATEGORY}/binutils-2.17 )
+ >=${CATEGORY}/binutils-2.15.94"
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ toolchain_src_prepare
+ use vanilla && return 0
+
+ sed -i 's/use_fixproto=yes/:/' gcc/config.gcc #PR33200
+}
diff --git a/sys-devel/gcc/gcc-4.5.4.ebuild b/sys-devel/gcc/gcc-4.5.4.ebuild
new file mode 100644
index 000000000000..f013c619a99d
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.5.4.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.3"
+UCLIBC_VER="1.0"
+
+inherit eutils toolchain
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ ppc? ( >=${CATEGORY}/binutils-2.17 )
+ ppc64? ( >=${CATEGORY}/binutils-2.17 )
+ >=${CATEGORY}/binutils-2.15.94"
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ toolchain_src_prepare
+
+ use vanilla && return 0
+
+ sed -i 's/use_fixproto=yes/:/' gcc/config.gcc #PR33200
+}
diff --git a/sys-devel/gcc/gcc-4.6.4.ebuild b/sys-devel/gcc/gcc-4.6.4.ebuild
new file mode 100644
index 000000000000..a3b35cd898a4
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.6.4.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.3"
+UCLIBC_VER="1.0"
+
+inherit eutils toolchain
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.18"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/gcc-4.7.4.ebuild b/sys-devel/gcc/gcc-4.7.4.ebuild
new file mode 100644
index 000000000000..ac333b40c4a6
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.7.4.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+PATCH_VER="1.4"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.5.5"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 ppc ppc64"
+SSP_STABLE="amd64 x86 ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 ppc ppc64 arm"
+#end Hardened stuff
+
+inherit eutils toolchain
+
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 -amd64-fbsd -x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.18"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+
+ toolchain_src_prepare
+
+ use vanilla && return 0
+
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env.patch
+}
diff --git a/sys-devel/gcc/gcc-4.8.5.ebuild b/sys-devel/gcc/gcc-4.8.5.ebuild
new file mode 100644
index 000000000000..3c74310bfc57
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.8.5.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+PATCH_VER="1.3"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.6.2"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64"
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm"
+#end Hardened stuff
+
+inherit eutils toolchain
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+
+ toolchain_src_prepare
+
+ use vanilla && return 0
+ #Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs.
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env-r1.patch
+}
diff --git a/sys-devel/gcc/gcc-4.9.4-r1.ebuild b/sys-devel/gcc/gcc-4.9.4-r1.ebuild
new file mode 100644
index 000000000000..74b2fcf50106
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.9.4-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.1"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.6.4"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64"
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm"
+#end Hardened stuff
+
+inherit eutils toolchain
+
+# KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+
+ toolchain_src_prepare
+
+ use vanilla && return 0
+ #Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs.
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env-r1.patch
+}
diff --git a/sys-devel/gcc/gcc-4.9.4.ebuild b/sys-devel/gcc/gcc-4.9.4.ebuild
new file mode 100644
index 000000000000..55295ab2500e
--- /dev/null
+++ b/sys-devel/gcc/gcc-4.9.4.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.0"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.6.4"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64"
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm"
+#end Hardened stuff
+
+inherit eutils toolchain
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+
+ toolchain_src_prepare
+
+ use vanilla && return 0
+ #Use -r1 for newer piepatchet that use DRIVER_SELF_SPECS for the hardened specs.
+ [[ ${CHOST} == ${CTARGET} ]] && epatch "${FILESDIR}"/gcc-spec-env-r1.patch
+}
diff --git a/sys-devel/gcc/gcc-5.4.0-r3.ebuild b/sys-devel/gcc/gcc-5.4.0-r3.ebuild
new file mode 100644
index 000000000000..3c46a24c73af
--- /dev/null
+++ b/sys-devel/gcc/gcc-5.4.0-r3.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+PATCH_VER="1.4"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.6.5"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64"
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm"
+#end Hardened stuff
+
+inherit toolchain
+
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+ is_crosscompile && EPATCH_EXCLUDE+=" 05_all_gcc-spec-env.patch"
+
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/gcc-5.4.0.ebuild b/sys-devel/gcc/gcc-5.4.0.ebuild
new file mode 100644
index 000000000000..a462cc69cb51
--- /dev/null
+++ b/sys-devel/gcc/gcc-5.4.0.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+PATCH_VER="1.0"
+UCLIBC_VER="1.0"
+
+# Hardened gcc 4 stuff
+PIE_VER="0.6.5"
+SPECS_VER="0.2.0"
+SPECS_GCC_VER="4.4.3"
+# arch/libc configurations known to be stable with {PIE,SSP}-by-default
+PIE_GLIBC_STABLE="x86 amd64 mips ppc ppc64 arm ia64"
+PIE_UCLIBC_STABLE="x86 arm amd64 mips ppc ppc64"
+SSP_STABLE="amd64 x86 mips ppc ppc64 arm"
+# uclibc need tls and nptl support for SSP support
+# uclibc need to be >= 0.9.33
+SSP_UCLIBC_STABLE="x86 amd64 mips ppc ppc64 arm"
+#end Hardened stuff
+
+inherit toolchain
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.8 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.8 )"
+fi
+
+src_prepare() {
+ if has_version '<sys-libs/glibc-2.12' ; then
+ ewarn "Your host glibc is too old; disabling automatic fortify."
+ ewarn "Please rebuild gcc after upgrading to >=glibc-2.12 #362315"
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ fi
+ is_crosscompile && EPATCH_EXCLUDE+=" 05_all_gcc-spec-env.patch"
+
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/gcc-6.3.0.ebuild b/sys-devel/gcc/gcc-6.3.0.ebuild
new file mode 100644
index 000000000000..d56c4f5fb120
--- /dev/null
+++ b/sys-devel/gcc/gcc-6.3.0.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+PATCH_VER="1.0"
+#UCLIBC_VER="1.0"
+
+inherit toolchain
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.13 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
+fi
+
+src_prepare() {
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/gcc-6.4.0.ebuild b/sys-devel/gcc/gcc-6.4.0.ebuild
new file mode 100644
index 000000000000..d57181534e88
--- /dev/null
+++ b/sys-devel/gcc/gcc-6.4.0.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.0"
+#UCLIBC_VER="1.0"
+
+inherit toolchain
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.13 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
+fi
+
+src_prepare() {
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/gcc-7.1.0-r1.ebuild b/sys-devel/gcc/gcc-7.1.0-r1.ebuild
new file mode 100644
index 000000000000..41b4c34bfbbe
--- /dev/null
+++ b/sys-devel/gcc/gcc-7.1.0-r1.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.1"
+#UCLIBC_VER="1.0"
+
+inherit toolchain
+
+KEYWORDS=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.13 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
+fi
+
+src_prepare() {
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/gcc-7.2.0.ebuild b/sys-devel/gcc/gcc-7.2.0.ebuild
new file mode 100644
index 000000000000..a0f65c4fe504
--- /dev/null
+++ b/sys-devel/gcc/gcc-7.2.0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+PATCH_VER="1.1"
+PATCH_GCC_VER="7.1.0"
+#UCLIBC_VER="1.0"
+
+inherit toolchain
+
+KEYWORDS=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ elibc_glibc? ( >=sys-libs/glibc-2.13 )
+ >=${CATEGORY}/binutils-2.20"
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
+fi
+
+src_prepare() {
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
new file mode 100644
index 000000000000..52748bc1ff68
--- /dev/null
+++ b/sys-devel/gcc/metadata.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <use>
+ <flag name="awt">Useful only when building GCJ, this enables Abstract Window Toolkit
+ (AWT) peer support on top of GTK+</flag>
+ <flag name="cilk">Support the Cilk Plus language (C/C++ based languages for parallel programming)</flag>
+ <flag name="d">Enable support for the D programming language</flag>
+ <flag name="fixed-point">Enable fixed-point arithmetic support for MIPS targets
+ in gcc (Warning: significantly increases compile time!)</flag>
+ <flag name="go">Build the GCC Go language frontend.</flag>
+ <flag name="graphite">Add support for the framework for loop
+ optimizations based on a polyhedral intermediate representation</flag>
+ <flag name="jit">Enable libgccjit so other applications can embed gcc for Just-In-Time compilation.
+ This will slow down the compiler a bit as it forces all of the toolchain to be shared libs.</flag>
+ <flag name="libssp">Build SSP support into a dedicated library rather than use the
+ code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag>
+ <flag name="mpx">Enable support for Intel Memory Protection Extensions (MPX)</flag>
+ <flag name="mudflap">Add support for mudflap, a pointer use checking library</flag>
+ <flag name="nopie">Disable PIE support (NOT FOR GENERAL USE)</flag>
+ <flag name="nossp">Disable SSP support (NOT FOR GENERAL USE)</flag>
+ <flag name="objc">Build support for the Objective C code language</flag>
+ <flag name="objc++">Build support for the Objective C++ language</flag>
+ <flag name="objc-gc">Build support for the Objective C code language Garbage
+ Collector</flag>
+ <flag name="pgo">Build GCC using Profile Guided Optimization (PGO)</flag>
+ <flag name="regression-test">Run the testsuite and install the results (requires FEATURES=test)</flag>
+ <flag name="sanitize">Build support for various sanitizer functions (ASAN/TSAN/etc...)</flag>
+ <flag name="ssp">Build packages with stack smashing protector on by default</flag>
+ <flag name="vtv">Build support for virtual table verification (a C++ hardening feature)</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:gnu:gcc</remote-id>
+ <remote-id type="sourceforge">dgcc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/gdb-apple/Manifest b/sys-devel/gdb-apple/Manifest
new file mode 100644
index 000000000000..49deafb69dbd
--- /dev/null
+++ b/sys-devel/gdb-apple/Manifest
@@ -0,0 +1,26 @@
+AUX gdb-apple-1344-darwin8.patch 3606 SHA256 e7be79bc996f17f11b8332c8a6f6b574c35e3343647c0b8b913d9c142302ebba SHA512 e98fd9a9d4d5969e868885fa467142eae0e3981eccc212fdfcd9b2d82c85d2e4f6aed50ad77227eb7ad24f71434f6f1564cf8ac49bdb9bc9898b85c2ea6ec45e WHIRLPOOL da5609507e4a8b64877049aaae4d4fb2cc09039250fc3747dade3ae775cf54b91bb237ae09a82e4f3f320a7ada63292ae5f507dfae8fad0c322d7532712a9b68
+AUX gdb-apple-1461-darwin8.patch 3206 SHA256 5af99b9785a5edc8a649c63b33f68b3c5f56887c3058c2d323ffebcb43e96a4c SHA512 bbf8ff590bbc6225ba4a78813c36e239bc4bc50514ae59e024a2f4c54a79fa2e98db2313be8cc9bbb098f3df3b79b2e9925fda400879e196ac02071a8e9b1b93 WHIRLPOOL 091889a32627d66c4b8457f22d9d2a0897085ff097772afbe8f1e50c7513a5047d4cc692ccadf41d95a091c400d2585ffbd0d87196ec8fb1698cbedae908bbb5
+AUX gdb-apple-1461-dyld-info.patch 503 SHA256 d0a1cf51ca0c8699a7fc06bd64e1765c4612a20a87acbcf24a98d0fb1bb6f4b1 SHA512 f697133fcad4b6d2c0492f3e800f02feb133526bbec548c966bf92dbb92df9cfa9e69fadcc2bf28898bdf6a90f3ef2480ff944101eb0d1e6566735d2278cf56e WHIRLPOOL 5910b921c60be0b665f17609070940fde281e5cd449ddef92ae2a9e433f7454bdedb2bd0a9b57ec38b2a44b9b2bcba9fb2d1dcd402292ff40ab88c8ac962172d
+AUX gdb-apple-1518-darwin8-9.patch 2260 SHA256 9adb3170f383af933aa2a14822341160e39a521c02a49db154ab71513f31222c SHA512 7c079c480b3ed1e9d6cfed78ea87358988a4c72a0e89f4cd76e12b235e9451ab6ea77679ad0953f224e6c30ba0d078c5ce4e1a25f6bbd1134214dd721b0420b6 WHIRLPOOL 3c3ad175ce7d607ab0fbfd741b75974ad402ee98c29da7e94716001be9c530f3e42da4dce0125344a123ad1a09e1865682e21b0e307247ff63802f71b5b03ac4
+AUX gdb-apple-1518-darwin8.patch 3022 SHA256 9b313bc99eedf2cb7ba0163b13ad88ce86be78c49372f9b158bb1ea3139b2844 SHA512 efa100767336d0eba752d03d5d6ea6a77c80e40160208cd157abc444064c779f9d671e5a621cbeae8f7b2ae134e838e49a2726d1d9efcbd8421070a6b789679d WHIRLPOOL b7a7520be2ced8da6d25a852e8a98fe2e9b0b6762b971b36788d2ce8c201acee02f263cef7772b24cbe4384ff28278f76f190964bf4fcb4e835b3de32ab7c537
+AUX gdb-apple-1518-task_dyld_info.patch 557 SHA256 bc7e754ef5eb8a8a285d9ed8ec0d3476297c13456e6f76c887c4a848c4049ecb SHA512 69ea8de6663c91b8587df903c5c8578586875d73b6fb2aeef37a98346e78d214814e794e6a294051fb3b82a9d450ab6e9a2b13265ae48b8ad3dfd80004d6caf5 WHIRLPOOL 559fd483ea4144dd40ab5b9bec1ad7ee4e0fa69f3129662bf0d008c44ab6aca996db1cc2c2f266c9df154b93ddecb701645bb50756bfd520dd05a7182e979dfa
+AUX gdb-apple-1705-darwin8-10.patch 286 SHA256 db62e146bc0595b02ac8f4883d56459c59f57ad50b01aa6d7211209e9ef95136 SHA512 baf049e3a1e580faeb5b5481bbdda5cfd96abb22ec7dd2528986c4fa78113933565a9a1711f4dcf8bed9edd27190aa9f5f04d7df141b0eb1aa65b18b57915061 WHIRLPOOL 249caf55b7a2135e7df5e90c725466c793ceec90aecf1d6b2246a59c83f9f6553c32526514a5fad8361f2f7f4e78a689b2292ce9d5f6637954dc6347458b38bb
+AUX gdb-apple-563-darwin7.patch 3329 SHA256 7d20fb2e241060f220a179a14d14a0062528ddee1ec60ce213ea80a1b85e8921 SHA512 5c12715998a039e114ae214848f4715848c6390f358d140b1886c52fc1ff376f8b26525c19b004ebbbda4c577a5a32d4909642943ceb5394fd8849d131aab626 WHIRLPOOL 69847755e18727d4711dccbda570e7fb01aeb1b822addd11938b44e2eb315e4242c3a64b1ea1f11e5612c50f11b3eb87773e9604d08aac8b20208f5116d697cc
+AUX gdb-apple-563-no-64bit.patch 767 SHA256 3eb672bb4bc08d74f01bd33008140177b9906fc06969852d013ee9440a8d6c97 SHA512 79eb42ca51363276aec1dfc9c2580ad8524c826bcf0a0d2a0128ba671625d5546aad161ad2d368f71b5828b76965a27df0f4e47ab78e3b46c73553168af6b94a WHIRLPOOL f83a53dcaaeea05dc40ceae083a99c0b2acfe34a551875a84fe328182a54b65db3283f90b7ef5e7f54dd53d84a66e424ad1b13c6453f5a598701a500f104ff5a
+AUX gdb-apple-768-darwin-arch.patch 571 SHA256 afd10f60857900824fb36d3109e2c4fa0c87ca95fab1c4411cd8316d3d566ab6 SHA512 5d5345c0b9aab9610bfeb3adf98f92f2d132e198ce69278b8a7e35e59d9b45955b5eabd0cf2e6dd085a034369826804d833ec841726729a1272b06a8d7b8592b WHIRLPOOL 4b0f05cd5a862027e5ec55bd5de402ec1eb7bacf77024a020b4296388abb563ba7900f08b7b868eb3d72a4be1e1682dc6b091d428131b85ef2e0a5aa87521d82
+AUX gdb-apple-768-texinfo.patch 487 SHA256 55d33c8603278687ec92f4b0bdbc7cb8e0b62b2348f1b44ce247d95c7ae14b2d SHA512 fb40c8c713e0cdd34df82b368fbae5b9cc4180a6519f303750d72181dcac31436f947fc01c6949bbfc8bf8a7be4459cb2083e821433c1c4e9a587e2171933b92 WHIRLPOOL c2728b22c83db57dc9c4981d2d7de5d2f5921a4d676a5443d1574fe0a58062fd8ce0af0d90962c0aaa4b58e91ed58299429e9babe2bd2c58c3e9f98632d8b0c5
+AUX gdb-apple-962-darwin64.patch 580 SHA256 016259650cd60b24b4bc39b890f7adec7a0a7c2f028dcc8fae8114d0f36a8676 SHA512 2b940cfef9caeac9aa863ab53349de083026258458321108d54e4605d1030f496701e666a720e530d530ede0db7b59694f3fbc4ab28a6122ca1e28c03bbae8a2 WHIRLPOOL 1f6106a3573467eb6117042559d765a7fbe3737b84923b384f2c44a5cda57473922d62a66f84f9597f7cfedf4b5528a2734e6f1eb1b3253f5c26bd3c7e1d95a7
+AUX gdb-apple-962-darwin8.patch 402 SHA256 885453cb8ea7e39bc5da479ce046e96e113eb150af220b7d61d8f50ebf29d2d6 SHA512 e6c8a48eef811c061e9ec48b4a99f653b6dcfd02d4c4cd7b0135e170eca8240183da563fe62de600156b065f5a74d64fbed84f9c3763324d6697168486750237 WHIRLPOOL 22536511d4226e1c2dd5748a45c924da6d85a0950294e5671b20687318fdfb50a16902362dabbfc31afc13df736c767f41cb02f1dff22eb1c3e60bf391aee5e8
+AUX gdb-apple-962-demangle.patch 708 SHA256 35d10612776db1cae9aca99ba72973ab1c6629dd6a9f1d16f1ec8322684c26ab SHA512 623db08a7c378f2644faf22a41cf57341f9bbecd7ad319e32651a8f4eff2935bb9914443143a749dabf255a1f99dea133daa487dc3192bacc1fc8f7eb088dec4 WHIRLPOOL 35e1f2521c6909d2f78f5c54b1b53da617820327da0fa1277146ea25cc9828f6ffd43bec21e411bdb221def8be7372b51ee5dcd9ec8f3e8a4a03c8aeef23e112
+AUX gdb-apple-no-global-gdbinit.patch 714 SHA256 e89a211394dec0443cc17098ebdf8b2ea513d64ad62bddd39082706902b83683 SHA512 e692621595562f002a8f2d170cf3aed087f09ddb0578e2a8bf4bdac77119ee7c4a921f9d4a10273a3c0b7cbe95299d936c93971b5ff1a73fd528f8d1984f7a4c WHIRLPOOL 55b28fd647ad093c73e738e0cc48aa173622218547624ef3961e8d5c6f57e22d99962c6d30824c06fd44e7a64e6b7d893202ca2f96eb4e71425df8f47e255ce6
+DIST gdb-1461.2.tar.gz 17951571 SHA256 91d8cdbcd9cf36377d9c2d425921141085b5c79a6dce312a3dc0b6960f8e02f9 SHA512 2d8b11ed575e26176a8f93eb7d2fbc052313114ffce10f0da6888ff9e7c30067d4db6d89c9443187bf7167823dfd631a7f56fe718160b5653791080df9b8163d WHIRLPOOL 20f0bcf5d9c7a5f42ff3d46e074ad94ed7bd6c89e61c6887a66b8f04fe5eb7dd3d9adaaaa041af0ef3c5fd236b7c31faa40a51a2f90e6217bec59b56950de929
+DIST gdb-1752.tar.gz 17922994 SHA256 8685227243cedc26954d175f28ed56ba5889410420aa888323e1eeaffb204ccf SHA512 863a861a9a7708b8a763ea93599f6b519277f23fff35700d04e81a7747cc49421d0f051790deb92c440ced30ee15ba719b75066d5a614341e0f0b765d7a81094 WHIRLPOOL f07fd8a5e3e8ed466a5f21df689c4b6b7f7deaafcfdb2a209573a1112c1720c423f87e1b82d559a0616aea0c089966ffe9d30e785112936469394a621c916611
+DIST gdb-768.tar.gz 17727326 SHA256 2342cbbf7c57dcc08011736c9823d5ca374156666ba73c4b67d9984ed944f24d SHA512 40395d2e8ca30bb7aa0bbb0b270cbb9c18decc5a8fb37a764d43770e234b6281528d6feb301bcd97033c624c196851283fdbfc131f0336772a1e6e4b0168ae47 WHIRLPOOL a824e5ff903df33327827545ca8dad0401846f368e6feb3dc1b8fc9d9d2359e37302a6fd2773a6ec09ce7c71cae6082728cb9ee7d62ec28c4ede7f2fe0630c56
+DIST gdb-966.tar.gz 17769429 SHA256 fc51d13dd4153e4ac6140fa5199699dc26387189fb0e37277bb50944410a445f SHA512 daaf6f0329e311d46d82734df87fd501f70281edb511a8eb9123b6288a6a97f84725acc0f1c5e67dee3dc3e00cfa31bf7fc20594fbf3827a0ea35414f5ef7434 WHIRLPOOL acb4fb07806c08f5e58aca3b067226ce789ecd35d77eecda2e12ff757c27f08102ac3bbc4e6cf81dde97e6b112e721a7db178a807ec84a108ccc50772d45a11d
+EBUILD gdb-apple-1461.ebuild 1767 SHA256 38e34227f154ed036815d196e6c6ea0c8ea50cd0e232666890a9e86c7e914a84 SHA512 695a01c6243a5a1aa033cb7e44fd21d9cbd6d0d7761fd476af3af05124323198d5cb712c3d1546068422234d45de6d1958dc8fc9aad10fac40bce4444bdc1226 WHIRLPOOL ff657f09e01d14d7f842139009379d49cfef819e346997bbb6658738a305fcd3cd67a72587d60da25580749883391091c745386d11b7dd1cfc777036c8a2e303
+EBUILD gdb-apple-1752.ebuild 2141 SHA256 f550fceb4e041200a359df3904a89c1e62c929a150a77779fdeeabc61d16ff4a SHA512 b18fb1e49efb63f157cf7fa91ae93cf4f597901278cebd09d1e98e17ea93a9852265694339781a37c279e7451d5625611497542987355adb89ba4b5c6e0865f3 WHIRLPOOL 8f7a0b6e089f5b2a8b5b403534aa9a84a408292c3585d77f895746994324f56c3f8085b98832b90ae3adaf58ad1120ff12be76f34dd241310b4e29d4cd7b1baf
+EBUILD gdb-apple-768-r1.ebuild 1094 SHA256 0f269945cc2d6c66918238a06591af5da519946a8a97a7177ca6e2167be652c3 SHA512 4e8b6d7c5b3c5795ea5bae69db45748223d977c2cf7ee010b2ff710bd488cb032c91c64db2f357c3d614fff5bc2f8adab2c7cea4811becc8ab25f5ca058f63c1 WHIRLPOOL fd67a82fc36d1481b55c28f7b2099b77bc53ecdf155a9801388324d4d753eb6a1410a93e44031f8adcc7bdd5544fda4cf2d2253afa3fb4680135b8350567a181
+EBUILD gdb-apple-966.ebuild 1717 SHA256 c26d84d88fe07f0ada287405447502cab6f1cea7ac143bc9798a6220440ceb5b SHA512 438e7db050233ecaf29dd82fa6f7174734813f49b0556dd55ff86d8b5c4caaebc5cd06e3cf7ff2eb0bc4e1de39cf4cdd4505af80c305ba595a9ead574910c644 WHIRLPOOL 7ff92c7100d92265f117bcf7eec3705b2f3b8de757fa4ea8eee9f4cd52a0fcea1d4122bfb02c1b7e50924168753a7edef6c8108e0d2fd92f141e450d76d81739
+MISC ChangeLog 3992 SHA256 687f0b907e435e6bb4ca1060dd1b1309a47998bc5136e6da38af22147613ccfb SHA512 b804de07543690dd4c91a66b5e1f73561edf66396fcfa0b37572c4a0c200234b432ef4143fb6263ff89720f09922ec696212cb3702b79e83c0a9a98d1e44c13f WHIRLPOOL ad54aa883fb407fb331502db0d61c17e0756e179820ae65704f226ad6cdfea5fa83bfee1c438a0f140add9c428d6a8b1ccdbc08b5ba608219e62afc561ecfb2f
+MISC ChangeLog-2015 6444 SHA256 c4f8c1c6abdde43991696ec2bf888cf426ba009383aab2191b800ca9b70271c2 SHA512 0e9a098f87e7f884700c3cfce4249000e75fda7ce3e043c4905bf9798d97bcf5de3c4877e8887704fb9b3acd44ce9764463c925aca925aea063b76fae570e7ba WHIRLPOOL a59634eeb06c4724e90695368af87e96d21c7682f85ff75e8d760a9117f8266f7c11434bf4e662ad332941a4fd962ae6bfa554593ff389c660801fd8c629c4ae
+MISC metadata.xml 247 SHA256 beb9a5395fe6fcde3c82e31b0cde4a75ea911efb59294b0419f76b71e4518366 SHA512 ae91bc559b2380b04af0bacbaf419deb042e9a9235c596c1afdbbb3933e59ba4f895c6e7ebf8fa4884702d5b39febedfdcce109ab912d6ef4f51b3696bc82c18 WHIRLPOOL b82c282b0539e6427a6d6dc1d6742794f922e0b6276dbc7acb805735d6654c79600eb6f650a9c1e36cd727a63d1f1655d728535082154a218c6fb40c01eb8fe0
diff --git a/sys-devel/gdb-apple/files/gdb-apple-1344-darwin8.patch b/sys-devel/gdb-apple/files/gdb-apple-1344-darwin8.patch
new file mode 100644
index 000000000000..c95f02e0fe2e
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-1344-darwin8.patch
@@ -0,0 +1,131 @@
+--- src/gdb/symfile.c.orig 2009-09-25 09:00:15 +0200
++++ src/gdb/symfile.c 2009-09-25 09:00:18 +0200
+@@ -67,7 +67,6 @@
+ #include <ctype.h>
+ #include <time.h>
+ #include <sys/time.h>
+-#include <libgen.h>
+
+ #include <sys/mman.h>
+
+--- src/gdb/utils.c.orig 2009-09-25 09:06:29 +0200
++++ src/gdb/utils.c 2009-09-25 09:46:24 +0200
+@@ -27,7 +27,6 @@
+ #include "gdb_string.h"
+ #include "event-top.h"
+ #include "exceptions.h"
+-#include <execinfo.h>
+
+ #ifdef TUI
+ #include "tui/tui.h" /* For tui_get_command_dimension. */
+@@ -878,6 +877,7 @@
+ target_terminal_ours ();
+ begin_line ();
+
++#if 0
+ /* APPLE LOCAL: Do a stack crawl of how we got here so we're more likely
+ to get useful bug reports. */
+ {
+@@ -886,6 +886,7 @@
+ fprintf (stderr, "gdb stack crawl at point of internal error:\n");
+ backtrace_symbols_fd (bt_buffer, count, STDERR_FILENO);
+ }
++#endif
+
+ /* Create a string containing the full error/warning message. Need
+ to call query with this full string, as otherwize the reason
+--- src/gdb/remote.c.orig 2009-09-25 09:31:58 +0200
++++ src/gdb/remote.c 2009-09-25 09:48:18 +0200
+@@ -61,7 +61,6 @@
+ #ifdef MACOSX_DYLD
+ #include "macosx-nat-dyld.h"
+ #endif
+-#include <execinfo.h>
+
+ /* Prototypes for local functions. */
+ static void cleanup_sigint_signal_handler (void *dummy);
+@@ -483,10 +482,12 @@
+ static void
+ remote_backtrace_self ()
+ {
++#if 0
+ void *bt_buffer[10];
+ int count = backtrace (bt_buffer, 10);
+ fprintf_filtered (gdb_stderr, "gdb stack crawl at point of invalid hex digit:\n");
+ backtrace_symbols_fd (bt_buffer, count, STDERR_FILENO);
++#endif
+ }
+
+ static void
+--- src/gdb/macosx/macosx-tdep.c.orig 2009-09-25 09:09:00 +0200
++++ src/gdb/macosx/macosx-tdep.c 2009-09-25 09:09:12 +0200
+@@ -61,7 +61,6 @@
+ #include "exceptions.h"
+
+ #include <dirent.h>
+-#include <libgen.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
+--- src/gdb/macosx/macosx-nat-inferior.c.orig 2009-09-25 09:12:44 +0200
++++ src/gdb/macosx/macosx-nat-inferior.c 2009-09-25 09:13:24 +0200
+@@ -62,8 +62,10 @@
+ #include <semaphore.h>
+
+ #include <dlfcn.h>
++#if 0
+ #include <libproc.h>
+ #include <sys/proc_info.h>
++#endif
+
+ #include "macosx-nat-dyld.h"
+ #include "macosx-nat-inferior.h"
+@@ -3261,8 +3263,10 @@
+ int_flags |= RTLD_NOLOAD;
+ if (strstr (flags, "RTLD_NODELETE") != NULL)
+ int_flags |= RTLD_NODELETE;
++#ifdef RTLD_FIRST
+ if (strstr (flags, "RTLD_FIRST") != NULL)
+ int_flags |= RTLD_FIRST;
++#endif
+ }
+
+ /* If the user didn't pass in anything, set some sensible defaults. */
+--- src/gdb/macosx/macosx-nat-infthread.c.orig 2009-09-25 09:14:01 +0200
++++ src/gdb/macosx/macosx-nat-infthread.c 2009-09-25 09:14:19 +0200
+@@ -36,8 +36,10 @@
+ #include <sys/dir.h>
+ #include <inttypes.h>
+
++#if 0
+ #include <libproc.h>
+ #include <sys/proc_info.h>
++#endif
+
+ #include "macosx-nat-inferior.h"
+ #include "macosx-nat-inferior-util.h"
+--- src/gdb/macosx/macosx-nat-info.c.orig 2009-09-25 09:16:50 +0200
++++ src/gdb/macosx/macosx-nat-info.c 2009-09-25 09:31:12 +0200
+@@ -45,6 +45,22 @@
+ #include "macosx-nat-inferior.h"
+ #include "macosx-nat-inferior-debug.h"
+
++#ifdef __ppc__
++#ifndef __darwin_ppc_thread_state
++#define __darwin_ppc_thread_state ppc_thread_state
++#define __r0 r0
++#define __srr0 srr0
++#define __srr1 srr1
++#define __cr cr
++#define __xer xer
++#define __lr lr
++#define __ctr ctr
++#endif
++#ifndef __darwin_ppc_exception_state
++#define __darwin_ppc_exception_state ppc_exception_state
++#endif
++#endif
++
+ extern macosx_inferior_status *macosx_status;
+
+ #define CHECK_ARGS(what, args) \
diff --git a/sys-devel/gdb-apple/files/gdb-apple-1461-darwin8.patch b/sys-devel/gdb-apple/files/gdb-apple-1461-darwin8.patch
new file mode 100644
index 000000000000..40ef761e8f70
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-1461-darwin8.patch
@@ -0,0 +1,128 @@
+--- gdb-1461.2/src/gdb/macosx/macosx-nat-inferior.c
++++ gdb-1461.2/src/gdb/macosx/macosx-nat-inferior.c
+@@ -60,13 +60,17 @@
+ #include <sys/sysctl.h>
+ #include <sys/proc.h>
+ #include <mach/mach_error.h>
++#if defined(TARGET_ARM)
+ #include <spawn.h>
++#endif
+
+ #include <semaphore.h>
+
+ #include <dlfcn.h>
++#if 0
+ #include <libproc.h>
+ #include <sys/proc_info.h>
++#endif
+
+ #include "macosx-nat-dyld.h"
+ #include "macosx-nat-inferior.h"
+--- gdb-1461.2/src/gdb/macosx/macosx-nat-info.c
++++ gdb-1461.2/src/gdb/macosx/macosx-nat-info.c
+@@ -45,6 +45,22 @@
+ #include "macosx-nat-inferior.h"
+ #include "macosx-nat-inferior-debug.h"
+
++#ifdef __ppc__
++#ifndef __darwin_ppc_thread_state
++#define __darwin_ppc_thread_state ppc_thread_state
++#define __r0 r0
++#define __srr0 srr0
++#define __srr1 srr1
++#define __cr cr
++#define __xer xer
++#define __lr lr
++#define __ctr ctr
++#endif
++#ifndef __darwin_ppc_exception_state
++#define __darwin_ppc_exception_state ppc_exception_state
++#endif
++#endif
++
+ extern macosx_inferior_status *macosx_status;
+
+ #define CHECK_ARGS(what, args) \
+--- gdb-1461.2/src/gdb/macosx/macosx-nat-infthread.c
++++ gdb-1461.2/src/gdb/macosx/macosx-nat-infthread.c
+@@ -36,8 +36,10 @@
+ #include <sys/dir.h>
+ #include <inttypes.h>
+
++#if 0
+ #include <libproc.h>
+ #include <sys/proc_info.h>
++#endif
+
+ #include "macosx-nat-inferior.h"
+ #include "macosx-nat-inferior-util.h"
+--- gdb-1461.2/src/gdb/macosx/macosx-tdep.c
++++ gdb-1461.2/src/gdb/macosx/macosx-tdep.c
+@@ -63,7 +63,6 @@
+ #include "gdbcore.h"
+
+ #include <dirent.h>
+-#include <libgen.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
+--- gdb-1461.2/src/gdb/remote.c
++++ gdb-1461.2/src/gdb/remote.c
+@@ -62,7 +62,6 @@
+ #include "macosx-nat-dyld.h"
+ #include "macosx-nat-dyld-process.h"
+ #endif
+-#include <execinfo.h>
+
+ /* Prototypes for local functions. */
+ static void cleanup_sigint_signal_handler (void *dummy);
+@@ -474,11 +473,13 @@
+ static void
+ remote_backtrace_self (const char *message)
+ {
++#if 0
+ void *bt_buffer[100];
+ int count = backtrace (bt_buffer, 100);
+ if (message && message[0])
+ fprintf_filtered (gdb_stderr, "%s", message);
+ backtrace_symbols_fd (bt_buffer, count, STDERR_FILENO);
++#endif
+ }
+
+ static void
+--- gdb-1461.2/src/gdb/symfile.c
++++ gdb-1461.2/src/gdb/symfile.c
+@@ -67,7 +67,6 @@
+ #include <ctype.h>
+ #include <time.h>
+ #include <sys/time.h>
+-#include <libgen.h>
+
+ #include <sys/mman.h>
+
+--- gdb-1461.2/src/gdb/utils.c
++++ gdb-1461.2/src/gdb/utils.c
+@@ -27,7 +27,6 @@
+ #include "gdb_string.h"
+ #include "event-top.h"
+ #include "exceptions.h"
+-#include <execinfo.h>
+
+ #ifdef TUI
+ #include "tui/tui.h" /* For tui_get_command_dimension. */
+@@ -874,6 +873,7 @@
+ target_terminal_ours ();
+ begin_line ();
+
++#if 0
+ /* APPLE LOCAL: Do a stack crawl of how we got here so we're more likely
+ to get useful bug reports. */
+ {
+@@ -882,6 +882,7 @@
+ fprintf (stderr, "gdb stack crawl at point of internal error:\n");
+ backtrace_symbols_fd (bt_buffer, count, STDERR_FILENO);
+ }
++#endif
+
+ /* Create a string containing the full error/warning message. Need
+ to call query with this full string, as otherwize the reason
diff --git a/sys-devel/gdb-apple/files/gdb-apple-1461-dyld-info.patch b/sys-devel/gdb-apple/files/gdb-apple-1461-dyld-info.patch
new file mode 100644
index 000000000000..75b910432278
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-1461-dyld-info.patch
@@ -0,0 +1,22 @@
+If dyld-info is not available, don't try to compile unreachable code
+using it either.
+
+--- gdb-1461.2/src/gdb/macosx/macosx-nat-dyld.c
++++ gdb-1461.2/src/gdb/macosx/macosx-nat-dyld.c
+@@ -731,7 +731,7 @@
+ {
+ #if !defined (TASK_DYLD_INFO) || !defined (NM_NEXTSTEP)
+ return 0;
+-#endif
++#else
+
+ if (target_is_remote () || value == NULL)
+ return 0;
+@@ -791,6 +791,7 @@
+ }
+ #endif /* NM_NEXTSTEP */
+ return 0;
++#endif
+ }
+
+ /* Searches the target address space for dyld itself, returning it in
diff --git a/sys-devel/gdb-apple/files/gdb-apple-1518-darwin8-9.patch b/sys-devel/gdb-apple/files/gdb-apple-1518-darwin8-9.patch
new file mode 100644
index 000000000000..a05169cec25d
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-1518-darwin8-9.patch
@@ -0,0 +1,87 @@
+--- src/gdb/macosx/macosx-nat-dyld.c
++++ src/gdb/macosx/macosx-nat-dyld.c
+@@ -2083,7 +2083,9 @@
+ case MH_DYLIB:
+ case MH_DYLINKER:
+ case MH_BUNDLE:
++#ifdef MH_KEXT_BUNDLE
+ case MH_KEXT_BUNDLE:
++#endif
+ break;
+ case MH_FVMLIB:
+ case MH_PRELOAD:
+@@ -2412,7 +2414,9 @@
+ break;
+ case MH_DYLINKER:
+ case MH_BUNDLE:
++#ifdef MH_KEXT_BUNDLE
+ case MH_KEXT_BUNDLE:
++#endif
+ entry->reason = dyld_reason_dyld;
+ break;
+ default:
+--- src/gdb/macosx/macosx-nat-dyld-process.c
++++ src/gdb/macosx/macosx-nat-dyld-process.c
+@@ -407,7 +407,9 @@
+ case MH_DYLIB:
+ break;
+ case MH_BUNDLE:
++#ifdef MH_KEXT_BUNDLE
+ case MH_KEXT_BUNDLE:
++#endif
+ break;
+ default:
+ return;
+ return;
+--- src/gdb/macosx/macosx-nat-inferior.c
++++ src/gdb/macosx/macosx-nat-inferior.c
+@@ -2692,6 +2692,7 @@
+ if (tp->private == NULL || tp->private->app_thread_port == 0)
+ return NULL;
+
++#ifdef THREAD_IDENTIFIER_INFO_COUNT
+ thread_identifier_info_data_t tident;
+ unsigned int info_count;
+ kern_return_t kret;
+@@ -2719,6 +2720,7 @@
+ }
+ }
+ }
++#endif
+ return buf;
+ }
+
+--- src/gdb/macosx/macosx-nat-infthread.c
++++ src/gdb/macosx/macosx-nat-infthread.c
+@@ -809,6 +809,7 @@
+ print_stack_frame (get_selected_frame (NULL), 0, LOCATION);
+ switch_to_thread (current_ptid);
+
++#ifdef THREAD_IDENTIFIER_INFO_COUNT
+ thread_identifier_info_data_t tident;
+ info_count = THREAD_IDENTIFIER_INFO_COUNT;
+ kret = thread_info (tid, THREAD_IDENTIFIER_INFO, (thread_info_t) &tident,
+@@ -878,6 +879,7 @@
+ printf_filtered ("\tcurrent priority: %d\n", pth.pth_priority);
+ printf_filtered ("\tmax priority: %d\n", pth.pth_maxpriority);
+ }
++#endif
+
+ printf_filtered ("\tsuspend count: %d", info.suspend_count);
+
+@@ -1175,6 +1177,7 @@
+ ui_out_field_fmt (uiout, "mach-port-number", "0x%s",
+ paddr_nz (app_thread_name));
+
++#ifdef THREAD_IDENTIFIER_INFO_COUNT
+ thread_identifier_info_data_t tident;
+ info_count = THREAD_IDENTIFIER_INFO_COUNT;
+ kret = thread_info (tid, THREAD_IDENTIFIER_INFO, (thread_info_t) &tident,
+@@ -1207,6 +1210,7 @@
+ paddr_nz (struct_addr));
+ }
+ }
++#endif
+ }
+
+
diff --git a/sys-devel/gdb-apple/files/gdb-apple-1518-darwin8.patch b/sys-devel/gdb-apple/files/gdb-apple-1518-darwin8.patch
new file mode 100644
index 000000000000..f8ecc30be7f6
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-1518-darwin8.patch
@@ -0,0 +1,128 @@
+--- src/gdb/macosx/macosx-nat-inferior.c
++++ src/gdb/macosx/macosx-nat-inferior.c
+@@ -60,13 +60,17 @@
+ #include <sys/sysctl.h>
+ #include <sys/proc.h>
+ #include <mach/mach_error.h>
++#if defined(TARGET_ARM)
+ #include <spawn.h>
++#endif
+
+ #include <semaphore.h>
+
+ #include <dlfcn.h>
++#if 0
+ #include <libproc.h>
+ #include <sys/proc_info.h>
++#endif
+
+ #include "macosx-nat-dyld.h"
+ #include "macosx-nat-inferior.h"
+--- src/gdb/macosx/macosx-nat-info.c
++++ src/gdb/macosx/macosx-nat-info.c
+@@ -45,6 +45,22 @@
+ #include "macosx-nat-inferior.h"
+ #include "macosx-nat-inferior-debug.h"
+
++#ifdef __ppc__
++#ifndef __darwin_ppc_thread_state
++#define __darwin_ppc_thread_state ppc_thread_state
++#define __r0 r0
++#define __srr0 srr0
++#define __srr1 srr1
++#define __cr cr
++#define __xer xer
++#define __lr lr
++#define __ctr ctr
++#endif
++#ifndef __darwin_ppc_exception_state
++#define __darwin_ppc_exception_state ppc_exception_state
++#endif
++#endif
++
+ extern macosx_inferior_status *macosx_status;
+
+ #define CHECK_ARGS(what, args) \
+--- src/gdb/macosx/macosx-nat-infthread.c
++++ src/gdb/macosx/macosx-nat-infthread.c
+@@ -36,8 +36,10 @@
+ #include <sys/dir.h>
+ #include <inttypes.h>
+
++#if 0
+ #include <libproc.h>
+ #include <sys/proc_info.h>
++#endif
+
+ #include "macosx-nat-inferior.h"
+ #include "macosx-nat-inferior-util.h"
+--- src/gdb/macosx/macosx-tdep.c
++++ src/gdb/macosx/macosx-tdep.c
+@@ -64,7 +64,6 @@
+ #include "gdbcore.h"
+
+ #include <dirent.h>
+-#include <libgen.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/param.h>
+--- src/gdb/remote.c
++++ src/gdb/remote.c
+@@ -63,7 +63,6 @@
+ #include "macosx-nat-dyld.h"
+ #include "macosx-nat-dyld-process.h"
+ #endif
+-#include <execinfo.h>
+
+ /* Prototypes for local functions. */
+ static void cleanup_sigint_signal_handler (void *dummy);
+@@ -475,11 +474,13 @@
+ static void
+ remote_backtrace_self (const char *message)
+ {
++#if 0
+ void *bt_buffer[100];
+ int count = backtrace (bt_buffer, 100);
+ if (message && message[0])
+ fprintf_filtered (gdb_stderr, "%s", message);
+ backtrace_symbols_fd (bt_buffer, count, STDERR_FILENO);
++#endif
+ }
+
+ static void
+--- src/gdb/symfile.c
++++ src/gdb/symfile.c
+@@ -67,7 +67,6 @@
+ #include <ctype.h>
+ #include <time.h>
+ #include <sys/time.h>
+-#include <libgen.h>
+
+ #include <sys/mman.h>
+
+--- src/gdb/utils.c
++++ src/gdb/utils.c
+@@ -28,7 +28,6 @@
+ #include "event-top.h"
+ #include "exceptions.h"
+ #include "bfd.h"
+-#include <execinfo.h>
+ #include <sys/resource.h>
+ #include <uuid/uuid.h>
+
+@@ -879,6 +878,7 @@
+ target_terminal_ours ();
+ begin_line ();
+
++#if 0
+ /* APPLE LOCAL: Do a stack crawl of how we got here so we're more likely
+ to get useful bug reports. */
+ {
+@@ -887,6 +887,7 @@
+ fprintf (stderr, "gdb stack crawl at point of internal error:\n");
+ backtrace_symbols_fd (bt_buffer, count, STDERR_FILENO);
+ }
++#endif
+
+ /* Create a string containing the full error/warning message. Need
+ to call query with this full string, as otherwize the reason
diff --git a/sys-devel/gdb-apple/files/gdb-apple-1518-task_dyld_info.patch b/sys-devel/gdb-apple/files/gdb-apple-1518-task_dyld_info.patch
new file mode 100644
index 000000000000..633a36a7a048
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-1518-task_dyld_info.patch
@@ -0,0 +1,22 @@
+If dyld-info is not available, don't try to compile unreachable code
+using it either.
+
+--- gdb-1518/src/gdb/macosx/macosx-nat-dyld.c
++++ gdb-1518/src/gdb/macosx/macosx-nat-dyld.c
+@@ -779,7 +779,7 @@
+ {
+ #if !defined (TASK_DYLD_INFO)
+ return 0;
+-#endif
++#else
+ if (macosx_status->task == TASK_NULL)
+ return 0;
+
+@@ -799,6 +799,7 @@
+ task_dyld_info.all_image_info_size == 0)
+ return 0;
+ s->dyld_image_infos = task_dyld_info.all_image_info_addr;
++#endif /* TASK_DYLD_INFO */
+ }
+ #endif /* NM_NEXTSTEP */
+
diff --git a/sys-devel/gdb-apple/files/gdb-apple-1705-darwin8-10.patch b/sys-devel/gdb-apple/files/gdb-apple-1705-darwin8-10.patch
new file mode 100644
index 000000000000..32247431fe89
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-1705-darwin8-10.patch
@@ -0,0 +1,11 @@
+--- src/gdb/macosx/macosx-nat-dyld.c
++++ src/gdb/macosx/macosx-nat-dyld.c
+@@ -788,7 +788,7 @@
+ }
+ else
+ {
+-#if defined (NM_NEXTSTEP)
++#if defined (NM_NEXTSTEP) && defined(TASK_DYLD_INFO_COUNT)
+ if (macosx_status->task == TASK_NULL)
+ return 0;
+
diff --git a/sys-devel/gdb-apple/files/gdb-apple-563-darwin7.patch b/sys-devel/gdb-apple/files/gdb-apple-563-darwin7.patch
new file mode 100644
index 000000000000..bd5061d41fc0
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-563-darwin7.patch
@@ -0,0 +1,110 @@
+* Fabian Groffen <grobian@gentoo.org>
+ Mac OS X Panther (10.3) doesn't have mach_vm_size_t yet, and
+ apparently this was forseen in macosx-nat-inferior-debug.c. However,
+ macosx-nat-inferior-debug.h also uses the provided types, hence we
+ move the backwards-compatibility logic to the .h file.
+
+* Fabian Groffen <grobian@gentoo.org>
+ On Mac OS X Panther (10.3) an older version of the Launch Services is
+ available, which doesn't cover the requirements made by Xcode here.
+ Because it's for Xcode only, and we don't use it on Gentoo, we just
+ enable the functionality that doesn't compile on 10.3.
+
+--- gdb/macosx/macosx-nat-inferior-debug.c
++++ gdb/macosx/macosx-nat-inferior-debug.c
+@@ -53,24 +53,6 @@
+
+ #include <AvailabilityMacros.h>
+
+-#define MACH64 (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+-
+-#if MACH64
+-
+-#include <mach/mach_vm.h>
+-
+-#else /* ! MACH64 */
+-
+-#define mach_vm_size_t vm_size_t
+-#define mach_vm_address_t vm_address_t
+-#define mach_vm_read vm_read
+-#define mach_vm_write vm_write
+-#define mach_vm_region vm_region
+-#define VM_REGION_BASIC_INFO_COUNT_64 VM_REGION_BASIC_INFO_COUNT
+-#define VM_REGION_BASIC_INFO_64 VM_REGION_BASIC_INFO
+-
+-#endif /* MACH64 */
+-
+ FILE *inferior_stderr = NULL;
+ int inferior_debug_flag = 0;
+ int timestamps_debug_flag = 0;
+--- gdb/macosx/macosx-nat-inferior-debug.h
++++ gdb/macosx/macosx-nat-inferior-debug.h
+@@ -6,6 +6,24 @@
+
+ #include "defs.h"
+
++#define MACH64 (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
++
++#if MACH64
++
++#include <mach/mach_vm.h>
++
++#else /* ! MACH64 */
++
++#define mach_vm_size_t vm_size_t
++#define mach_vm_address_t vm_address_t
++#define mach_vm_read vm_read
++#define mach_vm_write vm_write
++#define mach_vm_region vm_region
++#define VM_REGION_BASIC_INFO_COUNT_64 VM_REGION_BASIC_INFO_COUNT
++#define VM_REGION_BASIC_INFO_64 VM_REGION_BASIC_INFO
++
++#endif /* MACH64 */
++
+ extern FILE *inferior_stderr;
+ extern int inferior_debug_flag;
+
+--- gdb/macosx/macosx-tdep.c
++++ gdb/macosx/macosx-tdep.c
+@@ -413,6 +413,7 @@
+ } BabelAESelInfo;
+ #pragma options align=reset
+
++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ static int
+ open_file_with_LS (const char *file_path, int lineno)
+ {
+@@ -538,7 +539,9 @@
+
+ return 1;
+ }
++#endif
+
++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ /* Opens the file pointed to in ARGS with the default editor
+ given by LaunchServices. If ARGS is NULL, opens the current
+ source file & line. You can also supply file:line and it will
+@@ -609,6 +612,7 @@
+
+ open_file_with_LS (filename, line_no);
+ }
++#endif
+
+ void
+ _initialize_macosx_tdep ()
+@@ -618,13 +622,15 @@
+
+ add_info ("trampoline", info_trampoline_command,
+ "Resolve function for DYLD trampoline stub and/or Objective-C call");
++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1040)
+ c = add_com ("open", class_support, open_command, _("\
+ Open the named source file in an application determined by LaunchServices.\n\
+ With no arguments, open the currently selected source file.\n\
+ Also takes file:line to hilight the file at the given line."));
+ set_cmd_completer (c, filename_completer);
+ add_com_alias ("op", "open", class_support, 1);
+ add_com_alias ("ope", "open", class_support, 1);
++#endif
+
+ add_com ("flushstack", class_maintenance, stack_flush_command,
+ "Force gdb to flush its stack-frame cache (maintainer command)");
diff --git a/sys-devel/gdb-apple/files/gdb-apple-563-no-64bit.patch b/sys-devel/gdb-apple/files/gdb-apple-563-no-64bit.patch
new file mode 100644
index 000000000000..952f5b337871
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-563-no-64bit.patch
@@ -0,0 +1,19 @@
+* Fabian Groffen <grobian@gentoo.org>
+ On Gentoo, when the user doesn't have a 64-bits capable CPU, we
+ compile GCC without multi-lib support. Hence, 64-bits defines are not
+ available so we better not use them if we don't have __ppc64__
+ defined.
+
+--- gdb/macosx/macosx-nat-dyld.c
++++ gdb/macosx/macosx-nat-dyld.c
+@@ -619,8 +619,10 @@
+ structures. */
+ if (header.cputype == CPU_TYPE_POWERPC || header.cputype == CPU_TYPE_I386)
+ osabi_seen_in_attached_dyld = GDB_OSABI_DARWIN;
++#if defined(__ppc64__)
+ if (header.cputype == CPU_TYPE_POWERPC64 || header.cputype == GDB_CPU_TYPE_X86_64)
+ osabi_seen_in_attached_dyld = GDB_OSABI_DARWIN64;
++#endif
+ }
+
+ /* Once we know the address at which dyld was loaded, we can try to
diff --git a/sys-devel/gdb-apple/files/gdb-apple-768-darwin-arch.patch b/sys-devel/gdb-apple/files/gdb-apple-768-darwin-arch.patch
new file mode 100644
index 000000000000..5442ba8ba636
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-768-darwin-arch.patch
@@ -0,0 +1,15 @@
+* configure checks for /usr/bin/arch to determine whether "arch" is ok
+ to use, so don't rely on the path at runtime, since GNU arch doesn't
+ understand -arch at all (and only returns the current arch name)
+
+--- src/gdb/fork-child.c
++++ src/gdb/fork-child.c
+@@ -243,7 +243,7 @@
+ arch_string = "x86_64";
+ #endif
+ if (arch_string != NULL)
+- sprintf (shell_command, "%s exec arch -arch %s ", shell_command, arch_string);
++ sprintf (shell_command, "%s exec /usr/bin/arch -arch %s ", shell_command, arch_string);
+ else
+ strcat (shell_command, "exec ");
+ }
diff --git a/sys-devel/gdb-apple/files/gdb-apple-768-texinfo.patch b/sys-devel/gdb-apple/files/gdb-apple-768-texinfo.patch
new file mode 100644
index 000000000000..41153d8436de
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-768-texinfo.patch
@@ -0,0 +1,10 @@
+--- src/Makefile.in
++++ src/Makefile.in
+@@ -280,6 +280,6 @@
+ then echo $$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo ; \
+ else if (${CONFIGURED_MAKEINFO} --version \
+- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \
++ | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|4\.[1-9][0-9]|[5-9])') >/dev/null 2>&1; \
+ then echo ${CONFIGURED_MAKEINFO}; else echo $$s/missing makeinfo; fi; fi`
+
+ # This just becomes part of the MAKEINFO definition passed down to
diff --git a/sys-devel/gdb-apple/files/gdb-apple-962-darwin64.patch b/sys-devel/gdb-apple/files/gdb-apple-962-darwin64.patch
new file mode 100644
index 000000000000..4417cee76e4d
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-962-darwin64.patch
@@ -0,0 +1,17 @@
+* todo: extend for powerpc64 also
+
+--- src/bfd/config.bfd.orig 2009-06-23 11:05:43 +0200
++++ src/bfd/config.bfd 2009-06-23 11:05:47 +0200
+@@ -500,6 +500,12 @@
+ targ_archs="bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
+ targ_underscore=yes
+ ;;
++ x86_64-*-darwin*)
++ targ_defvec=mach_o_le_vec
++ targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
++ targ_archs="bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch"
++ targ_underscore=yes
++ ;;
+ i[3-7]86-sequent-bsd*)
+ targ_defvec=i386dynix_vec
+ targ_underscore=yes
diff --git a/sys-devel/gdb-apple/files/gdb-apple-962-darwin8.patch b/sys-devel/gdb-apple/files/gdb-apple-962-darwin8.patch
new file mode 100644
index 000000000000..05a088b93fb3
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-962-darwin8.patch
@@ -0,0 +1,15 @@
+* 10.4 doesn't have posix spawn, but fortunately it's only used on ARM
+ (iPhone), so we can still compile it
+
+--- src/gdb/macosx/macosx-nat-inferior.c
++++ src/gdb/macosx/macosx-nat-inferior.c
+@@ -58,7 +58,9 @@
+ #include <sys/sysctl.h>
+ #include <sys/proc.h>
+ #include <mach/mach_error.h>
++#ifdef TARGET_ARM
+ #include <spawn.h>
++#endif
+
+ #include "macosx-nat-dyld.h"
+ #include "macosx-nat-inferior.h"
diff --git a/sys-devel/gdb-apple/files/gdb-apple-962-demangle.patch b/sys-devel/gdb-apple/files/gdb-apple-962-demangle.patch
new file mode 100644
index 000000000000..a302ce56ec91
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-962-demangle.patch
@@ -0,0 +1,22 @@
+in 32-bits mode this goes /just/ right, in 64-bits mode Portage aborts
+because objc_demangle is implicitly turned into a pointer
+
+--- src/gdb/maint.c.orig 2009-06-23 11:12:15 +0200
++++ src/gdb/maint.c 2009-06-23 11:19:58 +0200
+@@ -31,6 +31,7 @@
+ #include "symtab.h"
+ #include "gdbtypes.h"
+ #include "demangle.h"
++#include "objc-lang.h"
+ #include "gdbcore.h"
+ #include "expression.h" /* For language.h */
+ #include "language.h"
+@@ -167,7 +168,7 @@
+ switch (current_language->la_language)
+ {
+ case language_objc:
+- demangled = objc_demangle (args);
++ demangled = objc_demangle (args, 0);
+ break;
+ case language_objcplus:
+ case language_cplus:
diff --git a/sys-devel/gdb-apple/files/gdb-apple-no-global-gdbinit.patch b/sys-devel/gdb-apple/files/gdb-apple-no-global-gdbinit.patch
new file mode 100644
index 000000000000..0c132ec5b384
--- /dev/null
+++ b/sys-devel/gdb-apple/files/gdb-apple-no-global-gdbinit.patch
@@ -0,0 +1,23 @@
+Sourcing /etc/gdb.conf is annoying mainly because Apple put
+ set history save on
+in there, which means everywhere you run it, you end up with a
+.gdb_history file.
+
+--- src/gdb/main.c
++++ src/gdb/main.c
+@@ -675,6 +675,7 @@
+ memset (&cwdbuf, 0, sizeof (struct stat));
+ /* APPLE LOCAL end move inits up */
+ /* APPLE LOCAL begin global gdbinit */
++#ifdef WANT_GLOBAL_GDBINIT
+ memset (&globalbuf, 0, sizeof (struct stat));
+ stat (gdbinit_global, &globalbuf);
+ if (!inhibit_gdbinit)
+@@ -683,6 +684,7 @@
+ source_file (gdbinit_global, 0);
+ }
+ do_cleanups (ALL_CLEANUPS);
++#endif
+ /* APPLE LOCAL end global gdbinit */
+
+ /* APPLE LOCAL: Set the $_Xcode convenience variable at '0' before sourcing
diff --git a/sys-devel/gdb-apple/gdb-apple-1461.ebuild b/sys-devel/gdb-apple/gdb-apple-1461.ebuild
new file mode 100644
index 000000000000..39484c62c317
--- /dev/null
+++ b/sys-devel/gdb-apple/gdb-apple-1461.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils flag-o-matic
+
+APPLE_PV=${PV}.2
+DESCRIPTION="Apple branch of the GNU Debugger, Developer Tools 3.2.2"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/gdb-${APPLE_PV}.tar.gz"
+
+LICENSE="APSL-2 GPL-2"
+SLOT="0"
+
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+
+IUSE="nls"
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2
+ =dev-db/sqlite-3*"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/gdb-${APPLE_PV}/src
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-no-global-gdbinit.patch
+ epatch "${FILESDIR}"/${PN}-768-texinfo.patch
+ epatch "${FILESDIR}"/${P}-dyld-info.patch
+ [[ ${CHOST} == *-darwin8 ]] && epatch "${FILESDIR}"/${P}-darwin8.patch
+
+ # for FSF gcc / gcc-apple:42
+ sed -e 's/-Wno-long-double//' -i gdb/config/*/macosx.mh
+
+ eapply_user
+}
+
+src_configure() {
+ replace-flags -O? -O2
+ econf \
+ --disable-werror \
+ --disable-debug-symbols-framework \
+ $(use_enable nls) \
+ || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" libdir=/nukeme includedir=/nukeme install || die
+ rm -R "${D}"/nukeme || die
+ rm -Rf "${ED}"/usr/${CHOST} || die
+ mv "${ED}"/usr/bin/gdb "${ED}"/
+ rm -f "${ED}"/usr/bin/*
+ mv "${ED}"/gdb "${ED}"/usr/bin/
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -ge 9 ]] ; then
+ ewarn "Due to increased security measures in 10.5 and up, gdb is"
+ ewarn "not able to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb-apple/gdb-apple-1752.ebuild b/sys-devel/gdb-apple/gdb-apple-1752.ebuild
new file mode 100644
index 000000000000..6a6d6a5c511c
--- /dev/null
+++ b/sys-devel/gdb-apple/gdb-apple-1752.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils flag-o-matic
+
+APPLE_PV=${PV}
+DESCRIPTION="Apple branch of the GNU Debugger, Developer Tools 4.3"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/gdb-${APPLE_PV}.tar.gz"
+
+LICENSE="APSL-2 GPL-2"
+SLOT="0"
+
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+
+IUSE="nls"
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2
+ =dev-db/sqlite-3*"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/gdb-${APPLE_PV}/src
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-no-global-gdbinit.patch
+ epatch "${FILESDIR}"/${PN}-768-texinfo.patch
+ epatch "${FILESDIR}"/${PN}-1518-darwin8-9.patch
+ epatch "${FILESDIR}"/${PN}-1705-darwin8-10.patch
+ [[ ${CHOST} == *-darwin8 ]] && epatch "${FILESDIR}"/${PN}-1518-darwin8.patch
+
+ eapply_user
+}
+
+src_configure() {
+ replace-flags -O? -O2
+ econf \
+ --disable-werror \
+ --disable-debug-symbols-framework \
+ $(use_enable nls) \
+ || die
+}
+
+src_compile() {
+ # unable to work around parallel make issue
+ emake -j2 || die
+}
+
+src_install() {
+ emake -j2 DESTDIR="${D}" libdir=/nukeme includedir=/nukeme install || die
+ rm -R "${D}"/nukeme || die
+ rm -Rf "${ED}"/usr/${CHOST} || die
+ mv "${ED}"/usr/bin/gdb "${ED}"/
+ rm -f "${ED}"/usr/bin/*
+ mv "${ED}"/gdb "${ED}"/usr/bin/
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -ge 9 ]] ; then
+ ewarn "Due to increased security measures in 10.5 and up, gdb is"
+ ewarn "not able to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+ if use x86-macos || use x64-macos ; then
+ einfo "FSF gdb works on Intel-based OSX platforms, sometimes even"
+ einfo "better than gdb-apple. You can consider installing FSF gdb"
+ einfo "instead of gdb-apple, since the FSF version is surely more"
+ einfo "advanced than this old 6.8 version modified by Apple."
+ fi
+}
diff --git a/sys-devel/gdb-apple/gdb-apple-768-r1.ebuild b/sys-devel/gdb-apple/gdb-apple-768-r1.ebuild
new file mode 100644
index 000000000000..1206ecb0b60a
--- /dev/null
+++ b/sys-devel/gdb-apple/gdb-apple-768-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Apple branch of the GNU Debugger, 10.5"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/gdb-${PV}.tar.gz"
+
+LICENSE="APSL-2 GPL-2"
+SLOT="0"
+
+KEYWORDS="~ppc-macos ~x86-macos"
+
+IUSE="nls"
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2
+ =dev-db/sqlite-3*"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/gdb-${PV}/src
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-texinfo.patch
+ epatch "${FILESDIR}"/${P}-darwin-arch.patch
+
+ # for FSF gcc / gcc-apple:42
+ sed -e 's/-Wno-long-double//' -i gdb/config/*/macosx.mh
+
+ eapply_user
+}
+
+src_configure() {
+ replace-flags -O? -O2
+ econf \
+ --disable-werror \
+ $(use_enable nls) \
+ || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" libdir=/nukeme includedir=/nukeme install || die
+ rm -r "${D}"/nukeme || die
+ rm -Rf "${ED}"/usr/${CHOST} || die
+ mv "${ED}"/usr/bin/gdb "${ED}"/
+ rm -f "${ED}"/usr/bin/*
+ mv "${ED}"/gdb "${ED}"/usr/bin/
+}
diff --git a/sys-devel/gdb-apple/gdb-apple-966.ebuild b/sys-devel/gdb-apple/gdb-apple-966.ebuild
new file mode 100644
index 000000000000..15017df485c8
--- /dev/null
+++ b/sys-devel/gdb-apple/gdb-apple-966.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Apple branch of the GNU Debugger, Developer Tools 3.1.3"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="http://www.opensource.apple.com/darwinsource/tarballs/other/gdb-${PV}.tar.gz"
+
+LICENSE="APSL-2 GPL-2"
+SLOT="0"
+
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+
+IUSE="nls"
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2
+ =dev-db/sqlite-3*"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+S=${WORKDIR}/gdb-${PV}/src
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-768-texinfo.patch
+ epatch "${FILESDIR}"/${PN}-768-darwin-arch.patch
+ epatch "${FILESDIR}"/${PN}-962-darwin8.patch
+ epatch "${FILESDIR}"/${PN}-962-darwin64.patch
+ epatch "${FILESDIR}"/${PN}-962-demangle.patch
+
+ # for FSF gcc / gcc-apple:42
+ sed -e 's/-Wno-long-double//' -i gdb/config/*/macosx.mh
+
+ eapply_user
+}
+
+src_configure() {
+ replace-flags -O? -O2
+ econf \
+ --disable-werror \
+ $(use_enable nls) \
+ || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" libdir=/nukeme includedir=/nukeme install || die
+ rm -R "${D}"/nukeme || die
+ rm -Rf "${ED}"/usr/${CHOST} || die
+ mv "${ED}"/usr/bin/gdb "${ED}"/
+ rm -f "${ED}"/usr/bin/*
+ mv "${ED}"/gdb "${ED}"/usr/bin/
+}
+
+pkg_postinst() {
+ if [[ ${CHOST} == *-darwin* && ${CHOST#*-darwin} -ge 9 ]] ; then
+ elog "Due to increased security measures in 10.5 and up, gdb is"
+ elog "not able to get a mach task port when installed by Prefix"
+ elog "Portage, unprivileged. To make gdb fully functional you'll"
+ elog "have to perform the following steps:"
+ elog " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ elog " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb-apple/metadata.xml b/sys-devel/gdb-apple/metadata.xml
new file mode 100644
index 000000000000..0c982d881307
--- /dev/null
+++ b/sys-devel/gdb-apple/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>prefix@gentoo.org</email>
+ <name>Gentoo Prefix</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/gdb/Manifest b/sys-devel/gdb/Manifest
new file mode 100644
index 000000000000..ebacf206dcb5
--- /dev/null
+++ b/sys-devel/gdb/Manifest
@@ -0,0 +1,14 @@
+DIST gdb-7.10.1.tar.xz 18531436 SHA256 25c72f3d41c7c8554d61cacbeacd5f40993276d2ccdec43279ac546e3993d6d5 SHA512 17a5138277a31685a5c2a841cb47ed9bc4626ea617b8ca77750513b300299f4fbbffe504958b5372de610dcb952c679cf8fa9c1bdadd380294fbf59b6e366010 WHIRLPOOL 02936f59d3f3f8a57966c72402f1da128dd8e10e686097ffdb3a2741cc0c1831ef27f97daa047fa006ff2ae9f79ae0480f6f0dc2d3f5904190a1dade0590c837
+DIST gdb-7.12.1.tar.xz 19225392 SHA256 4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186 SHA512 0ac8d0a495103611ef41167a08313a010dce6ca4c6d827cbe8558a0c1a1a8a6bfa53f1b7704251289cababbfaaf9e075550cdf741a54d6cd9ca3433d910efcd8 WHIRLPOOL 1da1d9680639531000f2518fb6e01551f7d35091065b933a25381339f7d78d64486b7ce54dd9815f7e82884133ccd6868950a15c27fb5a7b9b13243e99eba697
+DIST gdb-7.9.1.tar.xz 17867692 SHA256 cd9c543a411a05b2b647dd38936034b68c2b5d6f10e0d51dc168c166c973ba40 SHA512 eebdf88b24e52e792b8a4b89ea85790de72b462a7810b44975fdf4232c068f353b15506071f450102a9d4bcecdde8e93dc3748a10699b7f73f3e04fb2d9d8414 WHIRLPOOL fe7afb392f453fa5aab290da3b74118c4e3bbae6f4e276f2efd7f978e3987e031d92ecd90d35e0531901f1cf68b04a313df050b25bb3b632d1b6e62360acd591
+DIST gdb-8.0.1.tar.xz 19583920 SHA256 3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 SHA512 5eb328910033f0918058be2f92caebf1e8dfc6caa3c730d99d621627e53de3c1b43761c2f683d53555893253c2f06768cbf56cdea051a3d291ffb6cfae87b5e1 WHIRLPOOL 4632580658f85faab596b98f4f9b3b21a48fc067f56c9ac987e4895f3bd1b430d8f78ef95965e0b78c53e69b502acdeeff5e966c3e8021e6426ce86b78807c17
+DIST gdb-8.0.tar.xz 19588616 SHA256 f6a24ffe4917e67014ef9273eb8b547cb96a13e5ca74895b06d683b391f3f4ee SHA512 e4044bdd162cbf95044ec1eaa44d2fa62a33e051bdbbacbc97afd4dfb07bae1bea514381fc1966aede89d6796ef2377a15748a93d95e2ad494c8497db489e886 WHIRLPOOL 8e5f49fd8d6a57778ba80cab8768fc11426720c15d54010f9fbcac2c6d8495e7d17ea133f9006d650ed34fdb95b82ac1942d935eaa6b7218fc51d6de6e2213bb
+EBUILD gdb-7.10.1.ebuild 6606 SHA256 db990c57f34ea8550352922f7103fc9c591d3057241111e9ef5093847cc0a3b5 SHA512 ac9409424ffdba44d825d16c0c9768ae0bc51c9deab4975845132f6b630ebf5cbb455344806b8a25425f9bb6a864ec06c3fc33f30abd0eb78e63e0af0f5d5665 WHIRLPOOL 0d07251e4c05c97585974fd91a97bb85a4fbe358b22550322c688556969ba4e2bc079a2e2d524f28c0562f837be7b5f8e8dbdc1637348ed3b66edd771068a34c
+EBUILD gdb-7.12.1.ebuild 6622 SHA256 08321ab7e95ad7b449f82bcf48fc99472176b36f3abae87bc683957378021e25 SHA512 55057ce019f5a9a97ea81e5f2b6c48dd669c1c90b7f7d53591fce50267b05112c6832a4e615671cee5cdb408a4fdb24da4cd6bddf10250696a72f0b4f9ac2aa0 WHIRLPOOL 64c6b8de69c14851e9de14b3e9ea1b8d0c82796ef8b66d36875fd3ee9153be130f824fdfc7d149cbf246428b9f732a0cec271dcd3ec48eacee3d7b015f7c87b5
+EBUILD gdb-7.9.1.ebuild 5944 SHA256 d151fc0b427649f34852b39cbd7d30a7b572a6836200927162cc9f293e2ea654 SHA512 7fe1fb5eba8ccb86f7b0fad0d433b7a5687421c9f8a57a4f6f393d09c840dd66e8f109873ff9772c2ea7209c5f4b95d2af6d8abe8e3e4c397bc0a96eba08871a WHIRLPOOL 1229626c939cf5d7cc8234dbd0a3ecd8111f0e329d69521a0ce54a9129ab25a0b89cc9d7ae4266d87613e6921c14633b2ba0cf852166431330529c3e29c7a9fc
+EBUILD gdb-8.0.1.ebuild 6869 SHA256 2a418b9f27aa3d6824987921834e3920f9c904ee20775896b58736fdde3266e3 SHA512 a9d6d0c65886a9a14ce87c523e7ec1ac42057cf7ca8420d60ca8d1d90315b83642a898dbb7e37ea6b3fb4f5e3585ac88c0ff52faaf7deb00199d3fa2babf4755 WHIRLPOOL b405ec5227ee2da7626c3e31610c3b045c480c51573f7f16c506257da7b473306ee5b298881dfbd1cd6b4f7bb17e23abd2d4f9d0bd8f89a37a9602a3603b205b
+EBUILD gdb-8.0.ebuild 6811 SHA256 61331a963672b56addb05bdff5cea89ae9e5272e93c32fdfc87e704354212f55 SHA512 3d6f7ce0483625f2772223de9fcbfac47d083cbb7278064f226ffa8476f68d8e236f131b6748b12ebf23a438ceb28e6c29b849607cc2fcb9af424bb772c43ab0 WHIRLPOOL a0c1ee74e60aafe81ec30a06b7eb81577dabae729ebf4cd7d4a87a16896c497d6a435800a780f09b80d8cc8c5e68811128d651fcf71b9b1b83bcda94c69932f0
+EBUILD gdb-9999.ebuild 6600 SHA256 aed0c901932cc1a77d38a0374d2223bdc064034a95cfb26ed23b6dd316124a87 SHA512 49415dad8c311943379a875926cb9254aa4c17f704c11a2cf292ae01028f5d6a1e99141c9f0301eedb85f8147af07ff6d4bbc44c31d31be94b03db5ef38ca734 WHIRLPOOL 32933f02fa88cf429d4e9106c772f2b27e23fe2f7451a28a7c4e8695fbb99d05852b7d69ac77552fc19d417561cae288aaa40ee44f38dd6368a7fa66f1190f5f
+MISC ChangeLog 10921 SHA256 c2c8b28f104f15468a559b1ed3d186c806aa553cb1404b2f77031e3d303a6241 SHA512 49c8e54c46b6678826839f092256113f8e8153a595b5408068acd7ac36fad4caec1a67b5982791446cc0d96ec9cc5477e2a0c2c61374f76d78dc7e77a89c6589 WHIRLPOOL e087599d93da1db77788ba75dc844ff9b33a8acaf4c406f5094e15edd616e45c3521b7292d81949afe631284e1e2163acf92ed25d9756524181df24af22916e6
+MISC ChangeLog-2015 40707 SHA256 7045b7ab416919cbe9c2ec6730f596adec722f6d2fefe00938945215738b0c66 SHA512 6d9c38a07f5688cf70288f918f600afe29a66b2b1041bd54b57c2226e7d3939c4cd46365ee27b1c30ad5f28ebacf56d54b68bda3f79ac3c11cdf3d2eee23d01c WHIRLPOOL b4f2efcdf31032f168e1c13fd6921a8eaeaaffd4f61c43d7ee9fbadfb52872949cfde9175708c57691e5e2116c68bda061bad0f6997f83be4340aa040d7912a2
+MISC metadata.xml 914 SHA256 b7651e2c8051c8b35a3c1080d50f1ba811ea40c42e8fb8e2eefd80a2b12832ae SHA512 515a5bcd6c70fc87309cd4e3822d83e1b8fdf52e58cbf331df0c38b9096ad2410dfdad14aed100ea0a53457f57ecdf2b61b910b6a52765219815e1872872ee0c WHIRLPOOL 237a1084550bbce7ddee98681b87fdcd6207c1f6cc40ff1aad1f623a5cd47f1ba3f3c6ae8558399264d52ada246b22cef53f59e2392c376e89524d50623d9524
diff --git a/sys-devel/gdb/gdb-7.10.1.ebuild b/sys-devel/gdb/gdb-7.10.1.ebuild
new file mode 100644
index 000000000000..c662f0cffde3
--- /dev/null
+++ b/sys-devel/gdb/gdb-7.10.1.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ # alpha #562128
+ KEYWORDS="-alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="+client expat lzma multitarget nls +python +server test vanilla"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ expat? ( dev-libs/expat )
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-7.12.1.ebuild b/sys-devel/gdb/gdb-7.12.1.ebuild
new file mode 100644
index 000000000000..928e2912f4e6
--- /dev/null
+++ b/sys-devel/gdb/gdb-7.12.1.ebuild
@@ -0,0 +1,235 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ # alpha #562128
+ KEYWORDS="-alpha amd64 arm ~arm64 ~hppa ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="+client lzma multitarget nls +python +server test vanilla xml"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ xml? ( dev-libs/expat )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with xml expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-7.9.1.ebuild b/sys-devel/gdb/gdb-7.9.1.ebuild
new file mode 100644
index 000000000000..f2d998373a9f
--- /dev/null
+++ b/sys-devel/gdb/gdb-7.9.1.ebuild
@@ -0,0 +1,221 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ KEYWORDS="alpha"
+fi
+IUSE="+client expat lzma multitarget nls +python +server test vanilla zlib"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ expat? ( dev-libs/expat )
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ zlib? ( sys-libs/zlib )
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ $(use_with zlib)
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-8.0.1.ebuild b/sys-devel/gdb/gdb-8.0.1.ebuild
new file mode 100644
index 000000000000..82cbc96263c0
--- /dev/null
+++ b/sys-devel/gdb/gdb-8.0.1.ebuild
@@ -0,0 +1,246 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ # alpha #562128
+ KEYWORDS="-alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="+client lzma multitarget nls +python +server test vanilla xml"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ xml? ( dev-libs/expat )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+
+ default
+
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with xml expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+ if use sparc-solaris || use x86-solaris ; then
+ # disable largefile support
+ # https://sourceware.org/ml/gdb-patches/2014-12/msg00058.html
+ myconf+=( --disable-largefile )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ if use server && ! use client; then
+ cd gdb/gdbserver || die
+ fi
+ default
+ if use client; then
+ find "${ED}"/usr -name libiberty.a -delete || die
+ fi
+ cd "${S}" || die
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete || die
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale} || die
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-8.0.ebuild b/sys-devel/gdb/gdb-8.0.ebuild
new file mode 100644
index 000000000000..825036422890
--- /dev/null
+++ b/sys-devel/gdb/gdb-8.0.ebuild
@@ -0,0 +1,242 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ # alpha #562128
+ KEYWORDS="-alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="+client lzma multitarget nls +python +server test vanilla xml"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ xml? ( dev-libs/expat )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+
+ default
+
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with xml expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+ if use sparc-solaris || use x86-solaris ; then
+ # disable largefile support
+ # https://sourceware.org/ml/gdb-patches/2014-12/msg00058.html
+ myconf+=( --disable-largefile )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/gdb-9999.ebuild b/sys-devel/gdb/gdb-9999.ebuild
new file mode 100644
index 000000000000..8ae03593af2f
--- /dev/null
+++ b/sys-devel/gdb/gdb-9999.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+
+inherit flag-o-matic eutils python-single-r1
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+RPM=
+MY_PV=${PV}
+case ${PV} in
+9999*)
+ # live git tree
+ EGIT_REPO_URI="git://sourceware.org/git/binutils-gdb.git"
+ inherit git-2
+ SRC_URI=""
+ ;;
+*.*.50.2???????)
+ # weekly snapshots
+ SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
+ ;;
+*.*.*.*.*.*)
+ # fedora versions; note we swap the rpm & fedora core versions.
+ # gdb-6.8.50.20090302-8.fc11.src.rpm -> gdb-6.8.50.20090302.11.8.ebuild
+ # gdb-7.9-11.fc23.src.rpm -> gdb-7.9.23.11.ebuild
+ inherit versionator rpm
+ gvcr() { get_version_component_range "$@"; }
+ parse_fedora_ver() {
+ set -- $(get_version_components)
+ MY_PV=$(gvcr 1-$(( $# - 2 )))
+ RPM="${PN}-${MY_PV}-$(gvcr $#).fc$(gvcr $(( $# - 1 ))).src.rpm"
+ }
+ parse_fedora_ver
+ SRC_URI="mirror://fedora-dev/development/rawhide/source/SRPMS/g/${RPM}"
+ ;;
+*)
+ # Normal upstream release
+ SRC_URI="mirror://gnu/gdb/${P}.tar.xz
+ ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
+ ;;
+esac
+
+PATCH_VER=""
+DESCRIPTION="GNU debugger"
+HOMEPAGE="https://sourceware.org/gdb/"
+SRC_URI="${SRC_URI} ${PATCH_VER:+mirror://gentoo/${P}-patches-${PATCH_VER}.tar.xz}"
+
+LICENSE="GPL-2 LGPL-2"
+SLOT="0"
+if [[ ${PV} != 9999* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+IUSE="+client lzma multitarget nls +python +server test vanilla xml"
+REQUIRED_USE="
+ python? ( ${PYTHON_REQUIRED_USE} )
+ || ( client server )
+"
+
+RDEPEND="server? ( !dev-util/gdbserver )
+ client? (
+ >=sys-libs/ncurses-5.2-r2:0=
+ sys-libs/readline:0=
+ lzma? ( app-arch/xz-utils )
+ python? ( ${PYTHON_DEPS} )
+ xml? ( dev-libs/expat )
+ sys-libs/zlib
+ )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ sys-apps/texinfo
+ client? (
+ virtual/yacc
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ )"
+
+S=${WORKDIR}/${PN}-${MY_PV}
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ [[ -n ${RPM} ]] && rpm_spec_epatch "${WORKDIR}"/gdb.spec
+ ! use vanilla && [[ -n ${PATCH_VER} ]] && EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch_user
+ strip-linguas -u bfd/po opcodes/po
+}
+
+gdb_branding() {
+ printf "Gentoo ${PV} "
+ if ! use vanilla && [[ -n ${PATCH_VER} ]] ; then
+ printf "p${PATCH_VER}"
+ else
+ printf "vanilla"
+ fi
+ [[ -n ${EGIT_COMMIT} ]] && printf " ${EGIT_COMMIT}"
+}
+
+src_configure() {
+ strip-unsupported-flags
+
+ local myconf=(
+ --with-pkgversion="$(gdb_branding)"
+ --with-bugurl='https://bugs.gentoo.org/'
+ --disable-werror
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{binutils,etc,gas,gold,gprof,ld}
+ )
+ local sysroot="${EPREFIX}/usr/${CTARGET}"
+ is_cross && myconf+=(
+ --with-sysroot="${sysroot}"
+ --includedir="${sysroot}/usr/include"
+ --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
+ )
+
+ if use server && ! use client ; then
+ # just configure+build in the gdbserver subdir to speed things up
+ cd gdb/gdbserver
+ myconf+=( --program-transform-name='' )
+ else
+ # gdbserver only works for native targets (CHOST==CTARGET).
+ # it also doesn't support all targets, so rather than duplicate
+ # the target list (which changes between versions), use the
+ # "auto" value when things are turned on.
+ is_cross \
+ && myconf+=( --disable-gdbserver ) \
+ || myconf+=( $(use_enable server gdbserver auto) )
+ fi
+
+ if ! ( use server && ! use client ) ; then
+ # if we are configuring in the top level, then use all
+ # the additional global options
+ myconf+=(
+ --enable-64-bit-bfd
+ --disable-install-libbfd
+ --disable-install-libiberty
+ # Disable guile for now as it requires guile-2.x #562902
+ --without-guile
+ # This only disables building in the readline subdir.
+ # For gdb itself, it'll use the system version.
+ --disable-readline
+ --with-system-readline
+ # This only disables building in the zlib subdir.
+ # For gdb itself, it'll use the system version.
+ --without-zlib
+ --with-system-zlib
+ --with-separate-debug-dir="${EPREFIX}"/usr/lib/debug
+ $(use_with xml expat)
+ $(use_with lzma)
+ $(use_enable nls)
+ $(use multitarget && echo --enable-targets=all)
+ $(use_with python python "${EPYTHON}")
+ )
+ fi
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ nonfatal emake check || ewarn "tests failed"
+}
+
+src_install() {
+ use server && ! use client && cd gdb/gdbserver
+ default
+ use client && find "${ED}"/usr -name libiberty.a -delete
+ cd "${S}"
+
+ # Delete translations that conflict with binutils-libs. #528088
+ # Note: Should figure out how to store these in an internal gdb dir.
+ if use nls ; then
+ find "${ED}" \
+ -regextype posix-extended -regex '.*/(bfd|opcodes)[.]g?mo$' \
+ -delete
+ fi
+
+ # Don't install docs when building a cross-gdb
+ if [[ ${CTARGET} != ${CHOST} ]] ; then
+ rm -r "${ED}"/usr/share/{doc,info,locale}
+ local f
+ for f in "${ED}"/usr/share/man/*/* ; do
+ if [[ ${f##*/} != ${CTARGET}-* ]] ; then
+ mv "${f}" "${f%/*}/${CTARGET}-${f##*/}" || die
+ fi
+ done
+ return 0
+ fi
+ # Install it by hand for now:
+ # https://sourceware.org/ml/gdb-patches/2011-12/msg00915.html
+ # Only install if it exists due to the twisted behavior (see
+ # notes in src_configure above).
+ [[ -e gdb/gdbserver/gdbreplay ]] && dobin gdb/gdbserver/gdbreplay
+
+ if use client ; then
+ docinto gdb
+ dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
+ gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
+ fi
+ docinto sim
+ dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
+ if use server ; then
+ docinto gdbserver
+ dodoc gdb/gdbserver/{ChangeLog,README}
+ fi
+
+ if [[ -n ${PATCH_VER} ]] ; then
+ dodoc "${WORKDIR}"/extra/gdbinit.sample
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/usr/share/info/{annotate,bfd,configure,standards}.info*
+}
+
+pkg_postinst() {
+ # portage sucks and doesnt unmerge files in /etc
+ rm -vf "${EROOT}"/etc/skel/.gdbinit
+
+ if use prefix && [[ ${CHOST} == *-darwin* ]] ; then
+ ewarn "gdb is unable to get a mach task port when installed by Prefix"
+ ewarn "Portage, unprivileged. To make gdb fully functional you'll"
+ ewarn "have to perform the following steps:"
+ ewarn " % sudo chgrp procmod ${EPREFIX}/usr/bin/gdb"
+ ewarn " % sudo chmod g+s ${EPREFIX}/usr/bin/gdb"
+ fi
+}
diff --git a/sys-devel/gdb/metadata.xml b/sys-devel/gdb/metadata.xml
new file mode 100644
index 000000000000..d11b1ea4a91e
--- /dev/null
+++ b/sys-devel/gdb/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+<use>
+ <flag name="client">Install the main "gdb" program (most people want this)</flag>
+ <flag name="lzma">Support lzma compression in ELF debug info</flag>
+ <flag name="multitarget">Support all known targets in one gdb binary</flag>
+ <flag name="python">Enable support for the new internal scripting language, as well as extended pretty printers</flag>
+ <flag name="server">Install the "gdbserver" program (useful for embedded/remote targets)</flag>
+ <flag name="xml">Support parsing XML data files needed (at least) for cpu features, memory maps, and syscall tracing</flag>
+</use>
+<upstream>
+ <remote-id type="cpe">cpe:/a:gnu:gdb</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-devel/gettext/Manifest b/sys-devel/gettext/Manifest
new file mode 100644
index 000000000000..62b002765271
--- /dev/null
+++ b/sys-devel/gettext/Manifest
@@ -0,0 +1,6 @@
+AUX gettext-0.19.7-disable-libintl.patch 1307 SHA256 b27e33f1466a079607a792c01599e6b7e7427e039537bbfaf2d5e3491a4dcc2d SHA512 7887d2fbf4b9d9677688e6d8d785b6c10c76bc330cb7b40da432e0a1ff0f7fc1355bf8f671041a37477baa6c8508b6e39f90ead468674febd62777506badc227 WHIRLPOOL 41f4b2b12a9ca83f679c8c672fffe090d09e0a4c2f8512e64fe30fe1da8178f858faf94a8f1c752f8e865aa8ceacb3e474298889462385884cfa42aa8a3b9e13
+DIST gettext-0.19.8.1.tar.gz 19704011 SHA256 ff942af0e438ced4a8b0ea4b0b6e0d6d657157c5e2364de57baa279c1c125c43 SHA512 073042fa2dc48804c58e76f036130a669e19612c25427b0ab14d0b366b549a63751bf3af03bfd0745d7c4f72497a4b2aab26a3cc6de83189ce111679073878e1 WHIRLPOOL ef9aa9eef3067595dc725169075401dfad8ba15d6224d2b563e3421afa7c4dce9336a287147404273b772def811230b3758c005902ec90192e6ee4ac373d9a9a
+EBUILD gettext-0.19.8.1.ebuild 3867 SHA256 0ae9be05c1e04484094345672b2ec483f7c0f51443378f17a31711426db9f1fe SHA512 11e87aa6a4841c9b173bfa142f30e8370df6e7c16c202d7c6e350411926a809d7367f160ff3e094d6a9860baafbf3c26f3ec07601a4bf4a64793dd93f3890a94 WHIRLPOOL 9c5fe5a199661423d483330ac941717d560ebeb887a5a5465782229c5be32954da077a0d4e2094134c528af11901da83487dc662e52ade1fb900fe2813932e7f
+MISC ChangeLog 10304 SHA256 cd76fe0b51b2b539e7e73e4f73d7cd49cc047af2ecb2d1690b19ecb5d77c3bda SHA512 0c8df7c2af8ec3bd49537290be74ab482c3e07cf18808db1f8ca54c5d03afd17a372fc1419bb15179a01943b30fc826178a8fe74591b26cc856b6df1df8e3cd6 WHIRLPOOL 7f59542a34891d45804125def4ed569753258599cf30b06cf8ea5daff33133e62757a079c85a87d9b8ef2492a588f57b0c2462d7e6b1879526fe60cf83b78df1
+MISC ChangeLog-2015 36817 SHA256 037bc77bf0a97f45bde0a74b220a43048fa9c99d78c709e504b1822833a9abc2 SHA512 80e6e8120717bbe49b2a267887b425f4c3d00d97d4b0c509511181d5d2069727155bc1003423d0657b639c09438d8b4118beb2f9262fd4ad02761e947fe3f222 WHIRLPOOL 4f3fdbfe933b7f8d3669a94c2a676c675fae6596870f1cbc712871a5de90777a1f325101751d110298d8b3c879ed17bc4cecb66bd77c55a39d0674cb89c267af
+MISC metadata.xml 630 SHA256 5e5aecc7a7c777f2bb2a3137d66e48218fa979965d59250af1cdb3b0cf8e161d SHA512 2eac2c110dde44856c6b45a3a1f5d58e26b887041fe8250c17ee6ca555240204296592a25122cf7595551b83b6414a4890a0886458dc4ff4e9135e2bbfc86507 WHIRLPOOL 095b6f0c61a74e9bcbc07b541e69d001e1d96a922bf8b5bc6afc00048dcee51442d7c36c782fd8efa0c48cf1519bccea640372dab06aa259ab7c50cd1f8f547b
diff --git a/sys-devel/gettext/files/gettext-0.19.7-disable-libintl.patch b/sys-devel/gettext/files/gettext-0.19.7-disable-libintl.patch
new file mode 100644
index 000000000000..f51de3484331
--- /dev/null
+++ b/sys-devel/gettext/files/gettext-0.19.7-disable-libintl.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/564168
+Never build libintl since it's in dev-libs/libintl now.
+
+We can drop this if/when upstream fixes the configure flag handling:
+https://savannah.gnu.org/bugs/?48233
+
+--- a/gettext-runtime/configure
++++ b/gettext-runtime/configure
+@@ -20391,8 +20391,7 @@ $as_echo "$ac_res" >&6; }
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+- && test "$PACKAGE" != gettext-runtime \
+- && test "$PACKAGE" != gettext-tools; }; then
++ }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ LIBINTL=
+--- a/gettext-tools/configure
++++ b/gettext-tools/configure
+@@ -22746,8 +22746,7 @@ $as_echo "$ac_res" >&6; }
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+- && test "$PACKAGE" != gettext-runtime \
+- && test "$PACKAGE" != gettext-tools; }; then
++ }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ LIBINTL=
diff --git a/sys-devel/gettext/gettext-0.19.8.1.ebuild b/sys-devel/gettext/gettext-0.19.8.1.ebuild
new file mode 100644
index 000000000000..98f51b7a799e
--- /dev/null
+++ b/sys-devel/gettext/gettext-0.19.8.1.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: Keep version bumps in sync with dev-libs/libintl.
+
+EAPI="5"
+
+inherit epatch epunt-cxx ltprune mono-env libtool java-pkg-opt-2 multilib-minimal
+
+DESCRIPTION="GNU locale utilities"
+HOMEPAGE="https://www.gnu.org/software/gettext/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+# Only libasprintf is under the LGPL (and libintl is in a sep package),
+# so put that license behind USE=cxx.
+LICENSE="GPL-3+ cxx? ( LGPL-2.1+ )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE="acl -cvs +cxx doc emacs git java ncurses nls openmp static-libs"
+
+# only runtime goes multilib
+# Note: The version of libxml2 corresponds to the version bundled via gnulib.
+# If the build detects too old of a system version, it will end up falling back
+# to the bundled copy. #596918
+# Note: expat lacks a subslot because it is dynamically loaded at runtime. We
+# would depend on older subslots if they were available (based on the ABIs that
+# are explicitly handled), but expat doesn't currently use subslots.
+DEPEND=">=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
+ >=virtual/libintl-0-r2[${MULTILIB_USEDEP}]
+ >=dev-libs/libxml2-2.9.3:=
+ dev-libs/expat
+ acl? ( virtual/acl )
+ ncurses? ( sys-libs/ncurses:0= )
+ java? ( >=virtual/jdk-1.4:= )"
+RDEPEND="${DEPEND}
+ !git? ( cvs? ( dev-vcs/cvs ) )
+ git? ( dev-vcs/git )
+ java? ( >=virtual/jre-1.4 )"
+PDEPEND="emacs? ( app-emacs/po-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ # only installed for native ABI
+ /usr/include/gettext-po.h
+)
+
+pkg_setup() {
+ mono-env_pkg_setup
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+
+ epatch "${FILESDIR}"/${PN}-0.19.7-disable-libintl.patch #564168
+
+ epunt_cxx
+ elibtoolize
+}
+
+multilib_src_configure() {
+ local myconf=(
+ # switches common to runtime and top-level
+ --cache-file="${BUILD_DIR}"/config.cache
+ --docdir="\$(datarootdir)/doc/${PF}"
+
+ # Emacs support is now in a separate package
+ --without-emacs
+ --without-lispdir
+ # glib depends on us so avoid circular deps
+ --with-included-glib
+ # libcroco depends on glib which ... ^^^
+ --with-included-libcroco
+ # this will _disable_ libunistring (since it is not bundled),
+ # see bug #326477
+ --with-included-libunistring
+ # Never build libintl since it's in dev-libs/libintl now.
+ --without-included-gettext
+ # Never build bundled copy of libxml2.
+ --without-included-libxml
+
+ $(use_enable acl)
+ $(use_enable cxx c++)
+ $(use_enable cxx libasprintf)
+ $(use_with git)
+ $(usex git --without-cvs $(use_with cvs))
+ $(use_enable java)
+ $(use_enable ncurses curses)
+ $(use_enable nls)
+ $(use_enable openmp)
+ $(use_enable static-libs static)
+ )
+
+ local ECONF_SOURCE=${S}
+ if ! multilib_is_native_abi ; then
+ # for non-native ABIs, we build runtime only
+ ECONF_SOURCE+=/gettext-runtime
+ fi
+
+ econf "${myconf[@]}"
+}
+
+multilib_src_install() {
+ default
+
+ if multilib_is_native_abi ; then
+ dosym msgfmt /usr/bin/gmsgfmt #43435
+ dobin gettext-tools/misc/gettextize
+ fi
+}
+
+multilib_src_install_all() {
+ use nls || rm -r "${ED}"/usr/share/locale
+ use static-libs || prune_libtool_files --all
+
+ rm -f "${ED}"/usr/share/locale/locale.alias "${ED}"/usr/lib/charset.alias
+
+ if use java ; then
+ java-pkg_dojar "${ED}"/usr/share/${PN}/*.jar
+ rm -f "${ED}"/usr/share/${PN}/*.jar
+ rm -f "${ED}"/usr/share/${PN}/*.class
+ if use doc ; then
+ java-pkg_dojavadoc "${ED}"/usr/share/doc/${PF}/javadoc2
+ rm -rf "${ED}"/usr/share/doc/${PF}/javadoc2
+ fi
+ fi
+
+ if use doc ; then
+ dohtml "${ED}"/usr/share/doc/${PF}/*.html
+ else
+ rm -rf "${ED}"/usr/share/doc/${PF}/{csharpdoc,examples,javadoc2,javadoc1}
+ fi
+ rm -f "${ED}"/usr/share/doc/${PF}/*.html
+
+ dodoc AUTHORS ChangeLog NEWS README THANKS
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+}
diff --git a/sys-devel/gettext/metadata.xml b/sys-devel/gettext/metadata.xml
new file mode 100644
index 000000000000..7844da809a7c
--- /dev/null
+++ b/sys-devel/gettext/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<use>
+ <flag name="cvs">
+ When running `autopoint`, use cvs to store the internal development files;
+ this requires cvs at runtime, but will be faster/smaller than raw archives
+ </flag>
+ <flag name="git">
+ When running `autopoint`, use git to store the internal development files;
+ this requires git at runtime, but will be faster/smaller than raw archives
+ </flag>
+</use>
+</pkgmetadata>
diff --git a/sys-devel/gnuconfig/Manifest b/sys-devel/gnuconfig/Manifest
new file mode 100644
index 000000000000..48e043c00c9d
--- /dev/null
+++ b/sys-devel/gnuconfig/Manifest
@@ -0,0 +1,12 @@
+AUX 99999999/0002-Add-x32-support-to-config.guess.patch 1315 SHA256 4ac653fefdcd1865b8cb4df24cd4ee3fe9a0df3c5b744a95d375551e17d4ea8c SHA512 e35aa9b56acc50bad8f560fb4def75c79bf8090e6595d5a66ec10f2a12ac1037dac9c0e5c1c4b66946dac26b97f845011952d1472625753294c295e82f67cb6a WHIRLPOOL 3d7eab4aa045d487740dad4da37fdb09c3ce36f8233e441ac7e37874b70f6762482981cd8c6ddf5387a0b0cfc71093699347b73816cd731d16c436f8d2b5297e
+AUX 99999999/0002-add-ps2-targets-to-config.sub.patch 1690 SHA256 ae54f8a1e8ee233bbb94064a54587f6d1215397b0de9371af2ee57d77133ad52 SHA512 cb53feeaa937a72b3d64a45120890fdbb5c8eb93124da6528fcbbf03fff0d4f08d252fed1331d40de5cd34f09dc9e05d175e24fe097f274b141b73366f8cb0ad WHIRLPOOL 49a152bbaf84389cd669ab784e063e72aebb42779553a485487132ed00d34699ee1c64f5313f6b273aa80fd469d0b7cfccecaed2df3e689d51e7684190ed9b4e
+DIST gnuconfig-20160402.tar.bz2 48351 SHA256 fa6f54f7d93b2640defedf36158f6857d18a23e657dc6c52e4dc153f39aeefa3 SHA512 df63ad5ea1748acf1bdf879a1954aa8cc8dd77856428aee919e38700b0fb792606925d6b7c0dca5561e8589f379e3d8e42bea8e50ceabf1ca1ba8038c55866e5 WHIRLPOOL 63b31e7a47de2035104686f2124e5581cfaed360861764fe577c952277fde3526f6fd7fa42ee177af674ef64bc892fd9afdb3de7c3a67f68fd64b080622d307e
+DIST gnuconfig-20161104.tar.bz2 49977 SHA256 fabdf38c789c8088859f70c9675eef04faf03a025aa4aeb636f4ab181a141eaf SHA512 976b29363aaeaddf4d0520e1458b7fd3f91adf4e4f54c732acba984b9fd59a67c72488a439cc848deae32de8e6884b372ff5e5bb2972ea1e8eb9ddb222816f56 WHIRLPOOL 89f7974342b39db5ec1ddbbeeab573ab8140fe3afc93dade74fa9cf7b837200dca00d7d0cb5391b66893d5c641f0dea8ea3b735bc593f892981b4d6d4a022778
+DIST gnuconfig-20170101.tar.bz2 50152 SHA256 7d171fe39cb3ca97975debd47e1e9474dde3c9fffa723ac7c0f6694208743e17 SHA512 a4d72b50f0c6ebae702b4d51aaeb459ac2b325f9f79ff6c464c1b92ecd7eb961b47b4fa0eb03894e80646846cff39a3e3b2d8ada6279e288e94846a12578b440 WHIRLPOOL 6f59242d0f2a84e1fe93744e0d163ebf78082d685c91a22de5ca253f1ee5e903d0ddff3932cf28ce70b35126c0b928edd74ff577e2923888d7b5da015dc29382
+EBUILD gnuconfig-20160402.ebuild 1554 SHA256 fc3125a0972271bdb858e6ba5378400657470637223377c4c043ac09c289aaae SHA512 c13efb975ace56230c3fb84430a3ea8651c9d29764bbd02a1b01a15c8b2785d58189d96ed3fb3ced0b461f02a9b9c7a6b0f87f241f86ef6e1ec0f67effca7cc0 WHIRLPOOL a79f7b58ebdbd494fc9a176057845507ef6c0166ee7a6e236050ce0c1e6238e10895fb4ee7a29b494330a3b6736af87d971b875a31d378613316925938ed9c32
+EBUILD gnuconfig-20161104.ebuild 1554 SHA256 fc3125a0972271bdb858e6ba5378400657470637223377c4c043ac09c289aaae SHA512 c13efb975ace56230c3fb84430a3ea8651c9d29764bbd02a1b01a15c8b2785d58189d96ed3fb3ced0b461f02a9b9c7a6b0f87f241f86ef6e1ec0f67effca7cc0 WHIRLPOOL a79f7b58ebdbd494fc9a176057845507ef6c0166ee7a6e236050ce0c1e6238e10895fb4ee7a29b494330a3b6736af87d971b875a31d378613316925938ed9c32
+EBUILD gnuconfig-20170101.ebuild 1579 SHA256 02b24bbd8a03e9161e8adb266bed76623f396b1b0fd5d3df581c751590d7baf4 SHA512 c531f67fdd3a324a30cabdae9042a089756cec9db727db800b6a66da5f8a60590ae8795809618f1954769869b30868ce484d890124a3dd2ae065b9d836230a07 WHIRLPOOL 5eac212549f1dfd2d8854073263cdfcd92fcf53263b9fbccbfaf7946c8c6b737f5488e54d51d9be94388f3b9571063051795d1a1f7fe06446668c5bdf4b2947b
+EBUILD gnuconfig-99999999.ebuild 1567 SHA256 532c1fd052efe8e98630ecbc2edceb8746cff7fdc784c259876f13d84c7581b2 SHA512 016ab5ea340218263299011146e432031685bc1336721a78e96d7d798b9e86c1d16359e0478ecbc7b59b93df2b37aa3ebd3f17cd41c956cd9dd053cb8e176c63 WHIRLPOOL 23a9f0b5bc701deeb397fe45cc01622fd87a2ec878e352f2b684ea502daa48256483749627260c0ee8ab404038a53e2d9dca4fd8e9241a1ab91b20aa788bba9d
+MISC ChangeLog 4894 SHA256 525ecd62e41becd7f6fdd956d1b3ce3a7d806e31c3bf9eae116256139220f5a1 SHA512 0701eef3ac230a364c77836bedfda340268f096970095b963ae819cc4e8bae8fcc2fdcb84e446df1fd7a4ca06c2dc66ff2ff188aaf960827e4eeb6d4888ffae9 WHIRLPOOL 0f974d609e0afd8244a23adc4d14869ef17880ab969e981148b773243f41466b4ffd06302eeb4f49fe7c30d6d92165a6badf526cb656e813bc3d3a7ab00fbbaa
+MISC ChangeLog-2015 11775 SHA256 baa56ddd87ed9d0cb994c20b70e560199e20c1f6dbfcef05cb273c94aa280a53 SHA512 f9830ec583e3b91b63763266ca070368584eaa6e383205656a6bdfffa502828e89c78938ec80b4799f8f5f489bf6659bf9addbeeca03a2d8fe59148c1d6d0799 WHIRLPOOL 9a8a6aac6d72c16fe739ab5d5bd39c5e9728b60adaf308e8c2d70a2a72d944d05011fc9c678ae44fe9da83a0adbf38f871fa16b462204ce3f91c8c1b599f98ba
+MISC metadata.xml 392 SHA256 1b9e4dd0f7d576091d2137c3c4c627ef7eaab3d708d9f85fad20ec68f45adbb6 SHA512 8b0ec5d0b1184ea7514dfd2ff09a1ceddad49150cf412816a5e966eec9857e25886b6c03bb14b38638f79dcca2a40326b8506e23d0d3d7e97b48d2234c5653e5 WHIRLPOOL 7dcc51f44c1fdba9b412641d0aafb89d4f07150394359a5edaafb774bff6cd099fa81f444a0f34d9a74aed9f0ffd5ee5fe51117be2df919278e1a17301ca130c
diff --git a/sys-devel/gnuconfig/files/99999999/0002-Add-x32-support-to-config.guess.patch b/sys-devel/gnuconfig/files/99999999/0002-Add-x32-support-to-config.guess.patch
new file mode 100644
index 000000000000..2c69f57878eb
--- /dev/null
+++ b/sys-devel/gnuconfig/files/99999999/0002-Add-x32-support-to-config.guess.patch
@@ -0,0 +1,44 @@
+From 8474d78c459f4ec8f8930094faeaacb2b77bf68f Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hongjiu.lu@intel.com>
+Date: Fri, 20 Dec 2013 14:36:01 -0500
+Subject: [PATCH] Add x32 support to config.guess
+
+GCC on Linux/x86-64 may be configured for x32:
+
+https://sites.google.com/site/x32abi/
+
+by default and the Linux/x32 target should be x86_64-VENDOR-linux-gnux32.
+This patch adds x32 support to config.guess. OK to install?
+
+URL: http://gcc.gnu.org/ml/gcc-patches/2012-08/msg01083.html
+---
+ config.guess | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/config.guess b/config.guess
+index fddac42..17a4f70 100755
+--- a/config.guess
++++ b/config.guess
+@@ -1038,7 +1038,18 @@ EOF
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
++ eval $set_cc_for_build
++ X86_64_ABI=
++ # If there is a compiler, see if it is configured for 32-bit objects.
++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
++ if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
++ grep IS_X32 >/dev/null
++ then
++ X86_64_ABI=x32
++ fi
++ fi
++ echo ${UNAME_MACHINE}-pc-linux-${LIBC}${X86_64_ABI}
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+--
+2.4.4
+
diff --git a/sys-devel/gnuconfig/files/99999999/0002-add-ps2-targets-to-config.sub.patch b/sys-devel/gnuconfig/files/99999999/0002-add-ps2-targets-to-config.sub.patch
new file mode 100644
index 000000000000..88e43cd8ac2b
--- /dev/null
+++ b/sys-devel/gnuconfig/files/99999999/0002-add-ps2-targets-to-config.sub.patch
@@ -0,0 +1,59 @@
+From 582f9caf95b3ccf36e6248be3b5b414546b0a03e Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 9 Oct 2008 15:51:35 -0400
+Subject: [PATCH] add ps2 targets to config.sub
+
+---
+ config.sub | 22 ++++++++++++++++++++--
+ 1 file changed, 20 insertions(+), 2 deletions(-)
+
+diff --git a/config.sub b/config.sub
+index 88307c1..7ee2b4c 100755
+--- a/config.sub
++++ b/config.sub
+@@ -258,7 +258,7 @@ case $basic_machine in
+ | be32 | be64 \
+ | bfin \
+ | c4x | c8051 | clipper \
+- | d10v | d30v | dlx | dsp16xx \
++ | d10v | d30v | dlx | dsp16xx | dvp \
+ | e2k | epiphany \
+ | fido | fr30 | frv | ft32 \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+@@ -823,6 +823,24 @@ case $basic_machine in
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
++ mipsEE* | ee | ps2)
++ basic_machine=mips64r5900el-scei
++ case $os in
++ -linux*)
++ ;;
++ *)
++ os=-elf
++ ;;
++ esac
++ ;;
++ iop)
++ basic_machine=mipsel-scei
++ os=-irx
++ ;;
++ dvp)
++ basic_machine=dvp-scei
++ os=-elf
++ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+@@ -1389,7 +1407,7 @@ case $os in
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+--
+2.3.1
+
diff --git a/sys-devel/gnuconfig/gnuconfig-20160402.ebuild b/sys-devel/gnuconfig/gnuconfig-20160402.ebuild
new file mode 100644
index 000000000000..d001992debaf
--- /dev/null
+++ b/sys-devel/gnuconfig/gnuconfig-20160402.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/config.git
+ http://git.savannah.gnu.org/r/config.git"
+
+ inherit git-2
+else
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+DESCRIPTION="Updated config.sub and config.guess file from GNU"
+HOMEPAGE="https://savannah.gnu.org/projects/config"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+S=${WORKDIR}
+
+maint_pkg_create() {
+ cd "${S}"
+
+ local ver=$(gawk '{ gsub(/-/, "", $1); print $1; exit }' ChangeLog)
+ [[ ${#ver} != 8 ]] && die "invalid version '${ver}'"
+
+ cp "${FILESDIR}"/${PV}/*.patch . || die
+
+ local tar="${T}/gnuconfig-${ver}.tar.bz2"
+ tar -jcf ${tar} ./* || die "creating tar failed"
+ einfo "Packaged tar now available:"
+ einfo "$(du -b ${tar})"
+}
+
+src_unpack() {
+ if [[ ${PV} == "99999999" ]] ; then
+ git-2_src_unpack
+ maint_pkg_create
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ epatch "${WORKDIR}"/*.patch
+ use elibc_uclibc && sed -i 's:linux-gnu:linux-uclibc:' testsuite/config-guess.data #180637
+}
+
+src_compile() { :;}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ insinto /usr/share/${PN}
+ doins config.{sub,guess} || die
+ fperms +x /usr/share/${PN}/config.{sub,guess}
+ dodoc ChangeLog
+}
diff --git a/sys-devel/gnuconfig/gnuconfig-20161104.ebuild b/sys-devel/gnuconfig/gnuconfig-20161104.ebuild
new file mode 100644
index 000000000000..d001992debaf
--- /dev/null
+++ b/sys-devel/gnuconfig/gnuconfig-20161104.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/config.git
+ http://git.savannah.gnu.org/r/config.git"
+
+ inherit git-2
+else
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+DESCRIPTION="Updated config.sub and config.guess file from GNU"
+HOMEPAGE="https://savannah.gnu.org/projects/config"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+S=${WORKDIR}
+
+maint_pkg_create() {
+ cd "${S}"
+
+ local ver=$(gawk '{ gsub(/-/, "", $1); print $1; exit }' ChangeLog)
+ [[ ${#ver} != 8 ]] && die "invalid version '${ver}'"
+
+ cp "${FILESDIR}"/${PV}/*.patch . || die
+
+ local tar="${T}/gnuconfig-${ver}.tar.bz2"
+ tar -jcf ${tar} ./* || die "creating tar failed"
+ einfo "Packaged tar now available:"
+ einfo "$(du -b ${tar})"
+}
+
+src_unpack() {
+ if [[ ${PV} == "99999999" ]] ; then
+ git-2_src_unpack
+ maint_pkg_create
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ epatch "${WORKDIR}"/*.patch
+ use elibc_uclibc && sed -i 's:linux-gnu:linux-uclibc:' testsuite/config-guess.data #180637
+}
+
+src_compile() { :;}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ insinto /usr/share/${PN}
+ doins config.{sub,guess} || die
+ fperms +x /usr/share/${PN}/config.{sub,guess}
+ dodoc ChangeLog
+}
diff --git a/sys-devel/gnuconfig/gnuconfig-20170101.ebuild b/sys-devel/gnuconfig/gnuconfig-20170101.ebuild
new file mode 100644
index 000000000000..48297e6c02cc
--- /dev/null
+++ b/sys-devel/gnuconfig/gnuconfig-20170101.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/config.git
+ http://git.savannah.gnu.org/r/config.git"
+
+ inherit git-2
+else
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+DESCRIPTION="Updated config.sub and config.guess file from GNU"
+HOMEPAGE="https://savannah.gnu.org/projects/config"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+S=${WORKDIR}
+
+maint_pkg_create() {
+ cd "${S}"
+
+ local ver=$(gawk '{ gsub(/-/, "", $1); print $1; exit }' ChangeLog)
+ [[ ${#ver} != 8 ]] && die "invalid version '${ver}'"
+
+ cp "${FILESDIR}"/${PV}/*.patch . || die
+
+ local tar="${T}/gnuconfig-${ver}.tar.bz2"
+ tar -jcf ${tar} ./* || die "creating tar failed"
+ einfo "Packaged tar now available:"
+ einfo "$(du -b ${tar})"
+}
+
+src_unpack() {
+ if [[ ${PV} == "99999999" ]] ; then
+ git-2_src_unpack
+ maint_pkg_create
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ epatch "${WORKDIR}"/*.patch
+ use elibc_uclibc && sed -i 's:linux-gnu:linux-uclibc:' testsuite/config-guess.data #180637
+}
+
+src_compile() { :;}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ insinto /usr/share/${PN}
+ doins config.{sub,guess} || die
+ fperms +x /usr/share/${PN}/config.{sub,guess}
+ dodoc ChangeLog
+}
diff --git a/sys-devel/gnuconfig/gnuconfig-99999999.ebuild b/sys-devel/gnuconfig/gnuconfig-99999999.ebuild
new file mode 100644
index 000000000000..190275498683
--- /dev/null
+++ b/sys-devel/gnuconfig/gnuconfig-99999999.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+if [[ ${PV} == "99999999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/config.git
+ http://git.savannah.gnu.org/r/config.git"
+
+ inherit git-2
+else
+ SRC_URI="mirror://gentoo/${P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+DESCRIPTION="Updated config.sub and config.guess file from GNU"
+HOMEPAGE="https://savannah.gnu.org/projects/config"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE=""
+
+S=${WORKDIR}
+
+maint_pkg_create() {
+ cd "${S}"
+
+ local ver=$(gawk '{ gsub(/-/, "", $1); print $1; exit }' ChangeLog)
+ [[ ${#ver} != 8 ]] && die "invalid version '${ver}'"
+
+ cp "${FILESDIR}"/${PV}/*.patch . || die
+
+ local tar="${T}/gnuconfig-${ver}.tar.bz2"
+ tar -jcf ${tar} ./* || die "creating tar failed"
+ einfo "Packaged tar now available:"
+ einfo "$(du -b ${tar})"
+}
+
+src_unpack() {
+ if [[ ${PV} == "99999999" ]] ; then
+ git-2_src_unpack
+ maint_pkg_create
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ epatch "${WORKDIR}"/*.patch
+ use elibc_uclibc && sed -i 's:linux-gnu:linux-uclibc:' testsuite/config-guess.data #180637
+}
+
+src_compile() { :;}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ insinto /usr/share/${PN}
+ doins config.{sub,guess} || die
+ fperms +x /usr/share/${PN}/config.{sub,guess}
+ dodoc ChangeLog
+}
diff --git a/sys-devel/gnuconfig/metadata.xml b/sys-devel/gnuconfig/metadata.xml
new file mode 100644
index 000000000000..227a3c0b87fa
--- /dev/null
+++ b/sys-devel/gnuconfig/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<longdescription lang="en">
+Updated config.{sub,guess} files from upstream cvs to properly detect various system types.
+</longdescription>
+</pkgmetadata>
diff --git a/sys-devel/heirloom-devtools/Manifest b/sys-devel/heirloom-devtools/Manifest
new file mode 100644
index 000000000000..e6179768df00
--- /dev/null
+++ b/sys-devel/heirloom-devtools/Manifest
@@ -0,0 +1,8 @@
+AUX heirloom-devtools-070527-64-bit.patch 1175 SHA256 fdb878ff16e8a30b5042f6b447061fb8d9c6c93c3ce691c0715ee3afe121ff1f SHA512 5523e670c9c9d57f0415e30d1aab4dfcd7d8ad74e2535136afbbe4c6e407c713e7801cbcbf7ddbe798ab2790fc196a2fdbf9d5295fa8c475c73360f5e3a27066 WHIRLPOOL 9ee49da3af1e2c0965761e764bbd84f5ff7e2ae8c77f11d44242c7d9720635faa48b29c108aa8d8462bb2427a85a1ad481b55b3a699e2e25d98447ad19c9918e
+AUX heirloom-devtools-070527-solaris.patch 5636 SHA256 3c6c42ab6ccb0b03fd7dcf83b3d3ca066eeff250738bd7750d32d39cc18ad357 SHA512 335fdabef9b9a8b93ffa6eab2b66d2db11af29b24989c4b64ea64695cfadd4471c31a865c2fcb823c1f4c11eebc1babb53ab83c9c2bdf83c05f497faf16e3f1c WHIRLPOOL a9ebe3a455c70d828d93d4fd1d20609ea000ec1461b69358688901bac9697498acd5498722dc9d16b40278a2185e5534ca7d07bdd0a117bb34dd768255a238bc
+DIST heirloom-devtools-070527.tar.bz2 381054 SHA256 9f233d8b78e4351fe9dd2d50d83958a0e5af36f54e9818521458a08e058691ba SHA512 1f1f10a7b49402053172cc028bbd939a46fcf933994cb867fa40e8c5bbd7b1291575b3bac254cd79dc4fce3e3a2c88fe0f890449888fda16169c8e6a2540f055 WHIRLPOOL 145d36f42b180e480afe4bcefa0c59de44787ba9eef73782588834d8b15300b9ef12bde77b47eef992229fdfed8cef9da49b993f50023aa15262166bebe57104
+EBUILD heirloom-devtools-070527-r2.ebuild 1464 SHA256 fb4ff32ede4cf84ad33ffd877397859f09cb64a190b5f18b0b815a69dbf72281 SHA512 a458bf398c070001ef760a9821cc6073a95b8eee3887ee51c8ef05291788870b8083b6ddd178012321e83d8297b98f3e75c3ee4d77d3594e10fc4fec6dd48b76 WHIRLPOOL 512a4de8fce88c38a1ca97e920348b75bb850bb8d6da1a14515fe6bfb6b494c1b9e53d4c0f408ec1f16b1ad94013485ae1e52cb6113246aa7932e74f70c5bbe8
+EBUILD heirloom-devtools-999999.ebuild 1458 SHA256 bac7472e99d310591619cd00fb9098b54b9f0e31d96231c9455ac98a7d8e8166 SHA512 03fe87d7411fe7fd7db25b3fe7154a2e1cc78f0850d6ef0460f3a78865fd99c68505f90ea8501005ee903ace55a113a996ca0d8bad36f2e190d09193376d8175 WHIRLPOOL 27879ba4c1533f9f3171aa0f62538e505dbb5df8f728d8105498b4f2508ada7ced5fb1c370898071c72a71b47d6cf8b460a1e9d5f9d9948261a65b847a4b258f
+MISC ChangeLog 2934 SHA256 01cae0d50f99f0bc27bed27784c90dd570aa3b4baba1f4146bc4203ef34299ef SHA512 13494ab247842ac7862832152c01d305fc4f49a5555c7c39195d6fba384667d0a44e4a2ae9bc6240ab77599e18cf88c93a97d3a601613e15fd5581a74651ff0b WHIRLPOOL 894d70f34ef2aa6cafaaefb2639d228d8308d4f4bdb16215a1f86c8c126c60128d90b3bd85ae0b3526f9070f2ab370eb3e434670b4523b99a9ec892594cb8c7c
+MISC ChangeLog-2015 1261 SHA256 2e8bf1070798c0252c722e2b3a3024d8091cd05b0d8b72948a47ad905fab4d1d SHA512 a65fa306be43932834bb9b82a9ae5347278b6aea6aa465f706fdd86a294b9edf2cb334088d5056d3cd4b3d02dfb78314cba3e3b4d7136d5d79bc67efded2ca2e WHIRLPOOL 6a9ee058fed7175162dd3bd759a2ac71c263739c9fd0039892e69d3e73c0459da3895942c6be2f9e9a62d9e007ce827b84a710e0bea04d7bee214c05f98ce350
+MISC metadata.xml 320 SHA256 60c58d3c6c0be63207a10f766ec41ab2e171e6f9c77185197f3b51eee00513eb SHA512 ff9b5a1315c7be331504f555dd9fbef1b1d20d93175700e6a963a96fcfdd5020b414a275626251f2d6a772053639e28530e74de470cc17a0b62d60aa2a5578cb WHIRLPOOL 080ee24545d4e33afa761ad9191c6fa02d3dc75428d62d3e0d45a64aee1a6dfc47aad42e7e842653972fa0b4979b36d26fcbe80722e4ed287573ee0b28c42c7a
diff --git a/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-64-bit.patch b/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-64-bit.patch
new file mode 100644
index 000000000000..d6c3cd7a5488
--- /dev/null
+++ b/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-64-bit.patch
@@ -0,0 +1,39 @@
+--- a/make/vroot/lock.cc 2007/01/18 15:06:32 1.1
++++ b/make/vroot/lock.cc 2007/10/01 11:44:26 1.2
+@@ -31,7 +31,7 @@
+ /*
+ * Portions Copyright (c) 2007 Gunnar Ritter, Freiburg i. Br., Germany
+ *
+- * Sccsid @(#)lock.cc 1.4 (gritter) 01/13/07
++ * Sccsid @(#)lock.cc 1.5 (gritter) 10/1/07
+ */
+
+ #include <avo/intl.h> /* for NOCATGETS */
+@@ -53,7 +53,7 @@
+ extern int sys_nerr;
+ #endif
+
+-static void file_lock_error(char *msg, char *file, char *str, int arg1, int arg2);
++static void file_lock_error(char *msg, char *file, char *str, const char *arg1, const char *arg2);
+
+ #define BLOCK_INTERUPTS sigfillset(&newset) ; \
+ sigprocmask(SIG_SETMASK, &newset, &oldset)
+@@ -123,7 +123,7 @@
+
+ if (errno != EEXIST) {
+ file_lock_error(msg, name, NOCATGETS("symlink(%s, %s)"),
+- (int) name, (int) lockname);
++ name, lockname);
+ fprintf(stderr, "%s", msg);
+ return errno;
+ }
+@@ -171,7 +171,8 @@
+ * Format a message telling why the lock could not be created.
+ */
+ static void
+-file_lock_error(char *msg, char *file, char *str, int arg1, int arg2)
++file_lock_error(char *msg, char *file, char *str,
++ const char *arg1, const char *arg2)
+ {
+ int len;
+
diff --git a/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-solaris.patch b/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-solaris.patch
new file mode 100644
index 000000000000..c6b394208762
--- /dev/null
+++ b/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-solaris.patch
@@ -0,0 +1,230 @@
+diff --git a/make/include/mksh/defs.h b/make/include/mksh/defs.h
+index 1992205..8065a77 100644
+--- a/make/include/mksh/defs.h
++++ b/make/include/mksh/defs.h
+@@ -63,7 +63,6 @@
+ #include <widec.h>
+ #endif
+
+-#ifndef __sun
+ /*
+ * Definition of wchar functions.
+ */
+@@ -90,7 +89,6 @@
+ # define wscmp(x,y) wcscmp(x,y)
+ # undef wsncmp
+ # define wsncmp(x,y,z) wcsncmp(x,y,z)
+-#endif
+
+ #if defined (__FreeBSD__) || defined (__APPLE__) || defined (__hpux)
+ extern "C" { wchar_t *wcsdup(const wchar_t *s); }
+diff --git a/make/makestate/lock.c b/make/makestate/lock.c
+index cdf7562..aa6083e 100644
+--- a/make/makestate/lock.c
++++ b/make/makestate/lock.c
+@@ -42,18 +42,6 @@
+ #include <sys/errno.h>
+ #include <errno.h> /* errno */
+
+-#if defined(_LP64)
+-/*
+- * The symbols _sys_errlist and _sys_nerr are not visible in the
+- * LP64 libc. Use strerror(3C) instead.
+- */
+-#else /* #_LP64 */
+-#if defined (__sun) || defined (__hpux)
+-extern char * sys_errlist[];
+-extern int sys_nerr;
+-#endif
+-#endif /* #_LP64 */
+-
+ static void file_lock_error(char *, char *, const char *, char *, char *);
+
+ /*
+@@ -167,16 +155,7 @@ file_lock_error(char * msg, char * file, const char * str, char * arg1,
+ len = strlen(msg);
+ sprintf(&msg[len], str, arg1, arg2);
+ strcat(msg, " failed - ");
+-#if defined(_LP64)
+ /* Needs to be changed to use strerror(3C) instead. */
+ len = strlen(msg);
+ sprintf(&msg[len], "errno %d", errno);
+-#else /* #_LP64 */
+- if (errno < sys_nerr) {
+- strcat(msg, sys_errlist[errno]);
+- } else {
+- len = strlen(msg);
+- sprintf(&msg[len], "errno %d", errno);
+- }
+-#endif /* #_LP64 */
+ }
+diff --git a/make/mksh/macro.cc b/make/mksh/macro.cc
+index 6ddb624..23b0315 100644
+--- a/make/mksh/macro.cc
++++ b/make/mksh/macro.cc
+@@ -43,6 +43,7 @@
+ /*
+ * Included files
+ */
++#include <alloca.h>
+ #include <wordexp.h>
+ #include <mksh/dosys.h> /* sh_command2string() */
+ #include <mksh/i18n.h> /* get_char_semantics_value() */
+@@ -1403,13 +1404,6 @@ found_it:;
+ new_value = ALLOC_WC(length);
+ new_value_allocated = true;
+ WCSTOMBS(mbs_buffer, old_vr);
+-#ifdef __sun
+- wsprintf(new_value,
+- NOCATGETS("/usr/arch/%s/%s:%s"),
+- ha->string_mb + 1,
+- ta->string_mb + 1,
+- mbs_buffer);
+-#else
+ char * mbs_new_value = (char *)getmem(length);
+ sprintf(mbs_new_value,
+ NOCATGETS("/usr/arch/%s/%s:%s"),
+@@ -1418,7 +1412,6 @@ found_it:;
+ mbs_buffer);
+ MBSTOWCS(new_value, mbs_new_value);
+ retmem_mb(mbs_new_value);
+-#endif
+ }
+ if (new_value[0] != 0) {
+ setvar_daemon(virtual_root,
+diff --git a/make/mksh/misc.cc b/make/mksh/misc.cc
+index 11122cf..d617591 100644
+--- a/make/mksh/misc.cc
++++ b/make/mksh/misc.cc
+@@ -382,30 +382,7 @@ setup_char_semantics(void)
+ char *
+ errmsg(int errnum)
+ {
+-#ifndef __sun
+ return strerror(errnum);
+-#else // __sun
+-
+- extern int sys_nerr;
+-#ifdef SUN4_x
+- extern char *sys_errlist[];
+-#endif
+- char *errbuf;
+-
+- if ((errnum < 0) || (errnum > sys_nerr)) {
+- errbuf = getmem(6+1+11+1);
+- sprintf(errbuf, "Error %d", errnum);
+- return errbuf;
+- } else {
+-#ifdef SUN4_x
+- return(sys_errlist[errnum]);
+-#endif
+-#ifdef SUN5_0
+- return strerror(errnum);
+-#endif
+-
+- }
+-#endif // !__sun
+ }
+
+ extern const char *progname;
+diff --git a/make/src/implicit.cc b/make/src/implicit.cc
+index 2d388cc..a1cee7e 100644
+--- a/make/src/implicit.cc
++++ b/make/src/implicit.cc
+@@ -43,10 +43,13 @@
+ /*
+ * Included files
+ */
++#include <cstdio>
+ #include <mk/defs.h>
+ #include <mksh/macro.h> /* expand_value() */
+ #include <mksh/misc.h> /* retmem() */
+
++using std::printf;
++
+ /*
+ * Defined macros
+ */
+@@ -97,8 +100,6 @@ extern void add_target_to_chain(Name target, Chain * query);
+ * recursion_level Used for tracing
+ */
+
+-extern int printf (const char *, ...);
+-
+ static Boolean actual_doname = false;
+
+ /* /tolik/
+diff --git a/make/src/nse_printdep.cc b/make/src/nse_printdep.cc
+index 6201a18..38826d2 100644
+--- a/make/src/nse_printdep.cc
++++ b/make/src/nse_printdep.cc
+@@ -37,9 +37,12 @@
+ /*
+ * Included files
+ */
++#include <cstdio>
+ #include <mk/defs.h>
+ #include <mksh/misc.h> /* get_prop() */
+
++using std::printf;
++
+ /*
+ * File table of contents
+ */
+@@ -59,7 +62,6 @@ static void print_rule(register Name target);
+ static void print_rec_info(Name target);
+ static Boolean is_out_of_date(Property line);
+ extern void depvar_print_results (void);
+-extern int printf (const char *, ...);
+ extern int _flsbuf (unsigned int, FILE *);
+
+ /*
+diff --git a/make/vroot/lock.cc b/make/vroot/lock.cc
+index 1d6239b..1a20bc0 100644
+--- a/make/vroot/lock.cc
++++ b/make/vroot/lock.cc
+@@ -48,11 +48,6 @@
+ #include <signal.h>
+ #include <errno.h> /* errno */
+
+-#if defined(sun) || defined(HP_UX)
+-extern char *sys_errlist[];
+-extern int sys_nerr;
+-#endif
+-
+ static void file_lock_error(char *msg, char *file, char *str, int arg1, int arg2);
+
+ #define BLOCK_INTERUPTS sigfillset(&newset) ; \
+@@ -179,20 +174,6 @@ file_lock_error(char *msg, char *file, char *str, int arg1, int arg2)
+ len = strlen(msg);
+ sprintf(&msg[len], str, arg1, arg2);
+ strcat(msg, " failed - ");
+-#ifdef __sun
+- if (errno < sys_nerr) {
+-#ifdef SUN4_x
+- strcat(msg, sys_errlist[errno]);
+-#endif
+-#ifdef SUN5_0
+- strcat(msg, strerror(errno));
+-#endif
+- } else {
+- len = strlen(msg);
+- sprintf(&msg[len], NOCATGETS("errno %d"), errno);
+- }
+-#else
+ strcat(msg, strerror(errno));
+-#endif
+ }
+
+diff --git a/sccs/src/vc.c b/sccs/src/vc.c
+index d7f7187..1c0ffb1 100644
+--- a/sccs/src/vc.c
++++ b/sccs/src/vc.c
+@@ -37,6 +37,7 @@
+ */
+ /* from OpenSolaris "sccs:cmd/vc.c" */
+ # include <defines.h>
++# include <limits.h>
+ # include <locale.h>
+
+
diff --git a/sys-devel/heirloom-devtools/heirloom-devtools-070527-r2.ebuild b/sys-devel/heirloom-devtools/heirloom-devtools-070527-r2.ebuild
new file mode 100644
index 000000000000..53ff19979779
--- /dev/null
+++ b/sys-devel/heirloom-devtools/heirloom-devtools-070527-r2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic readme.gentoo-r1 toolchain-funcs
+
+DESCRIPTION="Original UNIX development tools"
+HOMEPAGE="http://heirloom.sourceforge.net/devtools.html"
+SRC_URI="http://downloads.sourceforge.net/project/heirloom/${PN}/${PV}/${P}.tar.bz2"
+
+LICENSE="BSD BSD-4 CDDL"
+SLOT="0"
+KEYWORDS="~amd64 ~x64-solaris"
+IUSE=""
+
+DEPEND="app-shells/heirloom-sh"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-solaris.patch"
+ "${FILESDIR}/${P}-64-bit.patch"
+ "${FILESDIR}/${P}-gcc6.patch"
+)
+
+DOC_CONTENTS="
+ You may want to add /usr/5bin or /usr/ucb to \$PATH
+ to enable using the apps of heirloom toolchest by default.
+ Man pages are installed in /usr/share/man/5man/
+ You may need to set \$MANPATH to access them.
+"
+
+src_prepare() {
+ default
+ sed -i \
+ -e 's:^\(SHELL =\) \(.*\):\1 /bin/jsh:' \
+ -e 's:^\(POSIX_SHELL =\) \(.*\):\1 /bin/sh:' \
+ -e "s:^\(PREFIX=\)\(.*\):\1${EPREFIX}\2:" \
+ -e "s:^\(SUSBIN=\)\(.*\):\1${EPREFIX}\2:" \
+ -e "s:^\(LDFLAGS=\):\1${LDFLAGS}:" \
+ -e "s:^\(CFLAGS=\)\(.*\):\1${CFLAGS}:" \
+ -e 's:^\(STRIP=\)\(.*\):\1true:' \
+ -e "s:^\(CXX = \)\(.*\):\1$(tc-getCXX):" \
+ -e "s:^\(INSTALL=\)\(.*\):\1$(which install):" \
+ ./mk.config
+
+ echo "CC=$(tc-getCC)" >> "./mk.config"
+}
+
+src_compile() {
+ emake -j1
+}
+
+src_install() {
+ emake ROOT="${D}" install
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
diff --git a/sys-devel/heirloom-devtools/heirloom-devtools-999999.ebuild b/sys-devel/heirloom-devtools/heirloom-devtools-999999.ebuild
new file mode 100644
index 000000000000..1d97661d245b
--- /dev/null
+++ b/sys-devel/heirloom-devtools/heirloom-devtools-999999.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit cvs flag-o-matic readme.gentoo-r1 toolchain-funcs
+
+ECVS_AUTH="pserver"
+ECVS_USER="anonymous"
+ECVS_SERVER="heirloom.cvs.sourceforge.net:/cvsroot/heirloom"
+ECVS_MODULE="heirloom-devtools"
+ECVS_PASS=""
+ECVS_CVS_OPTIONS="-dP"
+
+DESCRIPTION="Original UNIX development tools"
+HOMEPAGE="http://heirloom.sourceforge.net/devtools.html"
+SRC_URI=""
+
+LICENSE="BSD BSD-4 CDDL"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+DEPEND="app-shells/heirloom-sh"
+RDEPEND="${DEPEND}"
+
+DOC_CONTENTS="
+ You may want to add /usr/5bin or /usr/ucb to \$PATH
+ to enable using the apps of heirloom toolchest by default.
+ Man pages are installed in /usr/share/man/5man/
+ You may need to set \$MANPATH to access them.
+"
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ default
+ sed -i \
+ -e 's:^\(SHELL =\) \(.*\):\1 /bin/jsh:' \
+ -e 's:^\(POSIX_SHELL =\) \(.*\):\1 /bin/sh:' \
+ -e "s:^\(PREFIX=\)\(.*\):\1${EPREFIX}\2:" \
+ -e "s:^\(SUSBIN=\)\(.*\):\1${EPREFIX}\2:" \
+ -e "s:^\(LDFLAGS=\):\1${LDFLAGS}:" \
+ -e "s:^\(CFLAGS=\)\(.*\):\1${CFLAGS}:" \
+ -e 's:^\(STRIP=\)\(.*\):\1true:' \
+ -e "s:^\(CXX = \)\(.*\):\1$(tc-getCXX):" \
+ -e "s:^\(INSTALL=\)\(.*\):\1$(which install):" \
+ ./mk.config
+
+ echo "CC=$(tc-getCC)" >> "./mk.config"
+}
+
+src_compile() {
+ emake -j1
+}
+
+src_install() {
+ emake ROOT="${D}" install
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}
diff --git a/sys-devel/heirloom-devtools/metadata.xml b/sys-devel/heirloom-devtools/metadata.xml
new file mode 100644
index 000000000000..22ffeee07c23
--- /dev/null
+++ b/sys-devel/heirloom-devtools/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>ryao@gentoo.org</email>
+ <name>Richard Yao</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">heirloom</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/icecream/Manifest b/sys-devel/icecream/Manifest
new file mode 100644
index 000000000000..8fe85f3bb198
--- /dev/null
+++ b/sys-devel/icecream/Manifest
@@ -0,0 +1,19 @@
+AUX 0.9.6-crosscompile.patch 471 SHA256 b0d4f69301cac95f5e3a7a3a91b5470769144e0deb33cb1504b70ad29b8cb783 SHA512 5c33cd6a1aae9b628e6308a4438355298ee0b4217d8561aaee9960c816aa336aa62eb2e5844f8cf756bbf3731fda4c07ac4c1bf30b2ef93c45205dcfbe8a7ae4 WHIRLPOOL e3bcf73125e91ca9d5d0e1a8b314d042734ae89cf4d2f77bd44821ea6fa665dd344af9049eb88a3c0f593e71f22ebef6a5ccc8a42fda08a25d8e15c82799993f
+AUX 0.9.6-symlinks.patch 614 SHA256 4100330fb48453abe7facecff4eb199e5285093df49d082e14050a4c30cb2dfb SHA512 739a683cb9142fb2ee52ec73194de03dac8815103fbd7a102cebabefd649c8ddfe6121649727de2785a525493a5f244352aa5a18796361014e6fe6fcbfe92321 WHIRLPOOL aab994500630cfe1b498ab3f870c45ae1a9745e3472c9d0ee9b50f42cb08312754768a62ee035d913853e0cfe7ce05c9c90772df238e68b6a91a2d4ab1e67ed6
+AUX 0.9.7-automake.patch 1085 SHA256 6f3281250708ec2ea5a1dd188104bdfa66e5f7b388c58a0b4827d3cc9f108da5 SHA512 2a2b8a03d10783a56484ec7b97cec0bf8f6853fc9c1e8d558297f7d1d0060d3e53410d9b6c77bd00359e249817fd6f0d854773850a1983b19417cee140ec17e3 WHIRLPOOL cbb5a0dcc9c5ec97458a38e91dace3474f7edd80d8190193295b22f427adb9aa9aa7ddabea29f078d93ada521610ae3fc479e6d3b42faa345d4dbd67a982da9b
+AUX 0.9.7-glibc2.16.patch 342 SHA256 7beb8999615edc5926c731c4f9f40c1cdf899f0a13aa0663847c415d23b4faba SHA512 3c3f0cbc15637d6f46ea4b7a7036a74a8ad46ab42f2ccfdda1638e0fa5cfc16e382ebefeb5294f937a34285c63d205f86b91ef0650a2ccaa8c5253f35ee1cecd WHIRLPOOL dd587412c5ad7956ffc59b9b0ec420e9702955b8aa27453f7c3e07826191a127ab2df68f7830bd360c109f2130025aa176d8e6d2e7a6411db1418564e1c40829
+AUX icecream 1614 SHA256 239aeadc35c4fa183a8ef4088fdfee709000e3c048a6bf2b9268ec7c287ede87 SHA512 670367aeab3a3e30c3f9c136b8965955db77e9b8555cffb3aba8872966553e955172bf2e47593ef661e8f7b8f2caa0db71750d978c2764fd72d458d6524f7fda WHIRLPOOL e5b1de90d12201e359a4b14b6520096b0e2d58a78878ce077770520de3d20f58010af1703aaed98622a4c594fd1de4e87de2daddcb19257a789faa833ed2ea00
+AUX icecream-1.0.0-libcap-ng.patch 195 SHA256 e6f54ce79c0da6c8f9b1379e21dc6ed528b2734dbaa7a9653b275a08073771e2 SHA512 31f69f07ad55465103587239249d2fd173dc3b920a026c7754635a3ada39696c1ccccbe636ced0ca2a2283b4adb8f23083a32586c2e803c1f18ad4afd3cc8746 WHIRLPOOL c0ef52dccf5aff25e7a93b949342a5ea1fe1e770c035c73d35a2e0a958016e5370c0fd3f7b15da899cc134ec13ac59c2b6666a8ae81be06fba837f1aff22bdad
+AUX icecream-conf.d-verbosity.patch 364 SHA256 d1191d31f84f2b1f1bcab67cecd0f77bc80db32d07766e7e3b6bc4cf886147cc SHA512 607b8eb2e50bf77fcf5f31757dd44fda9bc2c98241239d1e23bf17228e68e32a391e22d0b859ad725c176f21580a0a92931644c5b3ecfd23d844719f035d38eb WHIRLPOOL fc0283058fed7deca2b8917289838c84e9821436e7a4c648ebd32edabf1180ee321db75e736b805a6695f313977ab63857dc9cfb80119905182f2f701928da88
+AUX icecream-config 1692 SHA256 24acbd8e5b0218ce966e78f451985f72530865f86e5a1ee2b6c92d8bf50ff66b SHA512 9bba4e6ebabfc5c2b6d205fdf53e08ce1c29801da6a69534d5c3c221ce1ff7d8575d56bd451254ee9d30d27b6a95d00fd64e3a5cb1129c72583193a27a7fef70 WHIRLPOOL bd23a6f38ecf907363fb15d6968be688c58c053e116575de68ad9a656fd3b4f3b880e82a5da70ec250bd5a8f926a665a88a45144d57052a57187cd66241a40a2
+AUX icecream-create-env 2137 SHA256 edcafb128d8bb833aeb0c2544c5ecdd2336f0ed60015e5a33096a972b1856c0f SHA512 0de4ca5a865eea62fe6aaa70982bb75c0c78490491f6a713fab1c5be6fe0a67492efcb836f6e97914a8252665d9c5e7a9c7d01f8805af0bd4108dbaabbc0eb32 WHIRLPOOL e369d8b9bd77992a756f480a5bddfa640d9630b3da75cca68ff173909ba4b12bd44124ee0a1c7d8e12c8b1890333a53a17d66818625eb1ebedf7d96b8272e1e4
+AUX icecream-gentoo-multilib.patch 1579 SHA256 0efa29f5cb350aa8118cb9c4ba8d62cf675b6af5692ee18e25021f463465fc8a SHA512 24a9de13691e39e96c32db5722e7a6979a7a233335bf37fc42f5cf8d8b67d111d26fcf68d5fc20acc4aacee0d1e7cc88ff04ee36a127efc45f3bffe269e7c253 WHIRLPOOL 58f94a649e807fd8c90e384cf84111cf32fb994c45233d2ef6225e97f2d0ae88e3192e42d0d89e0e89e841fea3b54cff6c164e31866a628ba77960a08c182921
+AUX icecream-r2 1733 SHA256 ba0ed1cc54acfac9d72679c95fd031130623a35304ae1e9a80ba55751da69355 SHA512 033ce0d49445db3afcbdd6724863651d4951b8f36f6253a13854abe9ee976419687579089aa1c5c808eed08aad357e34bb9f1e70570857cc39f2515ac2f211b0 WHIRLPOOL de58aaf7ede01afa034175bd4c0de0decb5b218d750e55118f9874ddfdf7ee755bd5a5c0e87380dd7092c76b34dd2685c42e67f09956b97390e1f6db83e210bd
+DIST icecc-0.9.7.tar.bz2 379527 SHA256 ba01c19e946d5a142ad9f912c24086ee12e7ca4927d64860787eb4bcd100657f SHA512 023a77d6df33af9837a87218272dc61d68f3782ad59dc8783ec3ca47cbb38619dbcaa25ac7e6654c6cacbd79477c3403b0a73aca595c6fe20aa9a39268f4f2e2 WHIRLPOOL cf822cc6667ceda286b41c4fd172092f51d75cb2c5d1ca3db0dd32796580128808881f09053f209d7f9165ccecf9e97093925fca1ae54597b2a775485d82004f
+DIST icecc-1.0.0.tar.bz2 485534 SHA256 c2897fac52711b8442ec40403c874bc50a10184131bb7006529087dfe469c85c SHA512 4292ecef6232112c3f4531cb2290a55f70c5c24095fef0865af2526d49fc10a043ffb06d22552e161f671c18ff1ab62795c3a63e2c8cb26f869cf65d0938af2a WHIRLPOOL 3c6e79756bd290e03fbfcd5fd5e38dbb700e0a7b1206c2a608914123a9f317f1d9896332c79909754fda6fc9c515a29dba6b4c485a505d1ca0fde315c35cd3ce
+EBUILD icecream-0.9.7-r1.ebuild 2713 SHA256 8a3d42a1c60ea147c993b9da37e914597ee4c34494e00682df47118b7519a3cb SHA512 5b79e2c5722f1632bb1ccff1341168534d78cb41c1c779825758f5e3f3f6f2bcaca58018d2915b54efb3fabe65b3cd3f8007c1a4601be240457105f8143b3ba9 WHIRLPOOL a4c0fa996239d50a730a0b70282be9298f41bf074f809b5b80935a58bb271feff125ad9df22c6b93dd69d88c1ee77d8fd2244b950c9099879c84820ce344ee08
+EBUILD icecream-1.0.0-r1.ebuild 1022 SHA256 166b77ab3fc3e7090b1556513a813f07511170c17ba638d66cfe9c046dfdea6d SHA512 bdc885463b426c96dc64e668f8e3b753d7645149286910a705102931b3c81df56e855caf4e6231a85962ab9cdfb2ad9920224c359aeee49193f1b6d7a8ee0803 WHIRLPOOL ad8fde83c96ef980b6caeba4b86f2bd769a9b13dc5200774f0aa3fe83e966ea7e56cc672db6daa0cf6c018c4ea9ee6d193112a3db409fb86dae5ef562337b9de
+EBUILD icecream-1.0.0-r2.ebuild 1314 SHA256 2d7b7c4952d26d37f525359361effac34d0d58aa2075ed2a6139211a56b4bfff SHA512 f5cb905b24d48c97a44f6e7ec5a064854913b1a686f8a8f163d8bcb73ef5e9c8ba42ca89bef4c19d75492d8fe1363c78dd3187ad8f0a82d30c83454fe58bef37 WHIRLPOOL 7b2f4be58f1f9190dee40df99218188d1160a36e9dc78399af692d7cf322a9157bc617e3adc9f30e0f6d758a9d2ee837d8d037c2d31d532212338e42ffc42480
+MISC ChangeLog 2983 SHA256 39bd929a0f5ec955342bc5daaf80b8a71a38d7db72005eb6f99d2e8378831372 SHA512 addd20a494c258d9f797ec10c4e9190091f8eb75bd038e765423ecde79a8e70320c316002c12a2f0dcfb88824bc8352167a1ae4c6c4a83ff55bd78b3a0fa1cb1 WHIRLPOOL b492d02689ecda539a6051c04b87a3cfc30e1608f7dcdf0f3738628754f157162c23b2f4415ae9b8bf7e9d58022d73f15ebc31b8d06a4fb48297b9c67cd48e2a
+MISC ChangeLog-2015 9891 SHA256 1dba523aa0d2853a582f1619aee32dbd7d5444093f2716c43567dc3d67eacb40 SHA512 6bb513845fb4f0d54361925c370c7f555bda3664d6d879d3ece49c1d2f8dc10fbc7e833b0f216de42b08a8152a8462563fb03c48c16e5656e8b692a75bf7cff8 WHIRLPOOL 91305ba08daf7571c5ffd2e45b87f0beaa8568c238fc4381c0e12675b91bb75f288940e4264722eb8a3f4f2703b16fd98c21b5eaa07f9943c85189261d241eb6
+MISC metadata.xml 433 SHA256 e594c52176dd96d82fabe0b801c41291eb0be19d7a47c7b0be94522d8435216c SHA512 df66083874796cbeaa39519bb61c871aab7581c777321eba2b37de89968fcdce685b023729d785dff99e33ce81f64345d2cf7757deffa5d2dd563d0de1b92c9a WHIRLPOOL 6c7603a70323b6b9536ac9d1faf413d78ee265f6f9c044b080e40f5d81f176d5b0f334514c55e1c5169a3bd1f38979807f1bcafd155f14c1f7898dd22fb5d4ef
diff --git a/sys-devel/icecream/files/0.9.6-crosscompile.patch b/sys-devel/icecream/files/0.9.6-crosscompile.patch
new file mode 100644
index 000000000000..990072bbb8fd
--- /dev/null
+++ b/sys-devel/icecream/files/0.9.6-crosscompile.patch
@@ -0,0 +1,12 @@
+diff -urN icecc-0.9.6.old//client/icecc-create-env icecc-0.9.6//client/icecc-create-env
+--- icecc-0.9.6.old//client/icecc-create-env 2010-09-18 12:10:08.143391700 +0200
++++ icecc-0.9.6//client/icecc-create-env 2010-09-18 12:10:46.574391700 +0200
+@@ -97,7 +97,7 @@
+
+ add_file $added_gcc /usr/bin/gcc
+ add_file $added_gxx /usr/bin/g++
+-add_file /usr/bin/as
++add_file `$added_gcc -print-prog-name=as` /usr/bin/as
+
+ if test "$is_darwin" = 1; then
+ # add dynamic linker
diff --git a/sys-devel/icecream/files/0.9.6-symlinks.patch b/sys-devel/icecream/files/0.9.6-symlinks.patch
new file mode 100644
index 000000000000..279ee0cc0f99
--- /dev/null
+++ b/sys-devel/icecream/files/0.9.6-symlinks.patch
@@ -0,0 +1,19 @@
+diff -urN icecc-0.9.6//client/Makefile.am icecc-0.9.6.new//client/Makefile.am
+--- icecc-0.9.6//client/Makefile.am 2010-09-11 13:43:53.922000148 +0200
++++ icecc-0.9.6.new//client/Makefile.am 2010-09-11 13:44:39.950000148 +0200
+@@ -7,15 +7,3 @@
+ noinst_HEADERS = client.h md5.h util.h
+
+ EXTRA_DIST = icecc-create-env
+-
+-install-exec-local:
+- $(mkinstalldirs) $(DESTDIR)$(bindir)
+- for link in g++ gcc c++ cc icerun; do \
+- rm -f $(DESTDIR)$(bindir)/$$link ;\
+- $(LN_S) icecc $(DESTDIR)$(bindir)/$$link ;\
+- done
+-
+-uninstall-local:
+- for link in g++ gcc c++ cc; do \
+- rm $(DESTDIR)$(bindir)/$$link ;\
+- done
diff --git a/sys-devel/icecream/files/0.9.7-automake.patch b/sys-devel/icecream/files/0.9.7-automake.patch
new file mode 100644
index 000000000000..6905a2a34158
--- /dev/null
+++ b/sys-devel/icecream/files/0.9.7-automake.patch
@@ -0,0 +1,32 @@
+Backport upstream patch to fix automake-1.12 issues
+
+https://bugs.gentoo.org/show_bug.cgi?id=397715
+https://bugs.gentoo.org/show_bug.cgi?id=399259
+--- client/Makefile.am
++++ client/Makefile.am
+@@ -1,10 +1,11 @@
+ INCLUDES = -I$(srcdir)/../services
+
+ bin_PROGRAMS = icecc
+-pkglib_SCRIPTS = icecc-create-env
++pkglibexec_SCRIPTS = icecc-create-env
+ icecc_SOURCES = main.cpp arg.cpp cpp.cpp local.cpp remote.cpp util.cpp md5.c safeguard.cpp
+ icecc_LDADD = ../services/libicecc.la $(LIBRSYNC)
+ noinst_HEADERS = client.h md5.h util.h
++AM_CPPFLAGS = -DPLIBDIR=\"$(pkglibexecdir)\"
+
+ EXTRA_DIST = icecc-create-env
+
+--- configure.in
++++ configure.in
+@@ -246,10 +246,6 @@
+ KDE_EXPAND_MAKEVAR(mybindir, bindir)
+ AC_DEFINE_UNQUOTED(BINDIR, "$mybindir", [Where to look for icecc])
+
+-myopkglibdir='${libdir}/'"$PACKAGE"
+-KDE_EXPAND_MAKEVAR(mypkglibdir, myopkglibdir)
+-AC_DEFINE_UNQUOTED(PLIBDIR, "$mypkglibdir", [Where to look for icecc-create-env])
+-
+ myorundir='${localstatedir}/run'
+ KDE_EXPAND_MAKEVAR(myrundir, myorundir)
+ AC_DEFINE_UNQUOTED(RUNDIR, "$myrundir", [Where to place pid files])
diff --git a/sys-devel/icecream/files/0.9.7-glibc2.16.patch b/sys-devel/icecream/files/0.9.7-glibc2.16.patch
new file mode 100644
index 000000000000..7ccbd735a46f
--- /dev/null
+++ b/sys-devel/icecream/files/0.9.7-glibc2.16.patch
@@ -0,0 +1,16 @@
+Fix building with glibc-2.16
+
+https://bugs.gentoo.org/show_bug.cgi?id=425248
+
+Patch written by Kacper Kowalik <xarthisius@gentoo.org>
+--- a/daemon/workit.cpp
++++ b/daemon/workit.cpp
+@@ -26,6 +26,7 @@
+ #include "exitcode.h"
+ #include "logging.h"
+ #include <sys/select.h>
++#include <sys/resource.h>
+ #include <algorithm>
+
+ #ifdef __FreeBSD__
+
diff --git a/sys-devel/icecream/files/icecream b/sys-devel/icecream/files/icecream
new file mode 100644
index 000000000000..db24c4046c7b
--- /dev/null
+++ b/sys-devel/icecream/files/icecream
@@ -0,0 +1,43 @@
+#!/sbin/openrc-run
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start() {
+ local basedir=${ICECREAM_BASEDIR:-"/var/cache/icecream"}
+ local netname=${ICECREAM_NETNAME:+"-n ${ICECREAM_NETNAME}"}
+ local logfile=${ICECREAM_LOG_FILE:+"-l ${ICECREAM_LOG_FILE}"}
+ local nice=${ICECREAM_NICE_LEVEL:+"--nice ${ICECREAM_NICE_LEVEL}"}
+ local scheduler=${ICECREAM_SCHEDULER_HOST:+"-s ${ICECREAM_SCHEDULER_HOST}"}
+ local maxjobs=${ICECREAM_MAX_JOBS:+"-m ${ICECREAM_MAX_JOBS}"}
+ local verbosity=${ICECREAM_VERBOSITY:-"-v"}
+
+ if [[ "${ICECREAM_RUN_SCHEDULER}" == "yes" ]]; then
+ local slogfile=${ICECREAM_SCHEDULER_LOG_FILE:-"/var/log/icecc_scheduler"}
+ touch ${slogfile} && chown icecream:icecream ${slogfile}
+ slogfile=${slogfile:+"-l ${slogfile}"}
+ ebegin "Starting Distributed Compiler Scheduler"
+ start-stop-daemon -u icecream --start --quiet --exec /usr/sbin/scheduler -- -d ${slogfile} ${netname} ${verbosity}
+ eend ${?}
+ fi
+
+ [[ ! -d ${basedir} ]] && mkdir -p ${basedir} && chown icecream:icecream ${basedir}
+ ebegin "Starting Distributed Compiler Daemon"
+ start-stop-daemon --start --quiet --exec /usr/sbin/iceccd -- -d ${logfile} ${nice} ${scheduler} ${netname} -u icecream -b "${basedir}" ${maxjobs} ${verbosity}
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping Distributed Compiler Daemon"
+ start-stop-daemon --stop --quiet --name iceccd
+ eend ${?}
+
+ if [[ "${ICECREAM_RUN_SCHEDULER}" == "yes" ]]; then
+ ebegin "Stopping Distributed Compiler Scheduler"
+ start-stop-daemon --stop --quiet --name scheduler
+ eend ${?}
+ fi
+}
diff --git a/sys-devel/icecream/files/icecream-1.0.0-libcap-ng.patch b/sys-devel/icecream/files/icecream-1.0.0-libcap-ng.patch
new file mode 100644
index 000000000000..3dc0e3713b0a
--- /dev/null
+++ b/sys-devel/icecream/files/icecream-1.0.0-libcap-ng.patch
@@ -0,0 +1,8 @@
+--- a/services/icecc.pc.in
++++ b/services/icecc.pc.in
+@@ -11,4 +11,5 @@ Version: @VERSION@
+ Requires:
+ Conflicts:
+ Libs: -L${libdir} -licecc
++Libs.private: @CAPNG_LDADD@
+ Cflags: -I${includedir}
diff --git a/sys-devel/icecream/files/icecream-conf.d-verbosity.patch b/sys-devel/icecream/files/icecream-conf.d-verbosity.patch
new file mode 100644
index 000000000000..1ee93c5741a2
--- /dev/null
+++ b/sys-devel/icecream/files/icecream-conf.d-verbosity.patch
@@ -0,0 +1,18 @@
+--- a/suse/sysconfig.icecream
++++ b/suse/sysconfig.icecream
+@@ -39,6 +39,15 @@
+ #
+ ## Type: string
+ ## Path: Applications/icecream
++## Default: -v
++#
++# icecream's level of verbosity ([-v[v[v]]])
++#
++ICECREAM_VERBOSITY="-v"
++
++#
++## Type: string
++## Path: Applications/icecream
+ ## Defaut: ""
+ #
+ # Identification for the network the scheduler and daemon run on.
diff --git a/sys-devel/icecream/files/icecream-config b/sys-devel/icecream/files/icecream-config
new file mode 100644
index 000000000000..6ed24c743772
--- /dev/null
+++ b/sys-devel/icecream/files/icecream-config
@@ -0,0 +1,69 @@
+#!/bin/sh
+#
+# icecream-config - helper script for icecream and its ebuild
+#
+# Copyright 2003-2010 Superlucidity Services, LLC
+# This program licensed under the GNU GPL version 2.
+#
+# This script developed by Zachary T Welch at Superlucidity Services, LLC
+# it was cloned from the distcc-config script to make ccache-config
+# and then modified by Marcus Furlong to configure icecream too.
+#
+# Additional features to come; this provides a starting point
+
+# this should be getopt'd someday (override with ICEC_QUIET=1)
+ICECC_VERBOSE=1
+
+icecc_echo() {
+ [ -z "${ICECC_QUIET}" -a -n "${ICECC_VERBOSE}" ] && echo "$*"
+}
+
+###
+# the following functions manage the icecream symlinks
+# they allow the user or other scripts (namely gcc-config) to
+# automatically update icecream's links when upgrading toolchains
+#
+icecc_remove_link() {
+ local t="/usr/lib/icecc/bin/${1}"
+ if [ -L ${t} ]; then
+ icecc_echo "Removing ${t}..."
+ rm -f "${t}"
+ fi
+}
+icecc_install_link() {
+ # Search the PATH for the specified compiler
+ # then create shadow link in /usr/lib/icecc/bin to icecc
+
+ if [ -n "$(type -p ${1})" ]; then
+ # first be sure any old link is removed
+ ICECC_QUIET=1 icecc_remove_link "${1}"
+
+ # then create the new link
+ local t="/usr/lib/icecc/bin/${1}"
+ icecc_echo "Creating icecream shadow link: ${t}..."
+ ln -s /usr/bin/icecc "${t}"
+ fi
+}
+icecc_links() {
+ local a
+ for a in gcc cc c++ g++ ; do
+ [ -n "${2}" ] && a="${2}-${a}"
+ eval "icecc_${1}_link" "${a}"
+ done
+}
+
+###
+# main routine
+
+case "${1}" in
+ --install-links )
+ icecc_links install "${2}"
+ ;;
+ --remove-links )
+ icecc_links remove "${2}"
+ ;;
+ * )
+ echo "usage: ${0} {--install-links|--remove-links} [ CHOST ]"
+ ;;
+esac
+
diff --git a/sys-devel/icecream/files/icecream-create-env b/sys-devel/icecream/files/icecream-create-env
new file mode 100644
index 000000000000..dafdc13b4331
--- /dev/null
+++ b/sys-devel/icecream/files/icecream-create-env
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# icecream-create-env - helper script to create icecc environments(mostly for cross-compiling)
+#
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+#
+# Please note, this script has been designed to work with Gentoo's crossdev, it may or may
+# not work with cross-toolchains that were build differently.
+#
+#
+# Usage: "./icecream-create-env" creates a native environment(similar to icecc --build-native)
+# "./icecream-create-env prefix" creates a cross-compile environment using the cross-toolchain created by crossdev
+# Example:
+# "emerge crossdev && crossdev -t sparc-unknown-linux-gnu && icecream-create-env sparc-unknown-linux"
+
+if [ `id -u` -ne 0 ]
+then
+ echo "Only the superuser can execute this script."
+ exit 1
+fi
+
+# param 1 = CHOST
+prefix="${1}"
+
+if [ -z "${prefix}" ]
+then
+ prefix="`gcc -dumpmachine`"
+fi
+
+gccbin=`which ${prefix}-gcc 2>/dev/null`
+if [ ! -e "${gccbin}" ]
+then
+ echo "Can't find ${prefix}-gcc!"
+ exit 1
+fi
+
+gxxbin=`which ${prefix}-g++ 2>/dev/null`
+if [ ! -e "${gxxbin}" ]
+then
+ echo "Can't find ${prefix}-g++!"
+ exit 2
+fi
+
+version="`${prefix}-gcc -dumpversion`"
+
+tmpdir=`mktemp -d`
+tmpfile=`mktemp`
+
+target=`gcc -dumpmachine`
+if [ "x${target}" = "x${prefix}" ]
+then
+ /usr/libexec/icecc/icecc-create-env \
+ /usr/${prefix}/gcc-bin/${version}/gcc \
+ /usr/${prefix}/gcc-bin/${version}/g++ \
+ | tee ${tmpfile}
+else
+ /usr/libexec/icecc/icecc-create-env \
+ /usr/${target}/${prefix}/gcc-bin/${version}/${prefix}-gcc \
+ /usr/${target}/${prefix}/gcc-bin/${version}/${prefix}-g++ \
+ | tee ${tmpfile}
+fi
+
+# figure out the name of the archive
+icecc_envname=`grep "creating" ${tmpfile} | awk '{print $2}'`
+
+echo "Testing icecc environment..."
+tar -x -z -f ${icecc_envname} -C ${tmpdir}
+touch ${tmpdir}/empty.c
+chroot ${tmpdir}/ /usr/bin/gcc -c /empty.c
+tested=${?}
+rm ${tmpdir}/empty.c
+
+if [ "${tested}" -ne 0 ]
+then
+ echo ""
+ echo "Creating icecc environment failed. Please see error message(s) above! The temporary directory is: ${tmpdir}/"
+else
+ echo ""
+ echo "Icecc environment has been created. It has been saved as ${icecc_envname}!"
+fi
+
diff --git a/sys-devel/icecream/files/icecream-gentoo-multilib.patch b/sys-devel/icecream/files/icecream-gentoo-multilib.patch
new file mode 100644
index 000000000000..94c6a41b3af6
--- /dev/null
+++ b/sys-devel/icecream/files/icecream-gentoo-multilib.patch
@@ -0,0 +1,59 @@
+Index: services/job.h
+===================================================================
+--- services/job.h (revision 843731)
++++ services/job.h (working copy)
+@@ -57,6 +57,10 @@
+
+ unsigned int argumentFlags() const;
+
++ const ArgumentsList getFlags() {
++ return m_flags;
++ }
++
+ void setFlags( const ArgumentsList &flags ) {
+ m_flags = flags;
+ }
+Index: client/main.cpp
+===================================================================
+--- client/main.cpp (revision 843731)
++++ client/main.cpp (working copy)
+@@ -218,6 +218,39 @@
+
+ local |= analyse_argv( argv, job );
+
++ /* honour Gentoo's ${CFLAGS_${ABI}} environment variable */
++ if (getenv("ABI") != NULL) {
++ char* envar = (char*) malloc(sizeof(char) *
++ (strlen("CFLAGS_") + strlen(getenv("ABI")) + 1));
++
++ if (!envar)
++ return 1;
++
++ /* We use CFLAGS_${ABI} for gcc, g++, g77, etc as they are
++ * the same no matter which compiler we are using.
++ */
++ sprintf(envar, "CFLAGS_%s", getenv("ABI"));
++
++ if (getenv(envar)) {
++ ArgumentsList args = job.getFlags();
++
++ char* pch = strtok(getenv(envar)," \t");
++ while (pch != NULL) {
++ #if CLIENT_DEBUG
++ log_info() << "adding CFLAG '" << pch << "' as specified in environment variable ${CFLAGS_${ABI}}" << endl;
++ #endif
++ args.append(pch, Arg_Remote);
++ pch = strtok(NULL, " \t");
++ }
++
++ job.setFlags(args);
++
++ free(pch);
++ }
++
++ free(envar);
++ }
++
+ /* if ICECC is set to no, then run job locally */
+ char* icecc = getenv("ICECC");
+ if ( icecc && !strcasecmp(icecc, "no") )
diff --git a/sys-devel/icecream/files/icecream-r2 b/sys-devel/icecream/files/icecream-r2
new file mode 100644
index 000000000000..21cfddeda8c3
--- /dev/null
+++ b/sys-devel/icecream/files/icecream-r2
@@ -0,0 +1,44 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start() {
+ local basedir=${ICECREAM_BASEDIR:-"/var/cache/icecream"}
+ local netname=${ICECREAM_NETNAME:+"-n ${ICECREAM_NETNAME}"}
+ local logfile=${ICECREAM_LOG_FILE:+"-l ${ICECREAM_LOG_FILE}"}
+ local nice=${ICECREAM_NICE_LEVEL:+"--nice ${ICECREAM_NICE_LEVEL}"}
+ local scheduler=${ICECREAM_SCHEDULER_HOST:+"-s ${ICECREAM_SCHEDULER_HOST}"}
+ local maxjobs=${ICECREAM_MAX_JOBS:+"-m ${ICECREAM_MAX_JOBS}"}
+ local verbosity=${ICECREAM_VERBOSITY:-"-v"}
+
+ [[ ! -d /var/log/icecream/ ]] && mkdir -p /var/log/icecream/ && chown icecream:icecream /var/log/icecream/
+ if [[ "${ICECREAM_RUN_SCHEDULER}" == "yes" ]]; then
+ local slogfile=${ICECREAM_SCHEDULER_LOG_FILE:-"/var/log/icecc_scheduler"}
+ touch ${slogfile} && chown icecream:icecream ${slogfile}
+ slogfile=${slogfile:+"-l ${slogfile}"}
+ ebegin "Starting Distributed Compiler Scheduler"
+ start-stop-daemon -u icecream --start --quiet --exec /usr/sbin/icecc-scheduler -- -d ${slogfile} ${netname} ${verbosity}
+ eend ${?}
+ fi
+
+ [[ ! -d ${basedir} ]] && mkdir -p ${basedir} && chown icecream:icecream ${basedir}
+ ebegin "Starting Distributed Compiler Daemon"
+ start-stop-daemon --start --quiet --exec /usr/sbin/iceccd -- -d ${logfile} ${nice} ${scheduler} ${netname} -u icecream -b "${basedir}" ${maxjobs} ${verbosity}
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping Distributed Compiler Daemon"
+ start-stop-daemon --stop --quiet --name iceccd
+ eend ${?}
+
+ if [[ "${ICECREAM_RUN_SCHEDULER}" == "yes" ]]; then
+ ebegin "Stopping Distributed Compiler Scheduler"
+ start-stop-daemon --stop --quiet --name icecc-scheduler
+ eend ${?}
+ fi
+}
diff --git a/sys-devel/icecream/icecream-0.9.7-r1.ebuild b/sys-devel/icecream/icecream-0.9.7-r1.ebuild
new file mode 100644
index 000000000000..03105d9b5c31
--- /dev/null
+++ b/sys-devel/icecream/icecream-0.9.7-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit autotools base user
+
+MY_P=icecc-${PV}
+
+DESCRIPTION="icecc is a program for distributed compiling of C(++) code across several machines; based on distcc"
+HOMEPAGE="http://en.opensuse.org/Icecream"
+SRC_URI="ftp://ftp.suse.com/pub/projects/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+ "${FILESDIR}/0.9.6-symlinks.patch"
+ "${FILESDIR}/0.9.6-crosscompile.patch"
+ "${FILESDIR}/${PV}-automake.patch"
+ "${FILESDIR}/${PV}-glibc2.16.patch"
+ "${FILESDIR}/${PN}-conf.d-verbosity.patch"
+ "${FILESDIR}/${PN}-gentoo-multilib.patch"
+)
+
+pkg_setup() {
+ enewgroup icecream
+ enewuser icecream -1 -1 /var/cache/icecream icecream
+}
+
+src_prepare() {
+ base_src_prepare
+ sed -i -e "s/Defaut/Default/g" suse/sysconfig.icecream || die #275761
+ eautoreconf
+}
+
+src_install() {
+ default
+
+ dosbin "${FILESDIR}"/icecream-config
+ dosbin "${FILESDIR}"/icecream-create-env
+
+ newconfd suse/sysconfig.icecream icecream
+ doinitd "${FILESDIR}"/icecream
+
+ diropts -m0755
+ keepdir /usr/lib/icecc/bin
+}
+
+pkg_postinst() {
+ ebegin "Scanning for compiler front-ends..."
+ /usr/sbin/icecream-config --install-links
+ /usr/sbin/icecream-config --install-links "${CHOST}"
+ eend ${?}
+
+ elog
+ elog "If you have compiled binutils/gcc/glibc with processor-specific flags"
+ elog "(as normal using Gentoo), there is a greater chance that your compiler"
+ elog "won't work on other machines. The best would be to build gcc, glibc and"
+ elog "binutils without those flags and then copy the needed files into your"
+ elog "tarball for distribution to other machines. This tarball can be created"
+ elog "by running /usr/bin/icecc --build-native, and used by setting"
+ elog "ICECC_VERSION in /etc/conf.d/icecream"
+ elog ' ICECC_VERSION=<filename_of_archive_containing_your_environment>'
+ elog
+ elog "To use icecream with portage add the following line to /etc/portage/make.conf"
+ elog ' PREROOTPATH=/usr/lib/icecc/bin'
+ elog
+ elog "To use icecream with normal make use (e.g. in /etc/profile)"
+ elog ' PATH=/usr/lib/icecc/bin:$PATH'
+ elog
+ elog "N.B. To use icecream with ccache, the ccache PATH should come first:"
+ elog ' PATH=/usr/lib/ccache/bin:/usr/lib/icecc/bin:$PATH'
+ elog
+ elog "Don't forget to open the following ports in your firewall(s):"
+ elog " TCP/10245 on the daemon computers (required)"
+ elog " TCP/8765 for the the scheduler computer (required)"
+ elog " TCP/8766 for the telnet interface to the scheduler (optional)"
+ elog " UDP/8765 for broadcast to find the scheduler (optional)"
+ elog
+ elog "Further usage instructions: ${HOMEPAGE}"
+}
diff --git a/sys-devel/icecream/icecream-1.0.0-r1.ebuild b/sys-devel/icecream/icecream-1.0.0-r1.ebuild
new file mode 100644
index 000000000000..e43d004caa23
--- /dev/null
+++ b/sys-devel/icecream/icecream-1.0.0-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+MY_P="${P/icecream/icecc}"
+
+inherit base eutils user
+
+DESCRIPTION="icecc is a program for distributed compiling of C(++) code across several machines; based on distcc"
+HOMEPAGE="https://github.com/icecc/icecream"
+SRC_URI="ftp://ftp.suse.com/pub/projects/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
+IUSE=""
+
+RDEPEND="
+ sys-libs/libcap-ng
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-libcap-ng.patch"
+)
+
+pkg_setup() {
+ enewgroup icecream
+ enewuser icecream -1 -1 /var/cache/icecream icecream
+}
+
+src_configure() {
+ econf \
+ --enable-shared --disable-static \
+ --enable-clang-wrappers \
+ --enable-clang-rewrite-includes
+}
+
+src_install() {
+ default
+ prune_libtool_files --all
+
+ newconfd suse/sysconfig.icecream icecream
+ newinitd "${FILESDIR}"/icecream-r2 icecream
+
+ insinto /etc/logrotate.d
+ newins suse/logrotate icecream
+}
diff --git a/sys-devel/icecream/icecream-1.0.0-r2.ebuild b/sys-devel/icecream/icecream-1.0.0-r2.ebuild
new file mode 100644
index 000000000000..ead3cbfcfa51
--- /dev/null
+++ b/sys-devel/icecream/icecream-1.0.0-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+MY_P="${P/icecream/icecc}"
+
+inherit user
+
+DESCRIPTION="icecc is a program for distributed compiling of C(++) code across several machines; based on distcc"
+HOMEPAGE="https://github.com/icecc/icecream"
+SRC_URI="ftp://ftp.suse.com/pub/projects/${PN}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="
+ sys-libs/libcap-ng
+"
+RDEPEND="
+ ${DEPEND}
+ dev-util/shadowman
+"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-libcap-ng.patch"
+)
+
+pkg_setup() {
+ enewgroup icecream
+ enewuser icecream -1 -1 /var/cache/icecream icecream
+}
+
+src_configure() {
+ econf \
+ --enable-shared --disable-static \
+ --enable-clang-wrappers \
+ --enable-clang-rewrite-includes
+}
+
+src_install() {
+ default
+ find "${D}" -name '*.la' -delete || die
+
+ newconfd suse/sysconfig.icecream icecream
+ newinitd "${FILESDIR}"/icecream-r2 icecream
+
+ insinto /etc/logrotate.d
+ newins suse/logrotate icecream
+
+ insinto /usr/share/shadowman/tools
+ newins - icecc <<<'/usr/libexec/icecc/bin'
+}
+
+pkg_prerm() {
+ if [[ -z ${REPLACED_BY_VERSION} && ${ROOT} == / ]]; then
+ eselect compiler-shadow remove icecc
+ fi
+}
+
+pkg_postinst() {
+ if [[ ${ROOT} == / ]]; then
+ eselect compiler-shadow update icecc
+ fi
+}
diff --git a/sys-devel/icecream/metadata.xml b/sys-devel/icecream/metadata.xml
new file mode 100644
index 000000000000..55acc851705c
--- /dev/null
+++ b/sys-devel/icecream/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>cluster@gentoo.org</email>
+ <name>Gentoo Cluster Project</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>suse@gentoo.org</email>
+ <name>SUSE</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">icecc/icecream</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/kgcc64/Manifest b/sys-devel/kgcc64/Manifest
new file mode 100644
index 000000000000..1526704fdde3
--- /dev/null
+++ b/sys-devel/kgcc64/Manifest
@@ -0,0 +1,57 @@
+AUX 4.1.0/gcc-4.1.0-cross-compile.patch 1134 SHA256 8ee57285151659793df88e025f1225b401a0c805bfc8d1685e04ef75393a24ab SHA512 84d0ab9bcfdd18148392a7219ec0ad4a1e63d43bda3f45a13e22f551f2f119822fed700570bd659f9260b09b0958d4c49e339ad4f135740e5b60e46462de7f20 WHIRLPOOL 1252a62c809523fb0669cf1c4f056d98c6fa4d24a3f97339be828fea8fcd66254b2e1112d6c4c628deddf71418dcf8e6a8846013bf6683efbe4cc3bfdd8f6cb4
+AUX gcc-configure-LANG.patch 2052 SHA256 63de6d2dcfe14f21d147abeb1390405b9220c03f8e968f482d4b4c1cf279c88b SHA512 a694c7ac2f45cc657097ff5b0cf1356ac88a9c06035c9ba15167e9d444844d0d8a478eb1b9b62195dd063774f79697b9148b9cdb6c261640b472c291061b2129 WHIRLPOOL 3cc1ec912fb192ff1058de5b93e49a994ba30d1501a932290dd5b3df1cd783875621cda56edeb41894cd5fa10c04917e693a40a60be8d742ddd7992bf5d8afeb
+AUX gcc-configure-texinfo.patch 337 SHA256 74b73a7ecec2d88889876b4db480cd173632f49d5396bb8e5b3c93673f9b5b98 SHA512 a15fba8bf2ff02bdeca54d6f186bfa08c1079c6a8ba0a3beef154483ce5c1b8c497e7ffeec32371968f0037e0ff8384609eb0c367d0155a4e5a7eef8aad084d5 WHIRLPOOL 39d008aad06f7621e4e5db15f5e85a59e583b43f8d247029bd4944466bb60a9795bda157d185c45c329294078e282703a243aad5c468d90c77665dd6336870d4
+DIST gcc-4.1.2-patches-1.0.1.tar.bz2 43294 SHA256 311cef339fd021c72086cdef361e0aa6409a4a62d21fddaa7a5171bc1545085a SHA512 79f1d47d364462325a927b35b66bbdc68c100dbb6c86a6dd524d0e1cd09b7135c3789e80b71539cec63befbeea1a0e9b456b53ab0a5580b64509f78231d3fdc5 WHIRLPOOL 709cd322c03d0292475ae46a62ce3c09b7c245b866dbf07ef05725c535531e6933f2c9fb51ec69166f300573912fcf608ca9219dc41e14fd6adc18cd62727a7c
+DIST gcc-4.1.2.tar.bz2 39707720 SHA256 cfc0efbcc6fcde0d416a32dfb246c9df022515a312683fac412578c4fd09a9bc SHA512 b97d3b72a3b0355611d5090b2c715b7a774f0e466a89326a0226c2809d12dfafb2d7c5a7af54bd5e00c135bbb6596f535e1a484740f7f1f691e8a57e6f0425cc WHIRLPOOL 5822040f7e96919bb906ce55e0bd19c4c85b3a47ce73f0a4b6d0da62ce9d7651b6cbeb6199dafc38582b206a98126e3efec8d54cc58c7f303ca708c9261bec57
+DIST gcc-4.2.4-patches-1.0.tar.bz2 21809 SHA256 3e077b6d4e9d51a30094aff35c4045bef859fc20c7a341f772da059b8bc6be85 SHA512 20eb3fa790e5cc1bd66c9ad1915c73c20ae8977d6789addaf4863184e6d5c25ab9b0f2c40e3ad08a6859825b2e97bf0839e0a616730362072aa35e8ae158a427 WHIRLPOOL 84d87cb1dc412e7f5318000264336b329f6f827af0769121370184fb96f4f37184cd1de2630743270d6ef63736fbc905fc68b76e86d799738daf690a94254551
+DIST gcc-4.2.4.tar.bz2 44025458 SHA256 afba845e2d38547a63bd3976e90245c81ea176786f9e6966339c6d3761f1133a SHA512 c6e3e4fce1d27d0c56ab24f4809367d9329b620b7c124e88de190f2ea2ae57b5e06d0bda85c5a74237a4f94ddba53dc91faea0611fff7b19ad720edc312cb0d9 WHIRLPOOL 242177c7adc1538dfbf0b5519132902479c9a8f21158ed04bcf29a3616bbf98d0cf4def13e602ad0226e745875c327d33e8f45eae1b1e6de6d61e2a0ca1b0b90
+DIST gcc-4.3.5-patches-1.1.tar.bz2 74719 SHA256 caebc997ecb83d2dcf736404b66de32e8dd324015d76a0ae9335d373e2f6229a SHA512 9c0e13e1186259f3410bc1cccf198d4bd9f1a2fec7d121ca8dfa0a90312b40f4610d216c8012525440045b83347dc2e05ac3f1584a08a54e5d384c56563bf4e3 WHIRLPOOL 41bb988b423a842619e0b77be9cce7ae798dbdd8c0034e8ef13a50dc93345018a6a66937528b66771fa755e78338507aa4e694728bdd7cfdfa651247945b13dd
+DIST gcc-4.3.5.tar.bz2 59347925 SHA256 10c6e745c39dbdc950cfa16ba8e3603cb52c5bd9d4d7e665c9a13a6f62407e6b SHA512 3c4074102b49c9783ecabb183f37741ff878ebc481c4e42661de913d1453fb72f074cfbfafacfb2d7fe6ea662da3c706855fc43afaca26de0c599b8121b60803 WHIRLPOOL 851c422087b23ec923c76398e601a5b36245f64973811a6d85992bcc1c67d906862b4dee38aa9ca5badc4f27b20c24096c0b798f27b3470f006e16f8b263d6c5
+DIST gcc-4.4.5-patches-1.2.tar.bz2 22319 SHA256 5cef67eeee0ce89f1471b3a6a75e0acbd4a54e78efc335b0bb66ac17e7cb7349 SHA512 ea3d0ac7b6a31d32ecf94fdd27b210ad97136cb7a1544f748ba936cc70c2c3964162b67ddf581ebef7eb57dd495bc5058759f4240e2a27392359015a4c22e331 WHIRLPOOL d4df74933f556acbc6709366757b505c349c3e428f1d609d986218972913eedf1225682c8f03560a62e9b564d75f506636beec3aa1d093567cb715aec1f975e4
+DIST gcc-4.4.5.tar.bz2 63081552 SHA256 a945eb6cf694a55f83af904f4a3fb41ee07b9d021826dfe66991dfa7f0ea97ce SHA512 d98ed79b13b58dc2e83d988514bd9a4dfe0dd4c8538efdfbaf0ec1f58c0aa990c39f97699f43b32d09f6022aacda2552e226c82de8c7b816a15708537f32662e WHIRLPOOL 6a7307fe034b16643fe333ee6e2bac228a44e8872d2c66a7aef9bc58b852fd107ba86df257528878a40eea86a6bda487f86ab5d62cd4e43443c76f174189dfb5
+DIST gcc-4.4.6-patches-1.0.tar.bz2 25346 SHA256 150a6503145e3a52b19419b66c8224808a8c1b2f813bdf552f6b1e4cf6b80310 SHA512 3074afcd36f5d0ba4a2ae53d5742dd269c36284bfa345564bd0de7d95111b15b43e5c8f86ecd577257d769baca976d02dc2fc31e4f8c5bdca2b989efc92c009b WHIRLPOOL 385cae48cdf3fa26d03c4ef3a10f0efdd0b2dada36d061d6b2fae229a9b91fdaa4f5d105816eb89feacebf0313eaefc94f6175f94c32c574bff517bde226a4d1
+DIST gcc-4.4.6.tar.bz2 63135296 SHA256 57c718899e19277cbce9df3b0940a319e63c4630df6134185a45f157f24e8a0b SHA512 a4ecc77e227c523b65988ecc3db4243bd96794d7373a4c3e7c15b5c60944f204be1d8a045a964bbe5ce0bb6d6136c09336eff0059a1970c0404f5585bf8688d7 WHIRLPOOL 26f8b2bdd09408f8abee99b16723b072b99f38d999eda8ae809778035914a09d47a2ef5c23b883961a1aa360fdc6d6520d4164873d73f510606f2bbb677b848b
+DIST gcc-4.5.3-patches-1.4.tar.bz2 22869 SHA256 96e7ee4805ceb19cc27ca9ef0f79c061f18c716ca33338a738c135cfe89f145c SHA512 5361914ba7142a22c12f7f415840be1645a8e6531ee7310a4ef476537b3f81e71fe69a11ac51d6016b0599ab5eef06b024cdf47e03cc11a5e1e5b031a63e2851 WHIRLPOOL 39399a559ca8270761e41387e43572e93643d0c2bb4c4b230f79934c8b1bf371d73e7181adc414b044198c7d36bc1c7979b381e2b9f88dbe64cfaa19648fd165
+DIST gcc-4.5.3.tar.bz2 66374586 SHA256 0a8847af44a9b33813b199997a73139517c96adfd519eaf24c79d4d9d09f65de SHA512 42c03aa0d16a52e95d1857d859ddd0a4923c232b90481ee52b02bc9a3976bc6e5e502e94af3fc76ac054572a420303c47e409c72f816416aeffd74c4bcd443d3 WHIRLPOOL faad2337eaae059cde6a2f42227f29a6c2855e6cbf16894a178e446b7668b7f68e23a7968926473974ec9aff3680cebbebfc01af0a60474ff90cf1fad3e96a11
+DIST gcc-4.5.4-patches-1.2.tar.bz2 22588 SHA256 45ea4e83e6c879d666fd38be5a4c7cce3e5ad756ebd402c664f65702dd2e4750 SHA512 f69c7be5195d4151c3ed1d3fb2913a77bea871554b03f1149ce700bb4cf553edc795cafd637c75305af6ed4079ec698122cac7836ff0f06189f9687ee5565f99 WHIRLPOOL e49f668c567c5427d12720d2d937092cbe323b023c786e25dde5babdcf8a1dfacab9deb82d7702cb67eba1eedb56d83fbe59f853102cad55b33e3d2ff213b270
+DIST gcc-4.5.4.tar.bz2 66426133 SHA256 eef3f0456db8c3d992cbb51d5d32558190bc14f3bc19383dd93acc27acc6befc SHA512 78696b287d46aacd6f150920da376ea32f58ad9f0dafd2d3b7fa6dbdd8dd7afe659108d1dfaa5807617fc5248719f50b39c37ade0173ea5b9fec2091f4656115 WHIRLPOOL 1d3aa5f344171a75144118101bf475536940eeb80f73849827ee4103c52dfb6504d9b26e21fa0984c65c5e6267e02fa6e7f8ef539c44f45470790781080aadca
+DIST gcc-4.6.4-patches-1.0.tar.bz2 18687 SHA256 f751e2e701c48bc30d3047b87b5d08fb15095de3bb5b83c9662c08f5e5449a92 SHA512 8dd580faa9bcffcdeb1843a8d3d3bd8db492891d855c17bba3cc019673d814a5d24a927055694307be6438cb2c041bc799646a483c019f3840e4e1ca33b7ccb5 WHIRLPOOL 695fd821f347062bed01305fa1aca8c0cf4085391ad63f31df4afa3f4eaeb57eba7cebae02caac788dc9b290a57d675e66667ee3e15522d7d2909cbcbf1e6982
+DIST gcc-4.6.4.tar.bz2 72006076 SHA256 35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8 SHA512 b5a5395782e0b9e61cda052f6e00c8575d1aa0b7e8db9e34c06e4e45f12ff37b436018536b7fa69a04a4235b5b368895652e3ed8fab2fe11763f9782ed9161dc WHIRLPOOL ab1b035f43aec669640b36037e65ae0edceb3b13b1ce4f7900aeff5ee06686dc2d66c3dd81156f53c4e9a9a806e4becd4462f72a6c4ad7e646b632c10c23356c
+DIST gcc-4.7.3-patches-1.3.tar.bz2 42559 SHA256 082cf644967bd83a145c0699d212d2e3703365483b08d43b3c1e50961602f029 SHA512 3a962d5301aaaebdf18b49e4d603b1dfd13d1bc0e874d66f7d0840058dc4588cc081df0b1da05bc6e293cb76bdb7fef1f4e76261f1c15820c8008a4f9814fa13 WHIRLPOOL cdd782784d730c8d6de48e74a30f980581d37818e6a3ca5d6ffa30ed9b822fd3fed2232fbdcb5eb01359675d9030a95ea2adf9ed6abba52d6725e07bc3152b44
+DIST gcc-4.7.3.tar.bz2 82904224 SHA256 2f7c37eb4fc14422ff2358a9ef59c974a75ab41204ef0e49fc34ab1d8981a9c3 SHA512 5671a2dd3b6ac0d23f305cb11a796aebd823c1462b873136b412e660966143f4e07439bd8926c1443b78442beb6ae370ef91d819ec615920294875b722b7b0bd WHIRLPOOL cb3408e3e251833f38ae7cf2388a1ddce864614fe1c68de9729a1a9a1f8f028ab92c0f2b863e7fa3ac16dbf443306ac864e74c9cce90690230c081ee2ac309d3
+DIST gcc-4.7.4-patches-1.0.tar.bz2 40785 SHA256 bd54097be04a28f50890cffb0f00c6794f1196496c55264711e036ef82173eea SHA512 223dfe74cb784e6e6d53f8a8ccf939a938be17fe039676d4750f0b3f767cc0c967fd69c3fce054983cad1739901c7cbb262c3e61b9ada0d56af1815a69f6bb7b WHIRLPOOL 2aba0ac3948012a353bd3e0cb9cfd3251633dc69c0254607026540f0ae38f06258f8e4e633075589d0c590b17eb9326187eff89b1c9d451bf16a3afd67b26c6a
+DIST gcc-4.7.4.tar.bz2 82935453 SHA256 92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282 SHA512 dfcb737073191e628231031a3571ec77ee760a59377630f4a6e4fdfa66f9ddad39fde47e3f0f227eb43cdf90e0d34cde5abdc9ac892c1e111a911062a66c9189 WHIRLPOOL df8408e80634ce28f105f9abcdcf38fba5c130795cbe48428527a68819abebc3bc7152bb6ad714e40c71450a08986b48ddd630c887e1b2faf07c3babfe720969
+DIST gcc-4.8.3-patches-1.1.tar.bz2 19882 SHA256 019cbe76f20f4e294b900ccb99a6b52553ed04fa0d2993798b3a07b0e4a8f90a SHA512 8512ec54fb2d482e08ca54042e11c6334d653ec850cc7c920ed95654575222ac0303caa35cd46e80f1985d86cd229f35e26e0eaca1ae623fd8d336940148801c WHIRLPOOL d7b8d6278b6f79aa00fcd29ed6142cad3002def33edb0be44e638d50cb3b1fa8da72fa62a7276c81c94cd873c872dd0e7fd602022420d9601fde8f2b04872ece
+DIST gcc-4.8.3.tar.bz2 86126808 SHA256 6a8e4f11b185f4fe2ed9d7fc053e80f8c7e73f800c045f51f9d8bea33f080f1e SHA512 2b40d231e8445f9c1654137df509f09ce1187b475138ca7f648f710d922a1718f740b2d8a37c26e16b5e27900c60358be98229ae884a6f1f70e9df44ad24d02b WHIRLPOOL 6dd3bd4b51bb9b8c52fb743bba28cde8612ff7090b71e56bf02d3613b91cd4c3c4dd91dbcb672985f22400d776870ba55550e1fc44afae9737092ceca5f83ebd
+DIST gcc-4.8.5-patches-1.3.tar.bz2 26025 SHA256 4a165e6a387421f581f49c742243bf013c9fb7c91f44514be7b38292178ebbb4 SHA512 8d190f81ca0d25281250dbf0a670fcf12334b0811a5bf664e6450942a2996d02b979c6e8f8760b287edad06df3d1f8e2fe5cb0c3dcf9677c3420457d841d9506 WHIRLPOOL d31b3f48e13e5a9292b704afc745cbea038e61eedc4dba0d659558b56feeafec118043f3430457f71dc938760d72860e4318b2238b3bee9fba069c740327b78a
+DIST gcc-4.8.5.tar.bz2 86165587 SHA256 22fb1e7e0f68a63cee631d85b20461d1ea6bda162f03096350e38c8d427ecf23 SHA512 47fdfeca0c0a624cdec9c4ae47137d056c918d5c386d4b96985bb3c8172aba377cb66cbcc30e80832fd244a7d98f562c20198056915c70cfef0977545073a8ea WHIRLPOOL 026253cd2f3706871dfe2525c0302b38b3f513f6a62666d0ba0ca2e62d6513f09ad5c1177f2a63ae3bad660fe60e7909b6930d26df2b367b9ec68e14552c6e11
+DIST gcc-4.9.4-patches-1.0.tar.bz2 22266 SHA256 1a394abb77c75e2212896ad3a62ae1f6bfd3660b1c176c608298733c740a00e4 SHA512 cc2407221f858bad38b57d31f635314f91794293695e23d255685d8bec20b9db19c7dc76bbf5e8184c2ba0ccb530958b09bae4d8a402ca27cadf463f46bfb995 WHIRLPOOL c74e5273c718020b591911d589d8eff5e366c902c479e566f966577efcbf424b19669a54843b2ddd60c51c81fd2851bc86aec1c647482b4789a518f01dd62561
+DIST gcc-4.9.4.tar.bz2 90097606 SHA256 6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092 SHA512 93abb78e16277454f41a8e9810f41f66c0fdffdc539a762ff6b67d3037f78db971378683fd2ebf707d1d51c059fad2161fe42d110c330027f40214b7db0f3efe WHIRLPOOL e20045126c21a3edea1fa4a2185ec2bc5feec77ddf967ab9d1e8c33322ad4eafe013bfcaab1ed4e35971d3b70ef373ea3585ebb089c9bbf91bbfca1f1da71236
+DIST gcc-5.4.0-patches-1.0.tar.bz2 28227 SHA256 ff600369f150129754108322338c3f4f0064d222843a2d82778537f94a22ecbb SHA512 70cd83b142abaa3c22d67d5d58185da2cfa178737ec963e230cc03ea8dc6dc757665c711fae91af4cd91062d3136c6f31a5ee3c4c7440ed9485c6f3632731940 WHIRLPOOL 84a69d2dde582fd486f6c60f78ce9f8c7cc5b480c2989cc1804617eb6526a4a17d20d2ed010bd9fc78019d69caa665428970234090b21f9d4b97217011d4fcd6
+DIST gcc-5.4.0.tar.bz2 95661481 SHA256 608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a SHA512 2941cc950c8f2409a314df497631f9b0266211aa74746c1839c46e04f1c7c299afe2528d1ef16ea39def408a644ba48f97519ec7a7dd37d260c3e9423514265b WHIRLPOOL ec81c8143e48bc8d9d0bbdc0fa3ca553c805193f53ac46c86127b54565894780dd97281485e396a130567464c753f043458c8e450018c957813f50ff90a40708
+DIST gcc-6.3.0-patches-1.0.tar.bz2 7596 SHA256 6c880468ffa4ad2b324fd18c762dbdf10646089c8ab865c228e166f99a0e049c SHA512 8fc96086bd3da3726687ee9d180d3b5d0a7d5814141d44eac8eb01566a783ec780c8fb8f55f75d6e9c9006b2e407e20cdb5835d541b0b66a47dd60642861734c WHIRLPOOL b1bce94d6134db6c9aff4298c6c7af003e39d0411aa40cd027d2c7d6a256971c81fb557e85b25f1107e9a474cb7d772c3bc62a7a4ab7ff7fca5eeae5b2ca0c94
+DIST gcc-6.3.0.tar.bz2 99903185 SHA256 f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f SHA512 234dd9b1bdc9a9c6e352216a7ef4ccadc6c07f156006a59759c5e0e6a69f0abcdc14630eff11e3826dd6ba5933a8faa43043f3d1d62df6bd5ab1e82862f9bf78 WHIRLPOOL e79a2d6ad199396b6efd835c1129d049a367174ea33dd3b6247d72461f117c2dd81e5a66f3dd6427ce500e768d3a4453efd0debcb56966d00c7df79d05d54b7d
+DIST gcc-6.4.0-patches-1.0.tar.bz2 7577 SHA256 9c9b68c28e67be281c9bcec5d944b2a3439bab953dce08fd35a65b10f9dae3cd SHA512 e649e334eec4deb7c261d808ed460413d78a2a4a672823d214c1e173a13bc314ce898fbf3674a7c7fe3151a089384ee0a7dee479bc8d005a06b65b39216bdf75 WHIRLPOOL d7d9a80038fb939c26605d91eda9bc23070179bdf6ce597255c44f9d83f2603aae91d9890d2a445bce8c682708743021485f1415cea0b9b8f02dd9d982e36d3b
+DIST gcc-6.4.0.tar.xz 76156220 SHA256 850bf21eafdfe5cd5f6827148184c08c4a0852a37ccf36ce69855334d2c914d4 SHA512 02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90 WHIRLPOOL 136b282c6957877d2f463d83740fa65a4e7a346ac94e4baabea25cec41ae307f34409b1e518a22927821d564b8634a48978dc8e1d0b988999e924adcbf3f5cc9
+DIST gcc-7.1.0-patches-1.1.tar.bz2 6746 SHA256 39d4a0c659cc361bd3c71fdc9b793bccfa2bce06ede65ac49b805d1e236fcc8e SHA512 1bf95a505dc6c37bf6924bb69fd0670c8f3355b6690c94edf4a4248649accbd426575b40cb7a473dfb0ae09a924b05619e5c633384bae0293edb670cfd0d3a30 WHIRLPOOL 9682649fff62b56683637d25a58d11928342d99e52b2269f42369fd1d691208a7645802cb0d609ac30e20593ecdceb8cb1ab9b216963afe14db1b17ed43d5eb7
+DIST gcc-7.2.0.tar.xz 62312628 SHA256 1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a SHA512 f853cd6530b4055d8d8289da74687cb4c6d5f363598d386332d31852b581bac76c3adb7d61889edec3b779f63d8646f0122840f12965ce4a4389ba535dbbb6e1 WHIRLPOOL 9503fb08731d94b5d79b182579f41992e9db16dba8a034cbfa8a2703a975185859e79c1e3f6094d14d08c7f5d7135c2ca5ffd8d6f7ae7820c20d4076fe5e9f65
+EBUILD kgcc64-4.1.2.ebuild 1168 SHA256 e84143efe2d9389fdc3638bdfc90d11edb9041a3439ed9c2c850b69b3b6f6816 SHA512 da8dce9f584b850a76deb1e21fd9158751f4c9aa15935017f7d7d1d2f5ac0382a7cc31cce4b5e8b6502e666ed63998e360011d8f825090de3c5b7d348e478615 WHIRLPOOL 178272dc522dc63c6029a8af37eab6c20e5bf4c119368a8162ee8a74d90e7c86bd00bb2623b3bdbb35c10c0d4f5e6ec58023cd4f5397aa8364588e051bfb8505
+EBUILD kgcc64-4.2.4.ebuild 1044 SHA256 e507dfea9cc94ad60f6959486da03d04d8a9261dfb16065bd73c6c0432d12abb SHA512 24609f0e6a851e49e5f695c612f4d6bba8f179f07545c97d1a63c4cacfdc9efc56d47bb981e53bef8878994e1178b68a33ef5243d9420a27950a19be9e54a905 WHIRLPOOL c3cb88c031ab36b0b4b20dcc5c974c732b5c238fde3c8e7fcb34323b5fa9c72affeab04b7c326fe01e9b82afb8a6e7f1095d97a0e2cb69c2e9bfc80ece63bf4d
+EBUILD kgcc64-4.3.5.ebuild 1101 SHA256 92c1ad8828667d0174a9b38b27c41deddd945ffd221202a0b024e3f8aaf8b56c SHA512 902552e9c67e8b4da00a07ccc57922047cfc599442bd5d276453baae23bf944d4a5823da222ae7523e545ed9e5c9674d55e9228f6921c6a155311254ebbb8c91 WHIRLPOOL 93648a6859b8c9284607c092536529cc1a6934774010bb308d7602f097de86c0b721a05f06c2dcc3c3001b4d51c13971a886288d0a33f4ba690d4bfc4e622b9e
+EBUILD kgcc64-4.4.5.ebuild 1236 SHA256 6632d863cee5b22a3bd0157340ebcacb63428dedc9e6be100fa1d71423d21e61 SHA512 174ae9f0a263779b51d6dc4f994d602254825f5029b8129f938a2c95099f72731051021e3b24c65035430f764e86f912e75bddb62f2110f06dc5d50ce2398eb9 WHIRLPOOL 86cd7c7023b33daeee48f5addc585c9a366eadc653d841cc7e939c3ff29d4502957198ebfcb1c10bdf2fb5137fdfbdca6b5813197316ce21b6370402e29845de
+EBUILD kgcc64-4.4.6.ebuild 1237 SHA256 52c9337acbed8586ebcd2487cc1720bab4fc67d8822308b034aea2121fb3be97 SHA512 dece0552e0578b8dcba903dee5365fa81a31754b31b64fc4b5f974fa6972275d97b8b7a15d5a1572594a71e7aea421d9633603327a9d5cb7bbf6086336519e9c WHIRLPOOL 5b1a9be72e0c4bcde9c651d25367ce6edb1315b7e79e543eaf26207dccbfc5c475cbe7fde4040de1c1ff5ec14391b1d7b3a959f93ea4c1f2d2977900db5ccc3a
+EBUILD kgcc64-4.5.3.ebuild 1258 SHA256 3fd71185233aedcbc0f7d735469fbd6f9fd08f56015c3344bb3f947eab786f17 SHA512 7bc38c9c74cfc659cdc2c94dd6f06753d318799d9eca3dad1b8921256c2fcafd37fb5a4732885e60cee85e59b11bd1558242bf9c5b5e376c62f2fcb5489d5dbf WHIRLPOOL 0e20eb781caaabf94cee40a6ccadf051b2e36cccebb810951093a0a4313241351b98fffb6a05f5f66b9130c4cc11e6b712705016375c09ce4b933d5d97da9694
+EBUILD kgcc64-4.5.4.ebuild 1259 SHA256 9f1f892a5aae98f30957de927c89f340a76a89a63acf61611daaed3937ee6da4 SHA512 6bc719686c8d30c5a6cc55d47efd9dd047626f128ff2ff0e30e2bf6616c7bd1a8ab2eeb182c8f5c694a48c2d7190c52dff6eb93b96dbc4f2acdb0c041d5e9cce WHIRLPOOL 3f9a566c7f2c827d21a7251f89e7aeb32c8d1434befa5dc74e2db838929ffebf2f72c8b5bc038b07f7e3025525bf186b25ff5f9ca502746d45433fb7c519aa5a
+EBUILD kgcc64-4.6.4.ebuild 1259 SHA256 81c310926a09df33d80decf8e3a681a067a1aa1a6894834cea3eeb6ea6e51fe6 SHA512 0fea238de467187f61ed22b4a8f4d5bf38233b2e623fa9d1ea4214599118ffec5ca64446e0a8b071de6e64e0fb70575f8b52f698a1221f0dd0704edfecdb73b7 WHIRLPOOL 0f7d638ad9a76371cb15d57afbefc8e65db601f21c1adf9436f44aa5503377c2084f5ed85008fec9df223f2c2abe5c94f8da5a049f44387bc8bd9525f08220ce
+EBUILD kgcc64-4.7.3.ebuild 1258 SHA256 762e18bf5e3949bbd573c0d2d98d164af721c3758751b05ad1f24e146b64da2e SHA512 720c26a5263e86a8cff98db79fe3f73edf884fe956a39ef1f2ed2b2b58a649e1b56e26505be497313ca4f468bbaeae1ccb042c08b9415c50fffbdfdbb1baa8c5 WHIRLPOOL 8a0b4a0b75a3b3c596bb4f98b5a31e8fdbecdce63f025036992a5827b64050b462352b81376651dd77c67c2f6247730028438ff44e4a70f5288b150f21bbd13b
+EBUILD kgcc64-4.7.4.ebuild 1409 SHA256 a944a6db9ee9f2cb5f4d057e59d15a54d842827069dac154e1a13e489186ecab SHA512 c81fef45154daa1a7ca13d46ce12c97211e09228ca3f10fe2f3059f7e0c3cacf5124055d790163e6ef787f9093216374b993d0ea7895e938b3b32691fea866fa WHIRLPOOL 4e035f73fb36f6e2c1466734bc2b9e5a75600c522c04549241f876dc6801df4d647c09713012a65ce8e07f9c48d41c53d9ba611a9d6baf9ff9e9140bf7e20502
+EBUILD kgcc64-4.8.3.ebuild 1259 SHA256 06d2072629541dde3d4f687d8a26703c5b10a25a43ff5f8e6a5db4f8418b3b98 SHA512 85f52c6635d9a6455a6864fd596019f35e5231182fa87e0ccf964d8164764967c58c8fab0b518436a9d76acbd14b4aefdb99706eab348a846827d21464d50e31 WHIRLPOOL 2e1470b2363b631090a4d4594e26b950ea6c82e3e6efcd454e40e66cbbc49fbfcb7708c1e1e53d738fb66e1bedff4a64bc3e8ee83402ac6c41a2edcaff11ecd7
+EBUILD kgcc64-4.8.5.ebuild 1259 SHA256 2103ae18321856584a2da04bffbb6a8f2d60caf96f4cf1bfab8eb6ca6458dac2 SHA512 5236478e22a47057a6e30b1b50504455366d1c7f8132752642ebee27ddc45c371eded4cc2fb1f1f4910948c9e69dd213cc6edac8aa35146fc98d91bf3beb47de WHIRLPOOL 1c234633fb4681fe1b2a243f8790295ec99063a30b4ec7f977dbd8e69415fb16c326760b454ddd3cb9af94663c38e0109601cfe2134c9f01bb51098ad89d503e
+EBUILD kgcc64-4.9.4.ebuild 1257 SHA256 1202f1c07408b0222efb0bbf3b2ed736124435114319ff7ce9578c784363916c SHA512 3ad1ca0dc52946a130ec8b23042c4c414dc564a69f01331414abf06b3aafe2b1846eca5ec8112161d4852d1c997f7fd57f4b76a340cc63b1cfd3deebcbcf6a1f WHIRLPOOL 7b5dd5e6794752099f86edc611a5294154c3163a1397c0e11893261b409d0f686e04884e75006fbb85a3ba7a70ec8d0e4d672e78d43c4e9f3cc52b99c60f2e57
+EBUILD kgcc64-5.4.0.ebuild 1257 SHA256 1202f1c07408b0222efb0bbf3b2ed736124435114319ff7ce9578c784363916c SHA512 3ad1ca0dc52946a130ec8b23042c4c414dc564a69f01331414abf06b3aafe2b1846eca5ec8112161d4852d1c997f7fd57f4b76a340cc63b1cfd3deebcbcf6a1f WHIRLPOOL 7b5dd5e6794752099f86edc611a5294154c3163a1397c0e11893261b409d0f686e04884e75006fbb85a3ba7a70ec8d0e4d672e78d43c4e9f3cc52b99c60f2e57
+EBUILD kgcc64-6.3.0.ebuild 1258 SHA256 ba8165080180002da579d3fa3512b45253d82bbce8d7aa0a9bee4626d85177fa SHA512 7b134d06e506ca68dd381ad9ade1ef77d313831eb4cce72776579a1f5052b4684811b937f96dac4f5c66c3f16ddd83b46bcdb9ae37bc8f7bc623d0651fceea17 WHIRLPOOL f95ca285a4073ce89c3e1b6c4a757ae76a481c52438ee0e116df4068234165bcf1ad9716a0c15890e824dcf0c1a42834c1e09422de9021afdb93fd30809947e7
+EBUILD kgcc64-6.4.0.ebuild 1258 SHA256 ba8165080180002da579d3fa3512b45253d82bbce8d7aa0a9bee4626d85177fa SHA512 7b134d06e506ca68dd381ad9ade1ef77d313831eb4cce72776579a1f5052b4684811b937f96dac4f5c66c3f16ddd83b46bcdb9ae37bc8f7bc623d0651fceea17 WHIRLPOOL f95ca285a4073ce89c3e1b6c4a757ae76a481c52438ee0e116df4068234165bcf1ad9716a0c15890e824dcf0c1a42834c1e09422de9021afdb93fd30809947e7
+EBUILD kgcc64-7.2.0.ebuild 1318 SHA256 97a73b15cdf7949508a4f9e1058d6220b458e46ad889f931b3bf9b4c8e81c496 SHA512 1acc070819232b4c51a27528c427610bdfe5c2bc8f870bfd6d489a82d15ea22102a893780ec32b6415e31377c1216c9f6da3bc3ede722eb45876b33109c159f3 WHIRLPOOL 7de245927689a880e38e22702806acd65bbfcb40697be0987547e246ef48f9926b45daa16811c857b3ba0f2c49237c8636a5133ae73bb05198a6d05e2bc4ce29
+MISC ChangeLog 5902 SHA256 15175f9813ace20e308d052e9561198bbdc2fbfb9c2f334522933966d63dcf47 SHA512 0e2db1a2b915497a013eedd08a1453dfedb38e082a0284bb274da464dee065830dfffb55b2e190656285a5b1e7f2738fda4b52965e7267be12de0c6c734a50e9 WHIRLPOOL f4bda3bea2d329b39275e23728c93647e4c25972da00207d537659f05193fc59d949a0dd62bfda4db8164193b023c6b3c815df745dc69ff687d32ba3e9fc4af5
+MISC ChangeLog-2015 8929 SHA256 b1fae751e5d9a3659084624584f88c0dc93b2a71cb4ca5ede84cc3a1771d978c SHA512 2b0dc52300cfae20b3288e9e3b8c5dbaebe610003fefae3794b07d678f64c4c7acfbdbd8860c1a3bc92f469a63a3669e9c489bfba8c923fc3d04fd41295077c5 WHIRLPOOL 870b0c3fb3d10e18bd6d51642eac61639151f704054a62e080c458e58f41d07724345b0683390c7cfb3f3fa43da3a242390f96d6a7f7f1aa116389e6844a7dce
+MISC metadata.xml 371 SHA256 8eb9bc9e7ad66c2c671f190ca95b1d6e8aa338a6f938820edaf58b314f34bde6 SHA512 29d1c3a9cbb0241c2384fb8aff0b48a35a5dca126b750a4cf25e33a1d29a5e79b8fd0c1d03cb216deeef8f7abeb5230a67b7f421e1765d1f76eee2cb6e8ab4f6 WHIRLPOOL 112be190475d69ce8b7121ed9e247ff3aef670dbdd946f3a58a87385035739be2d0ecc43dbc077b0a35e29c479cf81029c219152dabf1dbb604b53fada5fe6d5
diff --git a/sys-devel/kgcc64/files/4.1.0/gcc-4.1.0-cross-compile.patch b/sys-devel/kgcc64/files/4.1.0/gcc-4.1.0-cross-compile.patch
new file mode 100644
index 000000000000..523caa48a3c8
--- /dev/null
+++ b/sys-devel/kgcc64/files/4.1.0/gcc-4.1.0-cross-compile.patch
@@ -0,0 +1,40 @@
+Some notes on the 'bootstrap with or without libc headers' debate:
+http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
+http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
+
+--- gcc/unwind-dw2.c
++++ gcc/unwind-dw2.c
+@@ -253,9 +253,11 @@
+ }
+ #endif
+
++#ifndef inhibit_libc
+ #ifdef MD_UNWIND_SUPPORT
+ #include MD_UNWIND_SUPPORT
+ #endif
++#endif
+
+ /* Extract any interesting information from the CIE for the translation
+ unit F belongs to. Return a pointer to the byte after the augmentation,
+--- gcc/configure
++++ gcc/configure
+@@ -12857,7 +12857,7 @@ then
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
+--- gcc/configure.ac
++++ gcc/configure.ac
+@@ -1717,7 +1717,7 @@ then
+ | powerpc*-*-*,powerpc64*-*-*)
+ CROSS="$CROSS -DNATIVE_CROSS" ;;
+ esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+ SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+
diff --git a/sys-devel/kgcc64/files/gcc-configure-LANG.patch b/sys-devel/kgcc64/files/gcc-configure-LANG.patch
new file mode 100644
index 000000000000..d1b1b0353662
--- /dev/null
+++ b/sys-devel/kgcc64/files/gcc-configure-LANG.patch
@@ -0,0 +1,64 @@
+The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in
+option parsing, it may break.
+
+http://bugs.gentoo.org/103483
+
+--- configure
++++ configure
+@@ -54,6 +54,19 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++ eval $as_var=C; export $as_var
++ else
++ unset $as_var
++ fi
++done
++
+ # Initialize some other variables.
+ subdirs=
+ MFLAGS= MAKEFLAGS=
+@@ -452,16 +463,6 @@
+ esac
+ done
+
+-# NLS nuisances.
+-# Only set these to C if already set. These must not be set unconditionally
+-# because not all systems understand e.g. LANG=C (notably SCO).
+-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+-# Non-C LC_CTYPE values break the ctype check.
+-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+-
+ # confdefs.h avoids OS command line length limits that DEFS can exceed.
+ rm -rf conftest* confdefs.h
+ # AIX cpp loses on an empty file, so make sure it contains at least a newline.
+@@ -1850,6 +1850,19 @@
+ # Compiler output produced by configure, useful for debugging
+ # configure, is in ./config.log if it exists.
+
++# NLS nuisances.
++for as_var in \
++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++ LC_TELEPHONE LC_TIME
++do
++ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
++ eval \$as_var=C; export \$as_var
++ else
++ unset \$as_var
++ fi
++done
++
+ ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+ for ac_option
+ do
diff --git a/sys-devel/kgcc64/files/gcc-configure-texinfo.patch b/sys-devel/kgcc64/files/gcc-configure-texinfo.patch
new file mode 100644
index 000000000000..ddc098ddbd58
--- /dev/null
+++ b/sys-devel/kgcc64/files/gcc-configure-texinfo.patch
@@ -0,0 +1,16 @@
+Chances are quite good that the installed makeinfo is sufficient.
+So ignore false positives where the makeinfo installed is so new
+that it violates the cheesy version grep.
+
+http://bugs.gentoo.org/198182
+
+--- configure
++++ configure
+@@ -3573,6 +3573,6 @@
+ :
+ else
+- MAKEINFO="$MISSING makeinfo"
++ :
+ fi
+ ;;
+
diff --git a/sys-devel/kgcc64/kgcc64-4.1.2.ebuild b/sys-devel/kgcc64/kgcc64-4.1.2.ebuild
new file mode 100644
index 000000000000..1b944aebd722
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.1.2.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0.1"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+KEYWORDS="-* hppa ~mips ~s390 sparc"
+
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64"
+
+src_prepare() {
+ toolchain_src_prepare
+ # Fix cross-compiling
+ epatch "${FILESDIR}"/4.1.0/gcc-4.1.0-cross-compile.patch
+}
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.2.4.ebuild b/sys-devel/kgcc64/kgcc64-4.2.4.ebuild
new file mode 100644
index 000000000000..280b4f0fb815
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.2.4.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+KEYWORDS="-* hppa ~mips ~s390 ~sparc"
+
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.3.5.ebuild b/sys-devel/kgcc64/kgcc64-4.3.5.ebuild
new file mode 100644
index 000000000000..d42caa3d104c
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.3.5.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.1"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="-hppa ~mips ~sparc"
+
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.4.5.ebuild b/sys-devel/kgcc64/kgcc64-4.4.5.ebuild
new file mode 100644
index 000000000000..a40dfa3752db
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.4.5.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.2"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa sparc"
+
+RDEPEND=">=dev-libs/gmp-4.2.1
+ >=dev-libs/mpfr-2.3.2
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.4.6.ebuild b/sys-devel/kgcc64/kgcc64-4.4.6.ebuild
new file mode 100644
index 000000000000..4cf0932591db
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.4.6.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa ~sparc"
+
+RDEPEND=">=dev-libs/gmp-4.2.1
+ >=dev-libs/mpfr-2.3.2
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.5.3.ebuild b/sys-devel/kgcc64/kgcc64-4.5.3.ebuild
new file mode 100644
index 000000000000..4d7b7305dff7
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.5.3.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.4"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa sparc"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.5.4.ebuild b/sys-devel/kgcc64/kgcc64-4.5.4.ebuild
new file mode 100644
index 000000000000..f89cae018873
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.5.4.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.2"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa ~sparc"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.6.4.ebuild b/sys-devel/kgcc64/kgcc64-4.6.4.ebuild
new file mode 100644
index 000000000000..df9275b16763
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.6.4.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa ~sparc"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.7.3.ebuild b/sys-devel/kgcc64/kgcc64-4.7.3.ebuild
new file mode 100644
index 000000000000..0fb3d04c68e1
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.7.3.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.3"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa sparc"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.7.4.ebuild b/sys-devel/kgcc64/kgcc64-4.7.4.ebuild
new file mode 100644
index 000000000000..e126ea64f8d6
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.7.4.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa ~mips ~sparc"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+src_prepare() {
+ EPATCH_EXCLUDE+=" 10_all_default-fortify-source.patch"
+ EPATCH_EXCLUDE+=" 90_all_gcc-4.7-x32.patch"
+
+ toolchain_src_prepare
+}
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.8.3.ebuild b/sys-devel/kgcc64/kgcc64-4.8.3.ebuild
new file mode 100644
index 000000000000..731074eedc19
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.8.3.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.1"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa ~sparc"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.8.5.ebuild b/sys-devel/kgcc64/kgcc64-4.8.5.ebuild
new file mode 100644
index 000000000000..90d69128a02c
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.8.5.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.3"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on mips and sparc; all other archs, refer to bug #228115
+KEYWORDS="hppa ~sparc"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-4.9.4.ebuild b/sys-devel/kgcc64/kgcc64-4.9.4.ebuild
new file mode 100644
index 000000000000..ec2766a42d2d
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-4.9.4.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on hppa and mips; all other archs, refer to bug #228115
+KEYWORDS="hppa ~mips"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-5.4.0.ebuild b/sys-devel/kgcc64/kgcc64-5.4.0.ebuild
new file mode 100644
index 000000000000..ec2766a42d2d
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-5.4.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on hppa and mips; all other archs, refer to bug #228115
+KEYWORDS="hppa ~mips"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-6.3.0.ebuild b/sys-devel/kgcc64/kgcc64-6.3.0.ebuild
new file mode 100644
index 000000000000..ded474dcdfa3
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-6.3.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on hppa and mips; all other archs, refer to bug #228115
+KEYWORDS="~hppa ~mips"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-6.4.0.ebuild b/sys-devel/kgcc64/kgcc64-6.4.0.ebuild
new file mode 100644
index 000000000000..ded474dcdfa3
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-6.4.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on hppa and mips; all other archs, refer to bug #228115
+KEYWORDS="~hppa ~mips"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/kgcc64-7.2.0.ebuild b/sys-devel/kgcc64/kgcc64-7.2.0.ebuild
new file mode 100644
index 000000000000..798eef00c209
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-7.2.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+case ${CHOST} in
+ hppa*) CTARGET=hppa64-${CHOST#*-};;
+ mips*) CTARGET=${CHOST/mips/mips64};;
+ powerpc*) CTARGET=${CHOST/powerpc/powerpc64};;
+ s390*) CTARGET=${CHOST/s390/s390x};;
+ sparc*) CTARGET=${CHOST/sparc/sparc64};;
+ i?86*) CTARGET=x86_64-${CHOST#*-};;
+esac
+export CTARGET
+TOOLCHAIN_ALLOWED_LANGS="c"
+GCC_TARGET_NO_MULTILIB=true
+
+PATCH_VER="1.1"
+PATCH_GCC_VER="7.1.0"
+
+inherit eutils toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on hppa and mips; all other archs, refer to bug #228115
+# unkeyworded, same as sys-devel/gcc
+#KEYWORDS="~hppa ~mips"
+
+RDEPEND=">=dev-libs/gmp-4.3.2
+ >=dev-libs/mpfr-2.4.2
+ >=dev-libs/mpc-0.8.1
+ >=sys-devel/gcc-config-1.4"
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+DEPEND="${RDEPEND}
+ hppa? ( sys-devel/binutils-hppa64 )
+ !sys-devel/gcc-hppa64
+ !sys-devel/gcc-mips64
+ !sys-devel/gcc-powerpc64
+ !sys-devel/gcc-sparc64
+ >=sys-apps/texinfo-4.8
+ >=sys-devel/bison-1.875"
+
+pkg_postinst() {
+ toolchain_pkg_postinst
+
+ cd "${ROOT}"/usr/bin
+ local x
+ for x in gcc cpp ; do
+ cat <<-EOF >${CTARGET%%-*}-linux-${x}
+ #!/bin/sh
+ exec ${CTARGET}-${x} "\$@"
+ EOF
+ chmod a+rx ${CTARGET%%-*}-linux-${x}
+ done
+}
diff --git a/sys-devel/kgcc64/metadata.xml b/sys-devel/kgcc64/metadata.xml
new file mode 100644
index 000000000000..2753a6abd172
--- /dev/null
+++ b/sys-devel/kgcc64/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+<email>toolchain@gentoo.org</email>
+<name>Gentoo Toolchain Project</name>
+</maintainer>
+<use>
+<flag name="regression-test">Run the testsuite and install the results (requires FEATURES=test)</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-devel/libtool/Manifest b/sys-devel/libtool/Manifest
new file mode 100644
index 000000000000..ae2422a8f2df
--- /dev/null
+++ b/sys-devel/libtool/Manifest
@@ -0,0 +1,20 @@
+AUX libtool-2.2.10-eprefix.patch 555 SHA256 e953d99d81e289b043db9ac124f45f2f738f99556112cb9cd4e5c22f7714643f SHA512 f6630d840cd34a868fc9eebd6b8d5880ad2ba1c2f894a968179fce361e4d9d8eae71ad44d10eaf22a084fc19e7f476ef2f021665068506ca2e5df9a37536247c WHIRLPOOL f86164248bb76e9eeb5f53be70f53f4678201b6f3539721648483e5bee89a6cfe20404be9295999078f2af8e2e7ec67d91dcc5a911a75db98c77086a5dd3820b
+AUX libtool-2.2.6a-darwin-module-bundle.patch 1202 SHA256 76fa96838c0ef3b23a99b5e73f32bd9b10765ae0f557f2126b5420328036d05a SHA512 aca1cfbab9b1c9508f7fac85b346865106ce1f63d69095cd5b13e02f8d3605f04cd1142e077f19e4f6f8174cb9a9f39823061e494dfafc4fe4589c4e11120353 WHIRLPOOL 002cd0b7bceca43f2d92bf4238e79916927f7428e002ae9d0890c46f0a3bf2820352d26a34df85d2b01a000832b3f1cfde28589d7414b12316c2c067da43d0f5
+AUX libtool-2.4.3-use-linux-version-in-fbsd.patch 1124 SHA256 4f081f5515b28be8496883a413c4c3597312e3780b3ba2732e28a33e0a61dd94 SHA512 6134fb39cf0e115a91cf69de175c9a088d405684139f8ba3dcf77f2c039e5f4603e2b70652f27bb59773aacb562560c1bcdbf439de1564bd19095d524b0ee5c7 WHIRLPOOL 360aa2635e2f26e94558428ac8d0921ce3d88ba9ec7906a63431a2894627d98b78c69af66a295a7dc7a3e59c4670bdfff0bfe08bccd31baa261410c8ac963492
+AUX libtool-2.4.6-darwin-use-linux-version.patch 493 SHA256 08e628cd696f3306a911ce25c487d1f931097670d2d6c53bea33eff22589c2dd SHA512 5cce0c85a59fef8c3c605e72f3f4a8a16c0ee2da464643c67fcf675fedfcb227866938fb98b1379506616b4141cca5b29175d976402510987053bade4fc482f9 WHIRLPOOL e72319af733be59a049b8dcaa4b345bfe7475bd6f23c417b877d853d02318ce9ee5a1a590849d984a5a9715c6d99935ea86549c9525bddb1ae381fac1be5bd37
+AUX libtool-2.4.6-libtoolize-delay-help.patch 1591 SHA256 23b29759721a7398497ecf3f851293b3e6c67a649a669ab4534a8bfeaaf8de8a SHA512 19c160cc706081d63b65d6580fd8cb4d01e6a5e45652dd3c4fd83e71df5b765c355e861e257ab37489c2d4c78b4aa14bc94ad9718c91c90b467e4604f484b9c3 WHIRLPOOL 8b808ead5163da2305066183f818e6881a527471a19ce9e09c7fe5312af5fb3793b9644675157c2fcd569fc4c7d823f8a7bda7027fa6a34e2ba576956e64d400
+AUX libtool-2.4.6-libtoolize-slow.patch 4665 SHA256 0097791d25b77d0c4742186e88613ce87271b8588271062fd2b24015c45f6e7c SHA512 d25506406c56a120b469b3b191d508f904c8336de4dd7be54c27e6582d6af1428afb8ebc2f56b98daae8e371bca3d56e2d8d9a8c428366597e4aa5425b13adb9 WHIRLPOOL 3bcb6da6d6399c425bcfe258d4a138083b4ec6d974cb6d224d51c9b1cb21557c72b5546aface274bec2594312506d635fd42fec483edc6223f75066d92242d42
+AUX libtool-2.4.6-link-fsanitize.patch 2364 SHA256 eb4d0466795b05b70b2a6a1600005b2f7e0d8e8b57369385ccacc968a28f64e3 SHA512 567487334e4084b94f0431561213ac520a7871a0acb904b019204e728b750a8ab8155b88f0b5a90cefdd5f524130f9f3f9f0de34d8d9a2bd821bb8be6266cf69 WHIRLPOOL 85dccf626bf86e0b1bba14b472a0632f738a051cf05d494c96c5658e7ea6863349fdd4b9f7ce0981409fe47a0966d3db4078f1d537845e3ed05031aa976198a6
+AUX libtool-2.4.6-link-fuse-ld.patch 2365 SHA256 1c7662f8b992ff41299ea6716db055181151c7b51e2308061aeff7eee58171e0 SHA512 273f9bef6dffc50f9773a8a91101d13ed2a13c72e077c4620f1e3da37b27271acb005fdcde7bcd9acc7cfcb1ee71ec2cb3eba3c9fcf262eb141e12f43fd06b6e WHIRLPOOL a39987bb6020c2a98502a5f5024a8ea62de8e6bd8483a711053d6c0b49bd48e522adff313b335f2b2bb150baaa8193dfd7ae30fabf556aa0060f2963b66992ee
+AUX libtool-2.4.6-link-specs.patch 2438 SHA256 e1fb76a50b4a81123e83938719fe6d55f6207f64b48d74d21b0a7fd85c20fc5d SHA512 349675e58a82227930859d7ced1f7bafc7b05f3d4d902e4bfec3f4f1337c7a724ff7d8f509da4212c74c6f4c07b7f3604a6c28070ca5091543a8c4616e0263c9 WHIRLPOOL 1bed33afbfcf65abbb2af44f50cecf73086860653c9eaea72a0118c3a167787781634ec8f031a517a879752c497b1a15c4f61ec0df89fd80dc1627f530c0809a
+AUX libtool-2.4.6-mint.patch 1672 SHA256 917c17e7fd05bf542c86e1528ad150e68058d33f60229f0dce9f5b8a5f372313 SHA512 a022703b39596ca5aafd27f463aee403c2d4565d3283c0ea20c259996c3d32056096536bbec079e3ed08b03618f9d5e46c0684db08c90477fe31e4219596e22b WHIRLPOOL 10a35be997395f4ff1f39b73ddb65f515e2e71960e7f321f1be85468eff64edde5a8450b4eedec78da1f25f90dfbf01d326a811f0279e432e1d60349f561852b
+AUX libtool-2.4.6-ppc64le.patch 3672 SHA256 3263fd9ab5bbcc6693ca8dbaf63b583c18d1d9ab36ddcf73967f2dbfda7abd8a SHA512 e9dc9fad5eebabcc65506dddabf3a917c73237485f2ad24765a20437404f654a8c04411755381c7c5d90c2ae13cabd5d89f9ad15839e2e1b9d43300d57adf178 WHIRLPOOL 852f70dc6546dda3d7289fe73796c8213801878f8647aedb320d473ea27893589cd7b5de70f552cb856ab9963ac830d4ee1643d0205923583d3de9af1c94424b
+AUX libtool-2.4.6-sed-quote-speedup.patch 8262 SHA256 2caefeb79e28f3dacc0dbb424f8664f56bd0b77bd5383f5b46c9ca6c441546d8 SHA512 d4a1ab01e1d6f3b05221bded3fc7c8204e686b1ac11dc00267a7a75a6759adfa8ac3d7041dc5710084031c7fe47f2deb88bc9c23e3502a944a97244942529927 WHIRLPOOL 217e62a163f2a038f3d05860ec043b2db5fab069bb8c84007f142312c2e7753532ed6a0b2c4c29432ed89675e344e1b4f7b640157b4c5e63ab6e89f6914a9590
+DIST libtool-2.4.6.tar.xz 973080 SHA256 7c87a8c2c8c0fc9cd5019e402bed4292462d00a718a7cd5f11218153bf28b26f SHA512 a6eef35f3cbccf2c9e2667f44a476ebc80ab888725eb768e91a3a6c33b8c931afc46eb23efaee76c8696d3e4eed74ab1c71157bcb924f38ee912c8a90a6521a4 WHIRLPOOL f6e1ea25cc8dd853f0de53c045bcd1166cfede9cb0e890079c2c05e6cbdb5e705e137f83ba32f7e16691b9c9108e9cfb2d14ed030cea07b6eacbe3f1ae18a73b
+EBUILD libtool-2.4.6-r2.ebuild 2519 SHA256 6580b132a4ca54374c5febc03bfb1ec1d47528681f0c54175be917a9c90d6498 SHA512 c375831d3eadebbf7de6ed933a4206c2b085118e94986083b9b4f4cb21d8c05f9eacb81ca3bcb937592ffe5239718a63c609d382d8bbf29afa4342d334935fff WHIRLPOOL 505cdab6023d99802d506617d5fc7dcbcee9b70a0618b06beb91f3c7027b5156a16ec811b364dbe2cde0be07d3093858d5dbeb5b55085ae6812c6b65d81ec5ca
+EBUILD libtool-2.4.6-r3.ebuild 2568 SHA256 103790a25325612e1d4090b51d0da447d96d2d279382cc0c1c6527314e4e9064 SHA512 27980b922f84b487f23edb8d7cff3b3ac341d20d37d23f8767cab5ecf6652eca5279acf5da4ad24150a3f6c5ee7fa42f6db1c50619b335cac39834259da85c34 WHIRLPOOL a44d4d1da717c8d044c1bf51249dc5f77ea91bdd3d15287e84d4dbfd8d127b11e93489c7f4e959e66c61a4d766126bc58a6124d9661bb21f170980d2ed1b237f
+EBUILD libtool-2.4.6-r4.ebuild 3528 SHA256 26243bfeb7ebadf156aa54096f6bc1d1d64c458727ec4a9db33f355864292836 SHA512 4bf267671324ff11f374bc46e2d7a5a615907e9dbcc9692eaf89fa5f967baae8b4d7acddfef90300e2d4e94cfb860f82ca19597321c9b9320f69de82763c2369 WHIRLPOOL 9c99a22e74295dd02fe158c14c73f5da76db11b4986ff3475e09a53198630dfbd1e69072f970276d3057615a52c2d538f17563ff5f19a171ec565405b75e9956
+EBUILD libtool-9999.ebuild 3170 SHA256 2eb0b0a0752894123de2f57699a761143a64b71f4047bac5f69ab43c81aec6f2 SHA512 0bfbb34698bec1fe5de71de28f7415b1597c22a21f641f290d545113ab4db061c0e0a633442cc1d2dfe3c09087d0cf17e73e9b5fdf0a79fdaede505d113ec039 WHIRLPOOL df600f9d2ebfd1605e8bac6d7ad16e073cedd8e0e2db5837ec66d81772635e17e2ffb95392c19d5ee0d4a5297ec81cfc9ac0edbf77e29fa5c5092695cc3f183c
+MISC ChangeLog 5518 SHA256 b6b2ba4280f6f70a66bcd0ea58f588f7e8763a1e9f1c3359b68c2ed936798e76 SHA512 5cbd1d88295c04f73aaf4a7d3f0b21cffac1e65fa6a8b4944d994709fb44b91f4bc0f7bd4ffa4e542475ad5a1377fca77d439d4a0a47b263777afaeb98635371 WHIRLPOOL 37b939dc5db9dfe1b29b3c14545db03272d69463158e57f35a9ca9f2767b0d6bc0896b3f05911bc609937e7b87a70aae37669a0d19d8655209dea04a4631366e
+MISC ChangeLog-2015 37381 SHA256 6dfda18dd9565ac81580cc35dd8fabb8ac7c3a9c206376976c3c6c9021657a73 SHA512 66bf3efefcd9944ac1a5335ab0ba2b4b71122b78e6ac5013d9597e98b117c490e1d0daa5b4371287c1b78ba90972c34e1c23e5d5627ce65c3dba4ba8c41a9fe5 WHIRLPOOL d2971021efa25b4bde5867a40405456deb6b4e61dd9aee7c1887961883597b2e61c9543922878e3c900c8ae6013a5a01e34e8e224492291365c57d3bb2c1bdf9
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/libtool/files/libtool-2.2.10-eprefix.patch b/sys-devel/libtool/files/libtool-2.2.10-eprefix.patch
new file mode 100644
index 000000000000..5a2980d2979d
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.2.10-eprefix.patch
@@ -0,0 +1,11 @@
+--- ./libltdl/m4/libtool.m4.orig 2010-07-02 12:41:07.000000000 +0200
++++ ./libltdl/m4/libtool.m4 2010-07-02 12:45:39.000000000 +0200
+@@ -2087,7 +2087,7 @@
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
++ sys_lib_search_path_spec=`$ECHO "@GENTOO_PORTAGE_EPREFIX@/lib @GENTOO_PORTAGE_EPREFIX@/usr/lib $lt_search_path_spec" | $lt_NL2SP`
+ else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ fi])
diff --git a/sys-devel/libtool/files/libtool-2.2.6a-darwin-module-bundle.patch b/sys-devel/libtool/files/libtool-2.2.6a-darwin-module-bundle.patch
new file mode 100644
index 000000000000..c6b63ed32766
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.2.6a-darwin-module-bundle.patch
@@ -0,0 +1,24 @@
+In Gentoo Prefix we go by Apple's convention to give modules the .bundle
+extension.
+http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/500-Linking/bs_linking.html
+(Above link was removed by Apple, the link below contains a copy:
+http://disanji.net/iOS_Doc/#documentation/DeveloperTools/Conceptual/XcodeBuildSystem/500-Linking/bs_linking.html,
+in case it disappears also, the relevant quote:
+
+Bundle. Bundles are executable files that can be loaded at runtime by
+other products. Plug-ins are implemented using bundles. The term bundle
+in this context refers to the binary itself, not to a structured
+hierarchy. Bundles have the .bundle extension; for example,
+MyBundle.bundle.)
+
+--- libltdl/m4/libtool.m4
++++ libltdl/m4/libtool.m4
+@@ -2271,7 +2271,7 @@
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
++ shrext_cmds='`test .$module = .yes && echo .bundle || echo .dylib`'
+ m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
diff --git a/sys-devel/libtool/files/libtool-2.4.3-use-linux-version-in-fbsd.patch b/sys-devel/libtool/files/libtool-2.4.3-use-linux-version-in-fbsd.patch
new file mode 100644
index 000000000000..8244eaa7e3e7
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.3-use-linux-version-in-fbsd.patch
@@ -0,0 +1,38 @@
+Force linux-style versioning when generating shared libraries on
+Gentoo/FreeBSD hosts only.
+
+Patch by Diego Elio Pettenò
+
+http://bugs.gentoo.org/109105
+
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -1375,7 +1375,14 @@
+ *) objformat=elf ;;
+ esac
+ fi
+- version_type=freebsd-$objformat
++ # Handle Gentoo/FreeBSD as it was Linux
++ case $host_vendor in
++ gentoo)
++ version_type=linux ;;
++ *)
++ version_type=freebsd-$objformat ;;
++ esac
++
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+@@ -1386,6 +1392,12 @@
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
++ linux)
++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
++ soname_spec='${libname}${release}${shared_ext}$major'
++ need_lib_prefix=no
++ need_version=no
++ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
diff --git a/sys-devel/libtool/files/libtool-2.4.6-darwin-use-linux-version.patch b/sys-devel/libtool/files/libtool-2.4.6-darwin-use-linux-version.patch
new file mode 100644
index 000000000000..b4409815f8b4
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-darwin-use-linux-version.patch
@@ -0,0 +1,13 @@
+* revert old 1.5 behaviour
+
+--- libtool-2.4.6/m4/libtool.m4
++++ libtool-2.4.6/m4/libtool.m4
+@@ -2272,7 +2272,7 @@
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+- library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
++ library_names_spec='$libname$release$versuffix$shared_ext $libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
diff --git a/sys-devel/libtool/files/libtool-2.4.6-libtoolize-delay-help.patch b/sys-devel/libtool/files/libtool-2.4.6-libtoolize-delay-help.patch
new file mode 100644
index 000000000000..974cd44d028c
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-libtoolize-delay-help.patch
@@ -0,0 +1,53 @@
+https://lists.gnu.org/archive/html/libtool-patches/2016-02/msg00002.html
+
+From 53419307d5b44e5b0cff80d76f88ea02f237b747 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 13 Feb 2016 03:32:20 -0500
+Subject: [PATCH] libtoolize: don't execute automake and autoconf on every
+ invocation.
+
+Same fix as applied to libtool in commit 408cfb9c5fa8a666917167ffb806cb
+to delay use of automake/autoconf to when the --help option is actually
+specified.
+
+* libtoolize.in (func_help): Override func_help() from
+gl/build-aux/options-parser to only run automake --version and
+autoconf --version when libtool --help is executed on the command
+line.
+---
+ libtoolize.in | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/libtoolize.in b/libtoolize.in
+index 3fe61ce..0d4af3d 100644
+--- a/libtoolize.in
++++ b/libtoolize.in
+@@ -94,7 +94,12 @@ usage_message="Options:
+ "
+
+ # Additional text appended to 'usage_message' in response to '--help'.
+-long_help_message=$long_help_message"
++func_help ()
++{
++ $debug_cmd
++
++ func_usage_message
++ $ECHO "$long_help_message
+ 'environment' show warnings about LIBTOOLIZE_OPTIONS content
+ 'file' show warnings about file copying and linking
+
+@@ -120,8 +125,9 @@ include the following information:
+
+ Report bugs to <@PACKAGE_BUGREPORT@>.
+ GNU @PACKAGE@ home page: <@PACKAGE_URL@>.
+-General help using GNU software: <http://www.gnu.org/gethelp/>.
+-"
++General help using GNU software: <http://www.gnu.org/gethelp/>."
++ exit 0
++}
+
+ warning_categories='environment file'
+
+--
+2.6.2
+
diff --git a/sys-devel/libtool/files/libtool-2.4.6-libtoolize-slow.patch b/sys-devel/libtool/files/libtool-2.4.6-libtoolize-slow.patch
new file mode 100644
index 000000000000..abddee13dc30
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-libtoolize-slow.patch
@@ -0,0 +1,118 @@
+From 351a88feee66eda6ce33eb06acdebb8e9c6d6716 Mon Sep 17 00:00:00 2001
+From: Pavel Raiskup <praiskup@redhat.com>
+Date: Fri, 18 Sep 2015 23:17:07 +0200
+Subject: [PATCH] libtoolize: fix infinite recursion in m4
+
+Some projects use this construct in configure.ac:
+
+ m4_define([version], m4_include([version]))
+ pkg_version=version
+
+When the m4_include builtin is undefined (as was done in
+libtoolize and extract-trace scripts), the call to this 'version'
+macro enters an infinite recursion (until ENOMEM). So rather
+re-define all potentially dangerous macros by empty strings,
+suggested by Eric Blake.
+
+While we are on it, merge the macro-"blacklist" with similar list
+implemented in gettext, except for 'm4_esyscmd'. It's kept
+defined because we already trace AC_INIT macro for package
+version, while it is often specified by
+m4_esyscmd(git-version-gen). Similarly to m4_include, m4_esyscmd
+might be opt-in-blacklisted in future.
+
+References:
+http://lists.gnu.org/archive/html/libtool/2015-09/msg00000.html
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=764580
+
+* gl/build-aux/extract-trace (_G_mini): Redefine trace-breaking
+macros to empty strings rather than undefining those. Use 'dnl'
+for comments.
+* bootstrap: Likewise, sync with extract-trace.
+* NEWS: Document.
+* NO-THANKS: Mention Hiroyuki Sato.
+
+Signed-off-by: Pavel Raiskup <praiskup@redhat.com>
+---
+ NEWS | 4 ++++
+ NO-THANKS | 1 +
+ bootstrap | 42 +++++++++++++++++++++++++++---------------
+ gl/build-aux/extract-trace | 42 +++++++++++++++++++++++++++---------------
+ 4 files changed, 59 insertions(+), 30 deletions(-)
+
+diff --git a/gl/build-aux/extract-trace b/gl/build-aux/extract-trace
+index 315a32a..c6abd21 100755
+--- a/gl/build-aux/extract-trace
++++ b/gl/build-aux/extract-trace
+@@ -329,29 +329,41 @@ func_extract_trace ()
+ # arguments to Autocof functions, but without following
+ # 'm4_s?include' files.
+ _G_mini='
+- # Initialisation.
++ dnl Initialisation.
+ m4_changequote([,])
+ m4_define([m4_copy], [m4_define([$2], m4_defn([$1]))])
+ m4_define([m4_rename], [m4_copy([$1], [$2])m4_undefine([$1])])
+
+- # Disable these macros.
+- m4_undefine([m4_dnl])
+- m4_undefine([m4_include])
+- m4_undefine([m4_m4exit])
+- m4_undefine([m4_m4wrap])
+- m4_undefine([m4_maketemp])
++ dnl Replace macros which may abort m4 with a no-op variant.
++ m4_pushdef([m4_assert])
++ m4_pushdef([m4_exit])
++ m4_pushdef([m4_fatal])
++ m4_pushdef([m4_m4exit])
+
+- # Copy and rename macros not handled by "m4 --prefix".
++ dnl Replace macros that might break stderr of m4.
++ m4_pushdef([m4_errprint])
++ m4_pushdef([m4_errprintn])
++ m4_pushdef([m4_include])
++ m4_pushdef([m4_warn])
++
++ dnl Avoid side-effects of tracing by extract-trace.
++ m4_pushdef([m4_maketemp])
++ m4_pushdef([m4_mkstemp])
++
++ dnl TODO: reasons for this
++ m4_pushdef([m4_dnl])
++ m4_pushdef([m4_m4wrap])
++
++ dnl Copy and rename macros not handled by "m4 --prefix".
+ m4_define([dnl], [m4_builtin([dnl])])
+ m4_copy([m4_define], [m4_defun])
+ m4_rename([m4_ifelse], [m4_if])
+- m4_ifdef([m4_mkstemp], [m4_undefine([m4_mkstemp])])
+ m4_rename([m4_patsubst], [m4_bpatsubst])
+ m4_rename([m4_regexp], [m4_bregexp])
+
+- # "m4sugar.mini" - useful m4-time macros for dynamic arguments.
+- # If we discover packages that need more m4 macros defined in
+- # order to bootstrap correctly, add them here:
++ dnl "m4sugar.mini" - useful m4-time macros for dynamic arguments.
++ dnl If we discover packages that need more m4 macros defined in
++ dnl order to bootstrap correctly, add them here:
+ m4_define([m4_bmatch],
+ [m4_if([$#], 0, [], [$#], 1, [], [$#], 2, [$2],
+ [m4_if(m4_bregexp([$1], [$2]), -1,
+@@ -362,11 +374,11 @@ func_extract_trace ()
+ m4_define([m4_require], [$1])
+ m4_define([m4_shift3], [m4_shift(m4shift(m4shift($@)))])
+
+- # "autoconf.mini" - things from autoconf macros we care about.
++ dnl "autoconf.mini" - things from autoconf macros we care about.
+ m4_copy([m4_defun], [AC_DEFUN])
+
+- # Dummy definitions for the macros we want to trace.
+- # AM_INIT_AUTOMAKE at least produces no trace without this.
++ dnl Dummy definitions for the macros we want to trace.
++ dnl AM_INIT_AUTOMAKE at least produces no trace without this.
+ '
+
+ _G_save=$IFS
+--
+2.6.2
+
diff --git a/sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch b/sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch
new file mode 100644
index 000000000000..c1ea8a82940f
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch
@@ -0,0 +1,58 @@
+https://bugs.gentoo.org/573744
+
+From a5c6466528c060cc4660ad0319c00740db0e42ba Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
+Date: Sun, 18 Oct 2015 21:55:39 -0700
+Subject: [PATCH] libtool: fix GCC/clang linking with -fsanitize=*
+
+References:
+https://lists.gnu.org/archive/html/libtool/2014-04/msg00026.html
+
+* build-aux/ltmain.in (func_mode_link): Pass -fsanitize=* to the
+linker to allow trivial use of the clang address sanitizer.
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@macports.org>
+Copyright-paperwork-exempt: Yes
+---
+ build-aux/ltmain.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index 1cbe875..2a5aaad 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -5382,10 +5382,11 @@ func_mode_link ()
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -specs=* GCC specs files
+ # -stdlib=* select c++ std lib with clang
++ # -fsanitize=* Clang/GCC memory and address sanitizer
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+- -specs=*)
++ -specs=*|-fsanitize=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+
+patch the generated file too to keep help2man from generating man pages
+https://bugs.gentoo.org/556512
+
+--- a/build-aux/ltmain.sh
++++ b/build-aux/ltmain.sh
+@@ -5382,10 +5382,11 @@ func_mode_link ()
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -specs=* GCC specs files
+ # -stdlib=* select c++ std lib with clang
++ # -fsanitize=* Clang/GCC memory and address sanitizer
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+- -specs=*)
++ -specs=*|-fsanitize=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+--
+2.6.2
+
diff --git a/sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch b/sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch
new file mode 100644
index 000000000000..55ec5ae9e0a6
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch
@@ -0,0 +1,54 @@
+https://lists.gnu.org/archive/html/libtool-patches/2015-03/msg00000.html
+https://lists.gnu.org/archive/html/libtool-patches/2016-02/msg00001.html
+
+From 2f258b87ce4415edede1b2a84a3a7dbcf44555c2 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Mon, 16 Mar 2015 18:17:31 -0400
+Subject: [PATCH] libtool: pass through -fuse-ld flags
+
+Starting with gcc-4.8, there's a -fuse-ld flag that can be used to select
+between bfd & gold. Make sure we pass it through to the linking stage.
+
+* build-aux/ltmain.in (func_mode_link): Pass -fuse-ld=* flags through.
+---
+ build-aux/ltmain.in | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index 2a5aaad..4c24d5d 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -5383,10 +5383,11 @@ func_mode_link ()
+ # -specs=* GCC specs files
+ # -stdlib=* select c++ std lib with clang
+ # -fsanitize=* Clang/GCC memory and address sanitizer
++ # -fuse-ld=* Linker select flags for GCC
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+- -specs=*|-fsanitize=*)
++ -specs=*|-fsanitize=*|-fuse-ld=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+
+patch the generated file too to keep help2man from generating man pages
+https://bugs.gentoo.org/556512
+
+--- a/build-aux/ltmain.sh
++++ b/build-aux/ltmain.sh
+@@ -5383,10 +5383,11 @@ func_mode_link ()
+ # -specs=* GCC specs files
+ # -stdlib=* select c++ std lib with clang
+ # -fsanitize=* Clang/GCC memory and address sanitizer
++ # -fuse-ld=* Linker select flags for GCC
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+- -specs=*|-fsanitize=*)
++ -specs=*|-fsanitize=*|-fuse-ld=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+--
+2.3.2
diff --git a/sys-devel/libtool/files/libtool-2.4.6-link-specs.patch b/sys-devel/libtool/files/libtool-2.4.6-link-specs.patch
new file mode 100644
index 000000000000..a8fbf28f80c0
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-link-specs.patch
@@ -0,0 +1,57 @@
+From 702a97fbb09bd7088a50f2b239016d1e32843c24 Mon Sep 17 00:00:00 2001
+From: Pavel Raiskup <praiskup@redhat.com>
+Date: Fri, 18 Sep 2015 10:36:43 +0200
+Subject: [PATCH] libtool: fix GCC linking with -specs=*
+
+References:
+https://bugzilla.redhat.com/show_bug.cgi?id=985592
+
+* build-aux/ltmain.in (func_mode_link): Pass -specs=*
+to the linker, Fedora uses this option for hardening.
+
+Signed-off-by: Pavel Raiskup <praiskup@redhat.com>
+---
+ build-aux/ltmain.in | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index d5cf07a..0c40da0 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -5360,10 +5360,12 @@ func_mode_link ()
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
++ # -specs=* GCC specs files
+ # -stdlib=* select c++ std lib with clang
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
++ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
++ -specs=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+
+patch the generated file too to keep help2man from generating man pages
+https://bugs.gentoo.org/556512
+
+--- a/build-aux/ltmain.sh
++++ b/build-aux/ltmain.sh
+@@ -5360,10 +5360,12 @@ func_mode_link ()
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
++ # -specs=* GCC specs files
+ # -stdlib=* select c++ std lib with clang
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
++ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
++ -specs=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+--
+2.6.2
+
diff --git a/sys-devel/libtool/files/libtool-2.4.6-mint.patch b/sys-devel/libtool/files/libtool-2.4.6-mint.patch
new file mode 100644
index 000000000000..341a0f02ef1e
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-mint.patch
@@ -0,0 +1,49 @@
+Patch by Alan Hourihane
+
+http://bugs.gentoo.org/show_bug.cgi?id=266984
+
+diff -ur libtool-2.2.6/configure libtool-2.2.6-mint/configure
+--- libtool-2.2.6/configure 2008-09-07 17:52:50.000000000 +0000
++++ libtool-2.2.6/configure 2009-04-21 08:49:27.000000000 +0000
+@@ -4986,6 +4986,11 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this can take a long time and run out of memory.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur libtool-2.2.6/libltdl/configure libtool-2.2.6-mint/libltdl/configure
+--- libtool-2.2.6/libltdl/configure 2008-09-07 17:53:05.000000000 +0000
++++ libtool-2.2.6/libltdl/configure 2009-04-21 08:50:08.000000000 +0000
+@@ -4422,6 +4422,11 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this can take a long time and run out of memory.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+diff -ur libtool-2.2.6/libltdl/m4/libtool.m4 libtool-2.2.6-mint/libltdl/m4/libtool.m4
+--- libtool-2.2.6/m4/libtool.m4 2008-09-05 11:54:41.000000000 +0000
++++ libtool-2.2.6/m4/libtool.m4 2009-04-21 08:50:26.000000000 +0000
+@@ -1527,6 +1527,11 @@
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
++ mint*)
++ # On MiNT this can take a long time and run out of memory.
++ lt_cv_sys_max_cmd_len=8192;
++ ;;
++
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
diff --git a/sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch b/sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch
new file mode 100644
index 000000000000..78d86c72956b
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch
@@ -0,0 +1,111 @@
+From 020afd7d6410f73bc205206abe1b88b4890b83b1 Mon Sep 17 00:00:00 2001
+From: Leno Hou <lenohou@gmail.com>
+Date: Sun, 24 Apr 2016 00:46:53 +0800
+Subject: [PATCH] [m4/libtool.m4] linker error for powerpc64le-unknown-linux-gnu
+
+Hi all,
+
+ 1) As we might know, Gentoo has powerpc64le-unknown-linux-gnu compiler
+
+leno@localhost ~ $ powerpc64le-unknown-linux-gnu-gcc -v
+
+Using built-in specs.
+
+COLLECT_GCC=/usr/powerpc64le-unknown-linux-gnu/gcc-bin/5.3.0/powerpc64le-unknown-linux-gnu-gcc
+
+COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc64le-unknown-linux-gnu/5.3.0/lto-wrapper
+
+Target: powerpc64le-unknown-linux-gnu
+
+Configured with:
+/var/tmp/portage/sys-devel/gcc-5.3.0/work/gcc-5.3.0/configure
+--host=powerpc64le-unknown-linux-gnu --build=powerpc64le-unknown-linux-gnu
+--prefix=/usr --bindir=/usr/powerpc64le-unknown-linux-gnu/gcc-bin/5.3.0
+--includedir=/usr/lib/gcc/powerpc64le-unknown-linux-gnu/5.3.0/include
+--datadir=/usr/share/gcc-data/powerpc64le-unknown-linux-gnu/5.3.0
+--mandir=/usr/share/gcc-data/powerpc64le-unknown-linux-gnu/5.3.0/man
+--infodir=/usr/share/gcc-data/powerpc64le-unknown-linux-gnu/5.3.0/info
+--with-gxx-include-dir=/usr/lib/gcc/powerpc64le-unknown-linux-gnu/5.3.0/include/g++-v5
+--with-python-dir=/share/gcc-data/powerpc64le-unknown-linux-gnu/5.3.0/python
+--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
+--disable-werror --with-system-zlib --enable-nls --without-included-gettext
+--enable-checking=release --with-bugurl=https://bugs.gentoo.org/
+--with-pkgversion='Gentoo 5.3.0 p1.0, pie-0.6.5' --enable-libstdcxx-time
+--enable-shared --enable-threads=posix --enable-__cxa_atexit
+--enable-clocale=gnu --disable-multilib --enable-altivec
+--disable-fixed-point --enable-targets=all --disable-libgcj
+--enable-libgomp --disable-libmudflap --disable-libssp --disable-libcilkrts
+--enable-lto --without-isl --enable-libsanitizer
+
+Thread model: posix
+
+gcc version 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
+
+ 2) And the supported emulations
+
+leno@localhost ~ $ powerpc64le-unknown-linux-gnu-ld -V
+GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
+ Supported emulations:
+ elf64lppc
+ elf32lppc
+ elf32lppclinux
+ elf32lppcsim
+
+ 3) But when I set CHOST="powerpc64le-unkown-linux-gnu" in Gentoo and
+execute aclocal, automake, libtoolize --copy --force, autoconf. When I
+glance in the latest m4/libtool.m4 :
+
+if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+...
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+...
+ *64-bit*)
+ case $host in
+...
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+...
+
+seems linked to $LD='$LD-ld -m elf64ppc' and failed to compile packages.
+
+ 4) Below is my workaround patch and works fine for this case. If this is
+OK for you, Could this to be merged in upstream? Thanks
+
+URL: https://debbugs.gnu.org/23348
+URL: https://bugs.gentoo.org/581314
+---
+ m4/libtool.m4 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+index ee292aff5bca..758b6951ae07 100644
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -1417,10 +1417,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+- powerpcle-*linux*)
++ powerpcle-*linux*|powerpc64le-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+- powerpc-*linux*)
++ powerpc-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+--
+2.11.1
+
diff --git a/sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch b/sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch
new file mode 100644
index 000000000000..0eeffac7a0da
--- /dev/null
+++ b/sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch
@@ -0,0 +1,268 @@
+https://bugs.gentoo.org/542252
+
+From 32f0df9835ac15ac17e04be57c368172c3ad1d19 Mon Sep 17 00:00:00 2001
+From: Pavel Raiskup <praiskup@redhat.com>
+Date: Sun, 4 Oct 2015 21:55:03 +0200
+Subject: [PATCH] libtool: mitigate the $sed_quote_subst slowdown
+
+When it is reasonably possible, use shell implementation for
+quoting.
+
+References:
+http://lists.gnu.org/archive/html/libtool/2015-03/msg00005.html
+http://lists.gnu.org/archive/html/libtool/2015-02/msg00000.html
+https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20006
+
+* gl/build-aux/funclib.sh (func_quote): New function that can be
+used as substitution for '$SED $sed_quote_subst' call.
+* build-aux/ltmain.in (func_emit_wrapper): Use func_quote instead
+of '$SED $sed_quote_subst'.
+(func_mode_link): Likewise.
+* NEWS: Document.
+* bootstrap: Sync with funclib.sh.
+---
+ NEWS | 3 +++
+ bootstrap | 61 +++++++++++++++++++++++++++++++++++++++++++------
+ build-aux/ltmain.in | 10 ++++----
+ gl/build-aux/funclib.sh | 61 +++++++++++++++++++++++++++++++++++++++++++------
+ 4 files changed, 117 insertions(+), 18 deletions(-)
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index 0c40da0..24acefd 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -3346,7 +3346,8 @@ else
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
++ func_quote "$ECHO"
++ qECHO=$func_quote_result
+ $ECHO "\
+
+ # A function that is used when there is no print builtin or printf.
+@@ -8596,8 +8597,8 @@ EOF
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+- relink_command="(cd `pwd`; $relink_command)"
+- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
++ func_quote "(cd `pwd`; $relink_command)"
++ relink_command=$func_quote_result
+ fi
+
+ # Only actually do things if not in dry run mode.
+@@ -8843,7 +8844,8 @@ EOF
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
++ func_quote "$relink_command"
++ relink_command=$func_quote_result
+ if test yes = "$hardcode_automatic"; then
+ relink_command=
+ fi
+diff --git a/gl/build-aux/funclib.sh b/gl/build-aux/funclib.sh
+index 39d972e..47d8b95 100644
+--- a/build-aux/funclib.sh
++++ b/build-aux/funclib.sh
+@@ -1,5 +1,5 @@
+ # Set a version string for this script.
+-scriptversion=2015-01-20.17; # UTC
++scriptversion=2015-10-04.22; # UTC
+
+ # General shell script boiler plate, and helper functions.
+ # Written by Gary V. Vaughan, 2004
+@@ -1026,6 +1026,57 @@ func_relative_path ()
+ }
+
+
++# func_quote ARG
++# --------------
++# Aesthetically quote one ARG, store the result into $func_quote_result. Note
++# that we keep attention to performance here (so far O(N) complexity as long as
++# func_append is O(1)).
++func_quote ()
++{
++ $debug_cmd
++
++ func_quote_result=$1
++
++ case $func_quote_result in
++ *[\\\`\"\$]*)
++ case $func_quote_result in
++ *[\[\*\?]*)
++ func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"`
++ return 0
++ ;;
++ esac
++
++ func_quote_old_IFS=$IFS
++ for _G_char in '\' '`' '"' '$'
++ do
++ # STATE($1) PREV($2) SEPARATOR($3)
++ set start "" ""
++ func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy
++ IFS=$_G_char
++ for _G_part in $func_quote_result
++ do
++ case $1 in
++ quote)
++ func_append func_quote_result "$3$2"
++ set quote "$_G_part" "\\$_G_char"
++ ;;
++ start)
++ set first "" ""
++ func_quote_result=
++ ;;
++ first)
++ set quote "$_G_part" ""
++ ;;
++ esac
++ done
++ IFS=$func_quote_old_IFS
++ done
++ ;;
++ *) ;;
++ esac
++}
++
++
+ # func_quote_for_eval ARG...
+ # --------------------------
+ # Aesthetically quote ARGs to be evaled later.
+@@ -1042,12 +1093,8 @@ func_quote_for_eval ()
+ func_quote_for_eval_unquoted_result=
+ func_quote_for_eval_result=
+ while test 0 -lt $#; do
+- case $1 in
+- *[\\\`\"\$]*)
+- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+- *)
+- _G_unquoted_arg=$1 ;;
+- esac
++ func_quote "$1"
++ _G_unquoted_arg=$func_quote_result
+ if test -n "$func_quote_for_eval_unquoted_result"; then
+ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+ else
+
+patch the generated file too to keep help2man from generating man pages
+https://bugs.gentoo.org/556512
+
+--- a/build-aux/ltmain.sh
++++ b/build-aux/ltmain.sh
+@@ -1,5 +1,5 @@
+ # Set a version string for this script.
+-scriptversion=2015-01-20.17; # UTC
++scriptversion=2015-10-04.22; # UTC
+
+ # General shell script boiler plate, and helper functions.
+ # Written by Gary V. Vaughan, 2004
+@@ -1026,6 +1026,57 @@ func_relative_path ()
+ }
+
+
++# func_quote ARG
++# --------------
++# Aesthetically quote one ARG, store the result into $func_quote_result. Note
++# that we keep attention to performance here (so far O(N) complexity as long as
++# func_append is O(1)).
++func_quote ()
++{
++ $debug_cmd
++
++ func_quote_result=$1
++
++ case $func_quote_result in
++ *[\\\`\"\$]*)
++ case $func_quote_result in
++ *[\[\*\?]*)
++ func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"`
++ return 0
++ ;;
++ esac
++
++ func_quote_old_IFS=$IFS
++ for _G_char in '\' '`' '"' '$'
++ do
++ # STATE($1) PREV($2) SEPARATOR($3)
++ set start "" ""
++ func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy
++ IFS=$_G_char
++ for _G_part in $func_quote_result
++ do
++ case $1 in
++ quote)
++ func_append func_quote_result "$3$2"
++ set quote "$_G_part" "\\$_G_char"
++ ;;
++ start)
++ set first "" ""
++ func_quote_result=
++ ;;
++ first)
++ set quote "$_G_part" ""
++ ;;
++ esac
++ done
++ IFS=$func_quote_old_IFS
++ done
++ ;;
++ *) ;;
++ esac
++}
++
++
+ # func_quote_for_eval ARG...
+ # --------------------------
+ # Aesthetically quote ARGs to be evaled later.
+@@ -1042,12 +1093,8 @@ func_quote_for_eval ()
+ func_quote_for_eval_unquoted_result=
+ func_quote_for_eval_result=
+ while test 0 -lt $#; do
+- case $1 in
+- *[\\\`\"\$]*)
+- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+- *)
+- _G_unquoted_arg=$1 ;;
+- esac
++ func_quote "$1"
++ _G_unquoted_arg=$func_quote_result
+ if test -n "$func_quote_for_eval_unquoted_result"; then
+ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+ else
+@@ -3346,7 +3346,8 @@ else
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
++ func_quote "$ECHO"
++ qECHO=$func_quote_result
+ $ECHO "\
+
+ # A function that is used when there is no print builtin or printf.
+@@ -8596,8 +8597,8 @@ EOF
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+- relink_command="(cd `pwd`; $relink_command)"
+- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
++ func_quote "(cd `pwd`; $relink_command)"
++ relink_command=$func_quote_result
+ fi
+
+ # Only actually do things if not in dry run mode.
+@@ -8843,7 +8844,8 @@ EOF
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
++ func_quote "$relink_command"
++ relink_command=$func_quote_result
+ if test yes = "$hardcode_automatic"; then
+ relink_command=
+ fi
+--
+2.6.2
+
diff --git a/sys-devel/libtool/libtool-2.4.6-r2.ebuild b/sys-devel/libtool/libtool-2.4.6-r2.ebuild
new file mode 100644
index 000000000000..22305f5c51f1
--- /dev/null
+++ b/sys-devel/libtool/libtool-2.4.6-r2.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+LIBTOOLIZE="true" #225559
+WANT_LIBTOOL="none"
+inherit autotools epatch epunt-cxx multilib unpacker
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ inherit git-2
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+DESCRIPTION="A shared library tool for developers"
+HOMEPAGE="https://www.gnu.org/software/libtool/"
+
+LICENSE="GPL-2"
+SLOT="2"
+IUSE="vanilla"
+
+# Pull in libltdl directly until we convert packages to the new dep.
+RDEPEND="sys-devel/gnuconfig
+ >=sys-devel/autoconf-2.69
+ >=sys-devel/automake-1.13
+ dev-libs/libltdl:0"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils"
+[[ ${PV} == "9999" ]] && DEPEND+=" sys-apps/help2man"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ cd "${S}"
+ ./bootstrap || die
+ else
+ unpacker_src_unpack
+ fi
+}
+
+src_prepare() {
+ use vanilla && return 0
+
+ epatch "${FILESDIR}"/${PN}-2.4.3-use-linux-version-in-fbsd.patch #109105
+ epatch "${FILESDIR}"/${P}-link-specs.patch
+ epatch "${FILESDIR}"/${P}-link-fsanitize.patch #573744
+ epatch "${FILESDIR}"/${P}-link-fuse-ld.patch
+ epatch "${FILESDIR}"/${P}-libtoolize-slow.patch
+ epatch "${FILESDIR}"/${P}-libtoolize-delay-help.patch
+ epatch "${FILESDIR}"/${P}-sed-quote-speedup.patch #542252
+ pushd libltdl >/dev/null
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ popd >/dev/null
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ epunt_cxx
+
+ # Make sure timestamps don't trigger a rebuild of man pages. #556512
+ if [[ ${PV} != "9999" ]] ; then
+ touch doc/*.1
+ export HELP2MAN=false
+ fi
+}
+
+src_configure() {
+ # the libtool script uses bash code in it and at configure time, tries
+ # to find a bash shell. if /bin/sh is bash, it uses that. this can
+ # cause problems for people who switch /bin/sh on the fly to other
+ # shells, so just force libtool to use /bin/bash all the time.
+ export CONFIG_SHELL=/bin/bash
+
+ # Do not bother hardcoding the full path to sed. Just rely on $PATH. #574550
+ export ac_cv_path_SED=$(basename "$(type -P sed)")
+
+ ECONF_SOURCE=${S} econf --disable-ltdl-install
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ local x
+ while read -d $'\0' -r x ; do
+ ln -sf "${EPREFIX}"/usr/share/gnuconfig/${x##*/} "${x}" || die
+ done < <(find "${ED}" '(' -name config.guess -o -name config.sub ')' -print0)
+}
diff --git a/sys-devel/libtool/libtool-2.4.6-r3.ebuild b/sys-devel/libtool/libtool-2.4.6-r3.ebuild
new file mode 100644
index 000000000000..a5d6ae853685
--- /dev/null
+++ b/sys-devel/libtool/libtool-2.4.6-r3.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+LIBTOOLIZE="true" #225559
+WANT_LIBTOOL="none"
+inherit autotools epatch epunt-cxx multilib unpacker
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ inherit git-2
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+fi
+
+DESCRIPTION="A shared library tool for developers"
+HOMEPAGE="https://www.gnu.org/software/libtool/"
+
+LICENSE="GPL-2"
+SLOT="2"
+IUSE="vanilla"
+
+# Pull in libltdl directly until we convert packages to the new dep.
+RDEPEND="sys-devel/gnuconfig
+ >=sys-devel/autoconf-2.69
+ >=sys-devel/automake-1.13
+ dev-libs/libltdl:0"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils"
+[[ ${PV} == "9999" ]] && DEPEND+=" sys-apps/help2man"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ cd "${S}"
+ ./bootstrap || die
+ else
+ unpacker_src_unpack
+ fi
+}
+
+src_prepare() {
+ use vanilla && return 0
+
+ epatch "${FILESDIR}"/${PN}-2.4.3-use-linux-version-in-fbsd.patch #109105
+ epatch "${FILESDIR}"/${P}-link-specs.patch
+ epatch "${FILESDIR}"/${P}-link-fsanitize.patch #573744
+ epatch "${FILESDIR}"/${P}-link-fuse-ld.patch
+ epatch "${FILESDIR}"/${P}-libtoolize-slow.patch
+ epatch "${FILESDIR}"/${P}-libtoolize-delay-help.patch
+ epatch "${FILESDIR}"/${P}-sed-quote-speedup.patch #542252
+ epatch "${FILESDIR}"/${P}-ppc64le.patch #581314
+ pushd libltdl >/dev/null
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ popd >/dev/null
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ epunt_cxx
+
+ # Make sure timestamps don't trigger a rebuild of man pages. #556512
+ if [[ ${PV} != "9999" ]] ; then
+ touch doc/*.1
+ export HELP2MAN=false
+ fi
+}
+
+src_configure() {
+ # the libtool script uses bash code in it and at configure time, tries
+ # to find a bash shell. if /bin/sh is bash, it uses that. this can
+ # cause problems for people who switch /bin/sh on the fly to other
+ # shells, so just force libtool to use /bin/bash all the time.
+ export CONFIG_SHELL=/bin/bash
+
+ # Do not bother hardcoding the full path to sed. Just rely on $PATH. #574550
+ export ac_cv_path_SED=$(basename "$(type -P sed)")
+
+ ECONF_SOURCE=${S} econf --disable-ltdl-install
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ local x
+ while read -d $'\0' -r x ; do
+ ln -sf "${EPREFIX}"/usr/share/gnuconfig/${x##*/} "${x}" || die
+ done < <(find "${ED}" '(' -name config.guess -o -name config.sub ')' -print0)
+}
diff --git a/sys-devel/libtool/libtool-2.4.6-r4.ebuild b/sys-devel/libtool/libtool-2.4.6-r4.ebuild
new file mode 100644
index 000000000000..4c96bca253ef
--- /dev/null
+++ b/sys-devel/libtool/libtool-2.4.6-r4.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+LIBTOOLIZE="true" #225559
+WANT_LIBTOOL="none"
+inherit autotools epatch epunt-cxx multilib unpacker prefix
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ inherit git-2
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+fi
+
+DESCRIPTION="A shared library tool for developers"
+HOMEPAGE="https://www.gnu.org/software/libtool/"
+
+LICENSE="GPL-2"
+SLOT="2"
+IUSE="vanilla"
+
+# Pull in libltdl directly until we convert packages to the new dep.
+RDEPEND="sys-devel/gnuconfig
+ >=sys-devel/autoconf-2.69
+ >=sys-devel/automake-1.13
+ dev-libs/libltdl:0"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils"
+[[ ${PV} == "9999" ]] && DEPEND+=" sys-apps/help2man"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-2_src_unpack
+ cd "${S}"
+ ./bootstrap || die
+ else
+ unpacker_src_unpack
+ fi
+}
+
+src_prepare() {
+ use vanilla && return 0
+
+ epatch "${FILESDIR}"/${PN}-2.4.3-use-linux-version-in-fbsd.patch #109105
+ epatch "${FILESDIR}"/${P}-link-specs.patch
+ epatch "${FILESDIR}"/${P}-link-fsanitize.patch #573744
+ epatch "${FILESDIR}"/${P}-link-fuse-ld.patch
+ epatch "${FILESDIR}"/${P}-libtoolize-slow.patch
+ epatch "${FILESDIR}"/${P}-libtoolize-delay-help.patch
+ epatch "${FILESDIR}"/${P}-sed-quote-speedup.patch #542252
+ epatch "${FILESDIR}"/${P}-ppc64le.patch #581314
+
+ epatch "${FILESDIR}"/${PN}-2.4.6-mint.patch
+ epatch "${FILESDIR}"/${PN}-2.2.6a-darwin-module-bundle.patch
+ epatch "${FILESDIR}"/${PN}-2.4.6-darwin-use-linux-version.patch
+ if use prefix ; then
+ # seems that libtool has to know about EPREFIX a little bit
+ # better, since it fails to find prefix paths to search libs
+ # from, resulting in some packages building static only, since
+ # libtool is fooled into thinking that libraries are unavailable
+ # (argh...). This could also be fixed by making the gcc wrapper
+ # return the correct result for -print-search-dirs (doesn't
+ # include prefix dirs ...).
+ epatch "${FILESDIR}"/${PN}-2.2.10-eprefix.patch
+ eprefixify m4/libtool.m4
+ fi
+
+ pushd libltdl >/dev/null
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ popd >/dev/null
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ epunt_cxx
+
+ # Make sure timestamps don't trigger a rebuild of man pages. #556512
+ if [[ ${PV} != "9999" ]] ; then
+ touch doc/*.1
+ export HELP2MAN=false
+ fi
+}
+
+src_configure() {
+ # the libtool script uses bash code in it and at configure time, tries
+ # to find a bash shell. if /bin/sh is bash, it uses that. this can
+ # cause problems for people who switch /bin/sh on the fly to other
+ # shells, so just force libtool to use /bin/bash all the time.
+ export CONFIG_SHELL=$(type -P bash)
+
+ # Do not bother hardcoding the full path to sed. Just rely on $PATH. #574550
+ export ac_cv_path_SED=$(basename "$(type -P sed)")
+
+ local myconf
+ [[ ${CHOST} == *-darwin* ]] && myconf="--program-prefix=g"
+ ECONF_SOURCE=${S} econf ${myconf} --disable-ltdl-install
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ local x
+ while read -d $'\0' -r x ; do
+ ln -sf "${EPREFIX}"/usr/share/gnuconfig/${x##*/} "${x}" || die
+ done < <(find "${ED}" '(' -name config.guess -o -name config.sub ')' -print0)
+}
diff --git a/sys-devel/libtool/libtool-9999.ebuild b/sys-devel/libtool/libtool-9999.ebuild
new file mode 100644
index 000000000000..072057189265
--- /dev/null
+++ b/sys-devel/libtool/libtool-9999.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+LIBTOOLIZE="true" #225559
+WANT_LIBTOOL="none"
+inherit autotools epatch epunt-cxx multilib unpacker prefix
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.savannah.gnu.org/${PN}.git
+ http://git.savannah.gnu.org/r/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+fi
+
+DESCRIPTION="A shared library tool for developers"
+HOMEPAGE="https://www.gnu.org/software/libtool/"
+
+LICENSE="GPL-2"
+SLOT="2"
+IUSE="vanilla"
+
+# Pull in libltdl directly until we convert packages to the new dep.
+RDEPEND="sys-devel/gnuconfig
+ >=sys-devel/autoconf-2.69
+ >=sys-devel/automake-1.13
+ dev-libs/libltdl:0"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils"
+[[ ${PV} == "9999" ]] && DEPEND+=" sys-apps/help2man"
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git-r3_src_unpack
+ cd "${S}"
+ ./bootstrap || die
+ else
+ unpacker_src_unpack
+ fi
+}
+
+src_prepare() {
+ use vanilla && return 0
+
+ epatch "${FILESDIR}"/${PN}-2.4.3-use-linux-version-in-fbsd.patch #109105
+ epatch "${FILESDIR}"/${PN}-2.4.6-mint.patch
+ epatch "${FILESDIR}"/${PN}-2.2.6a-darwin-module-bundle.patch
+ epatch "${FILESDIR}"/${PN}-2.4.6-darwin-use-linux-version.patch
+ if use prefix ; then
+ # seems that libtool has to know about EPREFIX a little bit
+ # better, since it fails to find prefix paths to search libs
+ # from, resulting in some packages building static only, since
+ # libtool is fooled into thinking that libraries are unavailable
+ # (argh...). This could also be fixed by making the gcc wrapper
+ # return the correct result for -print-search-dirs (doesn't
+ # include prefix dirs ...).
+ epatch "${FILESDIR}"/${PN}-2.2.10-eprefix.patch
+ eprefixify m4/libtool.m4
+ fi
+ pushd libltdl >/dev/null
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ popd >/dev/null
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ epunt_cxx
+
+ # Make sure timestamps don't trigger a rebuild of man pages. #556512
+ if [[ ${PV} != "9999" ]] ; then
+ touch doc/*.1
+ export HELP2MAN=false
+ fi
+}
+
+src_configure() {
+ # the libtool script uses bash code in it and at configure time, tries
+ # to find a bash shell. if /bin/sh is bash, it uses that. this can
+ # cause problems for people who switch /bin/sh on the fly to other
+ # shells, so just force libtool to use /bin/bash all the time.
+ export CONFIG_SHELL=$(type -P bash)
+
+ # Do not bother hardcoding the full path to sed. Just rely on $PATH. #574550
+ export ac_cv_path_SED=$(basename "$(type -P sed)")
+
+ local myconf
+ [[ ${CHOST} == *-darwin* ]] && myconf="--program-prefix=g"
+ ECONF_SOURCE=${S} econf ${myconf} --disable-ltdl-install
+}
+
+src_test() {
+ emake check
+}
+
+src_install() {
+ default
+
+ local x
+ while read -d $'\0' -r x ; do
+ ln -sf "${EPREFIX}"/usr/share/gnuconfig/${x##*/} "${x}" || die
+ done < <(find "${ED}" '(' -name config.guess -o -name config.sub ')' -print0)
+}
diff --git a/sys-devel/libtool/metadata.xml b/sys-devel/libtool/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/libtool/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/lld/Manifest b/sys-devel/lld/Manifest
new file mode 100644
index 000000000000..b1a65d8fa693
--- /dev/null
+++ b/sys-devel/lld/Manifest
@@ -0,0 +1,12 @@
+AUX 4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch 4381 SHA256 21221017514bfb4e30a04bf3b69891e127b0ae36b1e25f97a59c5aa96585ffbc SHA512 6d133999c5b95ede493ca98a0e8c7816dcca36e4e5f17f6d847996a2d70517cc50d0e1a6259b0d34173f76c4300f8809cea2c06d029a85d2fc62e856e69cbc72 WHIRLPOOL e45f2467f1286aaf56d5090d94dfebba9e29b50ea11b6b4b10451c9a1cc1ee78a9fd8eec320042eec03b9da506f50809b096f2e0f1f8dfd2d7499315afa4212c
+AUX 4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch 2924 SHA256 91e8192923e573ae457e347386f691b8190845cb2cdd0c7a6ed6627943729995 SHA512 1b82f754fb872318740f77f78fa08647e2523d5b6d9cdd0dd9108bdac82a213d5d5c698a8915c0f6bd60b2163cce3c8bd1c13095dad52d0beb08079f851d30d8 WHIRLPOOL 1b2aabe53b872dc5333d992533f715213b900e0bf8d89cbb11c21fe11a7cca61cc70587004e679459053244072c729eae57443483fd6e10538c473a82a1c5900
+DIST lld-4.0.1.src.tar.xz 593796 SHA256 63ce10e533276ca353941ce5ab5cc8e8dcd99dbdd9c4fa49f344a212f29d36ed SHA512 63bd0813094dc7fa9a95fdee93eb7b97026882a15548f819b5c67f3f0f9fa2a582d968af27ad8f802dbff1f6cd1b8c2fb26b3c7c80379488d05c4a4984d7af68 WHIRLPOOL e7adca75f7f5fbb6136d01544798e969cba69b86c5b76a7fdcf7918564aa13eb868f4fa41102d7a4c501f741664ae309d6842c821ac974503431722ae963f93f
+DIST lld-5.0.0.src.tar.xz 668344 SHA256 399a7920a5278d42c46a7bf7e4191820ec2301457a7d0d4fcc9a4ac05dd53897 SHA512 984606a8c8aa753805d30602ce851a70d5427ee0ec098e3fcb2751e58d36c601f59f17f5c9ab90a430bc670f689c3b86b6ecbeccb6ff187f108f6e2000621eb7 WHIRLPOOL 111f38f1005f2e4a7c31435acaaff133c3a2dec695f615f25b3872801c5865c5057bcc7e75551fd8d65abafe7f1637498853ca78840731cfae91b0ae3972b4c6
+DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d WHIRLPOOL 1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
+DIST llvm-5.0.0.src.tar.xz 23411980 SHA256 e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a WHIRLPOOL 6a99edbdc3e6726dc8ff9126b110fd7560faac46601407722e6dd80b5d894ff242521dc8fda7f4d879de83dac51c65645a37224f7e8def0d8d2f1e564b0531bb
+EBUILD lld-4.0.1.ebuild 1709 SHA256 b93a6bdcf552cc5574b7dff927d6e6cdbd14a500ccc7250725a3db411e4af804 SHA512 a8415379201edd9ea508266c73d62620b08d672f66b4ddfb8b3e82b037e60a585e7263fa5e9e0c89fbba87108d02542bb276beccb403cbf4ebdf58e542f1d64c WHIRLPOOL f9ed88cbefc849ac0f338d20424a42ddb91bdbbbed45df7db3b21d1ca9d594016008e686f0828e717eeab7fe309deab5b38fde12567c55fb84c04bbffc9cc656
+EBUILD lld-5.0.0.ebuild 1439 SHA256 ceafbbb1b8d9a2d2bde685c696abe1129e31ba9785f4de3448dbc31d88e90f2b SHA512 f176cb6685c7e6d435f00b3ce3ab68c345fa658ccfadce1a2ebb23d196d1eb152a3c17e0925d684897c6f82dcd5284748403ff0a803f4ed6f2d4faba20700172 WHIRLPOOL 3cc618de8870afc5e3f31f9cb6e36d1e7de1af756d29eec835b006bf1e3305018aa1e9f7f6a085f6dd3fd14d095d52eaba4c0828184e50afe1acb370f6944af8
+EBUILD lld-5.0.9999.ebuild 1605 SHA256 8b410caed024230c595cc5dc42fc1577fbe1abf40bc2f7d3d2242e26d8cbc6b2 SHA512 7e0ff04172f71b2bfd568b56dffd0ccabd47860c94627a0cda8e6e423d1db7f52aaa766537851364fd2a0be7abd71665e7eb3b7792c2db6d0f118635d1c74cf9 WHIRLPOOL 8010d4153b37e043325b925fdb4fce07adc206be06ee3ecd04fccb9b6f1e4e81b5c01895aebbe3687a8e2d0c21479452538596f2882bab3b56f00c616a07cc1f
+EBUILD lld-9999.ebuild 1586 SHA256 25a918670a8dba073d508bf38ab49a7bb136b8c95affe69705754a2d8edb06e9 SHA512 bacda60ca06b24b5d4a5d4eca85a8e1802b93289b533d9bc2e0a189f3bc78b9f7498e3a7f4d121c244ebf3904db09691488f207d66744e9927acbc589ca235e2 WHIRLPOOL 55b3e0af15053002dbc15eb32c7e6311ae034880b1fa18f490faaa5cb0382fd0a5dbbb9962e3b12b78ae16d7dcc0680bd0404bf93ed46273ac4e7b81f83b205d
+MISC ChangeLog 282 SHA256 433fa56933fb974fcabf687259f07a45d2e1f27b65551d88c1d0f05563b289de SHA512 bfd4b64c29380b5e9aa3e39a6efe4b2495ba32d09c75be6e257e2dee1cd9d6eb41b527ca356396b0703a7ee92e89225d66715ce0316e148df0ff6c6b175453f5 WHIRLPOOL 3aa87110e79ac3ec17052afbfbadc1b3abe0d93f358a571f5802a87786d86fe4dce8cc20bf7ccfd404c96d4e5d59348ae68c310b654b7023cb929cd7b36e55f7
+MISC metadata.xml 216 SHA256 e94ba81dd2791908508a3993afdebf723cc617314c53c273b9bcca15a9c48327 SHA512 3485598147c953e72e1785693a489a7e7d73d59620b76054db9c0ce95d8bfa0e8ffec29da7f7a9d73a32e5b77eac07ca3306c56a972dc57fd89d477edaebf3d5 WHIRLPOOL 29145f5721e079e0548c5ef22424c65e6a5b2bfc4428918e923fcfdfc37e9b8749fb63e3c2eb5773c17fab276f7513dd66e326b906f1848911dceba7ae4b419a
diff --git a/sys-devel/lld/files/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch b/sys-devel/lld/files/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch
new file mode 100644
index 000000000000..2a7935f76838
--- /dev/null
+++ b/sys-devel/lld/files/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch
@@ -0,0 +1,97 @@
+From 72b099306f586382a32cb0b37ad6a07dc7cddcf9 Mon Sep 17 00:00:00 2001
+From: Michal Gorny <mgorny@gentoo.org>
+Date: Wed, 8 Feb 2017 20:08:25 +0000
+Subject: [PATCH 2/3] [test] Use LLD-specific binary&library dirs when building
+ stand-alone
+
+Use both LLD- and LLVM-specific binary&library directories when LLD is
+being built stand-alone. This ensures that the freshly built tools and
+libraries are found and used correctly.
+
+Without this patch, the test suite uses LLVM_TOOLS_DIR and LLVM_LIBS_DIR
+to locate lld, and set PATH and LD_LIBRARY_PATH. When doing
+a stand-alone builds, these variables represent the installed LLVM.
+As a result, tests either fail due to missing lld executables/libraries
+or use an earlier installed LLD version rather than the one being built.
+
+To solve this, an additional LLD_TOOLS_DIR and LLD_LIBS_DIR variables
+are added that are populated using LLVM_*_OUTPUT_INTDIR. Those variables
+are populated with directories used to output built executables
+and libraries. In stand-alone builds, they represent the directories
+used by LLD. In integrated builds, they have the same values as
+LLVM_*_DIR and therefore using them does not harm.
+
+The new variables are prepended to PATH and LD_LIBRARY_PATH to ensure
+that freshly built binaries are preferred over potentially earlier
+installed ones. Furthermore, the resulting PATH is used to locate tools
+for substitutions since the search includes both tools built as part of
+LLD and of LLVM.
+
+Differential Revision: https://reviews.llvm.org/D29335
+
+git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@294507 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ test/lit.cfg | 14 ++++++++++----
+ test/lit.site.cfg.in | 2 ++
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/test/lit.cfg b/test/lit.cfg
+index 0db879312..8dff2fb4e 100644
+--- a/test/lit.cfg
++++ b/test/lit.cfg
+@@ -66,18 +66,24 @@ config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
+
+ # Tweak the PATH to include the tools dir and the scripts dir.
+ if lld_obj_root is not None:
++ lld_tools_dir = getattr(config, 'lld_tools_dir', None)
++ if not lld_tools_dir:
++ lit_config.fatal('No LLD tools dir set!')
+ llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
+ if not llvm_tools_dir:
+ lit_config.fatal('No LLVM tools dir set!')
+- path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
++ path = os.path.pathsep.join((lld_tools_dir, llvm_tools_dir, config.environment['PATH']))
+ path = os.path.pathsep.join((os.path.join(getattr(config, 'llvm_src_root', None),'test','Scripts'),path))
+
+ config.environment['PATH'] = path
+
++ lld_libs_dir = getattr(config, 'lld_libs_dir', None)
++ if not lld_libs_dir:
++ lit_config.fatal('No LLD libs dir set!')
+ llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
+ if not llvm_libs_dir:
+ lit_config.fatal('No LLVM libs dir set!')
+- path = os.path.pathsep.join((llvm_libs_dir,
++ path = os.path.pathsep.join((lld_libs_dir, llvm_libs_dir,
+ config.environment.get('LD_LIBRARY_PATH','')))
+ config.environment['LD_LIBRARY_PATH'] = path
+
+@@ -174,10 +180,10 @@ for pattern in tool_patterns:
+ pattern)
+ tool_pipe = tool_match.group(2)
+ tool_name = tool_match.group(4)
+- tool_path = lit.util.which(tool_name, llvm_tools_dir)
++ tool_path = lit.util.which(tool_name, config.environment['PATH'])
+ if not tool_path:
+ # Warn, but still provide a substitution.
+- lit_config.note('Did not find ' + tool_name + ' in ' + llvm_tools_dir)
++ lit_config.note('Did not find ' + tool_name + ' in ' + path)
+ tool_path = llvm_tools_dir + '/' + tool_name
+ config.substitutions.append((pattern, tool_pipe + tool_path))
+
+diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
+index 5293f24c1..9dcb48174 100644
+--- a/test/lit.site.cfg.in
++++ b/test/lit.site.cfg.in
+@@ -6,6 +6,8 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
+ config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
+ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
+ config.lld_obj_root = "@LLD_BINARY_DIR@"
++config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
++config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
+ config.target_triple = "@TARGET_TRIPLE@"
+ config.python_executable = "@PYTHON_EXECUTABLE@"
+ config.have_zlib = "@HAVE_LIBZ@"
+--
+2.12.0
+
diff --git a/sys-devel/lld/files/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch b/sys-devel/lld/files/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch
new file mode 100644
index 000000000000..b1333ac40bc9
--- /dev/null
+++ b/sys-devel/lld/files/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch
@@ -0,0 +1,82 @@
+From a7fe305520085cff8e4bec0110d323c4f1ccbcab Mon Sep 17 00:00:00 2001
+From: Michal Gorny <mgorny@gentoo.org>
+Date: Wed, 8 Feb 2017 20:08:29 +0000
+Subject: [PATCH 3/3] [test] Fix zlib cond when building stand-alone, clean up
+
+Fix the test zlib conditional to use LLVM_ENABLE_ZLIB value when
+building stand-alone. The HAVE_LIBZ is not available when performing
+a stand-alone build. Since the zlib support is a feature of
+the underlying LLVM library, it exports the actual status as the final
+value of LLVM_ENABLE_ZLIB in LLVMConfig.
+
+While at it, canonicalize the boolean value into 0/1 and remove unused
+CMake definitions (most likely copied from clang).
+
+Differential Revision: https://reviews.llvm.org/D29340
+
+git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@294508 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ test/CMakeLists.txt | 19 ++++++++++++-------
+ test/lit.cfg | 2 +-
+ test/lit.site.cfg.in | 2 +-
+ 3 files changed, 14 insertions(+), 9 deletions(-)
+
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index ede92c13d..962274160 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -3,13 +3,18 @@ set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
+ set(LLVM_BUILD_MODE "%(build_mode)s")
+ set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
+ set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")
+-set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
+-set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
+-if(BUILD_SHARED_LIBS)
+- set(ENABLE_SHARED 1)
+-else()
+- set(ENABLE_SHARED 0)
+-endif(BUILD_SHARED_LIBS)
++
++if(LLD_BUILT_STANDALONE)
++ # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
++ # value is forced to 0 if zlib was not found, so it is fine to use it
++ # instead of HAVE_LIBZ (not recorded).
++ if(LLVM_ENABLE_ZLIB)
++ set(HAVE_LIBZ 1)
++ endif()
++endif()
++
++llvm_canonicalize_cmake_booleans(
++ HAVE_LIBZ)
+
+ configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+diff --git a/test/lit.cfg b/test/lit.cfg
+index 8dff2fb4e..85469ff6f 100644
+--- a/test/lit.cfg
++++ b/test/lit.cfg
+@@ -202,7 +202,7 @@ if execute_external:
+ config.available_features.add('shell')
+
+ # zlib compression library
+-if config.have_zlib == "1":
++if config.have_zlib:
+ config.available_features.add("zlib")
+
+ # Running on Darwin OS
+diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
+index 9dcb48174..1fb8d3690 100644
+--- a/test/lit.site.cfg.in
++++ b/test/lit.site.cfg.in
+@@ -10,7 +10,7 @@ config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
+ config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
+ config.target_triple = "@TARGET_TRIPLE@"
+ config.python_executable = "@PYTHON_EXECUTABLE@"
+-config.have_zlib = "@HAVE_LIBZ@"
++config.have_zlib = @HAVE_LIBZ@
+
+ # Support substitution of the tools and libs dirs with user parameters. This is
+ # used when we can't determine the tool dir at configuration time.
+--
+2.12.0
+
diff --git a/sys-devel/lld/lld-4.0.1.ebuild b/sys-devel/lld/lld-4.0.1.ebuild
new file mode 100644
index 000000000000..684bc8deac68
--- /dev/null
+++ b/sys-devel/lld/lld-4.0.1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils llvm python-any-r1
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+
+RDEPEND="~sys-devel/llvm-${PV}"
+DEPEND="${RDEPEND}
+ test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ if use test; then
+ mv llvm-* llvm || die
+ fi
+}
+
+src_prepare() {
+ # backport stand-alone build test fixes from master
+ eapply "${FILESDIR}/4.0.1/0002-test-Use-LLD-specific-binary-library-dirs-when-build.patch"
+ eapply "${FILESDIR}/4.0.1/0003-test-Fix-zlib-cond-when-building-stand-alone-clean-u.patch"
+
+ eapply_user
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ # TODO: fix detecting pthread upstream in stand-alone build
+ -DPTHREAD_LIB='-lpthread'
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ cmake-utils_src_make check-lld
+}
diff --git a/sys-devel/lld/lld-5.0.0.ebuild b/sys-devel/lld/lld-5.0.0.ebuild
new file mode 100644
index 000000000000..dabb7f02f743
--- /dev/null
+++ b/sys-devel/lld/lld-5.0.0.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils llvm python-any-r1
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ test? ( https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz )"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+
+RDEPEND="~sys-devel/llvm-${PV}"
+DEPEND="${RDEPEND}
+ test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+
+ if use test; then
+ mv llvm-* llvm || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ # TODO: fix detecting pthread upstream in stand-alone build
+ -DPTHREAD_LIB='-lpthread'
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ cmake-utils_src_make check-lld
+}
diff --git a/sys-devel/lld/lld-5.0.9999.ebuild b/sys-devel/lld/lld-5.0.9999.ebuild
new file mode 100644
index 000000000000..6c2601f5d423
--- /dev/null
+++ b/sys-devel/lld/lld-5.0.9999.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils git-r3 llvm python-any-r1
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/lld.git
+ https://github.com/llvm-mirror/lld.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="test"
+
+RDEPEND="~sys-devel/llvm-${PV}"
+DEPEND="${RDEPEND}
+ test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ # TODO: fix detecting pthread upstream in stand-alone build
+ -DPTHREAD_LIB='-lpthread'
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ cmake-utils_src_make check-lld
+}
diff --git a/sys-devel/lld/lld-9999.ebuild b/sys-devel/lld/lld-9999.ebuild
new file mode 100644
index 000000000000..a8e3f4f39dc9
--- /dev/null
+++ b/sys-devel/lld/lld-9999.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils git-r3 llvm python-any-r1
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/lld.git
+ https://github.com/llvm-mirror/lld.git"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="test"
+
+RDEPEND="~sys-devel/llvm-${PV}"
+DEPEND="${RDEPEND}
+ test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ if use test; then
+ # needed for patched gtest
+ git-r3_fetch "https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+ fi
+ git-r3_fetch
+
+ if use test; then
+ git-r3_checkout https://llvm.org/git/llvm.git \
+ "${WORKDIR}"/llvm
+ fi
+ git-r3_checkout
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ # TODO: fix detecting pthread upstream in stand-alone build
+ -DPTHREAD_LIB='-lpthread'
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ cmake-utils_src_make check-lld
+}
diff --git a/sys-devel/lld/metadata.xml b/sys-devel/lld/metadata.xml
new file mode 100644
index 000000000000..89c4bdb96049
--- /dev/null
+++ b/sys-devel/lld/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/llvm-common/Manifest b/sys-devel/llvm-common/Manifest
new file mode 100644
index 000000000000..f75621635339
--- /dev/null
+++ b/sys-devel/llvm-common/Manifest
@@ -0,0 +1,7 @@
+DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d WHIRLPOOL 1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
+DIST llvm-5.0.0.src.tar.xz 23411980 SHA256 e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a WHIRLPOOL 6a99edbdc3e6726dc8ff9126b110fd7560faac46601407722e6dd80b5d894ff242521dc8fda7f4d879de83dac51c65645a37224f7e8def0d8d2f1e564b0531bb
+EBUILD llvm-common-4.0.1.ebuild 644 SHA256 ea2b54ff32ed96f73e85acacce0ebf0ed462f42a245301cc34943ac88533e113 SHA512 036b41ba0bfe661a3970bd703a8d02afd6cebb80f7e44c0a4a8b4fde0327a72364c8175ee01c67f05a3f37d3969505706e64f929b3b8e170ce80efd1cd09a20e WHIRLPOOL 3e6292d7ca75f6d6d273aaf3703b277a9238c9ceeae8754221badcf0dd2244f7daf43fcaffee878238b50a19d92c8b72c537bd95ce02f083f808b2f73b875e2d
+EBUILD llvm-common-5.0.0.ebuild 644 SHA256 ea2b54ff32ed96f73e85acacce0ebf0ed462f42a245301cc34943ac88533e113 SHA512 036b41ba0bfe661a3970bd703a8d02afd6cebb80f7e44c0a4a8b4fde0327a72364c8175ee01c67f05a3f37d3969505706e64f929b3b8e170ce80efd1cd09a20e WHIRLPOOL 3e6292d7ca75f6d6d273aaf3703b277a9238c9ceeae8754221badcf0dd2244f7daf43fcaffee878238b50a19d92c8b72c537bd95ce02f083f808b2f73b875e2d
+EBUILD llvm-common-5.0.9999.ebuild 661 SHA256 6dadfb04eccdf98ba8d7ec390610454d11abde4088b9165da48f835ceeb2514e SHA512 62e224b7d58358cb027dd318304a9c4bd56ff6a454392f3575d6e4f9ac105966dd4d308631c23d04207d204a065c4f571a60a6961fe519f70d275a0ba95ad94d WHIRLPOOL 92720fe818004cb0aa27a3a426256351dd6947ed81555a7a89d2943b34296794fd987e82ceb3b3618e69b4609fedae45fdb4774302c83db8af32d36c0a89d2fe
+EBUILD llvm-common-9999.ebuild 636 SHA256 0d107f1c271f260088621b6754da643cefa71aba7c9ec18eb1ed2abb6503dd44 SHA512 0bd4c7535c82bbcdf33068e411358e2847a30665a2c8f83cb2bd2d289760ded3ce93d66c5a43f94dca7db49665a3f8281d3c5b2ba3be45a11d54e61a9041259e WHIRLPOOL c190f2b79d2073796a913ad250bde88a760b16d799ffece2423afeac66d55b9909d4750a4811cd870e82c6507bb4c983a563fb3df99b05bdef6ceb0cf2caca7a
+MISC metadata.xml 216 SHA256 e94ba81dd2791908508a3993afdebf723cc617314c53c273b9bcca15a9c48327 SHA512 3485598147c953e72e1785693a489a7e7d73d59620b76054db9c0ce95d8bfa0e8ffec29da7f7a9d73a32e5b77eac07ca3306c56a972dc57fd89d477edaebf3d5 WHIRLPOOL 29145f5721e079e0548c5ef22424c65e6a5b2bfc4428918e923fcfdfc37e9b8749fb63e3c2eb5773c17fab276f7513dd66e326b906f1848911dceba7ae4b419a
diff --git a/sys-devel/llvm-common/llvm-common-4.0.1.ebuild b/sys-devel/llvm-common/llvm-common-4.0.1.ebuild
new file mode 100644
index 000000000000..f53d09927137
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-4.0.1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE=""
+
+RDEPEND="!sys-devel/llvm:0"
+
+S=${WORKDIR}/llvm-${PV/_/}.src
+
+src_configure() { :; }
+src_compile() { :; }
+src_test() { :; }
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r utils/vim/*/
+ # some users may find it useful
+ newdoc utils/vim/README README.vim
+ dodoc utils/vim/vimrc
+}
diff --git a/sys-devel/llvm-common/llvm-common-5.0.0.ebuild b/sys-devel/llvm-common/llvm-common-5.0.0.ebuild
new file mode 100644
index 000000000000..f53d09927137
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-5.0.0.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/llvm-${PV/_/}.src.tar.xz"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE=""
+
+RDEPEND="!sys-devel/llvm:0"
+
+S=${WORKDIR}/llvm-${PV/_/}.src
+
+src_configure() { :; }
+src_compile() { :; }
+src_test() { :; }
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r utils/vim/*/
+ # some users may find it useful
+ newdoc utils/vim/README README.vim
+ dodoc utils/vim/vimrc
+}
diff --git a/sys-devel/llvm-common/llvm-common-5.0.9999.ebuild b/sys-devel/llvm-common/llvm-common-5.0.9999.ebuild
new file mode 100644
index 000000000000..239d0e083cd5
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-5.0.9999.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit git-r3
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="!sys-devel/llvm:0"
+
+src_configure() { :; }
+src_compile() { :; }
+src_test() { :; }
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r utils/vim/*/
+ # some users may find it useful
+ newdoc utils/vim/README README.vim
+ dodoc utils/vim/vimrc
+}
diff --git a/sys-devel/llvm-common/llvm-common-9999.ebuild b/sys-devel/llvm-common/llvm-common-9999.ebuild
new file mode 100644
index 000000000000..64d8f5e7daf3
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-9999.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit git-r3
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+
+LICENSE="UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="!sys-devel/llvm:0"
+
+src_configure() { :; }
+src_compile() { :; }
+src_test() { :; }
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r utils/vim/*/
+ # some users may find it useful
+ newdoc utils/vim/README README.vim
+ dodoc utils/vim/vimrc
+}
diff --git a/sys-devel/llvm-common/metadata.xml b/sys-devel/llvm-common/metadata.xml
new file mode 100644
index 000000000000..89c4bdb96049
--- /dev/null
+++ b/sys-devel/llvm-common/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
new file mode 100644
index 000000000000..4c63b02f12f0
--- /dev/null
+++ b/sys-devel/llvm/Manifest
@@ -0,0 +1,55 @@
+AUX 9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch 2626 SHA256 66481b2fb647e72007a3a66bfce6283de6e882dd9cd126f826fdd3543b14f1ef SHA512 34a84427c34fa8886f55e05cf0ffce258cdee8e98190e070eb40dc555a30784c49ebe4f946f7ea51b7d00fceb8071fc745007250dc5b5a61c4d2bb9910672ec5 WHIRLPOOL cccdbed2df2ad42496e5b3db71104775d7c34e82ae7b631c3715487f54d8084d1a8b35bf4ff805698ebefb8e4f7581495bb5b62fa168de8ed95feaceb45ff7d8
+AUX 9999/musl-fixes.patch 1258 SHA256 8b0ae461e2d50f052e71a9498058f3d514c439973af32d0e0bab5ce73efedefa SHA512 314dcbe846a66312c9f1634f4ff3f4670b3db1d3210bb550f1d3877a423333ba042da2e90c8736918a36be4d4faf58dab8d3236d4f26df5af7f7f019b0e0ec8f WHIRLPOOL 893934dd9ea093d2c102144be0e6fb80ec846299c662939e7093d21fb38fe237a49909c1c69e5b5839a1686aa0281b8a865eb4162ede3e7e64642b11621c08d5
+DIST cfe-3.4.2.src.tar.gz 10612313 SHA256 5ba6f5772f8d00f445209356a7daf83c5bca2da5acd10de517ad2359ae95bc10 SHA512 e01fa8e312e9b3b7b3cb572ac21349161aaa50078ecfe7bded273b75db4a0c44acde524f8fdfcbeec54c61eeeb8339e9917d1f205a8fda18e34fe7ccbe89c36d WHIRLPOOL 153208b1a60bb5fbe92a7162cb26bbe70d591e7db9dcf06fcd54efc539bbff0403ec88e64236969c9f256e5586bc333840bd6178fd158577d6fe228d9edd4dcd
+DIST cfe-3.5.2.src.tar.xz 8268008 SHA256 4feb575f74fb3a74b6245400460230141bf610f235ef3a25008cfe6137828620 SHA512 2ad9a7daa8e62cdbf47b001aa6b937a06ae7e6396dcd1832797e2d98036522443ccfca9f1253e16d531a99d1edf237fcd2b457c55491ff68ca4534a2396ca52f WHIRLPOOL 51789ba2a3193d404b26d26b999fc47f1bc4b56b45048078cc51e4ff5c31d834d360ee0c2d16096c060f85acab6de9055dc375569348ae3307e4b280406f2d9e
+DIST cfe-3.6.2.src.tar.xz 8617576 SHA256 ae9180466a23acb426d12444d866b266ff2289b266064d362462e44f8d4699f3 SHA512 ed837c48f38d8998efd675b56477c8681dcedfcf3f71bba65930f145501289bebb6fe6a6d9de336548f94c381d016b99f10c58e046b885449755d44ac782de03 WHIRLPOOL a17419cea329999c8662c0008dbd0391ed5f52045d0175488979e7620f6a9a21b08e451a5e21d3bf944597bb37934a8228fa89c09d773882359822d59bd447a8
+DIST cfe-3.7.1.src.tar.xz 9110616 SHA256 56e2164c7c2a1772d5ed2a3e57485ff73ff06c97dff12edbeea1acc4412b0674 SHA512 8e3285a32ad0fd4721fa77c4fb9709f31bb4e4f7cb5245357aaf57b0767b6ef18a30d902b59d1437a6febffb6c2128214f9ce5aa913bb298743221a28c4f9de5 WHIRLPOOL ce300f5023bddda59ee055e4dccdca8bf459fae5d4e91c44262d2830c406b798d697d1bf3c6326ff41b969a8439f94a3c83570f1d0151a7f0223eb0d8f324f7b
+DIST cfe-3.8.1.src.tar.xz 9605548 SHA256 4cd3836dfb4b88b597e075341cae86d61c63ce3963e45c7fe6a8bf59bb382cdf SHA512 72d23a410271b50f97371b13dd7a6c6c5c0a993e35df436ab716ece8521d83406aa3d4bf8fdecd8154139f39fd5e011e480d405225d8c3ff152d0a2ac4573e04 WHIRLPOOL 7bcc9e6fed871b7490e2a280f2ad36008150a0af3605357fbe529aea8a7acbbed41c7da273dd150f8f50869cd321f114e909236261c4dd05ed7f644c75f208c4
+DIST cfe-3.9.1.src.tar.xz 10363080 SHA256 e6c4cebb96dee827fa0470af313dff265af391cb6da8d429842ef208c8f25e63 SHA512 3f0eea194597e438bbe49ce9ef5fdced81459c21cbdd2653750b2fe02c55a0154d6a33a8cfd02e607b83314a8e35b2c300f944462120ab6de1d4139d85db56b8 WHIRLPOOL 9f70688c7c2857426bf5fbf039b9723ec73ec57e8d3b36da37589bcbdbdb090aa36cd1800f0521ef0c30065bf03083eade0ac81ef0939412919423db7779a6f8
+DIST clang-tools-extra-3.7.1.src.tar.xz 277476 SHA256 4a91edaccad1ce984c7c49a4a87db186b7f7b21267b2b03bcf4bd7820715bc6b SHA512 06e2db8af75f1e6ee82da6ee723b5256b9e3f6ba196428f18944ec02d07df26d04329ca8824a083c5f25274ce7e3469aa75e3a29ccfbdb6375524841d65e3ad7 WHIRLPOOL 2c1a459d6aff6bc24d5c8d38120ab665adbef61394050781a9707d50e83dae1b4997ed19459086e9bd7f6dd38a09c295d135e33515c947d64a7f1ab714ad8beb
+DIST clang-tools-extra-3.8.1.src.tar.xz 334768 SHA256 664a5c60220de9c290bf2a5b03d902ab731a4f95fe73a00856175ead494ec396 SHA512 ec8c4a6ac4fd1a0e24fc15e56ba00828e0d718c2f7bd477ea134ab094c67f4f4b2f603f128ec11a03b7f25f3e9b8fe75181e40730c56b7b683f54e3f37573137 WHIRLPOOL b05213cbe21b778e718233cecbf4d01b92c1f133eced6fdd3fa5059c4b10e5f0407549634f65032af177ba1614250f5c02e283c2b03563db3e227b1afcae424b
+DIST clang-tools-extra-3.9.1.src.tar.xz 456464 SHA256 29a5b65bdeff7767782d4427c7c64d54c3a8684bc6b217b74a70e575e4813635 SHA512 5691fb09f80b519876cdd2e82ad23a20bba32a0bc356e15e6db631b2936763911f15ff55f8bf5f073100b9e4cf217f08fdce90ae98ef0e084274259d3cfe9634 WHIRLPOOL 1b1d877da04a2d8f93e3181b9b32caad23874a052c1e29bc66fddf29efb8edd69979400fcff40de00831d041383356fe7c37ddd63de8a206498baa65f7b79872
+DIST compiler-rt-3.4.src.tar.gz 1858593 SHA256 f37c89b1383ce462d47537a0245ac798600887a9be9f63073e16b79ed536ab5c SHA512 70efffaf12ff7c15befa87ce808489c6f6b6eb421d0ab5d8ecd525239efc8aab850c7ed34b31a993ff5e499657b72598619945cc4461fe3e5359e9a94aaac0c8 WHIRLPOOL ad558b5877a01e476d30d2757959ab04be0c385b2fe3442bcc578bf36c6f3214cd78b4adda24fcb1f3b2b84353db213b82e8d7d4c40e66c3f57aed3a49322dbc
+DIST compiler-rt-3.5.2.src.tar.xz 1093000 SHA256 542d7aadd21e7fe35bea0a7912bc965f08a1a566746cebcca76f96dcfeb74dc3 SHA512 319a8a1dbe07eb4f1fcccfe79a1fa445f348fb854a441500e89fa0a128e45716b65d06347f19a63de32e9294cd2331e914ae0d5fe8224f0b2452c39b79ac96ff WHIRLPOOL 6e9286c56a60a515006c8232ca01622ae844185a5f31fb49bce632868862c5e560619f1c45da66878b5322a764f91a284cd296e9f13105d6f74e055a17321d93
+DIST compiler-rt-3.6.2.src.tar.xz 1128080 SHA256 0f2ff37d80a64575fecd8cf0d5c50f7ac1f837ddf700d1855412bb7547431d87 SHA512 7dafcc5bd4822475de649d8a84ae51af3c4ed4d0958f76b1b55ba79219638f3e78eb94a1986c6e9ba0e7f1ccf3ec834d546b5ca60e8b08083fea5880ecdf17a3 WHIRLPOOL dd77e7df43c9028a6873ed903da67560fdb04968013016a7f0ad2d2e9a81b3a3d890b95e4f49a6bdef349806d6507defcd80a0a9fb50c1c9f778e7eff42dbc5d
+DIST compiler-rt-3.7.1.src.tar.xz 1181772 SHA256 9d4769e4a927d3824bcb7a9c82b01e307c68588e6de4e7f04ab82d82c5af8181 SHA512 bf434519ea0838264c30de1e1e8681320aa868df0ecc825a45c659077b963a4120c18216946558cbf8aea24a8ac8ec39af2066dab906bc7cabc0894d51d61325 WHIRLPOOL 0bea047e48622884a6fc6bb3826046e9de5b3192006cc41c0ccd9d6c611674869c3c15988b531a0f7d9fea2cf951b90ecef385b85db765c6f99a48692fdcf223
+DIST compiler-rt-3.8.1.src.tar.xz 1263312 SHA256 0df011dae14d8700499dfc961602ee0a9572fef926202ade5dcdfe7858411e5c SHA512 bed3da5f8594c4bf71af406419fbeaf7ed5d8bf46adb305233a298271d34a9af1072bcb47d474ac19bb862cc7c7bc9e1d89bc1567133553f29480030cad1cf75 WHIRLPOOL 950de96c57461c51ee9857dd56a858876f6bdb09f44ea1ec96c6f113d3499f5f3ddb90e86a8a6b50460577e1b4857da3dd6024eb3427d837630a2c4c678c360a
+DIST compiler-rt-3.9.1.src.tar.xz 1376372 SHA256 d30967b1a5fa51a2503474aacc913e69fd05ae862d37bf310088955bdb13ec99 SHA512 91a4c78a5e8c1cdd2d6bbcb27d2c34f49ea30a952733444ef4f4a7cc7503c880d4b6924595e87745ef6278851178f49f98d38d2068975d4fb6577fb9e9cdcdbe WHIRLPOOL 06c55bbd9f79f1b3ee0adf058e6c540c3df5542337840d35e43e149d10605a95ba1363b360de25ebad41b048dd4e8f2aac25604b4f55f6a282fe01b014104d56
+DIST lldb-3.7.1.src.tar.xz 10650524 SHA256 9a0bc315ef55f44c98cdf92d064df0847f453ed156dd0ef6a87e04f5fd6a0e01 SHA512 d2d3e1052026edd6ef9113ff5362acb4a32cef598098b4031c35e389301130ef2e1bda594f30de4d65c9fdc0beaecdd35afcf36676eb540baad34015aca294d1 WHIRLPOOL bba9c700788f0cf86ac1de51383a223e1c92f724719cdd327d83189cb77714c1e10fb78569aeed3b3c639062a3410bb114f646a271fd0d9e8c9a8e45d090330a
+DIST lldb-3.8.1.src.tar.xz 10928220 SHA256 349148116a47e39dcb5d5042f10d8a6357d2c865034563283ca512f81cdce8a3 SHA512 d73c55daed6ef5e5ca784c7010f2d75be26024b14fa61a2861a8a6cbe129e417fb7be2a3b532e17e9d7de98ae38ce6a689d8166049eff365fb04f4bd772758f3 WHIRLPOOL 78dd8161cd1411bd62cb3ffe1196fe95ccb73d78f2e141a58c63776eb6d91065fe1348b1b8e241630cdf954ab659b333ebbcdcaeba3e6df36af62aaf3a7c6634
+DIST lldb-3.9.1.src.tar.xz 13750816 SHA256 7e3311b2a1f80f4d3426e09f9459d079cab4d698258667e50a46dccbaaa460fc SHA512 e2957a1da60284595b21c205b07fa3db5c474bfad1935ab8e1bc832f30af497e9eb709efeb703591ef62e7dd73a28d22fc21398097a232c8a729946d72eb5df7 WHIRLPOOL ef4903cca78c6509602c72f37738326f0f0544275f068571d9bcfd1e26eb5fb4f78f5f41790a2696e045ac9d6f45adfdb7edd532ac41fd82565b50a6db93725e
+DIST llvm-3.4-manpages.tar.bz2 33753 SHA256 dc2616104cf333dd9ef56b2d31f9a36e81303e2c5756ff8bc221e05b46f7e1cb SHA512 8e438a9392c9b896ccb2b1460a8f57ffa01633e3a6bba61e2bf2f718d970ff96c17d63b0bc0d4da1162e1d1dc4cb9b2a9e9a14a722e8a5b5d2f205f037ae665d WHIRLPOOL 1c037a9972442937f84bc3147d77d4bbc6d6c0812c3025f3107c2ee5f6259afab990f6e1bca564237fdca8089e2372df4b7ca45cbdea686fbf891f92d1bfbbe6
+DIST llvm-3.4.2-patchset.tar.gz 4612 SHA256 ec5d12763c0181ae0ff7485b08a69b621a988df278fcb3ae009551d637da824c SHA512 32c7cf229a6a8917f0fc67efa1fb11994945281f6906395cee7e5c51399c8fb4c06f554a03253c8f9073890a7bc7af151a8adfe887ad62f45f1523e6e358f769 WHIRLPOOL 408d1b2e55aa14acd3ae34918d164a53ebc3eddf8e3f8e77deb52acbab9e76bf94365d94c34ad6155d2537739a7fffab1b7f088be7d25ba77dd1796164f77721
+DIST llvm-3.4.2.src.tar.gz 15938155 SHA256 17038d47069ad0700c063caed76f0c7259628b0e79651ce2b540d506f2f1efd7 SHA512 6c1453f7d9d9110257db3574cc4f6227fed8938705cbb09851ac09a868089b48f1556a1b6e758aff6d97520b08b5605d3ed20411ad9dd22cdc573d62176905f0 WHIRLPOOL f8b4d5167469e6f350ec41aede04e7b756e18f3d8e78b3270beb5791310a7b9b13c69e57c8bcfefbd0a78efc0c40e3b75a9a158eac72c025b7c77146e8dfaf7c
+DIST llvm-3.5.0-manpages.tar.bz2 35314 SHA256 724e752a60016dce8cc536658906d3646c600e977374e0ea692a5d0fe2d4a021 SHA512 d99d6096d7f21a81923297584fe5eeb23e0d83d4538fe376615c92fffc8aff3189999f7ab3c537b5aa5d6bc2c22c53eb05717d48c7ab99c42315b8665bac62c3 WHIRLPOOL 68ced06ee6678c5333c662eb1cc0da744c5a184b12dd059c1b77ec200b1d3cc231f270b9d9b6e177d728776894277b3f9061338aa55620c90474eb97915b7819
+DIST llvm-3.5.2-patchset.tar.gz 4568 SHA256 9a987625d5d5a06cbf2733c68815ae0083a7bba30be7c53c3cda996ab61df52e SHA512 6df5a61d3e949dbe9840e713eb90e7514760c5ae68e241494d0246925015ac7e9d73671dd0646eb44d2d9232665027783d02c00639f41385615ec541d4e2fa93 WHIRLPOOL a34e09f22b62b12adcf3d948a2e9769868f70cc0692feb8e574a224999e74edea6bf82c16b48fa658de0f06f6d7f6987e8e8dd1d65cdf9b6a0d0bdf7ee3cdaab
+DIST llvm-3.5.2.src.tar.xz 11876128 SHA256 44196156d5749eb4b4224fe471a29cc3984df92570a4a89fa859f7394fc0c575 SHA512 0f6a83cc61a385387e7baf8fb8f0d9f18e3fd00d2d389a3c7e2c3792be7d82ed095506cac52c24e65ae3c1f94456a441d39440feef6125e25ef18447ec9dd406 WHIRLPOOL b41de51907d6d2c2d04a4c498b44f0ed560cc710e6e2d8678f5ef93a9009d140bc7c2406f4b25d5b901fd026689d48edce77a2e435687b489b835156a512e256
+DIST llvm-3.6.1-manpages.tar.bz2 38338 SHA256 b27c6198e09b11421841a7184d4e8a0f8878d4f1313405da28d643134a55688a SHA512 a47aeb0b4632329eaaa1d6c774446fea5822d7692d81533a9a5c5de1c6a3b37fdd6b7c1fc6433339649f4d3a53a753065e73afb30fd84f253ad31d5fb3d48662 WHIRLPOOL 022b214b6340365490915b5c873e515bf16be90d04cd32f09024a3607c23edc2c2e241d295102f045bd08a442c4e5aaf134ac89f7e59a027ec1633330a95989b
+DIST llvm-3.6.2-patchset.tar.gz 4562 SHA256 7b85037d143732c0e635a2ba436d1f2418654161ecb5b9618f8e9ffad8fa3279 SHA512 6018e7d96317e6a46f373259430782a1377193ab64b337d5f6720a4ffe0eb0891e7e9373fb9c20da66e840f07e52f2bccb2a8c51bb55ded0f124748796cce1c8 WHIRLPOOL 01aeb3b454cc0d442c9a54ab3aca3be0106765f372ec4e82344f3967faa89fefec978562cdef56d1cc47cb418b0dd15ac685a2c1b05d415fb32b8684182aeb23
+DIST llvm-3.6.2.src.tar.xz 12802380 SHA256 f60dc158bfda6822de167e87275848969f0558b3134892ff54fced87e4667b94 SHA512 42b44ce69cfb96e2dc12dc2246f0de8ff983a99741206e2c46ccf074b3248aaab9c0f22c6baad802de851d06f202f40db9dd62fe38aab4479b3f70026c936b36 WHIRLPOOL 1a15e16793fe4120f1c14a5334362c36db26745c493e7289281351b7c18c523d781ff9425dddfe1a2add9ea1e8aebb92f2313787da5f286259b55b0884b3039f
+DIST llvm-3.7.0-manpages.tar.bz2 38095 SHA256 8597fa532464c6336aefbbef0b1ce452aaa98d474fa58108c6a6f57a9ccd6785 SHA512 ea70ac15dbaef3740b31f66aa798338f7f9b82484586582aa62e0364f9d74bf175be2f4f29721df253b8157c1cbc146ab9045c0656c42a6375434e994786b643 WHIRLPOOL 743b339b0df7c52d270a5197e9e765dfd92d4b5acee94cf9d9d7713e1a75aa9d987b3f5adab0952e7267febf88b318d0f31cb45847e2b0b42c7c7373b2358358
+DIST llvm-3.7.1-patchset.tar.gz 17234 SHA256 3add3f23c0eae09f52ac055362234a116da4fc1e5a7772cd9a90519549e9f096 SHA512 030dc7f72d11fcd53307f707d5dde321054feb0f0977601c3e188a37f2be6c14bfd05482d1c1e5f435aaf32ca7c7e3701cf5f1375fbd0cf83cf8afbad7f4f6be WHIRLPOOL fa5d3464ac6315dabac895b753918b0dbe301ef6d8e45a75934ba6b0ba947e30763d0522bd95b79ae4a714b1234bb08e654c0a9987fd74e692eeb2afe16694e8
+DIST llvm-3.7.1.src.tar.xz 14592544 SHA256 be7794ed0cec42d6c682ca8e3517535b54555a3defabec83554dbc74db545ad5 SHA512 ac521debc02f6deba96ef975d6a546b0c5c77299c1dbf5e1b87a7974ff5e7fd715bd7e384b92d9adf572ce47130bdbf6d3c648eb0d7f72f16f976292e4909e90 WHIRLPOOL 788ce0907b906ebee595c766713bec5067563c8aba7460211f5830e116df7c830de84704834c0df2f2f2c90354d75521e4a4aff57e769a2d8ab590778c1e4a70
+DIST llvm-3.8.0-manpages.tar.bz2 37889 SHA256 4dda7f69f9412e0fb50d32631df34d6ea7f93c945c9a59cb050a99f1d2d0508b SHA512 a93ed7a25b75c237a0967ba7a501c71af3e7e9292ebabf69733bc637e9a4534dcaee539c6b1f6b2df7a87103c2371b1cf130fac05b88047100988c814e89ab0f WHIRLPOOL 9790a576fd4db798c2339bb4ea1dc973f1057177364770a104be7916998a1ad824e6b4eee296066ddd32eb5e6c57ffd5716457cecbd8ca9fe1b317d0d5ed2676
+DIST llvm-3.8.1-patchset.tar.xz 24260 SHA256 4a1677b5aff3a4ca8ccdbcc45e286e44d23867cbaa48a39cffc0fc2a8765ed6c SHA512 1e4ec68c56cc72a89afb573ad0c3cada10be7ec02e0af033a6c5cf8ce46ed7bf40389543c2f1b11e7080dba49962c57b4ea9f9bc971c4647eb3fd945c0cf0529 WHIRLPOOL 38c16b23f995818a6ca292e89d28f85ae6d19327bc0efe72270611077a7b76bca99b2e1f11b8653550bddee4123f2611621b86c4b81cdb8f96edc1cd4c5cfc4f
+DIST llvm-3.8.1.src.tar.xz 16551472 SHA256 6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9 SHA512 99bbb2cc5f337fd5edf1621f8028c8cb74011aa4af2531018dc05409b27f7b8d0c2f76a00115f677f7c013029d5d9f55d085a5b40433409aac4e9161d53bd366 WHIRLPOOL a99cef164a0e05e5237b840bee776d48fe0bde460cb4536f03a5e4eb0cc630deeb96f76bdd42f912a4b2dab08133bd9137ea16be1b9582d375f0f5841dd40234
+DIST llvm-3.9.0_rc3-manpages.tar.bz2 80007 SHA256 991f5238d23c0aee2fd303d1adecd6045c42ed066f42f0d58f62c3a25c197140 SHA512 f96c340021de3f096ec3ad7d51a6af2c7a84974122d1df15729a39d4f9d65452f063a85ab38adb064288dc14220d9cc679b31ee19b48424d3d7cde621ff37597 WHIRLPOOL d3f24a2faaa5aa909519373532262c342acf517048ac543f303b6ddb539f5ece876a338c8efc445f4ada6f723a4e65e35bd5f2f9b4f52ef96ef832000259ab20
+DIST llvm-3.9.1-patchset.tar.xz 16404 SHA256 a4b3e5887b53af47984ea39ff8640f11e8a9accbafd1be20fb9cf25f2980b16c SHA512 dcae89ba910b5195bb455924242912f526b6994f0f236571b6364fd594bf9ca03cc74e116a44ae4372e34ce63b21f1351125157e7af7a957aee115f400b54089 WHIRLPOOL a9ec4315e8bb9593e6734e22a0d81fbe0398adedcfe7f6b81de852c1a1092593e07624a5ce7b67bca8be8b34c7453fda9f7eb33be41d11f51458800248a15649
+DIST llvm-3.9.1.src.tar.xz 18130436 SHA256 1fd90354b9cf19232e8f168faf2220e79be555df3aa743242700879e8fd329ee SHA512 50cbe8ee911080f586e77861c442348701bd02e2de0c090c54c34f82ac275ecfcd712af0f41e387c33b4a6057778a4258a27554292fe68ab4af3fd9dd6d90683 WHIRLPOOL 1cd1a25befcb178bec4a4aace4367167f3838d32edbe9db9de8c6e558c01c1fcf123f6d6f80b7ec9ff32b3d6dcf2de2f4eb4201d417c3d17a5c8a69934832903
+DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d WHIRLPOOL 1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
+DIST llvm-5.0.0.src.tar.xz 23411980 SHA256 e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a WHIRLPOOL 6a99edbdc3e6726dc8ff9126b110fd7560faac46601407722e6dd80b5d894ff242521dc8fda7f4d879de83dac51c65645a37224f7e8def0d8d2f1e564b0531bb
+DIST llvm-manpages-4.0.1.tar.bz2 87981 SHA256 28fa1dcd4774156247ba253d2d79c81796ef0f0763b4f37c9c5ae27af93f4320 SHA512 d5b3213567c25db58ef364d272314a79c311a80fc21d98c09a5540af45a8190a38f489228663fe9a9b63bf0f2b952c460c4196a8fc8d6f221619f6e7ed2fc415 WHIRLPOOL da897ea8d3713a5c4c10a6320f0e7dd13e0125e942e3444b0e8a2a062b83a8e86e3754be025b89ae00f63f557ec0518ab62d8cd21237962e93c708ca72c8e3f5
+DIST llvm-manpages-5.0.0.tar.bz2 94240 SHA256 5082c316cf09e6c15d76f0b184745bf3392d3fd42a56cf0a5119b45918a67cb9 SHA512 0bccfb00caa0796bed8ea4e591616e025e43d304f05589180820c17f8567fa3a1f1f76c323098ed0d0e4590765415b1c1c272a94c6e2e7544788f4088ef0ffea WHIRLPOOL 410fe9eda01519c7ded00b2ca61dd323bafb3418a0a81fdc5c3b60d64ee80b75a6372ea29eb66a1b1ce6bb020c011cff7d9e896469dd6f9534fc19fb5b5a4696
+EBUILD llvm-3.4.2-r100.ebuild 7025 SHA256 39af7cb53bdec9ab78e23a1a49faa268b3bc1feef604e0b4b499513b44a99d91 SHA512 9829abe6dbd09d786236ed4b05edbdbdd96c82af22dee5e4d4eb33fa28c80102024eeed057bc15140cf4bb646e84e8ed86e152a10df99b59f9ce84790af53593 WHIRLPOOL de2b921465bf56e090fe272dd3427911bb888b052b85745d4fd363f0a9460841bcf6f372b893e7d77d635e017688a1c407f3a2d57a665d3568d0223b99c10269
+EBUILD llvm-3.5.2-r100.ebuild 7837 SHA256 aef49f649c6389fffbedfe93d3def28ccb3fd31054adcefb705a3bbef4da3018 SHA512 3753dab4281fa0fd5061a9b4231e6fceb567bf40ac89f3bc9b2f52164e21e1b6283d3e6bb48b72dc8dfb0c21a7567ef0661d1a820943c032bb3a6ebdff59c5c9 WHIRLPOOL d2e321e96a47335e02b72483e4ede94df63166fbfe851b7259043f0d23c48e45b212513abadeea8f4a52d43e99ab4e899b4aaaaad0348e406daa5300a3f7a505
+EBUILD llvm-3.6.2-r100.ebuild 7982 SHA256 966845070ac04a74c846935bf39c5fad48db47935a441420e0b9d1e15a6bbba2 SHA512 4a1673e289d67385d2971f367251e1e301e30be59d8931f2c73ed9ce6708fee0c993a11a243f134101f5e2fffb662cad09173791ad80a11e052c073ee6f48419 WHIRLPOOL 255219455c07ec065d9c23635929129a3281cde6decda7a87c0527d869f7b84ac1f2bd377e7320b87deaf544b21f26f41f7b219d3bb684207adf8020f2642159
+EBUILD llvm-3.7.1-r3.ebuild 16941 SHA256 4d4b12a9349082d0815fb802a9da38b344d71fa61f190ae7d0ee02c504c960d7 SHA512 5ca52835db5c31f58a98e642f0eadd411645ccf51780b45c752344c8d77e782b488b6043d1b932040458d9378981762ad4be81497fb34d8807dc6f0dd82a1857 WHIRLPOOL 6da5da9e61c14a9cef0d9f2173004bf2b9be7437fdbee43698b28e21d3b347c20dca9a87da274b7163d3ecb9c95c9e318b4da23958d27f36d42af9e38d3aeed2
+EBUILD llvm-3.8.1-r2.ebuild 17467 SHA256 1f81cc00e3aba219f33bfc599bec993db2c65c7e4f742ea29cf57ac1ffded638 SHA512 06422cb15fd1616c66127669bdaf9710c9bf81b5ddba850b99641b9921f732e6665bcb42dfff300e69df263686d48abe02b23bb5b1c8c22d525703d9ae849407 WHIRLPOOL 12d8eae00b3d20635470720169eb38c63490bfda60d2cbbb0b569079b71c4f33ac411916ba434865a985a0f10ebb08e435fd64d2aa61de33af3c45b6db1a0080
+EBUILD llvm-3.9.1-r1.ebuild 16490 SHA256 b2028283bab2b9ead67b4bb38fc45e8c301c2b101bc97148974a1b9e70726122 SHA512 7756549475e656155e7631c724b2f08d3c51c45127d2ae1f6f5eca9f9bd42107e8c2b90b3a002a944acc3f28365ac7058ad68698d1d91f11ed541b511c487e2d WHIRLPOOL 4bb34aafe2bc1761cb55db53db5c4fdae11bdc54cd6599857328d9cbfcef8a4e5f233391d3e2d63140ec643fd3dc6573eeec8cbc88000c0c072c52bc11fa00ea
+EBUILD llvm-4.0.1.ebuild 6794 SHA256 56f1d0ac2a81b238a6a335078fafc36e0e0317987b69145171f04c6956026e10 SHA512 ed7115ba42a53826fa60486ae25c9086697dae235bf2c448f34e925da17678769af0087ad8cf894fca68e74518f311a003eae3c0b8678a5056f00641f29b3ce5 WHIRLPOOL ea5b62bb4c834edb966a2e9a3f18d022e7738ee401aefcb77e57eb1d9db9972c07813b9a6f3619cb93b34a580e97d6f7e32af0d98ade95ee3c6c7c232d655e1d
+EBUILD llvm-5.0.0.ebuild 6786 SHA256 f28928961ccded2fe72ffa9f6f1c50a7c34afb6c0300b6813bfea7698ddc0621 SHA512 c965d5c7569677c5c46393011a38baa3377596744c8b814152fb1b293751a56d57fceb2dd1b4e61e5e6ddcda006c164e19a1957fc89835e1f98035c47af6ce49 WHIRLPOOL 59930261c8b46bb5db7f3f6a9d9959563a00b9bf1b42b75e7bfd12f780c84be6273f206f98e7f3581f03e5eb1ae430fb424de8f1619f209eb75ab616222f2442
+EBUILD llvm-5.0.9999.ebuild 6496 SHA256 f866b08ccddc189ace8d3e5bd4f070b9f6ea38fcfb10007b1f9415b9b67e3ffb SHA512 dfd4cc2c3fdd69a92bf4096095aaaecc1878ac474cad553db34fb421ebc9fdf5f87b9b18c2bb2cd1275a875c6dd13caea7dc016507f470959c74f53a572aa7a7 WHIRLPOOL 245c343c7072eff23c7c2c4e2c4e06328ab5353e254be630d5b583b7e102127831a923658686c876c64b32bad268575f1738c5e76fb97636ee929639e5c2c399
+EBUILD llvm-9999.ebuild 6833 SHA256 bfa3c3d891d755a4bc0ecdf2db5b6076be2762c0781679fd99658afc5814affc SHA512 112c5d35a525bb08cfd60f9b92023bc7b7d391c50c8b5ad84df8c7564814b6c3915826d345838e0ede41288cdc000ae268411666c8ac0a9f45a47d78bd378136 WHIRLPOOL 0f87be73213b480a02f384637b2e6db3578fec8d26a49935baca77ca4a929a9347c4c6bd47031181ea8091d93da0ee4d9ad3f222f7bfb0c34df71fa2b6d4be4a
+MISC ChangeLog 44039 SHA256 8baec74338dcf46c8f9e7c7506741bd786c17061a6ee8b0a0b0c4578dfc01365 SHA512 73a2efe8a3e9de1e3333aff6d914ad055294262888c4460ed470e08a5f3a7b9e160448b4835c803fd92c704e4832f9bc91122038c8c36f5f947fd62b6e48e7b8 WHIRLPOOL 7157a12efb77e2e4b34ee3cd7c54dcbfa789cb442dc2cee45c1c595ed3d64a6ba74e9a8b6651e32136accb98b8da6f284a00f178c8f3bb3f22801c6b190145d1
+MISC ChangeLog-2015 43796 SHA256 ecefaa7b76b23b8a297c152b9a997690e4421ceae10191fe8f32728529efafd3 SHA512 2dc035d9ea0ba8bb2f3db1242ca2f92e156f869d1b047f2cc306f8a8e85a6e30ead5734d0a85fd34bb04a5f405f3b3a4e8a9ade18878c3e7280b38855df34aca WHIRLPOOL cfd7e1f53f6a8d61bb2e3fe7386d08e9b519e9c74b736de38616ee6057ee86c53ffa36377dc6e7da2142b688e8877ae6da7e869d9f3a54bfbf4b756024674bf7
+MISC metadata.xml 2755 SHA256 8f607ddf2ddd552822cf5e5ff134bdd76d40fb04e29279b741664b2e110bcbf5 SHA512 69ab0854bb2cbbbea8b4a19510bf3c0505558403974f55f3ee74882880b6259f574b6750f122dc9dcd7fc0da246bde960f6a9ffc652ee0a5e1823c24276cc6d7 WHIRLPOOL de86a991cda215c813f6867a087fbe1344134f02ea1bb20f387c5f57f3287f7d2c05a3987be7090bdcbc118dc9b1f67e7fb092e123169ac49b632496116e92a7
diff --git a/sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch b/sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
new file mode 100644
index 000000000000..5def55d38fcc
--- /dev/null
+++ b/sys-devel/llvm/files/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
@@ -0,0 +1,54 @@
+From 628b899be14a6bab4b32dbd53aabd447dcc16cb7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Sat, 20 Aug 2016 23:47:41 +0200
+Subject: [PATCH] llvm-config: Clean up exported values, update for shared
+ linking
+
+Gentoo-specific fixup for llvm-config, including:
+- wiping build-specific CFLAGS, CXXFLAGS,
+- making --src-root return invalid path (/dev/null).
+
+Thanks to Steven Newbury for the initial patch.
+
+Bug: https://bugs.gentoo.org/565358
+Bug: https://bugs.gentoo.org/501684
+
+diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
+index 744fa4e44d1..593788aaef3 100644
+--- a/tools/llvm-config/CMakeLists.txt
++++ b/tools/llvm-config/CMakeLists.txt
+@@ -32,8 +32,12 @@ get_property(COMPILE_FLAGS TARGET llvm-config PROPERTY COMPILE_FLAGS)
+ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
+ set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
+ set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+-set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+-set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
++# Just use CMAKE_CPP_FLAGS for CFLAGS and CXXFLAGS, otherwise compiler
++# specific flags will be set when we don't know what compiler will be used
++# with external project utilising llvm-config. C++ Standard is required.
++# TODO: figure out if we can remove -std=c++11 and move it to revdeps.
++set(LLVM_CFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
++set(LLVM_CXXFLAGS "${CMAKE_CPP_FLAGS} -std=c++11 ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+ set(LLVM_BUILD_SYSTEM cmake)
+ set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
+ set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}")
+diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp
+index d780094861c..c61c72ff48c 100644
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -549,7 +550,11 @@ int main(int argc, char **argv) {
+ } else if (Arg == "--obj-root") {
+ OS << ActivePrefix << '\n';
+ } else if (Arg == "--src-root") {
+- OS << LLVM_SRC_ROOT << '\n';
++ if (IsInDevelopmentTree) {
++ OS << LLVM_SRC_ROOT << '\n';
++ } else {
++ OS << "/dev/null\n";
++ }
+ } else if (Arg == "--ignore-libllvm") {
+ LinkDyLib = false;
+ LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto;
+--
+2.11.0
+
diff --git a/sys-devel/llvm/files/9999/musl-fixes.patch b/sys-devel/llvm/files/9999/musl-fixes.patch
new file mode 100644
index 000000000000..5c516534abc1
--- /dev/null
+++ b/sys-devel/llvm/files/9999/musl-fixes.patch
@@ -0,0 +1,33 @@
+diff --git a/include/llvm/Analysis/TargetLibraryInfo.def b/include/llvm/Analysis/TargetLibraryInfo.def
+index 7798e3c..ade2b96 100644
+--- a/include/llvm/Analysis/TargetLibraryInfo.def
++++ b/include/llvm/Analysis/TargetLibraryInfo.def
+@@ -27,6 +27,15 @@
+ #define TLI_DEFINE_STRING_INTERNAL(string_repr) string_repr,
+ #endif
+
++// avoid name conflicts with musl-libc
++#undef fopen64
++#undef fseeko64
++#undef ftello64
++#undef fstat64
++#undef lstat64
++#undef stat64
++#undef tmpfile64
++
+ /// void *new(unsigned int);
+ TLI_DEFINE_ENUM_INTERNAL(msvc_new_int)
+ TLI_DEFINE_STRING_INTERNAL("??2@YAPAXI@Z")
+diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp
+index 9a7aeb5..e98ad80 100644
+--- a/lib/Support/DynamicLibrary.cpp
++++ b/lib/Support/DynamicLibrary.cpp
+@@ -143,7 +143,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
+ // On linux we have a weird situation. The stderr/out/in symbols are both
+ // macros and global variables because of standards requirements. So, we
+ // boldly use the EXPLICIT_SYMBOL macro without checking for a #define first.
+-#if defined(__linux__) and !defined(__ANDROID__)
++#if defined(__linux__) && defined(__GLIBC__)
+ {
+ EXPLICIT_SYMBOL(stderr);
+ EXPLICIT_SYMBOL(stdout);
diff --git a/sys-devel/llvm/llvm-3.4.2-r100.ebuild b/sys-devel/llvm/llvm-3.4.2-r100.ebuild
new file mode 100644
index 000000000000..c533ef6f68e8
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.4.2-r100.ebuild
@@ -0,0 +1,256 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils check-reqs flag-o-matic multilib pax-utils prefix \
+ python-any-r1 toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.gz
+ clang? ( https://llvm.org/releases/3.4/compiler-rt-3.4.src.tar.gz
+ https://llvm.org/releases/${PV}/cfe-${PV}.src.tar.gz )
+ https://dev.gentoo.org/~mgorny/dist/llvm/${PN}-3.4-manpages.tar.bz2
+ https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.gz"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend (disabled): ARM.
+# 3. MD5 code: public-domain.
+# 4. autoconf (not installed): some undefined M.I.T. license.
+# 5. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain"
+SLOT="0/3.4"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang +libffi"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ libffi? ( >=virtual/libffi-3.0.13-r1:0= )"
+DEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-apple-4.2.1 >=sys-devel/llvm-3.3 )
+ >=sys-devel/binutils-apple-5.1
+ libffi? ( virtual/pkgconfig )
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-${PV}-r99
+ !>=sys-devel/clang-9999 )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
+
+S=${WORKDIR}/${P}.src
+
+check_space() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if is-flagq '-g?(gdb)?([1-9])'; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ local CHECKREQS_DISK_BUILD=${build_size}M
+ check-reqs_pkg_pretend
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+}
+
+src_unpack() {
+ default
+
+ rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \
+ || die "symlinks removal failed"
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-3.4 "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ fi
+}
+
+src_prepare() {
+ epatch "${WORKDIR}/${P}-patchset"/nodoctargz.patch
+ epatch "${WORKDIR}/${P}-patchset"/gentoo-install.patch
+
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ epatch "${WORKDIR}/${P}-patchset"/clang/gentoo-runtime-gcc-detection-v3.patch
+
+ epatch "${WORKDIR}/${P}-patchset"/clang/gentoo-install.patch
+ epatch "${WORKDIR}/${P}-patchset"/clang/darwin_build_fix.patch
+ epatch "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
+ eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+ fi
+
+ if use prefix && use clang; then
+ sed -i -e "/^CFLAGS /s@-Werror@-I${EPREFIX}/usr/include@" \
+ projects/compiler-rt/make/platform/clang_*.mk || die
+ fi
+
+ local sub_files=(
+ Makefile.config.in
+ Makefile.rules
+ tools/llvm-config/llvm-config.cpp
+ )
+ use clang && sub_files+=(
+ tools/clang/lib/Driver/Tools.cpp
+ tools/clang/tools/scan-build/scan-build
+ )
+
+ # unfortunately ./configure won't listen to --mandir and the-like, so take
+ # care of this.
+ # note: we're setting the main libdir intentionally.
+ # where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make.
+ einfo "Fixing install dirs"
+ sed -e "s,@libdir@,$(get_libdir),g" \
+ -e "s,@PF@,${PF},g" \
+ -e "s,@EPREFIX@,${EPREFIX},g" \
+ -i "${sub_files[@]}" \
+ || die "install paths sed failed"
+
+ if use clang; then
+ # constantly fails for a long time, likely due to our patches
+ rm tools/clang/test/Driver/cross-linux.c || die
+ fi
+
+ # User patches
+ epatch_user
+
+ python_setup
+}
+
+src_configure() {
+ # disable timestamps since they confuse ccache
+ local conf_flags=(
+ --disable-timestamps
+ --enable-keep-symbols
+ --enable-shared
+ --with-optimize-option=
+ --enable-optimized
+ --disable-assertions
+ --disable-expensive-checks
+ --disable-terminfo
+ $(use_enable libffi)
+
+ --enable-bindings=none
+ --enable-targets=host
+
+ ac_cv_prog_XML2CONFIG=""
+ )
+
+ if use libffi; then
+ local CPPFLAGS=${CPPFLAGS}
+ append-cppflags "$($(tc-getPKG_CONFIG) --cflags libffi)"
+ fi
+
+ # llvm prefers clang over gcc, so we may need to force that
+ tc-export CC CXX
+
+ ECONF_SOURCE=${S} \
+ econf "${conf_flags[@]}"
+}
+
+src_compile() {
+ LLVM_MAKEARGS=(
+ VERBOSE=1
+ REQUIRES_RTTI=1
+ GENTOO_LIBDIR=$(get_libdir)
+ )
+
+ emake "${LLVM_MAKEARGS[@]}"
+
+ pax-mark m Release/bin/llvm-rtdyld
+ pax-mark m Release/bin/lli
+ pax-mark m Release/bin/lli-child-target
+}
+
+src_install() {
+ emake "${LLVM_MAKEARGS[@]}" DESTDIR="${D}" install
+
+ if ! use clang; then
+ rm "${WORKDIR}"/${PN}-3.4-manpages/clang.1 || die
+ else
+ for tool in clang{,++} ; do
+ dosym ${tool} /usr/bin/${CHOST}-${tool}
+ done
+ fi
+ doman "${WORKDIR}"/${PN}-3.4-manpages/*.1
+
+ # Fix install_names on Darwin. The build system is too complicated
+ # to just fix this, so we correct it post-install
+ local lib= f= odylib= ndylib= libpv=${PV}
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ eval $(grep PACKAGE_VERSION= configure)
+ [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
+ libpvminor=${libpv%.[0-9]*}
+ for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib BugpointPasses.dylib clang/${libpv}/lib/darwin/libclang_rt.asan_{osx,iossim}_dynamic.dylib; do
+ # libEnhancedDisassembly is Darwin10 only, so non-fatal
+ # + omit clang libs if not enabled
+ [[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+ ebegin "fixing install_name of $lib"
+ install_name_tool \
+ -id "${EPREFIX}"/usr/lib/${lib} \
+ "${ED}"/usr/lib/${lib}
+ eend $?
+ done
+ for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib*.dylib "${ED}"/usr/lib/clang/${libpv}/lib/darwin/*.dylib ; do
+ # omit clang libs if not enabled
+ [[ -f "${f}" ]] || continue
+
+ scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | \
+ while read odylib ; do
+ ndylib=
+ case ${odylib} in
+ */libclang.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libclang.dylib
+ ;;
+ */libLLVM-${libpv}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib
+ ;;
+ */libLLVM-${libpvminor}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpvminor}.dylib
+ ;;
+ */libLTO.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLTO.dylib
+ ;;
+ esac
+ if [[ -n ${ndylib} ]] ; then
+ ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
+ install_name_tool \
+ -change "${odylib}" "${ndylib}" \
+ "${f}"
+ eend $?
+ fi
+ done
+ done
+ fi
+}
diff --git a/sys-devel/llvm/llvm-3.5.2-r100.ebuild b/sys-devel/llvm/llvm-3.5.2-r100.ebuild
new file mode 100644
index 000000000000..fc7b03e22ba8
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.5.2-r100.ebuild
@@ -0,0 +1,276 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils check-reqs flag-o-matic multilib pax-utils prefix \
+ python-any-r1 toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz
+ clang? ( https://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+ https://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz )
+ https://dev.gentoo.org/~voyageur/distfiles/${PN}-3.5.0-manpages.tar.bz2
+ https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.gz"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. autoconf (not installed): some undefined M.I.T. license.
+# 5. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain"
+SLOT="0/3.5"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang +libffi"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ libffi? ( >=virtual/libffi-3.0.13-r1:0= )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-apple-4.2.1 >=sys-devel/llvm-3.3 )
+ >=sys-devel/binutils-apple-5.1
+ libffi? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-${PV}-r99
+ !>=sys-devel/clang-9999 )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
+
+S=${WORKDIR}/${P}.src
+
+check_space() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if is-flagq '-g?(gdb)?([1-9])'; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ local CHECKREQS_DISK_BUILD=${build_size}M
+ check-reqs_pkg_pretend
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ echo 'int main() {return 0;}' > "${T}"/test.cxx || die
+ ebegin "Trying to build a C++11 test program"
+ if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then
+ eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler"
+ eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+ eerror "to gcc-4.7 or an equivalent version supporting C++11."
+ die "Currently active compiler does not support -std=c++11"
+ fi
+ eend ${?}
+ fi
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+}
+
+src_unpack() {
+ default
+
+ rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \
+ || die "symlinks removal failed"
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-${PV}.src "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ fi
+}
+
+src_prepare() {
+ epatch "${WORKDIR}/${P}-patchset"/nodoctargz.patch
+ epatch "${WORKDIR}/${P}-patchset"/gcc-4.9.patch
+ epatch "${WORKDIR}/${P}-patchset"/gentoo-install.patch
+ epatch "${WORKDIR}/${P}-patchset"/gcc-5.1.patch
+
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ epatch "${WORKDIR}/${P}-patchset"/clang/gentoo-runtime-gcc-detection-v3.patch
+
+ epatch "${WORKDIR}/${P}-patchset"/clang/gentoo-install.patch
+ epatch "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
+ eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+ fi
+
+ if use prefix && use clang; then
+ sed -i -e "/^CFLAGS /s@-Werror@-I${EPREFIX}/usr/include@" \
+ projects/compiler-rt/make/platform/clang_*.mk || die
+ fi
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ local sub_files=(
+ Makefile.config.in
+ Makefile.rules
+ tools/llvm-config/llvm-config.cpp
+ )
+ use clang && sub_files+=(
+ tools/clang/lib/Driver/Tools.cpp
+ tools/clang/tools/scan-build/scan-build
+ )
+
+ # unfortunately ./configure won't listen to --mandir and the-like, so take
+ # care of this.
+ # note: we're setting the main libdir intentionally.
+ # where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make.
+ einfo "Fixing install dirs"
+ sed -e "s,@libdir@,$(get_libdir),g" \
+ -e "s,@PF@,${PF},g" \
+ -e "s,@EPREFIX@,${EPREFIX},g" \
+ -i "${sub_files[@]}" \
+ || die "install paths sed failed"
+
+ if use clang; then
+ # constantly fails for a long time, likely due to our patches
+ rm tools/clang/test/Driver/cross-linux.c || die
+ fi
+
+ # User patches
+ epatch_user
+
+ python_setup
+}
+
+src_configure() {
+ # disable timestamps since they confuse ccache
+ local conf_flags=(
+ --disable-timestamps
+ --enable-keep-symbols
+ --enable-shared
+ --with-optimize-option=
+ --enable-optimized
+ --disable-assertions
+ --disable-expensive-checks
+ --disable-libedit
+ --disable-terminfo
+ $(use_enable libffi)
+
+ --enable-bindings=none
+ --enable-targets=host
+
+ ac_cv_prog_XML2CONFIG=""
+ )
+
+ if use libffi; then
+ local CPPFLAGS=${CPPFLAGS}
+ append-cppflags "$($(tc-getPKG_CONFIG) --cflags libffi)"
+ fi
+
+ # llvm prefers clang over gcc, so we may need to force that
+ tc-export CC CXX
+
+ ECONF_SOURCE=${S} \
+ econf "${conf_flags[@]}"
+}
+
+src_compile() {
+ LLVM_MAKEARGS=(
+ VERBOSE=1
+ REQUIRES_RTTI=1
+ GENTOO_LIBDIR=$(get_libdir)
+ )
+
+ emake "${LLVM_MAKEARGS[@]}"
+
+ pax-mark m Release/bin/llvm-rtdyld
+ pax-mark m Release/bin/lli
+ pax-mark m Release/bin/lli-child-target
+}
+
+src_install() {
+ emake "${LLVM_MAKEARGS[@]}" DESTDIR="${D}" install
+
+ if ! use clang; then
+ rm "${WORKDIR}"/${PN}-3.5.0-manpages/clang.1 || die
+ else
+ for tool in clang{,++} ; do
+ dosym ${tool} /usr/bin/${CHOST}-${tool}
+ done
+ fi
+ doman "${WORKDIR}"/${PN}-3.5.0-manpages/*.1
+
+ # Fix install_names on Darwin. The build system is too complicated
+ # to just fix this, so we correct it post-install
+ local lib= f= odylib= ndylib= libpv=${PV}
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ eval $(grep PACKAGE_VERSION= configure)
+ [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
+ libpvminor=${libpv%.[0-9]*}
+ for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib clang/${libpv}/lib/darwin/libclang_rt.asan_{osx,iossim}_dynamic.dylib; do
+ # libEnhancedDisassembly is Darwin10 only, so non-fatal
+ # + omit clang libs if not enabled
+ [[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+ ebegin "fixing install_name of $lib"
+ install_name_tool \
+ -id "${EPREFIX}"/usr/lib/${lib} \
+ "${ED}"/usr/lib/${lib}
+ eend $?
+ done
+ for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib*.dylib "${ED}"/usr/lib/clang/${libpv}/lib/darwin/*.dylib ; do
+ # omit clang libs if not enabled
+ [[ -f "${f}" ]] || continue
+
+ scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | \
+ while read odylib ; do
+ ndylib=
+ case ${odylib} in
+ */libclang.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libclang.dylib
+ ;;
+ */libLLVM-${libpv}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib
+ ;;
+ */libLLVM-${libpvminor}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpvminor}.dylib
+ ;;
+ */libLTO.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLTO.dylib
+ ;;
+ esac
+ if [[ -n ${ndylib} ]] ; then
+ ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
+ install_name_tool \
+ -change "${odylib}" "${ndylib}" \
+ "${f}"
+ eend $?
+ fi
+ done
+ done
+ fi
+}
diff --git a/sys-devel/llvm/llvm-3.6.2-r100.ebuild b/sys-devel/llvm/llvm-3.6.2-r100.ebuild
new file mode 100644
index 000000000000..c84af618ae08
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.6.2-r100.ebuild
@@ -0,0 +1,280 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils check-reqs flag-o-matic multilib pax-utils prefix \
+ python-any-r1 toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz
+ clang? ( https://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+ https://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz )
+ https://dev.gentoo.org/~voyageur/distfiles/${PN}-3.6.1-manpages.tar.bz2
+ https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.gz"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. autoconf (not installed): some undefined M.I.T. license.
+# 5. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain"
+SLOT="0/3.6"
+KEYWORDS="~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang +libffi"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ libffi? ( >=virtual/libffi-3.0.13-r1:0= )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+ app-arch/xz-utils
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-apple-4.2.1 >=sys-devel/llvm-3.3 )
+ >=sys-devel/binutils-apple-5.1
+ libffi? ( virtual/pkgconfig )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-${PV}-r99
+ !>=sys-devel/clang-9999 )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )"
+
+S=${WORKDIR}/${P}.src
+
+check_space() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if is-flagq '-g?(gdb)?([1-9])'; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ local CHECKREQS_DISK_BUILD=${build_size}M
+ check-reqs_pkg_pretend
+
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ echo 'int main() {return 0;}' > "${T}"/test.cxx || die
+ ebegin "Trying to build a C++11 test program"
+ if ! $(tc-getCXX) -std=c++11 -o /dev/null "${T}"/test.cxx; then
+ eerror "LLVM-${PV} requires C++11-capable C++ compiler. Your current compiler"
+ eerror "does not seem to support -std=c++11 option. Please upgrade your compiler"
+ eerror "to gcc-4.7 or an equivalent version supporting C++11."
+ die "Currently active compiler does not support -std=c++11"
+ fi
+ eend ${?}
+ fi
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+}
+
+src_unpack() {
+ default
+
+ rm -f "${S}"/tools/clang "${S}"/projects/compiler-rt \
+ || die "symlinks removal failed"
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ fi
+}
+
+src_prepare() {
+ epatch "${WORKDIR}/${P}-patchset"/nodoctargz.patch
+ epatch "${WORKDIR}/${P}-patchset"/gcc-4.9.patch
+ epatch "${WORKDIR}/${P}-patchset"/gentoo-install.patch
+
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ epatch "${WORKDIR}/${P}-patchset"/clang/gentoo-runtime-gcc-detection-v3.patch
+
+ epatch "${WORKDIR}/${P}-patchset"/clang/gentoo-install.patch
+ epatch "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
+ eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+
+ # Fix build fails with using gcc-4.9 on Gentoo/FreeBSD, bug #548444
+ epatch "${WORKDIR}/${P}-patchset"/clang/fbsd-gcc49.patch
+ fi
+
+ if use prefix && use clang; then
+ sed -i -e "/^CFLAGS /s@-Werror@-I${EPREFIX}/usr/include@" \
+ projects/compiler-rt/make/platform/clang_*.mk || die
+ fi
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ local sub_files=(
+ Makefile.config.in
+ Makefile.rules
+ tools/llvm-config/llvm-config.cpp
+ )
+ use clang && sub_files+=(
+ tools/clang/lib/Driver/Tools.cpp
+ tools/clang/tools/scan-build/scan-build
+ )
+
+ # unfortunately ./configure won't listen to --mandir and the-like, so take
+ # care of this.
+ # note: we're setting the main libdir intentionally.
+ # where per-ABI is appropriate, we use $(GENTOO_LIBDIR) make.
+ einfo "Fixing install dirs"
+ sed -e "s,@libdir@,$(get_libdir),g" \
+ -e "s,@PF@,${PF},g" \
+ -e "s,@EPREFIX@,${EPREFIX},g" \
+ -i "${sub_files[@]}" \
+ || die "install paths sed failed"
+
+ if use clang; then
+ # constantly fails for a long time, likely due to our patches
+ rm tools/clang/test/Driver/cross-linux.c || die
+ fi
+
+ # User patches
+ epatch_user
+
+ python_setup
+}
+
+src_configure() {
+ # disable timestamps since they confuse ccache
+ local conf_flags=(
+ --disable-timestamps
+ --enable-keep-symbols
+ --enable-shared
+ --with-optimize-option=
+ --enable-optimized
+ --disable-assertions
+ --disable-expensive-checks
+ --disable-libedit
+ --disable-terminfo
+ $(use_enable libffi)
+
+ --enable-bindings=none
+ --enable-targets=host
+
+ ac_cv_prog_XML2CONFIG=""
+ )
+
+ if use libffi; then
+ local CPPFLAGS=${CPPFLAGS}
+ append-cppflags "$($(tc-getPKG_CONFIG) --cflags libffi)"
+ fi
+
+ # Enable large file support, bug #550708
+ append-lfs-flags
+ # llvm prefers clang over gcc, so we may need to force that
+ tc-export CC CXX
+
+ ECONF_SOURCE=${S} \
+ econf "${conf_flags[@]}"
+}
+
+src_compile() {
+ LLVM_MAKEARGS=(
+ VERBOSE=1
+ REQUIRES_RTTI=1
+ GENTOO_LIBDIR=$(get_libdir)
+ )
+
+ emake "${LLVM_MAKEARGS[@]}"
+
+ pax-mark m Release/bin/llvm-rtdyld
+ pax-mark m Release/bin/lli
+ pax-mark m Release/bin/lli-child-target
+}
+
+src_install() {
+ emake "${LLVM_MAKEARGS[@]}" DESTDIR="${D}" install
+
+ if ! use clang; then
+ rm "${WORKDIR}"/${PN}-3.6.1-manpages/clang.1 || die
+ else
+ for tool in clang{,++} ; do
+ dosym ${tool} /usr/bin/${CHOST}-${tool}
+ done
+ fi
+ doman "${WORKDIR}"/${PN}-3.6.1-manpages/*.1
+
+ # Fix install_names on Darwin. The build system is too complicated
+ # to just fix this, so we correct it post-install
+ local lib= f= odylib= ndylib= libpv=${PV}
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ eval $(grep PACKAGE_VERSION= configure)
+ [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION}
+ libpvminor=${libpv%.[0-9]*}
+ for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib clang/${libpv}/lib/darwin/libclang_rt.asan_{osx,iossim}_dynamic.dylib; do
+ # libEnhancedDisassembly is Darwin10 only, so non-fatal
+ # + omit clang libs if not enabled
+ [[ -f ${ED}/usr/lib/${lib} ]] || continue
+
+ ebegin "fixing install_name of $lib"
+ install_name_tool \
+ -id "${EPREFIX}"/usr/lib/${lib} \
+ "${ED}"/usr/lib/${lib}
+ eend $?
+ done
+ for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/lib*.dylib "${ED}"/usr/lib/clang/${libpv}/lib/darwin/*.dylib ; do
+ # omit clang libs if not enabled
+ [[ -f "${f}" ]] || continue
+
+ scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | \
+ while read odylib ; do
+ ndylib=
+ case ${odylib} in
+ */libclang.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libclang.dylib
+ ;;
+ */libLLVM-${libpv}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpv}.dylib
+ ;;
+ */libLLVM-${libpvminor}.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLLVM-${libpvminor}.dylib
+ ;;
+ */libLTO.dylib)
+ ndylib="${EPREFIX}"/usr/lib/libLTO.dylib
+ ;;
+ esac
+ if [[ -n ${ndylib} ]] ; then
+ ebegin "fixing install_name reference to ${odylib} of ${f##*/}"
+ install_name_tool \
+ -change "${odylib}" "${ndylib}" \
+ "${f}"
+ eend $?
+ fi
+ done
+ done
+ fi
+}
diff --git a/sys-devel/llvm/llvm-3.7.1-r3.ebuild b/sys-devel/llvm/llvm-3.7.1-r3.ebuild
new file mode 100644
index 000000000000..a443825a626c
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.7.1-r3.ebuild
@@ -0,0 +1,573 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils eutils flag-o-matic multilib \
+ multilib-minimal python-single-r1 toolchain-funcs pax-utils prefix
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz
+ clang? ( https://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+ https://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
+ https://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
+ lldb? ( https://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
+ !doc? ( https://dev.gentoo.org/~voyageur/distfiles/${PN}-3.7.0-manpages.tar.bz2 )
+ https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.gz"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. autoconf (not used): some undefined M.I.T. license.
+# 5. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain
+ arm? ( LLVM-Grant )
+ arm64? ( LLVM-Grant )
+ multitarget? ( LLVM-Grant )"
+SLOT="0/${PV}"
+KEYWORDS="amd64 arm ~arm64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang debug doc gold libedit +libffi lldb multitarget ncurses ocaml
+ python +static-analyzer test xml video_cards_radeon
+ kernel_Darwin kernel_FreeBSD"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ clang? (
+ python? ( ${PYTHON_DEPS} )
+ static-analyzer? (
+ dev-lang/perl:*
+ ${PYTHON_DEPS}
+ )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ )
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ ocaml? (
+ >=dev-lang/ocaml-4.00.0:0=
+ dev-ml/findlib
+ dev-ml/ocaml-ctypes
+ !!<=sys-devel/llvm-3.7.0-r1[ocaml] )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+ clang? ( xml? ( virtual/pkgconfig ) )
+ doc? ( dev-python/sphinx )
+ gold? ( sys-libs/binutils-libs )
+ libffi? ( virtual/pkgconfig )
+ lldb? ( dev-lang/swig )
+ !!<dev-python/configparser-3.3.0.2
+ ocaml? ( test? ( dev-ml/ounit ) )
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-${PV}-r99 )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )
+ kernel_Darwin? ( =sys-libs/libcxx-${PV}* )"
+
+# pypy gives me around 1700 unresolved tests due to open file limit
+# being exceeded. probably GC does not close them fast enough.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ lldb? ( clang xml )"
+
+S=${WORKDIR}/${P/_}.src
+
+check_space() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if use debug; then
+ ewarn "USE=debug is known to increase the size of package considerably"
+ ewarn "and cause the tests to fail."
+ ewarn
+
+ (( build_size *= 14 ))
+ elif is-flagq '-g?(gdb)?([1-9])'; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ # Multiply by number of ABIs :).
+ local abis=( $(multilib_get_enabled_abis) )
+ (( build_size *= ${#abis[@]} ))
+
+ local CHECKREQS_DISK_BUILD=${build_size}M
+ check-reqs_pkg_pretend
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+}
+
+src_unpack() {
+ default
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
+ || die "clang-tools-extra source directory move failed"
+ fi
+
+ if use lldb; then
+ mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \
+ || die "lldb source directory move failed"
+ fi
+}
+
+src_prepare() {
+ python_setup
+
+ # Make ocaml warnings non-fatal, bug #537308
+ sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die
+ # Fix libdir for ocaml bindings install, bug #559134
+ eapply "${WORKDIR}/${P}-patchset"/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
+ # Do not build/install ocaml docs with USE=-doc, bug #562008
+ eapply "${WORKDIR}/${P}-patchset"/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
+
+ # Make it possible to override Sphinx HTML install dirs
+ # https://llvm.org/bugs/show_bug.cgi?id=23780
+ eapply "${WORKDIR}/${P}-patchset"/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
+
+ # Prevent race conditions with parallel Sphinx runs
+ # https://llvm.org/bugs/show_bug.cgi?id=23781
+ eapply "${WORKDIR}/${P}-patchset"/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
+
+ # Prevent installing libgtest
+ # https://llvm.org/bugs/show_bug.cgi?id=18341
+ eapply "${WORKDIR}/${P}-patchset"/0005-cmake-Do-not-install-libgtest.patch
+
+ # Fix llvm-config for shared linking, sane flags and return values
+ # in order:
+ # - backported r247159 that adds --build-system (needed for later code)
+ # - backported r252532 that adds better shared linking support
+ # - our fixes
+ # - backported r260343 that fixes cross-compilation
+ # combination of backported upstream r252532 with our patch
+ # https://bugs.gentoo.org/show_bug.cgi?id=565358
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-0.patch
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-1.patch
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-2.patch
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-3.patch
+
+ # Fix msan with newer kernels, #569894
+ eapply "${WORKDIR}/${P}-patchset"/msan-fix.patch
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ eapply "${WORKDIR}/${P}-patchset"/clang/gentoo-runtime-gcc-detection-v3.patch
+
+ # Support gcc4.9 search paths
+ # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
+ eapply "${WORKDIR}/${P}-patchset"/clang/gcc4.9-search-path.patch
+
+ eapply "${WORKDIR}/${P}-patchset"/clang/gentoo-install.patch
+
+ eapply "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
+ eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+
+ # Fix -isystem support in ccc-analyzer
+ eapply "${WORKDIR}/${P}-patchset"/clang/ccc-analyzer-isystem.patch
+
+ sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
+ tools/clang/tools/scan-build/scan-build || die
+
+ # Install clang runtime into /usr/lib/clang
+ # https://llvm.org/bugs/show_bug.cgi?id=23792
+ eapply "${WORKDIR}/${P}-patchset"/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
+
+ # Do not force -march flags on arm platforms
+ # https://bugs.gentoo.org/show_bug.cgi?id=562706
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/arm_march_flags.patch
+
+ # Make it possible to override CLANG_LIBDIR_SUFFIX
+ # (that is used only to find LLVMgold.so)
+ # https://llvm.org/bugs/show_bug.cgi?id=23793
+ eapply "${WORKDIR}/${P}-patchset"/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
+
+ # Fix git-clang-format shebang, bug #562688
+ python_fix_shebang tools/clang/tools/clang-format/git-clang-format
+
+ pushd projects/compiler-rt >/dev/null || die
+
+ # Fix msan with newer kernels, compiler-rt part, #569894
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/msan-fix.patch
+
+ # Fix WX sections, bug #421527
+ find lib/builtins -type f -name '*.S' -exec sed \
+ -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
+ -i {} + || die
+
+ popd >/dev/null || die
+ fi
+
+ if use lldb; then
+ # Do not install dummy readline.so module from
+ # https://llvm.org/bugs/show_bug.cgi?id=18841
+ sed -e 's/add_subdirectory(readline)/#&/' \
+ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
+
+ # Fix Python paths, bugs #562436 and #562438
+ eapply "${WORKDIR}/${P}-patchset"/lldb/python.patch
+ sed -e "s/GENTOO_LIBDIR/$(get_libdir)/" \
+ -i tools/lldb/scripts/Python/finishSwigPythonLLDB.py || die
+
+ # Fix build with ncurses[tinfo], #560474
+ # https://llvm.org/viewvc/llvm-project?view=revision&revision=247842
+ eapply "${WORKDIR}/${P}-patchset"/lldb/tinfo.patch
+ fi
+
+ # User patches
+ eapply_user
+
+ # Native libdir is used to hold LLVMgold.so
+ NATIVE_LIBDIR=$(get_libdir)
+}
+
+multilib_src_configure() {
+ local targets
+ if use multitarget; then
+ targets=all
+ else
+ targets='host;BPF;CppBackend'
+ use video_cards_radeon && targets+=';AMDGPU'
+ fi
+
+ local ffi_cflags ffi_ldflags
+ if use libffi; then
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_ENABLE_TIMESTAMPS=OFF
+ -DLLVM_TARGETS_TO_BUILD="${targets}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DWITH_POLLY=OFF # TODO
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -DHAVE_HISTEDIT_H=$(usex libedit)
+ )
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+ )
+ fi
+
+ if use lldb; then
+ mycmakeargs+=(
+ -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+ -DLLDB_DISABLE_CURSES=$(usex !ncurses)
+ -DLLDB_ENABLE_TERMINFO=$(usex ncurses)
+ )
+ fi
+
+ if ! multilib_is_native_abi || ! use ocaml; then
+ mycmakeargs+=(
+ -DOCAMLFIND=NO
+ )
+ fi
+# Note: go bindings have no CMake rules at the moment
+# but let's kill the check in case they are introduced
+# if ! multilib_is_native_abi || ! use go; then
+ mycmakeargs+=(
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+ )
+# fi
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=$(usex doc)
+ -DLLVM_ENABLE_SPHINX=$(usex doc)
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
+ )
+ fi
+
+ if use gold; then
+ mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ if use lldb; then
+ mycmakeargs+=(
+ -DLLDB_DISABLE_PYTHON=$(usex !python)
+ )
+ fi
+
+ else
+ if use clang; then
+ mycmakeargs+=(
+ # disable compiler-rt on non-native ABI because:
+ # 1. it fails to configure because of -m32
+ # 2. it is shared between ABIs so no point building
+ # it multiple times
+ -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+ if use lldb; then
+ mycmakeargs+=(
+ # only run swig on native abi
+ -DLLDB_DISABLE_PYTHON=ON
+ )
+ fi
+ fi
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
+ )
+
+ # -- not needed when compiler-rt is built with host compiler --
+ # cmake passes host C*FLAGS to compiler-rt build
+ # which is performed using clang, so we need to filter out
+ # some flags clang does not support
+ # (if you know some more flags that don't work, let us know)
+ #filter-flags -msahf -frecord-gcc-switches
+ fi
+
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+ # TODO: not sure why this target is not correctly called
+ multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc
+
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+ pax-mark m "${BUILD_DIR}"/bin/lli
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+ if use test; then
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check )
+ # clang tests won't work on non-native ABI because we skip compiler-rt
+ multilib_is_native_abi && use clang && test_targets+=( check-clang )
+ cmake-utils_src_make "${test_targets[@]}"
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/config.h
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ if use clang; then
+ # note: magic applied in multilib_src_install()!
+ CLANG_VERSION=${PV%.*}
+
+ MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/clang
+ /usr/bin/clang++
+ /usr/bin/clang-cl
+ /usr/bin/clang-${CLANG_VERSION}
+ /usr/bin/clang++-${CLANG_VERSION}
+ /usr/bin/clang-cl-${CLANG_VERSION}
+ )
+
+ MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/clang/Config/config.h
+ )
+ fi
+
+ multilib-minimal_src_install
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ if use kernel_FreeBSD && use clang; then
+ rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
+ fi
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ if multilib_is_native_abi; then
+ # Install man pages.
+ use doc || doman "${WORKDIR}"/${PN}-3.7.0-manpages/*.1
+
+ # Symlink the gold plugin.
+ if use gold; then
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+ dosym "../../../../$(get_libdir)/LLVMgold.so" \
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+ fi
+ fi
+
+ # apply CHOST and CLANG_VERSION to clang executables
+ # they're statically linked so we don't have to worry about the lib
+ if use clang; then
+ local clang_tools=( clang clang++ clang-cl )
+ local i
+
+ # cmake gives us:
+ # - clang-X.Y
+ # - clang -> clang-X.Y
+ # - clang++, clang-cl -> clang
+ # we want to have:
+ # - clang-X.Y
+ # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y
+ # - clang, clang++, clang-cl -> clang*-X.Y
+ # so we need to fix the two tools
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED%/}/usr/bin/${i}" || die
+ dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}"
+ dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}"
+ done
+
+ # now prepend ${CHOST} and let the multilib-build.eclass symlink it
+ if ! multilib_is_native_abi; then
+ # non-native? let's replace it with a simple wrapper
+ for i in "${clang_tools[@]}"; do
+ rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die
+ cat > "${T}"/wrapper.tmp <<-_EOF_
+ #!${EPREFIX}/bin/sh
+ exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}"
+ _EOF_
+ newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}"
+ done
+ fi
+ fi
+}
+
+multilib_src_install_all() {
+ insinto /usr/share/vim/vimfiles
+ doins -r utils/vim/*/.
+ # some users may find it useful
+ dodoc utils/vim/vimrc
+
+ if use clang; then
+ pushd tools/clang >/dev/null || die
+
+ if use static-analyzer ; then
+ pushd tools/scan-build >/dev/null || die
+
+ dobin ccc-analyzer scan-build
+ dosym ccc-analyzer /usr/bin/c++-analyzer
+ doman scan-build.1
+
+ insinto /usr/share/llvm
+ doins scanview.css sorttable.js
+
+ popd >/dev/null || die
+ fi
+
+ if use static-analyzer ; then
+ pushd tools/scan-view >/dev/null || die
+
+ python_doscript scan-view
+
+ touch __init__.py || die
+ python_moduleinto clang
+ python_domodule *.py Resources
+
+ popd >/dev/null || die
+ fi
+
+ if use python ; then
+ pushd bindings/python/clang >/dev/null || die
+
+ python_moduleinto clang
+ python_domodule *.py
+
+ popd >/dev/null || die
+ fi
+
+ # AddressSanitizer symbolizer (currently separate)
+ dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
+
+ popd >/dev/null || die
+
+ python_fix_shebang "${ED}"
+ if use lldb && use python; then
+ python_optimize
+ fi
+ fi
+}
+
+pkg_postinst() {
+ if use clang && ! has_version sys-libs/libomp; then
+ elog "To enable OpenMP support in clang, install sys-libs/libomp."
+ fi
+}
diff --git a/sys-devel/llvm/llvm-3.8.1-r2.ebuild b/sys-devel/llvm/llvm-3.8.1-r2.ebuild
new file mode 100644
index 000000000000..e6e60425a190
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.8.1-r2.ebuild
@@ -0,0 +1,578 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils eutils flag-o-matic multilib \
+ multilib-minimal python-single-r1 toolchain-funcs pax-utils prefix
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz
+ clang? ( https://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+ https://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
+ https://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
+ lldb? ( https://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
+ !doc? ( https://dev.gentoo.org/~voyageur/distfiles/${PN}-3.8.0-manpages.tar.bz2 )
+ https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.xz"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. autoconf (not used): some undefined M.I.T. license.
+# 5. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain
+ multitarget? ( LLVM-Grant )"
+SLOT="0/3.8.0"
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="clang debug default-compiler-rt default-libcxx doc gold libedit +libffi
+ lldb multitarget ncurses ocaml python +sanitize +static-analyzer test xml
+ video_cards_radeon elibc_musl kernel_Darwin kernel_FreeBSD"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ clang? (
+ python? ( ${PYTHON_DEPS} )
+ static-analyzer? (
+ dev-lang/perl:*
+ ${PYTHON_DEPS}
+ )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ )
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ lldb? ( dev-python/six[${PYTHON_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ ocaml? (
+ >=dev-lang/ocaml-4.00.0:0=
+ dev-ml/ocaml-ctypes:=
+ !!<=sys-devel/llvm-3.7.0-r1[ocaml] )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+ clang? ( xml? ( virtual/pkgconfig ) )
+ doc? ( dev-python/sphinx )
+ gold? ( sys-libs/binutils-libs )
+ libffi? ( virtual/pkgconfig )
+ lldb? ( dev-lang/swig )
+ !!<dev-python/configparser-3.3.0.2
+ ocaml? ( dev-ml/findlib
+ test? ( dev-ml/ounit ) )
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-${PV}-r99 )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+PDEPEND="clang? ( =sys-devel/clang-${PV}-r100 )
+ default-libcxx? ( sys-libs/libcxx )
+ kernel_Darwin? ( =sys-libs/libcxx-${PV%.*}* )"
+
+# pypy gives me around 1700 unresolved tests due to open file limit
+# being exceeded. probably GC does not close them fast enough.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ lldb? ( clang xml )"
+
+S=${WORKDIR}/${P/_}.src
+
+check_space() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if use debug; then
+ ewarn "USE=debug is known to increase the size of package considerably"
+ ewarn "and cause the tests to fail."
+ ewarn
+
+ (( build_size *= 14 ))
+ elif is-flagq '-g?(gdb)?([1-9])'; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ # Multiply by number of ABIs :).
+ local abis=( $(multilib_get_enabled_abis) )
+ (( build_size *= ${#abis[@]} ))
+
+ local CHECKREQS_DISK_BUILD=${build_size}M
+ check-reqs_pkg_pretend
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+}
+
+src_unpack() {
+ default
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
+ || die "clang-tools-extra source directory move failed"
+ fi
+
+ if use lldb; then
+ mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \
+ || die "lldb source directory move failed"
+ fi
+}
+
+src_prepare() {
+ python_setup
+
+ # Make ocaml warnings non-fatal, bug #537308
+ sed -e "/RUN/s/-warn-error A//" -i test/Bindings/OCaml/*ml || die
+ # Fix libdir for ocaml bindings install, bug #559134
+ eapply "${WORKDIR}/${P}-patchset"/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
+ # Do not build/install ocaml docs with USE=-doc, bug #562008
+ eapply "${WORKDIR}/${P}-patchset"/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
+
+ # Make it possible to override Sphinx HTML install dirs
+ # https://llvm.org/bugs/show_bug.cgi?id=23780
+ eapply "${WORKDIR}/${P}-patchset"/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
+
+ # Prevent race conditions with parallel Sphinx runs
+ # https://llvm.org/bugs/show_bug.cgi?id=23781
+ eapply "${WORKDIR}/${P}-patchset"/0004-cmake-Add-an-ordering-dep-between-HTML-man-Sphinx-ta.patch
+
+ # Prevent installing libgtest
+ # https://llvm.org/bugs/show_bug.cgi?id=18341
+ eapply "${WORKDIR}/${P}-patchset"/0005-cmake-Do-not-install-libgtest.patch
+
+ # Allow custom cmake build types (like 'Gentoo')
+ eapply "${WORKDIR}/${P}-patchset"/0006-cmake-Remove-the-CMAKE_BUILD_TYPE-assertion.patch
+
+ # Fix llvm-config for shared linking and sane flags
+ # https://bugs.gentoo.org/show_bug.cgi?id=565358
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-r1.patch
+
+ # Restore SOVERSIONs for shared libraries
+ # https://bugs.gentoo.org/show_bug.cgi?id=578392
+ eapply "${WORKDIR}/${P}-patchset"/0008-cmake-Restore-SOVERSIONs-on-shared-libraries.patch
+
+ # support building llvm against musl-libc
+ use elibc_musl && eapply "${WORKDIR}/${P}-patchset"/musl-fixes.patch
+
+ # support "musl" as a valid environment type in llvm
+ eapply "${WORKDIR}/${P}-patchset"/musl-env-support.patch
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # Workaround, can be compiled with gcc on Gentoo/FreeBSD, bug #578064
+ use kernel_FreeBSD && tc-is-gcc && append-cppflags "-D_GLIBCXX_USE_C99"
+
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ eapply "${WORKDIR}/${P}-patchset"/clang/gentoo-runtime-gcc-detection-v3.patch
+
+ # Support gcc4.9 search paths
+ # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
+ eapply "${WORKDIR}/${P}-patchset"/clang/gcc4.9-search-path.patch
+
+ eapply "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
+ eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+
+ pushd "${S}"/tools/clang >/dev/null || die
+ # be able to specify default values for -stdlib and -rtlib at build time
+ eapply "${WORKDIR}/${P}-patchset"/clang/default-libs.patch
+
+ # enable clang to recognize musl-libc
+ eapply "${WORKDIR}/${P}-patchset"/clang/musl-support.patch
+ popd >/dev/null || die
+
+ sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
+ tools/clang/tools/scan-build/bin/scan-build || die
+
+ # Install clang runtime into /usr/lib/clang
+ # https://llvm.org/bugs/show_bug.cgi?id=23792
+ eapply "${WORKDIR}/${P}-patchset"/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
+
+ # Do not force -march flags on arm platforms
+ # https://bugs.gentoo.org/show_bug.cgi?id=562706
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/arm_march_flags.patch
+
+ # Make it possible to override CLANG_LIBDIR_SUFFIX
+ # (that is used only to find LLVMgold.so)
+ # https://llvm.org/bugs/show_bug.cgi?id=23793
+ eapply "${WORKDIR}/${P}-patchset"/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
+
+ # Fix git-clang-format shebang, bug #562688
+ python_fix_shebang tools/clang/tools/clang-format/git-clang-format
+
+ # Fix 'stdarg.h' file not found on Gentoo/FreeBSD, bug #578064
+ # https://llvm.org/bugs/show_bug.cgi?id=26651
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/fbsd.patch
+
+ # Backport abi-tag support, bug #571600
+ eapply "${WORKDIR}/${P}-patchset"/clang/abi-tag-support-sema.patch
+ eapply "${WORKDIR}/${P}-patchset"/clang/abi-tag-support-mangler.patch
+
+ pushd projects/compiler-rt >/dev/null || die
+
+ # Fix WX sections, bug #421527
+ find lib/builtins -type f -name '*.S' -exec sed \
+ -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
+ -i {} + || die
+
+ popd >/dev/null || die
+ fi
+
+ if use lldb; then
+ # Do not install dummy readline.so module from
+ # https://llvm.org/bugs/show_bug.cgi?id=18841
+ sed -e 's/add_subdirectory(readline)/#&/' \
+ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
+ # Do not install bundled six module
+ eapply "${WORKDIR}/${P}-patchset"/lldb/six.patch
+ fi
+
+ # User patches
+ eapply_user
+
+ # Native libdir is used to hold LLVMgold.so
+ NATIVE_LIBDIR=$(get_libdir)
+}
+
+multilib_src_configure() {
+ local targets
+ if use multitarget; then
+ targets=all
+ else
+ targets='host;BPF;CppBackend'
+ use video_cards_radeon && targets+=';AMDGPU'
+ fi
+
+ local ffi_cflags ffi_ldflags
+ if use libffi; then
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_ENABLE_TIMESTAMPS=OFF
+ -DLLVM_TARGETS_TO_BUILD="${targets}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DWITH_POLLY=OFF # TODO
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -DHAVE_HISTEDIT_H=$(usex libedit)
+ )
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # override default stdlib and rtlib
+ -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
+ -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
+
+ # compiler-rt's test cases depend on sanitizer
+ -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex sanitize)
+ )
+ fi
+
+ if use lldb; then
+ mycmakeargs+=(
+ -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+ -DLLDB_DISABLE_CURSES=$(usex !ncurses)
+ -DLLDB_ENABLE_TERMINFO=$(usex ncurses)
+ )
+ fi
+
+ if ! multilib_is_native_abi || ! use ocaml; then
+ mycmakeargs+=(
+ -DOCAMLFIND=NO
+ )
+ fi
+# Note: go bindings have no CMake rules at the moment
+# but let's kill the check in case they are introduced
+# if ! multilib_is_native_abi || ! use go; then
+ mycmakeargs+=(
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+ )
+# fi
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=$(usex doc)
+ -DLLVM_ENABLE_SPHINX=$(usex doc)
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
+ )
+ fi
+
+ if use gold; then
+ mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ if use lldb; then
+ mycmakeargs+=(
+ -DLLDB_DISABLE_PYTHON=$(usex !python)
+ )
+ fi
+
+ else
+ if use clang; then
+ mycmakeargs+=(
+ # disable compiler-rt on non-native ABI because:
+ # 1. it fails to configure because of -m32
+ # 2. it is shared between ABIs so no point building
+ # it multiple times
+ -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+ if use lldb; then
+ mycmakeargs+=(
+ # only run swig on native abi
+ -DLLDB_DISABLE_PYTHON=ON
+ )
+ fi
+ fi
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
+ )
+
+ # -- not needed when compiler-rt is built with host compiler --
+ # cmake passes host C*FLAGS to compiler-rt build
+ # which is performed using clang, so we need to filter out
+ # some flags clang does not support
+ # (if you know some more flags that don't work, let us know)
+ #filter-flags -msahf -frecord-gcc-switches
+ fi
+
+ if tc-is-cross-compiler; then
+ [[ -x "/usr/bin/llvm-tblgen" ]] \
+ || die "/usr/bin/llvm-tblgen not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen
+ )
+
+ if use clang; then
+ [[ -x "/usr/bin/clang-tblgen" ]] \
+ || die "/usr/bin/clang-tblgen not found or usable"
+ mycmakeargs+=(
+ -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ )
+ fi
+ fi
+
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+ # TODO: not sure why this target is not correctly called
+ multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc
+
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+ pax-mark m "${BUILD_DIR}"/bin/lli
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+ if use test; then
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check )
+ # clang tests won't work on non-native ABI because we skip compiler-rt
+ multilib_is_native_abi && use clang && test_targets+=( check-clang )
+ cmake-utils_src_make "${test_targets[@]}"
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/config.h
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ if use clang; then
+ # note: magic applied in multilib_src_install()!
+ CLANG_VERSION=${PV%.*}
+
+ MULTILIB_CHOST_TOOLS+=(
+ /usr/bin/clang
+ /usr/bin/clang++
+ /usr/bin/clang-cl
+ /usr/bin/clang-${CLANG_VERSION}
+ /usr/bin/clang++-${CLANG_VERSION}
+ /usr/bin/clang-cl-${CLANG_VERSION}
+ )
+
+ MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/clang/Config/config.h
+ )
+ fi
+
+ multilib-minimal_src_install
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ if use kernel_FreeBSD && use clang; then
+ rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
+ fi
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ if multilib_is_native_abi; then
+ # Install man pages.
+ use doc || doman "${WORKDIR}"/${PN}-3.8.0-manpages/*.1
+
+ # Symlink the gold plugin.
+ if use gold; then
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+ dosym "../../../../$(get_libdir)/LLVMgold.so" \
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+ fi
+ fi
+
+ # apply CHOST and CLANG_VERSION to clang executables
+ # they're statically linked so we don't have to worry about the lib
+ if use clang; then
+ local clang_tools=( clang clang++ clang-cl )
+ local i
+
+ # cmake gives us:
+ # - clang-X.Y
+ # - clang -> clang-X.Y
+ # - clang++, clang-cl -> clang
+ # we want to have:
+ # - clang-X.Y
+ # - clang++-X.Y, clang-cl-X.Y -> clang-X.Y
+ # - clang, clang++, clang-cl -> clang*-X.Y
+ # so we need to fix the two tools
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED%/}/usr/bin/${i}" || die
+ dosym "clang-${CLANG_VERSION}" "/usr/bin/${i}-${CLANG_VERSION}"
+ dosym "${i}-${CLANG_VERSION}" "/usr/bin/${i}"
+ done
+
+ # now prepend ${CHOST} and let the multilib-build.eclass symlink it
+ if ! multilib_is_native_abi; then
+ # non-native? let's replace it with a simple wrapper
+ for i in "${clang_tools[@]}"; do
+ rm "${ED%/}/usr/bin/${i}-${CLANG_VERSION}" || die
+ cat > "${T}"/wrapper.tmp <<-_EOF_
+ #!${EPREFIX}/bin/sh
+ exec "${i}-${CLANG_VERSION}" $(get_abi_CFLAGS) "\${@}"
+ _EOF_
+ newbin "${T}"/wrapper.tmp "${i}-${CLANG_VERSION}"
+ done
+ fi
+ fi
+}
+
+multilib_src_install_all() {
+ insinto /usr/share/vim/vimfiles
+ doins -r utils/vim/*/.
+ # some users may find it useful
+ dodoc utils/vim/vimrc
+
+ if use clang; then
+ pushd tools/clang >/dev/null || die
+
+ if use python ; then
+ pushd bindings/python/clang >/dev/null || die
+
+ python_moduleinto clang
+ python_domodule *.py
+
+ popd >/dev/null || die
+ fi
+
+ # AddressSanitizer symbolizer (currently separate)
+ dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
+
+ popd >/dev/null || die
+
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"usr/share/scan-view
+ fi
+ fi
+}
+
+pkg_postinst() {
+ if use clang && ! has_version 'sys-libs/libomp'; then
+ elog "To enable OpenMP support in clang, install sys-libs/libomp."
+ fi
+}
diff --git a/sys-devel/llvm/llvm-3.9.1-r1.ebuild b/sys-devel/llvm/llvm-3.9.1-r1.ebuild
new file mode 100644
index 000000000000..11188e4e124b
--- /dev/null
+++ b/sys-devel/llvm/llvm-3.9.1-r1.ebuild
@@ -0,0 +1,549 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+PYTHON_COMPAT=( python2_7 )
+
+inherit check-reqs cmake-utils eutils flag-o-matic multilib \
+ multilib-minimal python-single-r1 toolchain-funcs pax-utils prefix
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://llvm.org/releases/${PV}/${P}.src.tar.xz
+ clang? ( https://llvm.org/releases/${PV}/compiler-rt-${PV}.src.tar.xz
+ https://llvm.org/releases/${PV}/cfe-${PV}.src.tar.xz
+ https://llvm.org/releases/${PV}/clang-tools-extra-${PV}.src.tar.xz )
+ lldb? ( https://llvm.org/releases/${PV}/lldb-${PV}.src.tar.xz )
+ !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/${PN}-3.9.0_rc3-manpages.tar.bz2 )
+ https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.xz"
+
+# Keep in sync with CMakeLists.txt
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Mips MSP430
+ NVPTX PowerPC Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain
+ llvm_targets_ARM? ( LLVM-Grant )"
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~arm64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="clang debug default-compiler-rt default-libcxx doc gold libedit +libffi
+ lldb multitarget ncurses ocaml python +sanitize +static-analyzer test xml
+ elibc_musl kernel_Darwin kernel_FreeBSD ${ALL_LLVM_TARGETS[*]}"
+
+COMMON_DEPEND="
+ sys-libs/zlib:0=
+ clang? (
+ python? ( ${PYTHON_DEPS} )
+ static-analyzer? (
+ dev-lang/perl:*
+ ${PYTHON_DEPS}
+ )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ )
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ lldb? ( dev-python/six[${PYTHON_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ ocaml? (
+ >=dev-lang/ocaml-4.00.0:0=
+ dev-ml/ocaml-ctypes:=
+ !!<=sys-devel/llvm-3.7.0-r1[ocaml] )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${COMMON_DEPEND}
+ dev-lang/perl
+ >=sys-devel/make-3.81
+ >=sys-devel/flex-2.5.4
+ >=sys-devel/bison-1.875d
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+ kernel_Darwin? ( <sys-libs/libcxx-${PV%_rc*}.9999 )
+ clang? ( xml? ( virtual/pkgconfig ) )
+ doc? ( dev-python/sphinx )
+ gold? ( sys-libs/binutils-libs )
+ libffi? ( virtual/pkgconfig )
+ lldb? ( dev-lang/swig )
+ !!<dev-python/configparser-3.3.0.2
+ ocaml? ( dev-ml/findlib
+ test? ( dev-ml/ounit ) )
+ ${PYTHON_DEPS}"
+RDEPEND="${COMMON_DEPEND}
+ clang? ( !<=sys-devel/clang-${PV}-r99 )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r2
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+PDEPEND="
+ clang? (
+ =sys-devel/clang-${PV}-r100
+ ~sys-devel/clang-runtime-${PV}
+ )
+ default-libcxx? ( sys-libs/libcxx )
+ kernel_Darwin? ( =sys-libs/libcxx-${PV%.*}* )"
+
+# pypy gives me around 1700 unresolved tests due to open file limit
+# being exceeded. probably GC does not close them fast enough.
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ lldb? ( clang xml )
+ || ( ${ALL_LLVM_TARGETS[*]} )
+ multitarget? ( ${ALL_LLVM_TARGETS[*]} )"
+
+S=${WORKDIR}/${P/_}.src
+
+check_space() {
+ # in megs
+ # !clang !debug !multitarget -O2 400
+ # !clang !debug multitarget -O2 550
+ # clang !debug !multitarget -O2 950
+ # clang !debug multitarget -O2 1200
+ # !clang debug multitarget -O2 5G
+ # clang !debug multitarget -O0 -g 12G
+ # clang debug multitarget -O2 16G
+ # clang debug multitarget -O0 -g 14G
+
+ local build_size=550
+ use clang && build_size=1200
+
+ if use debug; then
+ ewarn "USE=debug is known to increase the size of package considerably"
+ ewarn "and cause the tests to fail."
+ ewarn
+
+ (( build_size *= 14 ))
+ elif is-flagq '-g?(gdb)?([1-9])'; then
+ ewarn "The C++ compiler -g option is known to increase the size of the package"
+ ewarn "considerably. If you run out of space, please consider removing it."
+ ewarn
+
+ (( build_size *= 10 ))
+ fi
+
+ # Multiply by number of ABIs :).
+ local abis=( $(multilib_get_enabled_abis) )
+ (( build_size *= ${#abis[@]} ))
+
+ local CHECKREQS_DISK_BUILD=${build_size}M
+ check-reqs_pkg_pretend
+}
+
+pkg_pretend() {
+ check_space
+}
+
+pkg_setup() {
+ check_space
+}
+
+src_unpack() {
+ default
+
+ if use clang; then
+ mv "${WORKDIR}"/cfe-${PV/_}.src "${S}"/tools/clang \
+ || die "clang source directory move failed"
+ mv "${WORKDIR}"/compiler-rt-${PV/_}.src "${S}"/projects/compiler-rt \
+ || die "compiler-rt source directory move failed"
+ mv "${WORKDIR}"/clang-tools-extra-${PV/_}.src "${S}"/tools/clang/tools/extra \
+ || die "clang-tools-extra source directory move failed"
+ fi
+
+ if use lldb; then
+ mv "${WORKDIR}"/lldb-${PV/_}.src "${S}"/tools/lldb \
+ || die "lldb source directory move failed"
+ fi
+}
+
+src_prepare() {
+ python_setup
+
+ # Fix libdir for ocaml bindings install, bug #559134
+ eapply "${WORKDIR}/${P}-patchset"/0001-cmake-Install-OCaml-modules-into-correct-package-loc.patch
+ # Do not build/install ocaml docs with USE=-doc, bug #562008
+ eapply "${WORKDIR}/${P}-patchset"/0002-cmake-Make-OCaml-docs-dependent-on-LLVM_BUILD_DOCS.patch
+
+ # Make it possible to override Sphinx HTML install dirs
+ # https://llvm.org/bugs/show_bug.cgi?id=23780
+ eapply "${WORKDIR}/${P}-patchset"/0003-cmake-Support-overriding-Sphinx-HTML-doc-install-dir.patch
+
+ # Prevent race conditions with parallel Sphinx runs
+ # https://llvm.org/bugs/show_bug.cgi?id=23781
+ eapply "${WORKDIR}/${P}-patchset"/0004-cmake-Use-separate-doctrees-to-prevent-races-between.patch
+
+ # Allow custom cmake build types (like 'Gentoo')
+ eapply "${WORKDIR}/${P}-patchset"/0006-cmake-Remove-the-CMAKE_BUILD_TYPE-assertion.patch
+
+ # Fix llvm-config for shared linking and sane flags
+ # https://bugs.gentoo.org/show_bug.cgi?id=565358
+ eapply "${WORKDIR}/${P}-patchset"/llvm-config-r1.patch
+
+ # Restore SOVERSIONs for shared libraries
+ # https://bugs.gentoo.org/show_bug.cgi?id=578392
+ eapply "${WORKDIR}/${P}-patchset"/0008-cmake-Reintroduce-ldconfig-compatible-SOVERSIONs-on-.patch
+
+ # Revert commit breaking AMDGPU
+ # https://bugs.gentoo.org/show_bug.cgi?id=603858
+ eapply "${WORKDIR}/${P}-patchset"/0009-Revert-AMDGPU-Fix-an-interaction-between-WQM-and-pol.patch
+
+ # support building llvm against musl-libc
+ use elibc_musl && eapply "${WORKDIR}/${P}-patchset"/musl-fixes.patch
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # Workaround, can be compiled with gcc on Gentoo/FreeBSD, bug #578064
+ use kernel_FreeBSD && tc-is-gcc && append-cppflags "-D_GLIBCXX_USE_C99"
+
+ if use clang; then
+ # Automatically select active system GCC's libraries, bugs #406163 and #417913
+ eapply "${WORKDIR}/${P}-patchset"/clang/gcc-config.patch
+
+ eapply "${WORKDIR}/${P}-patchset"/clang/darwin_prefix-include-paths.patch
+ eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp
+
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/darwin-default-sysroot.patch
+
+ pushd "${S}"/tools/clang >/dev/null || die
+ # be able to specify default values for -stdlib and -rtlib at build time
+ eapply "${WORKDIR}/${P}-patchset"/clang/default-libs.patch
+ popd >/dev/null || die
+
+ sed -i -e "s^@EPREFIX@^${EPREFIX}^" \
+ tools/clang/tools/scan-build/bin/scan-build || die
+
+ # Install clang runtime into /usr/lib/clang
+ # https://llvm.org/bugs/show_bug.cgi?id=23792
+ eapply "${WORKDIR}/${P}-patchset"/clang/0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
+ eapply "${WORKDIR}/${P}-patchset"/compiler-rt/0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
+
+ # Make it possible to override CLANG_LIBDIR_SUFFIX
+ # (that is used only to find LLVMgold.so)
+ # https://llvm.org/bugs/show_bug.cgi?id=23793
+ eapply "${WORKDIR}/${P}-patchset"/clang/0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
+
+ # Fix git-clang-format shebang, bug #562688
+ python_fix_shebang tools/clang/tools/clang-format/git-clang-format
+
+ pushd projects/compiler-rt >/dev/null || die
+
+ # Fix WX sections, bug #421527
+ find lib/builtins -type f -name '*.S' -exec sed \
+ -e '$a\\n#if defined(__linux__) && defined(__ELF__)\n.section .note.GNU-stack,"",%progbits\n#endif' \
+ -i {} + || die
+
+ popd >/dev/null || die
+ fi
+
+ if use lldb; then
+ # Do not install dummy readline.so module from
+ # https://llvm.org/bugs/show_bug.cgi?id=18841
+ sed -e 's/add_subdirectory(readline)/#&/' \
+ -i tools/lldb/scripts/Python/modules/CMakeLists.txt || die
+ # Do not install bundled six module
+ eapply "${WORKDIR}/${P}-patchset"/lldb/six.patch
+ fi
+
+ # User patches
+ eapply_user
+
+ # Native libdir is used to hold LLVMgold.so
+ NATIVE_LIBDIR=$(get_libdir)
+}
+
+multilib_src_configure() {
+ local ffi_cflags ffi_ldflags
+ if use libffi; then
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DWITH_POLLY=OFF # TODO
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -DHAVE_HISTEDIT_H=$(usex libedit)
+ )
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # override default stdlib and rtlib
+ -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
+ -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
+
+ # compiler-rt's test cases depend on sanitizer
+ -DCOMPILER_RT_BUILD_SANITIZERS=$(usex sanitize)
+ -DCOMPILER_RT_INCLUDE_TESTS=$(usex sanitize)
+ )
+ fi
+
+ if use lldb; then
+ mycmakeargs+=(
+ -DLLDB_DISABLE_LIBEDIT=$(usex !libedit)
+ -DLLDB_DISABLE_CURSES=$(usex !ncurses)
+ -DLLDB_ENABLE_TERMINFO=$(usex ncurses)
+ )
+ fi
+
+ if ! multilib_is_native_abi || ! use ocaml; then
+ mycmakeargs+=(
+ -DOCAMLFIND=NO
+ )
+ fi
+# Note: go bindings have no CMake rules at the moment
+# but let's kill the check in case they are introduced
+# if ! multilib_is_native_abi || ! use go; then
+ mycmakeargs+=(
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+ )
+# fi
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=$(usex doc)
+ -DLLVM_ENABLE_SPHINX=$(usex doc)
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCLANG_INSTALL_HTML="${EPREFIX}/usr/share/doc/${PF}/clang"
+ )
+ fi
+
+ if use gold; then
+ mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ if use lldb; then
+ mycmakeargs+=(
+ -DLLDB_DISABLE_PYTHON=$(usex !python)
+ )
+ fi
+
+ else
+ if use clang; then
+ mycmakeargs+=(
+ # disable compiler-rt on non-native ABI because:
+ # 1. it fails to configure because of -m32
+ # 2. it is shared between ABIs so no point building
+ # it multiple times
+ -DLLVM_EXTERNAL_COMPILER_RT_BUILD=OFF
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+ if use lldb; then
+ mycmakeargs+=(
+ # only run swig on native abi
+ -DLLDB_DISABLE_PYTHON=ON
+ )
+ fi
+ fi
+
+ if use clang; then
+ mycmakeargs+=(
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ -DCLANG_LIBDIR_SUFFIX="${NATIVE_LIBDIR#lib}"
+ )
+
+ # -- not needed when compiler-rt is built with host compiler --
+ # cmake passes host C*FLAGS to compiler-rt build
+ # which is performed using clang, so we need to filter out
+ # some flags clang does not support
+ # (if you know some more flags that don't work, let us know)
+ #filter-flags -msahf -frecord-gcc-switches
+ fi
+
+ if tc-is-cross-compiler; then
+ [[ -x "/usr/bin/llvm-tblgen" ]] \
+ || die "/usr/bin/llvm-tblgen not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DLLVM_TABLEGEN=/usr/bin/llvm-tblgen
+ )
+
+ if use clang; then
+ [[ -x "/usr/bin/clang-tblgen" ]] \
+ || die "/usr/bin/clang-tblgen not found or usable"
+ mycmakeargs+=(
+ -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ )
+ fi
+ fi
+
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+ # TODO: not sure why this target is not correctly called
+ multilib_is_native_abi && use doc && use ocaml && cmake-utils_src_make docs/ocaml_doc
+
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+ pax-mark m "${BUILD_DIR}"/bin/lli
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+ if use test; then
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+ fi
+
+ # provide a symlink for tests
+ if [[ $(get_libdir) != lib ]]; then
+ ln -s "../$(get_libdir)/clang" lib/clang || die
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check )
+ # clang tests won't work on non-native ABI because we skip compiler-rt
+ multilib_is_native_abi && use clang && test_targets+=( check-clang )
+ cmake-utils_src_make "${test_targets[@]}"
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/config.h
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ if use clang; then
+ MULTILIB_WRAPPED_HEADERS+=(
+ /usr/include/clang/Config/config.h
+ )
+ fi
+
+ multilib-minimal_src_install
+
+ if use clang; then
+ # Apply CHOST and version suffix to clang tools
+ local clang_version=${PV%.*}
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X.Y
+ # - clang -> clang-X.Y
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X.Y
+ # - clang++-X.Y, clang-cl-X.Y, clang-cpp-X.Y -> clang-X.Y
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X.Y
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm -f "${ED%/}/usr/bin/${i}" || die
+ dosym "clang-${clang_version}" "/usr/bin/${i}-${clang_version}"
+ dosym "${i}-${clang_version}" "/usr/bin/${i}"
+ done
+
+ # now create target symlinks for all supported ABIs
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ for i in "${clang_tools[@]}"; do
+ dosym "${i}-${clang_version}" \
+ "/usr/bin/${abi_chost}-${i}-${clang_version}"
+ dosym "${abi_chost}-${i}-${clang_version}" \
+ "/usr/bin/${abi_chost}-${i}"
+ done
+ done
+ fi
+
+ # Remove unnecessary headers on FreeBSD, bug #417171
+ if use kernel_FreeBSD && use clang; then
+ rm "${ED}"usr/lib/clang/${PV}/include/{std,float,iso,limits,tgmath,varargs}*.h || die
+ fi
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ if multilib_is_native_abi; then
+ # Symlink the gold plugin.
+ if use gold; then
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+ dosym "../../../../$(get_libdir)/LLVMgold.so" \
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+ fi
+ fi
+}
+
+multilib_src_install_all() {
+ insinto /usr/share/vim/vimfiles
+ doins -r utils/vim/*/.
+ # some users may find it useful
+ dodoc utils/vim/vimrc
+
+ # Install man pages from the prebuilt package
+ if ! use doc; then
+ if ! use clang; then
+ rm "${WORKDIR}"/${PN}-3.9.0_rc3-manpages/{clang,extraclangtools,scan-build}.1 || die
+ fi
+
+ doman "${WORKDIR}"/${PN}-3.9.0_rc3-manpages/*.1
+ fi
+
+ if use clang; then
+ pushd tools/clang >/dev/null || die
+
+ if use python ; then
+ pushd bindings/python/clang >/dev/null || die
+
+ python_moduleinto clang
+ python_domodule *.py
+
+ popd >/dev/null || die
+ fi
+
+ # AddressSanitizer symbolizer (currently separate)
+ dobin "${S}"/projects/compiler-rt/lib/asan/scripts/asan_symbolize.py
+
+ popd >/dev/null || die
+
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"usr/share/scan-view
+ fi
+ fi
+}
diff --git a/sys-devel/llvm/llvm-4.0.1.ebuild b/sys-devel/llvm/llvm-4.0.1.ebuild
new file mode 100644
index 000000000000..0c5bec512cce
--- /dev/null
+++ b/sys-devel/llvm/llvm-4.0.1.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic multilib-minimal pax-utils \
+ python-any-r1 toolchain-funcs versionator
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-manpages-${PV}.tar.bz2 )"
+
+# Keep in sync with CMakeLists.txt
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC RISCV Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain
+ llvm_targets_ARM? ( LLVM-Grant )"
+SLOT="$(get_major_version)"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="debug +doc gold libedit +libffi ncurses test
+ elibc_musl kernel_Darwin ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ sys-libs/zlib:0=
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+ kernel_Darwin? ( <sys-libs/libcxx-$(get_version_component_range 1-3).9999 )
+ doc? ( dev-python/sphinx )
+ gold? ( sys-libs/binutils-libs )
+ libffi? ( virtual/pkgconfig )
+ test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+# There are no file collisions between these versions but having :0
+# installed means llvm-config there will take precedence.
+RDEPEND="${RDEPEND}
+ !sys-devel/llvm:0"
+PDEPEND="sys-devel/llvm-common
+ gold? ( sys-devel/llvmgold )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ || ( ${ALL_LLVM_TARGETS[*]} )"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ ! use test \
+ || has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ # Fix llvm-config for shared linking and sane flags
+ # https://bugs.gentoo.org/show_bug.cgi?id=565358
+ eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
+
+ # support building llvm against musl-libc
+ use elibc_musl && eapply "${FILESDIR}"/9999/musl-fixes.patch
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # User patches
+ eapply_user
+}
+
+multilib_src_configure() {
+ local ffi_cflags ffi_ldflags
+ if use libffi; then
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DWITH_POLLY=OFF # TODO
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+# Note: go bindings have no CMake rules at the moment
+# but let's kill the check in case they are introduced
+# if ! multilib_is_native_abi || ! use go; then
+ mycmakeargs+=(
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+ )
+# fi
+
+ use test && mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=$(usex doc)
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=$(usex doc)
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use doc && mycmakeargs+=(
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ use gold && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ local tblgen="${EPREFIX}/usr/lib/llvm/${SLOT}/bin/llvm-tblgen"
+ [[ -x "${tblgen}" ]] \
+ || die "${tblgen} not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DLLVM_TABLEGEN="${tblgen}"
+ )
+ fi
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+ pax-mark m "${BUILD_DIR}"/bin/lli
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+ if use test; then
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake-utils_src_make check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${SLOT}/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ local LLVM_LDPATHS=()
+ multilib-minimal_src_install
+
+ # move wrapped headers back
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${SLOT} ))
+ cat <<-_EOF_ > "${T}/10llvm-${revord}" || die
+ PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+_EOF_
+ doenvd "${T}/10llvm-${revord}"
+
+ # install pre-generated manpages
+ if ! use doc; then
+ # (doman does not support custom paths)
+ insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
+ doins "${WORKDIR}/llvm-manpages-${PV}/llvm"/*.1
+ fi
+
+ docompress "/usr/lib/llvm/${SLOT}/share/man"
+}
diff --git a/sys-devel/llvm/llvm-5.0.0.ebuild b/sys-devel/llvm/llvm-5.0.0.ebuild
new file mode 100644
index 000000000000..355123205952
--- /dev/null
+++ b/sys-devel/llvm/llvm-5.0.0.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils flag-o-matic multilib-minimal pax-utils \
+ python-any-r1 toolchain-funcs versionator
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ !doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/llvm-manpages-${PV}.tar.bz2 )"
+
+# Keep in sync with CMakeLists.txt
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain
+ llvm_targets_ARM? ( LLVM-Grant )"
+SLOT="$(get_major_version)"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="debug +doc gold libedit +libffi ncurses test
+ kernel_Darwin ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ sys-libs/zlib:0=
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+ kernel_Darwin? ( <sys-libs/libcxx-$(get_version_component_range 1-3).9999 )
+ doc? ( dev-python/sphinx )
+ gold? ( sys-libs/binutils-libs )
+ libffi? ( virtual/pkgconfig )
+ test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+# There are no file collisions between these versions but having :0
+# installed means llvm-config there will take precedence.
+RDEPEND="${RDEPEND}
+ !sys-devel/llvm:0"
+PDEPEND="sys-devel/llvm-common
+ gold? ( sys-devel/llvmgold )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ || ( ${ALL_LLVM_TARGETS[*]} )"
+
+S=${WORKDIR}/${P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ ! use test \
+ || has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ # Fix llvm-config for shared linking and sane flags
+ # https://bugs.gentoo.org/show_bug.cgi?id=565358
+ eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # User patches
+ eapply_user
+}
+
+multilib_src_configure() {
+ local ffi_cflags ffi_ldflags
+ if use libffi; then
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ # disable appending VCS revision to the version to improve
+ # direct cache hit ratio
+ -DLLVM_APPEND_VC_REV=OFF
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DWITH_POLLY=OFF # TODO
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+# Note: go bindings have no CMake rules at the moment
+# but let's kill the check in case they are introduced
+# if ! multilib_is_native_abi || ! use go; then
+ mycmakeargs+=(
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+ )
+# fi
+
+ use test && mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=$(usex doc)
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=$(usex doc)
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use doc && mycmakeargs+=(
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ use gold && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ local tblgen="${EPREFIX}/usr/lib/llvm/${SLOT}/bin/llvm-tblgen"
+ [[ -x "${tblgen}" ]] \
+ || die "${tblgen} not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DLLVM_TABLEGEN="${tblgen}"
+ )
+ fi
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+ pax-mark m "${BUILD_DIR}"/bin/lli
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+ if use test; then
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake-utils_src_make check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${SLOT}/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ local LLVM_LDPATHS=()
+ multilib-minimal_src_install
+
+ # move wrapped headers back
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${SLOT} ))
+ cat <<-_EOF_ > "${T}/10llvm-${revord}" || die
+ PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+_EOF_
+ doenvd "${T}/10llvm-${revord}"
+
+ # install pre-generated manpages
+ if ! use doc; then
+ # (doman does not support custom paths)
+ insinto "/usr/lib/llvm/${SLOT}/share/man/man1"
+ doins "${WORKDIR}/llvm-manpages-${PV}/llvm"/*.1
+ fi
+
+ docompress "/usr/lib/llvm/${SLOT}/share/man"
+}
diff --git a/sys-devel/llvm/llvm-5.0.9999.ebuild b/sys-devel/llvm/llvm-5.0.9999.ebuild
new file mode 100644
index 000000000000..14fb539b01c5
--- /dev/null
+++ b/sys-devel/llvm/llvm-5.0.9999.ebuild
@@ -0,0 +1,230 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils eapi7-ver flag-o-matic git-r3 multilib-minimal \
+ pax-utils python-any-r1 toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+EGIT_BRANCH="release_50"
+
+# Keep in sync with CMakeLists.txt
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain
+ llvm_targets_ARM? ( LLVM-Grant )"
+SLOT="$(ver_cut 1)"
+KEYWORDS=""
+IUSE="debug +doc gold libedit +libffi ncurses test
+ kernel_Darwin ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ sys-libs/zlib:0=
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+ kernel_Darwin? ( <sys-libs/libcxx-$(ver_cut 1-3).9999 )
+ doc? ( dev-python/sphinx )
+ gold? ( sys-libs/binutils-libs )
+ libffi? ( virtual/pkgconfig )
+ test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+# There are no file collisions between these versions but having :0
+# installed means llvm-config there will take precedence.
+RDEPEND="${RDEPEND}
+ !sys-devel/llvm:0"
+PDEPEND="sys-devel/llvm-common
+ gold? ( sys-devel/llvmgold )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ || ( ${ALL_LLVM_TARGETS[*]} )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ ! use test \
+ || has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ # Fix llvm-config for shared linking and sane flags
+ # https://bugs.gentoo.org/show_bug.cgi?id=565358
+ eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # User patches
+ eapply_user
+}
+
+multilib_src_configure() {
+ local ffi_cflags ffi_ldflags
+ if use libffi; then
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ # disable appending VCS revision to the version to improve
+ # direct cache hit ratio
+ -DLLVM_APPEND_VC_REV=OFF
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DWITH_POLLY=OFF # TODO
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+# Note: go bindings have no CMake rules at the moment
+# but let's kill the check in case they are introduced
+# if ! multilib_is_native_abi || ! use go; then
+ mycmakeargs+=(
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+ )
+# fi
+
+ use test && mycmakeargs+=(
+ -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=$(usex doc)
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=$(usex doc)
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use doc && mycmakeargs+=(
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ use gold && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ local tblgen="${EPREFIX}/usr/lib/llvm/${SLOT}/bin/llvm-tblgen"
+ [[ -x "${tblgen}" ]] \
+ || die "${tblgen} not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DLLVM_TABLEGEN="${tblgen}"
+ )
+ fi
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+ pax-mark m "${BUILD_DIR}"/bin/lli
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+ if use test; then
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake-utils_src_make check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${SLOT}/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ local LLVM_LDPATHS=()
+ multilib-minimal_src_install
+
+ # move wrapped headers back
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${SLOT} ))
+ cat <<-_EOF_ > "${T}/10llvm-${revord}" || die
+ PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+_EOF_
+ doenvd "${T}/10llvm-${revord}"
+
+ docompress "/usr/lib/llvm/${SLOT}/share/man"
+}
diff --git a/sys-devel/llvm/llvm-9999.ebuild b/sys-devel/llvm/llvm-9999.ebuild
new file mode 100644
index 000000000000..e86690a206c7
--- /dev/null
+++ b/sys-devel/llvm/llvm-9999.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils eapi7-ver flag-o-matic git-r3 multilib-minimal \
+ pax-utils python-any-r1 toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+
+# Those are in lib/Targets, without explicit CMakeLists.txt mention
+ALL_LLVM_EXPERIMENTAL_TARGETS=( AVR Nios2 RISCV WebAssembly )
+# Keep in sync with CMakeLists.txt
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC Sparc SystemZ X86 XCore
+ "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}" )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. ARM backend: LLVM Software Grant by ARM.
+# 3. MD5 code: public-domain.
+# 4. Tests (not installed):
+# a. gtest: BSD.
+# b. YAML tests: MIT.
+
+LICENSE="UoI-NCSA rc BSD public-domain
+ llvm_targets_ARM? ( LLVM-Grant )"
+SLOT="6"
+KEYWORDS=""
+IUSE="debug +doc gold libedit +libffi ncurses test
+ kernel_Darwin ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ sys-libs/zlib:0=
+ gold? ( >=sys-devel/binutils-2.22:*[cxx] )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=virtual/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+ dev-lang/perl
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/llvm-3.5
+ ( >=sys-freebsd/freebsd-lib-9.1-r10 sys-libs/libcxx )
+ )
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-5.1 )
+ kernel_Darwin? ( <sys-libs/libcxx-$(ver_cut 1-3).9999 )
+ doc? ( dev-python/sphinx )
+ gold? ( sys-libs/binutils-libs )
+ libffi? ( virtual/pkgconfig )
+ test? ( $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
+ !!<dev-python/configparser-3.3.0.2
+ ${PYTHON_DEPS}"
+# There are no file collisions between these versions but having :0
+# installed means llvm-config there will take precedence.
+RDEPEND="${RDEPEND}
+ !sys-devel/llvm:0"
+PDEPEND="sys-devel/llvm-common
+ gold? ( sys-devel/llvmgold )"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+ || ( ${ALL_LLVM_TARGETS[*]} )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ ! use test \
+ || has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ # Fix llvm-config for shared linking and sane flags
+ # https://bugs.gentoo.org/show_bug.cgi?id=565358
+ eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
+
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # User patches
+ eapply_user
+}
+
+multilib_src_configure() {
+ local ffi_cflags ffi_ldflags
+ if use libffi; then
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ # disable appending VCS revision to the version to improve
+ # direct cache hit ratio
+ -DLLVM_APPEND_VC_REV=OFF
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=ON
+ # cheap hack: LLVM combines both anyway, and the only difference
+ # is that the former list is explicitly verified at cmake time
+ -DLLVM_TARGETS_TO_BUILD=""
+ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DWITH_POLLY=OFF # TODO
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+# Note: go bindings have no CMake rules at the moment
+# but let's kill the check in case they are introduced
+# if ! multilib_is_native_abi || ! use go; then
+ mycmakeargs+=(
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+ )
+# fi
+
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="-vv"
+ )
+
+ if multilib_is_native_abi; then
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=$(usex doc)
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=$(usex doc)
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use doc && mycmakeargs+=(
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ use gold && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ local tblgen="${EPREFIX}/usr/lib/llvm/${SLOT}/bin/llvm-tblgen"
+ [[ -x "${tblgen}" ]] \
+ || die "${tblgen} not found or usable"
+ mycmakeargs+=(
+ -DCMAKE_CROSSCOMPILING=ON
+ -DLLVM_TABLEGEN="${tblgen}"
+ )
+ fi
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ cmake-utils_src_compile
+
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+ pax-mark m "${BUILD_DIR}"/bin/lli
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+ if use test; then
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake-utils_src_make check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${SLOT}/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ local LLVM_LDPATHS=()
+ multilib-minimal_src_install
+
+ # move wrapped headers back
+ mv "${ED%/}"/usr/include "${ED%/}"/usr/lib/llvm/${SLOT}/include || die
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED%/}"/usr/include || die
+ mv "${ED%/}"/usr/lib/llvm/${SLOT}/include "${ED%/}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${SLOT} ))
+ cat <<-_EOF_ > "${T}/10llvm-${revord}" || die
+ PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+_EOF_
+ doenvd "${T}/10llvm-${revord}"
+
+ docompress "/usr/lib/llvm/${SLOT}/share/man"
+}
diff --git a/sys-devel/llvm/metadata.xml b/sys-devel/llvm/metadata.xml
new file mode 100644
index 000000000000..681eb7776901
--- /dev/null
+++ b/sys-devel/llvm/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <longdescription>Low Level Virtual Machine (LLVM) is:
+ 1. A compilation strategy designed to enable effective program optimization across the entire lifetime of a program. LLVM supports effective optimization at compile time, link-time (particularly interprocedural), run-time and offline (i.e., after software is installed), while remaining transparent to developers and maintaining compatibility with existing build scripts.
+ 2. A virtual instruction set - LLVM is a low-level object code representation that uses simple RISC-like instructions, but provides rich, language-independent, type information and dataflow (SSA) information about operands. This combination enables sophisticated transformations on object code, while remaining light-weight enough to be attached to the executable. This combination is key to allowing link-time, run-time, and offline transformations.
+ 3. A compiler infrastructure - LLVM is also a collection of source code that implements the language and compilation strategy. The primary components of the LLVM infrastructure are a GCC-based C and C++ front-end, a link-time optimization framework with a growing set of global and interprocedural analyses and transformations, static back-ends for many popular (and some obscure) architectures, a back-end which emits portable C code, and a Just-In-Time compilers for several architectures.
+ 4. LLVM does not imply things that you would expect from a high-level virtual machine. It does not require garbage collection or run-time code generation (In fact, LLVM makes a great static compiler!). Note that optional LLVM components can be used to build high-level virtual machines and other systems that need these services.</longdescription>
+ <use>
+ <flag name="clang">Build the clang C/C++ compiler</flag>
+ <flag name="default-compiler-rt">Use compiler-rt instead of libgcc as the default rtlib for clang</flag>
+ <flag name="default-libcxx">Use libc++ instead of libstdc++ as the default stdlib for clang</flag>
+ <flag name="doc">Build and install the HTML documentation and regenerate the man pages</flag>
+ <flag name="gold">Build the gold linker plugin</flag>
+ <flag name="lldb">Build the lldb debugger</flag>
+ <flag name="multitarget">Build all host targets (default: host only)</flag>
+ <flag name="ncurses">Support querying terminal properties using ncurses' terminfo</flag>
+ <flag name="sanitize">Build compiler-rt's sanitizers</flag>
+ <flag name="static-analyzer">Install the Clang static analyzer (requires USE=clang)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/llvmgold/Manifest b/sys-devel/llvmgold/Manifest
new file mode 100644
index 000000000000..7b7561f1f9fb
--- /dev/null
+++ b/sys-devel/llvmgold/Manifest
@@ -0,0 +1,4 @@
+EBUILD llvmgold-4.ebuild 552 SHA256 67cbdc75aba879ead41564d5a7ba8bdd1c42951b5d4e3eef562dd51d0ece0ad9 SHA512 b0c5e2b9cb9244a525fac2041c1cc9c198ec9dc56e9739141378490c4a1482260bd9819a376ff5193883cdaa5fe5ae41b2e618576a60a1ad0b8775e2032b8051 WHIRLPOOL f6c0fb258c49b56adf9658dfa76d24d3cef55cd5e0bbee8c8fae29f0c86213cc0c21b01d1cc09f8530e32718a86fb36ca3103ff0568fb489ae90bcb8c6132f89
+EBUILD llvmgold-5.ebuild 552 SHA256 67cbdc75aba879ead41564d5a7ba8bdd1c42951b5d4e3eef562dd51d0ece0ad9 SHA512 b0c5e2b9cb9244a525fac2041c1cc9c198ec9dc56e9739141378490c4a1482260bd9819a376ff5193883cdaa5fe5ae41b2e618576a60a1ad0b8775e2032b8051 WHIRLPOOL f6c0fb258c49b56adf9658dfa76d24d3cef55cd5e0bbee8c8fae29f0c86213cc0c21b01d1cc09f8530e32718a86fb36ca3103ff0568fb489ae90bcb8c6132f89
+EBUILD llvmgold-6.ebuild 529 SHA256 9f8032236c1b5cdccb6eb6551eed543415056a2c8ac8012282d02e2092eb208a SHA512 e9e870f695ca3eca2e764d5aaa62626a678bf18ea994b88e244978b0c8900c3ae981202508043adaf50c453a5d96733dd7125903a117c1562ce52eefefa8cafc WHIRLPOOL bd2258c6949bbd42bd343b45ba3ad9ed54a091c2bc1b215026a9b44a8abf9ca971f2bc4dba3a7c26f7380019bf028dd779df675c8fd837dea191a89e9e0e879f
+MISC metadata.xml 216 SHA256 e94ba81dd2791908508a3993afdebf723cc617314c53c273b9bcca15a9c48327 SHA512 3485598147c953e72e1785693a489a7e7d73d59620b76054db9c0ce95d8bfa0e8ffec29da7f7a9d73a32e5b77eac07ca3306c56a972dc57fd89d477edaebf3d5 WHIRLPOOL 29145f5721e079e0548c5ef22424c65e6a5b2bfc4428918e923fcfdfc37e9b8749fb63e3c2eb5773c17fab276f7513dd66e326b906f1848911dceba7ae4b419a
diff --git a/sys-devel/llvmgold/llvmgold-4.ebuild b/sys-devel/llvmgold/llvmgold-4.ebuild
new file mode 100644
index 000000000000..b65d437828be
--- /dev/null
+++ b/sys-devel/llvmgold/llvmgold-4.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="LLVMgold plugin symlink for autoloading"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE=""
+
+RDEPEND="sys-devel/llvm:${PV}[gold]
+ !sys-devel/llvm:0"
+
+S=${WORKDIR}
+
+src_install() {
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+ dosym "../../../../lib/llvm/${PV}/$(get_libdir)/LLVMgold.so" \
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+}
diff --git a/sys-devel/llvmgold/llvmgold-5.ebuild b/sys-devel/llvmgold/llvmgold-5.ebuild
new file mode 100644
index 000000000000..b65d437828be
--- /dev/null
+++ b/sys-devel/llvmgold/llvmgold-5.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="LLVMgold plugin symlink for autoloading"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE=""
+
+RDEPEND="sys-devel/llvm:${PV}[gold]
+ !sys-devel/llvm:0"
+
+S=${WORKDIR}
+
+src_install() {
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+ dosym "../../../../lib/llvm/${PV}/$(get_libdir)/LLVMgold.so" \
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+}
diff --git a/sys-devel/llvmgold/llvmgold-6.ebuild b/sys-devel/llvmgold/llvmgold-6.ebuild
new file mode 100644
index 000000000000..6e0663ca9db8
--- /dev/null
+++ b/sys-devel/llvmgold/llvmgold-6.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="LLVMgold plugin symlink for autoloading"
+HOMEPAGE="https://llvm.org/"
+SRC_URI=""
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS=""
+IUSE=""
+
+RDEPEND="sys-devel/llvm:${PV}[gold]
+ !sys-devel/llvm:0"
+
+S=${WORKDIR}
+
+src_install() {
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+ dosym "../../../../lib/llvm/${PV}/$(get_libdir)/LLVMgold.so" \
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+}
diff --git a/sys-devel/llvmgold/metadata.xml b/sys-devel/llvmgold/metadata.xml
new file mode 100644
index 000000000000..89c4bdb96049
--- /dev/null
+++ b/sys-devel/llvmgold/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/m4/Manifest b/sys-devel/m4/Manifest
new file mode 100644
index 000000000000..e563a77950a7
--- /dev/null
+++ b/sys-devel/m4/Manifest
@@ -0,0 +1,8 @@
+AUX m4-1.4.17-posix_spawn.patch 3302 SHA256 7034930fea8163d0822c5b9ffc4d7c45827196b55a11c4c5d3997d1e8d5d7d03 SHA512 82f6f1960a290265f1a7a3c868a780fa0816194c26ed5fc8337e35983021798c55db7c75fccf979a7dcc73253d1864cbf2de89a906fc6bf8458a524e2c4604c8 WHIRLPOOL a8dddbbf8a2d67c2b04315bb176ae0c8446bfe226c2d2afc3c15b63180b7242efb39bf4430d555ee79ba9a965df3d5d61affd9b7981e6541832a13cf0000debe
+DIST m4-1.4.17.tar.xz 1149088 SHA256 f0543c3beb51fa6b3337d8025331591e0e18d8ec2886ed391f1aade43477d508 SHA512 406e6e97c3f5c5f3c8055bac748d4fe8c2e861d97e84ab6d840a2caa7df04f523cc662d6d51f6afae7d6c219d03693c7ae0c1e669a80246a3ceb5e8342b82389 WHIRLPOOL 69a9f9129dd2f2fd0f5d61771cbac2208f10aa83e0d42fe4213eb10283cc68ce1a96717aece99e92890a4135eb7e201c638d4d9bc17ac10026b0989f3a64940e
+DIST m4-1.4.18.tar.xz 1207688 SHA256 f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07 SHA512 06f583efc3855cd8477d8347544f4ae5153a3e50aea74d21968afa7214784ea3ddfc02d0a2b11324120d76a19f2e804d20de11a456b5da929eb6ae469519b174 WHIRLPOOL bed79746e774e17c8487e0e1c02e62d961dfcdeb3ed0852fb948b77b5baf7b7d35bcf69d6d0d01ff5e8f873fffd0dadc92ebdfcf31bf87ac302e3cfb0e6ce497
+EBUILD m4-1.4.17.ebuild 1643 SHA256 c5773e0d2a9b7be3f114416197fb99e05361b6f6990efd3e0f7157b40fe59774 SHA512 223ec6c3666c28c0e96457ad7589733266d97022049d43e9b55066061b518b36701e90d4dd24b8e1b1b5cbc386e788e1f0596361587fc34faf3e7d7679378db4 WHIRLPOOL 7fd76ba1e67484ac739f19e605e51e1d9cf770a6ad43eb5d6a542ad7af9542aa260f12bc9584c75bb769c7db77b8bdbe96aea0bc28ca193032352faeaa79d3fb
+EBUILD m4-1.4.18.ebuild 1330 SHA256 bc0575ba5d70bbdf337f6dd3192da516f9c7ea9ec51e9f7a3455aa37771bdc42 SHA512 f586369b9e09566f6b8391891426171d8d04367afe046a894c477c7b2dc00e4679d4fa02a5b96d1dc627a59a3dc858d610add7d19019c3f371874101b7a99662 WHIRLPOOL 2461e37da43030dbdb598fb1fc94103bd0628af8d4f895b68bc78cb8cbb36238f7a416a5239e5ec299b340ec61916bbe34835885ccc7752a6410271de09b3650
+MISC ChangeLog 5193 SHA256 cd67f5c0f2818f57843c1314f9439d96e443a5b6f80b227a82d5fa90765f6df9 SHA512 382d2c6c156cc769de049ef701c3e89da0f992f69c1a08c43f0d350726773018846cf22702bd04babac13e76965062c02ff6c1cb2e96798d952a07ae5869a7f9 WHIRLPOOL acca90d60c552c5df77d7b89a857957c10a32762ef01f700cdc1ce43d63f276aa70a73321ba0280bf239186cabda192dbe41643b5f17d092a06ce6b07ac0b9a1
+MISC ChangeLog-2015 18924 SHA256 3d1673cdcb3eec99cc4dcf8b76223b51d4e92eb56b077ef52b476a4b43c06e1f SHA512 17ad92e1511ef447887505dd070d59538db0cb2dd9f06b4bb8ca956c5a5e80330a78bfe991939c4b519b8d099f978d91a9469cc02f41f599f386a374faab24a8 WHIRLPOOL 00448515d37ecf62b8961eb0a03c04e5325803fce673a8c7cc621a1343498e6375fcd4170dac82c71ff3fa02a44cd865ecd3fe8528cde753b54379a4669d85b1
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/m4/files/m4-1.4.17-posix_spawn.patch b/sys-devel/m4/files/m4-1.4.17-posix_spawn.patch
new file mode 100644
index 000000000000..5954cc35d548
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.17-posix_spawn.patch
@@ -0,0 +1,111 @@
+This fixes the search for posix_spawn() to use AC_SEARCH_LIBS which
+is needed for uClibc which puts the function in librt [1]. The fix
+is in gnulib commit d6eab2e [2], but we can't just apply that patch
+and autoreconf because that means we must depend on autotools.eclass
+and this leads to a circular dependency. So we have to patch
+configure directlly.
+
+[1] https://bugs.gentoo.org/show_bug.cgi?id=580688
+[2] http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=d6eab2e70fc5ccc82a73e5c988b76a229e4cd3d5
+[3] https://bugs.gentoo.org/show_bug.cgi?id=581086
+
+Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+
+diff -Naur m4-1.4.17.orig/configure m4-1.4.17/configure
+--- m4-1.4.17.orig/configure 2013-09-22 06:38:28.000000000 +0000
++++ m4-1.4.17/configure 2016-04-25 22:27:12.774118561 +0000
+@@ -808,6 +808,7 @@
+ GNULIB_SIGNAL_H_SIGPIPE
+ GNULIB_RAISE
+ GNULIB_PTHREAD_SIGMASK
++LIB_POSIX_SPAWN
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
+ REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
+@@ -3590,7 +3591,6 @@
+ as_fn_append ac_func_list " mkstemp"
+ as_fn_append ac_func_list " nl_langinfo"
+ as_fn_append ac_func_list " pipe2"
+-as_fn_append ac_func_list " posix_spawn"
+ gl_printf_safe=yes
+ as_fn_append ac_func_list " isblank"
+ as_fn_append ac_func_list " iswctype"
+@@ -15877,8 +15881,78 @@
+
+
+
++ LIB_POSIX_SPAWN=
++
++ gl_saved_libs=$LIBS
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing posix_spawn" >&5
++$as_echo_n "checking for library containing posix_spawn... " >&6; }
++if ${ac_cv_search_posix_spawn+:} false; then :
++ $as_echo_n "(cached) " >&6
++else
++ ac_func_search_save_LIBS=$LIBS
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h. */
++
++/* Override any GCC internal prototype to avoid an error.
++ Use char because int might match the return type of a GCC
++ builtin and then its argument prototype would still apply. */
++#ifdef __cplusplus
++extern "C"
++#endif
++char posix_spawn ();
++int
++main ()
++{
++return posix_spawn ();
++ ;
++ return 0;
++}
++_ACEOF
++for ac_lib in '' rt; do
++ if test -z "$ac_lib"; then
++ ac_res="none required"
++ else
++ ac_res=-l$ac_lib
++ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
++ fi
++ if ac_fn_c_try_link "$LINENO"; then :
++ ac_cv_search_posix_spawn=$ac_res
++fi
++rm -f core conftest.err conftest.$ac_objext \
++ conftest$ac_exeext
++ if ${ac_cv_search_posix_spawn+:} false; then :
++ break
++fi
++done
++if ${ac_cv_search_posix_spawn+:} false; then :
++
++else
++ ac_cv_search_posix_spawn=no
++fi
++rm conftest.$ac_ext
++LIBS=$ac_func_search_save_LIBS
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_posix_spawn" >&5
++$as_echo "$ac_cv_search_posix_spawn" >&6; }
++ac_res=$ac_cv_search_posix_spawn
++if test "$ac_res" != no; then :
++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
++ test "$ac_cv_search_posix_spawn" = "none required" ||
++ LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn
++fi
++
++ for ac_func in posix_spawn
++do :
++ ac_fn_c_check_func "$LINENO" "posix_spawn" "ac_cv_func_posix_spawn"
++if test "x$ac_cv_func_posix_spawn" = xyes; then :
++ cat >>confdefs.h <<_ACEOF
++#define HAVE_POSIX_SPAWN 1
++_ACEOF
+
++fi
++done
+
++ LIBS=$gl_saved_libs
+
+ if test $ac_cv_func_posix_spawn != yes; then
+ HAVE_POSIX_SPAWN=0
diff --git a/sys-devel/m4/m4-1.4.17.ebuild b/sys-devel/m4/m4-1.4.17.ebuild
new file mode 100644
index 000000000000..adfd4d6afac5
--- /dev/null
+++ b/sys-devel/m4/m4-1.4.17.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils
+
+DESCRIPTION="GNU macro processor"
+HOMEPAGE="https://www.gnu.org/software/m4/m4.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples"
+
+# remember: cannot dep on autoconf since it needs us
+DEPEND="app-arch/xz-utils"
+RDEPEND=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-posix_spawn.patch #580688, 581086
+
+ # Disable gnulib build test that has no impact on the source.
+ # Re-enable w/next version bump (and gnulib is updated). #554728
+ [[ ${PV} != "1.4.17" ]] && die "re-enable test #554728"
+ echo 'exit 0' > tests/test-update-copyright.sh || die
+}
+
+src_configure() {
+ # Disable automagic dependency over libsigsegv; see bug #278026
+ export ac_cv_libsigsegv=no
+
+ local myconf=""
+ [[ ${USERLAND} != "GNU" ]] && myconf="--program-prefix=g"
+ econf --enable-changeword ${myconf}
+}
+
+src_test() {
+ [[ -d /none ]] && die "m4 tests will fail with /none/" #244396
+ emake check
+}
+
+src_install() {
+ default
+ # autoconf-2.60 for instance, first checks gm4, then m4. If we don't have
+ # gm4, it might find gm4 from outside the prefix on for instance Darwin
+ use prefix && dosym /usr/bin/m4 /usr/bin/gm4
+ if use examples ; then
+ docinto examples
+ dodoc examples/*
+ rm -f "${ED}"/usr/share/doc/${PF}/examples/Makefile*
+ fi
+}
diff --git a/sys-devel/m4/m4-1.4.18.ebuild b/sys-devel/m4/m4-1.4.18.ebuild
new file mode 100644
index 000000000000..1bb440ec6f2a
--- /dev/null
+++ b/sys-devel/m4/m4-1.4.18.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+DESCRIPTION="GNU macro processor"
+HOMEPAGE="https://www.gnu.org/software/m4/m4.html"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="examples"
+
+# remember: cannot dep on autoconf since it needs us
+DEPEND="app-arch/xz-utils"
+RDEPEND=""
+
+src_configure() {
+ # Disable automagic dependency over libsigsegv; see bug #278026
+ export ac_cv_libsigsegv=no
+
+ local myconf=""
+ [[ ${USERLAND} != "GNU" ]] && myconf="--program-prefix=g"
+ econf --enable-changeword ${myconf}
+}
+
+src_test() {
+ [[ -d /none ]] && die "m4 tests will fail with /none/" #244396
+ emake check
+}
+
+src_install() {
+ default
+ # autoconf-2.60 for instance, first checks gm4, then m4. If we don't have
+ # gm4, it might find gm4 from outside the prefix on for instance Darwin
+ use prefix && dosym /usr/bin/m4 /usr/bin/gm4
+ if use examples ; then
+ docinto examples
+ dodoc examples/*
+ rm -f "${ED}"/usr/share/doc/${PF}/examples/Makefile*
+ fi
+}
diff --git a/sys-devel/m4/metadata.xml b/sys-devel/m4/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/m4/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/make/Manifest b/sys-devel/make/Manifest
new file mode 100644
index 000000000000..7625ca99c4ae
--- /dev/null
+++ b/sys-devel/make/Manifest
@@ -0,0 +1,37 @@
+AUX 3.80-memory.patch 2248 SHA256 0fa6d8b039fd56313626a3865cde7ef09622525a751ec55bf3741a6fc172091f SHA512 dc2654f236d72fcde4cc7c0249cec31cf46b3d80d4dc6c5659f65cab22c010a1edc202ab6b005237c78930939fe676461e04b426b348beaa912835ee04bc67cc WHIRLPOOL a520b7257d2ee3b6c297cf06b70a01ad26d7842dc2dabe01b444c4f5cc9b95cd987db4b8ecb46cfe1e848a8cc5b60c831524d38d8917c1918fd9be05eca9993c
+AUX make-3.80-conditional-eval.patch 4144 SHA256 68f182f5435296b60acc710006bddf745bee6c37e68ae2942c778add93a40155 SHA512 6cc783cdfe315580f0143605a3f41ef48e06a510858178c5647145d05bd8a6b420080cfbbd0ffe640ad41385d197f6e7aba8f37dda2c3589c9316898658a4593 WHIRLPOOL 67405a9079a27ac9b90fdcfd1ad0a29966c2f5691f1ddaa8dd658e235c3900bb105ac61da48880dbb4d7749ac88d5f150b657475bb8a00d358a71e186df0fed5
+AUX make-3.80-parallel-build-failure.patch 2210 SHA256 71f80dee56a04f30f2fe8bb9012d32ed830d2e0e9f68c183819c5ccf025c9b62 SHA512 09d85abae6df739df02ca46fe7652a256cf9b6765c6599688795d0aae827608d9606e7870d634b8eb5662665d888c7316ca6c83c5be11fa9578c13334eb83330 WHIRLPOOL bd068564283aa74bbe7782be180124087d77fc0bf63922d62ef4959141b37fd32a4b1762015a9c2fdf9a670cb404b921d9eee959f66709ce359c95da6b8de9eb
+AUX make-3.81-jobserver.patch 543 SHA256 0c38417b19d1950f0665b17a2c4ddb503ebd3741ab3e5099fa54e93eaa989d60 SHA512 0e9aa06a9bc4db784eaebf8b0689e3cc049a261a9948bfc16b2aee195b177a5e2f5b47f004c653807298513b000ed7ea2ed586fe758bfa2a0c9c08c97a71131c WHIRLPOOL 162924b759648c91e8c1bac33dc20d6903d4a6c0dab3f81069a13ad9049ef475b327cadac7718df56b1f41c2d85acb090de4126d358d3cadba2f24ffe36d9f86
+AUX make-3.81-long-cmdline.patch 2823 SHA256 0609897c53f29fca55b0f064a45af881cb1c98297c5c7f43e0bde154622f3c26 SHA512 40241b167bb724d3f50658338346d5b6674076fcd30bcb50c3e8e4e032d0745eb0d251856496d5ecdc47cb14aabb59ab3a47a4f48cabbf670c118e887897728d WHIRLPOOL 01d6fb72de3652f762ed5a632153cd22711a626c4a86d9f391b4ffbfd9f355d0b755a775f2d67e7972d5998eaa3b2033e04bfdb6b98f4c0066aa3cdd161cbd82
+AUX make-3.81-tests-lang.patch 1788 SHA256 0d2f6b061ed2b09babbb851d1bcebcd20bc2331c799d469bfefa2a985774e486 SHA512 1717c35f8b87aa694be75f2ca42162d06a66488e9ba2c004f0daebf4cd3cf06f65aa980adf745179408d55d45b6bbb889596d5f39b28c928a0ddfd273405ec8b WHIRLPOOL d418ae2f10f3f03f5b4e2601229bd30a8236cb18bded1edfb67f5c8791cfd3a1cf4bd3f535b6ca572844f72ce10f2a92e67e153f9de311196a75e96d57a95b2d
+AUX make-3.81-tests-recursion.patch 514 SHA256 727a42dd884d296d421342f374b95ac05eeaef67c5f5efe755f1242944aab74b SHA512 8119045661bb08d468a0975f6e0a9606768bb6122c9c5cdb9e8b74926cd37e0e1a5a60486aab306106d1c1de0b3a83b072a6999b3ba33d6a0befc333f658da00 WHIRLPOOL 77eef52ca8b00539c8d7cbd1cfcf9e930d48707c706897a082bc40f2c1cab82d14b3ec1d7eb5be5b248cee4999cb8d9234429fca6e0af71f914c214a8390582b
+AUX make-3.82-MAKEFLAGS-reexec.patch 456 SHA256 0180a94ab07bb9c1348ab30301afcbbe382a281c4c6f143de16e3bea3d96e00c SHA512 675c528ea92c9df487c0a9d9058a304f970543f71991c70cc1399f3b6582316dac8b387aa1a744b0d6dcbe215775efea4e936b09553bccbfced3dcbc28af5532 WHIRLPOOL 5da896f02f24c5813a25cfccc4029b4f0a674c2f10d86057bdc59bf4f8be24bfba2886a91c63feadf5805ab26c85098c6c3c5be7c4b1ceddc1edee6328874a88
+AUX make-3.82-archives-many-objs.patch 2110 SHA256 268db7c9e98f540ac9d5466bba17946f400463c1fd934d419e37fafaea7f0dd7 SHA512 c3669a4a2104621e3dab921793635c1443ec389ef160d1171d3181d58a1568d88ff35044b70298edef504f63e449ddb7fb27f9528cf588ca643dcdc3e40ebab7 WHIRLPOOL fc4e7b40bf67638c2e5ec476dd49a7ffd2dcd5aba465367ffbd734bec6b1c0a5b792cc704ba6414802318601ee558236d17b49bfdd7405610b0bb5f3bc0f9c06
+AUX make-3.82-construct-command-line.patch 2307 SHA256 5ba054cd764f493acc5f3f8acda9028e6fd2324508ca4dae7fbce04e491da0a5 SHA512 7c72bd7b9da986a8a37b047b7944a07b729fb16cd3413bce0e17008f2bbc4afabc48835580c4302d1381552873d1f07c93fbc4dfb6862eab0e46c62b0d35f557 WHIRLPOOL 59dae0e195a2fb6cdfb103f41870d31bae4d506df96b6e4abfbe96e39b35a6b6be9a25a7ce6663a67c3a842a09e8023e4c20754601dae1921514df77b6e3289a
+AUX make-3.82-copy-on-expand.patch 1812 SHA256 866a3942f9c747aecc5dd6c313f1fbd2f8f0b457a28197756c5713aefa45f543 SHA512 e7e31edfe3f11a91a4e2d0377a15328d6b54ab7b614c9d0c8ab6b18b5a8a5e2fa852ac7469bee685fcbdaa46d22f81fd585d0683a762afaa4160d7a7d5a558c8 WHIRLPOOL 4b8f123509131c495f15aacab0f906c864204c06554d07c5ac91d225ac6e4998d3fa1014a9780d8e3ef8a2c360c19a55bd84cd726f0ae0f150efdf92d3c60f11
+AUX make-3.82-darwin-library_search-dylib.patch 439 SHA256 726ddb522e6d46ac1fe29c0d76329c8264f53fc2a19baa94771e9299d9bfd54e SHA512 aaabf2e7faaa6f116c0124d30e8bc5c049fa471defc39c454e03e3f484265f30fc0388ea13154559925935d803315b5594780b41bbf1d1f7d1599a60f85cd8ac WHIRLPOOL 2a344dabd157fcb90ba97a8e774fb151cb32067b5cb8f8dda662be3ec9c425081e1a76d217448167ecc6b98e1699b2b6cd6580ccd0b8a465c0f91c254a76d6ee
+AUX make-3.82-glob-speedup.patch 2833 SHA256 525896b152bb314cbf3c465575394584305ded895429bf4ade919d69dedfec06 SHA512 de6bacc4e389c2308a92b77b6f21f752ed078af6f5320481f84e8344532825a5b2225ddb9c8eba40badf9d377d1e5546906ab265e5c08a815cce01b0832dfe1c WHIRLPOOL ac2101cc81778c6a425566224594a89a958ce1d7dbd9bfb1e71bdea3ed794aa4c7de0b970f1603240f0f1072ef61c18a5fd839badd904dd2f551579dd45d7399
+AUX make-3.82-intermediate-parallel.patch 1863 SHA256 05ba85e34ed727ea5bbeebcbeab467da1ec97edf7a9543b246896daa02b72a55 SHA512 6cebec44deda36e1a25fd5b0641ecfb90dc708d7d5dca2dd6108cc2bf0be142f26e96a5979a7b456c6f29517853e1abb7a755b078fef3c0f452437c7f0c38379 WHIRLPOOL 4ad303da4f73241ccb6a58f116b19d8f64fbe22bf2a6e0885c5df15ae95d3197fecda2a71a7b8f3be7a2de4362fd9de84359b7ee317154478b54b49389a994de
+AUX make-3.82-long-command-line.patch 1598 SHA256 da196f8050c717d42110e9328b3413a61719a7064e5b76bb1a539f492e6a1613 SHA512 b86336d6e337a8d7524a90ec75944772aab48cba45ab003adc5b71c3a4604350ecb16c398a003cd3ac7ff900d841b915d771626e9a8485778ce72e43510f107c WHIRLPOOL 8d9e9454cddef12e7def055add4a695f1c62ad13e57afec4219e3e88d290d12368dd27fb491f47fe8400ba8528755fc2faf90fae64e47daa79618358f8b17814
+AUX make-3.82-memory-corruption.patch 899 SHA256 8bb84e638f40514045f0c57b0ee9da24024679f624614e4d954ce7e8f6414d3b SHA512 a65428bf6a1ff3bbe811cbf633577f15399bdaeab11fab0e66a104987df4dffc7779753aaaaad0534e591ca6df2fbebfca6522b35487e6bf9166b0681c271ae8 WHIRLPOOL 0200c90954a948108b21e5cec6c95f02479bc0d189cc9cf76de6b0f4c3647225fde83e775b07f23cc4d0e040c02c3ca5972c2f75ac1da8f2ec4896ff21a6ea2f
+AUX make-3.82-oneshell.patch 931 SHA256 017bd61d9ed44a9cda3f7dc2c49d65be33b9b3a225580ad36e9caf5c8481f184 SHA512 85784dfcfeee2b7d7d3d659edc39a268165ab3f9dbd3d716ffcc7ba52cb44c3011cf5aa3e57cdab12f2f8aeec4ff00ffe82959aef242951f4dc1a7c6d4b55d89 WHIRLPOOL 287b8cefc2abfbe4a7825499f6c15db192be1b7941c25a1d5d260fc795a38bbb97923a8da5fe0035697c3dae36bd26b2633d316f6c9c9882be23aee51ece2d62
+AUX make-3.82-parallel-remake.patch 1422 SHA256 e2b63a63a44fb692798d237f888ad35a0899144fc5c6700270dee8ee455ac231 SHA512 640489810aa387524d5b7b0c38b22d13c423e1ca04c2a8915d1736904aa6e158f999eda5d6b0f17c21a85f97b490e73c85fd2d205d494c98099e379842a1fccc WHIRLPOOL cfc8ba57e22524ba675aa916eafcdc5b4bd2121f7d1dfd6cb73a2fadc365975af8360e61b70260632fa13292537ed7ea169861745deb3cd7956a6ff4ff364738
+AUX make-4.0-char-cast.patch 1399 SHA256 e713be18cd6cf63428ec35c9e0e6b097031fff3148716ae0ec329032a6d8805e SHA512 7d1490094b01362bba40cb0d2088d2ee79b9bd6756e4ea51920675ca305acfc653cdf92df5735e4e40360ece6c9de6dafcdd542df6b9821de8b1345b8ad2fb1b WHIRLPOOL 96df083fd4ed757d3e76a4074d49cf5fc93c63ef4ddc8b2a773ecda5a6ffd20335d7390c92795327977f0d8694f44a2dfbfb9fab91244afa807a5e73bebc9931
+AUX make-4.1-fix_null_returns_from_ttyname.patch 1888 SHA256 325db153f75e680de29fb05f6e341ebfde4f68f1b7fcc3ace602f30b07bafd5b SHA512 47eb22909be25618fbc120fe5b844207989135101ada960c69557f898b2345c52a25fc329945324cd968f19fc3835330d939cf4ec2faf5ccf5c54e20dc02a1da WHIRLPOOL 4d4920a02a59cbce9584857ced89139f60fd817ad1e0ab90eefc15328b4d7073f61063eafa21ac101574ae05ada24a789df89ba4045963de1c0746ddf9fae513
+AUX make-4.2-default-cxx.patch 269 SHA256 3e2e1102bcaca24599ab1796a08a43d6e98e882d2540a8ea3dac67774574b27f SHA512 b9c6254c8111111d9986de617023fad1673a8992d5a8b2e1e5ce32a92f5e4d064e1a9677b44f1d647a54ddd1c62782eccfd2d71ddc8d41baee141f65bdc894fe WHIRLPOOL 96c1b51e9a1ac6b555692a38a7e487c6ef2f919069d59c0ab31e6dbaa2d5a484161b3b7ddddb9dfb6f0527d8b0d65d04ff79fe6a88c6b727b5553e35a5dcb229
+DIST make-3.80.tar.bz2 920645 SHA256 a99b39e7b04c333724f48c38fede709481cfb69fafe7e32ae4285b7fadf92f1b SHA512 aadabe1f6a3acd438597b24465e06e34343fb020b4ca9336d2aa5b572ce530622785dde8215b3f4332ff75928f72c269b9b83dfecf470f522285e27109b7bdfd WHIRLPOOL 4564dd28addd0817e47e8e89b8eff6af601050a2b0062b9e6df0b66945c7a426fa2cda4624b420d2f026440650ab5a95f6acd058deb7d2af00baa549fc19ea1e
+DIST make-3.81.tar.bz2 1151445 SHA256 f3e69023771e23908f5d5592954d8271d3d6af09693cecfd29cee6fde8550dc8 SHA512 f38b8219a966b4756149a13435f5b9dc760814aa62c6add8e1760e602f65a83cd0a45ed457a5dbdd2fab91043af4de2c60e62154f95c6b625af3703c824eb653 WHIRLPOOL 39d33b8b9136a3a8cf732fe8f437729ab5d487dc3e6dca0cad6dcdea256eec799d19c6c8d2591c3b526e7bd4fdd901ca7eb1d9e77e525454a3e52e17fd181ce7
+DIST make-3.82.tar.bz2 1242186 SHA256 e2c1a73f179c40c71e2fe8abf8a8a0688b8499538512984da4a76958d0402966 SHA512 3260be0d1a9a7c5eb0dbb87179a9a9521fdfc7809ca51f13ee5a37ba5e63d21ad50a4249ec7d3929a9d0ce8c8f6cf302558743964f0f7ff742efe283b91df9de WHIRLPOOL 0b6b5f95f33e0e5584cddad234afb2350bbf62f2a9c280703345100eba7867d80412cbe1b22f429eb32db43dd37e665e0f136d0262ee3f030cf384f77e99d1cb
+DIST make-4.0.tar.bz2 1341927 SHA256 e60686c7afede62cc8c86ad3012cf081ea4887daf9d223ce7115703b2bb2dbdb SHA512 82de265963cd08701491e02a4917cd2097762657257a9508119e5847050d0cb15580c163159463e822860435c5910190677d8e4aba644ba75df2895f26117376 WHIRLPOOL 96984c0493651bf27db3ddd6fadde25678e512d4d134fd7063cc5cd54bff6228543c98463835940e19e1cc79a67e22067c889efd460b355438670a4d42ce0d09
+DIST make-4.1.tar.bz2 1327342 SHA256 0bc7613389650ee6a24554b52572a272f7356164fd2c4132b0bcf13123e4fca5 SHA512 3fcaf06660b7a5019937b81ee69fe54cdfe0a24d66286fc5cc6a34fa996d76dfe6fd5bc49ee59b727ae2b24ddca261ada0fdb5873ba2b38dcc63647ad3cdb193 WHIRLPOOL 992ae4e6dc5e82bb4dc1b5c0840fbc519769114e61233c2d1cf9badfd0cf52a618fde290cef6cdc13d6c098aea9a67c414655513acefb1d44b031e14fe43d544
+DIST make-4.2.1.tar.bz2 1407126 SHA256 d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589 SHA512 9cf00869a2f938492554f71d8cb288b5b009b3bd0489ef164f2c8f6532fc37db5c7e20af1dea288536e7c9710ee0bc6e1ddcdfc4928a8540e6e43661741825b8 WHIRLPOOL 51c953368a4e2f4ec1e99cbd7f1d3e7671c52051ea213fa849ff60de9a695fe69670be92708b794ae8a7326b91a4548d82de7e0be441f073fc1f3329cfc065e0
+EBUILD make-3.80-r4.ebuild 1024 SHA256 3b3ad652a65814c7cbd4207a499c3411bc9bf5f6c401d07dbcc3d3291e358053 SHA512 072bb62e7b41a1b1b7904f2bb4da50daa5d1355d7bccbac1ed58aad82dfe8e1fee5b963e2640566019617a9196880f93d1c3ea9a3ddfcd33d6e7e7af5aebee2b WHIRLPOOL aa2445a99a2530debfe7666d990af84e91340ac27f325d3e1a128b4188eaf94dd4a2638fe31bdc246e31c5ba2a2472fc70538cff0f17d60f646766c08af98b84
+EBUILD make-3.81-r2.ebuild 1198 SHA256 18ba4984a8102eb672e05a859e48aba328db54891513744cc2c5f5409bdf6d3f SHA512 d2348b81a5fbfb9406d8b2d178ce46dc9f91e6c492a10953f39a87fc977fed5a4a1644f76447c08ea45da97c01481f02b6e97ec0605d69313a54feb191bf4c1d WHIRLPOOL 12cb73d99b4c63fa11c9d317c4b4a9d2b18caddb6d0f961ff5a7bba2b92d7db0973e37b253084a561d95c139b0b4982055f09f09c7e50d3ec148872965b2a187
+EBUILD make-3.82-r4.ebuild 1698 SHA256 ec233d07e49f6e91a711e4bf92f77c3be246b48b99129cccf6b1f44fe48e4e50 SHA512 efe00112524c6dacac99d5c60b8cbddfa4942631450106ef35e822c854bf1fd32d56a487f6a96def9870b04e8a1a914e7055649ec9c295a920031629f902f3ea WHIRLPOOL 39a4eea0a86e424cfddaf35e88696bbd1a2d20d514b5405a20211e2564bc47ae910d590864957aa0b209908ef9129d8fbdc4aa208f860b5d0fc481b58c53a8c5
+EBUILD make-4.0-r1.ebuild 1296 SHA256 b7295d49d39a917d7ca008b275b87b8cae181235966dd861ac7c7d9df4bd456f SHA512 dae5616eedd77c83eb4b2cb9d54a02740df9f82f7d4333a9aad382f9137c039cf897a6758eb314afd9bc2ffac454fc9ae975b3d8a9d0b7761ae4d0d9afe2367d WHIRLPOOL 3e3af52f6ced9cf0d07ff392e091f0b3139434dc71babdc173ada849e3fafb09de3897e0ea5f74e51351bb1cf722d170a1e5ceedcf47a4f7025a03ae930b69de
+EBUILD make-4.1-r1.ebuild 1306 SHA256 9c406b1538084d329c1e04d01da6863084b3db12c30147eb4ae39cfbaf9f9beb SHA512 42ba99cd73a1af23b15cca67afa469fa048c77a7a1e0870f94e8f6eb81b825ca2a379e49a1c4093d45771db8b625545cb5f362c815c1012474c4b5bbf6c73809 WHIRLPOOL c103cd25cbf22271f5423363f9d7742b3b43fc17b1b37ea12cdb0a4f507029cdfadb17a06efc0816d541021633d3ee88ba4e66de809849c33606d5d7b5bb2cec
+EBUILD make-4.2.1-r1.ebuild 1343 SHA256 7100017e5597d4bdbc6734f39b265c3f2620914c5621b57b5c3cad3ee7415076 SHA512 3c990f6788274012a5db9f18c04901b6761c7729bd78fc583f629f8a6e7f3e3c9a696afe8e9483fbff8fd685acd2c03bab256b2aad11331efc493120d3e863f3 WHIRLPOOL 1e20db182b7917f2d78006f8a22b70bf7e89a5ad7b27440145e5a491d32dc1fead50bf4862cdf95d21ca4181bb557c44f7e395058e8ca416f0887347bdd01dc8
+EBUILD make-4.2.1.ebuild 1291 SHA256 3d742c70fccc645ff79a97f353342afc77a5adee2082c52d9683a52fb94a5935 SHA512 ef759245fedebf4ee4f83686b10ecc50d53dc80c99c5fe9933f1738b04ea641685ce74583f04bfbbe8bfc84257f82511a7eafc010b5f05cf755599205fa200f1 WHIRLPOOL 1f155490b49a47d8539fc095dcda50fd2a55cd98984da2f6b1639f337871cf8405b90cf260dbb0bdd655b6f302cc2f1dd1678fbe709139eeb4b390d911bfad75
+MISC ChangeLog 5709 SHA256 eec1b695efb46f1db754046e8fd2c1b41b8ce0495ca8dbe6bb7f9337beb51d57 SHA512 85887c429d69fb6af1d823c2a6023b072438ab902bc3713a1f343b6601ecbaaf534f2364efd4f6b700d0230308c6e66faf87ce523588a233b29d786c9636c604 WHIRLPOOL 674baf7c652517865e316a86fd96fd07dec057c6ecb56f905a0eb74e2553be7736826f03ad1e98500e75775f5f0fa32ec66d8f933d816358116d42e91df1c97e
+MISC ChangeLog-2015 18347 SHA256 1ae3c0c93f7f5c97fd21dd8890a4a9701802b08713e6c1ffe05ab48e21994ea1 SHA512 df210658a1d5036b7fe188834a66818343bf8f94716fffbfeeedd343ffa12d32d465bb7104753ef69b052c151458bbc21627009608e7ac28bcf843b50f265e75 WHIRLPOOL efcf138911b6d2bb39746997f1e75795b1a7cf3e448a5957418577d5d20b09df5cac68906e30d7ef8c299228d5b981379ccb5e9d483b68375d4347fb9a817f04
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/make/files/3.80-memory.patch b/sys-devel/make/files/3.80-memory.patch
new file mode 100644
index 000000000000..663acf52d77c
--- /dev/null
+++ b/sys-devel/make/files/3.80-memory.patch
@@ -0,0 +1,77 @@
+Index: variable.h
+===================================================================
+RCS file: /cvsroot/make/make/variable.h,v
+retrieving revision 1.24
+diff -u -B -b -r1.24 variable.h
+--- variable.h 8 Aug 2002 00:11:19 -0000 1.24
++++ variable.h 25 Oct 2002 21:37:32 -0000
+@@ -107,6 +107,8 @@
+ extern char *expand_argument PARAMS ((char *str, char *end));
+ extern char *variable_expand_string PARAMS ((char *line, char *string,
+ long length));
++extern void install_variable_buffer PARAMS ((char **bufp, unsigned int *lenp));
++extern void restore_variable_buffer PARAMS ((char *buf, unsigned int len));
+
+ /* function.c */
+ extern int handle_function PARAMS ((char **op, char **stringp));
+Index: expand.c
+===================================================================
+RCS file: /cvsroot/make/make/expand.c,v
+retrieving revision 1.33
+diff -u -B -b -r1.33 expand.c
+--- expand.c 14 Oct 2002 21:54:04 -0000 1.33
++++ expand.c 25 Oct 2002 21:37:32 -0000
+@@ -545,3 +545,28 @@
+
+ return value;
+ }
++
++/* Install a new variable_buffer context, returning the current one for
++ safe-keeping. */
++
++void
++install_variable_buffer (char **bufp, unsigned int *lenp)
++{
++ *bufp = variable_buffer;
++ *lenp = variable_buffer_length;
++
++ variable_buffer = 0;
++ initialize_variable_output ();
++}
++
++/* Restore a previously-saved variable_buffer setting (free the current one).
++ */
++
++void
++restore_variable_buffer (char *buf, unsigned int len)
++{
++ free (variable_buffer);
++
++ variable_buffer = buf;
++ variable_buffer_length = len;
++}
+Index: function.c
+===================================================================
+RCS file: /cvsroot/make/make/function.c,v
+retrieving revision 1.71
+diff -u -B -b -r1.71 function.c
+--- function.c 14 Oct 2002 21:54:04 -0000 1.71
++++ function.c 25 Oct 2002 21:37:32 -0000
+@@ -1196,7 +1196,17 @@
+ static char *
+ func_eval (char *o, char **argv, const char *funcname)
+ {
++ char *buf;
++ unsigned int len;
++
++ /* Eval the buffer. Pop the current variable buffer setting so that the
++ eval'd code can use its own without conflicting. */
++
++ install_variable_buffer (&buf, &len);
++
+ eval_buffer (argv[0]);
++
++ restore_variable_buffer (buf, len);
+
+ return o;
+ } \ No newline at end of file
diff --git a/sys-devel/make/files/make-3.80-conditional-eval.patch b/sys-devel/make/files/make-3.80-conditional-eval.patch
new file mode 100644
index 000000000000..f4c1581f316f
--- /dev/null
+++ b/sys-devel/make/files/make-3.80-conditional-eval.patch
@@ -0,0 +1,157 @@
+Fix from upstream
+
+https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=1516
+http://bugs.gentoo.org/123317
+
+Index: read.c
+===================================================================
+RCS file: /cvsroot/make/make/read.c,v
+retrieving revision 1.124
+retrieving revision 1.125
+diff -u -p -r1.124 -r1.125
+--- read.c 14 Oct 2002 21:54:04 -0000 1.124
++++ read.c 25 Oct 2002 22:01:47 -0000 1.125
+@@ -272,6 +272,34 @@ read_all_makefiles (char **makefiles)
+ return read_makefiles;
+ }
+
++/* Install a new conditional and return the previous one. */
++
++static struct conditionals *
++install_conditionals (struct conditionals *new)
++{
++ struct conditionals *save = conditionals;
++
++ bzero ((char *) new, sizeof (*new));
++ conditionals = new;
++
++ return save;
++}
++
++/* Free the current conditionals and reinstate a saved one. */
++
++static void
++restore_conditionals (struct conditionals *saved)
++{
++ /* Free any space allocated by conditional_line. */
++ if (conditionals->ignoring)
++ free (conditionals->ignoring);
++ if (conditionals->seen_else)
++ free (conditionals->seen_else);
++
++ /* Restore state. */
++ conditionals = saved;
++}
++
+ static int
+ eval_makefile (char *filename, int flags)
+ {
+@@ -388,6 +416,8 @@ int
+ eval_buffer (char *buffer)
+ {
+ struct ebuffer ebuf;
++ struct conditionals *saved;
++ struct conditionals new;
+ const struct floc *curfile;
+ int r;
+
+@@ -402,8 +432,12 @@ eval_buffer (char *buffer)
+ curfile = reading_file;
+ reading_file = &ebuf.floc;
+
++ saved = install_conditionals (&new);
++
+ r = eval (&ebuf, 1);
+
++ restore_conditionals (saved);
++
+ reading_file = curfile;
+
+ return r;
+@@ -412,13 +446,8 @@ eval_buffer (char *buffer)
+
+ /* Read file FILENAME as a makefile and add its contents to the data base.
+
+- SET_DEFAULT is true if we are allowed to set the default goal.
++ SET_DEFAULT is true if we are allowed to set the default goal. */
+
+- FILENAME is added to the `read_makefiles' chain.
+-
+- Returns 0 if a file was not found or not read.
+- Returns 1 if FILENAME was found and read.
+- Returns 2 if FILENAME was read, and we kept a reference (don't free it). */
+
+ static int
+ eval (struct ebuffer *ebuf, int set_default)
+@@ -782,9 +811,7 @@ eval (struct ebuffer *ebuf, int set_defa
+
+ /* Save the state of conditionals and start
+ the included makefile with a clean slate. */
+- save = conditionals;
+- bzero ((char *) &new_conditionals, sizeof new_conditionals);
+- conditionals = &new_conditionals;
++ save = install_conditionals (&new_conditionals);
+
+ /* Record the rules that are waiting so they will determine
+ the default goal before those in the included makefile. */
+@@ -810,14 +837,8 @@ eval (struct ebuffer *ebuf, int set_defa
+ }
+ }
+
+- /* Free any space allocated by conditional_line. */
+- if (conditionals->ignoring)
+- free (conditionals->ignoring);
+- if (conditionals->seen_else)
+- free (conditionals->seen_else);
+-
+- /* Restore state. */
+- conditionals = save;
++ /* Restore conditional state. */
++ restore_conditionals (save);
+
+ goto rule_complete;
+ }
+Index: tests/scripts/functions/eval
+===================================================================
+RCS file: /cvsroot/make/make/tests/scripts/functions/eval,v
+retrieving revision 1.1
+retrieving revision 1.2
+diff -u -p -r1.1 -r1.2
+--- tests/scripts/functions/eval 8 Jul 2002 02:26:48 -0000 1.1
++++ tests/scripts/functions/eval 25 Oct 2002 22:01:47 -0000 1.2
+@@ -57,4 +57,35 @@ $answer = "A = A B = B\n";
+
+ &compare_output($answer,&get_logfile(1));
+
++# Test to make sure eval'ing inside conditionals works properly
++
++$makefile3 = &get_tmpfile;
++
++open(MAKEFILE,"> $makefile3");
++
++print MAKEFILE <<'EOF';
++FOO = foo
++
++all:: ; @echo it
++
++define Y
++ all:: ; @echo worked
++endef
++
++ifdef BAR
++$(eval $(Y))
++endif
++
++EOF
++
++close(MAKEFILE);
++
++&run_make_with_options($makefile3, "", &get_logfile);
++$answer = "it\n";
++&compare_output($answer,&get_logfile(1));
++
++&run_make_with_options($makefile3, "BAR=1", &get_logfile);
++$answer = "it\nworked\n";
++&compare_output($answer,&get_logfile(1));
++
+ 1;
diff --git a/sys-devel/make/files/make-3.80-parallel-build-failure.patch b/sys-devel/make/files/make-3.80-parallel-build-failure.patch
new file mode 100644
index 000000000000..717e0f3556ce
--- /dev/null
+++ b/sys-devel/make/files/make-3.80-parallel-build-failure.patch
@@ -0,0 +1,59 @@
+http://lists.gnu.org/archive/html/bug-make/2005-07/msg00050.html
+http://lists.gnu.org/archive/html/bug-make/2005-08/msg00019.html
+http://bugs.gentoo.org/107613
+
+2005-08-07 Paul D. Smith <psmith@gnu.org>
+
+ Fix a bug reported by Michael Matz <matz@suse.de>: patch included.
+ If make is running in parallel without -k and two jobs die in a
+ row, but not too close to each other, then make will quit without
+ waiting for the rest of the jobs to die.
+
+ * main.c (die): Don't reset err before calling reap_children() the
+ second time: we still want it to be in the error condition.
+ * job.c (reap_children): Use a static variable, rather than err,
+ to control whether or not the error message should be printed.
+
+Index: job.c
+===================================================================
+RCS file: /cvsroot/make/make/job.c,v
+retrieving revision 1.166
+retrieving revision 1.167
+diff -u -p -r1.166 -r1.167
+--- job.c 26 Jun 2005 03:31:30 -0000 1.166
++++ job.c 8 Aug 2005 05:08:00 -0000 1.167
+@@ -475,9 +479,14 @@ reap_children (int block, int err)
+
+ if (err && block)
+ {
+- /* We might block for a while, so let the user know why. */
++ static int printed = 0;
++
++ /* We might block for a while, so let the user know why.
++ Only print this message once no matter how many jobs are left. */
+ fflush (stdout);
+- error (NILF, _("*** Waiting for unfinished jobs...."));
++ if (!printed)
++ error (NILF, _("*** Waiting for unfinished jobs...."));
++ printed = 1;
+ }
+
+ /* We have one less dead child to reap. As noted in
+Index: main.c
+===================================================================
+RCS file: /cvsroot/make/make/main.c,v
+retrieving revision 1.210
+retrieving revision 1.211
+diff -u -p -r1.210 -r1.211
+--- main.c 12 Jul 2005 04:35:13 -0000 1.210
++++ main.c 8 Aug 2005 05:08:00 -0000 1.211
+@@ -2990,7 +2996,8 @@ die (int status)
+ print_version ();
+
+ /* Wait for children to die. */
+- for (err = (status != 0); job_slots_used > 0; err = 0)
++ err = (status != 0);
++ while (job_slots_used > 0)
+ reap_children (1, err);
+
+ /* Let the remote job module clean up its state. */
diff --git a/sys-devel/make/files/make-3.81-jobserver.patch b/sys-devel/make/files/make-3.81-jobserver.patch
new file mode 100644
index 000000000000..cd787ca769d2
--- /dev/null
+++ b/sys-devel/make/files/make-3.81-jobserver.patch
@@ -0,0 +1,19 @@
+related to bug #193258, but this is the final patch that Fedora went with
+
+--- make-3.81/main.c 2007-09-24 15:28:34.000000000 +0200
++++ make-3.81-pm/main.c 2007-09-24 15:32:50.000000000 +0200
+@@ -1669,8 +1669,12 @@ main (int argc, char **argv, char **envp
+
+ if (job_slots > 0)
+ {
+- close (job_fds[0]);
+- close (job_fds[1]);
++ if (restarts == 0)
++ {
++ close (job_fds[0]);
++ close (job_fds[1]);
++ }
++
+ job_fds[0] = job_fds[1] = -1;
+ free (jobserver_fds->list);
+ free (jobserver_fds);
diff --git a/sys-devel/make/files/make-3.81-long-cmdline.patch b/sys-devel/make/files/make-3.81-long-cmdline.patch
new file mode 100644
index 000000000000..9ceb5e8195e2
--- /dev/null
+++ b/sys-devel/make/files/make-3.81-long-cmdline.patch
@@ -0,0 +1,100 @@
+http://bugs.gentoo.org/301116
+
+tweaked a little to avoid regenerating autotools
+
+2009-07-29 Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
+
+ * configure.in: Check for sys/user.h and linux/binfmts.h
+ headers.
+ * job.c: Include them if available.
+ (construct_command_argv_internal): When constructing the command
+ line with 'sh -c', use multiple arguments together with eval
+ expansion to evade the Linux per-argument length limit
+ MAX_ARG_STRLEN if it is defined.
+ Problem reported against Automake by Xan Lopez <xan <at> gnome.org>.
+
+--- job.c.orig 2010-01-15 18:36:53.000000000 +0200
++++ job.c 2010-01-15 18:41:09.000000000 +0200
+@@ -29,6 +29,15 @@
+
+ #include <string.h>
+
++#if defined(__linux__) /* defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H) */
++#include <sys/user.h>
++#include <unistd.h>
++#ifndef PAGE_SIZE
++#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
++#endif
++#include <linux/binfmts.h>
++#endif
++
+ /* Default shell to use. */
+ #ifdef WINDOWS32
+ #include <windows.h>
+@@ -2697,9 +2702,19 @@
+ #endif
+ unsigned int line_len = strlen (line);
+
++#ifdef MAX_ARG_STRLEN
++ static char eval_line[] = "eval\\ \\\"set\\ x\\;\\ shift\\;\\ ";
++#define ARG_NUMBER_DIGITS 5
++#define EVAL_LEN (sizeof(eval_line)-1 + shell_len + 4 \
++ + (7 + ARG_NUMBER_DIGITS) * 2 * line_len / (MAX_ARG_STRLEN - 2))
++#else
++#define EVAL_LEN 0
++#endif
+ char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1)
+- + (line_len * 2) + 1);
++ + (line_len*2) + 1 + EVAL_LEN);
++
+ char *command_ptr = NULL; /* used for batch_mode_shell mode */
++ char *args_ptr;
+
+ # ifdef __EMX__ /* is this necessary? */
+ if (!unixy_shell)
+@@ -2712,6 +2727,30 @@
+ bcopy (minus_c, ap, sizeof (minus_c) - 1);
+ ap += sizeof (minus_c) - 1;
+ command_ptr = ap;
++
++#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN)
++ if (unixy_shell && line_len > MAX_ARG_STRLEN)
++ {
++ unsigned j;
++ memcpy (ap, eval_line, sizeof (eval_line) - 1);
++ ap += sizeof (eval_line) - 1;
++ for (j = 1; j <= 2 * line_len / (MAX_ARG_STRLEN - 2); j++)
++ ap += sprintf (ap, "\\$\\{%u\\}", j);
++ *ap++ = '\\';
++ *ap++ = '"';
++ *ap++ = ' ';
++ /* Copy only the first word of SHELL to $0. */
++ for (p = shell; *p != '\0'; ++p)
++ {
++ if (isspace ((unsigned char)*p))
++ break;
++ *ap++ = *p;
++ }
++ *ap++ = ' ';
++ }
++#endif
++ args_ptr = ap;
++
+ for (p = line; *p != '\0'; ++p)
+ {
+ if (restp != NULL && *p == '\n')
+@@ -2760,6 +2799,14 @@
+ }
+ #endif
+ *ap++ = *p;
++
++#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN)
++ if (unixy_shell && line_len > MAX_ARG_STRLEN && (ap - args_ptr > MAX_ARG_STRLEN - 2))
++ {
++ *ap++ = ' ';
++ args_ptr = ap;
++ }
++#endif
+ }
+ if (ap == new_line + shell_len + sizeof (minus_c) - 1)
+ /* Line was empty. */
diff --git a/sys-devel/make/files/make-3.81-tests-lang.patch b/sys-devel/make/files/make-3.81-tests-lang.patch
new file mode 100644
index 000000000000..f4e514712a0e
--- /dev/null
+++ b/sys-devel/make/files/make-3.81-tests-lang.patch
@@ -0,0 +1,55 @@
+Fix from upstream for running tests when LC_ALL is set to non-C
+
+http://bugs.gentoo.org/149147
+
+Index: make/tests/run_make_tests.pl
+===================================================================
+RCS file: /cvsroot/make/make/tests/run_make_tests.pl,v
+retrieving revision 1.22
+retrieving revision 1.23
+diff -u -p -r1.22 -r1.23
+--- make/tests/run_make_tests.pl 8 Mar 2006 20:15:09 -0000 1.22
++++ make/tests/run_make_tests.pl 1 Oct 2006 05:38:38 -0000 1.23
+@@ -228,11 +228,6 @@ sub set_more_defaults
+ local($string);
+ local($index);
+
+- # Make sure we're in the C locale for those systems that support it,
+- # so sorting, etc. is predictable.
+- #
+- $ENV{LANG} = 'C';
+-
+ # find the type of the port. We do this up front to have a single
+ # point of change if it needs to be tweaked.
+ #
+Index: make/tests/test_driver.pl
+===================================================================
+RCS file: /cvsroot/make/make/tests/test_driver.pl,v
+retrieving revision 1.19
+retrieving revision 1.20
+diff -u -p -r1.19 -r1.20
+--- make/tests/test_driver.pl 10 Mar 2006 02:20:45 -0000 1.19
++++ make/tests/test_driver.pl 1 Oct 2006 05:38:38 -0000 1.20
+@@ -78,9 +78,9 @@ sub resetENV
+ sub toplevel
+ {
+ # Pull in benign variables from the user's environment
+- #
++
+ foreach (# UNIX-specific things
+- 'TZ', 'LANG', 'TMPDIR', 'HOME', 'USER', 'LOGNAME', 'PATH',
++ 'TZ', 'TMPDIR', 'HOME', 'USER', 'LOGNAME', 'PATH',
+ # Purify things
+ 'PURIFYOPTIONS',
+ # Windows NT-specific stuff
+@@ -92,6 +92,10 @@ sub toplevel
+ $makeENV{$_} = $ENV{$_} if $ENV{$_};
+ }
+
++ # Make sure our compares are not foiled by locale differences
++
++ $makeENV{LC_ALL} = 'C';
++
+ # Replace the environment with the new one
+ #
+ %origENV = %ENV;
diff --git a/sys-devel/make/files/make-3.81-tests-recursion.patch b/sys-devel/make/files/make-3.81-tests-recursion.patch
new file mode 100644
index 000000000000..490e2a912cd8
--- /dev/null
+++ b/sys-devel/make/files/make-3.81-tests-recursion.patch
@@ -0,0 +1,14 @@
+http://bugs.gentoo.org/329153
+https://savannah.gnu.org/bugs/index.php?29968
+
+--- tests/scripts/features/recursion 2005/02/10 00:10:58 1.2
++++ tests/scripts/features/recursion 2010/07/01 07:16:00 1.3
+@@ -16,7 +16,7 @@
+ @echo MAKELEVEL = $(MAKELEVEL)
+ @echo THE END
+ ',
+- ('CFLAGS=-O -w' . ($parallel_jobs ? '-j 2' : '')),
++ ('CFLAGS=-O -w' . ($parallel_jobs ? ' -j 2' : '')),
+ ($vos
+ ? "#MAKE#: Entering directory `#PWD#'
+ make 'CFLAGS=-O' -f #MAKEFILE# foo
diff --git a/sys-devel/make/files/make-3.82-MAKEFLAGS-reexec.patch b/sys-devel/make/files/make-3.82-MAKEFLAGS-reexec.patch
new file mode 100644
index 000000000000..a2f59657d4ca
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-MAKEFLAGS-reexec.patch
@@ -0,0 +1,14 @@
+http://bugs.gentoo.org/331975
+https://savannah.gnu.org/bugs/?30723
+
+--- main.c 2010/07/19 07:10:53 1.243
++++ main.c 2010/08/10 07:35:34 1.244
+@@ -2093,7 +2093,7 @@
+ const char *pv = define_makeflags (1, 1);
+ char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
+ sprintf (p, "MAKEFLAGS=%s", pv);
+- putenv (p);
++ putenv (allocated_variable_expand (p));
+ }
+
+ if (ISDB (DB_BASIC))
diff --git a/sys-devel/make/files/make-3.82-archives-many-objs.patch b/sys-devel/make/files/make-3.82-archives-many-objs.patch
new file mode 100644
index 000000000000..abdcd3228014
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-archives-many-objs.patch
@@ -0,0 +1,60 @@
+http://bugs.gentoo.org/334889
+https://savannah.gnu.org/bugs/?30612
+
+revision 1.194
+date: 2010-08-13 22:50:14 -0400; author: psmith; state: Exp; lines: +9 -6; commitid: 4UaslPqQHZTs5wKu;
+- Fix Savannah bug #30612: handling of archive references with >1 object
+
+Index: read.c
+===================================================================
+RCS file: /sources/make/make/read.c,v
+retrieving revision 1.193
+retrieving revision 1.194
+diff -u -p -r1.193 -r1.194
+--- read.c 13 Jul 2010 01:20:42 -0000 1.193
++++ read.c 14 Aug 2010 02:50:14 -0000 1.194
+@@ -3028,7 +3028,7 @@ parse_file_seq (char **stringp, unsigned
+ {
+ /* This looks like the first element in an open archive group.
+ A valid group MUST have ')' as the last character. */
+- const char *e = p + nlen;
++ const char *e = p;
+ do
+ {
+ e = next_token (e);
+@@ -3084,19 +3084,19 @@ parse_file_seq (char **stringp, unsigned
+ Go to the next item in the string. */
+ if (flags & PARSEFS_NOGLOB)
+ {
+- NEWELT (concat (2, prefix, tp));
++ NEWELT (concat (2, prefix, tmpbuf));
+ continue;
+ }
+
+ /* If we get here we know we're doing glob expansion.
+ TP is a string in tmpbuf. NLEN is no longer used.
+ We may need to do more work: after this NAME will be set. */
+- name = tp;
++ name = tmpbuf;
+
+ /* Expand tilde if applicable. */
+- if (tp[0] == '~')
++ if (tmpbuf[0] == '~')
+ {
+- tildep = tilde_expand (tp);
++ tildep = tilde_expand (tmpbuf);
+ if (tildep != 0)
+ name = tildep;
+ }
+@@ -3152,7 +3152,10 @@ parse_file_seq (char **stringp, unsigned
+ else
+ {
+ /* We got a chain of items. Attach them. */
+- (*newp)->next = found;
++ if (*newp)
++ (*newp)->next = found;
++ else
++ *newp = found;
+
+ /* Find and set the new end. Massage names if necessary. */
+ while (1)
diff --git a/sys-devel/make/files/make-3.82-construct-command-line.patch b/sys-devel/make/files/make-3.82-construct-command-line.patch
new file mode 100644
index 000000000000..c504c45291ba
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-construct-command-line.patch
@@ -0,0 +1,71 @@
+https://savannah.gnu.org/bugs/?23922
+
+From 6f3684710a0f832533191f8657a57bc2fbba90ba Mon Sep 17 00:00:00 2001
+From: eliz <eliz>
+Date: Sat, 7 May 2011 08:29:13 +0000
+Subject: [PATCH] job.c (construct_command_argv_internal): Don't assume
+ shellflags is always non-NULL. Escape-protect characters
+ special to the shell when copying the value of SHELL into
+ new_line. Fixes Savannah bug #23922.
+
+---
+ ChangeLog | 7 +++++++
+ job.c | 23 ++++++++++++++++-------
+ 2 files changed, 23 insertions(+), 7 deletions(-)
+
+diff --git a/job.c b/job.c
+index 67b402d..c2ce84d 100644
+--- a/job.c
++++ b/job.c
+@@ -2844,12 +2844,12 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+
+ unsigned int shell_len = strlen (shell);
+ unsigned int line_len = strlen (line);
+- unsigned int sflags_len = strlen (shellflags);
++ unsigned int sflags_len = shellflags ? strlen (shellflags) : 0;
+ char *command_ptr = NULL; /* used for batch_mode_shell mode */
+ char *new_line;
+
+ # ifdef __EMX__ /* is this necessary? */
+- if (!unixy_shell)
++ if (!unixy_shell && shellflags)
+ shellflags[0] = '/'; /* "/c" */
+ # endif
+
+@@ -2911,19 +2911,28 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+
+ new_argv = xmalloc (4 * sizeof (char *));
+ new_argv[0] = xstrdup(shell);
+- new_argv[1] = xstrdup(shellflags);
++ new_argv[1] = xstrdup(shellflags ? shellflags : "");
+ new_argv[2] = line;
+ new_argv[3] = NULL;
+ return new_argv;
+ }
+
+- new_line = alloca (shell_len + 1 + sflags_len + 1
++ new_line = alloca ((shell_len*2) + 1 + sflags_len + 1
+ + (line_len*2) + 1);
+ ap = new_line;
+- memcpy (ap, shell, shell_len);
+- ap += shell_len;
++ /* Copy SHELL, escaping any characters special to the shell. If
++ we don't escape them, construct_command_argv_internal will
++ recursively call itself ad nauseam, or until stack overflow,
++ whichever happens first. */
++ for (p = shell; *p != '\0'; ++p)
++ {
++ if (strchr (sh_chars, *p) != 0)
++ *(ap++) = '\\';
++ *(ap++) = *p;
++ }
+ *(ap++) = ' ';
+- memcpy (ap, shellflags, sflags_len);
++ if (shellflags)
++ memcpy (ap, shellflags, sflags_len);
+ ap += sflags_len;
+ *(ap++) = ' ';
+ command_ptr = ap;
+--
+1.7.12
+
diff --git a/sys-devel/make/files/make-3.82-copy-on-expand.patch b/sys-devel/make/files/make-3.82-copy-on-expand.patch
new file mode 100644
index 000000000000..3f202b4db96b
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-copy-on-expand.patch
@@ -0,0 +1,58 @@
+fix from upstream cvs
+
+----------------------------
+revision 1.58
+date: 2011-08-29 12:20:19 -0400; author: psmith; state: Exp; lines: +7 -13; commitid: MdH0jSxpuIy7mqxv;
+Save strings we're expanding in case an embedded eval causes them
+to be freed (if they're the value of a variable that's reset for example).
+See Savannah patch #7534
+
+Index: expand.c
+===================================================================
+RCS file: /sources/make/make/expand.c,v
+retrieving revision 1.57
+retrieving revision 1.58
+diff -u -p -r1.57 -r1.58
+--- expand.c 7 May 2011 20:03:49 -0000 1.57
++++ expand.c 29 Aug 2011 16:20:19 -0000 1.58
+@@ -197,7 +197,7 @@ variable_expand_string (char *line, cons
+ {
+ struct variable *v;
+ const char *p, *p1;
+- char *abuf = NULL;
++ char *save;
+ char *o;
+ unsigned int line_offset;
+
+@@ -212,16 +212,11 @@ variable_expand_string (char *line, cons
+ return (variable_buffer);
+ }
+
+- /* If we want a subset of the string, allocate a temporary buffer for it.
+- Most of the functions we use here don't work with length limits. */
+- if (length > 0 && string[length] != '\0')
+- {
+- abuf = xmalloc(length+1);
+- memcpy(abuf, string, length);
+- abuf[length] = '\0';
+- string = abuf;
+- }
+- p = string;
++ /* We need a copy of STRING: due to eval, it's possible that it will get
++ freed as we process it (it might be the value of a variable that's reset
++ for example). Also having a nil-terminated string is handy. */
++ save = length < 0 ? xstrdup (string) : xstrndup (string, length);
++ p = save;
+
+ while (1)
+ {
+@@ -411,8 +406,7 @@ variable_expand_string (char *line, cons
+ ++p;
+ }
+
+- if (abuf)
+- free (abuf);
++ free (save);
+
+ variable_buffer_output (o, "", 1);
+ return (variable_buffer + line_offset);
diff --git a/sys-devel/make/files/make-3.82-darwin-library_search-dylib.patch b/sys-devel/make/files/make-3.82-darwin-library_search-dylib.patch
new file mode 100644
index 000000000000..de7e4f615212
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-darwin-library_search-dylib.patch
@@ -0,0 +1,17 @@
+Fixed default libpatttern on Darwin, imported from prefix overlay.
+Got merged upstream:
+https://savannah.gnu.org/bugs/?37197
+--- default.c.orig 2009-05-02 12:25:24 +0200
++++ default.c 2009-05-02 12:25:58 +0200
+@@ -509,7 +509,11 @@
+ #ifdef __MSDOS__
+ ".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
+ #else
++#ifdef __APPLE__
++ ".LIBPATTERNS", "lib%.dylib lib%.a",
++#else
+ ".LIBPATTERNS", "lib%.so lib%.a",
++#endif
+ #endif
+ #endif
+
diff --git a/sys-devel/make/files/make-3.82-glob-speedup.patch b/sys-devel/make/files/make-3.82-glob-speedup.patch
new file mode 100644
index 000000000000..c826c2c0e1fa
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-glob-speedup.patch
@@ -0,0 +1,104 @@
+change from upstream to speed up by skipping unused globs
+https://bugs.gentoo.org/382845
+
+http://cvs.savannah.gnu.org/viewvc/make/read.c?root=make&r1=1.198&r2=1.200
+
+Revision 1.200
+Sat May 7 14:36:12 2011 UTC (4 months, 1 week ago) by psmith
+Branch: MAIN
+Changes since 1.199: +1 -1 lines
+Inverted the boolean test from what I wanted it to be. Added a
+regression test to make sure this continues to work.
+
+Revision 1.199
+Mon May 2 00:18:06 2011 UTC (4 months, 2 weeks ago) by psmith
+Branch: MAIN
+Changes since 1.198: +35 -25 lines
+Avoid invoking glob() unless the filename has potential globbing
+characters in it, for performance improvements.
+
+--- a/read.c 2011/04/29 15:27:39 1.198
++++ b/read.c 2011/05/07 14:36:12 1.200
+@@ -2901,6 +2901,7 @@
+ const char *name;
+ const char **nlist = 0;
+ char *tildep = 0;
++ int globme = 1;
+ #ifndef NO_ARCHIVES
+ char *arname = 0;
+ char *memname = 0;
+@@ -3109,32 +3110,40 @@
+ }
+ #endif /* !NO_ARCHIVES */
+
+- switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
+- {
+- case GLOB_NOSPACE:
+- fatal (NILF, _("virtual memory exhausted"));
+-
+- case 0:
+- /* Success. */
+- i = gl.gl_pathc;
+- nlist = (const char **)gl.gl_pathv;
+- break;
+-
+- case GLOB_NOMATCH:
+- /* If we want only existing items, skip this one. */
+- if (flags & PARSEFS_EXISTS)
+- {
+- i = 0;
+- break;
+- }
+- /* FALLTHROUGH */
+-
+- default:
+- /* By default keep this name. */
++ /* glob() is expensive: don't call it unless we need to. */
++ if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL)
++ {
++ globme = 0;
+ i = 1;
+ nlist = &name;
+- break;
+- }
++ }
++ else
++ switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
++ {
++ case GLOB_NOSPACE:
++ fatal (NILF, _("virtual memory exhausted"));
++
++ case 0:
++ /* Success. */
++ i = gl.gl_pathc;
++ nlist = (const char **)gl.gl_pathv;
++ break;
++
++ case GLOB_NOMATCH:
++ /* If we want only existing items, skip this one. */
++ if (flags & PARSEFS_EXISTS)
++ {
++ i = 0;
++ break;
++ }
++ /* FALLTHROUGH */
++
++ default:
++ /* By default keep this name. */
++ i = 1;
++ nlist = &name;
++ break;
++ }
+
+ /* For each matched element, add it to the list. */
+ while (i-- > 0)
+@@ -3174,7 +3183,8 @@
+ #endif /* !NO_ARCHIVES */
+ NEWELT (concat (2, prefix, nlist[i]));
+
+- globfree (&gl);
++ if (globme)
++ globfree (&gl);
+
+ #ifndef NO_ARCHIVES
+ if (arname)
diff --git a/sys-devel/make/files/make-3.82-intermediate-parallel.patch b/sys-devel/make/files/make-3.82-intermediate-parallel.patch
new file mode 100644
index 000000000000..df9b8d475b95
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-intermediate-parallel.patch
@@ -0,0 +1,62 @@
+https://savannah.gnu.org/bugs/?30653
+https://bugs.gentoo.org/431250
+
+From d1ba0ee36b2bdd91434b5df90f0f4cceda7d6979 Mon Sep 17 00:00:00 2001
+From: psmith <psmith>
+Date: Mon, 10 Sep 2012 02:36:05 +0000
+Subject: [PATCH] Force intermediate targets to be considered if their
+ non-intermediate parent needs to be remade. Fixes Savannah
+ bug #30653.
+
+---
+ ChangeLog | 4 ++++
+ remake.c | 4 ++++
+ tests/scripts/features/parallelism | 17 +++++++++++++++++
+ 3 files changed, 25 insertions(+)
+
+diff --git a/remake.c b/remake.c
+index c0bf709..b1ddd23 100644
+--- a/remake.c
++++ b/remake.c
+@@ -612,6 +612,10 @@ update_file_1 (struct file *file, unsigned int depth)
+ d->file->dontcare = file->dontcare;
+ }
+
++ /* We may have already considered this file, when we didn't know
++ we'd need to update it. Force update_file() to consider it and
++ not prune it. */
++ d->file->considered = !considered;
+
+ dep_status |= update_file (d->file, depth);
+
+diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
+index d4250f0..76d24a7 100644
+--- a/tests/scripts/features/parallelism
++++ b/tests/scripts/features/parallelism
+@@ -214,6 +214,23 @@ rm main.x");
+ rmfiles(qw(foo.y foo.y.in main.bar));
+ }
+
++# Ensure intermediate/secondary files are not pruned incorrectly.
++# See Savannah bug #30653
++
++utouch(-15, 'file2');
++utouch(-10, 'file4');
++utouch(-5, 'file1');
++
++run_make_test(q!
++.INTERMEDIATE: file3
++file4: file3 ; @mv -f $< $@
++file3: file2 ; touch $@
++file2: file1 ; @touch $@
++!,
++ '--no-print-directory -j2', "touch file3");
++
++#rmfiles('file1', 'file2', 'file3', 'file4');
++
+ if ($all_tests) {
+ # Jobserver FD handling is messed up in some way.
+ # Savannah bug #28189
+--
+1.7.12
+
diff --git a/sys-devel/make/files/make-3.82-long-command-line.patch b/sys-devel/make/files/make-3.82-long-command-line.patch
new file mode 100644
index 000000000000..9266786e4da7
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-long-command-line.patch
@@ -0,0 +1,54 @@
+https://savannah.gnu.org/bugs/?36451
+
+From a95796de3a491d8acfc8ea94c217b90531161786 Mon Sep 17 00:00:00 2001
+From: psmith <psmith>
+Date: Sun, 9 Sep 2012 23:25:07 +0000
+Subject: [PATCH] Keep the command line on the heap to avoid stack overflow.
+ Fixes Savannah bug #36451.
+
+---
+ ChangeLog | 3 +++
+ job.c | 13 +++++++++----
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/job.c b/job.c
+index 754576b..f7b7d51 100644
+--- a/job.c
++++ b/job.c
+@@ -2984,8 +2984,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+ return new_argv;
+ }
+
+- new_line = alloca ((shell_len*2) + 1 + sflags_len + 1
+- + (line_len*2) + 1);
++ new_line = xmalloc ((shell_len*2) + 1 + sflags_len + 1
++ + (line_len*2) + 1);
+ ap = new_line;
+ /* Copy SHELL, escaping any characters special to the shell. If
+ we don't escape them, construct_command_argv_internal will
+@@ -3052,8 +3052,11 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+ *ap++ = *p;
+ }
+ if (ap == new_line + shell_len + sflags_len + 2)
+- /* Line was empty. */
+- return 0;
++ {
++ /* Line was empty. */
++ free (new_line);
++ return 0;
++ }
+ *ap = '\0';
+
+ #ifdef WINDOWS32
+@@ -3194,6 +3197,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+ fatal (NILF, _("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"),
+ __FILE__, __LINE__);
+ #endif
++
++ free (new_line);
+ }
+ #endif /* ! AMIGA */
+
+--
+1.7.12
+
diff --git a/sys-devel/make/files/make-3.82-memory-corruption.patch b/sys-devel/make/files/make-3.82-memory-corruption.patch
new file mode 100644
index 000000000000..b28c07353ec2
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-memory-corruption.patch
@@ -0,0 +1,37 @@
+--- function.c 2011/04/18 01:25:20 1.121
++++ function.c 2011/05/02 12:35:01 1.122
+@@ -706,7 +706,7 @@
+ const char *word_iterator = argv[0];
+ char buf[20];
+
+- while (find_next_token (&word_iterator, (unsigned int *) 0) != 0)
++ while (find_next_token (&word_iterator, NULL) != 0)
+ ++i;
+
+ sprintf (buf, "%d", i);
+@@ -1133,21 +1133,14 @@
+
+ /* Find the maximum number of words we'll have. */
+ t = argv[0];
+- wordi = 1;
+- while (*t != '\0')
++ wordi = 0;
++ while ((p = find_next_token (&t, NULL)) != 0)
+ {
+- char c = *(t++);
+-
+- if (! isspace ((unsigned char)c))
+- continue;
+-
++ ++t;
+ ++wordi;
+-
+- while (isspace ((unsigned char)*t))
+- ++t;
+ }
+
+- words = xmalloc (wordi * sizeof (char *));
++ words = xmalloc ((wordi == 0 ? 1 : wordi) * sizeof (char *));
+
+ /* Now assign pointers to each string in the array. */
+ t = argv[0];
diff --git a/sys-devel/make/files/make-3.82-oneshell.patch b/sys-devel/make/files/make-3.82-oneshell.patch
new file mode 100644
index 000000000000..fbade127ce61
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-oneshell.patch
@@ -0,0 +1,24 @@
+fix from upstream cvs
+
+----------------------------
+revision 1.245
+date: 2010-08-13 22:50:14 -0400; author: psmith; state: Exp; lines: +1 -1; commitid: 4UaslPqQHZTs5wKu;
+- Add oneshell to $(.FEATURES) (forgot that!)
+
+Index: main.c
+===================================================================
+RCS file: /sources/make/make/main.c,v
+retrieving revision 1.244
+retrieving revision 1.245
+diff -u -p -r1.244 -r1.245
+--- main.c 10 Aug 2010 07:35:34 -0000 1.244
++++ main.c 14 Aug 2010 02:50:14 -0000 1.245
+@@ -1138,7 +1138,7 @@ main (int argc, char **argv, char **envp
+ a macro and some compilers (MSVC) don't like conditionals in macros. */
+ {
+ const char *features = "target-specific order-only second-expansion"
+- " else-if shortest-stem undefine"
++ " else-if shortest-stem undefine oneshell"
+ #ifndef NO_ARCHIVES
+ " archives"
+ #endif
diff --git a/sys-devel/make/files/make-3.82-parallel-remake.patch b/sys-devel/make/files/make-3.82-parallel-remake.patch
new file mode 100644
index 000000000000..a19fe7b7d629
--- /dev/null
+++ b/sys-devel/make/files/make-3.82-parallel-remake.patch
@@ -0,0 +1,39 @@
+fix from upstream cvs
+
+----------------------------
+revision 1.247
+date: 2011-09-18 19:39:26 -0400; author: psmith; state: Exp; lines: +5 -3; commitid: 07NxO4T5PiWC82Av;
+When we re-exec the master makefile in a jobserver environment, ensure
+that MAKEFLAGS is set properly so the re-exec'd make runs in parallel.
+See Savannah bug #33873.
+
+Index: main.c
+===================================================================
+RCS file: /sources/make/make/main.c,v
+retrieving revision 1.246
+retrieving revision 1.247
+diff -u -p -r1.246 -r1.247
+--- main.c 29 Aug 2010 23:05:27 -0000 1.246
++++ main.c 18 Sep 2011 23:39:26 -0000 1.247
+@@ -2089,6 +2089,11 @@ main (int argc, char **argv, char **envp
+
+ ++restarts;
+
++ /* If we're re-exec'ing the first make, put back the number of
++ job slots so define_makefiles() will get it right. */
++ if (master_job_slots)
++ job_slots = master_job_slots;
++
+ /* Reset makeflags in case they were changed. */
+ {
+ const char *pv = define_makeflags (1, 1);
+@@ -2825,9 +2830,6 @@ define_makeflags (int all, int makefile)
+ && (*(unsigned int *) cs->value_ptr ==
+ *(unsigned int *) cs->noarg_value))
+ ADD_FLAG ("", 0); /* Optional value omitted; see below. */
+- else if (cs->c == 'j')
+- /* Special case for `-j'. */
+- ADD_FLAG ("1", 1);
+ else
+ {
+ char *buf = alloca (30);
diff --git a/sys-devel/make/files/make-4.0-char-cast.patch b/sys-devel/make/files/make-4.0-char-cast.patch
new file mode 100644
index 000000000000..129f54092047
--- /dev/null
+++ b/sys-devel/make/files/make-4.0-char-cast.patch
@@ -0,0 +1,46 @@
+https://savannah.gnu.org/bugs/?40371
+http://git.savannah.gnu.org/cgit/make.git/commit/?id=9d58570c
+
+From 9d58570c77240fed53d1f88217877f8e778f4bb2 Mon Sep 17 00:00:00 2001
+From: Paul Smith <psmith@gnu.org>
+Date: Sat, 26 Oct 2013 04:10:17 +0000
+Subject: * makeint.h (STOP_SET): [SV 40371] Cast to unsigned char.
+
+* tests/scripts/misc/utf8: Test variable names with characters >127.
+Fix suggested by Robert Bogomip <bob.bogo@milohedge.com>
+---
+diff --git a/makeint.h b/makeint.h
+index 77f51e0..c591427 100644
+--- a/makeint.h
++++ b/makeint.h
+@@ -415,7 +415,7 @@ extern int unixy_shell;
+ # define MAP_VMSCOMMA 0x0000
+ #endif
+
+-#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(int)(_v)],(_m))
++#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(unsigned char)(_v)],(_m))
+
+ #if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
+ # define SET_STACK_SIZE
+diff --git a/tests/scripts/misc/utf8 b/tests/scripts/misc/utf8
+new file mode 100644
+index 0000000..2adcd07
+--- a/dev/null
++++ b/tests/scripts/misc/utf8
+@@ -0,0 +1,14 @@
++# -*-perl-*-
++$description = "Test utf8 handling.";
++
++$details = "";
++
++# Variable names containing UTF8 characters
++run_make_test("
++\xe2\x96\xaa := hello
++\$(info \$(\xe2\x96\xaa))
++all:
++",
++ '', "hello\n#MAKE#: Nothing to be done for 'all'.");
++
++1;
+--
+cgit v0.9.0.2
diff --git a/sys-devel/make/files/make-4.1-fix_null_returns_from_ttyname.patch b/sys-devel/make/files/make-4.1-fix_null_returns_from_ttyname.patch
new file mode 100644
index 000000000000..f6be5c9f06af
--- /dev/null
+++ b/sys-devel/make/files/make-4.1-fix_null_returns_from_ttyname.patch
@@ -0,0 +1,53 @@
+From 292da6f6867b75a5af7ddbb639a1feae022f438f Mon Sep 17 00:00:00 2001
+From: Paul Smith <psmith@gnu.org>
+Date: Mon, 20 Oct 2014 05:54:56 +0000
+Subject: * main.c (main): [SV 43434] Handle NULL returns from ttyname().
+
+---
+diff --git a/main.c b/main.c
+index b2d169c..0cdb8a8 100644
+--- a/main.c
++++ b/main.c
+@@ -1429,13 +1429,18 @@ main (int argc, char **argv, char **envp)
+ #ifdef HAVE_ISATTY
+ if (isatty (fileno (stdout)))
+ if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT")))
+- define_variable_cname ("MAKE_TERMOUT", TTYNAME (fileno (stdout)),
+- o_default, 0)->export = v_export;
+-
++ {
++ const char *tty = TTYNAME (fileno (stdout));
++ define_variable_cname ("MAKE_TERMOUT", tty ? tty : DEFAULT_TTYNAME,
++ o_default, 0)->export = v_export;
++ }
+ if (isatty (fileno (stderr)))
+ if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR")))
+- define_variable_cname ("MAKE_TERMERR", TTYNAME (fileno (stderr)),
+- o_default, 0)->export = v_export;
++ {
++ const char *tty = TTYNAME (fileno (stderr));
++ define_variable_cname ("MAKE_TERMERR", tty ? tty : DEFAULT_TTYNAME,
++ o_default, 0)->export = v_export;
++ }
+ #endif
+
+ /* Reset in case the switches changed our minds. */
+diff --git a/makeint.h b/makeint.h
+index 6223936..2009f41 100644
+--- a/makeint.h
++++ b/makeint.h
+@@ -436,10 +436,11 @@ extern struct rlimit stack_limit;
+ /* The number of bytes needed to represent the largest integer as a string. */
+ #define INTSTR_LENGTH CSTRLEN ("18446744073709551616")
+
++#define DEFAULT_TTYNAME "true"
+ #ifdef HAVE_TTYNAME
+ # define TTYNAME(_f) ttyname (_f)
+ #else
+-# define TTYNAME(_f) "true"
++# define TTYNAME(_f) DEFAULT_TTYNAME
+ #endif
+
+
+--
+cgit v0.9.0.2
diff --git a/sys-devel/make/files/make-4.2-default-cxx.patch b/sys-devel/make/files/make-4.2-default-cxx.patch
new file mode 100644
index 000000000000..4d592086a6ff
--- /dev/null
+++ b/sys-devel/make/files/make-4.2-default-cxx.patch
@@ -0,0 +1,13 @@
+diff --git a/default.c b/default.c
+index 3d865c7..e8b3ed6 100644
+--- a/default.c
++++ b/default.c
+@@ -530,7 +530,7 @@ static const char *default_variables[] =
+ "OBJC", "gcc",
+ #else
+ "CC", "cc",
+- "CXX", "g++",
++ "CXX", "c++",
+ "OBJC", "cc",
+ #endif
+
diff --git a/sys-devel/make/make-3.80-r4.ebuild b/sys-devel/make/make-3.80-r4.ebuild
new file mode 100644
index 000000000000..91a6ec2b73d9
--- /dev/null
+++ b/sys-devel/make/make-3.80-r4.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit eutils flag-o-matic
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="https://www.gnu.org/software/make/make.html"
+SRC_URI="mirror://gnu//make/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd"
+IUSE="nls static"
+
+DEPEND="nls? ( sys-devel/gettext )"
+RDEPEND=""
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PV}-memory.patch
+ epatch "${FILESDIR}"/${P}-parallel-build-failure.patch
+ epatch "${FILESDIR}"/${P}-conditional-eval.patch #123317
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ econf \
+ $(use_enable nls) \
+ --program-prefix=g \
+ || die
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc AUTHORS ChangeLog NEWS README*
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ dosym gmake /usr/bin/make
+ dosym gmake.1 /usr/share/man/man1/make.1
+ fi
+}
diff --git a/sys-devel/make/make-3.81-r2.ebuild b/sys-devel/make/make-3.81-r2.ebuild
new file mode 100644
index 000000000000..cd996376ff85
--- /dev/null
+++ b/sys-devel/make/make-3.81-r2.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="https://www.gnu.org/software/make/make.html"
+SRC_URI="mirror://gnu//make/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="nls static"
+
+DEPEND="nls? ( sys-devel/gettext )"
+RDEPEND="nls? ( virtual/libintl )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-tests-lang.patch
+ epatch "${FILESDIR}"/${P}-long-cmdline.patch #301116
+ epatch "${FILESDIR}"/${P}-tests-recursion.patch #329153
+ epatch "${FILESDIR}"/${P}-jobserver.patch #193258
+}
+
+src_compile() {
+ use static && append-ldflags -static
+ econf \
+ $(use_enable nls) \
+ --program-prefix=g \
+ || die
+ emake || die
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "make install failed"
+ dodoc AUTHORS ChangeLog NEWS README*
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ # we install everywhere as 'gmake' but on GNU systems,
+ # symlink 'make' to 'gmake'
+ dosym gmake /usr/bin/make
+ dosym gmake.1 /usr/share/man/man1/make.1
+ fi
+}
diff --git a/sys-devel/make/make-3.82-r4.ebuild b/sys-devel/make/make-3.82-r4.ebuild
new file mode 100644
index 000000000000..49dece74fb9e
--- /dev/null
+++ b/sys-devel/make/make-3.82-r4.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="https://www.gnu.org/software/make/make.html"
+SRC_URI="mirror://gnu//make/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="nls static"
+
+DEPEND="nls? ( sys-devel/gettext )"
+RDEPEND="nls? ( virtual/libintl )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-archives-many-objs.patch #334889
+ epatch "${FILESDIR}"/${P}-MAKEFLAGS-reexec.patch #31975
+ epatch "${FILESDIR}"/${P}-memory-corruption.patch #355907
+ epatch "${FILESDIR}"/${P}-glob-speedup.patch #382845
+ epatch "${FILESDIR}"/${P}-copy-on-expand.patch
+ epatch "${FILESDIR}"/${P}-oneshell.patch
+ epatch "${FILESDIR}"/${P}-parallel-remake.patch
+ epatch "${FILESDIR}"/${P}-intermediate-parallel.patch #431250
+ epatch "${FILESDIR}"/${P}-construct-command-line.patch
+ epatch "${FILESDIR}"/${P}-long-command-line.patch
+ epatch "${FILESDIR}"/${P}-darwin-library_search-dylib.patch
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ econf \
+ --program-prefix=g \
+ $(use_enable nls)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc AUTHORS ChangeLog NEWS README*
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ # we install everywhere as 'gmake' but on GNU systems,
+ # symlink 'make' to 'gmake'
+ dosym gmake /usr/bin/make
+ dosym gmake.1 /usr/share/man/man1/make.1
+ fi
+}
diff --git a/sys-devel/make/make-4.0-r1.ebuild b/sys-devel/make/make-4.0-r1.ebuild
new file mode 100644
index 000000000000..43b8b2760cdf
--- /dev/null
+++ b/sys-devel/make/make-4.0-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="https://www.gnu.org/software/make/make.html"
+SRC_URI="mirror://gnu//make/${P}.tar.bz2"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="guile nls static"
+
+CDEPEND="guile? ( >=dev-scheme/guile-1.8 )"
+DEPEND="${CDEPEND}
+ nls? ( sys-devel/gettext )"
+RDEPEND="${CDEPEND}
+ nls? ( virtual/libintl )"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.82-darwin-library_search-dylib.patch \
+ "${FILESDIR}"/${P}-char-cast.patch
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ econf \
+ --program-prefix=g \
+ $(use_with guile) \
+ $(use_enable nls)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS ChangeLog NEWS README*
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ # we install everywhere as 'gmake' but on GNU systems,
+ # symlink 'make' to 'gmake'
+ dosym gmake /usr/bin/make
+ dosym gmake.1 /usr/share/man/man1/make.1
+ fi
+}
diff --git a/sys-devel/make/make-4.1-r1.ebuild b/sys-devel/make/make-4.1-r1.ebuild
new file mode 100644
index 000000000000..f531d4104c13
--- /dev/null
+++ b/sys-devel/make/make-4.1-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="https://www.gnu.org/software/make/make.html"
+SRC_URI="mirror://gnu//make/${P}.tar.bz2"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="guile nls static"
+
+CDEPEND="guile? ( >=dev-scheme/guile-1.8 )"
+DEPEND="${CDEPEND}
+ nls? ( sys-devel/gettext )"
+RDEPEND="${CDEPEND}
+ nls? ( virtual/libintl )"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-3.82-darwin-library_search-dylib.patch \
+ "${FILESDIR}"/${P}-fix_null_returns_from_ttyname.patch
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ econf \
+ --program-prefix=g \
+ $(use_with guile) \
+ $(use_enable nls)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS NEWS README*
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ # we install everywhere as 'gmake' but on GNU systems,
+ # symlink 'make' to 'gmake'
+ dosym gmake /usr/bin/make
+ dosym gmake.1 /usr/share/man/man1/make.1
+ fi
+}
diff --git a/sys-devel/make/make-4.2.1-r1.ebuild b/sys-devel/make/make-4.2.1-r1.ebuild
new file mode 100644
index 000000000000..2b944c675fad
--- /dev/null
+++ b/sys-devel/make/make-4.2.1-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="https://www.gnu.org/software/make/make.html"
+SRC_URI="mirror://gnu//make/${P}.tar.bz2"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="guile nls static"
+
+CDEPEND="guile? ( >=dev-scheme/guile-1.8:= )"
+DEPEND="${CDEPEND}
+ nls? ( sys-devel/gettext )"
+RDEPEND="${CDEPEND}
+ nls? ( virtual/libintl )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.82-darwin-library_search-dylib.patch
+ "${FILESDIR}"/${PN}-4.2-default-cxx.patch
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ econf \
+ --program-prefix=g \
+ $(use_with guile) \
+ $(use_enable nls)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS NEWS README*
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ # we install everywhere as 'gmake' but on GNU systems,
+ # symlink 'make' to 'gmake'
+ dosym gmake /usr/bin/make
+ dosym gmake.1 /usr/share/man/man1/make.1
+ fi
+}
diff --git a/sys-devel/make/make-4.2.1.ebuild b/sys-devel/make/make-4.2.1.ebuild
new file mode 100644
index 000000000000..70e90b6bf623
--- /dev/null
+++ b/sys-devel/make/make-4.2.1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Standard tool to compile source trees"
+HOMEPAGE="https://www.gnu.org/software/make/make.html"
+SRC_URI="mirror://gnu//make/${P}.tar.bz2"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="guile nls static"
+
+CDEPEND="guile? ( >=dev-scheme/guile-1.8:= )"
+DEPEND="${CDEPEND}
+ nls? ( sys-devel/gettext )"
+RDEPEND="${CDEPEND}
+ nls? ( virtual/libintl )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.82-darwin-library_search-dylib.patch
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ econf \
+ --program-prefix=g \
+ $(use_with guile) \
+ $(use_enable nls)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc AUTHORS NEWS README*
+ if [[ ${USERLAND} == "GNU" ]] ; then
+ # we install everywhere as 'gmake' but on GNU systems,
+ # symlink 'make' to 'gmake'
+ dosym gmake /usr/bin/make
+ dosym gmake.1 /usr/share/man/man1/make.1
+ fi
+}
diff --git a/sys-devel/make/metadata.xml b/sys-devel/make/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/make/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/metadata.xml b/sys-devel/metadata.xml
new file mode 100644
index 000000000000..dd5a911e46a2
--- /dev/null
+++ b/sys-devel/metadata.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ The sys-devel category contains various core system development tools
+ and libraries.
+ </longdescription>
+ <longdescription lang="es">
+ La categoría sys-devel contiene paquetes esenciales para el desarrollo
+ de software.
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie sys-devel enthält essentielle Entwicklungswerkzeuge und
+ Bibliotheken.
+ </longdescription>
+ <longdescription lang="ja">
+ sys-develカテゴリにはコアシステム開発ツールとライブラリが含まれます。
+ </longdescription>
+ <longdescription lang="nl">
+ De sys-devel categorie bevat essentiele ontwikkelgereedschappen en
+ bibliotheken.
+ </longdescription>
+ <longdescription lang="vi">
+ Nhóm sys-devel chứa các phần mềm và thư viện phát triển hệ thống cốt lõi.
+ </longdescription>
+ <longdescription lang="it">
+ La categoria sys-devel contiene gli strumenti e le librerie essenziali per lo sviluppo del software e la compilazione del sistema.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria sys-devel contém várias ferramentas e bibliotecas
+ de desenvolvimento essenciais para o sistema.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria sys-devel zawiera programy i biblioteki służące do rozwijania
+ systemu.
+ </longdescription>
+</catmetadata>
+
diff --git a/sys-devel/multilib-gcc-wrapper/Manifest b/sys-devel/multilib-gcc-wrapper/Manifest
new file mode 100644
index 000000000000..626134508d13
--- /dev/null
+++ b/sys-devel/multilib-gcc-wrapper/Manifest
@@ -0,0 +1,4 @@
+EBUILD multilib-gcc-wrapper-0.ebuild 1523 SHA256 51096f1558d3adc47efa427a7107260bea35d59d85ff4f4a8f452b477aa3f525 SHA512 3c52476f072da9c8626868ab44b5147fafcf05f07eced28268a45b000fc2bd8e82744f4a368d155f06b32af6f6126486f357a84f51986e3c6f146f85dcff0c61 WHIRLPOOL c6868206c8ae0a1987c2e42efe71d8e358d1451dc669f3af2952304876a5ea733bffdd4b421c954eb16e7500ebc32958ae13f0f2a8d5e4a2fc501c4068ae52fe
+MISC ChangeLog 2241 SHA256 3697f694f7420a789b2da3e78dbfc5ec92934ce97e4ca6f26c4ef022d6c2bf08 SHA512 c0b5952120c92c58dd4765d5f749ac4ac4ea8c69ab1509bf3ce542727736e713f4889b069b445089eec40ee104e5421a7c0ea767fd0f4af1c0a48530c2711563 WHIRLPOOL e9deadac5b4c8ffa9ff43062f1b2ebbe318f0ac09c403eb0679dd9b83a133006407a588b270d72eabacb843cab85d71bab4a296e80be4b3afb20ca1d5bb2999f
+MISC ChangeLog-2015 404 SHA256 8bc0acad4b480d0810d9bfa8738863b23aa3006efd4545541af8e4da257b153f SHA512 ce8596eb82b84e6e94fc1d0022ab593551681e4aaf6ca77df164d998fedc9f11068dd0e6d9b219b91522db009c0ae6675d9121bd3c546e5550431a530ed8352d WHIRLPOOL c9a8f84e62dd76638bae80501c616983a0befe754450be6467b9a90772dcc961ed64c4f8b08b74e7c8d1f9cb8b8709e4c088c69f88280fa23bc3cffca5ec5c42
+MISC metadata.xml 362 SHA256 cf8dc713cfb0488cd9b30dba49d9cc73ecd5c79738c56a77376cd391b893d7a2 SHA512 7960a5447f1c6f22a9096eb667fcc700facbab5734896bc492ef7cd5ec7d25fad4d6bdbca6f8be3390762d0dbb57052f10b1ce00616553218f63f67936fa1d1b WHIRLPOOL 96be1ddd7295aea94897fcdb72d30aa10428f399cf7cec9840cfe9805ed7c5629136a90785245cbd43cfa16b97ce1a0e8e4ee4f6f5d78a360e94278db0618373
diff --git a/sys-devel/multilib-gcc-wrapper/metadata.xml b/sys-devel/multilib-gcc-wrapper/metadata.xml
new file mode 100644
index 000000000000..d1c3b3b043a8
--- /dev/null
+++ b/sys-devel/multilib-gcc-wrapper/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>multilib@gentoo.org</email>
+ <name>gx86 multilib team</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild b/sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild
new file mode 100644
index 000000000000..8094a33d1a12
--- /dev/null
+++ b/sys-devel/multilib-gcc-wrapper/multilib-gcc-wrapper-0.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils multilib
+
+DESCRIPTION="Wrappers for gcc tools to be used on non-native CHOSTs"
+HOMEPAGE="https://www.gentoo.org"
+SRC_URI=""
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="sys-devel/gcc:="
+
+S=${WORKDIR}
+
+mkwrap() {
+ einfo " ${2}"
+
+ cat > "${T}"/wrapper <<-_EOF_
+ #!${EPREFIX}/bin/sh
+ exec ${1} $(get_abi_CFLAGS) "\${@}"
+ _EOF_
+
+ newbin "${T}"/wrapper "${2}"
+}
+
+src_install() {
+ local host_prefix=${CHOST}
+ # stolen from sys-devel/gcc-config
+ # TODO: check if all of them actually support $(get_ABI_CFLAGS)
+ local tools=(
+ cpp cc gcc c++ g++ f77 g77 gcj gcjh gdc gdmd gfortran gccgo
+ )
+
+ cd "${EROOT%/}"/usr/bin || die
+ eshopts_push -s nullglob
+
+ # same as toolchain.eclass
+ : ${TARGET_DEFAULT_ABI:=${DEFAULT_ABI}}
+ : ${TARGET_MULTILIB_ABIS:=${MULTILIB_ABIS}}
+ local ABI t e
+ for ABI in $(get_all_abis TARGET); do
+ [[ ${ABI} == ${TARGET_DEFAULT_ABI} ]] && continue
+
+ einfo "Creating wrappers for ${ABI} ..."
+ for t in "${tools[@]}"; do
+ # look for both plain *-gcc and e.g. *-gcc-4.8.3
+ # (but avoid *-gcc-nm)
+ # note: nullglob applied above
+ for e in ${host_prefix}[-]${t}{,-[0-9]*}; do
+ local newname=$(get_abi_CHOST)-${e#${host_prefix}-}
+
+ einfo " ${newname}"
+
+ cat > "${T}"/wrapper <<-_EOF_
+ #!${EPREFIX}/bin/sh
+ exec ${e} $(get_abi_CFLAGS) "\${@}"
+ _EOF_
+
+ newbin "${T}"/wrapper "${newname}"
+ done
+ done
+ done
+
+ eshopts_pop
+}
diff --git a/sys-devel/native-cctools/Manifest b/sys-devel/native-cctools/Manifest
new file mode 100644
index 000000000000..4146bb01d2de
--- /dev/null
+++ b/sys-devel/native-cctools/Manifest
@@ -0,0 +1,9 @@
+AUX aix-2/ld 2717 SHA256 a2c264df546aa8d42583d30e41042ba43c1b2baabf4a3f3966426f9d3cfd09d2 SHA512 38ab347451d67a36b37ae2aea8f27876a20cda7a6b3ba1f3ae3acbed5f8a8016822991e3aabc82c8d14f3b0962922d765e5c01ade0e9853ff03f3f0d8e743846 WHIRLPOOL 7758b8a8bedfb2d26335a4995e4b0ee99f9c6f46507cf11f4dd2459f4f91589d7911808125607dc782e1d08e8b532ca1c74a90a2c9a91da4f33e85eaa2c4c67b
+AUX aix-2/mkexpfile 1535 SHA256 4ba886dd45b53cb9109eea2722b7cbb720b07d4afce8fcd21cb7977d3be39520 SHA512 51491a3b215b2efcbf3a14ee7cc90ea6e9062eb98a939e88671b288cbd8262864aec8cffe481689ba325c1aed125881a2c6a375eff1bb1f4f9902f29b53944c6 WHIRLPOOL bfdea62c671c2b6829e35be48e43b5d6162d90820139703d7f5dd3b7a7b0fd3aa76af479374dc590e0afa821498ce70a692d9bf09dfbec7cf3bb1838167b1ec1
+AUX aix-2/nm 176 SHA256 e3ff019fc3ba6d12841c62b23bc676cf1338ad4af02fd5ba0da3189a825133c8 SHA512 d5206f7bf3ce54f79c292f9734b028aa8c9d0db811db4cb6ef2a4570f3bd13e38b2e41def4d6053a3794dd0f5ed81b485deee4d27c3db6462035071d7c522411 WHIRLPOOL b3192f2c36685b99b0840c4c0abd36b99f8ae7b823d8cdd0a5a375dda9af475e36bc3a681ca72a8522f9ca8a79d0f230335d15617a98ecdc2969b2ebf31f1ad4
+AUX ld-aix-1 2753 SHA256 e1f31000aecfd60671797423783478ccaa352c91d0ca831aadc25eca0409b268 SHA512 e637a4596164b88fef8d0e9b7259970f49bcee04b4baa75aa811c87e7973fdf63e89d3e72ed8b953ef07fa121e8e8f58d6da3de995c190bc2df59cea950d7cbb WHIRLPOOL 65ca22ca5c48dd29bc45a9db476b0b958667dc6efa92b791df440c31c90a43bbe6dde618b695cf7859b72332778a9da704e242ff1096b8fd17ff42bcae25ed8b
+AUX ld-aix-2 2717 SHA256 8635efef392a72da5ad0196de97e59c4e55c9f96590ff12e58ff37a1d7fc95af SHA512 88c88e80e38f2da69bc2adb0ccbaeb35b65ce6c0e00afdf7867c7fa254ed24aacd680ddb98aee3743613f606a18a46fc5525ff4667258c15b17d24ea3da718fe WHIRLPOOL 1578fdf23d39a60cffbab8c02aef91f6de903e1f60fa250cf02ee0fc8450fe8ae64ad772a1a8bcc3350daa4ee5beee1a8d37106bf681071ff0f595220244114a
+EBUILD native-cctools-4.ebuild 2816 SHA256 61aaa94ab0a4bbb6178d9b8c46d45167d0354a1b40e616d454b3e32fbfda2d23 SHA512 92382257c82fe3b1a9c109a8628d1a08a588ce95fcc3ec799cd331f5e5b61ee536cc285f5dae5e83dc6e760c3128da294b81020779a2d668656bb08bc2b1a1c9 WHIRLPOOL 531a1de77f7e16c7af15e38d6d3d284fbd46c090f0acebb8d59a2be333a2a9b16a0255cea9a3edc80953eb606a5687ece937c42cba69d8efda4d10941de7baff
+MISC ChangeLog 2935 SHA256 9448b6594d9ceee05bef928cbd40208a85a612da3a2d3b63e57b4f5ae209b7fd SHA512 29ae2150bda77be5ccdb90bb12903972e08053134257d37d61d612d7e224a5780578e77342809455792f0f7c8ae92ebaa25be7f2bd40d9f7a352acca4728cc8b WHIRLPOOL 2767eb92659c3a2cfd8e74af3b53ee8d72e166352b051bce278d4a57b8dd75ec65d93e5dafcbbec477958b91fc6bcef56063fc0294706948708be5cc1b1d8776
+MISC ChangeLog-2015 1925 SHA256 1d54c8be32d7e7ef4ee07baf6ccb26f65a339d2e6831484a87da176f5e181b49 SHA512 8c92412c5f41388472ed1757508b0158a99b67dc2264f15a70e14699d577b04a86f66e9aef43b51f176703897de93749640511dbd98040f45a13d877e4610a54 WHIRLPOOL c489e1a48f0618db2223e795a9dd40653f9e69823f91ef4bc20d6d46fea02b8c353b22374f137431ca56af020e3bed38f6b8708f988b46ceb814a31144a33332
+MISC metadata.xml 243 SHA256 acb891975882d2b75bb5a1a76063f1d61ad1d96c799548e7f141e1623a0cc57e SHA512 8489be9ea6eac385511b0d193b1b61fad9c8e0d4cb86fd711e6faf04e66b2c935ae64ce6ce0a044d036e76de6787e5d440d67f831e89261a71e74b645a0999d9 WHIRLPOOL e06d2acbfdb38aa17edb0da41bcafece9c9a5d0542c9192ee3b74ae0b6250d24fb096e3a153f6a215a29d3dd7c5794f2c67f0917db3aa3f1cc65e86ea27e228f
diff --git a/sys-devel/native-cctools/files/aix-2/ld b/sys-devel/native-cctools/files/aix-2/ld
new file mode 100644
index 000000000000..7477f11cf6e9
--- /dev/null
+++ b/sys-devel/native-cctools/files/aix-2/ld
@@ -0,0 +1,138 @@
+#! /usr/bin/env /bin/ksh
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+
+# Upon '-soname' and similar flags, create a "shared library" on AIX being an
+# archive file containing an Import File and the shared object file, as in:
+# http://lists.gnu.org/archive/html/libtool/2011-01/msg00023.html
+# with updates in:
+# http://lists.gnu.org/archive/html/libtool/2011-02/msg00000.html
+#
+# This helper script is meant not depend on anything Gentoo specific.
+
+ld=/usr/ccs/bin/ld
+ar=/usr/ccs/bin/ar
+strip=/usr/ccs/bin/strip
+dump=/usr/sbin/dump
+awk=/usr/bin/awk
+rm=/usr/bin/rm
+mkdir=/usr/bin/mkdir
+mv=/usr/bin/mv
+ln=/usr/bin/ln
+
+oldargs=
+output=
+soname=
+newargs=
+OBJECT_MODE=${OBJECT_MODE:-32}
+
+while [[ $# -gt 0 ]]
+do
+ arg=$1
+ shift
+ oldargs="${oldargs} '${arg}'"
+ case ${arg} in
+ -o)
+ newargs="${newargs} -o '$1'"
+ output=$1
+ oldargs="${oldargs} '$1'"
+ shift
+ ;;
+ -bM:SRE)
+ newargs="${newargs} '-G' '-bernotok'"
+ ;;
+ -soname=*)
+ soname=${arg#-soname=}
+ ;;
+ -h*)
+ soname=${arg#-h}
+ ;;
+ -soname|-h)
+ soname=$1
+ shift
+ ;;
+ -b32)
+ newargs="${newargs} '${arg}'"
+ OBJECT_MODE=32
+ ;;
+ -b64)
+ newargs="${newargs} '${arg}'"
+ OBJECT_MODE=64
+ ;;
+ *)
+ newargs="${newargs} '${arg}'"
+ ;;
+ esac
+done
+
+if [[ -z ${output} || -z ${soname} ]]; then
+ eval "exec ${ld} ${oldargs}"
+ exit 1
+fi
+
+# Running ld against the orginal target file to retain
+# ld error message when there's a problem with it:
+eval "${ld} -o '${output}' ${newargs}" || exit 1
+
+workdir="${output}.$$"
+
+${rm} -rf "${workdir}" || exit 1
+trap "${rm} -rf '${workdir}'" 0
+
+case ${soname} in
+*\(*\))
+ shro=${soname#*\(}
+ shro=${shro%\)}
+ shri=${shro%.*}.imp
+ ;;
+*\[*\])
+ shro=${soname#*\[}
+ shro=${shro%\]}
+ shri=${shro%.*}.imp
+ ;;
+none) # loadable only module, not linkable: no import file
+ shro='shr.o'
+ soname="${output##*/}(${shro})"
+ shri=
+ ;;
+auto)
+ shro='shr.o'
+ soname=${output##*/}
+ if [[ ${soname} == lib*.so* ]]; then
+ # linkable library: need import file
+ shri=${shro%.*}.imp
+ else
+ # loadable only module, not linkable: no import file
+ shri=
+ fi
+ soname="${soname}(${shro})"
+ ;;
+*)
+ shro='shr.o'
+ shri=${shro%.*}.imp
+ soname="${soname}(${shro})"
+ ;;
+esac
+
+export OBJECT_MODE
+
+${mkdir} "${workdir}" || exit 1
+${strip} -e "${output}" || exit 1
+if [[ -n ${shri} ]]; then
+ ${dump} -Tv "${output}" > "${workdir}"/syms || exit 1
+ ${awk} '
+ BEGIN {
+ print "#! '"${soname}"'"
+ print "# '"${OBJECT_MODE}"'"
+ }
+ {
+ if ($4 == "EXP" || $4 == "ImpExp") {
+ print $8
+ } else
+ if ($4 == "wEXP") {
+ print $8" weak"
+ }
+ }' <"${workdir}"/syms > "${workdir}"/${shri} || exit 1
+fi
+${mv} "${output}" "${workdir}/${shro}" || exit 1
+${ar} rc "${output}" ${shri:+"${workdir}/${shri}"} "${workdir}/${shro}" || exit 1
+exit 0
diff --git a/sys-devel/native-cctools/files/aix-2/mkexpfile b/sys-devel/native-cctools/files/aix-2/mkexpfile
new file mode 100644
index 000000000000..4e79e4647b06
--- /dev/null
+++ b/sys-devel/native-cctools/files/aix-2/mkexpfile
@@ -0,0 +1,70 @@
+#! /bin/sh
+
+nm="${0%mkexpfile}nm"
+showwith=
+expfile="ld.aix.exports.$$"
+srcobjs=
+
+# /bin/sort does not allow TMPDIR to be longer than 85 characters
+test ${#TMPDIR} -le 85 || TMPDIR=/tmp export TMPDIR
+
+while test $# -gt 0
+do
+ arg=$1
+ shift
+
+ case ${arg} in
+ --) for arg in "$@"
+ do
+ srcobjs="${srcobjs} '${arg}'"
+ done
+ break
+ ;;
+ --show-with=*) showwith="${arg#--show-with=}" ;;
+ -o) expfile="${1}"; shift ;;
+ -o*) expfile="${arg#-o}"; ;;
+ *) srcobjs="${srcobjs} '${arg}'" ;;
+ esac
+done
+
+/bin/rm -f "${expfile}" || exit 1
+
+if ! type "${nm}" >/dev/null 2>&1
+then
+ case ${nm} in
+ *-nm) nm=${nm##*/} ;; # use "powerpc-ibm-aix7.1.0.0-nm" from PATH
+ */nm|nm) nm=/usr/ccs/bin/nm ;; # native anyway
+ esac
+ type "${nm}" >/dev/null || exit 1 # let 'type' yell when necessary
+fi
+
+if "${nm}" -V 2>&1 | /bin/grep 'GNU' >/dev/null
+then
+ eval "${nm}" -Bpg ${srcobjs} |
+ /bin/awk '{
+ if ((($2 == "T") || ($2 == "D") || ($2 == "B") || ($2 == "W")) && (substr($3,1,1) != ".")) {
+ if ($2 == "W") {
+ print $3 " weak"
+ } else {
+ print $3
+ }
+ }
+ }' |
+ /bin/sort -u > "${expfile}" || exit 1
+else
+ eval "${nm}" -PCpgl ${srcobjs} |
+ /bin/awk '{
+ if ((($2 == "T") || ($2 == "D") || ($2 == "B") || ($2 == "W") || ($2 == "V") || ($2 == "Z")) && (substr($1,1,1) != ".")) {
+ if (($2 == "W") || ($2 == "V") || ($2 == "Z")) {
+ print $1 " weak"
+ } else {
+ print $1
+ }
+ }
+ }' |
+ /bin/sort -u > "${expfile}" || exit 1
+fi
+
+echo "${showwith}${expfile}"
+
+exit 0
diff --git a/sys-devel/native-cctools/files/aix-2/nm b/sys-devel/native-cctools/files/aix-2/nm
new file mode 100644
index 000000000000..5ba1d650d23a
--- /dev/null
+++ b/sys-devel/native-cctools/files/aix-2/nm
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+# /usr/bin/sort (used by nm) cannot work with TMPDIR longer than 85 characters.
+test ${#TMPDIR} -le 85 || TMPDIR=/tmp export TMPDIR
+
+exec /usr/ccs/bin/nm ${1+"$@"}
diff --git a/sys-devel/native-cctools/files/ld-aix-1 b/sys-devel/native-cctools/files/ld-aix-1
new file mode 100644
index 000000000000..452edad70d87
--- /dev/null
+++ b/sys-devel/native-cctools/files/ld-aix-1
@@ -0,0 +1,140 @@
+#! /usr/bin/env /bin/ksh
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+
+# Upon '-soname' and similar flags, create a "shared library" on AIX being an
+# archive file containing an Import File and the shared object file, as in:
+# http://lists.gnu.org/archive/html/libtool/2011-01/msg00023.html
+# with updates in:
+# http://lists.gnu.org/archive/html/libtool/2011-02/msg00000.html
+#
+# This helper script is meant not depend on anything Gentoo specific.
+
+ld=/usr/ccs/bin/ld
+ar=/usr/ccs/bin/ar
+strip=/usr/ccs/bin/strip
+dump=/usr/sbin/dump
+awk=/usr/bin/awk
+rm=/usr/bin/rm
+mkdir=/usr/bin/mkdir
+mv=/usr/bin/mv
+ln=/usr/bin/ln
+
+oldargs=
+output=
+soname=
+newargs=
+OBJECT_MODE=${OBJECT_MODE:-32}
+
+while [[ $# -gt 0 ]]
+do
+ arg=$1
+ shift
+ oldargs="${oldargs} '${arg}'"
+ case ${arg} in
+ -o)
+ newargs="${newargs} -o '$1'"
+ output=$1
+ oldargs="${oldargs} '$1'"
+ shift
+ ;;
+ -bM:SRE)
+ newargs="${newargs} '-G' '-bernotok'"
+ ;;
+ -soname=*)
+ soname=${arg#-soname=}
+ ;;
+ -h*)
+ soname=${arg#-h}
+ ;;
+ -soname|-h)
+ soname=$1
+ shift
+ ;;
+ -b32)
+ newargs="${newargs} '${arg}'"
+ OBJECT_MODE=32
+ ;;
+ -b64)
+ newargs="${newargs} '${arg}'"
+ OBJECT_MODE=64
+ ;;
+ *)
+ newargs="${newargs} '${arg}'"
+ ;;
+ esac
+done
+
+if [[ -z ${output} || -z ${soname} ]]; then
+ eval "exec ${ld} ${oldargs}"
+ exit 1
+fi
+
+# Running ld against the orginal target file to retain
+# ld error message when there's a problem with it:
+eval "${ld} -o '${output}' ${newargs}" || exit 1
+
+workdir="${output}.$$"
+
+${rm} -rf "${workdir}" || exit 1
+trap "${rm} -rf '${workdir}'" 0
+
+case ${soname} in
+*\(*\))
+ shro=${soname#*\(}
+ shro=${shro%\)}
+ shri=${shro%.*}.imp
+ ;;
+*\[*\])
+ shro=${soname#*\[}
+ shro=${shro%\]}
+ shri=${shro%.*}.imp
+ ;;
+none) # loadable only module, not linkable: no import file
+ shro='shr.o'
+ soname="${output##*/}(${shro})"
+ shri=
+ ;;
+auto)
+ shro='shr.o'
+ soname=${output##*/}
+ if [[ ${soname} == lib*.so* ]]; then
+ # linkable library: need import file
+ shri=${shro%.*}.imp
+ else
+ # loadable only module, not linkable: no import file
+ shri=
+ fi
+ soname="${soname}(${shro})"
+ ;;
+*)
+ shro='shr.o'
+ shri=${shro%.*}.imp
+ soname="${soname}(${shro})"
+ ;;
+esac
+
+export OBJECT_MODE
+
+${mkdir} "${workdir}" || exit 1
+${strip} -e "${output}" || exit 1
+if [[ -n ${shri} ]]; then
+ ${dump} -Tv "${output}" > "${workdir}"/syms || exit 1
+ ${awk} '
+ BEGIN {
+ print "#! '"${soname}"'"
+ print "# '"${OBJECT_MODE}"'"
+ }
+ {
+ if ($6 != "SECdef") {
+ if ($4 == "EXP" || $4 == "ImpExp") {
+ print $8
+ } else
+ if ($4 == "wEXP") {
+ print $8" weak"
+ }
+ }
+ }' <"${workdir}"/syms > "${workdir}"/${shri} || exit 1
+fi
+${mv} "${output}" "${workdir}/${shro}" || exit 1
+${ar} rc "${output}" ${shri:+"${workdir}/${shri}"} "${workdir}/${shro}" || exit 1
+exit 0
diff --git a/sys-devel/native-cctools/files/ld-aix-2 b/sys-devel/native-cctools/files/ld-aix-2
new file mode 100644
index 000000000000..3ca9eb2357eb
--- /dev/null
+++ b/sys-devel/native-cctools/files/ld-aix-2
@@ -0,0 +1,138 @@
+#! /usr/bin/env /bin/ksh
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+
+# Upon '-soname' and similar flags, create a "shared library" on AIX being an
+# archive file containing an Import File and the shared object file, as in:
+# http://lists.gnu.org/archive/html/libtool/2011-01/msg00023.html
+# with updates in:
+# http://lists.gnu.org/archive/html/libtool/2011-02/msg00000.html
+#
+# This helper script is meant not depend on anything Gentoo specific.
+
+ld=/usr/ccs/bin/ld
+ar=/usr/ccs/bin/ar
+strip=/usr/ccs/bin/strip
+dump=/usr/sbin/dump
+awk=/usr/bin/awk
+rm=/usr/bin/rm
+mkdir=/usr/bin/mkdir
+mv=/usr/bin/mv
+ln=/usr/bin/ln
+
+oldargs=
+output=
+soname=
+newargs=
+OBJECT_MODE=${OBJECT_MODE:-32}
+
+while [[ $# -gt 0 ]]
+do
+ arg=$1
+ shift
+ oldargs="${oldargs} '${arg}'"
+ case ${arg} in
+ -o)
+ newargs="${newargs} -o '$1'"
+ output=$1
+ oldargs="${oldargs} '$1'"
+ shift
+ ;;
+ -bM:SRE)
+ newargs="${newargs} '-G' '-bernotok'"
+ ;;
+ -soname=*)
+ soname=${arg#-soname=}
+ ;;
+ -h*)
+ soname=${arg#-h}
+ ;;
+ -soname|-h)
+ soname=$1
+ shift
+ ;;
+ -b32)
+ newargs="${newargs} '${arg}'"
+ OBJECT_MODE=32
+ ;;
+ -b64)
+ newargs="${newargs} '${arg}'"
+ OBJECT_MODE=64
+ ;;
+ *)
+ newargs="${newargs} '${arg}'"
+ ;;
+ esac
+done
+
+if [[ -z ${output} || -z ${soname} ]]; then
+ eval "exec ${ld} ${oldargs}"
+ exit 1
+fi
+
+# Running ld against the orginal target file to retain
+# ld error message when there's a problem with it:
+eval "${ld} -o '${output}' ${newargs}" || exit 1
+
+workdir="${output}.$$"
+
+${rm} -rf "${workdir}" || exit 1
+trap "${rm} -rf '${workdir}'" 0
+
+case ${soname} in
+*\(*\))
+ shro=${soname#*\(}
+ shro=${shro%\)}
+ shri=${shro%.*}.imp
+ ;;
+*\[*\])
+ shro=${soname#*\[}
+ shro=${shro%\]}
+ shri=${shro%.*}.imp
+ ;;
+none) # loadable only module, not linkable: no import file
+ shro='shr.o'
+ soname="${output##*/}(${shro})"
+ shri=
+ ;;
+auto)
+ shro='shr.o'
+ soname=${output##*/}
+ if [[ ${soname} == lib*.so* ]]; then
+ # linkable library: need import file
+ shri=${shro%.*}.imp
+ else
+ # loadable only module, not linkable: no import file
+ shri=
+ fi
+ soname="${soname}(${shro})"
+ ;;
+*)
+ shro='shr.o'
+ shri=${shro%.*}.imp
+ soname="${soname}(${shro})"
+ ;;
+esac
+
+export OBJECT_MODE
+
+${mkdir} "${workdir}" || exit 1
+${strip} -e "${output}" || exit 1
+if [[ -n ${shri} ]]; then
+ ${dump} -Tv "${output}" > "${workdir}"/syms || exit 1
+ ${awk} '
+ BEGIN {
+ print "#! '"${soname}"'"
+ print "# '"${OBJECT_MODE}"'"
+ }
+ {
+ if ($4 == "EXP" || $4 == "ImpExp") {
+ print $8
+ } else
+ if ($4 == "wEXP") {
+ print $8" weak"
+ }
+ }' <"${workdir}"/syms > "${workdir}"/${shri} || exit 1
+fi
+${mv} "${output}" "${workdir}/${shro}" || exit 1
+${ar} rc "${output}" ${shri:+"${workdir}/${shri}"} "${workdir}/${shro}" || exit 1
+exit 0
diff --git a/sys-devel/native-cctools/metadata.xml b/sys-devel/native-cctools/metadata.xml
new file mode 100644
index 000000000000..d33cce94b0d4
--- /dev/null
+++ b/sys-devel/native-cctools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>prefix@gentoo.org</email>
+ <name>Gentoo Prefix</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/native-cctools/native-cctools-4.ebuild b/sys-devel/native-cctools/native-cctools-4.ebuild
new file mode 100644
index 000000000000..e94fdaa2f606
--- /dev/null
+++ b/sys-devel/native-cctools/native-cctools-4.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit eutils
+
+DESCRIPTION="Host OS native assembler as and static linker ld"
+HOMEPAGE="https://prefix.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2" # actually, we don't know, the wrapper is
+SLOT="0"
+
+AIX_V='aix-2'
+
+KEYWORDS="~ppc-aix ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+IUSE=""
+
+DEPEND="sys-devel/binutils-config"
+RDEPEND="${DEPEND}"
+
+src_unpack() {
+ mkdir -p "${S}"
+}
+
+src_install() {
+ LIBPATH=/usr/$(get_libdir)/binutils/${CHOST}/native-${PV}
+ BINPATH=/usr/${CHOST}/binutils-bin/native-${PV}
+
+ keepdir ${LIBPATH} || die
+ dodir ${BINPATH} || die
+
+ # allow for future hosts with different paths
+ nativepath=""
+ wrappers=()
+ case ${CHOST} in
+ *-solaris*)
+ nativepath=/usr/sfw/bin
+ ;;
+ *-aix*)
+ nativepath=/usr/ccs/bin
+ wrappers=("${wrappers[@]}" "ld=${FILESDIR}/${AIX_V}/ld")
+ wrappers=("${wrappers[@]}" "nm=${FILESDIR}/${AIX_V}/nm")
+ wrappers=("${wrappers[@]}" "mkexpfile=${FILESDIR}/${AIX_V}/mkexpfile")
+ ;;
+ *-apple-darwin*|*-netbsd*|*-openbsd*)
+ nativepath=/usr/bin
+ ;;
+ *-interix*)
+ nativepath=/opt/gcc.3.3/bin
+ ;;
+ *)
+ die "Don't know where the native linker for your platform is"
+ ;;
+ esac
+
+ what="addr2line as ar c++filt gprof ld nm objcopy objdump \
+ ranlib readelf elfdump size strings strip"
+ # Darwin things
+ what="${what} install_name_tool ld64 libtool lipo nmedit \
+ otool otool64 pagestuff redo_prebinding segedit"
+
+ # copy from the host os
+ cd "${ED}${BINPATH}"
+ for b in ${what} ; do
+ if [[ ${CHOST} == *-darwin* && ${b} == libtool ]] ; then
+ echo "linking darwin libtool ${nativepath}/${b}"
+ ln -s "${nativepath}/${b}" "${b}"
+ elif [[ -x ${nativepath}/g${b} ]] ; then
+ einfo "linking ${nativepath}/g${b}"
+ ln -s "${nativepath}/g${b}" "${b}"
+ elif [[ -x ${nativepath}/${b} ]] ; then
+ einfo "linking ${nativepath}/${b}"
+ ln -s "${nativepath}/${b}" "${b}"
+ else
+ ewarn "skipping ${b} (not in ${nativepath})"
+ fi
+ done
+
+ # post fix for Darwin's ranlib (doesn't like it when its called other than
+ # that, as libtool and ranlib are one tool)
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ rm -f ranlib
+ cat <<-EOF > ranlib
+ #!/usr/bin/env bash
+ exec ${nativepath}/ranlib "\$@"
+ EOF
+ chmod 755 ranlib
+ fi
+
+ exeinto ${BINPATH}
+ local wrapper source target
+ for wrapper in "${wrappers[@]}" ; do
+ source=${wrapper#*=}
+ target=${wrapper%%=*}
+ rm -f "${target}"
+ newexe "${source}" "${target}" || die
+ done
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CHOST}"
+ VER="native-${PV}"
+ LIBPATH="${EPREFIX}/${LIBPATH}"
+ FAKE_TARGETS="${CHOST}"
+ EOF
+ newins "${T}"/env.d ${CHOST}-native-${PV}
+}
+
+pkg_postinst() {
+ binutils-config ${CHOST}-native-${PV}
+}
diff --git a/sys-devel/parity/Manifest b/sys-devel/parity/Manifest
new file mode 100644
index 000000000000..1f38629b519f
--- /dev/null
+++ b/sys-devel/parity/Manifest
@@ -0,0 +1,11 @@
+AUX parity-1.2.6-debugging.patch 431 SHA256 dc502d3650a887807afb52474fc682003d9c28afb1f6bdf91a66226884ef2a43 SHA512 da62fc499c5d9e25c3373d8f3529c8dfb0c26bfb08bba851b144d4f2f0b98e29fcf2d1e11022d10412b67afad84e70bcd5456842f4beccaaeab1bf1091e9ddb9 WHIRLPOOL b0cb5fe0e187521e3f6d503e8ffbac4238f7003119b1ff5e2e35a982e88d4dc25965b46dd050962a9ea205593353ba3b9d01d2cadf5d2f42d1a80374ac2410ca
+DIST parity-1.2.4.tar.gz 456408 SHA256 13d781a5f606244f53d980bdb362f30bbdb67d29e8d93075c893fc7ee13fc496 SHA512 236476c8fbf29e84363062722cb5092d07c86798584d0a17ea0406b2416e044fd2952f81e31b5a49b3f117592a7fbf496379ad065320d44fee8d33ebb86ec590 WHIRLPOOL 2fd4ef7d04bf0f8e69f8e892a2afdc1bef89f48e31ef7a1410e7f2e0b5df4de7ef84f87d633abbbece53ae9079a83fad67d734b2b46b37b3429c49a9512ed300
+DIST parity-1.2.5.tar.gz 559411 SHA256 950d7888c7bf0cd6ad8955b4781d2fafcbdae2b009d13f80929b12a1af9cc4df SHA512 daadf80582b7fa8914f7899e4055185885164210f9a970ff178c3846da83058e3bd70c1db10406e3bcaef05148e87226846cb39e30cbbd1e0821176a8f65c32b WHIRLPOOL 90f3803b0fd62b5a8d198a3c2c95eb23a7db62ad80b49ec71daf7eb834f51f5af37a1efaba9bcaa7d54170655c527d95b4e399c4038993f0b17a9dba3dbe2fe6
+DIST parity-1.2.6.tar.gz 559357 SHA256 a0b9fb69e6bbef5f2b4a6ef84910c23b8cac5649456ef1834d0517a06d2c3537 SHA512 fe043feef71db20cf759fd1b5eb8e855f5f78b278f48e9d4afdd2c06fc6c6ae861439cde3829728d3548e072cb065aea5d4048da7ad8bc49f5bc7fcebf7ad430 WHIRLPOOL 98662c7f37b3eb4040ac49e1135d4fa6bbea8a4473094ee5d9f12c79fa81886dbf4ccd3037d56f55ee707a0d749be6898b6826e8f7126b426608011d79a042fe
+EBUILD parity-1.2.4.ebuild 1840 SHA256 4afcbb269952d0399b03290e1d08e1d7e6f836c93e033b967a9390db724a0d2e SHA512 b9a729395449b6265357c134b56046bd3928dfb2c99a526e402be319c74f04ddfeca107ca15db3c405ec1d9a9ed2b512e24aa48f7d57db0ae485c6ce86ff1379 WHIRLPOOL ba7b95228b22ef9da429a5ed30521c2c285bfc4a5d45d1d2d90d231118bf5045ac918fa3c06e3afb46df481957ac2f0e4438d067ce9580012a068779956f5406
+EBUILD parity-1.2.5.ebuild 1840 SHA256 4afcbb269952d0399b03290e1d08e1d7e6f836c93e033b967a9390db724a0d2e SHA512 b9a729395449b6265357c134b56046bd3928dfb2c99a526e402be319c74f04ddfeca107ca15db3c405ec1d9a9ed2b512e24aa48f7d57db0ae485c6ce86ff1379 WHIRLPOOL ba7b95228b22ef9da429a5ed30521c2c285bfc4a5d45d1d2d90d231118bf5045ac918fa3c06e3afb46df481957ac2f0e4438d067ce9580012a068779956f5406
+EBUILD parity-1.2.6.ebuild 1912 SHA256 f1ac854292e512dacae6bcf032de298ff73a3f7e62c1f1064408d145e6950f21 SHA512 3472126d0cca7f23f207187fe648c48a31abfafb7440a815f1a7dae952b53a42732fa3d50dae3b3e3eb5f5b42c00bfcd847f108a9845ecd21ecc440245b47c99 WHIRLPOOL b7a51217ad6fbdeb6e132ed79cbd0637efd0c8867ba5d9f9275ab7188d2fcb5a6438600cc003e12484bea1e6597da3c062193dac418b793f4e9e41302544f616
+EBUILD parity-9999.ebuild 2042 SHA256 33ffd15f595ae362d9c0e738077c5a1379167cdf2decf00ccc5c67eddddd780f SHA512 29f58be9aea4f471ed75d73d4a217b295b8ea2f0c3f083f5ebb92c08cd04ea4ef79d22ba9ff557d636740a8704b4a8605496c126e6348f98cff02b0222d36250 WHIRLPOOL 1421a435fe58b766fb0f5ea78a67570e91fa5b06bad32c91c4ae406530eeceff9d8d54bbc0533b5bd3de31fe442aed4f82440f56378691e7a94e2fcc0f9f722d
+MISC ChangeLog 2562 SHA256 832220bb9822aa1e9fa8f6c260255c3376b8fdaf9c0162f33d42c764b8a429d2 SHA512 6db486bea5fc27cb95d4bc9fc3bd6c95d2096d7ac6ceb117ed838fdc1285e130213811d8a45eccdfa525976fa50758cdb46792b3cf93bdda0a09d4cea0cef826 WHIRLPOOL 031b2ca146cf78462b6c4ead7b0025c1c5fffa2debeccf68b5f93c73c4331332742acd923e672310d936ba6ae5ebadaed7692ba9c634f593da4de86389fd561f
+MISC ChangeLog-2015 4528 SHA256 a982a82513eaf4b84253bdf1c33310e7d382a28c96cf3582dd3beabc0d652f2f SHA512 ac131d0bfdd116ad4d9375c307c1f9e112cdc1dbb543abc07dced49e6fc4ab40f7260ec0b8aedb8b5be0dc6eb778c5edcee94625ad523f43a1d642d02f0d676b WHIRLPOOL 0eeb0e1875fde614cbcf4005acefaeb9b18839140a4ebd6d6d6d73da25bbbb53b9354b2725764bdbb6e9d7b8695b11d9e6ff67684b1a8cfe088c431d8bd70cca
+MISC metadata.xml 381 SHA256 092a74d1d829761febb8b7175e4eca79ac117065cae4ceba444cd60a1a4b5ae4 SHA512 6ba0a9716f0ac257e89c2a2ac1b35c9a39f8ced04260b74c4e8fce0906a9dbcad9844817aaeb8c3288e16cd3897c3617233d19634728f8e49a2e31e0d39e586e WHIRLPOOL 8ef56798abb047461dd9073b6ffe5c3b7d053a68026d4885a5214d6bcca761317e0d1c121633f60b53b265f42e9a6a591b3d1b81aea9fae5571d939581d435b8
diff --git a/sys-devel/parity/files/parity-1.2.6-debugging.patch b/sys-devel/parity/files/parity-1.2.6-debugging.patch
new file mode 100644
index 000000000000..709f46ee9734
--- /dev/null
+++ b/sys-devel/parity/files/parity-1.2.6-debugging.patch
@@ -0,0 +1,17 @@
+--- parity.runtime/diagnose.c.orig 2012-09-28 17:12:54 +0200
++++ parity.runtime/diagnose.c 2012-09-28 17:11:14 +0200
+@@ -745,9 +745,11 @@
+ CloseHandle(hCore);
+ }
+
+- // abort on fatal exceptions
+- TerminateProcess(GetCurrentProcess(), 1);
+- ExitProcess(1);
++ if (!IsDebuggerPresent()) {
++ // abort on fatal exceptions
++ TerminateProcess(GetCurrentProcess(), 1);
++ ExitProcess(1);
++ }
+ return EXCEPTION_CONTINUE_SEARCH;
+ }
+
diff --git a/sys-devel/parity/metadata.xml b/sys-devel/parity/metadata.xml
new file mode 100644
index 000000000000..c0714eac500c
--- /dev/null
+++ b/sys-devel/parity/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>haubi@gentoo.org</email>
+ <name>Michael Haubenwallner</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">parity</remote-id>
+ <remote-id type="github">haubi/parity</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/parity/parity-1.2.4.ebuild b/sys-devel/parity/parity-1.2.4.ebuild
new file mode 100644
index 000000000000..a52cea9e6344
--- /dev/null
+++ b/sys-devel/parity/parity-1.2.4.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+DESCRIPTION="An Interix to native Win32 Cross-Compiler Tool (requires Visual Studio)"
+HOMEPAGE="http://www.sourceforge.net/projects/parity/"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit subversion
+ ESVN_REPO_URI="https://svn.code.sf.net/p/parity/code/trunk"
+ ESVN_BOOTSTRAP="confix --bootstrap"
+ ESVN_PROJECT="${PN}"
+ KEYWORDS=""
+
+ DEPEND="dev-util/confix"
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+ KEYWORDS="~x86-winnt"
+fi
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE=""
+
+pkg_setup() {
+ if [ -z "${MSSDK}" ]; then
+ einfo "NOTE: When using Visual Studio 2008, the Platform SDK is no longer"
+ einfo "installed alongside with the other components, but has it's own"
+ einfo "root directory, most likely something like this:"
+ einfo ""
+ einfo " C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A"
+ einfo ""
+ einfo "To make parity find it's paths correctly, please set MSSDK to the"
+ einfo "value correspoding to the above example for your system."
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ # create i586-pc-winnt*-g[++|cc|..] links..
+ local exeext=
+
+ [[ -f ${ED}/usr/bin/parity.gnu.gcc.exe ]] && exeext=.exe
+
+ # create cross compiler syms
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-gcc
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-c++
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-g++
+ dosym /usr/bin/parity.gnu.ld${exeext} /usr/bin/i586-pc-winnt$(uname -r)-ld
+
+ # we don't need the header files installed by parity... private
+ # header files are supported with a patch from 2.1.0-r1 onwards,
+ # so they won't be there anymore, but -f does the job in any case.
+ rm -f "${ED}"/usr/include/*.h
+}
diff --git a/sys-devel/parity/parity-1.2.5.ebuild b/sys-devel/parity/parity-1.2.5.ebuild
new file mode 100644
index 000000000000..a52cea9e6344
--- /dev/null
+++ b/sys-devel/parity/parity-1.2.5.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+DESCRIPTION="An Interix to native Win32 Cross-Compiler Tool (requires Visual Studio)"
+HOMEPAGE="http://www.sourceforge.net/projects/parity/"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit subversion
+ ESVN_REPO_URI="https://svn.code.sf.net/p/parity/code/trunk"
+ ESVN_BOOTSTRAP="confix --bootstrap"
+ ESVN_PROJECT="${PN}"
+ KEYWORDS=""
+
+ DEPEND="dev-util/confix"
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+ KEYWORDS="~x86-winnt"
+fi
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE=""
+
+pkg_setup() {
+ if [ -z "${MSSDK}" ]; then
+ einfo "NOTE: When using Visual Studio 2008, the Platform SDK is no longer"
+ einfo "installed alongside with the other components, but has it's own"
+ einfo "root directory, most likely something like this:"
+ einfo ""
+ einfo " C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A"
+ einfo ""
+ einfo "To make parity find it's paths correctly, please set MSSDK to the"
+ einfo "value correspoding to the above example for your system."
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ # create i586-pc-winnt*-g[++|cc|..] links..
+ local exeext=
+
+ [[ -f ${ED}/usr/bin/parity.gnu.gcc.exe ]] && exeext=.exe
+
+ # create cross compiler syms
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-gcc
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-c++
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-g++
+ dosym /usr/bin/parity.gnu.ld${exeext} /usr/bin/i586-pc-winnt$(uname -r)-ld
+
+ # we don't need the header files installed by parity... private
+ # header files are supported with a patch from 2.1.0-r1 onwards,
+ # so they won't be there anymore, but -f does the job in any case.
+ rm -f "${ED}"/usr/include/*.h
+}
diff --git a/sys-devel/parity/parity-1.2.6.ebuild b/sys-devel/parity/parity-1.2.6.ebuild
new file mode 100644
index 000000000000..f91ef988e4dc
--- /dev/null
+++ b/sys-devel/parity/parity-1.2.6.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils
+
+if [[ ${PV} == 9999 ]]; then
+ inherit subversion
+ ESVN_REPO_URI="https://svn.code.sf.net/p/parity/code/trunk"
+ ESVN_BOOTSTRAP="confix --bootstrap"
+ ESVN_PROJECT="${PN}"
+ : ${KEYWORDS=""}
+
+ DEPEND="dev-util/confix"
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+ KEYWORDS=""
+fi
+DESCRIPTION="An Interix to native Win32 Cross-Compiler Tool (requires Visual Studio)"
+HOMEPAGE="http://www.sourceforge.net/projects/parity/"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE=""
+
+pkg_setup() {
+ if [ -z "${MSSDK}" ]; then
+ einfo "NOTE: When using Visual Studio 2008, the Platform SDK is no longer"
+ einfo "installed alongside with the other components, but has it's own"
+ einfo "root directory, most likely something like this:"
+ einfo ""
+ einfo " C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A"
+ einfo ""
+ einfo "To make parity find it's paths correctly, please set MSSDK to the"
+ einfo "value correspoding to the above example for your system."
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-debugging.patch
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ # create i586-pc-winnt*-g[++|cc|..] links..
+ local exeext=
+
+ [[ -f ${ED}/usr/bin/parity.gnu.gcc.exe ]] && exeext=.exe
+
+ # create cross compiler syms
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-gcc
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-c++
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt$(uname -r)-g++
+ dosym /usr/bin/parity.gnu.ld${exeext} /usr/bin/i586-pc-winnt$(uname -r)-ld
+
+ # we don't need the header files installed by parity... private
+ # header files are supported with a patch from 2.1.0-r1 onwards,
+ # so they won't be there anymore, but -f does the job in any case.
+ rm -f "${ED}"/usr/include/*.h
+}
diff --git a/sys-devel/parity/parity-9999.ebuild b/sys-devel/parity/parity-9999.ebuild
new file mode 100644
index 000000000000..d6e19cd51a49
--- /dev/null
+++ b/sys-devel/parity/parity-9999.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="git@github.com:haubi/parity.git https://github.com/haubi/parity.git"
+ DEPEND="dev-util/confix"
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+ KEYWORDS=""
+fi
+DESCRIPTION="A POSIX to native Win32 Cross-Compiler Tool (requires Visual Studio)"
+HOMEPAGE="https://github.com/haubi/parity"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE=""
+
+pkg_setup() {
+ if [ -z "${MSSDK}" ]; then
+ einfo "NOTE: When using Visual Studio 2008, the Platform SDK is no longer"
+ einfo "installed alongside with the other components, but has it's own"
+ einfo "root directory, most likely something like this:"
+ einfo ""
+ einfo " C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A"
+ einfo ""
+ einfo "To make parity find it's paths correctly, please set MSSDK to the"
+ einfo "value correspoding to the above example for your system."
+ fi
+}
+
+if [[ ${PV} == 9999 ]]; then
+ src_prepare() {
+ confix --bootstrap || die
+ default
+ }
+fi
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ # create i586-pc-winnt-g[++|cc|..] links..
+ local exeext=
+
+ [[ -f ${ED}usr/bin/parity.gnu.gcc.exe ]] && exeext=.exe
+
+ # create cross compiler syms, also for former versioned winnt profiles
+ local v t
+ for v in "" 5.2 6.1; do
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt${v}-c++
+ dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt${v}-g++
+ for t in gcc ld windres ar nm ranlib strip; do
+ if [[ -e "${ED}"usr/bin/parity.gnu.${t}${exeext} ]]; then
+ dosym /usr/bin/parity.gnu.${t}${exeext} /usr/bin/i586-pc-winnt${v}-${t}
+ else
+ dosym /usr/bin/parity.gnu.${t} /usr/bin/i586-pc-winnt${v}-${t}
+ fi
+ done
+ done
+
+ # we don't need the header files installed by parity... private
+ # header files are supported with a patch from 2.1.0-r1 onwards,
+ # so they won't be there anymore, but -f does the job in any case.
+ rm -f "${ED}"/usr/include/*.h
+}
diff --git a/sys-devel/patch/Manifest b/sys-devel/patch/Manifest
new file mode 100644
index 000000000000..fbfefa29c668
--- /dev/null
+++ b/sys-devel/patch/Manifest
@@ -0,0 +1,5 @@
+DIST patch-2.7.5.tar.xz 727704 SHA256 fd95153655d6b95567e623843a0e77b81612d502ecf78a489a4aed7867caa299 SHA512 6620ac8101f60c0b456ce339fa5e371f40be0b391e2e9728f34f3625f9907e516de61dac2f91bc76e6fd28a9bd1224efc3ba827cfaa606d857730c1af4195a0f WHIRLPOOL 27e209cd99b0e3366c7e094e54581510fb3018202fc79d6a906e14e87efae1b7b7548fcafb70af6f5db59f08237fd0f5363789d719ff3452925bd99dc41a9cdb
+EBUILD patch-2.7.5.ebuild 922 SHA256 efeb671918049813add27686879a81a66b9c0854e7fb11495a89ab28fe242e73 SHA512 52ed38cd7c035b371617a1e2bfbbeaa7221d2e8f5f8832c66c0f51706802b61c86fc0ee05ebfab9efecd10e3d684f8839c6a80baa30abf1be12eeb06d19edd5c WHIRLPOOL be597241094b3f496afc0c67332a6aedfcdf830419d24239d3b85b9ef4af75d79c676e1fd7a3aaba8337bc2e2ec95fdf21f49e042b58ce80e7001fbe0b47c212
+MISC ChangeLog 3616 SHA256 120f10f46c3a648be07e1383dcae3d368fd22d9b1cf56c849d138fac6e1fd031 SHA512 0e24401f8be041f3f09ac3be85c46f05c3884b851803754810a37b8c9d17a130a0785093e8eed90b3b190a7d4415835978d10a1645a95ba13b3b19dba926d6ed WHIRLPOOL 049c97583128f412cdba496d22d10de24f2a463231ceaea2936eb8ce783cf0b78fb215e4106a5e019e85b42ac74be28d9ec38b95dfc5fdc7d883a27abb8dcb4e
+MISC ChangeLog-2015 11384 SHA256 51ef22c4293e7c9b7923db88c6fb6a1a27dff39695a21b956e5763a1ddd59a0d SHA512 487894a0cdfd9e9aecb71873c88513be8fa48cd50385c7accb3538bf574dc4e75aad75e585a7acc7836a202bafb9c4389cefe247b6f5919998debe857ac84c56 WHIRLPOOL 28502c53399d9ed89b8bac25918425ef42113499fbeaedcbfb176ac931a0eadad8d527151479dea1f2eefb5573f3ef481856750c3950862a50cfc94dec416645
+MISC metadata.xml 253 SHA256 d82c33ef453113a5c1ebe250dcba373c22934a69b0a86c6ab15a5ca589c25b91 SHA512 54a9069aeb4165d2dff3d473c8001bc51613aac9dff3f7f5e9971a9891a737a31511ffa11cbd523febe581ac1d9de2bdf2f40410f0c4239138f2ccca3ef15555 WHIRLPOOL e5aee23acff864609953a1e4de768f0e4aef704b44c53c021f28573e1ca5c99f1a46d92935ecec2449f7b4419a36d8373127d0ecfa8d7bae72d835e1839eb3f8
diff --git a/sys-devel/patch/metadata.xml b/sys-devel/patch/metadata.xml
new file mode 100644
index 000000000000..56c124413057
--- /dev/null
+++ b/sys-devel/patch/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/patch/patch-2.7.5.ebuild b/sys-devel/patch/patch-2.7.5.ebuild
new file mode 100644
index 000000000000..92310e30ad67
--- /dev/null
+++ b/sys-devel/patch/patch-2.7.5.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Utility to apply diffs to files"
+HOMEPAGE="https://www.gnu.org/software/patch/patch.html"
+SRC_URI="mirror://gnu/patch/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static test xattr"
+
+RDEPEND="xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}
+ test? ( sys-apps/ed )"
+
+src_configure() {
+ use static && append-ldflags -static
+
+ # Do not let $ED mess up the search for `ed` 470210.
+ ac_cv_path_ED=$(type -P ed) \
+ econf \
+ $(use_enable xattr) \
+ --program-prefix="$(use userland_BSD && echo g)"
+}
diff --git a/sys-devel/pmake/Manifest b/sys-devel/pmake/Manifest
new file mode 100644
index 000000000000..fd72300c5073
--- /dev/null
+++ b/sys-devel/pmake/Manifest
@@ -0,0 +1,10 @@
+AUX pmake-1.111.1-ldflags.patch 484 SHA256 64bfa9f5d832c6a7ffd19c133c5f061ab347f69da0130141b54d378f2173fd89 SHA512 10276e6caa4e339a2e7c787ee04dc97187d48cf433cd6148ec5451ae055d638f79c8d8950c94fe84cdffa02b20519423272f09a6ee669ab026db861442051849 WHIRLPOOL 05995b5ffb2fe2b1a84ac38890ad17fd568645e5a8f796665311f09afd7fb69047d8289481843fe7d25f4efbe2d222dc0a3e5bd098f4609a0da01126241f79b7
+AUX pmake-1.98-skipdots.patch 513 SHA256 4d12778d4940012a98773fc4c180418f3409529beadc909921dc07d2c8b4e32d SHA512 ccd751cca406abdb763f251c147f7b7efd7b001e415bc8c98a4fa8069420b64c3a5819b4abd5f174606390f903f8cba5e560e02a14519619713da26ab52c54ad WHIRLPOOL 8e70f4400ec3f560b94a2fb01b01a4227d4e719b487d53e9862c3c8ddf31a9d160f4524e6f9dedb3dea511caa22e8f86b708bdd059f0cf464433fb080a9a2113
+DIST pmake_1.111-3.1.debian.tar.gz 32176 SHA256 964101c5c06f32161398bf6efa0c52e59763523bd633fded6eb165ec3d025da7 SHA512 a5743c0b0478119cf8ac01b0182f14cf213b275078b1cd2badee9ac26a3b40660bf4fd430af079fdaa7bc8117ed8a1cdf855166e34e151204e34e7d2b67beee3 WHIRLPOOL 155682e807d06b9df0a8ce37f1e98250246ea7cda12f7342cf25388b08f4e5d4b1cb3aa4922a4dbd37f6ffcba0918ae32d37686f91abeca6517cfafe0bffedac
+DIST pmake_1.111-3.3.debian.tar.gz 31648 SHA256 2bf161316e0e97ea90a9fe1d53d6dbd262351145a805890aa88faa91aa458366 SHA512 b22a1d9e371712732f196d91ac3eb9239fa98ee8ee05754576e7a5878cab88976cb10bb6be90706df5ac738373f519468403c23f6a3ff3860a2968b3222a66ed WHIRLPOOL a07f64bbff44293d796afdda5ebd61f697060a749b2eb1eea66dba4850e91481a9d5ade9a71a1b24dd08dba4a36dc5ff86e08fe2a70cce221fb7302ebafbeaa7
+DIST pmake_1.111.orig.tar.gz 264383 SHA256 dde37ac618f19a7cce174754c207e90501cab362b51f904bcfb20dfb24a13539 SHA512 ad48708ea014d6a38ad36303504c52992b51a1e815564f1710849d859b1fc3cd58c4a1a71f54ec902c9b69112e9cd1e1a64282ff738439cdb209a4f75c364c22 WHIRLPOOL c3038682686acc4c32e25efb3db623b06f7f1d6df5813389319cc32151207f0cb93e44bedd82e7486907cbb9f0950a4a80c811eb1b6a148083bef23f613a7ec2
+EBUILD pmake-1.111.3.1.ebuild 2361 SHA256 79d86f97371d19c2aaef5c1690acd83d31a8712157b986765e88b3e595cd8776 SHA512 8c94e3b2c70193e10663caaf3a456b88c9e3343c6d1bf2dcc1640bfdda96b1ad703b655b7db06ba7b29b9f74ea0cf7f25744b8afa52ed0b4befe36f8950b5278 WHIRLPOOL 46fc5f050de39fbbabd909d62cb7f19e15e423ccebaf7d06e958905f365b8a7643fee98a0cdf99479391d9dc418aaf58e88778a151960847328a6b3797f113b2
+EBUILD pmake-1.111.3.3.ebuild 2379 SHA256 d5110427d8fabda0758cd8ac4e5f4e5ee2981d8310258c2aeafb629f7a45a8e3 SHA512 372899a6500e07f6b7af455a0b74a0e9e778be0346f8dfc0817caad25cc6aea7d98e369f820b84cc2d75cc2098b78621e6be002e032aa34c3ba1ac6ca77edef8 WHIRLPOOL 94d16aa152e176fd686499633b25fa5cd09ecb99baef02e217dbc18290b5f18d135f8cef37b1aacb27326d3660af4eaf59152a8b46f3eca02f137cd0cada9bb9
+MISC ChangeLog 2558 SHA256 a8d561d4a1510dd5ca42987cdb3e84250688a1c404b90ad4059b5e7c0dc061be SHA512 3f6e72e49360cb5d0de5c88314cd51b5cfc460f3eab7eedead3d273b20af91ca1778f34ef59363739d90c8e2018c41e1470609a26b1c29891bc30b1adcb48eec WHIRLPOOL 97fec88c9fbed5706098f6042eb931ab80c061492d1623adb40e4b270cf22837f91a826785b05613b5f8f9e484bd4776a39058cda9d2f0da982411f63cb47600
+MISC ChangeLog-2015 7022 SHA256 03059f9234e91dd2e46c198e0b95a8ffaca6d3aaac586f8019d946b8ff85beb8 SHA512 87a2e6b52ab23bf5eabb0ce75c02499d8cae4070dfdd9d87779bcabf7f8ff7ab7344d574242d8c36c24253ccce618cb88420ad5d418a0912c92d7f1f075cfa2a WHIRLPOOL 79fbf50cfc4c5ab0ec5f95b38575aa70148be68ac5e1b1fc090c7be7cbeafab58d1a1d1b0b4d3a85e2360e1c9130ef487e7ba3ab622ff7a2499e7d83a46071ec
+MISC metadata.xml 238 SHA256 501d93b0c41ed422505100f002758cd173cd9783ae7fbb53e2ec5f238c868340 SHA512 173efaa53a514acf1e2f0c6681c82a48ec16d505844f551d2cc823ee8685b27837c7461f7956c12182059ee7e83023e2f0bcd5d1afab74beeaf998487193656d WHIRLPOOL 4ca51d994f011a5e7e4939f02a54b5c2f9f3e526665893c9ac2876c9871b7dc80361393d41c5247b3a5520e82d31d0dd10da520e7715c94b806a94ce0fed2a5a
diff --git a/sys-devel/pmake/files/pmake-1.111.1-ldflags.patch b/sys-devel/pmake/files/pmake-1.111.1-ldflags.patch
new file mode 100644
index 000000000000..d6047d48994b
--- /dev/null
+++ b/sys-devel/pmake/files/pmake-1.111.1-ldflags.patch
@@ -0,0 +1,13 @@
+Index: pmake/Makefile.boot
+===================================================================
+--- pmake.orig/Makefile.boot
++++ pmake/Makefile.boot
+@@ -36,7 +36,7 @@ LIBOBJ= lst.lib/lstAppend.o lst.lib/lstA
+
+ bmake: ${OBJ} ${LIBOBJ}
+ # @echo 'make of make and make.0 started.'
+- ${CC} ${CFLAGS} ${OBJ} ${LIBOBJ} -o bmake ${LIBS}
++ ${CC} ${LDFLAGS} ${CFLAGS} ${OBJ} ${LIBOBJ} -o bmake ${LIBS}
+ @ls -l $@
+ # nroff -h -man make.1 > make.0
+ # @echo 'make of make and make.0 completed.'
diff --git a/sys-devel/pmake/files/pmake-1.98-skipdots.patch b/sys-devel/pmake/files/pmake-1.98-skipdots.patch
new file mode 100644
index 000000000000..6783a9799919
--- /dev/null
+++ b/sys-devel/pmake/files/pmake-1.98-skipdots.patch
@@ -0,0 +1,12 @@
+diff -urN pmake-2.0.orig/dir.c pmake-2.0/dir.c
+--- pmake-2.0.orig/dir.c 2005-02-08 09:26:28.932978574 -0500
++++ pmake-2.0/dir.c 2005-02-08 09:36:18.208704201 -0500
+@@ -1528,6 +1528,8 @@
+ Hash_InitTable (&p->files, -1);
+
+ while ((dp = readdir (d)) != (struct dirent *) NULL) {
++ if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
++ continue;
+ #if defined(sun) && defined(d_ino) /* d_ino is a sunos4 #define for d_fileno */
+ /*
+ * The sun directory library doesn't check for a 0 inode
diff --git a/sys-devel/pmake/metadata.xml b/sys-devel/pmake/metadata.xml
new file mode 100644
index 000000000000..a00f3aeb1f81
--- /dev/null
+++ b/sys-devel/pmake/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>bsd@gentoo.org</email>
+ <name>BSD Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/pmake/pmake-1.111.3.1.ebuild b/sys-devel/pmake/pmake-1.111.3.1.ebuild
new file mode 100644
index 000000000000..cbd8c14db38e
--- /dev/null
+++ b/sys-devel/pmake/pmake-1.111.3.1.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs versionator
+
+MY_P="${PN}-$(get_version_component_range 1-2)"
+DEBIAN_SOURCE="${PN}_$(get_version_component_range 1-2).orig.tar.gz"
+DEBIAN_PATCH="${PN}_$(replace_version_separator 2 '-').debian.tar.gz"
+
+DESCRIPTION="BSD build tool to create programs in parallel. Debian's version of NetBSD's make"
+HOMEPAGE="http://www.netbsd.org/"
+SRC_URI="mirror://debian/pool/main/p/pmake/${DEBIAN_SOURCE}
+ mirror://debian/pool/main/p/pmake/${DEBIAN_PATCH}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=""
+DEPEND=""
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-g0 -E --no-backup-if-mismatch -p1" \
+ EPATCH_SUFFIX="diff" \
+ epatch "${WORKDIR}/debian/patches"
+
+ # pmake makes the assumption that . and .. are the first two
+ # entries in a directory, which doesn't always appear to be the
+ # case on ext3... (05 Apr 2004 agriffis)
+ epatch "${FILESDIR}/${PN}-1.98-skipdots.patch"
+
+ # Don't ignore ldflags
+ epatch "${FILESDIR}/${PN}-1.111.1-ldflags.patch"
+}
+
+src_compile() {
+ # The following CFLAGS are almost directly from Red Hat 8.0 and
+ # debian/rules, so assume it's okay to void out the __COPYRIGHT
+ # and __RCSID. I've checked the source and don't see the point,
+ # but whatever... (07 Feb 2004 agriffis)
+ CFLAGS="${CFLAGS} -Wall -Wno-unused -D_GNU_SOURCE \
+ -DHAVE_STRERROR -DHAVE_STRDUP -DHAVE_SETENV \
+ -D__COPYRIGHT\(x\)= -D__RCSID\(x\)= -I. \
+ -DMACHINE=\\\"gentoo\\\" -DMACHINE_ARCH=\\\"$(tc-arch-kernel)\\\" \
+ -D_PATH_DEFSHELLDIR=\\\"${EPREFIX}/bin\\\" \
+ -D_PATH_DEFSYSPATH=\\\"${EPREFIX}/usr/share/mk\\\" \
+ -DHAVE_VSNPRINTF"
+ if [[ "${USERLAND}" == "GNU" ]]; then
+ CFLAGS="${CFLAGS} -D_PATH_DEFSYSPATH=\\\"${EPREFIX}/usr/share/mk/${PN}\\\""
+ fi
+
+ emake -f Makefile.boot \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ # Don't install these on BSD, else they conflict
+ if [[ "${USERLAND}" == "GNU" ]]; then
+ insinto /usr/share/mk/${PN}
+ doins mk/*
+ fi
+
+ newbin bmake pmake
+ dobin mkdep
+ mv make.1 pmake.1
+ doman mkdep.1 pmake.1
+ dodoc PSD.doc/tutorial.ms
+
+ if [[ "${USERLAND}" == "BSD" ]]; then
+ dosym pmake /usr/bin/make
+ dosym pmake.1.gz /usr/share/man/man1/make.1.gz
+ fi
+}
diff --git a/sys-devel/pmake/pmake-1.111.3.3.ebuild b/sys-devel/pmake/pmake-1.111.3.3.ebuild
new file mode 100644
index 000000000000..7da945dc1cf2
--- /dev/null
+++ b/sys-devel/pmake/pmake-1.111.3.3.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=4
+
+inherit eutils toolchain-funcs versionator linux-info
+
+MY_P="${PN}-$(get_version_component_range 1-2)"
+DEBIAN_SOURCE="${PN}_$(get_version_component_range 1-2).orig.tar.gz"
+DEBIAN_PATCH="${PN}_$(replace_version_separator 2 '-').debian.tar.gz"
+
+DESCRIPTION="BSD build tool to create programs in parallel. Debian's version of NetBSD's make"
+HOMEPAGE="http://www.netbsd.org/"
+SRC_URI="mirror://debian/pool/main/p/pmake/${DEBIAN_SOURCE}
+ mirror://debian/pool/main/p/pmake/${DEBIAN_PATCH}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="alpha amd64 arm ~arm64 ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=""
+DEPEND=""
+
+S="${WORKDIR}/${PN}"
+
+src_prepare() {
+ EPATCH_FORCE="yes" \
+ EPATCH_OPTS="-g0 -E --no-backup-if-mismatch -p1" \
+ EPATCH_SUFFIX="diff" \
+ epatch "${WORKDIR}/debian/patches"
+
+ # pmake makes the assumption that . and .. are the first two
+ # entries in a directory, which doesn't always appear to be the
+ # case on ext3... (05 Apr 2004 agriffis)
+ epatch "${FILESDIR}/${PN}-1.98-skipdots.patch"
+
+ # Don't ignore ldflags
+ epatch "${FILESDIR}/${PN}-1.111.1-ldflags.patch"
+}
+
+src_compile() {
+ # The following CFLAGS are almost directly from Red Hat 8.0 and
+ # debian/rules, so assume it's okay to void out the __COPYRIGHT
+ # and __RCSID. I've checked the source and don't see the point,
+ # but whatever... (07 Feb 2004 agriffis)
+ CFLAGS="${CFLAGS} -Wall -Wno-unused -D_GNU_SOURCE \
+ -DHAVE_STRERROR -DHAVE_STRDUP -DHAVE_SETENV \
+ -D__COPYRIGHT\(x\)= -D__RCSID\(x\)= -I. \
+ -DMACHINE=\\\"gentoo\\\" -DMACHINE_ARCH=\\\"$(tc-arch-kernel)\\\" \
+ -D_PATH_DEFSHELLDIR=\\\"${EPREFIX}/bin\\\" \
+ -D_PATH_DEFSYSPATH=\\\"${EPREFIX}/usr/share/mk\\\" \
+ -DHAVE_VSNPRINTF"
+ if [[ "${USERLAND}" == "GNU" ]]; then
+ CFLAGS="${CFLAGS} -D_PATH_DEFSYSPATH=\\\"${EPREFIX}/usr/share/mk/${PN}\\\""
+ fi
+
+ emake -f Makefile.boot \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ # Don't install these on BSD, else they conflict
+ if [[ "${USERLAND}" == "GNU" ]]; then
+ insinto /usr/share/mk/${PN}
+ doins mk/*
+ fi
+
+ newbin bmake pmake
+ dobin mkdep
+ mv make.1 pmake.1
+ doman mkdep.1 pmake.1
+ dodoc PSD.doc/tutorial.ms
+
+ if [[ "${USERLAND}" == "BSD" ]]; then
+ dosym pmake /usr/bin/make
+ dosym pmake.1.gz /usr/share/man/man1/make.1.gz
+ fi
+}
diff --git a/sys-devel/prelink/Manifest b/sys-devel/prelink/Manifest
new file mode 100644
index 000000000000..bdbccb11cd5b
--- /dev/null
+++ b/sys-devel/prelink/Manifest
@@ -0,0 +1,14 @@
+AUX prelink-20130503-libiberty-md5.patch 2604 SHA256 4d09fe9a9bb731e24681ced804c541f63c9976ac1320960678eccd80a3b234c3 SHA512 5240d1d0d2a0014aa117f09cb8af872cda178401d09d1df4260bfedecf0aa74b2c713dc08ba0cf08a15aba2e49155a40047c30f7907b27a65f39ebbf8ad4f9ca WHIRLPOOL d7a537b60d2297491cf96d738dabe5ce1a88a9aab7e5e67027daa84c3a44d6ad207f77cb28e880beb576b6c64ab4f863765f1d932ddaff53270d3caee6719097
+AUX prelink-20130503-prelink-conf.patch 910 SHA256 52d2c0d52bde5c6ea9b2101d37dc4dbca988f5aece517ad85ee1ff4be2ff2a9d SHA512 640fce42bac33d76a9ed312a138817695b57b03e7b0d1c57b074903739c3fb3b7c64b8c0d839687dd60fd50054d682f2f095c3f0eff7d5f4fe505d6c334267b2 WHIRLPOOL 60fcaa242576c52fdbcbe1715b9087de191399346164deff143646a8a4a8b92d518b5ac6b22c64f4c7c4321d11a0932c32ffd6fdca581bab5a1c7006b77c1499
+AUX prelink-armhf-dynamic-linker.patch 519 SHA256 d6ca6ce138a5e33568376068e5e48425e2601e17863f17f166abcb36772c45ff SHA512 af898440f11af102d6d4b95ade2ed267dc5e3e01407ded17ca2df7454ee845f8177c0316e9bc73838f3965f5000f58ac51055588fdb4a90293cc431e07e9e467 WHIRLPOOL 48c3f54c56dd2e324f7d33b7ebeb71b6123c7c263baa3c8a98306a209bcbf2a454fc2b816df836f7d6c37e143b65e8b1a59ae2f62e3594a9a949267e1a3246e9
+AUX prelink.confd 1677 SHA256 e5db6bcc86a010a50be9134cb440f8366247ee36f1556f97d4f270746eb59dea SHA512 d9edf2535d0b5f1effa797882abfc1cae71a4944e7a443880845a6f860d160125f2ab3a1d69db444e31a35b62a09ed661adcbc1ee62539e9a73f270d33602e9b WHIRLPOOL a584d7b609dcd545930f95934f2de8cc15f39c6ff0c9e0cf92d13429842960ef27f91e23026dd74a72c2e755e150c5837c7d026dc88b5965ba514503fb7a83c1
+AUX prelink.cron 2424 SHA256 6258d94475db9f58902c1e13ef0f3abe1422f0c955d6e385455a4c7e8f63957c SHA512 0c336bcd3b77fabd978d637b4063bb88ac6a675ba910b374af0373a0a7567ecffd356bf5a5532d66fab119d975fd7cc4f3c359b46f2696d313388aa6eb140f7d WHIRLPOOL 1facaf56c783c7ee1227cb4e45b4c1531b7d1bcb8cf8e4a70fb17c1f17669be7d21bb2aa3e0d06d2bddd4b6c96ddbd7799cfe4fd13def7389912c05113bf6c29
+DIST prelink-20130503.tar.bz2 928040 SHA256 6339c7605e9b6f414d1be32530c9c8011f38820d36431c8a62e8674ca37140f0 SHA512 69138a695e3e535deacd8224f6f8364ff64b8868b87b516d1f3392d9df968f77265177e9fede09c38f16aa878f9fd57a9ec39f0d9deabc0c9c01609b11156ba3 WHIRLPOOL 51b4234009c6ac6e6f45f09e3513feb5efe1dbf9d705b55f88d0443fe386bacbe04fa4a4e5d60caf40ef0a98a5557eb2e9f3a11549ec01c0200c324cb948ab34
+DIST prelink-cross-20151030.tar.bz2 701337 SHA256 c87a8c4f0805d80d6b48b63a430537f58e8eeae721972d6e19af5b3cc92fec0f SHA512 75edd8617b95ae5bd3bfc968732ee142c968855c97c5b2b93784d3476a9724e0fd9a4eb7af681a5356616a4f023e24d5c5a2e75fb57e2a25b142cc901d9bfcaf WHIRLPOOL d40ad1d9e39e1c3b4027c83db2399579f133796d77f72a9d162ffb5c60b887c01110110e5feb9377373b21e72889518a0cebacdb442798e1d9ff08be2f115972
+DIST prelink.pdf 474129 SHA256 83e62795c59cb0dec683585a97b8777c8756a555ff056725425bfdf21e6d5baf SHA512 86b7163fcf6f43d1764183b3dfc30aad8de99ce198b2721af276c81fc361e9f5fd8f4aea1e8e0c653f0566e8346dff4b4ba72909359167aa92c094f5561d2e1e WHIRLPOOL b497b07c073fd883735e34db46d050b036356f680e3df3299ae361a4dc8d5ba4190aa193662ff4f917d3b5e875846170025583c07ec281f05b2520ec6fc1418f
+EBUILD prelink-20130503-r1.ebuild 2458 SHA256 033f90d532969a938126a50142cd6c638ce34d946d8bf057baca0962faf12a39 SHA512 2cc0e66fb48f2137bc9a8118d1ed97e58dd5725bd30b042c4276dad5df2d65ef8298e93cdaeb0b8b292c16ff255fa1ddacdc104150ac478e1bf8677869ce4939 WHIRLPOOL a8e05b821f2968af117d6f1586d564cb96ecb325fd4ed38efd0bf9edb0e29e3e22ce377676923f02dbabcf81ff1156f095a6de462cf7daf37bf0c60cb90e9b7e
+EBUILD prelink-20130503.ebuild 2617 SHA256 450cd11c161cbf0d0056ce1bdbb185b176c7818bc3c661034c09a88e9cb046b8 SHA512 4ba50aad1ba5e142f8a0c96d2ab73fca49712202c506a57af58e9fee5021446e6587f9715420244c39aef9f006baf8cfef7cd318e8e6e21f36aa590f7840cbc0 WHIRLPOOL f530d9b77770911d0d9be262c2fbfba9ee229282c59393b23b297db58686ac8bdb75a675811c46eac13762fd82b113cd3163acdd2539875b6f197d9c4305b3ab
+EBUILD prelink-20151030.ebuild 1737 SHA256 daa2fa9ffd8ffc00240094fe2c0102eb5196f2270f86fb11a5b1e704859a5461 SHA512 7889421c986260cac8f31d3eafe1e354bb78dec1e00f2fec5798a3347c845c4dd4ba973e5f0c0728d4efe993f393ea50607b5d00591488a0b38574d519d70f36 WHIRLPOOL 7c4fd58715e6b2191e202cc1ba3ecf8daaf78bc63e16d13ae774815cde8338372e63c507abbff0c63ec6a4b63aa8e2724f42d29f804166a30d6deaf887c6688e
+MISC ChangeLog 3905 SHA256 42cb90deb4594ebc9d4f43c04eaefc5da92f4aab3d108d900e364590dee2f22c SHA512 4789b1608f8c6717ce6a6e2b3eedc714b474655e1b645a212c0260e2caba6e068e0ae9fcd24bb40bb01a257499b5454cc3923e26770bdc1978fda3f109e2a07f WHIRLPOOL 2f7d5eda649e14a6735931b8cb430ec739554eb18bf24b0b66b4f09f60d4c549aece7b6fee08cc0f975eeac0f2de1004f14e727db6125e35952071b583270977
+MISC ChangeLog-2015 12945 SHA256 4af1796fa18fdac847919d2adbb713ad6d70633844f7ac69c90d103e870f867b SHA512 0aaeaa81248c0f06ca339033e3c7b47eb70ad87f39a853b7774803f1fbd93b71149248adb0f14c2802f20e071baff287113569e52873dd77f7f9d1719b3bd0d8 WHIRLPOOL 7d4532d13353d668648bba3c1218b07e1588354a3d059152878d95a58e7848966f326652c65f6f3211b7a5d492080cf410ecaff04ed90a0cf7582adb9bd8af4d
+MISC metadata.xml 257 SHA256 fcb691c3299a07a5fe4f936baa5aa146b8aa3cb9491ba88fd12547cb540b02c2 SHA512 fd85d9cf15f6b7db96e4d184e32ae6f1503a5b70cb4cb1ce930ba13a1d5d4c4b24971781e95b7f3f9ead58b31760f84c368bc6fa2a793b4b5baf78259b047ff1 WHIRLPOOL 62b62e3e5489b8983ddd7bfc6017411d5e02f9710763206baa84b826388c8685fe7bdc0bb6a76c029e73ae4c160e9af6c8544406dc70a203c7c3d65d4aa15400
diff --git a/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch b/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch
new file mode 100644
index 000000000000..5a9fffb838f9
--- /dev/null
+++ b/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch
@@ -0,0 +1,61 @@
+From 8eeb9da6d017761037bf757780ea544dfeabbad8 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 31 Jul 2012 09:02:35 +0000
+Subject: [PATCH] libiberty/md5: fix strict alias warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Current libiberty md5 code triggers these warnings with gcc-4.7.1 for me:
+
+libiberty/md5.c: In function ‘md5_finish_ctx’:
+libiberty/md5.c:117:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
+libiberty/md5.c:118:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
+
+The change below fixes things for me. The optimized output (-O2) is the same
+before/after my change on x86_64-linux. I imagine it'll be the same for most
+targets. It seems simpler than using a union on the md5_ctx buffer since these
+are the only two locations in the code where this occurs.
+---
+ libiberty/ChangeLog | 5 +++++
+ libiberty/md5.c | 12 ++++++++----
+ 2 files changed, 13 insertions(+), 4 deletions(-)
+
+2012-07-31 Mike Frysinger <vapier@gentoo.org>
+
+ * md5.c (md5_finish_ctx): Declare swap_bytes. Assign SWAP() output
+ to swap_bytes, and then call memcpy to move it to ctx->buffer.
+
+diff --git a/libiberty/md5.c b/libiberty/md5.c
+index 0db8fc8..8cc0cb5 100644
+--- a/src/md5.c
++++ b/src/md5.c
+@@ -103,6 +103,7 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
+ {
+ /* Take yet unprocessed bytes into account. */
+ md5_uint32 bytes = ctx->buflen;
++ md5_uint32 swap_bytes;
+ size_t pad;
+
+ /* Now count remaining bytes. */
+@@ -113,10 +114,13 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
+ pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
+ memcpy (&ctx->buffer[bytes], fillbuf, pad);
+
+- /* Put the 64-bit file length in *bits* at the end of the buffer. */
+- *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
+- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
+- (ctx->total[0] >> 29));
++ /* Put the 64-bit file length in *bits* at the end of the buffer.
++ Use memcpy to avoid aliasing problems. On most systems, this
++ will be optimized away to the same code. */
++ swap_bytes = SWAP (ctx->total[0] << 3);
++ memcpy (&ctx->buffer[bytes + pad], &swap_bytes, sizeof (swap_bytes));
++ swap_bytes = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
++ memcpy (&ctx->buffer[bytes + pad + 4], &swap_bytes, sizeof (swap_bytes));
+
+ /* Process last bytes. */
+ md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
+--
+1.8.2.1
+
diff --git a/sys-devel/prelink/files/prelink-20130503-prelink-conf.patch b/sys-devel/prelink/files/prelink-20130503-prelink-conf.patch
new file mode 100644
index 000000000000..9233a4114827
--- /dev/null
+++ b/sys-devel/prelink/files/prelink-20130503-prelink-conf.patch
@@ -0,0 +1,39 @@
+--- a/doc/prelink.conf
++++ b/doc/prelink.conf
+@@ -5,6 +5,7 @@
+ # If a directory name is prefixed with `-h ', symbolic links in a
+ # directory hierarchy are followed.
+ # Directories or files with `-b ' prefix will be blacklisted.
++-c /etc/prelink.conf.d/*.conf
+ -b *.la
+ -b *.png
+ -b *.py
+@@ -16,8 +16,11 @@
+ -b *.a
+ -b *.js
+ -b /lib/modules
+--b /usr/lib/locale
+--b /usr/X11R6/lib{,64}/X11/xfig
++-b /usr/lib{,x32,32,64}/locale
++-b /usr/lib{,x32,32,64}/wine
++-b /usr/lib{,x32,32,64}/valgrind
++-b /usr/X11R6/lib{,x32,32,64}/X11/xfig
++-b /usr/src
+ -l /bin
+ -l /usr/bin
+ -l /sbin
+@@ -27,9 +30,9 @@
+ -l /usr/games
+ -l /usr/libexec
+ -l /var/ftp/bin
+--l /lib{,64}
+--l /usr/lib{,64}
+--l /usr/X11R6/lib{,64}
+--l /usr/kerberos/lib{,64}
++-l /lib{,x32,32,64}
++-l /usr/lib{,x32,32,64}
++-l /usr/X11R6/lib{,x32,32,64}
++-l /usr/kerberos/lib{,x32,32,64}
+ -l /usr/X11R6/LessTif
+--l /var/ftp/lib{,64}
++-l /var/ftp/lib{,x32,32,64}
diff --git a/sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch b/sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch
new file mode 100644
index 000000000000..896101040b5b
--- /dev/null
+++ b/sys-devel/prelink/files/prelink-armhf-dynamic-linker.patch
@@ -0,0 +1,12 @@
+diff -urNp prelink_orig/src/arch-arm.c prelink/src/arch-arm.c
+--- prelink_orig/src/arch-arm.c 2011-08-26 03:20:49.000000000 -0400
++++ prelink/src/arch-arm.c 2012-11-28 23:59:28.030164736 -0500
+@@ -832,7 +832,7 @@ PL_ARCH = {
+ .R_COPY = R_ARM_COPY,
+ .R_RELATIVE = R_ARM_RELATIVE,
+ .rtype_class_valid = RTYPE_CLASS_VALID,
+- .dynamic_linker = "/lib/ld-linux.so.3",
++ .dynamic_linker = "/lib/ld-linux-armhf.so.3",
+ .adjust_dyn = arm_adjust_dyn,
+ .adjust_rel = arm_adjust_rel,
+ .adjust_rela = arm_adjust_rela,
diff --git a/sys-devel/prelink/files/prelink.confd b/sys-devel/prelink/files/prelink.confd
new file mode 100644
index 000000000000..6b89b8c1f1fd
--- /dev/null
+++ b/sys-devel/prelink/files/prelink.confd
@@ -0,0 +1,43 @@
+# For an in depth prelinking guide, please see:
+# http://www.gentoo.org/doc/en/prelink-howto.xml
+
+# Control prelinking behavior in the cronjob.
+# yes - automatically prelink the system
+# no - automatically un-prelink the system
+# "" - do nothing at all (user manages)
+# (if you change this from yes to no prelink -ua
+# will be run next night to undo prelinking)
+PRELINKING=""
+
+# Options to pass to prelink
+# -m Try to conserve virtual memory by allowing overlapping
+# assigned virtual memory slots for libraries which
+# never appear together in one binary
+# -R Randomize virtual memory slot assignments for libraries.
+# This makes it slightly harder for various buffer overflow
+# attacks, since library addresses will be different on each
+# host using -R.
+PRELINK_OPTS=-mR
+
+# How often should full prelink be run (in days)
+# Normally, prelink will be run in quick mode, every
+# $PRELINK_FULL_TIME_INTERVAL days it will be run
+# in normal mode. Comment it out if it should be run
+# in normal mode always.
+PRELINK_FULL_TIME_INTERVAL=14
+
+# How often should prelink run (in days) even if
+# no packages have been upgraded via portage.
+# If $PRELINK_FULL_TIME_INTERVAL days have not elapsed
+# yet since last normal mode prelinking, last
+# quick mode prelinking happened less than
+# $PRELINK_NOEMER_CHECK_INTERVAL days ago
+# and no packages have been upgraded by portage
+# since last quick mode prelinking, prelink
+# will not do anything.
+# Change to
+# PRELINK_NOEMER_CHECK_INTERVAL=0
+# if you want to disable the portage database timestamp
+# check (especially if you don't use portage
+# exclusively to upgrade system libraries and/or binaries).
+PRELINK_NOEMER_CHECK_INTERVAL=7
diff --git a/sys-devel/prelink/files/prelink.cron b/sys-devel/prelink/files/prelink.cron
new file mode 100644
index 000000000000..a3edc429fee7
--- /dev/null
+++ b/sys-devel/prelink/files/prelink.cron
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+. /etc/conf.d/prelink
+log="/var/log/prelink.log"
+
+case $PRELINKING in
+ yes|no);;
+ *) exit 0;;
+esac
+
+ionice -c3 -p $$ >/dev/null 2>&1
+renice +19 -p $$ >/dev/null 2>&1
+
+if [ "$PRELINKING" != yes ]; then
+ sed -ri '/^[[:space:]]*#?[[:space:]]*KDE_IS_PRELINKED=/s:.*:#KDE_IS_PRELINKED=1:' /etc/env.d/*kde* 2>/dev/null
+ if [ -f /etc/prelink.cache ]; then
+ echo /usr/sbin/prelink -uav > ${log}
+ /usr/sbin/prelink -uav >> ${log} 2>&1 \
+ || echo Prelink failed with return value $? >> ${log}
+ rm -f /etc/prelink.cache
+ # Restart init if needed
+ [ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+ fi
+ exit 0
+fi
+
+sed -ri '/^[[:space:]]*#?[[:space:]]*KDE_IS_PRELINKED=/s:.*:KDE_IS_PRELINKED=1:' /etc/env.d/*kde* 2>/dev/null
+
+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \
+ || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then
+ # If cache does not exist or is from older prelink versions or
+ # if we were asked to explicitely, force full prelinking
+ rm -f /etc/prelink.cache /var/lib/misc/prelink.force
+ PRELINK_OPTS="$PRELINK_OPTS -f"
+ date > /var/lib/misc/prelink.full
+ cp -a /var/lib/misc/prelink.full /var/lib/misc/prelink.quick
+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
+ -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \
+ = /var/lib/misc/prelink.full ]; then
+ # If no more than PRELINK_NOEMER_CHECK_INTERVAL days elapsed from last prelink
+ # (be it full or quick) and no packages have been upgraded via rpm since then,
+ # don't do anything.
+ [ "`find /var/lib/misc/prelink.quick -mtime -${PRELINK_NOEMER_CHECK_INTERVAL:-7} 2>/dev/null`" \
+ -a -f /var/cache/edb/counter \
+ -a /var/cache/edb/counter -ot /var/lib/misc/prelink.quick ] && exit 0
+ date > /var/lib/misc/prelink.quick
+ # If prelink without -q has been run in the last
+ # PRELINK_FULL_TIME_INTERVAL days, just use quick mode
+ PRELINK_OPTS="$PRELINK_OPTS -q"
+else
+ date > /var/lib/misc/prelink.full
+ cp -a /var/lib/misc/prelink.full /var/lib/misc/prelink.quick
+fi
+
+echo /usr/sbin/prelink -av $PRELINK_OPTS > ${log}
+/usr/sbin/prelink -av $PRELINK_OPTS >> ${log} 2>&1 \
+ || echo Prelink failed with return value $? >> ${log}
+# Restart init if needed
+[ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+
+exit 0
diff --git a/sys-devel/prelink/metadata.xml b/sys-devel/prelink/metadata.xml
new file mode 100644
index 000000000000..e396f3755977
--- /dev/null
+++ b/sys-devel/prelink/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-devel/prelink/prelink-20130503-r1.ebuild b/sys-devel/prelink/prelink-20130503-r1.ebuild
new file mode 100644
index 000000000000..5f8f8e9f70d4
--- /dev/null
+++ b/sys-devel/prelink/prelink-20130503-r1.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic
+
+DESCRIPTION="Modifies ELFs to avoid runtime symbol resolutions resulting in faster load times"
+HOMEPAGE="https://people.redhat.com/jakub/prelink"
+
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+#SRC_URI="https://people.redhat.com/jakub/prelink/${P}.tar.bz2"
+
+# if not available on jakub's dev space extract the distfile with rpm2tarbz2 from
+# https://mirrors.kernel.org/fedora/development/rawhide/source/SRPMS/p/prelink-[ver].src.rpm
+#
+# track http://pkgs.fedoraproject.org/cgit/prelink.git/ for updates
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 -arm ~ppc ~ppc64 ~x86"
+IUSE="selinux"
+
+DEPEND=">=dev-libs/elfutils-0.100[static-libs(+)]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ !dev-libs/libelf
+ >=sys-libs/glibc-2.8"
+RDEPEND="${DEPEND}
+ >=sys-devel/binutils-2.18"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
+ epatch "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
+ epatch "${FILESDIR}"/${PN}-armhf-dynamic-linker.patch
+
+ sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die #469126
+
+ sed -i -e '/^CC=/s: : -Wl,--disable-new-dtags :' testsuite/functions.sh #100147
+ # >=binutils-2.22 --no-copy-dt-needed-entries is the default
+ # --copy-dt-needed-entries was renamed from --add-needed in 2.21, use the
+ # former so we don't have to bump the dep
+ sed -i \
+ -e '/CCLINK=/s:CCLINK="$(CC):& -Wl,--add-needed :' \
+ -e '/CXXLINK=/s:CXXLINK="$(CXX):& -Wl,--add-needed :' \
+ testsuite/Makefile.am
+
+ has_version 'dev-libs/elfutils[threads]' && append-ldflags -pthread
+
+ eautoreconf # prevent maintainer mode
+
+ # have to do this after eautoreconf or automake barfs on the trailing
+ # backslash of the previous line
+ sed -i -e 's:undosyslibs.sh::' testsuite/Makefile.in #254201
+
+ export ac_cv_{header_selinux_selinux_h,lib_selinux_is_selinux_enabled}=$(usex selinux)
+}
+
+src_install() {
+ default
+
+ insinto /etc
+ doins doc/prelink.conf
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/prelink.cron prelink
+ newconfd "${FILESDIR}"/prelink.confd prelink
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
+ elog "found online at:"
+ elog " https://wiki.gentoo.org/wiki/Prelink"
+ elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
+ fi
+}
diff --git a/sys-devel/prelink/prelink-20130503.ebuild b/sys-devel/prelink/prelink-20130503.ebuild
new file mode 100644
index 000000000000..46b2197ba6ed
--- /dev/null
+++ b/sys-devel/prelink/prelink-20130503.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit autotools eutils flag-o-matic
+
+DESCRIPTION="Modifies ELFs to avoid runtime symbol resolutions resulting in faster load times"
+HOMEPAGE="https://people.redhat.com/jakub/prelink"
+
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+#SRC_URI="https://people.redhat.com/jakub/prelink/${P}.tar.bz2"
+
+# if not available on jakub's dev space extract the distfile with rpm2tarbz2 from
+# https://mirrors.kernel.org/fedora/development/rawhide/source/SRPMS/p/prelink-[ver].src.rpm
+#
+# track http://pkgs.fedoraproject.org/cgit/prelink.git/ for updates
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 -arm ppc ppc64 x86"
+IUSE="selinux"
+
+DEPEND=">=dev-libs/elfutils-0.100[static-libs(+)]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ !dev-libs/libelf
+ >=sys-libs/glibc-2.8"
+RDEPEND="${DEPEND}
+ >=sys-devel/binutils-2.18"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
+ epatch "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
+ epatch "${FILESDIR}"/${PN}-armhf-dynamic-linker.patch
+
+ sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die #469126
+
+ sed -i -e '/^CC=/s: : -Wl,--disable-new-dtags :' testsuite/functions.sh #100147
+ # >=binutils-2.22 --no-copy-dt-needed-entries is the default
+ # --copy-dt-needed-entries was renamed from --add-needed in 2.21, use the
+ # former so we don't have to bump the dep
+ sed -i \
+ -e '/CCLINK=/s:CCLINK="$(CC):& -Wl,--add-needed :' \
+ -e '/CXXLINK=/s:CXXLINK="$(CXX):& -Wl,--add-needed :' \
+ testsuite/Makefile.am
+
+ has_version 'dev-libs/elfutils[threads]' && append-ldflags -pthread
+
+ eautoreconf # prevent maintainer mode
+
+ # have to do this after eautoreconf or automake barfs on the trailing
+ # backslash of the previous line
+ sed -i -e 's:undosyslibs.sh::' testsuite/Makefile.in #254201
+
+ export ac_cv_{header_selinux_selinux_h,lib_selinux_is_selinux_enabled}=$(usex selinux)
+}
+
+src_install() {
+ default
+
+ insinto /etc
+ doins doc/prelink.conf
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/prelink.cron prelink
+ newconfd "${FILESDIR}"/prelink.confd prelink
+
+ dodir /var/{lib/misc,log}
+ touch "${ED}"/var/lib/misc/prelink.{full,quick,force}
+ touch "${ED}"/var/log/prelink.log
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
+ elog "found online at:"
+ elog " https://wiki.gentoo.org/wiki/Prelink"
+ elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
+ fi
+ touch "${EROOT}/var/lib/misc/prelink.force"
+}
diff --git a/sys-devel/prelink/prelink-20151030.ebuild b/sys-devel/prelink/prelink-20151030.ebuild
new file mode 100644
index 000000000000..69a205c9d16a
--- /dev/null
+++ b/sys-devel/prelink/prelink-20151030.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+MY_PN="${PN}-cross"
+MY_P="${MY_PN}-${PV}"
+
+inherit autotools eutils flag-o-matic
+
+DESCRIPTION="Modifies ELFs to avoid runtime symbol resolutions resulting in faster load times"
+HOMEPAGE="https://git.yoctoproject.org/cgit/cgit.cgi/prelink-cross/ https://people.redhat.com/jakub/prelink"
+SRC_URI="https://git.yoctoproject.org/cgit/cgit.cgi/${MY_PN}/snapshot/${MY_P}.tar.bz2
+ doc? ( https://people.redhat.com/jakub/prelink/prelink.pdf )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+IUSE="doc selinux"
+
+DEPEND=">=dev-libs/elfutils-0.100[static-libs(+)]
+ selinux? ( sys-libs/libselinux[static-libs(+)] )
+ !dev-libs/libelf
+ sys-libs/binutils-libs
+ >=sys-libs/glibc-2.8"
+RDEPEND="${DEPEND}
+ >=sys-devel/binutils-2.18"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
+ epatch "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
+
+ sed -i -e '/^CC=/s: : -Wl,--disable-new-dtags :' testsuite/functions.sh #100147
+
+ has_version 'dev-libs/elfutils[threads]' && append-ldflags -pthread
+
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_enable selinux)
+}
+
+src_install() {
+ default
+
+ use doc && dodoc "${WORKDIR}"/prelink.pdf
+
+ insinto /etc
+ doins doc/prelink.conf
+
+ exeinto /etc/cron.daily
+ newexe "${FILESDIR}"/prelink.cron prelink
+ newconfd "${FILESDIR}"/prelink.confd prelink
+}
+
+pkg_postinst() {
+ if [ -z "${REPLACING_VERSIONS}" ] ; then
+ elog "You may wish to read the Gentoo Linux Prelink Guide, which can be"
+ elog "found online at:"
+ elog " https://wiki.gentoo.org/wiki/Prelink"
+ elog "Please edit /etc/conf.d/prelink to enable and configure prelink"
+ fi
+}
diff --git a/sys-devel/qconf/Manifest b/sys-devel/qconf/Manifest
new file mode 100644
index 000000000000..fec7a7a1c32f
--- /dev/null
+++ b/sys-devel/qconf/Manifest
@@ -0,0 +1,7 @@
+DIST qconf-2.0.tar.bz2 50507 SHA256 772022c9757530c192d3bb1d31c4d6076b3464a8395dc06d3019923c44f999f2 SHA512 8820dfe191149b8bf7aa2cd631a6c4900b821c30817c6bffcf79734271c47165daceef11507690d495881c8dc8d19f8dec441c7adeb2a3e36b355b66b4f5c43a WHIRLPOOL facc512a3df046e131825a45afc928b76d8c87446b8d4161695165e6551cebfb586497b2cad3c69a9a75afa0791b9c915e6f7019ead9925d867c01d7bd573f09
+DIST qconf-2.3.tar.xz 51848 SHA256 d189dcf5589fe7d8ca53b963ba8bd33b91c4a75d1e7d863544174e6b7d69f581 SHA512 27a532cb52067707a3e04a40260bb0f42e40adff4a643d2f048832356de58271e4051c9cb810e6fffd4b4e45dba483ed65aec062506053caa262ac03b3ec6253 WHIRLPOOL 6fc386321d4a9bbb12254d427355feaadc90c4b66dfdd0d69a635c15ed72c481aede18c506b9b15260de448931bbbbec6c3a59d374c49491e997d6f52a33ea62
+EBUILD qconf-2.0.ebuild 1053 SHA256 1d24540de472dc24f6137af09c68d1dd6767066e57b16da08cd825388cbb394d SHA512 a93f1387335f4ff079f1163e7f70e39add007e5efcfcfe213c3a13005667e01c0d7ad9173cb68dede601dc5ca297176e8551d6d44a89769f8f02cc8afa981dc5 WHIRLPOOL 11d8cba60534921a839164aa0bc753901adbfb2b21302693a21be1429099112083c5e7c4827d356f87de5f0f7082e7015881f7e659300bf0bcdc38292d4862cf
+EBUILD qconf-2.3.ebuild 826 SHA256 72cdb9ed9d19f9f28a919d1659c4312f0f515114d7701f1c4e336817a532480c SHA512 89193bfa9148fa6532ee3dfb8038089213a17e791755dcb9d8dc8f5accc88562d08d414acf0c5db3f276cf20bb2d7c41d82ac23a154e9c72019e313affadaa77 WHIRLPOOL a45f2df9db0126ab48d843906b4c0200e7d7512a342549f68d5a40be10c7748a8f7211de88799092101d85f0bd2f5a97a04e7370c6cf9eb8d7e789d076ebea49
+MISC ChangeLog 2634 SHA256 bbe3f98df9430d39a94d48af9794490e8b5663ffed4092d7fdeb2e0d4b4bb3ae SHA512 78bdc5e1bf259f416cb7f1e6669225b90c2707383b5e0d665950c0783c348599a1aa8c77febcfb194c1264f87568c68138906331081e59da89c282010316944d WHIRLPOOL 6ea5342e8f36542d2a2d7e6648ac0df9a849190ff603861d01ac944c2dcbc81089891c95f9e5ed0fc5849022ab003fb394f434397cb338cf0573bc49c8355cf0
+MISC ChangeLog-2015 2733 SHA256 72774813246201b18625b7947300174e92e3e4718a0b4746773ca02be7bc893a SHA512 3a4d6f2d3d231a069f97cfd34cb78989eae3e41cfd9259994062f802298d560805e987a7d3e9338283e8d485bde736da864de95bb9699779d34b178026ea11c9 WHIRLPOOL 61188a83eadb098c815aafd8bf31aa2b8e146459567acaf078d79cedcb455b477c53591b0c2a90416b58ea8c2bebde1775f23ca54c6befcc3bd28a1175ae676b
+MISC metadata.xml 218 SHA256 0f7a6378554e66563fad0fbf1f75e05258e6183006ae8a77a4d9d419d314cd28 SHA512 4ab760be4d4de619f5932ce8d02522b3466cf8c01fcb63ef0b06b226d719246007c719f1da90501d345004bc70f8d0b13e2d5f077d34be131966988ad9629755 WHIRLPOOL c3700a7cd8819199aeaa2c41e139be16a595248668b5c0cb25ab5ab15decfffc33e42a90d5a18b2dcb98ea3b3caa4c569638723be283b0c3008b9ef9fc51dc54
diff --git a/sys-devel/qconf/metadata.xml b/sys-devel/qconf/metadata.xml
new file mode 100644
index 000000000000..93b766b33a89
--- /dev/null
+++ b/sys-devel/qconf/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <upstream>
+ <remote-id type="github">psi-plus/qconf</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/qconf/qconf-2.0.ebuild b/sys-devel/qconf/qconf-2.0.ebuild
new file mode 100644
index 000000000000..0798d266db56
--- /dev/null
+++ b/sys-devel/qconf/qconf-2.0.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit qmake-utils
+
+DESCRIPTION="./configure like generator for qmake-based projects"
+HOMEPAGE="http://delta.affinix.com/qconf/"
+SRC_URI="http://delta.affinix.com/download/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm hppa ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE="+qt4 qt5"
+
+RDEPEND="
+ qt4? ( dev-qt/qtcore:4 )
+ qt5? (
+ dev-qt/qtcore:5
+ dev-qt/qtxml:5
+ )
+"
+DEPEND="${RDEPEND}"
+
+DOCS=( AUTHORS README.md TODO )
+
+REQUIRED_USE="^^ ( qt4 qt5 )"
+
+src_configure() {
+ # Fake ./configure. Fails on unknown options
+ ./configure \
+ --prefix="${EPREFIX}/usr" \
+ $(use qt4 && echo "--qtdir=$(qt4_get_libdir)") \
+ $(use qt5 && echo "--qtdir=$(qt5_get_libdir)/qt5") \
+ --extraconf=QMAKE_STRIP= \
+ --verbose || die
+
+ [ ! -f Makefile ] && die "Makefile generation failure"
+
+ use qt4 && eqmake4
+ use qt5 && eqmake5
+}
+
+src_install() {
+ emake INSTALL_ROOT="${ED}" install
+ einstalldocs
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+}
diff --git a/sys-devel/qconf/qconf-2.3.ebuild b/sys-devel/qconf/qconf-2.3.ebuild
new file mode 100644
index 000000000000..40ddf2a32176
--- /dev/null
+++ b/sys-devel/qconf/qconf-2.3.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit qmake-utils
+
+DESCRIPTION="./configure like generator for qmake-based projects"
+HOMEPAGE="https://github.com/psi-plus/qconf"
+SRC_URI="http://psi-im.org/files/qconf/${P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~hppa ppc ppc64 ~sparc x86 ~x86-fbsd"
+IUSE=""
+
+# There is no one to one match to autotools-based configure
+QA_CONFIGURE_OPTIONS=".*"
+
+RDEPEND="
+ dev-qt/qtcore:5
+ dev-qt/qtxml:5
+"
+DEPEND="${RDEPEND}"
+
+src_configure() {
+ econf \
+ --qtdir="$(qt5_get_libdir)/qt5" \
+ --extraconf=QMAKE_STRIP= \
+ --verbose
+
+ # just to set all the Gentoo toolchain flags
+ eqmake5
+}
+
+src_install() {
+ emake INSTALL_ROOT="${D}" install
+ einstalldocs
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+}
diff --git a/sys-devel/remake/Manifest b/sys-devel/remake/Manifest
new file mode 100644
index 000000000000..4cd9fdfcfcde
--- /dev/null
+++ b/sys-devel/remake/Manifest
@@ -0,0 +1,13 @@
+DIST remake-3.81+dbg-0.2.tar.bz2 1311308 SHA256 c7600bd96084e7fdfd667d50e889b652bf69f933799ac207def021a1820c5097 SHA512 3f0d828c27e990d4e959fb9f73ca49921eeba76cba1ac869d1165fb4a11d257ffcfcb03ff1886e569db91e06021e4b5055aaaec4069347291d62a5f518440486 WHIRLPOOL 66e1c9d9ee1e7ee1b8efc8b41981752b45f3cef5ea656a249ff170f2b183afafc9cdc3ba0b0f94b2cb65ce6b1a65996fe428cb2bb15cafd09bf97f13581b6bd6
+DIST remake-3.81+dbg-0.3.tar.bz2 1078924 SHA256 55647ac9d23ca6f634c77eeefacbb45dd0e16cac50b402d3b35f0d44e71745a3 SHA512 a86ed989ed6c616da0a9850560b88c1a2f8ac277fa4c8abdb2a40543cf63c3180810d5c6a822d7dd6988a53cd36eef18d857e4958787fca2ed616d14186c36b1 WHIRLPOOL 79461f07dcbbfe7178b96f10bf6513c4c53a38c417e0119dfdc25ecd2539ebd3fd6ecd3aa8affaa0b2cf74e3416334fa23871fc738e4cb1dfaf09729be704db2
+DIST remake-3.82+dbg-0.4.tar.bz2 1360407 SHA256 2c08b996805aa709e8cbd6a75ac3e3952fc03622a1407c450b60bf4fc19e4275 SHA512 5f75e7826e4258c33e3844d72d685f1c1d252c352b40c0d6a7a3e5155097496640ff72542786452fa40079060b4c0cb514bda7147521c7170f42003ba8c0aa77 WHIRLPOOL 81b0fc2e7ef8b5c55f93bc77de7bcb9f21b819e36a4eb393faa53b5876dd5115e98f62da46c693ad93b554a5f087cf69fd3edcc8895a710d10cf44a94f7119e4
+DIST remake-3.82+dbg0.9.tar.bz2 1152677 SHA256 491c6da004a3517a6c76d62017279374fd594f5c09c823b4de53e81180c4041a SHA512 94682e9d0317088456dac683d67be320fe10bb06a3384969fafefe091558b215105ba3c96a7c1d4e0d970ea2dc5c4f535a704256fe7a4eaa87bec11d78d074cf WHIRLPOOL a4caad6c8acb74e8284946db7fe5ebd3bdf806a2e79309030d5ebbad132a161d32d9bfc6a567237793080b285cc928ef7c88a4a97b921d8eeffe041ca75a8e81
+DIST remake-4.1+dbg1.1.tar.bz2 1254246 SHA256 42eb79a8418e327255341a55ccbdf358eed42c4e15ffb39052c1627de83521fe SHA512 e0dfb0f7a3f05968c3597e73f2fd486929893546a8f993e99ae73c6400050d1faa5baed1b0588d399bfc6e58e8504f857c8734e39a02efd875b522b26dfaa421 WHIRLPOOL ec018e16450ead020758cb004a70da15c168f00e51451dd23bbc1388e7c71401675543385f929b5ec54618a3d8023887aea19a25ff7e9808e42a5acf8afd86c1
+EBUILD remake-3.81.0.2.ebuild 626 SHA256 bb551a379d2eccf055dcb600631d1d05aec04840bdfd808403d89df57e83c40f SHA512 6659e4c23a193d226cc6bbd39ab11fe44350a52e77a520e3186e29ba78871412109e12b370a1f85b6888e099df4f5bda01d2ec44997e297fa22616672aef3d74 WHIRLPOOL 925295a383659d2c75400722f6be09fbdbd38570db98c7eb33ec0385127c1786d70c519f31655f004ec3e1803312c1d84d68252862a3a19cb10ab7dd4806931e
+EBUILD remake-3.81.0.3.ebuild 629 SHA256 32fd0588cc6887d757e0ce56d0f9e166f52d787c0a21faa61f5ba93c2ecba769 SHA512 41a8affbc8f23ae65212a8a9a56e3a2eedbb37c34193d9d17f7711cae2ac6d681d86b0112d89ebc1799348d8fe9b2542abc16d9998d09edf9c48e909f9ee1287 WHIRLPOOL ce989bac6a123a9359b1ec8c4113d4d9e9ed672c3d3b904f450f288333c59745a33aaf8a041ba11668d15e4527a63066dfac40d062907eff47f3071f436f9318
+EBUILD remake-3.82.0.4.ebuild 678 SHA256 824e1ab2c1ea096b4f4787ce3ac3f43bb6f22430d2e78c5b51e4bf0d00862b42 SHA512 44f550803e9159a528c91f59519d32a285eecf40306b57c023605b268ffb38306c8b422de18a34d2a72b6b29445d23f0dc7cc5c4f796b6c1d585b03d438c6c9c WHIRLPOOL 5a41c47fef12458aeadee444ae8dab3dc26e871ef38d71a556c2a36ae230e0542dd17df477e1f5604228c4a46abcb45f77e89a1112cfcd3df516bcea33b6a873
+EBUILD remake-3.82.0.9.ebuild 627 SHA256 18b921cc00e86693dc0b9c65276a979d8c9e24774af82070c52d036f52c95204 SHA512 d0b978401613f65bd7128ab6b36462969ca06237ca23444b752f6b5c364aeb60eaca2d51e31d30454853f4f4d85fb3660b44d7c05743c490f9af388cab8e17ab WHIRLPOOL b03646d8ac64fc7ffff562219324b74e313cdd7752d714ff79fd2fe839301ea0db848a40be157af5c7e4d4c41f7df4511e1b7b3e7aa1847cb4b3dcd295b6efdc
+EBUILD remake-4.1.1.1.ebuild 841 SHA256 f5234db3ac020306dce388c6aca38c45a7ebaef42b8d347cd3671dbfdcef7d1d SHA512 0a7d6055ec1d79656cf1df4438a1f9cdee7021a52ebc5031040a294705e989b80ae3f0a68e067d02183fb6b40d5d16531ff0223ff5ebe7756d15df78bfd19093 WHIRLPOOL 0f79a86f3e122a2440a41e77efedc22037728ed457cc9e71c50cf261abf6c9cd60efe7cc4f10b6e4f088bb2e66a0ff6a24839625d61f9ebeb0507a27d590f34c
+MISC ChangeLog 3257 SHA256 d42be711985419bf8b50aff56edd16b6734a0c8fb487c3bf2185fce1e8cb1ad6 SHA512 2067e4ed84daa4d1110a23e302c632614f9036c805fd69aec1865c6b9cfa1513053fd4af6cb318d2f7d7da58981a6b5c69563c6af2fe29ead2f6693eb5836376 WHIRLPOOL 0b83d252a386be30e70fde67906a26109396d62ef66e43df99ace34949f489835f269d6d8beee2079cf61b6d3d52d8ddf79fe6af02b518fec0805ee8cd5900be
+MISC ChangeLog-2015 2240 SHA256 11b1eb0ead2499298215fb6d3cb1904068736128e51f3c0a2c3ac79e9f1205df SHA512 cce04eee0f32f06f06f8ddb03665c1d4415bf38007929a7fef147076ce7bd9a3717cae9d9cb1681dfa515df6c56a4559974ca4599050c51ddda242e8328b20ad WHIRLPOOL 789973b0a50ba33784487f30a07e1cd5e8b194b395d0414da9e410ea2b474bbc1e730c44c2e6b35bd5deb070a5609b741e63ebc03f5294c0eadb0b4da2836418
+MISC metadata.xml 326 SHA256 caedbc07b79e81105d5c40ffdcc6629432eeacf7eb566b34f4c836c09acc67a0 SHA512 69c31da5d0fb8b94548ee398fc937405ae11224a415dc7ad6628c9b66362d43c4e3adcfba05016735298d31eba68faa19dab93f3d792629217660e51c382567c WHIRLPOOL d401c7be5c35be262713563acb04149c7f0c8ec58e7abd968c6f5cc80bb2cce21137d371741b2e8a531fc7b5597272beb03732e4bb4e4ff79d280b10cdaf07d2
diff --git a/sys-devel/remake/metadata.xml b/sys-devel/remake/metadata.xml
new file mode 100644
index 000000000000..ab51d946705e
--- /dev/null
+++ b/sys-devel/remake/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">bashdb</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-devel/remake/remake-3.81.0.2.ebuild b/sys-devel/remake/remake-3.81.0.2.ebuild
new file mode 100644
index 000000000000..2b1dd0fd6862
--- /dev/null
+++ b/sys-devel/remake/remake-3.81.0.2.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MY_P="${PN}-${PV:0:4}+dbg-${PV:5}"
+
+DESCRIPTION="patched version of GNU make that adds improved error reporting, tracing, and a debugger"
+HOMEPAGE="http://bashdb.sourceforge.net/remake/"
+SRC_URI="mirror://sourceforge/bashdb/${MY_P}.tar.bz2"
+
+LICENSE="GPL-1"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "make install failed"
+ dodoc AUTHORS INSTALL NEWS README
+ # fix collide with the real make's info pages
+ rm -f "${D}"/usr/share/info/make.*
+}
diff --git a/sys-devel/remake/remake-3.81.0.3.ebuild b/sys-devel/remake/remake-3.81.0.3.ebuild
new file mode 100644
index 000000000000..eb9995e6d1fb
--- /dev/null
+++ b/sys-devel/remake/remake-3.81.0.3.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MY_P="${PN}-${PV:0:4}+dbg-${PV:5}"
+
+DESCRIPTION="patched version of GNU make that adds improved error reporting, tracing, and a debugger"
+HOMEPAGE="http://bashdb.sourceforge.net/remake/"
+SRC_URI="mirror://sourceforge/bashdb/${MY_P}.tar.bz2"
+
+LICENSE="GPL-1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+S=${WORKDIR}/${MY_P}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "make install failed"
+ dodoc AUTHORS INSTALL NEWS README
+ # fix collide with the real make's info pages
+ rm -f "${D}"/usr/share/info/make.*
+}
diff --git a/sys-devel/remake/remake-3.82.0.4.ebuild b/sys-devel/remake/remake-3.82.0.4.ebuild
new file mode 100644
index 000000000000..f8af7b441f70
--- /dev/null
+++ b/sys-devel/remake/remake-3.82.0.4.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MY_P="${PN}-${PV:0:4}+dbg-${PV:5}"
+
+DESCRIPTION="patched version of GNU make that adds improved error reporting, tracing, and a debugger"
+HOMEPAGE="http://bashdb.sourceforge.net/remake/"
+SRC_URI="mirror://sourceforge/bashdb/${MY_P}.tar.bz2"
+
+LICENSE="GPL-1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="readline"
+
+RDEPEND="readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS INSTALL NEWS README
+ # fix collide with the real make's info pages
+ rm -f "${D}"/usr/share/info/make.*
+}
diff --git a/sys-devel/remake/remake-3.82.0.9.ebuild b/sys-devel/remake/remake-3.82.0.9.ebuild
new file mode 100644
index 000000000000..c31a0bff1d2b
--- /dev/null
+++ b/sys-devel/remake/remake-3.82.0.9.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+MY_P="${PN}-${PV:0:4}+dbg${PV:5}"
+
+DESCRIPTION="patched version of GNU make that adds improved error reporting, tracing, and a debugger"
+HOMEPAGE="http://bashdb.sourceforge.net/remake/"
+SRC_URI="mirror://sourceforge/bashdb/${MY_P}.tar.bz2"
+
+LICENSE="GPL-1"
+SLOT="0"
+KEYWORDS="amd64 ~hppa ppc x86"
+IUSE="readline"
+
+RDEPEND="readline? ( sys-libs/readline )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_install() {
+ default
+ # fix collide with the real make's info pages
+ rm -f "${D}"/usr/share/info/make.*
+}
diff --git a/sys-devel/remake/remake-4.1.1.1.ebuild b/sys-devel/remake/remake-4.1.1.1.ebuild
new file mode 100644
index 000000000000..c629c155592e
--- /dev/null
+++ b/sys-devel/remake/remake-4.1.1.1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+MY_P="${PN}-${PV:0:3}+dbg${PV:4}"
+
+DESCRIPTION="patched version of GNU make that adds improved error reporting, tracing, and a debugger"
+HOMEPAGE="http://bashdb.sourceforge.net/remake/"
+SRC_URI="mirror://sourceforge/bashdb/${MY_P}.tar.bz2"
+
+LICENSE="GPL-1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="guile readline"
+
+RDEPEND="readline? ( sys-libs/readline:0= )
+ guile? ( >=dev-scheme/guile-1.8:= )"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_configure() {
+ use readline || export vl_cv_lib_readline=no
+ econf $(use_with guile)
+}
+
+src_install() {
+ default
+ # delete files GNU make owns and remake doesn't care about.
+ rm -r "${ED}"/usr/include || die
+}
diff --git a/sys-devel/slibtool/Manifest b/sys-devel/slibtool/Manifest
new file mode 100644
index 000000000000..1d13bcec1556
--- /dev/null
+++ b/sys-devel/slibtool/Manifest
@@ -0,0 +1,4 @@
+DIST slibtool-0.5.17.tar.xz 51884 SHA256 de24fb363978531efac0d14392983c6600d180bc6bb2c33143fc42c99cd0b5a4 SHA512 d5847e7f4ca63c44e6ee58d7ceacc409a684e33a290f6888fdbc398303183b9ce9ae94d86b0270db865eafae2deb0681c6ecdd7d472cff7ad4d2d99a7457bdac WHIRLPOOL ebee26ff360825e1941059f91f05906d657806ff3bc15c53ae6b0f1cec44a66f573f42992d641b554431819fb4c47081fb814fecfc9b60c164efeca5b88cf19f
+EBUILD slibtool-0.5.17.ebuild 427 SHA256 7da8b065ebc820483a72f45a31e288ce08ded084fed49473bd57a369e3302c80 SHA512 3c0402fe88427bcab91c021fab69ca9b0a82574ea628415ce68f833ec416b6deff9cc92e69c0bc01f47cb260b5f3a9573c98e75b7fd430f248f7add1a3a61d7c WHIRLPOOL 113e7b38eca2a1e20924c09966046ac7c32eed3bd17e98a046d52c0cc9910932126eaff5d8082318b4556b1a19960930bb6414b3ee9104f754d3aff7b13bcd27
+MISC ChangeLog 403 SHA256 cf073caaf57617018de9e6a817ceab8f4417507844923ba260bc7039f0529d37 SHA512 1f190cd2c787eaace68ff979a93ef0fe1a45244cab1de95b4e89410b68c6b277a66ec171dd761199ff7b5199f557b841913b65c04d68003f370ecb3ab6029e26 WHIRLPOOL a52888a0aab84a9a12692938fc4730d1875bf3fd48eebdcf6d21f5ed991d329f0a9552af868ffffbc58a3b2deccc9d92e870ba2dadf518e3245beb64c17e6197
+MISC metadata.xml 365 SHA256 501403f698be007f94d9fa5b9a4096f3b237a48555bd45aa06585b1dcbf67418 SHA512 f87d93b660215d0d7271ecb980798e1c5bef9ab24a4773ea2e60748cfa4dd57644567820d5862e33520b7a71f4ef07bac60265f0e656a26aad5360c74b7611fd WHIRLPOOL b464116e2e4cbfca8b37344c581d96f2bad789c70bc59a88334361c83d2193bb6581d620b2972d68a9cd42c54f7523ddbe3cb5c467a804afc946517af91d8360
diff --git a/sys-devel/slibtool/metadata.xml b/sys-devel/slibtool/metadata.xml
new file mode 100644
index 000000000000..f954e7f9956d
--- /dev/null
+++ b/sys-devel/slibtool/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>felix.janda@posteo.de</email>
+ <name>Felix Janda</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/slibtool/slibtool-0.5.17.ebuild b/sys-devel/slibtool/slibtool-0.5.17.ebuild
new file mode 100644
index 000000000000..2d616267ad3e
--- /dev/null
+++ b/sys-devel/slibtool/slibtool-0.5.17.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DESCRIPTION="A skinny libtool implementation, written in C"
+HOMEPAGE="http://git.midipix.org/cgit.cgi/slibtool"
+SRC_URI="http://git.midipix.org/cgit.cgi/${PN}/snapshot/${P}.tar.xz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm"
+
+src_configure() {
+ ./configure --host=${CHOST} --prefix="${EPREFIX}"/usr || die
+}
diff --git a/sys-devel/smatch/Manifest b/sys-devel/smatch/Manifest
new file mode 100644
index 000000000000..bf5b42efe09f
--- /dev/null
+++ b/sys-devel/smatch/Manifest
@@ -0,0 +1,10 @@
+AUX smatch-1.57-restrict.patch 406 SHA256 f06b2bafdd32eac4896e0b265af31b00fb09673fde17c053d8a5a8e46666a01d SHA512 fa4816a24a2f0ff4aaf057ac83fc0ba4d9787f0e2daa7e6999700448068460adddce6fcac3efdb7aa69e4d60b9eb34f4ff17056e8037419ac4f5d21b5be5514d WHIRLPOOL 0942edefc918682bd126049340e6dd3d2995e0e6a87b4e081aecef9f2824862dd44a030bf6630a4f5f57ed1b40a475a4ff2f1e30c0479a85ba21fefd9cc0104e
+DIST smatch-1.57.tar.gz 491677 SHA256 3ca08158f066887aa821da45962e4999ca60b459f3f13eb5ffc4d68c4b94cadb SHA512 031f417c97d58b617b2e375a28f509f71eb2735212a98aee0e21880a28842078ad3c24b5375a03f73d75fec582a9d187ed6a00a0512c4792e5ffce82dfd79b99 WHIRLPOOL 6eb43af471ba08c106fe05dc786422b16b20cb94bf9af2afdde3e9ccea6985bc5c3b39922e135d55b7a1b341187a77a9565b2ef27ff47f7214b6472b10b6d7c0
+DIST smatch-1.59.tar.gz 495530 SHA256 9c300600aace39fe67fde59421a159d6dffdc5d8ef074762a6a6a7c78e87d472 SHA512 5e18f48dbbe11255a06b427205aefd1f8f5a11bb0b238f9134b89e6f5cb838fcae649a4e87a4a04473a33077c94e88aab46b06e33cc87cfe451fa83b5846ccc7 WHIRLPOOL 5f8c115370acd876cb41c360dcb8916ca1a725aa3714b89261ab69122976440f01b20f8874ffd7dc93ac79479db69ce246a3d5cd8bbedf5c52f430eff0195522
+EBUILD smatch-1.57-r1.ebuild 1258 SHA256 b3f25d28377eacba466e4424346a683cae580bb4ee0fcb97fff46021c0930df7 SHA512 27b2c45fb70953190af70913aa3bf80030b95edd45d1204063db364209df8d453a4c94a57c837fbadf3cf39f1598a5b77b5e5de28654d4ad2762388ac035fb8c WHIRLPOOL 7d4c867f7a6e189e43c8626ed4e51767f59e2958ff7789c3a719a70602d06c24ae952943bc3587ce93a1cbcecb3fab3cb91df6f2a7aaae0749568c91de8a0f9c
+EBUILD smatch-1.57.ebuild 1209 SHA256 c8ea7b46c1ef749172166414986401c76a8f381f38b528ee8e92c12f62ca2622 SHA512 85aa6e85b35628e53b54e617ab639267f50b12927d5c415d3cee82f19a384462c17d53a65869a9ea4a7b675b4a8b70d757705727af87ac684eb5a1a9167f6a12 WHIRLPOOL 38e6bba1676d2e718e088dedb8dbc992ff2f34c66e70b50faba802865c508d2db1249160e1b31a757f4ce88d3e471fc7e6562398ec6f1287406ae4429e847a2e
+EBUILD smatch-1.59.ebuild 1217 SHA256 7ca52587b1510f4e8fed0291419a640591ea3d431510010deeaf5fbe46465c7a SHA512 c22981a1e5917b32c7ad113df8b7dec529a38bbbaa06ce3abe79c8d23b7b7c86eca90637db0486dcc07d05dbaa48746410f18ce5e5218957f3b831babe810ce4 WHIRLPOOL 98cc0e71099d57a75d3b7984ddae77d96c752cd3e0871f5924023d0a04ef3c7c2b7e945db9dbf67e45d314680411c6b68ac0add2057c187ea21a44010366ce5d
+EBUILD smatch-9999.ebuild 1217 SHA256 7ca52587b1510f4e8fed0291419a640591ea3d431510010deeaf5fbe46465c7a SHA512 c22981a1e5917b32c7ad113df8b7dec529a38bbbaa06ce3abe79c8d23b7b7c86eca90637db0486dcc07d05dbaa48746410f18ce5e5218957f3b831babe810ce4 WHIRLPOOL 98cc0e71099d57a75d3b7984ddae77d96c752cd3e0871f5924023d0a04ef3c7c2b7e945db9dbf67e45d314680411c6b68ac0add2057c187ea21a44010366ce5d
+MISC ChangeLog 3156 SHA256 28824798cf486a6e39be87abd527afca25fbaaa47a6b9df08e541c3df94b47da SHA512 95134f0dc736dcd9dc22248da18c1212f3fb1680d6283dbaac46d3601f9a581e506a506ba19d1ec68020496d30cdb6c628257c69bdf5f5e7582627f64822b244 WHIRLPOOL 38991c6ada0777524523236f49109a2fec6278fc522d153049eab35b41cefafafd86ad3da482a8dc6004dfa57a2e66f35b14a89fcad0771e9c28dcdc66cf6756
+MISC ChangeLog-2015 921 SHA256 dc4e50eb76995a83ae54b8b3096f87abae278483569baf9ad9925cb75f091c3e SHA512 7021f3e169ed7dbcd961858b7ae9a607c3dd2586eafe2ba6e005841df92c990590f84c52fd357e5b301c35fc4029f456d88e63430c340d4bedad478b272cba84 WHIRLPOOL 1dc0633fb147143bf14ce35c144c8662f91155a6f7b6e06fd953d6192f4640955510fadadc5f80014f9e0acb59500ce326833b61ce4a79731d31c62d11de2a18
+MISC metadata.xml 337 SHA256 b33b8b7e322f87875478803f556538720b7256ccfe8a0c857dbca2665e969fe4 SHA512 8d4007163912848eb4e4b525c808e7c69fe5aa93913398db793b6ed73936cc936a25e1fe7dce4a915b4caf6b2796d6dd4d1a52ed6dfbd2e0fb0faf6c0ba1c7e0 WHIRLPOOL 08d226731e1f85f24ddfb3f18eb69af73064c21e06b5ae2c5f2c7d97e5639cf145e6242f6ddcb1e0cc3ab95152d4507974b912ab11e3e00c593511c677651d75
diff --git a/sys-devel/smatch/files/smatch-1.57-restrict.patch b/sys-devel/smatch/files/smatch-1.57-restrict.patch
new file mode 100644
index 000000000000..2f0dc98d496a
--- /dev/null
+++ b/sys-devel/smatch/files/smatch-1.57-restrict.patch
@@ -0,0 +1,14 @@
+send upstream already
+
+diff --git a/parse.c b/parse.c
+index 5dd9a06..bf5894d 100644
+--- a/parse.c
++++ b/parse.c
+@@ -419,6 +419,7 @@ static struct init_keyword {
+ /* Ignored for now.. */
+ { "restrict", NS_TYPEDEF, .op = &restrict_op},
+ { "__restrict", NS_TYPEDEF, .op = &restrict_op},
++ { "__restrict__", NS_TYPEDEF, .op = &restrict_op},
+
+ /* Storage class */
+ { "auto", NS_TYPEDEF, .op = &auto_op },
diff --git a/sys-devel/smatch/metadata.xml b/sys-devel/smatch/metadata.xml
new file mode 100644
index 000000000000..b88d066159b6
--- /dev/null
+++ b/sys-devel/smatch/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">smatch</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/smatch/smatch-1.57-r1.ebuild b/sys-devel/smatch/smatch-1.57-r1.ebuild
new file mode 100644
index 000000000000..fd7fc3e72b97
--- /dev/null
+++ b/sys-devel/smatch/smatch-1.57-r1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit multilib toolchain-funcs eutils
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://repo.or.cz/${PN}.git
+ http://repo.or.cz/r/${PN}.git"
+ inherit git-2
+fi
+
+DESCRIPTION="static analysis tool for C"
+HOMEPAGE="http://smatch.sourceforge.net/"
+
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ # The repo.or.cz site does not produce stable tarballs,
+ # so we have to cache our own copy of the snapshot.
+ #SRC_URI="http://repo.or.cz/w/smatch.git/snapshot/${PV}.tar.gz -> ${P}.tar.gz"
+ SRC_URI="mirror://gentoo/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+LICENSE="OSL-1.1"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-db/sqlite"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-restrict.patch
+ sed -i \
+ -e '/^PREFIX=/s:=.*:=/usr:' \
+ -e '/^CFLAGS =/{s:=:+=:;s:-O2 -finline-functions:${CPPFLAGS}:}' \
+ Makefile || die
+}
+
+src_compile() {
+ emake PREFIX=/usr V=1 CC="$(tc-getCC)" smatch
+}
+
+src_install() {
+ # default install target installs a lot of sparse cruft
+ dobin smatch
+ insinto /usr/share/smatch/smatch_data
+ doins smatch_data/*
+ dodoc FAQ README
+}
diff --git a/sys-devel/smatch/smatch-1.57.ebuild b/sys-devel/smatch/smatch-1.57.ebuild
new file mode 100644
index 000000000000..e807d2044380
--- /dev/null
+++ b/sys-devel/smatch/smatch-1.57.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://repo.or.cz/${PN}.git
+ http://repo.or.cz/r/${PN}.git"
+ inherit git-2
+fi
+
+DESCRIPTION="static analysis tool for C"
+HOMEPAGE="http://smatch.sourceforge.net/"
+
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ # The repo.or.cz site does not produce stable tarballs,
+ # so we have to cache our own copy of the snapshot.
+ #SRC_URI="http://repo.or.cz/w/smatch.git/snapshot/${PV}.tar.gz -> ${P}.tar.gz"
+ SRC_URI="mirror://gentoo/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+LICENSE="OSL-1.1"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-db/sqlite"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ sed -i \
+ -e '/^PREFIX=/s:=.*:=/usr:' \
+ -e '/^CFLAGS =/{s:=:+=:;s:-O2 -finline-functions:${CPPFLAGS}:}' \
+ Makefile || die
+}
+
+src_compile() {
+ emake PREFIX=/usr V=1 CC="$(tc-getCC)" smatch
+}
+
+src_install() {
+ # default install target installs a lot of sparse cruft
+ dobin smatch
+ insinto /usr/share/smatch/smatch_data
+ doins smatch_data/*
+ dodoc FAQ README
+}
diff --git a/sys-devel/smatch/smatch-1.59.ebuild b/sys-devel/smatch/smatch-1.59.ebuild
new file mode 100644
index 000000000000..b2a8198a82ca
--- /dev/null
+++ b/sys-devel/smatch/smatch-1.59.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://repo.or.cz/${PN}.git
+ http://repo.or.cz/r/${PN}.git"
+ inherit git-2
+else
+ SRC_URI="http://repo.or.cz/w/smatch.git/snapshot/${PV}.tar.gz -> ${P}.tar.gz
+ mirror://gentoo/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="static analysis tool for C"
+HOMEPAGE="http://smatch.sourceforge.net/"
+
+LICENSE="OSL-1.1"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-db/sqlite"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ sed -i \
+ -e '/^CFLAGS =/{s:=:+=:;s:-O2 -finline-functions:${CPPFLAGS}:}' \
+ Makefile || die
+}
+
+_emake() {
+ # gtk/llvm/xml is used by sparse which we don't install
+ emake \
+ PREFIX="${EPREFIX}/usr" \
+ V=1 \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ LD='$(CC)' \
+ HAVE_GTK2=no \
+ HAVE_LLVM=no \
+ HAVE_LIBXML=no \
+ "$@"
+}
+
+src_compile() {
+ _emake smatch
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ # default install target installs a lot of sparse cruft
+ dobin smatch
+ insinto /usr/share/smatch/smatch_data
+ doins smatch_data/*
+ dodoc FAQ README
+}
diff --git a/sys-devel/smatch/smatch-9999.ebuild b/sys-devel/smatch/smatch-9999.ebuild
new file mode 100644
index 000000000000..b2a8198a82ca
--- /dev/null
+++ b/sys-devel/smatch/smatch-9999.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://repo.or.cz/${PN}.git
+ http://repo.or.cz/r/${PN}.git"
+ inherit git-2
+else
+ SRC_URI="http://repo.or.cz/w/smatch.git/snapshot/${PV}.tar.gz -> ${P}.tar.gz
+ mirror://gentoo/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+DESCRIPTION="static analysis tool for C"
+HOMEPAGE="http://smatch.sourceforge.net/"
+
+LICENSE="OSL-1.1"
+SLOT="0"
+IUSE=""
+
+RDEPEND="dev-db/sqlite"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ sed -i \
+ -e '/^CFLAGS =/{s:=:+=:;s:-O2 -finline-functions:${CPPFLAGS}:}' \
+ Makefile || die
+}
+
+_emake() {
+ # gtk/llvm/xml is used by sparse which we don't install
+ emake \
+ PREFIX="${EPREFIX}/usr" \
+ V=1 \
+ AR="$(tc-getAR)" \
+ CC="$(tc-getCC)" \
+ LD='$(CC)' \
+ HAVE_GTK2=no \
+ HAVE_LLVM=no \
+ HAVE_LIBXML=no \
+ "$@"
+}
+
+src_compile() {
+ _emake smatch
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ # default install target installs a lot of sparse cruft
+ dobin smatch
+ insinto /usr/share/smatch/smatch_data
+ doins smatch_data/*
+ dodoc FAQ README
+}
diff --git a/sys-devel/sparse/Manifest b/sys-devel/sparse/Manifest
new file mode 100644
index 000000000000..d3f887759851
--- /dev/null
+++ b/sys-devel/sparse/Manifest
@@ -0,0 +1,11 @@
+AUX sparse-0.4.3-gentoo.patch 1446 SHA256 e353bee56776054bbd7c60b4b41424eb2eba565bf303b2eaf382c129880c27aa SHA512 a270266af0ce1728b114092271e627f63f8e55339b06c67634825a7c89a7cf7e1af17cdd47b5dab7475ef7eca39b95026264c870dee2c3a228c63af0bbdec461 WHIRLPOOL b14145d483d29151060b153c52f24d5dd218a49be6f2bd8691d61ae6f861cfa994c2f86e11f30114aedf9fdf304ade78b590e865dd99181c33b491e50841c061
+DIST sparse-0.4.3.tar.bz2 172431 SHA256 9059bc649ca8c9309e542d0015091ccf72ac9e3300db0adb4eba838cdcc82f9c SHA512 ff3dbd3e28b1a95dc9d6abf9a4ffdfaa0f470047b8232bd50930839432ae66a2249adb861c880e8eef1a906b007fd7d1c1ef8683c48c763eb523aedc9e1df631 WHIRLPOOL d2fad751e0d9594b467a457843a8beb153d9744683cfe9112ae38484f25eb2bb1784fa58d8ec1c6c5341450e966478e42c16027de271452804e5607c0c393354
+DIST sparse-0.4.4.tar.bz2 174074 SHA256 57ce3b7e33567e67dc0b5c74142aff60a8a78257664a2160c3e3d345d00765af SHA512 5cd5e660ea863170e86f1abaa040434c43a5cc7e92560f1bcbcce9ce906ae7355c066168bfc1dcc551e41e4c0f864122be288ed69eb1c4cda8b7c0825b5b647f WHIRLPOOL 2e61fcbee4e2f603d80db37f69050c130aef9d5df5e43dc475504a29e5d53eed3d599499fc5e3ca9139535f68a7f19e701ee3003f2b20ffe16681ffa524b05d0
+DIST sparse-0.5.0.tar.xz 187576 SHA256 921fcf918c6778d1359f3886ac8cb4cf632faa6242627bc2ae2db75e983488d5 SHA512 0cb70a74034c4bc4d5340ab7d19288a438f4b6d0c4c63ac95d1f4cc3c5fdfe1370a27a607605a6f0c85ea6f371141c55abfdb4438d9e87b2d544fff5674f7ce4 WHIRLPOOL 328027ab5fab473d5819659bb91ab6d655cebc6cf5ec5f5c102217fc11aee5c0e5e56e694260784a315f14b7ce84c25a19b5cd70e98db92cfa9ba19f7e7c8944
+EBUILD sparse-0.4.3.ebuild 1322 SHA256 959ded3287a3527f65fa7c73d8630d04bcecc30d8ce9c774b1fa66b819507add SHA512 6fd02eeb079aa4d042dbb541943c3a7b3e2c53dca0f06230fa627bb89558259a9bd78c7b54f4f5f87a4fc9318db0894aa7d3e6fa924d5d841099ab95913d8d83 WHIRLPOOL 7ca031d05eeaa4cbdc9689895189ab3b5951f518d86547bb49cf9628e3c6fd2962c55a5fb317df7cf2be72a0e2688b8e82b0df71a5bd652e15e8202b5a0611f1
+EBUILD sparse-0.4.4.ebuild 1167 SHA256 45540fe883a55dbe3cc7e1c9ffbff696f017a243a79438ae946ac2c16fc623c4 SHA512 02606f9f9925a0c10b40512dc292a16d9ef98a8cb40194bb5a00950e1f3efe68074d1b00b438b38e7bb2a61f4b076b05dbad68f2eeaa8d4506fbb45070ab1cdc WHIRLPOOL 269643f0032195be21ef805fabc8d27e85e110a231a6a0eab1ab7ef6107a6fc3fc5e55627284cbf2ac8576e2be543fdb7f0df6c18a87bab51a51e413373eea63
+EBUILD sparse-0.5.0.ebuild 1226 SHA256 30b86bca516bb9cb371ca9e8ce1406ce547615d07b28d1199f651b26cbd45fa7 SHA512 2bad4ec621b8e2998fc8cd909031060b15df6d93343582aa2f51553aa681ab58a0b3a9b58999d7e9dfe7d332baf57a4c6ed6b448389efe3e3db44399cf1aca2e WHIRLPOOL 70af0f349740f167f272db922f39b1244775ec50be65602a8948e566cc86bd98f8006e98097136d5a54456c73b228cb8192b1539a14664ed44d3a6fe1c4bc867
+EBUILD sparse-9999.ebuild 1226 SHA256 30b86bca516bb9cb371ca9e8ce1406ce547615d07b28d1199f651b26cbd45fa7 SHA512 2bad4ec621b8e2998fc8cd909031060b15df6d93343582aa2f51553aa681ab58a0b3a9b58999d7e9dfe7d332baf57a4c6ed6b448389efe3e3db44399cf1aca2e WHIRLPOOL 70af0f349740f167f272db922f39b1244775ec50be65602a8948e566cc86bd98f8006e98097136d5a54456c73b228cb8192b1539a14664ed44d3a6fe1c4bc867
+MISC ChangeLog 3453 SHA256 f7e06173e7f2bc18ce8747809e7640786a9d0264f145ed2b8f492a55abaffd52 SHA512 91b6878a0b3e25e23f8d2aad89c1e8b686f74831784cbbd88343a067f60016094b97ab6ad2f2ef8980731cd3502565d997870d50ef4088529df4f5595a61091d WHIRLPOOL 8ad1a4283f50dad466822aab90c9587641bc38d33d4bdcd9aa21897d71fc58b6c61331c85116873a94c689536a874422a1b510f029a05c38513f2651a80084c7
+MISC ChangeLog-2015 7547 SHA256 fc530756d30499d5fb1f675fd92bca59f1d30162d0dbcdf4663bd5a9af3994e4 SHA512 3871273d15dc3a4a68164a4db4782a2e4db5f8bd6199ecad2d1d614cddf8bb6bad9f31f75bac2360cf1d40ca33f28d79a06e311a055dbfaeee196428f2a9cbf5 WHIRLPOOL fd997fa49fdd97f84d01631085f58aa64adaaf02718af292623a8ccb07fd59b24597b9fef0f874797e943e206bd6bdcddb2909ae7445e085bf9523ca6b9ace06
+MISC metadata.xml 567 SHA256 50a6c953098cf5bb5486cfe458817d74b1365ff26e4f46c90799f4b2dc4c4623 SHA512 c69a32bcedce10ce3574d769eb347d8370bb6c5c84ccd04a092846643cb02fef30c6edcb3b60958f1e1b34a9b315500d619858a5bc509e82b900b26bf6898b5f WHIRLPOOL bbc0a0a3b05f66346f5fa4a2ea1b285bd05240d51dc075fa87dd350b87a50abf2c8506be43d442d487ba59c9dbea1d498a68d02427e976b5c4c9c61f8e21d0ff
diff --git a/sys-devel/sparse/files/sparse-0.4.3-gentoo.patch b/sys-devel/sparse/files/sparse-0.4.3-gentoo.patch
new file mode 100644
index 000000000000..6f46687d78b3
--- /dev/null
+++ b/sys-devel/sparse/files/sparse-0.4.3-gentoo.patch
@@ -0,0 +1,49 @@
+diff --git a/Makefile b/Makefile
+index 74905df..1f2b2b6 100644
+--- a/Makefile
++++ b/Makefile
+@@ -4,7 +4,7 @@ OS = linux
+
+
+ CC = gcc
+-CFLAGS = -O2 -finline-functions -fno-strict-aliasing -g
++CFLAGS ?= -O2 -finline-functions -fno-strict-aliasing -g
+ CFLAGS += -Wall -Wwrite-strings
+ LDFLAGS += -g
+ AR = ar
+@@ -21,7 +21,8 @@ HAVE_GCC_DEP:=$(shell touch .gcc-test.c && \
+ echo 'yes'; rm -f .gcc-test.d .gcc-test.o .gcc-test.c)
+ HAVE_GTK2:=$(shell pkg-config --exists gtk+-2.0 2>/dev/null && echo 'yes')
+
+-CFLAGS += -DGCC_BASE=\"$(shell $(CC) --print-file-name=)\"
++GCC_BASE = $(shell $(CC) --print-file-name=)
++CFLAGS += -DGCC_BASE=\"$(GCC_BASE)\"
+
+ ifeq ($(HAVE_GCC_DEP),yes)
+ CFLAGS += -Wp,-MD,$(@D)/.$(@F).d
+@@ -113,7 +114,9 @@ SED_PC_CMD = 's|@version@|$(VERSION)|g; \
+
+ all: $(PROGRAMS) sparse.pc
+
+-install: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
++all-installable: $(INST_PROGRAMS) $(LIBS) $(LIB_H) sparse.pc
++
++install: all-installable
+ $(Q)install -d $(DESTDIR)$(BINDIR)
+ $(Q)install -d $(DESTDIR)$(LIBDIR)
+ $(Q)install -d $(DESTDIR)$(MAN1DIR)
+diff --git a/parse.h b/parse.h
+index 6b21e23..b26bd03 100644
+--- a/parse.h
++++ b/parse.h
+@@ -35,10 +35,6 @@ struct statement {
+ struct /* declaration */ {
+ struct symbol_list *declaration;
+ };
+- struct /* label_arg */ {
+- struct symbol *label;
+- struct statement *label_statement;
+- };
+ struct {
+ struct expression *expression;
+ struct expression *context;
diff --git a/sys-devel/sparse/metadata.xml b/sys-devel/sparse/metadata.xml
new file mode 100644
index 000000000000..b07d40e90439
--- /dev/null
+++ b/sys-devel/sparse/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <use>
+ <flag name="gtk">
+ Build the test-inspect utility (requires
+ <pkg>x11-libs/gtk+</pkg> version 2)
+ </flag>
+ <flag name="llvm">Build the sparse-llvm utility</flag>
+ <flag name="xml">
+ Build the c2xml utility (requires <pkg>dev-libs/libxml2</pkg>).
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/sparse/sparse-0.4.3.ebuild b/sys-devel/sparse/sparse-0.4.3.ebuild
new file mode 100644
index 000000000000..c351211de29d
--- /dev/null
+++ b/sys-devel/sparse/sparse-0.4.3.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit eutils multilib flag-o-matic toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
+ inherit git
+fi
+
+DESCRIPTION="C semantic parser"
+HOMEPAGE="https://sparse.wiki.kernel.org/index.php/Main_Page"
+
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://kernel/software/devel/sparse/dist/${P}.tar.bz2"
+ KEYWORDS="amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
+fi
+
+LICENSE="OSL-1.1"
+SLOT="0"
+IUSE="gtk xml test"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2 )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ gtk? ( virtual/pkgconfig )
+ xml? ( virtual/pkgconfig )"
+
+src_prepare() {
+ # https://cgit.gentoo.org/proj/sparse.git
+ epatch "${FILESDIR}"/${P}-gentoo.patch
+}
+
+mymake() {
+ usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; }
+
+ emake \
+ V=1 \
+ CC="$(tc-getCC)" \
+ GCC_BASE="$(gcc-config -L | cut -d : -f1)" \
+ HAVE_LIBXML=$(usex xml) \
+ HAVE_GTK2=$(usex gtk) \
+ PREFIX=/usr \
+ LIBDIR="/usr/$(get_libdir)" \
+ DESTDIR="${D}" \
+ "$@" \
+ || die
+}
+
+src_compile() {
+ append-flags -fno-strict-aliasing
+
+ mymake \
+ $(use test && echo all) all-installable
+}
+
+src_install() {
+ mymake install
+ dodoc FAQ README
+}
diff --git a/sys-devel/sparse/sparse-0.4.4.ebuild b/sys-devel/sparse/sparse-0.4.4.ebuild
new file mode 100644
index 000000000000..51173588d3c2
--- /dev/null
+++ b/sys-devel/sparse/sparse-0.4.4.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
+ inherit git-2
+fi
+
+DESCRIPTION="C semantic parser"
+HOMEPAGE="https://sparse.wiki.kernel.org/index.php/Main_Page"
+
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://kernel/software/devel/sparse/dist/${P}.tar.bz2"
+ KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+LICENSE="OSL-1.1"
+SLOT="0"
+IUSE="gtk test xml"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2 )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ gtk? ( virtual/pkgconfig )
+ xml? ( virtual/pkgconfig )"
+
+src_prepare() {
+ tc-export AR CC PKG_CONFIG
+ sed -i \
+ -e '/^PREFIX=/s:=.*:=/usr:' \
+ -e "/^LIBDIR=/s:/lib:/$(get_libdir):" \
+ -e '/^CFLAGS =/{s:=:+= $(CPPFLAGS):;s:-O2 -finline-functions::}' \
+ -e "s:pkg-config:${PKG_CONFIG}:" \
+ Makefile || die
+ export MAKEOPTS+=" V=1 AR=${AR} CC=${CC} HAVE_GTK2=$(usex gtk) HAVE_LIBXML=$(usex xml)"
+}
+
+src_compile() {
+ emake $(usex test all all-installable)
+}
diff --git a/sys-devel/sparse/sparse-0.5.0.ebuild b/sys-devel/sparse/sparse-0.5.0.ebuild
new file mode 100644
index 000000000000..8771de72828a
--- /dev/null
+++ b/sys-devel/sparse/sparse-0.5.0.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
+ inherit git-2
+fi
+
+DESCRIPTION="C semantic parser"
+HOMEPAGE="https://sparse.wiki.kernel.org/index.php/Main_Page"
+
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://kernel/software/devel/sparse/dist/${P}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+LICENSE="OSL-1.1"
+SLOT="0"
+IUSE="gtk llvm test xml"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2 )
+ llvm? ( >=sys-devel/llvm-3.0 )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ gtk? ( virtual/pkgconfig )
+ xml? ( virtual/pkgconfig )"
+
+src_prepare() {
+ tc-export AR CC PKG_CONFIG
+ sed -i \
+ -e '/^PREFIX=/s:=.*:=/usr:' \
+ -e "/^LIBDIR=/s:/lib:/$(get_libdir):" \
+ -e '/^CFLAGS =/{s:=:+= $(CPPFLAGS):;s:-O2 -finline-functions::}' \
+ -e "s:pkg-config:${PKG_CONFIG}:" \
+ Makefile || die
+ export MAKEOPTS+=" V=1 AR=${AR} CC=${CC} HAVE_GTK2=$(usex gtk) HAVE_LLVM=$(usex llvm) HAVE_LIBXML=$(usex xml)"
+}
+
+src_compile() {
+ emake $(usex test all all-installable)
+}
diff --git a/sys-devel/sparse/sparse-9999.ebuild b/sys-devel/sparse/sparse-9999.ebuild
new file mode 100644
index 000000000000..8771de72828a
--- /dev/null
+++ b/sys-devel/sparse/sparse-9999.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils multilib toolchain-funcs
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/devel/sparse/sparse.git"
+ inherit git-2
+fi
+
+DESCRIPTION="C semantic parser"
+HOMEPAGE="https://sparse.wiki.kernel.org/index.php/Main_Page"
+
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+ #KEYWORDS=""
+else
+ SRC_URI="mirror://kernel/software/devel/sparse/dist/${P}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+fi
+
+LICENSE="OSL-1.1"
+SLOT="0"
+IUSE="gtk llvm test xml"
+
+RDEPEND="gtk? ( x11-libs/gtk+:2 )
+ llvm? ( >=sys-devel/llvm-3.0 )
+ xml? ( dev-libs/libxml2 )"
+DEPEND="${RDEPEND}
+ gtk? ( virtual/pkgconfig )
+ xml? ( virtual/pkgconfig )"
+
+src_prepare() {
+ tc-export AR CC PKG_CONFIG
+ sed -i \
+ -e '/^PREFIX=/s:=.*:=/usr:' \
+ -e "/^LIBDIR=/s:/lib:/$(get_libdir):" \
+ -e '/^CFLAGS =/{s:=:+= $(CPPFLAGS):;s:-O2 -finline-functions::}' \
+ -e "s:pkg-config:${PKG_CONFIG}:" \
+ Makefile || die
+ export MAKEOPTS+=" V=1 AR=${AR} CC=${CC} HAVE_GTK2=$(usex gtk) HAVE_LLVM=$(usex llvm) HAVE_LIBXML=$(usex xml)"
+}
+
+src_compile() {
+ emake $(usex test all all-installable)
+}
diff --git a/sys-devel/systemd-m4/Manifest b/sys-devel/systemd-m4/Manifest
new file mode 100644
index 000000000000..782efa1db638
--- /dev/null
+++ b/sys-devel/systemd-m4/Manifest
@@ -0,0 +1,4 @@
+EBUILD systemd-m4-9999.ebuild 528 SHA256 4c929eb66319514ccddaa82e588744066686212c4acdc4976101b83d4d9bd838 SHA512 3d7e11fb7ff7bfefea9f65316e80687e4f6e03553b92620dfa072a60dc97001f5bf2f3e84d264599137b5cfb2facf01499f242e3fadb90fd93ef0cb9fa8e3c70 WHIRLPOOL e5423ae47a6da5730ec7dc09eb1510947b0293679395db1169618dc78f8e897ca2cfb3c4b831870d3708ce63ce9af529f1567e1d13574d511868d251312a8296
+MISC ChangeLog 2329 SHA256 c96b42338e7c6698481f86647b466903675e9d717ae6642bdbd9f4ba8dce8654 SHA512 5677d636ef88425c93d30a56dd6546c098a0cb3ed2cae560366f4f77714ad6a672817ec1f07cf9b3275da519312ac686badfe6f582d729de51311453c8dffdfa WHIRLPOOL 9355ad79b85211e47e2ccbb1421c8c0227419e946b1c47ca286c7cb66baaff91c3fe1c258f47afd33497c88230c57b999dcc03bc05139234130fa3d288e9fbea
+MISC ChangeLog-2015 713 SHA256 fc5f589c7b600b8579929e2935aae3a473b9d968b8b0cb45e36213a448869391 SHA512 f3b5db7ae3d009e1928d62c6d4ac0868dc5807adc03e1b82bf5802e4f8ad09aaf4849ea34c974a5c593751780061d60a331e687926bb8b2450199e076b727226 WHIRLPOOL d668b0ce033daa47d0daeb601eb08e1b0f8f970b3d89abeee9df31dcb597ef2025e685a23ba223c370c55f4929e5d5bcce53f251e52cceb29d12b5270b1dfb1f
+MISC metadata.xml 515 SHA256 03e4d469802c3f6cdde1442e25a163b4df90f14c3c6b09d601d5f3a37a11cc9c SHA512 1d4652a0c1f0c7372379d16f0065e58df8d25397f03386c3d5bff6a04de7526e80101f470fe5f7bb821eeb952cfc75a56308e874d6590d06db27d40e8f2fb98c WHIRLPOOL d2b1ecf3b1d91f4491cbbe06151f34922f3d3ec17e9f82968615365d3244deff09a061233637acce15d6c8d3cfff3ffb2e947533b1f1e500aec16588c856ed61
diff --git a/sys-devel/systemd-m4/metadata.xml b/sys-devel/systemd-m4/metadata.xml
new file mode 100644
index 000000000000..8dd60d9fa05a
--- /dev/null
+++ b/sys-devel/systemd-m4/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <upstream>
+ <maintainer status="active">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <bugs-to>https://bitbucket.org/mgorny/systemd-m4/issues/</bugs-to>
+ <remote-id type="bitbucket">mgorny/systemd-m4</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/systemd-m4/systemd-m4-9999.ebuild b/sys-devel/systemd-m4/systemd-m4-9999.ebuild
new file mode 100644
index 000000000000..3c2306e59171
--- /dev/null
+++ b/sys-devel/systemd-m4/systemd-m4-9999.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+#if LIVE
+AUTOTOOLS_AUTORECONF=yes
+EGIT_REPO_URI="https://bitbucket.org/mgorny/${PN}.git"
+
+inherit git-r3
+#endif
+
+inherit autotools-utils
+
+DESCRIPTION="autoconf macros for packages using systemd"
+HOMEPAGE="https://bitbucket.org/mgorny/systemd-m4/"
+SRC_URI="https://www.bitbucket.org/mgorny/${PN}/downloads/${P}.tar.bz2"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+#if LIVE
+
+KEYWORDS=
+SRC_URI=
+#endif
diff --git a/sys-devel/ucpp/Manifest b/sys-devel/ucpp/Manifest
new file mode 100644
index 000000000000..be37f8fb00bf
--- /dev/null
+++ b/sys-devel/ucpp/Manifest
@@ -0,0 +1,6 @@
+DIST ucpp-1.3.4.tar.xz 274488 SHA256 6eab925e49f5635962a2152b15536b92d861b409b18337317c122ee065133d25 SHA512 f9ea88e8f53e728a5b0fcb9084d6d6e140737b00fe350a9c6bc53ef2bb5f7b09d3c9d9a4a2147f635d796247e1b920fd3fea0cdce3ec3f4578694162c2f4c2a6 WHIRLPOOL aea8570a422e222f0fe4aa053e755c1484c2f308486ee4b15d630f2bed79806c2efaa0b07bffbe067f0cdd36aec5222592ba2c8e5cfeb4f18f0bc35cfd87cc6b
+EBUILD ucpp-1.3.4.ebuild 557 SHA256 b3ee47fc598c16dc773d055f2e69d5d820e1b77145d45e37cb94fe42195ae8e2 SHA512 f3c2f3000002bf2ddd89bff59831a79f3284e847b7a42f6c9654d02fac9973675ca71bdd9c929c4b2789c1811dad2aaa73c110a14187e335b288b66e20d3f948 WHIRLPOOL a3ab2c2ec8c36bf81d05ec53685006f9956a1618582626ebaad6ba4ee328b2970384bc5703ff8987d9a3a9187e98f53f9d2e7a702c74d4b6f33690a8a203d033
+EBUILD ucpp-9999.ebuild 560 SHA256 6ca6f6c750e20001f2a46ec445465b01bb55d4fbb48af8dd4c8c4bed46486640 SHA512 0e81ee83c29a4ddb4ae9b22222a683192afcb8c494f30d90b8af3cd0077a8a6b95322208d4014e6679d84063c075e6102bbeb27386aa098593574dbf863dfe76 WHIRLPOOL 856b7f5fd186b9167f4e3bf9766d72df378c21457025916c1636688f7bf6821079be0b8c0c84d88ca172ee45c16006992bb857eb6f6f3437dae80603cfc5fc64
+MISC ChangeLog 2773 SHA256 d88dc4ab045274f72ce5dc9d4fa59a7b603d9c838c8e311330d1bf9aae211d0c SHA512 55ed06785677e95ff2a6c2b0b1972b7dfee270191afa5c18c48b32d94e0d64f9b14446b284c24683d21e95e9c09f3522a9fe6cb4a85758c30fee5b77239d8d4a WHIRLPOOL ad9181a2bbdc80db3029eb93ac710deee87bc87302410cf6cba107564db85e4ae67c948252573bbf8d1a0a0a0ee17290aafa5e8c65e82e300d3853e92a3970fa
+MISC ChangeLog-2015 1217 SHA256 01b75c9eb22b856580e7f2f633ea506b76245a84749ab6f65aee6bcf21a3bb70 SHA512 0427968bad2e070b9155ba6ce29eb7afb6484d318225894abd863f11277a753a3cb3c92541a00a9a1cfb135254b811123f9ab1fa0f124c445f843ca4bd1ac1c8 WHIRLPOOL 94daa36be9f17e9db91e472928011af2db0588e0cff6d27353ef006484792b0faaf4f5462d01224c0b169fdba0fb8a2db5fb69b850d9de7c3e5ad455334d41fa
+MISC metadata.xml 368 SHA256 c07f93580397f1f1eb654efe5513cb8e926737ab5b0ee66692811b4dc4d048f6 SHA512 4eb1fce17c77d2e4123e763b76f102cf95e4e2108606949aa9ce87a55dc76fb3159f98fcfc8ec50b98c91bac7fc9e49430a4497b8b8b0edd8e9d5ca0804c1a2b WHIRLPOOL a585d7d7c9beeb33f7f411348e9feab2d7e77c02e58f5d5aee41f6fe844fe94c56127faa18a17fa61e218423130ba469696635ea5bca1c0b5ddead07e4dfd2c2
diff --git a/sys-devel/ucpp/metadata.xml b/sys-devel/ucpp/metadata.xml
new file mode 100644
index 000000000000..8e3addd48188
--- /dev/null
+++ b/sys-devel/ucpp/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>office@gentoo.org</email>
+ <name>Gentoo Office project</name>
+ </maintainer>
+<maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/ucpp/ucpp-1.3.4.ebuild b/sys-devel/ucpp/ucpp-1.3.4.ebuild
new file mode 100644
index 000000000000..f82d6e141c51
--- /dev/null
+++ b/sys-devel/ucpp/ucpp-1.3.4.ebuild
@@ -0,0 +1,27 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit eutils
+
+DESCRIPTION="A quick and light preprocessor, but anyway fully compliant to C99"
+HOMEPAGE="https://code.google.com/p/ucpp/"
+SRC_URI="http://dev.gentooexperimental.org/~scarabeus/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 ppc x86 ~amd64-linux"
+IUSE="static-libs"
+
+src_configure() {
+ econf \
+ --disable-werror \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ prune_libtool_files --all
+}
diff --git a/sys-devel/ucpp/ucpp-9999.ebuild b/sys-devel/ucpp/ucpp-9999.ebuild
new file mode 100644
index 000000000000..81b7839a7a4d
--- /dev/null
+++ b/sys-devel/ucpp/ucpp-9999.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+EGIT_REPO_URI="https://github.com/scarabeusiv/ucpp.git"
+inherit eutils git-2 autotools
+
+DESCRIPTION="A quick and light preprocessor, but anyway fully compliant to C99"
+HOMEPAGE="https://github.com/scarabeusiv/ucpp"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS=""
+IUSE="static-libs"
+
+src_prepare() {
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ --disable-werror \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ prune_libtool_files --all
+}