summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/autoconf-archive/Manifest1
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2021.02.19-r1.ebuild21
-rw-r--r--sys-devel/autoconf-archive/autoconf-archive-2021.02.19.ebuild18
-rw-r--r--sys-devel/autoconf-archive/files/autoconf-archive-2021.02.19-python310.patch36
-rw-r--r--sys-devel/autoconf-archive/files/autoconf-archive-2021.02.19-revert-ax_pthreads.patch70
-rw-r--r--sys-devel/autoconf-wrapper/autoconf-wrapper-15.ebuild25
-rw-r--r--sys-devel/autoconf-wrapper/files/ac-wrapper-15.sh203
-rw-r--r--sys-devel/autoconf-wrapper/metadata.xml8
-rw-r--r--sys-devel/autoconf/Manifest5
-rw-r--r--sys-devel/autoconf/autoconf-2.13-r1.ebuild49
-rw-r--r--sys-devel/autoconf/autoconf-2.64-r1.ebuild26
-rw-r--r--sys-devel/autoconf/autoconf-2.69-r5.ebuild58
-rw-r--r--sys-devel/autoconf/autoconf-2.71-r1.ebuild77
-rw-r--r--sys-devel/autoconf/autoconf-9999.ebuild58
-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-perl-5.26.patch12
-rw-r--r--sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch18
-rw-r--r--sys-devel/autoconf/files/autoconf-2.61-darwin.patch11
-rw-r--r--sys-devel/autoconf/files/autoconf-2.69-fix-libtool-test.patch31
-rw-r--r--sys-devel/autoconf/files/autoconf-2.69-make-tests-bash5-compatible.patch63
-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/files/autoconf-2.71-darwin.patch11
-rw-r--r--sys-devel/autoconf/files/autoconf-2.71-time.patch49
-rw-r--r--sys-devel/autoconf/metadata.xml8
-rw-r--r--sys-devel/autogen/autogen-5.18.16-r3.ebuild77
-rw-r--r--sys-devel/autogen/autogen-5.18.16-r4.ebuild (renamed from sys-devel/autogen/autogen-5.18.16-r1.ebuild)40
-rw-r--r--sys-devel/autogen/files/autogen-5.18.16-FORTIFY_SOURCE.patch100
-rw-r--r--sys-devel/autogen/files/autogen-5.18.16-configure-c99.patch42
-rw-r--r--sys-devel/autogen/files/autogen-5.18.16-no-which.patch15
-rw-r--r--sys-devel/autogen/metadata.xml17
-rw-r--r--sys-devel/automake-wrapper/automake-wrapper-11.ebuild36
-rw-r--r--sys-devel/automake-wrapper/files/am-wrapper-11.sh186
-rw-r--r--sys-devel/automake-wrapper/metadata.xml8
-rw-r--r--sys-devel/automake/Manifest6
-rw-r--r--sys-devel/automake/automake-1.11.6-r3.ebuild98
-rw-r--r--sys-devel/automake/automake-1.13.4-r2.ebuild90
-rw-r--r--sys-devel/automake/automake-1.15.1-r2.ebuild111
-rw-r--r--sys-devel/automake/automake-1.16.3-r1.ebuild131
-rw-r--r--sys-devel/automake/automake-1.16.4.ebuild131
-rw-r--r--sys-devel/automake/automake-1.16.5.ebuild131
-rw-r--r--sys-devel/automake/automake-9999.ebuild130
-rw-r--r--sys-devel/automake/files/automake-1.10-perl-5.16.patch128
-rw-r--r--sys-devel/automake/files/automake-1.11-install-sh-avoid-low-risk-race-in-tmp.patch77
-rw-r--r--sys-devel/automake/files/automake-1.13-dyn-ithreads.patch59
-rw-r--r--sys-devel/automake/files/automake-1.13-hash-order-workaround.patch14
-rw-r--r--sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket-r1.patch37
-rw-r--r--sys-devel/automake/files/automake-1.14-install-sh-avoid-low-risk-race-in-tmp.patch77
-rw-r--r--sys-devel/automake/files/automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch82
-rw-r--r--sys-devel/automake/files/automake-1.16.2-fix-instmany-python.sh-test.patch26
-rw-r--r--sys-devel/automake/files/automake-1.16.2-fix-py-compile-basedir.sh-test.patch26
-rw-r--r--sys-devel/automake/files/automake-1.16.2-py3-compile.patch73
-rw-r--r--sys-devel/automake/metadata.xml11
-rw-r--r--sys-devel/bc/bc-1.07.1-r3.ebuild61
-rw-r--r--sys-devel/bc/bc-1.07.1-r6.ebuild84
-rw-r--r--sys-devel/bc/metadata.xml8
-rw-r--r--sys-devel/bin86/bin86-0.16.21-r1.ebuild4
-rw-r--r--sys-devel/bin86/bin86-0.16.21-r2.ebuild (renamed from sys-devel/bin86/bin86-0.16.21.ebuild)14
-rw-r--r--sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch17
-rw-r--r--sys-devel/bin86/files/bin86-0.16.21-fix-build-for-clang16.patch145
-rw-r--r--sys-devel/binutils-apple/Manifest6
-rw-r--r--sys-devel/binutils-apple/binutils-apple-11.3.1-r1.ebuild378
-rw-r--r--sys-devel/binutils-apple/binutils-apple-3.2.6-r1.ebuild (renamed from sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild)46
-rw-r--r--sys-devel/binutils-apple/binutils-apple-8.2.1-r103.ebuild (renamed from sys-devel/binutils-apple/binutils-apple-8.2.1-r101.ebuild)26
-rw-r--r--sys-devel/binutils-apple/binutils-apple-8.2.1-r2.ebuild (renamed from sys-devel/binutils-apple/binutils-apple-8.2.1-r1.ebuild)92
-rw-r--r--sys-devel/binutils-apple/files/binutils-apple-8.2.1-macos-12.patch24
-rw-r--r--sys-devel/binutils-apple/metadata.xml4
-rw-r--r--sys-devel/binutils-config/Manifest2
-rw-r--r--sys-devel/binutils-config/binutils-config-5.5.ebuild (renamed from sys-devel/binutils-config/binutils-config-5.4.ebuild)14
-rw-r--r--sys-devel/binutils-config/binutils-config-9999.ebuild10
-rw-r--r--sys-devel/binutils-config/metadata.xml4
-rw-r--r--sys-devel/binutils-hppa64/Manifest18
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.35.2.ebuild432
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.36.1-r2.ebuild432
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1-r2.ebuild (renamed from sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1.ebuild)38
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.38-r2.ebuild (renamed from sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1-r1.ebuild)138
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.39-r5.ebuild492
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.40-r7.ebuild492
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.41-r3.ebuild497
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.41-r5.ebuild497
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.42-r1.ebuild534
-rw-r--r--sys-devel/binutils-hppa64/metadata.xml8
-rw-r--r--sys-devel/binutils/Manifest14
-rw-r--r--sys-devel/binutils/binutils-2.32-r2.ebuild23
-rw-r--r--sys-devel/binutils/binutils-2.33.1-r1.ebuild23
-rw-r--r--sys-devel/binutils/binutils-2.34-r2.ebuild23
-rw-r--r--sys-devel/binutils/binutils-2.35.2.ebuild25
-rw-r--r--sys-devel/binutils/binutils-2.36.1-r2.ebuild25
-rw-r--r--sys-devel/binutils/binutils-2.37_p1-r2.ebuild38
-rw-r--r--sys-devel/binutils/binutils-2.38-r2.ebuild (renamed from sys-devel/binutils/binutils-2.37_p1-r1.ebuild)56
-rw-r--r--sys-devel/binutils/binutils-2.39-r5.ebuild (renamed from sys-devel/binutils/binutils-2.37_p1.ebuild)153
-rw-r--r--sys-devel/binutils/binutils-2.40-r9.ebuild499
-rw-r--r--sys-devel/binutils/binutils-2.41-r2.ebuild517
-rw-r--r--sys-devel/binutils/binutils-2.41-r3.ebuild517
-rw-r--r--sys-devel/binutils/binutils-2.41-r4.ebuild524
-rw-r--r--sys-devel/binutils/binutils-2.41-r5.ebuild524
-rw-r--r--sys-devel/binutils/binutils-2.42-r1.ebuild551
-rw-r--r--sys-devel/binutils/binutils-9999.ebuild243
-rw-r--r--sys-devel/binutils/files/binutils-2.40-linker-search-path.patch38
-rw-r--r--sys-devel/binutils/files/binutils-2.41-linker-prefix.patch56
-rw-r--r--sys-devel/binutils/files/binutils-configure-LANG.patch65
-rw-r--r--sys-devel/binutils/metadata.xml3
-rw-r--r--sys-devel/bison/Manifest4
-rw-r--r--sys-devel/bison/bison-3.7.6.ebuild91
-rw-r--r--sys-devel/bison/bison-3.8.1.ebuild96
-rw-r--r--sys-devel/bison/bison-3.8.2-r2.ebuild (renamed from sys-devel/bison/bison-3.8.2.ebuild)45
-rw-r--r--sys-devel/bison/metadata.xml12
-rw-r--r--sys-devel/bmake/Manifest4
-rw-r--r--sys-devel/bmake/bmake-20211024.ebuild55
-rw-r--r--sys-devel/bmake/bmake-20211212.ebuild55
-rw-r--r--sys-devel/bmake/bmake-20211221.ebuild55
-rw-r--r--sys-devel/bmake/files/bmake-20210206-tests.patch18
-rw-r--r--sys-devel/bmake/files/bmake-20210314-mk-fixes.patch66
-rw-r--r--sys-devel/bmake/metadata.xml12
-rw-r--r--sys-devel/boost-m4/Manifest1
-rw-r--r--sys-devel/boost-m4/boost-m4-0.4_p20160328.ebuild29
-rw-r--r--sys-devel/boost-m4/metadata.xml8
-rw-r--r--sys-devel/clang-common/Manifest18
-rw-r--r--sys-devel/clang-common/clang-common-11.1.0.ebuild24
-rw-r--r--sys-devel/clang-common/clang-common-12.0.1.ebuild24
-rw-r--r--sys-devel/clang-common/clang-common-13.0.0.ebuild24
-rw-r--r--sys-devel/clang-common/clang-common-13.0.1.9999.ebuild24
-rw-r--r--sys-devel/clang-common/clang-common-13.0.1_rc1.ebuild24
-rw-r--r--sys-devel/clang-common/clang-common-13.0.1_rc2.ebuild24
-rw-r--r--sys-devel/clang-common/clang-common-14.0.0.9999.ebuild24
-rw-r--r--sys-devel/clang-common/clang-common-15.0.7-r8.ebuild185
-rw-r--r--sys-devel/clang-common/clang-common-16.0.6-r4.ebuild191
-rw-r--r--sys-devel/clang-common/clang-common-17.0.6-r5.ebuild303
-rw-r--r--sys-devel/clang-common/clang-common-18.1.3-r3.ebuild297
-rw-r--r--sys-devel/clang-common/clang-common-18.1.4-r3.ebuild297
-rw-r--r--sys-devel/clang-common/clang-common-19.0.0.9999.ebuild304
-rw-r--r--sys-devel/clang-common/clang-common-19.0.0_pre20240330-r1.ebuild304
-rw-r--r--sys-devel/clang-common/clang-common-19.0.0_pre20240404.ebuild304
-rw-r--r--sys-devel/clang-common/clang-common-19.0.0_pre20240410.ebuild304
-rw-r--r--sys-devel/clang-common/metadata.xml20
-rw-r--r--sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-16.ebuild43
-rw-r--r--sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-17.ebuild43
-rw-r--r--sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-18.ebuild44
-rw-r--r--sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-19.ebuild44
-rw-r--r--sys-devel/clang-crossdev-wrappers/metadata.xml10
-rw-r--r--sys-devel/clang-runtime/clang-runtime-12.0.1.ebuild24
-rw-r--r--sys-devel/clang-runtime/clang-runtime-13.0.0.ebuild24
-rw-r--r--sys-devel/clang-runtime/clang-runtime-13.0.1.9999.ebuild25
-rw-r--r--sys-devel/clang-runtime/clang-runtime-13.0.1_rc1.ebuild25
-rw-r--r--sys-devel/clang-runtime/clang-runtime-13.0.1_rc2.ebuild25
-rw-r--r--sys-devel/clang-runtime/clang-runtime-14.0.0.9999.ebuild25
-rw-r--r--sys-devel/clang-runtime/clang-runtime-15.0.7.ebuild (renamed from sys-devel/clang-runtime/clang-runtime-11.1.0.ebuild)16
-rw-r--r--sys-devel/clang-runtime/clang-runtime-16.0.6.ebuild40
-rw-r--r--sys-devel/clang-runtime/clang-runtime-17.0.6.ebuild40
-rw-r--r--sys-devel/clang-runtime/clang-runtime-18.1.3.ebuild40
-rw-r--r--sys-devel/clang-runtime/clang-runtime-18.1.4.ebuild40
-rw-r--r--sys-devel/clang-runtime/clang-runtime-19.0.0.9999.ebuild39
-rw-r--r--sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240330.ebuild39
-rw-r--r--sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240404.ebuild39
-rw-r--r--sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240410.ebuild39
-rw-r--r--sys-devel/clang-runtime/metadata.xml3
-rw-r--r--sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-15-r2.ebuild59
-rw-r--r--sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-16-r2.ebuild59
-rw-r--r--sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-17.ebuild59
-rw-r--r--sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-18.ebuild59
-rw-r--r--sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-19.ebuild58
-rw-r--r--sys-devel/clang-toolchain-symlinks/metadata.xml26
-rw-r--r--sys-devel/clang/Manifest34
-rw-r--r--sys-devel/clang/clang-11.1.0.ebuild428
-rw-r--r--sys-devel/clang/clang-12.0.1.ebuild432
-rw-r--r--sys-devel/clang/clang-13.0.0.ebuild421
-rw-r--r--sys-devel/clang/clang-15.0.7-r3.ebuild (renamed from sys-devel/clang/clang-14.0.0.9999.ebuild)249
-rw-r--r--sys-devel/clang/clang-16.0.6.ebuild (renamed from sys-devel/clang/clang-13.0.1_rc1.ebuild)265
-rw-r--r--sys-devel/clang/clang-17.0.6.ebuild (renamed from sys-devel/clang/clang-13.0.1_rc2.ebuild)274
-rw-r--r--sys-devel/clang/clang-18.1.3.ebuild476
-rw-r--r--sys-devel/clang/clang-18.1.4.ebuild476
-rw-r--r--sys-devel/clang/clang-19.0.0.9999.ebuild (renamed from sys-devel/clang/clang-13.0.1.9999.ebuild)281
-rw-r--r--sys-devel/clang/clang-19.0.0_pre20240330.ebuild475
-rw-r--r--sys-devel/clang/clang-19.0.0_pre20240404.ebuild475
-rw-r--r--sys-devel/clang/clang-19.0.0_pre20240410.ebuild475
-rw-r--r--sys-devel/clang/metadata.xml8
-rw-r--r--sys-devel/cons/Manifest1
-rw-r--r--sys-devel/cons/cons-2.3.0.ebuild29
-rw-r--r--sys-devel/cons/metadata.xml8
-rw-r--r--sys-devel/cproc/Manifest1
-rw-r--r--sys-devel/cproc/cproc-0_pre20220805.ebuild39
-rw-r--r--sys-devel/cproc/cproc-9999.ebuild39
-rw-r--r--sys-devel/cproc/metadata.xml16
-rw-r--r--sys-devel/crossdev/Manifest5
-rw-r--r--sys-devel/crossdev/crossdev-20210621.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20210718.ebuild35
-rw-r--r--sys-devel/crossdev/crossdev-20211027.ebuild36
-rw-r--r--sys-devel/crossdev/crossdev-20240209.ebuild (renamed from sys-devel/crossdev/crossdev-20211121.ebuild)20
-rw-r--r--sys-devel/crossdev/crossdev-99999999.ebuild20
-rw-r--r--sys-devel/crossdev/metadata.xml24
-rw-r--r--sys-devel/crosstool-ng/Manifest3
-rw-r--r--sys-devel/crosstool-ng/crosstool-ng-1.24.0-r3.ebuild75
-rw-r--r--sys-devel/crosstool-ng/crosstool-ng-1.25.0-r1.ebuild75
-rw-r--r--sys-devel/crosstool-ng/crosstool-ng-1.26.0.ebuild75
-rw-r--r--sys-devel/crosstool-ng/crosstool-ng-9999.ebuild75
-rw-r--r--sys-devel/crosstool-ng/metadata.xml25
-rw-r--r--sys-devel/ct-ng/Manifest1
-rw-r--r--sys-devel/ct-ng/ct-ng-1.24.0.ebuild28
-rw-r--r--sys-devel/ct-ng/metadata.xml17
-rw-r--r--sys-devel/dev86/dev86-0.16.21-r3.ebuild3
-rw-r--r--sys-devel/dev86/files/dev86-0.16.21-void-return-check-msdos-clang-fix.patch20
-rw-r--r--sys-devel/dev86/metadata.xml3
-rw-r--r--sys-devel/distcc/Manifest1
-rw-r--r--sys-devel/distcc/distcc-3.4-r1.ebuild (renamed from sys-devel/distcc/distcc-3.4.ebuild)17
-rw-r--r--sys-devel/distcc/distcc-3.4-r2.ebuild (renamed from sys-devel/distcc/distcc-3.3.3-r3.ebuild)30
-rw-r--r--sys-devel/distcc/distcc-3.4-r3.ebuild186
-rw-r--r--sys-devel/distcc/files/distcc-3.3.2-freedesktop.patch112
-rw-r--r--sys-devel/distcc/files/distcc-3.3.3-gcc-10-fix.patch28
-rw-r--r--sys-devel/distcc/files/distcc-3.3.3-no-rewrite-chost.patch28
-rw-r--r--sys-devel/distcc/files/distcc-3.3.3-py38.patch53
-rw-r--r--sys-devel/distcc/files/distcc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch65
-rw-r--r--sys-devel/distcc/files/distcc-3.4-pump-tests.patch153
-rw-r--r--sys-devel/distcc/files/distcc-3.4-rewrite-chost.patch79
-rw-r--r--sys-devel/distcc/metadata.xml7
-rw-r--r--sys-devel/dwz/Manifest2
-rw-r--r--sys-devel/dwz/dwz-0.15-r1.ebuild (renamed from sys-devel/dwz/dwz-0.14.ebuild)24
-rw-r--r--sys-devel/dwz/metadata.xml10
-rw-r--r--sys-devel/elftoolchain/elftoolchain-0.7.1-r2.ebuild6
-rw-r--r--sys-devel/elftoolchain/elftoolchain-0.7.1_p20210319.ebuild6
-rw-r--r--sys-devel/flex/Manifest1
-rw-r--r--sys-devel/flex/files/flex-2.6.4-fix-apple-m1-crash-by-explicit-pointer-cast.patch48
-rw-r--r--sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.26.patch219
-rw-r--r--sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.6+.patch767
-rw-r--r--sys-devel/flex/flex-2.6.4-r6.ebuild (renamed from sys-devel/flex/flex-2.6.4-r1.ebuild)46
-rw-r--r--sys-devel/gcc-apple/files/gcc-apple-4.2.1-dsymutil.patch20
-rw-r--r--sys-devel/gcc-apple/files/libstdc++-16.patch11
-rw-r--r--sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r3.ebuild19
-rw-r--r--sys-devel/gcc-config/Manifest3
-rw-r--r--sys-devel/gcc-config/gcc-config-2.11.ebuild (renamed from sys-devel/gcc-config/gcc-config-2.5-r1.ebuild)8
-rw-r--r--sys-devel/gcc-config/gcc-config-2.4.ebuild52
-rw-r--r--sys-devel/gcc-config/gcc-config-9999.ebuild8
-rw-r--r--sys-devel/gcc-config/metadata.xml4
-rw-r--r--sys-devel/gcc/Manifest61
-rw-r--r--sys-devel/gcc/files/gcc-11.2.0-cross-compile-include.patch26
-rw-r--r--sys-devel/gcc/files/gcc-13-fix-cross-fixincludes.patch21
-rw-r--r--sys-devel/gcc/files/gcc-14.0.1_pre20240324-PR114439.patch112
-rw-r--r--sys-devel/gcc/files/gcc-configure-LANG.patch64
-rw-r--r--sys-devel/gcc/gcc-10.3.0-r2.ebuild24
-rw-r--r--sys-devel/gcc/gcc-10.3.1_p20211126.ebuild26
-rw-r--r--sys-devel/gcc/gcc-10.3.1_pre9999.ebuild30
-rw-r--r--sys-devel/gcc/gcc-10.5.0.ebuild61
-rw-r--r--sys-devel/gcc/gcc-11.2.0.ebuild25
-rw-r--r--sys-devel/gcc/gcc-11.2.1_p20211127.ebuild31
-rw-r--r--sys-devel/gcc/gcc-11.2.1_pre9999.ebuild38
-rw-r--r--sys-devel/gcc/gcc-11.4.1_p20240111.ebuild65
-rw-r--r--sys-devel/gcc/gcc-11.4.1_p20240208.ebuild65
-rw-r--r--sys-devel/gcc/gcc-11.4.1_p20240328.ebuild65
-rw-r--r--sys-devel/gcc/gcc-11.4.1_p20240404.ebuild65
-rw-r--r--sys-devel/gcc/gcc-11.4.1_p20240411.ebuild65
-rw-r--r--sys-devel/gcc/gcc-11.4.1_p20240418.ebuild65
-rw-r--r--sys-devel/gcc/gcc-11.5.9999.ebuild62
-rw-r--r--sys-devel/gcc/gcc-12.0.0_pre9999.ebuild36
-rw-r--r--sys-devel/gcc/gcc-12.3.1_p20240112.ebuild65
-rw-r--r--sys-devel/gcc/gcc-12.3.1_p20240209.ebuild65
-rw-r--r--sys-devel/gcc/gcc-12.3.1_p20240329.ebuild65
-rw-r--r--sys-devel/gcc/gcc-12.3.1_p20240405.ebuild65
-rw-r--r--sys-devel/gcc/gcc-12.3.1_p20240412.ebuild65
-rw-r--r--sys-devel/gcc/gcc-12.4.9999.ebuild62
-rw-r--r--sys-devel/gcc/gcc-13.2.1_p20240113-r1.ebuild66
-rw-r--r--sys-devel/gcc/gcc-13.2.1_p20240210.ebuild66
-rw-r--r--sys-devel/gcc/gcc-13.2.1_p20240330.ebuild66
-rw-r--r--sys-devel/gcc/gcc-13.2.1_p20240406.ebuild66
-rw-r--r--sys-devel/gcc/gcc-13.2.1_p20240413.ebuild66
-rw-r--r--sys-devel/gcc/gcc-13.3.9999.ebuild62
-rw-r--r--sys-devel/gcc/gcc-14.0.1_pre20240317.ebuild66
-rw-r--r--sys-devel/gcc/gcc-14.0.1_pre20240324-r1.ebuild67
-rw-r--r--sys-devel/gcc/gcc-14.0.1_pre20240331.ebuild66
-rw-r--r--sys-devel/gcc/gcc-14.0.1_pre20240407.ebuild66
-rw-r--r--sys-devel/gcc/gcc-14.0.1_pre20240414.ebuild66
-rw-r--r--sys-devel/gcc/gcc-14.0.9999.ebuild51
-rw-r--r--sys-devel/gcc/gcc-6.5.0-r4.ebuild19
-rw-r--r--sys-devel/gcc/gcc-7.5.0-r2.ebuild19
-rw-r--r--sys-devel/gcc/gcc-8.5.0-r1.ebuild7
-rw-r--r--sys-devel/gcc/gcc-9.4.0.ebuild19
-rw-r--r--sys-devel/gcc/gcc-9.4.1_pre9999.ebuild26
-rw-r--r--sys-devel/gcc/gcc-9.5.0.ebuild53
-rw-r--r--sys-devel/gcc/metadata.xml159
-rw-r--r--sys-devel/gdb-apple/Manifest1
-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-1705-darwin8-10.patch11
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-768-texinfo.patch10
-rw-r--r--sys-devel/gdb-apple/files/gdb-apple-no-global-gdbinit.patch23
-rw-r--r--sys-devel/gdb-apple/gdb-apple-1752.ebuild95
-rw-r--r--sys-devel/gdb-apple/metadata.xml8
-rw-r--r--sys-devel/gdb/Manifest2
-rw-r--r--sys-devel/gdb/files/gdb-10.1-cet.patch103
-rw-r--r--sys-devel/gdb/files/gdb-10.2-DW_LLE-riscv64.patch41
-rw-r--r--sys-devel/gdb/files/gdb-10.2-sparc-nat.patch47
-rw-r--r--sys-devel/gdb/files/gdb-11.1-glibc-2.34-sim.patch110
-rw-r--r--sys-devel/gdb/files/gdb-8.3.1-verbose-build.patch13
-rw-r--r--sys-devel/gdb/gdb-10.2-r1.ebuild259
-rw-r--r--sys-devel/gdb/gdb-11.1.ebuild267
-rw-r--r--sys-devel/gdb/gdb-9999.ebuild266
-rw-r--r--sys-devel/gdb/metadata.xml21
-rw-r--r--sys-devel/gettext/Manifest7
-rw-r--r--sys-devel/gettext/files/gettext-0.21-musl-omit_setlocale_lock.patch37
-rw-r--r--sys-devel/gettext/files/gettext-0.21.1-java-autoconf.patch100
-rw-r--r--sys-devel/gettext/gettext-0.21.1.ebuild (renamed from sys-devel/gettext/gettext-0.21-r1.ebuild)52
-rw-r--r--sys-devel/gettext/gettext-0.22.4.ebuild189
-rw-r--r--sys-devel/gettext/gettext-0.22.5.ebuild199
-rw-r--r--sys-devel/gettext/metadata.xml27
-rw-r--r--sys-devel/gnuconfig/Manifest2
-rw-r--r--sys-devel/gnuconfig/files/99999999/0001-add-ps2-targets-to-config.sub.patch64
-rw-r--r--sys-devel/gnuconfig/gnuconfig-20230731.ebuild (renamed from sys-devel/gnuconfig/gnuconfig-20210107.ebuild)30
-rw-r--r--sys-devel/gnuconfig/gnuconfig-99999999.ebuild30
-rw-r--r--sys-devel/gnuconfig/metadata.xml3
-rw-r--r--sys-devel/icecream/Manifest3
-rw-r--r--sys-devel/icecream/files/icecream-1.0.0-libcap-ng.patch8
-rw-r--r--sys-devel/icecream/files/icecream-r244
-rw-r--r--sys-devel/icecream/icecream-1.0.0-r3.ebuild62
-rw-r--r--sys-devel/icecream/icecream-1.4.ebuild (renamed from sys-devel/icecream/icecream-1.3.1.ebuild)11
-rw-r--r--sys-devel/kgcc64/Manifest27
-rw-r--r--sys-devel/kgcc64/files/gcc-12.3-ccache-ICE.patch67
-rw-r--r--sys-devel/kgcc64/files/gcc-configure-LANG.patch64
-rw-r--r--sys-devel/kgcc64/kgcc64-10.5.0.ebuild (renamed from sys-devel/kgcc64/kgcc64-10.3.0.ebuild)12
-rw-r--r--sys-devel/kgcc64/kgcc64-11.4.1_p20240111.ebuild (renamed from sys-devel/kgcc64/kgcc64-9.3.0-r2.ebuild)17
-rw-r--r--sys-devel/kgcc64/kgcc64-11.4.1_p20240208.ebuild (renamed from sys-devel/kgcc64/kgcc64-9.4.0.ebuild)17
-rw-r--r--sys-devel/kgcc64/kgcc64-12.3.1_p20240112.ebuild51
-rw-r--r--sys-devel/kgcc64/kgcc64-12.3.1_p20240209.ebuild51
-rw-r--r--sys-devel/kgcc64/kgcc64-13.2.1_p20240113-r1.ebuild (renamed from sys-devel/kgcc64/kgcc64-11.1.0.ebuild)16
-rw-r--r--sys-devel/kgcc64/kgcc64-13.2.1_p20240210.ebuild (renamed from sys-devel/kgcc64/kgcc64-11.2.0.ebuild)16
-rw-r--r--sys-devel/libtool/Manifest1
-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-darwin20.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.patch46
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch43
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-link-specs.patch45
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-mint.patch46
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch111
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-pthread.patch43
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-pthread_bootstrapped.patch21
-rw-r--r--sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch253
-rw-r--r--sys-devel/libtool/libtool-2.4.6-r6.ebuild115
-rw-r--r--sys-devel/libtool/libtool-9999.ebuild106
-rw-r--r--sys-devel/libtool/metadata.xml11
-rw-r--r--sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-15-r2.ebuild38
-rw-r--r--sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-16-r2.ebuild38
-rw-r--r--sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-17.ebuild38
-rw-r--r--sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-18.ebuild38
-rw-r--r--sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-19.ebuild37
-rw-r--r--sys-devel/lld-toolchain-symlinks/metadata.xml21
-rw-r--r--sys-devel/lld/Manifest19
-rw-r--r--sys-devel/lld/lld-11.1.0-r1.ebuild57
-rw-r--r--sys-devel/lld/lld-11.1.0.ebuild65
-rw-r--r--sys-devel/lld/lld-12.0.1.ebuild68
-rw-r--r--sys-devel/lld/lld-14.0.0.9999.ebuild73
-rw-r--r--sys-devel/lld/lld-15.0.7.ebuild (renamed from sys-devel/lld/lld-13.0.0.ebuild)44
-rw-r--r--sys-devel/lld/lld-16.0.6.ebuild92
-rw-r--r--sys-devel/lld/lld-17.0.6.ebuild93
-rw-r--r--sys-devel/lld/lld-18.1.3.ebuild94
-rw-r--r--sys-devel/lld/lld-18.1.4.ebuild94
-rw-r--r--sys-devel/lld/lld-19.0.0.9999.ebuild (renamed from sys-devel/lld/lld-13.0.1.9999.ebuild)56
-rw-r--r--sys-devel/lld/lld-19.0.0_pre20240330.ebuild (renamed from sys-devel/lld/lld-13.0.1_rc2.ebuild)56
-rw-r--r--sys-devel/lld/lld-19.0.0_pre20240404.ebuild (renamed from sys-devel/lld/lld-13.0.1_rc1.ebuild)56
-rw-r--r--sys-devel/lld/lld-19.0.0_pre20240410.ebuild93
-rw-r--r--sys-devel/lld/metadata.xml3
-rw-r--r--sys-devel/llvm-common/Manifest18
-rw-r--r--sys-devel/llvm-common/llvm-common-11.1.0.ebuild27
-rw-r--r--sys-devel/llvm-common/llvm-common-12.0.1.ebuild27
-rw-r--r--sys-devel/llvm-common/llvm-common-13.0.0.ebuild27
-rw-r--r--sys-devel/llvm-common/llvm-common-13.0.1.9999.ebuild27
-rw-r--r--sys-devel/llvm-common/llvm-common-13.0.1_rc1.ebuild27
-rw-r--r--sys-devel/llvm-common/llvm-common-13.0.1_rc2.ebuild27
-rw-r--r--sys-devel/llvm-common/llvm-common-14.0.0.9999.ebuild27
-rw-r--r--sys-devel/llvm-common/llvm-common-15.0.7.ebuild54
-rw-r--r--sys-devel/llvm-common/llvm-common-16.0.6.ebuild54
-rw-r--r--sys-devel/llvm-common/llvm-common-17.0.6.ebuild54
-rw-r--r--sys-devel/llvm-common/llvm-common-18.1.3.ebuild54
-rw-r--r--sys-devel/llvm-common/llvm-common-18.1.4.ebuild54
-rw-r--r--sys-devel/llvm-common/llvm-common-19.0.0.9999.ebuild53
-rw-r--r--sys-devel/llvm-common/llvm-common-19.0.0_pre20240330.ebuild53
-rw-r--r--sys-devel/llvm-common/llvm-common-19.0.0_pre20240404.ebuild53
-rw-r--r--sys-devel/llvm-common/llvm-common-19.0.0_pre20240410.ebuild53
-rw-r--r--sys-devel/llvm-common/metadata.xml3
-rw-r--r--sys-devel/llvm-roc/Manifest10
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-3.0.0-add_libraries.patch20
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-3.7.0-current_pos.patch32
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-3.9.0-tensorflow.patch35
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch84
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-4.0.0-remove-isystem-usr-include.patch29
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-4.1.0-fix-missing-include.patch21
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-4.2.0-add_Object.patch11
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-4.2.0-current_pos.patch28
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-4.2.0-cyclades.patch86
-rw-r--r--sys-devel/llvm-roc/files/llvm-roc-4.3.0-hip-location.patch189
-rw-r--r--sys-devel/llvm-roc/llvm-roc-3.10.0.ebuild70
-rw-r--r--sys-devel/llvm-roc/llvm-roc-3.7.0-r1.ebuild63
-rw-r--r--sys-devel/llvm-roc/llvm-roc-3.8.0.ebuild69
-rw-r--r--sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild70
-rw-r--r--sys-devel/llvm-roc/llvm-roc-4.0.0-r2.ebuild93
-rw-r--r--sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild91
-rw-r--r--sys-devel/llvm-roc/llvm-roc-4.0.1.ebuild93
-rw-r--r--sys-devel/llvm-roc/llvm-roc-4.1.0.ebuild93
-rw-r--r--sys-devel/llvm-roc/llvm-roc-4.1.1.ebuild94
-rw-r--r--sys-devel/llvm-roc/llvm-roc-4.2.0.ebuild94
-rw-r--r--sys-devel/llvm-roc/llvm-roc-4.3.0-r1.ebuild95
-rw-r--r--sys-devel/llvm-roc/metadata.xml14
-rw-r--r--sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15-r1.ebuild47
-rw-r--r--sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16-r1.ebuild47
-rw-r--r--sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-17.ebuild47
-rw-r--r--sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-18.ebuild47
-rw-r--r--sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-19.ebuild46
-rw-r--r--sys-devel/llvm-toolchain-symlinks/metadata.xml22
-rw-r--r--sys-devel/llvm/Manifest34
-rw-r--r--sys-devel/llvm/llvm-11.1.0.ebuild512
-rw-r--r--sys-devel/llvm/llvm-12.0.1.ebuild517
-rw-r--r--sys-devel/llvm/llvm-13.0.0.ebuild510
-rw-r--r--sys-devel/llvm/llvm-15.0.7-r3.ebuild (renamed from sys-devel/llvm/llvm-13.0.1_rc1.ebuild)140
-rw-r--r--sys-devel/llvm/llvm-16.0.6.ebuild (renamed from sys-devel/llvm/llvm-13.0.1.9999.ebuild)181
-rw-r--r--sys-devel/llvm/llvm-17.0.6.ebuild (renamed from sys-devel/llvm/llvm-13.0.1_rc2.ebuild)200
-rw-r--r--sys-devel/llvm/llvm-18.1.3.ebuild548
-rw-r--r--sys-devel/llvm/llvm-18.1.4.ebuild548
-rw-r--r--sys-devel/llvm/llvm-19.0.0.9999.ebuild (renamed from sys-devel/llvm/llvm-14.0.0.9999.ebuild)223
-rw-r--r--sys-devel/llvm/llvm-19.0.0_pre20240330.ebuild547
-rw-r--r--sys-devel/llvm/llvm-19.0.0_pre20240404.ebuild547
-rw-r--r--sys-devel/llvm/llvm-19.0.0_pre20240410.ebuild547
-rw-r--r--sys-devel/llvm/metadata.xml6
-rw-r--r--sys-devel/llvmgold/llvmgold-15.ebuild (renamed from sys-devel/llvmgold/llvmgold-11.ebuild)17
-rw-r--r--sys-devel/llvmgold/llvmgold-16.ebuild (renamed from sys-devel/llvmgold/llvmgold-12.ebuild)16
-rw-r--r--sys-devel/llvmgold/llvmgold-17.ebuild (renamed from sys-devel/llvmgold/llvmgold-13-r1.ebuild)18
-rw-r--r--sys-devel/llvmgold/llvmgold-18.ebuild23
-rw-r--r--sys-devel/llvmgold/llvmgold-19.ebuild (renamed from sys-devel/llvmgold/llvmgold-14.ebuild)15
-rw-r--r--sys-devel/llvmgold/metadata.xml3
-rw-r--r--sys-devel/m4/Manifest2
-rw-r--r--sys-devel/m4/files/loong-fix-build.patch30
-rw-r--r--sys-devel/m4/files/m4-1.4.19-fortify-source.patch50
-rw-r--r--sys-devel/m4/files/m4-1.4.19-make-4.4-tests.patch38
-rw-r--r--sys-devel/m4/files/m4-1.4.19-race-condition-tests.patch34
-rw-r--r--sys-devel/m4/files/ppc-musl.patch3
-rw-r--r--sys-devel/m4/m4-1.4.19-r2.ebuild100
-rw-r--r--sys-devel/m4/m4-1.4.19.ebuild70
-rw-r--r--sys-devel/m4/metadata.xml11
-rw-r--r--sys-devel/make/Manifest1
-rw-r--r--sys-devel/make/files/make-3.82-darwin-library_search-dylib.patch17
-rw-r--r--sys-devel/make/files/make-4.2-default-cxx.patch13
-rw-r--r--sys-devel/make/make-4.3.ebuild55
-rw-r--r--sys-devel/make/metadata.xml11
-rw-r--r--sys-devel/mold/Manifest6
-rw-r--r--sys-devel/mold/files/mold-2.3.0-no-pch.patch12
-rw-r--r--sys-devel/mold/metadata.xml6
-rw-r--r--sys-devel/mold/mold-1.0.0-r1.ebuild67
-rw-r--r--sys-devel/mold/mold-1.0.1.ebuild69
-rw-r--r--sys-devel/mold/mold-2.1.0.ebuild89
-rw-r--r--sys-devel/mold/mold-2.30.0.ebuild99
-rw-r--r--sys-devel/mold/mold-2.4.0.ebuild103
-rw-r--r--sys-devel/mold/mold-2.4.1.ebuild99
-rw-r--r--sys-devel/mold/mold-9999.ebuild104
-rw-r--r--sys-devel/native-cctools/files/aix-2/ld143
-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/native-cctools-4.ebuild114
-rw-r--r--sys-devel/native-cctools/native-cctools-5-r1.ebuild (renamed from sys-devel/native-cctools/native-cctools-5.ebuild)21
-rw-r--r--sys-devel/nvptx-tools/Manifest1
-rw-r--r--sys-devel/nvptx-tools/metadata.xml (renamed from sys-devel/autoconf-archive/metadata.xml)8
-rw-r--r--sys-devel/nvptx-tools/nvptx-tools-0_pre20230122.ebuild52
-rw-r--r--sys-devel/nvptx-tools/nvptx-tools-9999.ebuild52
-rw-r--r--sys-devel/parity/Manifest1
-rw-r--r--sys-devel/parity/metadata.xml20
-rw-r--r--sys-devel/parity/parity-2.0.1.ebuild77
-rw-r--r--sys-devel/parity/parity-9999.ebuild77
-rw-r--r--sys-devel/patch/Manifest1
-rw-r--r--sys-devel/patch/patch-2.7.6-r4.ebuild13
-rw-r--r--sys-devel/patch/patch-2.7.6-r5.ebuild59
-rw-r--r--sys-devel/pmake/Manifest2
-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.xml5
-rw-r--r--sys-devel/pmake/pmake-1.111.3.3.ebuild76
-rw-r--r--sys-devel/prelink/Manifest2
-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.confd43
-rw-r--r--sys-devel/prelink/files/prelink.cron61
-rw-r--r--sys-devel/prelink/files/prelink.service6
-rw-r--r--sys-devel/prelink/files/prelink.timer10
-rw-r--r--sys-devel/prelink/metadata.xml8
-rw-r--r--sys-devel/prelink/prelink-20151030-r1.ebuild72
-rw-r--r--sys-devel/prelink/prelink-99999999.ebuild71
-rw-r--r--sys-devel/qbe/Manifest5
-rw-r--r--sys-devel/qbe/metadata.xml (renamed from sys-devel/qconf/metadata.xml)9
-rw-r--r--sys-devel/qbe/qbe-1.1-r1.ebuild46
-rw-r--r--sys-devel/qbe/qbe-1.2.ebuild41
-rw-r--r--sys-devel/qbe/qbe-9999.ebuild41
-rw-r--r--sys-devel/qconf/Manifest1
-rw-r--r--sys-devel/qconf/qconf-2.5.ebuild39
-rw-r--r--sys-devel/reflex/Manifest2
-rw-r--r--sys-devel/reflex/metadata.xml12
-rw-r--r--sys-devel/reflex/reflex-20230523.ebuild22
-rw-r--r--sys-devel/remake/Manifest1
-rw-r--r--sys-devel/remake/files/remake-4.3.1.1.5-fno-common.patch103
-rw-r--r--sys-devel/remake/metadata.xml9
-rw-r--r--sys-devel/remake/remake-4.3.1.1.5.ebuild40
-rw-r--r--sys-devel/rust-std/Manifest13
-rw-r--r--sys-devel/rust-std/files/1.75.0-handle-vendored-sources.patch45
-rw-r--r--sys-devel/rust-std/metadata.xml10
-rw-r--r--sys-devel/rust-std/rust-std-1.68.2.ebuild (renamed from sys-devel/rust-std/rust-std-1.58.0.ebuild)4
-rw-r--r--sys-devel/rust-std/rust-std-1.71.1.ebuild (renamed from sys-devel/rust-std/rust-std-1.53.0.ebuild)11
-rw-r--r--sys-devel/rust-std/rust-std-1.72.0.ebuild (renamed from sys-devel/rust-std/rust-std-1.56.1.ebuild)11
-rw-r--r--sys-devel/rust-std/rust-std-1.73.0.ebuild (renamed from sys-devel/rust-std/rust-std-1.54.0.ebuild)13
-rw-r--r--sys-devel/rust-std/rust-std-1.74.1.ebuild155
-rw-r--r--sys-devel/rust-std/rust-std-1.75.0.ebuild (renamed from sys-devel/rust-std/rust-std-1.55.0.ebuild)17
-rw-r--r--sys-devel/rust-std/rust-std-1.76.0.ebuild159
-rw-r--r--sys-devel/rust-std/rust-std-1.77.1.ebuild155
-rw-r--r--sys-devel/slibtool/Manifest2
-rw-r--r--sys-devel/slibtool/metadata.xml16
-rw-r--r--sys-devel/slibtool/slibtool-0.5.34.ebuild36
-rw-r--r--sys-devel/slibtool/slibtool-9999.ebuild36
-rw-r--r--sys-devel/smatch/Manifest1
-rw-r--r--sys-devel/smatch/smatch-1.60.ebuild69
-rw-r--r--sys-devel/smatch/smatch-1.72.ebuild7
-rw-r--r--sys-devel/smatch/smatch-9999.ebuild7
-rw-r--r--sys-devel/sparse/metadata.xml2
-rw-r--r--sys-devel/sparse/sparse-0.6.4-r2.ebuild (renamed from sys-devel/sparse/sparse-0.6.4.ebuild)6
-rw-r--r--sys-devel/sparse/sparse-9999.ebuild6
-rw-r--r--sys-devel/ucpp/Manifest1
-rw-r--r--sys-devel/ucpp/metadata.xml15
-rw-r--r--sys-devel/ucpp/ucpp-1.3.5.ebuild25
524 files changed, 24012 insertions, 17596 deletions
diff --git a/sys-devel/autoconf-archive/Manifest b/sys-devel/autoconf-archive/Manifest
deleted file mode 100644
index b50af912fbc6..000000000000
--- a/sys-devel/autoconf-archive/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST autoconf-archive-2021.02.19.tar.xz 667304 BLAKE2B bc99cfd2b507a0c7fc37a001cc9e090fa037cc3626f5f5201c9a62ef06ee8ca4532ca8f21e1422f9dff9f67f64409ae560117c3161809f2d3bc3a39469910485 SHA512 a968c355c3cf66d74dc5b452141afbdf763e84a6c43b12c25da9a08482910d6d57ba3952aaf270d8cd5fd8b9d2dadf2d7d943ae2e1b067d68b71d2738d881aa0
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2021.02.19-r1.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2021.02.19-r1.ebuild
deleted file mode 100644
index d9ba9d3bedf3..000000000000
--- a/sys-devel/autoconf-archive/autoconf-archive-2021.02.19-r1.ebuild
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-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 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-
-# File collisions. #540246
-RDEPEND="!=gnome-base/gnome-common-3.14.0-r0
- !>=gnome-base/gnome-common-3.14.0-r1[-autoconf-archive(+)]"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-2021.02.19-python310.patch
- "${FILESDIR}"/${PN}-2021.02.19-revert-ax_pthreads.patch
-)
diff --git a/sys-devel/autoconf-archive/autoconf-archive-2021.02.19.ebuild b/sys-devel/autoconf-archive/autoconf-archive-2021.02.19.ebuild
deleted file mode 100644
index 87b98f88cd12..000000000000
--- a/sys-devel/autoconf-archive/autoconf-archive-2021.02.19.ebuild
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-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 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE=""
-
-# File collisions. #540246
-RDEPEND="!=gnome-base/gnome-common-3.14.0-r0
- !>=gnome-base/gnome-common-3.14.0-r1[-autoconf-archive(+)]"
-DEPEND=""
diff --git a/sys-devel/autoconf-archive/files/autoconf-archive-2021.02.19-python310.patch b/sys-devel/autoconf-archive/files/autoconf-archive-2021.02.19-python310.patch
deleted file mode 100644
index d76605eb5c1d..000000000000
--- a/sys-devel/autoconf-archive/files/autoconf-archive-2021.02.19-python310.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Ensure configure tests don't fail with Python 3.10, 3.11.
-
-https://github.com/autoconf-archive/autoconf-archive/pull/235
-
-From: Yaakov Selkowitz <yselkowi@redhat.com>
-Date: Thu, 5 Aug 2021 11:12:47 -0400
-Subject: [PATCH 1/2] AX_PYTHON_DEVEL: fix for Python 3.10+
-
---- a/m4/ax_python_devel.m4
-+++ b/m4/ax_python_devel.m4
-@@ -208,7 +208,7 @@ EOD`
- ac_python_version=$PYTHON_VERSION
- else
- ac_python_version=`$PYTHON -c "import sys; \
-- print (sys.version[[:3]])"`
-+ print ("%d.%d" % sys.version_info[[:2]])"`
- fi
- fi
-
-
-From: Yaakov Selkowitz <yselkowi@redhat.com>
-Date: Thu, 5 Aug 2021 11:27:24 -0400
-Subject: [PATCH 2/2] AX_PYTHON: Add 3.10 and 3.11
-
---- a/m4/ax_python.m4
-+++ b/m4/ax_python.m4
-@@ -55,7 +55,7 @@
- AC_DEFUN([AX_PYTHON],
- [AC_MSG_CHECKING(for python build information)
- AC_MSG_RESULT([])
--for python in python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
-+for python in python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
- AC_CHECK_PROGS(PYTHON_BIN, [$python])
- ax_python_bin=$PYTHON_BIN
- if test x$ax_python_bin != x; then
-
diff --git a/sys-devel/autoconf-archive/files/autoconf-archive-2021.02.19-revert-ax_pthreads.patch b/sys-devel/autoconf-archive/files/autoconf-archive-2021.02.19-revert-ax_pthreads.patch
deleted file mode 100644
index 3800fd292a6d..000000000000
--- a/sys-devel/autoconf-archive/files/autoconf-archive-2021.02.19-revert-ax_pthreads.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-This is an upstream revert which hasn't yet landed in a release.
-
-https://github.com/autoconf-archive/autoconf-archive/commit/59008cc7f85e1982eb298e1c424c2e6ad5942c4a
-https://github.com/autoconf-archive/autoconf-archive/pull/233
-https://github.com/autoconf-archive/autoconf-archive/commit/2567e0ce0f3a11b535c6b527386197fb49ff172b
-
-From: David Seifert <soap@gentoo.org>
-Date: Sat, 12 Jun 2021 22:29:03 +0200
-Subject: [PATCH] Revert "AX_PTHREAD: target > host"
-
-This reverts commit 2567e0ce0f3a11b535c6b527386197fb49ff172b.
-
-* `AC_CANONICAL_HOST` is the system on which the actual binary will run,
- `AC_CANONICAL_TARGET` is the system for which code is generated. The
- Autoconf manual even mentions that
-
- --target=target-type
- the type of system for which any compiler tools in the package produce code (**rarely needed**).
---- a/m4/ax_pthread.m4
-+++ b/m4/ax_pthread.m4
-@@ -87,11 +87,11 @@
- # modified version of the Autoconf Macro, you may extend this special
- # exception to the GPL to apply to your modified version as well.
-
--#serial 30
-+#serial 31
-
- AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
- AC_DEFUN([AX_PTHREAD], [
--AC_REQUIRE([AC_CANONICAL_TARGET])
-+AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_PROG_SED])
- AC_LANG_PUSH([C])
-@@ -158,7 +158,7 @@ ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --
- # --thread-safe: KAI C++
- # pthread-config: use pthread-config program (for GNU Pth library)
-
--case $target_os in
-+case $host_os in
-
- freebsd*)
-
-@@ -248,7 +248,7 @@ AS_IF([test "x$ax_pthread_clang" = "xyes"],
- # definitions is, on some systems, a strong hint that pthreads support is
- # correctly enabled
-
--case $target_os in
-+case $host_os in
- darwin* | hpux* | linux* | osf* | solaris*)
- ax_pthread_check_macro="_REENTRANT"
- ;;
-@@ -450,7 +450,7 @@ if test "x$ax_pthread_ok" = "xyes"; then
- AC_CACHE_CHECK([whether more special flags are required for pthreads],
- [ax_cv_PTHREAD_SPECIAL_FLAGS],
- [ax_cv_PTHREAD_SPECIAL_FLAGS=no
-- case $target_os in
-+ case $host_os in
- solaris*)
- ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
- ;;
-@@ -480,7 +480,7 @@ if test "x$ax_pthread_ok" = "xyes"; then
-
- # More AIX lossage: compile with *_r variant
- if test "x$GCC" != "xyes"; then
-- case $target_os in
-+ case $host_os in
- aix*)
- AS_CASE(["x/$CC"],
- [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
diff --git a/sys-devel/autoconf-wrapper/autoconf-wrapper-15.ebuild b/sys-devel/autoconf-wrapper/autoconf-wrapper-15.ebuild
deleted file mode 100644
index d960af4fa666..000000000000
--- a/sys-devel/autoconf-wrapper/autoconf-wrapper-15.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-DESCRIPTION="wrapper for autoconf to manage multiple autoconf versions"
-HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
-
-LICENSE="GPL-2"
-SLOT="0"
-[[ "${PV}" == *_pre* ]] || \
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-
-S="${WORKDIR}"
-
-src_install() {
- exeinto /usr/$(get_libdir)/misc
- newexe "${FILESDIR}"/ac-wrapper-${PV}.sh ac-wrapper.sh
-
- 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}
- done
-}
diff --git a/sys-devel/autoconf-wrapper/files/ac-wrapper-15.sh b/sys-devel/autoconf-wrapper/files/ac-wrapper-15.sh
deleted file mode 100644
index e5eda0e53f18..000000000000
--- a/sys-devel/autoconf-wrapper/files/ac-wrapper-15.sh
+++ /dev/null
@@ -1,203 +0,0 @@
-#!/bin/sh
-# Copyright 1999-2021 Gentoo Authors
-# 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.
-#
-if [ -z "${KNOWN_AUTOCONF}" ] ; then
- KNOWN_AUTOCONF="2.71:2.5 2.70:2.5 2.69:2.5"
-fi
-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 aclocal.m4 acinclude.m4 configure.in configure.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
deleted file mode 100644
index 73dda144f9ac..000000000000
--- a/sys-devel/autoconf-wrapper/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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
deleted file mode 100644
index 4d729262f261..000000000000
--- a/sys-devel/autoconf/Manifest
+++ /dev/null
@@ -1,5 +0,0 @@
-DIST autoconf-2.13.tar.gz 443844 BLAKE2B ade10f9d4a0b1a0e8b752eee817cfe100d77b074192b9892330402ddc5b62dda1a3485ce0c36e72191daa9fd49382b99851cb6aa3a13aca8cf2ae6e884638fb6 SHA512 602584f4c77b7a554aaa068eda5409b68eb0b3229e9c224bffb91c83c4314d25de15bd560a323626ff78f6df339c79e1ef8938c54b78ecadf4dc75c5241290ad
-DIST autoconf-2.64.tar.xz 1113892 BLAKE2B 598873209a67725150cd4cf09c4b78b26b3d1782f259846da48dc8106a1d32ae2b24f3a864c3be0e9e8dc7d6b6ca8781b83ff33a691c88e68391d1ea861ccf23 SHA512 ee4b504447c14a59b849d0915e55a90522cfb071d1583af2bd3575e5a05d7bd290e55e0e9d0760c8f36043f926199fc2d962b559d27d2f95c70d0e147b4ad0a3
-DIST autoconf-2.69-runstatedir_patches.tar.xz 257096 BLAKE2B ae765e0ca7fe8261117f6f6b75611c232fc3d4016c22c86346afa72f2b7e6c3b7ccc1f9dfe134b2443f8bde6d578b503d79cf88472f76ce75b6c2e843ef55b8e SHA512 55f93299fe5243151f6bb782986a7935270f06d5065929f4d365a37aba05703e3ce66ecf7981d30413db50ee6b4f77d81d10a71b539c8a366c5c5a156c5443da
-DIST autoconf-2.69.tar.xz 1214744 BLAKE2B 71d33d72a06e9a05fbed0eda73bc9d8a3805c7c90bf082959862f93f3c5f01192114176e84d84ecb58fa99512eafbc0ab21ad1407be18c8c63bb3dc1117c482d SHA512 995d3e5a8eb1eb37e2b7fae53c6ec7a9b4df997286b7d643344818f94636756b1bf5ff5ea9155e755cb9461149a853dfbf2886fc6bd7132e5afa9c168e306e9b
-DIST autoconf-2.71.tar.xz 1292296 BLAKE2B 7fd4b98b4cfff10720e8da6ee91045637991643b50fcb3e47a0ecfcc01600f7b7b36fd1c0a5f08b68a418f1bdbd8d5a98de1008157595dd37cc3a31facb61416 SHA512 73d32b4adcbe24e3bafa9f43f59ed3b6efbd3de0f194e5ec90375f35da1199c583f5d3e89139b7edbad35171403709270e339ffa56a2ecb9b3123e9285021ff0
diff --git a/sys-devel/autoconf/autoconf-2.13-r1.ebuild b/sys-devel/autoconf/autoconf-2.13-r1.ebuild
deleted file mode 100644
index 64ebbe280198..000000000000
--- a/sys-devel/autoconf/autoconf-2.13-r1.ebuild
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-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 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
-
-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
- "${FILESDIR}"/${PN}-2.13-perl-5.26.patch
-)
-
-src_configure() {
- # make sure configure is newer than configure.in
- touch configure || die
-
- # 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.
- ac_cv_path_M4="m4" \
- ac_cv_prog_AWK="awk" \
- LC_ALL=C \
- econf \
- --exec-prefix="${EPREFIX}"/usr \
- --bindir="${EPREFIX}"/usr/bin \
- --program-suffix="-${PV}"
-}
diff --git a/sys-devel/autoconf/autoconf-2.64-r1.ebuild b/sys-devel/autoconf/autoconf-2.64-r1.ebuild
deleted file mode 100644
index efed7086f51a..000000000000
--- a/sys-devel/autoconf/autoconf-2.64-r1.ebuild
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-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 ~riscv ~s390 sparc x86"
-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}"/${PN}-2.69-perl-5.26.patch
- "${FILESDIR}"/${PN}-2.69-perl-5.26-2.patch
-)
diff --git a/sys-devel/autoconf/autoconf-2.69-r5.ebuild b/sys-devel/autoconf/autoconf-2.69-r5.ebuild
deleted file mode 100644
index c85719fd173a..000000000000
--- a/sys-devel/autoconf/autoconf-2.69-r5.ebuild
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/autoconf.git"
- inherit git-r3
-else
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
- ftp://alpha.gnu.org/pub/gnu/${PN}/${P}.tar.xz
- https://dev.gentoo.org/~polynomial-c/dist/${P}-runstatedir_patches.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~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"
-
-BDEPEND=">=sys-devel/m4-1.4.16
- >=dev-lang/perl-5.6"
-RDEPEND="${BDEPEND}
- !~sys-devel/${P}:2.5
- >=sys-devel/autoconf-wrapper-13"
-[[ ${PV} == "9999" ]] && BDEPEND+=" >=sys-apps/texinfo-4.3"
-PDEPEND="emacs? ( app-emacs/autoconf-mode )"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-2.69-perl-5.26.patch
- "${FILESDIR}"/${P}-fix-libtool-test.patch
- "${FILESDIR}"/${PN}-2.69-perl-5.26-2.patch
- "${FILESDIR}"/${P}-make-tests-bash5-compatible.patch
-
- "${WORKDIR}"/patches/${P}-runstatedir.patch
- "${WORKDIR}"/patches/${P}-texinfo.patch
- "${WORKDIR}"/patches/${P}-runstatedir_info.patch
-)
-
-src_prepare() {
- # usr/bin/libtool is provided by binutils-apple, need gnu libtool
- if [[ ${CHOST} == *-darwin* ]] ; then
- PATCHES+=( "${FILESDIR}"/${PN}-2.61-darwin.patch )
- fi
-
- # Save timestamp to avoid later makeinfo call
- touch -r doc/{,old_}autoconf.texi || die
-
- toolchain-autoconf_src_prepare
-
- # Restore timestamp to avoid makeinfo call
- # We already have an up to date autoconf.info page at this point.
- touch -r doc/{old_,}autoconf.texi || die
-}
diff --git a/sys-devel/autoconf/autoconf-2.71-r1.ebuild b/sys-devel/autoconf/autoconf-2.71-r1.ebuild
deleted file mode 100644
index 2421cf85b368..000000000000
--- a/sys-devel/autoconf/autoconf-2.71-r1.ebuild
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/autoconf.git"
- inherit git-r3
-else
- # For _beta handling replace with real version number
- MY_PV="${PV}"
- MY_P="${PN}-${MY_PV}"
- #PATCH_TARBALL_NAME="${PN}-2.70-patches-01"
- SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz -> ${P}.tar.xz
- https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz -> ${P}.tar.xz"
- #SRC_URI+=" https://dev.gentoo.org/~polynomial-c/${PATCH_TARBALL_NAME}.tar.xz"
- [[ "${PV}" == *_beta* ]] || \
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
- S="${WORKDIR}/${MY_P}"
-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"
-
-BDEPEND=">=sys-devel/m4-1.4.16
- >=dev-lang/perl-5.6"
-RDEPEND="${BDEPEND}
- >=sys-devel/autoconf-wrapper-15
- sys-devel/gnuconfig
- !~sys-devel/${P}:2.5"
-[[ ${PV} == "9999" ]] && BDEPEND+=" >=sys-apps/texinfo-4.3"
-PDEPEND="emacs? ( app-emacs/autoconf-mode )"
-
-PATCHES=( "${FILESDIR}/${P}-time.patch" )
-
-src_prepare() {
- # usr/bin/libtool is provided by binutils-apple, need gnu libtool
- if [[ ${CHOST} == *-darwin* ]] ; then
- PATCHES+=( "${FILESDIR}"/${PN}-2.71-darwin.patch )
- fi
-
- # Save timestamp to avoid later makeinfo call
- touch -r doc/{,old_}autoconf.texi || die
-
- local pdir
- for pdir in "${WORKDIR}"/{upstream_,}patches ; do
- if [[ -d "${pdir}" ]] ; then
- eapply ${pdir}
- fi
- done
-
- toolchain-autoconf_src_prepare
-
- # Restore timestamp to avoid makeinfo call
- # We already have an up to date autoconf.info page at this point.
- touch -r doc/{old_,}autoconf.texi || die
-}
-
-src_test() {
- emake check
-}
-
-src_install() {
- toolchain-autoconf_src_install
-
- local f
- for f in config.{guess,sub} ; do
- ln -fs ../../gnuconfig/${f} \
- "${ED}"/usr/share/autoconf-*/build-aux/${f} || die
- done
-}
diff --git a/sys-devel/autoconf/autoconf-9999.ebuild b/sys-devel/autoconf/autoconf-9999.ebuild
deleted file mode 100644
index cb3d17704c68..000000000000
--- a/sys-devel/autoconf/autoconf-9999.ebuild
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/autoconf.git"
- 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 ~riscv ~s390 ~sparc ~x86 ~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"
-
-BDEPEND=">=sys-devel/m4-1.4.16
- >=dev-lang/perl-5.6"
-RDEPEND="${BDEPEND}
- >=sys-devel/autoconf-wrapper-14
- sys-devel/gnuconfig
- !~sys-devel/${P}:2.5"
-[[ ${PV} == "9999" ]] && BDEPEND+=" >=sys-apps/texinfo-4.3"
-PDEPEND="emacs? ( app-emacs/autoconf-mode )"
-
-src_prepare() {
- if [[ ${PV} == *9999 ]] ; then
- # 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 || die
-
- autoreconf -f -i || die
- fi
-
- toolchain-autoconf_src_prepare
-}
-
-src_test() {
- emake check
-}
-
-src_install() {
- default
-
- local f
- for f in config.{guess,sub} ; do
- ln -fs ../../gnuconfig/${f} \
- "${ED}"/usr/share/autoconf-*/build-aux/${f} || die
- done
-}
diff --git a/sys-devel/autoconf/files/autoconf-2.13-destdir.patch b/sys-devel/autoconf/files/autoconf-2.13-destdir.patch
deleted file mode 100644
index 47605af5f59c..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.13-destdir.patch
+++ /dev/null
@@ -1,26 +0,0 @@
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -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
deleted file mode 100644
index 44f09cba92f0..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.13-gentoo.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/configure
-+++ b/configure
-@@ -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
---- a/configure.in
-+++ b/configure.in
-@@ -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-perl-5.26.patch b/sys-devel/autoconf/files/autoconf-2.13-perl-5.26.patch
deleted file mode 100644
index 6fbc0cd1bc89..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.13-perl-5.26.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN autoconf-2.13.orig/autoscan.pl autoconf-2.13/autoscan.pl
---- autoconf-2.13.orig/autoscan.pl 1999-01-05 14:28:42.000000000 +0100
-+++ autoconf-2.13/autoscan.pl 2018-12-22 19:55:10.986732296 +0100
-@@ -232,7 +232,7 @@
- # Strip out comments and variable references.
- s/#.*//;
- s/\$\([^\)]*\)//g;
-- s/\${[^\}]*}//g;
-+ s/\$\{[^\}]*}//g;
- s/@[^@]*@//g;
-
- # Variable assignments.
diff --git a/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch b/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch
deleted file mode 100644
index b8a7e3b8ce99..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.13-test-fixes.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-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.61-darwin.patch b/sys-devel/autoconf/files/autoconf-2.61-darwin.patch
deleted file mode 100644
index 83f450e6f5af..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.61-darwin.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/bin/autoreconf.in
-+++ b/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.69-fix-libtool-test.patch b/sys-devel/autoconf/files/autoconf-2.69-fix-libtool-test.patch
deleted file mode 100644
index e75eba621606..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.69-fix-libtool-test.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-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-make-tests-bash5-compatible.patch b/sys-devel/autoconf/files/autoconf-2.69-make-tests-bash5-compatible.patch
deleted file mode 100644
index 1afcec15bb4f..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.69-make-tests-bash5-compatible.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 5b9db67786a428164abafe626ab11a2754aad528 Mon Sep 17 00:00:00 2001
-From: Ondrej Dubaj <odubaj@redhat.com>
-Date: Wed, 28 Aug 2019 07:39:50 +0200
-Subject: Port tests to Bash 5
-
-* tests/local.at (AT_CHECK_ENV, AT_CONFIG_CMP):
-Add BASH_ARGC, BASH_ARGV to list of variables to be ignored when
-comparing variable space dumps.
-(AT_CONFIG_CMP): Also ignore LINENO.
-* tests/m4sh.at: Also unset LINENO in 'reference' and 'test/test-1'.
----
- tests/local.at | 5 ++++-
- tests/m4sh.at | 4 ++--
- 2 files changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/tests/local.at b/tests/local.at
-index a22958c0..852be285 100644
---- a/tests/local.at
-+++ b/tests/local.at
-@@ -325,7 +325,7 @@ if test -f state-env.before && test -f state-env.after; then
- [AWK|LEX|LEXLIB|LEX_OUTPUT_ROOT|LN_S|M4|MKDIR_P|RANLIB|SET_MAKE|YACC],
- [GREP|[EF]GREP|SED],
- [[_@]|.[*#?$].],
-- [argv|ARGC|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS]))=' \
-+ [argv|ARGC|LINENO|BASH_ARGC|BASH_ARGV|OLDPWD|PIPESTATUS|RANDOM|SECONDS]))=' \
- $act_file ||
- test $? -eq 1 || echo failed >&2
- ) 2>stderr-$act_file |
-@@ -382,6 +382,9 @@ do
- /'\'\\\$\''=/ d
- /^argv=/ d
- /^ARGC=/ d
-+ /^BASH_ARGC=/ d
-+ /^BASH_ARGV=/ d
-+ /^LINENO=/ d
- ' $act_file >at_config_vars-$act_file
- done
- AT_CMP([at_config_vars-$1], [at_config_vars-$2])[]dnl
-diff --git a/tests/m4sh.at b/tests/m4sh.at
-index e9d70b02..cbdfcb62 100644
---- a/tests/m4sh.at
-+++ b/tests/m4sh.at
-@@ -254,7 +254,7 @@ AT_CHECK([autom4te -l m4sh $1.as -o $1])
- # `_oline_', once processed and ran, produces our reference.
- # We check that we find ourselves by looking at a string which is
- # available only in the original script: `_oline_'.
--AT_DATA_LINENO([reference], [false], [__OLINE__], [_oline__])
-+AT_DATA_LINENO([reference], [true], [__OLINE__], [_oline__])
- AT_CHECK([./reference], 0, [stdout])
-
- # The reference:
-@@ -264,7 +264,7 @@ mv stdout expout
- # Be sure to be out of the PATH.
- AT_CHECK([mkdir test || exit 77])
-
--AT_DATA_LINENO([test/test-1], [false], [__LINENO__], [LINENO])
-+AT_DATA_LINENO([test/test-1], [true], [__LINENO__], [LINENO])
- AT_CHECK([./test/test-1], 0, [expout])
- AT_CHECK([(PATH=test$PATH_SEPARATOR$PATH; export PATH; exec test-1)],
- 0, [expout])
---
-cgit v1.2.1
-
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
deleted file mode 100644
index 6becf807c43e..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.69-perl-5.26-2.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-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
deleted file mode 100644
index b3d7888ca722..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.69-perl-5.26.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-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/files/autoconf-2.71-darwin.patch b/sys-devel/autoconf/files/autoconf-2.71-darwin.patch
deleted file mode 100644
index c122aee4b22d..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.71-darwin.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/bin/autoreconf.in
-+++ b/bin/autoreconf.in
-@@ -122,7 +122,7 @@
- my $autom4te = $ENV{'AUTOM4TE'} || '@bindir@/@autom4te-name@';
- my $automake = $ENV{'AUTOMAKE'} || 'automake';
- my $aclocal = $ENV{'ACLOCAL'} || 'aclocal';
--my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
-+my $libtoolize = $ENV{'LIBTOOLIZE'} || 'glibtoolize';
- my $intltoolize = $ENV{'INTLTOOLIZE'} || 'intltoolize';
- my $gtkdocize = $ENV{'GTKDOCIZE'} || 'gtkdocize';
- my $autopoint = $ENV{'AUTOPOINT'} || 'autopoint';
diff --git a/sys-devel/autoconf/files/autoconf-2.71-time.patch b/sys-devel/autoconf/files/autoconf-2.71-time.patch
deleted file mode 100644
index 8ecfe10f40a3..000000000000
--- a/sys-devel/autoconf/files/autoconf-2.71-time.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From e194b3c7e00429612a9d40e78ea571687fd25b91 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Andreas=20K=2E=20H=C3=BCttel?= <dilfridge@gentoo.org>
-Date: Sun, 1 Aug 2021 19:07:48 +0200
-Subject: [PATCH] Use stat from Time::HiRes (instead of File::stat)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
----
- lib/Autom4te/FileUtils.pm | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/lib/Autom4te/FileUtils.pm b/lib/Autom4te/FileUtils.pm
-index a182031b..27a5fd91 100644
---- a/lib/Autom4te/FileUtils.pm
-+++ b/lib/Autom4te/FileUtils.pm
-@@ -34,12 +34,12 @@ This perl module provides various general purpose file handling functions.
-
- =cut
-
--use 5.006;
-+use 5.008;
- use strict;
- use warnings FATAL => 'all';
-
- use Exporter;
--use File::stat;
-+use Time::HiRes qw(stat);
- use IO::File;
-
- use Autom4te::Channels;
-@@ -115,10 +115,11 @@ sub mtime ($)
- return 0
- if $file eq '-' || ! -f $file;
-
-- my $stat = stat ($file)
-+ my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
-+ $atime,$mtime,$ctime,$blksize,$blocks) = stat ($file)
- or fatal "cannot stat $file: $!";
-
-- return $stat->mtime;
-+ return $mtime;
- }
-
-
---
-2.31.1
-
diff --git a/sys-devel/autoconf/metadata.xml b/sys-devel/autoconf/metadata.xml
deleted file mode 100644
index 73dda144f9ac..000000000000
--- a/sys-devel/autoconf/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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/autogen-5.18.16-r3.ebuild b/sys-devel/autogen/autogen-5.18.16-r3.ebuild
new file mode 100644
index 000000000000..e908a1837ef5
--- /dev/null
+++ b/sys-devel/autogen/autogen-5.18.16-r3.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic autotools 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
+ https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/verify.h;h=3b57ddee0acffd23cc51bc8910a15cf879f90619;hb=537a5511ab0b1326e69b32f87593a50aedb8a589 -> ${P}-gnulib-3b57ddee0acffd23cc51bc8910a15cf879f90619-lib-verify.h
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+IUSE="libopts static-libs"
+
+RDEPEND="
+ >=dev-scheme/guile-2.0:=
+ dev-libs/libxml2
+"
+DEPEND="${RDEPEND}"
+# TODO: investigate & drop this!
+BDEPEND="sys-apps/which"
+
+# We don't pass the flag explicitly, bug #796776.
+# Let's fix it upstream after next autogen release if it happens.
+QA_CONFIGURE_OPTIONS+=" --enable-snprintfv-convenience"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.18.16-no-werror.patch
+ "${FILESDIR}"/${PN}-5.18.16-rpath.patch
+ "${FILESDIR}"/${PN}-5.18.16-respect-TMPDIR.patch
+ "${FILESDIR}"/${PN}-5.18.16-make-4.3.patch
+ "${FILESDIR}"/${PN}-5.18.16-guile-3.patch
+ "${FILESDIR}"/${PN}-5.18.16-configure-c99.patch
+ "${FILESDIR}"/${PN}-5.18.16-FORTIFY_SOURCE.patch
+)
+
+src_prepare() {
+ default
+
+ # missing tarball file
+ cp "${DISTDIR}"/${P}-gnulib-3b57ddee0acffd23cc51bc8910a15cf879f90619-lib-verify.h autoopts/verify.h || die
+
+ # May be able to drop this on next release (>5.18.16)
+ eautoreconf
+}
+
+src_configure() {
+ # suppress possibly incorrect -R flag
+ export ag_cv_test_ldflags=
+
+ # autogen requires run-time sanity of regex and string functions.
+ # Use defaults of linux-glibc until we need somethig more advanced.
+ if tc-is-cross-compiler ; then
+ export ag_cv_run_strcspn=no
+ export libopts_cv_with_libregex=yes
+ fi
+
+ # bug 920174
+ use elibc_musl && append-cppflags -D_LARGEFILE64_SOURCE
+
+ econf $(use_enable static-libs static)
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -delete || die
+
+ if ! use libopts ; then
+ rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
+ fi
+}
diff --git a/sys-devel/autogen/autogen-5.18.16-r1.ebuild b/sys-devel/autogen/autogen-5.18.16-r4.ebuild
index a9abb0ce9185..d767e53a32bf 100644
--- a/sys-devel/autogen/autogen-5.18.16-r1.ebuild
+++ b/sys-devel/autogen/autogen-5.18.16-r4.ebuild
@@ -1,22 +1,26 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-inherit toolchain-funcs
+inherit flag-o-matic autotools 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
- https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/verify.h;h=3b57ddee0acffd23cc51bc8910a15cf879f90619;hb=537a5511ab0b1326e69b32f87593a50aedb8a589 -> ${P}-gnulib-3b57ddee0acffd23cc51bc8910a15cf879f90619-lib-verify.h"
+SRC_URI="
+ mirror://gnu/${PN}/rel${PV}/${P}.tar.xz
+ https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=lib/verify.h;h=3b57ddee0acffd23cc51bc8910a15cf879f90619;hb=537a5511ab0b1326e69b32f87593a50aedb8a589 -> ${P}-gnulib-3b57ddee0acffd23cc51bc8910a15cf879f90619-lib-verify.h
+"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
IUSE="libopts static-libs"
-RDEPEND=">=dev-scheme/guile-2.0:=
- dev-libs/libxml2"
+RDEPEND="
+ >=dev-scheme/guile-2.0:=
+ dev-libs/libxml2
+"
DEPEND="${RDEPEND}"
# We don't pass the flag explicitly, bug #796776.
@@ -29,21 +33,19 @@ PATCHES=(
"${FILESDIR}"/${PN}-5.18.16-respect-TMPDIR.patch
"${FILESDIR}"/${PN}-5.18.16-make-4.3.patch
"${FILESDIR}"/${PN}-5.18.16-guile-3.patch
+ "${FILESDIR}"/${PN}-5.18.16-configure-c99.patch
+ "${FILESDIR}"/${PN}-5.18.16-FORTIFY_SOURCE.patch
+ "${FILESDIR}"/${PN}-5.18.16-no-which.patch
)
src_prepare() {
- # no-werror.patch fixes both configure{.ac,}
- # avoid configure echeck
- touch -r configure.ac orig.configure.ac || die
- touch -r configure orig.configure || die
-
default
- touch -r orig.configure.ac configure.ac || die
- touch -r orig.configure configure || die
-
# missing tarball file
cp "${DISTDIR}"/${P}-gnulib-3b57ddee0acffd23cc51bc8910a15cf879f90619-lib-verify.h autoopts/verify.h || die
+
+ # May be able to drop this on next release (>5.18.16)
+ eautoreconf
}
src_configure() {
@@ -57,12 +59,16 @@ src_configure() {
export libopts_cv_with_libregex=yes
fi
+ # bug 920174
+ use elibc_musl && append-cppflags -D_LARGEFILE64_SOURCE
+
econf $(use_enable static-libs static)
}
src_install() {
default
- find "${D}" -name '*.la' -delete || die
+
+ find "${ED}" -name '*.la' -delete || die
if ! use libopts ; then
rm "${ED}"/usr/share/autogen/libopts-*.tar.gz || die
diff --git a/sys-devel/autogen/files/autogen-5.18.16-FORTIFY_SOURCE.patch b/sys-devel/autogen/files/autogen-5.18.16-FORTIFY_SOURCE.patch
new file mode 100644
index 000000000000..b8108c1c0ed1
--- /dev/null
+++ b/sys-devel/autogen/files/autogen-5.18.16-FORTIFY_SOURCE.patch
@@ -0,0 +1,100 @@
+https://bugs.gentoo.org/889394
+https://sourceforge.net/p/autogen/bugs/212/
+https://bugzilla.redhat.com/2173623
+https://siddhesh.in/posts/that-is-not-a-number-that-is-a-freed-object.html
+https://gcc.gnu.org/PR105217
+https://src.fedoraproject.org/rpms/autogen/blob/684b717191dd8bcd4e01a7775e62d50bc41b8ccb/f/autogen-fortify.patch
+
+commit 772b282a4e858a27af610bcdcc8b66925cbf1a83
+Author: Tomas Korbar <tkorbar@redhat.com>
+Date: Tue Feb 28 16:08:13 2023 +0100
+
+ avoid GCC code analysis bug
+
+--- a/agen5/defLoad.c
++++ b/agen5/defLoad.c
+@@ -448,17 +448,28 @@ read_defs(void)
+ FILE * fp;
+ def_input_mode_t in_mode = ready_def_input(&def_fname, &data_sz);
+
++ /*
++ * "ready_def_input" has a lot of side effects. It's possible that
++ * there are no definitions, so "in_mode" is set to DONE and there's
++ * nothing to do.
++ */
+ if (in_mode == INPUT_DONE)
+ return;
+
+ /*
+ * Allocate the space we need for our definitions.
++ * "data_sz" was set by read_def_input to the size of the
++ * definitions file (or 4096 if we're reading from a fifo file).
++ * In that alternate case, we'll start the input size at 4096 bytes.
++ * The allocation includes space for context and a NUL byte or two
+ */
+- rem_sz = data_sz+4+sizeof(*base_ctx);
+- base_ctx = (scan_ctx_t *)AGALOC(rem_sz, "file buf");
+- memset(VOIDP(base_ctx), 0, rem_sz);
++ {
++ size_t sz = data_sz + sizeof(long) + sizeof(*base_ctx);
++ base_ctx = (scan_ctx_t *)AGALOC(sz, "file buf");
++ memset(VOIDP(base_ctx), 0, sz);
++ }
+ base_ctx->scx_line = 1;
+- rem_sz = data_sz;
++ rem_sz = data_sz; // size available for storing def text
+
+ /*
+ * Our base context will have its currency pointer set to this
+@@ -482,6 +493,9 @@ read_defs(void)
+ if (fp == NULL)
+ AG_CANT(READ_DEF_OPEN, def_fname);
+
++ /*
++ * If we're emitting dependency information, then do so.
++ */
+ if (dep_fp != NULL)
+ add_source_file(def_fname);
+ }
+@@ -516,8 +530,7 @@ read_defs(void)
+ * See if there is any space left
+ */
+ if (rem_sz == 0) {
+- scan_ctx_t * p;
+- off_t dataOff;
++ off_t scan_off;
+
+ /*
+ * IF it is a regular file, then we are done
+@@ -527,24 +540,16 @@ read_defs(void)
+
+ /*
+ * We have more data and we are out of space.
+- * Try to reallocate our input buffer.
++ * AGREALOC will succeed or not return.
+ */
+ data_sz += (rem_sz = 0x1000);
+- dataOff = data - base_ctx->scx_data;
+- p = AGREALOC(VOIDP(base_ctx), data_sz + 4 + sizeof(*base_ctx),
+- "expand f buf");
++ scan_off = data - base_ctx->scx_data;
++ base_ctx = AGREALOC(VOIDP(base_ctx), data_sz + 4 + sizeof(*base_ctx),
++ "expand f buf");
+
+- /*
+- * The buffer may have moved. Set the data pointer at an
+- * offset within the new buffer and make sure our base pointer
+- * has been corrected as well.
+- */
+- if (p != base_ctx) {
+- p->scx_scan = \
+- p->scx_data = (char *)(p + 1);
+- data = p->scx_data + dataOff;
+- base_ctx = p;
+- }
++ base_ctx->scx_scan = \
++ base_ctx->scx_data = (char *)(base_ctx + 1);
++ data = base_ctx->scx_data + scan_off;
+ }
+ }
+
diff --git a/sys-devel/autogen/files/autogen-5.18.16-configure-c99.patch b/sys-devel/autogen/files/autogen-5.18.16-configure-c99.patch
new file mode 100644
index 000000000000..75e2e760a792
--- /dev/null
+++ b/sys-devel/autogen/files/autogen-5.18.16-configure-c99.patch
@@ -0,0 +1,42 @@
+https://bugs.gentoo.org/898590
+https://src.fedoraproject.org/rpms/autogen/c/7d157d98e73dcd1602111309a690643faa80e207?branch=rawhide
+--- a/config/ag_macros.m4
++++ b/config/ag_macros.m4
+@@ -113,7 +113,7 @@ AC_DEFUN([INVOKE_AG_MACROS_LAST],[
+ fi
+
+ AC_CACHE_CHECK([for static inline], [snv_cv_static_inline], [
+- AC_TRY_COMPILE([static inline foo(bar) int bar; { return bar; }],
++ AC_TRY_COMPILE([static inline int foo(bar) int bar; { return bar; }],
+ [return foo(0);],
+ [snv_cv_static_inline='static inline'],
+ [snv_cv_static_inline='static'])
+@@ -428,7 +428,7 @@ int main (int argc, char ** argv) {
+ char zRej@<:@@:>@ = reject;
+ char zAcc@<:@@:>@ = "a-ok-eject";
+ return strcspn( zAcc, zRej ) - 5;
+-}] )]
++}] )],
+ [ag_cv_run_strcspn=yes],[ag_cv_run_strcspn=no],[ag_cv_run_strcspn=no]
+ ) # end of RUN_IFELSE
+ ]) # end of AC_CACHE_VAL for ag_cv_run_strcspn
+--- a/configure
++++ b/configure
+@@ -17338,7 +17338,7 @@ int main (int argc, char ** argv) {
+ char zAcc[] = "a-ok-eject";
+ return strcspn( zAcc, zRej ) - 5;
+ }
+- ag_cv_run_strcspn=yes
++#error
+ _ACEOF
+ if ac_fn_c_try_run "$LINENO"; then :
+ ag_cv_run_strcspn=no
+@@ -18406,7 +18405,7 @@ else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-static inline foo(bar) int bar; { return bar; }
++static inline int foo(bar) int bar; { return bar; }
+ int
+ main ()
+ {
diff --git a/sys-devel/autogen/files/autogen-5.18.16-no-which.patch b/sys-devel/autogen/files/autogen-5.18.16-no-which.patch
new file mode 100644
index 000000000000..c4b462cba420
--- /dev/null
+++ b/sys-devel/autogen/files/autogen-5.18.16-no-which.patch
@@ -0,0 +1,15 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -149,9 +149,9 @@ GDnam=getdefs${ac_exeext}
+ CLnam=columns${ac_exeext}
+ if test "X$cross_compiling" = Xyes
+ then
+- AGexe=`which ${AGnam}`
+- GDexe=`which ${GDnam}`
+- CLexe=`which ${CLnam}`
++ AGexe=`command -v ${AGnam}`
++ GDexe=`command -v ${GDnam}`
++ CLexe=`command -v ${CLnam}`
+ else
+ AGexe=${ag_top_builddir}/agen5/${AGnam}
+ GDexe=${ag_top_builddir}/getdefs/${GDnam}
diff --git a/sys-devel/autogen/metadata.xml b/sys-devel/autogen/metadata.xml
index ab5727db0a55..8f3ef98f5bc0 100644
--- a/sys-devel/autogen/metadata.xml
+++ b/sys-devel/autogen/metadata.xml
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://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>
+ <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>
+ <upstream>
+ <remote-id type="savannah">autogen</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/automake-wrapper/automake-wrapper-11.ebuild b/sys-devel/automake-wrapper/automake-wrapper-11.ebuild
deleted file mode 100644
index 1516e27afb7d..000000000000
--- a/sys-devel/automake-wrapper/automake-wrapper-11.ebuild
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-DESCRIPTION="wrapper for automake to manage multiple automake versions"
-HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
-SRC_URI=""
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE=""
-
-S=${WORKDIR}
-
-src_unpack() {
- cp "${FILESDIR}"/am-wrapper-${PV}.sh "${S}"/ || die
-}
-
-src_prepare() {
- default
-
- # 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-11.sh b/sys-devel/automake-wrapper/files/am-wrapper-11.sh
deleted file mode 100644
index 290762680d22..000000000000
--- a/sys-devel/automake-wrapper/files/am-wrapper-11.sh
+++ /dev/null
@@ -1,186 +0,0 @@
-#!/bin/sh
-# Copyright 1999-2018 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="16"
-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
deleted file mode 100644
index 73dda144f9ac..000000000000
--- a/sys-devel/automake-wrapper/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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
deleted file mode 100644
index e5df40b3adb2..000000000000
--- a/sys-devel/automake/Manifest
+++ /dev/null
@@ -1,6 +0,0 @@
-DIST automake-1.11.6.tar.xz 1092908 BLAKE2B 17254d81d6920c32aa877b6c892025de8e4060b8bcbe50fff841ada513dd462ddde8fc6838b4976098a812f8fda047e7186cb62cea8175df615dde75a9959144 SHA512 6e4cdf69f07734954f770fd4a7211a8c9dc69fe25a7746bd3c1e01d3139c94cab2900399e87371548833e99687e0d2b59c5e746ab2fdfbc7d47f2c1d439137ba
-DIST automake-1.13.4.tar.xz 1449608 BLAKE2B 03dee42d65362a6f36e81c83d516c85faba1aac59bdc0d941077fde9be7742da0f57b48d678169e7a0e8b652c3ef46c314cdd3efb0fc489c389852fed1c39a02 SHA512 c9b145c1b822a4d83f2899f4280a76ccae932301b273f4c9718dc7f53161aa03dc1be2c1fb1a61083c54186e1908ae2c8284250aa1d8f6dea484767aca1344d3
-DIST automake-1.15.1.tar.xz 1509496 BLAKE2B e6ade31089f969140472004cd9854318470228c64e4f8e829d48c5379f62d2c5f8ef9509131c577653e81868d94544ecf6520f86b5d582ebb6ed65c832039f30 SHA512 02f661b2676f1d44334ce1c7188f9913a6874bf46ba487708ad8090ad57905f14aead80fefed815e21effacfbb925e23b944ea7dd32563dca39c1a4174eda688
-DIST automake-1.16.3.tar.xz 1590708 BLAKE2B ab6001a1b09e171ec83bac07155a77ab0fc29f5185116616aa3080b27e8bbf759472cd0dfb75630b26f7ad8d0741e668662d00b370ef79cf5ef6c62e945c94da SHA512 7265aeb7f82a8a205761d76e6ade7b7e97831c283349fd80f86e511f4b0b3e17f429d1506fca84c76079f63781e5dbf5ca81455d6bf6cda27d2e5c3d23b0d1aa
-DIST automake-1.16.4.tar.xz 1599336 BLAKE2B a74bb444e7074e7dd7cf920a94a86756a5e6dec24a9eeb669ee629a1d3ab667efef0005d488fe6d9d8b33a680ada54f098ca334b63da4a739b0fec7c630a65aa SHA512 5a8883657e73b75bfa1ee59ab04af6bf4d43f390ab62fb7a9e8e2ac66159dfe4947b2ac7bc1028afffe6a09d88f388339500e03f6cdfa1226985be45ec033246
-DIST automake-1.16.5.tar.xz 1601740 BLAKE2B 87408abc57e1d4317a2b518fb3606d0f6d156522e7333016dd84747cd8922f27ef7fcc93220b11f794ce52bf8fd9a788d0166a4d1964d7c283905f269977ac7c SHA512 3084ae543aa3fb5a05104ffb2e66cfa9a53080f2343c44809707fd648516869511500dba50dae67ff10f92a1bf3b5a92b2a0fa01cda30adb69b9da03994d9d88
diff --git a/sys-devel/automake/automake-1.11.6-r3.ebuild b/sys-devel/automake/automake-1.11.6-r3.ebuild
deleted file mode 100644
index 8b96c4f83141..000000000000
--- a/sys-devel/automake/automake-1.11.6-r3.ebuild
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-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 ~riscv ~s390 sparc x86"
-IUSE=""
-RESTRICT="test"
-
-RDEPEND="dev-lang/perl
- >=sys-devel/automake-wrapper-10
- >=sys-devel/autoconf-2.69:*
- sys-devel/gnuconfig"
-DEPEND="${RDEPEND}
- sys-apps/help2man"
-BDEPEND="app-arch/gzip"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-1.10-perl-5.16.patch #424453
- "${FILESDIR}"/${PN}-1.11-install-sh-avoid-low-risk-race-in-tmp.patch
- "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket-r1.patch
-)
-
-src_prepare() {
- default
- export WANT_AUTOCONF=2.5
- export HELP2MAN=true
- sed -i -e "/APIVERSION=/s:=.*:=${SLOT}:" configure || die
- export TZ="UTC" #589138
-}
-
-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 || die
- rm -f dir || die
-
- # 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/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
-
- # Avoid QA message about pre-compressed file in docs
- local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz"
- if [[ -f "${tarfile}" ]] ; then
- gunzip "${tarfile}" || die
- fi
-}
diff --git a/sys-devel/automake/automake-1.13.4-r2.ebuild b/sys-devel/automake/automake-1.13.4-r2.ebuild
deleted file mode 100644
index 286477158c2a..000000000000
--- a/sys-devel/automake/automake-1.13.4-r2.ebuild
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-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 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE=""
-RESTRICT="test"
-
-RDEPEND="dev-lang/perl
- >=sys-devel/automake-wrapper-10
- >=sys-devel/autoconf-2.69:*
- sys-devel/gnuconfig"
-DEPEND="${RDEPEND}
- sys-apps/help2man"
-BDEPEND="app-arch/gzip"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-1.13-dyn-ithreads.patch
- "${FILESDIR}"/${PN}-1.13-perl-escape-curly-bracket-r1.patch
- "${FILESDIR}"/${PN}-1.13-hash-order-workaround.patch
- "${FILESDIR}"/${PN}-1.14-install-sh-avoid-low-risk-race-in-tmp.patch
-)
-
-src_prepare() {
- default
- export WANT_AUTOCONF=2.5
- 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 || die
-
- # 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
-
- # Avoid QA message about pre-compressed file in docs
- local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz"
- if [[ -f "${tarfile}" ]] ; then
- gunzip "${tarfile}" || die
- fi
-}
diff --git a/sys-devel/automake/automake-1.15.1-r2.ebuild b/sys-devel/automake/automake-1.15.1-r2.ebuild
deleted file mode 100644
index 61626303e82b..000000000000
--- a/sys-devel/automake/automake-1.15.1-r2.ebuild
+++ /dev/null
@@ -1,111 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git"
-
- inherit git-r3
-else
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
- if [[ ${PV/_beta} == ${PV} ]]; then
- MY_P=${P}
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
- https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
- else
- MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b"
- MY_P="${PN}-${MY_PV}"
-
- # Alpha/beta releases are not distributed on the usual mirrors.
- SRC_URI="https://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=""
-RESTRICT="test"
-
-RDEPEND="dev-lang/perl
- >=sys-devel/automake-wrapper-10
- >=sys-devel/autoconf-2.69:*
- sys-devel/gnuconfig"
-DEPEND="${RDEPEND}
- sys-apps/help2man"
-BDEPEND="app-arch/gzip"
-
-PATCHES=( "${FILESDIR}"/${PN}-1.15-install-sh-avoid-low-risk-race-in-tmp.patch )
-
-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
-
- # Bug 628912
- if ! has_version sys-apps/texinfo ; then
- touch doc/{stamp-vti,version.texi,automake.info} || die
- fi
-}
-
-# 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 || die
-
- # 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
-
- # Avoid QA message about pre-compressed file in docs
- local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz"
- if [[ -f "${tarfile}" ]] ; then
- gunzip "${tarfile}" || die
- fi
-}
diff --git a/sys-devel/automake/automake-1.16.3-r1.ebuild b/sys-devel/automake/automake-1.16.3-r1.ebuild
deleted file mode 100644
index 6908170eb07b..000000000000
--- a/sys-devel/automake/automake-1.16.3-r1.ebuild
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_{8,9,10} )
-
-inherit python-any-r1
-
-if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git"
-
- inherit git-r3
-else
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
- if [[ ${PV/_beta} == ${PV} ]]; then
- MY_P="${P}"
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
- https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
- else
- MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b"
- MY_P="${PN}-${MY_PV}"
-
- # Alpha/beta releases are not distributed on the usual mirrors.
- SRC_URI="https://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="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="dev-lang/perl
- >=sys-devel/automake-wrapper-11
- >=sys-devel/autoconf-2.69:*
- sys-devel/gnuconfig"
-DEPEND="${RDEPEND}"
-BDEPEND="
- app-arch/gzip
- sys-apps/help2man
- test? ( ${PYTHON_DEPS} )
-"
-
-PATCHES=(
- "${FILESDIR}"/automake-1.16.2-py3-compile.patch
- "${FILESDIR}"/automake-1.16.2-fix-instmany-python.sh-test.patch
- "${FILESDIR}"/automake-1.16.2-fix-py-compile-basedir.sh-test.patch
-)
-
-pkg_setup() {
- # Avoid python-any-r1_pkg_setup
- :
-}
-
-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
-
- # Bug 628912
- if ! has_version sys-apps/texinfo ; then
- touch doc/{stamp-vti,version.texi,automake.info} || die
- fi
-}
-
-src_configure() {
- use test && python_setup
- default
-}
-
-# 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
-
- # 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
-
- # Avoid QA message about pre-compressed file in docs
- local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz"
- if [[ -f "${tarfile}" ]] ; then
- gunzip "${tarfile}" || die
- fi
-}
diff --git a/sys-devel/automake/automake-1.16.4.ebuild b/sys-devel/automake/automake-1.16.4.ebuild
deleted file mode 100644
index 6908170eb07b..000000000000
--- a/sys-devel/automake/automake-1.16.4.ebuild
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_{8,9,10} )
-
-inherit python-any-r1
-
-if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git"
-
- inherit git-r3
-else
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
- if [[ ${PV/_beta} == ${PV} ]]; then
- MY_P="${P}"
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
- https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
- else
- MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b"
- MY_P="${PN}-${MY_PV}"
-
- # Alpha/beta releases are not distributed on the usual mirrors.
- SRC_URI="https://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="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="dev-lang/perl
- >=sys-devel/automake-wrapper-11
- >=sys-devel/autoconf-2.69:*
- sys-devel/gnuconfig"
-DEPEND="${RDEPEND}"
-BDEPEND="
- app-arch/gzip
- sys-apps/help2man
- test? ( ${PYTHON_DEPS} )
-"
-
-PATCHES=(
- "${FILESDIR}"/automake-1.16.2-py3-compile.patch
- "${FILESDIR}"/automake-1.16.2-fix-instmany-python.sh-test.patch
- "${FILESDIR}"/automake-1.16.2-fix-py-compile-basedir.sh-test.patch
-)
-
-pkg_setup() {
- # Avoid python-any-r1_pkg_setup
- :
-}
-
-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
-
- # Bug 628912
- if ! has_version sys-apps/texinfo ; then
- touch doc/{stamp-vti,version.texi,automake.info} || die
- fi
-}
-
-src_configure() {
- use test && python_setup
- default
-}
-
-# 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
-
- # 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
-
- # Avoid QA message about pre-compressed file in docs
- local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz"
- if [[ -f "${tarfile}" ]] ; then
- gunzip "${tarfile}" || die
- fi
-}
diff --git a/sys-devel/automake/automake-1.16.5.ebuild b/sys-devel/automake/automake-1.16.5.ebuild
deleted file mode 100644
index a9dc19ef2b08..000000000000
--- a/sys-devel/automake/automake-1.16.5.ebuild
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_{8,9,10} )
-
-inherit python-any-r1
-
-if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git"
-
- inherit git-r3
-else
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
- if [[ ${PV/_beta} == ${PV} ]]; then
- MY_P="${P}"
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
- https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
- else
- MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b"
- MY_P="${PN}-${MY_PV}"
-
- # Alpha/beta releases are not distributed on the usual mirrors.
- SRC_URI="https://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="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="dev-lang/perl
- >=sys-devel/automake-wrapper-11
- >=sys-devel/autoconf-2.69:*
- sys-devel/gnuconfig"
-DEPEND="${RDEPEND}"
-BDEPEND="
- app-arch/gzip
- sys-apps/help2man
- test? ( ${PYTHON_DEPS} )
-"
-
-PATCHES=(
- "${FILESDIR}"/automake-1.16.2-py3-compile.patch
- "${FILESDIR}"/automake-1.16.2-fix-instmany-python.sh-test.patch
- "${FILESDIR}"/automake-1.16.2-fix-py-compile-basedir.sh-test.patch
-)
-
-pkg_setup() {
- # Avoid python-any-r1_pkg_setup
- :
-}
-
-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
-
- # Bug 628912
- if ! has_version sys-apps/texinfo ; then
- touch doc/{stamp-vti,version.texi,automake.info} || die
- fi
-}
-
-src_configure() {
- use test && python_setup
- default
-}
-
-# 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
-
- # 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
-
- # Avoid QA message about pre-compressed file in docs
- local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz"
- if [[ -f "${tarfile}" ]] ; then
- gunzip "${tarfile}" || die
- fi
-}
diff --git a/sys-devel/automake/automake-9999.ebuild b/sys-devel/automake/automake-9999.ebuild
deleted file mode 100644
index d5f464992b96..000000000000
--- a/sys-devel/automake/automake-9999.ebuild
+++ /dev/null
@@ -1,130 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8,9,10} )
-
-inherit python-any-r1
-
-if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/r/${PN}.git"
- inherit git-r3
-else
- if [[ ${PV/_beta} == ${PV} ]]; then
- MY_P="${P}"
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
- https://alpha.gnu.org/pub/gnu/${PN}/${MY_P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
- else
- MY_PV="$(ver_cut 1).$(($(ver_cut 2)-1))b"
- MY_P="${PN}-${MY_PV}"
-
- # Alpha/beta releases are not distributed on the usual mirrors.
- SRC_URI="https://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="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="dev-lang/perl
- >=sys-devel/automake-wrapper-11
- >=sys-devel/autoconf-2.69:*
- sys-devel/gnuconfig"
-DEPEND="${RDEPEND}"
-BDEPEND="
- app-arch/gzip
- sys-apps/help2man
- test? ( ${PYTHON_DEPS} )
-"
-
-PATCHES=(
- "${FILESDIR}"/automake-1.16.2-py3-compile.patch
-)
-# All patches have been submitted upstream.
-
-pkg_setup() {
- # Avoid python-any-r1_pkg_setup
- :
-}
-
-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
-
- # Bug 628912
- if ! has_version sys-apps/texinfo ; then
- touch doc/{stamp-vti,version.texi,automake.info} || die
- fi
-}
-
-src_configure() {
- use test && python_setup
- default
-}
-
-# 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
-
- # 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
-
- # Avoid QA message about pre-compressed file in docs
- local tarfile="${ED}/usr/share/doc/${PF}/amhello-1.0.tar.gz"
- if [[ -f "${tarfile}" ]] ; then
- gunzip "${tarfile}" || die
- fi
-}
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
deleted file mode 100644
index 19fe249e0c00..000000000000
--- a/sys-devel/automake/files/automake-1.10-perl-5.16.patch
+++ /dev/null
@@ -1,128 +0,0 @@
-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.11-install-sh-avoid-low-risk-race-in-tmp.patch b/sys-devel/automake/files/automake-1.11-install-sh-avoid-low-risk-race-in-tmp.patch
deleted file mode 100644
index c435b9004f8d..000000000000
--- a/sys-devel/automake/files/automake-1.11-install-sh-avoid-low-risk-race-in-tmp.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Pavel Raiskup <praiskup@redhat.com>
-Date: Sat, 15 Aug 2015 04:40:57 -0400
-Subject: install-sh: avoid (low risk) race in /tmp
-
-Ensure that nobody can cross privilege boundaries by pre-creating
-symlink on '$tmpdir' path.
-
-Just testing 'mkdir -p' by creating '/tmp/ins$RANDOM-$$/d' is not
-safe because '/tmp' directory is usually world-writeable and
-'/tmp/ins$RANDOM-$$' content could be pretty easily guessed by
-attacker (at least for shells where $RANDOM is not supported).
-So, as the first step, create the '/tmp/ins$RANDOM-$$' without -p.
-This step would fail early if somebody wanted catch us.
-
-Note that systems that implement (and have enabled)
-fs.protected_symlinks kernel feature are not affected even without
-this commit.
-
-References:
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760455
-https://bugzilla.redhat.com/show_bug.cgi?id=1140725
-
-* lib/install-sh: Implement safer 'mkdir -p' test by running
-'$mkdirprog $mkdir_mode "$tmpdir"' first.
-(scriptversion): Bump.
-
---- a/lib/install-sh
-+++ b/lib/install-sh
-@@ -345,34 +345,41 @@ do
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
-+ # $RANDOM is not portable (e.g. dash); use it when possible to
-+ # lower collision chance
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-+ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-+ # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
-+ # create the $tmpdir first (and fail if unsuccessful) to make sure
-+ # that nobody tries to guess the $tmpdir name.
- if (umask $mkdir_umask &&
-- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-+ $mkdirprog $mkdir_mode "$tmpdir" &&
-+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-- ls_ld_tmpdir=`ls -ld "$tmpdir"`
-+ test_tmpdir="$tmpdir/a"
-+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
-- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
-+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
-- rmdir "$tmpdir/d" "$tmpdir"
-+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
-- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
- fi
- trap '' 0;;
- esac;;
diff --git a/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch b/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch
deleted file mode 100644
index f790e7724c93..000000000000
--- a/sys-devel/automake/files/automake-1.13-dyn-ithreads.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-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-hash-order-workaround.patch b/sys-devel/automake/files/automake-1.13-hash-order-workaround.patch
deleted file mode 100644
index 79b81e6fa407..000000000000
--- a/sys-devel/automake/files/automake-1.13-hash-order-workaround.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/t/primary-prefix-invalid-couples.tap
-+++ b/t/primary-prefix-invalid-couples.tap
-@@ -186,8 +186,10 @@ grep -v 'dir.* not a legitimate directory' stderr && exit 1
- # Check that the same failures are present without the '--add-missing'
- # option.
- mv stderr stderr.old
-+cat stderr.old | sort > a
- AUTOMAKE_fails -d "automake error out on mismatched prefix/primary couples"
-+cat stderr | sort > b
- command_ok_ "... and with the same diagnostic of 'automake -a'" \
-- diff stderr.old stderr
-+ diff a b
-
- :
diff --git a/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket-r1.patch b/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket-r1.patch
deleted file mode 100644
index bf8819adcf4c..000000000000
--- a/sys-devel/automake/files/automake-1.13-perl-escape-curly-bracket-r1.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-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/automake.in
-+++ b/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.14-install-sh-avoid-low-risk-race-in-tmp.patch b/sys-devel/automake/files/automake-1.14-install-sh-avoid-low-risk-race-in-tmp.patch
deleted file mode 100644
index 679370686aaf..000000000000
--- a/sys-devel/automake/files/automake-1.14-install-sh-avoid-low-risk-race-in-tmp.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Pavel Raiskup <praiskup@redhat.com>
-Date: Sat, 15 Aug 2015 04:40:57 -0400
-Subject: install-sh: avoid (low risk) race in /tmp
-
-Ensure that nobody can cross privilege boundaries by pre-creating
-symlink on '$tmpdir' path.
-
-Just testing 'mkdir -p' by creating '/tmp/ins$RANDOM-$$/d' is not
-safe because '/tmp' directory is usually world-writeable and
-'/tmp/ins$RANDOM-$$' content could be pretty easily guessed by
-attacker (at least for shells where $RANDOM is not supported).
-So, as the first step, create the '/tmp/ins$RANDOM-$$' without -p.
-This step would fail early if somebody wanted catch us.
-
-Note that systems that implement (and have enabled)
-fs.protected_symlinks kernel feature are not affected even without
-this commit.
-
-References:
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760455
-https://bugzilla.redhat.com/show_bug.cgi?id=1140725
-
-* lib/install-sh: Implement safer 'mkdir -p' test by running
-'$mkdirprog $mkdir_mode "$tmpdir"' first.
-(scriptversion): Bump.
-
---- a/lib/install-sh
-+++ b/lib/install-sh
-@@ -345,34 +345,41 @@ do
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
-+ # $RANDOM is not portable (e.g. dash); use it when possible to
-+ # lower collision chance
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-+ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-+ # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
-+ # create the $tmpdir first (and fail if unsuccessful) to make sure
-+ # that nobody tries to guess the $tmpdir name.
- if (umask $mkdir_umask &&
-- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-+ $mkdirprog $mkdir_mode "$tmpdir" &&
-+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-- ls_ld_tmpdir=`ls -ld "$tmpdir"`
-+ test_tmpdir="$tmpdir/a"
-+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
-- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
-+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
-- rmdir "$tmpdir/d" "$tmpdir"
-+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
-- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
- fi
- trap '' 0;;
- esac;;
diff --git a/sys-devel/automake/files/automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch b/sys-devel/automake/files/automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch
deleted file mode 100644
index 1fabdd5fb3e1..000000000000
--- a/sys-devel/automake/files/automake-1.15-install-sh-avoid-low-risk-race-in-tmp.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From: Pavel Raiskup <praiskup@redhat.com>
-Date: Sat, 15 Aug 2015 04:40:57 -0400
-Subject: install-sh: avoid (low risk) race in /tmp
-
-Ensure that nobody can cross privilege boundaries by pre-creating
-symlink on '$tmpdir' path.
-
-Just testing 'mkdir -p' by creating '/tmp/ins$RANDOM-$$/d' is not
-safe because '/tmp' directory is usually world-writeable and
-'/tmp/ins$RANDOM-$$' content could be pretty easily guessed by
-attacker (at least for shells where $RANDOM is not supported).
-So, as the first step, create the '/tmp/ins$RANDOM-$$' without -p.
-This step would fail early if somebody wanted catch us.
-
-Note that systems that implement (and have enabled)
-fs.protected_symlinks kernel feature are not affected even without
-this commit.
-
-References:
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760455
-https://bugzilla.redhat.com/show_bug.cgi?id=1140725
-
-* lib/install-sh: Implement safer 'mkdir -p' test by running
-'$mkdirprog $mkdir_mode "$tmpdir"' first.
-(scriptversion): Bump.
----
- lib/install-sh | 23 +++++++++++++++--------
- 1 file changed, 15 insertions(+), 8 deletions(-)
-
-diff --git a/lib/install-sh b/lib/install-sh
-index 0b0fdcb..59990a1 100755
---- a/lib/install-sh
-+++ b/lib/install-sh
-@@ -324,34 +324,41 @@ do
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
-+ # $RANDOM is not portable (e.g. dash); use it when possible to
-+ # lower collision chance
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-+ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-+ # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
-+ # create the $tmpdir first (and fail if unsuccessful) to make sure
-+ # that nobody tries to guess the $tmpdir name.
- if (umask $mkdir_umask &&
-- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-+ $mkdirprog $mkdir_mode "$tmpdir" &&
-+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-- ls_ld_tmpdir=`ls -ld "$tmpdir"`
-+ test_tmpdir="$tmpdir/a"
-+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
-- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
-+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
-- rmdir "$tmpdir/d" "$tmpdir"
-+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
-- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
- fi
- trap '' 0;;
- esac;;
diff --git a/sys-devel/automake/files/automake-1.16.2-fix-instmany-python.sh-test.patch b/sys-devel/automake/files/automake-1.16.2-fix-instmany-python.sh-test.patch
deleted file mode 100644
index 5cddb4cfb83f..000000000000
--- a/sys-devel/automake/files/automake-1.16.2-fix-instmany-python.sh-test.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 50daac4f15d207b6b69011b9cdde62b56c1c8b10 Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi@gentoo.org>
-Date: Fri, 20 Nov 2020 02:17:31 +0100
-Subject: [PATCH 2/2] tests: fix instmany-python.sh: increase limit
-
-Still failing with 4500 on Gentoo. Passing with 7000...
----
- t/instmany-python.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/t/instmany-python.sh b/t/instmany-python.sh
-index dce3594b5..1c482520d 100644
---- a/t/instmany-python.sh
-+++ b/t/instmany-python.sh
-@@ -21,7 +21,7 @@
- required='python'
- . test-init.sh
-
--limit=4500
-+limit=7000
- subdir=long_subdir_name_with_many_characters
- nfiles=81
- list=$(seq_ 1 $nfiles)
---
-2.29.2
-
diff --git a/sys-devel/automake/files/automake-1.16.2-fix-py-compile-basedir.sh-test.patch b/sys-devel/automake/files/automake-1.16.2-fix-py-compile-basedir.sh-test.patch
deleted file mode 100644
index f49dd253c2d6..000000000000
--- a/sys-devel/automake/files/automake-1.16.2-fix-py-compile-basedir.sh-test.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From e3db5b8038a902501a354b6921dcebcb4180f50a Mon Sep 17 00:00:00 2001
-From: Thomas Deutschmann <whissi@gentoo.org>
-Date: Fri, 20 Nov 2020 02:13:56 +0100
-Subject: [PATCH 1/2] tests: fix py-compile-basedir.sh: add missing test call
-
-Fixes: b279a0d46 ("tests: in python tests, do not require .pyo files (for python3)")
----
- t/py-compile-basedir.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/t/py-compile-basedir.sh b/t/py-compile-basedir.sh
-index 13a22ff1d..1a16ee2d7 100644
---- a/t/py-compile-basedir.sh
-+++ b/t/py-compile-basedir.sh
-@@ -43,7 +43,7 @@ for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do
- py_installed "$d2/sub/$f.pyc"
- files=$(find "$d2" | grep '\.py[co]$')
- # with new-enough Python3, there are six files.
-- test $(echo "$files" | wc -l) -eq 4 || $(echo "$files" | wc -l) -eq 6
-+ test $(echo "$files" | wc -l) -eq 4 || test $(echo "$files" | wc -l) -eq 6
- case $d2 in
- .|..) rm -f $files;;
- *) rm -rf "$d2";;
---
-2.29.2
-
diff --git a/sys-devel/automake/files/automake-1.16.2-py3-compile.patch b/sys-devel/automake/files/automake-1.16.2-py3-compile.patch
deleted file mode 100644
index 7924f204ad4f..000000000000
--- a/sys-devel/automake/files/automake-1.16.2-py3-compile.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From aa449bd4c836abf0320033c5077259fc760b622d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sun, 3 Nov 2019 11:51:19 +0100
-Subject: [PATCH] py-compile: Support -OO for py3.5+, and -O&-OO for pypy3
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Michał Górny <mgorny@gentoo.org>
----
- lib/py-compile | 29 +++++++++++++++++++++++++----
- 1 file changed, 25 insertions(+), 4 deletions(-)
-
-diff --git a/lib/py-compile b/lib/py-compile
-index e56d98d6e..5b9ae5d5d 100755
---- a/lib/py-compile
-+++ b/lib/py-compile
-@@ -126,12 +126,10 @@ if test "$python_major" -le 2; then
- import_lib=imp
- import_test="hasattr(imp, 'get_tag')"
- import_call=imp.cache_from_source
-- import_arg2=', False' # needed in one call and not the other
- else
- import_lib=importlib
- import_test="hasattr(sys.implementation, 'cache_tag')"
- import_call=importlib.util.cache_from_source
-- import_arg2=
- fi
-
- $PYTHON -c "
-@@ -159,7 +157,7 @@ $PYTHON -O -c "
- import sys, os, py_compile, $import_lib
-
- # pypy does not use .pyo optimization
--if hasattr(sys, 'pypy_translation_info'):
-+if hasattr(sys, 'pypy_translation_info') and sys.hexversion < 0x03050000:
- sys.exit(0)
-
- files = '''$files'''
-@@ -173,7 +171,30 @@ for file in files.split():
- sys.stdout.write(file)
- sys.stdout.flush()
- if $import_test:
-- py_compile.compile(filepath, $import_call(filepath$import_arg2), path)
-+ py_compile.compile(filepath, $import_call(filepath), path)
-+ else:
-+ py_compile.compile(filepath, filepath + 'o', path)
-+sys.stdout.write('\n')" 2>/dev/null || :
-+
-+$PYTHON -OO -c "
-+import sys, os, py_compile, $import_lib
-+
-+# python<3.5 does not have split files for -O and -OO
-+if sys.hexversion < 0x03050000:
-+ sys.exit(0)
-+
-+files = '''$files'''
-+sys.stdout.write('Byte-compiling python modules (optimized versions) ...\n')
-+for file in files.split():
-+ $pathtrans
-+ $filetrans
-+ if not os.path.exists(filepath) or not (len(filepath) >= 3
-+ and filepath[-3:] == '.py'):
-+ continue
-+ sys.stdout.write(file)
-+ sys.stdout.flush()
-+ if $import_test:
-+ py_compile.compile(filepath, $import_call(filepath), path)
- else:
- py_compile.compile(filepath, filepath + 'o', path)
- sys.stdout.write('\n')" 2>/dev/null || :
---
-2.25.2
diff --git a/sys-devel/automake/metadata.xml b/sys-devel/automake/metadata.xml
deleted file mode 100644
index f671901dcb0b..000000000000
--- a/sys-devel/automake/metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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="cpe">cpe:/a:gnu:automake</remote-id>
-</upstream>
-</pkgmetadata>
diff --git a/sys-devel/bc/bc-1.07.1-r3.ebuild b/sys-devel/bc/bc-1.07.1-r3.ebuild
deleted file mode 100644
index 84f22cd7fd26..000000000000
--- a/sys-devel/bc/bc-1.07.1-r3.ebuild
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-inherit flag-o-matic toolchain-funcs
-
-DESCRIPTION="Handy console-based calculator utility"
-HOMEPAGE="https://www.gnu.org/software/bc/bc.html"
-SRC_URI="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 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~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
- virtual/yacc
-"
-
-PATCHES=(
- "${FILESDIR}/${PN}-1.07.1-no-ed-its-sed.patch"
-)
-
-src_prepare() {
- default
-
- # Avoid bad build tool usage when cross-compiling. #627126
- tc-is-cross-compiler && eapply "${FILESDIR}/${PN}-1.07.1-use-system-bc.patch"
-}
-
-src_configure() {
- local myconf=(
- $(use_with readline)
- )
- if use readline ; then
- myconf+=( --without-libedit )
- else
- myconf+=( $(use_with 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)"
-}
diff --git a/sys-devel/bc/bc-1.07.1-r6.ebuild b/sys-devel/bc/bc-1.07.1-r6.ebuild
new file mode 100644
index 000000000000..b3c954931a8e
--- /dev/null
+++ b/sys-devel/bc/bc-1.07.1-r6.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Handy console-based calculator utility"
+HOMEPAGE="https://www.gnu.org/software/bc/bc.html"
+SRC_URI="mirror://gnu/bc/${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="libedit readline static"
+
+RDEPEND="
+ !readline? ( libedit? ( dev-libs/libedit:= ) )
+ readline? (
+ sys-libs/readline:=
+ sys-libs/ncurses:=
+ )"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ sys-devel/flex
+ app-alternatives/yacc"
+PDEPEND="app-alternatives/bc"
+
+PATCHES=( "${FILESDIR}"/${PN}-1.07.1-no-ed-its-sed.patch )
+
+src_prepare() {
+ default
+
+ # Avoid bad build tool usage when cross-compiling. Bug #627126
+ tc-is-cross-compiler && eapply "${FILESDIR}"/${PN}-1.07.1-use-system-bc.patch
+}
+
+src_configure() {
+ local myconf=(
+ $(use_with readline)
+ --program-suffix=-reference
+ )
+
+ if use readline ; then
+ myconf+=( --without-libedit )
+ else
+ myconf+=( $(use_with libedit) )
+ fi
+
+ use static && append-ldflags -static
+
+ # The libedit code isn't compatible currently. #830101
+ use libedit && append-flags -fcommon
+
+ # AC_SYS_LARGEFILE in configure.ac would handle this, but we don't patch
+ # autotools otherwise currently. This change has been sent upstream, but
+ # who knows when they'll make another release.
+ append-lfs-flags
+
+ # configure dies with other lexes:
+ # "configure: error: readline works only with flex."
+ export LEX=flex
+
+ econf "${myconf[@]}"
+
+ # Do not regen docs -- configure produces a small fragment that includes
+ # the version info which causes all pages to regen (newer file). Bug #554774
+ touch -r doc doc/* || die
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)"
+}
+
+pkg_postinst() {
+ # ensure to preserve the symlinks before app-alternatives/bc
+ # is installed
+ local x
+ for x in bc dc ; do
+ if [[ ! -h ${EROOT}/usr/bin/${x} ]] ; then
+ ln -s "${x}-reference" "${EROOT}/usr/bin/${x}" || die
+ fi
+ done
+}
diff --git a/sys-devel/bc/metadata.xml b/sys-devel/bc/metadata.xml
index 73dda144f9ac..b0d83aa2e489 100644
--- a/sys-devel/bc/metadata.xml
+++ b/sys-devel/bc/metadata.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<maintainer type="project">
- <email>base-system@gentoo.org</email>
- <name>Gentoo Base System</name>
-</maintainer>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
</pkgmetadata>
diff --git a/sys-devel/bin86/bin86-0.16.21-r1.ebuild b/sys-devel/bin86/bin86-0.16.21-r1.ebuild
index c8aa201710f6..cdbd313b3371 100644
--- a/sys-devel/bin86/bin86-0.16.21-r1.ebuild
+++ b/sys-devel/bin86/bin86-0.16.21-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
@@ -11,7 +11,7 @@ SRC_URI="http://v3.sk/~lkundrak/dev86/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
+KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86"
PATCHES="${FILESDIR}"/${PN}-0.16.21-amd64-build.patch
diff --git a/sys-devel/bin86/bin86-0.16.21.ebuild b/sys-devel/bin86/bin86-0.16.21-r2.ebuild
index b21fcec3bf49..c7be6fd8af00 100644
--- a/sys-devel/bin86/bin86-0.16.21.ebuild
+++ b/sys-devel/bin86/bin86-0.16.21-r2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="6"
+EAPI="8"
-inherit toolchain-funcs epatch
+inherit toolchain-funcs
DESCRIPTION="Assembler and loader used to create kernel bootsector"
HOMEPAGE="http://v3.sk/~lkundrak/dev86/"
@@ -12,7 +12,10 @@ SRC_URI="http://v3.sk/~lkundrak/dev86/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86"
-IUSE=""
+
+PATCHES=( "${FILESDIR}"/${PN}-0.16.21-amd64-build.patch
+ "${FILESDIR}"/${PN}-0.16.21-fix-build-for-clang16.patch
+)
src_prepare() {
use elibc_musl && CPPFLAGS="${CPPFLAGS} -U__linux__"
@@ -23,9 +26,8 @@ src_prepare() {
-e "/^CFLAGS/s|=.*|=${CFLAGS} -D_POSIX_SOURCE ${CPPFLAGS}|" \
-e "/^LDFLAGS/s|=.*|=${LDFLAGS}|" \
Makefile || die
- epatch "${FILESDIR}"/${PN}-0.16.17-amd64-build.patch
- eapply_user
tc-export CC
+ default
}
src_install() {
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
deleted file mode 100644
index b494a8b724de..000000000000
--- a/sys-devel/bin86/files/bin86-0.16.17-amd64-build.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-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/files/bin86-0.16.21-fix-build-for-clang16.patch b/sys-devel/bin86/files/bin86-0.16.21-fix-build-for-clang16.patch
new file mode 100644
index 000000000000..9b821ca35850
--- /dev/null
+++ b/sys-devel/bin86/files/bin86-0.16.21-fix-build-for-clang16.patch
@@ -0,0 +1,145 @@
+Subject: [PATCH] fix build for clang 16
+
+clang 16 does not allow implicit int in function declarations
+
+Bug: https://bugs.gentoo.org/880797
+Upstream PR: https://github.com/lkundrak/dev86/pull/26
+
+Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
+---
+ ld/catimage.c | 32 +++++++++++++++++++-------------
+ ld/objchop.c | 16 ++++++++--------
+ 2 files changed, 27 insertions(+), 21 deletions(-)
+
+diff --git a/ld/catimage.c b/ld/catimage.c
+index 1f5e160..47161b9 100644
+--- a/ld/catimage.c
++++ b/ld/catimage.c
+@@ -24,6 +24,7 @@
+ #ifdef __STDC__
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <string.h>
+ #endif
+ #include "x86_aout.h"
+
+@@ -39,9 +40,14 @@ FILE * ofd;
+ FILE * ifd = 0;
+ struct exec header;
+
+-main(argc, argv)
+-int argc;
+-char ** argv;
++void open_obj(char * fname);
++void copy_segment(long out_offset,long in_offset,long length);
++void patch_bin(long file_off, int value);
++void read_symtable(void);
++void fatal(char * str);
++
++int
++main(int argc, char ** argv)
+ {
+ long image_offset, text_off;
+ int image_id;
+@@ -100,8 +106,8 @@ char ** argv;
+ exit(0);
+ }
+
+-open_obj(fname)
+-char * fname;
++void
++open_obj(char * fname)
+ {
+ input_file = fname;
+
+@@ -117,8 +123,8 @@ char * fname;
+ fatal("Input file has bad magic number");
+ }
+
+-copy_segment(out_offset, in_offset, length)
+-long out_offset, in_offset, length;
++void
++copy_segment(long out_offset,long in_offset,long length)
+ {
+ char buffer[1024];
+ int ssize;
+@@ -143,9 +149,8 @@ long out_offset, in_offset, length;
+ }
+ }
+
+-patch_bin(file_off, value)
+-long file_off;
+-int value;
++void
++patch_bin(long file_off, int value)
+ {
+ char wbuf[4];
+ if( file_off > 0 )
+@@ -163,7 +168,8 @@ int value;
+ }
+ }
+
+-read_symtable()
++void
++read_symtable(void)
+ {
+ struct nlist item;
+ int nitems;
+@@ -234,8 +240,8 @@ read_symtable()
+ }
+ }
+
+-fatal(str)
+-char * str;
++void
++fatal(char * str)
+ {
+ fprintf(stderr, "catimage:%s: %s\n", input_file, str);
+ exit(2);
+diff --git a/ld/objchop.c b/ld/objchop.c
+index c7631c1..495df75 100644
+--- a/ld/objchop.c
++++ b/ld/objchop.c
+@@ -16,12 +16,13 @@ main()
+
+ #else
+
++void fatal(char* str);
++void write_file(char *fname, long bsize);
++
+ FILE * ifd;
+ struct exec header;
+
+-main(argc, argv)
+-int argc;
+-char ** argv;
++int main(int argc, char** argv)
+ {
+ FILE * ofd;
+ if( argc != 5 ) fatal("Usage: objchop a.out text.bin data.bin sizes.asm");
+@@ -56,9 +57,8 @@ char ** argv;
+ exit(0);
+ }
+
+-write_file(fname, bsize)
+-char * fname;
+-long bsize;
++void
++write_file(char *fname, long bsize)
+ {
+ char buffer[1024];
+ int ssize;
+@@ -81,8 +81,8 @@ long bsize;
+ fclose(ofd);
+ }
+
+-fatal(str)
+-char * str;
++void
++fatal(char* str)
+ {
+ fprintf(stderr, "objchop: %s\n", str);
+ exit(2);
+--
+2.41.0
+
diff --git a/sys-devel/binutils-apple/Manifest b/sys-devel/binutils-apple/Manifest
index a6468db7cc6c..22c77453207c 100644
--- a/sys-devel/binutils-apple/Manifest
+++ b/sys-devel/binutils-apple/Manifest
@@ -1,4 +1,3 @@
-DIST binutils-apple-patches-11.3-r1.tar.bz2 9041 BLAKE2B c881117e19e119173dd8c126859f8ebab5ff4024697c9650b8ba145c021aa6e251086d3678d80fec2672e78637a5beca795b71ae871692e832ba4e69a7a8e04c SHA512 eda63cd89f67674556dc75de719cd318f534544db50165d4faac454f67c557c9944e7e024c4443e640f987ed8c8826ccd578427743a86d7220c2ba90ed2206d4
DIST binutils-apple-patches-3.2.6-r0.tar.bz2 3500 BLAKE2B f10dcf71400ea5d4bf7efb8ad906240765cfb56743274b3e1684eeb4273a35171aa4202d475920cff2c5c39e89f9bd1d7e5b0d38ba6c2b4705b0a592ba47e063 SHA512 4ccb8ebd49ac8eac4dbd0c1f24ee1836f216efd2e9e15b13072cbc76d8f83fbf4f1f6b3b60736bf5d5482af3e49ec1eaedfce8dd0ce1e949f915faf9c92ee0ea
DIST binutils-apple-patches-4.3-r1.tar.bz2 37363 BLAKE2B a5ad04d4bf746a864f03a25d052197ed9a6ecada1f34460f4e38bea8cd87dfe2cb6c7f99f2096acac2231cd1e0c13c53757854b07f729a7a0c5a162a908fbe83 SHA512 f5d64ad182891c3af971e6aabd3c0c1b717b6a1cb471632339cba61b41a998d15880d18de09aafa1c3d059e528c888d6e8b914025c79bc21897d90a6d0e2ebf5
DIST binutils-apple-patches-5.1-r2.tar.bz2 51642 BLAKE2B 1b44020a05e0a91cfe569273f1e3dc65afaeac4bcdb80a626bdcc1f30cf8fbba6cc7bb522ece93126d4035b2d309defefd17fe0cee5bcaadcc58c4fa0feb4827 SHA512 37ba0dcae6c10b54a07c6208f6893ab80b0de1bd1c2f677902f707c8290629f7671a481e256b57a18bf304b95e41e4d59519bc1c88f15de488c0ef7e142f5cd8
@@ -6,12 +5,9 @@ DIST binutils-apple-patches-7.3-r2.tar.bz2 44551 BLAKE2B 036cd2a2e4a66b046467f29
DIST binutils-apple-patches-8.2-r1.tar.bz2 10830 BLAKE2B 345db8619873e9e91b79c3fdc0685fc46f82366df0b6153c1a59fbe5c122622e799754397e980e8752ef01ef25bbac81bb8f0339e92168790211b1d9c03bef2d SHA512 e7ca8cbac75671846c044abcd5415cfcf5832ff71acd5a2799b643369b02f2f7148990398c51913a3758e589f9fbff875e333aadf568e2a8a2defeafaa2aca95
DIST cctools-795.tar.gz 1993795 BLAKE2B dc0915f8647eecba5352e34dfc5752b679df39ead9a4734c49955a824d2cc127308eed46a614665dfe08a9d3036eb37f587e1b765a7df727facc42a33befacb0 SHA512 5a34a73dc71d3574a357f6b0f26a48a99dd0995d62695b309cdfe85c4960934b410455b1ba6bdbc9a4e32106bb45b35555604975d2a80ad1be21f5d4eac69254
DIST cctools-895.tar.gz 1716126 BLAKE2B 9706a6b243518693888e5e21dfe8d83b217380b47db621a7f1b35105eb72fb8997353ff85133224b0856f6b6ec710f54a4fe79076d9e228f89c98b6f517de309 SHA512 4ef9db870385cc2c4263bcbe42ff0de80386771f5acbc7082a1818ecd6b8d7bb1bfa02a7fcfecd3e7281481aeaaac4c331359aca3564bfe7a4c7dea1e0d06126
-DIST cctools-949.0.1.tar.gz 1968671 BLAKE2B b38fbae5d2ec011a94c2e4ec299c1ecd173f2c2516664cf925b06aaa078e234b59068158ea29dfcbf763ca98c73bc1806a507fbbe49a8d4d0a2fd4e602f401ce SHA512 13c493a48852c980d2829d28616c18640ad5ebfe6acd55143c4c948665e0b65377a459560667074fdac5e69bb6360fea13d988303c49fd3dd4a58e9b5c54ebcb
-DIST darwin-xtools-8.2.1-r101.tar.gz 3105898 BLAKE2B 3516cd252d4880b1e80c76365efef6f96830578bb5512befe33f86decdeb026fbad17fd3b27e9c3cf20d100897002e86ec08822041baa0291bb53e0b0ecf4d10 SHA512 f84cbde0853c14f03af40a124133d71d3e1710da021a593336eb4351c60edbca5753af0780f269ed4716cd194973f5437d428c5ff9615d9ce025dba3b7daef77
+DIST darwin-xtools-8.2.1-r103.tar.gz 3106189 BLAKE2B f13e77f796eefc393389206d5663c98d55c3fe0eb5123b366155e7c993cea421a039121d705cab2aa5fcdab2ef08d2b17dd5b9d6e0b2c50c97db067b0ec10283 SHA512 241f402ac368606eb9b89421a3e0a2ebbde1ea79d6e84cc55680a7f3dbc31dfa402ee7b20f605627c1bfd9097bbe824dea466339a7ff9026810911ef70940bda
DIST dyld-132.13.tar.gz 342690 BLAKE2B 011418ba5b91a28bb7c5f8188af2fac5478bad53581396b7c1c4623a854a8f0d5ecb92d023246157830ed2db83bbf28e23225a255188e2d07eeb6c933814bda6 SHA512 2c9d50fc32868b696d88730eb6ea6afa9bb9f56883cc2ea4f1d41f370f311b7487a29ce0eff6761e1eeb086a18e2513953989d8d5d3ef1043bb662e86baadd3f
DIST dyld-421.2.tar.gz 625173 BLAKE2B 8f8325314861ae2ea10fbe78c74c7199b547973ac61a8e9cb76fb874a0e53395ea31c04e489f85ac7cfdb5715ae5051679453de75eb195e313113e7bbbc70340 SHA512 75f2fb840da980d44649aa3e045f50c4e37d4403fbdb1e2e5f1a85bf6d8859e1130053c3806f7ef992fdfc6573f7f18146263c690144bdd3df31452c6bdd8bd8
-DIST dyld-551.4.tar.gz 832297 BLAKE2B e65c5b2ed90af6ec94f1295efc984404af99f0e5dc666bfc854379f13fd2e98b8048fae84b7bc8864fe27112abf12f741a33cc404b18ae7c88b7abd6a1d9e3c6 SHA512 896281c4b2330c92ed538af58f1b60906ed0a9ffa3099a5e8ef9a15b7ed974259bf546fd2ab7562739f2c8cf1fdfb44ea0ea7567092c77f2ea2cab377da064b0
DIST ld64-274.2.tar.gz 671652 BLAKE2B f45bb65bbe65c7baff54dec633a49b8ea472a59a7978aa050b329132963b26e4a2b3ef3dd034b04247531a11a07de5135b3726a429165cbfcae50e06c09531f4 SHA512 7b4e17f199909450b697bf719564c6841d46f5116c48dd47ff483ae7ddfe2965db1b7c024ed8ebeeaf90cd983ed353b95f7f23c93c8971536977dc892e6d6a9d
-DIST ld64-530.tar.gz 744871 BLAKE2B 8117160ffe55c02b463559a52fcbd109629d6e2b4707f36391ec2151785cc1ab5be911129397af7bea05f06b2c718bc345a1e3b6b0838dae943f4083612af38f SHA512 0197ec05f9fbaf9e1902bb6e0819d0562573a433e0445809f1020e76126d3af57222a8e9e187fce793a5b581f825b48bfb5ec5cca9ae3eb77758cbc7f20e9e20
DIST ld64-97.17.tar.gz 421947 BLAKE2B 56820ef28490f2e0181d6e36b87506c6f00ae5759afe304a063fb6bd1904ace566ef4aa69ff0d235d65968af547a1a5735cb23bcefa990f418740188d399b637 SHA512 841774a1a7c0e2f661ac7e66703f7578d8f11274897ffa15f8c49daf290a23465763f264a4dae99f15754891f44c425c0d327652112007b499bc8f755a7fc9d6
DIST libunwind-30.tar.gz 82811 BLAKE2B 26993d6afa6930931c01b579326964a66832ed7a6ffa26eff10016c8d6d175d3b671753cf8700dcdbae7f0a9c01b16e9cbd3c9fe86697608f1f08a8eceb64782 SHA512 57106eafa1516791b4e0db2de6c6336bc0c1cbd8bf098a6d3a809fafa457802c95a7aeae9137f4ca5922a3018dfd8f597907ea4187b0afbbf267500eae00041f
diff --git a/sys-devel/binutils-apple/binutils-apple-11.3.1-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-11.3.1-r1.ebuild
deleted file mode 100644
index 42f2f2808cb7..000000000000
--- a/sys-devel/binutils-apple/binutils-apple-11.3.1-r1.ebuild
+++ /dev/null
@@ -1,378 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-inherit eutils flag-o-matic toolchain-funcs llvm prefix
-
-# versions:
-# XCode-11.3.1 ld64-530 cctools-949.0.1
-# XCode-11.2.1 ld64-520 cctools-949.0.1
-# XCode-11.0 ld64-512.4 cctools-949.0.1
-# XCode-8.2.1 ld64-274.2 cctools-895 <== binutils-apple-8.2.1-r1 (2019)
-
-# macOS-10.15.6 dyld-750.6 Causes build failures with Xcode-11 tools
-# macOS-10.14.4-10.14.6 dyld-655.1.1 Causes build failures with Xcode-11 tools
-# macOS-10.13.6 dyld-551.4
-# macOS-10.12.1-10.12.3 dyld-421.2 <== binutils-apple-8.2.1-r1,8.1
-
-LD64=ld64-530
-CCTOOLS_VERSION=949.0.1
-CCTOOLS=cctools-${CCTOOLS_VERSION}
-DYLD=dyld-551.4
-
-DESCRIPTION="Darwin assembler as(1) and static linker ld(1), Xcode Tools ${PV}"
-HOMEPAGE="http://www.opensource.apple.com/"
-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.3-r2.tar.bz2
- https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-8.2-r1.tar.bz2
- https://dev.gentoo.org/~grobian/distfiles/${PN}-patches-11.3-r1.tar.bz2"
-
-LICENSE="APSL-2"
-KEYWORDS="~x64-macos"
-IUSE="lto classic test" # tapi is now required
-RESTRICT="!test? ( 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 )
- sys-libs/tapi
- sys-devel/llvm:*
- sys-libs/libcxx"
-DEPEND="${RDEPEND}
- test? ( >=dev-lang/perl-5.8.8 )"
-
-SLOT="11"
-
-S=${WORKDIR}
-
-is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-
-llvm_pkg_setup() {
- # eclass version will die if no LLVM can be found which will break prefix
- # bootstrap
- :
-}
-
-src_prepare() {
- cd "${S}"/${LD64}/src
- cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
- cp "${S}"/ld64-530-Makefile Makefile
-
- epatch "${S}"/ld64-530-nolto.patch
- epatch "${S}"/ld64-236.3-crashreporter.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 dyld
- mkdir -p include/mach-o || die
- # never present because it's private
- cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
- # TARGET_OS_BRIDGE is undefined in TargetConditionals.h of newer MacOSX.sdk.
- # We don't target BridgeOS. Disable it to avoid errors when clang adds:
- # -Werror,-Wundef-prefix=TARGET_OS_
- sed -i -e 's/#if TARGET_OS_BRIDGE/#if 0/' include/mach-o/dyld_priv.h
-
- local VER_STR="\"@(#)PROGRAM:ld PROJECT:${LD64} (Gentoo ${PN}-${PVR})\\n\""
- echo "char ldVersionString[] = ${VER_STR};" > version.cpp
-
- 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}-11.3.1-no-developertools-dir.patch
- epatch "${S}"/${PN}-11.3.1-llvm-prefix.patch
- epatch "${S}"/${PN}-11.3.1-llvm-shim.patch
- epatch "${S}"/${PN}-11.3.1-nolto-fix.patch # bugfix
- epatch "${S}"/${PN}-11.3.1-segaddrtable-fix.patch # bugfix
- eprefixify libstuff/execute.c
- 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
-
- # bugfix. args.c not built but args_expand_at is used in misc/libtool.c
- sed -i -e "/^CFILES = /s, errors.c , errors.c args.c ," 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/^G =.*$/G =/' \
- -e 's/^OFLAG =.*$/OFLAG =/' \
- -e 's/install -c -s/install/g'
- eend $?
-}
-
-src_configure() {
- ENABLE_LTO=0
- if use lto ; then
- ENABLE_LTO=1
-
- LLVM_INCDIR=$(get_llvm_prefix)/include
- LLVM_LIBDIR=$(get_llvm_prefix)/lib
-
- [ -n "${LLVM_INCDIR}" -a -n "${LLVM_LIBDIR}" ] || \
- die "LLVM not found - LTO support can not be enabled"
-
- # LTO and LLVM support currently both depend only on libLTO being
- # present. So we can enable both.
- CCTOOLS_LTO_CFLAGS="-DLTO_SUPPORT -I${LLVM_INCDIR}"
- CCTOOLS_LLVM_CFLAGS="-DLLVM_SUPPORT -I${LLVM_INCDIR}"
- fi
-
- 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}
- 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
-
- export CCTOOLS_CPPFLAGS="${CPPFLAGS}"
- # CPPFLAGS only affects ld64, cctools don't use 'em (which currently is
- # what we want). Removed in compile_cctools.
- 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} \
- LTO_INCDIR=${LLVM_INCDIR} \
- LTO_LIBDIR=${LLVM_LIBDIR} \
- TAPI=1 \
- TAPI_LIBDIR="${EPREFIX}"/usr/lib
-
- use test && emake build_test
-}
-
-compile_cctools() {
- einfo "building ${CCTOOLS}"
- filter-flags -DNDEBUG
-
- 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="${CCTOOLS_LTO_CFLAGS} ${CCTOOLS_LLVM_CFLAGS}" \
- COMMON_SUBDIRS='libstuff ar misc otool' \
- SUBDIRS_32= \
- LEGACY= \
- RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
- RC_CFLAGS="${CFLAGS}" \
- OFLAG="${CCTOOLS_OFLAG}" \
- DSYMUTIL=": disabled: dsymutil"
-
- cd "${S}"/${CCTOOLS}/as
- emake \
- BUILD_OBSOLETE_ARCH= \
- RC_ProjectSourceVersion=${CCTOOLS_VERSION} \
- RC_CFLAGS="-DASLIBEXECDIR=\"\\\"${EPREFIX}${LIBPATH}/\\\"\" ${CFLAGS}" \
- OFLAG="${CCTOOLS_OFLAG}" \
- DSYMUTIL=": disabled: dsymutil"
-}
-
-src_compile() {
- compile_ld64
- compile_cctools
-}
-
-install_ld64() {
- exeinto ${BINPATH}
- doexe "${S}"/${LD64}/src/{ld64,dyldinfo,unwinddump,ObjectDump,objcimageinfo,machocheck}
- dosym ld64 ${BINPATH}/ld
- insinto ${DATAPATH}/man/man1
- doins "${S}"/${LD64}/doc/man/man1/{ld,ld64,dyldinfo,unwinddump}.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. In Xcode, nm and size are now symlinks to llvm-{nm,size} while the
- # classic version is preserved as {nm,size}-classic. When asked to do so
- # by use classic we statically link to the classic version.
- # binutils-bin/<version>/<tool>
- # -> binutils-bin/<version>/<tool>-classic
- #
- # Otherwise we try to find and use the llvm version of the tool. Since our
- # binutils do not live in the same directory as the llvm installation and
- # llvm tends to move around, we use a shim that tries to find the llvm
- # version of the tool in prefix. It will fall back to the classic tool if
- # it fails.
- # binutils-bin/<version>/<tool>
- # -> binutils-bin/<version>/llvm-<tool>
- # -> $EPREFIX/usr/lib/llvm/<major/bin/llvm-<tool>
- # -> $EPREFIX/usr/bin/llvm-<tool>
- # -> binutils-bin/<version>/<tool>-classic
- budir=${D}/${EPREFIX}/${BINPATH}
- for tool in nm size ; do
- use classic && \
- ln -sfn ${tool}-classic "${budir}/${tool}" || \
- ln -sfn llvm-shim "${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"
-
- # And finally, although our cctools don't actually contain dsymutil and
- # objdump, we provide access to the llvm versions of them via the shim to
- # be in line with Xcode.
- for tool in objdump dsymutil ; do
- ln -sfn llvm-shim "${budir}/${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-3.2.6.ebuild b/sys-devel/binutils-apple/binutils-apple-3.2.6-r1.ebuild
index 49c5ce262a52..22d10d9f7b20 100644
--- a/sys-devel/binutils-apple/binutils-apple-3.2.6.ebuild
+++ b/sys-devel/binutils-apple/binutils-apple-3.2.6-r1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="6"
+EAPI="7"
-inherit eutils flag-o-matic toolchain-funcs
+inherit flag-o-matic toolchain-funcs
RESTRICT="test" # the test suite will test what's installed.
@@ -34,7 +34,7 @@ S=${WORKDIR}
is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-prepare_ld64() {
+eprepare_ld64() {
cd "${S}"/${LD64}/src
cp "${WORKDIR}"/Makefile Makefile || die
@@ -90,14 +90,14 @@ prepare_ld64() {
}
src_prepare() {
- prepare_ld64
+ eprepare_ld64
cd "${S}"/${CCTOOLS}
- epatch "${WORKDIR}"/${PN}-3.2.6-as-dir.patch
- epatch "${WORKDIR}"/${PN}-3.1.1-libtool-ranlib.patch
- epatch "${WORKDIR}"/${PN}-3.1.1-nmedit.patch
- epatch "${WORKDIR}"/${PN}-3.1.1-no-headers.patch
- epatch "${WORKDIR}"/${PN}-3.1.1-no-oss-dir.patch
+ eapply -p1 "${WORKDIR}"/${PN}-3.2.6-as-dir.patch
+ eapply -p1 "${WORKDIR}"/${PN}-3.1.1-libtool-ranlib.patch
+ eapply -p1 "${WORKDIR}"/${PN}-3.1.1-nmedit.patch
+ eapply -p1 "${WORKDIR}"/${PN}-3.1.1-no-headers.patch
+ eapply -p1 "${WORKDIR}"/${PN}-3.1.1-no-oss-dir.patch
# drop as targets which are not suported by anything
sed -i \
@@ -109,8 +109,8 @@ src_prepare() {
as/Makefile || die
cd "${S}"/${LD64}
- epatch "${WORKDIR}"/${PN}-3.1.1-testsuite.patch
- epatch "${WORKDIR}"/${PN}-3.2.6-lto.patch
+ eapply -p1 "${WORKDIR}"/${PN}-3.1.1-testsuite.patch
+ eapply -p1 "${WORKDIR}"/${PN}-3.2.6-lto.patch
cd "${S}"
ebegin "cleaning Makefiles from unwanted CFLAGS"
@@ -200,19 +200,19 @@ install_cctools() {
COMMON_SUBDIRS='ar misc otool' \
SUBDIRS_32= \
RC_CFLAGS="${CFLAGS}" OFLAG="${CFLAGS}" \
- DSTROOT=\"${D}\" \
- BINDIR=\"${EPREFIX}\"${BINPATH} \
- LOCBINDIR=\"${EPREFIX}\"${BINPATH} \
- USRBINDIR=\"${EPREFIX}\"${BINPATH} \
- LOCLIBDIR=\"${EPREFIX}\"${LIBPATH} \
- MANDIR=\"${EPREFIX}\"${DATAPATH}/man/
+ 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}
+ DSTROOT="\"${D}\"" \
+ USRBINDIR="\"${EPREFIX}\"${BINPATH}" \
+ LIBDIR="\"${EPREFIX}\"${LIBPATH}" \
+ LOCLIBDIR="\"${EPREFIX}\"${LIBPATH}"
cd "${ED}"${BINPATH}
insinto ${DATAPATH}/man/man1
@@ -249,6 +249,8 @@ src_install() {
install_ld64
install_cctools
+ docompress /usr/share/binutils-data/${CTARGET}/${PV}/man
+
cd "${S}"
insinto /etc/env.d/binutils
cat <<-EOF > env.d
diff --git a/sys-devel/binutils-apple/binutils-apple-8.2.1-r101.ebuild b/sys-devel/binutils-apple/binutils-apple-8.2.1-r103.ebuild
index 091e4e5990b4..9c2ab92a0fe8 100644
--- a/sys-devel/binutils-apple/binutils-apple-8.2.1-r101.ebuild
+++ b/sys-devel/binutils-apple/binutils-apple-8.2.1-r103.ebuild
@@ -1,11 +1,11 @@
-# Copyright 2020-2021 Gentoo Authors
+# Copyright 2020-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
CMAKE_MAKEFILE_GENERATOR=emake # keep dependencies down
-inherit cmake toolchain-funcs
+inherit cmake
DESCRIPTION="Darwin Xtools matching Xcode Tools ${PN}"
HOMEPAGE="https://github.com/iains/darwin-xtools"
@@ -13,23 +13,27 @@ SRC_URI="https://github.com/grobian/darwin-xtools/archive/gentoo-${PVR}.tar.gz -
LICENSE="APSL-2"
SLOT="8"
-KEYWORDS="~ppc-macos ~x64-macos"
-IUSE="tapi"
+KEYWORDS="~arm64-macos ~ppc-macos ~x64-macos"
# xtools uses c++11 features, not available in gcc-apple, hence gcc/clang dep
DEPEND="sys-devel/binutils-config
|| ( sys-devel/gcc:* sys-devel/clang:* )
app-arch/xar
- tapi? ( sys-libs/tapi )
- !tapi? ( dev-libs/libyaml )"
+ dev-libs/libyaml"
RDEPEND="${DEPEND}"
BDEPEND=""
S="${WORKDIR}/darwin-xtools-gentoo-${PVR}"
-PATCHES=(
- "${FILESDIR}"/${PN}-8.2.1-macos-12.patch
-)
+src_prepare() {
+ cmake_src_prepare
+ # kill forced libstd=libc++ usage, breaks with GCC-13 which has
+ # preliminary support for that
+ # check_cxx_compiler_flag(-stdlib=libc++ # XTOOLS_CXX_HAS_STDLIB_FLAG)
+ #
+ sed -i -e '/check_cxx_compiler_flag/s/XTOOLS_CXX_HAS_STDLIB_FLAG/NO_&/' \
+ cmake/config-ix.cmake || die
+}
src_configure() {
CTARGET=${CTARGET:-${CHOST}}
@@ -65,7 +69,7 @@ src_configure() {
-DXTOOLS_LTO_SUPPORT=NO
-DXTOOLS_HAS_LIBPRUNETRIE=YES
-DXTOOLS_TAPI_SUPPORT=ON
- -DXTOOLS_USE_TAPILITE=$(use tapi && echo OFF || echo ON)
+ -DXTOOLS_USE_TAPILITE=ON
-DXTOOLS_HOST_IS_64B=$(is-host-64bit)
-DXTOOLS_BUGURL="https://bugs.gentoo.org/"
)
@@ -109,6 +113,8 @@ src_install() {
dodir "${DATAPATH}"
mv "${ED}"/usr/share/man "${ED}/${DATAPATH}/" || die
+ docompress "${DATAPATH}"/man
+
cd "${S}"
insinto /etc/env.d/binutils
cat <<-EOF > env.d
diff --git a/sys-devel/binutils-apple/binutils-apple-8.2.1-r1.ebuild b/sys-devel/binutils-apple/binutils-apple-8.2.1-r2.ebuild
index 3d5c7e8105dc..b1c82e7522e4 100644
--- a/sys-devel/binutils-apple/binutils-apple-8.2.1-r1.ebuild
+++ b/sys-devel/binutils-apple/binutils-apple-8.2.1-r2.ebuild
@@ -1,9 +1,20 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="6"
+EAPI="7"
-inherit eutils flag-o-matic toolchain-funcs llvm prefix
+inherit flag-o-matic llvm prefix
+
+# versions:
+# XCode-11.3.1 ld64-530 cctools-949.0.1
+# XCode-11.2.1 ld64-520 cctools-949.0.1
+# XCode-11.0 ld64-512.4 cctools-949.0.1
+# XCode-8.2.1 ld64-274.2 cctools-895 <== binutils-apple-8.2.1-r1 (2019)
+
+# macOS-10.15.6 dyld-750.6 Causes build failures with Xcode-11 tools
+# macOS-10.14.4-10.14.6 dyld-655.1.1 Causes build failures with Xcode-11 tools
+# macOS-10.13.6 dyld-551.4
+# macOS-10.12.1-10.12.3 dyld-421.2 <== binutils-apple-8.2.1-r1,8.1
LD64=ld64-274.2
CCTOOLS_VERSION=895
@@ -22,7 +33,7 @@ SRC_URI="http://www.opensource.apple.com/tarballs/ld64/${LD64}.tar.gz
LICENSE="APSL-2"
KEYWORDS="~x64-macos"
-IUSE="lto tapi classic test"
+IUSE="lto classic test"
RESTRICT="!test? ( test )"
# ld64 can now only be compiled using llvm and libc++ since it massively uses
@@ -31,7 +42,6 @@ RESTRICT="!test? ( test )"
# -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}
@@ -54,12 +64,12 @@ src_prepare() {
cp "${S}"/ld64-136-compile_stubs.h ld/compile_stubs.h
cp "${S}"/ld64-274.2-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
- epatch "${S}"/ld64-274.2-cfi-info-type.patch
+ eapply -p2 "${S}"/ld64-274.1-nolto.patch
+ eapply -p2 "${S}"/ld64-236.3-crashreporter.patch
+ eapply -p2 "${S}"/ld64-264.3.102-bitcode-case.patch
+ eapply -p2 "${S}"/ld64-274.1-unknown-fixup.patch
+ eapply -p2 "${S}"/ld64-274.1-notapi.patch
+ eapply -p2 "${S}"/ld64-274.2-cfi-info-type.patch
# workound llvm-3.9.{0,1} issue
# https://bugs.gentoo.org/show_bug.cgi?id=603580
@@ -77,27 +87,27 @@ src_prepare() {
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
+ eapply -p2 "${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
+ eapply -p0 "${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.3-no-developertools-dir.patch
- epatch "${S}"/${PN}-8.2.1-llvm-prefix-3.patch
- epatch "${S}"/${PN}-8.2.1-llvm-shim.patch
+ eapply -p1 "${S}"/${PN}-4.5-as.patch
+ eapply -p1 "${S}"/${PN}-5.1-as-dir.patch
+ eapply -p2 "${S}"/${PN}-5.1-ranlib.patch
+ eapply -p1 "${S}"/${PN}-3.1.1-libtool-ranlib.patch
+ eapply -p1 "${S}"/${PN}-3.1.1-no-headers.patch
+ eapply -p0 "${S}"/${PN}-4.0-no-oss-dir.patch
+ eapply -p1 "${S}"/cctools-839-intel-retf.patch
+ eapply -p2 "${S}"/${PN}-5.1-extraneous-includes.patch
+ eapply -p1 "${S}"/${PN}-5.1-strnlen.patch
+ eapply -p1 "${S}"/${PN}-7.3-make-j.patch
+ eapply -p1 "${S}"/${PN}-7.3-no-developertools-dir.patch
+ eapply -p1 "${S}"/${PN}-8.2.1-llvm-prefix-3.patch
+ eapply -p1 "${S}"/${PN}-8.2.1-llvm-shim.patch
eprefixify libstuff/execute.c
cp ../${LD64}/src/other/prune_trie.h include/mach-o/ || die
@@ -200,7 +210,7 @@ compile_ld64() {
LTO=${ENABLE_LTO} \
LTO_INCDIR=${LLVM_INCDIR} \
LTO_LIBDIR=${LLVM_LIBDIR} \
- TAPI=$(use tapi && echo 1 || echo 0) \
+ TAPI=0 \
TAPI_LIBDIR="${EPREFIX}"/usr/lib
use test && emake build_test
@@ -253,19 +263,19 @@ install_cctools() {
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/
+ 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}
+ DSTROOT="\"${D}\"" \
+ USRBINDIR="\"${EPREFIX}\"${BINPATH}" \
+ LIBDIR="\"${EPREFIX}\"${LIBPATH}" \
+ LOCLIBDIR="\"${EPREFIX}\"${LIBPATH}"
# upstream is starting to replace classic binutils with llvm-integrated
# ones. In Xcode, nm and size are now symlinks to llvm-{nm,size} while the
@@ -284,7 +294,7 @@ install_cctools() {
# -> $EPREFIX/usr/lib/llvm/<major/bin/llvm-<tool>
# -> $EPREFIX/usr/bin/llvm-<tool>
# -> binutils-bin/<version>/<tool>-classic
- budir=${D}/${EPREFIX}/${BINPATH}
+ budir="${D}"/${EPREFIX}/${BINPATH}
for tool in nm size ; do
use classic && \
ln -sfn ${tool}-classic "${budir}/${tool}" || \
@@ -304,7 +314,7 @@ install_cctools() {
ln -sfn llvm-shim "${budir}/${tool}"
done
- cd "${ED}"${BINPATH}
+ cd "${ED}"/${BINPATH}
insinto ${DATAPATH}/man/man1
local skips manpage
# ar brings an up-to-date manpage with it
@@ -325,7 +335,7 @@ install_cctools() {
}
src_test() {
- if ! [ "${EPREFIX}"/usr/bin/clang ] ; then
+ if ! [[ -x "${EPREFIX}"/usr/bin/clang ]] ; then
einfo "Test suite only works properly with clang - please install"
return
fi
@@ -351,6 +361,8 @@ src_install() {
install_ld64
install_cctools
+ docompress /usr/share/binutils-data/${CTARGET}/${PV}/man
+
cd "${S}"
insinto /etc/env.d/binutils
cat <<-EOF > env.d
diff --git a/sys-devel/binutils-apple/files/binutils-apple-8.2.1-macos-12.patch b/sys-devel/binutils-apple/files/binutils-apple-8.2.1-macos-12.patch
deleted file mode 100644
index b30f91d44cb5..000000000000
--- a/sys-devel/binutils-apple/files/binutils-apple-8.2.1-macos-12.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Extracted from the patch in
-https://reviews.llvm.org/rG96d071cd0ccc53bbf94bcd6ed4b52c9006b17e15
-License is unclear.
-
-support macOS Monterey by providing definitions which formerly were
-provided
-
---- a/cctools/otool/print_objc.c
-+++ b/cctools/otool/print_objc.c
-@@ -75,6 +75,14 @@
- uint32_t protocols; /* struct objc_protocol_list * (32-bit pointer) */
- };
-
-+#ifndef CLS_GETINFO
-+# define CLS_GETINFO(cls, infomask) ((cls)->info & (infomask))
-+// class is not a metaclass
-+#define CLS_CLASS 0x1
-+// class is a metaclass
-+#define CLS_META 0x2
-+#endif
-+
- struct objc_category_t {
- uint32_t category_name; /* char * (32-bit pointer) */
- uint32_t class_name; /* char * (32-bit pointer) */
diff --git a/sys-devel/binutils-apple/metadata.xml b/sys-devel/binutils-apple/metadata.xml
index e43e477505d4..d64768b87649 100644
--- a/sys-devel/binutils-apple/metadata.xml
+++ b/sys-devel/binutils-apple/metadata.xml
@@ -9,6 +9,8 @@
<flag name="lto">Add support for Link-Time Optimization with LLVM</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>
+ <upstream>
+ <remote-id type="github">grobian/darwin-xtools</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/binutils-config/Manifest b/sys-devel/binutils-config/Manifest
index fd54bdc21c2f..de1dcd4ed1a2 100644
--- a/sys-devel/binutils-config/Manifest
+++ b/sys-devel/binutils-config/Manifest
@@ -1 +1 @@
-DIST binutils-config-5.4.tar.xz 7332 BLAKE2B 1dd0fdebf028e9d95caa395948037d51ac1e627f370921b56fc99a6fe2e2100ddb202c8027ad1e67330306de8b4cbc6a03753105d401198e515b22fca94f760f SHA512 79411afcbec3a6cce960be1b06e4a6efdf55081992f6a92157737f7ef41fc61eaec0005078a4ce0cd78ad6af14583ab85f4f2b7b43808238088d521e1aa31af1
+DIST binutils-config-5.5.tar.xz 7344 BLAKE2B decef43013ca2f7c6d36c12d08d55f499d866b6b1b55ed58f8b2df3761077b5e2c4d09d1f2c40762d42c2d3b9827575833a502b79180ef13b845f1a39a5f2feb SHA512 6f6e21799b47e38cd61621e4ec018dc0db4811f363c0817025c3e3be651d3790b30a0cab233f35fe40b1d57c88daa246037f24a7488187f4e47cca589d87d45b
diff --git a/sys-devel/binutils-config/binutils-config-5.4.ebuild b/sys-devel/binutils-config/binutils-config-5.5.ebuild
index 11e69fe4f773..b6729edc8359 100644
--- a/sys-devel/binutils-config/binutils-config-5.4.ebuild
+++ b/sys-devel/binutils-config/binutils-config-5.5.ebuild
@@ -1,22 +1,20 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
-
-inherit prefix
+EAPI=8
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/binutils-config.git"
inherit git-r3
else
- SRC_URI="https://dev.gentoo.org/~sam/distfiles/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+ SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
DESCRIPTION="Utility to change the binutils version being used"
HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Toolchain"
-LICENSE="GPL-2"
+LICENSE="GPL-2 GPL-2+"
SLOT="0"
IUSE="+native-symlinks"
@@ -29,8 +27,6 @@ src_compile() {
src_install() {
emake DESTDIR="${D}" PV="${PV}" install
-
- use prefix && eprefixify "${ED}"/usr/bin/${PN}
}
pkg_postinst() {
diff --git a/sys-devel/binutils-config/binutils-config-9999.ebuild b/sys-devel/binutils-config/binutils-config-9999.ebuild
index 17daaedfeda0..c1bb9c114e91 100644
--- a/sys-devel/binutils-config/binutils-config-9999.ebuild
+++ b/sys-devel/binutils-config/binutils-config-9999.ebuild
@@ -1,20 +1,20 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/binutils-config.git"
inherit git-r3
else
- SRC_URI="https://dev.gentoo.org/~sam/distfiles/${P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
DESCRIPTION="Utility to change the binutils version being used"
HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Toolchain"
-LICENSE="GPL-2"
+LICENSE="GPL-2 GPL-2+"
SLOT="0"
IUSE="+native-symlinks"
diff --git a/sys-devel/binutils-config/metadata.xml b/sys-devel/binutils-config/metadata.xml
index 34de766f7ebc..b44ab6e35394 100644
--- a/sys-devel/binutils-config/metadata.xml
+++ b/sys-devel/binutils-config/metadata.xml
@@ -8,4 +8,8 @@
<use>
<flag name="native-symlinks">Install native symlinks like 'as' or 'ar' to /usr/bin. Otherwise keep only ${CTARGET}-as and friends.</flag>
</use>
+ <upstream>
+ <remote-id type="gentoo">proj/binutils-config</remote-id>
+ <remote-id type="github">gentoo/binutils-config</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest
index f724d39579b0..253059918a79 100644
--- a/sys-devel/binutils-hppa64/Manifest
+++ b/sys-devel/binutils-hppa64/Manifest
@@ -1,7 +1,13 @@
-DIST binutils-2.35.2-patches-1.tar.xz 11836 BLAKE2B 0141349c9618992d1ab1e0309f7ed8fbc43b60a58be1dfed05eae8a8fee857241d9e112ae673da6fc9778767675f536ece818cb85567367bb1c8f87a0693623f SHA512 35de5f227c745c5fb800784fe657b2a6216faf43e2498e8481e7b0dc79b0d2f86b3b6a10b896e060319a77a51c61d2e1b7a951ae962b3a6ef8c1a2a261d9bb6c
-DIST binutils-2.35.2.tar.xz 22056908 BLAKE2B 9c392e0db2b482442f9476f30bd80cf2796321cbf7be79cf21af7bef167b6074c4ae009dcf9b438d2f2f4a23381c935176b2cfa85de1a526ab46e0fd844a7ca5 SHA512 9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348
-DIST binutils-2.36.1-patches-5.tar.xz 44388 BLAKE2B 1dadb012fe35ec5fb0c5a15d348ab535bc5e3765375c97a3768c6b9f7126e0fda15d35163c9f9c33a4be98662dd120d7c1b21930a20c18dbb5345f56ecd9ecc1 SHA512 a2ce3388f1f1a77ff865481ff4b625121fd55f5234fed0a885312744f2f9c504717de1499b68252c6de64fa45866db7692df91c5838b43fbeb178938811cbe84
-DIST binutils-2.36.1.tar.xz 22772248 BLAKE2B 03fbfbedd6dba2beaa836b1ed254eddd7a54a163d3061fd93edd2b9591cae24ba049b26658c524b5ccecc2f22d431dfa168218d2531aa356945c994fbbe896fa SHA512 cc24590bcead10b90763386b6f96bb027d7594c659c2d95174a6352e8b98465a50ec3e4088d0da038428abe059bbc4ae5f37b269f31a40fc048072c8a234f4e9
-DIST binutils-2.37_p1-patches-0.tar.xz 1392 BLAKE2B 128930a381022fea5d1fcb0695953e8dada2513b088b8540fe08d4e0da93ec18b6bf9c78acad6ec5a8982ae2c115d143462ef0bb7bfd63cfeb06c10ad472c2f8 SHA512 44666821f96349e96685ffcfd53a80a94659e38fc63eeeb980d0eed13aab03ae3e2d5059b4932cd9018f2f7698cdb5e15b443d60c01b2bd1385eeb0c698e0e24
-DIST binutils-2.37_p1-patches-1.tar.xz 28956 BLAKE2B 3bc14fcc52a6d11992ad9ed88fa3347ca3d5facd59de094a178a5f720d0eed6297dadf9a8fea7189076eb81274612c0b71c01f15a8f58deeaed8c8f6135ef50d SHA512 f6b2a09bfc692cf90f6cd56be81f424a68831db48054dc150eb6ec28bfa18d35933203c2d3b502f0c80e38771353c373446aec2488469fe2df20d8066033f59e
+DIST binutils-2.37_p1-patches-2.tar.xz 31956 BLAKE2B 39c48628d0e2d7f3a8cf11be391b51dc64c7a534a3e64950fd992907c34fa36bebdf95cc5a184dd5b35e134e0c20376b5883abbf96ae57403c55377e615a6790 SHA512 c927aafa8c87e3b68ad28da5a17edf5647591ec26feeb56c743bc6637ffb10832b50ec6fd8442e80e40628b624e31b2f0f0b5f1193e77dc7e5442df0cb8cc8f1
DIST binutils-2.37_p1.tar.xz 22992196 BLAKE2B a8aa0f386d03a5b1466166ac7c40989c228351ccf0949a9b462b4d4615d70ab7e1a45351299140a42baf39c317b8007733c253eb547ee1dfadb612addde11621 SHA512 46c297ec2a7a5b81d1c6e3f16486a6dc2860a07520fe2dd8871d1eb5160065bbe2cc6b0415d5352bf12284133e5817a4e429e6077182d615e969bd1a8f52ed28
+DIST binutils-2.38-patches-4.tar.xz 193852 BLAKE2B 5a83e20008e58464ed563a6817a367e50684c59d08c47345cc546054269c42463d1651441720f865851e4e182e917df1a095c68e64226e0351b64e975d524096 SHA512 6657e547bb02898632cc45a8f1894be098aa7472b6725b65f95393e621abb127e468b4e50310720bf03f7e8d0a68bc2c47af76fc43aaa8f32b2e4a149c0c6290
+DIST binutils-2.38.tar.xz 23651408 BLAKE2B 19ede396ec97b88e632aded2f69f4684cc5053109e06c3c4a1934944e3f0ceaa9e4a2604528a440189771f778cb5d75edd510163970eeea31afba87fa256feba SHA512 8bf0b0d193c9c010e0518ee2b2e5a830898af206510992483b427477ed178396cd210235e85fd7bd99a96fc6d5eedbeccbd48317a10f752b7336ada8b2bb826d
+DIST binutils-2.39-patches-6.tar.xz 92380 BLAKE2B 39f490f1134fb0e7dc80924a280d3113efe0ed094ee15de97c42ab751c83d2f5aa7448966d8cbbcde722b2af4999a36c1e5aa2f37ca6d2e3942b97b6d90ff152 SHA512 213cd7a86da83987966675f3195e843d898ca4ff412dfc29fd33ed80adb7bbf80a0b2919cd8e7dd49208c73a621ab7b720970f2259418bdc82ed2a568ff62064
+DIST binutils-2.39.tar.xz 25167756 BLAKE2B ac6a5296c6586d53eaadcbffc5c399a6d79edf72450b9bb8b3525ce525129cef3d2eb90c85ef3bb3270b5a03b0e1ffb8f0b705f028158726f9777ebb8685066f SHA512 68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3
+DIST binutils-2.40-patches-6.tar.xz 299212 BLAKE2B 3a68a924e9747fdd0486327a5bd2490cb72376f2cb6c6a60030d8c6b71357150d956a1e71d91683d43b571cb5bf738270880f72ef175d6c8faa257b090abeb8b SHA512 984dab529276ab4f9d215f643c7c18bd1793f438aaad0be158d209787c9c4a6bb68b10bec2065d3fe14a1594d5f1c29f55b2e9bac34a6f489f4b466c02e24766
+DIST binutils-2.40.tar.xz 25241484 BLAKE2B 8d799f7c595f878b9af5b17a490021dd8b8300ac2fe0ed8574c012929d22d2d0493e003a3e631a9436e8e712da801779b777c566167fe42b0bde119ffa5ad1c2 SHA512 a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925
+DIST binutils-2.41-patches-4.tar.xz 86580 BLAKE2B 32748fd0e81a7e323e9f56f0864f2a1755b8fe1b09c777075e31a292297e365c47b47003f8f1bffacc254ed8dccf1c655b7b13f61da751c9db090e56d819fbb2 SHA512 90dcf38c1ed2ae015eb9de922e946e2be62355bd51276075e7f1c0a06cd52408057c4151a2d2d4c07e33c1d2c5998001cba5509819e5722cce45f70172465ea5
+DIST binutils-2.41-patches-5.tar.xz 95176 BLAKE2B bbc94b3c7d70653a1056afe57a120b6eac9f0c8f51f05e95a1b5f80f2b7ef35e6355d740b49bc1ec2f3a13a838d5210ff4a205aa2bde5a72bc55c12100bce726 SHA512 ad293f97116f71322993f381c1af69fad1719a159f127ff16ddeca62f9b9b62aaf141abfa661985a61e9be7ae0639772148e69293a97364eebbf49182babb691
+DIST binutils-2.41.tar.xz 26765692 BLAKE2B 3bccec2b52f7e82a727121bf2a2e51a6249ba63dcd74c665fd834e858645c912ffd8245d848435288b938852830b482905606f55c40df4061215fd75c52ffc75 SHA512 5df45d0bd6ddabdce4f35878c041e46a92deef01e7dea5facc97fd65cc06b59abc6fba0eb454b68e571c7e14038dc823fe7f2263843e6e627b7444eaf0fe9374
+DIST binutils-2.42-patches-3.tar.xz 34768 BLAKE2B e4bfaf3b42147408a8a3dcb00f50378a6b49aef8e939731a92598680cfbf42dfdf842c3f5bf3458867f79c534eb92385bc64f34f7b1d6462ec4182b5f424fbe5 SHA512 3d75e0684bbfa2cc3fc6dfcb5488ac571db58f1a5833fcc754f231664137001ccb0f2ec750947b8021fa12daf614eb2cd21b598bd962d71a34bb8ea38805850d
+DIST binutils-2.42.tar.xz 27567160 BLAKE2B e67a5c028fba70e70088fd11b38ec8c9c4ed5a019badefda25abeb6275997b16f0891e7ff3424c4b82bbfae92e8992669826920dd53df61cd48469d8f7cd5bd1 SHA512 155f3ba14cd220102f4f29a4f1e5cfee3c48aa03b74603460d05afb73c70d6657a9d87eee6eb88bf13203fe6f31177a5c9addc04384e956e7da8069c8ecd20a6
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.35.2.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.35.2.ebuild
deleted file mode 100644
index d9ffb17a0c13..000000000000
--- a/sys-devel/binutils-hppa64/binutils-hppa64-2.35.2.ebuild
+++ /dev/null
@@ -1,432 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-export CTARGET=hppa64-${CHOST#*-}
-
-inherit eutils libtool flag-o-matic gnuconfig multilib toolchain-funcs
-
-DESCRIPTION="Tools necessary to build programs"
-HOMEPAGE="https://sourceware.org/binutils/"
-LICENSE="GPL-3+"
-IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test"
-REQUIRED_USE="default-gold? ( gold )"
-
-# Variables that can be set here:
-# PATCH_VER - the patchset version
-# Default: empty, no patching
-# PATCH_BINUTILS_VER - the binutils version in the patchset name
-# - Default: PV
-# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
-# for the patchsets
-
-PATCH_VER=1
-PATCH_DEV=dilfridge
-
-case ${PV} in
- 9999)
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- S=${WORKDIR}/binutils
- EGIT_CHECKOUT_DIR=${S}
- SLOT=${PV}
- ;;
- *)
- SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
- SLOT=$(ver_cut 1-2)
- KEYWORDS="-* hppa"
- ;;
-esac
-
-#
-# The Gentoo patchset
-#
-PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
-PATCH_DEV=${PATCH_DEV:-slyfox}
-
-[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
- https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
-
-#
-# The cross-compile logic
-#
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-
-#
-# The dependencies
-#
-RDEPEND="
- >=sys-devel/binutils-config-3
- sys-libs/zlib
-"
-DEPEND="${RDEPEND}"
-BDEPEND="
- doc? ( sys-apps/texinfo )
- test? ( dev-util/dejagnu )
- nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
-"
-
-RESTRICT="!test? ( test )"
-
-MY_BUILDDIR=${WORKDIR}/build
-S=${WORKDIR}/${P/-hppa64/}
-
-src_unpack() {
- case ${PV} in
- *9999)
- git-r3_src_unpack
- ;;
- *)
- ;;
- esac
- default
- mkdir -p "${MY_BUILDDIR}"
-}
-
-src_prepare() {
- if [[ ! -z ${PATCH_VER} ]] ; then
- einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
- eapply "${WORKDIR}/patch"/*.patch
- fi
-
- # Make sure our explicit libdir paths don't get clobbered. #562460
- sed -i \
- -e 's:@bfdlibdir@:@libdir@:g' \
- -e 's:@bfdincludedir@:@includedir@:g' \
- {bfd,opcodes}/Makefile.in || die
-
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
- # Fix conflicts with newer glibc #272594
- if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
- sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
- fi
-
- # Apply things from PATCHES and user dirs
- default
-
- # Run misc portage update scripts
- gnuconfig_update
- elibtoolize --portage --no-uclibc
-}
-
-toolchain-binutils_bugurl() {
- printf "https://bugs.gentoo.org/"
-}
-toolchain-binutils_pkgversion() {
- printf "Gentoo ${PV}"
- [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
-}
-
-src_configure() {
- # Setup some paths
- LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
- INCPATH=${LIBPATH}/include
- DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
- if is_cross ; then
- TOOLPATH=/usr/${CHOST}/${CTARGET}
- else
- TOOLPATH=/usr/${CTARGET}
- fi
- BINPATH=${TOOLPATH}/binutils-bin/${PV}
-
- # Make sure we filter $LINGUAS so that only ones that
- # actually work make it through #42033
- strip-linguas -u */po
-
- # Keep things sane
- strip-flags
-
- local x
- echo
- for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
- einfo "$(printf '%10s' ${x}:) ${!x}"
- done
- echo
-
- cd "${MY_BUILDDIR}"
- local myconf=()
-
- if use plugins ; then
- myconf+=( --enable-plugins )
- fi
- # enable gold (installed as ld.gold) and ld's plugin architecture
- if use gold ; then
- myconf+=( --enable-gold )
- if use default-gold; then
- myconf+=( --enable-gold=default )
- fi
- fi
-
- if use nls ; then
- myconf+=( --without-included-gettext )
- else
- myconf+=( --disable-nls )
- fi
-
- myconf+=( --with-system-zlib )
-
- # For bi-arch systems, enable a 64bit bfd. This matches
- # the bi-arch logic in toolchain.eclass. #446946
- # We used to do it for everyone, but it's slow on 32bit arches. #438522
- case $(tc-arch) in
- ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
- esac
-
- use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
-
- [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
-
- is_cross && myconf+=(
- --with-sysroot="${EPREFIX}"/usr/${CTARGET}
- --enable-poison-system-directories
- )
-
- # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
- # on everyone in alpha (for now), we'll just enable it when possible
- has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
- has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
-
- # mips can't do hash-style=gnu ...
- if [[ $(tc-arch) != mips ]] ; then
- myconf+=( --enable-default-hash-style=gnu )
- fi
-
- myconf+=(
- --prefix="${EPREFIX}"/usr
- --host=${CHOST}
- --target=${CTARGET}
- --datadir="${EPREFIX}"${DATAPATH}
- --datarootdir="${EPREFIX}"${DATAPATH}
- --infodir="${EPREFIX}"${DATAPATH}/info
- --mandir="${EPREFIX}"${DATAPATH}/man
- --bindir="${EPREFIX}"${BINPATH}
- --libdir="${EPREFIX}"${LIBPATH}
- --libexecdir="${EPREFIX}"${LIBPATH}
- --includedir="${EPREFIX}"${INCPATH}
- --enable-obsolete
- --enable-shared
- --enable-threads
- # Newer versions (>=2.27) offer a configure flag now.
- --enable-relro
- # Newer versions (>=2.24) make this an explicit option. #497268
- --enable-install-libiberty
- --disable-werror
- --with-bugurl="$(toolchain-binutils_bugurl)"
- --with-pkgversion="$(toolchain-binutils_pkgversion)"
- $(use_enable static-libs static)
- ${EXTRA_ECONF}
- # Disable modules that are in a combined binutils/gdb tree. #490566
- --disable-{gdb,libdecnumber,readline,sim}
- # Strip out broken static link flags.
- # https://gcc.gnu.org/PR56750
- --without-stage1-ldflags
- # Change SONAME to avoid conflict across
- # {native,cross}/binutils, binutils-libs. #666100
- --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
-
- # avoid automagic dependency on (currently prefix) systems
- # systems with debuginfod library, bug #754753
- --without-debuginfod
-
- # Allow user to opt into CET for host libraries.
- # Ideally we would like automagic-or-disabled here.
- # But the check does not quite work on i686: bug #760926.
- $(use_enable cet)
- )
- echo ./configure "${myconf[@]}"
- "${S}"/configure "${myconf[@]}" || die
-
- # Prevent makeinfo from running if doc is unset.
- if ! use doc ; then
- sed -i \
- -e '/^MAKEINFO/s:=.*:= true:' \
- Makefile || die
- fi
-}
-
-src_compile() {
- cd "${MY_BUILDDIR}"
- # see Note [tooldir hack for ldscripts]
- emake tooldir="${EPREFIX}${TOOLPATH}" all
-
- # only build info pages if the user wants them
- if use doc ; then
- emake info
- fi
-
- # we nuke the manpages when we're left with junk
- # (like when we bootstrap, no perl -> no manpages)
- find . -name '*.1' -a -size 0 -delete
-}
-
-src_test() {
- cd "${MY_BUILDDIR}"
- # bug 637066
- filter-flags -Wall -Wreturn-type
- emake -k check
-}
-
-src_install() {
- local x d
-
- cd "${MY_BUILDDIR}"
- # see Note [tooldir hack for ldscripts]
- emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
- rm -rf "${ED}"/${LIBPATH}/bin
- use static-libs || find "${ED}" -name '*.la' -delete
-
- # Newer versions of binutils get fancy with ${LIBPATH} #171905
- cd "${ED}"/${LIBPATH}
- for d in ../* ; do
- [[ ${d} == ../${PV} ]] && continue
- mv ${d}/* . || die
- rmdir ${d} || die
- done
-
- # Now we collect everything intp the proper SLOT-ed dirs
- # When something is built to cross-compile, it installs into
- # /usr/$CHOST/ by default ... we have to 'fix' that :)
- if is_cross ; then
- cd "${ED}"/${BINPATH}
- for x in * ; do
- mv ${x} ${x/${CTARGET}-}
- done
-
- if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
- mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
- mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
- rm -r "${ED}"/usr/${CHOST}/{include,lib}
- fi
- fi
- insinto ${INCPATH}
- local libiberty_headers=(
- # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
- demangle.h
- dyn-string.h
- fibheap.h
- hashtab.h
- libiberty.h
- objalloc.h
- splay-tree.h
- )
- doins "${libiberty_headers[@]/#/${S}/include/}"
- if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
- mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
- rm -r "${ED}"/${LIBPATH}/lib
- fi
-
- # Generate an env.d entry for this binutils
- insinto /etc/env.d/binutils
- cat <<-EOF > "${T}"/env.d
- TARGET="${CTARGET}"
- VER="${PV}"
- LIBPATH="${EPREFIX}${LIBPATH}"
- EOF
- newins "${T}"/env.d ${CTARGET}-${PV}
-
- # Handle documentation
- if ! is_cross ; then
- cd "${S}"
- dodoc README
- docinto bfd
- dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
- docinto binutils
- dodoc binutils/ChangeLog binutils/NEWS binutils/README
- docinto gas
- dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
- docinto gprof
- dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
- docinto ld
- dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
- docinto libiberty
- dodoc libiberty/ChangeLog* libiberty/README
- docinto opcodes
- dodoc opcodes/ChangeLog*
- fi
-
- # Remove shared info pages
- rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
-
- # Trim all empty dirs
- find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
-
- # the hppa64 hack; this should go into 9999 as a PN-conditional
- # tweak the default fake list a little bit
- cd "${D}"/etc/env.d/binutils
- sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
-}
-
-pkg_postinst() {
- # Make sure this ${CTARGET} has a binutils version selected
- [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
- binutils-config ${CTARGET}-${PV}
-}
-
-pkg_postrm() {
- local current_profile=$(binutils-config -c ${CTARGET})
-
- # If no other versions exist, then uninstall for this
- # target ... otherwise, switch to the newest version
- # Note: only do this if this version is unmerged. We
- # rerun binutils-config if this is a remerge, as
- # we want the mtimes on the symlinks updated (if
- # it is the same as the current selected profile)
- if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
- local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
- choice=${choice//$'\n'/ }
- choice=${choice/* }
- if [[ -z ${choice} ]] ; then
- binutils-config -u ${CTARGET}
- else
- binutils-config ${choice}
- fi
- elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
- binutils-config ${CTARGET}-${PV}
- fi
-}
-# Note [slotting support]
-# -----------------------
-# Gentoo's layout for binutils files is non-standard as Gentoo
-# supports slotted installation for binutils. Many tools
-# still expect binutils to reside in known locations.
-# binutils-config package restores symlinks into known locations,
-# like:
-# /usr/bin/${CTARGET}-<tool>
-# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
-# /usr/include/
-#
-# Note [tooldir hack for ldscripts]
-# ---------------------------------
-# Build system does not allow ./configure to tweak every location
-# we need for slotting binutils hence all the shuffling in
-# src_install(). This note is about SCRIPTDIR define handling.
-#
-# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
-# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
-# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
-# Thus we can't just move files around after compilation finished.
-#
-# Our goal is the following:
-# - at build-time set scriptdir to point to symlinked location:
-# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
-# - at install-time set scriptdir to point to slotted location:
-# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.36.1-r2.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.36.1-r2.ebuild
deleted file mode 100644
index 4350678795e6..000000000000
--- a/sys-devel/binutils-hppa64/binutils-hppa64-2.36.1-r2.ebuild
+++ /dev/null
@@ -1,432 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-export CTARGET=hppa64-${CHOST#*-}
-
-inherit eutils libtool flag-o-matic gnuconfig multilib toolchain-funcs
-
-DESCRIPTION="Tools necessary to build programs"
-HOMEPAGE="https://sourceware.org/binutils/"
-LICENSE="GPL-3+"
-IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test"
-REQUIRED_USE="default-gold? ( gold )"
-
-# Variables that can be set here:
-# PATCH_VER - the patchset version
-# Default: empty, no patching
-# PATCH_BINUTILS_VER - the binutils version in the patchset name
-# - Default: PV
-# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
-# for the patchsets
-
-PATCH_VER=5
-PATCH_DEV=dilfridge
-
-case ${PV} in
- 9999)
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- S=${WORKDIR}/binutils
- EGIT_CHECKOUT_DIR=${S}
- SLOT=${PV}
- ;;
- *)
- SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
- SLOT=$(ver_cut 1-2)
- KEYWORDS="-* hppa"
- ;;
-esac
-
-#
-# The Gentoo patchset
-#
-PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
-PATCH_DEV=${PATCH_DEV:-slyfox}
-
-[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
- https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
-
-#
-# The cross-compile logic
-#
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-
-#
-# The dependencies
-#
-RDEPEND="
- >=sys-devel/binutils-config-3
- sys-libs/zlib
-"
-DEPEND="${RDEPEND}"
-BDEPEND="
- doc? ( sys-apps/texinfo )
- test? ( dev-util/dejagnu )
- nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
-"
-
-RESTRICT="!test? ( test )"
-
-MY_BUILDDIR=${WORKDIR}/build
-S=${WORKDIR}/${P/-hppa64/}
-
-src_unpack() {
- case ${PV} in
- *9999)
- git-r3_src_unpack
- ;;
- *)
- ;;
- esac
- default
- mkdir -p "${MY_BUILDDIR}"
-}
-
-src_prepare() {
- if [[ ! -z ${PATCH_VER} ]] ; then
- einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
- eapply "${WORKDIR}/patch"/*.patch
- fi
-
- # Make sure our explicit libdir paths don't get clobbered. #562460
- sed -i \
- -e 's:@bfdlibdir@:@libdir@:g' \
- -e 's:@bfdincludedir@:@includedir@:g' \
- {bfd,opcodes}/Makefile.in || die
-
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
- # Fix conflicts with newer glibc #272594
- if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
- sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
- fi
-
- # Apply things from PATCHES and user dirs
- default
-
- # Run misc portage update scripts
- gnuconfig_update
- elibtoolize --portage --no-uclibc
-}
-
-toolchain-binutils_bugurl() {
- printf "https://bugs.gentoo.org/"
-}
-toolchain-binutils_pkgversion() {
- printf "Gentoo ${PV}"
- [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
-}
-
-src_configure() {
- # Setup some paths
- LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
- INCPATH=${LIBPATH}/include
- DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
- if is_cross ; then
- TOOLPATH=/usr/${CHOST}/${CTARGET}
- else
- TOOLPATH=/usr/${CTARGET}
- fi
- BINPATH=${TOOLPATH}/binutils-bin/${PV}
-
- # Make sure we filter $LINGUAS so that only ones that
- # actually work make it through #42033
- strip-linguas -u */po
-
- # Keep things sane
- strip-flags
-
- local x
- echo
- for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
- einfo "$(printf '%10s' ${x}:) ${!x}"
- done
- echo
-
- cd "${MY_BUILDDIR}"
- local myconf=()
-
- if use plugins ; then
- myconf+=( --enable-plugins )
- fi
- # enable gold (installed as ld.gold) and ld's plugin architecture
- if use gold ; then
- myconf+=( --enable-gold )
- if use default-gold; then
- myconf+=( --enable-gold=default )
- fi
- fi
-
- if use nls ; then
- myconf+=( --without-included-gettext )
- else
- myconf+=( --disable-nls )
- fi
-
- myconf+=( --with-system-zlib )
-
- # For bi-arch systems, enable a 64bit bfd. This matches
- # the bi-arch logic in toolchain.eclass. #446946
- # We used to do it for everyone, but it's slow on 32bit arches. #438522
- case $(tc-arch) in
- ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
- esac
-
- use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
-
- [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
-
- is_cross && myconf+=(
- --with-sysroot="${EPREFIX}"/usr/${CTARGET}
- --enable-poison-system-directories
- )
-
- # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
- # on everyone in alpha (for now), we'll just enable it when possible
- has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
- has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
-
- # mips can't do hash-style=gnu ...
- if [[ $(tc-arch) != mips ]] ; then
- myconf+=( --enable-default-hash-style=gnu )
- fi
-
- myconf+=(
- --prefix="${EPREFIX}"/usr
- --host=${CHOST}
- --target=${CTARGET}
- --datadir="${EPREFIX}"${DATAPATH}
- --datarootdir="${EPREFIX}"${DATAPATH}
- --infodir="${EPREFIX}"${DATAPATH}/info
- --mandir="${EPREFIX}"${DATAPATH}/man
- --bindir="${EPREFIX}"${BINPATH}
- --libdir="${EPREFIX}"${LIBPATH}
- --libexecdir="${EPREFIX}"${LIBPATH}
- --includedir="${EPREFIX}"${INCPATH}
- --enable-obsolete
- --enable-shared
- --enable-threads
- # Newer versions (>=2.27) offer a configure flag now.
- --enable-relro
- # Newer versions (>=2.24) make this an explicit option. #497268
- --enable-install-libiberty
- --disable-werror
- --with-bugurl="$(toolchain-binutils_bugurl)"
- --with-pkgversion="$(toolchain-binutils_pkgversion)"
- $(use_enable static-libs static)
- ${EXTRA_ECONF}
- # Disable modules that are in a combined binutils/gdb tree. #490566
- --disable-{gdb,libdecnumber,readline,sim}
- # Strip out broken static link flags.
- # https://gcc.gnu.org/PR56750
- --without-stage1-ldflags
- # Change SONAME to avoid conflict across
- # {native,cross}/binutils, binutils-libs. #666100
- --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
-
- # avoid automagic dependency on (currently prefix) systems
- # systems with debuginfod library, bug #754753
- --without-debuginfod
-
- # Allow user to opt into CET for host libraries.
- # Ideally we would like automagic-or-disabled here.
- # But the check does not quite work on i686: bug #760926.
- $(use_enable cet)
- )
- echo ./configure "${myconf[@]}"
- "${S}"/configure "${myconf[@]}" || die
-
- # Prevent makeinfo from running if doc is unset.
- if ! use doc ; then
- sed -i \
- -e '/^MAKEINFO/s:=.*:= true:' \
- Makefile || die
- fi
-}
-
-src_compile() {
- cd "${MY_BUILDDIR}"
- # see Note [tooldir hack for ldscripts]
- emake tooldir="${EPREFIX}${TOOLPATH}" all
-
- # only build info pages if the user wants them
- if use doc ; then
- emake info
- fi
-
- # we nuke the manpages when we're left with junk
- # (like when we bootstrap, no perl -> no manpages)
- find . -name '*.1' -a -size 0 -delete
-}
-
-src_test() {
- cd "${MY_BUILDDIR}"
- # bug 637066
- filter-flags -Wall -Wreturn-type
- emake -k check
-}
-
-src_install() {
- local x d
-
- cd "${MY_BUILDDIR}"
- # see Note [tooldir hack for ldscripts]
- emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
- rm -rf "${ED}"/${LIBPATH}/bin
- use static-libs || find "${ED}" -name '*.la' -delete
-
- # Newer versions of binutils get fancy with ${LIBPATH} #171905
- cd "${ED}"/${LIBPATH}
- for d in ../* ; do
- [[ ${d} == ../${PV} ]] && continue
- mv ${d}/* . || die
- rmdir ${d} || die
- done
-
- # Now we collect everything intp the proper SLOT-ed dirs
- # When something is built to cross-compile, it installs into
- # /usr/$CHOST/ by default ... we have to 'fix' that :)
- if is_cross ; then
- cd "${ED}"/${BINPATH}
- for x in * ; do
- mv ${x} ${x/${CTARGET}-}
- done
-
- if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
- mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
- mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
- rm -r "${ED}"/usr/${CHOST}/{include,lib}
- fi
- fi
- insinto ${INCPATH}
- local libiberty_headers=(
- # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
- demangle.h
- dyn-string.h
- fibheap.h
- hashtab.h
- libiberty.h
- objalloc.h
- splay-tree.h
- )
- doins "${libiberty_headers[@]/#/${S}/include/}"
- if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
- mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
- rm -r "${ED}"/${LIBPATH}/lib
- fi
-
- # Generate an env.d entry for this binutils
- insinto /etc/env.d/binutils
- cat <<-EOF > "${T}"/env.d
- TARGET="${CTARGET}"
- VER="${PV}"
- LIBPATH="${EPREFIX}${LIBPATH}"
- EOF
- newins "${T}"/env.d ${CTARGET}-${PV}
-
- # Handle documentation
- if ! is_cross ; then
- cd "${S}"
- dodoc README
- docinto bfd
- dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
- docinto binutils
- dodoc binutils/ChangeLog binutils/NEWS binutils/README
- docinto gas
- dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
- docinto gprof
- dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
- docinto ld
- dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
- docinto libiberty
- dodoc libiberty/ChangeLog* libiberty/README
- docinto opcodes
- dodoc opcodes/ChangeLog*
- fi
-
- # Remove shared info pages
- rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
-
- # Trim all empty dirs
- find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
-
- # the hppa64 hack; this should go into 9999 as a PN-conditional
- # tweak the default fake list a little bit
- cd "${D}"/etc/env.d/binutils
- sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
-}
-
-pkg_postinst() {
- # Make sure this ${CTARGET} has a binutils version selected
- [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
- binutils-config ${CTARGET}-${PV}
-}
-
-pkg_postrm() {
- local current_profile=$(binutils-config -c ${CTARGET})
-
- # If no other versions exist, then uninstall for this
- # target ... otherwise, switch to the newest version
- # Note: only do this if this version is unmerged. We
- # rerun binutils-config if this is a remerge, as
- # we want the mtimes on the symlinks updated (if
- # it is the same as the current selected profile)
- if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
- local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
- choice=${choice//$'\n'/ }
- choice=${choice/* }
- if [[ -z ${choice} ]] ; then
- binutils-config -u ${CTARGET}
- else
- binutils-config ${choice}
- fi
- elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
- binutils-config ${CTARGET}-${PV}
- fi
-}
-# Note [slotting support]
-# -----------------------
-# Gentoo's layout for binutils files is non-standard as Gentoo
-# supports slotted installation for binutils. Many tools
-# still expect binutils to reside in known locations.
-# binutils-config package restores symlinks into known locations,
-# like:
-# /usr/bin/${CTARGET}-<tool>
-# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
-# /usr/include/
-#
-# Note [tooldir hack for ldscripts]
-# ---------------------------------
-# Build system does not allow ./configure to tweak every location
-# we need for slotting binutils hence all the shuffling in
-# src_install(). This note is about SCRIPTDIR define handling.
-#
-# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
-# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
-# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
-# Thus we can't just move files around after compilation finished.
-#
-# Our goal is the following:
-# - at build-time set scriptdir to point to symlinked location:
-# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
-# - at install-time set scriptdir to point to slotted location:
-# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1-r2.ebuild
index 7607479c80a1..144ce57e1699 100644
--- a/sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1.ebuild
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1-r2.ebuild
@@ -1,16 +1,16 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
export CTARGET=hppa64-${CHOST#*-}
-inherit eutils libtool flag-o-matic gnuconfig multilib toolchain-funcs
+inherit libtool flag-o-matic gnuconfig multilib strip-linguas toolchain-funcs
DESCRIPTION="Tools necessary to build programs"
HOMEPAGE="https://sourceware.org/binutils/"
LICENSE="GPL-3+"
-IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
+IUSE="cet default-gold doc +gold multitarget +nls pgo +plugins static-libs test vanilla"
REQUIRED_USE="default-gold? ( gold )"
# Variables that can be set here (ignored for live ebuilds)
@@ -21,7 +21,7 @@ REQUIRED_USE="default-gold? ( gold )"
# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
# for the patchsets
-PATCH_VER=0
+PATCH_VER=2
PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
@@ -34,7 +34,6 @@ else
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
SLOT=$(ver_cut 1-2)
- # live ebuild
KEYWORDS="-* hppa"
fi
@@ -61,11 +60,11 @@ BDEPEND="
doc? ( sys-apps/texinfo )
test? (
dev-util/dejagnu
- sys-devel/bc
+ app-alternatives/bc
)
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -109,7 +108,7 @@ src_prepare() {
patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
fi
- if [[ ! -z ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
if ! use vanilla; then
einfo "Applying binutils patchset ${patchsetname}"
eapply "${WORKDIR}/patch"
@@ -123,17 +122,6 @@ src_prepare() {
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
# Fix conflicts with newer glibc #272594
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
@@ -174,6 +162,8 @@ src_configure() {
# Keep things sane
strip-flags
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -274,7 +264,15 @@ src_configure() {
# Ideally we would like automagic-or-disabled here.
# But the check does not quite work on i686: bug #760926.
$(use_enable cet)
+
+ # No LTO for HPPA64 right now as we don't build kgcc64 with LTO support.
+ $(use_enable pgo pgo-build)
)
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+
echo ./configure "${myconf[@]}"
"${S}"/configure "${myconf[@]}" || die
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1-r1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.38-r2.ebuild
index 1e073a1a806a..909ed7c262ce 100644
--- a/sys-devel/binutils-hppa64/binutils-hppa64-2.37_p1-r1.ebuild
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.38-r2.ebuild
@@ -1,16 +1,17 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
export CTARGET=hppa64-${CHOST#*-}
-inherit eutils libtool flag-o-matic gnuconfig multilib toolchain-funcs
+inherit libtool flag-o-matic gnuconfig multilib strip-linguas toolchain-funcs
DESCRIPTION="Tools necessary to build programs"
HOMEPAGE="https://sourceware.org/binutils/"
+
LICENSE="GPL-3+"
-IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
+IUSE="cet default-gold doc +gold multitarget +nls pgo +plugins static-libs test vanilla"
REQUIRED_USE="default-gold? ( gold )"
# Variables that can be set here (ignored for live ebuilds)
@@ -21,7 +22,7 @@ REQUIRED_USE="default-gold? ( gold )"
# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
# for the patchsets
-PATCH_VER=1
+PATCH_VER=4
PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
@@ -34,8 +35,7 @@ else
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
SLOT=$(ver_cut 1-2)
- # live ebuild
- KEYWORDS="-* ~hppa"
+ KEYWORDS="-* hppa"
fi
#
@@ -61,28 +61,28 @@ BDEPEND="
doc? ( sys-apps/texinfo )
test? (
dev-util/dejagnu
- sys-devel/bc
+ app-alternatives/bc
)
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
-MY_BUILDDIR=${WORKDIR}/build
-S=${WORKDIR}/${P/-hppa64/}
+MY_BUILDDIR="${WORKDIR}"/build
+S="${WORKDIR}"/${P/-hppa64/}
src_unpack() {
if [[ ${PV} == 9999* ]] ; then
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
- EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ EGIT_CHECKOUT_DIR="${WORKDIR}"/patches-git
git-r3_src_unpack
mv patches-git/9999 patch || die
+ S="${WORKDIR}"/binutils
EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- S=${WORKDIR}/binutils
- EGIT_CHECKOUT_DIR=${S}
+ EGIT_CHECKOUT_DIR="${S}"
git-r3_src_unpack
else
unpack ${P/-hppa64/}.tar.xz
@@ -94,7 +94,7 @@ src_unpack() {
local dir=${P%_p?}
dir=${dir/-hppa64/}
- S=${WORKDIR}/${dir}
+ S="${WORKDIR}"/${dir}
fi
cd "${WORKDIR}" || die
@@ -109,7 +109,7 @@ src_prepare() {
patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
fi
- if [[ ! -z ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
if ! use vanilla; then
einfo "Applying binutils patchset ${patchsetname}"
eapply "${WORKDIR}/patch"
@@ -117,28 +117,12 @@ src_prepare() {
fi
fi
- # Make sure our explicit libdir paths don't get clobbered. #562460
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
sed -i \
-e 's:@bfdlibdir@:@libdir@:g' \
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
- # Fix conflicts with newer glibc #272594
- if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
- sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
- fi
-
# Apply things from PATCHES and user dirs
default
@@ -156,6 +140,11 @@ toolchain-binutils_pkgversion() {
}
src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
# Setup some paths
LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
INCPATH=${LIBPATH}/include
@@ -168,12 +157,14 @@ src_configure() {
BINPATH=${TOOLPATH}/binutils-bin/${PV}
# Make sure we filter $LINGUAS so that only ones that
- # actually work make it through #42033
+ # actually work make it through, bug #42033
strip-linguas -u */po
# Keep things sane
strip-flags
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -181,7 +172,7 @@ src_configure() {
done
echo
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
local myconf=()
if use plugins ; then
@@ -203,9 +194,10 @@ src_configure() {
myconf+=( --with-system-zlib )
- # For bi-arch systems, enable a 64bit bfd. This matches
- # the bi-arch logic in toolchain.eclass. #446946
- # We used to do it for everyone, but it's slow on 32bit arches. #438522
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
case $(tc-arch) in
ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
esac
@@ -219,10 +211,7 @@ src_configure() {
--enable-poison-system-directories
)
- # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
- # on everyone in alpha (for now), we'll just enable it when possible
- has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
- has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
+ myconf+=( --enable-secureplt )
# mips can't do hash-style=gnu ...
if [[ $(tc-arch) != mips ]] ; then
@@ -246,24 +235,23 @@ src_configure() {
--enable-threads
# Newer versions (>=2.27) offer a configure flag now.
--enable-relro
- # Newer versions (>=2.24) make this an explicit option. #497268
+ # Newer versions (>=2.24) make this an explicit option, bug #497268
--enable-install-libiberty
# Available from 2.35 on
--enable-textrel-check=warning
- # Works better than vapier's patch... #808787
+ # Works better than vapier's patch., bug #808787
--enable-new-dtags
--disable-werror
--with-bugurl="$(toolchain-binutils_bugurl)"
--with-pkgversion="$(toolchain-binutils_pkgversion)"
$(use_enable static-libs static)
- ${EXTRA_ECONF}
- # Disable modules that are in a combined binutils/gdb tree. #490566
+ # Disable modules that are in a combined binutils/gdb tree. bug #490566
--disable-{gdb,libdecnumber,readline,sim}
# Strip out broken static link flags.
# https://gcc.gnu.org/PR56750
--without-stage1-ldflags
# Change SONAME to avoid conflict across
- # {native,cross}/binutils, binutils-libs. #666100
+ # {native,cross}/binutils, binutils-libs. bug #666100
--with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
# avoid automagic dependency on (currently prefix) systems
@@ -274,9 +262,19 @@ src_configure() {
# Ideally we would like automagic-or-disabled here.
# But the check does not quite work on i686: bug #760926.
$(use_enable cet)
+
)
- echo ./configure "${myconf[@]}"
- "${S}"/configure "${myconf[@]}" || die
+
+ if ! is_cross ; then
+ # No LTO for HPPA64 right now as we don't build kgcc64 with LTO support.
+ myconf+=( $(use_enable pgo pgo-build) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" || die
# Prevent makeinfo from running if doc is unset.
if ! use doc ; then
@@ -287,13 +285,14 @@ src_configure() {
}
src_compile() {
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
+
# see Note [tooldir hack for ldscripts]
- emake tooldir="${EPREFIX}${TOOLPATH}" all
+ emake V=1 tooldir="${EPREFIX}${TOOLPATH}" all
# only build info pages if the user wants them
if use doc ; then
- emake info
+ emake V=1 info
fi
# we nuke the manpages when we're left with junk
@@ -302,25 +301,26 @@ src_compile() {
}
src_test() {
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
- # bug 637066
+ # bug #637066
filter-flags -Wall -Wreturn-type
- emake -k check
+ emake -k V=1 check
}
src_install() {
local x d
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
+
# see Note [tooldir hack for ldscripts]
- emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
- rm -rf "${ED}"/${LIBPATH}/bin
+ emake V=1 DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
use static-libs || find "${ED}" -name '*.la' -delete
- # Newer versions of binutils get fancy with ${LIBPATH} #171905
- cd "${ED}"/${LIBPATH}
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
for d in ../* ; do
[[ ${d} == ../${PV} ]] && continue
mv ${d}/* . || die
@@ -331,17 +331,19 @@ src_install() {
# When something is built to cross-compile, it installs into
# /usr/$CHOST/ by default ... we have to 'fix' that :)
if is_cross ; then
- cd "${ED}"/${BINPATH}
+ cd "${ED}"/${BINPATH} || die
for x in * ; do
- mv ${x} ${x/${CTARGET}-}
+ mv ${x} ${x/${CTARGET}-} || die
done
if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ # No die for now, dies on hppa?
mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
rm -r "${ED}"/usr/${CHOST}/{include,lib}
fi
fi
+
insinto ${INCPATH}
local libiberty_headers=(
# Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
@@ -355,6 +357,7 @@ src_install() {
)
doins "${libiberty_headers[@]/#/${S}/include/}"
if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ # TODO: add || die here, fails on hppa?
mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
rm -r "${ED}"/${LIBPATH}/lib
fi
@@ -370,26 +373,33 @@ src_install() {
# Handle documentation
if ! is_cross ; then
- cd "${S}"
+ cd "${S}" || die
dodoc README
+
docinto bfd
dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
docinto binutils
dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
docinto gas
dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
docinto gprof
dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
docinto ld
dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
docinto libiberty
dodoc libiberty/ChangeLog* libiberty/README
+
docinto opcodes
dodoc opcodes/ChangeLog*
fi
# Remove shared info pages
- rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} || die
# Trim all empty dirs
find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.39-r5.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.39-r5.ebuild
new file mode 100644
index 000000000000..9b2ba15370d8
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.39-r5.ebuild
@@ -0,0 +1,492 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CTARGET=hppa64-${CHOST#*-}
+
+inherit libtool flag-o-matic gnuconfig multilib strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet default-gold doc gold gprofng multitarget +nls pgo +plugins static-libs test vanilla"
+REQUIRED_USE="default-gold? ( gold )"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=6
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="-* hppa"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR="${WORKDIR}"/build
+S="${WORKDIR}"/${P/-hppa64/}
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR}"/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ S="${WORKDIR}"/binutils
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ EGIT_CHECKOUT_DIR="${S}"
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ if use default-gold; then
+ myconf+=( --enable-gold=default )
+ fi
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.27) offer a configure flag now.
+ --enable-relro
+ # Newer versions (>=2.24) make this an explicit option, bug #497268
+ --enable-install-libiberty
+ # Available from 2.35 on
+ --enable-textrel-check=warning
+
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #--enable-warn-execstack
+ #--enable-warn-rwx-segments
+ #--disable-default-execstack (or is it --enable-default-execstack=no? docs are confusing)
+
+ # Things to think about
+ #--enable-deterministic-archives
+
+ # Works better than vapier's patch, bug #808787
+ --enable-new-dtags
+
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across
+ # {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ # Avoid automagic dependency on (currently prefix) systems
+ # systems with debuginfod library, bug #754753
+ --without-debuginfod
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ if ! is_cross ; then
+ # No LTO for HPPA64 right now as we don't build kgcc64 with LTO support.
+ myconf+=( $(use_enable pgo pgo-build) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" || die
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake V=1 tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake V=1 info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k V=1 check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake V=1 DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ # No die for now, dies on hppa?
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ # TODO: add || die here, fails on hppa?
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/${LIBPATH}/lib
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} || die
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+
+ # the hppa64 hack; this should go into 9999 as a PN-conditional
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.40-r7.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.40-r7.ebuild
new file mode 100644
index 000000000000..9b2ba15370d8
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.40-r7.ebuild
@@ -0,0 +1,492 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CTARGET=hppa64-${CHOST#*-}
+
+inherit libtool flag-o-matic gnuconfig multilib strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet default-gold doc gold gprofng multitarget +nls pgo +plugins static-libs test vanilla"
+REQUIRED_USE="default-gold? ( gold )"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=6
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="-* hppa"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR="${WORKDIR}"/build
+S="${WORKDIR}"/${P/-hppa64/}
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR}"/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ S="${WORKDIR}"/binutils
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ EGIT_CHECKOUT_DIR="${S}"
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ if use default-gold; then
+ myconf+=( --enable-gold=default )
+ fi
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.27) offer a configure flag now.
+ --enable-relro
+ # Newer versions (>=2.24) make this an explicit option, bug #497268
+ --enable-install-libiberty
+ # Available from 2.35 on
+ --enable-textrel-check=warning
+
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #--enable-warn-execstack
+ #--enable-warn-rwx-segments
+ #--disable-default-execstack (or is it --enable-default-execstack=no? docs are confusing)
+
+ # Things to think about
+ #--enable-deterministic-archives
+
+ # Works better than vapier's patch, bug #808787
+ --enable-new-dtags
+
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across
+ # {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ # Avoid automagic dependency on (currently prefix) systems
+ # systems with debuginfod library, bug #754753
+ --without-debuginfod
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ if ! is_cross ; then
+ # No LTO for HPPA64 right now as we don't build kgcc64 with LTO support.
+ myconf+=( $(use_enable pgo pgo-build) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" || die
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake V=1 tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake V=1 info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k V=1 check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake V=1 DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ # No die for now, dies on hppa?
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ # TODO: add || die here, fails on hppa?
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/${LIBPATH}/lib
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} || die
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+
+ # the hppa64 hack; this should go into 9999 as a PN-conditional
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.41-r3.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.41-r3.ebuild
new file mode 100644
index 000000000000..cfe58c7c1e4f
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.41-r3.ebuild
@@ -0,0 +1,497 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CTARGET=hppa64-${CHOST#*-}
+
+inherit libtool flag-o-matic gnuconfig multilib strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet default-gold doc gold gprofng multitarget +nls pgo +plugins static-libs test vanilla"
+REQUIRED_USE="default-gold? ( gold )"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=4
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="-* hppa"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR="${WORKDIR}"/build
+S="${WORKDIR}"/${P/-hppa64/}
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR}"/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ S="${WORKDIR}"/binutils
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ EGIT_CHECKOUT_DIR="${S}"
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ if use default-gold; then
+ myconf+=( --enable-gold=default )
+ fi
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.27) offer a configure flag now.
+ --enable-relro
+ # Newer versions (>=2.24) make this an explicit option, bug #497268
+ --enable-install-libiberty
+ # Available from 2.35 on
+ --enable-textrel-check=warning
+
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #--enable-warn-execstack
+ #--enable-warn-rwx-segments
+ #--disable-default-execstack (or is it --enable-default-execstack=no? docs are confusing)
+
+ # Things to think about
+ #--enable-deterministic-archives
+
+ # Works better than vapier's patch, bug #808787
+ --enable-new-dtags
+
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across
+ # {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ # Avoid automagic dependency on (currently prefix) systems
+ # systems with debuginfod library, bug #754753
+ --without-debuginfod
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ if ! is_cross ; then
+ # No LTO for HPPA64 right now as we don't build kgcc64 with LTO support.
+ myconf+=( $(use_enable pgo pgo-build) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ # No die for now, dies on hppa?
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ # TODO: add || die here, fails on hppa?
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/${LIBPATH}/lib
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} || die
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+
+ # the hppa64 hack; this should go into 9999 as a PN-conditional
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.41-r5.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.41-r5.ebuild
new file mode 100644
index 000000000000..c4fc096afca6
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.41-r5.ebuild
@@ -0,0 +1,497 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CTARGET=hppa64-${CHOST#*-}
+
+inherit libtool flag-o-matic gnuconfig multilib strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet default-gold doc gold gprofng multitarget +nls pgo +plugins static-libs test vanilla"
+REQUIRED_USE="default-gold? ( gold )"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=5
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="-* hppa"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR="${WORKDIR}"/build
+S="${WORKDIR}"/${P/-hppa64/}
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR}"/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ S="${WORKDIR}"/binutils
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ EGIT_CHECKOUT_DIR="${S}"
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ if use default-gold; then
+ myconf+=( --enable-gold=default )
+ fi
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.27) offer a configure flag now.
+ --enable-relro
+ # Newer versions (>=2.24) make this an explicit option, bug #497268
+ --enable-install-libiberty
+ # Available from 2.35 on
+ --enable-textrel-check=warning
+
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #--enable-warn-execstack
+ #--enable-warn-rwx-segments
+ #--disable-default-execstack (or is it --enable-default-execstack=no? docs are confusing)
+
+ # Things to think about
+ #--enable-deterministic-archives
+
+ # Works better than vapier's patch, bug #808787
+ --enable-new-dtags
+
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across
+ # {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ # Avoid automagic dependency on (currently prefix) systems
+ # systems with debuginfod library, bug #754753
+ --without-debuginfod
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ if ! is_cross ; then
+ # No LTO for HPPA64 right now as we don't build kgcc64 with LTO support.
+ myconf+=( $(use_enable pgo pgo-build) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ # No die for now, dies on hppa?
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ # TODO: add || die here, fails on hppa?
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/${LIBPATH}/lib
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info} || die
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+
+ # the hppa64 hack; this should go into 9999 as a PN-conditional
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.42-r1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.42-r1.ebuild
new file mode 100644
index 000000000000..53e91ed47268
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.42-r1.ebuild
@@ -0,0 +1,534 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CTARGET=hppa64-${CHOST#*-}
+
+inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet debuginfod doc gold gprofng hardened multitarget +nls pgo +plugins static-libs test vanilla zstd"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=3
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="-* ~hppa"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+ debuginfod? (
+ dev-libs/elfutils[debuginfod(-)]
+ )
+ zstd? ( app-arch/zstd:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ zstd? ( virtual/pkgconfig )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR="${WORKDIR}"/build
+S="${WORKDIR}"/${P/-hppa64/}
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+
+ # This is applied conditionally for now just out of caution.
+ # It should be okay on non-prefix systems though. See bug #892549.
+ if [[ ${PN} != binutils-hppa64 ]] && { is_cross || use prefix; } ; then
+ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch \
+ "${FILESDIR}"/binutils-2.41-linker-prefix.patch
+ fi
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+ use cet && filter-flags -mindirect-branch -mindirect-branch=*
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ --enable-relro
+ --enable-install-libiberty
+ --enable-textrel-check=$(usex hardened error warning)
+ # Things to think about
+ #--enable-deterministic-archives
+ --enable-new-dtags
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ $(use_with zstd)
+
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags: https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ $(use_with debuginfod)
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ case ${CTARGET} in
+ x86_64-*|aarch64*|arm64*|i[3456]*)
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #
+ # TODO: Get the logic for this fixed upstream so it doesn't
+ # create impossible broken combinations on some arches, like mips.
+ #
+ # TODO: Get the logic for this fixed upstream so --disable-* works
+ # as expected.
+ myconf+=(
+ --enable-warn-execstack=yes
+ --enable-warn-rwx-segments=yes
+ )
+
+ if use hardened ; then
+ myconf+=(
+ # TOOD: breaks glibc test suite
+ #--enable-error-execstack=yes
+ #--enable-error-rwx-segments=yes
+ --enable-default-execstack=no
+ )
+ fi
+ ;;
+ *)
+ ;;
+ esac
+
+ if use elibc_musl ; then
+ # Override our earlier setting for musl, as textrels don't
+ # work there at all. See bug #707660.
+ myconf+=(
+ --enable-textrel-check=error
+ )
+ fi
+
+ if ! is_cross ; then
+ # No LTO for HPPA64 right now as we don't build kgcc64 with LTO support.
+ myconf+=( $(use_enable pgo pgo-build) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ # see linker prefix patch
+ emake \
+ tooldir="${EPREFIX}${TOOLPATH}" \
+ gentoo_prefix=$(usex prefix-guest "${EPREFIX}"/usr /usr) \
+ all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ # No die for now, dies on hppa?
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ # TODO: add || die here, fails on hppa?
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/${LIBPATH}/lib
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ docompress "${DATAPATH}"/{info,man}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+
+ # the hppa64 hack; this should go into 9999 as a PN-conditional
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils-hppa64/metadata.xml b/sys-devel/binutils-hppa64/metadata.xml
index cd664c3ca7f2..5e566060dac2 100644
--- a/sys-devel/binutils-hppa64/metadata.xml
+++ b/sys-devel/binutils-hppa64/metadata.xml
@@ -3,7 +3,7 @@
<pkgmetadata>
<maintainer type="project">
<email>hppa@gentoo.org</email>
- <name>Gentoo Linux HPPA Development</name>
+ <name>HPPA architecture team</name>
</maintainer>
<maintainer type="project">
<email>toolchain@gentoo.org</email>
@@ -13,7 +13,13 @@
<flag name="cet">Enable Intel Control-flow Enforcement Technology.</flag>
<flag name="default-gold">Set ld to point to ld.gold instead of ld.bfd</flag>
<flag name="gold">Build ld.gold linker</flag>
+ <flag name="gprofng">Enable the next-generation gprofng profiler</flag>
+ <flag name="pgo">Build binutils with Profile Guided Optimization (PGO) and LTO</flag>
<flag name="plugins">Enable plugin support in tools</flag>
<flag name="multitarget">Adds support to binutils for cross compiling (does not work with gas)</flag>
+ <flag name="debuginfod">Enable debuginfod support via <pkg>dev-libs/elfutils</pkg> libdebuginfod</flag>
</use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:gnu:binutils</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest
index 6e23e4923e4e..635b751d198d 100644
--- a/sys-devel/binutils/Manifest
+++ b/sys-devel/binutils/Manifest
@@ -8,7 +8,17 @@ DIST binutils-2.35.2-patches-1.tar.xz 11836 BLAKE2B 0141349c9618992d1ab1e0309f7e
DIST binutils-2.35.2.tar.xz 22056908 BLAKE2B 9c392e0db2b482442f9476f30bd80cf2796321cbf7be79cf21af7bef167b6074c4ae009dcf9b438d2f2f4a23381c935176b2cfa85de1a526ab46e0fd844a7ca5 SHA512 9974ede5978d32e0d68fef23da48fa00bd06b0bff7ec45b00ca075c126d6bbe0cf2defc03ecc3f17bc6cc85b64271a13009c4049d7ba17de26e84e3a6e2c0348
DIST binutils-2.36.1-patches-5.tar.xz 44388 BLAKE2B 1dadb012fe35ec5fb0c5a15d348ab535bc5e3765375c97a3768c6b9f7126e0fda15d35163c9f9c33a4be98662dd120d7c1b21930a20c18dbb5345f56ecd9ecc1 SHA512 a2ce3388f1f1a77ff865481ff4b625121fd55f5234fed0a885312744f2f9c504717de1499b68252c6de64fa45866db7692df91c5838b43fbeb178938811cbe84
DIST binutils-2.36.1.tar.xz 22772248 BLAKE2B 03fbfbedd6dba2beaa836b1ed254eddd7a54a163d3061fd93edd2b9591cae24ba049b26658c524b5ccecc2f22d431dfa168218d2531aa356945c994fbbe896fa SHA512 cc24590bcead10b90763386b6f96bb027d7594c659c2d95174a6352e8b98465a50ec3e4088d0da038428abe059bbc4ae5f37b269f31a40fc048072c8a234f4e9
-DIST binutils-2.37_p1-patches-0.tar.xz 1392 BLAKE2B 128930a381022fea5d1fcb0695953e8dada2513b088b8540fe08d4e0da93ec18b6bf9c78acad6ec5a8982ae2c115d143462ef0bb7bfd63cfeb06c10ad472c2f8 SHA512 44666821f96349e96685ffcfd53a80a94659e38fc63eeeb980d0eed13aab03ae3e2d5059b4932cd9018f2f7698cdb5e15b443d60c01b2bd1385eeb0c698e0e24
-DIST binutils-2.37_p1-patches-1.tar.xz 28956 BLAKE2B 3bc14fcc52a6d11992ad9ed88fa3347ca3d5facd59de094a178a5f720d0eed6297dadf9a8fea7189076eb81274612c0b71c01f15a8f58deeaed8c8f6135ef50d SHA512 f6b2a09bfc692cf90f6cd56be81f424a68831db48054dc150eb6ec28bfa18d35933203c2d3b502f0c80e38771353c373446aec2488469fe2df20d8066033f59e
DIST binutils-2.37_p1-patches-2.tar.xz 31956 BLAKE2B 39c48628d0e2d7f3a8cf11be391b51dc64c7a534a3e64950fd992907c34fa36bebdf95cc5a184dd5b35e134e0c20376b5883abbf96ae57403c55377e615a6790 SHA512 c927aafa8c87e3b68ad28da5a17edf5647591ec26feeb56c743bc6637ffb10832b50ec6fd8442e80e40628b624e31b2f0f0b5f1193e77dc7e5442df0cb8cc8f1
DIST binutils-2.37_p1.tar.xz 22992196 BLAKE2B a8aa0f386d03a5b1466166ac7c40989c228351ccf0949a9b462b4d4615d70ab7e1a45351299140a42baf39c317b8007733c253eb547ee1dfadb612addde11621 SHA512 46c297ec2a7a5b81d1c6e3f16486a6dc2860a07520fe2dd8871d1eb5160065bbe2cc6b0415d5352bf12284133e5817a4e429e6077182d615e969bd1a8f52ed28
+DIST binutils-2.38-patches-4.tar.xz 193852 BLAKE2B 5a83e20008e58464ed563a6817a367e50684c59d08c47345cc546054269c42463d1651441720f865851e4e182e917df1a095c68e64226e0351b64e975d524096 SHA512 6657e547bb02898632cc45a8f1894be098aa7472b6725b65f95393e621abb127e468b4e50310720bf03f7e8d0a68bc2c47af76fc43aaa8f32b2e4a149c0c6290
+DIST binutils-2.38.tar.xz 23651408 BLAKE2B 19ede396ec97b88e632aded2f69f4684cc5053109e06c3c4a1934944e3f0ceaa9e4a2604528a440189771f778cb5d75edd510163970eeea31afba87fa256feba SHA512 8bf0b0d193c9c010e0518ee2b2e5a830898af206510992483b427477ed178396cd210235e85fd7bd99a96fc6d5eedbeccbd48317a10f752b7336ada8b2bb826d
+DIST binutils-2.39-patches-6.tar.xz 92380 BLAKE2B 39f490f1134fb0e7dc80924a280d3113efe0ed094ee15de97c42ab751c83d2f5aa7448966d8cbbcde722b2af4999a36c1e5aa2f37ca6d2e3942b97b6d90ff152 SHA512 213cd7a86da83987966675f3195e843d898ca4ff412dfc29fd33ed80adb7bbf80a0b2919cd8e7dd49208c73a621ab7b720970f2259418bdc82ed2a568ff62064
+DIST binutils-2.39.tar.xz 25167756 BLAKE2B ac6a5296c6586d53eaadcbffc5c399a6d79edf72450b9bb8b3525ce525129cef3d2eb90c85ef3bb3270b5a03b0e1ffb8f0b705f028158726f9777ebb8685066f SHA512 68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3
+DIST binutils-2.40-patches-7.tar.xz 299188 BLAKE2B 170cd2432e0458889b240c3603461d0b4bfa62d5314634b101a629db455d87235ac14ad44c63920b713d5235fa8b73902960df1019153873ef06a33aa7050b4b SHA512 a60da163caee68fe1fa355385d404e8998ebed0e390d50e0713e95334733a8b4e37bc63d522817284c027953e43848dbc98042461a47131fb53bc69203b4ee87
+DIST binutils-2.40.tar.xz 25241484 BLAKE2B 8d799f7c595f878b9af5b17a490021dd8b8300ac2fe0ed8574c012929d22d2d0493e003a3e631a9436e8e712da801779b777c566167fe42b0bde119ffa5ad1c2 SHA512 a37e042523bc46494d99d5637c3f3d8f9956d9477b748b3b1f6d7dfbb8d968ed52c932e88a4e946c6f77b8f48f1e1b360ca54c3d298f17193f3b4963472f6925
+DIST binutils-2.41-patches-2.tar.xz 20288 BLAKE2B 1cc29e868ded12845856c5da567f23798fe3017961ce079325c20f456b837cab11560d896065f70953b0bab55bf565288541579e9c3e0991a87083edf2a85fa5 SHA512 75619a5e17b75d72f9bdd9d5e5ee3b566c94de64410bfc074f1a9bfb9f08db9ecf8be216efa1053263468aa8ec99b8aa3b2b095e63cb95f3566500ac0c3b9432
+DIST binutils-2.41-patches-4.tar.xz 86580 BLAKE2B 32748fd0e81a7e323e9f56f0864f2a1755b8fe1b09c777075e31a292297e365c47b47003f8f1bffacc254ed8dccf1c655b7b13f61da751c9db090e56d819fbb2 SHA512 90dcf38c1ed2ae015eb9de922e946e2be62355bd51276075e7f1c0a06cd52408057c4151a2d2d4c07e33c1d2c5998001cba5509819e5722cce45f70172465ea5
+DIST binutils-2.41-patches-5.tar.xz 95176 BLAKE2B bbc94b3c7d70653a1056afe57a120b6eac9f0c8f51f05e95a1b5f80f2b7ef35e6355d740b49bc1ec2f3a13a838d5210ff4a205aa2bde5a72bc55c12100bce726 SHA512 ad293f97116f71322993f381c1af69fad1719a159f127ff16ddeca62f9b9b62aaf141abfa661985a61e9be7ae0639772148e69293a97364eebbf49182babb691
+DIST binutils-2.41.tar.xz 26765692 BLAKE2B 3bccec2b52f7e82a727121bf2a2e51a6249ba63dcd74c665fd834e858645c912ffd8245d848435288b938852830b482905606f55c40df4061215fd75c52ffc75 SHA512 5df45d0bd6ddabdce4f35878c041e46a92deef01e7dea5facc97fd65cc06b59abc6fba0eb454b68e571c7e14038dc823fe7f2263843e6e627b7444eaf0fe9374
+DIST binutils-2.42-patches-3.tar.xz 34768 BLAKE2B e4bfaf3b42147408a8a3dcb00f50378a6b49aef8e939731a92598680cfbf42dfdf842c3f5bf3458867f79c534eb92385bc64f34f7b1d6462ec4182b5f424fbe5 SHA512 3d75e0684bbfa2cc3fc6dfcb5488ac571db58f1a5833fcc754f231664137001ccb0f2ec750947b8021fa12daf614eb2cd21b598bd962d71a34bb8ea38805850d
+DIST binutils-2.42.tar.xz 27567160 BLAKE2B e67a5c028fba70e70088fd11b38ec8c9c4ed5a019badefda25abeb6275997b16f0891e7ff3424c4b82bbfae92e8992669826920dd53df61cd48469d8f7cd5bd1 SHA512 155f3ba14cd220102f4f29a4f1e5cfee3c48aa03b74603460d05afb73c70d6657a9d87eee6eb88bf13203fe6f31177a5c9addc04384e956e7da8069c8ecd20a6
diff --git a/sys-devel/binutils/binutils-2.32-r2.ebuild b/sys-devel/binutils/binutils-2.32-r2.ebuild
index 40db4705c2a9..606d5951eec2 100644
--- a/sys-devel/binutils/binutils-2.32-r2.ebuild
+++ b/sys-devel/binutils/binutils-2.32-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -76,8 +76,8 @@ DEPEND="${RDEPEND}
doc? ( sys-apps/texinfo )
test? ( dev-util/dejagnu )
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -111,17 +111,6 @@ src_prepare() {
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
# Fix conflicts with newer glibc #272594
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
@@ -162,6 +151,8 @@ src_configure() {
# Keep things sane
strip-flags
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -279,6 +270,10 @@ src_compile() {
src_test() {
cd "${MY_BUILDDIR}"
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
# bug 637066
filter-flags -Wall -Wreturn-type
diff --git a/sys-devel/binutils/binutils-2.33.1-r1.ebuild b/sys-devel/binutils/binutils-2.33.1-r1.ebuild
index 785ea17b6542..29def533ca06 100644
--- a/sys-devel/binutils/binutils-2.33.1-r1.ebuild
+++ b/sys-devel/binutils/binutils-2.33.1-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -68,8 +68,8 @@ DEPEND="${RDEPEND}
doc? ( sys-apps/texinfo )
test? ( dev-util/dejagnu )
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -104,17 +104,6 @@ src_prepare() {
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
# Fix conflicts with newer glibc #272594
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
@@ -155,6 +144,8 @@ src_configure() {
# Keep things sane
strip-flags
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -272,6 +263,10 @@ src_compile() {
src_test() {
cd "${MY_BUILDDIR}"
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
# bug 637066
filter-flags -Wall -Wreturn-type
diff --git a/sys-devel/binutils/binutils-2.34-r2.ebuild b/sys-devel/binutils/binutils-2.34-r2.ebuild
index c61503139101..009154a560d0 100644
--- a/sys-devel/binutils/binutils-2.34-r2.ebuild
+++ b/sys-devel/binutils/binutils-2.34-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -69,8 +69,8 @@ BDEPEND="
doc? ( sys-apps/texinfo )
test? ( dev-util/dejagnu )
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -101,17 +101,6 @@ src_prepare() {
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
# Fix conflicts with newer glibc #272594
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
@@ -152,6 +141,8 @@ src_configure() {
# Keep things sane
strip-flags
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -273,6 +264,10 @@ src_compile() {
src_test() {
cd "${MY_BUILDDIR}"
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
# bug 637066
filter-flags -Wall -Wreturn-type
diff --git a/sys-devel/binutils/binutils-2.35.2.ebuild b/sys-devel/binutils/binutils-2.35.2.ebuild
index cdb4d4b87ec3..2e7d17a37bea 100644
--- a/sys-devel/binutils/binutils-2.35.2.ebuild
+++ b/sys-devel/binutils/binutils-2.35.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -58,11 +58,11 @@ BDEPEND="
doc? ( sys-apps/texinfo )
test? (
dev-util/dejagnu
- sys-devel/bc
+ app-alternatives/bc
)
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -118,17 +118,6 @@ src_prepare() {
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
# Fix conflicts with newer glibc #272594
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
@@ -169,6 +158,8 @@ src_configure() {
# Keep things sane
strip-flags
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -297,6 +288,10 @@ src_compile() {
src_test() {
cd "${MY_BUILDDIR}"
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
# bug 637066
filter-flags -Wall -Wreturn-type
diff --git a/sys-devel/binutils/binutils-2.36.1-r2.ebuild b/sys-devel/binutils/binutils-2.36.1-r2.ebuild
index faa27e272c6c..243182b97a8a 100644
--- a/sys-devel/binutils/binutils-2.36.1-r2.ebuild
+++ b/sys-devel/binutils/binutils-2.36.1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -58,11 +58,11 @@ BDEPEND="
doc? ( sys-apps/texinfo )
test? (
dev-util/dejagnu
- sys-devel/bc
+ app-alternatives/bc
)
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -113,17 +113,6 @@ src_prepare() {
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
# Fix conflicts with newer glibc #272594
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
@@ -164,6 +153,8 @@ src_configure() {
# Keep things sane
strip-flags
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -292,6 +283,10 @@ src_compile() {
src_test() {
cd "${MY_BUILDDIR}"
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
# bug 637066
filter-flags -Wall -Wreturn-type
diff --git a/sys-devel/binutils/binutils-2.37_p1-r2.ebuild b/sys-devel/binutils/binutils-2.37_p1-r2.ebuild
index cfdd2538eefe..c7faa17c7bed 100644
--- a/sys-devel/binutils/binutils-2.37_p1-r2.ebuild
+++ b/sys-devel/binutils/binutils-2.37_p1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -8,7 +8,7 @@ inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
DESCRIPTION="Tools necessary to build programs"
HOMEPAGE="https://sourceware.org/binutils/"
LICENSE="GPL-3+"
-IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
+IUSE="cet default-gold doc +gold multitarget +nls pgo +plugins static-libs test vanilla"
REQUIRED_USE="default-gold? ( gold )"
# Variables that can be set here (ignored for live ebuilds)
@@ -32,7 +32,7 @@ else
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
SLOT=$(ver_cut 1-2)
- #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
#
@@ -58,11 +58,11 @@ BDEPEND="
doc? ( sys-apps/texinfo )
test? (
dev-util/dejagnu
- sys-devel/bc
+ app-alternatives/bc
)
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -119,17 +119,6 @@ src_prepare() {
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
# Fix conflicts with newer glibc #272594
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
@@ -170,6 +159,8 @@ src_configure() {
# Keep things sane
strip-flags
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
local x
@@ -273,6 +264,15 @@ src_configure() {
# But the check does not quite work on i686: bug #760926.
$(use_enable cet)
)
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build lto) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
echo ./configure "${myconf[@]}"
"${S}"/configure "${myconf[@]}" || die
@@ -302,6 +302,10 @@ src_compile() {
src_test() {
cd "${MY_BUILDDIR}"
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
# bug 637066
filter-flags -Wall -Wreturn-type
diff --git a/sys-devel/binutils/binutils-2.37_p1-r1.ebuild b/sys-devel/binutils/binutils-2.38-r2.ebuild
index 2333d6b11deb..c384b5f5ae0b 100644
--- a/sys-devel/binutils/binutils-2.37_p1-r1.ebuild
+++ b/sys-devel/binutils/binutils-2.38-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -8,7 +8,7 @@ inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
DESCRIPTION="Tools necessary to build programs"
HOMEPAGE="https://sourceware.org/binutils/"
LICENSE="GPL-3+"
-IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
+IUSE="cet default-gold doc +gold multitarget +nls pgo +plugins static-libs test vanilla"
REQUIRED_USE="default-gold? ( gold )"
# Variables that can be set here (ignored for live ebuilds)
@@ -19,7 +19,7 @@ REQUIRED_USE="default-gold? ( gold )"
# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
# for the patchsets
-PATCH_VER=1
+PATCH_VER=4
PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
@@ -32,7 +32,7 @@ else
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
SLOT=$(ver_cut 1-2)
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
#
@@ -58,11 +58,11 @@ BDEPEND="
doc? ( sys-apps/texinfo )
test? (
dev-util/dejagnu
- sys-devel/bc
+ app-alternatives/bc
)
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -119,17 +119,6 @@ src_prepare() {
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
# Fix conflicts with newer glibc #272594
if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
@@ -152,6 +141,11 @@ toolchain-binutils_pkgversion() {
}
src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
# Setup some paths
LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
INCPATH=${LIBPATH}/include
@@ -170,6 +164,8 @@ src_configure() {
# Keep things sane
strip-flags
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
local x
@@ -228,6 +224,9 @@ src_configure() {
fi
myconf+=(
+ # (--disable-silent-rules should get passed automatically w/ econf which we use
+ # in >= 2.39, so can drop it then.)
+ --disable-silent-rules
--prefix="${EPREFIX}"/usr
--host=${CHOST}
--target=${CTARGET}
@@ -273,6 +272,15 @@ src_configure() {
# But the check does not quite work on i686: bug #760926.
$(use_enable cet)
)
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build lto) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
echo ./configure "${myconf[@]}"
"${S}"/configure "${myconf[@]}" || die
@@ -287,11 +295,11 @@ src_configure() {
src_compile() {
cd "${MY_BUILDDIR}"
# see Note [tooldir hack for ldscripts]
- emake tooldir="${EPREFIX}${TOOLPATH}" all
+ emake V=1 tooldir="${EPREFIX}${TOOLPATH}" all
# only build info pages if the user wants them
if use doc ; then
- emake info
+ emake V=1 info
fi
# we nuke the manpages when we're left with junk
@@ -302,10 +310,14 @@ src_compile() {
src_test() {
cd "${MY_BUILDDIR}"
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
# bug 637066
filter-flags -Wall -Wreturn-type
- emake -k check
+ emake -k V=1 check
}
src_install() {
@@ -313,7 +325,7 @@ src_install() {
cd "${MY_BUILDDIR}"
# see Note [tooldir hack for ldscripts]
- emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ emake V=1 DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
rm -rf "${ED}"/${LIBPATH}/bin
use static-libs || find "${ED}" -name '*.la' -delete
diff --git a/sys-devel/binutils/binutils-2.37_p1.ebuild b/sys-devel/binutils/binutils-2.39-r5.ebuild
index 7bac92e076f5..efeadfc827de 100644
--- a/sys-devel/binutils/binutils-2.37_p1.ebuild
+++ b/sys-devel/binutils/binutils-2.39-r5.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -7,8 +7,9 @@ inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
DESCRIPTION="Tools necessary to build programs"
HOMEPAGE="https://sourceware.org/binutils/"
+
LICENSE="GPL-3+"
-IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
+IUSE="cet default-gold doc gold gprofng multitarget +nls pgo +plugins static-libs test vanilla"
REQUIRED_USE="default-gold? ( gold )"
# Variables that can be set here (ignored for live ebuilds)
@@ -19,7 +20,7 @@ REQUIRED_USE="default-gold? ( gold )"
# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
# for the patchsets
-PATCH_VER=0
+PATCH_VER=6
PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
@@ -32,8 +33,7 @@ else
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
SLOT=$(ver_cut 1-2)
- # live ebuild
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
#
@@ -59,11 +59,11 @@ BDEPEND="
doc? ( sys-apps/texinfo )
test? (
dev-util/dejagnu
- sys-devel/bc
+ app-alternatives/bc
)
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -114,28 +114,12 @@ src_prepare() {
fi
fi
- # Make sure our explicit libdir paths don't get clobbered. #562460
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
sed -i \
-e 's:@bfdlibdir@:@libdir@:g' \
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
- # Fix conflicts with newer glibc #272594
- if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
- sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
- fi
-
# Apply things from PATCHES and user dirs
default
@@ -153,6 +137,11 @@ toolchain-binutils_pkgversion() {
}
src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
# Setup some paths
LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
INCPATH=${LIBPATH}/include
@@ -165,12 +154,16 @@ src_configure() {
BINPATH=${TOOLPATH}/binutils-bin/${PV}
# Make sure we filter $LINGUAS so that only ones that
- # actually work make it through #42033
+ # actually work make it through, bug #42033
strip-linguas -u */po
# Keep things sane
strip-flags
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -178,7 +171,7 @@ src_configure() {
done
echo
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
local myconf=()
if use plugins ; then
@@ -200,9 +193,10 @@ src_configure() {
myconf+=( --with-system-zlib )
- # For bi-arch systems, enable a 64bit bfd. This matches
- # the bi-arch logic in toolchain.eclass. #446946
- # We used to do it for everyone, but it's slow on 32bit arches. #438522
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
case $(tc-arch) in
ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
esac
@@ -216,10 +210,7 @@ src_configure() {
--enable-poison-system-directories
)
- # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
- # on everyone in alpha (for now), we'll just enable it when possible
- has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
- has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
+ myconf+=( --enable-secureplt )
# mips can't do hash-style=gnu ...
if [[ $(tc-arch) != mips ]] ; then
@@ -243,37 +234,69 @@ src_configure() {
--enable-threads
# Newer versions (>=2.27) offer a configure flag now.
--enable-relro
- # Newer versions (>=2.24) make this an explicit option. #497268
+ # Newer versions (>=2.24) make this an explicit option, bug #497268
--enable-install-libiberty
# Available from 2.35 on
--enable-textrel-check=warning
- # Works better than vapier's patch... #808787
+
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #--enable-warn-execstack
+ #--enable-warn-rwx-segments
+ #--disable-default-execstack (or is it --enable-default-execstack=no? docs are confusing)
+
+ # Things to think about
+ #--enable-deterministic-archives
+
+ # Works better than vapier's patch, bug #808787
--enable-new-dtags
+
+ --disable-jansson
--disable-werror
--with-bugurl="$(toolchain-binutils_bugurl)"
--with-pkgversion="$(toolchain-binutils_pkgversion)"
$(use_enable static-libs static)
- ${EXTRA_ECONF}
- # Disable modules that are in a combined binutils/gdb tree. #490566
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
--disable-{gdb,libdecnumber,readline,sim}
# Strip out broken static link flags.
# https://gcc.gnu.org/PR56750
--without-stage1-ldflags
# Change SONAME to avoid conflict across
- # {native,cross}/binutils, binutils-libs. #666100
+ # {native,cross}/binutils, binutils-libs. bug #666100
--with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
- # avoid automagic dependency on (currently prefix) systems
+ # Avoid automagic dependency on (currently prefix) systems
# systems with debuginfod library, bug #754753
--without-debuginfod
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
# Allow user to opt into CET for host libraries.
# Ideally we would like automagic-or-disabled here.
# But the check does not quite work on i686: bug #760926.
$(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
)
- echo ./configure "${myconf[@]}"
- "${S}"/configure "${myconf[@]}" || die
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build lto) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" || die
# Prevent makeinfo from running if doc is unset.
if ! use doc ; then
@@ -284,13 +307,14 @@ src_configure() {
}
src_compile() {
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
+
# see Note [tooldir hack for ldscripts]
- emake tooldir="${EPREFIX}${TOOLPATH}" all
+ emake V=1 tooldir="${EPREFIX}${TOOLPATH}" all
# only build info pages if the user wants them
if use doc ; then
- emake info
+ emake V=1 info
fi
# we nuke the manpages when we're left with junk
@@ -299,25 +323,30 @@ src_compile() {
}
src_test() {
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
- # bug 637066
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
+ # bug #637066
filter-flags -Wall -Wreturn-type
- emake -k check
+ emake -k V=1 check
}
src_install() {
local x d
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
+
# see Note [tooldir hack for ldscripts]
- emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
- rm -rf "${ED}"/${LIBPATH}/bin
+ emake V=1 DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
use static-libs || find "${ED}" -name '*.la' -delete
- # Newer versions of binutils get fancy with ${LIBPATH} #171905
- cd "${ED}"/${LIBPATH}
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
for d in ../* ; do
[[ ${d} == ../${PV} ]] && continue
mv ${d}/* . || die
@@ -328,9 +357,9 @@ src_install() {
# When something is built to cross-compile, it installs into
# /usr/$CHOST/ by default ... we have to 'fix' that :)
if is_cross ; then
- cd "${ED}"/${BINPATH}
+ cd "${ED}"/${BINPATH} || die
for x in * ; do
- mv ${x} ${x/${CTARGET}-}
+ mv ${x} ${x/${CTARGET}-} || die
done
if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
@@ -339,6 +368,7 @@ src_install() {
rm -r "${ED}"/usr/${CHOST}/{include,lib}
fi
fi
+
insinto ${INCPATH}
local libiberty_headers=(
# Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
@@ -352,8 +382,8 @@ src_install() {
)
doins "${libiberty_headers[@]/#/${S}/include/}"
if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
- mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
- rm -r "${ED}"/${LIBPATH}/lib
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ || die
+ rm -r "${ED}"/${LIBPATH}/lib || die
fi
# Generate an env.d entry for this binutils
@@ -367,20 +397,27 @@ src_install() {
# Handle documentation
if ! is_cross ; then
- cd "${S}"
+ cd "${S}" || die
dodoc README
+
docinto bfd
dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
docinto binutils
dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
docinto gas
dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
docinto gprof
dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
docinto ld
dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
docinto libiberty
dodoc libiberty/ChangeLog* libiberty/README
+
docinto opcodes
dodoc opcodes/ChangeLog*
fi
diff --git a/sys-devel/binutils/binutils-2.40-r9.ebuild b/sys-devel/binutils/binutils-2.40-r9.ebuild
new file mode 100644
index 000000000000..a8b13b594c74
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.40-r9.ebuild
@@ -0,0 +1,499 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet debuginfod doc gold gprofng multitarget +nls pgo +plugins static-libs test vanilla zstd"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=7
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+ debuginfod? (
+ dev-libs/elfutils[debuginfod(-)]
+ )
+ zstd? ( app-arch/zstd:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ zstd? ( virtual/pkgconfig )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR=${WORKDIR}/build
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+
+ # This is applied conditionally for now just out of caution.
+ # It should be okay on non-prefix systems though. See bug #892549.
+ if is_cross || use prefix; then
+ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
+ fi
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+ use cet && filter-flags -mindirect-branch -mindirect-branch=*
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.27) offer a configure flag now.
+ --enable-relro
+ # Newer versions (>=2.24) make this an explicit option, bug #497268
+ --enable-install-libiberty
+ # Available from 2.35 on
+ --enable-textrel-check=warning
+
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #--enable-warn-execstack
+ #--enable-warn-rwx-segments
+ #--disable-default-execstack (or is it --enable-default-execstack=no? docs are confusing)
+
+ # Things to think about
+ #--enable-deterministic-archives
+
+ # Works better than vapier's patch, bug #808787
+ --enable-new-dtags
+
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ $(use_with zstd)
+
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across
+ # {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ $(use_with debuginfod)
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build lto) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" || die
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ || die
+ rm -r "${ED}"/${LIBPATH}/lib || die
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils/binutils-2.41-r2.ebuild b/sys-devel/binutils/binutils-2.41-r2.ebuild
new file mode 100644
index 000000000000..c787465a3200
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.41-r2.ebuild
@@ -0,0 +1,517 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet debuginfod doc gold gprofng hardened multitarget +nls pgo +plugins static-libs test vanilla zstd"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=2
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+ debuginfod? (
+ dev-libs/elfutils[debuginfod(-)]
+ )
+ zstd? ( app-arch/zstd:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ zstd? ( virtual/pkgconfig )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR=${WORKDIR}/build
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+
+ # This is applied conditionally for now just out of caution.
+ # It should be okay on non-prefix systems though. See bug #892549.
+ if is_cross || use prefix; then
+ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
+ fi
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+ use cet && filter-flags -mindirect-branch -mindirect-branch=*
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ --enable-relro
+ --enable-install-libiberty
+ --enable-textrel-check=$(usex hardened error warning)
+ # Things to think about
+ #--enable-deterministic-archives
+ --enable-new-dtags
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ $(use_with zstd)
+
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags: https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ $(use_with debuginfod)
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ case ${CTARGET} in
+ x86_64-*|aarch64*|arm64*|i[3456]*)
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #
+ # TODO: Get the logic for this fixed upstream so it doesn't
+ # create impossible broken combinations on some arches, like mips.
+ #
+ # TODO: Get the logic for this fixed upstream so --disable-* works
+ # as expected.
+ myconf+=(
+ --enable-warn-execstack=yes
+ --enable-warn-rwx-segments=yes
+ )
+
+ if use hardened ; then
+ myconf+=(
+ --enable-default-execstack=no
+ )
+ fi
+ ;;
+ *)
+ ;;
+ esac
+
+ if use elibc_musl ; then
+ # Override our earlier setting for musl, as textrels don't
+ # work there at all. See bug #707660.
+ myconf+=(
+ --enable-textrel-check=error
+ )
+ fi
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build lto) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ || die
+ rm -r "${ED}"/${LIBPATH}/lib || die
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils/binutils-2.41-r3.ebuild b/sys-devel/binutils/binutils-2.41-r3.ebuild
new file mode 100644
index 000000000000..a0cc21bab946
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.41-r3.ebuild
@@ -0,0 +1,517 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet debuginfod doc gold gprofng hardened multitarget +nls pgo +plugins static-libs test vanilla zstd"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=4
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="~alpha amd64 ~arm arm64 hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+ debuginfod? (
+ dev-libs/elfutils[debuginfod(-)]
+ )
+ zstd? ( app-arch/zstd:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ zstd? ( virtual/pkgconfig )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR=${WORKDIR}/build
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+
+ # This is applied conditionally for now just out of caution.
+ # It should be okay on non-prefix systems though. See bug #892549.
+ if is_cross || use prefix; then
+ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch
+ fi
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+ use cet && filter-flags -mindirect-branch -mindirect-branch=*
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ --enable-relro
+ --enable-install-libiberty
+ --enable-textrel-check=$(usex hardened error warning)
+ # Things to think about
+ #--enable-deterministic-archives
+ --enable-new-dtags
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ $(use_with zstd)
+
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags: https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ $(use_with debuginfod)
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ case ${CTARGET} in
+ x86_64-*|aarch64*|arm64*|i[3456]*)
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #
+ # TODO: Get the logic for this fixed upstream so it doesn't
+ # create impossible broken combinations on some arches, like mips.
+ #
+ # TODO: Get the logic for this fixed upstream so --disable-* works
+ # as expected.
+ myconf+=(
+ --enable-warn-execstack=yes
+ --enable-warn-rwx-segments=yes
+ )
+
+ if use hardened ; then
+ myconf+=(
+ --enable-default-execstack=no
+ )
+ fi
+ ;;
+ *)
+ ;;
+ esac
+
+ if use elibc_musl ; then
+ # Override our earlier setting for musl, as textrels don't
+ # work there at all. See bug #707660.
+ myconf+=(
+ --enable-textrel-check=error
+ )
+ fi
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build lto) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ || die
+ rm -r "${ED}"/${LIBPATH}/lib || die
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils/binutils-2.41-r4.ebuild b/sys-devel/binutils/binutils-2.41-r4.ebuild
new file mode 100644
index 000000000000..9cac9d6928b7
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.41-r4.ebuild
@@ -0,0 +1,524 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet debuginfod doc gold gprofng hardened multitarget +nls pgo +plugins static-libs test vanilla zstd"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=4
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+ debuginfod? (
+ dev-libs/elfutils[debuginfod(-)]
+ )
+ zstd? ( app-arch/zstd:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ zstd? ( virtual/pkgconfig )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR=${WORKDIR}/build
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+
+ # This is applied conditionally for now just out of caution.
+ # It should be okay on non-prefix systems though. See bug #892549.
+ if is_cross || use prefix; then
+ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch \
+ "${FILESDIR}"/binutils-2.41-linker-prefix.patch
+ fi
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+ use cet && filter-flags -mindirect-branch -mindirect-branch=*
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ --enable-relro
+ --enable-install-libiberty
+ --enable-textrel-check=$(usex hardened error warning)
+ # Things to think about
+ #--enable-deterministic-archives
+ --enable-new-dtags
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ $(use_with zstd)
+
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags: https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ $(use_with debuginfod)
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ case ${CTARGET} in
+ x86_64-*|aarch64*|arm64*|i[3456]*)
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #
+ # TODO: Get the logic for this fixed upstream so it doesn't
+ # create impossible broken combinations on some arches, like mips.
+ #
+ # TODO: Get the logic for this fixed upstream so --disable-* works
+ # as expected.
+ myconf+=(
+ --enable-warn-execstack=yes
+ --enable-warn-rwx-segments=yes
+ )
+
+ if use hardened ; then
+ myconf+=(
+ --enable-default-execstack=no
+ )
+ fi
+ ;;
+ *)
+ ;;
+ esac
+
+ if use elibc_musl ; then
+ # Override our earlier setting for musl, as textrels don't
+ # work there at all. See bug #707660.
+ myconf+=(
+ --enable-textrel-check=error
+ )
+ fi
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build lto) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ # see linker prefix patch
+ emake \
+ tooldir="${EPREFIX}${TOOLPATH}" \
+ gentoo_prefix=$(usex prefix-guest "${EPREFIX}"/usr /usr) \
+ all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ || die
+ rm -r "${ED}"/${LIBPATH}/lib || die
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ docompress "${DATAPATH}"/{info,man}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils/binutils-2.41-r5.ebuild b/sys-devel/binutils/binutils-2.41-r5.ebuild
new file mode 100644
index 000000000000..219a22bdca12
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.41-r5.ebuild
@@ -0,0 +1,524 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet debuginfod doc gold gprofng hardened multitarget +nls pgo +plugins static-libs test vanilla zstd"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=5
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+ debuginfod? (
+ dev-libs/elfutils[debuginfod(-)]
+ )
+ zstd? ( app-arch/zstd:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ zstd? ( virtual/pkgconfig )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR=${WORKDIR}/build
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+
+ # This is applied conditionally for now just out of caution.
+ # It should be okay on non-prefix systems though. See bug #892549.
+ if is_cross || use prefix; then
+ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch \
+ "${FILESDIR}"/binutils-2.41-linker-prefix.patch
+ fi
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+ use cet && filter-flags -mindirect-branch -mindirect-branch=*
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ --enable-relro
+ --enable-install-libiberty
+ --enable-textrel-check=$(usex hardened error warning)
+ # Things to think about
+ #--enable-deterministic-archives
+ --enable-new-dtags
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ $(use_with zstd)
+
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags: https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ $(use_with debuginfod)
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ case ${CTARGET} in
+ x86_64-*|aarch64*|arm64*|i[3456]*)
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #
+ # TODO: Get the logic for this fixed upstream so it doesn't
+ # create impossible broken combinations on some arches, like mips.
+ #
+ # TODO: Get the logic for this fixed upstream so --disable-* works
+ # as expected.
+ myconf+=(
+ --enable-warn-execstack=yes
+ --enable-warn-rwx-segments=yes
+ )
+
+ if use hardened ; then
+ myconf+=(
+ --enable-default-execstack=no
+ )
+ fi
+ ;;
+ *)
+ ;;
+ esac
+
+ if use elibc_musl ; then
+ # Override our earlier setting for musl, as textrels don't
+ # work there at all. See bug #707660.
+ myconf+=(
+ --enable-textrel-check=error
+ )
+ fi
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build lto) )
+
+ if use pgo ; then
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ # see linker prefix patch
+ emake \
+ tooldir="${EPREFIX}${TOOLPATH}" \
+ gentoo_prefix=$(usex prefix-guest "${EPREFIX}"/usr /usr) \
+ all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ || die
+ rm -r "${ED}"/${LIBPATH}/lib || die
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ docompress "${DATAPATH}"/{info,man}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils/binutils-2.42-r1.ebuild b/sys-devel/binutils/binutils-2.42-r1.ebuild
new file mode 100644
index 000000000000..cf195f441b89
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.42-r1.ebuild
@@ -0,0 +1,551 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+
+LICENSE="GPL-3+"
+IUSE="cet debuginfod doc gold gprofng hardened multitarget +nls pgo +plugins static-libs test vanilla zstd"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=3
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-dilfridge}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+ debuginfod? (
+ dev-libs/elfutils[debuginfod(-)]
+ )
+ zstd? ( app-arch/zstd:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? (
+ dev-util/dejagnu
+ app-alternatives/bc
+ )
+ nls? ( sys-devel/gettext )
+ zstd? ( virtual/pkgconfig )
+ app-alternatives/lex
+ app-alternatives/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR=${WORKDIR}/build
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ git-r3_src_unpack
+ else
+ unpack ${P/-hppa64/}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+
+ # _p patch versions are Gentoo specific tarballs ...
+ local dir=${P%_p?}
+ dir=${dir/-hppa64/}
+
+ S=${WORKDIR}/${dir}
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ -n ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+
+ # This is applied conditionally for now just out of caution.
+ # It should be okay on non-prefix systems though. See bug #892549.
+ if is_cross || use prefix; then
+ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch \
+ "${FILESDIR}"/binutils-2.41-linker-prefix.patch
+ fi
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through, bug #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+ use cet && filter-flags -mindirect-branch -mindirect-branch=*
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}" || die
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ --enable-relro
+ --enable-install-libiberty
+ --enable-textrel-check=$(usex hardened error warning)
+ # Things to think about
+ #--enable-deterministic-archives
+ --enable-new-dtags
+ --disable-jansson
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ $(use_with zstd)
+
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,gdbserver,libbacktrace,libdecnumber,readline,sim}
+ # Strip out broken static link flags: https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across {native,cross}/binutils, binutils-libs. bug #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+
+ $(use_with debuginfod)
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
+
+ # Allow user to opt into CET for host libraries.
+ # Ideally we would like automagic-or-disabled here.
+ # But the check does not quite work on i686: bug #760926.
+ $(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
+ )
+
+ case ${CTARGET} in
+ x86_64-*|aarch64*|arm64*|i[3456]*)
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #
+ # TODO: Get the logic for this fixed upstream so it doesn't
+ # create impossible broken combinations on some arches, like mips.
+ #
+ # TODO: Get the logic for this fixed upstream so --disable-* works
+ # as expected.
+ myconf+=(
+ --enable-warn-execstack=yes
+ --enable-warn-rwx-segments=yes
+ )
+
+ if use hardened ; then
+ myconf+=(
+ # TOOD: breaks glibc test suite
+ #--enable-error-execstack=yes
+ #--enable-error-rwx-segments=yes
+ --enable-default-execstack=no
+ )
+ fi
+ ;;
+ *)
+ ;;
+ esac
+
+ if use elibc_musl ; then
+ # Override our earlier setting for musl, as textrels don't
+ # work there at all. See bug #707660.
+ myconf+=(
+ --enable-textrel-check=error
+ )
+ fi
+
+ if use test || { use pgo && tc-is-lto ; } ; then
+ # -Wa,* needs to be consistent everywhere or lto-wrapper will complain
+ filter-flags '-Wa,*'
+ fi
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build $(tc-is-lto && echo "lto" || echo "yes")) )
+
+ if use pgo ; then
+ # We let configure handle it for us because it has to run
+ # the testsuite later on for profiling, and LTO isn't compatible
+ # with the testsuite.
+ filter-lto
+
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ # see linker prefix patch
+ emake \
+ tooldir="${EPREFIX}${TOOLPATH}" \
+ gentoo_prefix=$(usex prefix-guest "${EPREFIX}"/usr /usr) \
+ all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}" || die
+
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
+ (
+ # Tests don't expect LTO
+ filter-lto
+
+ # lto-wrapper warnings which confuse tests
+ filter-flags '-Wa,*'
+
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check \
+ CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET:-${CFLAGS}}" \
+ CXXFLAGS_FOR_TARGET="${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}" \
+ LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}" \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+ )
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}" || die
+
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin || die
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH} || die
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-} || die
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ || die
+ rm -r "${ED}"/${LIBPATH}/lib || die
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}" || die
+ dodoc README
+
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ docompress "${DATAPATH}"/{info,man}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}
diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild
index 2609713b2a04..8576f0e43ff0 100644
--- a/sys-devel/binutils/binutils-9999.ebuild
+++ b/sys-devel/binutils/binutils-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -7,9 +7,9 @@ inherit libtool flag-o-matic gnuconfig strip-linguas toolchain-funcs
DESCRIPTION="Tools necessary to build programs"
HOMEPAGE="https://sourceware.org/binutils/"
+
LICENSE="GPL-3+"
-IUSE="cet default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
-REQUIRED_USE="default-gold? ( gold )"
+IUSE="cet debuginfod doc gold gprofng hardened multitarget +nls pgo +plugins static-libs test vanilla zstd"
# Variables that can be set here (ignored for live ebuilds)
# PATCH_VER - the patchset version
@@ -19,7 +19,7 @@ REQUIRED_USE="default-gold? ( gold )"
# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
# for the patchsets
-PATCH_VER=0
+PATCH_VER=1
PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
@@ -28,12 +28,11 @@ if [[ ${PV} == 9999* ]]; then
else
PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
PATCH_DEV=${PATCH_DEV:-dilfridge}
- SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz https://sourceware.org/pub/binutils/releases/binutils-${PV}.tar.xz https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PV}.tar.xz"
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
SLOT=$(ver_cut 1-2)
- # live ebuild
- #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
#
@@ -53,17 +52,22 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
RDEPEND="
>=sys-devel/binutils-config-3
sys-libs/zlib
+ debuginfod? (
+ dev-libs/elfutils[debuginfod(-)]
+ )
+ zstd? ( app-arch/zstd:= )
"
DEPEND="${RDEPEND}"
BDEPEND="
doc? ( sys-apps/texinfo )
test? (
dev-util/dejagnu
- sys-devel/bc
+ app-alternatives/bc
)
nls? ( sys-devel/gettext )
- sys-devel/flex
- virtual/yacc
+ zstd? ( virtual/pkgconfig )
+ app-alternatives/lex
+ app-alternatives/yacc
"
RESTRICT="!test? ( test )"
@@ -111,31 +115,22 @@ src_prepare() {
einfo "Applying binutils patchset ${patchsetname}"
eapply "${WORKDIR}/patch"
einfo "Done."
+
+ # This is applied conditionally for now just out of caution.
+ # It should be okay on non-prefix systems though. See bug #892549.
+ if is_cross || use prefix; then
+ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch \
+ "${FILESDIR}"/binutils-2.41-linker-prefix.patch
+ fi
fi
fi
- # Make sure our explicit libdir paths don't get clobbered. #562460
+ # Make sure our explicit libdir paths don't get clobbered, bug #562460
sed -i \
-e 's:@bfdlibdir@:@libdir@:g' \
-e 's:@bfdincludedir@:@includedir@:g' \
{bfd,opcodes}/Makefile.in || die
- # Fix locale issues if possible #122216
- if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
- einfo "Fixing misc issues in configure files"
- for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
- ebegin " Updating ${f/${S}\/}"
- patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
- || eerror "Please file a bug about this"
- eend $?
- done
- fi
-
- # Fix conflicts with newer glibc #272594
- if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
- sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
- fi
-
# Apply things from PATCHES and user dirs
default
@@ -153,6 +148,11 @@ toolchain-binutils_pkgversion() {
}
src_configure() {
+ # See https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html
+ # Avoid really confusing logs from subconfigure spam, makes logs far
+ # more legible.
+ MAKEOPTS="--output-sync=line ${MAKEOPTS}"
+
# Setup some paths
LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
INCPATH=${LIBPATH}/include
@@ -165,14 +165,16 @@ src_configure() {
BINPATH=${TOOLPATH}/binutils-bin/${PV}
# Make sure we filter $LINGUAS so that only ones that
- # actually work make it through #42033
+ # actually work make it through, bug #42033
strip-linguas -u */po
# Keep things sane
strip-flags
-
+ use cet && filter-flags -mindirect-branch -mindirect-branch=*
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+ append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
+
local x
echo
for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
@@ -180,7 +182,7 @@ src_configure() {
done
echo
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
local myconf=()
if use plugins ; then
@@ -189,9 +191,6 @@ src_configure() {
# enable gold (installed as ld.gold) and ld's plugin architecture
if use gold ; then
myconf+=( --enable-gold )
- if use default-gold; then
- myconf+=( --enable-gold=default )
- fi
fi
if use nls ; then
@@ -202,9 +201,10 @@ src_configure() {
myconf+=( --with-system-zlib )
- # For bi-arch systems, enable a 64bit bfd. This matches
- # the bi-arch logic in toolchain.eclass. #446946
- # We used to do it for everyone, but it's slow on 32bit arches. #438522
+ # For bi-arch systems, enable a 64bit bfd. This matches the bi-arch
+ # logic in toolchain.eclass. bug #446946
+ #
+ # We used to do it for everyone, but it's slow on 32bit arches. bug #438522
case $(tc-arch) in
ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
esac
@@ -218,10 +218,7 @@ src_configure() {
--enable-poison-system-directories
)
- # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
- # on everyone in alpha (for now), we'll just enable it when possible
- has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
- has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
+ myconf+=( --enable-secureplt )
# mips can't do hash-style=gnu ...
if [[ $(tc-arch) != mips ]] ; then
@@ -240,42 +237,110 @@ src_configure() {
--libdir="${EPREFIX}"${LIBPATH}
--libexecdir="${EPREFIX}"${LIBPATH}
--includedir="${EPREFIX}"${INCPATH}
+ # portage's econf() does not detect presence of --d-d-t
+ # because it greps only top-level ./configure. But not
+ # libiberty's or bfd's configure.
+ --disable-dependency-tracking
+ --disable-silent-rules
--enable-obsolete
--enable-shared
--enable-threads
- # Newer versions (>=2.27) offer a configure flag now.
--enable-relro
- # Newer versions (>=2.24) make this an explicit option. #497268
--enable-install-libiberty
- # Available from 2.35 on
- --enable-textrel-check=warning
- # Works better than vapier's patch... #808787
+ --enable-textrel-check=$(usex hardened error warning)
+ # Things to think about
+ #--enable-deterministic-archives
--enable-new-dtags
+ --disable-jansson
--disable-werror
--with-bugurl="$(toolchain-binutils_bugurl)"
--with-pkgversion="$(toolchain-binutils_pkgversion)"
$(use_enable static-libs static)
- ${EXTRA_ECONF}
- # Disable modules that are in a combined binutils/gdb tree. #490566
- --disable-{gdb,libdecnumber,readline,sim}
- # Strip out broken static link flags.
- # https://gcc.gnu.org/PR56750
+ $(use_with zstd)
+
+ # Disable modules that are in a combined binutils/gdb tree, bug #490566
+ --disable-{gdb,gdbserver,libbacktrace,libdecnumber,readline,sim}
+ # Strip out broken static link flags: https://gcc.gnu.org/PR56750
--without-stage1-ldflags
- # Change SONAME to avoid conflict across
- # {native,cross}/binutils, binutils-libs. #666100
+ # Change SONAME to avoid conflict across {native,cross}/binutils, binutils-libs. bug #666100
--with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
- # avoid automagic dependency on (currently prefix) systems
- # systems with debuginfod library, bug #754753
- --without-debuginfod
+ $(use_with debuginfod)
+
+ # Avoid automagic dev-libs/msgpack dep, bug #865875
+ --without-msgpack
# Allow user to opt into CET for host libraries.
# Ideally we would like automagic-or-disabled here.
# But the check does not quite work on i686: bug #760926.
$(use_enable cet)
+
+ # We can enable this by default in future, but it's brand new
+ # in 2.39 with several bugs:
+ # - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477)
+ # - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521)
+ # - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479)
+ # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
+ $(use_enable gprofng)
)
- echo ./configure "${myconf[@]}"
- "${S}"/configure "${myconf[@]}" || die
+
+ case ${CTARGET} in
+ x86_64-*|aarch64*|arm64*|i[3456]*)
+ # These hardening options are available from 2.39+ but
+ # they unconditionally enable the behaviour even on arches
+ # where e.g. execstacks can't be avoided.
+ # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592.
+ #
+ # TODO: Get the logic for this fixed upstream so it doesn't
+ # create impossible broken combinations on some arches, like mips.
+ #
+ # TODO: Get the logic for this fixed upstream so --disable-* works
+ # as expected.
+ myconf+=(
+ --enable-warn-execstack=yes
+ --enable-warn-rwx-segments=yes
+ )
+
+ if use hardened ; then
+ myconf+=(
+ # TOOD: breaks glibc test suite
+ #--enable-error-execstack=yes
+ #--enable-error-rwx-segments=yes
+ --enable-default-execstack=no
+ )
+ fi
+ ;;
+ *)
+ ;;
+ esac
+
+ if use elibc_musl ; then
+ # Override our earlier setting for musl, as textrels don't
+ # work there at all. See bug #707660.
+ myconf+=(
+ --enable-textrel-check=error
+ )
+ fi
+
+ if use test || { use pgo && tc-is-lto ; } ; then
+ # -Wa,* needs to be consistent everywhere or lto-wrapper will complain
+ filter-flags '-Wa,*'
+ fi
+
+ if ! is_cross ; then
+ myconf+=( $(use_enable pgo pgo-build $(tc-is-lto && echo "lto" || echo "yes")) )
+
+ if use pgo ; then
+ # We let configure handle it for us because it has to run
+ # the testsuite later on for profiling, and LTO isn't compatible
+ # with the testsuite.
+ filter-lto
+
+ export BUILD_CFLAGS="${CFLAGS}"
+ fi
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
# Prevent makeinfo from running if doc is unset.
if ! use doc ; then
@@ -286,9 +351,14 @@ src_configure() {
}
src_compile() {
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
+
# see Note [tooldir hack for ldscripts]
- emake tooldir="${EPREFIX}${TOOLPATH}" all
+ # see linker prefix patch
+ emake \
+ tooldir="${EPREFIX}${TOOLPATH}" \
+ gentoo_prefix=$(usex prefix-guest "${EPREFIX}"/usr /usr) \
+ all
# only build info pages if the user wants them
if use doc ; then
@@ -301,25 +371,44 @@ src_compile() {
}
src_test() {
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
+
+ # https://sourceware.org/PR31327
+ local -x XZ_OPT="-T1"
+ local -x XZ_DEFAULTS="-T1"
+
+ (
+ # Tests don't expect LTO
+ filter-lto
- # bug 637066
- filter-flags -Wall -Wreturn-type
+ # lto-wrapper warnings which confuse tests
+ filter-flags '-Wa,*'
- emake -k check
+ # bug #637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check \
+ CFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET:-${CFLAGS}}" \
+ CXXFLAGS_FOR_TARGET="${CXXFLAGS_FOR_TARGET:-${CXXFLAGS}}" \
+ LDFLAGS_FOR_TARGET="${LDFLAGS_FOR_TARGET:-${LDFLAGS}}" \
+ CFLAGS="${CFLAGS}" \
+ CXXFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS}"
+ )
}
src_install() {
local x d
- cd "${MY_BUILDDIR}"
+ cd "${MY_BUILDDIR}" || die
+
# see Note [tooldir hack for ldscripts]
emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
- rm -rf "${ED}"/${LIBPATH}/bin
+ rm -rf "${ED}"/${LIBPATH}/bin || die
use static-libs || find "${ED}" -name '*.la' -delete
- # Newer versions of binutils get fancy with ${LIBPATH} #171905
- cd "${ED}"/${LIBPATH}
+ # Newer versions of binutils get fancy with ${LIBPATH}, bug #171905
+ cd "${ED}"/${LIBPATH} || die
for d in ../* ; do
[[ ${d} == ../${PV} ]] && continue
mv ${d}/* . || die
@@ -330,9 +419,9 @@ src_install() {
# When something is built to cross-compile, it installs into
# /usr/$CHOST/ by default ... we have to 'fix' that :)
if is_cross ; then
- cd "${ED}"/${BINPATH}
+ cd "${ED}"/${BINPATH} || die
for x in * ; do
- mv ${x} ${x/${CTARGET}-}
+ mv ${x} ${x/${CTARGET}-} || die
done
if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
@@ -341,6 +430,7 @@ src_install() {
rm -r "${ED}"/usr/${CHOST}/{include,lib}
fi
fi
+
insinto ${INCPATH}
local libiberty_headers=(
# Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
@@ -354,8 +444,8 @@ src_install() {
)
doins "${libiberty_headers[@]/#/${S}/include/}"
if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
- mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
- rm -r "${ED}"/${LIBPATH}/lib
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/ || die
+ rm -r "${ED}"/${LIBPATH}/lib || die
fi
# Generate an env.d entry for this binutils
@@ -369,20 +459,27 @@ src_install() {
# Handle documentation
if ! is_cross ; then
- cd "${S}"
+ cd "${S}" || die
dodoc README
+
docinto bfd
dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+
docinto binutils
dodoc binutils/ChangeLog binutils/NEWS binutils/README
+
docinto gas
dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+
docinto gprof
dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+
docinto ld
dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+
docinto libiberty
dodoc libiberty/ChangeLog* libiberty/README
+
docinto opcodes
dodoc opcodes/ChangeLog*
fi
@@ -390,6 +487,8 @@ src_install() {
# Remove shared info pages
rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+ docompress "${DATAPATH}"/{info,man}
+
# Trim all empty dirs
find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
}
diff --git a/sys-devel/binutils/files/binutils-2.40-linker-search-path.patch b/sys-devel/binutils/files/binutils-2.40-linker-search-path.patch
new file mode 100644
index 000000000000..bddfa1ec6eb5
--- /dev/null
+++ b/sys-devel/binutils/files/binutils-2.40-linker-search-path.patch
@@ -0,0 +1,38 @@
+https://bugs.gentoo.org/892549
+https://github.com/gentoo/binutils-gdb/pull/4
+
+From 1601840f9f2397edd56177871527a198a14277bd Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sat, 11 Feb 2023 15:15:20 +0000
+Subject: [PATCH 1/2] ldelf.c: Always consider -L arguments when handling
+ DT_NEEDED
+
+This is for consistency with other linkers, including gold. Without
+this, we typically rely on ld.so.conf to find libraries such as
+libstdc++.so.6, while other linkers do not use this file at all.
+--- a/ld/ldelf.c
++++ b/ld/ldelf.c
+@@ -1090,8 +1090,8 @@ ldelf_handle_dt_needed (struct elf_link_hash_table *htab,
+ linker will search. That means that we want to use
+ rpath_link, rpath, then the environment variable
+ LD_LIBRARY_PATH (native only), then the DT_RPATH/DT_RUNPATH
+- entries (native only), then the linker script LIB_SEARCH_DIRS.
+- We do not search using the -L arguments.
++ entries (native only), then the linker script LIB_SEARCH_DIRS,
++ then the -L arguments.
+
+ We search twice. The first time, we skip objects which may
+ introduce version mismatches. The second time, we force
+@@ -1165,11 +1165,7 @@ ldelf_handle_dt_needed (struct elf_link_hash_table *htab,
+ len = strlen (l->name);
+ for (search = search_head; search != NULL; search = search->next)
+ {
+- char *filename;
+-
+- if (search->cmdline)
+- continue;
+- filename = (char *) xmalloc (strlen (search->name) + len + 2);
++ char *filename = (char *) xmalloc (strlen (search->name) + len + 2);
+ sprintf (filename, "%s/%s", search->name, l->name);
+ nn.name = filename;
+ if (ldelf_try_needed (&nn, force, is_linux))
diff --git a/sys-devel/binutils/files/binutils-2.41-linker-prefix.patch b/sys-devel/binutils/files/binutils-2.41-linker-prefix.patch
new file mode 100644
index 000000000000..d97a15599209
--- /dev/null
+++ b/sys-devel/binutils/files/binutils-2.41-linker-prefix.patch
@@ -0,0 +1,56 @@
+https://bugs.gentoo.org/892549
+https://github.com/gentoo/binutils-gdb/pull/5
+
+From 531bc1536dfc3070c1f7d03e98fa14bcb81fdcd0 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sat, 23 Dec 2023 13:48:10 +0000
+Subject: [PATCH 2/2] ld: Allow a Gentoo-specific prefix to override the prefix
+ used by ld.bfd
+
+This prefix is only used to locate $prefix/etc/ld.so.conf, with $prefix
+usually being /usr. This file is important on Gentoo Prefix systems,
+where the /usr prefix is within another directory. The problem is that
+Gentoo already passes the same directory as the sysroot, and ld.bfd
+therefore looks for /myprefix/myprefix/usr/etc/ld.so.conf.
+
+The sysroot is dynamic, while the prefix is hardcoded. A hardcoded
+prefix that isn't just /usr is unhelpful, not just because of the
+doubled prefix issue above, but also because it prevents ld.bfd from
+working effectively outside its native environment. We will therefore
+hardcode it to just /usr.
+
+This change does not simply do that though and sets up a $gentoo_prefix
+variable instead, with $prefix as a fallback. This is necessary because
+Gentoo prefix-guest systems, which use the host's libc, do not apply a
+sysroot like RAP prefix systems do. In that case, we must preserve the
+existing behaviour. The binutils ebuild will be responsible for setting
+this variable appropriately.
+---
+ ld/emultempl/elf.em | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
+index 3f67f8b09d9..78c8e909b6c 100644
+--- a/ld/emultempl/elf.em
++++ b/ld/emultempl/elf.em
+@@ -138,7 +138,7 @@ gld${EMULATION_NAME}_before_plugin_all_symbols_read (void)
+ ldelf_before_plugin_all_symbols_read ($IS_LIBPATH, $IS_NATIVE,
+ $IS_LINUX_TARGET,
+ $IS_FREEBSD_TARGET,
+- $ELFSIZE, "$prefix");
++ $ELFSIZE, "${gentoo_prefix-${prefix}}");
+ }
+
+ /* This is called after all the input files have been opened. */
+@@ -147,7 +147,7 @@ static void
+ gld${EMULATION_NAME}_after_open (void)
+ {
+ ldelf_after_open ($IS_LIBPATH, $IS_NATIVE,
+- $IS_LINUX_TARGET, $IS_FREEBSD_TARGET, $ELFSIZE, "$prefix");
++ $IS_LINUX_TARGET, $IS_FREEBSD_TARGET, $ELFSIZE, "${gentoo_prefix-${prefix}}");
+ }
+
+ EOF
+--
+2.43.0
+
diff --git a/sys-devel/binutils/files/binutils-configure-LANG.patch b/sys-devel/binutils/files/binutils-configure-LANG.patch
deleted file mode 100644
index 5521d196cf4a..000000000000
--- a/sys-devel/binutils/files/binutils-configure-LANG.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-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
index 4f6990c6d6f9..3cc106863437 100644
--- a/sys-devel/binutils/metadata.xml
+++ b/sys-devel/binutils/metadata.xml
@@ -9,8 +9,11 @@
<flag name="cet">Enable Intel Control-flow Enforcement Technology.</flag>
<flag name="default-gold">Set ld to point to ld.gold instead of ld.bfd</flag>
<flag name="gold">Build ld.gold linker</flag>
+ <flag name="gprofng">Enable the next-generation gprofng profiler</flag>
+ <flag name="pgo">Build binutils with Profile Guided Optimization (PGO) and LTO</flag>
<flag name="plugins">Enable plugin support in tools</flag>
<flag name="multitarget">Adds support to binutils for cross compiling (does not work with gas)</flag>
+ <flag name="debuginfod">Enable debuginfod support via <pkg>dev-libs/elfutils</pkg> libdebuginfod</flag>
</use>
<upstream>
<remote-id type="cpe">cpe:/a:gnu:binutils</remote-id>
diff --git a/sys-devel/bison/Manifest b/sys-devel/bison/Manifest
index 60fc54129fef..b6104c4e11c0 100644
--- a/sys-devel/bison/Manifest
+++ b/sys-devel/bison/Manifest
@@ -1,4 +1,2 @@
-DIST bison-3.7.6-patches-01.tar.xz 10600 BLAKE2B c7907a327c2bbb82a2e575a864e71400f91cd4349a84f95b187ecaadefc1bfd595a91bce6c8c47e42423cace9cf78a4041fde3fdc489a4824aa3c10ca73be7cb SHA512 8f2ddee79b9678b9fd9a7a34f26d44f7c4472d0fc55c9fef8b418d27949b6a27309b7aa5ac3f4a5ad27c90ad7d92d824ffe767c77b0ed81de6b2897c91cd7560
-DIST bison-3.7.6.tar.xz 2627180 BLAKE2B 2f1015b517e46ff0870378b4d0dd489c8c737f31b2b69146bd7fbbae1e3adcdff0e4837cfdf1d238e8660ecc2b310ce87ec8940ed4989278b3df6cbb2d464e54 SHA512 6c1c9b825fbd2c94b8903f03a7e68e6832599f7bbd8d3c49864537c11b038c45a15de02fd36128d662af314334c83515bbc132df84e9acc6c651e98649c65bad
-DIST bison-3.8.1.tar.xz 2800372 BLAKE2B 0b70ee1b3ab8075540d9254cffdc1dfc9a9fb354d8b9b79dd3b097bf9a2235f892e120736e4195ad21ce8fbf3831c63b2d1a267a20a7abf85f0d72cdcdac1820 SHA512 f87978c41eca4db22de4f64feb3be92e44862d412f75dd84980045faf0f9e7f5a41b25bef8d4acd90743638eab61a7ac111444969d958fef5fe3535bac416921
DIST bison-3.8.2.tar.xz 2817324 BLAKE2B e211b61494c911f55b72a8b70b5a48cdf4000ce9e675a1f1f52735bb8f57d93a3f8075341451263af9c9c531004907ae2b62b1873e7e4664c2cd26fa3b12271c SHA512 d4d23af6671406e97257892f90651b67f2ab95219831372be032190b7156c10a3435d457857e677445df8b2327aacccc15344acbbc3808a6f332a93cce23b444
+DIST bison-3.8.2.tar.xz.sig 195 BLAKE2B b9bd21adb5115d3d3174c94223fbc9cd33afa0e9c1805008e49f77ff154fc2b656d8a9e9503dc5290658ae2948a2ca7c0dbc812f62aec268d8f8bfafb6349096 SHA512 8bb7743ca326e81a6c091b1413e3c09bd43c7eabbb80bac0638ccd52bdf7e3395cce300a86acd95f4637a9ec8a1b0e9a4d3d25d95ab0a8f03e57fd82eb87a7ac
diff --git a/sys-devel/bison/bison-3.7.6.ebuild b/sys-devel/bison/bison-3.7.6.ebuild
deleted file mode 100644
index a9e566e5e632..000000000000
--- a/sys-devel/bison/bison-3.7.6.ebuild
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit flag-o-matic
-
-PATCH_TAR="${PN}-3.7.6-patches-01.tar.xz"
-
-DESCRIPTION="A general-purpose (yacc-compatible) parser generator"
-HOMEPAGE="https://www.gnu.org/software/bison/"
-SRC_URI="mirror://gnu/${PN}/${P}.tar.xz
- https://dev.gentoo.org/~whissi/dist/bison/${PATCH_TAR}
- https://dev.gentoo.org/~polynomial-c/dist/bison/${PATCH_TAR}"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="examples nls static test"
-RESTRICT="!test? ( test )"
-
-# gettext _IS_ required in RDEPEND because >=bison-3.7 links against
-# libtextstyle.so!!! (see bug #740754)
-DEPEND="
- >=sys-devel/m4-1.4.16
- >=sys-devel/gettext-0.21
-"
-RDEPEND="${DEPEND}"
-BDEPEND="
- sys-devel/flex
- examples? ( dev-lang/perl )
- test? ( dev-lang/perl )
-"
-
-DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) # ChangeLog-2012 ChangeLog-1998 PACKAGING README-alpha README-release
-
-src_prepare() {
- # Record date to avoid 'config.status --recheck' & regen of 'tests/package.m4'
- touch -r configure.ac old.configure.ac || die
- touch -r configure old.configure || die
-
- eapply "${WORKDIR}"/patches
- default
-
- # Restore date after patching
- touch -r old.configure.ac configure.ac || die
- touch -r old.configure configure || die
-
- # The makefiles make the man page depend on the configure script
- # which we patched above. Touch it to prevent regeneration.
- touch doc/bison.1 || die #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
-
- local myeconfargs=(
- $(use_enable examples)
- $(use_enable nls)
- )
- econf "${myeconfargs[@]}"
-}
-
-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
-}
-
-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.8.1.ebuild b/sys-devel/bison/bison-3.8.1.ebuild
deleted file mode 100644
index 21002c007b81..000000000000
--- a/sys-devel/bison/bison-3.8.1.ebuild
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-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 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="examples nls static test"
-RESTRICT="!test? ( test )"
-
-# gettext _IS_ required in RDEPEND because >=bison-3.7 links against
-# libtextstyle.so!!! (see bug #740754)
-DEPEND="
- >=sys-devel/m4-1.4.16
- >=sys-devel/gettext-0.21
-"
-RDEPEND="${DEPEND}"
-BDEPEND="
- sys-devel/flex
- test? ( dev-lang/perl )
-"
-
-DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) # ChangeLog-2012 ChangeLog-1998 PACKAGING README-alpha README-release
-
-src_prepare() {
- # Old logic when we needed to patch configure.ac
- # Keeping in case it's useful for future
-
- # Record date to avoid 'config.status --recheck' & regen of 'tests/package.m4'
- #touch -r configure.ac old.configure.ac || die
- #touch -r configure old.configure || die
-
- #eapply "${WORKDIR}"/patches
- #default
-
- # Restore date after patching
- #touch -r old.configure.ac configure.ac || die
- #touch -r old.configure configure || die
-
- # The makefiles make the man page depend on the configure script
- # which we patched above. Touch it to prevent regeneration.
- #touch doc/bison.1 || die #548778 #538300#9
-
- default
-
- # 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
-
- local myeconfargs=(
- $(use_enable nls)
- )
-
- econf "${myeconfargs[@]}"
-}
-
-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
-
- # Examples are about 200K, so let's make them optional still for now.
- if ! use examples ; then
- rm -r "${ED}"/usr/share/doc/${PF}/examples/ || die
- fi
-}
-
-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.8.2.ebuild b/sys-devel/bison/bison-3.8.2-r2.ebuild
index 0815391c170c..b778f945857a 100644
--- a/sys-devel/bison/bison-3.8.2.ebuild
+++ b/sys-devel/bison/bison-3.8.2-r2.ebuild
@@ -1,17 +1,19 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-inherit flag-o-matic
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bison.asc
+inherit flag-o-matic multiprocessing verify-sig
DESCRIPTION="A general-purpose (yacc-compatible) parser generator"
HOMEPAGE="https://www.gnu.org/software/bison/"
SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )"
-LICENSE="GPL-2"
+LICENSE="GPL-3+"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="examples nls static test"
RESTRICT="!test? ( test )"
@@ -23,9 +25,11 @@ DEPEND="
"
RDEPEND="${DEPEND}"
BDEPEND="
- sys-devel/flex
+ app-alternatives/lex
test? ( dev-lang/perl )
+ verify-sig? ( sec-keys/openpgp-keys-bison )
"
+PDEPEND="app-alternatives/yacc"
DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) # ChangeLog-2012 ChangeLog-1998 PACKAGING README-alpha README-release
@@ -64,10 +68,14 @@ src_configure() {
econf "${myeconfargs[@]}"
}
+src_test() {
+ emake check TESTSUITEFLAGS="--jobs=$(get_makeopts_jobs)"
+}
+
src_install() {
default
- # This one is installed by dev-util/yacc
+ # These are owned by app-alternatives/yacc
mv "${ED}"/usr/bin/yacc{,.bison} || die
mv "${ED}"/usr/share/man/man1/yacc{,.bison}.1 || die
@@ -81,16 +89,17 @@ src_install() {
}
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}"
+ # ensure to preserve the symlinks before app-alternatives/yacc
+ # is installed
+ if [[ ! -h ${EROOT}/usr/bin/yacc ]]; then
+ if [[ -e ${EROOT}/usr/bin/yacc ]] ; then
+ # bug #886123
+ ewarn "${EROOT}/usr/bin/yacc exists but is not a symlink."
+ ewarn "This is expected during Prefix bootstrap and unusual otherwise."
+ ewarn "Moving away unexpected ${EROOT}/usr/bin/yacc to .bak."
+ mv "${EROOT}/usr/bin/yacc" "${EROOT}/usr/bin/yacc.bak" || die
+ fi
+
+ ln -s yacc.bison "${EROOT}/usr/bin/yacc" || die
fi
}
diff --git a/sys-devel/bison/metadata.xml b/sys-devel/bison/metadata.xml
index 73dda144f9ac..2e9f3654b407 100644
--- a/sys-devel/bison/metadata.xml
+++ b/sys-devel/bison/metadata.xml
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<maintainer type="project">
- <email>base-system@gentoo.org</email>
- <name>Gentoo Base System</name>
-</maintainer>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:gnu:bison</remote-id>
+ <remote-id type="github">akimd/bison</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/bmake/Manifest b/sys-devel/bmake/Manifest
deleted file mode 100644
index 18b3ea5585d1..000000000000
--- a/sys-devel/bmake/Manifest
+++ /dev/null
@@ -1,4 +0,0 @@
-DIST bmake-20211024.tar.gz 774782 BLAKE2B 8ec30e133af832ed1cafba7592060dae1ad9e8937d1dd124446e0c74a26a40ca7ad42cfef10282ff13304672565ffaa8219dc027ba8fed2fdf735699397c7e41 SHA512 c39e5541d1c501ea8371825017fb0136a0778e02ec87c77a2f84a80d277573f97985f0b260147284b3cb4309ae6cfd3565330c2a6171fd98aec2c58f5a38b28d
-DIST bmake-20211212.tar.gz 780800 BLAKE2B 4a69f4881c70319d9548a688284036732ca541c0abc3082dc126ff743e550e6ccd1dee5c0909029e35f7e2329866e806615c2e4f8cd3bd4d7739e9b03f677326 SHA512 210065d90e1d4ec68df78d9c19d7f685d2a3f8dbd837ca1f6e40f250ae94b9e03f8ca07d15d3e9f34f27229b3e410ca9aef633fcc5f7661967a2553846524eb3
-DIST bmake-20211221.tar.gz 782416 BLAKE2B 928ca15e5d2014ac9e0cc4bf56c3034802082d7c87bfacdc953c92802a838b888b9265f22b59e553093c96b80068e4e26be2453860a077481ad94ba2362b915f SHA512 51f316c8784dfbb9221cfe6c80baf8b65b08c798a17d75ad4cb3e9ad90ce4b3d780da57ca6b15027854b93c78c67e9a4f8c135c452cf87aa2e06c4e1820a2a03
-DIST mk-20210330.tar.gz 107380 BLAKE2B 9ac30a117d9ba31635cf8d8d29fdba76f148611f47628403ca8f807081c32509f10498d3c30fd24985e5420af4710fe59fc6315d71f2d0c1cfed93263a06553a SHA512 6acd3ee911442934082f4f877d795b07c5e23022eaa9c0874799d97e92a2f5a663cb45f94b7f9745c49cbbce6b7e755a29e381ccfb9e68a0be1eedbd22fd5d3b
diff --git a/sys-devel/bmake/bmake-20211024.ebuild b/sys-devel/bmake/bmake-20211024.ebuild
deleted file mode 100644
index f3e4c0d04f65..000000000000
--- a/sys-devel/bmake/bmake-20211024.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MK_VER=20210330
-
-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"
-S="${WORKDIR}/${PN}"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="amd64 ~ppc ~x86"
-
-# Skip failing test (sandbox and csh)
-PATCHES=( "${FILESDIR}"/${PN}-20210206-tests.patch )
-
-src_prepare() {
- default
- cd "${WORKDIR}" || die
- eapply "${FILESDIR}"/${PN}-20210314-mk-fixes.patch
-}
-
-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
-
- # the 'ternary' test uses ${A} internally, which
- # conflicts with Gentoo's ${A}, hence unset it for
- # the tests temporarily.
- env -u A MAKEFLAGS= \
- "${S}"/bmake -r -m / TEST_MAKE="${S}"/bmake test || die "tests compilation failed"
-}
-
-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-20211212.ebuild b/sys-devel/bmake/bmake-20211212.ebuild
deleted file mode 100644
index 5d5f15630855..000000000000
--- a/sys-devel/bmake/bmake-20211212.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MK_VER=20210330
-
-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"
-S="${WORKDIR}/${PN}"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~ppc ~x86"
-
-# Skip failing test (sandbox and csh)
-PATCHES=( "${FILESDIR}"/${PN}-20210206-tests.patch )
-
-src_prepare() {
- default
- cd "${WORKDIR}" || die
- eapply "${FILESDIR}"/${PN}-20210314-mk-fixes.patch
-}
-
-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
-
- # the 'ternary' test uses ${A} internally, which
- # conflicts with Gentoo's ${A}, hence unset it for
- # the tests temporarily.
- env -u A MAKEFLAGS= \
- "${S}"/bmake -r -m / TEST_MAKE="${S}"/bmake test || die "tests compilation failed"
-}
-
-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-20211221.ebuild b/sys-devel/bmake/bmake-20211221.ebuild
deleted file mode 100644
index 5d5f15630855..000000000000
--- a/sys-devel/bmake/bmake-20211221.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-MK_VER=20210330
-
-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"
-S="${WORKDIR}/${PN}"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~ppc ~x86"
-
-# Skip failing test (sandbox and csh)
-PATCHES=( "${FILESDIR}"/${PN}-20210206-tests.patch )
-
-src_prepare() {
- default
- cd "${WORKDIR}" || die
- eapply "${FILESDIR}"/${PN}-20210314-mk-fixes.patch
-}
-
-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
-
- # the 'ternary' test uses ${A} internally, which
- # conflicts with Gentoo's ${A}, hence unset it for
- # the tests temporarily.
- env -u A MAKEFLAGS= \
- "${S}"/bmake -r -m / TEST_MAKE="${S}"/bmake test || die "tests compilation failed"
-}
-
-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/files/bmake-20210206-tests.patch b/sys-devel/bmake/files/bmake-20210206-tests.patch
deleted file mode 100644
index 49e5f258e91a..000000000000
--- a/sys-devel/bmake/files/bmake-20210206-tests.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- a/unit-tests/Makefile
-+++ b/unit-tests/Makefile
-@@ -191,7 +191,6 @@ TESTS+= dotwait
- TESTS+= envfirst
- TESTS+= error
- TESTS+= # escape # broken by reverting POSIX changes
--TESTS+= export
- TESTS+= export-all
- TESTS+= export-env
- TESTS+= export-variants
-@@ -290,7 +289,6 @@ TESTS+= sh-leading-plus
- TESTS+= sh-meta-chars
- TESTS+= sh-multi-line
- TESTS+= sh-single-line
--TESTS+= shell-csh
- TESTS+= shell-custom
- .if exists(/bin/ksh)
- TESTS+= shell-ksh
diff --git a/sys-devel/bmake/files/bmake-20210314-mk-fixes.patch b/sys-devel/bmake/files/bmake-20210314-mk-fixes.patch
deleted file mode 100644
index 6dd935863be1..000000000000
--- a/sys-devel/bmake/files/bmake-20210314-mk-fixes.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-# https://bugs.gentoo.org/779340
-# https://bugs.gentoo.org/778458
-# - Fix incorrect linking of shared libraries
-# - Respect LDFLAGS
-# - Do not strip prog binaries
---- a/mk/lib.mk
-+++ b/mk/lib.mk
-@@ -170,7 +170,7 @@ LD_solib= lib${LIB}_pic.a
- .elif ${TARGET_OSNAME} == "Linux"
- SHLIB_LD = ${CC}
- # this is ambiguous of course
--LD_shared=-shared -Wl,"-soname lib${LIB}.so.${SHLIB_MAJOR}"
-+LD_shared=-shared -Wl,-soname,lib${LIB}.so.${SHLIB_MAJOR}
- LD_solib= -Wl,--whole-archive lib${LIB}_pic.a -Wl,--no-whole-archive
- .if ${COMPILER_TYPE} == "gcc"
- # Linux uses GNU ld, which is a multi-pass linker
-@@ -455,11 +455,11 @@ lib${LIB}.${LD_so}: ${SOLIB} ${DPADD}
- --whole-archive ${SOLIB} --no-whole-archive ${SHLIB_LDADD} \
- ${SHLIB_LDENDFILE}
- .else
-- ${SHLIB_LD} ${LD_x} ${LD_shared} \
-+ ${SHLIB_LD} ${LD_x} ${LD_shared} ${LDFLAGS} \
- -o ${.TARGET} ${SOLIB} ${SHLIB_LDADD}
- .endif
- .else
-- ${SHLIB_LD} -o ${.TARGET} ${LD_shared} ${LD_solib} ${DLLIB} ${SHLIB_LDADD}
-+ ${SHLIB_LD} -o ${.TARGET} ${LD_shared} ${LDFLAGS} ${LD_solib} ${DLLIB} ${SHLIB_LDADD}
- .endif
- .endif
- .if !empty(SHLIB_LINKS)
---- a/mk/prog.mk
-+++ b/mk/prog.mk
-@@ -178,7 +178,7 @@ proginstall:
- .if defined(PROG)
- [ -d ${DESTDIR}${BINDIR} ] || \
- ${INSTALL} -d ${PROG_INSTALL_OWN} -m 775 ${DESTDIR}${BINDIR}
-- ${INSTALL} ${COPY} ${STRIP_FLAG} ${PROG_INSTALL_OWN} -m ${BINMODE} \
-+ ${INSTALL} ${COPY} ${PROG_INSTALL_OWN} -m ${BINMODE} \
- ${PROG} ${DESTDIR}${BINDIR}/${PROG_NAME}
- .endif
- .if defined(HIDEGAME)
---- a/mk/sys/Linux.mk
-+++ b/mk/sys/Linux.mk
-@@ -19,12 +19,13 @@ NEED_SOLINKS ?=yes
- AR ?= ar
- ARFLAGS ?= rl
- RANLIB ?= ranlib
-+LDFLAGS ?=
-
- AS ?= as
- AFLAGS=
- COMPILE.s ?= ${AS} ${AFLAGS}
- LINK.s ?= ${CC} ${AFLAGS} ${LDFLAGS}
--COMPILE.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} -c
-+COMPILE.S ?= ${CC} ${AFLAGS} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -c
- LINK.S ?= ${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}
- .if exists(/usr/local/bin/gcc)
- CC ?= gcc -pipe
-@@ -65,7 +66,6 @@ LFLAGS=
- LEX.l ?= ${LEX} ${LFLAGS}
-
- LD ?= ld
--LDFLAGS=
-
- LINT ?= lint
- LINTFLAGS ?= -chapbx
diff --git a/sys-devel/bmake/metadata.xml b/sys-devel/bmake/metadata.xml
deleted file mode 100644
index fe8a3a5da516..000000000000
--- a/sys-devel/bmake/metadata.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="person">
- <email>jsmolic@gentoo.org</email>
- <name>Jakov Smolić</name>
- </maintainer>
- <maintainer type="person">
- <email>soap@gentoo.org</email>
- <name>David Seifert</name>
- </maintainer>
-</pkgmetadata>
diff --git a/sys-devel/boost-m4/Manifest b/sys-devel/boost-m4/Manifest
deleted file mode 100644
index 2c9cc88c4c1b..000000000000
--- a/sys-devel/boost-m4/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST boost-m4-0.4_p20160328.tar.gz 41253 BLAKE2B 47ad17f652560dce4e276b295e55e7daa8752f1c932a6c0d1bad9e4bc2ff72eb0adfaf8abc4e7c57f179f08857de255935fc530f0a4d8a26d3f6a2a0711417ac SHA512 4aecd311b21ced4a3d62fc706a9fa731c375ea490482f78756892243b5af6909cd8841c249632b37820be7f1bde41c290e842edd933d0c727e1dca76d30eb506
diff --git a/sys-devel/boost-m4/boost-m4-0.4_p20160328.ebuild b/sys-devel/boost-m4/boost-m4-0.4_p20160328.ebuild
deleted file mode 100644
index abe648762767..000000000000
--- a/sys-devel/boost-m4/boost-m4-0.4_p20160328.ebuild
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# 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 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-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/metadata.xml b/sys-devel/boost-m4/metadata.xml
deleted file mode 100644
index 9b6ec7a4328b..000000000000
--- a/sys-devel/boost-m4/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <!--maintainer-needed-->
- <upstream>
- <remote-id type="github">tsuna/boost.m4</remote-id>
- </upstream>
-</pkgmetadata>
diff --git a/sys-devel/clang-common/Manifest b/sys-devel/clang-common/Manifest
index 286783c6f5a6..6dab866d637b 100644
--- a/sys-devel/clang-common/Manifest
+++ b/sys-devel/clang-common/Manifest
@@ -1,5 +1,13 @@
-DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
-DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
-DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
-DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
-DIST llvmorg-13.0.1-rc2.tar.gz 147304491 BLAKE2B 86b2c64e57e4aaab837229b25a95d5517ac077d22cf552d71ff6b996dbdbcd171ad51de7eb12d098b50a139beda4ace843727181a1c6978fc487215391e64a3a SHA512 0d890f3317504c8cef10e118b245e5a4c815cc19f07cbc511a66bde6c9b1f3d15c167942608a8987befe9115b24657d29f72305f9f2794385a7434b80167f40f
+DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948
+DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
+DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
+DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7
+DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
+DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
+DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
+DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
+DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
+DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
+DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
diff --git a/sys-devel/clang-common/clang-common-11.1.0.ebuild b/sys-devel/clang-common/clang-common-11.1.0.ebuild
deleted file mode 100644
index 8d21c79346d2..000000000000
--- a/sys-devel/clang-common/clang-common-11.1.0.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE=""
-
-PDEPEND="sys-devel/clang:*"
-
-LLVM_COMPONENTS=( clang/utils/bash-autocomplete.sh )
-llvm.org_set_globals
-S=${WORKDIR}/clang/utils
-
-src_install() {
- newbashcomp bash-autocomplete.sh clang
-}
diff --git a/sys-devel/clang-common/clang-common-12.0.1.ebuild b/sys-devel/clang-common/clang-common-12.0.1.ebuild
deleted file mode 100644
index 70896015ab67..000000000000
--- a/sys-devel/clang-common/clang-common-12.0.1.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE=""
-
-PDEPEND="sys-devel/clang:*"
-
-LLVM_COMPONENTS=( clang/utils/bash-autocomplete.sh )
-llvm.org_set_globals
-S=${WORKDIR}/clang/utils
-
-src_install() {
- newbashcomp bash-autocomplete.sh clang
-}
diff --git a/sys-devel/clang-common/clang-common-13.0.0.ebuild b/sys-devel/clang-common/clang-common-13.0.0.ebuild
deleted file mode 100644
index 70896015ab67..000000000000
--- a/sys-devel/clang-common/clang-common-13.0.0.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE=""
-
-PDEPEND="sys-devel/clang:*"
-
-LLVM_COMPONENTS=( clang/utils/bash-autocomplete.sh )
-llvm.org_set_globals
-S=${WORKDIR}/clang/utils
-
-src_install() {
- newbashcomp bash-autocomplete.sh clang
-}
diff --git a/sys-devel/clang-common/clang-common-13.0.1.9999.ebuild b/sys-devel/clang-common/clang-common-13.0.1.9999.ebuild
deleted file mode 100644
index 03e4441b91b9..000000000000
--- a/sys-devel/clang-common/clang-common-13.0.1.9999.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-PDEPEND="sys-devel/clang:*"
-
-LLVM_COMPONENTS=( clang/utils/bash-autocomplete.sh )
-llvm.org_set_globals
-S=${WORKDIR}/clang/utils
-
-src_install() {
- newbashcomp bash-autocomplete.sh clang
-}
diff --git a/sys-devel/clang-common/clang-common-13.0.1_rc1.ebuild b/sys-devel/clang-common/clang-common-13.0.1_rc1.ebuild
deleted file mode 100644
index 03e4441b91b9..000000000000
--- a/sys-devel/clang-common/clang-common-13.0.1_rc1.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-PDEPEND="sys-devel/clang:*"
-
-LLVM_COMPONENTS=( clang/utils/bash-autocomplete.sh )
-llvm.org_set_globals
-S=${WORKDIR}/clang/utils
-
-src_install() {
- newbashcomp bash-autocomplete.sh clang
-}
diff --git a/sys-devel/clang-common/clang-common-13.0.1_rc2.ebuild b/sys-devel/clang-common/clang-common-13.0.1_rc2.ebuild
deleted file mode 100644
index 71768ae561e5..000000000000
--- a/sys-devel/clang-common/clang-common-13.0.1_rc2.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-PDEPEND="sys-devel/clang:*"
-
-LLVM_COMPONENTS=( clang/utils/bash-autocomplete.sh )
-llvm.org_set_globals
-S=${WORKDIR}/clang/utils
-
-src_install() {
- newbashcomp bash-autocomplete.sh clang
-}
diff --git a/sys-devel/clang-common/clang-common-14.0.0.9999.ebuild b/sys-devel/clang-common/clang-common-14.0.0.9999.ebuild
deleted file mode 100644
index 03e4441b91b9..000000000000
--- a/sys-devel/clang-common/clang-common-14.0.0.9999.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of clang"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-PDEPEND="sys-devel/clang:*"
-
-LLVM_COMPONENTS=( clang/utils/bash-autocomplete.sh )
-llvm.org_set_globals
-S=${WORKDIR}/clang/utils
-
-src_install() {
- newbashcomp bash-autocomplete.sh clang
-}
diff --git a/sys-devel/clang-common/clang-common-15.0.7-r8.ebuild b/sys-devel/clang-common/clang-common-15.0.7-r8.ebuild
new file mode 100644
index 000000000000..4d200fba7af7
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-15.0.7-r8.ebuild
@@ -0,0 +1,185 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
+IUSE="
+ default-compiler-rt default-libcxx default-lld llvm-libunwind
+ hardened stricter
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # Baseline hardening (bug #851111)
+ # (-fstack-clash-protection is omitted because of a possible Clang bug,
+ # see bug #892537 and bug #865339.)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ #endif
+ EOF
+
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ -D_LIBCPP_ENABLE_ASSERTIONS=1
+ EOF
+ fi
+
+ if use stricter; then
+ newins - gentoo-stricter.cfg <<-EOF
+ # This file increases the strictness of older clang versions
+ # to match the newest upstream version.
+
+ # clang-16 defaults
+ -Werror=implicit-function-declaration
+ -Werror=implicit-int
+ -Werror=incompatible-function-pointer-types
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ @gentoo-stricter.cfg
+ EOF
+ fi
+
+ local tool
+ for tool in clang{,++,-cpp}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ EOF
+ done
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/clang-common-16.0.6-r4.ebuild b/sys-devel/clang-common/clang-common-16.0.6-r4.ebuild
new file mode 100644
index 000000000000..8185d75d346e
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-16.0.6-r4.ebuild
@@ -0,0 +1,191 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ #endif
+ EOF
+
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ -D_LIBCPP_ENABLE_ASSERTIONS=1
+ EOF
+ fi
+
+ local tool
+ for tool in clang{,++,-cpp}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ EOF
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ cat >> "${ED}/etc/clang/clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/clang-common-17.0.6-r5.ebuild b/sys-devel/clang-common/clang-common-17.0.6-r5.ebuild
new file mode 100644
index 000000000000..e736620feb37
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-17.0.6-r5.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+_doclang_cfg() {
+ local triple="${1}"
+
+ local tool
+ for tool in ${triple}-clang{,++}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ @gentoo-common-ld.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+
+ newins - "${triple}-clang-cpp.cfg" <<-EOF
+ # This configuration file is used by the ${triple}-clang-cpp driver.
+ @gentoo-common.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+
+ # Install symlinks for triples with other vendor strings since some
+ # programs insist on mangling the triple.
+ local vendor
+ for vendor in gentoo pc unknown; do
+ local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+ for tool in clang{,++,-cpp}; do
+ if [[ ! -f "${ED}/etc/clang/${vendor_triple}-${tool}.cfg" ]]; then
+ dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+ fi
+ done
+ done
+}
+
+doclang_cfg() {
+ local triple="${1}"
+
+ _doclang_cfg ${triple}
+
+ # LLVM may have different arch names in some cases. For example in x86
+ # profiles the triple uses i686, but llvm will prefer i386 if invoked
+ # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+ # be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+ #
+ # To make sure the correct triples are installed,
+ # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+ # and compare with CHOST values in profiles.
+
+ local abi=${triple%%-*}
+ case ${abi} in
+ armv4l|armv4t|armv5tel|armv6j|armv7a)
+ _doclang_cfg ${triple/${abi}/arm}
+ ;;
+ i686)
+ _doclang_cfg ${triple/${abi}/i386}
+ ;;
+ sparc)
+ _doclang_cfg ${triple/${abi}/sparcel}
+ ;;
+ sparc64)
+ _doclang_cfg ${triple/${abi}/sparcv9}
+ ;;
+ esac
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # clang-cpp does not like link args being passed to it when directly
+ # invoked, so use a separate configuration file.
+ newins - gentoo-common-ld.cfg <<-EOF
+ # This file contains flags common to clang and clang++
+ @gentoo-hardened-ld.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ newins - gentoo-cet.cfg <<-EOF
+ -Xarch_host -fcf-protection=$(usex cet full none)
+ EOF
+
+ if use kernel_Darwin; then
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # There was -Wl,-z,relro here, but it's not supported on Mac
+ # TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+ EOF
+ else
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Wl,-z,relro
+ -Wl,-z,now
+ EOF
+ fi
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+ # define __GENTOO_NOT_FREESTANDING 1
+ # else
+ # define __GENTOO_NOT_FREESTANDING 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ # undef __GENTOO_NOT_FREESTANDING
+ #endif
+ EOF
+
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ # https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+ -D_LIBCPP_ENABLE_ASSERTIONS=1
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ EOF
+ fi
+
+ # We only install config files for supported ABIs because unprefixed tools
+ # might be used for crosscompilation where e.g. PIE may not be supported.
+ # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+ local abi
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ doclang_cfg "${abi_chost}"
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ fi
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/clang-common-18.1.3-r3.ebuild b/sys-devel/clang-common/clang-common-18.1.3-r3.ebuild
new file mode 100644
index 000000000000..fff63838526d
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-18.1.3-r3.ebuild
@@ -0,0 +1,297 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+_doclang_cfg() {
+ local triple="${1}"
+
+ local tool
+ for tool in ${triple}-clang{,++}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ @gentoo-common-ld.cfg
+ EOF
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+
+ newins - "${triple}-clang-cpp.cfg" <<-EOF
+ # This configuration file is used by the ${triple}-clang-cpp driver.
+ @gentoo-common.cfg
+ EOF
+
+ # Install symlinks for triples with other vendor strings since some
+ # programs insist on mangling the triple.
+ local vendor
+ for vendor in gentoo pc unknown; do
+ local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+ for tool in clang{,++,-cpp}; do
+ if [[ ! -f "${ED}/etc/clang/${vendor_triple}-${tool}.cfg" ]]; then
+ dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+ fi
+ done
+ done
+}
+
+doclang_cfg() {
+ local triple="${1}"
+
+ _doclang_cfg ${triple}
+
+ # LLVM may have different arch names in some cases. For example in x86
+ # profiles the triple uses i686, but llvm will prefer i386 if invoked
+ # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+ # be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+ #
+ # To make sure the correct triples are installed,
+ # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+ # and compare with CHOST values in profiles.
+
+ local abi=${triple%%-*}
+ case ${abi} in
+ armv4l|armv4t|armv5tel|armv6j|armv7a)
+ _doclang_cfg ${triple/${abi}/arm}
+ ;;
+ i686)
+ _doclang_cfg ${triple/${abi}/i386}
+ ;;
+ sparc)
+ _doclang_cfg ${triple/${abi}/sparcel}
+ ;;
+ sparc64)
+ _doclang_cfg ${triple/${abi}/sparcv9}
+ ;;
+ esac
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # clang-cpp does not like link args being passed to it when directly
+ # invoked, so use a separate configuration file.
+ newins - gentoo-common-ld.cfg <<-EOF
+ # This file contains flags common to clang and clang++
+ @gentoo-hardened-ld.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ if use amd64; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ -Xarch_host -fcf-protection=$(usex cet full none)
+ EOF
+ fi
+
+ if use kernel_Darwin; then
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # There was -Wl,-z,relro here, but it's not supported on Mac
+ # TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+ EOF
+ else
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Wl,-z,relro
+ -Wl,-z,now
+ EOF
+ fi
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+ # define __GENTOO_NOT_FREESTANDING 1
+ # else
+ # define __GENTOO_NOT_FREESTANDING 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ # undef __GENTOO_NOT_FREESTANDING
+ #endif
+ EOF
+
+ # TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+ # non-hardened?
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ # https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ EOF
+ fi
+
+ # We only install config files for supported ABIs because unprefixed tools
+ # might be used for crosscompilation where e.g. PIE may not be supported.
+ # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+ local abi
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ doclang_cfg "${abi_chost}"
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ fi
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/clang-common-18.1.4-r3.ebuild b/sys-devel/clang-common/clang-common-18.1.4-r3.ebuild
new file mode 100644
index 000000000000..fff63838526d
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-18.1.4-r3.ebuild
@@ -0,0 +1,297 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+_doclang_cfg() {
+ local triple="${1}"
+
+ local tool
+ for tool in ${triple}-clang{,++}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ @gentoo-common-ld.cfg
+ EOF
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+
+ newins - "${triple}-clang-cpp.cfg" <<-EOF
+ # This configuration file is used by the ${triple}-clang-cpp driver.
+ @gentoo-common.cfg
+ EOF
+
+ # Install symlinks for triples with other vendor strings since some
+ # programs insist on mangling the triple.
+ local vendor
+ for vendor in gentoo pc unknown; do
+ local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+ for tool in clang{,++,-cpp}; do
+ if [[ ! -f "${ED}/etc/clang/${vendor_triple}-${tool}.cfg" ]]; then
+ dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+ fi
+ done
+ done
+}
+
+doclang_cfg() {
+ local triple="${1}"
+
+ _doclang_cfg ${triple}
+
+ # LLVM may have different arch names in some cases. For example in x86
+ # profiles the triple uses i686, but llvm will prefer i386 if invoked
+ # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+ # be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+ #
+ # To make sure the correct triples are installed,
+ # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+ # and compare with CHOST values in profiles.
+
+ local abi=${triple%%-*}
+ case ${abi} in
+ armv4l|armv4t|armv5tel|armv6j|armv7a)
+ _doclang_cfg ${triple/${abi}/arm}
+ ;;
+ i686)
+ _doclang_cfg ${triple/${abi}/i386}
+ ;;
+ sparc)
+ _doclang_cfg ${triple/${abi}/sparcel}
+ ;;
+ sparc64)
+ _doclang_cfg ${triple/${abi}/sparcv9}
+ ;;
+ esac
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # clang-cpp does not like link args being passed to it when directly
+ # invoked, so use a separate configuration file.
+ newins - gentoo-common-ld.cfg <<-EOF
+ # This file contains flags common to clang and clang++
+ @gentoo-hardened-ld.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ if use amd64; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ -Xarch_host -fcf-protection=$(usex cet full none)
+ EOF
+ fi
+
+ if use kernel_Darwin; then
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # There was -Wl,-z,relro here, but it's not supported on Mac
+ # TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+ EOF
+ else
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Wl,-z,relro
+ -Wl,-z,now
+ EOF
+ fi
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+ # define __GENTOO_NOT_FREESTANDING 1
+ # else
+ # define __GENTOO_NOT_FREESTANDING 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ # undef __GENTOO_NOT_FREESTANDING
+ #endif
+ EOF
+
+ # TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+ # non-hardened?
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ # https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ EOF
+ fi
+
+ # We only install config files for supported ABIs because unprefixed tools
+ # might be used for crosscompilation where e.g. PIE may not be supported.
+ # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+ local abi
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ doclang_cfg "${abi_chost}"
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ fi
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild b/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild
new file mode 100644
index 000000000000..f260391ba4ab
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild
@@ -0,0 +1,304 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+_doclang_cfg() {
+ local triple="${1}"
+
+ local tool
+ for tool in ${triple}-clang{,++}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ @gentoo-common-ld.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+
+ newins - "${triple}-clang-cpp.cfg" <<-EOF
+ # This configuration file is used by the ${triple}-clang-cpp driver.
+ @gentoo-common.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+
+ # Install symlinks for triples with other vendor strings since some
+ # programs insist on mangling the triple.
+ local vendor
+ for vendor in gentoo pc unknown; do
+ local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+ for tool in clang{,++,-cpp}; do
+ if [[ ! -f "${ED}/etc/clang/${vendor_triple}-${tool}.cfg" ]]; then
+ dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+ fi
+ done
+ done
+}
+
+doclang_cfg() {
+ local triple="${1}"
+
+ _doclang_cfg ${triple}
+
+ # LLVM may have different arch names in some cases. For example in x86
+ # profiles the triple uses i686, but llvm will prefer i386 if invoked
+ # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+ # be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+ #
+ # To make sure the correct triples are installed,
+ # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+ # and compare with CHOST values in profiles.
+
+ local abi=${triple%%-*}
+ case ${abi} in
+ armv4l|armv4t|armv5tel|armv6j|armv7a)
+ _doclang_cfg ${triple/${abi}/arm}
+ ;;
+ i686)
+ _doclang_cfg ${triple/${abi}/i386}
+ ;;
+ sparc)
+ _doclang_cfg ${triple/${abi}/sparcel}
+ ;;
+ sparc64)
+ _doclang_cfg ${triple/${abi}/sparcv9}
+ ;;
+ esac
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # clang-cpp does not like link args being passed to it when directly
+ # invoked, so use a separate configuration file.
+ newins - gentoo-common-ld.cfg <<-EOF
+ # This file contains flags common to clang and clang++
+ @gentoo-hardened-ld.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ newins - gentoo-cet.cfg <<-EOF
+ -Xarch_host -fcf-protection=$(usex cet full none)
+ EOF
+
+ if use kernel_Darwin; then
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # There was -Wl,-z,relro here, but it's not supported on Mac
+ # TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+ EOF
+ else
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Wl,-z,relro
+ -Wl,-z,now
+ EOF
+ fi
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+ # define __GENTOO_NOT_FREESTANDING 1
+ # else
+ # define __GENTOO_NOT_FREESTANDING 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ # undef __GENTOO_NOT_FREESTANDING
+ #endif
+ EOF
+
+ # TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+ # non-hardened?
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ # https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ EOF
+ fi
+
+ # We only install config files for supported ABIs because unprefixed tools
+ # might be used for crosscompilation where e.g. PIE may not be supported.
+ # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+ local abi
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ doclang_cfg "${abi_chost}"
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ fi
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/clang-common-19.0.0_pre20240330-r1.ebuild b/sys-devel/clang-common/clang-common-19.0.0_pre20240330-r1.ebuild
new file mode 100644
index 000000000000..f260391ba4ab
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-19.0.0_pre20240330-r1.ebuild
@@ -0,0 +1,304 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+_doclang_cfg() {
+ local triple="${1}"
+
+ local tool
+ for tool in ${triple}-clang{,++}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ @gentoo-common-ld.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+
+ newins - "${triple}-clang-cpp.cfg" <<-EOF
+ # This configuration file is used by the ${triple}-clang-cpp driver.
+ @gentoo-common.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+
+ # Install symlinks for triples with other vendor strings since some
+ # programs insist on mangling the triple.
+ local vendor
+ for vendor in gentoo pc unknown; do
+ local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+ for tool in clang{,++,-cpp}; do
+ if [[ ! -f "${ED}/etc/clang/${vendor_triple}-${tool}.cfg" ]]; then
+ dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+ fi
+ done
+ done
+}
+
+doclang_cfg() {
+ local triple="${1}"
+
+ _doclang_cfg ${triple}
+
+ # LLVM may have different arch names in some cases. For example in x86
+ # profiles the triple uses i686, but llvm will prefer i386 if invoked
+ # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+ # be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+ #
+ # To make sure the correct triples are installed,
+ # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+ # and compare with CHOST values in profiles.
+
+ local abi=${triple%%-*}
+ case ${abi} in
+ armv4l|armv4t|armv5tel|armv6j|armv7a)
+ _doclang_cfg ${triple/${abi}/arm}
+ ;;
+ i686)
+ _doclang_cfg ${triple/${abi}/i386}
+ ;;
+ sparc)
+ _doclang_cfg ${triple/${abi}/sparcel}
+ ;;
+ sparc64)
+ _doclang_cfg ${triple/${abi}/sparcv9}
+ ;;
+ esac
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # clang-cpp does not like link args being passed to it when directly
+ # invoked, so use a separate configuration file.
+ newins - gentoo-common-ld.cfg <<-EOF
+ # This file contains flags common to clang and clang++
+ @gentoo-hardened-ld.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ newins - gentoo-cet.cfg <<-EOF
+ -Xarch_host -fcf-protection=$(usex cet full none)
+ EOF
+
+ if use kernel_Darwin; then
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # There was -Wl,-z,relro here, but it's not supported on Mac
+ # TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+ EOF
+ else
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Wl,-z,relro
+ -Wl,-z,now
+ EOF
+ fi
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+ # define __GENTOO_NOT_FREESTANDING 1
+ # else
+ # define __GENTOO_NOT_FREESTANDING 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ # undef __GENTOO_NOT_FREESTANDING
+ #endif
+ EOF
+
+ # TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+ # non-hardened?
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ # https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ EOF
+ fi
+
+ # We only install config files for supported ABIs because unprefixed tools
+ # might be used for crosscompilation where e.g. PIE may not be supported.
+ # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+ local abi
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ doclang_cfg "${abi_chost}"
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ fi
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/clang-common-19.0.0_pre20240404.ebuild b/sys-devel/clang-common/clang-common-19.0.0_pre20240404.ebuild
new file mode 100644
index 000000000000..f260391ba4ab
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-19.0.0_pre20240404.ebuild
@@ -0,0 +1,304 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+_doclang_cfg() {
+ local triple="${1}"
+
+ local tool
+ for tool in ${triple}-clang{,++}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ @gentoo-common-ld.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+
+ newins - "${triple}-clang-cpp.cfg" <<-EOF
+ # This configuration file is used by the ${triple}-clang-cpp driver.
+ @gentoo-common.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+
+ # Install symlinks for triples with other vendor strings since some
+ # programs insist on mangling the triple.
+ local vendor
+ for vendor in gentoo pc unknown; do
+ local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+ for tool in clang{,++,-cpp}; do
+ if [[ ! -f "${ED}/etc/clang/${vendor_triple}-${tool}.cfg" ]]; then
+ dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+ fi
+ done
+ done
+}
+
+doclang_cfg() {
+ local triple="${1}"
+
+ _doclang_cfg ${triple}
+
+ # LLVM may have different arch names in some cases. For example in x86
+ # profiles the triple uses i686, but llvm will prefer i386 if invoked
+ # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+ # be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+ #
+ # To make sure the correct triples are installed,
+ # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+ # and compare with CHOST values in profiles.
+
+ local abi=${triple%%-*}
+ case ${abi} in
+ armv4l|armv4t|armv5tel|armv6j|armv7a)
+ _doclang_cfg ${triple/${abi}/arm}
+ ;;
+ i686)
+ _doclang_cfg ${triple/${abi}/i386}
+ ;;
+ sparc)
+ _doclang_cfg ${triple/${abi}/sparcel}
+ ;;
+ sparc64)
+ _doclang_cfg ${triple/${abi}/sparcv9}
+ ;;
+ esac
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # clang-cpp does not like link args being passed to it when directly
+ # invoked, so use a separate configuration file.
+ newins - gentoo-common-ld.cfg <<-EOF
+ # This file contains flags common to clang and clang++
+ @gentoo-hardened-ld.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ newins - gentoo-cet.cfg <<-EOF
+ -Xarch_host -fcf-protection=$(usex cet full none)
+ EOF
+
+ if use kernel_Darwin; then
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # There was -Wl,-z,relro here, but it's not supported on Mac
+ # TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+ EOF
+ else
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Wl,-z,relro
+ -Wl,-z,now
+ EOF
+ fi
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+ # define __GENTOO_NOT_FREESTANDING 1
+ # else
+ # define __GENTOO_NOT_FREESTANDING 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ # undef __GENTOO_NOT_FREESTANDING
+ #endif
+ EOF
+
+ # TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+ # non-hardened?
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ # https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ EOF
+ fi
+
+ # We only install config files for supported ABIs because unprefixed tools
+ # might be used for crosscompilation where e.g. PIE may not be supported.
+ # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+ local abi
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ doclang_cfg "${abi_chost}"
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ fi
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/clang-common-19.0.0_pre20240410.ebuild b/sys-devel/clang-common/clang-common-19.0.0_pre20240410.ebuild
new file mode 100644
index 000000000000..f260391ba4ab
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-19.0.0_pre20240410.ebuild
@@ -0,0 +1,304 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+_doclang_cfg() {
+ local triple="${1}"
+
+ local tool
+ for tool in ${triple}-clang{,++}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ @gentoo-common-ld.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+
+ newins - "${triple}-clang-cpp.cfg" <<-EOF
+ # This configuration file is used by the ${triple}-clang-cpp driver.
+ @gentoo-common.cfg
+ EOF
+ if [[ ${triple} == x86_64* ]]; then
+ cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+ @gentoo-cet.cfg
+ EOF
+ fi
+
+ # Install symlinks for triples with other vendor strings since some
+ # programs insist on mangling the triple.
+ local vendor
+ for vendor in gentoo pc unknown; do
+ local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+ for tool in clang{,++,-cpp}; do
+ if [[ ! -f "${ED}/etc/clang/${vendor_triple}-${tool}.cfg" ]]; then
+ dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+ fi
+ done
+ done
+}
+
+doclang_cfg() {
+ local triple="${1}"
+
+ _doclang_cfg ${triple}
+
+ # LLVM may have different arch names in some cases. For example in x86
+ # profiles the triple uses i686, but llvm will prefer i386 if invoked
+ # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+ # be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+ #
+ # To make sure the correct triples are installed,
+ # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+ # and compare with CHOST values in profiles.
+
+ local abi=${triple%%-*}
+ case ${abi} in
+ armv4l|armv4t|armv5tel|armv6j|armv7a)
+ _doclang_cfg ${triple/${abi}/arm}
+ ;;
+ i686)
+ _doclang_cfg ${triple/${abi}/i386}
+ ;;
+ sparc)
+ _doclang_cfg ${triple/${abi}/sparcel}
+ ;;
+ sparc64)
+ _doclang_cfg ${triple/${abi}/sparcv9}
+ ;;
+ esac
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # clang-cpp does not like link args being passed to it when directly
+ # invoked, so use a separate configuration file.
+ newins - gentoo-common-ld.cfg <<-EOF
+ # This file contains flags common to clang and clang++
+ @gentoo-hardened-ld.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ newins - gentoo-cet.cfg <<-EOF
+ -Xarch_host -fcf-protection=$(usex cet full none)
+ EOF
+
+ if use kernel_Darwin; then
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # There was -Wl,-z,relro here, but it's not supported on Mac
+ # TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+ EOF
+ else
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Wl,-z,relro
+ -Wl,-z,now
+ EOF
+ fi
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+ # define __GENTOO_NOT_FREESTANDING 1
+ # else
+ # define __GENTOO_NOT_FREESTANDING 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ # undef __GENTOO_NOT_FREESTANDING
+ #endif
+ EOF
+
+ # TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+ # non-hardened?
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ # https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ EOF
+ fi
+
+ # We only install config files for supported ABIs because unprefixed tools
+ # might be used for crosscompilation where e.g. PIE may not be supported.
+ # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+ local abi
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ doclang_cfg "${abi_chost}"
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ fi
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-common/metadata.xml b/sys-devel/clang-common/metadata.xml
index 3ad9b7a7c0eb..da45c87b0e27 100644
--- a/sys-devel/clang-common/metadata.xml
+++ b/sys-devel/clang-common/metadata.xml
@@ -4,4 +4,24 @@
<maintainer type="project">
<email>llvm@gentoo.org</email>
</maintainer>
+ <upstream>
+ <remote-id type="github">llvm/llvm-project</remote-id>
+ </upstream>
+ <use>
+ <flag name="bootstrap-prefix">!!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for bootstrapping Gentoo Prefix</flag>
+ <flag name="cet">
+ Enable support for control flow hijacking protection.
+
+ On amd64, this provides Intel Control Flow Enforcement Technology (CET).
+
+ Only provides benefits on newer CPUs. For Intel, the CPU
+ must be at least as new as Tiger Lake. For AMD, it must be
+ at least as new as Zen 3. This is harmless on older CPUs,
+ but provides no benefit either.
+ </flag>
+ <flag name="default-compiler-rt">Use compiler-rt + libunwind 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="default-lld">Use lld as the default linker for clang</flag>
+ <flag name="stricter">Default to stricter behavior known from newer clang versions, turning more warnings into errors</flag>
+ </use>
</pkgmetadata>
diff --git a/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-16.ebuild b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-16.ebuild
new file mode 100644
index 000000000000..2a6e3cd5239e
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-16.ebuild
@@ -0,0 +1,43 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev
+
+DESCRIPTION="Symlinks to a Clang crosscompiler"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x64-macos"
+
+RDEPEND="
+ sys-devel/clang:${SLOT}
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ local llvm_path="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ into "${llvm_path}"
+
+ for exe in "clang" "clang++" "clang-cpp"; do
+ newbin - "${CTARGET}-${exe}" <<-EOF
+ #!/bin/sh
+ exec ${exe}-${SLOT} --no-default-config --config="/etc/clang/cross/${CTARGET}.cfg" \${@}
+ EOF
+ done
+
+ local tools=(
+ ${CTARGET}-clang-${SLOT}:${CTARGET}-clang
+ ${CTARGET}-clang-cpp-${SLOT}:${CTARGET}-clang-cpp
+ ${CTARGET}-clang++-${SLOT}:${CTARGET}-clang++
+ )
+
+ local t
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${llvm_path}/bin/${t%:*}"
+ done
+}
diff --git a/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-17.ebuild b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-17.ebuild
new file mode 100644
index 000000000000..4c77cf55e7da
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-17.ebuild
@@ -0,0 +1,43 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev
+
+DESCRIPTION="Symlinks to a Clang crosscompiler"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux ~x64-macos"
+
+RDEPEND="
+ sys-devel/clang:${SLOT}
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ local llvm_path="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ into "${llvm_path}"
+
+ for exe in "clang" "clang++" "clang-cpp"; do
+ newbin - "${CTARGET}-${exe}" <<-EOF
+ #!/bin/sh
+ exec ${exe}-${SLOT} --no-default-config --config="/etc/clang/cross/${CTARGET}.cfg" \${@}
+ EOF
+ done
+
+ local tools=(
+ ${CTARGET}-clang-${SLOT}:${CTARGET}-clang
+ ${CTARGET}-clang-cpp-${SLOT}:${CTARGET}-clang-cpp
+ ${CTARGET}-clang++-${SLOT}:${CTARGET}-clang++
+ )
+
+ local t
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${llvm_path}/bin/${t%:*}"
+ done
+}
diff --git a/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-18.ebuild b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-18.ebuild
new file mode 100644
index 000000000000..7604a7a58de0
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-18.ebuild
@@ -0,0 +1,44 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev
+
+DESCRIPTION="Symlinks to a Clang crosscompiler"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS=""
+PROPERTIES="live"
+
+RDEPEND="
+ sys-devel/clang:${SLOT}
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ local llvm_path="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ into "${llvm_path}"
+
+ for exe in "clang" "clang++" "clang-cpp"; do
+ newbin - "${CTARGET}-${exe}" <<-EOF
+ #!/bin/sh
+ exec ${exe}-${SLOT} --no-default-config --config="/etc/clang/cross/${CTARGET}.cfg" \${@}
+ EOF
+ done
+
+ local tools=(
+ ${CTARGET}-clang-${SLOT}:${CTARGET}-clang
+ ${CTARGET}-clang-cpp-${SLOT}:${CTARGET}-clang-cpp
+ ${CTARGET}-clang++-${SLOT}:${CTARGET}-clang++
+ )
+
+ local t
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${llvm_path}/bin/${t%:*}"
+ done
+}
diff --git a/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-19.ebuild b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-19.ebuild
new file mode 100644
index 000000000000..7604a7a58de0
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/clang-crossdev-wrappers-19.ebuild
@@ -0,0 +1,44 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit crossdev
+
+DESCRIPTION="Symlinks to a Clang crosscompiler"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS=""
+PROPERTIES="live"
+
+RDEPEND="
+ sys-devel/clang:${SLOT}
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ local llvm_path="${EPREFIX}/usr/lib/llvm/${SLOT}"
+ into "${llvm_path}"
+
+ for exe in "clang" "clang++" "clang-cpp"; do
+ newbin - "${CTARGET}-${exe}" <<-EOF
+ #!/bin/sh
+ exec ${exe}-${SLOT} --no-default-config --config="/etc/clang/cross/${CTARGET}.cfg" \${@}
+ EOF
+ done
+
+ local tools=(
+ ${CTARGET}-clang-${SLOT}:${CTARGET}-clang
+ ${CTARGET}-clang-cpp-${SLOT}:${CTARGET}-clang-cpp
+ ${CTARGET}-clang++-${SLOT}:${CTARGET}-clang++
+ )
+
+ local t
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${llvm_path}/bin/${t%:*}"
+ done
+}
diff --git a/sys-devel/clang-crossdev-wrappers/metadata.xml b/sys-devel/clang-crossdev-wrappers/metadata.xml
new file mode 100644
index 000000000000..83615f23a338
--- /dev/null
+++ b/sys-devel/clang-crossdev-wrappers/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM 'https://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>cat@catcream.org</email>
+ </maintainer>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-devel/clang-runtime/clang-runtime-12.0.1.ebuild b/sys-devel/clang-runtime/clang-runtime-12.0.1.ebuild
deleted file mode 100644
index 1b29ce1a433d..000000000000
--- a/sys-devel/clang-runtime/clang-runtime-12.0.1.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib-build
-
-DESCRIPTION="Meta-ebuild for clang runtime libraries"
-HOMEPAGE="https://clang.llvm.org/"
-SRC_URI=""
-
-LICENSE="metapackage"
-SLOT="$(ver_cut 1-3)"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE="+compiler-rt libcxx openmp +sanitize"
-REQUIRED_USE="sanitize? ( compiler-rt )"
-
-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}] )"
diff --git a/sys-devel/clang-runtime/clang-runtime-13.0.0.ebuild b/sys-devel/clang-runtime/clang-runtime-13.0.0.ebuild
deleted file mode 100644
index 1b29ce1a433d..000000000000
--- a/sys-devel/clang-runtime/clang-runtime-13.0.0.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib-build
-
-DESCRIPTION="Meta-ebuild for clang runtime libraries"
-HOMEPAGE="https://clang.llvm.org/"
-SRC_URI=""
-
-LICENSE="metapackage"
-SLOT="$(ver_cut 1-3)"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE="+compiler-rt libcxx openmp +sanitize"
-REQUIRED_USE="sanitize? ( compiler-rt )"
-
-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}] )"
diff --git a/sys-devel/clang-runtime/clang-runtime-13.0.1.9999.ebuild b/sys-devel/clang-runtime/clang-runtime-13.0.1.9999.ebuild
deleted file mode 100644
index 218cdb1426f6..000000000000
--- a/sys-devel/clang-runtime/clang-runtime-13.0.1.9999.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib-build
-
-DESCRIPTION="Meta-ebuild for clang runtime libraries"
-HOMEPAGE="https://clang.llvm.org/"
-SRC_URI=""
-
-LICENSE="metapackage"
-SLOT="$(ver_cut 1-3)"
-KEYWORDS=""
-IUSE="+compiler-rt libcxx openmp +sanitize"
-REQUIRED_USE="sanitize? ( compiler-rt )"
-PROPERTIES="live"
-
-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}] )"
diff --git a/sys-devel/clang-runtime/clang-runtime-13.0.1_rc1.ebuild b/sys-devel/clang-runtime/clang-runtime-13.0.1_rc1.ebuild
deleted file mode 100644
index 218cdb1426f6..000000000000
--- a/sys-devel/clang-runtime/clang-runtime-13.0.1_rc1.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib-build
-
-DESCRIPTION="Meta-ebuild for clang runtime libraries"
-HOMEPAGE="https://clang.llvm.org/"
-SRC_URI=""
-
-LICENSE="metapackage"
-SLOT="$(ver_cut 1-3)"
-KEYWORDS=""
-IUSE="+compiler-rt libcxx openmp +sanitize"
-REQUIRED_USE="sanitize? ( compiler-rt )"
-PROPERTIES="live"
-
-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}] )"
diff --git a/sys-devel/clang-runtime/clang-runtime-13.0.1_rc2.ebuild b/sys-devel/clang-runtime/clang-runtime-13.0.1_rc2.ebuild
deleted file mode 100644
index 23ad83f3671d..000000000000
--- a/sys-devel/clang-runtime/clang-runtime-13.0.1_rc2.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib-build
-
-DESCRIPTION="Meta-ebuild for clang runtime libraries"
-HOMEPAGE="https://clang.llvm.org/"
-SRC_URI=""
-
-LICENSE="metapackage"
-SLOT="$(ver_cut 1-3)"
-KEYWORDS=""
-IUSE="+compiler-rt libcxx openmp +sanitize"
-REQUIRED_USE="sanitize? ( compiler-rt )"
-PROPERTIES="live"
-
-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}] )"
diff --git a/sys-devel/clang-runtime/clang-runtime-14.0.0.9999.ebuild b/sys-devel/clang-runtime/clang-runtime-14.0.0.9999.ebuild
deleted file mode 100644
index 218cdb1426f6..000000000000
--- a/sys-devel/clang-runtime/clang-runtime-14.0.0.9999.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib-build
-
-DESCRIPTION="Meta-ebuild for clang runtime libraries"
-HOMEPAGE="https://clang.llvm.org/"
-SRC_URI=""
-
-LICENSE="metapackage"
-SLOT="$(ver_cut 1-3)"
-KEYWORDS=""
-IUSE="+compiler-rt libcxx openmp +sanitize"
-REQUIRED_USE="sanitize? ( compiler-rt )"
-PROPERTIES="live"
-
-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}] )"
diff --git a/sys-devel/clang-runtime/clang-runtime-11.1.0.ebuild b/sys-devel/clang-runtime/clang-runtime-15.0.7.ebuild
index c7b7ec0ae636..c4f7620e1212 100644
--- a/sys-devel/clang-runtime/clang-runtime-11.1.0.ebuild
+++ b/sys-devel/clang-runtime/clang-runtime-15.0.7.ebuild
@@ -1,24 +1,26 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit multilib-build
DESCRIPTION="Meta-ebuild for clang runtime libraries"
HOMEPAGE="https://clang.llvm.org/"
-SRC_URI=""
LICENSE="metapackage"
SLOT="$(ver_cut 1-3)"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux ~ppc-macos ~x64-macos"
+KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
IUSE="+compiler-rt libcxx openmp +sanitize"
REQUIRED_USE="sanitize? ( compiler-rt )"
RDEPEND="
compiler-rt? (
- ~sys-libs/compiler-rt-${PV}:${SLOT}
- sanitize? ( ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT} )
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
)
libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
- openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )"
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
diff --git a/sys-devel/clang-runtime/clang-runtime-16.0.6.ebuild b/sys-devel/clang-runtime/clang-runtime-16.0.6.ebuild
new file mode 100644
index 000000000000..25889f60d661
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-16.0.6.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-runtime/clang-runtime-17.0.6.ebuild b/sys-devel/clang-runtime/clang-runtime-17.0.6.ebuild
new file mode 100644
index 000000000000..25889f60d661
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-17.0.6.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-runtime/clang-runtime-18.1.3.ebuild b/sys-devel/clang-runtime/clang-runtime-18.1.3.ebuild
new file mode 100644
index 000000000000..38042f073a24
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-18.1.3.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-runtime/clang-runtime-18.1.4.ebuild b/sys-devel/clang-runtime/clang-runtime-18.1.4.ebuild
new file mode 100644
index 000000000000..38042f073a24
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-18.1.4.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-runtime/clang-runtime-19.0.0.9999.ebuild b/sys-devel/clang-runtime/clang-runtime-19.0.0.9999.ebuild
new file mode 100644
index 000000000000..323c0b62c062
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-19.0.0.9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240330.ebuild b/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240330.ebuild
new file mode 100644
index 000000000000..323c0b62c062
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240330.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240404.ebuild b/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240404.ebuild
new file mode 100644
index 000000000000..323c0b62c062
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240404.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240410.ebuild b/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240410.ebuild
new file mode 100644
index 000000000000..323c0b62c062
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-19.0.0_pre20240410.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-runtime/metadata.xml b/sys-devel/clang-runtime/metadata.xml
index 2180b1b16681..83929061543f 100644
--- a/sys-devel/clang-runtime/metadata.xml
+++ b/sys-devel/clang-runtime/metadata.xml
@@ -10,4 +10,7 @@
<flag name="openmp">Install <pkg>sys-libs/libomp</pkg> for -fopenmp support</flag>
<flag name="sanitize">Enable compiler-rt sanitizer (-fsanitize*) support</flag>
</use>
+ <upstream>
+ <remote-id type="github">llvm/llvm-project</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-15-r2.ebuild b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-15-r2.ebuild
new file mode 100644
index 000000000000..988214f580c9
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-15-r2.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use Clang on GCC-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x64-macos"
+IUSE="gcc-symlinks multilib-symlinks +native-symlinks"
+
+# Blocker for bug #872416
+RDEPEND="
+ !<sys-devel/gcc-config-2.6
+ sys-devel/clang:${SLOT}
+"
+
+src_install() {
+ local tools=()
+
+ if use native-symlinks; then
+ tools+=(
+ cc:clang
+ cpp:clang-cpp
+ c++:clang++
+ )
+ fi
+ if use gcc-symlinks; then
+ tools+=(
+ gcc:clang
+ g++:clang++
+ )
+ fi
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${t%:*}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${chost}-${t%:*}"
+ done
+ done
+}
diff --git a/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-16-r2.ebuild b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-16-r2.ebuild
new file mode 100644
index 000000000000..436e2673639f
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-16-r2.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use Clang on GCC-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~x64-macos"
+IUSE="gcc-symlinks multilib-symlinks +native-symlinks"
+
+# Blocker for bug #872416
+RDEPEND="
+ !<sys-devel/gcc-config-2.6
+ sys-devel/clang:${SLOT}
+"
+
+src_install() {
+ local tools=()
+
+ if use native-symlinks; then
+ tools+=(
+ cc:clang
+ cpp:clang-cpp
+ c++:clang++
+ )
+ fi
+ if use gcc-symlinks; then
+ tools+=(
+ gcc:clang
+ g++:clang++
+ )
+ fi
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${t%:*}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${chost}-${t%:*}"
+ done
+ done
+}
diff --git a/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-17.ebuild b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-17.ebuild
new file mode 100644
index 000000000000..436e2673639f
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-17.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use Clang on GCC-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~x64-macos"
+IUSE="gcc-symlinks multilib-symlinks +native-symlinks"
+
+# Blocker for bug #872416
+RDEPEND="
+ !<sys-devel/gcc-config-2.6
+ sys-devel/clang:${SLOT}
+"
+
+src_install() {
+ local tools=()
+
+ if use native-symlinks; then
+ tools+=(
+ cc:clang
+ cpp:clang-cpp
+ c++:clang++
+ )
+ fi
+ if use gcc-symlinks; then
+ tools+=(
+ gcc:clang
+ g++:clang++
+ )
+ fi
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${t%:*}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${chost}-${t%:*}"
+ done
+ done
+}
diff --git a/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-18.ebuild b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-18.ebuild
new file mode 100644
index 000000000000..5cfe92aa27da
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-18.ebuild
@@ -0,0 +1,59 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use Clang on GCC-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~x64-macos"
+IUSE="gcc-symlinks multilib-symlinks +native-symlinks"
+
+# Blocker for bug #872416
+RDEPEND="
+ !<sys-devel/gcc-config-2.6
+ sys-devel/clang:${SLOT}
+"
+
+src_install() {
+ local tools=()
+
+ if use native-symlinks; then
+ tools+=(
+ cc:clang
+ cpp:clang-cpp
+ c++:clang++
+ )
+ fi
+ if use gcc-symlinks; then
+ tools+=(
+ gcc:clang
+ g++:clang++
+ )
+ fi
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${t%:*}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${chost}-${t%:*}"
+ done
+ done
+}
diff --git a/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-19.ebuild b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-19.ebuild
new file mode 100644
index 000000000000..3496a0f89b67
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-19.ebuild
@@ -0,0 +1,58 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use Clang on GCC-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+IUSE="gcc-symlinks multilib-symlinks +native-symlinks"
+
+# Blocker for bug #872416
+RDEPEND="
+ !<sys-devel/gcc-config-2.6
+ sys-devel/clang:${SLOT}
+"
+
+src_install() {
+ local tools=()
+
+ if use native-symlinks; then
+ tools+=(
+ cc:clang
+ cpp:clang-cpp
+ c++:clang++
+ )
+ fi
+ if use gcc-symlinks; then
+ tools+=(
+ gcc:clang
+ g++:clang++
+ )
+ fi
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${t%:*}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${chost}-${t%:*}"
+ done
+ done
+}
diff --git a/sys-devel/clang-toolchain-symlinks/metadata.xml b/sys-devel/clang-toolchain-symlinks/metadata.xml
new file mode 100644
index 000000000000..bf4e9fc6a6ca
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="gcc-symlinks">
+ Install symlinks for 'gcc' and 'g++' for extra
+ compatibility.
+ </flag>
+ <flag name="multilib-symlinks">
+ Install symlinks for all ABI CHOSTs. Note that this can
+ result in gcc being overrode for native builds, as well
+ as conflict with crossdev if used for the same targets.
+ </flag>
+ <flag name="native-symlinks">
+ Install generic tool symlinks like 'cc' and 'c++',
+ as well as ${CTARGET}-*. These symlinks are installed
+ into slotted LLVM bindir, so they should not take precedence
+ over symlinks installed into /usr/bin
+ by <pkg>sys-devel/gcc-config</pkg> but they can be helpful
+ for GCC-free setups.
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest
index 501c66762de9..b1023c6a84da 100644
--- a/sys-devel/clang/Manifest
+++ b/sys-devel/clang/Manifest
@@ -1,14 +1,20 @@
-DIST llvm-11.1.0-manpages.tar.bz2 191571 BLAKE2B d6f8e1390dd3e6e8bbcd66c0079ef89f2ff3479743499c36ab32f8bc8281631a96113df9a87f6284058365950f4df3c75dacfcc11920fc5ea7ef0233ba842b77 SHA512 2543e519f51cc7ecb51a732c658ec5d35c5225e30a677f24ead75e81fb1ab793a030e79f21d0b702a2cf6ab6da1a2cba839b49a98e1b0a36384e98076ed5c4b1
-DIST llvm-12.0.1-manpages.tar.bz2 191582 BLAKE2B a049cd305c257875d47e92d703c51aee8225854f999eddbd530c7a978704a981b05bc0819ba31a2f2a218d3569b078f0deb01b0eeb385966253b54a0fdc090d1 SHA512 9931a57f843709aed59193524fe980af695e4e23c8f53ec3cff308677ba4fc520ca58032b50b68440c7762305855317d9a705fe5ccbb543fb104f4deb5d10ea5
-DIST llvm-13.0.0-manpages.tar.bz2 202595 BLAKE2B 1a3a389e8c544675f7ba2692f92bb82a83beabd6c595211806ef7f473e1741ea633a773edf623011d3d011ef2ee7a1611fc9620fe921eeebe1b99c3b8b3a0652 SHA512 344139f3123169776e0fd603e605bbf537d15d80ff56ad60e66ed1639a9dec53a8ac5cd088c8e14c8b7a799b563268445562293ba1d4efeb8db438cbd9cb5fb0
-DIST llvm-gentoo-patchset-11.1.0-1.tar.xz 4032 BLAKE2B e69138a422e315b31a3d9c11faa4ae1ddf1bf9092cee2db0de4d2adef81fd802973488293aab48b764402b51996893b17ca03249ef4620848a576d1f6cdb9698 SHA512 e1c5504dab6c5db9fdf4addfeb12316f22d0258717ba551a9b7b3ba37919491fb6011ac5cca1e793b7509d5c1c186bc6bc4213f7d6155d190612492b216f979b
-DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841ac5bcaeb927538cc7de27683167111a17d6496677c7517de2ecfaf14b5d8ac22bad357be490b8a2ed9aba502fd5f447ecc99e9 SHA512 fc7c38e671555751650299c3a8bee44d5c7f26e11b68d5538c507fb7fe9ff2d349bdcd43bce90a448a747f082d523b3849d6bcda5e3ae2e998edcb926d6aa249
-DIST llvm-gentoo-patchset-13.0.0.tar.xz 5012 BLAKE2B 6760c78c086aaf6629143fd920b0a2c68cad9278628fbea8164dfeb59db95984a5b5d6b3505b510c697e8c95bf8d2be782c6b73c01622d52f2da9b07ecff39e0 SHA512 7764d49343b795b6bebae64f646ba27e3e6cc2a20b8a1aee645ce0d8474633c34acfbb73c08546fee415755dd4ea5a98c1d84db5e394cf5f4fc802eb61148ab6
-DIST llvm-gentoo-patchset-13.0.1-rc1-r1.tar.xz 6332 BLAKE2B 2586125a75d46e14c897f99dec5cf3dbb431684abbad4678d2ccd17411c3934247034b85cf3b397569fcabc366f97afd19773cd199b6e48eb5e7fc61a7d0ea26 SHA512 acff9e94ea4e02cc16135797e821388c5159a73ee4be2bc437789f39bcd2cb8f31f4bc42fb561e26db548948304e743ea0fe8016f36689571ad70cc7065b0c34
-DIST llvm-gentoo-patchset-13.0.1-rc2.tar.xz 5192 BLAKE2B 4a129a3d0b7c1839d79c814ea57602f5e87aadb9050fc8e91868d2c3773ff7ae8e2137f785deeded6925a4368220767526c95790c9883f2031edc3ebae25b13c SHA512 2f384281d06f5378f7d1b2f036958c7db00d1c4d799406fd188fa8388f0cf18279dae36f2fb37bff26daa91419ab1bc1c2390be0f3af42359f1aef8de81b6ac8
-DIST llvm-gentoo-patchset-9999-2.tar.xz 4064 BLAKE2B 4b29234f10ea4ab2609e83c71bcd5f968cd93abd275c13366146ca899bbc576d55a3364432cc7db353739f5da5762529436689b848857e839e230425d551265b SHA512 c0d40a81bd11dc6018d7b3789e4ca7e1cd784992d44fab8d750b8b5281db39ad9092d320d125cae93164d2dddc42177a173b6d5e4158e4b62d7507db877acb9e
-DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
-DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
-DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
-DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
-DIST llvmorg-13.0.1-rc2.tar.gz 147304491 BLAKE2B 86b2c64e57e4aaab837229b25a95d5517ac077d22cf552d71ff6b996dbdbcd171ad51de7eb12d098b50a139beda4ace843727181a1c6978fc487215391e64a3a SHA512 0d890f3317504c8cef10e118b245e5a4c815cc19f07cbc511a66bde6c9b1f3d15c167942608a8987befe9115b24657d29f72305f9f2794385a7434b80167f40f
+DIST llvm-15.0.7-manpages.tar.bz2 228425 BLAKE2B 573b030a32407cfe241fb2c8c62bed8e7c54f9daf4b8cffdd2d4e5ca2e40b5ec5ed3724475aedf77119be1a4d9de847a989e933d315e6d94908e407a19c98047 SHA512 86d5eeea2757b0a627c8d2d6e70a3265fc0207085f4e473cdd6e8b624c719625dead23fd1737742a1bea27b1c4631ef3e8e3041a1122a85fcb49859e5bfbee49
+DIST llvm-16.0.4-manpages.tar.bz2 243154 BLAKE2B 69308e3ec19d750e7249b7c8cd79224c466b879c67dd900e201339486fa7fa4dd6ef9ef5b033b2443b32c3530cc76564fe2856a76f9b466fdab2b5c64148f089 SHA512 2d2b711adbd20a233d0611f81393faa29a2f32f0e64799a9a48185876045023ca1320becd2da110fbcbfce019a38df0d7c13fcaea3770b4fc23aa732eb11321b
+DIST llvm-17.0.1-manpages.tar.bz2 263148 BLAKE2B 6485a261e356eacc4a274f9b8d329b53f11a37a23effea41a12322f6908bbe702dc1a97bfd10293061f01f1dbff8693e9324ab3dce2551e78eab128dbd7fea30 SHA512 963ff1b7aa0cb01ed0c0356a0adc3a315d94e78035e928dc81464f553e722633a17596e421c248968e87e22ae66f1ab9cccda5fd3388d1a6d34b5e9c6140ebcb
+DIST llvm-18.1.0-manpages.tar.bz2 270429 BLAKE2B d85d6e23197184dc512019c25805af0aa145eefb4c36215807c1ba70ad47943c05c06dbaafd84a7e6487bdd83814e03277374e095d97b129e3fc8d468c10741c SHA512 5f492c85fad4e04e0148ea509f4b6520de9e2765c51e617363a11aa8e47c2d847f6b0897958ca1d93bccf0f6a9150868b7e04c728bd430c05bf2da30bdeba6cc
+DIST llvm-gentoo-patchset-15.0.7-r3.tar.xz 24268 BLAKE2B 6531ae385ecea87bc26dba8ce19b4cde8ff224c80fd81f04c6ded131e305ecfdeb8d29ebd3b68a641d240805dc83eb0ebc7cc85124f02ad0ee66e0f201b91d7e SHA512 66cb33f8b423736b990fb75d4f2d1e5f14c0b03308f403297204dd1a352d72f85f34220fd66d3de5d6df328cdf2ffce03c2a111cb0bb57791cf68a88069ac7df
+DIST llvm-gentoo-patchset-16.0.6.tar.xz 17340 BLAKE2B 37cdf4b38367b4256d4f7a25d1b4f41758e5f81be8e20a1c94a10d6c5e36642e9672121b455e73a0bac2eb40467ef2db4b43789b2912a6790593d97b8b5c27e3 SHA512 2c02b9d8a4c5af9fddcd26c95dc66fffae32cb5b7f85c65a1aa4ed00dd8cd5b01cc1975a711aee63c0b8b11e9dc20f2bc05ea753904eb516892b820f02aff825
+DIST llvm-gentoo-patchset-17.0.6-r1.tar.xz 2792 BLAKE2B b4e9014179edd96add0c932b16d3a95a5d7a905298052164ff668590108c83cd4f938d42b6d801efedae28a959b03b2bc3c7cd2a4cad20ef2b3c7aa9a3d0c15d SHA512 73a46aa9f6f2ac6334a073733aa082a12f97fb6a2750d5930af4eb1639cd192f3a17ea87c2f17947f04c68a5f60e37d9bc27ede8bab75531599edfb4c3aa8ffe
+DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948
+DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
+DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
+DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7
+DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
+DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
+DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
+DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
+DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
+DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
+DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
diff --git a/sys-devel/clang/clang-11.1.0.ebuild b/sys-devel/clang/clang-11.1.0.ebuild
deleted file mode 100644
index 70f90cdc03ee..000000000000
--- a/sys-devel/clang/clang-11.1.0.ebuild
+++ /dev/null
@@ -1,428 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} )
-inherit cmake llvm llvm.org multilib multilib-minimal \
- prefix python-single-r1 toolchain-funcs
-
-DESCRIPTION="C language family frontend for LLVM"
-HOMEPAGE="https://llvm.org/"
-
-# Keep in sync with sys-devel/llvm
-ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC VE )
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
- NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore
- "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}" )
-ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
-
-# MSVCSetupApi.h: MIT
-# sorttable.js: MIT
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
-SLOT="$(ver_cut 1)/$(ver_cut 1-2)"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux ~x64-macos"
-IUSE="debug default-compiler-rt default-libcxx default-lld
- doc +static-analyzer test xml ${ALL_LLVM_TARGETS[*]}"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}
- || ( ${ALL_LLVM_TARGETS[*]} )"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT%/*}=[debug=,${MULTILIB_USEDEP}]
- static-analyzer? ( dev-lang/perl:* )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
-for x in "${ALL_LLVM_TARGETS[@]}"; do
- RDEPEND+="
- ${x}? ( ~sys-devel/llvm-${PV}:${SLOT%/*}[${x}] )"
-done
-unset x
-
-DEPEND="${RDEPEND}"
-BDEPEND="
- >=dev-util/cmake-3.16
- doc? ( dev-python/sphinx )
- xml? ( virtual/pkgconfig )
- ${PYTHON_DEPS}"
-PDEPEND="
- sys-devel/clang-common
- ~sys-devel/clang-runtime-${PV}
- default-compiler-rt? ( =sys-libs/compiler-rt-${PV%_*}* )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )
- default-lld? ( sys-devel/lld )"
-
-LLVM_COMPONENTS=( clang clang-tools-extra )
-LLVM_MANPAGES=pregenerated
-LLVM_TEST_COMPONENTS=(
- llvm/lib/Testing/Support
- llvm/utils/{lit,llvm-lit,unittest}
- llvm/utils/{UpdateTestChecks,update_cc_test_checks.py}
-)
-LLVM_PATCHSET=11.1.0-1
-llvm.org_set_globals
-
-# 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_prepare() {
- # create extra parent dir for relative CLANG_RESOURCE_DIR access
- mkdir -p x/y || die
- BUILD_DIR=${WORKDIR}/x/y/clang
-
- llvm.org_src_prepare
-
- mv ../clang-tools-extra tools/extra || die
-
- # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
- eprefixify \
- lib/Frontend/InitHeaderSearch.cpp \
- lib/Driver/ToolChains/Darwin.cpp || die
-}
-
-check_distribution_components() {
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
- local all_targets=() my_targets=() l
- cd "${BUILD_DIR}" || die
-
- while read -r l; do
- if [[ ${l} == install-*-stripped:* ]]; then
- l=${l#install-}
- l=${l%%-stripped*}
-
- case ${l} in
- # meta-targets
- clang-libraries|distribution)
- continue
- ;;
- # headers for clang-tidy static library
- clang-tidy-headers)
- continue
- ;;
- # tools
- clang|clangd|clang-*)
- ;;
- # static libraries
- clang*|findAllSymbols)
- continue
- ;;
- # conditional to USE=doc
- docs-clang-html|docs-clang-tools-html)
- use doc || continue
- ;;
- esac
-
- all_targets+=( "${l}" )
- fi
- done < <(ninja -t targets all)
-
- while read -r l; do
- my_targets+=( "${l}" )
- done < <(get_distribution_components $"\n")
-
- local add=() remove=()
- for l in "${all_targets[@]}"; do
- if ! has "${l}" "${my_targets[@]}"; then
- add+=( "${l}" )
- fi
- done
- for l in "${my_targets[@]}"; do
- if ! has "${l}" "${all_targets[@]}"; then
- remove+=( "${l}" )
- fi
- done
-
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
- eqawarn "get_distribution_components() is outdated!"
- eqawarn " Add: ${add[*]}"
- eqawarn "Remove: ${remove[*]}"
- fi
- cd - >/dev/null || die
- fi
-}
-
-get_distribution_components() {
- local sep=${1-;}
-
- local out=(
- # common stuff
- clang-cmake-exports
- clang-headers
- clang-resource-headers
- libclang-headers
-
- # libs
- clang-cpp
- libclang
- )
-
- if multilib_is_native_abi; then
- out+=(
- # common stuff
- bash-autocomplete
- libclang-python-bindings
-
- # tools
- c-index-test
- clang
- clang-format
- clang-offload-bundler
- clang-offload-wrapper
- clang-refactor
- clang-rename
- clang-scan-deps
- diagtool
- hmaptool
-
- # extra tools
- clang-apply-replacements
- clang-change-namespace
- clang-doc
- clang-include-fixer
- clang-move
- clang-query
- clang-reorder-fields
- clang-tidy
- clangd
- find-all-symbols
- modularize
- pp-trace
- )
-
- if llvm_are_manpages_built; then
- out+=(
- # manpages
- docs-clang-man
- docs-clang-tools-man
- )
- fi
-
- use doc && out+=(
- docs-clang-html
- docs-clang-tools-html
- )
-
- use static-analyzer && out+=(
- clang-check
- clang-extdef-mapping
- scan-build
- scan-view
- )
- fi
-
- printf "%s${sep}" "${out[@]}"
-}
-
-multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
-
- local mycmakeargs=(
- -DLLVM_CMAKE_PATH="${EPREFIX}/usr/lib/llvm/${SLOT%/*}/$(get_libdir)/cmake/llvm"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT%/*}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT%/*}/share/man"
- # relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
-
- -DBUILD_SHARED_LIBS=OFF
- -DCLANG_LINK_CLANG_DYLIB=ON
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
-
- -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_DEFAULT_LINKER=$(usex default-lld lld "")
-
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
-
- -DPython3_EXECUTABLE="${PYTHON}"
- )
- use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- )
-
- if multilib_is_native_abi; then
- local build_docs=OFF
- if llvm_are_manpages_built; then
- build_docs=ON
- 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
- )
- fi
-
- mycmakeargs+=(
- # normally copied from LLVM_INCLUDE_DOCS but the latter
- # is lacking value in stand-alone builds
- -DCLANG_INCLUDE_DOCS=${build_docs}
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
- )
- else
- mycmakeargs+=(
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
- )
- fi
-
- if [[ -n ${EPREFIX} ]]; then
- mycmakeargs+=(
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
- )
- 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 can have very high memory consumption while linking,
- # exhausting the limit on 32-bit linker executable
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake_src_configure
-
- multilib_is_native_abi && check_distribution_components
-}
-
-multilib_src_compile() {
- cmake_build distribution
-
- # 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_build check-clang
- multilib_is_native_abi &&
- cmake_build check-clang-tools check-clangd
-}
-
-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 "${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
- # - clang -> clang-X
- # - clang++, clang-cl, clang-cpp -> clang
- # we want to have:
- # - clang-X
- # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X
- # 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
-}
-
-multilib_src_install() {
- DESTDIR=${D} cmake_build install-distribution
-
- # 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"
- llvm_install_manpages
- # 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 [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow update all
- fi
-
- elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT%/*}/share/clang"
- elog "Some of them are vim integration scripts (with instructions inside)."
- elog "The run-clang-tidy.py script requires the following additional package:"
- elog " dev-python/pyyaml"
-}
-
-pkg_postrm() {
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow clean all
- fi
-}
diff --git a/sys-devel/clang/clang-12.0.1.ebuild b/sys-devel/clang/clang-12.0.1.ebuild
deleted file mode 100644
index e4b38d294772..000000000000
--- a/sys-devel/clang/clang-12.0.1.ebuild
+++ /dev/null
@@ -1,432 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm llvm.org multilib multilib-minimal \
- prefix python-single-r1 toolchain-funcs
-
-DESCRIPTION="C language family frontend for LLVM"
-HOMEPAGE="https://llvm.org/"
-
-# Keep in sync with sys-devel/llvm
-ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY VE )
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
- NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore
- "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}" )
-ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
-
-# MSVCSetupApi.h: MIT
-# sorttable.js: MIT
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
-SLOT="$(ver_cut 1)"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x64-macos"
-IUSE="debug default-compiler-rt default-libcxx default-lld
- doc llvm-libunwind +static-analyzer test xml ${ALL_LLVM_TARGETS[*]}"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}
- || ( ${ALL_LLVM_TARGETS[*]} )"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${MULTILIB_USEDEP}]
- static-analyzer? ( dev-lang/perl:* )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
-for x in "${ALL_LLVM_TARGETS[@]}"; do
- RDEPEND+="
- ${x}? ( ~sys-devel/llvm-${PV}:${SLOT}[${x}] )"
-done
-unset x
-
-DEPEND="${RDEPEND}"
-BDEPEND="
- >=dev-util/cmake-3.16
- doc? ( dev-python/sphinx )
- xml? ( virtual/pkgconfig )
- ${PYTHON_DEPS}"
-PDEPEND="
- sys-devel/clang-common
- ~sys-devel/clang-runtime-${PV}
- default-compiler-rt? (
- =sys-libs/compiler-rt-${PV%_*}*
- llvm-libunwind? ( sys-libs/llvm-libunwind )
- !llvm-libunwind? ( sys-libs/libunwind )
- )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )
- default-lld? ( sys-devel/lld )"
-
-LLVM_COMPONENTS=( clang clang-tools-extra )
-LLVM_MANPAGES=pregenerated
-LLVM_TEST_COMPONENTS=(
- llvm/lib/Testing/Support
- llvm/utils/{lit,llvm-lit,unittest}
- llvm/utils/{UpdateTestChecks,update_cc_test_checks.py}
-)
-LLVM_PATCHSET=12.0.1
-llvm.org_set_globals
-
-# 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_prepare() {
- # create extra parent dir for relative CLANG_RESOURCE_DIR access
- mkdir -p x/y || die
- BUILD_DIR=${WORKDIR}/x/y/clang
-
- llvm.org_src_prepare
-
- # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
- eprefixify \
- lib/Frontend/InitHeaderSearch.cpp \
- lib/Driver/ToolChains/Darwin.cpp || die
-}
-
-check_distribution_components() {
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
- local all_targets=() my_targets=() l
- cd "${BUILD_DIR}" || die
-
- while read -r l; do
- if [[ ${l} == install-*-stripped:* ]]; then
- l=${l#install-}
- l=${l%%-stripped*}
-
- case ${l} in
- # meta-targets
- clang-libraries|distribution)
- continue
- ;;
- # headers for clang-tidy static library
- clang-tidy-headers)
- continue
- ;;
- # tools
- clang|clangd|clang-*)
- ;;
- # static libraries
- clang*|findAllSymbols)
- continue
- ;;
- # conditional to USE=doc
- docs-clang-html|docs-clang-tools-html)
- use doc || continue
- ;;
- esac
-
- all_targets+=( "${l}" )
- fi
- done < <(ninja -t targets all)
-
- while read -r l; do
- my_targets+=( "${l}" )
- done < <(get_distribution_components $"\n")
-
- local add=() remove=()
- for l in "${all_targets[@]}"; do
- if ! has "${l}" "${my_targets[@]}"; then
- add+=( "${l}" )
- fi
- done
- for l in "${my_targets[@]}"; do
- if ! has "${l}" "${all_targets[@]}"; then
- remove+=( "${l}" )
- fi
- done
-
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
- eqawarn "get_distribution_components() is outdated!"
- eqawarn " Add: ${add[*]}"
- eqawarn "Remove: ${remove[*]}"
- fi
- cd - >/dev/null || die
- fi
-}
-
-get_distribution_components() {
- local sep=${1-;}
-
- local out=(
- # common stuff
- clang-cmake-exports
- clang-headers
- clang-resource-headers
- libclang-headers
-
- # libs
- clang-cpp
- libclang
- )
-
- if multilib_is_native_abi; then
- out+=(
- # common stuff
- bash-autocomplete
- libclang-python-bindings
-
- # tools
- c-index-test
- clang
- clang-format
- clang-offload-bundler
- clang-offload-wrapper
- clang-refactor
- clang-rename
- clang-scan-deps
- diagtool
- hmaptool
-
- # extra tools
- clang-apply-replacements
- clang-change-namespace
- clang-doc
- clang-include-fixer
- clang-move
- clang-query
- clang-reorder-fields
- clang-tidy
- clangd
- find-all-symbols
- modularize
- pp-trace
- )
-
- if llvm_are_manpages_built; then
- out+=(
- # manpages
- docs-clang-man
- docs-clang-tools-man
- )
- fi
-
- use doc && out+=(
- docs-clang-html
- docs-clang-tools-html
- )
-
- use static-analyzer && out+=(
- clang-check
- clang-extdef-mapping
- scan-build
- scan-view
- )
- fi
-
- printf "%s${sep}" "${out[@]}"
-}
-
-multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
-
- local mycmakeargs=(
- -DLLVM_CMAKE_PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)/cmake/llvm"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- # relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
-
- -DBUILD_SHARED_LIBS=OFF
- -DCLANG_LINK_CLANG_DYLIB=ON
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
-
- -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
-
- # disable using CUDA to autodetect GPU, just build for all
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
-
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
- -DCLANG_DEFAULT_LINKER=$(usex default-lld lld "")
- -DCLANG_DEFAULT_UNWINDLIB=$(usex default-compiler-rt libunwind "")
-
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
-
- -DPython3_EXECUTABLE="${PYTHON}"
- )
- use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- )
-
- if multilib_is_native_abi; then
- local build_docs=OFF
- if llvm_are_manpages_built; then
- build_docs=ON
- 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
- )
- fi
- mycmakeargs+=(
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
- -DCLANG_INCLUDE_DOCS=${build_docs}
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
- )
- else
- mycmakeargs+=(
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
- )
- fi
-
- if [[ -n ${EPREFIX} ]]; then
- mycmakeargs+=(
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
- )
- 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 can have very high memory consumption while linking,
- # exhausting the limit on 32-bit linker executable
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake_src_configure
-
- multilib_is_native_abi && check_distribution_components
-}
-
-multilib_src_compile() {
- cmake_build distribution
-
- # 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_build check-clang
- multilib_is_native_abi &&
- cmake_build check-clang-tools check-clangd
-}
-
-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 "${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
- # - clang -> clang-X
- # - clang++, clang-cl, clang-cpp -> clang
- # we want to have:
- # - clang-X
- # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X
- # 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
-}
-
-multilib_src_install() {
- DESTDIR=${D} cmake_build install-distribution
-
- # 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"
- llvm_install_manpages
- # 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 [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow update all
- fi
-
- elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "Some of them are vim integration scripts (with instructions inside)."
- elog "The run-clang-tidy.py script requires the following additional package:"
- elog " dev-python/pyyaml"
-}
-
-pkg_postrm() {
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow clean all
- fi
-}
diff --git a/sys-devel/clang/clang-13.0.0.ebuild b/sys-devel/clang/clang-13.0.0.ebuild
deleted file mode 100644
index 5aeac025e36c..000000000000
--- a/sys-devel/clang/clang-13.0.0.ebuild
+++ /dev/null
@@ -1,421 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm llvm.org multilib multilib-minimal \
- prefix python-single-r1 toolchain-funcs
-
-DESCRIPTION="C language family frontend for LLVM"
-HOMEPAGE="https://llvm.org/"
-
-# MSVCSetupApi.h: MIT
-# sorttable.js: MIT
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
-SLOT="$(ver_cut 1)"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x64-macos"
-IUSE="debug default-compiler-rt default-libcxx default-lld
- doc llvm-libunwind +static-analyzer test xml"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${MULTILIB_USEDEP}]
- static-analyzer? ( dev-lang/perl:* )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
-
-DEPEND="${RDEPEND}"
-BDEPEND="
- >=dev-util/cmake-3.16
- doc? ( dev-python/sphinx )
- xml? ( virtual/pkgconfig )
- ${PYTHON_DEPS}"
-PDEPEND="
- sys-devel/clang-common
- ~sys-devel/clang-runtime-${PV}
- default-compiler-rt? (
- =sys-libs/compiler-rt-${PV%_*}*
- llvm-libunwind? ( sys-libs/llvm-libunwind )
- !llvm-libunwind? ( sys-libs/libunwind )
- )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )
- default-lld? ( sys-devel/lld )"
-
-LLVM_COMPONENTS=( clang clang-tools-extra )
-LLVM_MANPAGES=pregenerated
-LLVM_TEST_COMPONENTS=(
- llvm/lib/Testing/Support
- llvm/utils/{lit,llvm-lit,unittest}
- llvm/utils/{UpdateTestChecks,update_cc_test_checks.py}
-)
-LLVM_PATCHSET=${PV/_/-}
-LLVM_USE_TARGETS=llvm
-llvm.org_set_globals
-
-# 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_prepare() {
- # create extra parent dir for relative CLANG_RESOURCE_DIR access
- mkdir -p x/y || die
- BUILD_DIR=${WORKDIR}/x/y/clang
-
- llvm.org_src_prepare
-
- # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
- eprefixify \
- lib/Frontend/InitHeaderSearch.cpp \
- lib/Driver/ToolChains/Darwin.cpp || die
-}
-
-check_distribution_components() {
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
- local all_targets=() my_targets=() l
- cd "${BUILD_DIR}" || die
-
- while read -r l; do
- if [[ ${l} == install-*-stripped:* ]]; then
- l=${l#install-}
- l=${l%%-stripped*}
-
- case ${l} in
- # meta-targets
- clang-libraries|distribution)
- continue
- ;;
- # headers for clang-tidy static library
- clang-tidy-headers)
- continue
- ;;
- # tools
- clang|clangd|clang-*)
- ;;
- # static libraries
- clang*|findAllSymbols)
- continue
- ;;
- # conditional to USE=doc
- docs-clang-html|docs-clang-tools-html)
- use doc || continue
- ;;
- esac
-
- all_targets+=( "${l}" )
- fi
- done < <(ninja -t targets all)
-
- while read -r l; do
- my_targets+=( "${l}" )
- done < <(get_distribution_components $"\n")
-
- local add=() remove=()
- for l in "${all_targets[@]}"; do
- if ! has "${l}" "${my_targets[@]}"; then
- add+=( "${l}" )
- fi
- done
- for l in "${my_targets[@]}"; do
- if ! has "${l}" "${all_targets[@]}"; then
- remove+=( "${l}" )
- fi
- done
-
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
- eqawarn "get_distribution_components() is outdated!"
- eqawarn " Add: ${add[*]}"
- eqawarn "Remove: ${remove[*]}"
- fi
- cd - >/dev/null || die
- fi
-}
-
-get_distribution_components() {
- local sep=${1-;}
-
- local out=(
- # common stuff
- clang-cmake-exports
- clang-headers
- clang-resource-headers
- libclang-headers
-
- # libs
- clang-cpp
- libclang
- )
-
- if multilib_is_native_abi; then
- out+=(
- # common stuff
- bash-autocomplete
- libclang-python-bindings
-
- # tools
- c-index-test
- clang
- clang-format
- clang-offload-bundler
- clang-offload-wrapper
- clang-refactor
- clang-rename
- clang-scan-deps
- diagtool
- hmaptool
-
- # extra tools
- clang-apply-replacements
- clang-change-namespace
- clang-doc
- clang-include-fixer
- clang-move
- clang-query
- clang-reorder-fields
- clang-tidy
- clangd
- find-all-symbols
- modularize
- pp-trace
- )
-
- if llvm_are_manpages_built; then
- out+=(
- # manpages
- docs-clang-man
- docs-clang-tools-man
- )
- fi
-
- use doc && out+=(
- docs-clang-html
- docs-clang-tools-html
- )
-
- use static-analyzer && out+=(
- clang-check
- clang-extdef-mapping
- scan-build
- scan-build-py
- scan-view
- )
- fi
-
- printf "%s${sep}" "${out[@]}"
-}
-
-multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
-
- local mycmakeargs=(
- -DLLVM_CMAKE_PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)/cmake/llvm"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- # relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
-
- -DBUILD_SHARED_LIBS=OFF
- -DCLANG_LINK_CLANG_DYLIB=ON
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
-
- -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
-
- # disable using CUDA to autodetect GPU, just build for all
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
-
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
- -DCLANG_DEFAULT_LINKER=$(usex default-lld lld "")
- -DCLANG_DEFAULT_UNWINDLIB=$(usex default-compiler-rt libunwind "")
-
- -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
- -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
-
- -DPython3_EXECUTABLE="${PYTHON}"
- )
- use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- )
-
- if multilib_is_native_abi; then
- local build_docs=OFF
- if llvm_are_manpages_built; then
- build_docs=ON
- 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
- )
- fi
- mycmakeargs+=(
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
- -DCLANG_INCLUDE_DOCS=${build_docs}
- -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
- )
- else
- mycmakeargs+=(
- -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
- )
- fi
-
- if [[ -n ${EPREFIX} ]]; then
- mycmakeargs+=(
- -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
- )
- 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 can have very high memory consumption while linking,
- # exhausting the limit on 32-bit linker executable
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake_src_configure
-
- multilib_is_native_abi && check_distribution_components
-}
-
-multilib_src_compile() {
- cmake_build distribution
-
- # 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_build check-clang
- multilib_is_native_abi &&
- cmake_build check-clang-tools check-clangd
-}
-
-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 "${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
- # - clang -> clang-X
- # - clang++, clang-cl, clang-cpp -> clang
- # we want to have:
- # - clang-X
- # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
- # - clang, clang++, clang-cl, clang-cpp -> clang*-X
- # 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
-}
-
-multilib_src_install() {
- DESTDIR=${D} cmake_build install-distribution
-
- # 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"
- llvm_install_manpages
- # 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 [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow update all
- fi
-
- elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "Some of them are vim integration scripts (with instructions inside)."
- elog "The run-clang-tidy.py script requires the following additional package:"
- elog " dev-python/pyyaml"
-}
-
-pkg_postrm() {
- if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow clean all
- fi
-}
diff --git a/sys-devel/clang/clang-14.0.0.9999.ebuild b/sys-devel/clang/clang-15.0.7-r3.ebuild
index 1de9a1a3a542..131afb227f0e 100644
--- a/sys-devel/clang/clang-14.0.0.9999.ebuild
+++ b/sys-devel/clang/clang-15.0.7-r3.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{10..11} )
inherit cmake llvm llvm.org multilib multilib-minimal \
prefix python-single-r1 toolchain-funcs
@@ -14,44 +14,47 @@ HOMEPAGE="https://llvm.org/"
# sorttable.js: MIT
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
-SLOT="$(ver_cut 1)"
-KEYWORDS=""
-IUSE="debug default-compiler-rt default-libcxx default-lld
- doc llvm-libunwind +static-analyzer test xml"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}g1"
+KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~x64-macos"
+IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="!test? ( test )"
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${MULTILIB_USEDEP}]
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
static-analyzer? ( dev-lang/perl:* )
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
+"
-DEPEND="${RDEPEND}"
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
BDEPEND="
- >=dev-util/cmake-3.16
- doc? ( dev-python/sphinx )
+ ${PYTHON_DEPS}
+ doc? ( $(python_gen_cond_dep '
+ dev-python/recommonmark[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ') )
xml? ( virtual/pkgconfig )
- ${PYTHON_DEPS}"
+"
PDEPEND="
- sys-devel/clang-common
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
~sys-devel/clang-runtime-${PV}
- default-compiler-rt? (
- =sys-libs/compiler-rt-${PV%_*}*
- llvm-libunwind? ( sys-libs/llvm-libunwind )
- !llvm-libunwind? ( sys-libs/libunwind )
- )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )
- default-lld? ( sys-devel/lld )"
+"
-LLVM_COMPONENTS=( clang clang-tools-extra )
-LLVM_MANPAGES=build
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
LLVM_TEST_COMPONENTS=(
llvm/lib/Testing/Support
llvm/utils/{lit,llvm-lit,unittest}
llvm/utils/{UpdateTestChecks,update_cc_test_checks.py}
)
-LLVM_PATCHSET=9999-2
+LLVM_PATCHSET=${PV/_/-}-r3
LLVM_USE_TARGETS=llvm
llvm.org_set_globals
@@ -67,7 +70,7 @@ llvm.org_set_globals
# multilib clang* libraries (not runtime, not wrappers).
pkg_setup() {
- LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
python-single-r1_pkg_setup
}
@@ -80,8 +83,12 @@ src_prepare() {
# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
eprefixify \
- lib/Frontend/InitHeaderSearch.cpp \
+ lib/Lex/InitHeaderSearch.cpp \
lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
}
check_distribution_components() {
@@ -99,10 +106,6 @@ check_distribution_components() {
clang-libraries|distribution)
continue
;;
- # headers for clang-tidy static library
- clang-tidy-headers)
- continue
- ;;
# tools
clang|clangd|clang-*)
;;
@@ -118,7 +121,7 @@ check_distribution_components() {
all_targets+=( "${l}" )
fi
- done < <(ninja -t targets all)
+ done < <(${NINJA} -t targets all)
while read -r l; do
my_targets+=( "${l}" )
@@ -155,6 +158,27 @@ get_distribution_components() {
clang-resource-headers
libclang-headers
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
# libs
clang-cpp
libclang
@@ -171,6 +195,7 @@ get_distribution_components() {
clang
clang-format
clang-offload-bundler
+ clang-offload-packager
clang-offload-wrapper
clang-refactor
clang-repl
@@ -179,33 +204,39 @@ get_distribution_components() {
diagtool
hmaptool
- # extra tools
- clang-apply-replacements
- clang-change-namespace
- clang-doc
- clang-include-fixer
- clang-move
- clang-query
- clang-reorder-fields
- clang-tidy
- clangd
- find-all-symbols
- modularize
- pp-trace
+ # needed for cross-compiling Clang
+ clang-tblgen
)
- if llvm_are_manpages_built; then
+ if use extra; then
out+=(
- # manpages
- docs-clang-man
- docs-clang-tools-man
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
)
fi
- use doc && out+=(
- docs-clang-html
- docs-clang-tools-html
- )
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
use static-analyzer && out+=(
clang-check
@@ -220,15 +251,13 @@ get_distribution_components() {
}
multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
-
local mycmakeargs=(
- -DLLVM_CMAKE_PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)/cmake/llvm"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
# relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_VERSION}"
-DBUILD_SHARED_LIBS=OFF
-DCLANG_LINK_CLANG_DYLIB=ON
@@ -249,17 +278,20 @@ multilib_src_configure() {
# disable using CUDA to autodetect GPU, just build for all
-DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
- -DCLANG_DEFAULT_LINKER=$(usex default-lld lld "")
- -DCLANG_DEFAULT_UNWINDLIB=$(usex default-compiler-rt libunwind "")
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
-DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
-DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
-DPython3_EXECUTABLE="${PYTHON}"
)
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
use test && mycmakeargs+=(
-DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
-DLLVM_EXTERNAL_LIT="${BUILD_DIR}/bin/llvm-lit"
@@ -274,13 +306,21 @@ multilib_src_configure() {
-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
)
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
fi
mycmakeargs+=(
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
-DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
-DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
)
else
@@ -296,11 +336,12 @@ multilib_src_configure() {
fi
if tc-is-cross-compiler; then
- [[ -x "/usr/bin/clang-tblgen" ]] \
- || die "/usr/bin/clang-tblgen not found or usable"
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
mycmakeargs+=(
- -DCMAKE_CROSSCOMPILING=ON
- -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
)
fi
@@ -328,9 +369,14 @@ multilib_src_compile() {
multilib_src_test() {
# respect TMPDIR!
local -x LIT_PRESERVES_TMP=1
- cmake_build check-clang
- multilib_is_native_abi &&
- cmake_build check-clang-tools check-clangd
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
}
src_install() {
@@ -343,13 +389,12 @@ 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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/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 "${llvm_version}")
- local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
local clang_tools=( clang clang++ clang-cl clang-cpp )
local abi i
@@ -363,19 +408,19 @@ src_install() {
# - clang, clang++, clang-cl, clang-cpp -> clang*-X
# 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}"
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}"
+ dosym "${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
done
done
}
@@ -383,25 +428,37 @@ src_install() {
multilib_src_install() {
DESTDIR=${D} cmake_build install-distribution
+ if multilib_is_native_abi; then
+ # install clang-*-wrapper tools
+ # https://bugs.gentoo.org/904143
+ exeinto "/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ doexe "${BUILD_DIR}"/bin/clang-{linker,nvlink}-wrapper
+ fi
+
# 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
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
}
multilib_src_install_all() {
python_fix_shebang "${ED}"
if use static-analyzer; then
- python_optimize "${ED}"/usr/lib/llvm/${SLOT}/share/scan-view
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
fi
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
# 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"
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1"
}
pkg_postinst() {
@@ -410,10 +467,12 @@ pkg_postinst() {
fi
elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "Some of them are vim integration scripts (with instructions inside)."
- elog "The run-clang-tidy.py script requires the following additional package:"
- elog " dev-python/pyyaml"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
}
pkg_postrm() {
diff --git a/sys-devel/clang/clang-13.0.1_rc1.ebuild b/sys-devel/clang/clang-16.0.6.ebuild
index cf79f953833e..bd1e86a5edd7 100644
--- a/sys-devel/clang/clang-13.0.1_rc1.ebuild
+++ b/sys-devel/clang/clang-16.0.6.ebuild
@@ -1,11 +1,12 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm llvm.org multilib multilib-minimal \
- prefix python-single-r1 toolchain-funcs
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm llvm.org multilib multilib-minimal
+inherit prefix python-single-r1 toolchain-funcs
DESCRIPTION="C language family frontend for LLVM"
HOMEPAGE="https://llvm.org/"
@@ -14,44 +15,47 @@ HOMEPAGE="https://llvm.org/"
# sorttable.js: MIT
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
-SLOT="$(ver_cut 1)"
-KEYWORDS=""
-IUSE="debug default-compiler-rt default-libcxx default-lld
- doc llvm-libunwind +static-analyzer test xml"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~x64-macos"
+IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="!test? ( test )"
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${MULTILIB_USEDEP}]
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
static-analyzer? ( dev-lang/perl:* )
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
+"
-DEPEND="${RDEPEND}"
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
BDEPEND="
- >=dev-util/cmake-3.16
- doc? ( dev-python/sphinx )
+ ${PYTHON_DEPS}
+ doc? ( $(python_gen_cond_dep '
+ dev-python/recommonmark[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ') )
xml? ( virtual/pkgconfig )
- ${PYTHON_DEPS}"
+"
PDEPEND="
- sys-devel/clang-common
~sys-devel/clang-runtime-${PV}
- default-compiler-rt? (
- =sys-libs/compiler-rt-${PV%_*}*
- llvm-libunwind? ( sys-libs/llvm-libunwind )
- !llvm-libunwind? ( sys-libs/libunwind )
- )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )
- default-lld? ( sys-devel/lld )"
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
-LLVM_COMPONENTS=( clang clang-tools-extra )
-LLVM_MANPAGES=build
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
LLVM_TEST_COMPONENTS=(
- llvm/lib/Testing/Support
- llvm/utils/{lit,llvm-lit,unittest}
- llvm/utils/{UpdateTestChecks,update_cc_test_checks.py}
+ llvm/lib/Testing
+ llvm/utils
+ third-party
)
-LLVM_PATCHSET=${PV/_/-}-r1
+LLVM_PATCHSET=${PV}
LLVM_USE_TARGETS=llvm
llvm.org_set_globals
@@ -67,7 +71,7 @@ llvm.org_set_globals
# multilib clang* libraries (not runtime, not wrappers).
pkg_setup() {
- LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
python-single-r1_pkg_setup
}
@@ -80,8 +84,12 @@ src_prepare() {
# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
eprefixify \
- lib/Frontend/InitHeaderSearch.cpp \
+ lib/Lex/InitHeaderSearch.cpp \
lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
}
check_distribution_components() {
@@ -99,10 +107,6 @@ check_distribution_components() {
clang-libraries|distribution)
continue
;;
- # headers for clang-tidy static library
- clang-tidy-headers)
- continue
- ;;
# tools
clang|clangd|clang-*)
;;
@@ -118,7 +122,7 @@ check_distribution_components() {
all_targets+=( "${l}" )
fi
- done < <(ninja -t targets all)
+ done < <(${NINJA} -t targets all)
while read -r l; do
my_targets+=( "${l}" )
@@ -155,6 +159,27 @@ get_distribution_components() {
clang-resource-headers
libclang-headers
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
# libs
clang-cpp
libclang
@@ -167,45 +192,55 @@ get_distribution_components() {
libclang-python-bindings
# tools
+ amdgpu-arch
c-index-test
clang
clang-format
+ clang-linker-wrapper
clang-offload-bundler
- clang-offload-wrapper
+ clang-offload-packager
clang-refactor
clang-repl
clang-rename
clang-scan-deps
diagtool
hmaptool
+ nvptx-arch
- # extra tools
- clang-apply-replacements
- clang-change-namespace
- clang-doc
- clang-include-fixer
- clang-move
- clang-query
- clang-reorder-fields
- clang-tidy
- clangd
- find-all-symbols
- modularize
- pp-trace
+ # needed for cross-compiling Clang
+ clang-tblgen
)
- if llvm_are_manpages_built; then
+ if use extra; then
out+=(
- # manpages
- docs-clang-man
- docs-clang-tools-man
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
)
fi
- use doc && out+=(
- docs-clang-html
- docs-clang-tools-html
- )
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
use static-analyzer && out+=(
clang-check
@@ -220,22 +255,22 @@ get_distribution_components() {
}
multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
+ tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
local mycmakeargs=(
- -DLLVM_CMAKE_PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)/cmake/llvm"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
# relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
-DBUILD_SHARED_LIBS=OFF
-DCLANG_LINK_CLANG_DYLIB=ON
-DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
-DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
- -DLLVM_BUILD_TESTS=$(usex test)
# these are not propagated reliably, so redefine them
-DLLVM_ENABLE_EH=ON
@@ -248,20 +283,26 @@ multilib_src_configure() {
# disable using CUDA to autodetect GPU, just build for all
-DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
- -DCLANG_DEFAULT_LINKER=$(usex default-lld lld "")
- -DCLANG_DEFAULT_UNWINDLIB=$(usex default-compiler-rt libunwind "")
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
-DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
-DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
-DPython3_EXECUTABLE="${PYTHON}"
)
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_BUILD_TESTS=ON
-DLLVM_LIT_ARGS="$(get_lit_flags)"
)
@@ -273,13 +314,21 @@ multilib_src_configure() {
-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
)
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
fi
mycmakeargs+=(
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
-DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
-DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
)
else
@@ -295,11 +344,12 @@ multilib_src_configure() {
fi
if tc-is-cross-compiler; then
- [[ -x "/usr/bin/clang-tblgen" ]] \
- || die "/usr/bin/clang-tblgen not found or usable"
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
mycmakeargs+=(
- -DCMAKE_CROSSCOMPILING=ON
- -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
)
fi
@@ -327,9 +377,14 @@ multilib_src_compile() {
multilib_src_test() {
# respect TMPDIR!
local -x LIT_PRESERVES_TMP=1
- cmake_build check-clang
- multilib_is_native_abi &&
- cmake_build check-clang-tools check-clangd
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
}
src_install() {
@@ -342,13 +397,12 @@ 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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/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 "${llvm_version}")
- local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
local clang_tools=( clang clang++ clang-cl clang-cpp )
local abi i
@@ -362,19 +416,19 @@ src_install() {
# - clang, clang++, clang-cl, clang-cpp -> clang*-X
# 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}"
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}"
+ dosym "${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
done
done
}
@@ -385,22 +439,27 @@ multilib_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
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
}
multilib_src_install_all() {
python_fix_shebang "${ED}"
if use static-analyzer; then
- python_optimize "${ED}"/usr/lib/llvm/${SLOT}/share/scan-view
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
fi
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
# 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"
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1"
}
pkg_postinst() {
@@ -409,10 +468,12 @@ pkg_postinst() {
fi
elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "Some of them are vim integration scripts (with instructions inside)."
- elog "The run-clang-tidy.py script requires the following additional package:"
- elog " dev-python/pyyaml"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
}
pkg_postrm() {
diff --git a/sys-devel/clang/clang-13.0.1_rc2.ebuild b/sys-devel/clang/clang-17.0.6.ebuild
index ae93802425a4..71d4d04a4823 100644
--- a/sys-devel/clang/clang-13.0.1_rc2.ebuild
+++ b/sys-devel/clang/clang-17.0.6.ebuild
@@ -1,11 +1,12 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm llvm.org multilib multilib-minimal \
- prefix python-single-r1 toolchain-funcs
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake llvm llvm.org multilib multilib-minimal
+inherit prefix python-single-r1 toolchain-funcs
DESCRIPTION="C language family frontend for LLVM"
HOMEPAGE="https://llvm.org/"
@@ -14,44 +15,45 @@ HOMEPAGE="https://llvm.org/"
# sorttable.js: MIT
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
-SLOT="$(ver_cut 1)"
-KEYWORDS=""
-IUSE="debug default-compiler-rt default-libcxx default-lld
- doc llvm-libunwind +static-analyzer test xml"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~x64-macos"
+IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="!test? ( test )"
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${MULTILIB_USEDEP}]
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
static-analyzer? ( dev-lang/perl:* )
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
+"
-DEPEND="${RDEPEND}"
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
BDEPEND="
- >=dev-util/cmake-3.16
- doc? ( dev-python/sphinx )
+ ${PYTHON_DEPS}
+ doc? ( $(python_gen_cond_dep '
+ dev-python/recommonmark[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ') )
xml? ( virtual/pkgconfig )
- ${PYTHON_DEPS}"
+"
PDEPEND="
- sys-devel/clang-common
~sys-devel/clang-runtime-${PV}
- default-compiler-rt? (
- =sys-libs/compiler-rt-${PV%_*}*
- llvm-libunwind? ( sys-libs/llvm-libunwind )
- !llvm-libunwind? ( sys-libs/libunwind )
- )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )
- default-lld? ( sys-devel/lld )"
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
-LLVM_COMPONENTS=( clang clang-tools-extra )
-LLVM_MANPAGES=build
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
+LLVM_PATCHSET=${PV}-r1
LLVM_TEST_COMPONENTS=(
- llvm/lib/Testing/Support
- llvm/utils/{lit,llvm-lit,unittest}
- llvm/utils/{UpdateTestChecks,update_cc_test_checks.py}
+ llvm/utils
)
-LLVM_PATCHSET=${PV/_/-}
LLVM_USE_TARGETS=llvm
llvm.org_set_globals
@@ -67,7 +69,7 @@ llvm.org_set_globals
# multilib clang* libraries (not runtime, not wrappers).
pkg_setup() {
- LLVM_MAX_SLOT=${SLOT} llvm_pkg_setup
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
python-single-r1_pkg_setup
}
@@ -80,8 +82,12 @@ src_prepare() {
# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
eprefixify \
- lib/Frontend/InitHeaderSearch.cpp \
+ lib/Lex/InitHeaderSearch.cpp \
lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
}
check_distribution_components() {
@@ -99,10 +105,6 @@ check_distribution_components() {
clang-libraries|distribution)
continue
;;
- # headers for clang-tidy static library
- clang-tidy-headers)
- continue
- ;;
# tools
clang|clangd|clang-*)
;;
@@ -118,7 +120,7 @@ check_distribution_components() {
all_targets+=( "${l}" )
fi
- done < <(ninja -t targets all)
+ done < <(${NINJA} -t targets all)
while read -r l; do
my_targets+=( "${l}" )
@@ -155,6 +157,27 @@ get_distribution_components() {
clang-resource-headers
libclang-headers
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
# libs
clang-cpp
libclang
@@ -167,45 +190,55 @@ get_distribution_components() {
libclang-python-bindings
# tools
+ amdgpu-arch
c-index-test
clang
clang-format
+ clang-linker-wrapper
clang-offload-bundler
- clang-offload-wrapper
+ clang-offload-packager
clang-refactor
clang-repl
clang-rename
clang-scan-deps
diagtool
hmaptool
+ nvptx-arch
- # extra tools
- clang-apply-replacements
- clang-change-namespace
- clang-doc
- clang-include-fixer
- clang-move
- clang-query
- clang-reorder-fields
- clang-tidy
- clangd
- find-all-symbols
- modularize
- pp-trace
+ # needed for cross-compiling Clang
+ clang-tblgen
)
- if llvm_are_manpages_built; then
+ if use extra; then
out+=(
- # manpages
- docs-clang-man
- docs-clang-tools-man
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
)
fi
- use doc && out+=(
- docs-clang-html
- docs-clang-tools-html
- )
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
use static-analyzer && out+=(
clang-check
@@ -220,48 +253,53 @@ get_distribution_components() {
}
multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
-
local mycmakeargs=(
- -DLLVM_CMAKE_PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)/cmake/llvm"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
# relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
-DBUILD_SHARED_LIBS=OFF
-DCLANG_LINK_CLANG_DYLIB=ON
-DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
-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
# disable using CUDA to autodetect GPU, just build for all
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDAToolkit=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
- -DCLANG_DEFAULT_LINKER=$(usex default-lld lld "")
- -DCLANG_DEFAULT_UNWINDLIB=$(usex default-compiler-rt libunwind "")
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+ -DCLANG_ENABLE_LIBXML2=$(usex xml)
-DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
-DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # TODO: CLANG_ENABLE_HLSL?
-DPython3_EXECUTABLE="${PYTHON}"
)
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_BUILD_TESTS=ON
-DLLVM_LIT_ARGS="$(get_lit_flags)"
)
@@ -273,13 +311,21 @@ multilib_src_configure() {
-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
)
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
fi
mycmakeargs+=(
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
-DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
-DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
)
else
@@ -295,11 +341,12 @@ multilib_src_configure() {
fi
if tc-is-cross-compiler; then
- [[ -x "/usr/bin/clang-tblgen" ]] \
- || die "/usr/bin/clang-tblgen not found or usable"
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
mycmakeargs+=(
- -DCMAKE_CROSSCOMPILING=ON
- -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
)
fi
@@ -316,20 +363,19 @@ multilib_src_configure() {
multilib_src_compile() {
cmake_build distribution
-
- # 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_build check-clang
- multilib_is_native_abi &&
- cmake_build check-clang-tools check-clangd
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
}
src_install() {
@@ -342,13 +388,12 @@ 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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/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 "${llvm_version}")
- local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
local clang_tools=( clang clang++ clang-cl clang-cpp )
local abi i
@@ -362,19 +407,19 @@ src_install() {
# - clang, clang++, clang-cl, clang-cpp -> clang*-X
# 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}"
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}"
+ dosym "${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
done
done
}
@@ -385,22 +430,27 @@ multilib_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
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
}
multilib_src_install_all() {
python_fix_shebang "${ED}"
if use static-analyzer; then
- python_optimize "${ED}"/usr/lib/llvm/${SLOT}/share/scan-view
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
fi
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
# 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"
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1"
}
pkg_postinst() {
@@ -409,10 +459,12 @@ pkg_postinst() {
fi
elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "Some of them are vim integration scripts (with instructions inside)."
- elog "The run-clang-tidy.py script requires the following additional package:"
- elog " dev-python/pyyaml"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
}
pkg_postrm() {
diff --git a/sys-devel/clang/clang-18.1.3.ebuild b/sys-devel/clang/clang-18.1.3.ebuild
new file mode 100644
index 000000000000..142fc3861de3
--- /dev/null
+++ b/sys-devel/clang/clang-18.1.3.ebuild
@@ -0,0 +1,476 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake llvm.org llvm-utils multilib multilib-minimal
+inherit prefix python-single-r1 toolchain-funcs
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+
+# MSVCSetupApi.h: MIT
+# sorttable.js: MIT
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~x64-macos"
+IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
+ static-analyzer? ( dev-lang/perl:* )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ test? ( ~sys-devel/lld-${PV} )
+ xml? ( virtual/pkgconfig )
+"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
+LLVM_TEST_COMPONENTS=(
+ llvm/utils
+)
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_cond_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+# 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).
+
+src_prepare() {
+ # create extra parent dir for relative CLANG_RESOURCE_DIR access
+ mkdir -p x/y || die
+ BUILD_DIR=${WORKDIR}/x/y/clang
+
+ llvm.org_src_prepare
+
+ # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+ eprefixify \
+ lib/Lex/InitHeaderSearch.cpp \
+ lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # meta-targets
+ clang-libraries|distribution)
+ continue
+ ;;
+ # tools
+ clang|clangd|clang-*)
+ ;;
+ # static libraries
+ clang*|findAllSymbols)
+ continue
+ ;;
+ # conditional to USE=doc
+ docs-clang-html|docs-clang-tools-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # common stuff
+ clang-cmake-exports
+ clang-headers
+ clang-resource-headers
+ libclang-headers
+
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
+ # libs
+ clang-cpp
+ libclang
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # common stuff
+ bash-autocomplete
+ libclang-python-bindings
+
+ # tools
+ amdgpu-arch
+ c-index-test
+ clang
+ clang-format
+ clang-linker-wrapper
+ clang-offload-bundler
+ clang-offload-packager
+ clang-refactor
+ clang-repl
+ clang-rename
+ clang-scan-deps
+ diagtool
+ hmaptool
+ nvptx-arch
+
+ # needed for cross-compiling Clang
+ clang-tblgen
+ )
+
+ if use extra; then
+ out+=(
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
+ )
+ fi
+
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
+
+ use static-analyzer && out+=(
+ clang-check
+ clang-extdef-mapping
+ scan-build
+ scan-build-py
+ scan-view
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ local mycmakeargs=(
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DCLANG_LINK_CLANG_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
+
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # disable using CUDA to autodetect GPU, just build for all
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDAToolkit=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
+
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+
+ -DCLANG_ENABLE_LIBXML2=$(usex xml)
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # TODO: CLANG_ENABLE_HLSL?
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
+ fi
+ mycmakeargs+=(
+ -DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if [[ -n ${EPREFIX} ]]; then
+ mycmakeargs+=(
+ -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
+ mycmakeargs+=(
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
+ )
+ fi
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ cmake_build distribution
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
+}
+
+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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X
+ # - clang -> clang-X
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X
+ # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
+ done
+ done
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # 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/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
+ fi
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+ # 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/${LLVM_MAJOR}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+
+ elog "You can find additional utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/clang-18.1.4.ebuild b/sys-devel/clang/clang-18.1.4.ebuild
new file mode 100644
index 000000000000..142fc3861de3
--- /dev/null
+++ b/sys-devel/clang/clang-18.1.4.ebuild
@@ -0,0 +1,476 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake llvm.org llvm-utils multilib multilib-minimal
+inherit prefix python-single-r1 toolchain-funcs
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+
+# MSVCSetupApi.h: MIT
+# sorttable.js: MIT
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~x64-macos"
+IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
+ static-analyzer? ( dev-lang/perl:* )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ test? ( ~sys-devel/lld-${PV} )
+ xml? ( virtual/pkgconfig )
+"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
+LLVM_TEST_COMPONENTS=(
+ llvm/utils
+)
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_cond_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+# 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).
+
+src_prepare() {
+ # create extra parent dir for relative CLANG_RESOURCE_DIR access
+ mkdir -p x/y || die
+ BUILD_DIR=${WORKDIR}/x/y/clang
+
+ llvm.org_src_prepare
+
+ # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+ eprefixify \
+ lib/Lex/InitHeaderSearch.cpp \
+ lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # meta-targets
+ clang-libraries|distribution)
+ continue
+ ;;
+ # tools
+ clang|clangd|clang-*)
+ ;;
+ # static libraries
+ clang*|findAllSymbols)
+ continue
+ ;;
+ # conditional to USE=doc
+ docs-clang-html|docs-clang-tools-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # common stuff
+ clang-cmake-exports
+ clang-headers
+ clang-resource-headers
+ libclang-headers
+
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
+ # libs
+ clang-cpp
+ libclang
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # common stuff
+ bash-autocomplete
+ libclang-python-bindings
+
+ # tools
+ amdgpu-arch
+ c-index-test
+ clang
+ clang-format
+ clang-linker-wrapper
+ clang-offload-bundler
+ clang-offload-packager
+ clang-refactor
+ clang-repl
+ clang-rename
+ clang-scan-deps
+ diagtool
+ hmaptool
+ nvptx-arch
+
+ # needed for cross-compiling Clang
+ clang-tblgen
+ )
+
+ if use extra; then
+ out+=(
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
+ )
+ fi
+
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
+
+ use static-analyzer && out+=(
+ clang-check
+ clang-extdef-mapping
+ scan-build
+ scan-build-py
+ scan-view
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ local mycmakeargs=(
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DCLANG_LINK_CLANG_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
+
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # disable using CUDA to autodetect GPU, just build for all
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDAToolkit=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
+
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+
+ -DCLANG_ENABLE_LIBXML2=$(usex xml)
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # TODO: CLANG_ENABLE_HLSL?
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
+ fi
+ mycmakeargs+=(
+ -DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if [[ -n ${EPREFIX} ]]; then
+ mycmakeargs+=(
+ -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
+ mycmakeargs+=(
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
+ )
+ fi
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ cmake_build distribution
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
+}
+
+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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X
+ # - clang -> clang-X
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X
+ # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
+ done
+ done
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # 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/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
+ fi
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+ # 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/${LLVM_MAJOR}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+
+ elog "You can find additional utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/clang-13.0.1.9999.ebuild b/sys-devel/clang/clang-19.0.0.9999.ebuild
index c9cdf6cd226b..79df96923121 100644
--- a/sys-devel/clang/clang-13.0.1.9999.ebuild
+++ b/sys-devel/clang/clang-19.0.0.9999.ebuild
@@ -1,11 +1,12 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm llvm.org multilib multilib-minimal \
- prefix python-single-r1 toolchain-funcs
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake llvm.org llvm-utils multilib multilib-minimal
+inherit prefix python-single-r1 toolchain-funcs
DESCRIPTION="C language family frontend for LLVM"
HOMEPAGE="https://llvm.org/"
@@ -14,47 +15,52 @@ HOMEPAGE="https://llvm.org/"
# sorttable.js: MIT
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
-SLOT="$(ver_cut 1)"
-KEYWORDS=""
-IUSE="debug default-compiler-rt default-libcxx default-lld
- doc llvm-libunwind +static-analyzer test xml"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="+debug doc +extra ieee-long-double +pie +static-analyzer test xml"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="!test? ( test )"
-RDEPEND="
- ~sys-devel/llvm-${PV}:${SLOT}=[debug=,${MULTILIB_USEDEP}]
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
static-analyzer? ( dev-lang/perl:* )
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- ${PYTHON_DEPS}"
+"
-DEPEND="${RDEPEND}"
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
BDEPEND="
- >=dev-util/cmake-3.16
- doc? ( dev-python/sphinx )
+ ${PYTHON_DEPS}
+ test? ( ~sys-devel/lld-${PV} )
xml? ( virtual/pkgconfig )
- ${PYTHON_DEPS}"
+"
PDEPEND="
- sys-devel/clang-common
~sys-devel/clang-runtime-${PV}
- default-compiler-rt? (
- =sys-libs/compiler-rt-${PV%_*}*
- llvm-libunwind? ( sys-libs/llvm-libunwind )
- !llvm-libunwind? ( sys-libs/libunwind )
- )
- default-libcxx? ( >=sys-libs/libcxx-${PV} )
- default-lld? ( sys-devel/lld )"
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
-LLVM_COMPONENTS=( clang clang-tools-extra )
-LLVM_MANPAGES=build
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
LLVM_TEST_COMPONENTS=(
- llvm/lib/Testing/Support
- llvm/utils/{lit,llvm-lit,unittest}
- llvm/utils/{UpdateTestChecks,update_cc_test_checks.py}
+ llvm/utils
)
-LLVM_PATCHSET=9999-2
LLVM_USE_TARGETS=llvm
llvm.org_set_globals
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_cond_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
# 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
@@ -66,11 +72,6 @@ llvm.org_set_globals
# 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_prepare() {
# create extra parent dir for relative CLANG_RESOURCE_DIR access
mkdir -p x/y || die
@@ -80,8 +81,12 @@ src_prepare() {
# add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
eprefixify \
- lib/Frontend/InitHeaderSearch.cpp \
+ lib/Lex/InitHeaderSearch.cpp \
lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
}
check_distribution_components() {
@@ -99,10 +104,6 @@ check_distribution_components() {
clang-libraries|distribution)
continue
;;
- # headers for clang-tidy static library
- clang-tidy-headers)
- continue
- ;;
# tools
clang|clangd|clang-*)
;;
@@ -118,7 +119,7 @@ check_distribution_components() {
all_targets+=( "${l}" )
fi
- done < <(ninja -t targets all)
+ done < <(${NINJA} -t targets all)
while read -r l; do
my_targets+=( "${l}" )
@@ -155,6 +156,27 @@ get_distribution_components() {
clang-resource-headers
libclang-headers
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
# libs
clang-cpp
libclang
@@ -167,45 +189,55 @@ get_distribution_components() {
libclang-python-bindings
# tools
+ amdgpu-arch
c-index-test
clang
clang-format
+ clang-linker-wrapper
clang-offload-bundler
- clang-offload-wrapper
+ clang-offload-packager
clang-refactor
clang-repl
clang-rename
clang-scan-deps
diagtool
hmaptool
+ nvptx-arch
- # extra tools
- clang-apply-replacements
- clang-change-namespace
- clang-doc
- clang-include-fixer
- clang-move
- clang-query
- clang-reorder-fields
- clang-tidy
- clangd
- find-all-symbols
- modularize
- pp-trace
+ # needed for cross-compiling Clang
+ clang-tblgen
)
- if llvm_are_manpages_built; then
+ if use extra; then
out+=(
- # manpages
- docs-clang-man
- docs-clang-tools-man
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
)
fi
- use doc && out+=(
- docs-clang-html
- docs-clang-tools-html
- )
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
use static-analyzer && out+=(
clang-check
@@ -220,48 +252,55 @@ get_distribution_components() {
}
multilib_src_configure() {
- local llvm_version=$(llvm-config --version) || die
- local clang_version=$(ver_cut 1-3 "${llvm_version}")
+ llvm_prepend_path "${LLVM_MAJOR}"
local mycmakeargs=(
- -DLLVM_CMAKE_PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)/cmake/llvm"
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${SLOT}"
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
# relative to bindir
- -DCLANG_RESOURCE_DIR="../../../../lib/clang/${clang_version}"
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
-DBUILD_SHARED_LIBS=OFF
-DCLANG_LINK_CLANG_DYLIB=ON
-DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
-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
# disable using CUDA to autodetect GPU, just build for all
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDAToolkit=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
- # override default stdlib and rtlib
- -DCLANG_DEFAULT_CXX_STDLIB=$(usex default-libcxx libc++ "")
- -DCLANG_DEFAULT_RTLIB=$(usex default-compiler-rt compiler-rt "")
- -DCLANG_DEFAULT_LINKER=$(usex default-lld lld "")
- -DCLANG_DEFAULT_UNWINDLIB=$(usex default-compiler-rt libunwind "")
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+ -DCLANG_ENABLE_LIBXML2=$(usex xml)
-DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
-DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # TODO: CLANG_ENABLE_HLSL?
-DPython3_EXECUTABLE="${PYTHON}"
)
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
use test && mycmakeargs+=(
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_BUILD_TESTS=ON
-DLLVM_LIT_ARGS="$(get_lit_flags)"
)
@@ -273,13 +312,21 @@ multilib_src_configure() {
-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
)
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
fi
mycmakeargs+=(
- -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
-DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
-DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
)
else
@@ -295,11 +342,12 @@ multilib_src_configure() {
fi
if tc-is-cross-compiler; then
- [[ -x "/usr/bin/clang-tblgen" ]] \
- || die "/usr/bin/clang-tblgen not found or usable"
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
mycmakeargs+=(
- -DCMAKE_CROSSCOMPILING=ON
- -DCLANG_TABLEGEN=/usr/bin/clang-tblgen
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
)
fi
@@ -316,20 +364,19 @@ multilib_src_configure() {
multilib_src_compile() {
cmake_build distribution
-
- # 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_build check-clang
- multilib_is_native_abi &&
- cmake_build check-clang-tools check-clangd
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
}
src_install() {
@@ -342,13 +389,12 @@ 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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/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 "${llvm_version}")
- local clang_full_version=$(ver_cut 1-3 "${llvm_version}")
local clang_tools=( clang clang++ clang-cl clang-cpp )
local abi i
@@ -362,19 +408,19 @@ src_install() {
# - clang, clang++, clang-cl, clang-cpp -> clang*-X
# 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}"
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}"
+ dosym "${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
done
done
}
@@ -385,22 +431,27 @@ multilib_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
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
}
multilib_src_install_all() {
python_fix_shebang "${ED}"
if use static-analyzer; then
- python_optimize "${ED}"/usr/lib/llvm/${SLOT}/share/scan-view
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
fi
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
# 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"
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1"
}
pkg_postinst() {
@@ -409,10 +460,12 @@ pkg_postinst() {
fi
elog "You can find additional utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/clang"
- elog "Some of them are vim integration scripts (with instructions inside)."
- elog "The run-clang-tidy.py script requires the following additional package:"
- elog " dev-python/pyyaml"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
}
pkg_postrm() {
diff --git a/sys-devel/clang/clang-19.0.0_pre20240330.ebuild b/sys-devel/clang/clang-19.0.0_pre20240330.ebuild
new file mode 100644
index 000000000000..79df96923121
--- /dev/null
+++ b/sys-devel/clang/clang-19.0.0_pre20240330.ebuild
@@ -0,0 +1,475 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake llvm.org llvm-utils multilib multilib-minimal
+inherit prefix python-single-r1 toolchain-funcs
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+
+# MSVCSetupApi.h: MIT
+# sorttable.js: MIT
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="+debug doc +extra ieee-long-double +pie +static-analyzer test xml"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
+ static-analyzer? ( dev-lang/perl:* )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ test? ( ~sys-devel/lld-${PV} )
+ xml? ( virtual/pkgconfig )
+"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
+LLVM_TEST_COMPONENTS=(
+ llvm/utils
+)
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_cond_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+# 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).
+
+src_prepare() {
+ # create extra parent dir for relative CLANG_RESOURCE_DIR access
+ mkdir -p x/y || die
+ BUILD_DIR=${WORKDIR}/x/y/clang
+
+ llvm.org_src_prepare
+
+ # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+ eprefixify \
+ lib/Lex/InitHeaderSearch.cpp \
+ lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # meta-targets
+ clang-libraries|distribution)
+ continue
+ ;;
+ # tools
+ clang|clangd|clang-*)
+ ;;
+ # static libraries
+ clang*|findAllSymbols)
+ continue
+ ;;
+ # conditional to USE=doc
+ docs-clang-html|docs-clang-tools-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # common stuff
+ clang-cmake-exports
+ clang-headers
+ clang-resource-headers
+ libclang-headers
+
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
+ # libs
+ clang-cpp
+ libclang
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # common stuff
+ bash-autocomplete
+ libclang-python-bindings
+
+ # tools
+ amdgpu-arch
+ c-index-test
+ clang
+ clang-format
+ clang-linker-wrapper
+ clang-offload-bundler
+ clang-offload-packager
+ clang-refactor
+ clang-repl
+ clang-rename
+ clang-scan-deps
+ diagtool
+ hmaptool
+ nvptx-arch
+
+ # needed for cross-compiling Clang
+ clang-tblgen
+ )
+
+ if use extra; then
+ out+=(
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
+ )
+ fi
+
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
+
+ use static-analyzer && out+=(
+ clang-check
+ clang-extdef-mapping
+ scan-build
+ scan-build-py
+ scan-view
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ local mycmakeargs=(
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DCLANG_LINK_CLANG_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
+
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # disable using CUDA to autodetect GPU, just build for all
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDAToolkit=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
+
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+
+ -DCLANG_ENABLE_LIBXML2=$(usex xml)
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # TODO: CLANG_ENABLE_HLSL?
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
+ fi
+ mycmakeargs+=(
+ -DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if [[ -n ${EPREFIX} ]]; then
+ mycmakeargs+=(
+ -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
+ mycmakeargs+=(
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
+ )
+ fi
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ cmake_build distribution
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
+}
+
+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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X
+ # - clang -> clang-X
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X
+ # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
+ done
+ done
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # 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/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
+ fi
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+ # 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/${LLVM_MAJOR}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+
+ elog "You can find additional utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/clang-19.0.0_pre20240404.ebuild b/sys-devel/clang/clang-19.0.0_pre20240404.ebuild
new file mode 100644
index 000000000000..79df96923121
--- /dev/null
+++ b/sys-devel/clang/clang-19.0.0_pre20240404.ebuild
@@ -0,0 +1,475 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake llvm.org llvm-utils multilib multilib-minimal
+inherit prefix python-single-r1 toolchain-funcs
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+
+# MSVCSetupApi.h: MIT
+# sorttable.js: MIT
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="+debug doc +extra ieee-long-double +pie +static-analyzer test xml"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
+ static-analyzer? ( dev-lang/perl:* )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ test? ( ~sys-devel/lld-${PV} )
+ xml? ( virtual/pkgconfig )
+"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
+LLVM_TEST_COMPONENTS=(
+ llvm/utils
+)
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_cond_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+# 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).
+
+src_prepare() {
+ # create extra parent dir for relative CLANG_RESOURCE_DIR access
+ mkdir -p x/y || die
+ BUILD_DIR=${WORKDIR}/x/y/clang
+
+ llvm.org_src_prepare
+
+ # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+ eprefixify \
+ lib/Lex/InitHeaderSearch.cpp \
+ lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # meta-targets
+ clang-libraries|distribution)
+ continue
+ ;;
+ # tools
+ clang|clangd|clang-*)
+ ;;
+ # static libraries
+ clang*|findAllSymbols)
+ continue
+ ;;
+ # conditional to USE=doc
+ docs-clang-html|docs-clang-tools-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # common stuff
+ clang-cmake-exports
+ clang-headers
+ clang-resource-headers
+ libclang-headers
+
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
+ # libs
+ clang-cpp
+ libclang
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # common stuff
+ bash-autocomplete
+ libclang-python-bindings
+
+ # tools
+ amdgpu-arch
+ c-index-test
+ clang
+ clang-format
+ clang-linker-wrapper
+ clang-offload-bundler
+ clang-offload-packager
+ clang-refactor
+ clang-repl
+ clang-rename
+ clang-scan-deps
+ diagtool
+ hmaptool
+ nvptx-arch
+
+ # needed for cross-compiling Clang
+ clang-tblgen
+ )
+
+ if use extra; then
+ out+=(
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
+ )
+ fi
+
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
+
+ use static-analyzer && out+=(
+ clang-check
+ clang-extdef-mapping
+ scan-build
+ scan-build-py
+ scan-view
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ local mycmakeargs=(
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DCLANG_LINK_CLANG_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
+
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # disable using CUDA to autodetect GPU, just build for all
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDAToolkit=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
+
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+
+ -DCLANG_ENABLE_LIBXML2=$(usex xml)
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # TODO: CLANG_ENABLE_HLSL?
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
+ fi
+ mycmakeargs+=(
+ -DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if [[ -n ${EPREFIX} ]]; then
+ mycmakeargs+=(
+ -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
+ mycmakeargs+=(
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
+ )
+ fi
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ cmake_build distribution
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
+}
+
+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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X
+ # - clang -> clang-X
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X
+ # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
+ done
+ done
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # 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/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
+ fi
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+ # 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/${LLVM_MAJOR}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+
+ elog "You can find additional utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/clang-19.0.0_pre20240410.ebuild b/sys-devel/clang/clang-19.0.0_pre20240410.ebuild
new file mode 100644
index 000000000000..79df96923121
--- /dev/null
+++ b/sys-devel/clang/clang-19.0.0_pre20240410.ebuild
@@ -0,0 +1,475 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake llvm.org llvm-utils multilib multilib-minimal
+inherit prefix python-single-r1 toolchain-funcs
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+
+# MSVCSetupApi.h: MIT
+# sorttable.js: MIT
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="+debug doc +extra ieee-long-double +pie +static-analyzer test xml"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
+ static-analyzer? ( dev-lang/perl:* )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ test? ( ~sys-devel/lld-${PV} )
+ xml? ( virtual/pkgconfig )
+"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
+LLVM_TEST_COMPONENTS=(
+ llvm/utils
+)
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_cond_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+# 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).
+
+src_prepare() {
+ # create extra parent dir for relative CLANG_RESOURCE_DIR access
+ mkdir -p x/y || die
+ BUILD_DIR=${WORKDIR}/x/y/clang
+
+ llvm.org_src_prepare
+
+ # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+ eprefixify \
+ lib/Lex/InitHeaderSearch.cpp \
+ lib/Driver/ToolChains/Darwin.cpp || die
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # meta-targets
+ clang-libraries|distribution)
+ continue
+ ;;
+ # tools
+ clang|clangd|clang-*)
+ ;;
+ # static libraries
+ clang*|findAllSymbols)
+ continue
+ ;;
+ # conditional to USE=doc
+ docs-clang-html|docs-clang-tools-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # common stuff
+ clang-cmake-exports
+ clang-headers
+ clang-resource-headers
+ libclang-headers
+
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
+ # libs
+ clang-cpp
+ libclang
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # common stuff
+ bash-autocomplete
+ libclang-python-bindings
+
+ # tools
+ amdgpu-arch
+ c-index-test
+ clang
+ clang-format
+ clang-linker-wrapper
+ clang-offload-bundler
+ clang-offload-packager
+ clang-refactor
+ clang-repl
+ clang-rename
+ clang-scan-deps
+ diagtool
+ hmaptool
+ nvptx-arch
+
+ # needed for cross-compiling Clang
+ clang-tblgen
+ )
+
+ if use extra; then
+ out+=(
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
+ )
+ fi
+
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
+
+ use static-analyzer && out+=(
+ clang-check
+ clang-extdef-mapping
+ scan-build
+ scan-build-py
+ scan-view
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ local mycmakeargs=(
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DCLANG_LINK_CLANG_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
+
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # disable using CUDA to autodetect GPU, just build for all
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDAToolkit=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
+
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+
+ -DCLANG_ENABLE_LIBXML2=$(usex xml)
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # TODO: CLANG_ENABLE_HLSL?
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
+ fi
+ mycmakeargs+=(
+ -DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if [[ -n ${EPREFIX} ]]; then
+ mycmakeargs+=(
+ -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
+ mycmakeargs+=(
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
+ )
+ fi
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ cmake_build distribution
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
+}
+
+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
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X
+ # - clang -> clang-X
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X
+ # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/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}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
+ done
+ done
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # 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/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
+ fi
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+ # 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/${LLVM_MAJOR}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+
+ elog "You can find additional utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/clang/metadata.xml b/sys-devel/clang/metadata.xml
index be058e8ac6ea..07d06647c9a6 100644
--- a/sys-devel/clang/metadata.xml
+++ b/sys-devel/clang/metadata.xml
@@ -27,9 +27,11 @@ 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="default-lld">Use lld as the default linker for clang</flag>
+ <flag name="extra">Build extra tools (clangd, clang-tidy and a few more)</flag>
+ <flag name="ieee-long-double">Use accelerated 128-bit IEEE long double ABI (ppc64le only)</flag>
<flag name="static-analyzer">Install the Clang static analyzer</flag>
</use>
+ <upstream>
+ <remote-id type="github">llvm/llvm-project</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/cons/Manifest b/sys-devel/cons/Manifest
deleted file mode 100644
index 167672cc3290..000000000000
--- a/sys-devel/cons/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST cons-2.3.0.tgz 235895 BLAKE2B 766b00824ede528c5d356eda40d3b2929b472720340c0f85add95ba13a5b172afaaa50c779e664cca1b5e74f9ed1d26cce8405f7994d9464a0693e5828963863 SHA512 a42b7537fa8c8cc179ff9e608e6cecfaec1ee0b2e1efb9b9b5992ced15867ca05155e87221e5fde6d912b94eac0d1a411c7feb528e882ed65ce9fb2a2d46be12
diff --git a/sys-devel/cons/cons-2.3.0.ebuild b/sys-devel/cons/cons-2.3.0.ebuild
deleted file mode 100644
index 717660db880b..000000000000
--- a/sys-devel/cons/cons-2.3.0.ebuild
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# 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
deleted file mode 100644
index 73dda144f9ac..000000000000
--- a/sys-devel/cons/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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/cproc/Manifest b/sys-devel/cproc/Manifest
new file mode 100644
index 000000000000..3bb5cf1ed1d2
--- /dev/null
+++ b/sys-devel/cproc/Manifest
@@ -0,0 +1 @@
+DIST cproc-6fabc79d81de56b6c1cdcc2242933fd792e2ddf9.tar.gz 80893 BLAKE2B f708649714f0fbc3e7b60dc87585603970eb350de4ce1f02fe9b5783714ef09fa38b4b4ec7a8b0553047e84edc0f752963c84df32dacd9585c435098e57be47c SHA512 355e3ca8fb481d9e32d0621787beee7b0e6f53f107bbb9512f89382c599daa581b89e7da3957c09b81a994ebce9f06df08df0833b010b055a8ff947c8cc8d02e
diff --git a/sys-devel/cproc/cproc-0_pre20220805.ebuild b/sys-devel/cproc/cproc-0_pre20220805.ebuild
new file mode 100644
index 000000000000..163ffe80afba
--- /dev/null
+++ b/sys-devel/cproc/cproc-0_pre20220805.ebuild
@@ -0,0 +1,39 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit edo toolchain-funcs
+
+if [[ ${PV} = 9999 ]]; then
+ EGIT_REPO_URI="https://git.sr.ht/~mcf/cproc"
+ inherit git-r3
+else
+ CPROC_COMMIT="6fabc79d81de56b6c1cdcc2242933fd792e2ddf9"
+ CPROC_P="${PN}-${CPROC_COMMIT}"
+ SRC_URI="https://git.sr.ht/~mcf/cproc/archive/${CPROC_COMMIT}.tar.gz -> ${CPROC_P}.tar.gz"
+ S="${WORKDIR}/${CPROC_P}"
+
+ KEYWORDS="~amd64 ~arm64 ~riscv"
+fi
+
+DESCRIPTION="C11 compiler using QBE as backend"
+HOMEPAGE="https://sr.ht/~mcf/cproc/"
+
+LICENSE="ISC"
+SLOT="0"
+
+DEPEND="sys-devel/qbe"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ default
+
+ rm -r "${S}/qbe" || die
+}
+
+src_configure() {
+ tc-export CC
+
+ edo ./configure --prefix=/usr
+}
diff --git a/sys-devel/cproc/cproc-9999.ebuild b/sys-devel/cproc/cproc-9999.ebuild
new file mode 100644
index 000000000000..163ffe80afba
--- /dev/null
+++ b/sys-devel/cproc/cproc-9999.ebuild
@@ -0,0 +1,39 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit edo toolchain-funcs
+
+if [[ ${PV} = 9999 ]]; then
+ EGIT_REPO_URI="https://git.sr.ht/~mcf/cproc"
+ inherit git-r3
+else
+ CPROC_COMMIT="6fabc79d81de56b6c1cdcc2242933fd792e2ddf9"
+ CPROC_P="${PN}-${CPROC_COMMIT}"
+ SRC_URI="https://git.sr.ht/~mcf/cproc/archive/${CPROC_COMMIT}.tar.gz -> ${CPROC_P}.tar.gz"
+ S="${WORKDIR}/${CPROC_P}"
+
+ KEYWORDS="~amd64 ~arm64 ~riscv"
+fi
+
+DESCRIPTION="C11 compiler using QBE as backend"
+HOMEPAGE="https://sr.ht/~mcf/cproc/"
+
+LICENSE="ISC"
+SLOT="0"
+
+DEPEND="sys-devel/qbe"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ default
+
+ rm -r "${S}/qbe" || die
+}
+
+src_configure() {
+ tc-export CC
+
+ edo ./configure --prefix=/usr
+}
diff --git a/sys-devel/cproc/metadata.xml b/sys-devel/cproc/metadata.xml
new file mode 100644
index 000000000000..507ef71566c5
--- /dev/null
+++ b/sys-devel/cproc/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" proxied="yes">
+ <email>contact@hacktivis.me</email>
+ <name>Haelwenn (lanodan) Monnier</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourcehut">~mcf/cproc</remote-id>
+ <remote-id type="github">michaelforney/cproc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/crossdev/Manifest b/sys-devel/crossdev/Manifest
index a855b5bb440f..b2e88d73c28e 100644
--- a/sys-devel/crossdev/Manifest
+++ b/sys-devel/crossdev/Manifest
@@ -1,4 +1 @@
-DIST crossdev-20210621.tar.xz 28588 BLAKE2B 33ff6069c85cbcff6bf34bf5f6dd8050bd5f9d34e3478c0200965dffd4cee46e71acf4210f533c9b22fd6fe979fa5f447d30b5aaa3a6fc0845b201a80dcb28d8 SHA512 8f8bed6ce53503fa4c2bbce4327d8e1d5ce8edab5ff698f11f312007912a2d73be56242269f798bb633ad3648f6cf936e00e019c05e5781b523059befc26f42c
-DIST crossdev-20210718.tar.xz 28640 BLAKE2B 1e9b9313a5c9a1cb4d82f00e4979794d61b9eaa0035c575ac55092c6c015d820a590c5816d212a4ffad95b96a3dd99a9b94ca7c20b78a7d7b062f16dec6ed329 SHA512 e1a37aebf759abaa30f071f43a528f9059b83456e71fd86fc8202a7eff5c506c1f34fdd260c7b91a03f491b9f2a107ce6a65c2314845a352176fcc5a27a766e2
-DIST crossdev-20211027.tar.xz 28752 BLAKE2B 058d6254c702709c18cc426fe15d7a11cb856336236837a15c0b2cb0c2389198f8b0ea9893e7cdadd6ecdabb3e75c05b64c22448324ce2ea86032cb57e92a5d9 SHA512 6c15d71fb551dcb5cb8e95d7e3b1ecb52b34e47335842408da5acc9d258c1a5fa7e4699681b9b414b1b444df98601aa8b99b2000700485ec6028c076abeafd03
-DIST crossdev-20211121.tar.xz 28700 BLAKE2B bfe637dcd3c5b6d45e289d6298de18cab4b70b5d21a817a9207b91360b489457b9ee10266a1c2641f8dfac09dffb166bf1565a7e519ba41f84c6d5c2000f5158 SHA512 5189fa7639b819dfffc8f994bb557d8d83f115b82cd61d938db77fdcf16a33cc9d0147f9708b3bed22fdc4ace27ac863436813ebad94876ae767172ac0cbb9ce
+DIST crossdev-20240209.tar.xz 30904 BLAKE2B b23c6c86796ce37968ce23a9399b068ecb78d6beb8e9b02ac11cd9e8b2f1c82f8905e615417525aa94d51f5da763841a8b9fc7cdc9b64d087a52b077adc92635 SHA512 5834cad934707f173529d7258f8230222e8d18903dea723b0051e06a8d974cab92f6aa7bbeef3a64aec0efd2d0b01f80b63503e78e30ddc1ba7e9a6a4ff08977
diff --git a/sys-devel/crossdev/crossdev-20210621.ebuild b/sys-devel/crossdev/crossdev-20210621.ebuild
deleted file mode 100644
index 59140a11c278..000000000000
--- a/sys-devel/crossdev/crossdev-20210621.ebuild
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-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/~sam/distfiles/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-fi
-
-DESCRIPTION="Gentoo Cross-toolchain generator"
-HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Crossdev"
-
-LICENSE="GPL-2"
-SLOT="0"
-
-RDEPEND="
- >=sys-apps/portage-2.1
- >=app-portage/portage-utils-0.55
- app-shells/bash
- sys-apps/gentoo-functions
-"
-BDEPEND="app-arch/xz-utils"
-
-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-20210718.ebuild b/sys-devel/crossdev/crossdev-20210718.ebuild
deleted file mode 100644
index b7f11a2c01de..000000000000
--- a/sys-devel/crossdev/crossdev-20210718.ebuild
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-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/~sam/distfiles/${P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-fi
-
-DESCRIPTION="Gentoo Cross-toolchain generator"
-HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Crossdev"
-
-LICENSE="GPL-2"
-SLOT="0"
-
-RDEPEND="
- >=sys-apps/portage-2.1
- >=app-portage/portage-utils-0.55
- app-shells/bash
- sys-apps/gentoo-functions
-"
-BDEPEND="app-arch/xz-utils"
-
-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-20211027.ebuild b/sys-devel/crossdev/crossdev-20211027.ebuild
deleted file mode 100644
index 0c2fe30139d5..000000000000
--- a/sys-devel/crossdev/crossdev-20211027.ebuild
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="8"
-
-if [[ ${PV} == "99999999" ]] ; then
- inherit git-r3
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/crossdev.git"
-else
- SRC_URI="mirror://gentoo/${P}.tar.xz
- https://dev.gentoo.org/~sam/distfiles/${P}.tar.xz
- https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-fi
-
-DESCRIPTION="Gentoo Cross-toolchain generator"
-HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Crossdev"
-
-LICENSE="GPL-2"
-SLOT="0"
-
-RDEPEND="
- >=sys-apps/portage-2.1
- >=app-portage/portage-utils-0.55
- app-shells/bash
- sys-apps/gentoo-functions
-"
-BDEPEND="app-arch/xz-utils"
-
-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-20211121.ebuild b/sys-devel/crossdev/crossdev-20240209.ebuild
index 864061acd24b..060ebf803d66 100644
--- a/sys-devel/crossdev/crossdev-20211121.ebuild
+++ b/sys-devel/crossdev/crossdev-20240209.ebuild
@@ -1,16 +1,17 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
if [[ ${PV} == "99999999" ]] ; then
inherit git-r3
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/crossdev.git"
+ EGIT_REPO_URI="
+ https://anongit.gentoo.org/git/proj/crossdev.git
+ https://github.com/gentoo/crossdev
+ "
else
- SRC_URI="mirror://gentoo/${P}.tar.xz
- https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz
- https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
DESCRIPTION="Gentoo Cross-toolchain generator"
@@ -21,16 +22,19 @@ SLOT="0"
RDEPEND="
>=sys-apps/portage-2.1
- >=app-portage/portage-utils-0.55
app-shells/bash
sys-apps/gentoo-functions
+ sys-apps/config-site
"
BDEPEND="app-arch/xz-utils"
src_install() {
default
- if [[ "${PV}" == "99999999" ]] ; then
+ if [[ ${PV} == "99999999" ]] ; then
sed -i "s:@CDEVPV@:${EGIT_VERSION}:" "${ED}"/usr/bin/crossdev || die
fi
+
+ dodir /usr/share/config.site.d
+ mv "${ED}"/usr/share/config.site{,.d/80crossdev.conf} || die
}
diff --git a/sys-devel/crossdev/crossdev-99999999.ebuild b/sys-devel/crossdev/crossdev-99999999.ebuild
index 864061acd24b..8938d96f9d54 100644
--- a/sys-devel/crossdev/crossdev-99999999.ebuild
+++ b/sys-devel/crossdev/crossdev-99999999.ebuild
@@ -1,16 +1,17 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
if [[ ${PV} == "99999999" ]] ; then
inherit git-r3
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/crossdev.git"
+ EGIT_REPO_URI="
+ https://anongit.gentoo.org/git/proj/crossdev.git
+ https://github.com/gentoo/crossdev
+ "
else
- SRC_URI="mirror://gentoo/${P}.tar.xz
- https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz
- https://dev.gentoo.org/~vapier/dist/${P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
DESCRIPTION="Gentoo Cross-toolchain generator"
@@ -21,16 +22,19 @@ SLOT="0"
RDEPEND="
>=sys-apps/portage-2.1
- >=app-portage/portage-utils-0.55
app-shells/bash
sys-apps/gentoo-functions
+ sys-apps/config-site
"
BDEPEND="app-arch/xz-utils"
src_install() {
default
- if [[ "${PV}" == "99999999" ]] ; then
+ if [[ ${PV} == "99999999" ]] ; then
sed -i "s:@CDEVPV@:${EGIT_VERSION}:" "${ED}"/usr/bin/crossdev || die
fi
+
+ dodir /usr/share/config.site.d
+ mv "${ED}"/usr/share/config.site{,.d/80crossdev.conf} || die
}
diff --git a/sys-devel/crossdev/metadata.xml b/sys-devel/crossdev/metadata.xml
index 00b311f5513d..d4d3daf6c1ae 100644
--- a/sys-devel/crossdev/metadata.xml
+++ b/sys-devel/crossdev/metadata.xml
@@ -1,12 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="project">
- <email>crossdev@gentoo.org</email>
- <name>Gentoo Crossdev Team</name>
- </maintainer>
- <maintainer type="project">
- <email>embedded@gentoo.org</email>
- <name>Embedded Gentoo</name>
- </maintainer>
+ <maintainer type="project">
+ <email>crossdev@gentoo.org</email>
+ <name>Gentoo Crossdev Team</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>embedded@gentoo.org</email>
+ <name>Embedded Gentoo</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="gentoo">proj/crossdev</remote-id>
+ <remote-id type="github">gentoo/crossdev</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/crosstool-ng/Manifest b/sys-devel/crosstool-ng/Manifest
new file mode 100644
index 000000000000..f02be9aa507f
--- /dev/null
+++ b/sys-devel/crosstool-ng/Manifest
@@ -0,0 +1,3 @@
+DIST crosstool-ng-1.24.0.tar.xz 1622432 BLAKE2B e0f3f26083dd10a35ac79fc78debe98db7914f5d7fd710ed6b4c788a7a0d56e22d22966f186e8315ae99a6141d1d5b80686e86ad8b0549514a07dfda5913a348 SHA512 89b8794a4184ad4928750e29712ed4f194aa1d0b93768d67ff64f30c30f1b1e165647cafc6de94d68d3ef70e50446e544dad65aa36137511a32ee7a667dddfb4
+DIST crosstool-ng-1.25.0.tar.xz 1075688 BLAKE2B 4484b1a0b9ee65a927c1fc76e86087e48c4f27397c8ebc5a94cc1bbf78a66f4ab94fb54239943a9c710350bd65056e9f63c4138ff3c8f750a35b2a1bfaca6080 SHA512 e25b6fb577ce439592a889fe73bbde4109309e7fe154e7133fefaeb5522c97e3f96958941aa1bc86448fcecb6b4021ff793c595048f5ef8e5ecc75e9a48c0c45
+DIST crosstool-ng-1.26.0.tar.xz 1144720 BLAKE2B 68c38dca58a239bd2a7a4e0f0adfa0069d97aba632c8a8a70594a67bf1049f0576db2d20b8a6ac90b170c1a3d8245f952a949e4fd006abe1d5e54effbb8e100b SHA512 7834184ae5792fd347455f9f48fee826248dcb82d271954ed4304b1a18f63995ff8a2c3b817564dcf147ac7e16e02d779195b26d97eb57db27f1118a1837002a
diff --git a/sys-devel/crosstool-ng/crosstool-ng-1.24.0-r3.ebuild b/sys-devel/crosstool-ng/crosstool-ng-1.24.0-r3.ebuild
new file mode 100644
index 000000000000..943dbb3f1893
--- /dev/null
+++ b/sys-devel/crosstool-ng/crosstool-ng-1.24.0-r3.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit python-single-r1
+
+DESCRIPTION="Versatile (cross-)toolchain generator"
+HOMEPAGE="https://crosstool-ng.github.io/"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/crosstool-ng/crosstool-ng.git"
+ inherit git-r3
+else
+ SRC_URI="
+ https://github.com/crosstool-ng/crosstool-ng/releases/download/${PN}-${PV/_rc/-rc}/${P}.tar.xz
+ http://crosstool-ng.org/download/crosstool-ng/${P}.tar.xz
+ "
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~amd64 ~x86"
+ fi
+fi
+
+LICENSE="GPL-2 doc? ( CC-BY-SA-2.5 )"
+SLOT="0"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+IUSE="curl cvs doc dtc git lzip meson ninja python rsync subversion wget"
+
+# TODO: Consider dropping these USE (optfeature), but configure does check for them
+BDEPEND="
+ app-arch/unzip
+ >=app-shells/bash-3.1
+ sys-apps/help2man
+ >=sys-apps/sed-4.0
+ sys-apps/gawk
+ sys-apps/texinfo
+ sys-devel/bison
+ sys-devel/flex
+ curl? ( net-misc/curl )
+ cvs? ( dev-vcs/cvs )
+ dtc? ( sys-apps/dtc )
+ git? ( dev-vcs/git )
+ lzip? ( app-arch/lzip )
+ meson? ( dev-build/meson )
+ python? ( ${PYTHON_DEPS} )
+ ninja? ( app-alternatives/ninja )
+ rsync? ( net-misc/rsync )
+ subversion? ( dev-vcs/subversion )
+ wget? ( net-misc/wget )
+"
+RDEPEND="
+ ${BDEPEND}
+"
+
+src_configure() {
+ # Needs bison+flex
+ unset YACC LEX
+
+ default
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if use doc ; then
+ mv "${ED}"/usr/share/doc/crosstool-ng/crosstool-ng-${PVR} "${ED}"/usr/share/doc/ || die
+ fi
+
+ rm -rf "${ED}"/usr/share/doc/crosstool-ng || die
+ rm -rf "${ED}"/usr/share/man/man1/ct-ng.1.gz || die
+ doman docs/ct-ng.1
+}
diff --git a/sys-devel/crosstool-ng/crosstool-ng-1.25.0-r1.ebuild b/sys-devel/crosstool-ng/crosstool-ng-1.25.0-r1.ebuild
new file mode 100644
index 000000000000..943dbb3f1893
--- /dev/null
+++ b/sys-devel/crosstool-ng/crosstool-ng-1.25.0-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit python-single-r1
+
+DESCRIPTION="Versatile (cross-)toolchain generator"
+HOMEPAGE="https://crosstool-ng.github.io/"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/crosstool-ng/crosstool-ng.git"
+ inherit git-r3
+else
+ SRC_URI="
+ https://github.com/crosstool-ng/crosstool-ng/releases/download/${PN}-${PV/_rc/-rc}/${P}.tar.xz
+ http://crosstool-ng.org/download/crosstool-ng/${P}.tar.xz
+ "
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~amd64 ~x86"
+ fi
+fi
+
+LICENSE="GPL-2 doc? ( CC-BY-SA-2.5 )"
+SLOT="0"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+IUSE="curl cvs doc dtc git lzip meson ninja python rsync subversion wget"
+
+# TODO: Consider dropping these USE (optfeature), but configure does check for them
+BDEPEND="
+ app-arch/unzip
+ >=app-shells/bash-3.1
+ sys-apps/help2man
+ >=sys-apps/sed-4.0
+ sys-apps/gawk
+ sys-apps/texinfo
+ sys-devel/bison
+ sys-devel/flex
+ curl? ( net-misc/curl )
+ cvs? ( dev-vcs/cvs )
+ dtc? ( sys-apps/dtc )
+ git? ( dev-vcs/git )
+ lzip? ( app-arch/lzip )
+ meson? ( dev-build/meson )
+ python? ( ${PYTHON_DEPS} )
+ ninja? ( app-alternatives/ninja )
+ rsync? ( net-misc/rsync )
+ subversion? ( dev-vcs/subversion )
+ wget? ( net-misc/wget )
+"
+RDEPEND="
+ ${BDEPEND}
+"
+
+src_configure() {
+ # Needs bison+flex
+ unset YACC LEX
+
+ default
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if use doc ; then
+ mv "${ED}"/usr/share/doc/crosstool-ng/crosstool-ng-${PVR} "${ED}"/usr/share/doc/ || die
+ fi
+
+ rm -rf "${ED}"/usr/share/doc/crosstool-ng || die
+ rm -rf "${ED}"/usr/share/man/man1/ct-ng.1.gz || die
+ doman docs/ct-ng.1
+}
diff --git a/sys-devel/crosstool-ng/crosstool-ng-1.26.0.ebuild b/sys-devel/crosstool-ng/crosstool-ng-1.26.0.ebuild
new file mode 100644
index 000000000000..943dbb3f1893
--- /dev/null
+++ b/sys-devel/crosstool-ng/crosstool-ng-1.26.0.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit python-single-r1
+
+DESCRIPTION="Versatile (cross-)toolchain generator"
+HOMEPAGE="https://crosstool-ng.github.io/"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/crosstool-ng/crosstool-ng.git"
+ inherit git-r3
+else
+ SRC_URI="
+ https://github.com/crosstool-ng/crosstool-ng/releases/download/${PN}-${PV/_rc/-rc}/${P}.tar.xz
+ http://crosstool-ng.org/download/crosstool-ng/${P}.tar.xz
+ "
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~amd64 ~x86"
+ fi
+fi
+
+LICENSE="GPL-2 doc? ( CC-BY-SA-2.5 )"
+SLOT="0"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+IUSE="curl cvs doc dtc git lzip meson ninja python rsync subversion wget"
+
+# TODO: Consider dropping these USE (optfeature), but configure does check for them
+BDEPEND="
+ app-arch/unzip
+ >=app-shells/bash-3.1
+ sys-apps/help2man
+ >=sys-apps/sed-4.0
+ sys-apps/gawk
+ sys-apps/texinfo
+ sys-devel/bison
+ sys-devel/flex
+ curl? ( net-misc/curl )
+ cvs? ( dev-vcs/cvs )
+ dtc? ( sys-apps/dtc )
+ git? ( dev-vcs/git )
+ lzip? ( app-arch/lzip )
+ meson? ( dev-build/meson )
+ python? ( ${PYTHON_DEPS} )
+ ninja? ( app-alternatives/ninja )
+ rsync? ( net-misc/rsync )
+ subversion? ( dev-vcs/subversion )
+ wget? ( net-misc/wget )
+"
+RDEPEND="
+ ${BDEPEND}
+"
+
+src_configure() {
+ # Needs bison+flex
+ unset YACC LEX
+
+ default
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if use doc ; then
+ mv "${ED}"/usr/share/doc/crosstool-ng/crosstool-ng-${PVR} "${ED}"/usr/share/doc/ || die
+ fi
+
+ rm -rf "${ED}"/usr/share/doc/crosstool-ng || die
+ rm -rf "${ED}"/usr/share/man/man1/ct-ng.1.gz || die
+ doman docs/ct-ng.1
+}
diff --git a/sys-devel/crosstool-ng/crosstool-ng-9999.ebuild b/sys-devel/crosstool-ng/crosstool-ng-9999.ebuild
new file mode 100644
index 000000000000..943dbb3f1893
--- /dev/null
+++ b/sys-devel/crosstool-ng/crosstool-ng-9999.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit python-single-r1
+
+DESCRIPTION="Versatile (cross-)toolchain generator"
+HOMEPAGE="https://crosstool-ng.github.io/"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/crosstool-ng/crosstool-ng.git"
+ inherit git-r3
+else
+ SRC_URI="
+ https://github.com/crosstool-ng/crosstool-ng/releases/download/${PN}-${PV/_rc/-rc}/${P}.tar.xz
+ http://crosstool-ng.org/download/crosstool-ng/${P}.tar.xz
+ "
+
+ if [[ ${PV} != *_rc* ]] ; then
+ KEYWORDS="~amd64 ~x86"
+ fi
+fi
+
+LICENSE="GPL-2 doc? ( CC-BY-SA-2.5 )"
+SLOT="0"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+IUSE="curl cvs doc dtc git lzip meson ninja python rsync subversion wget"
+
+# TODO: Consider dropping these USE (optfeature), but configure does check for them
+BDEPEND="
+ app-arch/unzip
+ >=app-shells/bash-3.1
+ sys-apps/help2man
+ >=sys-apps/sed-4.0
+ sys-apps/gawk
+ sys-apps/texinfo
+ sys-devel/bison
+ sys-devel/flex
+ curl? ( net-misc/curl )
+ cvs? ( dev-vcs/cvs )
+ dtc? ( sys-apps/dtc )
+ git? ( dev-vcs/git )
+ lzip? ( app-arch/lzip )
+ meson? ( dev-build/meson )
+ python? ( ${PYTHON_DEPS} )
+ ninja? ( app-alternatives/ninja )
+ rsync? ( net-misc/rsync )
+ subversion? ( dev-vcs/subversion )
+ wget? ( net-misc/wget )
+"
+RDEPEND="
+ ${BDEPEND}
+"
+
+src_configure() {
+ # Needs bison+flex
+ unset YACC LEX
+
+ default
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ if use doc ; then
+ mv "${ED}"/usr/share/doc/crosstool-ng/crosstool-ng-${PVR} "${ED}"/usr/share/doc/ || die
+ fi
+
+ rm -rf "${ED}"/usr/share/doc/crosstool-ng || die
+ rm -rf "${ED}"/usr/share/man/man1/ct-ng.1.gz || die
+ doman docs/ct-ng.1
+}
diff --git a/sys-devel/crosstool-ng/metadata.xml b/sys-devel/crosstool-ng/metadata.xml
new file mode 100644
index 000000000000..69260a3c3c18
--- /dev/null
+++ b/sys-devel/crosstool-ng/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <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 <pkg>sys-devel/crossdev</pkg>.
+
+ For more information, see https://crosstool-ng.github.io/
+ </longdescription>
+ <upstream>
+ <remote-id type="github">crosstool-ng/crosstool-ng</remote-id>
+ </upstream>
+ <use>
+ <flag name="dtc">Require <pkg>sys-apps/dtc</pkg></flag>
+ <flag name="lzip">Require <pkg>app-arch/lzip</pkg></flag>
+ <flag name="meson">Require <pkg>dev-build/meson</pkg></flag>
+ <flag name="ninja">Require <pkg>app-alternatives/ninja</pkg></flag>
+ <flag name="rsync">Require <pkg>net-misc/rsync</pkg></flag>
+ <flag name="wget">Require <pkg>net-misc/wget</pkg></flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/ct-ng/Manifest b/sys-devel/ct-ng/Manifest
deleted file mode 100644
index 169a86ae625d..000000000000
--- a/sys-devel/ct-ng/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST crosstool-ng-1.24.0.tar.bz2 2058069 BLAKE2B 4108e9546acd6c0660552595d41164ce9c4f07985851a911c260fcc9e2ec70e80136b6cb2090290ca2aa2ceeb4ebc61fca183340de88eafd800bc2bf18d0cfbb SHA512 379e668365628f0ab359ae119213bed44960870093f64f0fbb12e92bbe2a3b82bfed77f5ab33f2e2f17c1977e7a63f2151c46ad8d0e6208220fb7fa8726fae33
diff --git a/sys-devel/ct-ng/ct-ng-1.24.0.ebuild b/sys-devel/ct-ng/ct-ng-1.24.0.ebuild
deleted file mode 100644
index c43e112be440..000000000000
--- a/sys-devel/ct-ng/ct-ng-1.24.0.ebuild
+++ /dev/null
@@ -1,28 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-DESCRIPTION="crosstool-ng is a tool to build cross-compiling toolchains"
-HOMEPAGE="https://crosstool-ng.github.io/"
-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
- 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
deleted file mode 100644
index 7daea155e8ed..000000000000
--- a/sys-devel/ct-ng/metadata.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="person">
- <email>blueness@gentoo.org</email>
- <name>Anthony G. Basile</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/dev86-0.16.21-r3.ebuild b/sys-devel/dev86/dev86-0.16.21-r3.ebuild
index 2af636abe3e1..e3784e658bfb 100644
--- a/sys-devel/dev86/dev86-0.16.21-r3.ebuild
+++ b/sys-devel/dev86/dev86-0.16.21-r3.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -22,6 +22,7 @@ PATCHES=(
"${FILESDIR}/${PN}-0.16.19-fortify.patch"
"${FILESDIR}/${P}-non-void-return-clang.patch"
"${FILESDIR}/${PN}-0.16.21-make.patch"
+ "${FILESDIR}/${P}-void-return-check-msdos-clang-fix.patch"
)
src_prepare() {
diff --git a/sys-devel/dev86/files/dev86-0.16.21-void-return-check-msdos-clang-fix.patch b/sys-devel/dev86/files/dev86-0.16.21-void-return-check-msdos-clang-fix.patch
new file mode 100644
index 000000000000..39e3a1296c21
--- /dev/null
+++ b/sys-devel/dev86/files/dev86-0.16.21-void-return-check-msdos-clang-fix.patch
@@ -0,0 +1,20 @@
+--- a/bootblocks/makeboot.c 2020-11-30 00:28:40.383078094 +0300
++++ b/bootblocks/makeboot.c 2020-11-30 00:28:26.969025659 +0300
+@@ -183,6 +183,8 @@
+ unsigned char bpb_flags[100];
+ int has_bpb_overrides = 0;
+
++static void check_msdos();
++
+ main(argc, argv)
+ int argc;
+ char ** argv;
+@@ -1122,7 +1124,7 @@
+
+ /**************************************************************************/
+
+-check_msdos()
++static void check_msdos()
+ {
+ decode_super(buffer);
+ if( dosflds[DOS_CLUST].value == 0 ) /* MSDOS v1.0 */
diff --git a/sys-devel/dev86/metadata.xml b/sys-devel/dev86/metadata.xml
index 115e9d64a669..c4f5ea2afda9 100644
--- a/sys-devel/dev86/metadata.xml
+++ b/sys-devel/dev86/metadata.xml
@@ -2,4 +2,7 @@
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="github">lkundrak/dev86</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/distcc/Manifest b/sys-devel/distcc/Manifest
index f78dee9dc148..19f4116d75c4 100644
--- a/sys-devel/distcc/Manifest
+++ b/sys-devel/distcc/Manifest
@@ -1,2 +1 @@
-DIST distcc-3.3.3.tar.gz 1195666 BLAKE2B b393fdb20eb555dec794bf55c1287dd804a576e0a5db9f2fa84c3924a40185a193231aea807353918430297c9c83c7592aaaafd521cf73c92a72bf30b8a69caa SHA512 d5e7fc67f49ee640cef753038b5c0ebcbbac61c6ac29f20ee4736b045a89979ced765717c46383a4fadc50a4fe34e94e58e307509144414a9ca19eb4cc68a135
DIST distcc-3.4.tar.gz 1239519 BLAKE2B 8dc9baa6b1f65f2bb3621e4e643d7d15d55e2338de4d6a7f20a572d9ec280925b4421a294f40c9fcfba8d4193a6bd1871eb8caf13dd2c2a8a81834671f6bc8bc SHA512 de09329fdfa25e08a9b9529190ddaa9ceccb34c8655692edb86f367a8db4a71b750c6e928cb8e5a670f51fbbc02fd1c8524f72e01b3ebaacc1106dc676d18eef
diff --git a/sys-devel/distcc/distcc-3.4.ebuild b/sys-devel/distcc/distcc-3.4-r1.ebuild
index cb49de0fd3c1..482c5d36a63e 100644
--- a/sys-devel/distcc/distcc-3.4.ebuild
+++ b/sys-devel/distcc/distcc-3.4-r1.ebuild
@@ -1,12 +1,11 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{10..11} )
-inherit autotools flag-o-matic prefix python-single-r1 systemd \
- toolchain-funcs xdg-utils
+inherit autotools flag-o-matic prefix python-single-r1 systemd
DESCRIPTION="Distribute compilation of C code across several machines on a network"
HOMEPAGE="https://github.com/distcc/distcc"
@@ -14,7 +13,7 @@ SRC_URI="https://github.com/distcc/distcc/releases/download/v${PV}/${P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="gssapi gtk hardened ipv6 selinux xinetd zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
@@ -27,7 +26,7 @@ RDEPEND="${PYTHON_DEPS}
DEPEND="${RDEPEND}
sys-libs/binutils-libs"
BDEPEND="
- sys-devel/autoconf-archive
+ dev-build/autoconf-archive
virtual/pkgconfig"
RDEPEND+="
acct-user/distcc
@@ -40,6 +39,7 @@ src_prepare() {
eapply "${FILESDIR}/${PN}-3.0-xinetd.patch"
# SOCKSv5 support needed for Portage, bug #537616
eapply "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
+ eapply "${FILESDIR}/${PN}-3.4-pump-tests.patch"
eapply_user
# Bugs #120001, #167844 and probably more. See patch for description.
@@ -64,6 +64,9 @@ src_prepare() {
}
src_configure() {
+ # https://github.com/distcc/distcc/issues/454
+ append-cppflags -DPY_SSIZE_T_CLEAN
+
local myconf=(
--disable-Werror
--libdir="${EPREFIX}"/usr/lib
diff --git a/sys-devel/distcc/distcc-3.3.3-r3.ebuild b/sys-devel/distcc/distcc-3.4-r2.ebuild
index c535bb1a9fe3..8aeae8cfb6ff 100644
--- a/sys-devel/distcc/distcc-3.3.3-r3.ebuild
+++ b/sys-devel/distcc/distcc-3.4-r2.ebuild
@@ -1,12 +1,11 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{10..11} )
-inherit autotools flag-o-matic prefix python-single-r1 systemd \
- toolchain-funcs xdg-utils
+inherit autotools flag-o-matic prefix python-single-r1 systemd
DESCRIPTION="Distribute compilation of C code across several machines on a network"
HOMEPAGE="https://github.com/distcc/distcc"
@@ -14,20 +13,20 @@ SRC_URI="https://github.com/distcc/distcc/releases/download/v${PV}/${P}.tar.gz"
LICENSE="GPL-2+"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="gssapi gtk hardened ipv6 selinux xinetd zeroconf"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RDEPEND="${PYTHON_DEPS}
dev-libs/popt
gssapi? ( net-libs/libgssglue )
- gtk? ( x11-libs/gtk+:2 )
+ gtk? ( x11-libs/gtk+:3 )
zeroconf? ( >=net-dns/avahi-0.6[dbus] )
"
DEPEND="${RDEPEND}
sys-libs/binutils-libs"
BDEPEND="
- sys-devel/autoconf-archive
+ dev-build/autoconf-archive
virtual/pkgconfig"
RDEPEND+="
acct-user/distcc
@@ -38,16 +37,10 @@ RDEPEND+="
src_prepare() {
eapply "${FILESDIR}/${PN}-3.0-xinetd.patch"
- # bug #255188
- eapply "${FILESDIR}/${PN}-3.3.2-freedesktop.patch"
# SOCKSv5 support needed for Portage, bug #537616
eapply "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
- # backport py3.8 fixes
- eapply "${FILESDIR}/${P}-py38.patch"
- # gcc-10 fix, #707502
- eapply "${FILESDIR}/${P}-gcc-10-fix.patch"
- # unbreak CHOST prefix, https://bugs.gentoo.org/773652
- eapply "${FILESDIR}/${P}-no-rewrite-chost.patch"
+ eapply "${FILESDIR}/${PN}-3.4-pump-tests.patch"
+ eapply "${FILESDIR}/${P}-fix-dcc_gcc_rewrite_fqn-corruption.patch"
eapply_user
# Bugs #120001, #167844 and probably more. See patch for description.
@@ -72,9 +65,12 @@ src_prepare() {
}
src_configure() {
+ # https://github.com/distcc/distcc/issues/454
+ append-cppflags -DPY_SSIZE_T_CLEAN
+
local myconf=(
--disable-Werror
- --libdir=/usr/lib
+ --libdir="${EPREFIX}"/usr/lib
$(use_enable ipv6 rfc2553)
$(use_with gtk)
--without-gnome
diff --git a/sys-devel/distcc/distcc-3.4-r3.ebuild b/sys-devel/distcc/distcc-3.4-r3.ebuild
new file mode 100644
index 000000000000..aacc1981dc3e
--- /dev/null
+++ b/sys-devel/distcc/distcc-3.4-r3.ebuild
@@ -0,0 +1,186 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit autotools flag-o-matic prefix python-single-r1 systemd
+
+DESCRIPTION="Distribute compilation of C code across several machines on a network"
+HOMEPAGE="https://github.com/distcc/distcc"
+SRC_URI="https://github.com/distcc/distcc/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="gssapi gtk hardened ipv6 selinux xinetd zeroconf"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+ dev-libs/popt
+ gssapi? ( net-libs/libgssglue )
+ gtk? ( x11-libs/gtk+:3 )
+ zeroconf? ( >=net-dns/avahi-0.6[dbus] )
+"
+DEPEND="${RDEPEND}
+ sys-libs/binutils-libs"
+BDEPEND="
+ dev-build/autoconf-archive
+ virtual/pkgconfig"
+RDEPEND+="
+ acct-user/distcc
+ dev-util/shadowman
+ >=sys-devel/gcc-config-1.4.1
+ selinux? ( sec-policy/selinux-distcc )
+ xinetd? ( sys-apps/xinetd )"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.0-xinetd.patch"
+ # SOCKSv5 support needed for Portage, bug #537616
+ "${FILESDIR}/${PN}-3.2_rc1-socks5.patch"
+ "${FILESDIR}/${PN}-3.4-pump-tests.patch"
+ "${FILESDIR}/${P}-fix-dcc_gcc_rewrite_fqn-corruption.patch"
+ "${FILESDIR}/${P}-rewrite-chost.patch"
+)
+
+src_prepare() {
+ default
+
+ # 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}/usr/lib/distcc/bin:" \
+ -e "s:@PYTHON@:${EPYTHON}:" \
+ pump.in || die "sed failed"
+
+ sed \
+ -e "s:@EPREFIX@:${EPREFIX:-/}:" \
+ -e "s:@libdir@:/usr/lib:" \
+ "${FILESDIR}/distcc-config" > "${T}/distcc-config" || die
+
+ # TODO: gdb tests fail due to gdb failing to find .c file
+ sed -i -e '/Gdb.*Case,/d' test/testdistcc.py || die
+
+ hprefixify update-distcc-symlinks.py src/{serve,daemon}.c
+ python_fix_shebang update-distcc-symlinks.py "${T}/distcc-config"
+ eautoreconf
+}
+
+src_configure() {
+ # https://github.com/distcc/distcc/issues/454
+ append-cppflags -DPY_SSIZE_T_CLEAN
+
+ local myconf=(
+ --disable-Werror
+ --libdir="${EPREFIX}"/usr/lib
+ $(use_enable ipv6 rfc2553)
+ $(use_with gtk)
+ --without-gnome
+ $(use_with gssapi auth)
+ $(use_with zeroconf avahi)
+ )
+
+ econf "${myconf[@]}"
+}
+
+src_test() {
+ # sandbox breaks some tests, and hangs some too
+ # retest once #590084 is fixed
+ local -x SANDBOX_ON=0
+ emake -j1 check
+}
+
+src_install() {
+ # override GZIP_BIN to stop it from compressing manpages
+ emake -j1 DESTDIR="${D}" GZIP_BIN=false install
+ python_optimize
+
+ newinitd "${FILESDIR}/distccd.initd" distccd
+ systemd_newunit "${FILESDIR}/distccd.service-1" distccd.service
+ systemd_install_serviced "${FILESDIR}/distccd.service.conf"
+
+ cp "${FILESDIR}/distccd.confd" "${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"
+
+ newenvd - 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
+
+ keepdir /usr/lib/distcc
+
+ dobin "${T}/distcc-config"
+
+ 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
+
+ insinto /usr/share/shadowman/tools
+ newins - distcc <<<"${EPREFIX}/usr/lib/distcc/bin"
+ newins - distccd <<<"${EPREFIX}/usr/lib/distcc"
+
+ rm -r "${ED}/etc/default" || die
+ rm "${ED}/etc/distcc/clients.allow" || die
+ rm "${ED}/etc/distcc/commands.allow.sh" || die
+}
+
+pkg_postinst() {
+ # remove the old paths when switching from libXX to lib
+ if [[ $(get_libdir) != lib && ${SYMLINK_LIB} != yes && \
+ -d ${EROOT}/usr/$(get_libdir)/distcc ]]; then
+ rm -r -f "${EROOT}/usr/$(get_libdir)/distcc" || die
+ fi
+
+ if [[ -z ${ROOT} ]]; then
+ eselect compiler-shadow update distcc
+ eselect compiler-shadow update distccd
+ fi
+
+ elog
+ elog "Tips on using distcc with Gentoo can be found at"
+ elog "https://wiki.gentoo.org/wiki/Distcc"
+ elog
+ elog "distcc-pump is known to cause breakage with multiple packages."
+ elog "Do NOT enable it globally."
+ 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 gtk; then
+ elog "Or:"
+ elog "# DISTCC_DIR=\"${DISTCC_DIR:-${BUILD_PREFIX}/.distcc}\" distccmon-gnome"
+ fi
+}
+
+pkg_prerm() {
+ if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]]; then
+ eselect compiler-shadow remove distcc
+ fi
+}
diff --git a/sys-devel/distcc/files/distcc-3.3.2-freedesktop.patch b/sys-devel/distcc/files/distcc-3.3.2-freedesktop.patch
deleted file mode 100644
index 7b735ebec7f9..000000000000
--- a/sys-devel/distcc/files/distcc-3.3.2-freedesktop.patch
+++ /dev/null
@@ -1,112 +0,0 @@
-From d852c808d6f470031f40edec9ebe980afc69b9b9 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sat, 8 Dec 2018 12:50:07 +0100
-Subject: [PATCH] Fix desktop spec compliance of distccmon-gnome install
-
----
- Makefile.in | 18 ++++++++++--------
- gnome/distccmon-gnome.desktop | 7 +++----
- ...mon-gnome-icon.png => distccmon-gnome.png} | Bin
- src/mon-gnome.c | 2 +-
- 4 files changed, 14 insertions(+), 13 deletions(-)
- rename gnome/{distccmon-gnome-icon.png => distccmon-gnome.png} (100%)
-
-diff --git a/Makefile.in b/Makefile.in
-index 6e1e467..1106559 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -52,13 +52,14 @@ mandir = @mandir@
- includedir = @includedir@
- oldincludedir = /usr/include
- docdir = @docdir@
--pkgdatadir = $(datadir)/@PACKAGE_NAME@
-+icondir = $(datarootdir)/pixmaps
-+desktopdir = $(datarootdir)/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 = -DLIBDIR="\"${libdir}\"" -DSYSCONFDIR="\"${sysconfdir}\"" -DPKGDATADIR="\"${pkgdatadir}\""
-+DIR_DEFS = -DLIBDIR="\"${libdir}\"" -DSYSCONFDIR="\"${sysconfdir}\"" -DICONDIR="\"${icondir}\""
-
- # arguments to pkgconfig
- GNOME_PACKAGES = @GNOME_PACKAGES@
-@@ -387,7 +388,7 @@ man_HTML = man/distcc_1.html man/distccd_1.html man/distccmon_text_1.html \
- man/lsdistcc_1.html man/pump_1.html man/include_server_1.html
- MEN = $(man1_MEN)
-
--gnome_data = gnome/distccmon-gnome-icon.png \
-+gnome_data = gnome/distccmon-gnome.png \
- gnome/distccmon-gnome.desktop
-
- popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
-@@ -1033,7 +1034,8 @@ showpaths:
- @echo " programs $(DESTDIR)$(bindir)"
- @echo " sbin programs $(DESTDIR)$(sbindir)"
- @echo " system configuration $(DESTDIR)$(sysconfdir)"
-- @echo " shared data files $(DESTDIR)$(pkgdatadir)"
-+ @echo " icon file $(DESTDIR)$(icondir)"
-+ @echo " application file $(DESTDIR)$(desktopdir)"
-
-
- # install-sh can't handle multiple arguments, but we don't need any
-@@ -1129,10 +1131,10 @@ install-example: $(example_DOCS)
- 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.png "$(DESTDIR)$(icondir)"
-+ $(INSTALL_DATA) gnome/distccmon-gnome.desktop "$(DESTDIR)$(desktopdir)"
-
- install-conf: $(conf_files) $(default_files)
- $(mkinstalldirs) "$(DESTDIR)$(sysconfdir)/distcc"
-diff --git a/gnome/distccmon-gnome.desktop b/gnome/distccmon-gnome.desktop
-index bd1fa26..7205f5e 100644
---- a/gnome/distccmon-gnome.desktop
-+++ b/gnome/distccmon-gnome.desktop
-@@ -1,6 +1,5 @@
- [Desktop Entry]
--Version=0.9.4
--Encoding=UTF-8
-+Version=1.0
- Exec=distccmon-gnome
- Name=distcc monitor
- Name[sv]=distcc övervakare
-@@ -8,9 +7,9 @@ GenericName=Distributed Compile Monitor
- 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
- TryExec=distccmon-gnome
- Terminal=false
- Type=Application
--Categories=GNOME;Application;Development;
-+Categories=GNOME;GTK;Development;
- StartupNotify=true
-diff --git a/gnome/distccmon-gnome-icon.png b/gnome/distccmon-gnome.png
-similarity index 100%
-rename from gnome/distccmon-gnome-icon.png
-rename to gnome/distccmon-gnome.png
-diff --git a/src/mon-gnome.c b/src/mon-gnome.c
-index 24681d0..bfc286d 100644
---- a/src/mon-gnome.c
-+++ b/src/mon-gnome.c
-@@ -599,7 +599,7 @@ static GtkWidget * dcc_gnome_make_mainwin (void)
-
- #if GTK_CHECK_VERSION(2,2,0)
- gtk_window_set_icon_from_file (GTK_WINDOW (mainwin),
-- PKGDATADIR "/distccmon-gnome-icon.png",
-+ ICONDIR "/distccmon-gnome.png",
- NULL);
- #endif
-
---
-2.20.0.rc2
-
diff --git a/sys-devel/distcc/files/distcc-3.3.3-gcc-10-fix.patch b/sys-devel/distcc/files/distcc-3.3.3-gcc-10-fix.patch
deleted file mode 100644
index 2c0bce6c82b6..000000000000
--- a/sys-devel/distcc/files/distcc-3.3.3-gcc-10-fix.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 377969cc762569f4a5ec409a1e7ad6a7be3e51b3 Mon Sep 17 00:00:00 2001
-From: Romain Geissler <romain.geissler@amadeus.com>
-Date: Mon, 27 Jan 2020 09:28:43 +0000
-Subject: [PATCH] Fix build with gcc 10 which defaults to -fno-common (cf
- https://gcc.gnu.org/gcc-10/porting_to.html)
-
-This fixes the following link error I see when I use the latest gcc 10
-git branch:
-/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/serve.o:(.bss+0x0): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
-/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/stats.o:(.data+0x20): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
-collect2: error: ld returned 1 exit status
----
- src/stats.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/stats.h b/src/stats.h
-index 9bde285..74d4690 100644
---- a/src/stats.h
-+++ b/src/stats.h
-@@ -33,7 +33,7 @@ enum stats_e { STATS_TCP_ACCEPT, STATS_REJ_BAD_REQ, STATS_REJ_OVERLOAD,
- STATS_COMPILE_OK, STATS_COMPILE_ERROR, STATS_COMPILE_TIMEOUT,
- STATS_CLI_DISCONN, STATS_OTHER, STATS_ENUM_MAX };
-
--const char *stats_text[20];
-+extern const char *stats_text[20];
-
- int dcc_stats_init(void);
- void dcc_stats_init_kid(void);
diff --git a/sys-devel/distcc/files/distcc-3.3.3-no-rewrite-chost.patch b/sys-devel/distcc/files/distcc-3.3.3-no-rewrite-chost.patch
deleted file mode 100644
index dafaa90759b4..000000000000
--- a/sys-devel/distcc/files/distcc-3.3.3-no-rewrite-chost.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From c2471d4cf3e2ef2556c150d52860b4e8f04e4994 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
-Date: Mon, 1 Mar 2021 22:13:36 +0200
-Subject: [PATCH] distcc: fix i686 cross compile
-
-[mgorny: disable toolchain prefix rewriting code that workarounds some
- Debian invention and breaks everything else]
-
----
- src/compile.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/compile.c b/src/compile.c
-index 25df355..e5d655b 100644
---- a/src/compile.c
-+++ b/src/compile.c
-@@ -572,7 +572,7 @@ static int dcc_gcc_rewrite_fqn(char **argv)
- if (!newcmd)
- return -ENOMEM;
-
-- if ((t = strstr(target_with_vendor, "-pc-"))) {
-+ if (0 && (t = strstr(target_with_vendor, "-pc-"))) {
- memcpy(newcmd, target_with_vendor, t - target_with_vendor);
- strcat(newcmd, t + strlen("-pc"));
- } else
---
-2.26.2
-
diff --git a/sys-devel/distcc/files/distcc-3.3.3-py38.patch b/sys-devel/distcc/files/distcc-3.3.3-py38.patch
deleted file mode 100644
index 1ba5fee7d87e..000000000000
--- a/sys-devel/distcc/files/distcc-3.3.3-py38.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From c52a023b8a17e4346c66a8fddee69b40b327eae7 Mon Sep 17 00:00:00 2001
-From: MartB <mart.b@outlook.de>
-Date: Thu, 28 Nov 2019 21:00:59 +0100
-Subject: [PATCH] Replace time.clock() with time.perf_counter()
-
-.clock() got removed in python 3.8 and was marked as deprecated since 3.3
-(https://github.com/python/cpython/pull/13270)
----
- include_server/parse_file.py | 4 ++--
- include_server/statistics.py | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/include_server/parse_file.py b/include_server/parse_file.py
-index d1dcc74..f5d78b7 100755
---- a/include_server/parse_file.py
-+++ b/include_server/parse_file.py
-@@ -272,7 +272,7 @@ def Parse(self, filepath, symbol_table):
-
- assert isinstance(filepath, str)
- self.filepath = filepath
-- parse_file_start_time = time.clock()
-+ parse_file_start_time = time.perf_counter()
- statistics.parse_file_counter += 1
-
- includepath_map_index = self.includepath_map.Index
-@@ -338,6 +338,6 @@ def Parse(self, filepath, symbol_table):
- expr_includes, next_includes)
-
-
-- statistics.parse_file_total_time += time.clock() - parse_file_start_time
-+ statistics.parse_file_total_time += time.perf_counter() - parse_file_start_time
-
- return (quote_includes, angle_includes, expr_includes, next_includes)
-diff --git a/include_server/statistics.py b/include_server/statistics.py
-index 9677af3..7bc9cb8 100755
---- a/include_server/statistics.py
-+++ b/include_server/statistics.py
-@@ -62,13 +62,13 @@ def StartTiming():
- global start_time, translation_unit_counter
- """Mark the start of a request to find an include closure."""
- translation_unit_counter += 1
-- start_time = time.clock()
-+ start_time = time.perf_counter()
-
-
- def EndTiming():
- """Mark the end of an include closure calculation."""
- global translation_unit_time, min_time, max_time, total_time
-- translation_unit_time = time.clock() - start_time
-+ translation_unit_time = time.perf_counter() - start_time
- min_time = min(translation_unit_time, min_time)
- max_time = max(translation_unit_time, max_time)
- total_time += translation_unit_time
diff --git a/sys-devel/distcc/files/distcc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch b/sys-devel/distcc/files/distcc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch
new file mode 100644
index 000000000000..14c08db329d1
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.4-fix-dcc_gcc_rewrite_fqn-corruption.patch
@@ -0,0 +1,65 @@
+https://bugs.gentoo.org/904720
+https://github.com/distcc/distcc/commit/879b71d6e95673e58d33f6c3c341a893ee307161
+
+From 879b71d6e95673e58d33f6c3c341a893ee307161 Mon Sep 17 00:00:00 2001
+From: Alexey Sheplyakov <asheplyakov@yandex.ru>
+Date: Sat, 10 Jul 2021 22:18:14 +0400
+Subject: [PATCH] dcc_gcc_rewrite_fqn: avoid heap corruption
+
+On ALT Linux I've run into the following bug:
+
+distcc gcc -Wall -std=gnu89 -I. -O2 -o hello.o -c hello.c
+free(): invalid next size (fast)
+Aborted (core dumped)
+
+Apparently dcc_gcc_rewrite writes beyond the allocated memory:
+
+valgrind --leak-check=full -v ./distcc gcc -Wall -std=gnu89 -I. -O2 -o hello.o -c hello.c
+
+==11382== ERROR SUMMARY: 53 errors from 5 contexts (suppressed: 0 from 0)
+==11382==
+==11382== 1 errors in context 1 of 5:
+==11382== Invalid write of size 1
+==11382== at 0x4C349D8: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+==11382== by 0x10D165: dcc_gcc_rewrite_fqn (compile.c:611)
+==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725)
+==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014)
+==11382== by 0x10E380: main (distcc.c:352)
+==11382== Address 0x544e828 is 1 bytes after a block of size 23 alloc'd
+==11382== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+==11382== by 0x10D087: dcc_gcc_rewrite_fqn (compile.c:588)
+==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725)
+==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014)
+==11382== by 0x10E380: main (distcc.c:352)
+==11382==
+==11382==
+==11382== 1 errors in context 2 of 5:
+==11382== Invalid write of size 1
+==11382== at 0x4C349C8: strcat (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+==11382== by 0x10D165: dcc_gcc_rewrite_fqn (compile.c:611)
+==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725)
+==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014)
+==11382== by 0x10E380: main (distcc.c:352)
+==11382== Address 0x544e827 is 0 bytes after a block of size 23 alloc'd
+==11382== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
+==11382== by 0x10D087: dcc_gcc_rewrite_fqn (compile.c:588)
+==11382== by 0x10D4B4: dcc_build_somewhere (compile.c:725)
+==11382== by 0x10DC01: dcc_build_somewhere_timed (compile.c:1014)
+==11382== by 0x10E380: main (distcc.c:352)
+
+and ALT Linux' hardened glibc does not quite like that.
+Correctly compute the `newcmd_len` to avoid the problem.
+
+ALTBUG: #40425
+--- a/src/compile.c
++++ b/src/compile.c
+@@ -584,7 +584,7 @@ static int dcc_gcc_rewrite_fqn(char **argv)
+ return -ENOENT;
+
+
+- newcmd_len = strlen(target_with_vendor) + 1 + strlen(argv[0] + 1);
++ newcmd_len = strlen(target_with_vendor) + 1 + strlen(argv[0]) + 1;
+ newcmd = malloc(newcmd_len);
+ if (!newcmd)
+ return -ENOMEM;
+
diff --git a/sys-devel/distcc/files/distcc-3.4-pump-tests.patch b/sys-devel/distcc/files/distcc-3.4-pump-tests.patch
new file mode 100644
index 000000000000..db392b7f3632
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.4-pump-tests.patch
@@ -0,0 +1,153 @@
+https://github.com/distcc/distcc/pull/460
+
+From 45d9c4a1ef66451ed45a6afdec7098ed02082390 Mon Sep 17 00:00:00 2001
+From: Rosen Matev <rosen.matev@cern.ch>
+Date: Fri, 29 Apr 2022 15:42:28 +0200
+Subject: [PATCH] Fix tests in pump mode
+
+`make check` is also running tests for the pump mode
+(`pump-maintainer-check` target) but they were all falling back to
+the usual preprocessor mode as the include server was not started.
+
+This is solved by prepending `pump` to the distcc invocations and
+also some trivially failing tests are fixed or disabled when they
+make no sense in pump mode.
+---
+ Makefile.in | 2 +-
+ pump.in | 13 +++++++++++--
+ test/testdistcc.py | 28 ++++++++++++++++++++++++----
+ 3 files changed, 36 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index f240ca6f..79e28380 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -583,7 +583,7 @@ distccmon-gnome@EXEEXT@: $(mon_obj) $(gnome_obj)
+ # the distcc version, the source location, the CPP flags (for location of the
+ # includes), and the build location.
+ include-server:
+- if test -z "$(PYTHON)"; then \
++ @if test -z "$(PYTHON)"; then \
+ echo "Not building $@: No suitable python found"; \
+ else \
+ mkdir -p "$(include_server_builddir)" && \
+diff --git a/pump.in b/pump.in
+index 8e46f458..08a32c0e 100755
+--- a/pump.in
++++ b/pump.in
+@@ -218,7 +218,9 @@ PrintIncludeServerStatusMessage() {
+ }
+
+ Announce() {
+- echo "__________Using distcc-pump from $DISTCC_LOCATION"
++ if [ "$verbose" = 1 ]; then
++ echo "__________Using distcc-pump from $DISTCC_LOCATION"
++ fi
+ }
+
+ # Starts up the include server. Sets $socket, $socket_dir, and
+@@ -359,7 +361,9 @@ ShutDown() {
+ # Always -- at exit -- shut down include_server and remove $socket_dir
+ if [ -n "$include_server_pid" ] && \
+ ps -p "$include_server_pid" > /dev/null; then
+- echo '__________Shutting down distcc-pump include server'
++ if [ "$verbose" = 1 ]; then
++ echo '__________Shutting down distcc-pump include server'
++ fi
+ kill $include_server_pid
+ # Wait until it's really dead. We need to do this because the
+ # include server may produce output after receiving SIGTERM.
+@@ -508,6 +512,11 @@ Main() {
+
+ Initialize
+
++ # Do not write on stdout if we're testing pump mode
++ if [ "0$DISTCC_TESTING_INCLUDE_SERVER" -ne "0" ]; then
++ verbose=0
++ fi
++
+ case "$*" in
+ --startup)
+ # Don't put ordinary progress messages on stdout,
+diff --git a/test/testdistcc.py b/test/testdistcc.py
+index dfdf2f13..6377d0b6 100755
+--- a/test/testdistcc.py
++++ b/test/testdistcc.py
+@@ -258,7 +258,11 @@ def valgrind(self):
+ return _valgrind_command;
+
+ def distcc(self):
+- return self.valgrind() + "distcc "
++ if "cpp" not in _server_options:
++ return self.valgrind() + "distcc "
++ else:
++ return "DISTCC_TESTING_INCLUDE_SERVER=1 " + self.valgrind() + "pump distcc "
++
+
+ def distccd(self):
+ return self.valgrind() + "distccd "
+@@ -422,6 +426,11 @@ class BogusOption_Case(SimpleDistCC_Case):
+ Now that we support implicit compilers, this is passed to gcc,
+ which returns a non-zero status."""
+ def runtest(self):
++ # Disable the test in pump mode since the pump wrapper fails
++ # before we can run distcc.
++ if "cpp" in _server_options:
++ raise comfychair.NotRunError('pump wrapper expects DISTCC_HOSTS')
++
+ error_rc, _, _ = self.runcmd_unchecked(self._cc + " --bogus-option")
+ assert error_rc != 0
+ self.runcmd(self.distcc() + self._cc + " --bogus-option", error_rc)
+@@ -432,7 +441,7 @@ def runtest(self):
+ class CompilerOptionsPassed_Case(SimpleDistCC_Case):
+ """Test that options following the compiler name are passed to the compiler."""
+ def runtest(self):
+- out, err = self.runcmd("DISTCC_HOSTS=localhost "
++ out, err = self.runcmd("DISTCC_HOSTS=localhost%s " % _server_options
+ + self.distcc()
+ + self._cc + " --help")
+ if re.search('distcc', out):
+@@ -1422,7 +1431,8 @@ def source(self):
+
+ def setupEnv(self):
+ Compilation_Case.setupEnv(self)
+- os.environ['DISTCC_HOSTS'] = '127.0.0.1:%d,lzo' % self.server_port
++ os.environ['DISTCC_HOSTS'] = (
++ '127.0.0.1:%d,lzo' % self.server_port + _server_options)
+
+ class DashONoSpace_Case(CompileHello_Case):
+ def compileCmd(self):
+@@ -1525,6 +1535,11 @@ def source(self):
+ """
+
+ def runtest(self):
++ # Disable the test in pump mode since the pump wrapper fails
++ # before we can run distcc.
++ if "cpp" in _server_options:
++ raise comfychair.NotRunError('pump wrapper expects DISTCC_HOSTS')
++
+ # -P means not to emit linemarkers
+ self.runcmd(self.distcc()
+ + self._cc + " -E testtmp.c -o testtmp.out")
+@@ -1828,7 +1843,7 @@ class NoServer_Case(CompileHello_Case):
+ """Invalid server name"""
+ def setup(self):
+ self.stripEnvironment()
+- os.environ['DISTCC_HOSTS'] = 'no.such.host.here'
++ os.environ['DISTCC_HOSTS'] = 'no.such.host.here' + _server_options
+ self.distcc_log = 'distcc.log'
+ os.environ['DISTCC_LOG'] = self.distcc_log
+ self.createSource()
+@@ -1874,6 +1889,11 @@ class NoHosts_Case(CompileHello_Case):
+ We expect compilation to succeed, but with a warning that it was
+ run locally."""
+ def runtest(self):
++ # Disable the test in pump mode since the pump wrapper fails
++ # before we can run distcc.
++ if "cpp" in _server_options:
++ raise comfychair.NotRunError('pump wrapper expects DISTCC_HOSTS')
++
+ # WithDaemon_Case sets this to point to the local host, but we
+ # don't want that. Note that you cannot delete environment
+ # keys in Python1.5, so we need to just set them to the empty
+
diff --git a/sys-devel/distcc/files/distcc-3.4-rewrite-chost.patch b/sys-devel/distcc/files/distcc-3.4-rewrite-chost.patch
new file mode 100644
index 000000000000..05db9691bbbe
--- /dev/null
+++ b/sys-devel/distcc/files/distcc-3.4-rewrite-chost.patch
@@ -0,0 +1,79 @@
+https://bugs.gentoo.org/773652
+https://github.com/distcc/distcc/issues/440
+https://github.com/distcc/distcc/commit/850db9eec0d5dd7f47ade8ffca91b679081f6d85
+
+From 850db9eec0d5dd7f47ade8ffca91b679081f6d85 Mon Sep 17 00:00:00 2001
+From: Alexey Sheplyakov <asheplyakov@altlinux.org>
+Date: Sun, 11 Jul 2021 18:57:00 +0400
+Subject: [PATCH] Improved cross-rewriting on non-x86 systems
+
+Unfortunately autoconf and GCC don't agree on the system name:
+
+- On arm (aarch64): `GNU_HOST` is `aarch64-unknown-linux-gnu`,
+ and GCC triple is `aarch64-linux-gnu` instead.
+- On rpm-based x86_64 distros: `GNU_HOST` is `x86_64-pc-linux-gnu`,
+ and GCC triple is `x86_64-redhat-linux`
+
+Therefore ask the compiler (when running distcc configure script)
+how to correctly identify it.
+
+Closes: #440
+ALTBUG: 40425
+--- a/configure.ac
++++ b/configure.ac
+@@ -547,6 +547,22 @@ AC_SUBST(CPPFLAGS)
+ AC_SUBST(POPT_INCLUDES)
+ AC_SUBST(BUILD_POPT)
+ AC_SUBST(GNOME_BIN)
++
++
++# Sometimes canonical triples as used by configure differ from GCC ones
++# x86: configure: x86_64-pc-linux-gnu, GCC: x86_64-linux-gnu
++# ALT Linux: configure: ${arch}-alt-linux-gnu, GCC: ${arch}-alt-linux
++# Therefore ask the compiler for its triple
++if test "x${GCC}" = xyes ; then
++ native_compiler_triple=`$CC -dumpmachine`
++fi
++if test "x$native_compiler_triple" = "x"; then
++ native_compiler_triple="$host"
++fi
++AC_MSG_NOTICE([Native compiler triple: $native_compiler_triple])
++
++AC_DEFINE_UNQUOTED(NATIVE_COMPILER_TRIPLE, ["$native_compiler_triple"], [Native compiler triple])
++
+ AC_DEFINE_UNQUOTED(GNU_HOST, ["$host"], [Your gnu-style host triple])
+ # The '.stamp-conf' files force creation of the containing directories in the
+ # build tree.
+--- a/src/compile.c
++++ b/src/compile.c
+@@ -549,7 +549,7 @@ static void dcc_rewrite_generic_compiler(char **argv)
+ static void dcc_add_clang_target(char **argv)
+ {
+ /* defined by autoheader */
+- const char *target = GNU_HOST;
++ const char *target = NATIVE_COMPILER_TRIPLE;
+
+ if (strcmp(argv[0], "clang") == 0 || strncmp(argv[0], "clang-", strlen("clang-")) == 0 ||
+ strcmp(argv[0], "clang++") == 0 || strncmp(argv[0], "clang++-", strlen("clang++-")) == 0)
+@@ -577,7 +577,7 @@ static void dcc_add_clang_target(char **argv)
+ static int dcc_gcc_rewrite_fqn(char **argv)
+ {
+ /* defined by autoheader */
+- const char *target_with_vendor = GNU_HOST;
++ const char *target_with_vendor = NATIVE_COMPILER_TRIPLE;
+ char *newcmd, *t, *path;
+ int pathlen = 0;
+ int newcmd_len = 0;
+@@ -595,11 +595,7 @@ static int dcc_gcc_rewrite_fqn(char **argv)
+ return -ENOMEM;
+ memset(newcmd, 0, newcmd_len);
+
+- if ((t = strstr(target_with_vendor, "-pc-"))) {
+- memcpy(newcmd, target_with_vendor, t - target_with_vendor);
+- strcat(newcmd, t + strlen("-pc"));
+- } else
+- strcpy(newcmd, target_with_vendor);
++ strcpy(newcmd, target_with_vendor);
+
+
+ strcat(newcmd, "-");
diff --git a/sys-devel/distcc/metadata.xml b/sys-devel/distcc/metadata.xml
index 949da1a6e8db..8e23cf8fbb58 100644
--- a/sys-devel/distcc/metadata.xml
+++ b/sys-devel/distcc/metadata.xml
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://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>cluster@gentoo.org</email>
<name>Gentoo Cluster Project</name>
@@ -12,4 +8,7 @@
<use>
<flag name="gssapi">Enable support for <pkg>net-libs/libgssglue</pkg></flag>
</use>
+ <upstream>
+ <remote-id type="github">distcc/distcc</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/dwz/Manifest b/sys-devel/dwz/Manifest
index e46195dbc905..d770ee4adc0a 100644
--- a/sys-devel/dwz/Manifest
+++ b/sys-devel/dwz/Manifest
@@ -1 +1 @@
-DIST dwz-0.14.tar.xz 147428 BLAKE2B 286350a8276a1a674937a7adc99560562782044fd6caa50c9a55ec08343f34d8bd27140cca904e648859aba61d181e01ab0755f2115151fab16d498aa1549450 SHA512 62c39f79723ca99305dbb08d1d24a17699b9a84dd98c30904103da116831b1253bf1edbfb905c76fdc4d48305bd1ea0046314c5619209c40a1e624b8ae4908b1
+DIST dwz-0.15.tar.xz 150080 BLAKE2B 4ce1722a53cb588cda8195211a26b28d69891ed32cc59e44897270298d033590c79c8c73168dc3b261cb017fc12874a9cbd50db3bfaa0aa7de8ed7cf8a588cca SHA512 43eb4b08c1f529859dc3466697d5ad7e172d6efbf21409530a67a2492ae4acc3734d5134bbd6e07c089ecc358d915871b13e22f6e4f1dd4c3af19ef804f8fcc5
diff --git a/sys-devel/dwz/dwz-0.14.ebuild b/sys-devel/dwz/dwz-0.15-r1.ebuild
index 4ad7ab103878..07e6062f11f1 100644
--- a/sys-devel/dwz/dwz-0.14.ebuild
+++ b/sys-devel/dwz/dwz-0.15-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -13,20 +13,34 @@ S="${WORKDIR}/${PN}"
LICENSE="GPL-2+ GPL-3+"
SLOT="0"
-KEYWORDS="~amd64"
+KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86"
IUSE="test"
RESTRICT="!test? ( test )"
-RDEPEND="dev-libs/elfutils"
+RDEPEND="
+ dev-libs/elfutils
+ dev-libs/xxhash
+"
DEPEND="${RDEPEND}"
BDEPEND="test? (
dev-libs/elfutils[utils]
dev-util/dejagnu
- sys-devel/gdb
+ dev-debug/gdb
)"
src_prepare() {
default
- sed -e '/^CFLAGS/d' -i Makefile || die
tc-export CC
}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS}" srcdir="${S}"
+}
+
+src_test() {
+ emake CFLAGS="${CFLAGS}" srcdir="${S}" check
+}
+
+src_install() {
+ emake DESTDIR="${D}" CFLAGS="${CFLAGS}" srcdir="${S}" install
+}
diff --git a/sys-devel/dwz/metadata.xml b/sys-devel/dwz/metadata.xml
index 319c2d8312f8..c87f24a66212 100644
--- a/sys-devel/dwz/metadata.xml
+++ b/sys-devel/dwz/metadata.xml
@@ -1,13 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="person" proxied="yes">
- <email>annulen@yandex.ru</email>
- <name>Konstantin Tokarev</name>
- </maintainer>
- <maintainer type="project" proxied="proxy">
- <email>proxy-maint@gentoo.org</email>
- <name>Proxy Maintainers</name>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
</maintainer>
<longdescription>
The dwz package contains a program that attempts to optimize DWARF
diff --git a/sys-devel/elftoolchain/elftoolchain-0.7.1-r2.ebuild b/sys-devel/elftoolchain/elftoolchain-0.7.1-r2.ebuild
index 4eea87b1c581..a237b0a27ce2 100644
--- a/sys-devel/elftoolchain/elftoolchain-0.7.1-r2.ebuild
+++ b/sys-devel/elftoolchain/elftoolchain-0.7.1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -21,8 +21,8 @@ DEPEND="${RDEPEND}"
BDEPEND="
dev-vcs/subversion
sys-apps/lsb-release
- >=sys-devel/bmake-20210314-r1
- virtual/yacc"
+ >=dev-build/bmake-20210314-r1
+ app-alternatives/yacc"
PATCHES=( "${FILESDIR}"/${P}-fno-common.patch )
diff --git a/sys-devel/elftoolchain/elftoolchain-0.7.1_p20210319.ebuild b/sys-devel/elftoolchain/elftoolchain-0.7.1_p20210319.ebuild
index 5c427a1e2119..02c757f53f3e 100644
--- a/sys-devel/elftoolchain/elftoolchain-0.7.1_p20210319.ebuild
+++ b/sys-devel/elftoolchain/elftoolchain-0.7.1_p20210319.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -25,8 +25,8 @@ DEPEND="${RDEPEND}"
BDEPEND="
dev-vcs/subversion
sys-apps/lsb-release
- >=sys-devel/bmake-20210314-r1
- virtual/yacc"
+ >=dev-build/bmake-20210314-r1
+ app-alternatives/yacc"
src_prepare() {
default
diff --git a/sys-devel/flex/Manifest b/sys-devel/flex/Manifest
index 327f0405ede2..34ccf066269d 100644
--- a/sys-devel/flex/Manifest
+++ b/sys-devel/flex/Manifest
@@ -1 +1,2 @@
+DIST flex-2.6.4-autotools-regenerate.patch.xz 282588 BLAKE2B 3995b8b5e354a43b1a4ff72fae76027c904ddb24eb8e5d55fc6fbe81299f48fa70ac3c4a98b9ed39aca8a98190d6db5005cacb96ec1016d413860d84a434dcc0 SHA512 9efd3197fdf7f8435dfbf4dafbe6b99c1fafede0ec364dbeb9cca81711763d693bc5d30fc3b2af038a44f8848577d19dd737e3afe0cd3b08ab79daea64fcdefa
DIST flex-2.6.4.tar.gz 1419096 BLAKE2B c003d4f764f7f4d41e33af7ee28c2af272a9f0aee6ba7c2494ba96722d8d0b18f7a3f745217e9a2cecb43b6863328267a810280670c04464156b3eb3d7ee9d62 SHA512 e9785f3d620a204b7d20222888917dc065c2036cae28667065bf7862dfa1b25235095a12fd04efdbd09bfd17d3452e6b9ef953a8c1137862ff671c97132a082e
diff --git a/sys-devel/flex/files/flex-2.6.4-fix-apple-m1-crash-by-explicit-pointer-cast.patch b/sys-devel/flex/files/flex-2.6.4-fix-apple-m1-crash-by-explicit-pointer-cast.patch
new file mode 100644
index 000000000000..c594262d2cb0
--- /dev/null
+++ b/sys-devel/flex/files/flex-2.6.4-fix-apple-m1-crash-by-explicit-pointer-cast.patch
@@ -0,0 +1,48 @@
+https://github.com/westes/flex/issues/539
+https://github.com/westes/flex/pull/554
+https://bugs.gentoo.org/871324
+
+This is a backported version for applying to v2.6.4
+instead of git.
+
+From cce2df853386d5b5b60445b1204dcca08e9f259e Mon Sep 17 00:00:00 2001
+From: Yifeng Li <tomli@tomli.me>
+Date: Mon, 20 Feb 2023 11:23:52 +0000
+Subject: [PATCH] Fix #539 crash on Apple M1 by casting 0 to (char *)
+ explicitly
+
+Currently, when the NULL-terminated variadic function
+filter_create_ext() is invoked, the value "0" is passed as
+the last argument to act as a terminator. However, this is
+an integer value, which is incompatible with the pointer
+data type expected by filter_create_ext().
+
+This is undefined behavior in C, correct operation is not
+guaranteed. In fact, it causes flex to crash on Apple M1
+when GCC is used - the loop is not terminated when it should,
+instead, it keeps running, corrupting the argument list for
+invoking m4. As a result, it creates the following error:
+
+> flex: fatal internal error, exec of gm4 failed
+
+This commit fixes the problem by explicitly casting the value 0 to
+the correct pointer type (char *).
+
+Signed-off-by: Yifeng Li <tomli@tomli.me>
+---
+ src/main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/main.c b/src/main.c
+index e5eac44fe..5c9086183 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -380,7 +380,7 @@ void check_options (void)
+ }
+ }
+ }
+- filter_create_ext(output_chain, m4, "-P", 0);
++ filter_create_ext(output_chain, m4, "-P", (char *) 0);
+ filter_create_int(output_chain, filter_fix_linedirs, NULL);
+
+ /* For debugging, only run the requested number of filters. */
diff --git a/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.26.patch b/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.26.patch
new file mode 100644
index 000000000000..9a9de8746b89
--- /dev/null
+++ b/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.26.patch
@@ -0,0 +1,219 @@
+https://github.com/westes/flex/issues/436
+https://bugs.gentoo.org/705800
+https://developers.redhat.com/blog/2019/04/22/implicit-function-declarations-flexs-use-of-reallocarray
+https://github.com/westes/flex/commit/4b5111d9772b5c160340ca96f08d30d7f6db5cda
+https://github.com/westes/flex/commit/24fd0551333e7eded87b64dd36062da3df2f6380
+https://github.com/westes/flex/commit/0db9f8903a446e7026874be519b8dc55a471f014
+https://github.com/westes/flex/commit/a17d79e9c722a6735b6d2a8f152287404f27df32
+https://github.com/westes/flex/commit/4081efa0831b15d7e4e4255401c225ad8262426d
+https://github.com/westes/flex/commit/1985bb3c7abed940e91ad816504ef08a18c3b7c1
+
+From 4b5111d9772b5c160340ca96f08d30d7f6db5cda Mon Sep 17 00:00:00 2001
+From: Explorer09 <explorer09@gmail.com>
+Date: Mon, 4 Sep 2017 08:28:53 +0800
+Subject: [PATCH] scanner: Include flexdef.h at %top block of scan.l
+
+config.h may define macros that alter the API of the standard library
+funtions, and so it should be included before any other standard
+header, even before the skeleton's standard header inclusion.
+
+For example: config.h may #define _GNU_SOURCE that would expose the
+reallocarray() prototype from <stdlib.h> on glibc 2.26+ systems. If we
+include <stdlib.h> before config.h, reallocarray() would not be
+available for use in lex file since the second include doesn't help
+due to header guard.
+
+For now our config.h might `#define malloc rpl_malloc` -- this
+substitution must work before including stdlib.h, or else the compiler
+will complain about missing prototypes, and may result in incorrect
+code in scan.l (gcc warning: return makes pointer from integer without
+a cast [-Wint-conversion]).
+
+Fixes #247.
+--- a/src/scan.l
++++ b/src/scan.l
+@@ -1,5 +1,11 @@
+ /* scan.l - scanner for flex input -*-C-*- */
+
++%top{
++/* flexdef.h includes config.h, which may contain macros that alter the API */
++/* of libc functions. Must include first before any libc header. */
++#include "flexdef.h"
++}
++
+ %{
+ /* Copyright (c) 1990 The Regents of the University of California. */
+ /* All rights reserved. */
+@@ -32,7 +38,6 @@
+ /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
+ /* PURPOSE. */
+
+-#include "flexdef.h"
+ #include "parse.h"
+ extern bool tablesverify, tablesext;
+ extern int trlcontxt; /* Set in parse.y for each rule. */
+
+From 24fd0551333e7eded87b64dd36062da3df2f6380 Mon Sep 17 00:00:00 2001
+From: Explorer09 <explorer09@gmail.com>
+Date: Mon, 4 Sep 2017 10:47:33 +0800
+Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac.
+
+This would, e.g. define _GNU_SOURCE in config.h, enabling the
+reallocarray() prototype in glibc 2.26+ on Linux systems with that
+version of glibc.
+
+Fixes #241.
+--- a/configure.ac
++++ b/configure.ac
+@@ -25,8 +25,10 @@
+ # autoconf requirements and initialization
+
+ AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
++AC_PREREQ([2.60])
+ AC_CONFIG_SRCDIR([src/scan.l])
+ AC_CONFIG_AUX_DIR([build-aux])
++AC_USE_SYSTEM_EXTENSIONS
+ LT_INIT
+ AM_INIT_AUTOMAKE([1.15 -Wno-portability foreign std-options dist-lzip parallel-tests subdir-objects])
+ AC_CONFIG_HEADER([src/config.h])
+
+
+From 0db9f8903a446e7026874be519b8dc55a471f014 Mon Sep 17 00:00:00 2001
+From: Lukasz Baj <l.baj@radytek.com>
+Date: Fri, 22 Sep 2017 10:24:46 +0200
+Subject: [PATCH] build: Remove custom reallocarray() declaration.
+
+Use one from <stdlib.h> instead because that is more portable.
+--- a/src/flexdef.h
++++ b/src/flexdef.h
+@@ -631,10 +631,6 @@ extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
+ extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
+ extern int num_backing_up, bol_needed;
+
+-#ifndef HAVE_REALLOCARRAY
+-void *reallocarray(void *, size_t, size_t);
+-#endif
+-
+ void *allocate_array(int, size_t);
+ void *reallocate_array(void *, int, size_t);
+
+
+From a17d79e9c722a6735b6d2a8f152287404f27df32 Mon Sep 17 00:00:00 2001
+From: Explorer09 <explorer09@gmail.com>
+Date: Sat, 14 Oct 2017 00:36:54 +0800
+Subject: [PATCH] scanner: Define _POSIX_C_SOURCE when needed in skeleton.
+
+The function fileno() is defined by POSIX. When flex would otherwise not provide that feature macro, we define it.
+
+Fixes #263
+--- a/src/flex.skl
++++ b/src/flex.skl
+@@ -218,6 +218,14 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
+
+ /* begin standard C headers. */
+ %if-c-only
++m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]], ,
++[[m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]], ,
++[[#ifndef _POSIX_C_SOURCE
++#define _POSIX_C_SOURCE 1 /* for fileno() */
++#ifndef _POSIX_SOURCE
++#define _POSIX_SOURCE 1
++#endif
++#endif]])]])
+ #include <stdio.h>
+ #include <string.h>
+ #include <errno.h>
+
+From 4081efa0831b15d7e4e4255401c225ad8262426d Mon Sep 17 00:00:00 2001
+From: Explorer09 <explorer09@gmail.com>
+Date: Thu, 8 Mar 2018 10:04:36 +0800
+Subject: [PATCH] scanner: Fix glibc features.h dependency in skeleton.
+
+Commit a17d79e9c722a6735b6d2a8f152287404f27df32 defines _POSIX_C_SOURCE
+to the minimum of 1 if it's not defined in the user's scanner code or
+the compiling environment. However in glibc the macros are not yet set
+up until one of the libc headers is included. This unfortunately have
+made us overwrite the default _POSIX_C_SOURCE value that would be
+defined by glibc (200809L at the time of writing), causing regressions
+in user code.
+
+Now in this patch:
+1. Ensure feature test macros have been set up in glibc before checking
+or defining any of them in our skeleton code.
+2. Have a more conservative logic when determining the need to define
+_POSIX_C_SOURCE (required for fileno()).
+
+Fixes: #313
+
+Note:
+It could be tricky for application code to ensure feature test macros
+have been set up in glibc, since <features.h> is no portable header and
+not meant to be included directly by applications. The way to do it is
+to include a libc header which in turn includes <features.h>. However,
+many of the glibc headers check __USE_POSIX (a glibc internal macro
+defined if _POSIX_C_SOURCE is defined) and determine which interfaces
+to expose already, making the headers inappropriate for our goal.
+Those which don't depend on _POSIX_C_SOURCE, and are also available
+since ANSI C89, are only <assert.h>, <errno.h> and <math.h>.
+
+<assert.h> is finally favored due to other considerations:
+- <math.h> check for __USE_XOPEN in glibc, making a dependency on
+_XOPEN_SOURCE, besides it exposes much more interfaces than we need.
+- In djgpp, <errno.h> depends on _POSIX_SOURCE to hide definitions of
+some errno values when it's defined.
+- <assert.h> exposes the fewest interfaces among the 3 headers and, at
+the time of writing, checks for only C99 (for __func__), C11 (for
+_Static_assert), and _GNU_SOURCE when needed.
+
+Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
+--- a/src/flex.skl
++++ b/src/flex.skl
+@@ -220,11 +220,21 @@ m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
+ %if-c-only
+ m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]], ,
+ [[m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]], ,
+-[[#ifndef _POSIX_C_SOURCE
+-#define _POSIX_C_SOURCE 1 /* for fileno() */
+-#ifndef _POSIX_SOURCE
+-#define _POSIX_SOURCE 1
++[[/* Feature test macros. Flex uses functions that require a minimum set of
++ * macros defined. As defining some macros may hide function declarations that
++ * user code might use, be conservative and respect user's definitions as much
++ * as possible. In glibc, feature test macros may not be all set up until one
++ * of the libc header (that includes <features.h>) is included. This creates
++ * a circular dependency when we check the macros. <assert.h> is the safest
++ * header we can include and does not declare too many functions we don't need.
++ */
++#if !defined(__GNU_LIBRARY__) && defined(__STDC__)
++#include <assert.h>
+ #endif
++#if !(defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
++ defined(_POSIX_SOURCE))
++# define _POSIX_C_SOURCE 1 /* Required for fileno() */
++# define _POSIX_SOURCE 1
+ #endif]])]])
+ #include <stdio.h>
+ #include <string.h>
+
+From 1985bb3c7abed940e91ad816504ef08a18c3b7c1 Mon Sep 17 00:00:00 2001
+From: Explorer09 <explorer09@gmail.com>
+Date: Thu, 8 Mar 2018 09:53:24 +0800
+Subject: [PATCH] scanner: correct comments about __STDC_LIMIT_MACROS.
+
+No code changes.
+
+Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
+--- a/src/flexint.h
++++ b/src/flexint.h
+@@ -7,8 +7,8 @@
+
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+- * if you want the limit (max/min) macros for int types.
++/* C++ systems might need __STDC_LIMIT_MACROS defined before including
++ * <stdint.h>, if you want the limit (max/min) macros for int types.
+ */
+ #ifndef __STDC_LIMIT_MACROS
+ #define __STDC_LIMIT_MACROS 1
+
diff --git a/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.6+.patch b/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.6+.patch
deleted file mode 100644
index 328b57524565..000000000000
--- a/sys-devel/flex/files/flex-2.6.4-fix-build-with-glibc2.6+.patch
+++ /dev/null
@@ -1,767 +0,0 @@
-Backport of https://github.com/westes/flex/commit/24fd0551333e7eded87b64dd36062da3df2f6380
-
-Bug: https://bugs.gentoo.org/628744
-
---- a/configure
-+++ b/configure
-@@ -3605,13 +3605,142 @@ test -z "$SED" && SED=sed
- Xsed="$SED -e 1s/^X//"
-
-
-+ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-+$as_echo_n "checking how to run the C preprocessor... " >&6; }
-+# On Suns, sometimes $CPP names a directory.
-+if test -n "$CPP" && test -d "$CPP"; then
-+ CPP=
-+fi
-+if test -z "$CPP"; then
-+ if ${ac_cv_prog_CPP+:} false; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ # Double quotes because CPP needs to be expanded
-+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-+ do
-+ ac_preproc_ok=false
-+for ac_c_preproc_warn_flag in '' yes
-+do
-+ # Use a header file that comes with gcc, so configuring glibc
-+ # with a fresh cross-compiler works.
-+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-+ # <limits.h> exists even on freestanding compilers.
-+ # On the NeXT, cc -E runs the code through the compiler's parser,
-+ # not just through cpp. "Syntax error" is here to catch this case.
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#ifdef __STDC__
-+# include <limits.h>
-+#else
-+# include <assert.h>
-+#endif
-+ Syntax error
-+_ACEOF
-+if ac_fn_c_try_cpp "$LINENO"; then :
-+
-+else
-+ # Broken: fails on valid input.
-+continue
-+fi
-+rm -f conftest.err conftest.i conftest.$ac_ext
-+
-+ # OK, works on sane cases. Now check whether nonexistent headers
-+ # can be detected and how.
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <ac_nonexistent.h>
-+_ACEOF
-+if ac_fn_c_try_cpp "$LINENO"; then :
-+ # Broken: success on invalid input.
-+continue
-+else
-+ # Passes both tests.
-+ac_preproc_ok=:
-+break
-+fi
-+rm -f conftest.err conftest.i conftest.$ac_ext
-+
-+done
-+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-+rm -f conftest.i conftest.err conftest.$ac_ext
-+if $ac_preproc_ok; then :
-+ break
-+fi
-
-+ done
-+ ac_cv_prog_CPP=$CPP
-
-+fi
-+ CPP=$ac_cv_prog_CPP
-+else
-+ ac_cv_prog_CPP=$CPP
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-+$as_echo "$CPP" >&6; }
-+ac_preproc_ok=false
-+for ac_c_preproc_warn_flag in '' yes
-+do
-+ # Use a header file that comes with gcc, so configuring glibc
-+ # with a fresh cross-compiler works.
-+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-+ # <limits.h> exists even on freestanding compilers.
-+ # On the NeXT, cc -E runs the code through the compiler's parser,
-+ # not just through cpp. "Syntax error" is here to catch this case.
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#ifdef __STDC__
-+# include <limits.h>
-+#else
-+# include <assert.h>
-+#endif
-+ Syntax error
-+_ACEOF
-+if ac_fn_c_try_cpp "$LINENO"; then :
-
-+else
-+ # Broken: fails on valid input.
-+continue
-+fi
-+rm -f conftest.err conftest.i conftest.$ac_ext
-
-+ # OK, works on sane cases. Now check whether nonexistent headers
-+ # can be detected and how.
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <ac_nonexistent.h>
-+_ACEOF
-+if ac_fn_c_try_cpp "$LINENO"; then :
-+ # Broken: success on invalid input.
-+continue
-+else
-+ # Passes both tests.
-+ac_preproc_ok=:
-+break
-+fi
-+rm -f conftest.err conftest.i conftest.$ac_ext
-
-+done
-+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-+rm -f conftest.i conftest.err conftest.$ac_ext
-+if $ac_preproc_ok; then :
-
-+else
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-+See \`config.log' for more details" "$LINENO" 5; }
-+fi
-
-+ac_ext=c
-+ac_cpp='$CPP $CPPFLAGS'
-+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-@@ -3744,91 +3873,208 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
--$as_echo_n "checking for fgrep... " >&6; }
--if ${ac_cv_path_FGREP+:} false; then :
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-+$as_echo_n "checking for ANSI C header files... " >&6; }
-+if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
- else
-- if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
-- then ac_cv_path_FGREP="$GREP -F"
-- else
-- if test -z "$FGREP"; then
-- ac_path_FGREP_found=false
-- # Loop through the user's path and test for each of PROGNAME-LIST
-- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
--for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
--do
-- IFS=$as_save_IFS
-- test -z "$as_dir" && as_dir=.
-- for ac_prog in fgrep; do
-- for ac_exec_ext in '' $ac_executable_extensions; do
-- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-- as_fn_executable_p "$ac_path_FGREP" || continue
--# Check for GNU ac_path_FGREP and select it if it is found.
-- # Check for GNU $ac_path_FGREP
--case `"$ac_path_FGREP" --version 2>&1` in
--*GNU*)
-- ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
--*)
-- ac_count=0
-- $as_echo_n 0123456789 >"conftest.in"
-- while :
-- do
-- cat "conftest.in" "conftest.in" >"conftest.tmp"
-- mv "conftest.tmp" "conftest.in"
-- cp "conftest.in" "conftest.nl"
-- $as_echo 'FGREP' >> "conftest.nl"
-- "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
-- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-- as_fn_arith $ac_count + 1 && ac_count=$as_val
-- if test $ac_count -gt ${ac_path_FGREP_max-0}; then
-- # Best one so far, save it but keep looking for a better one
-- ac_cv_path_FGREP="$ac_path_FGREP"
-- ac_path_FGREP_max=$ac_count
-- fi
-- # 10*(2^10) chars as input seems more than enough
-- test $ac_count -gt 10 && break
-- done
-- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
--esac
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <stdlib.h>
-+#include <stdarg.h>
-+#include <string.h>
-+#include <float.h>
-
-- $ac_path_FGREP_found && break 3
-- done
-- done
-- done
--IFS=$as_save_IFS
-- if test -z "$ac_cv_path_FGREP"; then
-- as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-- fi
--else
-- ac_cv_path_FGREP=$FGREP
--fi
-+int
-+main ()
-+{
-
-- fi
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+ ac_cv_header_stdc=yes
-+else
-+ ac_cv_header_stdc=no
- fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
--$as_echo "$ac_cv_path_FGREP" >&6; }
-- FGREP="$ac_cv_path_FGREP"
--
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
--test -z "$GREP" && GREP=grep
-+if test $ac_cv_header_stdc = yes; then
-+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <string.h>
-
-+_ACEOF
-+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-+ $EGREP "memchr" >/dev/null 2>&1; then :
-
-+else
-+ ac_cv_header_stdc=no
-+fi
-+rm -f conftest*
-
-+fi
-
-+if test $ac_cv_header_stdc = yes; then
-+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <stdlib.h>
-
-+_ACEOF
-+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-+ $EGREP "free" >/dev/null 2>&1; then :
-
-+else
-+ ac_cv_header_stdc=no
-+fi
-+rm -f conftest*
-
-+fi
-
-+if test $ac_cv_header_stdc = yes; then
-+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-+ if test "$cross_compiling" = yes; then :
-+ :
-+else
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+#include <ctype.h>
-+#include <stdlib.h>
-+#if ((' ' & 0x0FF) == 0x020)
-+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-+#else
-+# define ISLOWER(c) \
-+ (('a' <= (c) && (c) <= 'i') \
-+ || ('j' <= (c) && (c) <= 'r') \
-+ || ('s' <= (c) && (c) <= 'z'))
-+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-+#endif
-
-+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-+int
-+main ()
-+{
-+ int i;
-+ for (i = 0; i < 256; i++)
-+ if (XOR (islower (i), ISLOWER (i))
-+ || toupper (i) != TOUPPER (i))
-+ return 2;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_run "$LINENO"; then :
-
-+else
-+ ac_cv_header_stdc=no
-+fi
-+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-+ conftest.$ac_objext conftest.beam conftest.$ac_ext
-+fi
-
-+fi
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-+$as_echo "$ac_cv_header_stdc" >&6; }
-+if test $ac_cv_header_stdc = yes; then
-
-+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-+fi
-
-+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-+ inttypes.h stdint.h unistd.h
-+do :
-+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-+"
-+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-+_ACEOF
-+
-+fi
-+
-+done
-+
-+
-+
-+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-+if test "x$ac_cv_header_minix_config_h" = xyes; then :
-+ MINIX=yes
-+else
-+ MINIX=
-+fi
-+
-+
-+ if test "$MINIX" = yes; then
-
-+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
-
-
-+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
-+
-+
-+$as_echo "#define _MINIX 1" >>confdefs.h
-+
-+ fi
-+
-+
-+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
-+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-+if ${ac_cv_safe_to_define___extensions__+:} false; then :
-+ $as_echo_n "(cached) " >&6
-+else
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
-+# define __EXTENSIONS__ 1
-+ $ac_includes_default
-+int
-+main ()
-+{
-+
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+if ac_fn_c_try_compile "$LINENO"; then :
-+ ac_cv_safe_to_define___extensions__=yes
-+else
-+ ac_cv_safe_to_define___extensions__=no
-+fi
-+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
-+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
-+ test $ac_cv_safe_to_define___extensions__ = yes &&
-+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
-+
-+ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
-+
-+ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-+
-+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
-+
-+ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
-+
-+
-+for ac_header in dlfcn.h
-+do :
-+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-+"
-+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
-+ cat >>confdefs.h <<_ACEOF
-+#define HAVE_DLFCN_H 1
-+_ACEOF
-+
-+fi
-+
-+done
-
-
- # Check whether --with-gnu-ld was given.
-@@ -6898,288 +7144,6 @@ func_munge_path_list ()
- esac
- }
-
--ac_ext=c
--ac_cpp='$CPP $CPPFLAGS'
--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
--ac_compiler_gnu=$ac_cv_c_compiler_gnu
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
--$as_echo_n "checking how to run the C preprocessor... " >&6; }
--# On Suns, sometimes $CPP names a directory.
--if test -n "$CPP" && test -d "$CPP"; then
-- CPP=
--fi
--if test -z "$CPP"; then
-- if ${ac_cv_prog_CPP+:} false; then :
-- $as_echo_n "(cached) " >&6
--else
-- # Double quotes because CPP needs to be expanded
-- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-- do
-- ac_preproc_ok=false
--for ac_c_preproc_warn_flag in '' yes
--do
-- # Use a header file that comes with gcc, so configuring glibc
-- # with a fresh cross-compiler works.
-- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-- # <limits.h> exists even on freestanding compilers.
-- # On the NeXT, cc -E runs the code through the compiler's parser,
-- # not just through cpp. "Syntax error" is here to catch this case.
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
-- Syntax error
--_ACEOF
--if ac_fn_c_try_cpp "$LINENO"; then :
--
--else
-- # Broken: fails on valid input.
--continue
--fi
--rm -f conftest.err conftest.i conftest.$ac_ext
--
-- # OK, works on sane cases. Now check whether nonexistent headers
-- # can be detected and how.
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <ac_nonexistent.h>
--_ACEOF
--if ac_fn_c_try_cpp "$LINENO"; then :
-- # Broken: success on invalid input.
--continue
--else
-- # Passes both tests.
--ac_preproc_ok=:
--break
--fi
--rm -f conftest.err conftest.i conftest.$ac_ext
--
--done
--# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
--rm -f conftest.i conftest.err conftest.$ac_ext
--if $ac_preproc_ok; then :
-- break
--fi
--
-- done
-- ac_cv_prog_CPP=$CPP
--
--fi
-- CPP=$ac_cv_prog_CPP
--else
-- ac_cv_prog_CPP=$CPP
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
--$as_echo "$CPP" >&6; }
--ac_preproc_ok=false
--for ac_c_preproc_warn_flag in '' yes
--do
-- # Use a header file that comes with gcc, so configuring glibc
-- # with a fresh cross-compiler works.
-- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-- # <limits.h> exists even on freestanding compilers.
-- # On the NeXT, cc -E runs the code through the compiler's parser,
-- # not just through cpp. "Syntax error" is here to catch this case.
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
-- Syntax error
--_ACEOF
--if ac_fn_c_try_cpp "$LINENO"; then :
--
--else
-- # Broken: fails on valid input.
--continue
--fi
--rm -f conftest.err conftest.i conftest.$ac_ext
--
-- # OK, works on sane cases. Now check whether nonexistent headers
-- # can be detected and how.
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <ac_nonexistent.h>
--_ACEOF
--if ac_fn_c_try_cpp "$LINENO"; then :
-- # Broken: success on invalid input.
--continue
--else
-- # Passes both tests.
--ac_preproc_ok=:
--break
--fi
--rm -f conftest.err conftest.i conftest.$ac_ext
--
--done
--# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
--rm -f conftest.i conftest.err conftest.$ac_ext
--if $ac_preproc_ok; then :
--
--else
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
--$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
--See \`config.log' for more details" "$LINENO" 5; }
--fi
--
--ac_ext=c
--ac_cpp='$CPP $CPPFLAGS'
--ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
--ac_compiler_gnu=$ac_cv_c_compiler_gnu
--
--
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
--$as_echo_n "checking for ANSI C header files... " >&6; }
--if ${ac_cv_header_stdc+:} false; then :
-- $as_echo_n "(cached) " >&6
--else
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <stdlib.h>
--#include <stdarg.h>
--#include <string.h>
--#include <float.h>
--
--int
--main ()
--{
--
-- ;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
-- ac_cv_header_stdc=yes
--else
-- ac_cv_header_stdc=no
--fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
--
--if test $ac_cv_header_stdc = yes; then
-- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <string.h>
--
--_ACEOF
--if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-- $EGREP "memchr" >/dev/null 2>&1; then :
--
--else
-- ac_cv_header_stdc=no
--fi
--rm -f conftest*
--
--fi
--
--if test $ac_cv_header_stdc = yes; then
-- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <stdlib.h>
--
--_ACEOF
--if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-- $EGREP "free" >/dev/null 2>&1; then :
--
--else
-- ac_cv_header_stdc=no
--fi
--rm -f conftest*
--
--fi
--
--if test $ac_cv_header_stdc = yes; then
-- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-- if test "$cross_compiling" = yes; then :
-- :
--else
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--#include <ctype.h>
--#include <stdlib.h>
--#if ((' ' & 0x0FF) == 0x020)
--# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
--# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
--#else
--# define ISLOWER(c) \
-- (('a' <= (c) && (c) <= 'i') \
-- || ('j' <= (c) && (c) <= 'r') \
-- || ('s' <= (c) && (c) <= 'z'))
--# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
--#endif
--
--#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
--int
--main ()
--{
-- int i;
-- for (i = 0; i < 256; i++)
-- if (XOR (islower (i), ISLOWER (i))
-- || toupper (i) != TOUPPER (i))
-- return 2;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_run "$LINENO"; then :
--
--else
-- ac_cv_header_stdc=no
--fi
--rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-- conftest.$ac_objext conftest.beam conftest.$ac_ext
--fi
--
--fi
--fi
--{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
--$as_echo "$ac_cv_header_stdc" >&6; }
--if test $ac_cv_header_stdc = yes; then
--
--$as_echo "#define STDC_HEADERS 1" >>confdefs.h
--
--fi
--
--# On IRIX 5.3, sys/types and inttypes.h are conflicting.
--for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-- inttypes.h stdint.h unistd.h
--do :
-- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
--ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
--"
--if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-- cat >>confdefs.h <<_ACEOF
--#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
--_ACEOF
--
--fi
--
--done
--
--
--for ac_header in dlfcn.h
--do :
-- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
--"
--if test "x$ac_cv_header_dlfcn_h" = xyes; then :
-- cat >>confdefs.h <<_ACEOF
--#define HAVE_DLFCN_H 1
--_ACEOF
--
--fi
--
--done
--
--
--
-
-
- # Set options
---- a/src/config.h.in
-+++ b/src/config.h.in
-@@ -207,6 +207,9 @@
- /* Define to the m4 executable name. */
- #undef M4
-
-+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-+#undef NO_MINUS_C_MINUS_O
-+
- /* Name of package */
- #undef PACKAGE
-
-@@ -239,6 +242,28 @@
- /* Define to 1 if you have the ANSI C header files. */
- #undef STDC_HEADERS
-
-+/* Enable extensions on AIX 3, Interix. */
-+#ifndef _ALL_SOURCE
-+# undef _ALL_SOURCE
-+#endif
-+/* Enable GNU extensions on systems that have them. */
-+#ifndef _GNU_SOURCE
-+# undef _GNU_SOURCE
-+#endif
-+/* Enable threading extensions on Solaris. */
-+#ifndef _POSIX_PTHREAD_SEMANTICS
-+# undef _POSIX_PTHREAD_SEMANTICS
-+#endif
-+/* Enable extensions on HP NonStop. */
-+#ifndef _TANDEM_SOURCE
-+# undef _TANDEM_SOURCE
-+#endif
-+/* Enable general extensions on Solaris. */
-+#ifndef __EXTENSIONS__
-+# undef __EXTENSIONS__
-+#endif
-+
-+
- /* Version number of package */
- #undef VERSION
-
-@@ -246,6 +271,16 @@
- `char[]'. */
- #undef YYTEXT_POINTER
-
-+/* Define to 1 if on MINIX. */
-+#undef _MINIX
-+
-+/* Define to 2 if the system does not provide POSIX.1 features except with
-+ this defined. */
-+#undef _POSIX_1_SOURCE
-+
-+/* Define to 1 if you need to in order for `stat' and other things to work. */
-+#undef _POSIX_SOURCE
-+
- /* Define to empty if `const' does not conform to ANSI C. */
- #undef const
-
diff --git a/sys-devel/flex/flex-2.6.4-r1.ebuild b/sys-devel/flex/flex-2.6.4-r6.ebuild
index 592b017eec1a..fd91a0206e3b 100644
--- a/sys-devel/flex/flex-2.6.4-r1.ebuild
+++ b/sys-devel/flex/flex-2.6.4-r6.ebuild
@@ -1,42 +1,54 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit flag-o-matic libtool multilib-minimal toolchain-funcs
DESCRIPTION="The Fast Lexical Analyzer"
HOMEPAGE="https://github.com/westes/flex"
SRC_URI="https://github.com/westes/${PN}/releases/download/v${PV}/${P}.tar.gz"
+SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-autotools-regenerate.patch.xz"
LICENSE="FLEX"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="nls static test"
RESTRICT="!test? ( test )"
-# We want bison explicitly and not yacc in general #381273
RDEPEND="sys-devel/m4"
-BDEPEND="${RDEPEND}
+# We want bison explicitly and not yacc in general, bug #381273
+BDEPEND="
+ ${RDEPEND}
nls? ( sys-devel/gettext )
- test? ( sys-devel/bison )"
+ test? ( sys-devel/bison )
+"
+PDEPEND="app-alternatives/lex"
PATCHES=(
- "${FILESDIR}"/${PN}-2.6.4-libobjdir.patch
- "${FILESDIR}"/${PN}-2.6.4-fix-build-with-glibc2.6+.patch
+ "${FILESDIR}"/${P}-libobjdir.patch
+ "${FILESDIR}"/${P}-fix-build-with-glibc2.26.patch
+ "${FILESDIR}"/${P}-fix-apple-m1-crash-by-explicit-pointer-cast.patch
+
+ "${WORKDIR}"/${P}-autotools-regenerate.patch
)
src_prepare() {
default
+ # Drop on next release when we can remove ${P}-autotools-regenerate.patch
+ touch configure.ac aclocal.m4 Makefile.in configure src/config.h.in || die
+
# Disable running in the tests/ subdir as it has a bunch of built sources
- # that cannot be made conditional (automake limitation). #568842
+ # that cannot be made conditional (automake limitation). bug #568842
if ! use test ; then
sed -i \
-e '/^SUBDIRS =/,/^$/{/tests/d}' \
Makefile.in || die
fi
- elibtoolize # Prefix always needs this
+
+ # Prefix always needs this
+ elibtoolize
}
src_configure() {
@@ -46,9 +58,8 @@ src_configure() {
}
multilib_src_configure() {
- # Do not install shared libs #503522
- ECONF_SOURCE=${S} \
- econf \
+ # Do not install shared libs, #503522
+ ECONF_SOURCE="${S}" econf \
CC_FOR_BUILD="$(tc-getBUILD_CC)" \
--disable-shared \
$(use_enable nls)
@@ -79,5 +90,12 @@ multilib_src_install_all() {
dodoc ONEWS
find "${ED}" -name '*.la' -type f -delete || die
rm "${ED}"/usr/share/doc/${PF}/COPYING || die
- dosym flex /usr/bin/lex
+}
+
+pkg_postinst() {
+ # ensure to preserve the symlink before app-alternatives/lex
+ # is installed
+ if [[ ! -h ${EROOT}/usr/bin/lex ]]; then
+ ln -s flex "${EROOT}/usr/bin/lex" || die
+ fi
}
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
deleted file mode 100644
index 8da025d8c5d0..000000000000
--- a/sys-devel/gcc-apple/files/gcc-apple-4.2.1-dsymutil.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-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/libstdc++-16.patch b/sys-devel/gcc-apple/files/libstdc++-16.patch
deleted file mode 100644
index 81d075bface7..000000000000
--- a/sys-devel/gcc-apple/files/libstdc++-16.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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-r3.ebuild b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r3.ebuild
index c144abe8aca5..0a8cb2421474 100644
--- a/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r3.ebuild
+++ b/sys-devel/gcc-apple/gcc-apple-4.2.1_p5666-r3.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
-inherit toolchain flag-o-matic autotools prefix toolchain-funcs
+inherit flag-o-matic autotools prefix toolchain-funcs
GCC_VERS=${PV/_p*/}
APPLE_VERS="${PV/*_p/}.3"
@@ -32,7 +32,7 @@ RDEPEND=">=sys-libs/zlib-1.1.4
)"
DEPEND="${RDEPEND}
>=sys-apps/texinfo-4.2-r4
- >=sys-devel/bison-1.875
+ app-alternatives/yacc
${CATEGORY}/binutils-apple
>=dev-libs/mpfr-2.2.0_p10"
PDEPEND="sys-libs/csu"
@@ -42,6 +42,17 @@ S=${WORKDIR}/gcc-${APPLE_VERS}
# TPREFIX is the prefix of the CTARGET installation
export TPREFIX=${TPREFIX:-${EPREFIX}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} = ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
do_bootstrap() {
is_crosscompile && return 1
[[ ${CHOST} != ${CBUILD} ]] && return 1
@@ -301,6 +312,8 @@ src_install() {
echo "STDCXX_INCDIR=\"g++-v${GCC_VERS/\.*/}\"" >> ${gcc_envd_file}
is_crosscompile && echo "CTARGET=${CTARGET}" >> ${gcc_envd_file}
+ docompress /usr/share/gcc-data/${CTARGET}/${GCC_VERS}/{man,info}
+
# Move <cxxabi.h> to compiler-specific directories
[[ -f ${D}${STDCXX_INCDIR}/cxxabi.h ]] && \
mv -f "${D}"${STDCXX_INCDIR}/cxxabi.h "${D}"${LIBPATH}/include/
diff --git a/sys-devel/gcc-config/Manifest b/sys-devel/gcc-config/Manifest
index 96afcff2b4a5..d36547d79ebd 100644
--- a/sys-devel/gcc-config/Manifest
+++ b/sys-devel/gcc-config/Manifest
@@ -1,2 +1 @@
-DIST gcc-config-2.4.tar.xz 17552 BLAKE2B 631645a5cc9f3e7ab0ff089960ee3d0b2ecea29aa96f839a03a86985db512bf0d182b67a7b1bb73b95808c04523f32d6b8c122cdfbe8dbf94e7d319a1e49a23c SHA512 852b4aefaccfae1d91c551e226ac28110fa23f9668075c190a5fb9129c86d2f3e4994e96b7a5e8a2801883c5a5b16d9fbf3e9066e6b6a423055fdefa490793c7
-DIST gcc-config-2.5.tar.xz 17664 BLAKE2B fa7133a54d3b49df20d3ae6036a65602c8a0d9e8668e2874a87d080add241a31322a3f4694bff8a5fe61957740603862539c0d9750e446d36beb2fb42ff0ba27 SHA512 20a8d62192faf54101352cfb6ca00503c9b2ab83aefecd94c4c887302a000d78334545a3424603a66a50e5f3ff07b67b16828813407893df5d94051776252b83
+DIST gcc-config-2.11.tar.xz 18068 BLAKE2B 0d76321adea9eff545e042ad847b70a5b3d8ecb8c248fdf58f71c88a7b03c0aca39f7d39e332808b89c3f6d0fb3fc3114bc2d8dfa1ade6460c0b12c3420d876f SHA512 38ea52c2d16287fc2c8efa0ee76e24563851b4fa1ee7dce601507df1530e7a867281f178ad4228505eb2aaf46164024a18825cd6771d847ff1a60a85d6e96d3e
diff --git a/sys-devel/gcc-config/gcc-config-2.5-r1.ebuild b/sys-devel/gcc-config/gcc-config-2.11.ebuild
index 6d93f7de87f9..f387c81e5cb3 100644
--- a/sys-devel/gcc-config/gcc-config-2.5-r1.ebuild
+++ b/sys-devel/gcc-config/gcc-config-2.11.ebuild
@@ -1,20 +1,20 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/gcc-config.git"
inherit git-r3
else
SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
fi
DESCRIPTION="Utility to manage compilers"
HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
-LICENSE="GPL-2"
+LICENSE="GPL-2 GPL-2+"
SLOT="0"
IUSE="+cc-wrappers +native-symlinks"
diff --git a/sys-devel/gcc-config/gcc-config-2.4.ebuild b/sys-devel/gcc-config/gcc-config-2.4.ebuild
deleted file mode 100644
index 1d9d5647b2f3..000000000000
--- a/sys-devel/gcc-config/gcc-config-2.4.ebuild
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-if [[ ${PV} == 9999 ]]; then
- EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/gcc-config.git"
- inherit git-r3
-else
- SRC_URI="https://dev.gentoo.org/~sam/distfiles/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-fi
-
-DESCRIPTION="Utility to manage compilers"
-HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="+cc-wrappers +native-symlinks"
-
-RDEPEND=">=sys-apps/gentoo-functions-0.10"
-
-_emake() {
- emake \
- PV="${PVR}" \
- SUBLIBDIR="$(get_libdir)" \
- USE_CC_WRAPPERS="$(usex cc-wrappers)" \
- USE_NATIVE_LINKS="$(usex native-symlinks)" \
- TOOLCHAIN_PREFIX="${CHOST}-" \
- "$@"
-}
-
-src_compile() {
- _emake
-}
-
-src_install() {
- _emake DESTDIR="${D}" install
-}
-
-pkg_postinst() {
- # 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
-
- # USE flag change can add or delete files in /usr/bin worth recaching
- if [[ ! ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
- eselect compiler-shadow update all
- fi
-}
diff --git a/sys-devel/gcc-config/gcc-config-9999.ebuild b/sys-devel/gcc-config/gcc-config-9999.ebuild
index 67c6a7ee6316..a314266369ef 100644
--- a/sys-devel/gcc-config/gcc-config-9999.ebuild
+++ b/sys-devel/gcc-config/gcc-config-9999.ebuild
@@ -1,20 +1,20 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
if [[ ${PV} == 9999 ]]; then
EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/gcc-config.git"
inherit git-r3
else
SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
DESCRIPTION="Utility to manage compilers"
HOMEPAGE="https://gitweb.gentoo.org/proj/gcc-config.git/"
-LICENSE="GPL-2"
+LICENSE="GPL-2 GPL-2+"
SLOT="0"
IUSE="+cc-wrappers +native-symlinks"
diff --git a/sys-devel/gcc-config/metadata.xml b/sys-devel/gcc-config/metadata.xml
index 4dac4d50b500..61a8b0758cd6 100644
--- a/sys-devel/gcc-config/metadata.xml
+++ b/sys-devel/gcc-config/metadata.xml
@@ -9,4 +9,8 @@
<flag name="cc-wrappers">Install and manage 'cc' and 'f77' wrappers in /usr/bin. Otherwise ignore them.</flag>
<flag name="native-symlinks">Install native symlinks like 'gcc' or 'g++' to /usr/bin. Otherwise keep only ${CTARGET}-gcc and friends.</flag>
</use>
+ <upstream>
+ <remote-id type="gentoo">proj/gcc-config</remote-id>
+ <remote-id type="github">gentoo/gcc-config</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest
index 939c069abb54..ffb597775b21 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,22 +1,41 @@
-DIST ecj-4.5.jar 1470676 BLAKE2B 793c10ba09fd8040c0e1181204141aea16780c9c9088e07126e00da2b510af2ad6f58d876357d7e98cbb02d783a3be434469d5de1df134ccb8cc508e45028d80 SHA512 d4e1bf7538ace56e3d69fa91da5bbd16c272923b4de0a9d8dee23ea2b75f9f38c603de72fc4061df49285c450b63f3df211cee5270e9fffc5447445d1a9c9e4e
-DIST gcc-10-20211126.tar.xz 71674848 BLAKE2B 81f4a572e973db7a3701601e66ea58c8e535a55d4d4ac164de00bdb06f7f265585f45d46171cf40d42ebcd3fb02ac81b643398c560912698eb6c008ac6e09518 SHA512 db887184c649ebeede5a1b9f13c00fe425012434cb93ec960c3ca50c0bcdeab04a1cc13b20de21b940e5d6a09c3b1c7fc415110a0e990ec1d938627bf97b9342
-DIST gcc-10.3.0-musl-patches-1.tar.bz2 2999 BLAKE2B 3e36bbf2f93fdce15e20f807fa262f7a7abbde85b6f6b4e1383f6eccd8a53d876687d56cde83a80cde8a50e15bec407a1212aa0c85520892563e3d5ef7aaca98 SHA512 21483912a7b152f27db82d837a4cf91f2552d5fe238702aeca0c0dd8c7d3695bc70d8794c94a19106df28e053baf14c38433ca8e38e849082b76273cb51f2384
-DIST gcc-10.3.0-patches-1.tar.bz2 15282 BLAKE2B ef283e8b108af9bfd3324fabb95c835374113c6ff2cf1430a5568b3d1b27183e6de6751367c1e5720c85ac4c45132848888d5510c63f95e88a1f623b6bcf4000 SHA512 6dc435c8619a1532000fae843b9964d0d1e28d3cc9cc1962ab7391570a0cf1135424ea5c0b0d3d5ec5ea863f02e963be2ec4c94822f217fc692a1d808325404e
-DIST gcc-10.3.0-patches-3.tar.bz2 18935 BLAKE2B 13eaf1e055b5b63069aed1575ed93f6bc822b5e3f2181ddfc88f4e7ff801f58997cd131b2efd79b90469b1f861db994feb2adcaecacf165442078f76e233fd9a SHA512 c3d6a6f32863cc0ff7c877314ff0c00a892e473f64d16b82d46b4a77aa97c3e7a575492d27f0d423acb2621c86c9a49bca0e26e45bda9e697495444fcac85084
-DIST gcc-10.3.0.tar.xz 76692288 BLAKE2B ac7898f5eb8a7c5f151a526d1bb38913a68b50a65e4d010ac09fa20b6c801c671c790d780f23ccb8e4ecdfc686f4aa588082ccc9eb5c80c7b0e30788f824c1eb SHA512 2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86
-DIST gcc-10.4.0-patches-0.tar.bz2 15231 BLAKE2B f64a2e7f317acf9416da69c129ea869116be2780828f9d3cda59f7ea8d39634df7f0347f745275bb167f95aae2a3b8e97ec7c78f775d9002718dd67cb9429f68 SHA512 d1497930ccf4d6ee8700faeb676945e65b3aa2ba3a580a3564575fad1590ad076741f2ecad778ab48d0c4e8ed7723b84b0a660cb67cc4530495691702159a43a
-DIST gcc-11-20211127.tar.xz 75659912 BLAKE2B 2de0883de6596457189da75977aa4628a45cadec6528e7b5c0043b891717d14805d8a65f87cd95e2033567c7f88e239063171690a3fbfda99cc687a9c691c965 SHA512 ba0dad9073cd16fdaad5cc05c8ee637fa89f20dca4b0cdf256487e54fa6b88a5a759ae851b946e2122c60f28d295a4ee47bcca3dbcaedcb53bd8a66edd0f5b45
-DIST gcc-11.2.0-musl-patches-1.tar.bz2 2999 BLAKE2B 3e36bbf2f93fdce15e20f807fa262f7a7abbde85b6f6b4e1383f6eccd8a53d876687d56cde83a80cde8a50e15bec407a1212aa0c85520892563e3d5ef7aaca98 SHA512 21483912a7b152f27db82d837a4cf91f2552d5fe238702aeca0c0dd8c7d3695bc70d8794c94a19106df28e053baf14c38433ca8e38e849082b76273cb51f2384
-DIST gcc-11.2.0-patches-1.tar.bz2 11537 BLAKE2B 9dd791ada244c9b70b8b99f9f305a688c248134715ed1b26d406e53b114983faae6873cdc521497164388d24d5f61c199e98df146bc02f5578e877295bcf5c82 SHA512 6539efc60c656d0798a5896dc1b944ed69914b815102c7a1c10bdba4ef935abd326b01309f38316e121f1ed90ceb2abcaf65df6af116892daad829ac2623cefc
-DIST gcc-11.2.0.tar.xz 80888824 BLAKE2B 69b61234ac436edfea2933df68c434a2ce7aa4454ef4da573e82587e1a42dc420189e949cfdadaf4cb37fc0de9674822210a95b77ff03aca0dbedfe67df19cc6 SHA512 d53a0a966230895c54f01aea38696f818817b505f1e2bfa65e508753fcd01b2aedb4a61434f41f3a2ddbbd9f41384b96153c684ded3f0fa97c82758d9de5c7cf
-DIST gcc-11.3.0-patches-3.tar.bz2 13567 BLAKE2B dba270d74b7a598e0108be0be7ff8cf01899d044ca4be9938cd5324465dc00c9e5cac4ffb4b6c1bdcdb824d75a7577eed63ae724c7e2887a19708992aca10f26 SHA512 7919b37900bbc2493564bc70f7911cf03efb857ff09c2b13280018fb54c48d8be42e35b649e69594a3ce61d51de847a8d4f75f794ce1dc50db3a700831b6a1e7
-DIST gcc-12.0.0-patches-2.tar.bz2 11564 BLAKE2B 5954ee8dd5edb30ecde54275d9ffd4d2f5671de82fe7789688d1220b181fbcdeed3d5305858d8af1fd016e627687ca6f2ebc76bb6b49e9b903e8d63c3de2baea SHA512 6299a1f46fc3f29934db7af20651c0c3e1266bef89b222fc9e3bc6a7e7cd2869301c5b227a4105157456474ae8a626ec550c15971bceb2f844476a9f5bc56284
-DIST gcc-6.5.0-patches-6.tar.bz2 15320 BLAKE2B fe6b60cd45d00187e4e41e607af6a1137481a6d8f4421a0ead7da9fd86d0cd19bf428e5d150e1de4e0616606f8d6c31738da24be8151c58f7760aa92432ea3d0 SHA512 87c2a6726373999472cbd6211e486864266c833d5a07f8fb02dd3054b7dd3f86aa86ea47b17928045ef6e46d82f429f879d6f69d8adf3b6f2956f4ac6b3f80f1
-DIST gcc-6.5.0.tar.xz 74355588 BLAKE2B 538595d32000b15a53577f0dc6b164d75791a8ccdf90500d5f667ff78378ef4ab9bedb8a590848907caf863bf1165ebe108b5e81eb4b54e85ced4002affde693 SHA512 ce046f9a50050fd54b870aab764f7db187fe7ea92eb4aaffb7c3689ca623755604e231f2af97ef795f41c406bb80c797dd69957cfdd51dfa2ba60813f72b7eac
-DIST gcc-7.5.0-patches-4.tar.bz2 13183 BLAKE2B 38a56910f01ef4172182d2145cef1df53b57eaa8f0655223cf54689e7ce12a264bfbb3735bde42b8a8594ab44031d9c48dc0d5303fab6537746f05e4d46b427a SHA512 28d3732d5351dabd1452ee0462865a0de00103d9ea66941e38499c532b34ee8beb150b0b32af58cde901e437b4c256593c29736a5e7df2575aa0d0c43b6cf6eb
-DIST gcc-7.5.0.tar.xz 62783088 BLAKE2B 8a5efeef517a5da1634d063aaa83bf5e002f86acdf27419f1067f5c3d087333d9eea0c8db427b8bd895af646990bb00ee173069980ca49cec848434a4127256f SHA512 fe716cc19f2e3255d3a8b1b8290777bf769c6d98e6e0b07b81a3d6ad43f8af74cb170dfa18b1555dbfcd3f55ae582b91a286ccef496b9b65c1579902f96a1f60
-DIST gcc-8.5.0-patches-2.tar.bz2 16921 BLAKE2B 619a47f74edf05fa01c9de59d0ff7abb027a01cf0bdec91ac41046166192f4eae561684136c4a6a5e077f64754bb5b0710905129f31b0def21d88f92e6bba7fb SHA512 b6095d4570895e2c4dd58fed5756194aea27391b813e5e2de42b2749cb318c4bea2087eb0ff92c70e7f98ae4482c49d476db57be83d7beb19fd462aa61714ab2
+DIST gcc-10.5.0-musl-patches-2.tar.xz 3452 BLAKE2B 5387e516d07d81477b3f39b8b3bd986bf861d32cd25dc5481c97bd3620d00c918c5661e86857f66dbf28a655401a53e43417f638c443e44cbfdbf5e950caac4d SHA512 86f2ce31cc4fc4fb5a6043fb527bf822d895e1a6220652024f78a1cbd5a962edb6be8dc5f43c32053e075f39bb2350ea8f14e7d57e0473dd2933a7b44676bde5
+DIST gcc-10.5.0-patches-6.tar.xz 18208 BLAKE2B 4cac3340108fb378c76ad62b728429f3c97f348d178744e7536575f3576ca8aa682b878b7df3b1c162dccae64a3cb56c66d8d60eae323e1ece2de4278084fdbd SHA512 9d6c84325fbc118cee01347468ce729c278e5b026b16da945fe54050726e26f86a46ee7b71a01a47cf927b70bfcce459c49a6bc4fb93dcfaa047c76d4c5bc5bc
+DIST gcc-10.5.0.tar.xz 77846412 BLAKE2B 9b71761f4015649514677784443886e59733ac3845f7dfaa4343f46327d36c08c403c444b9e492b870ac0b3f2e3568f972b7700a0ef05a497fb4066079b3143b SHA512 d86dbc18b978771531f4039465e7eb7c19845bf607dc513c97abf8e45ffe1086a99d98f83dfb7b37204af22431574186de9d5ff80c8c3c3a98dbe3983195bffd
+DIST gcc-11-20240111.tar.xz 76240620 BLAKE2B dcf3b2493ca6ba1a9cd0137186cfbf1b96296ff9c5625e40ec7b89e5903b07dc151b61ad54b885fc57ccc02214e2cfa7b9249cbd755ac2554c6ca0008f0704d8 SHA512 aaed094cb6dd99166e0ec59886014108574ddab52701581f0f8e7f0abb966320d01f1bce6ff646170618ca7c2819d20523a23615f20114dbe412de43b937caf4
+DIST gcc-11-20240208.tar.xz 76276224 BLAKE2B efce83c3ea03093546b73d7731ac1051da7a2b0309612ce5b809ae2756bf7a949c94f951f6a77e789f7669051315e1a4e4c33f2b12a2ec1999ee9f1f39f6b13f SHA512 a0e2b4402ff187d0804e3bc2ed0a228cfce48476c1270d57798b060899f65c7e986945651d36c358f9df5eb4b36db13321e141895329b7382c130a0aca6a8962
+DIST gcc-11-20240328.tar.xz 76268060 BLAKE2B a3ffdd5a2376b1d3984ca39837932e1c6dc047ff6ae72eac0387cf27acdf8f1a1ff7e9584f631de348b6553e929892d8bc443ad6c40132a2636c39a8907c5eec SHA512 6372a99f2a1320c7df6e7984bb780395aaf8319624f311d955d5dbab2ac7bfb8de933c5b945bc3c4ea3b5d7404b8fc2d696825214b6563c1e032094a421b8bd2
+DIST gcc-11-20240404.tar.xz 76246936 BLAKE2B 09eed1bff289e960018b8c9c5d39e43ebcff78d344feba45d7889149e0de0d2727a54a0359471eab9a28cb38d5750b488c62cbffbf937ab7238eab51f3e7d0b7 SHA512 431f0b8d78f2b5e910ca8de8e8f64594f070639c17bc65a074650c217a5262cb9081db7e090bd3396e30ef50e92ed3ada0d163b4cabf04f2ae78fd02dba8c05a
+DIST gcc-11-20240411.tar.xz 76275268 BLAKE2B a24769b7f4b6d111b1fc46f9a99f9f731193a15b9a1a73fc224388721f0e3b6d02022eb0dc44a3d587522ad124bf63ce9ee50b9622ec91b55001c46fbc261776 SHA512 43fef6a426b4b8001c1d8707c34339203e66dcfa580cf289e20cd7abeaf0f8b57068ab1099099c4692a7acce1bc38bb978bcff6c309f30e3430457af5b7fb018
+DIST gcc-11-20240418.tar.xz 76255988 BLAKE2B 363f195d8e23915511e768c303550e6e3a67aa45e3f55945cf763fbbcaea7e28932e5094d2fe4c26f8a920ad3479523c27b8aef14716cb7d26cd7da7a69196fa SHA512 a6072e40ad233759f8f893b5c7962df5cc926cd5322bf1b3986b88013628ac7b08eea23a8f5f5bf75444e26e6106d0ebfab26caa82974805308d17f6b69b36d0
+DIST gcc-11.4.0-musl-patches-2.tar.xz 4308 BLAKE2B a2335e155fc57816fed822a648e0eaefafcba9d04e1ad0fd7baeea5a694ab6f5e3c1678cb406f2a1bd17bab25cb01699d032713a1ccf337948dfda2093844607 SHA512 17b84f907cb1bd763873655e6f35fd3ed55a40b602b70a626f04f83b4cc89c6261db1661de78d4d969187a8c56e9f6305b742515a3836b962248a21df0df5d0c
+DIST gcc-11.4.0-patches-12.tar.xz 13824 BLAKE2B e4df9e0dc9512882022aaf325ebf65c540169454c91dd31f913c6f57f6eb291c79ae919671b53db1549799d4a70c09298bf45ed82ad05eb1f961443cc958369d SHA512 87fed0c3f8e28c9f702443db58350bb615110b27ebe334b5de2ea60678e2548c56cd75cffade210d69634e2ac0a9311f5100ddb45d97645aa76d5688bc421a61
+DIST gcc-12-20240112.tar.xz 79832228 BLAKE2B deec7123b8ffc42ddace51e1f3e8e08d5485f7000c0d4b7273b6311912ec0e7e2cb41124297af8c54456bb369a76fa2ef51aff552d8d680ec41dd2b144b08e55 SHA512 2c0a676ad35e6edee915c042a1751ac0263fae9b7af4d324deb49d6603dc73d3ec768832184879543e6ffb1595da5c56d9117288547adab7f243646dcbfc64ac
+DIST gcc-12-20240209.tar.xz 79824868 BLAKE2B 1ae5a646da470f06648c4766c77475ceb287c5f6647d5102f1aef6590f973233d5e7f83b5e0241488d49dba59dd605c211938379e68a393a2dccb3834103ae4b SHA512 9f9a04f4477f41bb2a5662aedef2af75b039de50c2dc99310e504e6080cb7aae06a1255337ea2e563975cb108ddc6766adbbaf4e3d5d5712801d7ba9a5209dbd
+DIST gcc-12-20240329.tar.xz 79862704 BLAKE2B 2ac09aeed2718acfcbb8d0d71e51f21cab9b186c73860cfabcf95a7ed4c37eb461fb26f86ee7319c614c21208c0fdf841b660d314eacd8314e8f323edd37f7cf SHA512 56d67cac2744c7fcb28eda9a29ba200d418a9e44fecc37b29747c2abac479e366b591ad6f7f92ce64b09dd3d0261af8ef28673beee1280618e043cf66f3b76ac
+DIST gcc-12-20240405.tar.xz 79849308 BLAKE2B d94046fead6cacd3e3b869f1db42843a2487d845ded332ad0fd55a7f290a4c3df72258dc1b74e4db3d7f7357e6b55444cde4b8863f2ce6f8691fd92bd49927fb SHA512 93ed2174ac3cdd8d5e885c6f4f546f9d0557e93bc9583a02d5d159c666fe6a82f30b6ed074f5f1e36f6f82855c41be527fb3d053498059ee4a6194575b00ed0d
+DIST gcc-12-20240412.tar.xz 79856320 BLAKE2B b83d64584a2c5bade96b7964349e4b760d5b40a4d10256799130d329f5748d2741a5122105f094f161f95eb8ade64109276aec723a518a42d695b41c8f08d61e SHA512 2a8a3ae4779f1cc897846b9d5e2eeb94ea8ece72d061c0f2436e854bb26eef33eb51c66bee6c0c363be04023e5c5ce3e3a88c9aaa7ae9faaa9322fd18dfbfae3
+DIST gcc-12.3.0-musl-patches-1.tar.xz 3572 BLAKE2B c7bf65f7c9ea8023ddaac821ee2b778622fa310ac72a72b2f7032494a8f304eac86217f9204622e6c21aaef9952bece0d09bc126facd4f42b602927909815ab5 SHA512 babc279fea2c1fd4c018815f2f5630214fd46015ce9f365c28af242681d51818eaca30ce298eddcab1eed5ac5f2759e2b47b2335afab9d722b4469a6d4fec326
+DIST gcc-12.3.0-patches-2.tar.xz 14236 BLAKE2B 06c43662c9abb0fa3cf90d5e2273c69aecb9158e6cf6f23c04754ed5d686be2616e81e2502eb16f4298ddd50518ca7677e13249da9e9b091162d3931ff65e4fe SHA512 b0d4b85dbf1a54aaaa1997203b872e3106906b4ad49cde57e1428bc22b2f8e2d73b8cb10ae0d0b792aebaf664594da4d1dea04c44ddc34e59047410766db04d1
+DIST gcc-12.3.0-patches-3.tar.xz 14852 BLAKE2B 7a5f1f43063b15f424099afd72096212fbbbc5151ff01f2de15dfb6e7cf274981c8cfaedba9ef61576c9096fb172fc550a7deb5cd7d9366fd249fd5dd3951f76 SHA512 aa89e4c2ae02f4fb42229ad5167f2eaa3a8fae51118645bf07199fe2124b9c83948590662b053d08002ef709fa870ea88315fd4ccbe4441a74e9cb62edcb82fb
+DIST gcc-13-20240113.tar.xz 84356052 BLAKE2B 1fbfffc9f2afe443158e3f26182c8bdc3f3b599c5582762117831ecb6e6d3c1c69e8d2e5932f45eb7d534c3967e08a9f7b1bcec31aa5d7ac608bebff9f35120c SHA512 a59886f707cf18f684295031d4d9fc5b03396face1705e61852d7de98729c53ac4cf209e951d00c232f14e9dc48eee40dd92487db7cb6ad0e80f2339d6d9503a
+DIST gcc-13-20240210.tar.xz 84354416 BLAKE2B 5807623d3f7dd751b6dfe164cfd50d57b2f93485c23c3c2228a4a846a9a94cdad52a5e6f2806e5e7ee2a7b5526386ebdb339c44c7ea023d69f8652088a1b114d SHA512 14a01ced7ac2bfd9fc93de4e3819b4d0823fbe129d3f1faabeb707e9e3e2613b4173321b58b3648a7250e3b7ff5d94edfee60e6c38682f31a1f7b57b1c01433f
+DIST gcc-13-20240330.tar.xz 84407332 BLAKE2B 28b40915bf8e9ecf71b50d06fcdf69c01e87d3635f0c6b6159e003a0876453ada062cc538204604885e1350d226417fe9d7cbdb5e39146f9fde0d524ad34ff07 SHA512 4c4c4be522feb9ebe1bc868db59f0828de1154f80afad6c32bc2c7cf45df3797cb5e6dce2b35a297194ea87f81e34439f4d87bd88cabf0a29ce686e1b29e7a08
+DIST gcc-13-20240406.tar.xz 84392728 BLAKE2B 42a560b01677350c480bde2a7436a8be4d2259100dd6f2f9e7c5555adb3d13ee1f51bfae058ceb0cc2ca4d527b302b5250f26b3d6b26fa9c7a2f5715aa003a3f SHA512 e5ec524df7e9498a23ccfa42e28c5ce284fecdbb4771980328257d8251a11740c4cd3970d6bbe13052907b257d8e89b176d183c895168cf524dda12582d05d86
+DIST gcc-13-20240413.tar.xz 84405692 BLAKE2B 4df749357ed33afdb0255b4dc02ae568ce12e461c07a535f3736c2dcd9f779391846097aeb99ed70f5f45dbc029244a0c994b84f1de1086cce3da23bba719984 SHA512 934857721e1a92ea709e1ff6f64dbb8a47df4c614935ec298ded0a19bb92342e50bb8ab7eccd6e3ab46ca00e86ed34b499d4b06379a689bf48bf4201f3956006
+DIST gcc-13.2.0-musl-patches-2.tar.xz 5292 BLAKE2B c057d6574d03c05854edaa9f3fd40e9149662b04f3ac7a7db3eb078d73a7b535726d1bf52e5b12736dedb2f9898ad731f2e48a6421fcfbf7b90f929dee072fcb SHA512 a691da0c87c443a5e9d23731f4005f27871c5b12bc9102873ffa24d374aa7b9fbd187c4f5635d23fa9ffb17e351e76173c2d3fdf40646e355c4cb314b538de69
+DIST gcc-13.2.0-patches-12.tar.xz 47404 BLAKE2B ed018bcd7429d1c7aace746cbfc4e59dae409fc0a35231320c1b44c96fff0d912eba5c72109c2deb883f5368159df02148b2d4373396b34da882164c61fe4387 SHA512 b7872a03870bce7b633e4af4329b24fe8f3d50d6d9173f63549f606ce062787748af7f79e7ec4afeb768968d6e8462a849bd1b94316ea6bb284551f99e811617
+DIST gcc-13.2.0-patches-14.tar.xz 46928 BLAKE2B fce23bc5315f35b04a4976550c4b44578944a1b17e40c7553351eeb8a1ef0f3a2538da5a5e1ae6f37b784ff11bbd8a44b8f6eec542be63e34d984dee69e1cd81 SHA512 d7d52bb2915fd89c06b0134bede8db939cadbb1f2dcddf923bee2c3f9f577ff9e5e986b60420d892539edf82867a0d1bd635807814bc618b06a2b37cdaca893a
+DIST gcc-13.2.0-patches-15.tar.xz 47052 BLAKE2B f145341813d6baf9cbcc3e8421c7f427148503d2aeddd6a2eaac1ad3d470a818292392861542a7915d8b0f2f9b3255603f394b2e6833141658fc035bcd2b5366 SHA512 c89a3fccd944f03d25e076a967c3b220803ee9a6fbedec1daf2c20f629dd6162ce6be4f259522bd193169f0e8307daa9895b5d8581cf975ee086e5abfd675e34
+DIST gcc-14-20240317.tar.xz 87764960 BLAKE2B 5cd957c3bf5e2fbb134b716a7ed14c0ace66d5c944e15422e66affbf110b76ba3b4bf83a05af49eec23d8f1543ca36c3d6ce81fa1b292cba47eceb517c3a7352 SHA512 77ade098872f687a3fb23dcb612eeed27a3ecf816304a218d695d2be7433576ceafcb13a9cfde3ed7fc9e48bfaee8521b77cfbabfe41b2557328cc95f3e73ebe
+DIST gcc-14-20240324.tar.xz 87808876 BLAKE2B 546b69f4562cfee6a3d5d8700e2a9bd0da001e3dde04825754ec5298144243ea4c975d0bf0366711fc9680f263732afb40c083fe9268f578b89e7d006b8d4955 SHA512 16b00690bf541784a109bc2382bbdf8ba6b72b416b130905d020182708ae687cbeca28197ab16539032ce9db3ad0e062e4231f9ef4c2d2452b14ed2b0ff3596e
+DIST gcc-14-20240331.tar.xz 87841560 BLAKE2B 7a3c0beb8234c38e4ad5d27369e848c178053a595bb6a4d2f5e2c848c5ddcd8a89b7674190d6964d5b3fd49709fb3f9be22e651a21543384f0210355bfca79fc SHA512 c7883d3ecb65e46783d8ce5efa87b53600aa84736a9af026b51ed5fdd827cae20729d4cb5cba70d3322ae7ca72c2d5a6944e5dee4174226bfc3c6398777d6377
+DIST gcc-14-20240407.tar.xz 87887372 BLAKE2B 76f9994af354fdd262420d80c6780dbf447a2ef64f09702523c31056d662227571d70cffab067ba82bcf4dee02a81a072382cb579a15af6f0b5edd4c1e51c1af SHA512 02d1ff0ee65ab7b0159d3d22a30ffd9055f3e7bf5f598663d5b711092dedd96bc67b511da37cbc785987d2f3460e2e38653c8fe6c7c3d34970fa1055db33cc0c
+DIST gcc-14-20240414.tar.xz 87980364 BLAKE2B 9b8d4ff7127d5f5cf805d6caa6956acaf24be3d628cbbd82d6bf926e40c8ed0088bf2bf386072ca3ea93ee4d945e4270c1977a5cf96ae4ff24ae32ce768fffa5 SHA512 552d0c49e3903cc42b46f44f1cedd5f1135997cebcd9e1d28c01474ef4365b1136cccb490923923c7633dfe94d744c8882fda1bb286a7dcb2cc26a90d4c3e99f
+DIST gcc-14.0.0-musl-patches-1.tar.xz 3576 BLAKE2B 692baee8a7709905d53aeb150d73a3721c4ba47ee5f397cfb1b5be905cf003ca02b60c94ee294d90ac39645cd5cdf186c7a3aa950c47d8cf680c128ed705b807 SHA512 0592ab98a7142e404623a6511c67dff61e9ade32c3fb2c0e75b456306e0af3799ad13252b50b3d2fdd31e5815d7f0b16b0ad63ab8386fe4d78729fc9c182d617
+DIST gcc-14.0.0-patches-25.tar.xz 12352 BLAKE2B c006fa3c2454ef4db073f718d54cab33d2832d233199469b1755f23bb168fd725eaec7ad60fb89e4e9965ad2870c35a232edd07ea2a781ca1f0d67964ad4c2e6 SHA512 1ab587c2e9873dd93356dfff30f02916811392b4c878e16f5b2129f833a974f96245deb6db346dde01e07e4ab162bb83be7c5ba1e1edd32efc0404a422268c52
+DIST gcc-14.0.0-patches-26.tar.xz 12360 BLAKE2B a2fdd6ff1774bc94f96bc4f7da4092c373936c93e04b94e75701227ab55d530523fee6b561773d05080e51748cc7716868d8b108f51a06e37a2c26a1d7f39b33 SHA512 1275e6345417ee196e74c46845d05508c8662d71e2432fbfbf7f1eb9c220657b4ee8e3b0ca02b7b4c7e14df164f254380c65af91cadc3bda4cd7afbe6af5ea8b
+DIST gcc-8.5.0-patches-4.tar.xz 18616 BLAKE2B 7594cbaea5daecf1a0b3d526c06aeba0a84c6da66aee2e105a51fda6be8d30a37ccc3814281b284a4582d892a1d556bca063551584edfc2525bed8ea5b6888e7 SHA512 1aa5742c361186637e7855f06feb1a4547e7d4d5de6e51f3d049e0ef3c19e2eff179465f52781739f59422035b7f8e4c0efa3844849f920f3c96acfdc37ca6a6
DIST gcc-8.5.0.tar.xz 63841008 BLAKE2B aa81a1a730fd7371360f6abed6ba78b5843fd18c58d5de5687acc320741b9e430e85df3535a1ef7a26051409be8d2f0945f503e5968480d919103123a99d4b12 SHA512 92f599680e6b7fbce88bcdda810f468777d541e5fddfbb287f7977d51093de2a5178bd0e6a08dfe37090ea10a0508a43ccd00220041abbbec33f1179bfc174d8
-DIST gcc-9.4.0-musl-patches-1.tar.bz2 2337 BLAKE2B 7bddc631c9f0e68884acb2bb603e2867e1f65e44f3bd519844341984fa17f323a953bca21cfc05a0f84f7da943c83f2f5341899c917ab88891ac33ccafeb8f75 SHA512 b2cf463613011892b07d1a932f402d7606aa3fce4e059c342996c4ef6aa37f20159812a81fa82897b2caf658853644c5075d23c81d04c4c98e06a72bd9680488
-DIST gcc-9.4.0-patches-1.tar.bz2 14012 BLAKE2B d5fbfd73d9c3a5b66be5b124d981fe5a7468363c83784989a50731f87931435f4b6302e4c20a64b20680581ed40005eff7bdd5855526a093f73a04c3c1ddab31 SHA512 b84884c7d2197cb14229d3321b98cd66c783cf9ebf7e5d1b1186e6cf32ee9e47d004ebad26118f9c848f9bc0a3783ceb23d9b65101d98c3bfa99874e66ee7cbc
-DIST gcc-9.4.0.tar.xz 72411232 BLAKE2B 4bb000d33d6bd2d6cc91c040713f27f79dcf726ef8ab1542c711e0c25651507628510b1373bc73aef71ffb660afddb2eb8d8c8540f5f1498ee243cfff6c0be67 SHA512 dfd3500bf21784b8351a522d53463cf362ede66b0bc302edf350bb44e94418497a8b4b797b6af8ca9b2eeb746b3b115d9c3698381b989546e9151b4496415624
+DIST gcc-9.5.0-patches-2.tar.xz 14324 BLAKE2B 1d3bf3e673108ad2fcdcb86daefb4603d1c9f6aa815e34d1591054d466b76d6f50cce124ab4760528c4951ea16eb00888a3e6485417f81ebf250548732df4a8e SHA512 a6d6f650aaf0bd193a17ac279649f0544a282cea295824384c59341c3000eac4b574b60e00dd427585d928f9768166abf85168b47772132790ad98854acacbbf
+DIST gcc-9.5.0.tar.xz 72462752 BLAKE2B 69e39314ee6bb46e3be491ba9c3cbc4914cb716f732c6d3f2b14d9382750b40c4f14b5d3051225b81f936ef8297b0ba8cb5439512e961dae5815d3bee2b0bfdb SHA512 cdd144ce4f747e051480410afc8506c90a57cb45da89071ddae377b1453bca3014422455ade9fe4563ebe51f4b6348cbc0c61905a9b8801cd597d51ad0ec62b3
+DIST gcc-validate-failures-7bbfb01a32b73842f8908de028703510a0e12057.py 27533 BLAKE2B 58917750d247d3a9e7078c62fd4412027a7d02d06c659a9c0743697529754218257c00dc6e10dff467e78b4e019225c39b1627b48a5298d13481a7072748a15f SHA512 b74d6358538d1b076f3d5b6632ea405b99627d5b5621b6f5101cb3453be13ba41e11d590039535b0c74b1624b69885a7093600d5395cc60bc63cea15ae7472b3
diff --git a/sys-devel/gcc/files/gcc-11.2.0-cross-compile-include.patch b/sys-devel/gcc/files/gcc-11.2.0-cross-compile-include.patch
deleted file mode 100644
index d06410650bb0..000000000000
--- a/sys-devel/gcc/files/gcc-11.2.0-cross-compile-include.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-https://bugs.gentoo.org/803371
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80196
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017
---- a/configure
-+++ b/configure
-@@ -17044,7 +17044,7 @@ else
- fi
-
-
--RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
-+RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target ar" >&5
- $as_echo_n "checking where to find the target ar... " >&6; }
---- a/configure.ac
-+++ b/configure.ac
-@@ -3529,7 +3529,7 @@ ACX_CHECK_INSTALLED_TARGET_TOOL(STRIP_FOR_TARGET, strip)
- ACX_CHECK_INSTALLED_TARGET_TOOL(WINDRES_FOR_TARGET, windres)
- ACX_CHECK_INSTALLED_TARGET_TOOL(WINDMC_FOR_TARGET, windmc)
-
--RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET"
-+RAW_CXX_FOR_TARGET="$CXX_FOR_TARGET -nostdinc++"
-
- GCC_TARGET_TOOL(ar, AR_FOR_TARGET, AR, [binutils/ar])
- GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
-
diff --git a/sys-devel/gcc/files/gcc-13-fix-cross-fixincludes.patch b/sys-devel/gcc/files/gcc-13-fix-cross-fixincludes.patch
new file mode 100644
index 000000000000..6d1681938b07
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-13-fix-cross-fixincludes.patch
@@ -0,0 +1,21 @@
+Revert of https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=59e4c98173a79fcaa2c33253261409f38856c384
+for now to fix cross fixincludes builds.
+
+https://bugs.gentoo.org/905118
+https://bugs.gentoo.org/925204
+https://bugs.gentoo.org/926059
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -532,11 +532,7 @@ LINKER_PLUGIN_API_H = $(srcdir)/../include/plugin-api.h
+ # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
+ NATIVE_SYSTEM_HEADER_DIR = @NATIVE_SYSTEM_HEADER_DIR@
+ # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
+-ifeq (@includedir@,$(prefix)/include)
+- CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+-else
+- CROSS_SYSTEM_HEADER_DIR = @includedir@
+-endif
++CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+
+ # autoconf sets SYSTEM_HEADER_DIR to one of the above.
+ # Purge it of unnecessary internal relative paths
diff --git a/sys-devel/gcc/files/gcc-14.0.1_pre20240324-PR114439.patch b/sys-devel/gcc/files/gcc-14.0.1_pre20240324-PR114439.patch
new file mode 100644
index 000000000000..2f92ab10cebf
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-14.0.1_pre20240324-PR114439.patch
@@ -0,0 +1,112 @@
+https://bugs.gentoo.org/927657
+https://gcc.gnu.org/PR114439
+https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=de0886d48032332d10e4acb5d15c8789b281b6fe
+
+From de0886d48032332d10e4acb5d15c8789b281b6fe Mon Sep 17 00:00:00 2001
+From: Marek Polacek <polacek@redhat.com>
+Date: Mon, 25 Mar 2024 15:32:20 -0400
+Subject: [PATCH] c++: broken direct-init with trailing array member [PR114439]
+
+can_init_array_with_p is wrongly saying that the init for 's' here:
+
+ struct S {
+ int *list = arr;
+ int arr[];
+ };
+
+ struct A {
+ A() {}
+ S s[2]{};
+ };
+
+is invalid. But as process_init_constructor_array says, for "non-constant
+initialization of trailing elements with no explicit initializers" we use
+a VEC_INIT_EXPR wrapped in a TARGET_EXPR, built in process_init_constructor.
+
+Unfortunately we didn't have a test for this scenario so I didn't
+realize can_init_array_with_p must handle it.
+
+ PR c++/114439
+
+gcc/cp/ChangeLog:
+
+ * init.cc (can_init_array_with_p): Return true for a VEC_INIT_EXPR
+ wrapped in a TARGET_EXPR.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.dg/init/array65.C: New test.
+---
+ gcc/cp/init.cc | 6 ++++-
+ gcc/testsuite/g++.dg/init/array65.C | 38 +++++++++++++++++++++++++++++
+ 2 files changed, 43 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/g++.dg/init/array65.C
+
+diff --git a/gcc/cp/init.cc b/gcc/cp/init.cc
+index dbd37d47cbf..a93ce00800c 100644
+--- a/gcc/cp/init.cc
++++ b/gcc/cp/init.cc
+@@ -950,12 +950,16 @@ can_init_array_with_p (tree type, tree init)
+ mem-initializers of a constructor. */
+ if (DECL_DEFAULTED_FN (current_function_decl))
+ return true;
+- /* As an extension, we allow copying from a compound literal. */
+ if (TREE_CODE (init) == TARGET_EXPR)
+ {
+ init = TARGET_EXPR_INITIAL (init);
++ /* As an extension, we allow copying from a compound literal. */
+ if (TREE_CODE (init) == CONSTRUCTOR)
+ return CONSTRUCTOR_C99_COMPOUND_LITERAL (init);
++ /* VEC_INIT_EXPR is used for non-constant initialization of trailing
++ elements with no explicit initializers. */
++ else if (TREE_CODE (init) == VEC_INIT_EXPR)
++ return true;
+ }
+
+ return false;
+diff --git a/gcc/testsuite/g++.dg/init/array65.C b/gcc/testsuite/g++.dg/init/array65.C
+new file mode 100644
+index 00000000000..0b144f45a9d
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/init/array65.C
+@@ -0,0 +1,38 @@
++// PR c++/114439
++// { dg-do compile { target c++11 } }
++
++struct S {
++ int *list = arr;
++ __extension__ int arr[];
++};
++
++struct R {
++ int *list = arr;
++ int arr[2];
++};
++
++struct A {
++ A() {}
++ S s[2]{};
++};
++
++struct A2 {
++ A2() {}
++ S s[2]{ {}, {} };
++};
++
++struct B {
++ B() {}
++ R r[2]{};
++};
++
++struct B2 {
++ B2() {}
++ R r[2]{ {}, {} };
++};
++
++struct S1 { S1(); };
++struct S2 {
++ S2() {}
++ S1 a[1] {};
++};
+--
+2.39.3
diff --git a/sys-devel/gcc/files/gcc-configure-LANG.patch b/sys-devel/gcc/files/gcc-configure-LANG.patch
deleted file mode 100644
index d1b1b0353662..000000000000
--- a/sys-devel/gcc/files/gcc-configure-LANG.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-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/gcc-10.3.0-r2.ebuild b/sys-devel/gcc/gcc-10.3.0-r2.ebuild
deleted file mode 100644
index 0fc4ea78dc7a..000000000000
--- a/sys-devel/gcc/gcc-10.3.0-r2.ebuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PATCH_VER="3"
-MUSL_VER="1"
-
-inherit toolchain
-
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-
-RDEPEND=""
-BDEPEND="${CATEGORY}/binutils"
-
-src_prepare() {
- if has_version '>=sys-libs/glibc-2.32-r1'; then
- rm -v "${WORKDIR}/patch/23_all_disable-riscv32-ABIs.patch" || die
- fi
-
- toolchain_src_prepare
-
- eapply_user
-}
diff --git a/sys-devel/gcc/gcc-10.3.1_p20211126.ebuild b/sys-devel/gcc/gcc-10.3.1_p20211126.ebuild
deleted file mode 100644
index 911b768bcd30..000000000000
--- a/sys-devel/gcc/gcc-10.3.1_p20211126.ebuild
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PATCH_VER="0"
-PATCH_GCC_VER="10.4.0"
-MUSL_VER="1"
-MUSL_GCC_VER="10.3.0"
-
-inherit toolchain
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-
-RDEPEND=""
-BDEPEND="${CATEGORY}/binutils"
-
-src_prepare() {
- if has_version '>=sys-libs/glibc-2.32-r1'; then
- rm -v "${WORKDIR}/patch/23_all_disable-riscv32-ABIs.patch" || die
- fi
-
- toolchain_src_prepare
-
- eapply_user
-}
diff --git a/sys-devel/gcc/gcc-10.3.1_pre9999.ebuild b/sys-devel/gcc/gcc-10.3.1_pre9999.ebuild
deleted file mode 100644
index b9f40e39b02d..000000000000
--- a/sys-devel/gcc/gcc-10.3.1_pre9999.ebuild
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PATCH_GCC_VER="10.3.0"
-PATCH_VER="1"
-
-inherit toolchain
-
-# Don't keyword live ebuilds
-#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86"
-
-RDEPEND=""
-BDEPEND="${CATEGORY}/binutils"
-
-src_prepare() {
- local p upstreamed_patches=(
- # add them here
- )
- for p in "${upstreamed_patches[@]}"; do
- rm -v "${WORKDIR}/patch/${p}" || die
- done
-
- if has_version '>=sys-libs/glibc-2.32-r1'; then
- rm -v "${WORKDIR}/patch/23_all_disable-riscv32-ABIs.patch" || die
- fi
-
- toolchain_src_prepare
-}
diff --git a/sys-devel/gcc/gcc-10.5.0.ebuild b/sys-devel/gcc/gcc-10.5.0.ebuild
new file mode 100644
index 000000000000..9203c7468723
--- /dev/null
+++ b/sys-devel/gcc/gcc-10.5.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="10.5.0"
+PATCH_VER="6"
+MUSL_VER="2"
+MUSL_GCC_VER="10.5.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+ :;
+fi
+
+RDEPEND=""
+BDEPEND="${CATEGORY}/binutils"
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ if has_version '>=sys-libs/glibc-2.32-r1'; then
+ rm -v "${WORKDIR}/patch/23_all_disable-riscv32-ABIs.patch" || die
+ fi
+
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/gcc-11.2.0.ebuild b/sys-devel/gcc/gcc-11.2.0.ebuild
deleted file mode 100644
index 92a4dc61b1f7..000000000000
--- a/sys-devel/gcc/gcc-11.2.0.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PATCH_VER="1"
-MUSL_VER="1"
-
-inherit toolchain
-
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-
-RDEPEND=""
-BDEPEND="${CATEGORY}/binutils"
-
-src_prepare() {
- toolchain_src_prepare
-
- if tc-is-cross-compiler ; then
- # bug #803371
- eapply "${FILESDIR}"/gcc-11.2.0-cross-compile-include.patch
- fi
-
- eapply_user
-}
diff --git a/sys-devel/gcc/gcc-11.2.1_p20211127.ebuild b/sys-devel/gcc/gcc-11.2.1_p20211127.ebuild
deleted file mode 100644
index cf332f7e6ce2..000000000000
--- a/sys-devel/gcc/gcc-11.2.1_p20211127.ebuild
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PATCH_VER="3"
-PATCH_GCC_VER="11.3.0"
-MUSL_VER="1"
-MUSL_GCC_VER="11.2.0"
-
-inherit toolchain
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-
-# Technically only if USE=hardened *too* right now, but no point in complicating it further.
-# If GCC is enabling CET by default, we need glibc to be built with support for it.
-# bug #830454
-RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
-DEPEND="${RDEPEND}"
-BDEPEND="${CATEGORY}/binutils[cet(-)?]"
-
-src_prepare() {
- toolchain_src_prepare
-
- if tc-is-cross-compiler ; then
- # bug #803371
- eapply "${FILESDIR}"/gcc-11.2.0-cross-compile-include.patch
- fi
-
- eapply_user
-}
diff --git a/sys-devel/gcc/gcc-11.2.1_pre9999.ebuild b/sys-devel/gcc/gcc-11.2.1_pre9999.ebuild
deleted file mode 100644
index b17d87e21b4f..000000000000
--- a/sys-devel/gcc/gcc-11.2.1_pre9999.ebuild
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PATCH_VER="3"
-PATCH_GCC_VER="11.3.0"
-MUSL_VER="1"
-MUSL_GCC_VER="11.2.0"
-
-inherit toolchain
-
-#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-
-# Technically only if USE=hardened *too* right now, but no point in complicating it further.
-# If GCC is enabling CET by default, we need glibc to be built with support for it.
-# bug #830454
-RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
-DEPEND="${RDEPEND}"
-BDEPEND="${CATEGORY}/binutils[cet(-)?]"
-
-src_prepare() {
- local p upstreamed_patches=(
- # add them here
- )
- for p in "${upstreamed_patches[@]}"; do
- rm -v "${WORKDIR}/patch/${p}" || die
- done
-
- toolchain_src_prepare
-
- if tc-is-cross-compiler ; then
- # bug #803371
- eapply "${FILESDIR}"/gcc-11.2.0-cross-compile-include.patch
- fi
-
- eapply_user
-}
diff --git a/sys-devel/gcc/gcc-11.4.1_p20240111.ebuild b/sys-devel/gcc/gcc-11.4.1_p20240111.ebuild
new file mode 100644
index 000000000000..7e0cd54888ec
--- /dev/null
+++ b/sys-devel/gcc/gcc-11.4.1_p20240111.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-11.4.1_p20240208.ebuild b/sys-devel/gcc/gcc-11.4.1_p20240208.ebuild
new file mode 100644
index 000000000000..9b1b89ca2bff
--- /dev/null
+++ b/sys-devel/gcc/gcc-11.4.1_p20240208.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-11.4.1_p20240328.ebuild b/sys-devel/gcc/gcc-11.4.1_p20240328.ebuild
new file mode 100644
index 000000000000..5ab7ed2dbcfa
--- /dev/null
+++ b/sys-devel/gcc/gcc-11.4.1_p20240328.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-11.4.1_p20240404.ebuild b/sys-devel/gcc/gcc-11.4.1_p20240404.ebuild
new file mode 100644
index 000000000000..9b1b89ca2bff
--- /dev/null
+++ b/sys-devel/gcc/gcc-11.4.1_p20240404.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-11.4.1_p20240411.ebuild b/sys-devel/gcc/gcc-11.4.1_p20240411.ebuild
new file mode 100644
index 000000000000..5ab7ed2dbcfa
--- /dev/null
+++ b/sys-devel/gcc/gcc-11.4.1_p20240411.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-11.4.1_p20240418.ebuild b/sys-devel/gcc/gcc-11.4.1_p20240418.ebuild
new file mode 100644
index 000000000000..5ab7ed2dbcfa
--- /dev/null
+++ b/sys-devel/gcc/gcc-11.4.1_p20240418.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-11.5.9999.ebuild b/sys-devel/gcc/gcc-11.5.9999.ebuild
new file mode 100644
index 000000000000..124b2c1eeeb5
--- /dev/null
+++ b/sys-devel/gcc/gcc-11.5.9999.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-12.0.0_pre9999.ebuild b/sys-devel/gcc/gcc-12.0.0_pre9999.ebuild
deleted file mode 100644
index d91ea5bdc31c..000000000000
--- a/sys-devel/gcc/gcc-12.0.0_pre9999.ebuild
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PATCH_VER="2"
-PATCH_GCC_VER="12.0.0"
-MUSL_VER="1"
-MUSL_GCC_VER="11.2.0"
-
-inherit toolchain
-# Needs to be after inherit (for now?), bug #830908
-EGIT_BRANCH=master
-
-# Don't keyword live ebuilds
-#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86"
-
-# Technically only if USE=hardened *too* right now, but no point in complicating it further.
-# If GCC is enabling CET by default, we need glibc to be built with support for it.
-# bug #830454
-RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
-DEPEND="${RDEPEND}"
-BDEPEND="${CATEGORY}/binutils[cet(-)?]"
-
-src_prepare() {
- local p upstreamed_patches=(
- # add them here
- )
- for p in "${upstreamed_patches[@]}"; do
- rm -v "${WORKDIR}/patch/${p}" || die
- done
-
- toolchain_src_prepare
-
- eapply_user
-}
diff --git a/sys-devel/gcc/gcc-12.3.1_p20240112.ebuild b/sys-devel/gcc/gcc-12.3.1_p20240112.ebuild
new file mode 100644
index 000000000000..6c45c55e4a05
--- /dev/null
+++ b/sys-devel/gcc/gcc-12.3.1_p20240112.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="12.3.0"
+PATCH_VER="2"
+MUSL_VER="1"
+MUSL_GCC_VER="12.3.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-12.3.1_p20240209.ebuild b/sys-devel/gcc/gcc-12.3.1_p20240209.ebuild
new file mode 100644
index 000000000000..f0ad270b596f
--- /dev/null
+++ b/sys-devel/gcc/gcc-12.3.1_p20240209.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="12.3.0"
+PATCH_VER="3"
+MUSL_VER="1"
+MUSL_GCC_VER="12.3.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-12.3.1_p20240329.ebuild b/sys-devel/gcc/gcc-12.3.1_p20240329.ebuild
new file mode 100644
index 000000000000..2c4b89e72445
--- /dev/null
+++ b/sys-devel/gcc/gcc-12.3.1_p20240329.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="12.3.0"
+PATCH_VER="3"
+MUSL_VER="1"
+MUSL_GCC_VER="12.3.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-12.3.1_p20240405.ebuild b/sys-devel/gcc/gcc-12.3.1_p20240405.ebuild
new file mode 100644
index 000000000000..2c4b89e72445
--- /dev/null
+++ b/sys-devel/gcc/gcc-12.3.1_p20240405.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="12.3.0"
+PATCH_VER="3"
+MUSL_VER="1"
+MUSL_GCC_VER="12.3.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-12.3.1_p20240412.ebuild b/sys-devel/gcc/gcc-12.3.1_p20240412.ebuild
new file mode 100644
index 000000000000..2c4b89e72445
--- /dev/null
+++ b/sys-devel/gcc/gcc-12.3.1_p20240412.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="12.3.0"
+PATCH_VER="3"
+MUSL_VER="1"
+MUSL_GCC_VER="12.3.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-12.4.9999.ebuild b/sys-devel/gcc/gcc-12.4.9999.ebuild
new file mode 100644
index 000000000000..4828fd444e14
--- /dev/null
+++ b/sys-devel/gcc/gcc-12.4.9999.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="12.3.0"
+MUSL_GCC_VER="12.3.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-13.2.1_p20240113-r1.ebuild b/sys-devel/gcc/gcc-13.2.1_p20240113-r1.ebuild
new file mode 100644
index 000000000000..27e1e5ab20bc
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.2.1_p20240113-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="13.2.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="13.2.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-13.2.1_p20240210.ebuild b/sys-devel/gcc/gcc-13.2.1_p20240210.ebuild
new file mode 100644
index 000000000000..e2094692e1f6
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.2.1_p20240210.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="13.2.0"
+PATCH_VER="14"
+MUSL_VER="2"
+MUSL_GCC_VER="13.2.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-13.2.1_p20240330.ebuild b/sys-devel/gcc/gcc-13.2.1_p20240330.ebuild
new file mode 100644
index 000000000000..1e4b87a7546c
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.2.1_p20240330.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="13.2.0"
+PATCH_VER="14"
+MUSL_VER="2"
+MUSL_GCC_VER="13.2.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-13.2.1_p20240406.ebuild b/sys-devel/gcc/gcc-13.2.1_p20240406.ebuild
new file mode 100644
index 000000000000..2a22fc220b4c
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.2.1_p20240406.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="13.2.0"
+PATCH_VER="15"
+MUSL_VER="2"
+MUSL_GCC_VER="13.2.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-13.2.1_p20240413.ebuild b/sys-devel/gcc/gcc-13.2.1_p20240413.ebuild
new file mode 100644
index 000000000000..2a22fc220b4c
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.2.1_p20240413.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="13.2.0"
+PATCH_VER="15"
+MUSL_VER="2"
+MUSL_GCC_VER="13.2.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-13.3.9999.ebuild b/sys-devel/gcc/gcc-13.3.9999.ebuild
new file mode 100644
index 000000000000..b7539bd2eccf
--- /dev/null
+++ b/sys-devel/gcc/gcc-13.3.9999.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="13.2.0"
+MUSL_GCC_VER="13.2.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-14.0.1_pre20240317.ebuild b/sys-devel/gcc/gcc-14.0.1_pre20240317.ebuild
new file mode 100644
index 000000000000..e809e40f6564
--- /dev/null
+++ b/sys-devel/gcc/gcc-14.0.1_pre20240317.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="14.0.0"
+PATCH_VER="25"
+MUSL_VER="1"
+MUSL_GCC_VER="14.0.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=master
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-14.0.1_pre20240324-r1.ebuild b/sys-devel/gcc/gcc-14.0.1_pre20240324-r1.ebuild
new file mode 100644
index 000000000000..41416832f8b5
--- /dev/null
+++ b/sys-devel/gcc/gcc-14.0.1_pre20240324-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="14.0.0"
+PATCH_VER="25"
+MUSL_VER="1"
+MUSL_GCC_VER="14.0.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=master
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply "${FILESDIR}"/${P}-PR114439.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-14.0.1_pre20240331.ebuild b/sys-devel/gcc/gcc-14.0.1_pre20240331.ebuild
new file mode 100644
index 000000000000..e809e40f6564
--- /dev/null
+++ b/sys-devel/gcc/gcc-14.0.1_pre20240331.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="14.0.0"
+PATCH_VER="25"
+MUSL_VER="1"
+MUSL_GCC_VER="14.0.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=master
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-14.0.1_pre20240407.ebuild b/sys-devel/gcc/gcc-14.0.1_pre20240407.ebuild
new file mode 100644
index 000000000000..00b7365febb9
--- /dev/null
+++ b/sys-devel/gcc/gcc-14.0.1_pre20240407.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="14.0.0"
+PATCH_VER="26"
+MUSL_VER="1"
+MUSL_GCC_VER="14.0.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=master
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-14.0.1_pre20240414.ebuild b/sys-devel/gcc/gcc-14.0.1_pre20240414.ebuild
new file mode 100644
index 000000000000..00b7365febb9
--- /dev/null
+++ b/sys-devel/gcc/gcc-14.0.1_pre20240414.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="14.0.0"
+PATCH_VER="26"
+MUSL_VER="1"
+MUSL_GCC_VER="14.0.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=master
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply "${FILESDIR}"/${PN}-13-fix-cross-fixincludes.patch
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-14.0.9999.ebuild b/sys-devel/gcc/gcc-14.0.9999.ebuild
new file mode 100644
index 000000000000..762b2f9aca6b
--- /dev/null
+++ b/sys-devel/gcc/gcc-14.0.9999.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="14.0.0"
+MUSL_GCC_VER="14.0.0"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=master
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ # Don't keyword live ebuilds
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ :;
+fi
+
+if [[ ${CATEGORY} != cross-* ]] ; then
+ # Technically only if USE=hardened *too* right now, but no point in complicating it further.
+ # If GCC is enabling CET by default, we need glibc to be built with support for it.
+ # bug #830454
+ RDEPEND="elibc_glibc? ( sys-libs/glibc[cet(-)?] )"
+ DEPEND="${RDEPEND}"
+ BDEPEND="amd64? ( >=${CATEGORY}/binutils-2.30[cet(-)?] )"
+fi
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+
+ eapply_user
+}
diff --git a/sys-devel/gcc/gcc-6.5.0-r4.ebuild b/sys-devel/gcc/gcc-6.5.0-r4.ebuild
deleted file mode 100644
index 3136ac508c4a..000000000000
--- a/sys-devel/gcc/gcc-6.5.0-r4.ebuild
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PATCH_VER="6"
-
-inherit toolchain
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
-
-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
diff --git a/sys-devel/gcc/gcc-7.5.0-r2.ebuild b/sys-devel/gcc/gcc-7.5.0-r2.ebuild
deleted file mode 100644
index 63d0a121cf09..000000000000
--- a/sys-devel/gcc/gcc-7.5.0-r2.ebuild
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PATCH_VER="4"
-
-inherit toolchain
-
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~ppc-macos"
-
-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
diff --git a/sys-devel/gcc/gcc-8.5.0-r1.ebuild b/sys-devel/gcc/gcc-8.5.0-r1.ebuild
index e5b72b981c98..71a72ec0dc9e 100644
--- a/sys-devel/gcc/gcc-8.5.0-r1.ebuild
+++ b/sys-devel/gcc/gcc-8.5.0-r1.ebuild
@@ -1,9 +1,12 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
-PATCH_VER="2"
+TOOLCHAIN_PATCH_SUFFIX="xz"
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_VER="4"
+PYTHON_COMPAT=( python3_{10..11} )
inherit toolchain
diff --git a/sys-devel/gcc/gcc-9.4.0.ebuild b/sys-devel/gcc/gcc-9.4.0.ebuild
deleted file mode 100644
index 7c210388c018..000000000000
--- a/sys-devel/gcc/gcc-9.4.0.ebuild
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PATCH_VER="1"
-MUSL_VER="1"
-inherit toolchain
-
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-
-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
diff --git a/sys-devel/gcc/gcc-9.4.1_pre9999.ebuild b/sys-devel/gcc/gcc-9.4.1_pre9999.ebuild
deleted file mode 100644
index 8c31f450a34c..000000000000
--- a/sys-devel/gcc/gcc-9.4.1_pre9999.ebuild
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PATCH_GCC_VER="9.4.0"
-PATCH_VER="1"
-
-inherit toolchain
-
-# Don't keyword live ebuilds
-#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86"
-
-RDEPEND=""
-BDEPEND="${CATEGORY}/binutils"
-
-src_prepare() {
- local p upstreamed_patches=(
- # add them here
- )
- for p in "${upstreamed_patches[@]}"; do
- rm -v "${WORKDIR}/patch/${p}" || die
- done
-
- toolchain_src_prepare
-}
diff --git a/sys-devel/gcc/gcc-9.5.0.ebuild b/sys-devel/gcc/gcc-9.5.0.ebuild
new file mode 100644
index 000000000000..9208cb574215
--- /dev/null
+++ b/sys-devel/gcc/gcc-9.5.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="9.5.0"
+PATCH_VER="2"
+PYTHON_COMPAT=( python3_{10..11} )
+
+if [[ ${PV} == *.9999 ]] ; then
+ MY_PV_2=$(ver_cut 2)
+ MY_PV_3=1
+ if [[ ${MY_PV_2} == 0 ]] ; then
+ MY_PV_2=0
+ MY_PV_3=0
+ else
+ MY_PV_2=$((${MY_PV_2} - 1))
+ fi
+
+ # e.g. 12.2.9999 -> 12.1.1
+ TOOLCHAIN_GCC_PV=$(ver_cut 1).${MY_PV_2}.${MY_PV_3}
+elif [[ -n ${TOOLCHAIN_GCC_RC} ]] ; then
+ # Cheesy hack for RCs
+ MY_PV=$(ver_cut 1).$((($(ver_cut 2) + 1))).$((($(ver_cut 3) - 1)))-RC-$(ver_cut 5)
+ MY_P=${PN}-${MY_PV}
+ GCC_TARBALL_SRC_URI="mirror://gcc/snapshots/${MY_PV}/${MY_P}.tar.xz"
+ TOOLCHAIN_SET_S=no
+ S="${WORKDIR}"/${MY_P}
+fi
+
+inherit toolchain
+
+if tc_is_live ; then
+ # Needs to be after inherit (for now?), bug #830908
+ EGIT_BRANCH=releases/gcc-$(ver_cut 1)
+elif [[ -z ${TOOLCHAIN_USE_GIT_PATCHES} ]] ; then
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
+fi
+
+RDEPEND=""
+BDEPEND="${CATEGORY}/binutils"
+
+src_prepare() {
+ local p upstreamed_patches=(
+ # add them here
+ )
+ for p in "${upstreamed_patches[@]}"; do
+ rm -v "${WORKDIR}/patch/${p}" || die
+ done
+
+ toolchain_src_prepare
+}
diff --git a/sys-devel/gcc/metadata.xml b/sys-devel/gcc/metadata.xml
index 8730f85e65dc..853d96579504 100644
--- a/sys-devel/gcc/metadata.xml
+++ b/sys-devel/gcc/metadata.xml
@@ -1,43 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="project">
- <email>toolchain@gentoo.org</email>
- <name>Gentoo Toolchain Project</name>
- </maintainer>
- <use>
- <flag name="ada">Build the ADA language (GNAT) frontend</flag>
- <flag name="awt">Useful only when building GCJ, this enables Abstract Window Toolkit
- (AWT) peer support on top of GTK+</flag>
- <flag name="cet" restrict="&gt;=sys-devel/gcc-10">Enable support for Intel Control Flow Enforcement Technology (CET)</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="gcj">Build the GCJ Java language frontend.</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="lto">Build using Link Time Optimizations (LTO)</flag>
- <flag name="mpx">Enable support for Intel Memory Protection Extensions (MPX)</flag>
- <flag name="nptl">Enable support for Native POSIX Threads Library, the new threading module (requires linux-2.6 or better usually)</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="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="systemtap">enable systemtap static probe points</flag>
- <flag name="valgrind">Enable valgrind annotations for gcc internals (useful for gcc debugging).</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>
+ <maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+ </maintainer>
+ <use>
+ <flag name="ada">Build the ADA language (GNAT) frontend</flag>
+ <flag name="cet" restrict="&gt;=sys-devel/gcc-10">
+ Enable support for control flow hijacking protection.
+
+ On amd64, this provides Intel Control Flow Enforcement Technology (CET).
+
+ On arm64, this provides Branch Target Identification (BTI)
+ and Pointer Authentication Code (PAC) support.
+
+ This is only effective on amd64 or arm64.
+
+ Only provides benefits on newer CPUs. For Intel, the CPU
+ must be at least as new as Tiger Lake. For AMD, it must be
+ at least as new as Zen 3. This is harmless on older CPUs,
+ but provides no benefit either.
+
+ For ARM64, PAC was introduced in armv8.3-a, and BTI was
+ introduced in armv8.5-a.
+
+ When combined with USE=hardened on amd64, GCC will set -fcf-protection
+ by default when building software. The effect is minimal
+ on systems which do not support it, other than a possible
+ small increase in codesize for the NOPs. The generated
+ code is therefore compatible with i686 at the earliest.
+
+ On arm64, GCC will set -mbranch-protection=standard by default
+ when building software.
+ </flag>
+ <flag name="d">Enable support for the D programming language</flag>
+ <flag name="debug">
+ Enables GCC's 'checking' facility via --enable-checking=yes,extra,rtl.
+
+ This adds checks to various compiler passes for integrity and input
+ validation. This can help catch possible miscompilations early as
+ well as latent bugs which could become real problems in future, but
+ at the cost of slower compile times when using GCC.
+
+ Unrelated to backtraces.
+ </flag>
+ <flag name="default-stack-clash-protection">
+ Build packages with stack clash protection on by default as
+ a hardening measure.
+
+ This enables -fstack-clash-protection by default which protects against
+ large memory allocations allowing stack smashing.
+
+ May cause slightly increased codesize, but modern compilers
+ have been adapted to optimize well for this case, as
+ this mitigation is now quite common.
+
+ See https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gcc-part-3
+ and https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt.
+ </flag>
+ <flag name="default-znow">
+ Request full relocation on start from ld.so by default.
+
+ This sets the -z,now (BIND_NOW) flag by default on all linker invocations. By
+ resolving all dynamic symbols at application startup, parts of the program
+ can be made read-only as a hardening measure.
+
+ This is closely related to RELRO which is also separately
+ enabled by default.
+
+ In some applications with many unresolved symbols (heavily plugin based,
+ for example), startup time may be impacted.
+ </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="ieee-long-double">Use accelerated 128-bit IEEE long double ABI (ppc64le only)</flag>
+ <flag name="jit">Enable libgccjit so other applications can embed gcc for Just-In-Time compilation.</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="lto">
+ Build using Link Time Optimizations (LTO).
+
+ Note that GCC is always built with support for building
+ other programs with LTO. This USE flag is for whether
+ GCC itself is built and optimized with LTO.
+ </flag>
+ <flag name="modula2">Build the GCC Modula-2 language frontend.</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).
+
+ GCC will build itself and then analyze the just-built
+ binary and then rebuild itself using the data obtained
+ from analysis of codepaths taken.
+
+ It does not affect whether GCC itself supports PGO
+ when building other software.
+
+ This substantially increases the build time needed for
+ building GCC itself.
+ </flag>
+ <flag name="rust">Build support for the Rust language, installs gccrs.</flag>
+ <flag name="sanitize">
+ Build support for various sanitizer functions (ASAN/TSAN/etc...)
+ to find runtime problems in applications.
+ </flag>
+ <flag name="ssp">Build packages with stack smashing protection on by default</flag>
+ <flag name="systemtap">enable systemtap static probe points</flag>
+ <flag name="vtv">
+ Build support for virtual table verification (a C++ hardening feature).
+
+ This does not control whether GCC defaults to using VTV>
+
+ Note that actually using VTV breaks ABI and hence the whole
+ system must be built with -fvtable-verify.
+ </flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:gnu:gcc</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/gdb-apple/Manifest b/sys-devel/gdb-apple/Manifest
deleted file mode 100644
index d52e9873b523..000000000000
--- a/sys-devel/gdb-apple/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST gdb-1752.tar.gz 17922994 BLAKE2B 9b27bca2b6a9f10e01d130d595270300a4e7f0040790c5b60337d41086e1238dc12d785cc88c484df630f742ddfe783f7baefc2132b47e41bb74a5d0b7ebbf1e SHA512 863a861a9a7708b8a763ea93599f6b519277f23fff35700d04e81a7747cc49421d0f051790deb92c440ced30ee15ba719b75066d5a614341e0f0b765d7a81094
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
deleted file mode 100644
index a05169cec25d..000000000000
--- a/sys-devel/gdb-apple/files/gdb-apple-1518-darwin8-9.patch
+++ /dev/null
@@ -1,87 +0,0 @@
---- 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
deleted file mode 100644
index f8ecc30be7f6..000000000000
--- a/sys-devel/gdb-apple/files/gdb-apple-1518-darwin8.patch
+++ /dev/null
@@ -1,128 +0,0 @@
---- 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-1705-darwin8-10.patch b/sys-devel/gdb-apple/files/gdb-apple-1705-darwin8-10.patch
deleted file mode 100644
index 32247431fe89..000000000000
--- a/sys-devel/gdb-apple/files/gdb-apple-1705-darwin8-10.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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-768-texinfo.patch b/sys-devel/gdb-apple/files/gdb-apple-768-texinfo.patch
deleted file mode 100644
index 41153d8436de..000000000000
--- a/sys-devel/gdb-apple/files/gdb-apple-768-texinfo.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- 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-no-global-gdbinit.patch b/sys-devel/gdb-apple/files/gdb-apple-no-global-gdbinit.patch
deleted file mode 100644
index 0c132ec5b384..000000000000
--- a/sys-devel/gdb-apple/files/gdb-apple-no-global-gdbinit.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-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-1752.ebuild b/sys-devel/gdb-apple/gdb-apple-1752.ebuild
deleted file mode 100644
index e9abe3a3f5d7..000000000000
--- a/sys-devel/gdb-apple/gdb-apple-1752.ebuild
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit flag-o-matic toolchain-funcs
-
-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"
-
-IUSE="nls"
-
-RDEPEND=">=sys-libs/ncurses-5.2-r2:0=
- sys-libs/readline:0=
- =dev-db/sqlite-3*"
-DEPEND="${RDEPEND}
- nls? ( sys-devel/gettext )
- || ( >=sys-devel/gcc-apple-4.2.1 sys-devel/llvm:* )"
-
-S=${WORKDIR}/gdb-${APPLE_PV}/src
-
-PATCHES=(
- "${FILESDIR}"/${PN}-no-global-gdbinit.patch
- "${FILESDIR}"/${PN}-768-texinfo.patch
- "${FILESDIR}"/${PN}-1518-darwin8-9.patch
- "${FILESDIR}"/${PN}-1705-darwin8-10.patch
-)
-
-src_prepare() {
- default
- [[ ${CHOST} == *-darwin8 ]] && eapply "${FILESDIR}"/${PN}-1518-darwin8.patch
-
- # use host readline
- sed -i -e '/host_libs/s/readline//' configure.in configure || die
- sed -i \
- -e '/^\(READLINE\|readline\)_/s/=.*$/=/' \
- -e '/^READLINE /s/=.*$/= -lreadline/' \
- gdb/Makefile.in || die
-}
-
-src_configure() {
- if tc-is-gcc ; then
- # force gcc-apple, FSF gcc doesn't grok this code
- export CC=${CTARGET:-${CHOST}}-gcc-4.2.1
- export CXX=${CTARGET:-${CHOST}}-g++-4.2.1
- fi
-
- replace-flags -O? -O2
- econf \
- --disable-werror \
- --disable-debug-symbols-framework \
- $(use_enable nls)
-}
-
-src_compile() {
- # unable to work around parallel make issue
- # ignore texinfo issues (version mismatch, to hard to fix or
- # disable)
- emake -j2 MAKEINFOFLAGS="--force"
-}
-
-src_install() {
- emake -j2 \
- DESTDIR="${D}" libdir=/nukeme includedir=/nukeme \
- MAKEINFOFLAGS="--force" 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 [[ ${CHOST} == *86* ]] ; 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/metadata.xml b/sys-devel/gdb-apple/metadata.xml
deleted file mode 100644
index 232d18dd1fa2..000000000000
--- a/sys-devel/gdb-apple/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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
deleted file mode 100644
index 322959616e0c..000000000000
--- a/sys-devel/gdb/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST gdb-10.2.tar.xz 21518900 BLAKE2B c5d31d80d2b454767d6f844e8471b012ad437c3872391b618fd7b14c5cf251b78e55d28c12e81382fd600f67e2f618ff5dbe3a7b737a5d5161ceb3542afbb90b SHA512 3653762ac008e065c37cd641653184c9ff7ce51ee2222ade1122bec9d6cc64dffd4fb74888ef11ac1942064a08910e96b7865112ad37f4602eb0a16bed074caa
-DIST gdb-11.1.tar.xz 22040696 BLAKE2B 6a639f6533f4008bfb469c23a26c4fcd039f1bc5dd33745f4876344451beb595d7a8843caeb5db70214924624c5b999f8831237d459bebf1cb2d2866f8b41ee2 SHA512 c40bf970e2f7c2107b29c5aa6a7150daa709d75ddadb73ac20742419d4637d158e3063a4c6ff6e47fae8ca8e1d36253973f85ea15445d004be6d5d7a2dd9bd46
diff --git a/sys-devel/gdb/files/gdb-10.1-cet.patch b/sys-devel/gdb/files/gdb-10.1-cet.patch
deleted file mode 100644
index 7477ff90ac95..000000000000
--- a/sys-devel/gdb/files/gdb-10.1-cet.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-https://bugs.gentoo.org/771765
-https://sourceware.org/PR27397
-
-On i586-like CPUs endbr32 added by -Wl,-z,ibt,-z,shstk
-generates crashing binaries and causes ./configure failure.
-
-From 847e4b3207f97762dc641db8d3b188081c3370c3 Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Fri, 12 Feb 2021 16:30:23 -0800
-Subject: [PATCH] GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs
-
----
- config/cet.m4 | 19 ++++++++++++++++---
- libiberty/configure | 29 +++++++++++++++++++++++++++++
- 2 files changed, 45 insertions(+), 3 deletions(-)
-
-diff --git a/config/cet.m4 b/config/cet.m4
-index c67fb4f35b6..7718be1afe8 100644
---- a/config/cet.m4
-+++ b/config/cet.m4
-@@ -130,6 +130,18 @@ fi
- if test x$may_have_cet = xyes; then
- if test x$cross_compiling = xno; then
- AC_TRY_RUN([
-+int
-+main ()
-+{
-+ asm ("endbr32");
-+ return 0;
-+}
-+ ],
-+ [have_multi_byte_nop=yes],
-+ [have_multi_byte_nop=no])
-+ have_cet=no
-+ if test x$have_multi_byte_nop = xyes; then
-+ AC_TRY_RUN([
- static void
- foo (void)
- {
-@@ -155,9 +167,10 @@ main ()
- bar ();
- return 0;
- }
-- ],
-- [have_cet=no],
-- [have_cet=yes])
-+ ],
-+ [have_cet=no],
-+ [have_cet=yes])
-+ fi
- if test x$enable_cet = xno -a x$have_cet = xyes; then
- AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
- fi
-diff --git a/libiberty/configure b/libiberty/configure
-index 160b8c9e8b1..29a690d44fc 100755
---- a/libiberty/configure
-+++ b/libiberty/configure
-@@ -5539,6 +5539,34 @@ else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-
-+int
-+main ()
-+{
-+ asm ("endbr32");
-+ return 0;
-+}
-+
-+_ACEOF
-+if ac_fn_c_try_run "$LINENO"; then :
-+ have_multi_byte_nop=yes
-+else
-+ have_multi_byte_nop=no
-+fi
-+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-+ conftest.$ac_objext conftest.beam conftest.$ac_ext
-+fi
-+
-+ have_cet=no
-+ if test x$have_multi_byte_nop = xyes; then
-+ if test "$cross_compiling" = yes; then :
-+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-+as_fn_error $? "cannot run test program while cross compiling
-+See \`config.log' for more details" "$LINENO" 5; }
-+else
-+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+/* end confdefs.h. */
-+
- static void
- foo (void)
- {
-@@ -5575,6 +5603,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
- fi
-
-+ fi
- if test x$enable_cet = xno -a x$have_cet = xyes; then
- as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
- fi
---
-2.29.2
-
diff --git a/sys-devel/gdb/files/gdb-10.2-DW_LLE-riscv64.patch b/sys-devel/gdb/files/gdb-10.2-DW_LLE-riscv64.patch
deleted file mode 100644
index 0d3e8c5cb949..000000000000
--- a/sys-devel/gdb/files/gdb-10.2-DW_LLE-riscv64.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=80d1206d7fea6eb756183e2825abdfd0f00cd976
-https://sourceware.org/PR27999
-
-From 80d1206d7fea6eb756183e2825abdfd0f00cd976 Mon Sep 17 00:00:00 2001
-From: Andreas Schwab <schwab@suse.de>
-Date: Mon, 21 Jun 2021 11:38:23 +0200
-Subject: [PATCH] gdb: Support DW_LLE_start_end
-
-Without that it is impossible to debug on riscv64.
-
---- a/gdb/dwarf2/loc.c
-+++ b/gdb/dwarf2/loc.c
-@@ -255,9 +255,27 @@ decode_debug_loclists_addresses (dwarf2_per_cu_data *per_cu,
- *new_ptr = loc_ptr;
- return DEBUG_LOC_OFFSET_PAIR;
-
-+ case DW_LLE_start_end:
-+ if (loc_ptr + 2 * addr_size > buf_end)
-+ return DEBUG_LOC_BUFFER_OVERFLOW;
-+
-+ if (signed_addr_p)
-+ *low = extract_signed_integer (loc_ptr, addr_size, byte_order);
-+ else
-+ *low = extract_unsigned_integer (loc_ptr, addr_size, byte_order);
-+
-+ loc_ptr += addr_size;
-+ if (signed_addr_p)
-+ *high = extract_signed_integer (loc_ptr, addr_size, byte_order);
-+ else
-+ *high = extract_unsigned_integer (loc_ptr, addr_size, byte_order);
-+
-+ loc_ptr += addr_size;
-+ *new_ptr = loc_ptr;
-+ return DEBUG_LOC_START_END;
-+
- /* Following cases are not supported yet. */
- case DW_LLE_startx_endx:
-- case DW_LLE_start_end:
- case DW_LLE_default_location:
- default:
- return DEBUG_LOC_INVALID_ENTRY;
diff --git a/sys-devel/gdb/files/gdb-10.2-sparc-nat.patch b/sys-devel/gdb/files/gdb-10.2-sparc-nat.patch
deleted file mode 100644
index 5e71efa0d33a..000000000000
--- a/sys-devel/gdb/files/gdb-10.2-sparc-nat.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 288e3189fce8f466ca60411c27e8f1c0dac5d582 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <siarheit@google.com>
-Date: Sun, 25 Apr 2021 20:50:38 +0100
-Subject: [PATCH] gdb: fix sparc build failure of linux-nat
-
-On sparc build failed as:
-
-```
-gdb/sparc-linux-nat.c: In member function
- 'virtual void sparc_linux_nat_target::fetch_registers(regcache*, int)':
-gdb/sparc-linux-nat.c:36:37:
- error: cannot convert 'regcache*' to 'process_stratum_target*'
- 36 | { sparc_fetch_inferior_registers (regcache, regnum); }
- | ^~~~~~~~
- | |
- | regcache*
-```
-
-The fix adopts gdb/sparc-nat.h API change in d1e93af64a6
-("gdb: set current thread in sparc_{fetch,collect}_inferior_registers").
-
-gdb/ChangeLog:
-
- * sparc-linux-nat.c (sparc_linux_nat_target): fix sparc build
- by passing `process_stratum_target*` parameter.
----
- gdb/sparc-linux-nat.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/gdb/sparc-linux-nat.c
-+++ b/gdb/sparc-linux-nat.c
-@@ -33,10 +33,10 @@ class sparc_linux_nat_target final : public linux_nat_target
- public:
- /* Add our register access methods. */
- void fetch_registers (struct regcache *regcache, int regnum) override
-- { sparc_fetch_inferior_registers (regcache, regnum); }
-+ { sparc_fetch_inferior_registers (this, regcache, regnum); }
-
- void store_registers (struct regcache *regcache, int regnum) override
-- { sparc_store_inferior_registers (regcache, regnum); }
-+ { sparc_store_inferior_registers (this, regcache, regnum); }
- };
-
- static sparc_linux_nat_target the_sparc_linux_nat_target;
---
-2.31.1
-
diff --git a/sys-devel/gdb/files/gdb-11.1-glibc-2.34-sim.patch b/sys-devel/gdb/files/gdb-11.1-glibc-2.34-sim.patch
deleted file mode 100644
index 15ab45f278f1..000000000000
--- a/sys-devel/gdb/files/gdb-11.1-glibc-2.34-sim.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=39d53d04357606a15efd400147fa7369d71baf2c;hp=46039d3632e32d9a404c1f18cf55f14c894e4627
-https://bugs.gentoo.org/813831
-
-From 39d53d04357606a15efd400147fa7369d71baf2c Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sun, 3 Oct 2021 12:02:53 -0400
-Subject: [PATCH 1/1] sim: filter out SIGSTKSZ [PR sim/28302]
-
-We map target signals to host signals so we can propagate signals
-between the host & simulated worlds. That means we need to know
-the symbolic names & values of all signals that might be sent.
-
-The tools that generate that list use signal.h and include all
-symbols that start with "SIG" so as to automatically include any
-new symbols that the C library might add. Unfortunately, this
-also picks up "SIGSTKSZ" which is not actually a signal itself,
-but a signal related setting -- it's the size of the stack when
-a signal is handled.
-
-By itself this doesn't super matter as we will never see a signal
-with that same value (since the range of valid signals tend to be
-way less than 1024, and the size of the default signal stack will
-never be that small). But with recent glibc changes that make this
-into a dynamic value instead of a compile-time constant, some users
-see build failures when building the sim.
-
-As suggested by Adam Sampson, update our scripts to ignore this
-symbol to simplify everything and avoid the build failure.
-
-Bug: https://sourceware.org/PR28302
----
- sim/bfin/linux-targ-map.h | 5 +----
- sim/common/gennltvals.py | 6 ++++--
- sim/common/nltvals.def | 1 -
- 3 files changed, 5 insertions(+), 7 deletions(-)
-
-diff --git a/sim/bfin/linux-targ-map.h b/sim/bfin/linux-targ-map.h
-index e9c8c8f273b..0340ed54764 100644
---- a/sim/bfin/linux-targ-map.h
-+++ b/sim/bfin/linux-targ-map.h
-@@ -30,6 +30,7 @@ echo
- # XXX: nothing uses this ?
- echo '#include <signal.h>' | \
- bfin-uclinux-gcc -E -dD -P - | \
-+grep -v SIGSTKSZ | \
- sed -r -n \
- -e '1istatic CB_TARGET_DEFS_MAP cb_linux_signal_map[] = {' \
- -e '$i\ \ { 0, -1, -1 }\n};' \
-@@ -1987,10 +1988,6 @@ static CB_TARGET_DEFS_MAP cb_linux_signal_map[] =
- #ifdef SIG_SETMASK
- # define TARGET_LINUX_SIG_SETMASK 2
- { "SIG_SETMASK", SIG_SETMASK, TARGET_LINUX_SIG_SETMASK },
--#endif
--#ifdef SIGSTKSZ
--# define TARGET_LINUX_SIGSTKSZ 8192
-- { "SIGSTKSZ", SIGSTKSZ, TARGET_LINUX_SIGSTKSZ },
- #endif
- { 0, -1, -1 }
- };
-diff --git a/sim/common/gennltvals.py b/sim/common/gennltvals.py
-index db3ff641d40..955ace34311 100755
---- a/sim/common/gennltvals.py
-+++ b/sim/common/gennltvals.py
-@@ -67,6 +67,7 @@ FILE_HEADER = f"""\
- def gentvals(output: TextIO, cpp: str, srctype: str, srcdir: Path,
- headers: Iterable[str],
- pattern: str,
-+ filter: str = r'^$',
- target: str = None):
- """Extract constants from the specified files using a regular expression.
-
-@@ -94,12 +95,13 @@ def gentvals(output: TextIO, cpp: str, srctype: str, srcdir: Path,
- srcfile = ''.join(f'#include <{x}>\n' for x in headers)
- syms = set()
- define_pattern = re.compile(r'^#\s*define\s+(' + pattern + ')')
-+ filter_pattern = re.compile(filter)
- for header in headers:
- with open(srcdir / header, 'r', encoding='utf-8') as fp:
- data = fp.read()
- for line in data.splitlines():
- m = define_pattern.match(line)
-- if m:
-+ if m and not filter_pattern.search(line):
- syms.add(m.group(1))
- for sym in sorted(syms):
- srcfile += f'#ifdef {sym}\nDEFVAL {{ "{sym}", {sym} }},\n#endif\n'
-@@ -129,7 +131,7 @@ def gen_common(output: TextIO, newlib: Path, cpp: str):
- ('errno.h', 'sys/errno.h'), 'E[A-Z0-9]*')
-
- gentvals(output, cpp, 'signal', newlib / 'newlib/libc/include',
-- ('signal.h', 'sys/signal.h'), r'SIG[A-Z0-9]*')
-+ ('signal.h', 'sys/signal.h'), r'SIG[A-Z0-9]*', filter=r'SIGSTKSZ')
-
- gentvals(output, cpp, 'open', newlib / 'newlib/libc/include',
- ('fcntl.h', 'sys/fcntl.h', 'sys/_default_fcntl.h'), r'O_[A-Z0-9]*')
-diff --git a/sim/common/nltvals.def b/sim/common/nltvals.def
-index 8ae88397249..8bc6ae59026 100644
---- a/sim/common/nltvals.def
-+++ b/sim/common/nltvals.def
-@@ -116,7 +116,6 @@
- { "SIGPROF", 27 },
- { "SIGQUIT", 3 },
- { "SIGSEGV", 11 },
-- { "SIGSTKSZ", 8192 },
- { "SIGSTOP", 17 },
- { "SIGSYS", 12 },
- { "SIGTERM", 15 },
---
-2.27.0
-
diff --git a/sys-devel/gdb/files/gdb-8.3.1-verbose-build.patch b/sys-devel/gdb/files/gdb-8.3.1-verbose-build.patch
deleted file mode 100644
index 06aa6084d2d2..000000000000
--- a/sys-devel/gdb/files/gdb-8.3.1-verbose-build.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Enable verbose build. By default gdb ignores even --disable-silent-rules.
-Override verbosity back to non-silent.
-
-https://bugs.gentoo.org/695936
---- a/gdb/silent-rules.mk
-+++ b/gdb/silent-rules.mk
-@@ -1,5 +1,4 @@
--# If V is undefined or V=0 is specified, use the silent/verbose/compact mode.
--V ?= 0
-+V ?= 1
- ifeq ($(V),0)
- ECHO_CXX = @echo " CXX $@";
- ECHO_CXXLD = @echo " CXXLD $@";
diff --git a/sys-devel/gdb/gdb-10.2-r1.ebuild b/sys-devel/gdb/gdb-10.2-r1.ebuild
deleted file mode 100644
index 19f08197ce03..000000000000
--- a/sys-devel/gdb/gdb-10.2-r1.ebuild
+++ /dev/null
@@ -1,259 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-PYTHON_COMPAT=( python3_{7,8,9,10} )
-
-inherit eutils flag-o-matic python-single-r1 toolchain-funcs
-
-export CTARGET=${CTARGET:-${CHOST}}
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-
-case ${PV} in
-9999*)
- # live git tree
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- SRC_URI=""
- ;;
-*.*.50.2???????)
- # weekly snapshots
- SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
- ;;
-*)
- # Normal upstream release
- SRC_URI="mirror://gnu/gdb/${P}.tar.xz
- ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
- ;;
-esac
-
-PATCH_VER=""
-PATCH_DEV=""
-DESCRIPTION="GNU debugger"
-HOMEPAGE="https://sourceware.org/gdb/"
-SRC_URI="${SRC_URI}
- ${PATCH_DEV:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz}
- ${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 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-fi
-IUSE="cet guile lzma multitarget nls +python +server source-highlight test vanilla xml xxhash"
-REQUIRED_USE="
- python? ( ${PYTHON_REQUIRED_USE} )
-"
-
-# ia64 kernel crashes when gdb testsuite is running
-RESTRICT="
- ia64? ( test )
-
- !test? ( test )
-"
-
-RDEPEND="
- dev-libs/mpfr:0=
- >=sys-libs/ncurses-5.2-r2:0=
- >=sys-libs/readline-7:0=
- sys-libs/zlib
- lzma? ( app-arch/xz-utils )
- python? ( ${PYTHON_DEPS} )
- guile? ( >=dev-scheme/guile-2.0 )
- xml? ( dev-libs/expat )
- source-highlight? (
- dev-util/source-highlight
- )
- xxhash? (
- dev-libs/xxhash
- )
-"
-DEPEND="${RDEPEND}"
-BDEPEND="
- app-arch/xz-utils
- sys-apps/texinfo
- virtual/yacc
- nls? ( sys-devel/gettext )
- source-highlight? ( virtual/pkgconfig )
- test? ( dev-util/dejagnu )
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch
- "${FILESDIR}"/${PN}-10.1-cet.patch
- "${FILESDIR}"/${PN}-10.2-sparc-nat.patch
- "${FILESDIR}"/${PN}-10.2-DW_LLE-riscv64.patch
-)
-
-pkg_setup() {
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- default
-
- strip-linguas -u bfd/po opcodes/po
- export CC_FOR_BUILD=$(tc-getBUILD_CC)
-
- # avoid using ancient termcap from host on Prefix systems
- sed -i -e 's/termcap tinfow/tinfow/g' \
- gdb/configure{.ac,} || die
-}
-
-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=(
- # portage's econf() does not detect presence of --d-d-t
- # because it greps only top-level ./configure. But not
- # gnulib's or gdb's configure.
- --disable-dependency-tracking
-
- --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}
-
- # avoid automagic dependency on (currently prefix) systems
- # systems with debuginfod library, bug #754753
- --without-debuginfod
-
- # Allow user to opt into CET for host libraries.
- # Ideally we would like automagic-or-disabled here.
- # But the check does not quite work on i686: bug #760926.
- $(use_enable cet)
- )
- local sysroot="${EPREFIX}/usr/${CTARGET}"
- is_cross && myconf+=(
- --with-sysroot="${sysroot}"
- --includedir="${sysroot}/usr/include"
- --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
- )
-
- # 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, which is triggered
- # whenever no --enable or --disable is given
- if is_cross || use !server ; then
- myconf+=( --disable-gdbserver )
- fi
-
- myconf+=(
- --enable-64-bit-bfd
- --disable-install-libbfd
- --disable-install-libiberty
- --enable-obsolete
- # 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_enable source-highlight)
- $(use multitarget && echo --enable-targets=all)
- $(use_with python python "${EPYTHON}")
- $(use_with xxhash)
- $(use_with guile)
- )
- 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
-
- # source-highlight is detected with pkg-config: bug #716558
- export ac_cv_path_pkg_config_prog_path="$(tc-getPKG_CONFIG)"
-
- # ensure proper compiler is detected for Clang builds: bug #831202
- export GCC_FOR_TARGET="${CC_FOR_TARGET:-$(tc-getCC)}"
-
- econf "${myconf[@]}"
-}
-
-src_install() {
- default
- find "${ED}"/usr -name libiberty.a -delete || 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 -rf "${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 gdbserver/gdbreplay ]] && dobin gdbserver/gdbreplay
-
- docinto gdb
- dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
- gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
- docinto sim
- dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
- if use server ; then
- docinto gdbserver
- dodoc 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*
-
- if use python; then
- python_optimize "${ED}"/usr/share/gdb/python/gdb
- fi
-}
-
-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-11.1.ebuild b/sys-devel/gdb/gdb-11.1.ebuild
deleted file mode 100644
index 3933cc2776b8..000000000000
--- a/sys-devel/gdb/gdb-11.1.ebuild
+++ /dev/null
@@ -1,267 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8,9,10} )
-inherit flag-o-matic python-single-r1 strip-linguas toolchain-funcs
-
-export CTARGET=${CTARGET:-${CHOST}}
-
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-
-case ${PV} in
- 9999*)
- # live git tree
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- SRC_URI=""
- ;;
- *.*.50.2???????)
- # weekly snapshots
- SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
- ;;
- *)
- # Normal upstream release
- SRC_URI="mirror://gnu/gdb/${P}.tar.xz
- ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
- ;;
-esac
-
-PATCH_VER=""
-PATCH_DEV=""
-DESCRIPTION="GNU debugger"
-HOMEPAGE="https://sourceware.org/gdb/"
-SRC_URI="${SRC_URI}
- ${PATCH_DEV:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz}
- ${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 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-fi
-
-IUSE="cet guile lzma multitarget nls +python +server source-highlight test vanilla xml xxhash"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-# ia64 kernel crashes when gdb testsuite is running
-RESTRICT="
- ia64? ( test )
- !test? ( test )
-"
-
-RDEPEND="
- dev-libs/mpfr:0=
- dev-libs/gmp:=
- >=sys-libs/ncurses-5.2-r2:0=
- >=sys-libs/readline-7:0=
- sys-libs/zlib
- lzma? ( app-arch/xz-utils )
- python? ( ${PYTHON_DEPS} )
- guile? ( >=dev-scheme/guile-2.0 )
- xml? ( dev-libs/expat )
- source-highlight? (
- dev-util/source-highlight
- )
- xxhash? (
- dev-libs/xxhash
- )
-"
-DEPEND="${RDEPEND}"
-BDEPEND="
- app-arch/xz-utils
- sys-apps/texinfo
- virtual/yacc
- nls? ( sys-devel/gettext )
- source-highlight? ( virtual/pkgconfig )
- test? ( dev-util/dejagnu )
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch
- "${FILESDIR}"/${P}-glibc-2.34-sim.patch
-)
-
-pkg_setup() {
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- default
-
- strip-linguas -u bfd/po opcodes/po
- export CC_FOR_BUILD=$(tc-getBUILD_CC)
-
- # avoid using ancient termcap from host on Prefix systems
- sed -i -e 's/termcap tinfow/tinfow/g' \
- gdb/configure{.ac,} || die
-}
-
-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=(
- # portage's econf() does not detect presence of --d-d-t
- # because it greps only top-level ./configure. But not
- # gnulib's or gdb's configure.
- --disable-dependency-tracking
-
- --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}
-
- # avoid automagic dependency on (currently prefix) systems
- # systems with debuginfod library, bug #754753
- --without-debuginfod
-
- # Allow user to opt into CET for host libraries.
- # Ideally we would like automagic-or-disabled here.
- # But the check does not quite work on i686: bug #760926.
- $(use_enable cet)
- )
-
- local sysroot="${EPREFIX}/usr/${CTARGET}"
-
- is_cross && myconf+=(
- --with-sysroot="${sysroot}"
- --includedir="${sysroot}/usr/include"
- --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
- )
-
- # 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, which is triggered
- # whenever no --enable or --disable is given
- if is_cross || use !server ; then
- myconf+=( --disable-gdbserver )
- fi
-
- myconf+=(
- --enable-64-bit-bfd
- --disable-install-libbfd
- --disable-install-libiberty
- --enable-obsolete
- # 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_enable source-highlight)
- $(use multitarget && echo --enable-targets=all)
- $(use_with python python "${EPYTHON}")
- $(use_with xxhash)
- $(use_with guile)
- )
-
- 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
-
- # source-highlight is detected with pkg-config: bug #716558
- export ac_cv_path_pkg_config_prog_path="$(tc-getPKG_CONFIG)"
-
- # ensure proper compiler is detected for Clang builds: bug #831202
- export GCC_FOR_TARGET="${CC_FOR_TARGET:-$(tc-getCC)}"
-
- econf "${myconf[@]}"
-}
-
-src_install() {
- default
-
- find "${ED}"/usr -name libiberty.a -delete || 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 -rf "${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 gdbserver/gdbreplay ]] && dobin gdbserver/gdbreplay
-
- docinto gdb
- dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
- gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
- docinto sim
- dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
-
- if use server ; then
- docinto gdbserver
- dodoc 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*
-
- if use python; then
- python_optimize "${ED}"/usr/share/gdb/python/gdb
- fi
-}
-
-pkg_postinst() {
- # Portage doesn't 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
deleted file mode 100644
index 1725c16abdac..000000000000
--- a/sys-devel/gdb/gdb-9999.ebuild
+++ /dev/null
@@ -1,266 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8,9,10} )
-inherit flag-o-matic python-single-r1 strip-linguas toolchain-funcs
-
-export CTARGET=${CTARGET:-${CHOST}}
-
-if [[ ${CTARGET} == ${CHOST} ]] ; then
- if [[ ${CATEGORY} == cross-* ]] ; then
- export CTARGET=${CATEGORY#cross-}
- fi
-fi
-
-is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
-
-case ${PV} in
- 9999*)
- # live git tree
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- SRC_URI=""
- ;;
- *.*.50.2???????)
- # weekly snapshots
- SRC_URI="ftp://sourceware.org/pub/gdb/snapshots/current/gdb-weekly-${PV}.tar.xz"
- ;;
- *)
- # Normal upstream release
- SRC_URI="mirror://gnu/gdb/${P}.tar.xz
- ftp://sourceware.org/pub/gdb/releases/${P}.tar.xz"
- ;;
-esac
-
-PATCH_VER=""
-PATCH_DEV=""
-DESCRIPTION="GNU debugger"
-HOMEPAGE="https://sourceware.org/gdb/"
-SRC_URI="${SRC_URI}
- ${PATCH_DEV:+https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz}
- ${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 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-fi
-
-IUSE="cet guile lzma multitarget nls +python +server source-highlight test vanilla xml xxhash"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-# ia64 kernel crashes when gdb testsuite is running
-RESTRICT="
- ia64? ( test )
- !test? ( test )
-"
-
-RDEPEND="
- dev-libs/mpfr:0=
- dev-libs/gmp:=
- >=sys-libs/ncurses-5.2-r2:0=
- >=sys-libs/readline-7:0=
- sys-libs/zlib
- lzma? ( app-arch/xz-utils )
- python? ( ${PYTHON_DEPS} )
- guile? ( >=dev-scheme/guile-2.0 )
- xml? ( dev-libs/expat )
- source-highlight? (
- dev-util/source-highlight
- )
- xxhash? (
- dev-libs/xxhash
- )
-"
-DEPEND="${RDEPEND}"
-BDEPEND="
- app-arch/xz-utils
- sys-apps/texinfo
- virtual/yacc
- nls? ( sys-devel/gettext )
- source-highlight? ( virtual/pkgconfig )
- test? ( dev-util/dejagnu )
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch
-)
-
-pkg_setup() {
- use python && python-single-r1_pkg_setup
-}
-
-src_prepare() {
- default
-
- strip-linguas -u bfd/po opcodes/po
- export CC_FOR_BUILD=$(tc-getBUILD_CC)
-
- # avoid using ancient termcap from host on Prefix systems
- sed -i -e 's/termcap tinfow/tinfow/g' \
- gdb/configure{.ac,} || die
-}
-
-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=(
- # portage's econf() does not detect presence of --d-d-t
- # because it greps only top-level ./configure. But not
- # gnulib's or gdb's configure.
- --disable-dependency-tracking
-
- --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}
-
- # avoid automagic dependency on (currently prefix) systems
- # systems with debuginfod library, bug #754753
- --without-debuginfod
-
- # Allow user to opt into CET for host libraries.
- # Ideally we would like automagic-or-disabled here.
- # But the check does not quite work on i686: bug #760926.
- $(use_enable cet)
- )
-
- local sysroot="${EPREFIX}/usr/${CTARGET}"
-
- is_cross && myconf+=(
- --with-sysroot="${sysroot}"
- --includedir="${sysroot}/usr/include"
- --with-gdb-datadir="\${datadir}/gdb/${CTARGET}"
- )
-
- # 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, which is triggered
- # whenever no --enable or --disable is given
- if is_cross || use !server ; then
- myconf+=( --disable-gdbserver )
- fi
-
- myconf+=(
- --enable-64-bit-bfd
- --disable-install-libbfd
- --disable-install-libiberty
- --enable-obsolete
- # 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_enable source-highlight)
- $(use multitarget && echo --enable-targets=all)
- $(use_with python python "${EPYTHON}")
- $(use_with xxhash)
- $(use_with guile)
- )
-
- 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
-
- # source-highlight is detected with pkg-config: bug #716558
- export ac_cv_path_pkg_config_prog_path="$(tc-getPKG_CONFIG)"
-
- # ensure proper compiler is detected for Clang builds: bug #831202
- export GCC_FOR_TARGET="${CC_FOR_TARGET:-$(tc-getCC)}"
-
- econf "${myconf[@]}"
-}
-
-src_install() {
- default
-
- find "${ED}"/usr -name libiberty.a -delete || 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 -rf "${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 gdbserver/gdbreplay ]] && dobin gdbserver/gdbreplay
-
- docinto gdb
- dodoc gdb/CONTRIBUTE gdb/README gdb/MAINTAINERS \
- gdb/NEWS gdb/ChangeLog gdb/PROBLEMS
- docinto sim
- dodoc sim/{ChangeLog,MAINTAINERS,README-HACKING}
-
- if use server ; then
- docinto gdbserver
- dodoc 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*
-
- if use python; then
- python_optimize "${ED}"/usr/share/gdb/python/gdb
- fi
-}
-
-pkg_postinst() {
- # Portage doesn't 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
deleted file mode 100644
index bcceccefd45a..000000000000
--- a/sys-devel/gdb/metadata.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
-<maintainer type="project">
- <email>toolchain@gentoo.org</email>
- <name>Gentoo Toolchain Project</name>
-</maintainer>
-<use>
- <flag name="cet">Enable Intel Control-flow Enforcement Technology.</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="source-highlight">Enable listing highlighting via <pkg>dev-util/source-highlight</pkg></flag>
- <flag name="xml">Support parsing XML data files needed (at least) for cpu features, memory maps, and syscall tracing</flag>
- <flag name="xxhash">Use <pkg>dev-libs/xxhash</pkg> to speed up internal hashing.</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
index 61bb66f324f9..fe3a242e1a81 100644
--- a/sys-devel/gettext/Manifest
+++ b/sys-devel/gettext/Manifest
@@ -1 +1,6 @@
-DIST gettext-0.21.tar.gz 24181849 BLAKE2B 2eae99d0916b00b2af6fbc6bf7e309076519a10fea16cd49e7aa29fe8aec1ee7c784c6277281b764dc4abacf400cd3fe461129586303c8cd337db15c76cb4b87 SHA512 bbe590c5dd3580c75bf30ff768da99a88eb8d466ec1ac9eea20be4cab4357ecf72448e6b81b47425e39d50fa6320ba426632914d7898dfebb4f159abc39c31d1
+DIST gettext-0.21.1.tar.xz 10054564 BLAKE2B e994924284b3fd5b3e3bf59d4bf43eb30c9b21cc213dc3b98616b4a9fc321c90911d94d314f323cfffd0d2c3e9371b5b8f7985b9a785adc61617dd042b6f4df5 SHA512 61e93bc9876effd3ca1c4e64ff6ba5bd84b24951ec2cc6f40a0e3248410e60f887552f29ca1f70541fb5524f6a4e8191fed288713c3e280e18922dd5bff1a2c9
+DIST gettext-0.21.1.tar.xz.sig 833 BLAKE2B f673436d315e972f9e110a1b5c8d1b2f20a32fc1b7ce027fcd3bc2fe7a81af183fb8db744cbed1a8c3a6ce1a13d55e19a8e8829fc944960fbfc7efcd9aaed91c SHA512 fba912830c57d0616fb66cf81da0cb7a3ab1e27497c45daa63249d3c9f85182a4f42dfeb1591d8f31c2a340ba0c519f04fd2f05429d1cf26a3ea316d047993d0
+DIST gettext-0.22.4.tar.xz 10255384 BLAKE2B 3f93aa5aef8e40d2e01acaa5aeed11efefd0de43ea26d084a0b9e743019685f7584d8e1bf05c1fd5772a5576d21ee1f052b81366f52c7827b6d14bd4d9890edc SHA512 0f3620b1621b85b3df9e372885c2f040c8a91ec0b2d4e16978459a8a2a152318a0e6f5fefb8d971bad80c437e7ee8ac8c24edc4de0ab86e729528b8a2ac62c51
+DIST gettext-0.22.4.tar.xz.sig 833 BLAKE2B fbb00b53c807934a11263c120861971fffebbd39689eda1fae0fb956476e69c3fb6799440cbf3acfcf43ecea2c134ea4dadb95becbac98badb43e546f3c8e9fb SHA512 a774c98de643b1ea3df645e451878652c2baa5cd786642aa457e6d5f5c44787cb1231eb15ad4390acdf314822633acaffffaa853eb69cbbc72c3b79b547a8854
+DIST gettext-0.22.5.tar.xz 10270724 BLAKE2B 18c383518f5a78b5c04cf76de976524da2a87a892a30d6386778bb4c7dd526ffc3f14f484906c5d3a513b7caf76ea560e53962b325e552182d6940055d798f24 SHA512 a60999bb9d09441f138214d87acb7e59aab81e765bb9253a77c54902681c5de164a5a04de2a9778dfb479dbdefaab2d5de1fbaf6095c555c43e7e9fd7a1c09bd
+DIST gettext-0.22.5.tar.xz.sig 833 BLAKE2B bb3e5ced34ab109f498347a3567103fe3491f69addb4a5ce25bf854fae1a11340eef1a9826b369d2416b53e5f7065aeebdb1609615f064cf7fb4151e82a5b4e5 SHA512 87f1df69206702be928b09a59a19ae4c23072cbc78ea16e76bfc4c929de76a3c0bb8e4eb2c3100c6e7b3b51d23e3b0e484c7e1d576ba7e25fd887934dc9ed8f7
diff --git a/sys-devel/gettext/files/gettext-0.21-musl-omit_setlocale_lock.patch b/sys-devel/gettext/files/gettext-0.21-musl-omit_setlocale_lock.patch
new file mode 100644
index 000000000000..e063785376dc
--- /dev/null
+++ b/sys-devel/gettext/files/gettext-0.21-musl-omit_setlocale_lock.patch
@@ -0,0 +1,37 @@
+OMIT_SETLOCALE_LOCK should be true when gl_get_setlocale_null_lock is provided by a dependency library, like GNU libintl.
+On Gentoo musl we use musl's libintl and gl_get_setlocale_null_lock is not provided by it, therefore we set OMIT_SETLOCALE_LOCK to 0.
+
+To properly fix this we should do AC_SEARCH_LIBS([gl_get_setlocale_null_lock], [intl], ...) in automake, but instead we do this
+hack to not get complacent. This should be fixed upstream.
+
+https://savannah.gnu.org/bugs/index.php?62659#comment7
+https://bugs.gentoo.org/830590
+diff --git a/gettext-tools/libgettextpo/Makefile.am b/gettext-tools/libgettextpo/Makefile.am
+index 59b016e..d92978d 100644
+--- a/gettext-tools/libgettextpo/Makefile.am
++++ b/gettext-tools/libgettextpo/Makefile.am
+@@ -40,7 +40,7 @@ AM_CPPFLAGS = \
+ -I../src -I$(top_srcdir)/src \
+ -I../intl -I$(top_srcdir)/../gettext-runtime/intl
+
+-DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=1 @DEFS@
++DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=0 @DEFS@
+
+ # libgettextpo contains the public API for PO files.
+ libgettextpo_la_SOURCES = \
+diff --git a/gettext-tools/libgettextpo/Makefile.in b/gettext-tools/libgettextpo/Makefile.in
+index f76efa5..aca3a81 100644
+--- a/gettext-tools/libgettextpo/Makefile.in
++++ b/gettext-tools/libgettextpo/Makefile.in
+@@ -804,7 +804,7 @@ CXXDEPMODE = @CXXDEPMODE@
+ CXXFLAGS = @CXXFLAGS@
+ CXX_CHOICE = @CXX_CHOICE@
+ CYGPATH_W = @CYGPATH_W@
+-DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=1 @DEFS@
++DEFS = -DIN_LIBGETTEXTPO=1 -DOMIT_SETLOCALE_LOCK=0 @DEFS@
+ DEPDIR = @DEPDIR@
+ DLLTOOL = @DLLTOOL@
+ DSYMUTIL = @DSYMUTIL@
+--
+2.35.1
+
diff --git a/sys-devel/gettext/files/gettext-0.21.1-java-autoconf.patch b/sys-devel/gettext/files/gettext-0.21.1-java-autoconf.patch
new file mode 100644
index 000000000000..a7471ac724c9
--- /dev/null
+++ b/sys-devel/gettext/files/gettext-0.21.1-java-autoconf.patch
@@ -0,0 +1,100 @@
+From b8fc039e4266570f5af5ee1c2cd201369a766f1e Mon Sep 17 00:00:00 2001
+From: Bruno Haible <bruno@clisp.org>
+Date: Tue, 11 Oct 2022 01:54:44 +0200
+Subject: [PATCH] Avoid warnings during configure execution with
+ --disable-java.
+
+Reported by Sam James <sam@cmpct.info>
+in <https://savannah.gnu.org/bugs/?63193>.
+
+* gettext-runtime/configure.ac: Expand gt_JAVACOMP_DISABLED inline.
+* gettext-tools/configure.ac: Expand gt_JAVAEXEC_DISABLED and
+gt_JAVACOMP_DISABLED inline.
+--- a/gettext-runtime/configure.ac
++++ b/gettext-runtime/configure.ac
+@@ -42,7 +42,16 @@ AS_IF([test "$JAVA_CHOICE" != no], [
+ BUILDJAVA=no
+ fi
+ ], [
+- gt_JAVACOMP_DISABLED
++ CONF_JAVAC=
++ HAVE_JAVAC_ENVVAR=
++ HAVE_GCJ_C=
++ HAVE_JAVAC=
++ HAVE_JIKES=
++ AC_SUBST([CONF_JAVAC])
++ AC_SUBST([HAVE_JAVAC_ENVVAR])
++ AC_SUBST([HAVE_GCJ_C])
++ AC_SUBST([HAVE_JAVAC])
++ AC_SUBST([HAVE_JIKES])
+ JAR=
+ BUILDJAVA=no
+ ])
+--- a/gettext-tools/configure.ac
++++ b/gettext-tools/configure.ac
+@@ -43,8 +43,28 @@ AS_IF([test "$JAVA_CHOICE" != no], [
+ BUILDJAVA=no
+ fi
+ ], [
+- gt_JAVAEXEC_DISABLED
+- gt_JAVACOMP_DISABLED
++ CONF_JAVA=
++ HAVE_JAVA_ENVVAR=
++ HAVE_GIJ=
++ HAVE_JAVA=
++ HAVE_JRE=
++ HAVE_JVIEW=
++ AC_SUBST([CONF_JAVA])
++ AC_SUBST([HAVE_JAVA_ENVVAR])
++ AC_SUBST([HAVE_GIJ])
++ AC_SUBST([HAVE_JAVA])
++ AC_SUBST([HAVE_JRE])
++ AC_SUBST([HAVE_JVIEW])
++ CONF_JAVAC=
++ HAVE_JAVAC_ENVVAR=
++ HAVE_GCJ_C=
++ HAVE_JAVAC=
++ HAVE_JIKES=
++ AC_SUBST([CONF_JAVAC])
++ AC_SUBST([HAVE_JAVAC_ENVVAR])
++ AC_SUBST([HAVE_GCJ_C])
++ AC_SUBST([HAVE_JAVAC])
++ AC_SUBST([HAVE_JIKES])
+ JAR=
+ BUILDJAVA=no
+ ])
+diff --git a/gettext-runtime/configure b/gettext-runtime/configure
+index 5e2d593..cf579ff 100755
+--- a/gettext-runtime/configure
++++ b/gettext-runtime/configure
+@@ -7070,7 +7070,11 @@ fi
+
+ else $as_nop
+
+- gt_JAVACOMP_DISABLED
++ CONF_JAVAC=
++ HAVE_JAVAC_ENVVAR=
++ HAVE_GCJ_C=
++ HAVE_JAVAC=
++ HAVE_JIKES=
+ JAR=
+ BUILDJAVA=no
+
+diff --git a/gettext-tools/configure b/gettext-tools/configure
+index f897bc3..3af54cd 100755
+--- a/gettext-tools/configure
++++ b/gettext-tools/configure
+@@ -8718,8 +8718,11 @@ fi
+
+ else $as_nop
+
+- gt_JAVAEXEC_DISABLED
+- gt_JAVACOMP_DISABLED
++ CONF_JAVAC=
++ HAVE_JAVAC_ENVVAR=
++ HAVE_GCJ_C=
++ HAVE_JAVAC=
++ HAVE_JIKES=
+ JAR=
+ BUILDJAVA=no
+
diff --git a/sys-devel/gettext/gettext-0.21-r1.ebuild b/sys-devel/gettext/gettext-0.21.1.ebuild
index bab939d0ebc9..4988b01ddbeb 100644
--- a/sys-devel/gettext/gettext-0.21-r1.ebuild
+++ b/sys-devel/gettext/gettext-0.21.1.ebuild
@@ -1,26 +1,29 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Note: Keep version bumps in sync with dev-libs/libintl.
-EAPI=7
+EAPI=8
-inherit mono-env libtool java-pkg-opt-2 multilib-minimal
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/gettext.asc
+inherit java-pkg-opt-2 libtool multilib-minimal verify-sig toolchain-funcs
DESCRIPTION="GNU locale utilities"
HOMEPAGE="https://www.gnu.org/software/gettext/"
-if [[ "${PV}" == *_rc* ]] ; then
- SRC_URI="https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.bz2"
+if [[ ${PV} == *_rc* ]] ; then
+ SRC_URI="https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.xz"
+ SRC_URI+=" verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.xz.sig )"
S="${WORKDIR}/${P/_/-}"
else
- SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+ SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
# 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"
-IUSE="acl cvs +cxx doc emacs git java ncurses nls openmp static-libs"
+IUSE="acl +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.
@@ -35,15 +38,13 @@ DEPEND=">=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
dev-libs/expat
acl? ( virtual/acl )
ncurses? ( sys-libs/ncurses:0= )
- java? ( >=virtual/jdk-1.8:= )"
+ java? ( virtual/jdk:1.8 )"
RDEPEND="${DEPEND}
- !git? ( cvs? ( dev-vcs/cvs ) )
git? ( dev-vcs/git )
- java? ( >=virtual/jre-1.8 )"
+ java? ( virtual/jre:1.8 )"
BDEPEND="
- !git? ( cvs? ( dev-vcs/cvs ) )
git? ( dev-vcs/git )
-"
+ verify-sig? ( sec-keys/openpgp-keys-gettext )"
PDEPEND="emacs? ( app-emacs/po-mode )"
MULTILIB_WRAPPED_HEADERS=(
@@ -62,12 +63,17 @@ PATCHES=(
"${FILESDIR}"/${PN}-0.20-parallel_install.patch #685530
"${FILESDIR}"/${PN}-0.21_rc1-avoid_eautomake.patch
"${FILESDIR}"/${PN}-0.21-CVE-2020-12825.patch
+ "${FILESDIR}"/${P}-java-autoconf.patch
)
QA_SONAME_NO_SYMLINK=".*/preloadable_libintl.so"
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
pkg_setup() {
- mono-env_pkg_setup
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
java-pkg-opt-2_pkg_setup
}
@@ -76,7 +82,19 @@ src_prepare() {
default
+ # gettext-0.21.1-java-autoconf.patch changes
+ # gettext-{runtime,tools}/configure.ac and the corresponding
+ # configure scripts. Avoid regenerating other autotools output.
+ touch -c gettext-{runtime,tools}/{aclocal.m4,Makefile.in,config.h.in,configure} || die
+
+ # Makefile.am adds a dependency on gettext-{runtime,tools}/configure.ac
+ touch -c configure || die
+
elibtoolize
+
+ if use elibc_musl || use elibc_Darwin; then
+ eapply "${FILESDIR}"/${PN}-0.21-musl-omit_setlocale_lock.patch
+ fi
}
multilib_src_configure() {
@@ -100,12 +118,14 @@ multilib_src_configure() {
# Never build bundled copy of libxml2.
--without-included-libxml
+ --disable-csharp
+ --without-cvs
+
$(use_enable acl)
$(use_enable cxx c++)
$(use_enable cxx libasprintf)
$(use_with git)
- $(usex git --without-cvs $(use_with cvs))
- $(use_enable java)
+ $(multilib_native_use_enable java)
$(use_enable ncurses curses)
$(use_enable nls)
$(use_enable openmp)
diff --git a/sys-devel/gettext/gettext-0.22.4.ebuild b/sys-devel/gettext/gettext-0.22.4.ebuild
new file mode 100644
index 000000000000..54fa2c5da80e
--- /dev/null
+++ b/sys-devel/gettext/gettext-0.22.4.ebuild
@@ -0,0 +1,189 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: Keep version bumps in sync with dev-libs/libintl.
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/gettext.asc
+inherit java-pkg-opt-2 libtool multilib-minimal verify-sig toolchain-funcs
+
+DESCRIPTION="GNU locale utilities"
+HOMEPAGE="https://www.gnu.org/software/gettext/"
+
+if [[ ${PV} == *_rc* ]] ; then
+ SRC_URI="
+ https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.xz
+ verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.xz.sig )
+ "
+ S="${WORKDIR}/${P/_/-}"
+else
+ SRC_URI="
+ mirror://gnu/${PN}/${P}.tar.xz
+ verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
+ "
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+
+# 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"
+IUSE="acl +cxx doc emacs git java ncurses nls openmp static-libs xattr"
+
+# 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:= )
+ java? ( virtual/jdk:1.8 )
+ xattr? ( sys-apps/attr )
+"
+RDEPEND="
+ ${DEPEND}
+ git? ( dev-vcs/git )
+ java? ( virtual/jre:1.8 )
+"
+BDEPEND="
+ git? ( dev-vcs/git )
+ verify-sig? ( sec-keys/openpgp-keys-gettext )
+"
+PDEPEND="emacs? ( app-emacs/po-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ # only installed for native ABI
+ /usr/include/gettext-po.h
+
+ /usr/include/autosprintf.h
+ /usr/include/textstyle.h
+ /usr/include/textstyle/stdbool.h
+ /usr/include/textstyle/version.h
+ /usr/include/textstyle/woe32dll.h
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.21-CVE-2020-12825.patch
+)
+
+QA_SONAME_NO_SYMLINK=".*/preloadable_libintl.so"
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+
+ default
+
+ # gettext-0.21.1-java-autoconf.patch changes
+ # gettext-{runtime,tools}/configure.ac and the corresponding
+ # configure scripts. Avoid regenerating other autotools output.
+ #touch -c gettext-{runtime,tools}/{aclocal.m4,Makefile.in,config.h.in,configure} || die
+ # Makefile.am adds a dependency on gettext-{runtime,tools}/configure.ac
+ #touch -c configure || die
+
+ elibtoolize
+
+ if use elibc_musl || use elibc_Darwin; then
+ eapply "${FILESDIR}"/${PN}-0.21-musl-omit_setlocale_lock.patch
+ fi
+}
+
+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
+
+ --disable-csharp
+ --without-cvs
+
+ $(use_enable acl)
+ $(use_enable cxx c++)
+ $(use_enable cxx libasprintf)
+ $(use_with git)
+ $(multilib_native_use_enable java)
+ $(use_enable ncurses curses)
+ $(use_enable nls)
+ $(use_enable openmp)
+ $(use_enable static-libs static)
+ $(use_enable xattr attr)
+ )
+
+ 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() {
+ emake DESTDIR="${D}" install
+
+ if multilib_is_native_abi ; then
+ dosym msgfmt /usr/bin/gmsgfmt # bug #43435
+ dobin gettext-tools/misc/gettextize
+ fi
+
+ # 909041 never install libintl which upstream insists on building
+ rm -f "${ED}"/usr/$(get_libdir)/libintl.* "${ED}"/usr/include/libintl.h
+}
+
+multilib_src_install_all() {
+ find "${ED}" -type f -name "*.la" -delete || die
+
+ if use java ; then
+ java-pkg_dojar "${ED}"/usr/share/${PN}/*.jar
+ rm "${ED}"/usr/share/${PN}/*.jar || die
+ rm "${ED}"/usr/share/${PN}/*.class || die
+ if use doc ; then
+ java-pkg_dojavadoc "${ED}"/usr/share/doc/${PF}/html/javadoc2
+ fi
+ fi
+
+ dodoc AUTHORS ChangeLog NEWS README THANKS
+
+ if use doc ; then
+ docinto html
+ dodoc "${ED}"/usr/share/doc/${PF}/*.html
+ else
+ rm -rf "${ED}"/usr/share/doc/${PF}/{csharpdoc,examples,javadoc2,javadoc1}
+ fi
+ rm "${ED}"/usr/share/doc/${PF}/*.html || die
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+}
diff --git a/sys-devel/gettext/gettext-0.22.5.ebuild b/sys-devel/gettext/gettext-0.22.5.ebuild
new file mode 100644
index 000000000000..0f0de646e397
--- /dev/null
+++ b/sys-devel/gettext/gettext-0.22.5.ebuild
@@ -0,0 +1,199 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Note: Keep version bumps in sync with dev-libs/libintl.
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/gettext.asc
+inherit java-pkg-opt-2 libtool multilib-minimal verify-sig toolchain-funcs
+
+DESCRIPTION="GNU locale utilities"
+HOMEPAGE="https://www.gnu.org/software/gettext/"
+
+if [[ ${PV} == *_rc* ]] ; then
+ SRC_URI="
+ https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.xz
+ verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${P/_/-}.tar.xz.sig )
+ "
+ S="${WORKDIR}/${P/_/-}"
+else
+ SRC_URI="
+ mirror://gnu/${PN}/${P}.tar.xz
+ verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )
+ "
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+
+# 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"
+IUSE="acl +cxx doc emacs git java ncurses nls openmp static-libs xattr"
+
+# 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 (bug #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:= )
+ java? ( virtual/jdk:1.8 )
+ xattr? ( sys-apps/attr )
+"
+RDEPEND="
+ ${DEPEND}
+ git? ( dev-vcs/git )
+ java? ( virtual/jre:1.8 )
+"
+BDEPEND="
+ git? ( dev-vcs/git )
+ verify-sig? ( sec-keys/openpgp-keys-gettext )
+"
+PDEPEND="emacs? ( app-emacs/po-mode )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ # only installed for native ABI
+ /usr/include/gettext-po.h
+
+ /usr/include/autosprintf.h
+ /usr/include/textstyle.h
+ /usr/include/textstyle/stdbool.h
+ /usr/include/textstyle/version.h
+ /usr/include/textstyle/woe32dll.h
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.21-CVE-2020-12825.patch
+)
+
+QA_SONAME_NO_SYMLINK=".*/preloadable_libintl.so"
+
+QA_CONFIG_IMPL_DECL_SKIP=(
+ # bug #898570
+ unreachable
+ MIN
+ alignof
+ static_assert
+)
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+ java-pkg-opt-2_pkg_setup
+}
+
+src_prepare() {
+ java-pkg-opt-2_src_prepare
+
+ default
+
+ # gettext-0.21.1-java-autoconf.patch changes
+ # gettext-{runtime,tools}/configure.ac and the corresponding
+ # configure scripts. Avoid regenerating other autotools output.
+ #touch -c gettext-{runtime,tools}/{aclocal.m4,Makefile.in,config.h.in,configure} || die
+ # Makefile.am adds a dependency on gettext-{runtime,tools}/configure.ac
+ #touch -c configure || die
+
+ elibtoolize
+
+ if use elibc_musl || use elibc_Darwin; then
+ eapply "${FILESDIR}"/${PN}-0.21-musl-omit_setlocale_lock.patch
+ fi
+}
+
+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
+
+ --disable-csharp
+ --without-cvs
+
+ $(use_enable acl)
+ $(use_enable cxx c++)
+ $(use_enable cxx libasprintf)
+ $(use_with git)
+ $(multilib_native_use_enable java)
+ $(use_enable ncurses curses)
+ $(use_enable nls)
+ $(use_enable openmp)
+ $(use_enable static-libs static)
+ $(use_enable xattr attr)
+ )
+
+ 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() {
+ emake DESTDIR="${D}" install
+
+ if multilib_is_native_abi ; then
+ dosym msgfmt /usr/bin/gmsgfmt # bug #43435
+ dobin gettext-tools/misc/gettextize
+ fi
+
+ # 909041 never install libintl which upstream insists on building
+ rm -f "${ED}"/usr/$(get_libdir)/libintl.* "${ED}"/usr/include/libintl.h
+}
+
+multilib_src_install_all() {
+ find "${ED}" -type f -name "*.la" -delete || die
+
+ if use java ; then
+ java-pkg_dojar "${ED}"/usr/share/${PN}/*.jar
+ rm "${ED}"/usr/share/${PN}/*.jar || die
+ rm "${ED}"/usr/share/${PN}/*.class || die
+ if use doc ; then
+ java-pkg_dojavadoc "${ED}"/usr/share/doc/${PF}/html/javadoc2
+ fi
+ fi
+
+ dodoc AUTHORS ChangeLog NEWS README THANKS
+
+ if use doc ; then
+ docinto html
+ dodoc "${ED}"/usr/share/doc/${PF}/*.html
+ else
+ rm -rf "${ED}"/usr/share/doc/${PF}/{csharpdoc,examples,javadoc2,javadoc1}
+ fi
+ rm "${ED}"/usr/share/doc/${PF}/*.html || die
+}
+
+pkg_preinst() {
+ java-pkg-opt-2_pkg_preinst
+}
diff --git a/sys-devel/gettext/metadata.xml b/sys-devel/gettext/metadata.xml
index 502becbd6b66..aad767169a65 100644
--- a/sys-devel/gettext/metadata.xml
+++ b/sys-devel/gettext/metadata.xml
@@ -1,21 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://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>
-<upstream>
- <remote-id type="cpe">cpe:/a:gnu:gettext</remote-id>
-</upstream>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <use>
+ <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>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:gnu:gettext</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/gnuconfig/Manifest b/sys-devel/gnuconfig/Manifest
index 035f2b70befd..0a977480cafd 100644
--- a/sys-devel/gnuconfig/Manifest
+++ b/sys-devel/gnuconfig/Manifest
@@ -1 +1 @@
-DIST gnuconfig-20210107.tar.xz 65944 BLAKE2B 209952ca349c9859b695df5a4f8b49df689cba47b439e715108cb66ccef7ec3742162113a2ee4948a85a96b44c45d4d553f9e41c15823403f451fea6ea61bd36 SHA512 e1485b7b719994441f49b18a88f922405f74aff2ba1df16050802a311fb5438e598d989fdb7fa008734e5ec0e567e7e90486f8bc6655787bc053ad8a89650213
+DIST gnuconfig-20230731.tar.xz 73112 BLAKE2B c6502d6b339e56440dbfc9abb0ba49e3eec5a573c5e44779dd326e6f11b55b7fc3a6d99fec73abbcc271e8f6f125699ce87f512cb3a825144307cf820df0067a SHA512 d8e24a30f86f1983c69a37a901e2357a0aefbe15fcd3f8a331d1c6f8eabc81b7436930055756a764ae874e406090d8029403f1c0faa3737acb94bd937cd577ef
diff --git a/sys-devel/gnuconfig/files/99999999/0001-add-ps2-targets-to-config.sub.patch b/sys-devel/gnuconfig/files/99999999/0001-add-ps2-targets-to-config.sub.patch
deleted file mode 100644
index a95e7ad3d5d8..000000000000
--- a/sys-devel/gnuconfig/files/99999999/0001-add-ps2-targets-to-config.sub.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From f1a763afa41654e25cbf73aae5ed56ca0909be63 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
-
-We no longer carry the "ps2" target as that conflicts with the long
-standing shortcut for the i386-ibm-aix target.
----
- config.sub | 25 +++++++++++++++++++++++--
- 1 file changed, 23 insertions(+), 2 deletions(-)
-
-diff --git a/config.sub b/config.sub
-index b0f8492..4d89efe 100755
---- a/config.sub
-+++ b/config.sub
-@@ -813,6 +813,27 @@ case $basic_machine in
- vendor=atari
- basic_os=mint
- ;;
-+ mipsEE* | ee)
-+ cpu=mips64r5900el
-+ vendor=scei
-+ case $os in
-+ linux*)
-+ ;;
-+ *)
-+ os=elf
-+ ;;
-+ esac
-+ ;;
-+ iop)
-+ cpu=mipsel
-+ vendor=scei
-+ os=irx
-+ ;;
-+ dvp)
-+ cpu=dvp
-+ vendor=scei
-+ os=elf
-+ ;;
- news-3600 | risc-news)
- cpu=mips
- vendor=sony
-@@ -1174,7 +1195,7 @@ case $cpu-$vendor in
- | bfin | bpf | bs2000 \
- | c[123]* | c30 | [cjt]90 | c4x \
- | c8051 | clipper | craynv | csky | cydra \
-- | d10v | d30v | dlx | dsp16xx \
-+ | d10v | d30v | dlx | dsp16xx | dvp \
- | e2k | elxsi | epiphany \
- | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
- | h8300 | h8500 \
-@@ -1715,7 +1736,7 @@ case $os in
- | uxpv* | beos* | mpeix* | udk* | moxiebox* \
- | interix* | uwin* | mks* | rhapsody* | darwin* \
- | openstep* | oskit* | conix* | pw32* | nonstopux* \
-- | storm-chaos* | tops10* | tenex* | tops20* | its* \
-+ | storm-chaos* | tops10* | tenex* | tops20* | its* | irx* \
- | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
- | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
- | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
---
-2.30.0
-
diff --git a/sys-devel/gnuconfig/gnuconfig-20210107.ebuild b/sys-devel/gnuconfig/gnuconfig-20230731.ebuild
index 1ca02c2eb1fa..36482deca301 100644
--- a/sys-devel/gnuconfig/gnuconfig-20210107.ebuild
+++ b/sys-devel/gnuconfig/gnuconfig-20230731.ebuild
@@ -1,15 +1,15 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="7"
+EAPI=8
-if [[ ${PV} == "99999999" ]] ; then
+if [[ ${PV} == 99999999 ]] ; then
EGIT_REPO_URI="https://git.savannah.gnu.org/r/config.git"
inherit git-r3
else
- SRC_URI="https://dev.gentoo.org/~polynomial-c/dist/${PN}/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+ SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
S="${WORKDIR}"
fi
@@ -18,17 +18,14 @@ HOMEPAGE="https://savannah.gnu.org/projects/config"
LICENSE="GPL-3+-with-autoconf-exception"
SLOT="0"
-IUSE=""
maint_pkg_create() {
- cd "${S}"
+ cd "${S}" || die
- make ChangeLog || die
+ emake ChangeLog
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.xz"
tar -Jcf "${tar}" ./* || die "creating tar failed"
einfo "Packaged tar now available:"
@@ -36,7 +33,7 @@ maint_pkg_create() {
}
src_unpack() {
- if [[ ${PV} == "99999999" ]] ; then
+ if [[ ${PV} == 99999999 ]] ; then
git-r3_src_unpack
maint_pkg_create
else
@@ -44,17 +41,6 @@ src_unpack() {
fi
}
-src_prepare() {
- default
- eapply "${S}"/*.patch
-}
-
-src_compile() { :;}
-
-src_test() {
- emake check
-}
-
src_install() {
insinto /usr/share/${PN}
doins config.{sub,guess}
diff --git a/sys-devel/gnuconfig/gnuconfig-99999999.ebuild b/sys-devel/gnuconfig/gnuconfig-99999999.ebuild
index e4c1ec17f5df..bbfd2430e73e 100644
--- a/sys-devel/gnuconfig/gnuconfig-99999999.ebuild
+++ b/sys-devel/gnuconfig/gnuconfig-99999999.ebuild
@@ -1,15 +1,15 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="7"
+EAPI=8
-if [[ ${PV} == "99999999" ]] ; then
+if [[ ${PV} == 99999999 ]] ; then
EGIT_REPO_URI="https://git.savannah.gnu.org/r/config.git"
inherit git-r3
else
- SRC_URI="https://dev.gentoo.org/~whissi/dist/${PN}/${P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+ SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
S="${WORKDIR}"
fi
@@ -18,17 +18,14 @@ HOMEPAGE="https://savannah.gnu.org/projects/config"
LICENSE="GPL-3+-with-autoconf-exception"
SLOT="0"
-IUSE=""
maint_pkg_create() {
- cd "${S}"
+ cd "${S}" || die
- make ChangeLog || die
+ emake ChangeLog
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.xz"
tar -Jcf "${tar}" ./* || die "creating tar failed"
einfo "Packaged tar now available:"
@@ -36,7 +33,7 @@ maint_pkg_create() {
}
src_unpack() {
- if [[ ${PV} == "99999999" ]] ; then
+ if [[ ${PV} == 99999999 ]] ; then
git-r3_src_unpack
maint_pkg_create
else
@@ -44,17 +41,6 @@ src_unpack() {
fi
}
-src_prepare() {
- default
- eapply "${S}"/*.patch
-}
-
-src_compile() { :;}
-
-src_test() {
- emake check
-}
-
src_install() {
insinto /usr/share/${PN}
doins config.{sub,guess}
diff --git a/sys-devel/gnuconfig/metadata.xml b/sys-devel/gnuconfig/metadata.xml
index 44a4bf40a0e9..fa5be8d4e324 100644
--- a/sys-devel/gnuconfig/metadata.xml
+++ b/sys-devel/gnuconfig/metadata.xml
@@ -6,4 +6,7 @@
<name>Gentoo Base System</name>
</maintainer>
<stabilize-allarches/>
+<upstream>
+ <remote-id type="savannah">config</remote-id>
+</upstream>
</pkgmetadata>
diff --git a/sys-devel/icecream/Manifest b/sys-devel/icecream/Manifest
index 1b0adc19c2ea..715a372facd9 100644
--- a/sys-devel/icecream/Manifest
+++ b/sys-devel/icecream/Manifest
@@ -1,2 +1 @@
-DIST icecc-1.0.0.tar.bz2 485534 BLAKE2B 31a978a4a461f20716a95277426e79d4c298c212d36361dbbd68c5affcbbbe2f0c71f743cc7b731d86fbb5f09ab556182482f56e1382be8572d019f80a004fc8 SHA512 4292ecef6232112c3f4531cb2290a55f70c5c24095fef0865af2526d49fc10a043ffb06d22552e161f671c18ff1ab62795c3a63e2c8cb26f869cf65d0938af2a
-DIST icecream-1.3.1.tar.gz 224068 BLAKE2B d7d66dadf27b0b88ab706bf217ce2b0d33b5db2ed95e48c4e9dcbd000931688ad6809ecbd4e14f0f3889bcebddc8543bd364c9dda09ba71e5dc04d0a5a2122d5 SHA512 d850394b4093defcf2c50bb3f9306348a45bf17d21f4730baeee7125998c2a548b7b3a7597785855d7e388e84830769bf0ec1c4136330a4c8e359cbdd111f5da
+DIST icecream-1.4.tar.gz 232707 BLAKE2B 5fdebea4d0eba4a99e8c7c01acab46ec323a887d3fe9944da23ae7089403a9ebf7bf9870ca61af49578af6adf49679341f7070f9e3da3e8c7c2f50d9d4e7c3fe SHA512 b77dd630c51b7b6b4d7fa06cd14a580891b974fe2d50074f7a3b129adc558fc7ce19b3a3716a6798c2fd0f7d0d3a1bc295bbedee3ed6dafa015f309c7c2590f5
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
deleted file mode 100644
index 3dc0e3713b0a..000000000000
--- a/sys-devel/icecream/files/icecream-1.0.0-libcap-ng.patch
+++ /dev/null
@@ -1,8 +0,0 @@
---- 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-r2 b/sys-devel/icecream/files/icecream-r2
deleted file mode 100644
index 21cfddeda8c3..000000000000
--- a/sys-devel/icecream/files/icecream-r2
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/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-1.0.0-r3.ebuild b/sys-devel/icecream/icecream-1.0.0-r3.ebuild
deleted file mode 100644
index 53e06f4ae2be..000000000000
--- a/sys-devel/icecream/icecream-1.0.0-r3.ebuild
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-MY_P="${P/icecream/icecc}"
-
-DESCRIPTION="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"
-S="${WORKDIR}/${MY_P}"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
-
-DEPEND="sys-libs/libcap-ng"
-RDEPEND="
- ${DEPEND}
- acct-group/icecream
- acct-user/icecream
- dev-util/shadowman
-"
-
-PATCHES=( "${FILESDIR}/${P}-libcap-ng.patch" )
-
-src_configure() {
- local myeconfargs=(
- --enable-shared --disable-static
- --enable-clang-wrappers
- --enable-clang-rewrite-includes
- )
-
- econf "${myeconfargs[@]}"
-}
-
-src_install() {
- default
-
- 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'
-
- find "${D}" -name '*.la' -delete || die
-}
-
-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/icecream-1.3.1.ebuild b/sys-devel/icecream/icecream-1.4.ebuild
index 72ab4fad07b2..487a71efceb4 100644
--- a/sys-devel/icecream/icecream-1.3.1.ebuild
+++ b/sys-devel/icecream/icecream-1.4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -12,7 +12,7 @@ SRC_URI="https://github.com/icecc/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
+KEYWORDS="~amd64 ~arm ~hppa ~loong ~ppc ~sparc ~x86"
DEPEND="app-arch/libarchive:=
app-arch/zstd:=
@@ -22,7 +22,8 @@ DEPEND="app-arch/libarchive:=
sys-libs/libcap-ng"
RDEPEND="${DEPEND}
dev-util/shadowman"
-BDEPEND="app-text/docbook2X"
+BDEPEND="app-text/docbook2X
+ virtual/pkgconfig"
src_prepare() {
default
@@ -65,7 +66,7 @@ src_install() {
}
pkg_prerm() {
- if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]]; then
+ if [[ -z ${REPLACED_BY_VERSION} && -z ${ROOT} ]] ; then
eselect compiler-shadow remove icecc
fi
}
@@ -73,7 +74,7 @@ pkg_prerm() {
pkg_postinst() {
tmpfiles_process icecream.conf
- if [[ -z ${ROOT} ]]; then
+ if [[ -z ${ROOT} ]] ; then
eselect compiler-shadow update icecc
fi
}
diff --git a/sys-devel/kgcc64/Manifest b/sys-devel/kgcc64/Manifest
index 93b80cd955ae..33b317e8f850 100644
--- a/sys-devel/kgcc64/Manifest
+++ b/sys-devel/kgcc64/Manifest
@@ -1,10 +1,17 @@
-DIST gcc-10.3.0-patches-1.tar.bz2 15282 BLAKE2B ef283e8b108af9bfd3324fabb95c835374113c6ff2cf1430a5568b3d1b27183e6de6751367c1e5720c85ac4c45132848888d5510c63f95e88a1f623b6bcf4000 SHA512 6dc435c8619a1532000fae843b9964d0d1e28d3cc9cc1962ab7391570a0cf1135424ea5c0b0d3d5ec5ea863f02e963be2ec4c94822f217fc692a1d808325404e
-DIST gcc-10.3.0.tar.xz 76692288 BLAKE2B ac7898f5eb8a7c5f151a526d1bb38913a68b50a65e4d010ac09fa20b6c801c671c790d780f23ccb8e4ecdfc686f4aa588082ccc9eb5c80c7b0e30788f824c1eb SHA512 2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86
-DIST gcc-11.1.0-patches-1.tar.bz2 12130 BLAKE2B 4d763b83dba7875bbbe8bbb9b6c392791ba97037d17347548604ffa7c70b32fdafcd45b0722ae40aa3aa8cbb34b9f3e3aa399d0096e35e74f75b174aad0c032e SHA512 e4e363c6a81bbc423ec36b6c57801ea2a70961ee7d7d0333924c7012b2b6fd4008f53e9208b5d1f6025f9e74a95d46c121b4b8909827070b46091228688996a4
-DIST gcc-11.1.0.tar.xz 78877216 BLAKE2B fe617e776b0270d11adea21b5c37d889de90865c19ab82d1c37bbd5c5b9c583a98c174606c4f893ca4950a4233e2a58aae93ad6aa7ad33d4e78a31c72371c1ed SHA512 fd6bba0f67ff48069d03073d1a9b5e896383b1cfc9dde008e868e60a9ec5014a837d56af0ecbf467b3fb9b37ec74a676e819a18b44393a0a3c4280175b5d7ad8
-DIST gcc-11.2.0-patches-1.tar.bz2 11537 BLAKE2B 9dd791ada244c9b70b8b99f9f305a688c248134715ed1b26d406e53b114983faae6873cdc521497164388d24d5f61c199e98df146bc02f5578e877295bcf5c82 SHA512 6539efc60c656d0798a5896dc1b944ed69914b815102c7a1c10bdba4ef935abd326b01309f38316e121f1ed90ceb2abcaf65df6af116892daad829ac2623cefc
-DIST gcc-11.2.0.tar.xz 80888824 BLAKE2B 69b61234ac436edfea2933df68c434a2ce7aa4454ef4da573e82587e1a42dc420189e949cfdadaf4cb37fc0de9674822210a95b77ff03aca0dbedfe67df19cc6 SHA512 d53a0a966230895c54f01aea38696f818817b505f1e2bfa65e508753fcd01b2aedb4a61434f41f3a2ddbbd9f41384b96153c684ded3f0fa97c82758d9de5c7cf
-DIST gcc-9.3.0-patches-3.tar.bz2 14193 BLAKE2B 4863fec1af41a8cdb2c24479b28812df36c1f71ab71d267ff0efc467cfb8ce99ed77714ceaedfb08b0d1eb0eb9316758cc7cbc5a8ad0bb582050690935e64b46 SHA512 8b90a5826df64e6f74e4f6c0e5acead695b38f671e26485b110d5b341daaad4ac21aabb04baae9ad457408eed274888b7f785bbc782611acfc7261e6a315d110
-DIST gcc-9.3.0.tar.xz 70533868 BLAKE2B 21efb1432aefad5ed9b9b395e88ef2adfda3a8ea6e3e808cd151da6e66df9fed1bafdc8b8ff055d4b2272ac786d8b7ddc4293bb6b51c55c40a261a0eda0e7cb4 SHA512 4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de
-DIST gcc-9.4.0-patches-1.tar.bz2 14012 BLAKE2B d5fbfd73d9c3a5b66be5b124d981fe5a7468363c83784989a50731f87931435f4b6302e4c20a64b20680581ed40005eff7bdd5855526a093f73a04c3c1ddab31 SHA512 b84884c7d2197cb14229d3321b98cd66c783cf9ebf7e5d1b1186e6cf32ee9e47d004ebad26118f9c848f9bc0a3783ceb23d9b65101d98c3bfa99874e66ee7cbc
-DIST gcc-9.4.0.tar.xz 72411232 BLAKE2B 4bb000d33d6bd2d6cc91c040713f27f79dcf726ef8ab1542c711e0c25651507628510b1373bc73aef71ffb660afddb2eb8d8c8540f5f1498ee243cfff6c0be67 SHA512 dfd3500bf21784b8351a522d53463cf362ede66b0bc302edf350bb44e94418497a8b4b797b6af8ca9b2eeb746b3b115d9c3698381b989546e9151b4496415624
+DIST gcc-10.5.0-musl-patches-2.tar.xz 3452 BLAKE2B 5387e516d07d81477b3f39b8b3bd986bf861d32cd25dc5481c97bd3620d00c918c5661e86857f66dbf28a655401a53e43417f638c443e44cbfdbf5e950caac4d SHA512 86f2ce31cc4fc4fb5a6043fb527bf822d895e1a6220652024f78a1cbd5a962edb6be8dc5f43c32053e075f39bb2350ea8f14e7d57e0473dd2933a7b44676bde5
+DIST gcc-10.5.0-patches-6.tar.xz 18208 BLAKE2B 4cac3340108fb378c76ad62b728429f3c97f348d178744e7536575f3576ca8aa682b878b7df3b1c162dccae64a3cb56c66d8d60eae323e1ece2de4278084fdbd SHA512 9d6c84325fbc118cee01347468ce729c278e5b026b16da945fe54050726e26f86a46ee7b71a01a47cf927b70bfcce459c49a6bc4fb93dcfaa047c76d4c5bc5bc
+DIST gcc-10.5.0.tar.xz 77846412 BLAKE2B 9b71761f4015649514677784443886e59733ac3845f7dfaa4343f46327d36c08c403c444b9e492b870ac0b3f2e3568f972b7700a0ef05a497fb4066079b3143b SHA512 d86dbc18b978771531f4039465e7eb7c19845bf607dc513c97abf8e45ffe1086a99d98f83dfb7b37204af22431574186de9d5ff80c8c3c3a98dbe3983195bffd
+DIST gcc-11-20240111.tar.xz 76240620 BLAKE2B dcf3b2493ca6ba1a9cd0137186cfbf1b96296ff9c5625e40ec7b89e5903b07dc151b61ad54b885fc57ccc02214e2cfa7b9249cbd755ac2554c6ca0008f0704d8 SHA512 aaed094cb6dd99166e0ec59886014108574ddab52701581f0f8e7f0abb966320d01f1bce6ff646170618ca7c2819d20523a23615f20114dbe412de43b937caf4
+DIST gcc-11-20240208.tar.xz 76276224 BLAKE2B efce83c3ea03093546b73d7731ac1051da7a2b0309612ce5b809ae2756bf7a949c94f951f6a77e789f7669051315e1a4e4c33f2b12a2ec1999ee9f1f39f6b13f SHA512 a0e2b4402ff187d0804e3bc2ed0a228cfce48476c1270d57798b060899f65c7e986945651d36c358f9df5eb4b36db13321e141895329b7382c130a0aca6a8962
+DIST gcc-11.4.0-musl-patches-2.tar.xz 4308 BLAKE2B a2335e155fc57816fed822a648e0eaefafcba9d04e1ad0fd7baeea5a694ab6f5e3c1678cb406f2a1bd17bab25cb01699d032713a1ccf337948dfda2093844607 SHA512 17b84f907cb1bd763873655e6f35fd3ed55a40b602b70a626f04f83b4cc89c6261db1661de78d4d969187a8c56e9f6305b742515a3836b962248a21df0df5d0c
+DIST gcc-11.4.0-patches-12.tar.xz 13824 BLAKE2B e4df9e0dc9512882022aaf325ebf65c540169454c91dd31f913c6f57f6eb291c79ae919671b53db1549799d4a70c09298bf45ed82ad05eb1f961443cc958369d SHA512 87fed0c3f8e28c9f702443db58350bb615110b27ebe334b5de2ea60678e2548c56cd75cffade210d69634e2ac0a9311f5100ddb45d97645aa76d5688bc421a61
+DIST gcc-12-20240112.tar.xz 79832228 BLAKE2B deec7123b8ffc42ddace51e1f3e8e08d5485f7000c0d4b7273b6311912ec0e7e2cb41124297af8c54456bb369a76fa2ef51aff552d8d680ec41dd2b144b08e55 SHA512 2c0a676ad35e6edee915c042a1751ac0263fae9b7af4d324deb49d6603dc73d3ec768832184879543e6ffb1595da5c56d9117288547adab7f243646dcbfc64ac
+DIST gcc-12-20240209.tar.xz 79824868 BLAKE2B 1ae5a646da470f06648c4766c77475ceb287c5f6647d5102f1aef6590f973233d5e7f83b5e0241488d49dba59dd605c211938379e68a393a2dccb3834103ae4b SHA512 9f9a04f4477f41bb2a5662aedef2af75b039de50c2dc99310e504e6080cb7aae06a1255337ea2e563975cb108ddc6766adbbaf4e3d5d5712801d7ba9a5209dbd
+DIST gcc-12.3.0-musl-patches-1.tar.xz 3572 BLAKE2B c7bf65f7c9ea8023ddaac821ee2b778622fa310ac72a72b2f7032494a8f304eac86217f9204622e6c21aaef9952bece0d09bc126facd4f42b602927909815ab5 SHA512 babc279fea2c1fd4c018815f2f5630214fd46015ce9f365c28af242681d51818eaca30ce298eddcab1eed5ac5f2759e2b47b2335afab9d722b4469a6d4fec326
+DIST gcc-12.3.0-patches-2.tar.xz 14236 BLAKE2B 06c43662c9abb0fa3cf90d5e2273c69aecb9158e6cf6f23c04754ed5d686be2616e81e2502eb16f4298ddd50518ca7677e13249da9e9b091162d3931ff65e4fe SHA512 b0d4b85dbf1a54aaaa1997203b872e3106906b4ad49cde57e1428bc22b2f8e2d73b8cb10ae0d0b792aebaf664594da4d1dea04c44ddc34e59047410766db04d1
+DIST gcc-13-20240113.tar.xz 84356052 BLAKE2B 1fbfffc9f2afe443158e3f26182c8bdc3f3b599c5582762117831ecb6e6d3c1c69e8d2e5932f45eb7d534c3967e08a9f7b1bcec31aa5d7ac608bebff9f35120c SHA512 a59886f707cf18f684295031d4d9fc5b03396face1705e61852d7de98729c53ac4cf209e951d00c232f14e9dc48eee40dd92487db7cb6ad0e80f2339d6d9503a
+DIST gcc-13-20240210.tar.xz 84354416 BLAKE2B 5807623d3f7dd751b6dfe164cfd50d57b2f93485c23c3c2228a4a846a9a94cdad52a5e6f2806e5e7ee2a7b5526386ebdb339c44c7ea023d69f8652088a1b114d SHA512 14a01ced7ac2bfd9fc93de4e3819b4d0823fbe129d3f1faabeb707e9e3e2613b4173321b58b3648a7250e3b7ff5d94edfee60e6c38682f31a1f7b57b1c01433f
+DIST gcc-13.2.0-musl-patches-2.tar.xz 5292 BLAKE2B c057d6574d03c05854edaa9f3fd40e9149662b04f3ac7a7db3eb078d73a7b535726d1bf52e5b12736dedb2f9898ad731f2e48a6421fcfbf7b90f929dee072fcb SHA512 a691da0c87c443a5e9d23731f4005f27871c5b12bc9102873ffa24d374aa7b9fbd187c4f5635d23fa9ffb17e351e76173c2d3fdf40646e355c4cb314b538de69
+DIST gcc-13.2.0-patches-12.tar.xz 47404 BLAKE2B ed018bcd7429d1c7aace746cbfc4e59dae409fc0a35231320c1b44c96fff0d912eba5c72109c2deb883f5368159df02148b2d4373396b34da882164c61fe4387 SHA512 b7872a03870bce7b633e4af4329b24fe8f3d50d6d9173f63549f606ce062787748af7f79e7ec4afeb768968d6e8462a849bd1b94316ea6bb284551f99e811617
+DIST gcc-13.2.0-patches-13.tar.xz 46404 BLAKE2B d11e6ebfed8d1fcba60638240927d57722015ea7cfb0790836c338c023fc01f9f5b3ebf0fe1e0c615b36e0131d38b49e3aee4026f8ed81473572255ccaa74e4b SHA512 4f8bbf9101548d64e78e32f38869ed84e462ce8329d64fbb934132d15bc81f8a9b6f2a075c0263fdc3b32e0dfac6bc032a4176eb06df88cb282fe974bfe102f4
+DIST kgcc64-validate-failures-7bbfb01a32b73842f8908de028703510a0e12057.py 27533 BLAKE2B 58917750d247d3a9e7078c62fd4412027a7d02d06c659a9c0743697529754218257c00dc6e10dff467e78b4e019225c39b1627b48a5298d13481a7072748a15f SHA512 b74d6358538d1b076f3d5b6632ea405b99627d5b5621b6f5101cb3453be13ba41e11d590039535b0c74b1624b69885a7093600d5395cc60bc63cea15ae7472b3
diff --git a/sys-devel/kgcc64/files/gcc-12.3-ccache-ICE.patch b/sys-devel/kgcc64/files/gcc-12.3-ccache-ICE.patch
new file mode 100644
index 000000000000..9a170f5db77e
--- /dev/null
+++ b/sys-devel/kgcc64/files/gcc-12.3-ccache-ICE.patch
@@ -0,0 +1,67 @@
+https://bugs.gentoo.org/906310
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109850
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109241
+
+https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=396a4e76afec30d2461638f569cae18955eb4ad2
+
+From 396a4e76afec30d2461638f569cae18955eb4ad2 Mon Sep 17 00:00:00 2001
+From: Jason Merrill <jason@redhat.com>
+Date: Wed, 22 Mar 2023 16:11:47 -0400
+Subject: [PATCH] c++: local class in nested generic lambda [PR109241]
+
+In this testcase, the tree walk to look for bare parameter packs was
+confused by finding a type with no TREE_BINFO. But it should be fine that
+it's unset; we already checked for unexpanded packs at parse time.
+
+I also tried doing the partial instantiation of the local class, which is
+probably the long-term direction we want to go, but for stage 4 let's go
+with this safer change.
+
+ PR c++/109241
+
+gcc/cp/ChangeLog:
+
+ * pt.cc (find_parameter_packs_r): Handle null TREE_BINFO.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.dg/cpp1y/lambda-generic-local-class2.C: New test.
+--- a/gcc/cp/pt.cc
++++ b/gcc/cp/pt.cc
+@@ -4106,10 +4106,14 @@ find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
+ case TAG_DEFN:
+ t = TREE_TYPE (t);
+ if (CLASS_TYPE_P (t))
+- /* Local class, need to look through the whole definition. */
+- for (tree bb : BINFO_BASE_BINFOS (TYPE_BINFO (t)))
+- cp_walk_tree (&BINFO_TYPE (bb), &find_parameter_packs_r,
+- ppd, ppd->visited);
++ {
++ /* Local class, need to look through the whole definition.
++ TYPE_BINFO might be unset for a partial instantiation. */
++ if (TYPE_BINFO (t))
++ for (tree bb : BINFO_BASE_BINFOS (TYPE_BINFO (t)))
++ cp_walk_tree (&BINFO_TYPE (bb), &find_parameter_packs_r,
++ ppd, ppd->visited);
++ }
+ else
+ /* Enum, look at the values. */
+ for (tree l = TYPE_VALUES (t); l; l = TREE_CHAIN (l))
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-local-class2.C
+@@ -0,0 +1,13 @@
++// PR c++/109241
++// { dg-do compile { target c++14 } }
++// { dg-options "" } no pedantic
++
++void g() {
++ [](auto) {
++ [](auto) {
++ ({
++ struct A {};
++ });
++ };
++ }(1);
++}
+--
+2.31.1
diff --git a/sys-devel/kgcc64/files/gcc-configure-LANG.patch b/sys-devel/kgcc64/files/gcc-configure-LANG.patch
deleted file mode 100644
index d1b1b0353662..000000000000
--- a/sys-devel/kgcc64/files/gcc-configure-LANG.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-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/kgcc64-10.3.0.ebuild b/sys-devel/kgcc64/kgcc64-10.5.0.ebuild
index e05d42e06fa3..c2a2eb1fd4b3 100644
--- a/sys-devel/kgcc64/kgcc64-10.3.0.ebuild
+++ b/sys-devel/kgcc64/kgcc64-10.5.0.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
case ${CHOST} in
hppa*) CTARGET=hppa64-${CHOST#*-};;
@@ -12,10 +12,16 @@ case ${CHOST} in
i?86*) CTARGET=x86_64-${CHOST#*-};;
esac
export CTARGET
+
TOOLCHAIN_ALLOWED_LANGS="c"
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="10.5.0"
+PATCH_VER="6"
+MUSL_VER="2"
+MUSL_GCC_VER="10.5.0"
GCC_TARGET_NO_MULTILIB=true
+PYTHON_COMPAT=( python3_{10..11} )
-PATCH_VER="1"
inherit toolchain
DESCRIPTION="64bit kernel compiler"
diff --git a/sys-devel/kgcc64/kgcc64-9.3.0-r2.ebuild b/sys-devel/kgcc64/kgcc64-11.4.1_p20240111.ebuild
index 973b2870eba9..805aef87b2bb 100644
--- a/sys-devel/kgcc64/kgcc64-9.3.0-r2.ebuild
+++ b/sys-devel/kgcc64/kgcc64-11.4.1_p20240111.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
case ${CHOST} in
hppa*) CTARGET=hppa64-${CHOST#*-};;
@@ -12,10 +12,15 @@ case ${CHOST} in
i?86*) CTARGET=x86_64-${CHOST#*-};;
esac
export CTARGET
-TOOLCHAIN_ALLOWED_LANGS="c"
-GCC_TARGET_NO_MULTILIB=true
-PATCH_VER="3"
+GCC_TARGET_NO_MULTILIB=true
+TOOLCHAIN_ALLOWED_LANGS="c"
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
inherit toolchain
DESCRIPTION="64bit kernel compiler"
@@ -25,7 +30,7 @@ KEYWORDS="hppa"
# unlike every other target, hppa has not unified the 32/64 bit
# ports in binutils yet
-DEPEND="hppa? ( sys-devel/binutils-hppa64 )"
+BDEPEND="hppa? ( sys-devel/binutils-hppa64 )"
pkg_postinst() {
toolchain_pkg_postinst
diff --git a/sys-devel/kgcc64/kgcc64-9.4.0.ebuild b/sys-devel/kgcc64/kgcc64-11.4.1_p20240208.ebuild
index e6b50adde92e..1105de63f8d0 100644
--- a/sys-devel/kgcc64/kgcc64-9.4.0.ebuild
+++ b/sys-devel/kgcc64/kgcc64-11.4.1_p20240208.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
case ${CHOST} in
hppa*) CTARGET=hppa64-${CHOST#*-};;
@@ -12,10 +12,15 @@ case ${CHOST} in
i?86*) CTARGET=x86_64-${CHOST#*-};;
esac
export CTARGET
-TOOLCHAIN_ALLOWED_LANGS="c"
-GCC_TARGET_NO_MULTILIB=true
-PATCH_VER="1"
+GCC_TARGET_NO_MULTILIB=true
+TOOLCHAIN_ALLOWED_LANGS="c"
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_GCC_VER="11.4.0"
+PATCH_VER="12"
+MUSL_VER="2"
+MUSL_GCC_VER="11.4.0"
+PYTHON_COMPAT=( python3_{10..11} )
inherit toolchain
DESCRIPTION="64bit kernel compiler"
@@ -25,7 +30,7 @@ KEYWORDS="~hppa"
# unlike every other target, hppa has not unified the 32/64 bit
# ports in binutils yet
-DEPEND="hppa? ( sys-devel/binutils-hppa64 )"
+BDEPEND="hppa? ( sys-devel/binutils-hppa64 )"
pkg_postinst() {
toolchain_pkg_postinst
diff --git a/sys-devel/kgcc64/kgcc64-12.3.1_p20240112.ebuild b/sys-devel/kgcc64/kgcc64-12.3.1_p20240112.ebuild
new file mode 100644
index 000000000000..65514fe59f88
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-12.3.1_p20240112.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+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"
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_VER="2"
+PATCH_GCC_VER="12.3.0"
+MUSL_VER="1"
+MUSL_GCC_VER="12.3.0"
+GCC_TARGET_NO_MULTILIB=true
+PYTHON_COMPAT=( python3_{10..11} )
+inherit toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on hppa and mips; all other archs, refer to bug #228115
+KEYWORDS="hppa"
+
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+BDEPEND="hppa? ( sys-devel/binutils-hppa64 )"
+
+src_prepare() {
+ toolchain_src_prepare
+ eapply "${FILESDIR}"/gcc-12.3-ccache-ICE.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-12.3.1_p20240209.ebuild b/sys-devel/kgcc64/kgcc64-12.3.1_p20240209.ebuild
new file mode 100644
index 000000000000..65514fe59f88
--- /dev/null
+++ b/sys-devel/kgcc64/kgcc64-12.3.1_p20240209.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+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"
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_VER="2"
+PATCH_GCC_VER="12.3.0"
+MUSL_VER="1"
+MUSL_GCC_VER="12.3.0"
+GCC_TARGET_NO_MULTILIB=true
+PYTHON_COMPAT=( python3_{10..11} )
+inherit toolchain
+
+DESCRIPTION="64bit kernel compiler"
+
+# Works on hppa and mips; all other archs, refer to bug #228115
+KEYWORDS="hppa"
+
+# unlike every other target, hppa has not unified the 32/64 bit
+# ports in binutils yet
+BDEPEND="hppa? ( sys-devel/binutils-hppa64 )"
+
+src_prepare() {
+ toolchain_src_prepare
+ eapply "${FILESDIR}"/gcc-12.3-ccache-ICE.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-11.1.0.ebuild b/sys-devel/kgcc64/kgcc64-13.2.1_p20240113-r1.ebuild
index c8abbd9325b8..e14486eae1a8 100644
--- a/sys-devel/kgcc64/kgcc64-11.1.0.ebuild
+++ b/sys-devel/kgcc64/kgcc64-13.2.1_p20240113-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
case ${CHOST} in
hppa*) CTARGET=hppa64-${CHOST#*-};;
@@ -13,19 +13,23 @@ case ${CHOST} in
esac
export CTARGET
TOOLCHAIN_ALLOWED_LANGS="c"
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_VER="12"
+PATCH_GCC_VER="13.2.0"
+MUSL_VER="2"
+MUSL_GCC_VER="13.2.0"
GCC_TARGET_NO_MULTILIB=true
-
-PATCH_VER="1"
+PYTHON_COMPAT=( python3_{10..11} )
inherit toolchain
DESCRIPTION="64bit kernel compiler"
# Works on hppa and mips; all other archs, refer to bug #228115
-KEYWORDS="~hppa"
+KEYWORDS="hppa"
# unlike every other target, hppa has not unified the 32/64 bit
# ports in binutils yet
-DEPEND="hppa? ( sys-devel/binutils-hppa64 )"
+BDEPEND="hppa? ( sys-devel/binutils-hppa64 )"
pkg_postinst() {
toolchain_pkg_postinst
diff --git a/sys-devel/kgcc64/kgcc64-11.2.0.ebuild b/sys-devel/kgcc64/kgcc64-13.2.1_p20240210.ebuild
index e6b50adde92e..71ebd938a35b 100644
--- a/sys-devel/kgcc64/kgcc64-11.2.0.ebuild
+++ b/sys-devel/kgcc64/kgcc64-13.2.1_p20240210.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
case ${CHOST} in
hppa*) CTARGET=hppa64-${CHOST#*-};;
@@ -13,19 +13,23 @@ case ${CHOST} in
esac
export CTARGET
TOOLCHAIN_ALLOWED_LANGS="c"
+TOOLCHAIN_PATCH_DEV="sam"
+PATCH_VER="13"
+PATCH_GCC_VER="13.2.0"
+MUSL_VER="2"
+MUSL_GCC_VER="13.2.0"
GCC_TARGET_NO_MULTILIB=true
-
-PATCH_VER="1"
+PYTHON_COMPAT=( python3_{10..11} )
inherit toolchain
DESCRIPTION="64bit kernel compiler"
# Works on hppa and mips; all other archs, refer to bug #228115
-KEYWORDS="~hppa"
+KEYWORDS="hppa"
# unlike every other target, hppa has not unified the 32/64 bit
# ports in binutils yet
-DEPEND="hppa? ( sys-devel/binutils-hppa64 )"
+BDEPEND="hppa? ( sys-devel/binutils-hppa64 )"
pkg_postinst() {
toolchain_pkg_postinst
diff --git a/sys-devel/libtool/Manifest b/sys-devel/libtool/Manifest
deleted file mode 100644
index 4f2d5bac1893..000000000000
--- a/sys-devel/libtool/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST libtool-2.4.6.tar.xz 973080 BLAKE2B 0865af9f8701ca9dc62eec8294a088d24f4a3ff541bc76acfe7b69f70637d7e8261a17d69f7d54a4177f974c429be68467883a1560edb539061966cbf7d4a356 SHA512 a6eef35f3cbccf2c9e2667f44a476ebc80ab888725eb768e91a3a6c33b8c931afc46eb23efaee76c8696d3e4eed74ab1c71157bcb924f38ee912c8a90a6521a4
diff --git a/sys-devel/libtool/files/libtool-2.2.10-eprefix.patch b/sys-devel/libtool/files/libtool-2.2.10-eprefix.patch
deleted file mode 100644
index c4693ee7feeb..000000000000
--- a/sys-devel/libtool/files/libtool-2.2.10-eprefix.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/m4/libtool.m4
-+++ b/m4/libtool.m4
-@@ -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
deleted file mode 100644
index 81364d4d02af..000000000000
--- a/sys-devel/libtool/files/libtool-2.2.6a-darwin-module-bundle.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-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.)
-
---- a/m4/libtool.m4
-+++ b/m4/libtool.m4
-@@ -2645,7 +2645,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
deleted file mode 100644
index aa1e870649b6..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.3-use-linux-version-in-fbsd.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-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
-@@ -2666,7 +2666,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$major $libname$shared_ext'
-@@ -2678,6 +2685,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
deleted file mode 100644
index aded304989d2..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-darwin-use-linux-version.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-* revert old 1.5 behaviour
-
---- a/m4/libtool.m4
-+++ b/m4/libtool.m4
-@@ -2641,7 +2641,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-darwin20.patch b/sys-devel/libtool/files/libtool-2.4.6-darwin20.patch
deleted file mode 100644
index 02cb1d7eb9ac..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-darwin20.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-macOS Big Sur is 11.0, Darwin 20, after a long line of 10.X releases.
-macOS Monterey is 12.0.
---- a/m4/libtool.m4
-+++ b/m4/libtool.m4
-@@ -1076,7 +1076,7 @@
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]][[,.]]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
-- 10.*)
-+ 10.*|11.*|12.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
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
deleted file mode 100644
index 974cd44d028c..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-libtoolize-delay-help.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-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
deleted file mode 100644
index d27f976ccb40..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-libtoolize-slow.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-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 +++++++++++++++++++++++++++---------------
- 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/build-aux/extract-trace
-+++ b/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
deleted file mode 100644
index 853a22eff54f..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-link-fsanitize.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-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
-
---- a/build-aux/ltmain.in
-+++ b/build-aux/ltmain.in
-@@ -5362,10 +5362,11 @@
- # -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"
---- a/build-aux/ltmain.sh
-+++ b/build-aux/ltmain.sh
-@@ -7274,10 +7274,11 @@
- # -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"
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
deleted file mode 100644
index f6c0a3dc89f1..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-link-fuse-ld.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-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.
-
---- a/build-aux/ltmain.in
-+++ b/build-aux/ltmain.in
-@@ -5363,10 +5363,11 @@
- # -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"
---- a/build-aux/ltmain.sh
-+++ b/build-aux/ltmain.sh
-@@ -7275,10 +7275,11 @@
- # -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"
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
deleted file mode 100644
index c7720935d8fd..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-link-specs.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-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>
-
---- a/build-aux/ltmain.in
-+++ b/build-aux/ltmain.in
-@@ -5360,10 +5360,12 @@
- # -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"
---- a/build-aux/ltmain.sh
-+++ b/build-aux/ltmain.sh
-@@ -7272,10 +7272,12 @@
- # -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"
diff --git a/sys-devel/libtool/files/libtool-2.4.6-mint.patch b/sys-devel/libtool/files/libtool-2.4.6-mint.patch
deleted file mode 100644
index 4fe5bcede5a3..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-mint.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-Patch by Alan Hourihane
-
-http://bugs.gentoo.org/show_bug.cgi?id=266984
-
---- a/configure
-+++ b/configure
-@@ -5897,6 +5897,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.
---- a/libltdl/configure
-+++ b/libltdl/configure
-@@ -4782,6 +4782,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.
---- a/m4/libtool.m4
-+++ b/m4/libtool.m4
-@@ -1708,6 +1708,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
deleted file mode 100644
index 78d86c72956b..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-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-pthread.patch b/sys-devel/libtool/files/libtool-2.4.6-pthread.patch
deleted file mode 100644
index 49b81c1dcda6..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-pthread.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-http://permalink.gmane.org/gmane.comp.gnu.libtool.patches/11704
-https://bugs.gentoo.org/650876
-
-From: Pavel Raiskup <praiskup <at> redhat.com>
-Subject: [PATCH] libtool: handle the -pthread{,s} options for g++
-Newsgroups: gmane.comp.gnu.libtool.patches
-Date: Thursday 28th November 2013 14:18:05 UTC (over 4 years ago)
-
-As we are forced to pass -nostdlib to g++ for linking, this option
-expectedly disables the effectiveness of passed -pthread flag - so
-add the -lpthread explicitly to $deplibs to link correctly.
-
-References:
-http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
-https://bugzilla.redhat.com/show_bug.cgi?id=661333
-http://lists.gnu.org/archive/html/bug-libtool/2013-01/msg00018.htm
-
-* build-aux/ltmain.in (func_mode_link): Explicitly add -lpthread
-flag into $deplibs when -pthread is passed (for g++ only).
----
- build-aux/ltmain.in | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
-index fba05c1..f202b80 100644
---- a/build-aux/ltmain.in
-+++ b/build-aux/ltmain.in
-@@ -5113,6 +5113,16 @@ func_mode_link ()
- *" $arg "*) ;;
- * ) func_append new_inherited_linker_flags " $arg" ;;
- esac
-+
-+ # As we are forced to pass -nostdlib to g++ during linking, the option
-+ # -pthread{,s} is not in effect; add the -lpthread to $deplist
-+ # explicitly to link correctly.
-+ if test "$tagname" = CXX -a x"$with_gcc" = xyes; then
-+ case "$arg" in
-+ -pthread*) func_append deplibs " -lpthread" ;;
-+ esac
-+ fi
-+
- continue
- ;;
diff --git a/sys-devel/libtool/files/libtool-2.4.6-pthread_bootstrapped.patch b/sys-devel/libtool/files/libtool-2.4.6-pthread_bootstrapped.patch
deleted file mode 100644
index b093d74266f2..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-pthread_bootstrapped.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-https://bugs.gentoo.org/650876
-
---- a/build-aux/ltmain.sh
-+++ b/build-aux/ltmain.sh
-@@ -7127,6 +7127,16 @@
- *" $arg "*) ;;
- * ) func_append new_inherited_linker_flags " $arg" ;;
- esac
-+
-+ # As we are forced to pass -nostdlib to g++ during linking, the option
-+ # -pthread{,s} is not in effect; add the -lpthread to $deplist
-+ # explicitly to link correctly.
-+ if test "$tagname" = CXX -a x"$with_gcc" = xyes; then
-+ case "$arg" in
-+ -pthread*) func_append deplibs " -lpthread" ;;
-+ esac
-+ fi
-+
- continue
- ;;
-
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
deleted file mode 100644
index 580d635d04aa..000000000000
--- a/sys-devel/libtool/files/libtool-2.4.6-sed-quote-speedup.patch
+++ /dev/null
@@ -1,253 +0,0 @@
-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.
-
---- a/build-aux/ltmain.in
-+++ b/build-aux/ltmain.in
-@@ -3346,7 +3346,8 @@
- 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.
-@@ -8598,8 +8599,8 @@
- 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.
-@@ -8845,7 +8846,8 @@
- 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
---- 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_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_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
---- a/build-aux/ltmain.sh
-+++ b/build-aux/ltmain.sh
-@@ -64,7 +64,7 @@
- # libraries, which are installed to $pkgauxdir.
-
- # 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
-@@ -1091,6 +1091,57 @@
- }
-
-
-+# 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.
-@@ -1107,12 +1158,8 @@
- 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
-@@ -5258,7 +5305,8 @@
- 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.
-@@ -10510,8 +10558,8 @@
- 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.
-@@ -10757,7 +10805,8 @@
- 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/sys-devel/libtool/libtool-2.4.6-r6.ebuild b/sys-devel/libtool/libtool-2.4.6-r6.ebuild
deleted file mode 100644
index cf041ceafab1..000000000000
--- a/sys-devel/libtool/libtool-2.4.6-r6.ebuild
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-LIBTOOLIZE="true" #225559
-WANT_LIBTOOL="none"
-inherit autotools prefix
-
-if [[ ${PV} == *9999 ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/libtool.git"
- inherit git-r3
-else
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~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}"
-[[ ${PV} == *9999 ]] && BDEPEND="sys-apps/help2man"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-2.4.3-use-linux-version-in-fbsd.patch #109105
- "${FILESDIR}"/${PN}-2.4.6-link-specs.patch
- "${FILESDIR}"/${PN}-2.4.6-link-fsanitize.patch #573744
- "${FILESDIR}"/${PN}-2.4.6-link-fuse-ld.patch
- "${FILESDIR}"/${PN}-2.4.6-libtoolize-slow.patch
- "${FILESDIR}"/${PN}-2.4.6-libtoolize-delay-help.patch
- "${FILESDIR}"/${PN}-2.4.6-sed-quote-speedup.patch #542252
- "${FILESDIR}"/${PN}-2.4.6-ppc64le.patch #581314
-
- "${FILESDIR}"/${PN}-2.4.6-mint.patch
- "${FILESDIR}"/${PN}-2.2.6a-darwin-module-bundle.patch
- "${FILESDIR}"/${PN}-2.4.6-darwin-use-linux-version.patch
- "${FILESDIR}"/${PN}-2.4.6-darwin20.patch
-)
-
-src_prepare() {
- if [[ ${PV} == *9999 ]] ; then
- eapply "${FILESDIR}"/${PN}-2.4.6-pthread.patch #650876
- ./bootstrap || die
- else
- PATCHES+=(
- "${FILESDIR}"/${PN}-2.4.6-pthread_bootstrapped.patch #650876
- )
- fi
-
- # WARNING: File build-aux/ltmain.sh is read-only; trying to patch anyway
- chmod +w build-aux/ltmain.sh || die
-
- if use vanilla ; then
- eapply_user
- return 0
- else
- default
- fi
-
- 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 ...).
- eapply "${FILESDIR}"/${PN}-2.2.10-eprefix.patch
- eprefixify m4/libtool.m4
- fi
-
- pushd libltdl >/dev/null || die
- AT_NOELIBTOOLIZE=yes eautoreconf
- popd >/dev/null || die
- AT_NOELIBTOOLIZE=yes eautoreconf
-
- # Make sure timestamps don't trigger a rebuild of man pages. #556512
- if [[ ${PV} != *9999 ]] ; then
- touch doc/*.1 || die
- 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)")"
-
- [[ ${CHOST} == *-darwin* ]] && local myconf="--program-prefix=g"
- ECONF_SOURCE=${S} econf ${myconf} --disable-ltdl-install
-}
-
-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
deleted file mode 100644
index ea6a7173bed3..000000000000
--- a/sys-devel/libtool/libtool-9999.ebuild
+++ /dev/null
@@ -1,106 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-LIBTOOLIZE="true" #225559
-WANT_LIBTOOL="none"
-inherit autotools prefix
-
-if [[ ${PV} == *9999 ]] ; then
- EGIT_REPO_URI="https://git.savannah.gnu.org/git/libtool.git"
- inherit git-r3
-else
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~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}"
-[[ ${PV} == *9999 ]] && BDEPEND="sys-apps/help2man"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-2.4.3-use-linux-version-in-fbsd.patch #109105
- "${FILESDIR}"/${PN}-2.4.6-mint.patch
- "${FILESDIR}"/${PN}-2.2.6a-darwin-module-bundle.patch
- "${FILESDIR}"/${PN}-2.4.6-darwin-use-linux-version.patch
-)
-
-src_prepare() {
- if [[ ${PV} == *9999 ]] ; then
- eapply "${FILESDIR}"/${PN}-2.4.6-pthread.patch #650876
- ./bootstrap || die
- else
- PATCHES+=(
- "${FILESDIR}"/${PN}-2.4.6-pthread_bootstrapped.patch #650876
- )
- fi
-
- # WARNING: File build-aux/ltmain.sh is read-only; trying to patch anyway
- chmod +w build-aux/ltmain.sh || die
-
- if use vanilla ; then
- eapply_user
- return 0
- else
- default
- fi
-
- 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 ...).
- eapply "${FILESDIR}"/${PN}-2.2.10-eprefix.patch
- eprefixify m4/libtool.m4
- fi
-
- pushd libltdl >/dev/null || die
- AT_NOELIBTOOLIZE=yes eautoreconf
- popd >/dev/null || die
- AT_NOELIBTOOLIZE=yes eautoreconf
-
- # Make sure timestamps don't trigger a rebuild of man pages. #556512
- if [[ ${PV} != *9999 ]] ; then
- touch doc/*.1 || die
- 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)")"
-
- [[ ${CHOST} == *-darwin* ]] && local myconf="--program-prefix=g"
- ECONF_SOURCE=${S} econf ${myconf} --disable-ltdl-install
-}
-
-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
deleted file mode 100644
index 151cc38da6c6..000000000000
--- a/sys-devel/libtool/metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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="cpe">cpe:/a:gnu:libtool</remote-id>
-</upstream>
-</pkgmetadata>
diff --git a/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-15-r2.ebuild b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-15-r2.ebuild
new file mode 100644
index 000000000000..44a21b6fb09f
--- /dev/null
+++ b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-15-r2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLD on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ dosym ld.lld "${dest}/ld"
+ for chost in "${chosts[@]}"; do
+ dosym ld.lld "${dest}/${chost}-ld"
+ done
+}
diff --git a/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-16-r2.ebuild b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-16-r2.ebuild
new file mode 100644
index 000000000000..2eb282b65da9
--- /dev/null
+++ b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-16-r2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLD on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86 ~arm64-macos"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ dosym ld.lld "${dest}/ld"
+ for chost in "${chosts[@]}"; do
+ dosym ld.lld "${dest}/${chost}-ld"
+ done
+}
diff --git a/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-17.ebuild b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-17.ebuild
new file mode 100644
index 000000000000..d8b2ae18b0fb
--- /dev/null
+++ b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-17.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLD on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~loong ~ppc ppc64 ~riscv x86 ~arm64-macos"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ dosym ld.lld "${dest}/ld"
+ for chost in "${chosts[@]}"; do
+ dosym ld.lld "${dest}/${chost}-ld"
+ done
+}
diff --git a/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-18.ebuild b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-18.ebuild
new file mode 100644
index 000000000000..046a5e6e66f0
--- /dev/null
+++ b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-18.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLD on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~arm64-macos"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ dosym ld.lld "${dest}/ld"
+ for chost in "${chosts[@]}"; do
+ dosym ld.lld "${dest}/${chost}-ld"
+ done
+}
diff --git a/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-19.ebuild b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-19.ebuild
new file mode 100644
index 000000000000..b85bf912c557
--- /dev/null
+++ b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-19.ebuild
@@ -0,0 +1,37 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLD on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ dosym ld.lld "${dest}/ld"
+ for chost in "${chosts[@]}"; do
+ dosym ld.lld "${dest}/${chost}-ld"
+ done
+}
diff --git a/sys-devel/lld-toolchain-symlinks/metadata.xml b/sys-devel/lld-toolchain-symlinks/metadata.xml
new file mode 100644
index 000000000000..69ca87c01788
--- /dev/null
+++ b/sys-devel/lld-toolchain-symlinks/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="multilib-symlinks">
+ Install symlinks for all ABI CHOSTs. Note that this can
+ result in gcc being overrode for native builds, as well
+ as conflict with crossdev if used for the same targets.
+ </flag>
+ <flag name="native-symlinks">
+ Install generic 'ld' symlink, as well as ${CTARGET}-ld.
+ These symlinks are installed into slotted LLVM bindir,
+ so they should not take precedence over symlinks installed
+ into /usr/bin by <pkg>sys-devel/binutils-config</pkg>
+ but they can be helpful for binutils-free setups.
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/lld/Manifest b/sys-devel/lld/Manifest
index 286783c6f5a6..112fd93ef3e1 100644
--- a/sys-devel/lld/Manifest
+++ b/sys-devel/lld/Manifest
@@ -1,5 +1,14 @@
-DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
-DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
-DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
-DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
-DIST llvmorg-13.0.1-rc2.tar.gz 147304491 BLAKE2B 86b2c64e57e4aaab837229b25a95d5517ac077d22cf552d71ff6b996dbdbcd171ad51de7eb12d098b50a139beda4ace843727181a1c6978fc487215391e64a3a SHA512 0d890f3317504c8cef10e118b245e5a4c815cc19f07cbc511a66bde6c9b1f3d15c167942608a8987befe9115b24657d29f72305f9f2794385a7434b80167f40f
+DIST llvm-gentoo-patchset-16.0.6-r1.tar.xz 17780 BLAKE2B e7c97916df463ff6d3d6374290bad86b3f2a7189fd9da3c6c808cb84160f904f4de1dffa7e98b32d7cacf904beea2df74116384960b0619ff30b7125839fc950 SHA512 74f86aa11614dd86a4af0cba514e98006d6df8ff15effc0c3598c291c7c6139f9310dc2e3ee25e8a3fa960e8a51986a4c48412a8e7269064197102fd9bbeac7c
+DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948
+DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
+DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
+DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7
+DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
+DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
+DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
+DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
+DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
+DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
+DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
diff --git a/sys-devel/lld/lld-11.1.0-r1.ebuild b/sys-devel/lld/lld-11.1.0-r1.ebuild
deleted file mode 100644
index fc27b8c1f6d1..000000000000
--- a/sys-devel/lld/lld-11.1.0-r1.ebuild
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} )
-inherit cmake llvm llvm.org python-any-r1
-
-DESCRIPTION="The LLVM linker (link editor)"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="~sys-devel/llvm-${PV}"
-DEPEND="${RDEPEND}"
-BDEPEND="
- test? (
- >=dev-util/cmake-3.16
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- )"
-
-LLVM_COMPONENTS=( lld )
-LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
-llvm.org_set_globals
-
-python_check_deps() {
- has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
- use test && python-any-r1_pkg_setup
-}
-
-src_configure() {
- local mycmakeargs=(
- -DBUILD_SHARED_LIBS=ON
- -DLLVM_INCLUDE_TESTS=$(usex test)
- )
- use test && mycmakeargs+=(
- -DLLVM_BUILD_TESTS=ON
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- -DPython3_EXECUTABLE="${PYTHON}"
- )
- cmake_src_configure
-}
-
-src_test() {
- local -x LIT_PRESERVES_TMP=1
- cmake_build check-lld
-}
diff --git a/sys-devel/lld/lld-11.1.0.ebuild b/sys-devel/lld/lld-11.1.0.ebuild
deleted file mode 100644
index acbc80f1dda4..000000000000
--- a/sys-devel/lld/lld-11.1.0.ebuild
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} )
-inherit cmake llvm llvm.org python-any-r1
-
-DESCRIPTION="The LLVM linker (link editor)"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="~sys-devel/llvm-${PV}"
-DEPEND="${RDEPEND}"
-BDEPEND="
- test? (
- >=dev-util/cmake-3.16
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- )"
-
-LLVM_COMPONENTS=( lld )
-LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
-llvm.org_set_globals
-
-python_check_deps() {
- has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
- use test && python-any-r1_pkg_setup
-}
-
-src_configure() {
- local mycmakeargs=(
- -DBUILD_SHARED_LIBS=OFF
-
- -DLLVM_INCLUDE_TESTS=$(usex test)
- )
- use test && mycmakeargs+=(
- -DLLVM_BUILD_TESTS=ON
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- -DPython3_EXECUTABLE="${PYTHON}"
- )
-
- cmake_src_configure
-}
-
-src_test() {
- local -x LIT_PRESERVES_TMP=1
- cmake_build check-lld
-}
-
-src_install() {
- cmake_src_install
- # LLD has no shared libraries, so strip it all for the time being
- rm -r "${ED}"/usr/{include,lib*} || die
-}
diff --git a/sys-devel/lld/lld-12.0.1.ebuild b/sys-devel/lld/lld-12.0.1.ebuild
deleted file mode 100644
index 12d00d30f2fa..000000000000
--- a/sys-devel/lld/lld-12.0.1.ebuild
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm llvm.org python-any-r1
-
-DESCRIPTION="The LLVM linker (link editor)"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="~sys-devel/llvm-${PV}"
-DEPEND="${RDEPEND}"
-BDEPEND="
- test? (
- >=dev-util/cmake-3.16
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- )"
-
-LLVM_COMPONENTS=( lld libunwind/include/mach-o )
-LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
-llvm.org_set_globals
-
-python_check_deps() {
- has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
- use test && python-any-r1_pkg_setup
-}
-
-src_unpack() {
- llvm.org_src_unpack
-
- # Directory ${WORKDIR}/llvm does not exist with USE="-test",
- # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
- # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
- # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
- # to existent directory ${WORKDIR}/libunwind/include.
- mkdir -p "${WORKDIR}/llvm" || die
-}
-
-src_configure() {
- local mycmakeargs=(
- -DBUILD_SHARED_LIBS=ON
- -DLLVM_INCLUDE_TESTS=$(usex test)
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- )
- use test && mycmakeargs+=(
- -DLLVM_BUILD_TESTS=ON
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- -DPython3_EXECUTABLE="${PYTHON}"
- )
- cmake_src_configure
-}
-
-src_test() {
- local -x LIT_PRESERVES_TMP=1
- cmake_build check-lld
-}
diff --git a/sys-devel/lld/lld-14.0.0.9999.ebuild b/sys-devel/lld/lld-14.0.0.9999.ebuild
deleted file mode 100644
index 863c9b49bdb9..000000000000
--- a/sys-devel/lld/lld-14.0.0.9999.ebuild
+++ /dev/null
@@ -1,73 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake flag-o-matic llvm llvm.org python-any-r1
-
-DESCRIPTION="The LLVM linker (link editor)"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE="debug test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="~sys-devel/llvm-${PV}"
-DEPEND="${RDEPEND}"
-BDEPEND="
- test? (
- >=dev-util/cmake-3.16
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- )"
-
-LLVM_COMPONENTS=( lld libunwind/include/mach-o )
-LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
-llvm.org_set_globals
-
-python_check_deps() {
- has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
-}
-
-pkg_setup() {
- LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
- use test && python-any-r1_pkg_setup
-}
-
-src_unpack() {
- llvm.org_src_unpack
-
- # Directory ${WORKDIR}/llvm does not exist with USE="-test",
- # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
- # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
- # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
- # to existent directory ${WORKDIR}/libunwind/include.
- mkdir -p "${WORKDIR}/llvm" || die
-}
-
-src_configure() {
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
-
- local mycmakeargs=(
- -DBUILD_SHARED_LIBS=ON
- -DLLVM_INCLUDE_TESTS=$(usex test)
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
- )
- use test && mycmakeargs+=(
- -DLLVM_BUILD_TESTS=ON
- -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- -DPython3_EXECUTABLE="${PYTHON}"
- )
- cmake_src_configure
-}
-
-src_test() {
- local -x LIT_PRESERVES_TMP=1
- cmake_build check-lld
-}
diff --git a/sys-devel/lld/lld-13.0.0.ebuild b/sys-devel/lld/lld-15.0.7.ebuild
index 16d9d0874180..5040684bb927 100644
--- a/sys-devel/lld/lld-13.0.0.ebuild
+++ b/sys-devel/lld/lld-15.0.7.ebuild
@@ -1,38 +1,48 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake flag-o-matic llvm llvm.org python-any-r1
+PYTHON_COMPAT=( python3_{10..11} )
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
DESCRIPTION="The LLVM linker (link editor)"
HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86"
IUSE="debug test"
RESTRICT="!test? ( test )"
-RDEPEND="~sys-devel/llvm-${PV}"
-DEPEND="${RDEPEND}"
+DEPEND="
+ ~sys-devel/llvm-${PV}
+ sys-libs/zlib:=
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
test? (
- >=dev-util/cmake-3.16
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- )"
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-15-r2:${LLVM_MAJOR}
+"
-LLVM_COMPONENTS=( lld libunwind/include/mach-o )
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
llvm.org_set_globals
python_check_deps() {
- has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
}
pkg_setup() {
- LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
use test && python-any-r1_pkg_setup
}
@@ -54,16 +64,24 @@ src_configure() {
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DBUILD_SHARED_LIBS=ON
-DLLVM_INCLUDE_TESTS=$(usex test)
-DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
)
+
use test && mycmakeargs+=(
-DLLVM_BUILD_TESTS=ON
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
-DLLVM_LIT_ARGS="$(get_lit_flags)"
-DPython3_EXECUTABLE="${PYTHON}"
)
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
cmake_src_configure
}
diff --git a/sys-devel/lld/lld-16.0.6.ebuild b/sys-devel/lld/lld-16.0.6.ebuild
new file mode 100644
index 000000000000..9308190da16c
--- /dev/null
+++ b/sys-devel/lld/lld-16.0.6.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv x86 ~arm64-macos"
+IUSE="debug test zstd"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}[zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
+BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
+ test? (
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
+LLVM_TEST_COMPONENTS=( llvm/utils third-party )
+LLVM_PATCHSET=${PV}-r1
+llvm.org_set_globals
+
+python_check_deps() {
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ llvm.org_src_unpack
+
+ # Directory ${WORKDIR}/llvm does not exist with USE="-test",
+ # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
+ # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
+ # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
+ # to existent directory ${WORKDIR}/libunwind/include.
+ mkdir -p "${WORKDIR}/llvm" || die
+}
+
+src_configure() {
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check-lld
+}
diff --git a/sys-devel/lld/lld-17.0.6.ebuild b/sys-devel/lld/lld-17.0.6.ebuild
new file mode 100644
index 000000000000..33a9eb571205
--- /dev/null
+++ b/sys-devel/lld/lld-17.0.6.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="amd64 arm arm64 ~loong ~ppc ppc64 ~riscv x86 ~arm64-macos"
+IUSE="debug test zstd"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}[debug=,zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
+BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
+ test? (
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
+llvm.org_set_globals
+
+python_check_deps() {
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ llvm.org_src_unpack
+
+ # Directory ${WORKDIR}/llvm does not exist with USE="-test",
+ # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
+ # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
+ # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
+ # to existent directory ${WORKDIR}/libunwind/include.
+ mkdir -p "${WORKDIR}/llvm" || die
+}
+
+src_configure() {
+ # ODR violations (https://github.com/llvm/llvm-project/issues/83529, bug #922353)
+ filter-lto
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check-lld
+}
diff --git a/sys-devel/lld/lld-18.1.3.ebuild b/sys-devel/lld/lld-18.1.3.ebuild
new file mode 100644
index 000000000000..0d20224dc323
--- /dev/null
+++ b/sys-devel/lld/lld-18.1.3.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm.org llvm-utils python-any-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~arm64-macos"
+IUSE="debug test zstd"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}[debug=,zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
+BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
+ test? (
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
+llvm.org_set_globals
+
+python_check_deps() {
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ llvm.org_src_unpack
+
+ # Directory ${WORKDIR}/llvm does not exist with USE="-test",
+ # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
+ # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
+ # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
+ # to existent directory ${WORKDIR}/libunwind/include.
+ mkdir -p "${WORKDIR}/llvm" || die
+}
+
+src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ # ODR violations (https://github.com/llvm/llvm-project/issues/83529, bug #922353)
+ filter-lto
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check-lld
+}
diff --git a/sys-devel/lld/lld-18.1.4.ebuild b/sys-devel/lld/lld-18.1.4.ebuild
new file mode 100644
index 000000000000..0d20224dc323
--- /dev/null
+++ b/sys-devel/lld/lld-18.1.4.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm.org llvm-utils python-any-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~arm64-macos"
+IUSE="debug test zstd"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}[debug=,zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
+BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
+ test? (
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
+llvm.org_set_globals
+
+python_check_deps() {
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ llvm.org_src_unpack
+
+ # Directory ${WORKDIR}/llvm does not exist with USE="-test",
+ # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
+ # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
+ # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
+ # to existent directory ${WORKDIR}/libunwind/include.
+ mkdir -p "${WORKDIR}/llvm" || die
+}
+
+src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ # ODR violations (https://github.com/llvm/llvm-project/issues/83529, bug #922353)
+ filter-lto
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check-lld
+}
diff --git a/sys-devel/lld/lld-13.0.1.9999.ebuild b/sys-devel/lld/lld-19.0.0.9999.ebuild
index 863c9b49bdb9..5440a5c89919 100644
--- a/sys-devel/lld/lld-13.0.1.9999.ebuild
+++ b/sys-devel/lld/lld-19.0.0.9999.ebuild
@@ -1,38 +1,46 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake flag-o-matic llvm llvm.org python-any-r1
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm.org llvm-utils python-any-r1 toolchain-funcs
DESCRIPTION="The LLVM linker (link editor)"
HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE="debug test"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="+debug test zstd"
RESTRICT="!test? ( test )"
-RDEPEND="~sys-devel/llvm-${PV}"
-DEPEND="${RDEPEND}"
+DEPEND="
+ ~sys-devel/llvm-${PV}[debug=,zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
test? (
- >=dev-util/cmake-3.16
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- )"
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
-LLVM_COMPONENTS=( lld libunwind/include/mach-o )
-LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
llvm.org_set_globals
python_check_deps() {
- has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
}
pkg_setup() {
- LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
use test && python-any-r1_pkg_setup
}
@@ -48,22 +56,34 @@ src_unpack() {
}
src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ # ODR violations (https://github.com/llvm/llvm-project/issues/83529, bug #922353)
+ filter-lto
+
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DBUILD_SHARED_LIBS=ON
-DLLVM_INCLUDE_TESTS=$(usex test)
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
)
+
use test && mycmakeargs+=(
- -DLLVM_BUILD_TESTS=ON
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
-DLLVM_LIT_ARGS="$(get_lit_flags)"
-DPython3_EXECUTABLE="${PYTHON}"
)
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
cmake_src_configure
}
diff --git a/sys-devel/lld/lld-13.0.1_rc2.ebuild b/sys-devel/lld/lld-19.0.0_pre20240330.ebuild
index 3377caffce15..5440a5c89919 100644
--- a/sys-devel/lld/lld-13.0.1_rc2.ebuild
+++ b/sys-devel/lld/lld-19.0.0_pre20240330.ebuild
@@ -1,38 +1,46 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake flag-o-matic llvm llvm.org python-any-r1
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm.org llvm-utils python-any-r1 toolchain-funcs
DESCRIPTION="The LLVM linker (link editor)"
HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE="debug test"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="+debug test zstd"
RESTRICT="!test? ( test )"
-RDEPEND="~sys-devel/llvm-${PV}"
-DEPEND="${RDEPEND}"
+DEPEND="
+ ~sys-devel/llvm-${PV}[debug=,zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
test? (
- >=dev-util/cmake-3.16
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- )"
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
-LLVM_COMPONENTS=( lld libunwind/include/mach-o )
-LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
llvm.org_set_globals
python_check_deps() {
- has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
}
pkg_setup() {
- LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
use test && python-any-r1_pkg_setup
}
@@ -48,22 +56,34 @@ src_unpack() {
}
src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ # ODR violations (https://github.com/llvm/llvm-project/issues/83529, bug #922353)
+ filter-lto
+
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DBUILD_SHARED_LIBS=ON
-DLLVM_INCLUDE_TESTS=$(usex test)
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
)
+
use test && mycmakeargs+=(
- -DLLVM_BUILD_TESTS=ON
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
-DLLVM_LIT_ARGS="$(get_lit_flags)"
-DPython3_EXECUTABLE="${PYTHON}"
)
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
cmake_src_configure
}
diff --git a/sys-devel/lld/lld-13.0.1_rc1.ebuild b/sys-devel/lld/lld-19.0.0_pre20240404.ebuild
index 863c9b49bdb9..5440a5c89919 100644
--- a/sys-devel/lld/lld-13.0.1_rc1.ebuild
+++ b/sys-devel/lld/lld-19.0.0_pre20240404.ebuild
@@ -1,38 +1,46 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake flag-o-matic llvm llvm.org python-any-r1
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm.org llvm-utils python-any-r1 toolchain-funcs
DESCRIPTION="The LLVM linker (link editor)"
HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE="debug test"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="+debug test zstd"
RESTRICT="!test? ( test )"
-RDEPEND="~sys-devel/llvm-${PV}"
-DEPEND="${RDEPEND}"
+DEPEND="
+ ~sys-devel/llvm-${PV}[debug=,zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
test? (
- >=dev-util/cmake-3.16
- $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
- )"
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
-LLVM_COMPONENTS=( lld libunwind/include/mach-o )
-LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
llvm.org_set_globals
python_check_deps() {
- has_version -b "dev-python/lit[${PYTHON_USEDEP}]"
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
}
pkg_setup() {
- LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
use test && python-any-r1_pkg_setup
}
@@ -48,22 +56,34 @@ src_unpack() {
}
src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ # ODR violations (https://github.com/llvm/llvm-project/issues/83529, bug #922353)
+ filter-lto
+
# LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DBUILD_SHARED_LIBS=ON
-DLLVM_INCLUDE_TESTS=$(usex test)
- -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
)
+
use test && mycmakeargs+=(
- -DLLVM_BUILD_TESTS=ON
-DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
-DLLVM_LIT_ARGS="$(get_lit_flags)"
-DPython3_EXECUTABLE="${PYTHON}"
)
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
cmake_src_configure
}
diff --git a/sys-devel/lld/lld-19.0.0_pre20240410.ebuild b/sys-devel/lld/lld-19.0.0_pre20240410.ebuild
new file mode 100644
index 000000000000..5440a5c89919
--- /dev/null
+++ b/sys-devel/lld/lld-19.0.0_pre20240410.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm.org llvm-utils python-any-r1 toolchain-funcs
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="+debug test zstd"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}[debug=,zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
+BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
+ test? (
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
+llvm.org_set_globals
+
+python_check_deps() {
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ llvm.org_src_unpack
+
+ # Directory ${WORKDIR}/llvm does not exist with USE="-test",
+ # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
+ # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
+ # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
+ # to existent directory ${WORKDIR}/libunwind/include.
+ mkdir -p "${WORKDIR}/llvm" || die
+}
+
+src_configure() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ # ODR violations (https://github.com/llvm/llvm-project/issues/83529, bug #922353)
+ filter-lto
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check-lld
+}
diff --git a/sys-devel/lld/metadata.xml b/sys-devel/lld/metadata.xml
index 3ad9b7a7c0eb..072910296ca3 100644
--- a/sys-devel/lld/metadata.xml
+++ b/sys-devel/lld/metadata.xml
@@ -4,4 +4,7 @@
<maintainer type="project">
<email>llvm@gentoo.org</email>
</maintainer>
+ <upstream>
+ <remote-id type="github">llvm/llvm-project</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/llvm-common/Manifest b/sys-devel/llvm-common/Manifest
index 286783c6f5a6..6dab866d637b 100644
--- a/sys-devel/llvm-common/Manifest
+++ b/sys-devel/llvm-common/Manifest
@@ -1,5 +1,13 @@
-DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
-DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
-DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
-DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
-DIST llvmorg-13.0.1-rc2.tar.gz 147304491 BLAKE2B 86b2c64e57e4aaab837229b25a95d5517ac077d22cf552d71ff6b996dbdbcd171ad51de7eb12d098b50a139beda4ace843727181a1c6978fc487215391e64a3a SHA512 0d890f3317504c8cef10e118b245e5a4c815cc19f07cbc511a66bde6c9b1f3d15c167942608a8987befe9115b24657d29f72305f9f2794385a7434b80167f40f
+DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948
+DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
+DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
+DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7
+DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
+DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
+DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
+DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
+DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
+DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
+DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
diff --git a/sys-devel/llvm-common/llvm-common-11.1.0.ebuild b/sys-devel/llvm-common/llvm-common-11.1.0.ebuild
deleted file mode 100644
index 277a3cc44f96..000000000000
--- a/sys-devel/llvm-common/llvm-common-11.1.0.ebuild
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of LLVM"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE=""
-
-RDEPEND="!sys-devel/llvm:0"
-
-LLVM_COMPONENTS=( llvm/utils/vim )
-llvm.org_set_globals
-
-src_install() {
- insinto /usr/share/vim/vimfiles
- doins -r */
- # some users may find it useful
- newdoc README README.vim
- dodoc vimrc
-}
diff --git a/sys-devel/llvm-common/llvm-common-12.0.1.ebuild b/sys-devel/llvm-common/llvm-common-12.0.1.ebuild
deleted file mode 100644
index 79fd5f8009dd..000000000000
--- a/sys-devel/llvm-common/llvm-common-12.0.1.ebuild
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of LLVM"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE=""
-
-RDEPEND="!sys-devel/llvm:0"
-
-LLVM_COMPONENTS=( llvm/utils/vim )
-llvm.org_set_globals
-
-src_install() {
- insinto /usr/share/vim/vimfiles
- doins -r */
- # some users may find it useful
- newdoc README README.vim
- dodoc vimrc
-}
diff --git a/sys-devel/llvm-common/llvm-common-13.0.0.ebuild b/sys-devel/llvm-common/llvm-common-13.0.0.ebuild
deleted file mode 100644
index 79fd5f8009dd..000000000000
--- a/sys-devel/llvm-common/llvm-common-13.0.0.ebuild
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of LLVM"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE=""
-
-RDEPEND="!sys-devel/llvm:0"
-
-LLVM_COMPONENTS=( llvm/utils/vim )
-llvm.org_set_globals
-
-src_install() {
- insinto /usr/share/vim/vimfiles
- doins -r */
- # some users may find it useful
- newdoc README README.vim
- dodoc vimrc
-}
diff --git a/sys-devel/llvm-common/llvm-common-13.0.1.9999.ebuild b/sys-devel/llvm-common/llvm-common-13.0.1.9999.ebuild
deleted file mode 100644
index 53511a0a20e3..000000000000
--- a/sys-devel/llvm-common/llvm-common-13.0.1.9999.ebuild
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of LLVM"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-RDEPEND="!sys-devel/llvm:0"
-
-LLVM_COMPONENTS=( llvm/utils/vim )
-llvm.org_set_globals
-
-src_install() {
- insinto /usr/share/vim/vimfiles
- doins -r */
- # some users may find it useful
- newdoc README README.vim
- dodoc vimrc
-}
diff --git a/sys-devel/llvm-common/llvm-common-13.0.1_rc1.ebuild b/sys-devel/llvm-common/llvm-common-13.0.1_rc1.ebuild
deleted file mode 100644
index 53511a0a20e3..000000000000
--- a/sys-devel/llvm-common/llvm-common-13.0.1_rc1.ebuild
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of LLVM"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-RDEPEND="!sys-devel/llvm:0"
-
-LLVM_COMPONENTS=( llvm/utils/vim )
-llvm.org_set_globals
-
-src_install() {
- insinto /usr/share/vim/vimfiles
- doins -r */
- # some users may find it useful
- newdoc README README.vim
- dodoc vimrc
-}
diff --git a/sys-devel/llvm-common/llvm-common-13.0.1_rc2.ebuild b/sys-devel/llvm-common/llvm-common-13.0.1_rc2.ebuild
deleted file mode 100644
index fdadac15eda6..000000000000
--- a/sys-devel/llvm-common/llvm-common-13.0.1_rc2.ebuild
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of LLVM"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-RDEPEND="!sys-devel/llvm:0"
-
-LLVM_COMPONENTS=( llvm/utils/vim )
-llvm.org_set_globals
-
-src_install() {
- insinto /usr/share/vim/vimfiles
- doins -r */
- # some users may find it useful
- newdoc README README.vim
- dodoc vimrc
-}
diff --git a/sys-devel/llvm-common/llvm-common-14.0.0.9999.ebuild b/sys-devel/llvm-common/llvm-common-14.0.0.9999.ebuild
deleted file mode 100644
index 53511a0a20e3..000000000000
--- a/sys-devel/llvm-common/llvm-common-14.0.0.9999.ebuild
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit llvm.org
-
-DESCRIPTION="Common files shared between multiple slots of LLVM"
-HOMEPAGE="https://llvm.org/"
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
-SLOT="0"
-KEYWORDS=""
-IUSE=""
-
-RDEPEND="!sys-devel/llvm:0"
-
-LLVM_COMPONENTS=( llvm/utils/vim )
-llvm.org_set_globals
-
-src_install() {
- insinto /usr/share/vim/vimfiles
- doins -r */
- # some users may find it useful
- newdoc README README.vim
- dodoc vimrc
-}
diff --git a/sys-devel/llvm-common/llvm-common-15.0.7.ebuild b/sys-devel/llvm-common/llvm-common-15.0.7.ebuild
new file mode 100644
index 000000000000..3419b7207944
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-15.0.7.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/llvm-common-16.0.6.ebuild b/sys-devel/llvm-common/llvm-common-16.0.6.ebuild
new file mode 100644
index 000000000000..ab2cb092abd1
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-16.0.6.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/llvm-common-17.0.6.ebuild b/sys-devel/llvm-common/llvm-common-17.0.6.ebuild
new file mode 100644
index 000000000000..ab2cb092abd1
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-17.0.6.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/llvm-common-18.1.3.ebuild b/sys-devel/llvm-common/llvm-common-18.1.3.ebuild
new file mode 100644
index 000000000000..32e5c3f51d9b
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-18.1.3.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/llvm-common-18.1.4.ebuild b/sys-devel/llvm-common/llvm-common-18.1.4.ebuild
new file mode 100644
index 000000000000..32e5c3f51d9b
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-18.1.4.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/llvm-common-19.0.0.9999.ebuild b/sys-devel/llvm-common/llvm-common-19.0.0.9999.ebuild
new file mode 100644
index 000000000000..2d8f35a84179
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-19.0.0.9999.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/llvm-common-19.0.0_pre20240330.ebuild b/sys-devel/llvm-common/llvm-common-19.0.0_pre20240330.ebuild
new file mode 100644
index 000000000000..2d8f35a84179
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-19.0.0_pre20240330.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/llvm-common-19.0.0_pre20240404.ebuild b/sys-devel/llvm-common/llvm-common-19.0.0_pre20240404.ebuild
new file mode 100644
index 000000000000..2d8f35a84179
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-19.0.0_pre20240404.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/llvm-common-19.0.0_pre20240410.ebuild b/sys-devel/llvm-common/llvm-common-19.0.0_pre20240410.ebuild
new file mode 100644
index 000000000000..2d8f35a84179
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-19.0.0_pre20240410.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm-common/metadata.xml b/sys-devel/llvm-common/metadata.xml
index 3ad9b7a7c0eb..072910296ca3 100644
--- a/sys-devel/llvm-common/metadata.xml
+++ b/sys-devel/llvm-common/metadata.xml
@@ -4,4 +4,7 @@
<maintainer type="project">
<email>llvm@gentoo.org</email>
</maintainer>
+ <upstream>
+ <remote-id type="github">llvm/llvm-project</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/llvm-roc/Manifest b/sys-devel/llvm-roc/Manifest
deleted file mode 100644
index 80142c713222..000000000000
--- a/sys-devel/llvm-roc/Manifest
+++ /dev/null
@@ -1,10 +0,0 @@
-DIST llvm-rocm-ocl-3.10.0.tar.gz 123600166 BLAKE2B 9b69dab6c7d1a8dfe0d90c76b54446ec7f8ef6e59c74ad328208ac07dbf8836ae412dc5c32fdcbfc926a2488e81cd8afef71c3ebca6cd8ff745205028ab380d8 SHA512 3bb7dac13d89cadfb61a231564155f49021437b7c35eae8735b88ceae4a23b7950643f17e3bfebb0868621297202a04d41120d50ea52b6ad8980dabe9bc75509
-DIST llvm-rocm-ocl-3.7.0.tar.gz 116973132 BLAKE2B c1cc8a3b95292d726626d3cb59ec1b96549682bfcbec16030e47cf1318c6ea01bc76f3349f012ce4f1e4d8b9fe192c51a025c2d08cf593622c61fe7c61969ba6 SHA512 0626075bedb3898c96c0bb0be7a2aba4662050a1c738115f661bedc03d744ace7a4581b55c6325060740c13a0e50e72e09272bb02c1186c2c4a40fc9b961dcbe
-DIST llvm-rocm-ocl-3.8.0.tar.gz 117004300 BLAKE2B 13c3213f0fb951fb9d574e8f6d76bb6c632fecadfe93dbe68a9720baa22e35aa3269deef8b533c5a5ff50a2c1ee3dd7a1ea0fae4b8ab8573ec5bfc5ca5d04f4f SHA512 4eca387a132c9d1237ebec7c80319e99c80088766209d05a697d09890f4a82c56ba5f48a5c8c8749bb051c177bb5eab67e00405b04d3191681d0ac7cf1ae868c
-DIST llvm-rocm-ocl-3.9.0.tar.gz 123591368 BLAKE2B 54b44d705e7704921df1914bac6dc1da8e420f9383efb698a9cf6a339b653d71cad29aa077a9e24d6764ca81fb8dc55fa70abb0cfac004d40f7d811e20ec9945 SHA512 3404390506b33c1de1d05980fafb219692985f38b52d852e9a47ab94e57228caa25ccd0d0d69da656281de32c75e001f60cb9f22453e70fea7b39d065d4333af
-DIST llvm-rocm-ocl-4.0.0.tar.gz 123595983 BLAKE2B 69dd47a50a53cf7d8168f872778bcda0e028907c2341b165f40152bdf03b668ee6c209dc60fa1018dde2a946d891f15eb92a38cfbc12bb5798dd132c1ce79bf1 SHA512 2ac3d643e0bee72239089003cd2889711a7cd58dc588467fb0ca0a50bec264fda992aa2e3352d5210011a9dc1eea4dd9eacdc7d0c313cd69c7b491df126a4e4e
-DIST llvm-rocm-ocl-4.0.1.tar.gz 123608276 BLAKE2B dd5a4d6bc198c7fb6fdc2514cd8c4533a2df6ded7a574c9b4762cda3cb65498a464a0e78427db94db05b468a29ce78d3d8131ac7c6e42953fc503896732474e3 SHA512 d23dceaee2badf46cda27aa725bce5b82bab2fba7d1c2220fedb4795eee455de5077b4ff7299ecd6850eeb0bbdb131ea12a699357f373aef818758d845550f04
-DIST llvm-rocm-ocl-4.1.0.tar.gz 128913932 BLAKE2B 15a041ec7b9fec91e409c8ab98ff88f2d15ce58822aa8a77a26ff21416378a4a77a5904fce4e26c5447653da4ec2dbbb5bfec4ae70c72e8e64b2a5f5986ffb92 SHA512 8576e5a43754a9587613f166dc6cad18890812f07bfa55e563ab3de150b6f01ae1b5515aaaf4eef238a7f79e87890533ce791ef07528e4557ea8290c2642ebd3
-DIST llvm-rocm-ocl-4.1.1.tar.gz 128914019 BLAKE2B 9806d1da497e9d9864fd015fc92f5e2d8a6077315d96538064357a38347bc9180948c65cdca9e29574b40f8df62c0660762731564822ac9e8b5364bebf016e43 SHA512 0e4c6b9b0c0330d58616f22d8ec6ebdd6c83aef9ce9968765ac56c022bcd76cba8af5a6cdfb47ed560b33cd67832ac5b026502357af6caec4ab699f1443163fd
-DIST llvm-rocm-ocl-4.2.0.tar.gz 132337711 BLAKE2B f08781f881f2853cd551828ef9190c1253e33ca1bfb13aac790b6484838fe5481be9519609ea9cf4bc09a6c8631c54a567123dfe97c25498c51c464d215049de SHA512 694c37c707c84d18cddb92054d8d59e1eea82c9c9928d0111992cbae1421d6bb614a0889891993b444a821c35fa6e91c801ac8555761c2cd0803f89981475952
-DIST llvm-rocm-ocl-4.3.0.tar.gz 134152148 BLAKE2B aaadb75f0b2f72d3c4dca4b375a38b2806491b854d45f6f95bc398c4b7685fccbc4e6df86869c200f08ced5ddb540344ace2402819cdd3c27c5167a71a78bb3b SHA512 4f85f06d5331770b8697bbe62776579ed02016d899ed9c5328d5953fc5992a0996f7934e7417d6062e77a317d242295803fbeab04b0428d5f257cecd4c25c0cd
diff --git a/sys-devel/llvm-roc/files/llvm-roc-3.0.0-add_libraries.patch b/sys-devel/llvm-roc/files/llvm-roc-3.0.0-add_libraries.patch
deleted file mode 100644
index 120ab819f5b4..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-3.0.0-add_libraries.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -Naur a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
---- a/clang/lib/Basic/CMakeLists.txt 2019-12-28 07:42:49.119055933 +0100
-+++ b/clang/lib/Basic/CMakeLists.txt 2019-12-28 07:42:13.265056070 +0100
-@@ -2,6 +2,7 @@
- Core
- MC
- Support
-+ Option
- )
-
- find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
-diff -Naur a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt
---- a/clang/lib/Driver/CMakeLists.txt 2019-12-28 07:41:39.521056199 +0100
-+++ b/clang/lib/Driver/CMakeLists.txt 2019-12-28 07:40:23.998056487 +0100
-@@ -79,4 +79,5 @@
- LINK_LIBS
- clangBasic
- ${system_libs}
-+ pthread
- )
diff --git a/sys-devel/llvm-roc/files/llvm-roc-3.7.0-current_pos.patch b/sys-devel/llvm-roc/files/llvm-roc-3.7.0-current_pos.patch
deleted file mode 100644
index a0d3c1df6d99..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-3.7.0-current_pos.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-https://bugs.llvm.org/show_bug.cgi?id=43235
-
-diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h
-index 705f1790b1d..a0314b2c46a 100644
---- a/include/llvm/Support/raw_ostream.h
-+++ b/include/llvm/Support/raw_ostream.h
-@@ -507,9 +507,7 @@ class raw_string_ostream : public raw_ostream {
- /// See raw_ostream::write_impl.
- void write_impl(const char *Ptr, size_t Size) override;
-
-- /// Return the current position within the stream, not counting the bytes
-- /// currently in the buffer.
-- uint64_t current_pos() const override { return OS.size(); }
-+ uint64_t current_pos() const override;
-
- public:
- explicit raw_string_ostream(std::string &O) : OS(O) {}
-diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
-index 4bb315f824a..742e2aced39 100644
---- a/lib/Support/raw_ostream.cpp
-+++ b/lib/Support/raw_ostream.cpp
-@@ -895,6 +895,10 @@ raw_ostream &llvm::nulls() {
- // raw_string_ostream
- //===----------------------------------------------------------------------===//
-
-+/// Return the current position within the stream, not counting the bytes
-+/// currently in the buffer.
-+uint64_t raw_string_ostream::current_pos() const { return OS.size(); }
-+
- raw_string_ostream::~raw_string_ostream() {
- flush();
- }
diff --git a/sys-devel/llvm-roc/files/llvm-roc-3.9.0-tensorflow.patch b/sys-devel/llvm-roc/files/llvm-roc-3.9.0-tensorflow.patch
deleted file mode 100644
index 3e1124457ad3..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-3.9.0-tensorflow.patch
+++ /dev/null
@@ -1,35 +0,0 @@
---- llvm-project-rocm-3.9.0.orig/CMakeLists.txt 2020-11-12 22:03:09.902293395 +0100
-+++ llvm-project-rocm-3.9.0/CMakeLists.txt 2020-11-12 22:07:28.185294853 +0100
-@@ -824,6 +824,11 @@
- ${LLVM_INCLUDE_DIR}/llvm/Config/Targets.def
- )
-
-+# They are not referenced. See set_output_directory().
-+set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
-+set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
-+set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
-+
- # For up-to-date instructions for installing the Tensorflow dependency, refer to
- # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
- # In this case, the latest C API library is available for download from
-@@ -832,18 +837,13 @@
- # LLVM_HAVE_TF_API, through llvm-config.h, so that a user of the LLVM library may
- # also leverage the dependency.
- set(TENSORFLOW_C_LIB_PATH "" CACHE PATH "Path to TensorFlow C library install")
--find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib)
-
--if (tensorflow_c_api)
-+if (TENSORFLOW_C_LIB_PATH)
-+ find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib NO_DEFAULT_PATH REQUIRED)
- set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
- include_directories(${TENSORFLOW_C_LIB_PATH}/include)
- endif()
-
--# They are not referenced. See set_output_directory().
--set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
--set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
--set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
--
- # For up-to-date instructions for installing the Tensorflow dependency, refer to
- # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
- # Specifically, assuming python3 is installed:
diff --git a/sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch b/sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch
deleted file mode 100644
index 225adc709666..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-4.0.0-hip-location.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-replace hardcoded hip finder with Gentoo paths.
-
-It is not necessary to check HIP runtime each time.
-
-Author: Benda Xu <heroxbd@gentoo.org>
-
-Index: llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp
-===================================================================
---- llvm-project-rocm-4.0.0.orig/clang/lib/Driver/ToolChains/AMDGPU.cpp
-+++ llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp
-@@ -116,37 +116,8 @@ RocmInstallationDetector::getInstallatio
- return Candidates;
- }
-
-- // Try to find relative to the compiler binary.
-- const char *InstallDir = D.getInstalledDir();
-+ Candidates.emplace_back(D.SysRoot + "/usr", /*StrictChecking=*/true);
-
-- // Check both a normal Unix prefix position of the clang binary, as well as
-- // the Windows-esque layout the ROCm packages use with the host architecture
-- // subdirectory of bin.
--
-- // Strip off directory (usually bin)
-- StringRef ParentDir = llvm::sys::path::parent_path(InstallDir);
-- StringRef ParentName = llvm::sys::path::filename(ParentDir);
--
-- // Some builds use bin/{host arch}, so go up again.
-- if (ParentName == "bin") {
-- ParentDir = llvm::sys::path::parent_path(ParentDir);
-- ParentName = llvm::sys::path::filename(ParentDir);
-- }
--
-- // Some versions of the rocm llvm package install to /opt/rocm/llvm/bin
-- if (ParentName == "llvm")
-- ParentDir = llvm::sys::path::parent_path(ParentDir);
--
-- Candidates.emplace_back(ParentDir.str(), /*StrictChecking=*/true);
--
-- // Device library may be installed in clang resource directory.
-- Candidates.emplace_back(D.ResourceDir, /*StrictChecking=*/true);
--
-- Candidates.emplace_back(D.SysRoot + "/opt/rocm", /*StrictChecking=*/true);
-- if (ParentName.startswith("aomp")) {
-- // Some versions of the aomp package install to /opt/rocm/aomp/bin
-- Candidates.emplace_back(ParentDir.str());
-- }
- return Candidates;
- }
-
-@@ -273,33 +244,7 @@ void RocmInstallationDetector::detectDev
- }
-
- void RocmInstallationDetector::detectHIPRuntime() {
-- auto Candidates = getInstallationPathCandidates();
-- auto &FS = D.getVFS();
--
-- for (const auto &Candidate : Candidates) {
-- InstallPath = Candidate.Path;
-- if (InstallPath.empty() || !FS.exists(InstallPath))
-- continue;
--
-- BinPath = InstallPath;
-- llvm::sys::path::append(BinPath, "bin");
-- IncludePath = InstallPath;
-- llvm::sys::path::append(IncludePath, "include");
-- LibPath = InstallPath;
-- llvm::sys::path::append(LibPath, "lib");
--
-- llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> VersionFile =
-- FS.getBufferForFile(BinPath + "/.hipVersion");
-- if (!VersionFile && Candidate.StrictChecking)
-- continue;
--
-- if (HIPVersionArg.empty() && VersionFile)
-- ParseHIPVersionFile((*VersionFile)->getBuffer());
--
-- HasHIPRuntime = true;
-- return;
-- }
-- HasHIPRuntime = false;
-+ HasHIPRuntime = true;
- }
-
- void RocmInstallationDetector::print(raw_ostream &OS) const {
diff --git a/sys-devel/llvm-roc/files/llvm-roc-4.0.0-remove-isystem-usr-include.patch b/sys-devel/llvm-roc/files/llvm-roc-4.0.0-remove-isystem-usr-include.patch
deleted file mode 100644
index f14ec4ac0db2..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-4.0.0-remove-isystem-usr-include.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-Author: Wilfried (justxi) Holzke
-
-Adopted from https://github.com/justxi/rocm/blob/master/sys-devel/llvm-roc/files/llvm-roc-4.0.0-remove-isystem-usr-include.patch
-
-Index: llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp
-===================================================================
---- llvm-project-rocm-4.0.0.orig/clang/lib/Driver/ToolChains/AMDGPU.cpp
-+++ llvm-project-rocm-4.0.0/clang/lib/Driver/ToolChains/AMDGPU.cpp
-@@ -326,11 +326,6 @@ void RocmInstallationDetector::AddHIPInc
- //
- // ROCm 3.5 does not fully support the wrapper headers. Therefore it needs
- // a workaround.
-- SmallString<128> P(D.ResourceDir);
-- if (UsesRuntimeWrapper)
-- llvm::sys::path::append(P, "include", "cuda_wrappers");
-- CC1Args.push_back("-internal-isystem");
-- CC1Args.push_back(DriverArgs.MakeArgString(P));
- }
-
- if (DriverArgs.hasArg(options::OPT_nogpuinc))
-@@ -341,8 +336,6 @@ void RocmInstallationDetector::AddHIPInc
- return;
- }
-
-- CC1Args.push_back("-internal-isystem");
-- CC1Args.push_back(DriverArgs.MakeArgString(getIncludePath()));
- if (UsesRuntimeWrapper)
- CC1Args.append({"-include", "__clang_hip_runtime_wrapper.h"});
- }
diff --git a/sys-devel/llvm-roc/files/llvm-roc-4.1.0-fix-missing-include.patch b/sys-devel/llvm-roc/files/llvm-roc-4.1.0-fix-missing-include.patch
deleted file mode 100644
index 4914ba2e7f98..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-4.1.0-fix-missing-include.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-From b498303066a63a203d24f739b2d2e0e56dca70d1 Mon Sep 17 00:00:00 2001
-From: serge-sans-paille <sguelton@redhat.com>
-Date: Tue, 10 Nov 2020 14:55:25 +0100
-Subject: [PATCH] [nfc] Fix missing include
-
----
- llvm/utils/benchmark/src/benchmark_register.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/utils/benchmark/src/benchmark_register.h b/llvm/utils/benchmark/src/benchmark_register.h
-index 0705e219f2fa2..4caa5ad4da079 100644
---- a/utils/benchmark/src/benchmark_register.h
-+++ b/utils/benchmark/src/benchmark_register.h
-@@ -1,6 +1,7 @@
- #ifndef BENCHMARK_REGISTER_H
- #define BENCHMARK_REGISTER_H
-
-+#include <limits>
- #include <vector>
-
- #include "check.h"
diff --git a/sys-devel/llvm-roc/files/llvm-roc-4.2.0-add_Object.patch b/sys-devel/llvm-roc/files/llvm-roc-4.2.0-add_Object.patch
deleted file mode 100644
index da21ab2fc85a..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-4.2.0-add_Object.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff --color -uprN orig/lib/Target/AMDGPU/Disassembler/CMakeLists.txt llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt
---- orig/lib/Target/AMDGPU/Disassembler/CMakeLists.txt 2021-06-14 11:57:54.222796911 +0800
-+++ llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt 2021-06-14 11:58:35.206796875 +0800
-@@ -11,6 +11,7 @@ add_llvm_component_library(LLVMAMDGPUDis
- MC
- MCDisassembler
- Support
-+ Object
-
- ADD_TO_COMPONENT
- AMDGPU
diff --git a/sys-devel/llvm-roc/files/llvm-roc-4.2.0-current_pos.patch b/sys-devel/llvm-roc/files/llvm-roc-4.2.0-current_pos.patch
deleted file mode 100644
index 0f3398951b07..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-4.2.0-current_pos.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -Naur a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h
---- a/include/llvm/Support/raw_ostream.h 2021-05-22 19:56:44.779955686 +0200
-+++ b/include/llvm/Support/raw_ostream.h 2021-05-22 20:00:49.449954752 +0200
-@@ -610,9 +610,7 @@
- /// See raw_ostream::write_impl.
- void write_impl(const char *Ptr, size_t Size) override;
-
-- /// Return the current position within the stream, not counting the bytes
-- /// currently in the buffer.
-- uint64_t current_pos() const override { return OS.size(); }
-+ uint64_t current_pos() const override;
-
- public:
- explicit raw_string_ostream(std::string &O) : OS(O) {
-diff -Naur a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp
---- a/lib/Support/raw_ostream.cpp 2021-05-22 19:59:05.651955148 +0200
-+++ b/lib/Support/raw_ostream.cpp 2021-05-22 20:01:22.929954625 +0200
-@@ -938,6 +938,10 @@
- // raw_string_ostream
- //===----------------------------------------------------------------------===//
-
-+/// Return the current position within the stream, not counting the bytes
-+/// currently in the buffer.
-+uint64_t raw_string_ostream::current_pos() const { return OS.size(); }
-+
- raw_string_ostream::~raw_string_ostream() {
- flush();
- }
diff --git a/sys-devel/llvm-roc/files/llvm-roc-4.2.0-cyclades.patch b/sys-devel/llvm-roc/files/llvm-roc-4.2.0-cyclades.patch
deleted file mode 100644
index 629ede5bbc76..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-4.2.0-cyclades.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-https://github.com/RadeonOpenCompute/llvm-project/commit/68d5235cb58f988c71b403334cd9482d663841ab.patch
-https://bugs.gentoo.org/800695
-Differential Revision: https://reviews.llvm.org/D102059
-
-From 68d5235cb58f988c71b403334cd9482d663841ab Mon Sep 17 00:00:00 2001
-From: Tamar Christina <tamar.christina@arm.com>
-Date: Thu, 20 May 2021 18:55:11 +0100
-Subject: [PATCH] libsanitizer: Remove cyclades inclusion in sanitizer
---- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -370,15 +370,6 @@ static void ioctl_table_fill() {
-
- #if SANITIZER_GLIBC
- // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
-- _(CYGETDEFTHRESH, WRITE, sizeof(int));
-- _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
-- _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
-- _(CYGETTHRESH, WRITE, sizeof(int));
-- _(CYGETTIMEOUT, WRITE, sizeof(int));
-- _(CYSETDEFTHRESH, NONE, 0);
-- _(CYSETDEFTIMEOUT, NONE, 0);
-- _(CYSETTHRESH, NONE, 0);
-- _(CYSETTIMEOUT, NONE, 0);
- _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
- _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
- _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
-@@ -143,7 +143,6 @@ typedef struct user_fpregs elf_fpregset_t;
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
- #include <linux/lp.h>
-@@ -460,7 +459,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
-
- #if SANITIZER_GLIBC
- unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
-- unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
- unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
- #else
-@@ -824,15 +822,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- #endif // SANITIZER_LINUX
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
-- unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
-- unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
-- unsigned IOCTL_CYGETMON = CYGETMON;
-- unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
-- unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
-- unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
-- unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
-- unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
-- unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
- unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
- unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
- unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -983,7 +983,6 @@ extern unsigned struct_vt_mode_sz;
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- extern unsigned struct_ax25_parms_struct_sz;
--extern unsigned struct_cyclades_monitor_sz;
- extern unsigned struct_input_keymap_entry_sz;
- extern unsigned struct_ipx_config_data_sz;
- extern unsigned struct_kbdiacrs_sz;
-@@ -1328,15 +1327,6 @@ extern unsigned IOCTL_VT_WAITACTIVE;
- #endif // SANITIZER_LINUX
-
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--extern unsigned IOCTL_CYGETDEFTHRESH;
--extern unsigned IOCTL_CYGETDEFTIMEOUT;
--extern unsigned IOCTL_CYGETMON;
--extern unsigned IOCTL_CYGETTHRESH;
--extern unsigned IOCTL_CYGETTIMEOUT;
--extern unsigned IOCTL_CYSETDEFTHRESH;
--extern unsigned IOCTL_CYSETDEFTIMEOUT;
--extern unsigned IOCTL_CYSETTHRESH;
--extern unsigned IOCTL_CYSETTIMEOUT;
- extern unsigned IOCTL_EQL_EMANCIPATE;
- extern unsigned IOCTL_EQL_ENSLAVE;
- extern unsigned IOCTL_EQL_GETMASTRCFG;
diff --git a/sys-devel/llvm-roc/files/llvm-roc-4.3.0-hip-location.patch b/sys-devel/llvm-roc/files/llvm-roc-4.3.0-hip-location.patch
deleted file mode 100644
index 1fe93a33db36..000000000000
--- a/sys-devel/llvm-roc/files/llvm-roc-4.3.0-hip-location.patch
+++ /dev/null
@@ -1,189 +0,0 @@
-replace hardcoded hip finder with Gentoo paths.
-
-It is not necessary to check HIP runtime each time.
-
-Author: Benda Xu <heroxbd@gentoo.org>
-Author: Yiyang Wu <xgreenlandforwyy@gmail.com>
-
---- orig/clang/lib/Driver/ToolChains/AMDGPU.cpp
-+++ llvm-project-rocm-4.3.0/clang/lib/Driver/ToolChains/AMDGPU.cpp
-@@ -165,133 +165,8 @@ bool RocmInstallationDetector::parseHIPV
- /// cached and populated only once.
- const SmallVectorImpl<RocmInstallationDetector::Candidate> &
- RocmInstallationDetector::getInstallationPathCandidates() {
--
-- // Return the cached candidate list if it has already been populated.
-- if (!ROCmSearchDirs.empty())
-- return ROCmSearchDirs;
--
-- auto DoPrintROCmSearchDirs = [&]() {
-- if (PrintROCmSearchDirs)
-- for (auto Cand : ROCmSearchDirs) {
-- llvm::errs() << "ROCm installation search path";
-- if (Cand.isSPACK())
-- llvm::errs() << " (Spack " << Cand.SPACKReleaseStr << ")";
-- llvm::errs() << ": " << Cand.Path << '\n';
-- }
-- };
--
-- // For candidate specified by --rocm-path we do not do strict check, i.e.,
-- // checking existence of HIP version file and device library files.
-- if (!RocmPathArg.empty()) {
-- ROCmSearchDirs.emplace_back(RocmPathArg.str());
-- DoPrintROCmSearchDirs();
-- return ROCmSearchDirs;
-- } else if (const char *RocmPathEnv = ::getenv("ROCM_PATH")) {
-- if (!StringRef(RocmPathEnv).empty()) {
-- ROCmSearchDirs.emplace_back(RocmPathEnv);
-- DoPrintROCmSearchDirs();
-- return ROCmSearchDirs;
-- }
-- }
--
-- // Try to find relative to the compiler binary.
-- const char *InstallDir = D.getInstalledDir();
--
-- // Check both a normal Unix prefix position of the clang binary, as well as
-- // the Windows-esque layout the ROCm packages use with the host architecture
-- // subdirectory of bin.
-- auto DeduceROCmPath = [](StringRef ClangPath) {
-- // Strip off directory (usually bin)
-- StringRef ParentDir = llvm::sys::path::parent_path(ClangPath);
-- StringRef ParentName = llvm::sys::path::filename(ParentDir);
--
-- // Some builds use bin/{host arch}, so go up again.
-- if (ParentName == "bin") {
-- ParentDir = llvm::sys::path::parent_path(ParentDir);
-- ParentName = llvm::sys::path::filename(ParentDir);
-- }
--
-- // Detect ROCm packages built with SPACK.
-- // clang is installed at
-- // <rocm_root>/llvm-amdgpu-<rocm_release_string>-<hash>/bin directory.
-- // We only consider the parent directory of llvm-amdgpu package as ROCm
-- // installation candidate for SPACK.
-- if (ParentName.startswith("llvm-amdgpu-")) {
-- auto SPACKPostfix =
-- ParentName.drop_front(strlen("llvm-amdgpu-")).split('-');
-- auto SPACKReleaseStr = SPACKPostfix.first;
-- if (!SPACKReleaseStr.empty()) {
-- ParentDir = llvm::sys::path::parent_path(ParentDir);
-- return Candidate(ParentDir.str(), /*StrictChecking=*/true,
-- SPACKReleaseStr);
-- }
-- }
--
-- // Some versions of the rocm llvm package install to /opt/rocm/llvm/bin
-- // Some versions of the aomp package install to /opt/rocm/aomp/bin
-- if (ParentName == "llvm" || ParentName.startswith("aomp"))
-- ParentDir = llvm::sys::path::parent_path(ParentDir);
--
-- return Candidate(ParentDir.str(), /*StrictChecking=*/true);
-- };
--
-- // Deduce ROCm path by the path used to invoke clang. Do not resolve symbolic
-- // link of clang itself.
-- ROCmSearchDirs.emplace_back(DeduceROCmPath(InstallDir));
--
-- // Deduce ROCm path by the real path of the invoked clang, resolving symbolic
-- // link of clang itself.
-- llvm::SmallString<256> RealClangPath;
-- llvm::sys::fs::real_path(D.getClangProgramPath(), RealClangPath);
-- auto ParentPath = llvm::sys::path::parent_path(RealClangPath);
-- if (ParentPath != InstallDir)
-- ROCmSearchDirs.emplace_back(DeduceROCmPath(ParentPath));
--
-- // Device library may be installed in clang resource directory.
-- ROCmSearchDirs.emplace_back(D.ResourceDir,
-- /*StrictChecking=*/true);
--
-- ROCmSearchDirs.emplace_back(D.SysRoot + "/opt/rocm",
-- /*StrictChecking=*/true);
--
-- // Find the latest /opt/rocm-{release} directory.
-- std::error_code EC;
-- std::string LatestROCm;
-- llvm::VersionTuple LatestVer;
-- // Get ROCm version from ROCm directory name.
-- auto GetROCmVersion = [](StringRef DirName) {
-- llvm::VersionTuple V;
-- std::string VerStr = DirName.drop_front(strlen("rocm-")).str();
-- // The ROCm directory name follows the format of
-- // rocm-{major}.{minor}.{subMinor}[-{build}]
-- std::replace(VerStr.begin(), VerStr.end(), '-', '.');
-- V.tryParse(VerStr);
-- return V;
-- };
-- for (llvm::vfs::directory_iterator
-- File = D.getVFS().dir_begin(D.SysRoot + "/opt", EC),
-- FileEnd;
-- File != FileEnd && !EC; File.increment(EC)) {
-- llvm::StringRef FileName = llvm::sys::path::filename(File->path());
-- if (!FileName.startswith("rocm-"))
-- continue;
-- if (LatestROCm.empty()) {
-- LatestROCm = FileName.str();
-- LatestVer = GetROCmVersion(LatestROCm);
-- continue;
-- }
-- auto Ver = GetROCmVersion(FileName);
-- if (LatestVer < Ver) {
-- LatestROCm = FileName.str();
-- LatestVer = Ver;
-- }
-- }
-- if (!LatestROCm.empty())
-- ROCmSearchDirs.emplace_back(D.SysRoot + "/opt/" + LatestROCm,
-- /*StrictChecking=*/true);
--
-- DoPrintROCmSearchDirs();
-- return ROCmSearchDirs;
-+ ROCmSearchDirs.emplace_back(D.SysRoot + "/usr", /*StrictChecking=*/true);
-+ return ROCmSearchDirs;
- }
-
- RocmInstallationDetector::RocmInstallationDetector(
-@@ -423,42 +298,7 @@ void RocmInstallationDetector::detectDev
- }
-
- void RocmInstallationDetector::detectHIPRuntime() {
-- SmallVector<Candidate, 4> HIPSearchDirs;
-- if (!HIPPathArg.empty())
-- HIPSearchDirs.emplace_back(HIPPathArg.str(), /*StrictChecking=*/true);
-- else
-- HIPSearchDirs.append(getInstallationPathCandidates());
-- auto &FS = D.getVFS();
--
-- for (const auto &Candidate : HIPSearchDirs) {
-- InstallPath = Candidate.Path;
-- if (InstallPath.empty() || !FS.exists(InstallPath))
-- continue;
-- // HIP runtime built by SPACK is installed to
-- // <rocm_root>/hip-<rocm_release_string>-<hash> directory.
-- auto SPACKPath = findSPACKPackage(Candidate, "hip");
-- InstallPath = SPACKPath.empty() ? InstallPath : SPACKPath;
--
-- BinPath = InstallPath;
-- llvm::sys::path::append(BinPath, "bin");
-- IncludePath = InstallPath;
-- llvm::sys::path::append(IncludePath, "include");
-- LibPath = InstallPath;
-- llvm::sys::path::append(LibPath, "lib");
--
-- llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> VersionFile =
-- FS.getBufferForFile(BinPath + "/.hipVersion");
-- if (!VersionFile && Candidate.StrictChecking)
-- continue;
--
-- if (HIPVersionArg.empty() && VersionFile)
-- if (parseHIPVersionFile((*VersionFile)->getBuffer()))
-- continue;
--
-- HasHIPRuntime = true;
-- return;
-- }
-- HasHIPRuntime = false;
-+ HasHIPRuntime = true;
- }
-
- void RocmInstallationDetector::print(raw_ostream &OS) const {
diff --git a/sys-devel/llvm-roc/llvm-roc-3.10.0.ebuild b/sys-devel/llvm-roc/llvm-roc-3.10.0.ebuild
deleted file mode 100644
index 399b74cc8ee3..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-3.10.0.ebuild
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug runtime"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
- "${FILESDIR}/${PN}-3.9.0-tensorflow.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-3.7.0-r1.ebuild b/sys-devel/llvm-roc/llvm-roc-3.7.0-r1.ebuild
deleted file mode 100644
index 9e5adf08c009..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-3.7.0-r1.ebuild
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${P}-current_pos.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="clang;lld"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-3.8.0.ebuild b/sys-devel/llvm-roc/llvm-roc-3.8.0.ebuild
deleted file mode 100644
index 69223b7e04a7..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-3.8.0.ebuild
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug runtime"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild b/sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild
deleted file mode 100644
index 6dd5e75e0479..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-3.9.0.ebuild
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug runtime"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
- "${FILESDIR}/${P}-tensorflow.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-4.0.0-r2.ebuild b/sys-devel/llvm-roc/llvm-roc-4.0.0-r2.ebuild
deleted file mode 100644
index 1c7a0fec0170..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-4.0.0-r2.ebuild
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug +runtime"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
- "${FILESDIR}/${PN}-3.9.0-tensorflow.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-remove-isystem-usr-include.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-hip-location.patch"
-
- if [[ -n ${EPREFIX} ]]; then
- pushd "${S}"/../clang >/dev/null || die
- sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt
- eend $?
- ebegin "Use "${EPREFIX}" as default sysroot"
- cd lib/Driver/ToolChains >/dev/null || die
- ebegin "Use dynamic linker from ${EPREFIX}"
- sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" Linux.cpp
- eend $?
-
- ebegin "Remove --sysroot call on ld for native toolchain"
- sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp
- eend $?
- popd >/dev/null || die
- fi
-
- # handled by sysroot, don't prefixify here.
- sed -e 's:/opt/rocm:/usr/lib/hip:' \
- -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp
-
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild b/sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild
deleted file mode 100644
index 3967ddabbea5..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug runtime"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
- "${FILESDIR}/${PN}-3.9.0-tensorflow.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
-
- if [[ -n ${EPREFIX} ]]; then
- pushd "${S}"/../clang >/dev/null || die
- sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt
- eend $?
-
- ebegin "Use "${EPREFIX}" as default sysroot"
- cd lib/Driver/ToolChains >/dev/null || die
- ebegin "Use dynamic linker from ${EPREFIX}"
- sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" Linux.cpp
- eend $?
-
- ebegin "Remove --sysroot call on ld for native toolchain"
- sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp
- eend $?
- popd >/dev/null || die
- fi
-
- sed -e 's:/opt/rocm:/usr/lib/hip:' \
- -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp
-
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-4.0.1.ebuild b/sys-devel/llvm-roc/llvm-roc-4.0.1.ebuild
deleted file mode 100644
index 1c7a0fec0170..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-4.0.1.ebuild
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug +runtime"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
- "${FILESDIR}/${PN}-3.9.0-tensorflow.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-remove-isystem-usr-include.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-hip-location.patch"
-
- if [[ -n ${EPREFIX} ]]; then
- pushd "${S}"/../clang >/dev/null || die
- sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt
- eend $?
- ebegin "Use "${EPREFIX}" as default sysroot"
- cd lib/Driver/ToolChains >/dev/null || die
- ebegin "Use dynamic linker from ${EPREFIX}"
- sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" Linux.cpp
- eend $?
-
- ebegin "Remove --sysroot call on ld for native toolchain"
- sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp
- eend $?
- popd >/dev/null || die
- fi
-
- # handled by sysroot, don't prefixify here.
- sed -e 's:/opt/rocm:/usr/lib/hip:' \
- -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp
-
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-4.1.0.ebuild b/sys-devel/llvm-roc/llvm-roc-4.1.0.ebuild
deleted file mode 100644
index 68df2726a379..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-4.1.0.ebuild
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug +runtime"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
- "${FILESDIR}/${PN}-4.1.0-fix-missing-include.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-remove-isystem-usr-include.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-hip-location.patch"
-
- if [[ -n ${EPREFIX} ]]; then
- pushd "${S}"/../clang >/dev/null || die
- sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt
- eend $?
- ebegin "Use "${EPREFIX}" as default sysroot"
- cd lib/Driver/ToolChains >/dev/null || die
- ebegin "Use dynamic linker from ${EPREFIX}"
- sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" Linux.cpp
- eend $?
-
- ebegin "Remove --sysroot call on ld for native toolchain"
- sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp
- eend $?
- popd >/dev/null || die
- fi
-
- # handled by sysroot, don't prefixify here.
- sed -e 's:/opt/rocm:/usr/lib/hip:' \
- -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp
-
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-4.1.1.ebuild b/sys-devel/llvm-roc/llvm-roc-4.1.1.ebuild
deleted file mode 100644
index 051b2af18e3f..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-4.1.1.ebuild
+++ /dev/null
@@ -1,94 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug +runtime"
-
-RDEPEND="virtual/cblas
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-3.7.0-current_pos.patch"
- "${FILESDIR}/${PN}-4.1.0-fix-missing-include.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-remove-isystem-usr-include.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-hip-location.patch"
-
- if [[ -n ${EPREFIX} ]]; then
- pushd "${S}"/../clang >/dev/null || die
- sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt
- eend $?
- ebegin "Use "${EPREFIX}" as default sysroot"
- cd lib/Driver/ToolChains >/dev/null || die
- ebegin "Use dynamic linker from ${EPREFIX}"
- sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" Linux.cpp
- eend $?
-
- ebegin "Remove --sysroot call on ld for native toolchain"
- sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp
- eend $?
- popd >/dev/null || die
- fi
-
- # handled by sysroot, don't prefixify here.
- sed -e 's:/opt/rocm:/usr/lib/hip:' \
- -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp
-
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-4.2.0.ebuild b/sys-devel/llvm-roc/llvm-roc-4.2.0.ebuild
deleted file mode 100644
index d4d6b886d09e..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-4.2.0.ebuild
+++ /dev/null
@@ -1,94 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug +runtime"
-
-RDEPEND="
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.2.0-current_pos.patch"
- "${FILESDIR}/${PN}-4.2.0-add_Object.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-remove-isystem-usr-include.patch"
- eapply "${FILESDIR}/${PN}-4.2.0-cyclades.patch"
-
- if [[ -n ${EPREFIX} ]]; then
- pushd "${S}"/../clang >/dev/null || die
- sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt
- eend $?
- ebegin "Use "${EPREFIX}" as default sysroot"
- cd lib/Driver/ToolChains >/dev/null || die
- ebegin "Use dynamic linker from ${EPREFIX}"
- sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" Linux.cpp
- eend $?
-
- ebegin "Remove --sysroot call on ld for native toolchain"
- sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp
- eend $?
- popd >/dev/null || die
- fi
-
- # handled by sysroot, don't prefixify here.
- sed -e 's:/opt/rocm:/usr/lib/hip:' \
- -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp
-
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/llvm-roc-4.3.0-r1.ebuild b/sys-devel/llvm-roc/llvm-roc-4.3.0-r1.ebuild
deleted file mode 100644
index 34567ada1922..000000000000
--- a/sys-devel/llvm-roc/llvm-roc-4.3.0-r1.ebuild
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit cmake
-
-DESCRIPTION="Radeon Open Compute llvm,lld,clang"
-HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm/"
-SRC_URI="https://github.com/RadeonOpenCompute/llvm-project/archive/rocm-${PV}.tar.gz -> llvm-rocm-ocl-${PV}.tar.gz"
-
-LICENSE="UoI-NCSA rc BSD public-domain"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="debug +runtime"
-
-RDEPEND="
- dev-libs/libxml2
- sys-libs/zlib
- sys-libs/ncurses:="
-DEPEND="${RDEPEND}"
-
-S="${WORKDIR}/llvm-project-rocm-${PV}/llvm"
-
-PATCHES=(
- "${FILESDIR}/${PN}-4.2.0-current_pos.patch"
- "${FILESDIR}/${PN}-4.2.0-add_Object.patch"
-)
-
-CMAKE_BUILD_TYPE=RelWithDebInfo
-
-src_prepare() {
- cd "${WORKDIR}/llvm-project-rocm-${PV}" || die
- eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch"
- eapply "${FILESDIR}/${PN}-4.0.0-remove-isystem-usr-include.patch"
- eapply "${FILESDIR}/${PN}-4.3.0-hip-location.patch"
- eapply "${FILESDIR}/${PN}-4.2.0-cyclades.patch"
-
- if [[ -n ${EPREFIX} ]]; then
- pushd "${S}"/../clang >/dev/null || die
- sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt || die
- eend $?
- ebegin "Use "${EPREFIX}" as default sysroot"
- cd lib/Driver/ToolChains >/dev/null || die
- ebegin "Use dynamic linker from ${EPREFIX}"
- sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" Linux.cpp || die
- eend $?
-
- ebegin "Remove --sysroot call on ld for native toolchain"
- sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp || die
- eend $?
- popd >/dev/null || die
- fi
-
- # handled by sysroot, don't prefixify here.
- sed -e 's:/opt/rocm:/usr/lib/hip:' \
- -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp || die
-
- eapply_user
- cmake_src_prepare
-}
-
-src_configure() {
- PROJECTS="clang;lld"
-
- if usex runtime; then
- PROJECTS+=";compiler-rt"
- fi
-
- local mycmakeargs=(
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/roc"
- -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
- -DLLVM_ENABLE_PROJECTS="${PROJECTS}"
- -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86"
- -DLLVM_BUILD_DOCS=NO
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=NO
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- -DLLVM_VERSION_SUFFIX=roc
- -DOCAMLFIND=NO
- )
-
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
-
- cmake_src_configure
-}
-
-src_install() {
- cmake_src_install
- cat > "99${PN}" <<-EOF
- LDPATH="${EROOT}/usr/lib/llvm/roc/lib"
- EOF
- doenvd "99${PN}"
-}
diff --git a/sys-devel/llvm-roc/metadata.xml b/sys-devel/llvm-roc/metadata.xml
deleted file mode 100644
index e9e51b8f323e..000000000000
--- a/sys-devel/llvm-roc/metadata.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="person">
- <email>candrews@gentoo.org</email>
- <name>Craig Andrews</name>
- </maintainer>
- <upstream>
- <remote-id type="github">RadeonOpenCompute/llvm-project</remote-id>
- </upstream>
- <use>
- <flag name="runtime">Builds the compiler runtime libraries.</flag>
- </use>
-</pkgmetadata>
diff --git a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15-r1.ebuild b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15-r1.ebuild
new file mode 100644
index 000000000000..63180b2f53b6
--- /dev/null
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLVM on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/llvm:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local tools=(
+ addr2line ar dlltool nm objcopy objdump ranlib readelf size
+ strings strip windres
+ )
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${t}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${chost}-${t}"
+ done
+ done
+}
diff --git a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16-r1.ebuild b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16-r1.ebuild
new file mode 100644
index 000000000000..c1c22114f553
--- /dev/null
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLVM on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/llvm:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local tools=(
+ addr2line ar dlltool nm objcopy objdump ranlib readelf size
+ strings strip windres
+ )
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${t}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${chost}-${t}"
+ done
+ done
+}
diff --git a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-17.ebuild b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-17.ebuild
new file mode 100644
index 000000000000..c1c22114f553
--- /dev/null
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-17.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLVM on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/llvm:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local tools=(
+ addr2line ar dlltool nm objcopy objdump ranlib readelf size
+ strings strip windres
+ )
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${t}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${chost}-${t}"
+ done
+ done
+}
diff --git a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-18.ebuild b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-18.ebuild
new file mode 100644
index 000000000000..c007ffe5deb6
--- /dev/null
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-18.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLVM on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/llvm:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local tools=(
+ addr2line ar dlltool nm objcopy objdump ranlib readelf size
+ strings strip windres
+ )
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${t}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${chost}-${t}"
+ done
+ done
+}
diff --git a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-19.ebuild b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-19.ebuild
new file mode 100644
index 000000000000..a57062acab8c
--- /dev/null
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-19.ebuild
@@ -0,0 +1,46 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLVM on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/llvm:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local tools=(
+ addr2line ar dlltool nm objcopy objdump ranlib readelf size
+ strings strip windres
+ )
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${t}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${chost}-${t}"
+ done
+ done
+}
diff --git a/sys-devel/llvm-toolchain-symlinks/metadata.xml b/sys-devel/llvm-toolchain-symlinks/metadata.xml
new file mode 100644
index 000000000000..d62775dfc3a3
--- /dev/null
+++ b/sys-devel/llvm-toolchain-symlinks/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="multilib-symlinks">
+ Install symlinks for all ABI CHOSTs. Note that this can
+ result in gcc being overrode for native builds, as well
+ as conflict with crossdev if used for the same targets.
+ </flag>
+ <flag name="native-symlinks">
+ Install generic tool symlinks like 'objdump' and 'ranlib',
+ as well as ${CTARGET}-*. These symlinks are installed
+ into slotted LLVM bindir, so they should not take precedence
+ over symlinks installed into /usr/bin
+ by <pkg>sys-devel/binutils-config</pkg> but they can be
+ helpful for binutils-free setups.
+ </flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index 357ee720db72..8a3f6065ca66 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -1,14 +1,20 @@
-DIST llvm-11.1.0-manpages.tar.bz2 191571 BLAKE2B d6f8e1390dd3e6e8bbcd66c0079ef89f2ff3479743499c36ab32f8bc8281631a96113df9a87f6284058365950f4df3c75dacfcc11920fc5ea7ef0233ba842b77 SHA512 2543e519f51cc7ecb51a732c658ec5d35c5225e30a677f24ead75e81fb1ab793a030e79f21d0b702a2cf6ab6da1a2cba839b49a98e1b0a36384e98076ed5c4b1
-DIST llvm-12.0.1-manpages.tar.bz2 191582 BLAKE2B a049cd305c257875d47e92d703c51aee8225854f999eddbd530c7a978704a981b05bc0819ba31a2f2a218d3569b078f0deb01b0eeb385966253b54a0fdc090d1 SHA512 9931a57f843709aed59193524fe980af695e4e23c8f53ec3cff308677ba4fc520ca58032b50b68440c7762305855317d9a705fe5ccbb543fb104f4deb5d10ea5
-DIST llvm-13.0.0-manpages.tar.bz2 202595 BLAKE2B 1a3a389e8c544675f7ba2692f92bb82a83beabd6c595211806ef7f473e1741ea633a773edf623011d3d011ef2ee7a1611fc9620fe921eeebe1b99c3b8b3a0652 SHA512 344139f3123169776e0fd603e605bbf537d15d80ff56ad60e66ed1639a9dec53a8ac5cd088c8e14c8b7a799b563268445562293ba1d4efeb8db438cbd9cb5fb0
-DIST llvm-gentoo-patchset-11.1.0-1.tar.xz 4032 BLAKE2B e69138a422e315b31a3d9c11faa4ae1ddf1bf9092cee2db0de4d2adef81fd802973488293aab48b764402b51996893b17ca03249ef4620848a576d1f6cdb9698 SHA512 e1c5504dab6c5db9fdf4addfeb12316f22d0258717ba551a9b7b3ba37919491fb6011ac5cca1e793b7509d5c1c186bc6bc4213f7d6155d190612492b216f979b
-DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841ac5bcaeb927538cc7de27683167111a17d6496677c7517de2ecfaf14b5d8ac22bad357be490b8a2ed9aba502fd5f447ecc99e9 SHA512 fc7c38e671555751650299c3a8bee44d5c7f26e11b68d5538c507fb7fe9ff2d349bdcd43bce90a448a747f082d523b3849d6bcda5e3ae2e998edcb926d6aa249
-DIST llvm-gentoo-patchset-13.0.0.tar.xz 5012 BLAKE2B 6760c78c086aaf6629143fd920b0a2c68cad9278628fbea8164dfeb59db95984a5b5d6b3505b510c697e8c95bf8d2be782c6b73c01622d52f2da9b07ecff39e0 SHA512 7764d49343b795b6bebae64f646ba27e3e6cc2a20b8a1aee645ce0d8474633c34acfbb73c08546fee415755dd4ea5a98c1d84db5e394cf5f4fc802eb61148ab6
-DIST llvm-gentoo-patchset-13.0.1-rc1.tar.xz 5988 BLAKE2B 8f1d295d4b6937518d9e0cc00cc2ba9e12ff9773b35261f0985b2d2a4ed1e3363a7f961cb385728b5ae552d0e129d99d11e63958d32c3353b0a79a88ba5cc0d5 SHA512 8272c423a5e0e99d412bb449794ba2e8134aca69d09e90e93555dbd3b7549d6ce4d68617ca11074af0a35a6f6830bf0330cbc672c5a56054cfd824e3ac1900ea
-DIST llvm-gentoo-patchset-13.0.1-rc2.tar.xz 5192 BLAKE2B 4a129a3d0b7c1839d79c814ea57602f5e87aadb9050fc8e91868d2c3773ff7ae8e2137f785deeded6925a4368220767526c95790c9883f2031edc3ebae25b13c SHA512 2f384281d06f5378f7d1b2f036958c7db00d1c4d799406fd188fa8388f0cf18279dae36f2fb37bff26daa91419ab1bc1c2390be0f3af42359f1aef8de81b6ac8
-DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
-DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
-DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
-DIST llvmorg-13.0.0.tar.gz 147270176 BLAKE2B 628f316b580e1edf3a58d4825b724df759e6ed2a4116802470c04562caefc392fa325c91f388036365a2e45a9595cca6d3557fab12984fc8bcfef29c9116d822 SHA512 8004c05d32b9720fb3391783621690c1df9bd1e97e72cbff9192ed88a84b0acd303b61432145fa917b5b5e548c8cee29b24ef8547dcc8677adf4816e7a8a0eb2
-DIST llvmorg-13.0.1-rc1.tar.gz 147284646 BLAKE2B 3a1d8d382de633b7f8fc998f8ad1e03c24b733aefc591615cbd34115d1d6d74962ae33bbf2224527b521a76930ffee425527225563a558a04173e9aa9487c781 SHA512 d487bfc9b898ad0046e0c94338d7757d8a05a1a84d683abfbc9ed4994c6d12caf88fd18575225e284070fc67b3ac0970ca6639e61b1a7cc2948b216a5364a22d
-DIST llvmorg-13.0.1-rc2.tar.gz 147304491 BLAKE2B 86b2c64e57e4aaab837229b25a95d5517ac077d22cf552d71ff6b996dbdbcd171ad51de7eb12d098b50a139beda4ace843727181a1c6978fc487215391e64a3a SHA512 0d890f3317504c8cef10e118b245e5a4c815cc19f07cbc511a66bde6c9b1f3d15c167942608a8987befe9115b24657d29f72305f9f2794385a7434b80167f40f
+DIST llvm-15.0.7-manpages.tar.bz2 228425 BLAKE2B 573b030a32407cfe241fb2c8c62bed8e7c54f9daf4b8cffdd2d4e5ca2e40b5ec5ed3724475aedf77119be1a4d9de847a989e933d315e6d94908e407a19c98047 SHA512 86d5eeea2757b0a627c8d2d6e70a3265fc0207085f4e473cdd6e8b624c719625dead23fd1737742a1bea27b1c4631ef3e8e3041a1122a85fcb49859e5bfbee49
+DIST llvm-16.0.4-manpages.tar.bz2 243154 BLAKE2B 69308e3ec19d750e7249b7c8cd79224c466b879c67dd900e201339486fa7fa4dd6ef9ef5b033b2443b32c3530cc76564fe2856a76f9b466fdab2b5c64148f089 SHA512 2d2b711adbd20a233d0611f81393faa29a2f32f0e64799a9a48185876045023ca1320becd2da110fbcbfce019a38df0d7c13fcaea3770b4fc23aa732eb11321b
+DIST llvm-17.0.1-manpages.tar.bz2 263148 BLAKE2B 6485a261e356eacc4a274f9b8d329b53f11a37a23effea41a12322f6908bbe702dc1a97bfd10293061f01f1dbff8693e9324ab3dce2551e78eab128dbd7fea30 SHA512 963ff1b7aa0cb01ed0c0356a0adc3a315d94e78035e928dc81464f553e722633a17596e421c248968e87e22ae66f1ab9cccda5fd3388d1a6d34b5e9c6140ebcb
+DIST llvm-18.1.0-manpages.tar.bz2 270429 BLAKE2B d85d6e23197184dc512019c25805af0aa145eefb4c36215807c1ba70ad47943c05c06dbaafd84a7e6487bdd83814e03277374e095d97b129e3fc8d468c10741c SHA512 5f492c85fad4e04e0148ea509f4b6520de9e2765c51e617363a11aa8e47c2d847f6b0897958ca1d93bccf0f6a9150868b7e04c728bd430c05bf2da30bdeba6cc
+DIST llvm-gentoo-patchset-15.0.7-r3.tar.xz 24268 BLAKE2B 6531ae385ecea87bc26dba8ce19b4cde8ff224c80fd81f04c6ded131e305ecfdeb8d29ebd3b68a641d240805dc83eb0ebc7cc85124f02ad0ee66e0f201b91d7e SHA512 66cb33f8b423736b990fb75d4f2d1e5f14c0b03308f403297204dd1a352d72f85f34220fd66d3de5d6df328cdf2ffce03c2a111cb0bb57791cf68a88069ac7df
+DIST llvm-gentoo-patchset-16.0.6.tar.xz 17340 BLAKE2B 37cdf4b38367b4256d4f7a25d1b4f41758e5f81be8e20a1c94a10d6c5e36642e9672121b455e73a0bac2eb40467ef2db4b43789b2912a6790593d97b8b5c27e3 SHA512 2c02b9d8a4c5af9fddcd26c95dc66fffae32cb5b7f85c65a1aa4ed00dd8cd5b01cc1975a711aee63c0b8b11e9dc20f2bc05ea753904eb516892b820f02aff825
+DIST llvm-gentoo-patchset-17.0.6.tar.xz 1792 BLAKE2B 21b34b436333c0b37522d4340cccc84a572701f6e267cf7c6adfa9be419913f5a6c9ee40a6be5c62d12fbd868912801d30381573c4459c05676e05785cccaefe SHA512 2d90b5e7fcbb950249ef7133fac1ed3dcb758a4d92732119049526cea0b291bd4e9738c4c0d806d70e7d769e1906f8ef3930066c206c00b6ec7d3509ed0fed19
+DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948
+DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
+DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
+DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7
+DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
+DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
+DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
+DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
+DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
+DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
+DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
diff --git a/sys-devel/llvm/llvm-11.1.0.ebuild b/sys-devel/llvm/llvm-11.1.0.ebuild
deleted file mode 100644
index aa2dcac73291..000000000000
--- a/sys-devel/llvm/llvm-11.1.0.ebuild
+++ /dev/null
@@ -1,512 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
- toolchain-funcs
-
-DESCRIPTION="Low Level Virtual Machine"
-HOMEPAGE="https://llvm.org/"
-
-# Those are in lib/Targets, without explicit CMakeLists.txt mention
-ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC VE )
-# Keep in sync with CMakeLists.txt
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
- NVPTX PowerPC RISCV Sparc SystemZ WebAssembly 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. xxhash: BSD.
-# 3. MD5 code: public-domain.
-# 4. ConvertUTF.h: TODO.
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
-SLOT="$(ver_cut 1)"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE="debug doc exegesis +gold libedit +libffi ncurses test xar xml z3 ${ALL_LLVM_TARGETS[*]}"
-REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- sys-libs/zlib:0=[${MULTILIB_USEDEP}]
- exegesis? ( dev-libs/libpfm:= )
- gold? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] )
- libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
- libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
- ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
- xar? ( app-arch/xar )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
- gold? ( sys-libs/binutils-libs )"
-BDEPEND="
- dev-lang/perl
- >=dev-util/cmake-3.16
- sys-devel/gnuconfig
- kernel_Darwin? (
- <sys-libs/libcxx-$(ver_cut 1-3).9999
- >=sys-devel/binutils-apple-5.1
- )
- doc? ( $(python_gen_any_dep '
- dev-python/recommonmark[${PYTHON_USEDEP}]
- dev-python/sphinx[${PYTHON_USEDEP}]
- ') )
- libffi? ( virtual/pkgconfig )
- ${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-${SLOT} )"
-
-LLVM_COMPONENTS=( llvm )
-LLVM_MANPAGES=pregenerated
-LLVM_PATCHSET=11.1.0-1
-llvm.org_set_globals
-
-python_check_deps() {
- use doc || return 0
-
- has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
- has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
-}
-
-check_live_ebuild() {
- local prod_targets=(
- $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
- | tail -n +2 | head -n -1)
- )
- local all_targets=(
- lib/Target/*/
- )
- all_targets=( "${all_targets[@]#lib/Target/}" )
- all_targets=( "${all_targets[@]%/}" )
-
- local exp_targets=() i
- for i in "${all_targets[@]}"; do
- has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
- done
- # reorder
- all_targets=( "${prod_targets[@]}" "${exp_targets[@]}" )
-
- if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
- eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
- eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
- eqawarn "Expected: ${exp_targets[*]}"
- eqawarn
- fi
-
- if [[ ${all_targets[*]} != ${ALL_LLVM_TARGETS[*]#llvm_targets_} ]]; then
- eqawarn "ALL_LLVM_TARGETS is outdated!"
- eqawarn " Have: ${ALL_LLVM_TARGETS[*]#llvm_targets_}"
- eqawarn "Expected: ${all_targets[*]}"
- fi
-}
-
-check_distribution_components() {
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
- local all_targets=() my_targets=() l
- cd "${BUILD_DIR}" || die
-
- while read -r l; do
- if [[ ${l} == install-*-stripped:* ]]; then
- l=${l#install-}
- l=${l%%-stripped*}
-
- case ${l} in
- # shared libs
- LLVM|LLVMgold)
- ;;
- # TableGen lib + deps
- LLVMDemangle|LLVMSupport|LLVMTableGen)
- ;;
- # static libs
- LLVM*)
- continue
- ;;
- # meta-targets
- distribution|llvm-libraries)
- continue
- ;;
- # used only w/ USE=doc
- docs-llvm-html)
- use doc || continue
- ;;
- esac
-
- all_targets+=( "${l}" )
- fi
- done < <(ninja -t targets all)
-
- while read -r l; do
- my_targets+=( "${l}" )
- done < <(get_distribution_components $"\n")
-
- local add=() remove=()
- for l in "${all_targets[@]}"; do
- if ! has "${l}" "${my_targets[@]}"; then
- add+=( "${l}" )
- fi
- done
- for l in "${my_targets[@]}"; do
- if ! has "${l}" "${all_targets[@]}"; then
- remove+=( "${l}" )
- fi
- done
-
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
- eqawarn "get_distribution_components() is outdated!"
- eqawarn " Add: ${add[*]}"
- eqawarn "Remove: ${remove[*]}"
- fi
- cd - >/dev/null || die
- fi
-}
-
-src_prepare() {
- # disable use of SDK on OSX, bug #568758
- sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
-
- # Update config.guess to support more systems
- cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
-
- # Verify that the live ebuild is up-to-date
- check_live_ebuild
-
- llvm.org_src_prepare
-}
-
-# Is LLVM being linked against libc++?
-is_libcxx_linked() {
- local code='#include <ciso646>
-#if defined(_LIBCPP_VERSION)
- HAVE_LIBCXX
-#endif
-'
- local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
-
- [[ ${out} == *HAVE_LIBCXX* ]]
-}
-
-get_distribution_components() {
- local sep=${1-;}
-
- local out=(
- # shared libs
- LLVM
- LTO
- Remarks
-
- # tools
- llvm-config
-
- # common stuff
- cmake-exports
- llvm-headers
-
- # libraries needed for clang-tblgen
- LLVMDemangle
- LLVMSupport
- LLVMTableGen
- )
-
- if multilib_is_native_abi; then
- out+=(
- # utilities
- llvm-tblgen
- FileCheck
- llvm-PerfectShuffle
- count
- not
- yaml-bench
-
- # tools
- bugpoint
- dsymutil
- llc
- lli
- lli-child-target
- llvm-addr2line
- llvm-ar
- llvm-as
- llvm-bcanalyzer
- llvm-c-test
- llvm-cat
- llvm-cfi-verify
- llvm-config
- llvm-cov
- llvm-cvtres
- llvm-cxxdump
- llvm-cxxfilt
- llvm-cxxmap
- llvm-diff
- llvm-dis
- llvm-dlltool
- llvm-dwarfdump
- llvm-dwp
- llvm-elfabi
- llvm-exegesis
- llvm-extract
- llvm-gsymutil
- llvm-ifs
- llvm-install-name-tool
- llvm-jitlink
- llvm-lib
- llvm-link
- llvm-lipo
- llvm-lto
- llvm-lto2
- llvm-mc
- llvm-mca
- llvm-ml
- llvm-modextract
- llvm-mt
- llvm-nm
- llvm-objcopy
- llvm-objdump
- llvm-opt-report
- llvm-pdbutil
- llvm-profdata
- llvm-ranlib
- llvm-rc
- llvm-readelf
- llvm-readobj
- llvm-reduce
- llvm-rtdyld
- llvm-size
- llvm-split
- llvm-stress
- llvm-strings
- llvm-strip
- llvm-symbolizer
- llvm-undname
- llvm-xray
- obj2yaml
- opt
- sancov
- sanstats
- verify-uselistorder
- yaml2obj
-
- # python modules
- opt-viewer
- )
-
- if llvm_are_manpages_built; then
- out+=(
- # manpages
- docs-dsymutil-man
- docs-llvm-dwarfdump-man
- docs-llvm-man
- )
- fi
- use doc && out+=(
- docs-llvm-html
- )
-
- use gold && out+=(
- LLVMgold
- )
- fi
-
- printf "%s${sep}" "${out[@]}"
-}
-
-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=OFF
- -DLLVM_BUILD_LLVM_DYLIB=ON
- -DLLVM_LINK_LLVM_DYLIB=ON
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
-
- # 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_LIBXML2=$(usex xml)
- -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
- -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
- -DLLVM_ENABLE_EH=ON
- -DLLVM_ENABLE_RTTI=ON
- -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
-
- -DLLVM_HOST_TRIPLE="${CHOST}"
-
- -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
- -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
- # used only for llvm-objdump tool
- -DHAVE_LIBXAR=$(multilib_native_usex xar 1 0)
-
- -DPython3_EXECUTABLE="${PYTHON}"
-
- # disable OCaml bindings (now in dev-ml/llvm-ocaml)
- -DOCAMLFIND=NO
- )
-
- if is_libcxx_linked; then
- # Smart hack: alter version suffix -> SOVERSION when linking
- # against libc++. This way we won't end up mixing LLVM libc++
- # libraries with libstdc++ clang, and the other way around.
- mycmakeargs+=(
- -DLLVM_VERSION_SUFFIX="libcxx"
- -DLLVM_ENABLE_LIBCXX=ON
- )
- 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
-
- use test && mycmakeargs+=(
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- )
-
- if multilib_is_native_abi; then
- local build_docs=OFF
- if llvm_are_manpages_built; then
- build_docs=ON
- mycmakeargs+=(
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
- -DSPHINX_WARNINGS_AS_ERRORS=OFF
- )
- fi
-
- mycmakeargs+=(
- -DLLVM_BUILD_DOCS=${build_docs}
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=${build_docs}
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- )
- 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
-
- # workaround BMI bug in gcc-7 (fixed in 7.4)
- # https://bugs.gentoo.org/649880
- # apply only to x86, https://bugs.gentoo.org/650506
- if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
- [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
- then
- local CFLAGS="${CFLAGS} -mno-bmi"
- local CXXFLAGS="${CXXFLAGS} -mno-bmi"
- fi
-
- # LLVM can have very high memory consumption while linking,
- # exhausting the limit on 32-bit linker executable
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake_src_configure
-
- multilib_is_native_abi && check_distribution_components
-}
-
-multilib_src_compile() {
- cmake_build distribution
-
- 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_build 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() {
- DESTDIR=${D} cmake_build install-distribution
-
- # 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} ))
- newenvd - "60llvm-${revord}" <<-_EOF_
- 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_
-
- docompress "/usr/lib/llvm/${SLOT}/share/man"
- llvm_install_manpages
-}
-
-pkg_postinst() {
- elog "You can find additional opt-viewer utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer"
- elog "To use these scripts, you will need Python along with the following"
- elog "packages:"
- elog " dev-python/pygments (for opt-viewer)"
- elog " dev-python/pyyaml (for all of them)"
-}
diff --git a/sys-devel/llvm/llvm-12.0.1.ebuild b/sys-devel/llvm/llvm-12.0.1.ebuild
deleted file mode 100644
index 673ce8591884..000000000000
--- a/sys-devel/llvm/llvm-12.0.1.ebuild
+++ /dev/null
@@ -1,517 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
- toolchain-funcs
-
-DESCRIPTION="Low Level Virtual Machine"
-HOMEPAGE="https://llvm.org/"
-
-# Those are in lib/Targets, without explicit CMakeLists.txt mention
-ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY VE )
-# Keep in sync with CMakeLists.txt
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
- NVPTX PowerPC RISCV Sparc SystemZ WebAssembly 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. xxhash: BSD.
-# 3. MD5 code: public-domain.
-# 4. ConvertUTF.h: TODO.
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
-SLOT="$(ver_cut 1)"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE="debug doc exegesis +gold libedit +libffi ncurses test xar xml z3 ${ALL_LLVM_TARGETS[*]}"
-REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- sys-libs/zlib:0=[${MULTILIB_USEDEP}]
- exegesis? ( dev-libs/libpfm:= )
- gold? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] )
- libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
- libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
- ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
- xar? ( app-arch/xar )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
- gold? ( sys-libs/binutils-libs )"
-BDEPEND="
- dev-lang/perl
- >=dev-util/cmake-3.16
- sys-devel/gnuconfig
- kernel_Darwin? (
- <sys-libs/libcxx-$(ver_cut 1-3).9999
- >=sys-devel/binutils-apple-5.1
- )
- doc? ( $(python_gen_any_dep '
- dev-python/recommonmark[${PYTHON_USEDEP}]
- dev-python/sphinx[${PYTHON_USEDEP}]
- ') )
- libffi? ( virtual/pkgconfig )
- ${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-${SLOT} )"
-
-LLVM_COMPONENTS=( llvm )
-LLVM_MANPAGES=pregenerated
-LLVM_PATCHSET=12.0.1
-llvm.org_set_globals
-
-python_check_deps() {
- use doc || return 0
-
- has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
- has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
-}
-
-check_live_ebuild() {
- local prod_targets=(
- $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
- | tail -n +2 | head -n -1)
- )
- local all_targets=(
- lib/Target/*/
- )
- all_targets=( "${all_targets[@]#lib/Target/}" )
- all_targets=( "${all_targets[@]%/}" )
-
- local exp_targets=() i
- for i in "${all_targets[@]}"; do
- has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
- done
- # reorder
- all_targets=( "${prod_targets[@]}" "${exp_targets[@]}" )
-
- if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
- eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
- eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
- eqawarn "Expected: ${exp_targets[*]}"
- eqawarn
- fi
-
- if [[ ${all_targets[*]} != ${ALL_LLVM_TARGETS[*]#llvm_targets_} ]]; then
- eqawarn "ALL_LLVM_TARGETS is outdated!"
- eqawarn " Have: ${ALL_LLVM_TARGETS[*]#llvm_targets_}"
- eqawarn "Expected: ${all_targets[*]}"
- fi
-}
-
-check_distribution_components() {
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
- local all_targets=() my_targets=() l
- cd "${BUILD_DIR}" || die
-
- while read -r l; do
- if [[ ${l} == install-*-stripped:* ]]; then
- l=${l#install-}
- l=${l%%-stripped*}
-
- case ${l} in
- # shared libs
- LLVM|LLVMgold)
- ;;
- # TableGen lib + deps
- LLVMDemangle|LLVMSupport|LLVMTableGen)
- ;;
- # static libs
- LLVM*)
- continue
- ;;
- # meta-targets
- distribution|llvm-libraries)
- continue
- ;;
- # used only w/ USE=doc
- docs-llvm-html)
- use doc || continue
- ;;
- esac
-
- all_targets+=( "${l}" )
- fi
- done < <(ninja -t targets all)
-
- while read -r l; do
- my_targets+=( "${l}" )
- done < <(get_distribution_components $"\n")
-
- local add=() remove=()
- for l in "${all_targets[@]}"; do
- if ! has "${l}" "${my_targets[@]}"; then
- add+=( "${l}" )
- fi
- done
- for l in "${my_targets[@]}"; do
- if ! has "${l}" "${all_targets[@]}"; then
- remove+=( "${l}" )
- fi
- done
-
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
- eqawarn "get_distribution_components() is outdated!"
- eqawarn " Add: ${add[*]}"
- eqawarn "Remove: ${remove[*]}"
- fi
- cd - >/dev/null || die
- fi
-}
-
-src_prepare() {
- # disable use of SDK on OSX, bug #568758
- sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
-
- # Update config.guess to support more systems
- cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
-
- # Verify that the live ebuild is up-to-date
- check_live_ebuild
-
- llvm.org_src_prepare
-}
-
-# Is LLVM being linked against libc++?
-is_libcxx_linked() {
- local code='#include <ciso646>
-#if defined(_LIBCPP_VERSION)
- HAVE_LIBCXX
-#endif
-'
- local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
-
- [[ ${out} == *HAVE_LIBCXX* ]]
-}
-
-get_distribution_components() {
- local sep=${1-;}
-
- local out=(
- # shared libs
- LLVM
- LTO
- Remarks
-
- # tools
- llvm-config
-
- # common stuff
- cmake-exports
- llvm-headers
-
- # libraries needed for clang-tblgen
- LLVMDemangle
- LLVMSupport
- LLVMTableGen
- )
-
- if multilib_is_native_abi; then
- out+=(
- # utilities
- llvm-tblgen
- FileCheck
- llvm-PerfectShuffle
- count
- not
- yaml-bench
-
- # tools
- bugpoint
- dsymutil
- llc
- lli
- lli-child-target
- llvm-addr2line
- llvm-ar
- llvm-as
- llvm-bcanalyzer
- llvm-bitcode-strip
- llvm-c-test
- llvm-cat
- llvm-cfi-verify
- llvm-config
- llvm-cov
- llvm-cvtres
- llvm-cxxdump
- llvm-cxxfilt
- llvm-cxxmap
- llvm-diff
- llvm-dis
- llvm-dlltool
- llvm-dwarfdump
- llvm-dwp
- llvm-elfabi
- llvm-exegesis
- llvm-extract
- llvm-gsymutil
- llvm-ifs
- llvm-install-name-tool
- llvm-jitlink
- llvm-jitlink-executor
- llvm-lib
- llvm-libtool-darwin
- llvm-link
- llvm-lipo
- llvm-lto
- llvm-lto2
- llvm-mc
- llvm-mca
- llvm-ml
- llvm-modextract
- llvm-mt
- llvm-nm
- llvm-objcopy
- llvm-objdump
- llvm-opt-report
- llvm-pdbutil
- llvm-profdata
- llvm-profgen
- llvm-ranlib
- llvm-rc
- llvm-readelf
- llvm-readobj
- llvm-reduce
- llvm-rtdyld
- llvm-size
- llvm-split
- llvm-stress
- llvm-strings
- llvm-strip
- llvm-symbolizer
- llvm-undname
- llvm-xray
- obj2yaml
- opt
- sancov
- sanstats
- split-file
- verify-uselistorder
- yaml2obj
-
- # python modules
- opt-viewer
- )
-
- if llvm_are_manpages_built; then
- out+=(
- # manpages
- docs-dsymutil-man
- docs-llvm-dwarfdump-man
- docs-llvm-man
- )
- fi
- use doc && out+=(
- docs-llvm-html
- )
-
- use gold && out+=(
- LLVMgold
- )
- fi
-
- printf "%s${sep}" "${out[@]}"
-}
-
-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=OFF
- -DLLVM_BUILD_LLVM_DYLIB=ON
- -DLLVM_LINK_LLVM_DYLIB=ON
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
-
- # 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_LIBXML2=$(usex xml)
- -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
- -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
- -DLLVM_ENABLE_EH=ON
- -DLLVM_ENABLE_RTTI=ON
- -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
-
- -DLLVM_HOST_TRIPLE="${CHOST}"
-
- -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
- -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
- # used only for llvm-objdump tool
- -DHAVE_LIBXAR=$(multilib_native_usex xar 1 0)
-
- -DPython3_EXECUTABLE="${PYTHON}"
-
- # disable OCaml bindings (now in dev-ml/llvm-ocaml)
- -DOCAMLFIND=NO
- )
-
- if is_libcxx_linked; then
- # Smart hack: alter version suffix -> SOVERSION when linking
- # against libc++. This way we won't end up mixing LLVM libc++
- # libraries with libstdc++ clang, and the other way around.
- mycmakeargs+=(
- -DLLVM_VERSION_SUFFIX="libcxx"
- -DLLVM_ENABLE_LIBCXX=ON
- )
- 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
-
- use test && mycmakeargs+=(
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- )
-
- if multilib_is_native_abi; then
- local build_docs=OFF
- if llvm_are_manpages_built; then
- build_docs=ON
- mycmakeargs+=(
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
- -DSPHINX_WARNINGS_AS_ERRORS=OFF
- )
- fi
-
- mycmakeargs+=(
- -DLLVM_BUILD_DOCS=${build_docs}
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=${build_docs}
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- )
- 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
-
- # workaround BMI bug in gcc-7 (fixed in 7.4)
- # https://bugs.gentoo.org/649880
- # apply only to x86, https://bugs.gentoo.org/650506
- if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
- [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
- then
- local CFLAGS="${CFLAGS} -mno-bmi"
- local CXXFLAGS="${CXXFLAGS} -mno-bmi"
- fi
-
- # LLVM can have very high memory consumption while linking,
- # exhausting the limit on 32-bit linker executable
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake_src_configure
-
- multilib_is_native_abi && check_distribution_components
-}
-
-multilib_src_compile() {
- cmake_build distribution
-
- 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_build 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() {
- DESTDIR=${D} cmake_build install-distribution
-
- # 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} ))
- newenvd - "60llvm-${revord}" <<-_EOF_
- 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_
-
- docompress "/usr/lib/llvm/${SLOT}/share/man"
- llvm_install_manpages
-}
-
-pkg_postinst() {
- elog "You can find additional opt-viewer utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer"
- elog "To use these scripts, you will need Python along with the following"
- elog "packages:"
- elog " dev-python/pygments (for opt-viewer)"
- elog " dev-python/pyyaml (for all of them)"
-}
diff --git a/sys-devel/llvm/llvm-13.0.0.ebuild b/sys-devel/llvm/llvm-13.0.0.ebuild
deleted file mode 100644
index 9f6396c849a1..000000000000
--- a/sys-devel/llvm/llvm-13.0.0.ebuild
+++ /dev/null
@@ -1,510 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
- toolchain-funcs
-
-DESCRIPTION="Low Level Virtual Machine"
-HOMEPAGE="https://llvm.org/"
-
-# Additional licenses:
-# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
-# 2. xxhash: BSD.
-# 3. MD5 code: public-domain.
-# 4. ConvertUTF.h: TODO.
-
-LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
-SLOT="$(ver_cut 1)"
-KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE="debug doc exegesis +gold libedit +libffi ncurses test xar xml z3"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- sys-libs/zlib:0=[${MULTILIB_USEDEP}]
- exegesis? ( dev-libs/libpfm:= )
- gold? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] )
- libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
- libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
- ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
- xar? ( app-arch/xar )
- xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
- gold? ( sys-libs/binutils-libs )"
-BDEPEND="
- dev-lang/perl
- >=dev-util/cmake-3.16
- sys-devel/gnuconfig
- kernel_Darwin? (
- <sys-libs/libcxx-$(ver_cut 1-3).9999
- >=sys-devel/binutils-apple-5.1
- )
- doc? ( $(python_gen_any_dep '
- dev-python/recommonmark[${PYTHON_USEDEP}]
- dev-python/sphinx[${PYTHON_USEDEP}]
- ') )
- libffi? ( virtual/pkgconfig )
- ${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-${SLOT} )"
-
-LLVM_COMPONENTS=( llvm )
-LLVM_MANPAGES=pregenerated
-LLVM_PATCHSET=${PV/_/-}
-LLVM_USE_TARGETS=provide
-llvm.org_set_globals
-
-python_check_deps() {
- use doc || return 0
-
- has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
- has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
-}
-
-check_live_ebuild() {
- local prod_targets=(
- $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
- | tail -n +2 | head -n -1)
- )
- local all_targets=(
- lib/Target/*/
- )
- all_targets=( "${all_targets[@]#lib/Target/}" )
- all_targets=( "${all_targets[@]%/}" )
-
- local exp_targets=() i
- for i in "${all_targets[@]}"; do
- has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
- done
-
- if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
- eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
- eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
- eqawarn "Expected: ${exp_targets[*]}"
- eqawarn
- fi
-
- if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
- eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
- eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
- eqawarn "Expected: ${prod_targets[*]}"
- fi
-}
-
-check_distribution_components() {
- if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
- local all_targets=() my_targets=() l
- cd "${BUILD_DIR}" || die
-
- while read -r l; do
- if [[ ${l} == install-*-stripped:* ]]; then
- l=${l#install-}
- l=${l%%-stripped*}
-
- case ${l} in
- # shared libs
- LLVM|LLVMgold)
- ;;
- # TableGen lib + deps
- LLVMDemangle|LLVMSupport|LLVMTableGen)
- ;;
- # static libs
- LLVM*)
- continue
- ;;
- # meta-targets
- distribution|llvm-libraries)
- continue
- ;;
- # used only w/ USE=doc
- docs-llvm-html)
- use doc || continue
- ;;
- esac
-
- all_targets+=( "${l}" )
- fi
- done < <(ninja -t targets all)
-
- while read -r l; do
- my_targets+=( "${l}" )
- done < <(get_distribution_components $"\n")
-
- local add=() remove=()
- for l in "${all_targets[@]}"; do
- if ! has "${l}" "${my_targets[@]}"; then
- add+=( "${l}" )
- fi
- done
- for l in "${my_targets[@]}"; do
- if ! has "${l}" "${all_targets[@]}"; then
- remove+=( "${l}" )
- fi
- done
-
- if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
- eqawarn "get_distribution_components() is outdated!"
- eqawarn " Add: ${add[*]}"
- eqawarn "Remove: ${remove[*]}"
- fi
- cd - >/dev/null || die
- fi
-}
-
-src_prepare() {
- # disable use of SDK on OSX, bug #568758
- sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
-
- # Update config.guess to support more systems
- cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
-
- # Verify that the live ebuild is up-to-date
- check_live_ebuild
-
- llvm.org_src_prepare
-}
-
-# Is LLVM being linked against libc++?
-is_libcxx_linked() {
- local code='#include <ciso646>
-#if defined(_LIBCPP_VERSION)
- HAVE_LIBCXX
-#endif
-'
- local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
-
- [[ ${out} == *HAVE_LIBCXX* ]]
-}
-
-get_distribution_components() {
- local sep=${1-;}
-
- local out=(
- # shared libs
- LLVM
- LTO
- Remarks
-
- # tools
- llvm-config
-
- # common stuff
- cmake-exports
- llvm-headers
-
- # libraries needed for clang-tblgen
- LLVMDemangle
- LLVMSupport
- LLVMTableGen
- )
-
- if multilib_is_native_abi; then
- out+=(
- # utilities
- llvm-tblgen
- FileCheck
- llvm-PerfectShuffle
- count
- not
- yaml-bench
-
- # tools
- bugpoint
- dsymutil
- llc
- lli
- lli-child-target
- llvm-addr2line
- llvm-ar
- llvm-as
- llvm-bcanalyzer
- llvm-bitcode-strip
- llvm-c-test
- llvm-cat
- llvm-cfi-verify
- llvm-config
- llvm-cov
- llvm-cvtres
- llvm-cxxdump
- llvm-cxxfilt
- llvm-cxxmap
- llvm-diff
- llvm-dis
- llvm-dlltool
- llvm-dwarfdump
- llvm-dwp
- llvm-exegesis
- llvm-extract
- llvm-gsymutil
- llvm-ifs
- llvm-install-name-tool
- llvm-jitlink
- llvm-jitlink-executor
- llvm-lib
- llvm-libtool-darwin
- llvm-link
- llvm-lipo
- llvm-lto
- llvm-lto2
- llvm-mc
- llvm-mca
- llvm-ml
- llvm-modextract
- llvm-mt
- llvm-nm
- llvm-objcopy
- llvm-objdump
- llvm-opt-report
- llvm-otool
- llvm-pdbutil
- llvm-profdata
- llvm-profgen
- llvm-ranlib
- llvm-rc
- llvm-readelf
- llvm-readobj
- llvm-reduce
- llvm-rtdyld
- llvm-sim
- llvm-size
- llvm-split
- llvm-stress
- llvm-strings
- llvm-strip
- llvm-symbolizer
- llvm-tapi-diff
- llvm-undname
- llvm-windres
- llvm-xray
- obj2yaml
- opt
- sancov
- sanstats
- split-file
- verify-uselistorder
- yaml2obj
-
- # python modules
- opt-viewer
- )
-
- if llvm_are_manpages_built; then
- out+=(
- # manpages
- docs-dsymutil-man
- docs-llvm-dwarfdump-man
- docs-llvm-man
- )
- fi
- use doc && out+=(
- docs-llvm-html
- )
-
- use gold && out+=(
- LLVMgold
- )
- fi
-
- printf "%s${sep}" "${out[@]}"
-}
-
-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=OFF
- -DLLVM_BUILD_LLVM_DYLIB=ON
- -DLLVM_LINK_LLVM_DYLIB=ON
- -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
-
- # 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_LIBXML2=$(usex xml)
- -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
- -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
- -DLLVM_ENABLE_EH=ON
- -DLLVM_ENABLE_RTTI=ON
- -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
-
- -DLLVM_HOST_TRIPLE="${CHOST}"
-
- -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
- -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
- # used only for llvm-objdump tool
- -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0)
-
- -DPython3_EXECUTABLE="${PYTHON}"
-
- # disable OCaml bindings (now in dev-ml/llvm-ocaml)
- -DOCAMLFIND=NO
- )
-
- if is_libcxx_linked; then
- # Smart hack: alter version suffix -> SOVERSION when linking
- # against libc++. This way we won't end up mixing LLVM libc++
- # libraries with libstdc++ clang, and the other way around.
- mycmakeargs+=(
- -DLLVM_VERSION_SUFFIX="libcxx"
- -DLLVM_ENABLE_LIBCXX=ON
- )
- 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
-
- use test && mycmakeargs+=(
- -DLLVM_LIT_ARGS="$(get_lit_flags)"
- )
-
- if multilib_is_native_abi; then
- local build_docs=OFF
- if llvm_are_manpages_built; then
- build_docs=ON
- mycmakeargs+=(
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
- -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
- -DSPHINX_WARNINGS_AS_ERRORS=OFF
- )
- fi
-
- mycmakeargs+=(
- -DLLVM_BUILD_DOCS=${build_docs}
- -DLLVM_ENABLE_OCAMLDOC=OFF
- -DLLVM_ENABLE_SPHINX=${build_docs}
- -DLLVM_ENABLE_DOXYGEN=OFF
- -DLLVM_INSTALL_UTILS=ON
- )
- 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
-
- # workaround BMI bug in gcc-7 (fixed in 7.4)
- # https://bugs.gentoo.org/649880
- # apply only to x86, https://bugs.gentoo.org/650506
- if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
- [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
- then
- local CFLAGS="${CFLAGS} -mno-bmi"
- local CXXFLAGS="${CXXFLAGS} -mno-bmi"
- fi
-
- # LLVM can have very high memory consumption while linking,
- # exhausting the limit on 32-bit linker executable
- use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
-
- # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
- use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
- cmake_src_configure
-
- multilib_is_native_abi && check_distribution_components
-}
-
-multilib_src_compile() {
- cmake_build distribution
-
- 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_build 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() {
- DESTDIR=${D} cmake_build install-distribution
-
- # 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} ))
- newenvd - "60llvm-${revord}" <<-_EOF_
- 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_
-
- docompress "/usr/lib/llvm/${SLOT}/share/man"
- llvm_install_manpages
-}
-
-pkg_postinst() {
- elog "You can find additional opt-viewer utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer"
- elog "To use these scripts, you will need Python along with the following"
- elog "packages:"
- elog " dev-python/pygments (for opt-viewer)"
- elog " dev-python/pyyaml (for all of them)"
-}
diff --git a/sys-devel/llvm/llvm-13.0.1_rc1.ebuild b/sys-devel/llvm/llvm-15.0.7-r3.ebuild
index f5d3be283708..6306ee2107c0 100644
--- a/sys-devel/llvm/llvm-13.0.1_rc1.ebuild
+++ b/sys-devel/llvm/llvm-15.0.7-r3.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
+PYTHON_COMPAT=( python3_{10..11} )
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1 \
toolchain-funcs
DESCRIPTION="Low Level Virtual Machine"
@@ -17,29 +17,35 @@ HOMEPAGE="https://llvm.org/"
# 4. ConvertUTF.h: TODO.
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
-SLOT="$(ver_cut 1)"
-KEYWORDS=""
-IUSE="+binutils-plugin debug doc exegesis libedit +libffi ncurses test xar xml z3"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="amd64 arm arm64 ppc ppc64 ~riscv sparc x86 ~amd64-linux ~ppc-macos ~x64-macos"
+IUSE="
+ +binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
+ xml z3 zstd
+"
RESTRICT="!test? ( test )"
RDEPEND="
sys-libs/zlib:0=[${MULTILIB_USEDEP}]
- binutils-plugin? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] )
exegesis? ( dev-libs/libpfm:= )
libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
xar? ( app-arch/xar )
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
- binutils-plugin? ( sys-libs/binutils-libs )"
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
BDEPEND="
+ ${PYTHON_DEPS}
dev-lang/perl
- >=dev-util/cmake-3.16
sys-devel/gnuconfig
kernel_Darwin? (
- <sys-libs/libcxx-$(ver_cut 1-3).9999
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
>=sys-devel/binutils-apple-5.1
)
doc? ( $(python_gen_any_dep '
@@ -47,28 +53,33 @@ BDEPEND="
dev-python/sphinx[${PYTHON_USEDEP}]
') )
libffi? ( virtual/pkgconfig )
- ${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
- binutils-plugin? ( >=sys-devel/llvmgold-${SLOT} )"
-
-LLVM_COMPONENTS=( llvm )
-LLVM_MANPAGES=build
-LLVM_PATCHSET=${PV/_/-}
+RDEPEND="
+ ${RDEPEND}
+ !sys-devel/llvm:0
+"
+PDEPEND="
+ sys-devel/llvm-common
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_MANPAGES=1
+LLVM_PATCHSET=${PV/_/-}-r3
LLVM_USE_TARGETS=provide
llvm.org_set_globals
python_check_deps() {
use doc || return 0
- has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
- has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+ python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
}
-check_live_ebuild() {
+check_uptodate() {
local prod_targets=(
$(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
| tail -n +2 | head -n -1)
@@ -131,7 +142,7 @@ check_distribution_components() {
all_targets+=( "${l}" )
fi
- done < <(ninja -t targets all)
+ done < <(${NINJA} -t targets all)
while read -r l; do
my_targets+=( "${l}" )
@@ -165,24 +176,12 @@ src_prepare() {
# Update config.guess to support more systems
cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
- # Verify that the live ebuild is up-to-date
- check_live_ebuild
+ # Verify that the ebuild is up-to-date
+ check_uptodate
llvm.org_src_prepare
}
-# Is LLVM being linked against libc++?
-is_libcxx_linked() {
- local code='#include <ciso646>
-#if defined(_LIBCPP_VERSION)
- HAVE_LIBCXX
-#endif
-'
- local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
-
- [[ ${out} == *HAVE_LIBCXX* ]]
-}
-
get_distribution_components() {
local sep=${1-;}
@@ -214,6 +213,7 @@ get_distribution_components() {
count
not
yaml-bench
+ UnicodeNameMappingGenerator
# tools
bugpoint
@@ -235,10 +235,13 @@ get_distribution_components() {
llvm-cxxdump
llvm-cxxfilt
llvm-cxxmap
+ llvm-debuginfod
+ llvm-debuginfod-find
llvm-diff
llvm-dis
llvm-dlltool
llvm-dwarfdump
+ llvm-dwarfutil
llvm-dwp
llvm-exegesis
llvm-extract
@@ -271,6 +274,7 @@ get_distribution_components() {
llvm-readelf
llvm-readobj
llvm-reduce
+ llvm-remark-size-diff
llvm-rtdyld
llvm-sim
llvm-size
@@ -280,6 +284,7 @@ get_distribution_components() {
llvm-strip
llvm-symbolizer
llvm-tapi-diff
+ llvm-tli-checker
llvm-undname
llvm-windres
llvm-xray
@@ -316,6 +321,16 @@ get_distribution_components() {
}
multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
local ffi_cflags ffi_ldflags
if use libffi; then
ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
@@ -327,7 +342,7 @@ multilib_src_configure() {
# 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}"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-DBUILD_SHARED_LIBS=OFF
@@ -350,6 +365,8 @@ multilib_src_configure() {
-DLLVM_ENABLE_EH=ON
-DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
-DLLVM_HOST_TRIPLE="${CHOST}"
@@ -364,7 +381,7 @@ multilib_src_configure() {
-DOCAMLFIND=NO
)
- if is_libcxx_linked; then
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
# Smart hack: alter version suffix -> SOVERSION when linking
# against libc++. This way we won't end up mixing LLVM libc++
# libraries with libstdc++ clang, and the other way around.
@@ -391,7 +408,7 @@ multilib_src_configure() {
if llvm_are_manpages_built; then
build_docs=ON
mycmakeargs+=(
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
-DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
-DSPHINX_WARNINGS_AS_ERRORS=OFF
)
@@ -410,7 +427,7 @@ multilib_src_configure() {
fi
if tc-is-cross-compiler; then
- local tblgen="${EPREFIX}/usr/lib/llvm/${SLOT}/bin/llvm-tblgen"
+ local tblgen="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
[[ -x "${tblgen}" ]] \
|| die "${tblgen} not found or usable"
mycmakeargs+=(
@@ -419,16 +436,6 @@ multilib_src_configure() {
)
fi
- # workaround BMI bug in gcc-7 (fixed in 7.4)
- # https://bugs.gentoo.org/649880
- # apply only to x86, https://bugs.gentoo.org/650506
- if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
- [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
- then
- local CFLAGS="${CFLAGS} -mno-bmi"
- local CXXFLAGS="${CXXFLAGS} -mno-bmi"
- fi
-
# LLVM can have very high memory consumption while linking,
# exhausting the limit on 32-bit linker executable
use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
@@ -437,11 +444,14 @@ multilib_src_configure() {
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
cmake_src_configure
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MASTER_MAJOR?"
multilib_is_native_abi && check_distribution_components
}
multilib_src_compile() {
- cmake_build distribution
+ tc-env_build cmake_build distribution
pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
pax-mark m "${BUILD_DIR}"/bin/lli
@@ -462,7 +472,7 @@ multilib_src_test() {
src_install() {
local MULTILIB_CHOST_TOOLS=(
- /usr/lib/llvm/${SLOT}/bin/llvm-config
+ /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
)
local MULTILIB_WRAPPED_HEADERS=(
@@ -473,7 +483,7 @@ src_install() {
multilib-minimal_src_install
# move wrapped headers back
- mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${SLOT}/include || die
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
}
multilib_src_install() {
@@ -481,28 +491,28 @@ multilib_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
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
- LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
}
multilib_src_install_all() {
- local revord=$(( 9999 - ${SLOT} ))
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
newenvd - "60llvm-${revord}" <<-_EOF_
- PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/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"
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
_EOF_
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
}
pkg_postinst() {
elog "You can find additional opt-viewer utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
elog "To use these scripts, you will need Python along with the following"
elog "packages:"
elog " dev-python/pygments (for opt-viewer)"
diff --git a/sys-devel/llvm/llvm-13.0.1.9999.ebuild b/sys-devel/llvm/llvm-16.0.6.ebuild
index 789047901490..aa171c1cd361 100644
--- a/sys-devel/llvm/llvm-13.0.1.9999.ebuild
+++ b/sys-devel/llvm/llvm-16.0.6.ebuild
@@ -1,11 +1,12 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
- toolchain-funcs
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit toolchain-funcs
DESCRIPTION="Low Level Virtual Machine"
HOMEPAGE="https://llvm.org/"
@@ -17,58 +18,69 @@ HOMEPAGE="https://llvm.org/"
# 4. ConvertUTF.h: TODO.
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
-SLOT="$(ver_cut 1)"
-KEYWORDS=""
-IUSE="+binutils-plugin debug doc exegesis libedit +libffi ncurses test xar xml z3"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ +binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
+ xml z3 zstd
+"
RESTRICT="!test? ( test )"
RDEPEND="
sys-libs/zlib:0=[${MULTILIB_USEDEP}]
- binutils-plugin? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] )
exegesis? ( dev-libs/libpfm:= )
libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
xar? ( app-arch/xar )
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
- binutils-plugin? ( sys-libs/binutils-libs )"
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
BDEPEND="
+ ${PYTHON_DEPS}
dev-lang/perl
- >=dev-util/cmake-3.16
sys-devel/gnuconfig
kernel_Darwin? (
- <sys-libs/libcxx-$(ver_cut 1-3).9999
- >=sys-devel/binutils-apple-5.1
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
)
doc? ( $(python_gen_any_dep '
dev-python/recommonmark[${PYTHON_USEDEP}]
dev-python/sphinx[${PYTHON_USEDEP}]
') )
libffi? ( virtual/pkgconfig )
- ${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
- binutils-plugin? ( >=sys-devel/llvmgold-${SLOT} )"
-
-LLVM_COMPONENTS=( llvm )
-LLVM_MANPAGES=build
-LLVM_PATCHSET=9999-1
+RDEPEND="
+ ${RDEPEND}
+ !sys-devel/llvm:0
+"
+PDEPEND="
+ sys-devel/llvm-common
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake )
+LLVM_TEST_COMPONENTS=( third-party )
+LLVM_MANPAGES=1
+LLVM_PATCHSET=${PV}
LLVM_USE_TARGETS=provide
llvm.org_set_globals
python_check_deps() {
use doc || return 0
- has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
- has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+ python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
}
-check_live_ebuild() {
+check_uptodate() {
local prod_targets=(
$(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
| tail -n +2 | head -n -1)
@@ -131,7 +143,7 @@ check_distribution_components() {
all_targets+=( "${l}" )
fi
- done < <(ninja -t targets all)
+ done < <(${NINJA} -t targets all)
while read -r l; do
my_targets+=( "${l}" )
@@ -165,24 +177,12 @@ src_prepare() {
# Update config.guess to support more systems
cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
- # Verify that the live ebuild is up-to-date
- check_live_ebuild
+ # Verify that the ebuild is up-to-date
+ check_uptodate
llvm.org_src_prepare
}
-# Is LLVM being linked against libc++?
-is_libcxx_linked() {
- local code='#include <ciso646>
-#if defined(_LIBCPP_VERSION)
- HAVE_LIBCXX
-#endif
-'
- local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
-
- [[ ${out} == *HAVE_LIBCXX* ]]
-}
-
get_distribution_components() {
local sep=${1-;}
@@ -214,6 +214,7 @@ get_distribution_components() {
count
not
yaml-bench
+ UnicodeNameMappingGenerator
# tools
bugpoint
@@ -235,10 +236,14 @@ get_distribution_components() {
llvm-cxxdump
llvm-cxxfilt
llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod
+ llvm-debuginfod-find
llvm-diff
llvm-dis
llvm-dlltool
llvm-dwarfdump
+ llvm-dwarfutil
llvm-dwp
llvm-exegesis
llvm-extract
@@ -271,6 +276,8 @@ get_distribution_components() {
llvm-readelf
llvm-readobj
llvm-reduce
+ llvm-remark-size-diff
+ llvm-remarkutil
llvm-rtdyld
llvm-sim
llvm-size
@@ -280,6 +287,7 @@ get_distribution_components() {
llvm-strip
llvm-symbolizer
llvm-tapi-diff
+ llvm-tli-checker
llvm-undname
llvm-windres
llvm-xray
@@ -316,6 +324,16 @@ get_distribution_components() {
}
multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
local ffi_cflags ffi_ldflags
if use libffi; then
ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
@@ -327,7 +345,7 @@ multilib_src_configure() {
# 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}"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-DBUILD_SHARED_LIBS=OFF
@@ -339,6 +357,8 @@ multilib_src_configure() {
# is that the former list is explicitly verified at cmake time
-DLLVM_TARGETS_TO_BUILD=""
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=$(usex test)
-DLLVM_BUILD_TESTS=$(usex test)
-DLLVM_ENABLE_FFI=$(usex libffi)
@@ -350,6 +370,8 @@ multilib_src_configure() {
-DLLVM_ENABLE_EH=ON
-DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
-DLLVM_HOST_TRIPLE="${CHOST}"
@@ -364,23 +386,24 @@ multilib_src_configure() {
-DOCAMLFIND=NO
)
- if is_libcxx_linked; then
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
# Smart hack: alter version suffix -> SOVERSION when linking
# against libc++. This way we won't end up mixing LLVM libc++
# libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
mycmakeargs+=(
- -DLLVM_VERSION_SUFFIX="libcxx"
-DLLVM_ENABLE_LIBCXX=ON
)
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
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
use test && mycmakeargs+=(
-DLLVM_LIT_ARGS="$(get_lit_flags)"
@@ -391,7 +414,7 @@ multilib_src_configure() {
if llvm_are_manpages_built; then
build_docs=ON
mycmakeargs+=(
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
-DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
-DSPHINX_WARNINGS_AS_ERRORS=OFF
)
@@ -409,25 +432,12 @@ multilib_src_configure() {
)
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
-
- # workaround BMI bug in gcc-7 (fixed in 7.4)
- # https://bugs.gentoo.org/649880
- # apply only to x86, https://bugs.gentoo.org/650506
- if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
- [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
- then
- local CFLAGS="${CFLAGS} -mno-bmi"
- local CXXFLAGS="${CXXFLAGS} -mno-bmi"
- fi
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ use kernel_Darwin && mycmakeargs+=(
+ -DTerminfo_LIBRARIES=-lncurses
+ )
# LLVM can have very high memory consumption while linking,
# exhausting the limit on 32-bit linker executable
@@ -437,11 +447,14 @@ multilib_src_configure() {
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
cmake_src_configure
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MASTER_MAJOR?"
multilib_is_native_abi && check_distribution_components
}
multilib_src_compile() {
- cmake_build distribution
+ tc-env_build cmake_build distribution
pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
pax-mark m "${BUILD_DIR}"/bin/lli
@@ -462,7 +475,7 @@ multilib_src_test() {
src_install() {
local MULTILIB_CHOST_TOOLS=(
- /usr/lib/llvm/${SLOT}/bin/llvm-config
+ /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
)
local MULTILIB_WRAPPED_HEADERS=(
@@ -473,7 +486,7 @@ src_install() {
multilib-minimal_src_install
# move wrapped headers back
- mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${SLOT}/include || die
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
}
multilib_src_install() {
@@ -481,28 +494,28 @@ multilib_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
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
- LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
}
multilib_src_install_all() {
- local revord=$(( 9999 - ${SLOT} ))
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
newenvd - "60llvm-${revord}" <<-_EOF_
- PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/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"
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
_EOF_
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
}
pkg_postinst() {
elog "You can find additional opt-viewer utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
elog "To use these scripts, you will need Python along with the following"
elog "packages:"
elog " dev-python/pygments (for opt-viewer)"
diff --git a/sys-devel/llvm/llvm-13.0.1_rc2.ebuild b/sys-devel/llvm/llvm-17.0.6.ebuild
index f5d3be283708..c32eee3908c7 100644
--- a/sys-devel/llvm/llvm-13.0.1_rc2.ebuild
+++ b/sys-devel/llvm/llvm-17.0.6.ebuild
@@ -1,11 +1,12 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
- toolchain-funcs
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit toolchain-funcs
DESCRIPTION="Low Level Virtual Machine"
HOMEPAGE="https://llvm.org/"
@@ -17,58 +18,72 @@ HOMEPAGE="https://llvm.org/"
# 4. ConvertUTF.h: TODO.
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
-SLOT="$(ver_cut 1)"
-KEYWORDS=""
-IUSE="+binutils-plugin debug doc exegesis libedit +libffi ncurses test xar xml z3"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ +binutils-plugin debug debuginfod doc exegesis libedit +libffi
+ ncurses test xar xml z3 zstd
+"
RESTRICT="!test? ( test )"
RDEPEND="
sys-libs/zlib:0=[${MULTILIB_USEDEP}]
- binutils-plugin? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] )
+ debuginfod? (
+ net-misc/curl:=
+ dev-cpp/cpp-httplib:=
+ )
exegesis? ( dev-libs/libpfm:= )
libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
xar? ( app-arch/xar )
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
- binutils-plugin? ( sys-libs/binutils-libs )"
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
BDEPEND="
+ ${PYTHON_DEPS}
dev-lang/perl
- >=dev-util/cmake-3.16
sys-devel/gnuconfig
kernel_Darwin? (
- <sys-libs/libcxx-$(ver_cut 1-3).9999
- >=sys-devel/binutils-apple-5.1
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
)
doc? ( $(python_gen_any_dep '
dev-python/recommonmark[${PYTHON_USEDEP}]
dev-python/sphinx[${PYTHON_USEDEP}]
') )
libffi? ( virtual/pkgconfig )
- ${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
- binutils-plugin? ( >=sys-devel/llvmgold-${SLOT} )"
-
-LLVM_COMPONENTS=( llvm )
-LLVM_MANPAGES=build
-LLVM_PATCHSET=${PV/_/-}
+RDEPEND="
+ ${RDEPEND}
+ !sys-devel/llvm:0
+"
+PDEPEND="
+ sys-devel/llvm-common
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_MANPAGES=1
+LLVM_PATCHSET=${PV}
LLVM_USE_TARGETS=provide
llvm.org_set_globals
python_check_deps() {
use doc || return 0
- has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
- has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+ python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
}
-check_live_ebuild() {
+check_uptodate() {
local prod_targets=(
$(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
| tail -n +2 | head -n -1)
@@ -115,6 +130,9 @@ check_distribution_components() {
# TableGen lib + deps
LLVMDemangle|LLVMSupport|LLVMTableGen)
;;
+ # testing libraries
+ LLVMTestingAnnotations|LLVMTestingSupport)
+ ;;
# static libs
LLVM*)
continue
@@ -131,7 +149,7 @@ check_distribution_components() {
all_targets+=( "${l}" )
fi
- done < <(ninja -t targets all)
+ done < <(${NINJA} -t targets all)
while read -r l; do
my_targets+=( "${l}" )
@@ -165,24 +183,12 @@ src_prepare() {
# Update config.guess to support more systems
cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
- # Verify that the live ebuild is up-to-date
- check_live_ebuild
+ # Verify that the ebuild is up-to-date
+ check_uptodate
llvm.org_src_prepare
}
-# Is LLVM being linked against libc++?
-is_libcxx_linked() {
- local code='#include <ciso646>
-#if defined(_LIBCPP_VERSION)
- HAVE_LIBCXX
-#endif
-'
- local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
-
- [[ ${out} == *HAVE_LIBCXX* ]]
-}
-
get_distribution_components() {
local sep=${1-;}
@@ -203,6 +209,12 @@ get_distribution_components() {
LLVMDemangle
LLVMSupport
LLVMTableGen
+
+ # testing libraries
+ llvm_gtest
+ llvm_gtest_main
+ LLVMTestingAnnotations
+ LLVMTestingSupport
)
if multilib_is_native_abi; then
@@ -214,6 +226,7 @@ get_distribution_components() {
count
not
yaml-bench
+ UnicodeNameMappingGenerator
# tools
bugpoint
@@ -235,10 +248,13 @@ get_distribution_components() {
llvm-cxxdump
llvm-cxxfilt
llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod-find
llvm-diff
llvm-dis
llvm-dlltool
llvm-dwarfdump
+ llvm-dwarfutil
llvm-dwp
llvm-exegesis
llvm-extract
@@ -271,6 +287,8 @@ get_distribution_components() {
llvm-readelf
llvm-readobj
llvm-reduce
+ llvm-remark-size-diff
+ llvm-remarkutil
llvm-rtdyld
llvm-sim
llvm-size
@@ -280,6 +298,7 @@ get_distribution_components() {
llvm-strip
llvm-symbolizer
llvm-tapi-diff
+ llvm-tli-checker
llvm-undname
llvm-windres
llvm-xray
@@ -310,12 +329,25 @@ get_distribution_components() {
use binutils-plugin && out+=(
LLVMgold
)
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
fi
printf "%s${sep}" "${out[@]}"
}
multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
local ffi_cflags ffi_ldflags
if use libffi; then
ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
@@ -327,7 +359,7 @@ multilib_src_configure() {
# 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}"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-DBUILD_SHARED_LIBS=OFF
@@ -339,7 +371,10 @@ multilib_src_configure() {
# is that the former list is explicitly verified at cmake time
-DLLVM_TARGETS_TO_BUILD=""
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=ON
-DLLVM_BUILD_TESTS=$(usex test)
+ -DLLVM_INSTALL_GTEST=ON
-DLLVM_ENABLE_FFI=$(usex libffi)
-DLLVM_ENABLE_LIBEDIT=$(usex libedit)
@@ -350,6 +385,10 @@ multilib_src_configure() {
-DLLVM_ENABLE_EH=ON
-DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ -DLLVM_ENABLE_CURL=$(usex debuginfod)
+ -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod)
-DLLVM_HOST_TRIPLE="${CHOST}"
@@ -364,23 +403,24 @@ multilib_src_configure() {
-DOCAMLFIND=NO
)
- if is_libcxx_linked; then
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
# Smart hack: alter version suffix -> SOVERSION when linking
# against libc++. This way we won't end up mixing LLVM libc++
# libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
mycmakeargs+=(
- -DLLVM_VERSION_SUFFIX="libcxx"
-DLLVM_ENABLE_LIBCXX=ON
)
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
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
use test && mycmakeargs+=(
-DLLVM_LIT_ARGS="$(get_lit_flags)"
@@ -391,7 +431,7 @@ multilib_src_configure() {
if llvm_are_manpages_built; then
build_docs=ON
mycmakeargs+=(
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
-DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
-DSPHINX_WARNINGS_AS_ERRORS=OFF
)
@@ -409,25 +449,14 @@ multilib_src_configure() {
)
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
-
- # workaround BMI bug in gcc-7 (fixed in 7.4)
- # https://bugs.gentoo.org/649880
- # apply only to x86, https://bugs.gentoo.org/650506
- if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
- [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
- then
- local CFLAGS="${CFLAGS} -mno-bmi"
- local CXXFLAGS="${CXXFLAGS} -mno-bmi"
- fi
+ use kernel_Darwin && mycmakeargs+=(
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ -DTerminfo_LIBRARIES=-lncurses
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
# LLVM can have very high memory consumption while linking,
# exhausting the limit on 32-bit linker executable
@@ -437,11 +466,14 @@ multilib_src_configure() {
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
cmake_src_configure
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MAIN_MAJOR?"
multilib_is_native_abi && check_distribution_components
}
multilib_src_compile() {
- cmake_build distribution
+ tc-env_build cmake_build distribution
pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
pax-mark m "${BUILD_DIR}"/bin/lli
@@ -462,7 +494,7 @@ multilib_src_test() {
src_install() {
local MULTILIB_CHOST_TOOLS=(
- /usr/lib/llvm/${SLOT}/bin/llvm-config
+ /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
)
local MULTILIB_WRAPPED_HEADERS=(
@@ -473,7 +505,7 @@ src_install() {
multilib-minimal_src_install
# move wrapped headers back
- mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${SLOT}/include || die
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
}
multilib_src_install() {
@@ -481,28 +513,28 @@ multilib_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
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
- LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
}
multilib_src_install_all() {
- local revord=$(( 9999 - ${SLOT} ))
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
newenvd - "60llvm-${revord}" <<-_EOF_
- PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/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"
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
_EOF_
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
}
pkg_postinst() {
elog "You can find additional opt-viewer utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
elog "To use these scripts, you will need Python along with the following"
elog "packages:"
elog " dev-python/pygments (for opt-viewer)"
diff --git a/sys-devel/llvm/llvm-18.1.3.ebuild b/sys-devel/llvm/llvm-18.1.3.ebuild
new file mode 100644
index 000000000000..8c3d70f01423
--- /dev/null
+++ b/sys-devel/llvm/llvm-18.1.3.ebuild
@@ -0,0 +1,548 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. xxhash: BSD.
+# 3. MD5 code: public-domain.
+# 4. ConvertUTF.h: TODO.
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ +binutils-plugin debug debuginfod doc exegesis libedit +libffi
+ ncurses test xml z3 zstd
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-libs/zlib:0=[${MULTILIB_USEDEP}]
+ debuginfod? (
+ net-misc/curl:=
+ dev-cpp/cpp-httplib:=
+ )
+ exegesis? ( dev-libs/libpfm:= )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ sys-devel/gnuconfig
+ kernel_Darwin? (
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
+ )
+ libffi? ( virtual/pkgconfig )
+"
+# 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
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_MANPAGES=1
+LLVM_USE_TARGETS=provide
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_any_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+python_check_deps() {
+ llvm_are_manpages_built || return 0
+
+ python_has_version -b "dev-python/myst-parser[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+}
+
+check_uptodate() {
+ local prod_targets=(
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
+ | tail -n +2 | head -n -1)
+ )
+ local all_targets=(
+ lib/Target/*/
+ )
+ all_targets=( "${all_targets[@]#lib/Target/}" )
+ all_targets=( "${all_targets[@]%/}" )
+
+ local exp_targets=() i
+ for i in "${all_targets[@]}"; do
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
+ done
+
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
+ eqawarn "Expected: ${exp_targets[*]}"
+ eqawarn
+ fi
+
+ if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
+ eqawarn "Expected: ${prod_targets[*]}"
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # shared libs
+ LLVM|LLVMgold)
+ ;;
+ # TableGen lib + deps
+ LLVMDemangle|LLVMSupport|LLVMTableGen)
+ ;;
+ # used by lldb
+ LLVMDebuginfod)
+ ;;
+ # testing libraries
+ LLVMTestingAnnotations|LLVMTestingSupport)
+ ;;
+ # static libs
+ LLVM*)
+ continue
+ ;;
+ # meta-targets
+ distribution|llvm-libraries)
+ continue
+ ;;
+ # used only w/ USE=doc
+ docs-llvm-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+src_prepare() {
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # Update config.guess to support more systems
+ cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
+
+ # Verify that the ebuild is up-to-date
+ check_uptodate
+
+ llvm.org_src_prepare
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # shared libs
+ LLVM
+ LTO
+ Remarks
+
+ # tools
+ llvm-config
+
+ # common stuff
+ cmake-exports
+ llvm-headers
+
+ # libraries needed for clang-tblgen
+ LLVMDemangle
+ LLVMSupport
+ LLVMTableGen
+
+ # testing libraries
+ llvm_gtest
+ llvm_gtest_main
+ LLVMTestingAnnotations
+ LLVMTestingSupport
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # library used by lldb
+ LLVMDebuginfod
+
+ # utilities
+ llvm-tblgen
+ FileCheck
+ llvm-PerfectShuffle
+ count
+ not
+ yaml-bench
+ UnicodeNameMappingGenerator
+
+ # tools
+ bugpoint
+ dsymutil
+ llc
+ lli
+ lli-child-target
+ llvm-addr2line
+ llvm-ar
+ llvm-as
+ llvm-bcanalyzer
+ llvm-bitcode-strip
+ llvm-c-test
+ llvm-cat
+ llvm-cfi-verify
+ llvm-config
+ llvm-cov
+ llvm-cvtres
+ llvm-cxxdump
+ llvm-cxxfilt
+ llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod-find
+ llvm-diff
+ llvm-dis
+ llvm-dlltool
+ llvm-dwarfdump
+ llvm-dwarfutil
+ llvm-dwp
+ llvm-exegesis
+ llvm-extract
+ llvm-gsymutil
+ llvm-ifs
+ llvm-install-name-tool
+ llvm-jitlink
+ llvm-jitlink-executor
+ llvm-lib
+ llvm-libtool-darwin
+ llvm-link
+ llvm-lipo
+ llvm-lto
+ llvm-lto2
+ llvm-mc
+ llvm-mca
+ llvm-ml
+ llvm-modextract
+ llvm-mt
+ llvm-nm
+ llvm-objcopy
+ llvm-objdump
+ llvm-opt-report
+ llvm-otool
+ llvm-pdbutil
+ llvm-profdata
+ llvm-profgen
+ llvm-ranlib
+ llvm-rc
+ llvm-readelf
+ llvm-readobj
+ llvm-readtapi
+ llvm-reduce
+ llvm-remarkutil
+ llvm-rtdyld
+ llvm-sim
+ llvm-size
+ llvm-split
+ llvm-stress
+ llvm-strings
+ llvm-strip
+ llvm-symbolizer
+ llvm-tli-checker
+ llvm-undname
+ llvm-windres
+ llvm-xray
+ obj2yaml
+ opt
+ sancov
+ sanstats
+ split-file
+ verify-uselistorder
+ yaml2obj
+
+ # python modules
+ opt-viewer
+ )
+
+ if llvm_are_manpages_built; then
+ out+=(
+ # manpages
+ docs-dsymutil-man
+ docs-llvm-dwarfdump-man
+ docs-llvm-man
+ )
+ fi
+ use doc && out+=(
+ docs-llvm-html
+ )
+
+ use binutils-plugin && out+=(
+ LLVMgold
+ )
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
+ 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/${LLVM_MAJOR}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=ON
+ -DLLVM_LINK_LLVM_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+
+ # 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_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=ON
+ -DLLVM_BUILD_TESTS=$(usex test)
+ -DLLVM_INSTALL_GTEST=ON
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_LIBXML2=$(usex xml)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+ -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ -DLLVM_ENABLE_CURL=$(usex debuginfod)
+ -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod)
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ # Smart hack: alter version suffix -> SOVERSION when linking
+ # against libc++. This way we won't end up mixing LLVM libc++
+ # libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
+ mycmakeargs+=(
+ -DLLVM_ENABLE_LIBCXX=ON
+ )
+ fi
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ fi
+
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=${build_docs}
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=${build_docs}
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use binutils-plugin && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ use kernel_Darwin && mycmakeargs+=(
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ -DTerminfo_LIBRARIES=-lncurses
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MAIN_MAJOR?"
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ tc-env_build cmake_build distribution
+
+ 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_build check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${LLVM_MAJOR}/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/${LLVM_MAJOR}/include || die
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
+ newenvd - "60llvm-${revord}" <<-_EOF_
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+ _EOF_
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+}
+
+pkg_postinst() {
+ elog "You can find additional opt-viewer utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
+ elog "To use these scripts, you will need Python along with the following"
+ elog "packages:"
+ elog " dev-python/pygments (for opt-viewer)"
+ elog " dev-python/pyyaml (for all of them)"
+}
diff --git a/sys-devel/llvm/llvm-18.1.4.ebuild b/sys-devel/llvm/llvm-18.1.4.ebuild
new file mode 100644
index 000000000000..8c3d70f01423
--- /dev/null
+++ b/sys-devel/llvm/llvm-18.1.4.ebuild
@@ -0,0 +1,548 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. xxhash: BSD.
+# 3. MD5 code: public-domain.
+# 4. ConvertUTF.h: TODO.
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ +binutils-plugin debug debuginfod doc exegesis libedit +libffi
+ ncurses test xml z3 zstd
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-libs/zlib:0=[${MULTILIB_USEDEP}]
+ debuginfod? (
+ net-misc/curl:=
+ dev-cpp/cpp-httplib:=
+ )
+ exegesis? ( dev-libs/libpfm:= )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ sys-devel/gnuconfig
+ kernel_Darwin? (
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
+ )
+ libffi? ( virtual/pkgconfig )
+"
+# 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
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_MANPAGES=1
+LLVM_USE_TARGETS=provide
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_any_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+python_check_deps() {
+ llvm_are_manpages_built || return 0
+
+ python_has_version -b "dev-python/myst-parser[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+}
+
+check_uptodate() {
+ local prod_targets=(
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
+ | tail -n +2 | head -n -1)
+ )
+ local all_targets=(
+ lib/Target/*/
+ )
+ all_targets=( "${all_targets[@]#lib/Target/}" )
+ all_targets=( "${all_targets[@]%/}" )
+
+ local exp_targets=() i
+ for i in "${all_targets[@]}"; do
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
+ done
+
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
+ eqawarn "Expected: ${exp_targets[*]}"
+ eqawarn
+ fi
+
+ if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
+ eqawarn "Expected: ${prod_targets[*]}"
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # shared libs
+ LLVM|LLVMgold)
+ ;;
+ # TableGen lib + deps
+ LLVMDemangle|LLVMSupport|LLVMTableGen)
+ ;;
+ # used by lldb
+ LLVMDebuginfod)
+ ;;
+ # testing libraries
+ LLVMTestingAnnotations|LLVMTestingSupport)
+ ;;
+ # static libs
+ LLVM*)
+ continue
+ ;;
+ # meta-targets
+ distribution|llvm-libraries)
+ continue
+ ;;
+ # used only w/ USE=doc
+ docs-llvm-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+src_prepare() {
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # Update config.guess to support more systems
+ cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
+
+ # Verify that the ebuild is up-to-date
+ check_uptodate
+
+ llvm.org_src_prepare
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # shared libs
+ LLVM
+ LTO
+ Remarks
+
+ # tools
+ llvm-config
+
+ # common stuff
+ cmake-exports
+ llvm-headers
+
+ # libraries needed for clang-tblgen
+ LLVMDemangle
+ LLVMSupport
+ LLVMTableGen
+
+ # testing libraries
+ llvm_gtest
+ llvm_gtest_main
+ LLVMTestingAnnotations
+ LLVMTestingSupport
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # library used by lldb
+ LLVMDebuginfod
+
+ # utilities
+ llvm-tblgen
+ FileCheck
+ llvm-PerfectShuffle
+ count
+ not
+ yaml-bench
+ UnicodeNameMappingGenerator
+
+ # tools
+ bugpoint
+ dsymutil
+ llc
+ lli
+ lli-child-target
+ llvm-addr2line
+ llvm-ar
+ llvm-as
+ llvm-bcanalyzer
+ llvm-bitcode-strip
+ llvm-c-test
+ llvm-cat
+ llvm-cfi-verify
+ llvm-config
+ llvm-cov
+ llvm-cvtres
+ llvm-cxxdump
+ llvm-cxxfilt
+ llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod-find
+ llvm-diff
+ llvm-dis
+ llvm-dlltool
+ llvm-dwarfdump
+ llvm-dwarfutil
+ llvm-dwp
+ llvm-exegesis
+ llvm-extract
+ llvm-gsymutil
+ llvm-ifs
+ llvm-install-name-tool
+ llvm-jitlink
+ llvm-jitlink-executor
+ llvm-lib
+ llvm-libtool-darwin
+ llvm-link
+ llvm-lipo
+ llvm-lto
+ llvm-lto2
+ llvm-mc
+ llvm-mca
+ llvm-ml
+ llvm-modextract
+ llvm-mt
+ llvm-nm
+ llvm-objcopy
+ llvm-objdump
+ llvm-opt-report
+ llvm-otool
+ llvm-pdbutil
+ llvm-profdata
+ llvm-profgen
+ llvm-ranlib
+ llvm-rc
+ llvm-readelf
+ llvm-readobj
+ llvm-readtapi
+ llvm-reduce
+ llvm-remarkutil
+ llvm-rtdyld
+ llvm-sim
+ llvm-size
+ llvm-split
+ llvm-stress
+ llvm-strings
+ llvm-strip
+ llvm-symbolizer
+ llvm-tli-checker
+ llvm-undname
+ llvm-windres
+ llvm-xray
+ obj2yaml
+ opt
+ sancov
+ sanstats
+ split-file
+ verify-uselistorder
+ yaml2obj
+
+ # python modules
+ opt-viewer
+ )
+
+ if llvm_are_manpages_built; then
+ out+=(
+ # manpages
+ docs-dsymutil-man
+ docs-llvm-dwarfdump-man
+ docs-llvm-man
+ )
+ fi
+ use doc && out+=(
+ docs-llvm-html
+ )
+
+ use binutils-plugin && out+=(
+ LLVMgold
+ )
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
+ 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/${LLVM_MAJOR}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=ON
+ -DLLVM_LINK_LLVM_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+
+ # 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_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=ON
+ -DLLVM_BUILD_TESTS=$(usex test)
+ -DLLVM_INSTALL_GTEST=ON
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_LIBXML2=$(usex xml)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+ -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ -DLLVM_ENABLE_CURL=$(usex debuginfod)
+ -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod)
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ # Smart hack: alter version suffix -> SOVERSION when linking
+ # against libc++. This way we won't end up mixing LLVM libc++
+ # libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
+ mycmakeargs+=(
+ -DLLVM_ENABLE_LIBCXX=ON
+ )
+ fi
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ fi
+
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=${build_docs}
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=${build_docs}
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use binutils-plugin && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ use kernel_Darwin && mycmakeargs+=(
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ -DTerminfo_LIBRARIES=-lncurses
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MAIN_MAJOR?"
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ tc-env_build cmake_build distribution
+
+ 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_build check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${LLVM_MAJOR}/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/${LLVM_MAJOR}/include || die
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
+ newenvd - "60llvm-${revord}" <<-_EOF_
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+ _EOF_
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+}
+
+pkg_postinst() {
+ elog "You can find additional opt-viewer utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
+ elog "To use these scripts, you will need Python along with the following"
+ elog "packages:"
+ elog " dev-python/pygments (for opt-viewer)"
+ elog " dev-python/pyyaml (for all of them)"
+}
diff --git a/sys-devel/llvm/llvm-14.0.0.9999.ebuild b/sys-devel/llvm/llvm-19.0.0.9999.ebuild
index f89b54bbb6c4..8624219a7e20 100644
--- a/sys-devel/llvm/llvm-14.0.0.9999.ebuild
+++ b/sys-devel/llvm/llvm-19.0.0.9999.ebuild
@@ -1,11 +1,12 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
- toolchain-funcs
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit toolchain-funcs
DESCRIPTION="Low Level Virtual Machine"
HOMEPAGE="https://llvm.org/"
@@ -17,58 +18,74 @@ HOMEPAGE="https://llvm.org/"
# 4. ConvertUTF.h: TODO.
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
-SLOT="$(ver_cut 1)"
-KEYWORDS=""
-IUSE="+binutils-plugin debug doc exegesis libedit +libffi ncurses test xar xml z3"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="
+ +binutils-plugin +debug debuginfod doc exegesis libedit +libffi
+ ncurses test xml z3 zstd
+"
RESTRICT="!test? ( test )"
RDEPEND="
sys-libs/zlib:0=[${MULTILIB_USEDEP}]
- binutils-plugin? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] )
+ debuginfod? (
+ net-misc/curl:=
+ dev-cpp/cpp-httplib:=
+ )
exegesis? ( dev-libs/libpfm:= )
libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
- xar? ( app-arch/xar )
xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
- z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
- binutils-plugin? ( sys-libs/binutils-libs )"
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
BDEPEND="
+ ${PYTHON_DEPS}
dev-lang/perl
- >=dev-util/cmake-3.16
sys-devel/gnuconfig
kernel_Darwin? (
- <sys-libs/libcxx-$(ver_cut 1-3).9999
- >=sys-devel/binutils-apple-5.1
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
)
- doc? ( $(python_gen_any_dep '
- dev-python/recommonmark[${PYTHON_USEDEP}]
- dev-python/sphinx[${PYTHON_USEDEP}]
- ') )
libffi? ( virtual/pkgconfig )
- ${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
- binutils-plugin? ( >=sys-devel/llvmgold-${SLOT} )"
-
-LLVM_COMPONENTS=( llvm third-party )
-LLVM_MANPAGES=build
-LLVM_PATCHSET=9999-1
+RDEPEND="
+ ${RDEPEND}
+ !sys-devel/llvm:0
+"
+PDEPEND="
+ sys-devel/llvm-common
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_MANPAGES=1
LLVM_USE_TARGETS=provide
llvm.org_set_globals
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_any_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
python_check_deps() {
- use doc || return 0
+ llvm_are_manpages_built || return 0
- has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
- has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+ python_has_version -b "dev-python/myst-parser[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
}
-check_live_ebuild() {
+check_uptodate() {
local prod_targets=(
$(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
| tail -n +2 | head -n -1)
@@ -115,6 +132,12 @@ check_distribution_components() {
# TableGen lib + deps
LLVMDemangle|LLVMSupport|LLVMTableGen)
;;
+ # used by lldb
+ LLVMDebuginfod)
+ ;;
+ # testing libraries
+ LLVMTestingAnnotations|LLVMTestingSupport)
+ ;;
# static libs
LLVM*)
continue
@@ -131,7 +154,7 @@ check_distribution_components() {
all_targets+=( "${l}" )
fi
- done < <(ninja -t targets all)
+ done < <(${NINJA} -t targets all)
while read -r l; do
my_targets+=( "${l}" )
@@ -165,24 +188,12 @@ src_prepare() {
# Update config.guess to support more systems
cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
- # Verify that the live ebuild is up-to-date
- check_live_ebuild
+ # Verify that the ebuild is up-to-date
+ check_uptodate
llvm.org_src_prepare
}
-# Is LLVM being linked against libc++?
-is_libcxx_linked() {
- local code='#include <ciso646>
-#if defined(_LIBCPP_VERSION)
- HAVE_LIBCXX
-#endif
-'
- local out=$($(tc-getCXX) ${CXXFLAGS} ${CPPFLAGS} -x c++ -E -P - <<<"${code}") || return 1
-
- [[ ${out} == *HAVE_LIBCXX* ]]
-}
-
get_distribution_components() {
local sep=${1-;}
@@ -203,10 +214,19 @@ get_distribution_components() {
LLVMDemangle
LLVMSupport
LLVMTableGen
+
+ # testing libraries
+ llvm_gtest
+ llvm_gtest_main
+ LLVMTestingAnnotations
+ LLVMTestingSupport
)
if multilib_is_native_abi; then
out+=(
+ # library used by lldb
+ LLVMDebuginfod
+
# utilities
llvm-tblgen
FileCheck
@@ -214,6 +234,7 @@ get_distribution_components() {
count
not
yaml-bench
+ UnicodeNameMappingGenerator
# tools
bugpoint
@@ -235,10 +256,13 @@ get_distribution_components() {
llvm-cxxdump
llvm-cxxfilt
llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod-find
llvm-diff
llvm-dis
llvm-dlltool
llvm-dwarfdump
+ llvm-dwarfutil
llvm-dwp
llvm-exegesis
llvm-extract
@@ -270,7 +294,9 @@ get_distribution_components() {
llvm-rc
llvm-readelf
llvm-readobj
+ llvm-readtapi
llvm-reduce
+ llvm-remarkutil
llvm-rtdyld
llvm-sim
llvm-size
@@ -279,7 +305,7 @@ get_distribution_components() {
llvm-strings
llvm-strip
llvm-symbolizer
- llvm-tapi-diff
+ llvm-tli-checker
llvm-undname
llvm-windres
llvm-xray
@@ -310,12 +336,25 @@ get_distribution_components() {
use binutils-plugin && out+=(
LLVMgold
)
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
fi
printf "%s${sep}" "${out[@]}"
}
multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
local ffi_cflags ffi_ldflags
if use libffi; then
ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
@@ -327,7 +366,7 @@ multilib_src_configure() {
# 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}"
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
-DLLVM_LIBDIR_SUFFIX=${libdir#lib}
-DBUILD_SHARED_LIBS=OFF
@@ -339,7 +378,10 @@ multilib_src_configure() {
# is that the former list is explicitly verified at cmake time
-DLLVM_TARGETS_TO_BUILD=""
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=ON
-DLLVM_BUILD_TESTS=$(usex test)
+ -DLLVM_INSTALL_GTEST=ON
-DLLVM_ENABLE_FFI=$(usex libffi)
-DLLVM_ENABLE_LIBEDIT=$(usex libedit)
@@ -350,13 +392,15 @@ multilib_src_configure() {
-DLLVM_ENABLE_EH=ON
-DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ -DLLVM_ENABLE_CURL=$(usex debuginfod)
+ -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod)
-DLLVM_HOST_TRIPLE="${CHOST}"
-DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
-DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
- # used only for llvm-objdump tool
- -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0)
-DPython3_EXECUTABLE="${PYTHON}"
@@ -364,23 +408,24 @@ multilib_src_configure() {
-DOCAMLFIND=NO
)
- if is_libcxx_linked; then
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
# Smart hack: alter version suffix -> SOVERSION when linking
# against libc++. This way we won't end up mixing LLVM libc++
# libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
mycmakeargs+=(
- -DLLVM_VERSION_SUFFIX="libcxx"
-DLLVM_ENABLE_LIBCXX=ON
)
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
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
use test && mycmakeargs+=(
-DLLVM_LIT_ARGS="$(get_lit_flags)"
@@ -391,7 +436,7 @@ multilib_src_configure() {
if llvm_are_manpages_built; then
build_docs=ON
mycmakeargs+=(
- -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${SLOT}/share/man"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
-DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
-DSPHINX_WARNINGS_AS_ERRORS=OFF
)
@@ -409,25 +454,14 @@ multilib_src_configure() {
)
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
-
- # workaround BMI bug in gcc-7 (fixed in 7.4)
- # https://bugs.gentoo.org/649880
- # apply only to x86, https://bugs.gentoo.org/650506
- if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
- [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
- then
- local CFLAGS="${CFLAGS} -mno-bmi"
- local CXXFLAGS="${CXXFLAGS} -mno-bmi"
- fi
+ use kernel_Darwin && mycmakeargs+=(
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ -DTerminfo_LIBRARIES=-lncurses
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
# LLVM can have very high memory consumption while linking,
# exhausting the limit on 32-bit linker executable
@@ -437,11 +471,14 @@ multilib_src_configure() {
use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
cmake_src_configure
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MAIN_MAJOR?"
multilib_is_native_abi && check_distribution_components
}
multilib_src_compile() {
- cmake_build distribution
+ tc-env_build cmake_build distribution
pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
pax-mark m "${BUILD_DIR}"/bin/lli
@@ -462,7 +499,7 @@ multilib_src_test() {
src_install() {
local MULTILIB_CHOST_TOOLS=(
- /usr/lib/llvm/${SLOT}/bin/llvm-config
+ /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
)
local MULTILIB_WRAPPED_HEADERS=(
@@ -473,7 +510,7 @@ src_install() {
multilib-minimal_src_install
# move wrapped headers back
- mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${SLOT}/include || die
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
}
multilib_src_install() {
@@ -481,28 +518,28 @@ multilib_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
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
- LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${SLOT}/$(get_libdir)" )
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
}
multilib_src_install_all() {
- local revord=$(( 9999 - ${SLOT} ))
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
newenvd - "60llvm-${revord}" <<-_EOF_
- PATH="${EPREFIX}/usr/lib/llvm/${SLOT}/bin"
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/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"
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
_EOF_
- docompress "/usr/lib/llvm/${SLOT}/share/man"
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
llvm_install_manpages
}
pkg_postinst() {
elog "You can find additional opt-viewer utility scripts in:"
- elog " ${EROOT}/usr/lib/llvm/${SLOT}/share/opt-viewer"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
elog "To use these scripts, you will need Python along with the following"
elog "packages:"
elog " dev-python/pygments (for opt-viewer)"
diff --git a/sys-devel/llvm/llvm-19.0.0_pre20240330.ebuild b/sys-devel/llvm/llvm-19.0.0_pre20240330.ebuild
new file mode 100644
index 000000000000..8624219a7e20
--- /dev/null
+++ b/sys-devel/llvm/llvm-19.0.0_pre20240330.ebuild
@@ -0,0 +1,547 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. xxhash: BSD.
+# 3. MD5 code: public-domain.
+# 4. ConvertUTF.h: TODO.
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="
+ +binutils-plugin +debug debuginfod doc exegesis libedit +libffi
+ ncurses test xml z3 zstd
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-libs/zlib:0=[${MULTILIB_USEDEP}]
+ debuginfod? (
+ net-misc/curl:=
+ dev-cpp/cpp-httplib:=
+ )
+ exegesis? ( dev-libs/libpfm:= )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ sys-devel/gnuconfig
+ kernel_Darwin? (
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
+ )
+ libffi? ( virtual/pkgconfig )
+"
+# 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
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_MANPAGES=1
+LLVM_USE_TARGETS=provide
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_any_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+python_check_deps() {
+ llvm_are_manpages_built || return 0
+
+ python_has_version -b "dev-python/myst-parser[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+}
+
+check_uptodate() {
+ local prod_targets=(
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
+ | tail -n +2 | head -n -1)
+ )
+ local all_targets=(
+ lib/Target/*/
+ )
+ all_targets=( "${all_targets[@]#lib/Target/}" )
+ all_targets=( "${all_targets[@]%/}" )
+
+ local exp_targets=() i
+ for i in "${all_targets[@]}"; do
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
+ done
+
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
+ eqawarn "Expected: ${exp_targets[*]}"
+ eqawarn
+ fi
+
+ if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
+ eqawarn "Expected: ${prod_targets[*]}"
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # shared libs
+ LLVM|LLVMgold)
+ ;;
+ # TableGen lib + deps
+ LLVMDemangle|LLVMSupport|LLVMTableGen)
+ ;;
+ # used by lldb
+ LLVMDebuginfod)
+ ;;
+ # testing libraries
+ LLVMTestingAnnotations|LLVMTestingSupport)
+ ;;
+ # static libs
+ LLVM*)
+ continue
+ ;;
+ # meta-targets
+ distribution|llvm-libraries)
+ continue
+ ;;
+ # used only w/ USE=doc
+ docs-llvm-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+src_prepare() {
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # Update config.guess to support more systems
+ cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
+
+ # Verify that the ebuild is up-to-date
+ check_uptodate
+
+ llvm.org_src_prepare
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # shared libs
+ LLVM
+ LTO
+ Remarks
+
+ # tools
+ llvm-config
+
+ # common stuff
+ cmake-exports
+ llvm-headers
+
+ # libraries needed for clang-tblgen
+ LLVMDemangle
+ LLVMSupport
+ LLVMTableGen
+
+ # testing libraries
+ llvm_gtest
+ llvm_gtest_main
+ LLVMTestingAnnotations
+ LLVMTestingSupport
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # library used by lldb
+ LLVMDebuginfod
+
+ # utilities
+ llvm-tblgen
+ FileCheck
+ llvm-PerfectShuffle
+ count
+ not
+ yaml-bench
+ UnicodeNameMappingGenerator
+
+ # tools
+ bugpoint
+ dsymutil
+ llc
+ lli
+ lli-child-target
+ llvm-addr2line
+ llvm-ar
+ llvm-as
+ llvm-bcanalyzer
+ llvm-bitcode-strip
+ llvm-c-test
+ llvm-cat
+ llvm-cfi-verify
+ llvm-config
+ llvm-cov
+ llvm-cvtres
+ llvm-cxxdump
+ llvm-cxxfilt
+ llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod-find
+ llvm-diff
+ llvm-dis
+ llvm-dlltool
+ llvm-dwarfdump
+ llvm-dwarfutil
+ llvm-dwp
+ llvm-exegesis
+ llvm-extract
+ llvm-gsymutil
+ llvm-ifs
+ llvm-install-name-tool
+ llvm-jitlink
+ llvm-jitlink-executor
+ llvm-lib
+ llvm-libtool-darwin
+ llvm-link
+ llvm-lipo
+ llvm-lto
+ llvm-lto2
+ llvm-mc
+ llvm-mca
+ llvm-ml
+ llvm-modextract
+ llvm-mt
+ llvm-nm
+ llvm-objcopy
+ llvm-objdump
+ llvm-opt-report
+ llvm-otool
+ llvm-pdbutil
+ llvm-profdata
+ llvm-profgen
+ llvm-ranlib
+ llvm-rc
+ llvm-readelf
+ llvm-readobj
+ llvm-readtapi
+ llvm-reduce
+ llvm-remarkutil
+ llvm-rtdyld
+ llvm-sim
+ llvm-size
+ llvm-split
+ llvm-stress
+ llvm-strings
+ llvm-strip
+ llvm-symbolizer
+ llvm-tli-checker
+ llvm-undname
+ llvm-windres
+ llvm-xray
+ obj2yaml
+ opt
+ sancov
+ sanstats
+ split-file
+ verify-uselistorder
+ yaml2obj
+
+ # python modules
+ opt-viewer
+ )
+
+ if llvm_are_manpages_built; then
+ out+=(
+ # manpages
+ docs-dsymutil-man
+ docs-llvm-dwarfdump-man
+ docs-llvm-man
+ )
+ fi
+ use doc && out+=(
+ docs-llvm-html
+ )
+
+ use binutils-plugin && out+=(
+ LLVMgold
+ )
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
+ 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/${LLVM_MAJOR}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=ON
+ -DLLVM_LINK_LLVM_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+
+ # 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_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=ON
+ -DLLVM_BUILD_TESTS=$(usex test)
+ -DLLVM_INSTALL_GTEST=ON
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_LIBXML2=$(usex xml)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+ -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ -DLLVM_ENABLE_CURL=$(usex debuginfod)
+ -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod)
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ # Smart hack: alter version suffix -> SOVERSION when linking
+ # against libc++. This way we won't end up mixing LLVM libc++
+ # libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
+ mycmakeargs+=(
+ -DLLVM_ENABLE_LIBCXX=ON
+ )
+ fi
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ fi
+
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=${build_docs}
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=${build_docs}
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use binutils-plugin && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ use kernel_Darwin && mycmakeargs+=(
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ -DTerminfo_LIBRARIES=-lncurses
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MAIN_MAJOR?"
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ tc-env_build cmake_build distribution
+
+ 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_build check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${LLVM_MAJOR}/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/${LLVM_MAJOR}/include || die
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
+ newenvd - "60llvm-${revord}" <<-_EOF_
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+ _EOF_
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+}
+
+pkg_postinst() {
+ elog "You can find additional opt-viewer utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
+ elog "To use these scripts, you will need Python along with the following"
+ elog "packages:"
+ elog " dev-python/pygments (for opt-viewer)"
+ elog " dev-python/pyyaml (for all of them)"
+}
diff --git a/sys-devel/llvm/llvm-19.0.0_pre20240404.ebuild b/sys-devel/llvm/llvm-19.0.0_pre20240404.ebuild
new file mode 100644
index 000000000000..8624219a7e20
--- /dev/null
+++ b/sys-devel/llvm/llvm-19.0.0_pre20240404.ebuild
@@ -0,0 +1,547 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. xxhash: BSD.
+# 3. MD5 code: public-domain.
+# 4. ConvertUTF.h: TODO.
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="
+ +binutils-plugin +debug debuginfod doc exegesis libedit +libffi
+ ncurses test xml z3 zstd
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-libs/zlib:0=[${MULTILIB_USEDEP}]
+ debuginfod? (
+ net-misc/curl:=
+ dev-cpp/cpp-httplib:=
+ )
+ exegesis? ( dev-libs/libpfm:= )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ sys-devel/gnuconfig
+ kernel_Darwin? (
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
+ )
+ libffi? ( virtual/pkgconfig )
+"
+# 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
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_MANPAGES=1
+LLVM_USE_TARGETS=provide
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_any_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+python_check_deps() {
+ llvm_are_manpages_built || return 0
+
+ python_has_version -b "dev-python/myst-parser[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+}
+
+check_uptodate() {
+ local prod_targets=(
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
+ | tail -n +2 | head -n -1)
+ )
+ local all_targets=(
+ lib/Target/*/
+ )
+ all_targets=( "${all_targets[@]#lib/Target/}" )
+ all_targets=( "${all_targets[@]%/}" )
+
+ local exp_targets=() i
+ for i in "${all_targets[@]}"; do
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
+ done
+
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
+ eqawarn "Expected: ${exp_targets[*]}"
+ eqawarn
+ fi
+
+ if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
+ eqawarn "Expected: ${prod_targets[*]}"
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # shared libs
+ LLVM|LLVMgold)
+ ;;
+ # TableGen lib + deps
+ LLVMDemangle|LLVMSupport|LLVMTableGen)
+ ;;
+ # used by lldb
+ LLVMDebuginfod)
+ ;;
+ # testing libraries
+ LLVMTestingAnnotations|LLVMTestingSupport)
+ ;;
+ # static libs
+ LLVM*)
+ continue
+ ;;
+ # meta-targets
+ distribution|llvm-libraries)
+ continue
+ ;;
+ # used only w/ USE=doc
+ docs-llvm-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+src_prepare() {
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # Update config.guess to support more systems
+ cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
+
+ # Verify that the ebuild is up-to-date
+ check_uptodate
+
+ llvm.org_src_prepare
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # shared libs
+ LLVM
+ LTO
+ Remarks
+
+ # tools
+ llvm-config
+
+ # common stuff
+ cmake-exports
+ llvm-headers
+
+ # libraries needed for clang-tblgen
+ LLVMDemangle
+ LLVMSupport
+ LLVMTableGen
+
+ # testing libraries
+ llvm_gtest
+ llvm_gtest_main
+ LLVMTestingAnnotations
+ LLVMTestingSupport
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # library used by lldb
+ LLVMDebuginfod
+
+ # utilities
+ llvm-tblgen
+ FileCheck
+ llvm-PerfectShuffle
+ count
+ not
+ yaml-bench
+ UnicodeNameMappingGenerator
+
+ # tools
+ bugpoint
+ dsymutil
+ llc
+ lli
+ lli-child-target
+ llvm-addr2line
+ llvm-ar
+ llvm-as
+ llvm-bcanalyzer
+ llvm-bitcode-strip
+ llvm-c-test
+ llvm-cat
+ llvm-cfi-verify
+ llvm-config
+ llvm-cov
+ llvm-cvtres
+ llvm-cxxdump
+ llvm-cxxfilt
+ llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod-find
+ llvm-diff
+ llvm-dis
+ llvm-dlltool
+ llvm-dwarfdump
+ llvm-dwarfutil
+ llvm-dwp
+ llvm-exegesis
+ llvm-extract
+ llvm-gsymutil
+ llvm-ifs
+ llvm-install-name-tool
+ llvm-jitlink
+ llvm-jitlink-executor
+ llvm-lib
+ llvm-libtool-darwin
+ llvm-link
+ llvm-lipo
+ llvm-lto
+ llvm-lto2
+ llvm-mc
+ llvm-mca
+ llvm-ml
+ llvm-modextract
+ llvm-mt
+ llvm-nm
+ llvm-objcopy
+ llvm-objdump
+ llvm-opt-report
+ llvm-otool
+ llvm-pdbutil
+ llvm-profdata
+ llvm-profgen
+ llvm-ranlib
+ llvm-rc
+ llvm-readelf
+ llvm-readobj
+ llvm-readtapi
+ llvm-reduce
+ llvm-remarkutil
+ llvm-rtdyld
+ llvm-sim
+ llvm-size
+ llvm-split
+ llvm-stress
+ llvm-strings
+ llvm-strip
+ llvm-symbolizer
+ llvm-tli-checker
+ llvm-undname
+ llvm-windres
+ llvm-xray
+ obj2yaml
+ opt
+ sancov
+ sanstats
+ split-file
+ verify-uselistorder
+ yaml2obj
+
+ # python modules
+ opt-viewer
+ )
+
+ if llvm_are_manpages_built; then
+ out+=(
+ # manpages
+ docs-dsymutil-man
+ docs-llvm-dwarfdump-man
+ docs-llvm-man
+ )
+ fi
+ use doc && out+=(
+ docs-llvm-html
+ )
+
+ use binutils-plugin && out+=(
+ LLVMgold
+ )
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
+ 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/${LLVM_MAJOR}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=ON
+ -DLLVM_LINK_LLVM_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+
+ # 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_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=ON
+ -DLLVM_BUILD_TESTS=$(usex test)
+ -DLLVM_INSTALL_GTEST=ON
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_LIBXML2=$(usex xml)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+ -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ -DLLVM_ENABLE_CURL=$(usex debuginfod)
+ -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod)
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ # Smart hack: alter version suffix -> SOVERSION when linking
+ # against libc++. This way we won't end up mixing LLVM libc++
+ # libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
+ mycmakeargs+=(
+ -DLLVM_ENABLE_LIBCXX=ON
+ )
+ fi
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ fi
+
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=${build_docs}
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=${build_docs}
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use binutils-plugin && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ use kernel_Darwin && mycmakeargs+=(
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ -DTerminfo_LIBRARIES=-lncurses
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MAIN_MAJOR?"
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ tc-env_build cmake_build distribution
+
+ 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_build check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${LLVM_MAJOR}/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/${LLVM_MAJOR}/include || die
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
+ newenvd - "60llvm-${revord}" <<-_EOF_
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+ _EOF_
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+}
+
+pkg_postinst() {
+ elog "You can find additional opt-viewer utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
+ elog "To use these scripts, you will need Python along with the following"
+ elog "packages:"
+ elog " dev-python/pygments (for opt-viewer)"
+ elog " dev-python/pyyaml (for all of them)"
+}
diff --git a/sys-devel/llvm/llvm-19.0.0_pre20240410.ebuild b/sys-devel/llvm/llvm-19.0.0_pre20240410.ebuild
new file mode 100644
index 000000000000..8624219a7e20
--- /dev/null
+++ b/sys-devel/llvm/llvm-19.0.0_pre20240410.ebuild
@@ -0,0 +1,547 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. xxhash: BSD.
+# 3. MD5 code: public-domain.
+# 4. ConvertUTF.h: TODO.
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+IUSE="
+ +binutils-plugin +debug debuginfod doc exegesis libedit +libffi
+ ncurses test xml z3 zstd
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-libs/zlib:0=[${MULTILIB_USEDEP}]
+ debuginfod? (
+ net-misc/curl:=
+ dev-cpp/cpp-httplib:=
+ )
+ exegesis? ( dev-libs/libpfm:= )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ sys-devel/gnuconfig
+ kernel_Darwin? (
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
+ )
+ libffi? ( virtual/pkgconfig )
+"
+# 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
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_MANPAGES=1
+LLVM_USE_TARGETS=provide
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_any_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+python_check_deps() {
+ llvm_are_manpages_built || return 0
+
+ python_has_version -b "dev-python/myst-parser[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+}
+
+check_uptodate() {
+ local prod_targets=(
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
+ | tail -n +2 | head -n -1)
+ )
+ local all_targets=(
+ lib/Target/*/
+ )
+ all_targets=( "${all_targets[@]#lib/Target/}" )
+ all_targets=( "${all_targets[@]%/}" )
+
+ local exp_targets=() i
+ for i in "${all_targets[@]}"; do
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
+ done
+
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
+ eqawarn "Expected: ${exp_targets[*]}"
+ eqawarn
+ fi
+
+ if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
+ eqawarn "Expected: ${prod_targets[*]}"
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # shared libs
+ LLVM|LLVMgold)
+ ;;
+ # TableGen lib + deps
+ LLVMDemangle|LLVMSupport|LLVMTableGen)
+ ;;
+ # used by lldb
+ LLVMDebuginfod)
+ ;;
+ # testing libraries
+ LLVMTestingAnnotations|LLVMTestingSupport)
+ ;;
+ # static libs
+ LLVM*)
+ continue
+ ;;
+ # meta-targets
+ distribution|llvm-libraries)
+ continue
+ ;;
+ # used only w/ USE=doc
+ docs-llvm-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+src_prepare() {
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # Update config.guess to support more systems
+ cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
+
+ # Verify that the ebuild is up-to-date
+ check_uptodate
+
+ llvm.org_src_prepare
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # shared libs
+ LLVM
+ LTO
+ Remarks
+
+ # tools
+ llvm-config
+
+ # common stuff
+ cmake-exports
+ llvm-headers
+
+ # libraries needed for clang-tblgen
+ LLVMDemangle
+ LLVMSupport
+ LLVMTableGen
+
+ # testing libraries
+ llvm_gtest
+ llvm_gtest_main
+ LLVMTestingAnnotations
+ LLVMTestingSupport
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # library used by lldb
+ LLVMDebuginfod
+
+ # utilities
+ llvm-tblgen
+ FileCheck
+ llvm-PerfectShuffle
+ count
+ not
+ yaml-bench
+ UnicodeNameMappingGenerator
+
+ # tools
+ bugpoint
+ dsymutil
+ llc
+ lli
+ lli-child-target
+ llvm-addr2line
+ llvm-ar
+ llvm-as
+ llvm-bcanalyzer
+ llvm-bitcode-strip
+ llvm-c-test
+ llvm-cat
+ llvm-cfi-verify
+ llvm-config
+ llvm-cov
+ llvm-cvtres
+ llvm-cxxdump
+ llvm-cxxfilt
+ llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod-find
+ llvm-diff
+ llvm-dis
+ llvm-dlltool
+ llvm-dwarfdump
+ llvm-dwarfutil
+ llvm-dwp
+ llvm-exegesis
+ llvm-extract
+ llvm-gsymutil
+ llvm-ifs
+ llvm-install-name-tool
+ llvm-jitlink
+ llvm-jitlink-executor
+ llvm-lib
+ llvm-libtool-darwin
+ llvm-link
+ llvm-lipo
+ llvm-lto
+ llvm-lto2
+ llvm-mc
+ llvm-mca
+ llvm-ml
+ llvm-modextract
+ llvm-mt
+ llvm-nm
+ llvm-objcopy
+ llvm-objdump
+ llvm-opt-report
+ llvm-otool
+ llvm-pdbutil
+ llvm-profdata
+ llvm-profgen
+ llvm-ranlib
+ llvm-rc
+ llvm-readelf
+ llvm-readobj
+ llvm-readtapi
+ llvm-reduce
+ llvm-remarkutil
+ llvm-rtdyld
+ llvm-sim
+ llvm-size
+ llvm-split
+ llvm-stress
+ llvm-strings
+ llvm-strip
+ llvm-symbolizer
+ llvm-tli-checker
+ llvm-undname
+ llvm-windres
+ llvm-xray
+ obj2yaml
+ opt
+ sancov
+ sanstats
+ split-file
+ verify-uselistorder
+ yaml2obj
+
+ # python modules
+ opt-viewer
+ )
+
+ if llvm_are_manpages_built; then
+ out+=(
+ # manpages
+ docs-dsymutil-man
+ docs-llvm-dwarfdump-man
+ docs-llvm-man
+ )
+ fi
+ use doc && out+=(
+ docs-llvm-html
+ )
+
+ use binutils-plugin && out+=(
+ LLVMgold
+ )
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
+ 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/${LLVM_MAJOR}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=ON
+ -DLLVM_LINK_LLVM_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+
+ # 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_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=ON
+ -DLLVM_BUILD_TESTS=$(usex test)
+ -DLLVM_INSTALL_GTEST=ON
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_LIBXML2=$(usex xml)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+ -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ -DLLVM_ENABLE_CURL=$(usex debuginfod)
+ -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod)
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ # Smart hack: alter version suffix -> SOVERSION when linking
+ # against libc++. This way we won't end up mixing LLVM libc++
+ # libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
+ mycmakeargs+=(
+ -DLLVM_ENABLE_LIBCXX=ON
+ )
+ fi
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ fi
+
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=${build_docs}
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=${build_docs}
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use binutils-plugin && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ use kernel_Darwin && mycmakeargs+=(
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ -DTerminfo_LIBRARIES=-lncurses
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MAIN_MAJOR?"
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ tc-env_build cmake_build distribution
+
+ 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_build check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${LLVM_MAJOR}/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/${LLVM_MAJOR}/include || die
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
+ newenvd - "60llvm-${revord}" <<-_EOF_
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+ _EOF_
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+}
+
+pkg_postinst() {
+ elog "You can find additional opt-viewer utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
+ elog "To use these scripts, you will need Python along with the following"
+ elog "packages:"
+ elog " dev-python/pygments (for opt-viewer)"
+ elog " dev-python/pyyaml (for all of them)"
+}
diff --git a/sys-devel/llvm/metadata.xml b/sys-devel/llvm/metadata.xml
index c10c45dd8f21..1277d338a5de 100644
--- a/sys-devel/llvm/metadata.xml
+++ b/sys-devel/llvm/metadata.xml
@@ -11,13 +11,17 @@
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="binutils-plugin">Build the binutils plugin</flag>
+ <flag name="debuginfod">Install llvm-debuginfod (requires <pkg>net-misc/curl</pkg> and <pkg>dev-cpp/cpp-httplib</pkg>)</flag>
<flag name="doc">Build and install the HTML documentation and regenerate the man pages</flag>
<flag name="exegesis">Enable performance counter support for llvm-exegesis tool
that can be used to measure host machine instruction characteristics</flag>
- <flag name="gold">Build the binutils plugin</flag>
<flag name="ncurses">Support querying terminal properties using ncurses' terminfo</flag>
<flag name="xar">Support dumping LLVM bitcode sections in Mach-O files
(uses <pkg>app-arch/xar</pkg>)</flag>
<flag name="z3">Enable support for <pkg>sci-mathematics/z3</pkg> constraint solver</flag>
</use>
+ <upstream>
+ <remote-id type="github">llvm/llvm-project</remote-id>
+ <remote-id type="cpe">cpe:/a:llvm:llvm</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/llvmgold/llvmgold-11.ebuild b/sys-devel/llvmgold/llvmgold-15.ebuild
index db2354e9c210..484ce44cf3f7 100644
--- a/sys-devel/llvmgold/llvmgold-11.ebuild
+++ b/sys-devel/llvmgold/llvmgold-15.ebuild
@@ -1,21 +1,20 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
DESCRIPTION="LLVMgold plugin symlink for autoloading"
HOMEPAGE="https://llvm.org/"
-SRC_URI=""
+S=${WORKDIR}
LICENSE="public-domain"
SLOT="0"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux"
-IUSE=""
-
-RDEPEND="sys-devel/llvm:${PV}[gold]
- !sys-devel/llvm:0"
+KEYWORDS="amd64 arm arm64 ~ppc ppc64 ~riscv sparc x86 ~amd64-linux"
-S=${WORKDIR}
+RDEPEND="
+ sys-devel/llvm:${PV}[binutils-plugin]
+ !sys-devel/llvm:0
+"
src_install() {
dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
diff --git a/sys-devel/llvmgold/llvmgold-12.ebuild b/sys-devel/llvmgold/llvmgold-16.ebuild
index 39dbffdba3bc..5eca5d655d97 100644
--- a/sys-devel/llvmgold/llvmgold-12.ebuild
+++ b/sys-devel/llvmgold/llvmgold-16.ebuild
@@ -1,20 +1,20 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
DESCRIPTION="LLVMgold plugin symlink for autoloading"
HOMEPAGE="https://llvm.org/"
-SRC_URI=""
+S=${WORKDIR}
LICENSE="public-domain"
SLOT="0"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux"
-
-RDEPEND="sys-devel/llvm:${PV}[gold]
- !sys-devel/llvm:0"
+KEYWORDS="amd64 arm arm64 ~loong ~ppc ppc64 ~riscv sparc x86 ~amd64-linux"
-S=${WORKDIR}
+RDEPEND="
+ sys-devel/llvm:${PV}[binutils-plugin]
+ !sys-devel/llvm:0
+"
src_install() {
dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
diff --git a/sys-devel/llvmgold/llvmgold-13-r1.ebuild b/sys-devel/llvmgold/llvmgold-17.ebuild
index 62c9f1525439..ad52f2c99dcd 100644
--- a/sys-devel/llvmgold/llvmgold-13-r1.ebuild
+++ b/sys-devel/llvmgold/llvmgold-17.ebuild
@@ -1,24 +1,20 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
DESCRIPTION="LLVMgold plugin symlink for autoloading"
HOMEPAGE="https://llvm.org/"
-SRC_URI=""
+S=${WORKDIR}
LICENSE="public-domain"
SLOT="0"
-KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux"
+KEYWORDS="amd64 arm arm64 ~loong ~ppc ppc64 ~riscv sparc x86 ~amd64-linux"
RDEPEND="
- || (
- sys-devel/llvm:${PV}[binutils-plugin(-)]
- sys-devel/llvm:${PV}[gold(-)]
- )
- !sys-devel/llvm:0"
-
-S=${WORKDIR}
+ sys-devel/llvm:${PV}[binutils-plugin]
+ !sys-devel/llvm:0
+"
src_install() {
dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
diff --git a/sys-devel/llvmgold/llvmgold-18.ebuild b/sys-devel/llvmgold/llvmgold-18.ebuild
new file mode 100644
index 000000000000..c169127837a0
--- /dev/null
+++ b/sys-devel/llvmgold/llvmgold-18.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="LLVMgold plugin symlink for autoloading"
+HOMEPAGE="https://llvm.org/"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux"
+
+RDEPEND="
+ sys-devel/llvm:${PV}[binutils-plugin]
+ !sys-devel/llvm:0
+"
+
+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-14.ebuild b/sys-devel/llvmgold/llvmgold-19.ebuild
index 314063f9db83..cc4a41d311fc 100644
--- a/sys-devel/llvmgold/llvmgold-14.ebuild
+++ b/sys-devel/llvmgold/llvmgold-19.ebuild
@@ -1,22 +1,19 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="LLVMgold plugin symlink for autoloading"
HOMEPAGE="https://llvm.org/"
-SRC_URI=""
+S=${WORKDIR}
LICENSE="public-domain"
SLOT="0"
-KEYWORDS=""
-IUSE=""
-PROPERTIES="live"
-
-RDEPEND="sys-devel/llvm:${PV}[binutils-plugin]
- !sys-devel/llvm:0"
-S=${WORKDIR}
+RDEPEND="
+ sys-devel/llvm:${PV}[binutils-plugin]
+ !sys-devel/llvm:0
+"
src_install() {
dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
diff --git a/sys-devel/llvmgold/metadata.xml b/sys-devel/llvmgold/metadata.xml
index 3ad9b7a7c0eb..072910296ca3 100644
--- a/sys-devel/llvmgold/metadata.xml
+++ b/sys-devel/llvmgold/metadata.xml
@@ -4,4 +4,7 @@
<maintainer type="project">
<email>llvm@gentoo.org</email>
</maintainer>
+ <upstream>
+ <remote-id type="github">llvm/llvm-project</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/m4/Manifest b/sys-devel/m4/Manifest
index 7b0eef3c82b6..90afb460c0a7 100644
--- a/sys-devel/m4/Manifest
+++ b/sys-devel/m4/Manifest
@@ -1 +1,3 @@
+DIST m4-1.4.19-test-198-sysval-r1.patch.gz 6292 BLAKE2B 62f52c8bb75e7b8f11e487906f1ce47069ea6d3095fd6532aa6b47bcd8109b7cd733fde26915d449a1cfc326f27f5ed83ba29a5a80687b8b9bdb73c8d87e96b8 SHA512 c3e7d4c1631e401c6b5477c22fd5de837188acf9d72551b116c665a927d1799b1fb249e90c9fb4f6f2f328ee84b2e4dd0bf54f684139997c19ee5b69a3e9284d
DIST m4-1.4.19.tar.xz 1654908 BLAKE2B 08694485a49c542761fa9a7db4d7609f4dfb08a5c6b785b57f2e14cf1f696c2a1c788bb5eb934e8159a632b63ff071dfe42511d0109d7b1828f46d33c8bf416a SHA512 47f595845c89709727bda0b3fc78e3188ef78ec818965b395532e7041cabe9e49677ee4aca3d042930095a7f8df81de3da1026b23b6897be471f6cf13ddd512b
+DIST m4-1.4.19.tar.xz.sig 488 BLAKE2B 99e89b1ed0bf158d29a652392fb122e23227e895c75a8c63057ebe33f11b433ab205ae99a991578a89df8c3e723fc00669d8cdb290fbc86eaa6c704b112e4370 SHA512 d6ac9c6a54c57e9b53fb3e34a60d49df2f46a6e494da0a0c9ae8246b984e68a853b5d8c42677c1a0485c3f36b0bce10a481d3775c0edc1dbdfb27b43545bc31e
diff --git a/sys-devel/m4/files/loong-fix-build.patch b/sys-devel/m4/files/loong-fix-build.patch
new file mode 100644
index 000000000000..d5243357928b
--- /dev/null
+++ b/sys-devel/m4/files/loong-fix-build.patch
@@ -0,0 +1,30 @@
+[xen0n: this is https://github.com/sunhaiyong1978/CLFS-for-LoongArch/blob/1.0/patches/stack-direction-add-loongarch.patch with line number tweak, and change to generated file added as well.]
+From: Sun Haiyong <youbest@sina.com>
+Date: Tue, 31 Aug 2021 11:11:52 +0800
+Subject: [PATCH] stack-direction: Add support for loongarch CPU
+
+* m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is loongarch,
+set "sv_cv_stack_direction" to "-1" .
+--- a/m4/stack-direction.m4
++++ b/m4/stack-direction.m4
+@@ -31,6 +31,7 @@ AC_DEFUN([SV_STACK_DIRECTION],
+ i?86 | x86_64 | \
+ i860 | \
+ ia64 | \
++ loongarch* | \
+ m32r | \
+ m68* | \
+ m88k | \
+--- a/configure
++++ b/configure
+@@ -46399,6 +46399,7 @@ else $as_nop
+ i?86 | x86_64 | \
+ i860 | \
+ ia64 | \
++ loongarch* | \
+ m32r | \
+ m68* | \
+ m88k | \
+--
+2.17.2
+
diff --git a/sys-devel/m4/files/m4-1.4.19-fortify-source.patch b/sys-devel/m4/files/m4-1.4.19-fortify-source.patch
new file mode 100644
index 000000000000..d07fe620c3df
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.19-fortify-source.patch
@@ -0,0 +1,50 @@
+https://lists.gnu.org/archive/html/m4-patches/2023-01/msg00001.html
+https://bugs.gentoo.org/890273
+
+From 960b9b4d0774f78d286932251d6f53f638aefb19 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 9 Jan 2023 08:00:34 +0000
+Subject: [PATCH] build: Don't add _FORTIFY_SOURCE if already set by
+ user/toolchain
+
+Newer toolchains (GCC 12+ or Clang 9+, glibc-2.34) allow _FORTIFY_SOURCE=3.
+
+The current macro used in configure.ac will forcefully downgrade to F_S=2
+and emit a warning if the user set something else:
+```
+x86_64-pc-linux-gnu-gcc -DEXEEXT=\"\" -I. -I../lib -DIN_M4_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../lib -I./../lib -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type -ggdb3 -Werror=implicit-function-declaration -Werror=implicit-int -c -o glthread/thread.o glthread/thread.c
+In file included from glthread/thread.c:20:
+../lib/config.h:202: warning: "_FORTIFY_SOURCE" redefined
+ 202 | # define _FORTIFY_SOURCE 2
+ |
+<built-in>: note: this is the location of the previous definition
+```
+
+See: 390d259efe8e1c7e4b6babb4738fef7427416857
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/configure.ac
++++ b/configure.ac
+@@ -133,7 +133,9 @@ if test "$gl_gcc_warnings" = yes; then
+ [/* Enable compile-time and run-time bounds-checking, and some warnings,
+ without upsetting newer glibc. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
+- # define _FORTIFY_SOURCE 2
++ # ifndef _FORTIFY_SOURCE
++ # define _FORTIFY_SOURCE 2
++ # endif
+ #endif
+ ])
+ fi
+--- a/lib/config.hin
++++ b/lib/config.hin
+@@ -198,7 +198,9 @@
+ /* Enable compile-time and run-time bounds-checking, and some warnings,
+ without upsetting newer glibc. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
+- # define _FORTIFY_SOURCE 2
++ # ifndef _FORTIFY_SOURCE
++ # define _FORTIFY_SOURCE 2
++ # endif
+ #endif
+
+
diff --git a/sys-devel/m4/files/m4-1.4.19-make-4.4-tests.patch b/sys-devel/m4/files/m4-1.4.19-make-4.4-tests.patch
new file mode 100644
index 000000000000..f7bc3f0e9b35
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.19-make-4.4-tests.patch
@@ -0,0 +1,38 @@
+https://bugs.gentoo.org/879061
+
+https://savannah.gnu.org/bugs/index.php?63307 (make bug)
+https://savannah.gnu.org/support/?110767 (M4 bug)
+
+https://lists.gnu.org/archive/html/bug-m4/2022-11/msg00003.html
+https://savannah.gnu.org/support/download.php?file_id=53951
+
+From ed64def45d68b2af53f1d3d783cc98e9dbe2ff74 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex@linutronix.de>
+Date: Sat, 12 Nov 2022 15:18:41 +0100
+Subject: [PATCH] test-execute-main.c: set default handler for SIGPIPE in tests
+ 3 and 4
+
+make 4.4 sets this to SIG_IGN and the tests fail
+
+Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+--- a/tests/test-execute-main.c
++++ b/tests/test-execute-main.c
+@@ -132,6 +132,7 @@ main (int argc, char *argv[])
+ #if !(defined _WIN32 && !defined __CYGWIN__)
+ {
+ /* Check SIGPIPE handling with ignore_sigpipe = false. */
++ signal(SIGPIPE, SIG_DFL);
+ const char *prog_argv[3] = { prog_path, "3", NULL };
+ int termsig = 0x7DEADBEE;
+ int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+@@ -145,6 +146,7 @@ main (int argc, char *argv[])
+ #if !(defined _WIN32 && !defined __CYGWIN__)
+ {
+ /* Check SIGPIPE handling with ignore_sigpipe = true. */
++ signal(SIGPIPE, SIG_DFL);
+ const char *prog_argv[3] = { prog_path, "4", NULL };
+ int termsig = 0x7DEADBEE;
+ int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+--
+2.30.2
+
diff --git a/sys-devel/m4/files/m4-1.4.19-race-condition-tests.patch b/sys-devel/m4/files/m4-1.4.19-race-condition-tests.patch
new file mode 100644
index 000000000000..c212777dcd3e
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.19-race-condition-tests.patch
@@ -0,0 +1,34 @@
+https://lists.gnu.org/archive/html/bug-m4/2022-12/msg00000.html
+https://lists.gnu.org/archive/html/bug-m4/2022-12/txtmGJxjX3osy.txt
+
+Fix a sporadic failure of the test-posix_spawn-script test.
+
+From a3efddb96f5f121b8a5bb1310dc82407546fd255 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 22 Dec 2022 21:19:34 -0800
+Subject: [PATCH] posix_spawnp-tests: fix filename typo
+
+Problem reported for GNU m4 by Mitchell Dorrell in:
+https://lists.gnu.org/r/bug-m4/2022-12/msg00000.html
+* tests/test-posix_spawnp-script.c (DATA_FILENAME):
+Fix typo in file name that caused race with
+test-posix_spawn-script.c.
+---
+ tests/test-posix_spawnp-script.c | 2 +-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test-posix_spawnp-script.c b/tests/test-posix_spawnp-script.c
+index 1e5fc5c110..d2035ed63e 100644
+--- a/tests/test-posix_spawnp-script.c
++++ b/tests/test-posix_spawnp-script.c
+@@ -28,7 +28,7 @@
+
+ #include "macros.h"
+
+-#define DATA_FILENAME "test-posix_spawn-script.tmp"
++#define DATA_FILENAME "test-posix_spawnp-script.tmp"
+
+ int
+ main ()
+--
+2.25.1
diff --git a/sys-devel/m4/files/ppc-musl.patch b/sys-devel/m4/files/ppc-musl.patch
index d7d8255a444a..4aff0ba1cf5c 100644
--- a/sys-devel/m4/files/ppc-musl.patch
+++ b/sys-devel/m4/files/ppc-musl.patch
@@ -1,7 +1,8 @@
-Needed to fix build on ppc + musl. Doesn't seem to yet be in upstream gnulib.
+Needed to fix build on ppc + musl. Should pop up in next gnulib sync in release (different patch).
https://www.openwall.com/lists/musl/2017/11/05/2
https://github.com/void-linux/void-packages/blob/master/srcpkgs/grep/patches/ppc-musl.patch
+https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=2d830e4a792fcd9f614ed08a7f18584b8b21d23b
--- a/lib/sigsegv.c
+++ b/lib/sigsegv.c
@@ -221,8 +221,10 @@ int libsigsegv_version = LIBSIGSEGV_VERSION;
diff --git a/sys-devel/m4/m4-1.4.19-r2.ebuild b/sys-devel/m4/m4-1.4.19-r2.ebuild
new file mode 100644
index 000000000000..6c21702d71ba
--- /dev/null
+++ b/sys-devel/m4/m4-1.4.19-r2.ebuild
@@ -0,0 +1,100 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/m4.asc
+inherit verify-sig
+
+DESCRIPTION="GNU macro processor"
+HOMEPAGE="https://www.gnu.org/software/m4/m4.html"
+if [[ ${PV} == *_beta* ]] ; then
+ MY_P="${PN}-1.4.18d"
+ SRC_URI="https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz"
+ SRC_URI+=" verify-sig? ( https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz.sig )"
+ S="${WORKDIR}/${MY_P}"
+else
+ SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
+ SRC_URI+=" https://dev.gentoo.org/~floppym/dist/${P}-test-198-sysval-r1.patch.gz"
+ SRC_URI+=" verify-sig? ( mirror://gnu/${PN}/${P}.tar.xz.sig )"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="examples nls"
+
+RDEPEND="
+ virtual/libiconv
+ nls? (
+ sys-devel/gettext
+ virtual/libintl
+ )"
+DEPEND="${RDEPEND}"
+# Remember: cannot dep on autoconf since it needs us
+BDEPEND="app-arch/xz-utils
+ nls? ( sys-devel/gettext )
+ verify-sig? ( sec-keys/openpgp-keys-m4 )"
+
+PATCHES=(
+ "${FILESDIR}"/ppc-musl.patch
+ "${FILESDIR}"/loong-fix-build.patch
+ "${FILESDIR}"/${PN}-1.4.19-make-4.4-tests.patch
+ "${WORKDIR}"/${P}-test-198-sysval-r1.patch
+ "${FILESDIR}"/${P}-fortify-source.patch
+ "${FILESDIR}"/${P}-race-condition-tests.patch
+)
+
+src_unpack() {
+ if use verify-sig ; then
+ # Needed for downloaded patch (which is unsigned, which is fine)
+ verify-sig_verify_detached "${DISTDIR}"/${P}.tar.xz{,.sig}
+ fi
+
+ default
+}
+
+src_prepare() {
+ default
+
+ # touch generated files after patching m4, to avoid activating maintainer
+ # mode
+ # remove when loong-fix-build.patch is no longer necessary
+ touch ./aclocal.m4 ./lib/config.hin ./configure ./doc/stamp-vti || die
+ find . -name Makefile.in -exec touch {} + || die
+}
+
+src_configure() {
+ local -a myeconfargs=(
+ --enable-changeword
+
+ --with-packager="Gentoo Linux"
+ --with-packager-version="${PVR}"
+ --with-packager-bug-reports="https://bugs.gentoo.org/"
+
+ $(usex nls '' '--disable-nls')
+
+ # Disable automagic dependency over libsigsegv; see bug #278026
+ ac_cv_libsigsegv=no
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+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 m4 /usr/bin/gm4
+
+ if use examples ; then
+ dodoc -r examples
+ rm -f "${ED}"/usr/share/doc/${PF}/examples/Makefile*
+ fi
+}
diff --git a/sys-devel/m4/m4-1.4.19.ebuild b/sys-devel/m4/m4-1.4.19.ebuild
deleted file mode 100644
index 96bbad225664..000000000000
--- a/sys-devel/m4/m4-1.4.19.ebuild
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-DESCRIPTION="GNU macro processor"
-HOMEPAGE="https://www.gnu.org/software/m4/m4.html"
-if [[ "${PV}" == *_beta* ]] ; then
- MY_P="${PN}-1.4.18d"
- #SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
- SRC_URI="https://alpha.gnu.org/gnu/${PN}/${MY_P}.tar.xz"
- S="${WORKDIR}/${MY_P}"
-else
- SRC_URI="mirror://gnu/${PN}/${P}.tar.xz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-fi
-
-LICENSE="GPL-3"
-SLOT="0"
-IUSE="examples nls"
-
-RDEPEND="
- virtual/libiconv
- nls? (
- sys-devel/gettext
- virtual/libintl
- )"
-DEPEND="${RDEPEND}"
-# Remember: cannot dep on autoconf since it needs us
-BDEPEND="app-arch/xz-utils
- nls? ( sys-devel/gettext )"
-
-PATCHES=( "${FILESDIR}/ppc-musl.patch" )
-
-src_configure() {
- local -a myeconfargs=(
- --enable-changeword
-
- --with-packager="Gentoo Linux"
- --with-packager-version="${PVR}"
- --with-packager-bug-reports="https://bugs.gentoo.org/"
-
- $(usex nls '' '--disable-nls')
-
- # Disable automagic dependency over libsigsegv; see bug #278026
- ac_cv_libsigsegv=no
- )
-
- [[ ${USERLAND} != GNU ]] && myeconfargs+=( --program-prefix=g )
-
- econf "${myeconfargs[@]}"
-}
-
-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 m4 /usr/bin/gm4
-
- if use examples ; then
- dodoc -r 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
index 73dda144f9ac..dce0ffc83fe5 100644
--- a/sys-devel/m4/metadata.xml
+++ b/sys-devel/m4/metadata.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<maintainer type="project">
- <email>base-system@gentoo.org</email>
- <name>Gentoo Base System</name>
-</maintainer>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="savannah">m4</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/make/Manifest b/sys-devel/make/Manifest
deleted file mode 100644
index 34d9f6842b0f..000000000000
--- a/sys-devel/make/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST make-4.3.tar.gz 2317073 BLAKE2B 5a82ce1f30eb034366ac3b87d2ec6698aae17d7b1a611941cf42136b2453b34236ab55382eab0a593c43cee8b036ba4a054f966c41ba766fdbd2862942be5dff SHA512 9a1185cc468368f4ec06478b1cfa343bf90b5cd7c92c0536567db0315b0ee909af53ecce3d44cfd93dd137dbca1ed13af5713e8663590c4fdd21ea635d78496b
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
deleted file mode 100644
index d2f60ec91cc0..000000000000
--- a/sys-devel/make/files/make-3.82-darwin-library_search-dylib.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Fixed default libpatttern on Darwin, imported from prefix overlay.
-Got merged upstream:
-https://savannah.gnu.org/bugs/?37197
---- a/default.c
-+++ b/default.c
-@@ -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-4.2-default-cxx.patch b/sys-devel/make/files/make-4.2-default-cxx.patch
deleted file mode 100644
index 4d592086a6ff..000000000000
--- a/sys-devel/make/files/make-4.2-default-cxx.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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-4.3.ebuild b/sys-devel/make/make-4.3.ebuild
deleted file mode 100644
index bd0a3434e14e..000000000000
--- a/sys-devel/make/make-4.3.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit flag-o-matic
-
-DESCRIPTION="Standard tool to compile source trees"
-HOMEPAGE="https://www.gnu.org/software/make/make.html"
-if [[ "$(ver_cut 3)" -ge 90 ]] ; then
- SRC_URI="https://alpha.gnu.org/gnu//make/${P}.tar.gz"
-else
- SRC_URI="mirror://gnu//make/${P}.tar.gz"
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-fi
-LICENSE="GPL-3+"
-SLOT="0"
-IUSE="guile nls static"
-
-DEPEND="guile? ( >=dev-scheme/guile-1.8:= )"
-BDEPEND="nls? ( sys-devel/gettext )"
-RDEPEND="${DEPEND}
- nls? ( virtual/libintl )"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-3.82-darwin-library_search-dylib.patch
- "${FILESDIR}"/${PN}-4.2-default-cxx.patch
-)
-
-src_prepare() {
- # sources were moved into src directory
- cd src || die
- default
-}
-
-src_configure() {
- use static && append-ldflags -static
- local myeconfargs=(
- --program-prefix=g
- $(use_with guile)
- $(use_enable nls)
- )
- econf "${myeconfargs[@]}"
-}
-
-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
deleted file mode 100644
index 1e62dd910293..000000000000
--- a/sys-devel/make/metadata.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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="cpe">cpe:/a:gnu:make</remote-id>
-</upstream>
-</pkgmetadata>
diff --git a/sys-devel/mold/Manifest b/sys-devel/mold/Manifest
index 79667690384d..c1d532776618 100644
--- a/sys-devel/mold/Manifest
+++ b/sys-devel/mold/Manifest
@@ -1,2 +1,4 @@
-DIST mold-1.0.0.tar.gz 3482927 BLAKE2B 56ebc267370548a2f91a71ebeed87871cede6f564c29dc7d44a499b95fe570f6e9c8a717baf2d9e235c7057c41e735b315493bd23d3b44574d2a44b14aaf5ef8 SHA512 99ffd0b9e2ff7157cc8b26808675c9d3147bf88961155ae19ed9b99990ac647b7ec31ee78d05062decc6d41e66d99aa0fdc398d119803929b8dbff51eb3d077c
-DIST mold-1.0.1.tar.gz 3675262 BLAKE2B 0e40860d3c0a221d368c94b9f58c20b245ee61de6f9eb6d1454ed3b6f103933c79ddd7358049e2aacf497221232d952c2117ba2b3371cbe37fb8ad4ae42461c2 SHA512 cc03a7db395362b97879c28942397d4443d12b72e067b6f979b1ece4d8aab06154b4c1a0f4c57d6ac505bcd4f892bf9a355ad281d628d4d544d8f70edaf34b72
+DIST mold-2.1.0.tar.gz 9278811 BLAKE2B b31e13f92177553adf5069cf35c8c75c7bc28f0af4d1726cdc0c6abc1c9d3baaa5be512c3a8fb9bc3c3110096a79e1c6751c701171769595a2234fc1fa8c441a SHA512 f1c98d349b35b4042109d71f7db6eb8d7d089dc3241735bbd7b5402d513dcc85ca17904828779e5fc8234650fa9fb97f47c3a2f3e89cc2fb3cb9e9110439e5a2
+DIST mold-2.30.0.tar.gz 9957539 BLAKE2B f45924598029dabfb2c02298e1f89aae848cd64e2e87dd80f500de323517db92e62df798feee8a2cd81cb930eff0640c2b9957808a4080f0027884015994ce64 SHA512 7cfba4f0fb332799ad267d3eafb8e2f0057af4484467b3e3fbaf8044220163a2c7e26cd1786510f250844c8b57e30c15167c8dd9688af1773abc580c5605abf3
+DIST mold-2.4.0.tar.gz 9974233 BLAKE2B 0710d9ce0407b64b05a23e04db142d603b38d41cd9e5e322b650680ee2bd8684f57647e9a0b5efc23b2106eb1e38e38143be7d4b357b2d32e4fe0b6a99e41cca SHA512 e332d027f783dfb0a4f48b1fb7daf98e11e830f8de82b971b58ee8a7bae59eaa30b8155e7491b6057f0ce8e0b09ddd0ab1d364f01ea15517e1d089fdb292a4e5
+DIST mold-2.4.1.tar.gz 9957259 BLAKE2B 17aab84c0793dc305d53a3c2f372ddc92395b6941ffe372af55cf94f4dd65ea8d63d4e85dcdb3e76622811e5f95577d6f10612102c373835d6f75f2a3d0bcfed SHA512 d61ee4306ecaa6ba5b4ce120636e70db081bb824a482bb3014429e13294134bc2560b1a9b477c47378f1062107f1c32dba2810e41be199cd6882cd1146971245
diff --git a/sys-devel/mold/files/mold-2.3.0-no-pch.patch b/sys-devel/mold/files/mold-2.3.0-no-pch.patch
new file mode 100644
index 000000000000..e61b5df01f54
--- /dev/null
+++ b/sys-devel/mold/files/mold-2.3.0-no-pch.patch
@@ -0,0 +1,12 @@
+We generally disable PCH in Gentoo because of how buggy it is.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -400,7 +400,7 @@ endif()
+
+ # Add frequently included header files for pre-compiling.
+ # target_precompile_headers is supported by CMake 3.16.0 or newer.
+-if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
++if(FALSE)
+ if(MOLD_IS_SOLD)
+ target_precompile_headers(mold PRIVATE
+ "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/elf/mold.h>"
diff --git a/sys-devel/mold/metadata.xml b/sys-devel/mold/metadata.xml
index 42610750e82e..f8a85299d5bb 100644
--- a/sys-devel/mold/metadata.xml
+++ b/sys-devel/mold/metadata.xml
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>sam@gentoo.org</email>
<name>Sam James</name>
</maintainer>
+ <maintainer type="person">
+ <email>matthew@gentoo.org</email>
+ <name>Matthew Smith</name>
+ </maintainer>
<upstream>
<remote-id type="github">rui314/mold</remote-id>
</upstream>
diff --git a/sys-devel/mold/mold-1.0.0-r1.ebuild b/sys-devel/mold/mold-1.0.0-r1.ebuild
deleted file mode 100644
index 767cc5c80f54..000000000000
--- a/sys-devel/mold/mold-1.0.0-r1.ebuild
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit toolchain-funcs
-
-DESCRIPTION="A Modern Linker"
-HOMEPAGE="https://github.com/rui314/mold"
-if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://github.com/rui314/mold.git"
- inherit git-r3
-else
- SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
- KEYWORDS="~amd64"
-fi
-
-LICENSE="AGPL-3"
-SLOT="0"
-
-# Try again after 1.0 (nearly there, but path-related issues)
-# https://github.com/rui314/mold/issues/137
-RESTRICT="test"
-
-RDEPEND=">=dev-cpp/tbb-2021.4.0:=
- dev-libs/xxhash:=
- sys-libs/zlib
- !kernel_Darwin? (
- <dev-libs/mimalloc-2:=
- dev-libs/openssl:=
- )"
-DEPEND="${RDEPEND}"
-
-src_prepare() {
- default
-
- # Needs unpackaged dwarfdump
- rm test/elf/{compress-debug-sections.sh,compressed-debug-info.sh} || die
-}
-
-src_compile() {
- tc-export CC CXX
-
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- STRIP="true" \
- LIBDIR="${EPREFIX}/usr/$(get_libdir)"
-}
-
-src_test() {
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- check
-}
-
-src_install() {
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- DESTDIR="${ED}" \
- PREFIX="${EPREFIX}/usr" \
- LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
- STRIP="true" \
- install
-}
diff --git a/sys-devel/mold/mold-1.0.1.ebuild b/sys-devel/mold/mold-1.0.1.ebuild
deleted file mode 100644
index 9751b231a53f..000000000000
--- a/sys-devel/mold/mold-1.0.1.ebuild
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright 2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit toolchain-funcs
-
-DESCRIPTION="A Modern Linker"
-HOMEPAGE="https://github.com/rui314/mold"
-if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://github.com/rui314/mold.git"
- inherit git-r3
-else
- SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
- KEYWORDS="~amd64"
-fi
-
-LICENSE="AGPL-3"
-SLOT="0"
-
-# Try again after 1.0 (nearly there, but path-related issues)
-# https://github.com/rui314/mold/issues/137
-RESTRICT="test"
-
-RDEPEND=">=dev-cpp/tbb-2021.4.0:=
- dev-libs/xxhash:=
- sys-libs/zlib
- !kernel_Darwin? (
- >=dev-libs/mimalloc-2:=
- dev-libs/openssl:=
- )"
-DEPEND="${RDEPEND}"
-
-src_prepare() {
- default
-
- # Needs unpackaged dwarfdump
- rm test/elf/{compress-debug-sections,compressed-debug-info}.sh || die
-}
-
-src_compile() {
- tc-export CC CXX
-
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- SYSTEM_XXHASH=1 \
- STRIP="true" \
- LIBDIR="${EPREFIX}/usr/$(get_libdir)"
-}
-
-src_test() {
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- check
-}
-
-src_install() {
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- SYSTEM_XXHASH=1 \
- DESTDIR="${ED}" \
- PREFIX="${EPREFIX}/usr" \
- LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
- STRIP="true" \
- install
-}
diff --git a/sys-devel/mold/mold-2.1.0.ebuild b/sys-devel/mold/mold-2.1.0.ebuild
new file mode 100644
index 000000000000..4140d61806dd
--- /dev/null
+++ b/sys-devel/mold/mold-2.1.0.ebuild
@@ -0,0 +1,89 @@
+# Copyright 2021-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="A Modern Linker"
+HOMEPAGE="https://github.com/rui314/mold"
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/rui314/mold.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="amd64 ~arm64 ~loong ~ppc64 ~riscv ~x86"
+fi
+
+# mold (MIT)
+# - xxhash (BSD-2)
+LICENSE="MIT BSD-2"
+SLOT="0"
+
+RDEPEND="
+ app-arch/zstd:=
+ >=dev-cpp/tbb-2021.7.0-r1:=
+ sys-libs/zlib
+ !kernel_Darwin? (
+ >=dev-libs/mimalloc-2:=
+ dev-libs/openssl:=
+ )
+"
+DEPEND="${RDEPEND}"
+
+pkg_pretend() {
+ # Requires a c++20 compiler, see #831473
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then
+ die "${PN} needs at least gcc 10"
+ elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then
+ die "${PN} needs at least clang 12"
+ fi
+ fi
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ # Needs unpackaged dwarfdump
+ rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
+
+ # Heavy tests, need qemu
+ rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die
+ rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die
+
+ # Sandbox sadness
+ rm test/elf/run.sh || die
+ sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \
+ test/elf/mold-wrapper{,2}.sh || die
+
+ # static-pie tests require glibc built with static-pie support
+ if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then
+ rm test/elf/{,ifunc-}static-pie.sh || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DMOLD_ENABLE_QEMU_TESTS=OFF
+ -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
+ -DMOLD_USE_SYSTEM_MIMALLOC=ON
+ -DMOLD_USE_SYSTEM_TBB=ON
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ dobin "${BUILD_DIR}"/${PN}
+
+ # https://bugs.gentoo.org/872773
+ insinto /usr/$(get_libdir)/mold
+ doins "${BUILD_DIR}"/${PN}-wrapper.so
+
+ dodoc docs/{design,execstack}.md
+ doman docs/${PN}.1
+
+ dosym ${PN} /usr/bin/ld.${PN}
+ dosym ${PN} /usr/bin/ld64.${PN}
+ dosym ../../../usr/bin/${PN} /usr/libexec/${PN}/ld
+}
diff --git a/sys-devel/mold/mold-2.30.0.ebuild b/sys-devel/mold/mold-2.30.0.ebuild
new file mode 100644
index 000000000000..ac067b811ef2
--- /dev/null
+++ b/sys-devel/mold/mold-2.30.0.ebuild
@@ -0,0 +1,99 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="A Modern Linker"
+HOMEPAGE="https://github.com/rui314/mold"
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/rui314/mold.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
+fi
+
+# mold (MIT)
+# - xxhash (BSD-2)
+LICENSE="MIT BSD-2"
+SLOT="0"
+
+RDEPEND="
+ app-arch/zstd:=
+ >=dev-cpp/tbb-2021.7.0-r1:=
+ dev-libs/blake3:=
+ sys-libs/zlib
+ !kernel_Darwin? (
+ >=dev-libs/mimalloc-2:=
+ )
+"
+DEPEND="${RDEPEND}"
+
+pkg_pretend() {
+ # Requires a c++20 compiler, see #831473
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then
+ die "${PN} needs at least gcc 10"
+ elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then
+ die "${PN} needs at least clang 12"
+ fi
+ fi
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ # Needs unpackaged dwarfdump
+ rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
+
+ # Heavy tests, need qemu
+ rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die
+ rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die
+
+ # Sandbox sadness
+ rm test/elf/run.sh || die
+ sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \
+ test/elf/mold-wrapper{,2}.sh || die
+
+ # static-pie tests require glibc built with static-pie support
+ if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then
+ rm test/elf/{,ifunc-}static-pie.sh || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
+ -DMOLD_ENABLE_QEMU_TESTS=OFF
+ -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
+ -DMOLD_USE_MIMALLOC=$(usex !kernel_Darwin)
+ -DMOLD_USE_SYSTEM_MIMALLOC=ON
+ -DMOLD_USE_SYSTEM_TBB=ON
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ dobin "${BUILD_DIR}"/${PN}
+
+ # https://bugs.gentoo.org/872773
+ insinto /usr/$(get_libdir)/mold
+ doins "${BUILD_DIR}"/${PN}-wrapper.so
+
+ dodoc docs/{design,execstack}.md
+ doman docs/${PN}.1
+
+ dosym ${PN} /usr/bin/ld.${PN}
+ dosym ${PN} /usr/bin/ld64.${PN}
+ dosym -r /usr/bin/${PN} /usr/libexec/${PN}/ld
+}
+
+src_test() {
+ export TEST_CC="$(tc-getCC)" \
+ TEST_GCC="$(tc-getCC)" \
+ TEST_CXX="$(tc-getCXX)" \
+ TEST_GXX="$(tc-getCXX)"
+ cmake_src_test
+}
diff --git a/sys-devel/mold/mold-2.4.0.ebuild b/sys-devel/mold/mold-2.4.0.ebuild
new file mode 100644
index 000000000000..52d41ed470e9
--- /dev/null
+++ b/sys-devel/mold/mold-2.4.0.ebuild
@@ -0,0 +1,103 @@
+# Copyright 2021-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="A Modern Linker"
+HOMEPAGE="https://github.com/rui314/mold"
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/rui314/mold.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="amd64 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
+fi
+
+# mold (MIT)
+# - xxhash (BSD-2)
+LICENSE="MIT BSD-2"
+SLOT="0"
+
+RDEPEND="
+ app-arch/zstd:=
+ >=dev-cpp/tbb-2021.7.0-r1:=
+ dev-libs/blake3:=
+ sys-libs/zlib
+ !kernel_Darwin? (
+ >=dev-libs/mimalloc-2:=
+ )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.3.0-no-pch.patch
+)
+
+pkg_pretend() {
+ # Requires a c++20 compiler, see #831473
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then
+ die "${PN} needs at least gcc 10"
+ elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then
+ die "${PN} needs at least clang 12"
+ fi
+ fi
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ # Needs unpackaged dwarfdump
+ rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
+
+ # Heavy tests, need qemu
+ rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die
+ rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die
+
+ # Sandbox sadness
+ rm test/elf/run.sh || die
+ sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \
+ test/elf/mold-wrapper{,2}.sh || die
+
+ # static-pie tests require glibc built with static-pie support
+ if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then
+ rm test/elf/{,ifunc-}static-pie.sh || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
+ -DMOLD_ENABLE_QEMU_TESTS=OFF
+ -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
+ -DMOLD_USE_MIMALLOC=$(usex !kernel_Darwin)
+ -DMOLD_USE_SYSTEM_MIMALLOC=ON
+ -DMOLD_USE_SYSTEM_TBB=ON
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ dobin "${BUILD_DIR}"/${PN}
+
+ # https://bugs.gentoo.org/872773
+ insinto /usr/$(get_libdir)/mold
+ doins "${BUILD_DIR}"/${PN}-wrapper.so
+
+ dodoc docs/{design,execstack}.md
+ doman docs/${PN}.1
+
+ dosym ${PN} /usr/bin/ld.${PN}
+ dosym ${PN} /usr/bin/ld64.${PN}
+ dosym -r /usr/bin/${PN} /usr/libexec/${PN}/ld
+}
+
+src_test() {
+ export TEST_CC="$(tc-getCC)" \
+ TEST_GCC="$(tc-getCC)" \
+ TEST_CXX="$(tc-getCXX)" \
+ TEST_GXX="$(tc-getCXX)"
+ cmake_src_test
+}
diff --git a/sys-devel/mold/mold-2.4.1.ebuild b/sys-devel/mold/mold-2.4.1.ebuild
new file mode 100644
index 000000000000..ac067b811ef2
--- /dev/null
+++ b/sys-devel/mold/mold-2.4.1.ebuild
@@ -0,0 +1,99 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="A Modern Linker"
+HOMEPAGE="https://github.com/rui314/mold"
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/rui314/mold.git"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
+fi
+
+# mold (MIT)
+# - xxhash (BSD-2)
+LICENSE="MIT BSD-2"
+SLOT="0"
+
+RDEPEND="
+ app-arch/zstd:=
+ >=dev-cpp/tbb-2021.7.0-r1:=
+ dev-libs/blake3:=
+ sys-libs/zlib
+ !kernel_Darwin? (
+ >=dev-libs/mimalloc-2:=
+ )
+"
+DEPEND="${RDEPEND}"
+
+pkg_pretend() {
+ # Requires a c++20 compiler, see #831473
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then
+ die "${PN} needs at least gcc 10"
+ elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then
+ die "${PN} needs at least clang 12"
+ fi
+ fi
+}
+
+src_prepare() {
+ cmake_src_prepare
+
+ # Needs unpackaged dwarfdump
+ rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
+
+ # Heavy tests, need qemu
+ rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die
+ rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die
+
+ # Sandbox sadness
+ rm test/elf/run.sh || die
+ sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \
+ test/elf/mold-wrapper{,2}.sh || die
+
+ # static-pie tests require glibc built with static-pie support
+ if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then
+ rm test/elf/{,ifunc-}static-pie.sh || die
+ fi
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
+ -DMOLD_ENABLE_QEMU_TESTS=OFF
+ -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
+ -DMOLD_USE_MIMALLOC=$(usex !kernel_Darwin)
+ -DMOLD_USE_SYSTEM_MIMALLOC=ON
+ -DMOLD_USE_SYSTEM_TBB=ON
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ dobin "${BUILD_DIR}"/${PN}
+
+ # https://bugs.gentoo.org/872773
+ insinto /usr/$(get_libdir)/mold
+ doins "${BUILD_DIR}"/${PN}-wrapper.so
+
+ dodoc docs/{design,execstack}.md
+ doman docs/${PN}.1
+
+ dosym ${PN} /usr/bin/ld.${PN}
+ dosym ${PN} /usr/bin/ld64.${PN}
+ dosym -r /usr/bin/${PN} /usr/libexec/${PN}/ld
+}
+
+src_test() {
+ export TEST_CC="$(tc-getCC)" \
+ TEST_GCC="$(tc-getCC)" \
+ TEST_CXX="$(tc-getCXX)" \
+ TEST_GXX="$(tc-getCXX)"
+ cmake_src_test
+}
diff --git a/sys-devel/mold/mold-9999.ebuild b/sys-devel/mold/mold-9999.ebuild
index 9751b231a53f..ac067b811ef2 100644
--- a/sys-devel/mold/mold-9999.ebuild
+++ b/sys-devel/mold/mold-9999.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2021 Gentoo Authors
+# Copyright 2021-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-inherit toolchain-funcs
+inherit cmake toolchain-funcs
DESCRIPTION="A Modern Linker"
HOMEPAGE="https://github.com/rui314/mold"
@@ -12,58 +12,88 @@ if [[ ${PV} == 9999 ]] ; then
inherit git-r3
else
SRC_URI="https://github.com/rui314/mold/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
- KEYWORDS="~amd64"
+ KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~sparc ~x86"
fi
-LICENSE="AGPL-3"
+# mold (MIT)
+# - xxhash (BSD-2)
+LICENSE="MIT BSD-2"
SLOT="0"
-# Try again after 1.0 (nearly there, but path-related issues)
-# https://github.com/rui314/mold/issues/137
-RESTRICT="test"
-
-RDEPEND=">=dev-cpp/tbb-2021.4.0:=
- dev-libs/xxhash:=
+RDEPEND="
+ app-arch/zstd:=
+ >=dev-cpp/tbb-2021.7.0-r1:=
+ dev-libs/blake3:=
sys-libs/zlib
!kernel_Darwin? (
>=dev-libs/mimalloc-2:=
- dev-libs/openssl:=
- )"
+ )
+"
DEPEND="${RDEPEND}"
+pkg_pretend() {
+ # Requires a c++20 compiler, see #831473
+ if [[ ${MERGE_TYPE} != binary ]]; then
+ if tc-is-gcc && [[ $(gcc-major-version) -lt 10 ]]; then
+ die "${PN} needs at least gcc 10"
+ elif tc-is-clang && [[ $(clang-major-version) -lt 12 ]]; then
+ die "${PN} needs at least clang 12"
+ fi
+ fi
+}
+
src_prepare() {
- default
+ cmake_src_prepare
# Needs unpackaged dwarfdump
- rm test/elf/{compress-debug-sections,compressed-debug-info}.sh || die
-}
+ rm test/elf/{{dead,compress}-debug-sections,compressed-debug-info}.sh || die
+
+ # Heavy tests, need qemu
+ rm test/elf/gdb-index-{compress-output,dwarf{2,3,4,5}}.sh || die
+ rm test/elf/lto-{archive,dso,gcc,llvm,version-script}.sh || die
-src_compile() {
- tc-export CC CXX
+ # Sandbox sadness
+ rm test/elf/run.sh || die
+ sed -i 's|`pwd`/mold-wrapper.so|"& ${LD_PRELOAD}"|' \
+ test/elf/mold-wrapper{,2}.sh || die
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- SYSTEM_XXHASH=1 \
- STRIP="true" \
- LIBDIR="${EPREFIX}/usr/$(get_libdir)"
+ # static-pie tests require glibc built with static-pie support
+ if ! has_version -d 'sys-libs/glibc[static-pie(+)]'; then
+ rm test/elf/{,ifunc-}static-pie.sh || die
+ fi
}
-src_test() {
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- check
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
+ -DMOLD_ENABLE_QEMU_TESTS=OFF
+ -DMOLD_LTO=OFF # Should be up to the user to decide this with CXXFLAGS.
+ -DMOLD_USE_MIMALLOC=$(usex !kernel_Darwin)
+ -DMOLD_USE_SYSTEM_MIMALLOC=ON
+ -DMOLD_USE_SYSTEM_TBB=ON
+ )
+ cmake_src_configure
}
src_install() {
- emake \
- SYSTEM_TBB=1 \
- SYSTEM_MIMALLOC=1 \
- SYSTEM_XXHASH=1 \
- DESTDIR="${ED}" \
- PREFIX="${EPREFIX}/usr" \
- LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
- STRIP="true" \
- install
+ dobin "${BUILD_DIR}"/${PN}
+
+ # https://bugs.gentoo.org/872773
+ insinto /usr/$(get_libdir)/mold
+ doins "${BUILD_DIR}"/${PN}-wrapper.so
+
+ dodoc docs/{design,execstack}.md
+ doman docs/${PN}.1
+
+ dosym ${PN} /usr/bin/ld.${PN}
+ dosym ${PN} /usr/bin/ld64.${PN}
+ dosym -r /usr/bin/${PN} /usr/libexec/${PN}/ld
+}
+
+src_test() {
+ export TEST_CC="$(tc-getCC)" \
+ TEST_GCC="$(tc-getCC)" \
+ TEST_CXX="$(tc-getCXX)" \
+ TEST_GXX="$(tc-getCXX)"
+ cmake_src_test
}
diff --git a/sys-devel/native-cctools/files/aix-2/ld b/sys-devel/native-cctools/files/aix-2/ld
deleted file mode 100644
index 8f9841ef32ee..000000000000
--- a/sys-devel/native-cctools/files/aix-2/ld
+++ /dev/null
@@ -1,143 +0,0 @@
-#! /usr/bin/env /bin/ksh
-# Copyright 1999-2018 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
- case ${arg} in
- -rpath=*)
- arg="-R${arg#-rpath=}"
- ;;
- esac
- 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
deleted file mode 100644
index 4e79e4647b06..000000000000
--- a/sys-devel/native-cctools/files/aix-2/mkexpfile
+++ /dev/null
@@ -1,70 +0,0 @@
-#! /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
deleted file mode 100644
index 5ba1d650d23a..000000000000
--- a/sys-devel/native-cctools/files/aix-2/nm
+++ /dev/null
@@ -1,6 +0,0 @@
-#! /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/native-cctools-4.ebuild b/sys-devel/native-cctools/native-cctools-4.ebuild
deleted file mode 100644
index f961a43cc039..000000000000
--- a/sys-devel/native-cctools/native-cctools-4.ebuild
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# 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-macos ~x64-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}
-
- # 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/native-cctools/native-cctools-5.ebuild b/sys-devel/native-cctools/native-cctools-5-r1.ebuild
index 821c9fafacdf..6ebf381895db 100644
--- a/sys-devel/native-cctools/native-cctools-5.ebuild
+++ b/sys-devel/native-cctools/native-cctools-5-r1.ebuild
@@ -1,9 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI="6"
-
-inherit eutils
+EAPI="8"
DESCRIPTION="Host OS native assembler as and static linker ld"
HOMEPAGE="https://prefix.gentoo.org/"
@@ -12,9 +10,7 @@ SRC_URI=""
LICENSE="GPL-2" # actually, we don't know, the wrapper is
SLOT="0"
-AIX_V='aix-2'
-
-KEYWORDS="~ppc-macos ~x64-macos ~x64-solaris ~x86-solaris"
+KEYWORDS="~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE=""
@@ -39,18 +35,9 @@ src_install() {
*-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*)
+ *-apple-darwin*)
nativepath=/usr/bin
;;
- *-interix*)
- nativepath=/opt/gcc.3.3/bin
- ;;
*)
die "Don't know where the native linker for your platform is"
;;
diff --git a/sys-devel/nvptx-tools/Manifest b/sys-devel/nvptx-tools/Manifest
new file mode 100644
index 000000000000..59a28d80175c
--- /dev/null
+++ b/sys-devel/nvptx-tools/Manifest
@@ -0,0 +1 @@
+DIST nvptx-tools-0_pre20230122.tar.gz 789116 BLAKE2B f05b922827c0215a2484c4f91f3424ca866bb91435a3d60559fc9f1f63c06559377f1c8071c9e8e5607ec4dbff1c22d095385ac86d35f43ade29d9df6699f3ff SHA512 9d3bceef2ef7942ea6ec8b6c6b1b9144f0a020bfabc2583ba4ef73db8ef299ffadbc6dbe27748c728bd16aee0ecd6f0fbe1f8bb064bde986bb4e0475b2494870
diff --git a/sys-devel/autoconf-archive/metadata.xml b/sys-devel/nvptx-tools/metadata.xml
index de9d78424186..26ea6434862c 100644
--- a/sys-devel/autoconf-archive/metadata.xml
+++ b/sys-devel/nvptx-tools/metadata.xml
@@ -2,8 +2,10 @@
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
- <email>base-system@gentoo.org</email>
- <name>Gentoo Base System</name>
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
</maintainer>
- <stabilize-allarches/>
+ <upstream>
+ <remote-id type="github">SourceryTools/nvptx-tools</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/sys-devel/nvptx-tools/nvptx-tools-0_pre20230122.ebuild b/sys-devel/nvptx-tools/nvptx-tools-0_pre20230122.ebuild
new file mode 100644
index 000000000000..a73728161032
--- /dev/null
+++ b/sys-devel/nvptx-tools/nvptx-tools-0_pre20230122.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Collection of tools for use with nvptx-none GCC toolchains"
+HOMEPAGE="https://github.com/SourceryTools/nvptx-tools https://gcc.gnu.org/wiki/nvptx"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/SourceryTools/nvptx-tools"
+ inherit git-r3
+else
+ MY_COMMIT="93e00909ceb9cbbc104f0fcba56c0361ffb3ca4b"
+ SRC_URI="https://github.com/SourceryTools/nvptx-tools/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+
+ KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+BDEPEND="
+ test? (
+ dev-python/lit
+ dev-util/dejagnu
+ )
+"
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|nvptx-*) ;;
+ *) die "Use sys-devel/crossdev to build a nvptx(-none) toolchain" ;;
+ esac
+ fi
+}
diff --git a/sys-devel/nvptx-tools/nvptx-tools-9999.ebuild b/sys-devel/nvptx-tools/nvptx-tools-9999.ebuild
new file mode 100644
index 000000000000..a73728161032
--- /dev/null
+++ b/sys-devel/nvptx-tools/nvptx-tools-9999.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Collection of tools for use with nvptx-none GCC toolchains"
+HOMEPAGE="https://github.com/SourceryTools/nvptx-tools https://gcc.gnu.org/wiki/nvptx"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/SourceryTools/nvptx-tools"
+ inherit git-r3
+else
+ MY_COMMIT="93e00909ceb9cbbc104f0fcba56c0361ffb3ca4b"
+ SRC_URI="https://github.com/SourceryTools/nvptx-tools/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}"/${PN}-${MY_COMMIT}
+
+ KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+BDEPEND="
+ test? (
+ dev-python/lit
+ dev-util/dejagnu
+ )
+"
+
+is_crosscompile() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|nvptx-*) ;;
+ *) die "Use sys-devel/crossdev to build a nvptx(-none) toolchain" ;;
+ esac
+ fi
+}
diff --git a/sys-devel/parity/Manifest b/sys-devel/parity/Manifest
deleted file mode 100644
index c3d3a17e4c48..000000000000
--- a/sys-devel/parity/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST parity-2.0.1.tar.bz2 371662 BLAKE2B c0fca272665bbe346d5d5ca18e06c65209df61454310811b939239f8ba25ec7a08ad2f864fb43780329dc1f0120afdb6ea4ee2b4b42d2888860358aa1dc176f4 SHA512 3c96c87b87f40cb7affd6ee9a87c8e7cf628aedb44a2d3d89370a5b5e32a43cb15a897ae27425e9d6a00581ffd50a70c7a7481f1ca259eddd1e6f2310b554eb9
diff --git a/sys-devel/parity/metadata.xml b/sys-devel/parity/metadata.xml
deleted file mode 100644
index 2dc9f71e7299..000000000000
--- a/sys-devel/parity/metadata.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <!-- maintainer-needed -->
- <upstream>
- <remote-id type="github">ssi-schaefer/parity</remote-id>
- </upstream>
- <use>
- <flag name="vc8_0">Enable support for Visual Studio 2005</flag>
- <flag name="vc9_0">Enable support for Visual Studio 2008</flag>
- <flag name="vc10_0">Enable support for Visual Studio 2010</flag>
- <flag name="vc11_0">Enable support for Visual Studio 2012</flag>
- <flag name="vc12_0">Enable support for Visual Studio 2013</flag>
- <flag name="vc14_0">Enable support for Visual Studio 2015</flag>
- <flag name="vc15">Enable support for Visual Studio 2017</flag>
- <flag name="vc16">Enable support for Visual Studio 2019</flag>
- <flag name="vcx64">Enable support for 64bit Visual Studio compilers</flag>
- <flag name="vcx86">Enable support for 32bit Visual Studio compilers</flag>
- </use>
-</pkgmetadata>
diff --git a/sys-devel/parity/parity-2.0.1.ebuild b/sys-devel/parity/parity-2.0.1.ebuild
deleted file mode 100644
index a6d5f5cfc4aa..000000000000
--- a/sys-devel/parity/parity-2.0.1.ebuild
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-if [[ ${PV} == 9999 ]]; then
- inherit autotools git-r3
- EGIT_REPO_URI="git@github.com:ssi-schaefer/parity.git https://github.com/ssi-schaefer/parity.git"
- BDEPEND="dev-util/confix"
-else
- SRC_URI="https://github.com/mduft/${PN}/releases/download/${PV}/${P}.tar.bz2"
- KEYWORDS="~x64-cygwin"
-fi
-DESCRIPTION="A POSIX to native Win32 Cross-Compiler Tool (requires Visual Studio)"
-HOMEPAGE="https://github.com/mduft/parity"
-
-parity-vcarchs() { echo x64=x86_64 x86=i686 ; }
-parity-vcvers-legacy() { echo 8_0 9_0 ; }
-parity-vcvers-current() { echo 10_0 11_0 12_0 14_0 15 16 ; }
-parity-vcvers() {
- parity-vcvers-legacy
- parity-vcvers-current
-}
-
-LICENSE="LGPL-3"
-SLOT="0"
-IUSE="$(
- for a in $(parity-vcarchs); do echo "+vc${a%=*}"; done
- for v in $(parity-vcvers-legacy); do echo "vc${v}"; done
- for v in $(parity-vcvers-current); do echo "+vc${v}"; done
-)"
-
-if [[ ${PV} == 9999 ]]; then
- src_prepare() {
- default
- confix --output || die
- eautoreconf
- }
-fi
-
-parity-enabled-vcarchs() {
- local enabled= a
- for a in $(parity-vcarchs) ; do
- if use vc${a%=*} ; then
- enabled+=",${a#*=}"
- fi
- done
- echo ${enabled#,}
-}
-
-parity-enabled-vcvers() {
- local enabled= v
- for v in $(parity-vcvers) ; do
- if use vc${v} ; then
- enabled+=",${v/_/.}"
- fi
- done
- echo ${enabled#,}
-}
-
-src_configure() {
- local myconf=(
- --enable-msvc-archs="$(parity-enabled-vcarchs)"
- --enable-msvc-versions="$(parity-enabled-vcvers)"
- --disable-default-msvc-version
- )
- econf "${myconf[@]}"
-}
-
-pkg_postinst() {
- if [[ -n ${ROOT} ]] ; then
- einfo "To enable all available MSVC versions, on the target machine please run:"
- einfo " '${EPREFIX}/usr/bin/parity-setup' --enable-all"
- else
- "${EPREFIX}"/usr/bin/parity-setup --enable-all
- fi
-}
diff --git a/sys-devel/parity/parity-9999.ebuild b/sys-devel/parity/parity-9999.ebuild
deleted file mode 100644
index a6d5f5cfc4aa..000000000000
--- a/sys-devel/parity/parity-9999.ebuild
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-if [[ ${PV} == 9999 ]]; then
- inherit autotools git-r3
- EGIT_REPO_URI="git@github.com:ssi-schaefer/parity.git https://github.com/ssi-schaefer/parity.git"
- BDEPEND="dev-util/confix"
-else
- SRC_URI="https://github.com/mduft/${PN}/releases/download/${PV}/${P}.tar.bz2"
- KEYWORDS="~x64-cygwin"
-fi
-DESCRIPTION="A POSIX to native Win32 Cross-Compiler Tool (requires Visual Studio)"
-HOMEPAGE="https://github.com/mduft/parity"
-
-parity-vcarchs() { echo x64=x86_64 x86=i686 ; }
-parity-vcvers-legacy() { echo 8_0 9_0 ; }
-parity-vcvers-current() { echo 10_0 11_0 12_0 14_0 15 16 ; }
-parity-vcvers() {
- parity-vcvers-legacy
- parity-vcvers-current
-}
-
-LICENSE="LGPL-3"
-SLOT="0"
-IUSE="$(
- for a in $(parity-vcarchs); do echo "+vc${a%=*}"; done
- for v in $(parity-vcvers-legacy); do echo "vc${v}"; done
- for v in $(parity-vcvers-current); do echo "+vc${v}"; done
-)"
-
-if [[ ${PV} == 9999 ]]; then
- src_prepare() {
- default
- confix --output || die
- eautoreconf
- }
-fi
-
-parity-enabled-vcarchs() {
- local enabled= a
- for a in $(parity-vcarchs) ; do
- if use vc${a%=*} ; then
- enabled+=",${a#*=}"
- fi
- done
- echo ${enabled#,}
-}
-
-parity-enabled-vcvers() {
- local enabled= v
- for v in $(parity-vcvers) ; do
- if use vc${v} ; then
- enabled+=",${v/_/.}"
- fi
- done
- echo ${enabled#,}
-}
-
-src_configure() {
- local myconf=(
- --enable-msvc-archs="$(parity-enabled-vcarchs)"
- --enable-msvc-versions="$(parity-enabled-vcvers)"
- --disable-default-msvc-version
- )
- econf "${myconf[@]}"
-}
-
-pkg_postinst() {
- if [[ -n ${ROOT} ]] ; then
- einfo "To enable all available MSVC versions, on the target machine please run:"
- einfo " '${EPREFIX}/usr/bin/parity-setup' --enable-all"
- else
- "${EPREFIX}"/usr/bin/parity-setup --enable-all
- fi
-}
diff --git a/sys-devel/patch/Manifest b/sys-devel/patch/Manifest
index 15f0b1675c72..612a9aae3b54 100644
--- a/sys-devel/patch/Manifest
+++ b/sys-devel/patch/Manifest
@@ -1 +1,2 @@
DIST patch-2.7.6.tar.xz 783756 BLAKE2B e3dd2d155a94c39cb60eafc26677e84de14c3a6d5814dff69de091ded52f21862490970254297795f2c42a0c3203f7e88a8f65bb66968f8dfd6e066bf53f2dfb SHA512 fcca87bdb67a88685a8a25597f9e015f5e60197b9a269fa350ae35a7991ed8da553939b4bbc7f7d3cfd863c67142af403b04165633acbce4339056a905e87fbd
+DIST patch-2.7.6.tar.xz.sig 801 BLAKE2B 8f2decb10402ecf0208d05ea7cce3bae565d31ee2bb2a118367c117d25b158d8bd525cae654ec0c0e2c036cc8f47a331edc1bb10b100683ade64dfa3b651988b SHA512 1302a1110dcda4f3d83b5263415d72be55c46dae0efb1c123e9c346154e09def5657004bbe7249e2d014555349410e7a5217140dd8852331235f75bcc757351b
diff --git a/sys-devel/patch/patch-2.7.6-r4.ebuild b/sys-devel/patch/patch-2.7.6-r4.ebuild
index 30d831025c06..0ea78585b038 100644
--- a/sys-devel/patch/patch-2.7.6-r4.ebuild
+++ b/sys-devel/patch/patch-2.7.6-r4.ebuild
@@ -1,23 +1,26 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
-inherit flag-o-matic
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/patch.asc
+inherit flag-o-matic verify-sig
DESCRIPTION="Utility to apply diffs to files"
HOMEPAGE="https://www.gnu.org/software/patch/patch.html"
SRC_URI="mirror://gnu/patch/${P}.tar.xz"
+SRC_URI+=" verify-sig? ( mirror://gnu/patch/${P}.tar.xz.sig )"
LICENSE="GPL-3+"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="static test xattr"
RESTRICT="!test? ( test )"
RDEPEND="xattr? ( sys-apps/attr )"
-DEPEND="${RDEPEND}
- test? ( sys-apps/ed )"
+DEPEND="${RDEPEND}"
+BDEPEND="test? ( sys-apps/ed )
+ verify-sig? ( sec-keys/openpgp-keys-patch )"
PATCHES=(
"${FILESDIR}"/${P}-fix-test-suite.patch
diff --git a/sys-devel/patch/patch-2.7.6-r5.ebuild b/sys-devel/patch/patch-2.7.6-r5.ebuild
new file mode 100644
index 000000000000..e1dfc88fa933
--- /dev/null
+++ b/sys-devel/patch/patch-2.7.6-r5.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/patch.asc
+inherit flag-o-matic verify-sig
+
+DESCRIPTION="Utility to apply diffs to files"
+HOMEPAGE="https://www.gnu.org/software/patch/patch.html"
+SRC_URI="mirror://gnu/patch/${P}.tar.xz"
+SRC_URI+=" verify-sig? ( mirror://gnu/patch/${P}.tar.xz.sig )"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="static test xattr"
+RESTRICT="!test? ( test )"
+
+RDEPEND="xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}"
+BDEPEND="test? ( sys-apps/ed )
+ verify-sig? ( sec-keys/openpgp-keys-patch )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-test-suite.patch
+ "${FILESDIR}"/${PN}-2.7.6-fix-error-handling-with-git-style-patches.patch
+ "${FILESDIR}"/${PN}-2.7.6-CVE-2018-6951.patch
+ "${FILESDIR}"/${PN}-2.7.6-allow-input-files-to-be-missing-for-ed-style-patches.patch
+ "${FILESDIR}"/${PN}-2.7.6-CVE-2018-1000156.patch
+ "${FILESDIR}"/${PN}-2.7.6-CVE-2018-6952.patch
+ "${FILESDIR}"/${PN}-2.7.6-Do-not-crash-when-RLIMIT_NOFILE-is-set-to-RLIM_INFINITY.patch
+ "${FILESDIR}"/${PN}-2.7.6-CVE-2018-1000156-fix1.patch
+ "${FILESDIR}"/${PN}-2.7.6-CVE-2018-1000156-fix2.patch
+ "${FILESDIR}"/${PN}-2.7.6-CVE-2019-13636.patch
+ "${FILESDIR}"/${PN}-2.7.6-CVE-2019-13638.patch
+ "${FILESDIR}"/${PN}-2.7.6-Avoid-invalid-memory-access-in-context-format-diffs.patch
+)
+
+src_configure() {
+ use static && append-ldflags -static
+
+ local myeconfargs=(
+ $(use_enable xattr)
+ # rename to gpatch for better BSD compatibility
+ --program-prefix=g
+ )
+ # Do not let $ED mess up the search for `ed` 470210.
+ ac_cv_path_ED=$(type -P ed) \
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ # symlink to the standard name
+ dosym gpatch /usr/bin/patch
+ dosym gpatch.1 /usr/share/man/man1/patch.1
+}
diff --git a/sys-devel/pmake/Manifest b/sys-devel/pmake/Manifest
deleted file mode 100644
index 149a5aafe345..000000000000
--- a/sys-devel/pmake/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST pmake_1.111-3.3.debian.tar.gz 31648 BLAKE2B 31aca433bbeac4275d4c2af0cfd33ef81b0086b0dec107edfc1fba55b15480367ebf62abccd6e2e48f0c7ccc25c59f0b07eed7ac950a5037b73c267b066a9638 SHA512 b22a1d9e371712732f196d91ac3eb9239fa98ee8ee05754576e7a5878cab88976cb10bb6be90706df5ac738373f519468403c23f6a3ff3860a2968b3222a66ed
-DIST pmake_1.111.orig.tar.gz 264383 BLAKE2B 54dd510251441b54c9f5d7f6061109b0222191b3acdded1394b51b72b87bbd4255edd80fab46976d92c58929693b6809a9f2c4f001cab8c9cdaabfac9f3adac9 SHA512 ad48708ea014d6a38ad36303504c52992b51a1e815564f1710849d859b1fc3cd58c4a1a71f54ec902c9b69112e9cd1e1a64282ff738439cdb209a4f75c364c22
diff --git a/sys-devel/pmake/files/pmake-1.111.1-ldflags.patch b/sys-devel/pmake/files/pmake-1.111.1-ldflags.patch
deleted file mode 100644
index d6047d48994b..000000000000
--- a/sys-devel/pmake/files/pmake-1.111.1-ldflags.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-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
deleted file mode 100644
index 6783a9799919..000000000000
--- a/sys-devel/pmake/files/pmake-1.98-skipdots.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-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
deleted file mode 100644
index 85e4ed814fa2..000000000000
--- a/sys-devel/pmake/metadata.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
-<!-- maintainer-needed -->
-</pkgmetadata>
diff --git a/sys-devel/pmake/pmake-1.111.3.3.ebuild b/sys-devel/pmake/pmake-1.111.3.3.ebuild
deleted file mode 100644
index 53db11c875df..000000000000
--- a/sys-devel/pmake/pmake-1.111.3.3.ebuild
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs linux-info
-
-MY_P="${PN}-$(ver_cut 1-2)"
-DEBIAN_SOURCE="${PN}_$(ver_cut 1-2).orig.tar.gz"
-DEBIAN_PATCH="${PN}_$(ver_rs 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"
-
-S="${WORKDIR}/${PN}"
-
-PATCHES=(
- "${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)
- "${FILESDIR}"/${PN}-1.98-skipdots.patch
-
- # Don't ignore ldflags
- "${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 -r mk/.
- fi
-
- newbin bmake pmake
- dobin mkdep
-
- doman mkdep.1
- newman make.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
deleted file mode 100644
index 139e3eee1b83..000000000000
--- a/sys-devel/prelink/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST prelink-cross-20151030.tar.bz2 701337 BLAKE2B 4875b936254a03afd0eeb1ee81ee99f97a2d654b7c0379acb80ea3763412f3e892c366a9962ff3e1493bba9c83a8a140e79a1d5fb08b269a08ef596d63fd1d32 SHA512 75edd8617b95ae5bd3bfc968732ee142c968855c97c5b2b93784d3476a9724e0fd9a4eb7af681a5356616a4f023e24d5c5a2e75fb57e2a25b142cc901d9bfcaf
-DIST prelink.pdf 474129 BLAKE2B 6df5d4998d0822a8032c5dcd1103d7eafa8e9002f2cbfa8fa821131d7c804d2998100dc98d310ae3ae601137b6815435ecdd2684d547a8d25025984c20c06318 SHA512 86b7163fcf6f43d1764183b3dfc30aad8de99ce198b2721af276c81fc361e9f5fd8f4aea1e8e0c653f0566e8346dff4b4ba72909359167aa92c094f5561d2e1e
diff --git a/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch b/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch
deleted file mode 100644
index 5a9fffb838f9..000000000000
--- a/sys-devel/prelink/files/prelink-20130503-libiberty-md5.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-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
deleted file mode 100644
index 9233a4114827..000000000000
--- a/sys-devel/prelink/files/prelink-20130503-prelink-conf.patch
+++ /dev/null
@@ -1,39 +0,0 @@
---- 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.confd b/sys-devel/prelink/files/prelink.confd
deleted file mode 100644
index 6b89b8c1f1fd..000000000000
--- a/sys-devel/prelink/files/prelink.confd
+++ /dev/null
@@ -1,43 +0,0 @@
-# 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
deleted file mode 100644
index 067fc2ea97a2..000000000000
--- a/sys-devel/prelink/files/prelink.cron
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/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 (and if exists)
-[ -n "$(find `ldd /sbin/init 2>/dev/null | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
-
-exit 0
diff --git a/sys-devel/prelink/files/prelink.service b/sys-devel/prelink/files/prelink.service
deleted file mode 100644
index dcdbf813a0e4..000000000000
--- a/sys-devel/prelink/files/prelink.service
+++ /dev/null
@@ -1,6 +0,0 @@
-[Unit]
-Description=Perform system-wide prelinking
-
-[Service]
-Type=oneshot
-ExecStart=/etc/cron.daily/prelink
diff --git a/sys-devel/prelink/files/prelink.timer b/sys-devel/prelink/files/prelink.timer
deleted file mode 100644
index 5d58d437158e..000000000000
--- a/sys-devel/prelink/files/prelink.timer
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Daily system-wide prelinking
-
-[Timer]
-OnCalendar=daily
-AccuracySec=12h
-Persistent=true
-
-[Install]
-WantedBy=timers.target
diff --git a/sys-devel/prelink/metadata.xml b/sys-devel/prelink/metadata.xml
deleted file mode 100644
index 5a1e1dee65db..000000000000
--- a/sys-devel/prelink/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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-20151030-r1.ebuild b/sys-devel/prelink/prelink-20151030-r1.ebuild
deleted file mode 100644
index 17c39b3993ef..000000000000
--- a/sys-devel/prelink/prelink-20151030-r1.ebuild
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2002-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-MY_PN="${PN}-cross"
-MY_P="${MY_PN}-${PV}"
-
-inherit autotools flag-o-matic systemd
-
-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 ~arm64 ppc ppc64 x86"
-IUSE="doc selinux"
-
-RDEPEND=">=dev-libs/elfutils-0.100
- selinux? ( sys-libs/libselinux )
- !dev-libs/libelf"
-DEPEND="${RDEPEND}
- sys-libs/binutils-libs"
-
-S=${WORKDIR}/${MY_P}
-
-PATCHES=(
- "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
- "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
-)
-
-# tests were fixed only in development version after 20151030
-RESTRICT=test
-
-src_prepare() {
- default
-
- 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 "${DISTDIR}"/prelink.pdf
-
- insinto /etc
- doins doc/prelink.conf
-
- exeinto /etc/cron.daily
- newexe "${FILESDIR}"/prelink.cron prelink
- newconfd "${FILESDIR}"/prelink.confd prelink
- systemd_dounit "${FILESDIR}"/prelink.{service,timer}
-}
-
-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-99999999.ebuild b/sys-devel/prelink/prelink-99999999.ebuild
deleted file mode 100644
index dfe534db6194..000000000000
--- a/sys-devel/prelink/prelink-99999999.ebuild
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 2002-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-MY_PN="${PN}-cross"
-MY_P="${MY_PN}-${PV}"
-
-inherit autotools flag-o-matic git-r3 systemd
-
-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"
-EGIT_REPO_URI="https://git.yoctoproject.org/git/prelink-cross"
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="doc selinux"
-
-RDEPEND=">=dev-libs/elfutils-0.100
- selinux? ( sys-libs/libselinux )
- !dev-libs/libelf"
-DEPEND="${RDEPEND}
- sys-libs/binutils-libs"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-20130503-prelink-conf.patch
- "${FILESDIR}"/${PN}-20130503-libiberty-md5.patch
-)
-
-src_prepare() {
- default
-
- 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_test() {
- # prelink tests check exact library lists.
- # LD_PRELOADed libraries break the assumption.
- SANDBOX_ON=0 LD_PRELOAD= emake check VERBOSE=1
-}
-
-src_install() {
- default
-
- use doc && dodoc doc/prelink.pdf
-
- insinto /etc
- doins doc/prelink.conf
-
- exeinto /etc/cron.daily
- newexe "${FILESDIR}"/prelink.cron prelink
- newconfd "${FILESDIR}"/prelink.confd prelink
- systemd_dounit "${FILESDIR}"/prelink.{service,timer}
-}
-
-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/qbe/Manifest b/sys-devel/qbe/Manifest
new file mode 100644
index 000000000000..739ffea8e281
--- /dev/null
+++ b/sys-devel/qbe/Manifest
@@ -0,0 +1,5 @@
+DIST qbe-1.1.tar.xz 244740 BLAKE2B fdadca56ff5a6b56f30e0a99724908e356b3c1b545e5b35a27080a92ca0d417ff53deb8f4c0a31b9289acab58fb79568384669004b0275cddd83afb198a7a5aa SHA512 1e5d7d1df3d73849dbf19dd1d84c9bba63a5041622823a5a239496032f9d82bd1640dd2bbd03e28c8a180b8e66a1fe10deb940b5d8fde996bf593f7e8d943e8b
+DIST qbe-1.2.tar.xz 246364 BLAKE2B b4cf4562caf6db191f1b2bfd078e2dfebfbe526a454552691ff78fba7b2d6c27b09df8ea5c795b49b9509a73b6981c17684d6e887999878f6e5bc7923c5047ef SHA512 b3ffd172e95346b3bfae1d2aff4c22a32af8bd4443d073f6fbb711f41db01f072ca7a8108901508cd4a8366567dab46510e0438716d35548591fdf37cee49971
+DIST qbe-dbgfile.patch 3813 BLAKE2B fbe0dd9c4fab8399054c091bb50fd8002c43108c53f2177ea000784f0707e9fb4fe432d637d03ccd87247f0ab1d232d5ba81e3a3e61347b7e1f31bb61b701c62 SHA512 41694848c95341f16618cd8f8d3222415e551b36b3428467e7ad066e257bc235dedbae4a1da4a6ae9034d102e359ecd69f51c580ad3f613e0e427df1882d1c65
+DIST qbe-info-tracking.patch 6305 BLAKE2B 03cb80de722e642812558fe7fe93eb3683f0fb54a2d78a1ceacf68016c779dee47f314651f0a6f1690d8b3ddc3089d41a894caafa83ec408d46b9375d24c9e3d SHA512 00d37894fca754f23024a8d64591e22f74b8f50022de77c1b25b474a68d204f0d89f2f3dbbfb822c5293ebccdadd923516c28b1e3c358c07de7a284fa0ef722f
+DIST qbe-parseline-tweaks.patch 1519 BLAKE2B 88940d42dbed988a5ecff68f18a1fab9c5024d5fb4d8219a1984f676808f9b5dbc4c4a729bf419358e0be71244aa4b97e23b3575aa4458a5c4059f7f1cd2151e SHA512 8701657032f26f8f7fe0de768573c5f111f80e5cc9d62fb4bfcf895b421532f039f08234bca8b4156b097f80893483fa8323cde3a8f3c8a5c729412328097bb2
diff --git a/sys-devel/qconf/metadata.xml b/sys-devel/qbe/metadata.xml
index ad30d60d9ef0..fc3c6c671309 100644
--- a/sys-devel/qconf/metadata.xml
+++ b/sys-devel/qbe/metadata.xml
@@ -1,15 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person" proxied="yes">
- <email>rion4ik@gmail.com</email>
- <name>Sergey Ilinykh</name>
+ <email>contact@hacktivis.me</email>
+ <name>Haelwenn (lanodan) Monnier</name>
</maintainer>
<maintainer type="project" proxied="proxy">
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
- <upstream>
- <remote-id type="github">psi-plus/qconf</remote-id>
- </upstream>
</pkgmetadata>
diff --git a/sys-devel/qbe/qbe-1.1-r1.ebuild b/sys-devel/qbe/qbe-1.1-r1.ebuild
new file mode 100644
index 000000000000..375946b25243
--- /dev/null
+++ b/sys-devel/qbe/qbe-1.1-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="git://c9x.me/qbe.git"
+ inherit git-r3
+else
+ SRC_URI="
+ https://c9x.me/compile/release/${P}.tar.xz
+ https://c9x.me/git/qbe.git/patch/?id=0d929287d77ccc3fb52ca8bd072678b5ae2c81c8 -> qbe-info-tracking.patch
+ https://c9x.me/git/qbe.git/patch/?id=baf11b7175c468d3d9408d332b1c0d529a4957ee -> qbe-parseline-tweaks.patch
+ https://c9x.me/git/qbe.git/patch/?id=36946a5142c40b733d25ea5ca469f7949ee03439 -> qbe-dbgfile.patch
+ "
+
+ # 64-bit RISC-V only
+ KEYWORDS="~amd64 ~arm64 ~riscv"
+fi
+
+DESCRIPTION="Pure-C embeddable compiler backend"
+HOMEPAGE="https://c9x.me/compile/"
+
+LICENSE="MIT"
+SLOT="0"
+
+DOCS=( README doc )
+
+PATCHES=(
+ "${DISTDIR}/qbe-info-tracking.patch"
+ "${DISTDIR}/qbe-parseline-tweaks.patch"
+ "${DISTDIR}/qbe-dbgfile.patch"
+)
+
+src_compile() {
+ tc-export CC
+
+ emake CFLAGS="-std=c99 ${CPPFLAGS} ${CFLAGS}"
+}
+
+src_install() {
+ einstalldocs
+ emake install DESTDIR="${ED}" PREFIX=/usr
+}
diff --git a/sys-devel/qbe/qbe-1.2.ebuild b/sys-devel/qbe/qbe-1.2.ebuild
new file mode 100644
index 000000000000..baaab97b66c1
--- /dev/null
+++ b/sys-devel/qbe/qbe-1.2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="git://c9x.me/qbe.git"
+ inherit git-r3
+else
+ SRC_URI="https://c9x.me/compile/release/${P}.tar.xz"
+
+ # 64-bit RISC-V only
+ KEYWORDS="~amd64 ~arm64 ~riscv"
+fi
+
+DESCRIPTION="Pure-C embeddable compiler backend"
+HOMEPAGE="https://c9x.me/compile/"
+
+LICENSE="MIT"
+SLOT="0"
+
+DOCS=( README doc )
+
+src_prepare() {
+ default
+
+ sed -i 's;^CC *=.*;CC ?= cc;' Makefile || die
+}
+
+src_compile() {
+ tc-export CC
+
+ emake CFLAGS="-std=c99 ${CPPFLAGS} ${CFLAGS}"
+}
+
+src_install() {
+ einstalldocs
+ emake install DESTDIR="${ED}" PREFIX=/usr
+}
diff --git a/sys-devel/qbe/qbe-9999.ebuild b/sys-devel/qbe/qbe-9999.ebuild
new file mode 100644
index 000000000000..baaab97b66c1
--- /dev/null
+++ b/sys-devel/qbe/qbe-9999.ebuild
@@ -0,0 +1,41 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+if [[ ${PV} == 9999 ]]; then
+ EGIT_REPO_URI="git://c9x.me/qbe.git"
+ inherit git-r3
+else
+ SRC_URI="https://c9x.me/compile/release/${P}.tar.xz"
+
+ # 64-bit RISC-V only
+ KEYWORDS="~amd64 ~arm64 ~riscv"
+fi
+
+DESCRIPTION="Pure-C embeddable compiler backend"
+HOMEPAGE="https://c9x.me/compile/"
+
+LICENSE="MIT"
+SLOT="0"
+
+DOCS=( README doc )
+
+src_prepare() {
+ default
+
+ sed -i 's;^CC *=.*;CC ?= cc;' Makefile || die
+}
+
+src_compile() {
+ tc-export CC
+
+ emake CFLAGS="-std=c99 ${CPPFLAGS} ${CFLAGS}"
+}
+
+src_install() {
+ einstalldocs
+ emake install DESTDIR="${ED}" PREFIX=/usr
+}
diff --git a/sys-devel/qconf/Manifest b/sys-devel/qconf/Manifest
deleted file mode 100644
index 87fc52a38213..000000000000
--- a/sys-devel/qconf/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST qconf-2.5.tar.gz 100704 BLAKE2B 01dcca053e020cfc76e8595927dd3cedb6c82ade24381c95935c87994037ca5129f5e9e0ec58dd0e0fc6815b1500249b767367fbf7a16549459f814bb1591368 SHA512 4ce032eb5b9ba2d584807b3283b0dd5cf973c2fdd6792dfec13c54bb7c639d23eeaab03eb52f1a395113d973d2b01d87bf713d717e691641203865b934c7da5e
diff --git a/sys-devel/qconf/qconf-2.5.ebuild b/sys-devel/qconf/qconf-2.5.ebuild
deleted file mode 100644
index ca303a7e0854..000000000000
--- a/sys-devel/qconf/qconf-2.5.ebuild
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit qmake-utils
-
-DESCRIPTION="./configure like generator for qmake-based projects"
-HOMEPAGE="https://github.com/psi-im/qconf"
-SRC_URI="https://github.com/psi-im/qconf/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 ~arm ~hppa ppc ppc64 ~sparc x86"
-IUSE=""
-
-DEPEND="
- dev-qt/qtcore:5
- dev-qt/qtxml:5
-"
-RDEPEND="${DEPEND}"
-
-src_configure() {
- # not autotools configure, so don't use econf
- ./configure \
- --prefix="${EPREFIX}"/usr \
- --qtdir="$(qt5_get_libdir)/qt5" \
- --extraconf=QMAKE_STRIP= \
- --verbose || die "configure failed"
-
- # just to set all the Gentoo toolchain flags
- eqmake5
-}
-
-src_install() {
- emake INSTALL_ROOT="${D}" install
- einstalldocs
- dodoc -r examples
-}
diff --git a/sys-devel/reflex/Manifest b/sys-devel/reflex/Manifest
new file mode 100644
index 000000000000..62eca417a802
--- /dev/null
+++ b/sys-devel/reflex/Manifest
@@ -0,0 +1,2 @@
+DIST reflex-20230523.tgz 480999 BLAKE2B a7306367bdf5bfb542a44f29c382a5d889a176059d95539916ab3132de06401edfd0c6a476ec66f433d56398039524d79c6879e1f24b4e813ebbba98ea434ed3 SHA512 9704b6dc3327bc017175bef21f34f53ff6614a76692deacb4af99c29bd4330e5fb7f71af6497d233acceab148bc8a7911d41d3ca224110812e5883c90cc801f2
+DIST reflex-20230523.tgz.asc 729 BLAKE2B 0249d1bc4f6d6395be0f51f90e1f9834bc63cd7e4b5565e71ff0502746f45ea04b611c8db70d62513dfe95d492512cf1935f4e70d582c960f38d11e06853f54f SHA512 48e2f84c8932a038366159ea6a26eac73510bb69b6bc3c5027195682ade4ef3a33ade082b41e4d08af0c23c6692abc8ee46b261796d72709aa9568070c16c20b
diff --git a/sys-devel/reflex/metadata.xml b/sys-devel/reflex/metadata.xml
new file mode 100644
index 000000000000..f885e82281a5
--- /dev/null
+++ b/sys-devel/reflex/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <upstream>
+ <changelog>https://invisible-island.net/reflex/NEWS.html</changelog>
+ <remote-id type="github">ThomasDickey/reflex-snapshots</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-devel/reflex/reflex-20230523.ebuild b/sys-devel/reflex/reflex-20230523.ebuild
new file mode 100644
index 000000000000..08eac7186712
--- /dev/null
+++ b/sys-devel/reflex/reflex-20230523.ebuild
@@ -0,0 +1,22 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/thomasdickey.asc
+inherit verify-sig
+
+DESCRIPTION="This is a variant of the flex fast lexical scanner"
+HOMEPAGE="https://invisible-island.net/reflex/"
+SRC_URI="https://invisible-island.net/archives/${PN}/${P}.tgz"
+SRC_URI+=" verify-sig? ( https://invisible-island.net/archives/${PN}/${P}.tgz.asc )"
+
+LICENSE="FLEX"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ppc ppc64 ~riscv ~s390 sparc x86"
+
+BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomasdickey )"
+
+src_configure() {
+ econf --with-manpage-format=formatted
+}
diff --git a/sys-devel/remake/Manifest b/sys-devel/remake/Manifest
deleted file mode 100644
index b96c6a20d2ab..000000000000
--- a/sys-devel/remake/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST remake-4.3+dbg-1.5.tar.gz 2546056 BLAKE2B c5c1b254d0533e0d9787d408f79e8aba93cab5185de76519dabef7ddca5c9d2021671099f9ff80df345732552f859ce31d1131b89cd56fb185bae4cee676b412 SHA512 90aa9674ed5d88b72fda5a99a103d0b1a643d10b18c1de1186478b026f6b4da73628bff75a180df880157b5cbfff1bfd782f4ee81880e0635d79113fcc0f7497
diff --git a/sys-devel/remake/files/remake-4.3.1.1.5-fno-common.patch b/sys-devel/remake/files/remake-4.3.1.1.5-fno-common.patch
deleted file mode 100644
index 6c8650472e4e..000000000000
--- a/sys-devel/remake/files/remake-4.3.1.1.5-fno-common.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-Adapted version of https://github.com/rocky/remake/commit/08113a28b9be25cf157ace5d63c2d36d7dbefc04
---- a/src/debugger/file2line.c
-+++ b/src/debugger/file2line.c
-@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
- #include "../src/rule.h"
- #include "./file2line.h"
-
-+struct hash_table file2lines;
-+
- unsigned long
- file2lines_hash_1 (const void *key)
- {
---- a/src/debugger/file2line.h
-+++ b/src/debugger/file2line.h
-@@ -19,15 +19,15 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
- #ifndef REMAKE_FILE2LINE
- #define REMAKE_FILE2LINE
--struct hash_table file2lines;
-+extern struct hash_table file2lines;
-
- typedef enum {
- F2L_TARGET,
- F2L_PATTERN
- } f2l_entry_t;
-
--
--typedef struct lineo_array_s
-+
-+typedef struct lineo_array_s
- {
- const char *hname; /**< Name stored in hash table */
- unsigned int size; /**< Number of entries in array */
-@@ -40,13 +40,13 @@ typedef struct lineo_array_s
- only. So we do this on demand.
- */
- extern bool file2lines_init(void);
--extern file_t *target_for_file_and_line (const char *psz_filename,
-+extern file_t *target_for_file_and_line (const char *psz_filename,
- unsigned int lineno,
- /*out*/ f2l_entry_t *entry_type);
- extern void file2lines_dump(void);
- #endif
-
--/*
-+/*
- * Local variables:
- * eval: (c-set-style "gnu")
- * indent-tabs-mode: nil
---- a/src/dep.h
-+++ b/src/dep.h
-@@ -139,7 +139,7 @@ struct dep *copy_dep_chain (const struct dep *d);
- struct goaldep *read_all_makefiles (const char **makefiles);
-
- /*! The chain of makefiles read by read_makefile. */
--struct goaldep *read_makefiles;
-+extern struct goaldep *read_makefiles;
-
- void eval_buffer (char *buffer, const gmk_floc *floc);
- enum update_status update_goal_chain (struct goaldep *goals);
---- a/src/globals.h
-+++ b/src/globals.h
-@@ -89,6 +89,6 @@ extern int in_debugger;
- extern bool b_debugger_preread;
-
- /* Remember the original value of the SHELL variable, from the environment. */
--struct variable shell_var;
-+extern struct variable shell_var;
-
- #endif /*GLOBALS_H*/
---- a/src/main.c
-+++ b/src/main.c
-@@ -45,6 +45,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
- # include <fcntl.h>
- #endif
-
-+struct goaldep *read_makefiles;
-+
- extern void initialize_stopchar_map ();
-
- #if defined HAVE_WAITPID || defined HAVE_WAIT3
---- a/src/make.h
-+++ b/src/make.h
-@@ -324,7 +324,7 @@ extern int unixy_shell;
- #endif
- #ifdef SET_STACK_SIZE
- # include <sys/resource.h>
--struct rlimit stack_limit;
-+extern struct rlimit stack_limit;
- #endif
-
- /* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use
---- a/src/print.h
-+++ b/src/print.h
-@@ -39,7 +39,7 @@ void fatal_err (target_stack_node_t *p_call, const char *fmt, ...);
-
- /* Think of the below not as an enumeration but as #defines done in a
- way that we'll be able to use the value in a gdb. */
--enum debug_print_enums_e {
-+extern enum debug_print_enums_e {
- MAX_STACK_SHOW = 1000,
- } debug_print_enums1;
-
diff --git a/sys-devel/remake/metadata.xml b/sys-devel/remake/metadata.xml
deleted file mode 100644
index 17bb5f7f22f9..000000000000
--- a/sys-devel/remake/metadata.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <!-- maintainer-needed -->
- <upstream>
- <remote-id type="github">rocky/remake</remote-id>
- <remote-id type="sourceforge">bashdb</remote-id>
- </upstream>
-</pkgmetadata>
diff --git a/sys-devel/remake/remake-4.3.1.1.5.ebuild b/sys-devel/remake/remake-4.3.1.1.5.ebuild
deleted file mode 100644
index 091440c48e65..000000000000
--- a/sys-devel/remake/remake-4.3.1.1.5.ebuild
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-MY_MAKE_BASE=$(ver_cut 1-2)
-MY_REMAKE_PATCH=$(ver_cut 4-)
-MY_P="${PN}-${MY_MAKE_BASE}+dbg-${MY_REMAKE_PATCH}"
-
-DESCRIPTION="Patched version of GNU Make with improved error reporting, tracing, and debugging"
-HOMEPAGE="http://bashdb.sourceforge.net/remake/"
-SRC_URI="https://github.com/rocky/remake/releases/download/release_${MY_P/remake-/}/${MY_P}.tar.gz"
-S="${WORKDIR}"/${MY_P}
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~s390 ~sparc x86"
-IUSE="guile readline"
-
-DEPEND="readline? ( sys-libs/readline:0= )"
-RDEPEND="${DEPEND}
- guile? ( >=dev-scheme/guile-1.8:= )"
-BDEPEND="guile? ( >=dev-scheme/guile-1.8 )"
-
-PATCHES=(
- "${FILESDIR}"/${P}-fno-common.patch
-)
-
-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
- rm "${ED}"/usr/share/info/make.info* || die
-}
diff --git a/sys-devel/rust-std/Manifest b/sys-devel/rust-std/Manifest
index 408325747f02..c313ce130552 100644
--- a/sys-devel/rust-std/Manifest
+++ b/sys-devel/rust-std/Manifest
@@ -1,5 +1,8 @@
-DIST rustc-1.53.0-src.tar.xz 115686332 BLAKE2B fa068f89d42f927fdc79ee31aad1386eaf2aa596a060e059c5a1a73fe48c48d008fc952cd6c7912b743e41d77a94b205639eed0f728b2539b62f18a772cabfe3 SHA512 70485cf7a0f7fc36ee31644e546374079dc387a85b44e5e793707fd0a4d7ca05d311291e78b86db955485d8f21c47ff9e1908acc4da68ba04929287213a40c24
-DIST rustc-1.54.0-src.tar.xz 116286856 BLAKE2B 5ac47822646a0b6205f09282168b4d4ddcace9f6bc8f242c890327ca4074626f129514f8bcae5c5556015745f718990cce490658076f5cd3526623439540416b SHA512 5162f85b43ca2c5af93fdbfb2597d75df8a838f7fcc025a5298499ce1043db50f1ea2fbba753e47ce5daad3d80d4b612acf6527ef902c34117763e687fdbbcfa
-DIST rustc-1.55.0-src.tar.xz 117197580 BLAKE2B 8d9739ce7571146aee0e07c6287de9a8c4f1a914606cd47819eb1ef118b15772ecf22d0d43d7732f03c234a013fa54a4a7f0578a3f136af518f71bf64a03305d SHA512 7522f2fa95d5af92472404ecc97d7d9e745e88c933196a83fa373ce1efff6db3c295e0e2afdbfa1ff00644554efa0c3c7f6c11f9119ecf9010cb440b3f27c2da
-DIST rustc-1.56.1-src.tar.xz 121798264 BLAKE2B 09677b0332022f28a0d80949a6735929dbf64276f7eb57195d8c33e6c80f13c903432ff77d8834093ab551677618fb1d385f2300e2b1b4c064f9c245c696be32 SHA512 193468e211cde9ebc5f6e30b8e3733b79bd8710fe6dd45c7ed8d4392f91010d30466787afd4d0b2041cd7dd994924fee8ad111048824e248bd994959e55bf15f
-DIST rustc-1.58.0-src.tar.xz 124348768 BLAKE2B e5a0d919a1ca1202e218cec3da93fc69cba163069b1f2b4051778a49184715579c14cd6b03baa0225b10a8f1adf758aca427c910d95dfa2e647bbf8b7d133785 SHA512 70104f4d3b474dcb9935200ef0503f29cb15f10d38ba8630e1dadbb384924dd9137fced647794699efe83ac88083e4ae5f45712f0e1c8bc0a6f8c23eecdb0aeb
+DIST rustc-1.68.2-src.tar.xz 147835648 BLAKE2B 4b6deab818d915afe67a96f4d32a758c15a832041a77d9da5d065a903ea2718e0e7ebbc0cd1baaa436b655bdb93a62e0fb76f9e37aed595c064e0857201bb091 SHA512 8b085d0351e19100e9abc24b10c44a0939a1d35ba23421da4ece345d7373f7dbad1dc6a2ae153c1259404dd96b41e2682e711cf2b0b63fd03a196760cddbcdd3
+DIST rustc-1.71.1-src.tar.xz 151983068 BLAKE2B 3dfdbc246feb84a79ae94c2de978c5585ee06cf6b683d2245869b62e28f7c79f89cc589f5431537713bf088236a0b824acefc1b68e418e9eb72e1eea98054e3f SHA512 fd0e5a16bdbeb539184513583089e55f681cb772810df357b6b1464853f7022ac02edab3dd155b2262ed0047e2a25dea3808dd078dcdfce9d399384465009db4
+DIST rustc-1.72.0-src.tar.xz 151630408 BLAKE2B 7b26e5a9335f9262567b2a6aaf3b8ad6dc813688f532c54502c12c7b59d02082a082fe49ae370b0748fb13f8245dad13a58927d8563ba96fdf3639d4a128f236 SHA512 aed27c1babfec7f9b0815bc395302cff4f8e8ed83d8d3bde202f6c86fba4aec14ad2d3e99f4e22618c6727d876262511bfbcd83513731ea4b9c664462c97945b
+DIST rustc-1.73.0-src.tar.xz 154319536 BLAKE2B 077bdedb36fdbc30db3c6331ac6014615eb79393ad42e38488d037ba38eaa6542467d39b2a14228d0bf6717110f915bf6fdcf0074c6293f413720cc748316eff SHA512 75c59680a82cb9d076b9434744a1c65908524ef769293952f5d9c5779d9a9c6fa4d9aa0c7e7d6b7566a21a50a27cd6ae452b5283a4d4606b2fa1acc24dfd8e0c
+DIST rustc-1.74.1-src.tar.xz 155968724 BLAKE2B e05f2379ac94b286f85791a138e1928e5b5b5a7749f0981d82c40c2a12860f55bf96bb2f0e924e35a0f8b2447b13052d38adea909aaa3199105787bb5a4861b3 SHA512 14c7e7ed2f38ab60299d8c7d41d78f042b6b57ef822d577b5138e60bdde31cf141eccd4332a25bc5da3d58eb5313d63c1448b5dfe9e11b8055bb8ea133a9038d
+DIST rustc-1.75.0-src.tar.xz 159624388 BLAKE2B 8937b80585eddaa3e1f1ef948899d14a170308518c6fef9fe569560cdd870053776956743f796055f2119399b9ca6c0df12fedd789ae46324d071e5126c4e495 SHA512 7b0f25d91b1b5c317980fc88e059200bd43b56a70b445fbc72fb9b96e09775bfd3a98e9bd9d662af80f0ce3aef527c777ee82777e96ca876f47a972d63da8606
+DIST rustc-1.76.0-src.tar.xz 162267908 BLAKE2B 0cf726841a837d9906d82a6216e65edad1e3e4a798ccd1ca3824c2098d0c45473854b8bf183c6e9ca70ba095752e77c4f5ef575d98c07243d609857214175f5e SHA512 92e16cfdeb91bde341fe6c2774d92868275b07aa1d46d870ddc9291eadfe4ea9af93e06586fa7d6b8d60534903945cbbe706d354c90272712989c58d2bf174bf
+DIST rustc-1.77.1-src.tar.xz 162796048 BLAKE2B 18a9fd095808ba78bf50ec94f7fd4087a1033ec79750aa593bacf64219c77ef90c030d41a7d8bc43f7ec8eb30b316c225024be4aeb517100ff6723487f8bb282 SHA512 e057ae638e4c3e54fdb367d48f4b85458121cee0d0ee1ed72f346940b8acad2f16cd9cc8abc16fcf4a17bf244b3300bb56a7e7be3bd0c23b034692c983b84fe8
diff --git a/sys-devel/rust-std/files/1.75.0-handle-vendored-sources.patch b/sys-devel/rust-std/files/1.75.0-handle-vendored-sources.patch
new file mode 100644
index 000000000000..c68ceba15e82
--- /dev/null
+++ b/sys-devel/rust-std/files/1.75.0-handle-vendored-sources.patch
@@ -0,0 +1,45 @@
+From 4b7e0a0b56aa2446e670dfd6558380a1039a86aa Mon Sep 17 00:00:00 2001
+From: Arlo Siemsen <arsiem@microsoft.com>
+Date: Thu, 4 Jan 2024 11:40:56 -0600
+Subject: [PATCH] Handle vendored sources when remapping paths
+
+Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
+---
+ src/bootstrap/src/core/builder.rs | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
+index 4e20babc55a..3770d0687b2 100644
+--- a/src/bootstrap/src/core/builder.rs
++++ b/src/bootstrap/src/core/builder.rs
+@@ -1799,15 +1799,20 @@ pub fn cargo(
+ }
+
+ if self.config.rust_remap_debuginfo {
+- // FIXME: handle vendored sources
+- let registry_src = t!(home::cargo_home()).join("registry").join("src");
+ let mut env_var = OsString::new();
+- for entry in t!(std::fs::read_dir(registry_src)) {
+- if !env_var.is_empty() {
+- env_var.push("\t");
+- }
+- env_var.push(t!(entry).path());
++ if self.config.vendor {
++ let vendor = self.build.src.join("vendor");
++ env_var.push(vendor);
+ env_var.push("=/rust/deps");
++ } else {
++ let registry_src = t!(home::cargo_home()).join("registry").join("src");
++ for entry in t!(std::fs::read_dir(registry_src)) {
++ if !env_var.is_empty() {
++ env_var.push("\t");
++ }
++ env_var.push(t!(entry).path());
++ env_var.push("=/rust/deps");
++ }
+ }
+ cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
+ }
+--
+2.43.0
+
diff --git a/sys-devel/rust-std/metadata.xml b/sys-devel/rust-std/metadata.xml
index 8615dcf23eb8..99067849043d 100644
--- a/sys-devel/rust-std/metadata.xml
+++ b/sys-devel/rust-std/metadata.xml
@@ -1,9 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="person">
- <email>gyakovlev@gentoo.org</email>
- <name>Georgy Yakovlev</name>
+ <maintainer type="person" proxied="yes">
+ <email>randy@electronsweatshop.com</email>
+ <name>Randy Barlow</name>
+ </maintainer>
+ <maintainer type="person" proxied="yes">
+ <email>navi@vlhl.dev</email>
+ <name>Anna Figueiredo Gomes</name>
</maintainer>
<maintainer type="project">
<email>rust@gentoo.org</email>
diff --git a/sys-devel/rust-std/rust-std-1.58.0.ebuild b/sys-devel/rust-std/rust-std-1.68.2.ebuild
index b3528f3325e7..dec75d768962 100644
--- a/sys-devel/rust-std/rust-std-1.58.0.ebuild
+++ b/sys-devel/rust-std/rust-std-1.68.2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2020-2022 Gentoo Authors
+# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_COMPAT=( python3_{9..11} )
inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
diff --git a/sys-devel/rust-std/rust-std-1.53.0.ebuild b/sys-devel/rust-std/rust-std-1.71.1.ebuild
index 7ca481644a6a..dec75d768962 100644
--- a/sys-devel/rust-std/rust-std-1.53.0.ebuild
+++ b/sys-devel/rust-std/rust-std-1.71.1.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2020-2021 Gentoo Authors
+# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_COMPAT=( python3_{9..11} )
inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
@@ -124,11 +124,12 @@ src_configure() {
[dist]
src-tarball = false
[target.${rtarget}]
+ ar = "$(tc-getAR ${CTARGET})"
cc = "$(tc-getCC ${CTARGET})"
cxx = "$(tc-getCXX ${CTARGET})"
linker = "$(tc-getCC ${CTARGET})"
- ar = "$(tc-getAR ${CTARGET})"
- $(usex elibc_musl 'crt-static = false' '')
+ ranlib = "$(tc-getRANLIB ${CTARGET})"
+ $(usev elibc_musl 'crt-static = false')
EOF
einfo "${PN^} configured with the following settings:"
diff --git a/sys-devel/rust-std/rust-std-1.56.1.ebuild b/sys-devel/rust-std/rust-std-1.72.0.ebuild
index 7ca481644a6a..dec75d768962 100644
--- a/sys-devel/rust-std/rust-std-1.56.1.ebuild
+++ b/sys-devel/rust-std/rust-std-1.72.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2020-2021 Gentoo Authors
+# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_COMPAT=( python3_{9..11} )
inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
@@ -124,11 +124,12 @@ src_configure() {
[dist]
src-tarball = false
[target.${rtarget}]
+ ar = "$(tc-getAR ${CTARGET})"
cc = "$(tc-getCC ${CTARGET})"
cxx = "$(tc-getCXX ${CTARGET})"
linker = "$(tc-getCC ${CTARGET})"
- ar = "$(tc-getAR ${CTARGET})"
- $(usex elibc_musl 'crt-static = false' '')
+ ranlib = "$(tc-getRANLIB ${CTARGET})"
+ $(usev elibc_musl 'crt-static = false')
EOF
einfo "${PN^} configured with the following settings:"
diff --git a/sys-devel/rust-std/rust-std-1.54.0.ebuild b/sys-devel/rust-std/rust-std-1.73.0.ebuild
index 7ca481644a6a..1432096c3a0d 100644
--- a/sys-devel/rust-std/rust-std-1.54.0.ebuild
+++ b/sys-devel/rust-std/rust-std-1.73.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2020-2021 Gentoo Authors
+# Copyright 2020-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_COMPAT=( python3_{9..12} )
inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
@@ -11,7 +11,7 @@ DESCRIPTION="Rust standard library, standalone (for crossdev)"
HOMEPAGE="https://www.rust-lang.org"
SRC_URI="https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz"
-LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4"
SLOT="stable/$(ver_cut 1-2)"
# please do not keyword
#KEYWORDS="" #nowarn
@@ -124,11 +124,12 @@ src_configure() {
[dist]
src-tarball = false
[target.${rtarget}]
+ ar = "$(tc-getAR ${CTARGET})"
cc = "$(tc-getCC ${CTARGET})"
cxx = "$(tc-getCXX ${CTARGET})"
linker = "$(tc-getCC ${CTARGET})"
- ar = "$(tc-getAR ${CTARGET})"
- $(usex elibc_musl 'crt-static = false' '')
+ ranlib = "$(tc-getRANLIB ${CTARGET})"
+ $(usev elibc_musl 'crt-static = false')
EOF
einfo "${PN^} configured with the following settings:"
diff --git a/sys-devel/rust-std/rust-std-1.74.1.ebuild b/sys-devel/rust-std/rust-std-1.74.1.ebuild
new file mode 100644
index 000000000000..1432096c3a0d
--- /dev/null
+++ b/sys-devel/rust-std/rust-std-1.74.1.ebuild
@@ -0,0 +1,155 @@
+# Copyright 2020-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..12} )
+
+inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
+
+DESCRIPTION="Rust standard library, standalone (for crossdev)"
+HOMEPAGE="https://www.rust-lang.org"
+SRC_URI="https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz"
+
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4"
+SLOT="stable/$(ver_cut 1-2)"
+# please do not keyword
+#KEYWORDS="" #nowarn
+IUSE="debug"
+
+BDEPEND="
+ ${PYTHON_DEPS}
+ ~dev-lang/rust-${PV}:=
+"
+
+DEPEND="||
+ (
+ >="${CATEGORY}"/gcc-4.7:*
+ >="${CATEGORY}"/clang-3.5:*
+ )
+"
+
+RDEPEND="${DEPEND}"
+
+# need full compiler to run tests
+RESTRICT="test"
+
+QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
+
+S="${WORKDIR}/${P/-std/c}-src"
+
+#
+# The cross magic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_cross() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+toml_usex() {
+ usex "$1" true false
+}
+
+pkg_pretend() {
+ is_cross || die "${PN} should only be used for cross"
+}
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+}
+
+src_configure() {
+ # do the great cleanup
+ strip-flags
+ filter-flags '-mcpu=*' '-march=*' '-mtune=*' '-m32' '-m64'
+ strip-unsupported-flags
+
+ local rust_root x
+ rust_root="$(rustc --print sysroot)"
+ rtarget="$(rust_abi ${CTARGET})"
+ rtarget="${ERUST_STD_RTARGET:-${rtarget}}" # some targets need to be custom.
+ rbuild="$(rust_abi ${CBUILD})"
+ rhost="$(rust_abi ${CHOST})"
+
+ echo
+ for x in CATEGORY rust_root rbuild rhost rtarget RUSTFLAGS CFLAGS CXXFLAGS LDFLAGS; do
+ einfo "$(printf '%10s' ${x^^}:) ${!x}"
+ done
+
+ cat <<- EOF > "${S}"/config.toml
+ [build]
+ build = "${rbuild}"
+ host = ["${rhost}"]
+ target = ["${rtarget}"]
+ cargo = "${rust_root}/bin/cargo"
+ rustc = "${rust_root}/bin/rustc"
+ submodules = false
+ python = "${EPYTHON}"
+ locked-deps = true
+ vendor = true
+ extended = true
+ verbose = 2
+ cargo-native-static = false
+ [install]
+ prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
+ sysconfdir = "etc"
+ docdir = "share/doc/rust"
+ bindir = "bin"
+ libdir = "lib"
+ mandir = "share/man"
+ [rust]
+ # https://github.com/rust-lang/rust/issues/54872
+ codegen-units-std = 1
+ optimize = true
+ debug = $(toml_usex debug)
+ debug-assertions = $(toml_usex debug)
+ debuginfo-level-rustc = 0
+ backtrace = true
+ incremental = false
+ default-linker = "$(tc-getCC)"
+ rpath = false
+ dist-src = false
+ remap-debuginfo = true
+ jemalloc = false
+ [dist]
+ src-tarball = false
+ [target.${rtarget}]
+ ar = "$(tc-getAR ${CTARGET})"
+ cc = "$(tc-getCC ${CTARGET})"
+ cxx = "$(tc-getCXX ${CTARGET})"
+ linker = "$(tc-getCC ${CTARGET})"
+ ranlib = "$(tc-getRANLIB ${CTARGET})"
+ $(usev elibc_musl 'crt-static = false')
+ EOF
+
+ einfo "${PN^} configured with the following settings:"
+ cat "${S}"/config.toml || die
+}
+
+src_compile() {
+ env RUST_BACKTRACE=1 \
+ "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \
+ library/std --stage 0 || die
+}
+
+src_test() {
+ ewarn "${PN} can't run tests"
+}
+
+src_install() {
+ local rustlib="lib/rust/${PV}/lib/rustlib"
+ dodir "/usr/${rustlib}"
+ pushd "build/${rhost}/stage0-sysroot/lib/rustlib" > /dev/null || die
+ cp -pPRv "${rtarget}" "${ED}/usr/${rustlib}" || die
+ popd > /dev/null || die
+}
diff --git a/sys-devel/rust-std/rust-std-1.55.0.ebuild b/sys-devel/rust-std/rust-std-1.75.0.ebuild
index 7ca481644a6a..c63efccf3b0c 100644
--- a/sys-devel/rust-std/rust-std-1.55.0.ebuild
+++ b/sys-devel/rust-std/rust-std-1.75.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2020-2021 Gentoo Authors
+# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
-PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_COMPAT=( python3_{9..12} )
inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
@@ -11,7 +11,7 @@ DESCRIPTION="Rust standard library, standalone (for crossdev)"
HOMEPAGE="https://www.rust-lang.org"
SRC_URI="https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz"
-LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4 UoI-NCSA"
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4"
SLOT="stable/$(ver_cut 1-2)"
# please do not keyword
#KEYWORDS="" #nowarn
@@ -36,6 +36,10 @@ RESTRICT="test"
QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
+PATCHES=(
+ "${FILESDIR}"/1.75.0-handle-vendored-sources.patch # remove for >=1.77.0
+)
+
S="${WORKDIR}/${P/-std/c}-src"
#
@@ -124,11 +128,12 @@ src_configure() {
[dist]
src-tarball = false
[target.${rtarget}]
+ ar = "$(tc-getAR ${CTARGET})"
cc = "$(tc-getCC ${CTARGET})"
cxx = "$(tc-getCXX ${CTARGET})"
linker = "$(tc-getCC ${CTARGET})"
- ar = "$(tc-getAR ${CTARGET})"
- $(usex elibc_musl 'crt-static = false' '')
+ ranlib = "$(tc-getRANLIB ${CTARGET})"
+ $(usev elibc_musl 'crt-static = false')
EOF
einfo "${PN^} configured with the following settings:"
diff --git a/sys-devel/rust-std/rust-std-1.76.0.ebuild b/sys-devel/rust-std/rust-std-1.76.0.ebuild
new file mode 100644
index 000000000000..c63efccf3b0c
--- /dev/null
+++ b/sys-devel/rust-std/rust-std-1.76.0.ebuild
@@ -0,0 +1,159 @@
+# Copyright 2020-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..12} )
+
+inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
+
+DESCRIPTION="Rust standard library, standalone (for crossdev)"
+HOMEPAGE="https://www.rust-lang.org"
+SRC_URI="https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz"
+
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4"
+SLOT="stable/$(ver_cut 1-2)"
+# please do not keyword
+#KEYWORDS="" #nowarn
+IUSE="debug"
+
+BDEPEND="
+ ${PYTHON_DEPS}
+ ~dev-lang/rust-${PV}:=
+"
+
+DEPEND="||
+ (
+ >="${CATEGORY}"/gcc-4.7:*
+ >="${CATEGORY}"/clang-3.5:*
+ )
+"
+
+RDEPEND="${DEPEND}"
+
+# need full compiler to run tests
+RESTRICT="test"
+
+QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
+
+PATCHES=(
+ "${FILESDIR}"/1.75.0-handle-vendored-sources.patch # remove for >=1.77.0
+)
+
+S="${WORKDIR}/${P/-std/c}-src"
+
+#
+# The cross magic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_cross() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+toml_usex() {
+ usex "$1" true false
+}
+
+pkg_pretend() {
+ is_cross || die "${PN} should only be used for cross"
+}
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+}
+
+src_configure() {
+ # do the great cleanup
+ strip-flags
+ filter-flags '-mcpu=*' '-march=*' '-mtune=*' '-m32' '-m64'
+ strip-unsupported-flags
+
+ local rust_root x
+ rust_root="$(rustc --print sysroot)"
+ rtarget="$(rust_abi ${CTARGET})"
+ rtarget="${ERUST_STD_RTARGET:-${rtarget}}" # some targets need to be custom.
+ rbuild="$(rust_abi ${CBUILD})"
+ rhost="$(rust_abi ${CHOST})"
+
+ echo
+ for x in CATEGORY rust_root rbuild rhost rtarget RUSTFLAGS CFLAGS CXXFLAGS LDFLAGS; do
+ einfo "$(printf '%10s' ${x^^}:) ${!x}"
+ done
+
+ cat <<- EOF > "${S}"/config.toml
+ [build]
+ build = "${rbuild}"
+ host = ["${rhost}"]
+ target = ["${rtarget}"]
+ cargo = "${rust_root}/bin/cargo"
+ rustc = "${rust_root}/bin/rustc"
+ submodules = false
+ python = "${EPYTHON}"
+ locked-deps = true
+ vendor = true
+ extended = true
+ verbose = 2
+ cargo-native-static = false
+ [install]
+ prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
+ sysconfdir = "etc"
+ docdir = "share/doc/rust"
+ bindir = "bin"
+ libdir = "lib"
+ mandir = "share/man"
+ [rust]
+ # https://github.com/rust-lang/rust/issues/54872
+ codegen-units-std = 1
+ optimize = true
+ debug = $(toml_usex debug)
+ debug-assertions = $(toml_usex debug)
+ debuginfo-level-rustc = 0
+ backtrace = true
+ incremental = false
+ default-linker = "$(tc-getCC)"
+ rpath = false
+ dist-src = false
+ remap-debuginfo = true
+ jemalloc = false
+ [dist]
+ src-tarball = false
+ [target.${rtarget}]
+ ar = "$(tc-getAR ${CTARGET})"
+ cc = "$(tc-getCC ${CTARGET})"
+ cxx = "$(tc-getCXX ${CTARGET})"
+ linker = "$(tc-getCC ${CTARGET})"
+ ranlib = "$(tc-getRANLIB ${CTARGET})"
+ $(usev elibc_musl 'crt-static = false')
+ EOF
+
+ einfo "${PN^} configured with the following settings:"
+ cat "${S}"/config.toml || die
+}
+
+src_compile() {
+ env RUST_BACKTRACE=1 \
+ "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \
+ library/std --stage 0 || die
+}
+
+src_test() {
+ ewarn "${PN} can't run tests"
+}
+
+src_install() {
+ local rustlib="lib/rust/${PV}/lib/rustlib"
+ dodir "/usr/${rustlib}"
+ pushd "build/${rhost}/stage0-sysroot/lib/rustlib" > /dev/null || die
+ cp -pPRv "${rtarget}" "${ED}/usr/${rustlib}" || die
+ popd > /dev/null || die
+}
diff --git a/sys-devel/rust-std/rust-std-1.77.1.ebuild b/sys-devel/rust-std/rust-std-1.77.1.ebuild
new file mode 100644
index 000000000000..7037dfd72e6f
--- /dev/null
+++ b/sys-devel/rust-std/rust-std-1.77.1.ebuild
@@ -0,0 +1,155 @@
+# Copyright 2020-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..12} )
+
+inherit flag-o-matic multiprocessing python-any-r1 rust-toolchain toolchain-funcs
+
+DESCRIPTION="Rust standard library, standalone (for crossdev)"
+HOMEPAGE="https://www.rust-lang.org"
+SRC_URI="https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz"
+
+LICENSE="|| ( MIT Apache-2.0 ) BSD-1 BSD-2 BSD-4"
+SLOT="stable/$(ver_cut 1-2)"
+# please do not keyword
+#KEYWORDS="" #nowarn
+IUSE="debug"
+
+BDEPEND="
+ ${PYTHON_DEPS}
+ ~dev-lang/rust-${PV}:=
+"
+
+DEPEND="||
+ (
+ >="${CATEGORY}"/gcc-4.7:*
+ >="${CATEGORY}"/clang-3.5:*
+ )
+"
+
+RDEPEND="${DEPEND}"
+
+# need full compiler to run tests
+RESTRICT="test"
+
+QA_FLAGS_IGNORED="usr/lib/rust/${PV}/rustlib/.*/lib/lib.*.so"
+
+S="${WORKDIR}/${P/-std/c}-src"
+
+#
+# The cross magic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+is_cross() {
+ [[ ${CHOST} != ${CTARGET} ]]
+}
+
+toml_usex() {
+ usex "$1" true false
+}
+
+pkg_pretend() {
+ is_cross || die "${PN} should only be used for cross"
+}
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ default
+}
+
+src_configure() {
+ # do the great cleanup
+ strip-flags
+ filter-flags '-mcpu=*' '-march=*' '-mtune=*' '-m32' '-m64'
+ strip-unsupported-flags
+
+ local rust_root x
+ rust_root="$(rustc --print sysroot)"
+ rtarget="$(rust_abi ${CTARGET})"
+ rtarget="${ERUST_STD_RTARGET:-${rtarget}}" # some targets need to be custom.
+ rbuild="$(rust_abi ${CBUILD})"
+ rhost="$(rust_abi ${CHOST})"
+
+ echo
+ for x in CATEGORY rust_root rbuild rhost rtarget RUSTFLAGS CFLAGS CXXFLAGS LDFLAGS; do
+ einfo "$(printf '%10s' ${x^^}:) ${!x}"
+ done
+
+ cat <<- EOF > "${S}"/config.toml
+ [build]
+ build = "${rbuild}"
+ host = ["${rhost}"]
+ target = ["${rtarget}"]
+ cargo = "${rust_root}/bin/cargo"
+ rustc = "${rust_root}/bin/rustc"
+ submodules = false
+ python = "${EPYTHON}"
+ locked-deps = true
+ vendor = true
+ extended = true
+ verbose = 2
+ cargo-native-static = false
+ [install]
+ prefix = "${EPREFIX}/usr/lib/${PN}/${PV}"
+ sysconfdir = "etc"
+ docdir = "share/doc/rust"
+ bindir = "bin"
+ libdir = "lib"
+ mandir = "share/man"
+ [rust]
+ # https://github.com/rust-lang/rust/issues/54872
+ codegen-units-std = 1
+ optimize = true
+ debug = $(toml_usex debug)
+ debug-assertions = $(toml_usex debug)
+ debuginfo-level-rustc = 0
+ backtrace = true
+ incremental = false
+ default-linker = "$(tc-getCC)"
+ rpath = false
+ dist-src = false
+ remap-debuginfo = true
+ jemalloc = false
+ [dist]
+ src-tarball = false
+ [target.${rtarget}]
+ ar = "$(tc-getAR ${CTARGET})"
+ cc = "$(tc-getCC ${CTARGET})"
+ cxx = "$(tc-getCXX ${CTARGET})"
+ linker = "$(tc-getCC ${CTARGET})"
+ ranlib = "$(tc-getRANLIB ${CTARGET})"
+ $(usev elibc_musl 'crt-static = false')
+ EOF
+
+ einfo "${PN^} configured with the following settings:"
+ cat "${S}"/config.toml || die
+}
+
+src_compile() {
+ env RUST_BACKTRACE=1 \
+ "${EPYTHON}" ./x.py build -vv --config="${S}"/config.toml -j$(makeopts_jobs) \
+ library/std --stage 0 || die
+}
+
+src_test() {
+ ewarn "${PN} can't run tests"
+}
+
+src_install() {
+ local rustlib="lib/rust/${PV}/lib/rustlib"
+ dodir "/usr/${rustlib}"
+ pushd "build/${rhost}/stage0-sysroot/lib/rustlib" > /dev/null || die
+ cp -pPRv "${rtarget}" "${ED}/usr/${rustlib}" || die
+ popd > /dev/null || die
+}
diff --git a/sys-devel/slibtool/Manifest b/sys-devel/slibtool/Manifest
deleted file mode 100644
index 0a7b2da67762..000000000000
--- a/sys-devel/slibtool/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST slibtool-0.5.34.tar.xz 79720 BLAKE2B 3a692d7485dcf2277f7ed99fe1ad67cf5fd33d8fe0a527d64634b0e7f956a5f58b92d812396f00d872ceb8509e058ae1a026f16a65feb2e79a9fff7bd60290da SHA512 3f7f6e4f45c4c2ae5ba5533152f08269cd77ca6fa2f3a515802bc23c7ac505b2d7340098fa98962c79035129cfd4077205596309f4acd1d634b9a1d6e2c0e96c
-DIST slibtool-0.5.34.tar.xz.sig 833 BLAKE2B 52df017d8ae3056e259a5283b0a4cea119a5ab4ce95e6c894d0d2e98fc10db101039a57c9a2a771f677c9d0afaad9273095ebdb078fca146a3d67ea25e9261fb SHA512 9f8415431a0b43e7be9a808dd6ed138a9b34b7b2c4af3ab406bdbc456ec31c877f13bc0b056ab9a50bec0b0cf1b654a133085f8523e70c8cb7d3851652d34ff7
diff --git a/sys-devel/slibtool/metadata.xml b/sys-devel/slibtool/metadata.xml
deleted file mode 100644
index 26b0002e202f..000000000000
--- a/sys-devel/slibtool/metadata.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="person" proxied="yes">
- <email>felix.janda@posteo.de</email>
- <name>Felix Janda</name>
- </maintainer>
- <maintainer type="person">
- <email>sam@gentoo.org</email>
- <name>Sam James</name>
- </maintainer>
- <maintainer type="project" proxied="proxy">
- <email>proxy-maint@gentoo.org</email>
- <name>Proxy Maintainers</name>
- </maintainer>
-</pkgmetadata>
diff --git a/sys-devel/slibtool/slibtool-0.5.34.ebuild b/sys-devel/slibtool/slibtool-0.5.34.ebuild
deleted file mode 100644
index 589a18d68165..000000000000
--- a/sys-devel/slibtool/slibtool-0.5.34.ebuild
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs
-
-# git.foss21.org is the official repository per upstream
-DESCRIPTION="A skinny libtool implementation, written in C"
-HOMEPAGE="https://git.foss21.org/slibtool"
-if [[ "${PV}" == *9999 ]] ; then
- inherit git-r3
- EGIT_REPO_URI="https://git.foss21.org/slibtool"
-else
- VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/midipix.asc
- inherit verify-sig
-
- SRC_URI="https://dl.midipix.org/slibtool/${P}.tar.xz"
- SRC_URI+=" verify-sig? ( https://dl.midipix.org/slibtool/${P}.tar.xz.sig )"
-
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
-
- BDEPEND="verify-sig? ( sec-keys/openpgp-keys-midipix )"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-
-src_configure() {
- # Custom configure script (not generated by autoconf)
- ./configure \
- --compiler=$(tc-getCC) \
- --host=${CHOST} \
- --prefix="${EPREFIX}"/usr \
- || die
-}
diff --git a/sys-devel/slibtool/slibtool-9999.ebuild b/sys-devel/slibtool/slibtool-9999.ebuild
deleted file mode 100644
index be4f199900aa..000000000000
--- a/sys-devel/slibtool/slibtool-9999.ebuild
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs
-
-# git.foss21.org is the official repository per upstream
-DESCRIPTION="A skinny libtool implementation, written in C"
-HOMEPAGE="https://git.foss21.org/slibtool"
-if [[ "${PV}" == *9999 ]] ; then
- inherit git-r3
- EGIT_REPO_URI="https://git.foss21.org/slibtool"
-else
- VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/midipix.asc
- inherit verify-sig
-
- SRC_URI="https://dl.midipix.org/slibtool/${P}.tar.xz"
- SRC_URI+=" verify-sig? ( https://dl.midipix.org/slibtool/${P}.tar.xz.sig )"
-
- KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x64-macos"
-
- BDEPEND="verify-sig? ( sec-keys/openpgp-keys-midipix )"
-fi
-
-LICENSE="MIT"
-SLOT="0"
-
-src_configure() {
- # Custom configure script (not generated by autoconf)
- ./configure \
- --compiler=$(tc-getCC) \
- --host=${CHOST} \
- --prefix="${EPREFIX}"/usr \
- || die
-}
diff --git a/sys-devel/smatch/Manifest b/sys-devel/smatch/Manifest
index a99bf33cb4d0..9ca3a1ada7b3 100644
--- a/sys-devel/smatch/Manifest
+++ b/sys-devel/smatch/Manifest
@@ -1,2 +1 @@
-DIST smatch-1.60.tar.gz 558479 BLAKE2B d5e564c32e33dc38847f9a258b4b47285f190652181db9b8850c832c0cf4d8a3302d989a7b42592e73a713927a29565565e83a9be1b0a5c9d10869fce278a0be SHA512 2920c9d4c500db36cfa60db5be70d157ed16abd729279462faef6f79e0756bd017ec91b8f857d19fdebd8a9d709b0555635700a2864cf0a84daa61cf2ca3eecd
DIST smatch-1.72.tar.gz 1431923 BLAKE2B ec4119fce985876afc9a46a74a0a56e8e8cb271a964c16496972c59ade95aa3d2df3a839a819e31cb081ca8a3b1f6bf6934ec97d73209091cfd86c87c1433557 SHA512 6d12e9ba85f332fcc56657296596e811cf3b75d4ad37007e07feb31baa4b315732361915972a2139ae13f75b8a73f953488ceb9de41529db9e84c81fb6fde77e
diff --git a/sys-devel/smatch/smatch-1.60.ebuild b/sys-devel/smatch/smatch-1.60.ebuild
deleted file mode 100644
index 04dfbb1b49ac..000000000000
--- a/sys-devel/smatch/smatch-1.60.ebuild
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit toolchain-funcs
-if [[ ${PV} == "9999" ]] ; then
- EGIT_REPO_URI="https://repo.or.cz/${PN}.git
- https://repo.or.cz/r/${PN}.git"
- inherit git-r3
-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 ~sparc ~x86"
- S=${WORKDIR}/${PN}
-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}"
-BDEPEND="virtual/pkgconfig"
-
-S=${WORKDIR}/${P}-7a4fdad
-
-src_prepare() {
- default
-
- sed -i \
- -e '/^CFLAGS =/{s:=:+=:;s:-O2 -finline-functions:${CPPFLAGS}:}' \
- -e 's:pkg-config:$(PKG_CONFIG):' \
- 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)' \
- PKG_CONFIG="$(tc-getPKG_CONFIG)" \
- 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-1.72.ebuild b/sys-devel/smatch/smatch-1.72.ebuild
index 9006835c81bb..adff98d916f1 100644
--- a/sys-devel/smatch/smatch-1.72.ebuild
+++ b/sys-devel/smatch/smatch-1.72.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
-if [[ ${PV} == "9999" ]] ; then
+if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://repo.or.cz/${PN}.git
https://repo.or.cz/r/${PN}.git"
inherit git-r3
@@ -20,7 +20,8 @@ fi
DESCRIPTION="Static analysis tool for C"
HOMEPAGE="http://smatch.sourceforge.net/"
-LICENSE="OSL-1.1"
+# bug #853733
+LICENSE="GPL-2+ MIT OSL-1.1"
SLOT="0"
RDEPEND="dev-db/sqlite"
diff --git a/sys-devel/smatch/smatch-9999.ebuild b/sys-devel/smatch/smatch-9999.ebuild
index 9006835c81bb..adff98d916f1 100644
--- a/sys-devel/smatch/smatch-9999.ebuild
+++ b/sys-devel/smatch/smatch-9999.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs
-if [[ ${PV} == "9999" ]] ; then
+if [[ ${PV} == 9999 ]] ; then
EGIT_REPO_URI="https://repo.or.cz/${PN}.git
https://repo.or.cz/r/${PN}.git"
inherit git-r3
@@ -20,7 +20,8 @@ fi
DESCRIPTION="Static analysis tool for C"
HOMEPAGE="http://smatch.sourceforge.net/"
-LICENSE="OSL-1.1"
+# bug #853733
+LICENSE="GPL-2+ MIT OSL-1.1"
SLOT="0"
RDEPEND="dev-db/sqlite"
diff --git a/sys-devel/sparse/metadata.xml b/sys-devel/sparse/metadata.xml
index aec196782c68..4eec8f82d259 100644
--- a/sys-devel/sparse/metadata.xml
+++ b/sys-devel/sparse/metadata.xml
@@ -10,7 +10,7 @@
<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="gtk">Build the test-inspect utility (requires <pkg>x11-libs/gtk+</pkg>:3)</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>
diff --git a/sys-devel/sparse/sparse-0.6.4.ebuild b/sys-devel/sparse/sparse-0.6.4-r2.ebuild
index 6fbcc28e1552..726fd8b0cfe3 100644
--- a/sys-devel/sparse/sparse-0.6.4.ebuild
+++ b/sys-devel/sparse/sparse-0.6.4-r2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-LLVM_MAX_SLOT=12
+LLVM_MAX_SLOT=14
inherit llvm toolchain-funcs
DESCRIPTION="C semantic parser"
@@ -22,7 +22,7 @@ SLOT="0"
IUSE="gtk llvm sqlite test xml"
RESTRICT="!test? ( test )"
-RDEPEND="gtk? ( x11-libs/gtk+:2 )
+RDEPEND="gtk? ( x11-libs/gtk+:3 )
llvm? ( <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):= )
sqlite? ( dev-db/sqlite:= )
xml? ( dev-libs/libxml2 )"
diff --git a/sys-devel/sparse/sparse-9999.ebuild b/sys-devel/sparse/sparse-9999.ebuild
index 6fbcc28e1552..726fd8b0cfe3 100644
--- a/sys-devel/sparse/sparse-9999.ebuild
+++ b/sys-devel/sparse/sparse-9999.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-LLVM_MAX_SLOT=12
+LLVM_MAX_SLOT=14
inherit llvm toolchain-funcs
DESCRIPTION="C semantic parser"
@@ -22,7 +22,7 @@ SLOT="0"
IUSE="gtk llvm sqlite test xml"
RESTRICT="!test? ( test )"
-RDEPEND="gtk? ( x11-libs/gtk+:2 )
+RDEPEND="gtk? ( x11-libs/gtk+:3 )
llvm? ( <sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):= )
sqlite? ( dev-db/sqlite:= )
xml? ( dev-libs/libxml2 )"
diff --git a/sys-devel/ucpp/Manifest b/sys-devel/ucpp/Manifest
deleted file mode 100644
index 9e88317c43e1..000000000000
--- a/sys-devel/ucpp/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST ucpp-1.3.5.tar.xz 289468 BLAKE2B 6a038cc5d02f080747a321a55af66f2072503a5c0a554492ea8aed34ff9c3b7b85e3778114e18c3e09f06f1472a1479f39c96997404e0345153a1f84e3f9daee SHA512 3ded8f7bc2b238adb6e7f4162aee48e039dfe7cee31b700c38e8f147634d47cd1ceaf39c343549b0d4a58358e6b9743f7e84f87b253dc19c05e543d68ade24ce
diff --git a/sys-devel/ucpp/metadata.xml b/sys-devel/ucpp/metadata.xml
deleted file mode 100644
index 838b9553c0a1..000000000000
--- a/sys-devel/ucpp/metadata.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://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>
- <upstream>
- <remote-id type="gitlab">scarabeusiv/ucpp</remote-id>
- </upstream>
-</pkgmetadata>
diff --git a/sys-devel/ucpp/ucpp-1.3.5.ebuild b/sys-devel/ucpp/ucpp-1.3.5.ebuild
deleted file mode 100644
index b82c336b6ab7..000000000000
--- a/sys-devel/ucpp/ucpp-1.3.5.ebuild
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-DESCRIPTION="Library for preprocessing C compliant to ISO-C99"
-HOMEPAGE="https://gitlab.com/scarabeusiv/ucpp"
-SRC_URI="https://gitlab.com/scarabeusiv/${PN}/uploads/79f08e39c676f15ed8a59335f6c9b924/${P}.tar.xz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="amd64 ~arm arm64 ppc ~ppc64 x86 ~amd64-linux"
-
-src_configure() {
- econf \
- --disable-werror \
- --disable-static
-}
-
-src_install() {
- default
-
- # no static archives
- find "${ED}" -name '*.la' -type f -delete || die
-}