From bad9bf87b08d293eb79ebe14d1882e77da2b0ced Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 21 Aug 2024 12:26:06 +0100 Subject: gentoo auto-resync : 21:08:2024 - 12:26:06 --- sys-devel/Manifest.gz | Bin 7867 -> 7863 bytes sys-devel/binutils/Manifest | 2 + sys-devel/binutils/binutils-2.43-r1.ebuild | 557 +++++++++++++++++++++ sys-devel/bpf-toolchain/Manifest | 2 + .../bpf-toolchain/bpf-toolchain-14.2.0_p1.ebuild | 232 +++++++++ sys-devel/clang-common/Manifest | 3 + .../clang-common/clang-common-19.1.0_rc3.ebuild | 304 +++++++++++ sys-devel/clang-runtime/Manifest | 1 + .../clang-runtime/clang-runtime-19.1.0_rc3.ebuild | 39 ++ sys-devel/clang/Manifest | 3 + sys-devel/clang/clang-19.1.0_rc3.ebuild | 470 +++++++++++++++++ sys-devel/lld/Manifest | 3 + sys-devel/lld/lld-19.1.0_rc3.ebuild | 93 ++++ sys-devel/llvm-common/Manifest | 3 + .../llvm-common/llvm-common-19.1.0_rc3.ebuild | 53 ++ sys-devel/llvm/Manifest | 3 + sys-devel/llvm/llvm-19.1.0_rc3.ebuild | 547 ++++++++++++++++++++ 17 files changed, 2315 insertions(+) create mode 100644 sys-devel/binutils/binutils-2.43-r1.ebuild create mode 100644 sys-devel/bpf-toolchain/bpf-toolchain-14.2.0_p1.ebuild create mode 100644 sys-devel/clang-common/clang-common-19.1.0_rc3.ebuild create mode 100644 sys-devel/clang-runtime/clang-runtime-19.1.0_rc3.ebuild create mode 100644 sys-devel/clang/clang-19.1.0_rc3.ebuild create mode 100644 sys-devel/lld/lld-19.1.0_rc3.ebuild create mode 100644 sys-devel/llvm-common/llvm-common-19.1.0_rc3.ebuild create mode 100644 sys-devel/llvm/llvm-19.1.0_rc3.ebuild (limited to 'sys-devel') diff --git a/sys-devel/Manifest.gz b/sys-devel/Manifest.gz index 3dde05cec8d4..9d48099c753c 100644 Binary files a/sys-devel/Manifest.gz and b/sys-devel/Manifest.gz differ diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest index aefba18ef915..c1c5719cd5ff 100644 --- a/sys-devel/binutils/Manifest +++ b/sys-devel/binutils/Manifest @@ -31,6 +31,7 @@ DIST binutils-2.42-patches-3.tar.xz 34768 BLAKE2B e4bfaf3b42147408a8a3dcb00f5037 DIST binutils-2.42-patches-6.tar.xz 50664 BLAKE2B f13b65a761cfba80caf2e4740c6383b40305558365b950fba22aca95a104e799e8bd476082f36fb9288de4f224b09f317792c1444e549c40d15a4b64cdf61989 SHA512 1203eca0a9e622411eac377509de8fd0db3ffcb282ac38ab7a0369b166cc1091197daad85b51b145b34a4832f1a1a4d573c8254e8d67aeb22f35adb1ab3ece1f DIST binutils-2.42.tar.xz 27567160 BLAKE2B e67a5c028fba70e70088fd11b38ec8c9c4ed5a019badefda25abeb6275997b16f0891e7ff3424c4b82bbfae92e8992669826920dd53df61cd48469d8f7cd5bd1 SHA512 155f3ba14cd220102f4f29a4f1e5cfee3c48aa03b74603460d05afb73c70d6657a9d87eee6eb88bf13203fe6f31177a5c9addc04384e956e7da8069c8ecd20a6 DIST binutils-2.43-patches-1.tar.xz 11644 BLAKE2B 578ee67c3c5e67f9191a31a5c83ffcc781f757f8aaee3eea14d052db427cdd2bc769977dba16e9a8c653dcc4a94f11c149898683945d5035d0beeac128045b1a SHA512 e6db4eaf4fbea366e607a7e9a56e20851fcc34664532fd6aa1f0818271c3e2687eada3daca482e211a2b3e36be85e7e0b23158caaa0fdf9785d13a9156e8c734 +DIST binutils-2.43-patches-2.tar.xz 35184 BLAKE2B fa35c9f182c7ae0fed28614f47618d1563a58f223fd1805f348b618c1fbf039a444e44d88f46d040b6971e481e0da882e5c4492fd167d17bf39579d87a446434 SHA512 a7e167d3f6a2c08f19af4685d90a6160a1a52f1a87f5660fb6d80ec664033829c0eacad0d77b1306620e50ff89d1f9f63a7c2b064ad9775400f0cb0eba3159a4 DIST binutils-2.43.tar.xz 28175768 BLAKE2B 28b0a04a28273b76eab2d00e00160be889f155f77f5a9d8759ef8dce505c97e97641bf7ec70b92b731b520570a02b06e04e8215b068fcb1bb2573e9ef24732d9 SHA512 93e063163e54d6a6ee2bd48dc754270bf757a3635b49a702ed6b310e929e94063958512d191e66beaf44275f7ea60865dbde138b624626739679fcc306b133bb EBUILD binutils-2.32-r2.ebuild 11663 BLAKE2B 61a63da4670dc6eda4957984fe3275dbfa4aec9587df4e4153be999b5bd0c54e5cc8baff866ddce84105f7143fc8dfcd2451099b06cb3f613e5a5a984fd4cc22 SHA512 f0777a02d983f34baf88a6e6d5a05367bba1c4cfd04fd7e285e04865e64e21208910ffb9e8723282fe815860a9d9876a409311655b20854edcc0730b69143d14 EBUILD binutils-2.33.1-r1.ebuild 11399 BLAKE2B d015914b62b98150cb9f33408ffe72588727cbf96a5b0bd791069f806212c180547886a2662b21c264bb5cd681196998839220a8e69d3971a8e1edb9cba1fc2c SHA512 282fc7065c6f3005407afe56fe0a4b77becb53b9a6f31e17bb3022a14da9b697a385bf3ae4f36f66b7c78449649e0df7f81aba64c5a82cd63e6040f7c9d3323d @@ -44,6 +45,7 @@ EBUILD binutils-2.40-r9.ebuild 14132 BLAKE2B ea7d8298ab644f3c4d1c2ca620949cef1f2 EBUILD binutils-2.41-r5.ebuild 14654 BLAKE2B 2049e8618a6aa4385bf036726a027cc2e58ce1e5e00d35d1d9926846f0209fcfe958d42e7ad4de6ea474bc8dd728c6f8d706121867e2c39e1404621deb15a1af SHA512 feeb65fc8ed360235fddc9d287d4aa28109ea60504283332940133eb40bcc0be5799a400c1da8aa7cf0e4038ebc8619ee225d6baf83ddc9f1d923c2ba2ded675 EBUILD binutils-2.42-r1.ebuild 15573 BLAKE2B 519d29431da4ea9c3d04e2e8baf923135d42042b8e1d06f57dfe58166fff618e2a790a64471d99ffd74a652114ce7382d5f546feb3e1484374f02e63a2f9d36b SHA512 9ef4b4df659786205130f0010407ff7955885fdbc09c696d85b62663e75b09dd01a7255b526fbb082c0c319d8f5603f6a46c7292a04e7f6f2394713d95386974 EBUILD binutils-2.42-r2.ebuild 15757 BLAKE2B c4ef7bd29af55cddbcb1d360f65c228866e4edfe32d6b1dbe6ca2198d3f9613a336bc2ca9a4432e6d8c9b556136ca294e797990b864b7cc53bd9dc55ea63e885 SHA512 4fd200c7603dfec62b69c5987a12e74697e028e22de07837b12d84d2b5a7a5fbad81caf25c768303044bb94d8a160affc2484eb3362473436cf3954bd29de7c6 +EBUILD binutils-2.43-r1.ebuild 15848 BLAKE2B 4c203f676ebd964fbecbacae27e54d1b8bda2751b3b9f7b291c810b52805b2925e22460270e47fdaa19503cf6205edc1721e5675902cdac32b969bcf12af4b29 SHA512 1e70aedd622558a0f5eb5ec3491b0bbd86993092cd6054379a66e7d26d42b8a6e915d02395c7ce083a9ae3f9ea486816a673c732e3640ab8a8c2fe5383c0a77c EBUILD binutils-2.43.9999.ebuild 15855 BLAKE2B 6e456c981c1b007057d0e8a344bfb066c6690e04dc968bb83d5e50e4112a550ee94368bb73f72f8b39f196259fabff8ff79f97a9510d50479f6919ccb8f1522a SHA512 67d4a5eefa8d63b6170ac460a5a366f39afbc4c6788f4397f28a855e2db942603ce7f991ced1b1d60636f4876f89727851d3fd0843be69bde6fbe6c7f9a3b04c EBUILD binutils-2.43.ebuild 15847 BLAKE2B e863cfa9d5993fe3faed07818a541245718842fa7fab44c6269fcffedde99e1111f9d2058d77205efec4bebafd728e135b9d206049cf7bcfc3f75890a762971e SHA512 dd2524dd671f21b129be058eba1e7e9a41ceff5e552f1af8708b318d024fd28cec396a49420a5eb250cad02bc27178738743a42da2d4c9f9797ad1d778059e8f EBUILD binutils-9999.ebuild 15908 BLAKE2B 45b63d8abea50e1cc2abe1c94cf9d4ca7244ac59c7992c994df9b9bfae138b8be59b2b7380c83c5c89f778e15cccec5148ce08eefc7f6daa3ce7bbc3f8eea669 SHA512 8de6cdc2f925ad995664983f145ba1a14fdbaa32ec69d3f716ddbea87829a726650158fcef1621cfa526ba7b8cfbba601308f458ace46e4c1374dd00c799b457 diff --git a/sys-devel/binutils/binutils-2.43-r1.ebuild b/sys-devel/binutils/binutils-2.43-r1.ebuild new file mode 100644 index 000000000000..e09db32d1a07 --- /dev/null +++ b/sys-devel/binutils/binutils-2.43-r1.ebuild @@ -0,0 +1,557 @@ +# 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} +elif [[ ${PV} == *9999 ]]; then + inherit git-r3 + SLOT=$(ver_cut 1-2) +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 ~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 ) + pgo? ( + dev-util/dejagnu + app-alternatives/bc + ) + 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 + + if [[ ${PV} != 9999 ]] ; then + EGIT_BRANCH=binutils-$(ver_cut 1)_$(ver_cut 2)-branch + fi + 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" + elif [[ ${PV} == *9999 ]] ; then + patchsetname="from git branch ${EGIT_BRANCH}" + 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.43-linker-search-path.patch \ + "${FILESDIR}"/binutils-2.43-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 + + 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 + + ( + # 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} || eerror binutils-config returned an error +} + +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} || eerror binutils-config returned an error + else + binutils-config ${choice} || eerror binutils-config returned an error + fi + elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then + binutils-config ${CTARGET}-${PV} || eerror binutils-config returned an error + 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}- +# /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/bpf-toolchain/Manifest b/sys-devel/bpf-toolchain/Manifest index 513ebed6020e..225dce824d46 100644 --- a/sys-devel/bpf-toolchain/Manifest +++ b/sys-devel/bpf-toolchain/Manifest @@ -1,4 +1,6 @@ +DIST binutils-2.43.1.tar.xz 28174300 BLAKE2B c4cd765cea326cd00b5cfe306e2937d820603b42f07a714ceb1349d36ddba0d45c3e125599dadf290d97954035c381781067155600ed87066e494cb9c4b34b45 SHA512 20977ad17729141a2c26d358628f44a0944b84dcfefdec2ba029c2d02f40dfc41cc91c0631044560d2bd6f9a51e1f15846b4b311befbe14f1239f14ff7d57824 DIST binutils-2.43.tar.xz 28175768 BLAKE2B 28b0a04a28273b76eab2d00e00160be889f155f77f5a9d8759ef8dce505c97e97641bf7ec70b92b731b520570a02b06e04e8215b068fcb1bb2573e9ef24732d9 SHA512 93e063163e54d6a6ee2bd48dc754270bf757a3635b49a702ed6b310e929e94063958512d191e66beaf44275f7ea60865dbde138b624626739679fcc306b133bb DIST gcc-14.2.0.tar.xz 92306460 BLAKE2B 87baf2a06dfa75d8fb6cd62c747ef1f57d3b9bbbe33a360d9ed3de4b4dbeaa8d920504c67e409bd9863414202c14fd854b46108e984418171205119216d03d3b SHA512 932bdef0cda94bacedf452ab17f103c0cb511ff2cec55e9112fc0328cbf1d803b42595728ea7b200e0a057c03e85626f937012e49a7515bc5dd256b2bf4bc396 EBUILD bpf-toolchain-14.2.0-r2.ebuild 6452 BLAKE2B 2ce7aa3cbe5c72659934616ca9bdb1d2ee394deddeb9f730d416e27a7a6a319dd55c173e603913085f988df1eae6dbe335fec74fb895a94b57364b94cc72ee16 SHA512 72c5a45e713899b1a26d05afd9b47b69425b4e05252365f91faf3fea9663169aabe28609773e05da82cc71d711f4ba7fec23272ef57b9600f39ece9ca322ed2e +EBUILD bpf-toolchain-14.2.0_p1.ebuild 6453 BLAKE2B ec76969f9ec5ea1fae06e1321204c76da4ca5967ea9035a78dd758b94b401533aefc5853a0abee317aea0544a193e9f6ba3a297443aed9207cad840a05d1e14f SHA512 a91ea44ba35cfc0fa82628e2f494084bdb1a28c41183c06f3ae559574abf881de22c34c8f9cd13807d8be1c5ca79e8ce1ea94c222f721b60c3430d01c7abfb51 MISC metadata.xml 599 BLAKE2B c41d219a2ba989105be860668dae9a75ed7283924017bc5f452853325f7800d90f87f3acd8c56c51efbc150a45d630f20dff2867a73753e4a71fef2cc5adea04 SHA512 c0e7d480106f9803602288191de6b5295d80c8f4da7458dd1630dcb40ea67cf0e1258865bd7be646306b60700c991ed15c487d54c083f2a65717ac46c27a70de diff --git a/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0_p1.ebuild b/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0_p1.ebuild new file mode 100644 index 000000000000..847ea82ad412 --- /dev/null +++ b/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0_p1.ebuild @@ -0,0 +1,232 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit edo flag-o-matic toolchain-funcs + +# Versioning is just the GCC version in full (so may include a snapshot +# date). Unlike dev-util/mingw64-toolchain, which this ebuild was heavily +# inspired by, there's no "third component" here to version on, just +# GCC + binutils. +# +# Do _p1++ rather than revbump on Binutils changes +# Not using Gentoo patchsets for simplicity, their changes are mostly unneeded here. +GCC_PV=${PV%_p*} +BINUTILS_PV=2.43.1 + +DESCRIPTION="All-in-one bpf toolchain for building DTrace and systemd without crossdev" +HOMEPAGE=" + https://gcc.gnu.org/ + https://sourceware.org/binutils/ + https://gcc.gnu.org/wiki/BPFBackEnd +" +SRC_URI=" + mirror://gnu/binutils/binutils-${BINUTILS_PV}.tar.xz +" +if [[ ${GCC_PV} == *-* ]]; then + SRC_URI+=" mirror://gcc/snapshots/${GCC_PV}/gcc-${GCC_PV}.tar.xz" +else + SRC_URI+=" + mirror://gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz + mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_PV}.tar.xz + " +fi +S="${WORKDIR}" + +# l1:binutils+gcc, l2:gcc(libraries) +LICENSE=" + GPL-3+ + LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-exception-3.1 ) +" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="+bin-symlinks custom-cflags +strip" + +RDEPEND=" + dev-libs/gmp:= + dev-libs/mpc:= + dev-libs/mpfr:= + sys-libs/zlib:= + virtual/libiconv + bin-symlinks? ( + !cross-bpf-unknown-none/binutils + !cross-bpf-unknown-none/gcc + ) +" +DEPEND="${RDEPEND}" + +PATCHES=() + +pkg_pretend() { + [[ ${MERGE_TYPE} == binary ]] && return + + tc-is-cross-compiler && + die "cross-compilation of the toolchain itself is unsupported" +} + +src_prepare() { + # rename directories to simplify both patching and the ebuild + mv binutils{-${BINUTILS_PV},} || die + mv gcc{-${GCC_PV},} || die + + default +} + +src_compile() { + # src_compile is kept similar to dev-util/mingw64-toolchain + # at least for now for ease of comparison etc. + # + # not great but do everything in src_compile given bootstrapping + # process needs to be done in steps of configure+compile+install + # (done modular to have most package-specific things in one place) + + CTARGET=bpf-unknown-none + + BPFT_D=${T}/root # moved to ${D} in src_install + local bpftdir=/usr/lib/${PN} + local prefix=${EPREFIX}${bpftdir} + local sysroot=${BPFT_D}${prefix} + local -x PATH=${sysroot}/bin:${PATH} + + use custom-cflags || strip-flags # fancy flags are not realistic here + + # global configure flags + local conf=( + --build=${CBUILD:-${CHOST}} + --target=${CTARGET} + --{doc,info,man}dir=/.skip # let the real binutils+gcc handle docs + MAKEINFO=: #922230 + ) + + # binutils + local conf_binutils=( + --prefix="${prefix}" + --host=${CHOST} + --disable-cet + --disable-default-execstack + --disable-nls + --disable-shared + --with-system-zlib + --without-debuginfod + --without-msgpack + --without-zstd + ) + + # gcc (minimal -- if need more, disable only in stage1 / enable in stage3) + local conf_gcc=( + --prefix="${prefix}" + --host=${CHOST} + --disable-bootstrap + --disable-cc1 + --disable-cet + --disable-gcov #843989 + --disable-gomp + --disable-nls # filename collisions + --disable-libcc1 + --disable-libquadmath + --disable-libsanitizer + --disable-libssp + --disable-libvtv + --disable-shared + --disable-werror + --enable-languages=c + --with-gcc-major-version-only + --with-system-zlib + --without-isl + --without-zstd + --disable-multilib + ) + + # libstdc++ may misdetect sys/sdt.h on systemtap-enabled system and fail + # (not passed in conf_gcc above given it is lost in sub-configure calls) + local -x glibcxx_cv_sys_sdt_h=no + + # bpft-build + # -> ./configure && make && make install && bpft-package() + # passes conf and conf_package to configure, and users can add options + # through environment with e.g. + # BPFT_BINUTILS_CONF="--some-option" + # EXTRA_ECONF="--global-option" (generic naming for if not reading this) + bpft-build() { + local id=${1##*/} + local build_dir=${WORKDIR}/${1}-build + + # econf is not allowed in src_compile and its defaults are + # mostly unused here, so use configure directly + local conf=( "${WORKDIR}/${1}"/configure "${conf[@]}" ) + + local -n conf_id=conf_${id} + [[ ${conf_id@a} == *a* ]] && conf+=( "${conf_id[@]}" ) + + local -n extra_id=BPFT_${id^^}_CONF + conf+=( ${EXTRA_ECONF} ${extra_id} ) + + einfo "Building ${id} in ${build_dir} ..." + + mkdir -p "${build_dir}" || die + pushd "${build_dir}" >/dev/null || die + + edo "${conf[@]}" + emake MAKEINFO=: V=1 + # -j1 to match bug #906155, other packages may be fragile too + emake -j1 MAKEINFO=: V=1 DESTDIR="${BPFT_D}" install + + declare -f bpft-${id} >/dev/null && edo bpft-${id} + + popd >/dev/null || die + } + + # build with same ordering that crossdev would do + bpft-build binutils + bpft-build gcc + + if use bin-symlinks; then + mkdir -p -- "${BPFT_D}${EPREFIX}"/usr/bin/ || die + local bin + for bin in "${sysroot}"/bin/*; do + ln -rs -- "${bin}" "${BPFT_D}${EPREFIX}"/usr/bin/ || die + done + fi + + # Delete libdep.a, which has a colliding name and is useless for bpf, + # which does not make use of cross-library dependencies: the libdep.a + # for the native binutils will do. + rm -f ${sysroot}/lib/bfd-plugins/libdep.a || die + + # portage doesn't know the right strip executable to use for CTARGET + # and it can lead to .a mangling, notably with 32bit (breaks toolchain) + dostrip -x ${bpftdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}} + + # TODO: Check if this is worth doing, it may not be + if use strip; then + einfo "Stripping ${CTARGET} static libraries ..." + find "${sysroot}"/{,lib/gcc/}${CTARGET} -type f -name '*.a' \ + -exec ${CTARGET}-strip --strip-unneeded {} + || die + fi +} + +src_install() { + mv "${BPFT_D}${EPREFIX}"/* "${ED}" || die + + find "${ED}" -type f -name '*.la' -delete || die +} + +pkg_postinst() { + use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] && + eselect compiler-shadow update all + + if [[ ! ${REPLACING_VERSIONS} ]]; then + elog "Note that this package is primarily intended for DTrace, systemd, and related" + elog "packages to depend on without needing a manual crossdev setup." + elog + elog "Settings are oriented only for what these need and simplicity." + elog "Use sys-devel/crossdev if need full toolchain/customization:" + elog " https://wiki.gentoo.org/wiki/Crossdev" + fi +} + +pkg_postrm() { + use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] && + eselect compiler-shadow clean all +} diff --git a/sys-devel/clang-common/Manifest b/sys-devel/clang-common/Manifest index 62d2eb5604c0..8cd71ba6eec3 100644 --- a/sys-devel/clang-common/Manifest +++ b/sys-devel/clang-common/Manifest @@ -8,6 +8,8 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b DIST llvm-project-19.1.0-rc2.src.tar.xz 141264388 BLAKE2B 690b4912d9e4a8019b7990934dd6486362337ccb303dca119c0e75aa1063ad452222be1ee965e43b160dfcea20e491a20c289344152666b618712a1d76dc4780 SHA512 508a401e8433b1ac9a399246eb1a3c18faed7c3d41d8c118e77cefbb64cc6d6e171bd41a3e5584f6c84df141ba6819f1a1cce75b5c1ef33e3d2ac239e662d07c DIST llvm-project-19.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 1eaf10a1419ecf009c033a8f6ecb6eec86107d81621d5b4665c8d929b05f4845ce0c432017343d7b06f33e6ff6384df9e1d8fc7b9c6efe7f10ef69798891b7e5 SHA512 b46e9a1d40f891c5f3544d8cc6295900bff5dda9a4a526b8db55a42a37ae90deb216b316d2117984e82f4e918d15343e75b3b9e6d6c773866707c3398e032826 +DIST llvm-project-19.1.0-rc3.src.tar.xz 141250388 BLAKE2B 6530bede000d2e4b8ce10b445bfc1f81dc25c2d7121fc953581cd9b6989b3ba197707cd79d3c7b94c055bf2e21b0d07ab3cb401d3f73d22eefba6da4b71dca7b SHA512 3ee4eab848e5e38c396e6f5addf5eb42570d451fc8e7cd77150dc5542f8f710f4a9db51836f7a799996dd1b8194defe4d58efe7c19e5d5e1c5f3dbdda94c0cf3 +DIST llvm-project-19.1.0-rc3.src.tar.xz.sig 438 BLAKE2B 86bad4d4fb805340096473bc603d7a3483f030f62b6f52b64d12c33561fbbb999c2ab69cc94857a32747492c846a5ab631a84da200b03475fd401335373bbccf SHA512 ef0fd2e3e7069fbfd410cbcf71294d1b7182456330ff151348058b5cb0f292edaecb9dcbf613ee4fc979214a23bd3bb8077d71e674635359da36b938dc143266 DIST llvm-project-db8ef6188cbbe2125e6d60bdef77a535105772df.tar.gz 218416682 BLAKE2B 691e3881e4a60c008c6b766b51ecc856122de1f40242ff1d91ebaa12682fea0a22f84783eb930c42d196f50ba0d3b2010f9010ed73ee7e292fe78c93d6e3f324 SHA512 2dc16a603b60607cc3daee2de0126a567a78c4fff72b2fbcb94c82472bc5ec64ac354ba8592b9a643248a5bfd43b34e2a60f2751a0c9e9e28b7f895fc50a5e9d DIST llvm-project-fd7d7882e7fa5a38d4bfde426120d4663718beb4.tar.gz 218217769 BLAKE2B a6c2aa012c342e31527b7e9f85e8fea3549d52530d8f87cd699e094a0aa768d099f9fd2631161ff7f53b4a5011937ed6d1f52b8fa1d23aa34183be1f487d4277 SHA512 c4863fab1a3c03f7f9c42f3501d3a75cebb491343515d77d30b26e5cbd720fc3fd628052099d87ed638e8c424bcbe7a1d066ed857f73da6f243d3d5a76b0e6c5 EBUILD clang-common-15.0.7-r8.ebuild 5482 BLAKE2B 20e8744166a852b4dbc233f128807e60bb204f14558d2cc1691b1a87777be2775d1a6c82a108945f795b02919bc47bf213b1a85e45f423c49a6009aed0fbbc3b SHA512 bf1f5cdf47c6772266117e9545994dcfb27cfd263a5e7749604106686d8e56b8b45ddab7073d6baf73e966304162f3aad755075c11dbb16bb42b88fa78e6face @@ -16,6 +18,7 @@ EBUILD clang-common-17.0.6-r5.ebuild 9010 BLAKE2B cbb5c5094ca6e99fc9ce1734acf02e EBUILD clang-common-17.0.6-r6.ebuild 9035 BLAKE2B 4e18fbf5bb39238603a6d490eb3e17012f510b859272331826e43fa3c14bdb57af0d63cadcac45dc3cac5a89dcdd401242022f130c681d17fb74c1339aa4dd69 SHA512 5b592d886f4b6d7ffdc67593d994f89a3202710633b61e0ee2d709052edd75ecc2f32e66668902901f5d5d21d08992f085b6f6a054a0f887d3a691f714a59caf EBUILD clang-common-18.1.8-r1.ebuild 9151 BLAKE2B 43a8bcc9b07107ab5a743722d04afc54b8d0b1074dab407f17ee613b572d84d0f217f145dc8786d764e9dea3254bd06f912aa1f09bcc6e76bec1be29ebfb0561 SHA512 a7cf13b1137da79b58580a4181a6ba3b19195467f0d979c826b746f4429b6f431d49373d870053d3abe5ff0f3e45cb9faff2768fcee66d0f09b8c49837032b56 EBUILD clang-common-19.1.0_rc2.ebuild 9042 BLAKE2B 7fc18661a55e2c223cc3c4e6c8477a913a0ed025b013f4407e58682f00f389cc2961c8cd5ee20d13e75b51f1c8a0b79569a0bb35da6a2028703f9fee553ed4c0 SHA512 212b4035d367e465de90d6b89c81388e45023257aec550dfe81c7ca71ea0a8d59b2ece092c8cbc4b5eadf4d29a3fbde6a49e6fdbce3fde8ccd1300dc7fafdf58 +EBUILD clang-common-19.1.0_rc3.ebuild 9042 BLAKE2B 7fc18661a55e2c223cc3c4e6c8477a913a0ed025b013f4407e58682f00f389cc2961c8cd5ee20d13e75b51f1c8a0b79569a0bb35da6a2028703f9fee553ed4c0 SHA512 212b4035d367e465de90d6b89c81388e45023257aec550dfe81c7ca71ea0a8d59b2ece092c8cbc4b5eadf4d29a3fbde6a49e6fdbce3fde8ccd1300dc7fafdf58 EBUILD clang-common-20.0.0.9999.ebuild 9042 BLAKE2B 7fc18661a55e2c223cc3c4e6c8477a913a0ed025b013f4407e58682f00f389cc2961c8cd5ee20d13e75b51f1c8a0b79569a0bb35da6a2028703f9fee553ed4c0 SHA512 212b4035d367e465de90d6b89c81388e45023257aec550dfe81c7ca71ea0a8d59b2ece092c8cbc4b5eadf4d29a3fbde6a49e6fdbce3fde8ccd1300dc7fafdf58 EBUILD clang-common-20.0.0_pre20240808.ebuild 9042 BLAKE2B 7fc18661a55e2c223cc3c4e6c8477a913a0ed025b013f4407e58682f00f389cc2961c8cd5ee20d13e75b51f1c8a0b79569a0bb35da6a2028703f9fee553ed4c0 SHA512 212b4035d367e465de90d6b89c81388e45023257aec550dfe81c7ca71ea0a8d59b2ece092c8cbc4b5eadf4d29a3fbde6a49e6fdbce3fde8ccd1300dc7fafdf58 EBUILD clang-common-20.0.0_pre20240815.ebuild 9042 BLAKE2B 7fc18661a55e2c223cc3c4e6c8477a913a0ed025b013f4407e58682f00f389cc2961c8cd5ee20d13e75b51f1c8a0b79569a0bb35da6a2028703f9fee553ed4c0 SHA512 212b4035d367e465de90d6b89c81388e45023257aec550dfe81c7ca71ea0a8d59b2ece092c8cbc4b5eadf4d29a3fbde6a49e6fdbce3fde8ccd1300dc7fafdf58 diff --git a/sys-devel/clang-common/clang-common-19.1.0_rc3.ebuild b/sys-devel/clang-common/clang-common-19.1.0_rc3.ebuild new file mode 100644 index 000000000000..090a45690818 --- /dev/null +++ b/sys-devel/clang-common/clang-common-19.1.0_rc3.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 () && !defined(__GLIBC__) + # include + #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. + -Xarch_host -D_GLIBCXX_ASSERTIONS + + # Analogue to GLIBCXX_ASSERTIONS + # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode + # https://libcxx.llvm.org/Hardening.html#using-hardened-mode + -Xarch_host -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-runtime/Manifest b/sys-devel/clang-runtime/Manifest index 9966a6e58117..b7c61aaa648e 100644 --- a/sys-devel/clang-runtime/Manifest +++ b/sys-devel/clang-runtime/Manifest @@ -3,6 +3,7 @@ EBUILD clang-runtime-16.0.6.ebuild 1448 BLAKE2B be376aab09a0268444784d1a0bcb5902 EBUILD clang-runtime-17.0.6.ebuild 1448 BLAKE2B be376aab09a0268444784d1a0bcb590222c9c8a118e260b15939e574687334eb476d6f66ab0f1f4fb0841a226c7b7f690666c33bec2d9c14f27a4f30f986b859 SHA512 b0b7a2f5c69890cb2fc0a9c2c8a1910669a4eae16826c0702a2ef508f91b6ec3b5607beab5b24f02951cf9b377f1d09395bd97c27f476137ef6cdf2571330578 EBUILD clang-runtime-18.1.8.ebuild 1448 BLAKE2B be376aab09a0268444784d1a0bcb590222c9c8a118e260b15939e574687334eb476d6f66ab0f1f4fb0841a226c7b7f690666c33bec2d9c14f27a4f30f986b859 SHA512 b0b7a2f5c69890cb2fc0a9c2c8a1910669a4eae16826c0702a2ef508f91b6ec3b5607beab5b24f02951cf9b377f1d09395bd97c27f476137ef6cdf2571330578 EBUILD clang-runtime-19.1.0_rc2.ebuild 1339 BLAKE2B 4a5ee8a332faf2da21256df048867b1458a5ccb2d733d00ee3788bfbc28b3daf4ce2ae2455ab03c9ebb192d964feae2cd5806b5fef23eaa9401d57b35386aa57 SHA512 fac3e259b5a7b5e105b3d5fd2f8e9a9b6236642867e4c4a67106ec999dfaf0a30a97a3905685043a0ab9f38b15b7b8a5a814a97921e37029b9d0beac7ba7085a +EBUILD clang-runtime-19.1.0_rc3.ebuild 1339 BLAKE2B 4a5ee8a332faf2da21256df048867b1458a5ccb2d733d00ee3788bfbc28b3daf4ce2ae2455ab03c9ebb192d964feae2cd5806b5fef23eaa9401d57b35386aa57 SHA512 fac3e259b5a7b5e105b3d5fd2f8e9a9b6236642867e4c4a67106ec999dfaf0a30a97a3905685043a0ab9f38b15b7b8a5a814a97921e37029b9d0beac7ba7085a EBUILD clang-runtime-20.0.0.9999.ebuild 1339 BLAKE2B 4a5ee8a332faf2da21256df048867b1458a5ccb2d733d00ee3788bfbc28b3daf4ce2ae2455ab03c9ebb192d964feae2cd5806b5fef23eaa9401d57b35386aa57 SHA512 fac3e259b5a7b5e105b3d5fd2f8e9a9b6236642867e4c4a67106ec999dfaf0a30a97a3905685043a0ab9f38b15b7b8a5a814a97921e37029b9d0beac7ba7085a EBUILD clang-runtime-20.0.0_pre20240808.ebuild 1339 BLAKE2B 4a5ee8a332faf2da21256df048867b1458a5ccb2d733d00ee3788bfbc28b3daf4ce2ae2455ab03c9ebb192d964feae2cd5806b5fef23eaa9401d57b35386aa57 SHA512 fac3e259b5a7b5e105b3d5fd2f8e9a9b6236642867e4c4a67106ec999dfaf0a30a97a3905685043a0ab9f38b15b7b8a5a814a97921e37029b9d0beac7ba7085a EBUILD clang-runtime-20.0.0_pre20240815.ebuild 1339 BLAKE2B 4a5ee8a332faf2da21256df048867b1458a5ccb2d733d00ee3788bfbc28b3daf4ce2ae2455ab03c9ebb192d964feae2cd5806b5fef23eaa9401d57b35386aa57 SHA512 fac3e259b5a7b5e105b3d5fd2f8e9a9b6236642867e4c4a67106ec999dfaf0a30a97a3905685043a0ab9f38b15b7b8a5a814a97921e37029b9d0beac7ba7085a diff --git a/sys-devel/clang-runtime/clang-runtime-19.1.0_rc3.ebuild b/sys-devel/clang-runtime/clang-runtime-19.1.0_rc3.ebuild new file mode 100644 index 000000000000..323c0b62c062 --- /dev/null +++ b/sys-devel/clang-runtime/clang-runtime-19.1.0_rc3.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/Manifest b/sys-devel/clang/Manifest index 888f74b52ff1..b809bca9c8f6 100644 --- a/sys-devel/clang/Manifest +++ b/sys-devel/clang/Manifest @@ -15,6 +15,8 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b DIST llvm-project-19.1.0-rc2.src.tar.xz 141264388 BLAKE2B 690b4912d9e4a8019b7990934dd6486362337ccb303dca119c0e75aa1063ad452222be1ee965e43b160dfcea20e491a20c289344152666b618712a1d76dc4780 SHA512 508a401e8433b1ac9a399246eb1a3c18faed7c3d41d8c118e77cefbb64cc6d6e171bd41a3e5584f6c84df141ba6819f1a1cce75b5c1ef33e3d2ac239e662d07c DIST llvm-project-19.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 1eaf10a1419ecf009c033a8f6ecb6eec86107d81621d5b4665c8d929b05f4845ce0c432017343d7b06f33e6ff6384df9e1d8fc7b9c6efe7f10ef69798891b7e5 SHA512 b46e9a1d40f891c5f3544d8cc6295900bff5dda9a4a526b8db55a42a37ae90deb216b316d2117984e82f4e918d15343e75b3b9e6d6c773866707c3398e032826 +DIST llvm-project-19.1.0-rc3.src.tar.xz 141250388 BLAKE2B 6530bede000d2e4b8ce10b445bfc1f81dc25c2d7121fc953581cd9b6989b3ba197707cd79d3c7b94c055bf2e21b0d07ab3cb401d3f73d22eefba6da4b71dca7b SHA512 3ee4eab848e5e38c396e6f5addf5eb42570d451fc8e7cd77150dc5542f8f710f4a9db51836f7a799996dd1b8194defe4d58efe7c19e5d5e1c5f3dbdda94c0cf3 +DIST llvm-project-19.1.0-rc3.src.tar.xz.sig 438 BLAKE2B 86bad4d4fb805340096473bc603d7a3483f030f62b6f52b64d12c33561fbbb999c2ab69cc94857a32747492c846a5ab631a84da200b03475fd401335373bbccf SHA512 ef0fd2e3e7069fbfd410cbcf71294d1b7182456330ff151348058b5cb0f292edaecb9dcbf613ee4fc979214a23bd3bb8077d71e674635359da36b938dc143266 DIST llvm-project-db8ef6188cbbe2125e6d60bdef77a535105772df.tar.gz 218416682 BLAKE2B 691e3881e4a60c008c6b766b51ecc856122de1f40242ff1d91ebaa12682fea0a22f84783eb930c42d196f50ba0d3b2010f9010ed73ee7e292fe78c93d6e3f324 SHA512 2dc16a603b60607cc3daee2de0126a567a78c4fff72b2fbcb94c82472bc5ec64ac354ba8592b9a643248a5bfd43b34e2a60f2751a0c9e9e28b7f895fc50a5e9d DIST llvm-project-fd7d7882e7fa5a38d4bfde426120d4663718beb4.tar.gz 218217769 BLAKE2B a6c2aa012c342e31527b7e9f85e8fea3549d52530d8f87cd699e094a0aa768d099f9fd2631161ff7f53b4a5011937ed6d1f52b8fa1d23aa34183be1f487d4277 SHA512 c4863fab1a3c03f7f9c42f3501d3a75cebb491343515d77d30b26e5cbd720fc3fd628052099d87ed638e8c424bcbe7a1d066ed857f73da6f243d3d5a76b0e6c5 EBUILD clang-15.0.7-r3.ebuild 12523 BLAKE2B 0e3f9d4506a1b98e96ff98ea52f8bb10f8ab4c91db2868f786bb1761a027e73708a10dce904192a9024ef5819ebf66af07ae6dcdc7186d4b2e04e8cc5978fc7a SHA512 7eeb3ab398c79d0931dedffd5c44d4f69b98b8b9717749a5d7373f6fef49fd337579ea2ab1d05e934b8e526d3f5a43a8911abeb32d956bed9c532b32cff0dbe3 @@ -22,6 +24,7 @@ EBUILD clang-16.0.6.ebuild 12452 BLAKE2B 446a354b58fc0535b81596a9a3785a4cd5d7b7a EBUILD clang-17.0.6.ebuild 12151 BLAKE2B 665280844db218824bec2add033e13e14b958ac510fb1b0b7193130a55041a5c802c57aa022a35d65a689c611ca9ed119eaf39c47f581d24f38d9c8655c5f062 SHA512 482ae07e36fb3c593d2051b2034f501fc0c94bdcaeb2a6a0701473d00f16f691c8a1584d4b1773dfd236297a12a42cb4f9443eb5c381dcb10d36f749a432ff1d EBUILD clang-18.1.8.ebuild 12218 BLAKE2B a8508146967a2807d4bd95734fe52da8194c9038055c086626a014c1684b40f41bf8a51c771549f8a538d83354e5ad5c4478a70f5864deab94cc014e641ea33b SHA512 24e0711766e69ed58726396aba57fc9cc539fcc15831402bfd22ca2727c0233f8cad8ffbbfde02046e47ad127391da97045d2096a58b73391c760bfb31751226 EBUILD clang-19.1.0_rc2.ebuild 11899 BLAKE2B 4ec92be5b4185157408680503931e7bc4c50cb99320a11e2d16598cad5bf8c1f6b30a020e395d652cb2489b9252885ab5fd18672bbfd6adbb84c69a5800be6ce SHA512 a1f20ed323af7a93a9c6d277789f53cc17c9faf60e81bdee8e4e754a52da46cbfa79fde093aea023b83b4f4d3c93add7b170e4af32e65e869e04e4d48204f898 +EBUILD clang-19.1.0_rc3.ebuild 11899 BLAKE2B 4ec92be5b4185157408680503931e7bc4c50cb99320a11e2d16598cad5bf8c1f6b30a020e395d652cb2489b9252885ab5fd18672bbfd6adbb84c69a5800be6ce SHA512 a1f20ed323af7a93a9c6d277789f53cc17c9faf60e81bdee8e4e754a52da46cbfa79fde093aea023b83b4f4d3c93add7b170e4af32e65e869e04e4d48204f898 EBUILD clang-20.0.0.9999.ebuild 11943 BLAKE2B a186ad2e553c9fe1f76a659a1bb8d015f777ef76f100d0400b18c755ebfa80380cad8426c27c69255531b2a321b1bd62ea7a22301616133442604398c92c136c SHA512 2f2a4f0dd70bbeffc174a1213733dddfaaf34b5ef247fde9bd4248361d3561227a66ff10aa87ff0a627ac472bea36455ddba50387ebd5d3fdd7e50d4fd751995 EBUILD clang-20.0.0_pre20240808.ebuild 11943 BLAKE2B a186ad2e553c9fe1f76a659a1bb8d015f777ef76f100d0400b18c755ebfa80380cad8426c27c69255531b2a321b1bd62ea7a22301616133442604398c92c136c SHA512 2f2a4f0dd70bbeffc174a1213733dddfaaf34b5ef247fde9bd4248361d3561227a66ff10aa87ff0a627ac472bea36455ddba50387ebd5d3fdd7e50d4fd751995 EBUILD clang-20.0.0_pre20240815.ebuild 11943 BLAKE2B a186ad2e553c9fe1f76a659a1bb8d015f777ef76f100d0400b18c755ebfa80380cad8426c27c69255531b2a321b1bd62ea7a22301616133442604398c92c136c SHA512 2f2a4f0dd70bbeffc174a1213733dddfaaf34b5ef247fde9bd4248361d3561227a66ff10aa87ff0a627ac472bea36455ddba50387ebd5d3fdd7e50d4fd751995 diff --git a/sys-devel/clang/clang-19.1.0_rc3.ebuild b/sys-devel/clang/clang-19.1.0_rc3.ebuild new file mode 100644 index 000000000000..e97008f8ad7a --- /dev/null +++ b/sys-devel/clang/clang-19.1.0_rc3.ebuild @@ -0,0 +1,470 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..13} ) + +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_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-installapi + clang-linker-wrapper + clang-nvlink-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 + + -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/lld/Manifest b/sys-devel/lld/Manifest index 4909c96d45b9..1933180e2d01 100644 --- a/sys-devel/lld/Manifest +++ b/sys-devel/lld/Manifest @@ -9,6 +9,8 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b DIST llvm-project-19.1.0-rc2.src.tar.xz 141264388 BLAKE2B 690b4912d9e4a8019b7990934dd6486362337ccb303dca119c0e75aa1063ad452222be1ee965e43b160dfcea20e491a20c289344152666b618712a1d76dc4780 SHA512 508a401e8433b1ac9a399246eb1a3c18faed7c3d41d8c118e77cefbb64cc6d6e171bd41a3e5584f6c84df141ba6819f1a1cce75b5c1ef33e3d2ac239e662d07c DIST llvm-project-19.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 1eaf10a1419ecf009c033a8f6ecb6eec86107d81621d5b4665c8d929b05f4845ce0c432017343d7b06f33e6ff6384df9e1d8fc7b9c6efe7f10ef69798891b7e5 SHA512 b46e9a1d40f891c5f3544d8cc6295900bff5dda9a4a526b8db55a42a37ae90deb216b316d2117984e82f4e918d15343e75b3b9e6d6c773866707c3398e032826 +DIST llvm-project-19.1.0-rc3.src.tar.xz 141250388 BLAKE2B 6530bede000d2e4b8ce10b445bfc1f81dc25c2d7121fc953581cd9b6989b3ba197707cd79d3c7b94c055bf2e21b0d07ab3cb401d3f73d22eefba6da4b71dca7b SHA512 3ee4eab848e5e38c396e6f5addf5eb42570d451fc8e7cd77150dc5542f8f710f4a9db51836f7a799996dd1b8194defe4d58efe7c19e5d5e1c5f3dbdda94c0cf3 +DIST llvm-project-19.1.0-rc3.src.tar.xz.sig 438 BLAKE2B 86bad4d4fb805340096473bc603d7a3483f030f62b6f52b64d12c33561fbbb999c2ab69cc94857a32747492c846a5ab631a84da200b03475fd401335373bbccf SHA512 ef0fd2e3e7069fbfd410cbcf71294d1b7182456330ff151348058b5cb0f292edaecb9dcbf613ee4fc979214a23bd3bb8077d71e674635359da36b938dc143266 DIST llvm-project-db8ef6188cbbe2125e6d60bdef77a535105772df.tar.gz 218416682 BLAKE2B 691e3881e4a60c008c6b766b51ecc856122de1f40242ff1d91ebaa12682fea0a22f84783eb930c42d196f50ba0d3b2010f9010ed73ee7e292fe78c93d6e3f324 SHA512 2dc16a603b60607cc3daee2de0126a567a78c4fff72b2fbcb94c82472bc5ec64ac354ba8592b9a643248a5bfd43b34e2a60f2751a0c9e9e28b7f895fc50a5e9d DIST llvm-project-fd7d7882e7fa5a38d4bfde426120d4663718beb4.tar.gz 218217769 BLAKE2B a6c2aa012c342e31527b7e9f85e8fea3549d52530d8f87cd699e094a0aa768d099f9fd2631161ff7f53b4a5011937ed6d1f52b8fa1d23aa34183be1f487d4277 SHA512 c4863fab1a3c03f7f9c42f3501d3a75cebb491343515d77d30b26e5cbd720fc3fd628052099d87ed638e8c424bcbe7a1d066ed857f73da6f243d3d5a76b0e6c5 EBUILD lld-15.0.7.ebuild 2269 BLAKE2B 322d5608e3acfb87bfb720646404ed405a3113c4faf1059428663a50d5566d7842fcff57ccf3aeb5e97b1a9acd4efd862db2368f130e088944ef4f0faf3c90f8 SHA512 e50d1d99fe18b6aba57c06eb6853f3212be1f7b7f2f3c70dcd226a69a4defc753eafcce77eb74f30eaa31b010fa094738718c1cdb23e584ef6e33eb72e536719 @@ -16,6 +18,7 @@ EBUILD lld-16.0.6.ebuild 2324 BLAKE2B 9b849aea16a8188e4da4cfcf0c85fb3e997007e128 EBUILD lld-17.0.6.ebuild 2363 BLAKE2B 8ebe513b67f3fb8efd981b97c1f77fe5de2065c363c2b9e99b8836983539fe5637b231e8be2a87713d47b48a49bfde77471ad65fa5166b606df476eca6f94fc1 SHA512 fd63e8600e393ecd95a05a28c8ac0d71b12f5aedcf273f432bea1904165b874ee913afff4aab91c2049aa1eb95c239bca217b84150133b2060f95ea66ce1944e EBUILD lld-18.1.8.ebuild 2366 BLAKE2B ad9fa5a3af2791ba8f4d976a9f132d1546d75ea8a158c7612f84505e381ae057578abe715f8c3784654b4eda22e0865a2c2324bdef866ed5ae234a0fda034862 SHA512 5b91209cbee538f60357f6a8ff023c256307692ed81c18e87b714f9cf951a378fa999ca4a8a1ffbe0b32555e52683f18093972a05587168faa62d182d673826c EBUILD lld-19.1.0_rc2.ebuild 2293 BLAKE2B 5825f0a471a50ec1d9e7775a82736f6369fa1e99904b30cf068f0092dce44d4e0c2e76fcb21d70b9ecb1756d19e8482a5ac940bdc25c5a1d58c9aee0c21b5d7b SHA512 86226e5f9aea8a87b022b2def7cef707fc7db0f1e026f4965ec64390708f7e2355c3e1ee991487bd0c6f9f17dc2f129a6b7a2b8abbf1e14fe48dd0e4cd73b1fa +EBUILD lld-19.1.0_rc3.ebuild 2293 BLAKE2B 5825f0a471a50ec1d9e7775a82736f6369fa1e99904b30cf068f0092dce44d4e0c2e76fcb21d70b9ecb1756d19e8482a5ac940bdc25c5a1d58c9aee0c21b5d7b SHA512 86226e5f9aea8a87b022b2def7cef707fc7db0f1e026f4965ec64390708f7e2355c3e1ee991487bd0c6f9f17dc2f129a6b7a2b8abbf1e14fe48dd0e4cd73b1fa EBUILD lld-20.0.0.9999.ebuild 2293 BLAKE2B 5825f0a471a50ec1d9e7775a82736f6369fa1e99904b30cf068f0092dce44d4e0c2e76fcb21d70b9ecb1756d19e8482a5ac940bdc25c5a1d58c9aee0c21b5d7b SHA512 86226e5f9aea8a87b022b2def7cef707fc7db0f1e026f4965ec64390708f7e2355c3e1ee991487bd0c6f9f17dc2f129a6b7a2b8abbf1e14fe48dd0e4cd73b1fa EBUILD lld-20.0.0_pre20240808.ebuild 2293 BLAKE2B 5825f0a471a50ec1d9e7775a82736f6369fa1e99904b30cf068f0092dce44d4e0c2e76fcb21d70b9ecb1756d19e8482a5ac940bdc25c5a1d58c9aee0c21b5d7b SHA512 86226e5f9aea8a87b022b2def7cef707fc7db0f1e026f4965ec64390708f7e2355c3e1ee991487bd0c6f9f17dc2f129a6b7a2b8abbf1e14fe48dd0e4cd73b1fa EBUILD lld-20.0.0_pre20240815.ebuild 2293 BLAKE2B 5825f0a471a50ec1d9e7775a82736f6369fa1e99904b30cf068f0092dce44d4e0c2e76fcb21d70b9ecb1756d19e8482a5ac940bdc25c5a1d58c9aee0c21b5d7b SHA512 86226e5f9aea8a87b022b2def7cef707fc7db0f1e026f4965ec64390708f7e2355c3e1ee991487bd0c6f9f17dc2f129a6b7a2b8abbf1e14fe48dd0e4cd73b1fa diff --git a/sys-devel/lld/lld-19.1.0_rc3.ebuild b/sys-devel/lld/lld-19.1.0_rc3.ebuild new file mode 100644 index 000000000000..79558afa1abe --- /dev/null +++ b/sys-devel/lld/lld-19.1.0_rc3.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..13} ) +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/llvm-common/Manifest b/sys-devel/llvm-common/Manifest index c4237fef566c..b23ec28d767c 100644 --- a/sys-devel/llvm-common/Manifest +++ b/sys-devel/llvm-common/Manifest @@ -8,6 +8,8 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b DIST llvm-project-19.1.0-rc2.src.tar.xz 141264388 BLAKE2B 690b4912d9e4a8019b7990934dd6486362337ccb303dca119c0e75aa1063ad452222be1ee965e43b160dfcea20e491a20c289344152666b618712a1d76dc4780 SHA512 508a401e8433b1ac9a399246eb1a3c18faed7c3d41d8c118e77cefbb64cc6d6e171bd41a3e5584f6c84df141ba6819f1a1cce75b5c1ef33e3d2ac239e662d07c DIST llvm-project-19.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 1eaf10a1419ecf009c033a8f6ecb6eec86107d81621d5b4665c8d929b05f4845ce0c432017343d7b06f33e6ff6384df9e1d8fc7b9c6efe7f10ef69798891b7e5 SHA512 b46e9a1d40f891c5f3544d8cc6295900bff5dda9a4a526b8db55a42a37ae90deb216b316d2117984e82f4e918d15343e75b3b9e6d6c773866707c3398e032826 +DIST llvm-project-19.1.0-rc3.src.tar.xz 141250388 BLAKE2B 6530bede000d2e4b8ce10b445bfc1f81dc25c2d7121fc953581cd9b6989b3ba197707cd79d3c7b94c055bf2e21b0d07ab3cb401d3f73d22eefba6da4b71dca7b SHA512 3ee4eab848e5e38c396e6f5addf5eb42570d451fc8e7cd77150dc5542f8f710f4a9db51836f7a799996dd1b8194defe4d58efe7c19e5d5e1c5f3dbdda94c0cf3 +DIST llvm-project-19.1.0-rc3.src.tar.xz.sig 438 BLAKE2B 86bad4d4fb805340096473bc603d7a3483f030f62b6f52b64d12c33561fbbb999c2ab69cc94857a32747492c846a5ab631a84da200b03475fd401335373bbccf SHA512 ef0fd2e3e7069fbfd410cbcf71294d1b7182456330ff151348058b5cb0f292edaecb9dcbf613ee4fc979214a23bd3bb8077d71e674635359da36b938dc143266 DIST llvm-project-db8ef6188cbbe2125e6d60bdef77a535105772df.tar.gz 218416682 BLAKE2B 691e3881e4a60c008c6b766b51ecc856122de1f40242ff1d91ebaa12682fea0a22f84783eb930c42d196f50ba0d3b2010f9010ed73ee7e292fe78c93d6e3f324 SHA512 2dc16a603b60607cc3daee2de0126a567a78c4fff72b2fbcb94c82472bc5ec64ac354ba8592b9a643248a5bfd43b34e2a60f2751a0c9e9e28b7f895fc50a5e9d DIST llvm-project-fd7d7882e7fa5a38d4bfde426120d4663718beb4.tar.gz 218217769 BLAKE2B a6c2aa012c342e31527b7e9f85e8fea3549d52530d8f87cd699e094a0aa768d099f9fd2631161ff7f53b4a5011937ed6d1f52b8fa1d23aa34183be1f487d4277 SHA512 c4863fab1a3c03f7f9c42f3501d3a75cebb491343515d77d30b26e5cbd720fc3fd628052099d87ed638e8c424bcbe7a1d066ed857f73da6f243d3d5a76b0e6c5 EBUILD llvm-common-15.0.7.ebuild 1014 BLAKE2B da3b7ec6cd3c1e57758312fb9ea25e693305e1ef72b350eea85fbde5a1e636269d84bd491b6f528aee8a9cb8229f6304b371f99e6ac416c661c6519706b83b61 SHA512 68b9d672372fe71e39f2b8f9d80eb1dcb5138b8b9b961f56a4eeb81b3fc4054448a51a46b3a62547ebb6262425512f39bc146e5f2c3703de10ab520f1594e7a4 @@ -15,6 +17,7 @@ EBUILD llvm-common-16.0.6.ebuild 1034 BLAKE2B 1e0a0b6cbb746a7eb45e3f553bc949b693 EBUILD llvm-common-17.0.6.ebuild 1034 BLAKE2B 1e0a0b6cbb746a7eb45e3f553bc949b69314afc3d913cda004d395e7b322c17f976496eed074cf08718dc2d9efa7f3db81dec4f38394fe6ea2b77793b74f4371 SHA512 8fbb211a6b05d24409642fcb00a4fb798499721cc30c4c5fa2df120ed74d9da7286916cf3788ea26f2cb21e334876417b05a4336fedff99e95d1ebe358f8b311 EBUILD llvm-common-18.1.8.ebuild 1040 BLAKE2B e48cc3f1b8cb1672859d620d637023ddce71a4a37827108ba2fd9a8eb66660175069e8d77c84549ec7bf843ecfe1ce3e2c8660c439c7acb08601a36fe72b4218 SHA512 626adbcb09088b70167deb3cc956b41cd1deb0321ff7b937faa6ab4d0a9a1ee219e9ed17a4b4233a47578fad528227b5e3d5e93d88db9610463947317e896e26 EBUILD llvm-common-19.1.0_rc2.ebuild 925 BLAKE2B 18510f8adb0e892eb63bdbf8a6154f56e23ed026ee6f0bf05bbccbafea843beb228bf57e14b01525fb0b067fdfa897faadbfd61179844a7c397c7f1d3b6fca64 SHA512 0cff75fcbabf14ba1526201d65b79486aefaf559accf5bd479a3643c4351ac997f6d55b2323328fabc4009e887e1cfe70681df5593c62a5b5bbfffb8312ea22d +EBUILD llvm-common-19.1.0_rc3.ebuild 925 BLAKE2B 18510f8adb0e892eb63bdbf8a6154f56e23ed026ee6f0bf05bbccbafea843beb228bf57e14b01525fb0b067fdfa897faadbfd61179844a7c397c7f1d3b6fca64 SHA512 0cff75fcbabf14ba1526201d65b79486aefaf559accf5bd479a3643c4351ac997f6d55b2323328fabc4009e887e1cfe70681df5593c62a5b5bbfffb8312ea22d EBUILD llvm-common-20.0.0.9999.ebuild 925 BLAKE2B 18510f8adb0e892eb63bdbf8a6154f56e23ed026ee6f0bf05bbccbafea843beb228bf57e14b01525fb0b067fdfa897faadbfd61179844a7c397c7f1d3b6fca64 SHA512 0cff75fcbabf14ba1526201d65b79486aefaf559accf5bd479a3643c4351ac997f6d55b2323328fabc4009e887e1cfe70681df5593c62a5b5bbfffb8312ea22d EBUILD llvm-common-20.0.0_pre20240808.ebuild 925 BLAKE2B 18510f8adb0e892eb63bdbf8a6154f56e23ed026ee6f0bf05bbccbafea843beb228bf57e14b01525fb0b067fdfa897faadbfd61179844a7c397c7f1d3b6fca64 SHA512 0cff75fcbabf14ba1526201d65b79486aefaf559accf5bd479a3643c4351ac997f6d55b2323328fabc4009e887e1cfe70681df5593c62a5b5bbfffb8312ea22d EBUILD llvm-common-20.0.0_pre20240815.ebuild 925 BLAKE2B 18510f8adb0e892eb63bdbf8a6154f56e23ed026ee6f0bf05bbccbafea843beb228bf57e14b01525fb0b067fdfa897faadbfd61179844a7c397c7f1d3b6fca64 SHA512 0cff75fcbabf14ba1526201d65b79486aefaf559accf5bd479a3643c4351ac997f6d55b2323328fabc4009e887e1cfe70681df5593c62a5b5bbfffb8312ea22d diff --git a/sys-devel/llvm-common/llvm-common-19.1.0_rc3.ebuild b/sys-devel/llvm-common/llvm-common-19.1.0_rc3.ebuild new file mode 100644 index 000000000000..2d8f35a84179 --- /dev/null +++ b/sys-devel/llvm-common/llvm-common-19.1.0_rc3.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/Manifest b/sys-devel/llvm/Manifest index e8ab13cf1c74..4cbee505cc68 100644 --- a/sys-devel/llvm/Manifest +++ b/sys-devel/llvm/Manifest @@ -18,6 +18,8 @@ DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffe DIST llvm-project-18.1.8.src.tar.xz.sig 566 BLAKE2B 6ab0efc5b38d4483f4e32e8b85774b2edd5d88fdf29f23b88eb0b5130a7a7f0e80549612b025f927e92de4a08ff7c292cff224dbda91a5d598244e98f7ad0fbd SHA512 ddfd1e8a06756759af6cbe488c82a6d6a62ba91f3e8a0eb4cece561321824f5d165b08ed91010588790b76e19790931d2651b24dba8567e3b151d3cb43bec25b DIST llvm-project-19.1.0-rc2.src.tar.xz 141264388 BLAKE2B 690b4912d9e4a8019b7990934dd6486362337ccb303dca119c0e75aa1063ad452222be1ee965e43b160dfcea20e491a20c289344152666b618712a1d76dc4780 SHA512 508a401e8433b1ac9a399246eb1a3c18faed7c3d41d8c118e77cefbb64cc6d6e171bd41a3e5584f6c84df141ba6819f1a1cce75b5c1ef33e3d2ac239e662d07c DIST llvm-project-19.1.0-rc2.src.tar.xz.sig 438 BLAKE2B 1eaf10a1419ecf009c033a8f6ecb6eec86107d81621d5b4665c8d929b05f4845ce0c432017343d7b06f33e6ff6384df9e1d8fc7b9c6efe7f10ef69798891b7e5 SHA512 b46e9a1d40f891c5f3544d8cc6295900bff5dda9a4a526b8db55a42a37ae90deb216b316d2117984e82f4e918d15343e75b3b9e6d6c773866707c3398e032826 +DIST llvm-project-19.1.0-rc3.src.tar.xz 141250388 BLAKE2B 6530bede000d2e4b8ce10b445bfc1f81dc25c2d7121fc953581cd9b6989b3ba197707cd79d3c7b94c055bf2e21b0d07ab3cb401d3f73d22eefba6da4b71dca7b SHA512 3ee4eab848e5e38c396e6f5addf5eb42570d451fc8e7cd77150dc5542f8f710f4a9db51836f7a799996dd1b8194defe4d58efe7c19e5d5e1c5f3dbdda94c0cf3 +DIST llvm-project-19.1.0-rc3.src.tar.xz.sig 438 BLAKE2B 86bad4d4fb805340096473bc603d7a3483f030f62b6f52b64d12c33561fbbb999c2ab69cc94857a32747492c846a5ab631a84da200b03475fd401335373bbccf SHA512 ef0fd2e3e7069fbfd410cbcf71294d1b7182456330ff151348058b5cb0f292edaecb9dcbf613ee4fc979214a23bd3bb8077d71e674635359da36b938dc143266 DIST llvm-project-db8ef6188cbbe2125e6d60bdef77a535105772df.tar.gz 218416682 BLAKE2B 691e3881e4a60c008c6b766b51ecc856122de1f40242ff1d91ebaa12682fea0a22f84783eb930c42d196f50ba0d3b2010f9010ed73ee7e292fe78c93d6e3f324 SHA512 2dc16a603b60607cc3daee2de0126a567a78c4fff72b2fbcb94c82472bc5ec64ac354ba8592b9a643248a5bfd43b34e2a60f2751a0c9e9e28b7f895fc50a5e9d DIST llvm-project-fd7d7882e7fa5a38d4bfde426120d4663718beb4.tar.gz 218217769 BLAKE2B a6c2aa012c342e31527b7e9f85e8fea3549d52530d8f87cd699e094a0aa768d099f9fd2631161ff7f53b4a5011937ed6d1f52b8fa1d23aa34183be1f487d4277 SHA512 c4863fab1a3c03f7f9c42f3501d3a75cebb491343515d77d30b26e5cbd720fc3fd628052099d87ed638e8c424bcbe7a1d066ed857f73da6f243d3d5a76b0e6c5 EBUILD llvm-15.0.7-r3.ebuild 12592 BLAKE2B 81cd473990810203c4e8a47ceb0189ed399c869b85fab3181724dbd1429063cdaad1f6b6cb1ab5b392f531b0b4907cc61f266558b873b236f9a3ff439045aa37 SHA512 2321f9e6da93af22d5f074175a6a92b7dcd271e2b9b92128d268dd777a9c3bdd876010740153734e2593b90d26a58d4f784b2256a6b1e18160d13b3c10441fb3 @@ -27,6 +29,7 @@ EBUILD llvm-17.0.6.ebuild 13293 BLAKE2B 50e4212c63f1561f4fc8397a831f83bd3ea37034 EBUILD llvm-18.1.8-r1.ebuild 13372 BLAKE2B cb78f1c21e29ec1987c52edeebdc3d0200ec0b6f5d4b6443b2fd62eda6e3cafcc4bf849cd0bd1112f899904f3816970f5f4672f9c7a51f400bb39ce924d023d4 SHA512 9246e225b934b64e982c3d4399faea476871845616f979fa6d7eed832a75f879d611f85a29e04ca768bd6690945f24a3e7eebdbe8b81f156299b37965944ec91 EBUILD llvm-18.1.8-r4.ebuild 13382 BLAKE2B 2d52ad708ed578868b700b97cc581ea732147219b9b71d4ced6dbe2553054e2524ba0971e051934b610d5aaa4e6a164e14c56be9961637349b37d9bafa97916b SHA512 4e67d7e9ceb174d8b9135e330ff5371e385d0253f6d8f6c7058840de7dc7819a5711670fa6ca0b487d9f4985de20987c0d69ee1809e131fbea029029643da475 EBUILD llvm-19.1.0_rc2.ebuild 13056 BLAKE2B 58a31e7b71687262ab0d6a7b194dbd8fdca492af1402f56d6fd638fd2cee7139faa686a08bf1b33b4c1c7721f1312d2aa1d7e0ce5ba452b9bf571ec49c4e127e SHA512 2cf4583ef22f45b7edb666d665b7d06728873ce724fe851d0cd974dd5f3ecc1e473ed6aa16111f5a6382d2f09088595be4b41fa4d5bf2e316048de0ff250cfbc +EBUILD llvm-19.1.0_rc3.ebuild 13041 BLAKE2B 914b33f85966c0b7ce92bc3ada3219ab7f670af431a69272b5a5b4bc95adc94e8fa8c1da360f0d0ba24a53122e2649beb20b7938d1ecab75db12ea900e65ac23 SHA512 855ef1af58a4288b23604850d1e45742e1ea9e2f584917da7bb41fce5a025d470d344896a376a9a78fe97362607e8a7266b9f76834379b86b8ca6c6b680ad798 EBUILD llvm-20.0.0.9999.ebuild 13137 BLAKE2B a7e19b19f8caa7fc54e74971f5525c580a9ac93cc26f55eeebe3f77401e588f658c8114549531458ec6f8166918396b77f03180309f2e0406c25a4dcb63c264c SHA512 3e77439099120b69390aca71f834ca60953860496ebc8e31086b3cc4e8b9a84350d1bac16e7cad00a53b68837eb3717c6669ba785d8f607301916f04f390c41d EBUILD llvm-20.0.0_pre20240808.ebuild 13137 BLAKE2B a7e19b19f8caa7fc54e74971f5525c580a9ac93cc26f55eeebe3f77401e588f658c8114549531458ec6f8166918396b77f03180309f2e0406c25a4dcb63c264c SHA512 3e77439099120b69390aca71f834ca60953860496ebc8e31086b3cc4e8b9a84350d1bac16e7cad00a53b68837eb3717c6669ba785d8f607301916f04f390c41d EBUILD llvm-20.0.0_pre20240815.ebuild 13137 BLAKE2B a7e19b19f8caa7fc54e74971f5525c580a9ac93cc26f55eeebe3f77401e588f658c8114549531458ec6f8166918396b77f03180309f2e0406c25a4dcb63c264c SHA512 3e77439099120b69390aca71f834ca60953860496ebc8e31086b3cc4e8b9a84350d1bac16e7cad00a53b68837eb3717c6669ba785d8f607301916f04f390c41d diff --git a/sys-devel/llvm/llvm-19.1.0_rc3.ebuild b/sys-devel/llvm/llvm-19.1.0_rc3.ebuild new file mode 100644 index 000000000000..3861c87b9224 --- /dev/null +++ b/sys-devel/llvm/llvm-19.1.0_rc3.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..13} ) + +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 + 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}] ) + 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? ( + /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 + + if has_version ">=sys-libs/glibc-2.40"; then + # https://github.com/llvm/llvm-project/issues/100791 + rm -r test/tools/llvm-exegesis/X86/latency || die + fi +} + +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 + reduce-chunk-list + 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_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+=( + # 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)" +} -- cgit v1.2.3