llvm-core/clang-common: Remove old

Signed-off-by: Michał Górny <mgorny@gentoo.org>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/866
This commit is contained in:
Michał Górny
2026-07-16 17:26:23 +02:00
parent dd04560723
commit ea9685de14
2 changed files with 0 additions and 192 deletions
-2
View File
@@ -1,5 +1,3 @@
DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7
DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447
DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30
DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
DIST llvm-project-18.1.8.src.tar.xz 132067260 BLAKE2B a950492f1dbfb874dff63b1ffef86468169ba2f211a9733ec2d4cf30040f7f277ef00f048bb44dee9f97d7d762f0f241f19e5a2a7b0b49217d3821ddfc8c354f SHA512 25eeee9984c8b4d0fbc240df90f33cbb000d3b0414baff5c8982beafcc5e59e7ef18f6f85d95b3a5f60cb3d4cd4f877c80487b5768bc21bc833f107698ad93db
@@ -1,190 +0,0 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit bash-completion-r1 llvm.org
DESCRIPTION="Common files shared between multiple slots of clang"
HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv ~sparc x86 ~arm64-macos ~x64-macos"
IUSE="
default-compiler-rt default-libcxx default-lld
bootstrap-prefix hardened llvm-libunwind
"
PDEPEND="
default-compiler-rt? (
llvm-runtimes/clang-runtime:${LLVM_MAJOR}[compiler-rt]
llvm-libunwind? ( llvm-runtimes/libunwind[static-libs] )
!llvm-libunwind? ( sys-libs/libunwind[static-libs] )
)
!default-compiler-rt? ( sys-devel/gcc )
default-libcxx? ( >=llvm-runtimes/libcxx-${PV}[static-libs] )
!default-libcxx? ( sys-devel/gcc )
default-lld? ( >=llvm-core/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 "llvm-core/clang[${flag}]"; then
missing_flags+=( "${flag}" )
fi
done
if [[ ${missing_flags[@]} ]]; then
eerror "It seems that you have the following flags set on llvm-core/clang:"
eerror
eerror " ${missing_flags[*]}"
eerror
eerror "The default runtimes are now set via flags on llvm-core/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 " llvm-core/clang-common ${missing_flags[*]}"
eerror
eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
die "Mismatched defaults detected between llvm-core/clang and llvm-core/clang-common"
fi
}
src_install() {
newbashcomp bash-autocomplete.sh clang
insinto /etc/clang
newins - gentoo-runtimes.cfg <<-EOF
# This file is initially generated by llvm-runtimes/clang-runtime.
# It is used to control the default runtimes using by clang.
--rtlib=$(usex default-compiler-rt compiler-rt libgcc)
--unwindlib=$(usex default-compiler-rt libunwind libgcc)
--stdlib=$(usex default-libcxx libc++ libstdc++)
-fuse-ld=$(usex default-lld lld bfd)
EOF
newins - gentoo-gcc-install.cfg <<-EOF
# This file is maintained by gcc-config.
# It is used to specify the selected GCC installation.
EOF
newins - gentoo-common.cfg <<-EOF
# This file contains flags common to clang, clang++ and clang-cpp.
@gentoo-runtimes.cfg
@gentoo-gcc-install.cfg
@gentoo-hardened.cfg
# bug #870001
-include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
EOF
# Baseline hardening (bug #851111)
newins - gentoo-hardened.cfg <<-EOF
# Some of these options are added unconditionally, regardless of
# USE=hardened, for parity with sys-devel/gcc.
-Xarch_host -fstack-clash-protection
-Xarch_host -fstack-protector-strong
-fPIE
-include "${EPREFIX}/usr/include/gentoo/fortify.h"
EOF
dodir /usr/include/gentoo
cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
/* __has_include is an extension, but it's fine, because this is only
for Clang anyway. */
#if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
# include <stdc-predef.h>
#endif
EOF
local fortify_level=$(usex hardened 3 2)
# We have to do this because glibc's headers warn if F_S is set
# without optimization and that would at the very least be very noisy
# during builds and at worst trigger many -Werror builds.
cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
#ifdef __clang__
# pragma clang system_header
#endif
#ifndef _FORTIFY_SOURCE
# if defined(__has_feature)
# define __GENTOO_HAS_FEATURE(x) __has_feature(x)
# else
# define __GENTOO_HAS_FEATURE(x) 0
# endif
#
# if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
# if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
# define _FORTIFY_SOURCE ${fortify_level}
# endif
# endif
# undef __GENTOO_HAS_FEATURE
#endif
EOF
if use hardened ; then
cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
# Options below are conditional on USE=hardened.
-D_GLIBCXX_ASSERTIONS
# Analogue to GLIBCXX_ASSERTIONS
# https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
-D_LIBCPP_ENABLE_ASSERTIONS=1
EOF
fi
local tool
for tool in clang{,++,-cpp}; do
newins - "${tool}.cfg" <<-EOF
# This configuration file is used by ${tool} driver.
@gentoo-common.cfg
EOF
done
if use kernel_Darwin; then
cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
# Gentoo Prefix on Darwin
-Wl,-search_paths_first
-Wl,-rpath,${EPREFIX}/usr/lib
-L ${EPREFIX}/usr/lib
-isystem ${EPREFIX}/usr/include
-isysroot ${EPREFIX}/MacOSX.sdk
EOF
if use bootstrap-prefix ; then
# bootstrap-prefix is only set during stage2 of bootstrapping
# Prefix, where EPREFIX is set to EPREFIX/tmp.
# Here we need to point it at the future lib dir of the stage3's
# EPREFIX.
cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
-Wl,-rpath,${EPREFIX}/../usr/lib
EOF
fi
cat >> "${ED}/etc/clang/clang++.cfg" <<-EOF || die
-lc++abi
EOF
fi
}
pkg_preinst() {
if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
then
local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
if [[ -n ${gcc_path} ]]; then
cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
--gcc-install-dir="${gcc_path%%:*}"
EOF
fi
fi
}