From da7ae1dd1fccb6b3c0e4763ab983ad96d57bf463 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 20 Apr 2024 12:05:24 +0100 Subject: gentoo auto-resync : 20:04:2024 - 12:05:23 --- sys-libs/Manifest.gz | Bin 14580 -> 14565 bytes sys-libs/compiler-rt-sanitizers/Manifest | 9 +- .../compiler-rt-sanitizers-18.1.3.ebuild | 218 --- ...ompiler-rt-sanitizers-19.0.0_pre20240330.ebuild | 217 --- ...ompiler-rt-sanitizers-19.0.0_pre20240404.ebuild | 217 --- ...ompiler-rt-sanitizers-19.0.0_pre20240420.ebuild | 217 +++ sys-libs/compiler-rt/Manifest | 9 +- sys-libs/compiler-rt/compiler-rt-18.1.3.ebuild | 172 -- .../compiler-rt-19.0.0_pre20240330.ebuild | 171 -- .../compiler-rt-19.0.0_pre20240404.ebuild | 171 -- .../compiler-rt-19.0.0_pre20240420.ebuild | 171 ++ sys-libs/glibc/Manifest | 6 +- sys-libs/glibc/glibc-2.38-r12.ebuild | 2 +- sys-libs/glibc/glibc-2.39-r1.ebuild | 1714 ------------------- sys-libs/glibc/glibc-2.39-r2.ebuild | 1724 -------------------- sys-libs/libcxx/Manifest | 9 +- sys-libs/libcxx/libcxx-18.1.3.ebuild | 210 --- sys-libs/libcxx/libcxx-19.0.0_pre20240330.ebuild | 210 --- sys-libs/libcxx/libcxx-19.0.0_pre20240404.ebuild | 210 --- sys-libs/libcxx/libcxx-19.0.0_pre20240420.ebuild | 210 +++ sys-libs/libcxxabi/Manifest | 9 +- sys-libs/libcxxabi/libcxxabi-18.1.3.ebuild | 111 -- .../libcxxabi/libcxxabi-19.0.0_pre20240330.ebuild | 110 -- .../libcxxabi/libcxxabi-19.0.0_pre20240404.ebuild | 110 -- .../libcxxabi/libcxxabi-19.0.0_pre20240420.ebuild | 110 ++ sys-libs/libomp/Manifest | 9 +- sys-libs/libomp/libomp-18.1.3.ebuild | 161 -- sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild | 160 -- sys-libs/libomp/libomp-19.0.0_pre20240404.ebuild | 160 -- sys-libs/libomp/libomp-19.0.0_pre20240420.ebuild | 160 ++ sys-libs/llvm-libunwind/Manifest | 9 +- .../llvm-libunwind/llvm-libunwind-18.1.3.ebuild | 129 -- .../llvm-libunwind-19.0.0_pre20240330.ebuild | 128 -- .../llvm-libunwind-19.0.0_pre20240404.ebuild | 128 -- .../llvm-libunwind-19.0.0_pre20240420.ebuild | 128 ++ 35 files changed, 1010 insertions(+), 6479 deletions(-) delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.1.3.ebuild delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240330.ebuild delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240404.ebuild create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240420.ebuild delete mode 100644 sys-libs/compiler-rt/compiler-rt-18.1.3.ebuild delete mode 100644 sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240330.ebuild delete mode 100644 sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240404.ebuild create mode 100644 sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240420.ebuild delete mode 100644 sys-libs/glibc/glibc-2.39-r1.ebuild delete mode 100644 sys-libs/glibc/glibc-2.39-r2.ebuild delete mode 100644 sys-libs/libcxx/libcxx-18.1.3.ebuild delete mode 100644 sys-libs/libcxx/libcxx-19.0.0_pre20240330.ebuild delete mode 100644 sys-libs/libcxx/libcxx-19.0.0_pre20240404.ebuild create mode 100644 sys-libs/libcxx/libcxx-19.0.0_pre20240420.ebuild delete mode 100644 sys-libs/libcxxabi/libcxxabi-18.1.3.ebuild delete mode 100644 sys-libs/libcxxabi/libcxxabi-19.0.0_pre20240330.ebuild delete mode 100644 sys-libs/libcxxabi/libcxxabi-19.0.0_pre20240404.ebuild create mode 100644 sys-libs/libcxxabi/libcxxabi-19.0.0_pre20240420.ebuild delete mode 100644 sys-libs/libomp/libomp-18.1.3.ebuild delete mode 100644 sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild delete mode 100644 sys-libs/libomp/libomp-19.0.0_pre20240404.ebuild create mode 100644 sys-libs/libomp/libomp-19.0.0_pre20240420.ebuild delete mode 100644 sys-libs/llvm-libunwind/llvm-libunwind-18.1.3.ebuild delete mode 100644 sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240330.ebuild delete mode 100644 sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240404.ebuild create mode 100644 sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240420.ebuild (limited to 'sys-libs') diff --git a/sys-libs/Manifest.gz b/sys-libs/Manifest.gz index beaf19b9f52a..5367b9f2a814 100644 Binary files a/sys-libs/Manifest.gz and b/sys-libs/Manifest.gz differ diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest index b9077219585a..38ead037fa9e 100644 --- a/sys-libs/compiler-rt-sanitizers/Manifest +++ b/sys-libs/compiler-rt-sanitizers/Manifest @@ -1,24 +1,19 @@ DIST llvm-gentoo-patchset-15.0.7.tar.xz 19300 BLAKE2B b70e81d744c2eba5cd851e7b690ce8979b3064973f522be7c93bfb541860000a4bc8b17219f8788dfc8a527217dd13946cf7836640698ddd3d4b3fde493dfbf8 SHA512 daffff6ae4a0874aff1a423b4bb36701ecb5a35a36ae91d4ed7fda58b83e50ffcdc30498c84be4711fd3e1f227bf312dbe930019203e0a131944439af2aa94f7 -DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948 DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7 DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447 DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30 DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340 -DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783 -DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29 DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386 -DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07 DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1 +DIST llvm-project-f03cd2db91956456f1c5e2da86d3c50183eebd28.tar.gz 209375254 BLAKE2B 1d7e043d04323edb64b2ef2309fbcb4f82a959f45391e815133cc0891d5a497bbb81101aab460e9bf67e75aa906e13ad1877c3850829dcad397ed626dc8f2792 SHA512 6775e03a44b2133bd4a4b473ab007599321daa19dc7f3cc47f95cf9d110e83e982bf48a6b1d43038b0f0a2c0fef2f689aefd20132b25a90ef19342683e2d2e50 EBUILD compiler-rt-sanitizers-15.0.7.ebuild 6648 BLAKE2B 89d90e750bc9c3c35e8a42a259fd84bc147ed9b7ed66168435f0010ef8adaf35e04e2cd43c1acc144668e04f5c229ca3cfd99aeb01b4ba2e46f10dd4615e131d SHA512 4f290993d65b7a17280c5ea9a9d19e13cefdde3aebc2236271e02bb1517655895e8eb3adc2047a849ce11dbacf8d7eddec715ab14523122089d856c21ae123a0 EBUILD compiler-rt-sanitizers-16.0.6.ebuild 6615 BLAKE2B 3ca63eefd87ce02510afa912e809895da7356a8e248f402f3fca1583048feebf80cba20f076e1b28fa4ad7f7c06781910948fc49d980b03276a900dc75114e06 SHA512 7f34e0416b520c75457f8267f28630f7a665f05e22d3f5c2d96ea631fcda79a584b6c0e75cba8b7fba7bf28b87a6b19b49be3b4b8770393caabc5ebc83831ebe EBUILD compiler-rt-sanitizers-17.0.6.ebuild 6447 BLAKE2B 553a762d6dd06dafca05953f4d60e5e3dd215d813da29053d5c4c44750554e3ed90c187390196eeee3bc85bb1e3fbdac7aa2e100b623271898478003792a1302 SHA512 6beaa92bf1ba5213dc9c73395ecdae737f1a84119da6e3f8f008f9f21cf7d7b08b3634ad8768af6b19992fd49d964344c7d37e19b7c7bfec02af644bdc730bbd -EBUILD compiler-rt-sanitizers-18.1.3.ebuild 6358 BLAKE2B d68fe00a7d79a022d2c66f03d1987491c7d382158426a5f27923f84df05cf5d27697abacad984e94a5b5f333bcd1e60d080ebbc4708f4abe77086bc777aeaaf5 SHA512 fcaf7d7203ede21db563de3b24bbf4d2939856913ba5ee3fff4f29eef18d6e93789791bc3e0d0b4ecd761fd7e8772b3a9f7ea5149300a22f99ee46e6caafbcd9 EBUILD compiler-rt-sanitizers-18.1.4.ebuild 6358 BLAKE2B d68fe00a7d79a022d2c66f03d1987491c7d382158426a5f27923f84df05cf5d27697abacad984e94a5b5f333bcd1e60d080ebbc4708f4abe77086bc777aeaaf5 SHA512 fcaf7d7203ede21db563de3b24bbf4d2939856913ba5ee3fff4f29eef18d6e93789791bc3e0d0b4ecd761fd7e8772b3a9f7ea5149300a22f99ee46e6caafbcd9 EBUILD compiler-rt-sanitizers-19.0.0.9999.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127 -EBUILD compiler-rt-sanitizers-19.0.0_pre20240330.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127 -EBUILD compiler-rt-sanitizers-19.0.0_pre20240404.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127 EBUILD compiler-rt-sanitizers-19.0.0_pre20240410.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127 +EBUILD compiler-rt-sanitizers-19.0.0_pre20240420.ebuild 6268 BLAKE2B 98422f1f8be179031ffed4ea9176843521842aff5be2cbdcb21f6ea2020a8d13a1c6fc4810e769c0ec0775f92af45831c4385cc70680765f474885c5ad5b389f SHA512 8677df281de24325290cb99cc4f6087460443c716ac2eea7b3c8175281daad874cd7aab0dda8f4d60213a1b73a8f1a921ae7ad0733d104a7db0e8e5f2ac35127 MISC metadata.xml 1412 BLAKE2B 75675507000fa6a6b8182e6b45a08a2716ae7fb9a7e3428dc8420464e4c1d1bdb5bea62cc2f553c579de5a4faa752b35cb3529d980fb07a055ff4ddf6e752707 SHA512 f05ea5168b923db72f4f5b53e9b748ebbcdae9eff09d86323313055933b47fc0089e1b2d73cd997d73dcfb2dca032344955816425fbddc09d27ca751463aadbb diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.1.3.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.1.3.ebuild deleted file mode 100644 index 192ead8311f8..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-18.1.3.ebuild +++ /dev/null @@ -1,218 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit check-reqs cmake flag-o-matic llvm.org llvm-utils python-any-r1 - -DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="${LLVM_MAJOR}" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~ppc-macos ~x64-macos" -IUSE="+abi_x86_32 abi_x86_64 +clang debug test" -# base targets -IUSE+=" +libfuzzer +memprof +orc +profile +xray" -# sanitizer targets, keep in sync with config-ix.cmake -# NB: ubsan, scudo deliberately match two entries -SANITIZER_FLAGS=( - asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo - shadowcallstack gwp-asan -) -IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" -REQUIRED_USE=" - || ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray ) - test? ( - cfi? ( ubsan ) - gwp-asan? ( scudo ) - ) -" -RESTRICT=" - !clang? ( test ) - !test? ( test ) -" - -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} - virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] -" -BDEPEND=" - clang? ( sys-devel/clang ) - elibc_glibc? ( net-libs/libtirpc ) - test? ( - $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") - =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} - sys-libs/compiler-rt:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) -" - -LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support third-party ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" -} - -check_space() { - if use test; then - local CHECKREQS_DISK_BUILD=11G - check-reqs_pkg_pretend - fi -} - -pkg_pretend() { - check_space -} - -pkg_setup() { - check_space - python-any-r1_pkg_setup -} - -src_prepare() { - sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die - - local flag - for flag in "${SANITIZER_FLAGS[@]}"; do - if ! use "${flag}"; then - local cmake_flag=${flag/-/_} - sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ - cmake/config-ix.cmake || die - fi - done - - # TODO: fix these tests to be skipped upstream - if use asan && ! use profile; then - rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die - fi - if use ubsan && ! use cfi; then - > test/cfi/CMakeLists.txt || die - fi - # hangs, sigh - rm test/tsan/getline_nohang.cpp || die - - llvm.org_src_prepare -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - # pre-set since we need to pass it to cmake - BUILD_DIR=${WORKDIR}/compiler-rt_build - - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - local flag want_sanitizer=OFF - for flag in "${SANITIZER_FLAGS[@]}"; do - if use "${flag}"; then - want_sanitizer=ON - break - fi - done - - local mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" - # use a build dir structure consistent with install - # this makes it possible to easily deploy test-friendly clang - -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${LLVM_MAJOR}" - - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) - # builtins & crt installed by sys-libs/compiler-rt - -DCOMPILER_RT_BUILD_BUILTINS=OFF - -DCOMPILER_RT_BUILD_CRT=OFF - -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer) - -DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof) - -DCOMPILER_RT_BUILD_ORC=$(usex orc) - -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) - -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}" - -DCOMPILER_RT_BUILD_XRAY=$(usex xray) - - -DPython3_EXECUTABLE="${PYTHON}" - ) - - if use amd64; then - mycmakeargs+=( - -DCAN_TARGET_i386=$(usex abi_x86_32) - -DCAN_TARGET_x86_64=$(usex abi_x86_64) - ) - fi - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - # they are created during src_test() - -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang++" - ) - - # same flags are passed for build & tests, so we need to strip - # them down to a subset supported by clang - CC=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang \ - CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++ \ - strip-unsupported-flags - fi - - if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then - mycmakeargs+=( - # setting -isysroot is disabled with compiler-rt-prefix-paths.patch - # this allows adding arm64 support using SDK in EPREFIX - -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" - # Set version based on the SDK in EPREFIX - # This disables i386 for SDK >= 10.15 - # Will error if has_use tsan and SDK < 10.12 - -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" - # Use our libtool instead of looking it up with xcrun - -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" - ) - fi - - cmake_src_configure - - if use test; then - local sys_dir=( "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/lib/* ) - [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" - [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" - - # copy clang over since resource_dir is located relatively to binary - # therefore, we can put our new libraries in it - mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_MAJOR}/{bin,$(get_libdir)},clang/${LLVM_MAJOR}/include} || die - cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/bin/clang{,++} \ - "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/bin/ || die - cp "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/include/*.h \ - "${BUILD_DIR}"/lib/clang/${LLVM_MAJOR}/include/ || die - cp "${sys_dir}"/*builtins*.a \ - "${BUILD_DIR}/lib/clang/${LLVM_MAJOR}/lib/${sys_dir##*/}/" || die - # we also need LLVMgold.so for gold-based tests - if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so ]]; then - ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so \ - "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/ || die - fi - fi -} - -src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - # disable sandbox to have it stop clobbering LD_PRELOAD - local -x SANDBOX_ON=0 - # wipe LD_PRELOAD to make ASAN happy - local -x LD_PRELOAD= - - cmake_build check-all -} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240330.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240330.ebuild deleted file mode 100644 index 57f868d54be6..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240330.ebuild +++ /dev/null @@ -1,217 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit check-reqs cmake flag-o-matic llvm.org llvm-utils python-any-r1 - -DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="${LLVM_MAJOR}" -IUSE="+abi_x86_32 abi_x86_64 +clang +debug test" -# base targets -IUSE+=" +libfuzzer +memprof +orc +profile +xray" -# sanitizer targets, keep in sync with config-ix.cmake -# NB: ubsan, scudo deliberately match two entries -SANITIZER_FLAGS=( - asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo - shadowcallstack gwp-asan -) -IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" -REQUIRED_USE=" - || ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray ) - test? ( - cfi? ( ubsan ) - gwp-asan? ( scudo ) - ) -" -RESTRICT=" - !clang? ( test ) - !test? ( test ) -" - -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} - virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] -" -BDEPEND=" - clang? ( sys-devel/clang ) - elibc_glibc? ( net-libs/libtirpc ) - test? ( - $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") - =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} - sys-libs/compiler-rt:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) -" - -LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support third-party ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" -} - -check_space() { - if use test; then - local CHECKREQS_DISK_BUILD=11G - check-reqs_pkg_pretend - fi -} - -pkg_pretend() { - check_space -} - -pkg_setup() { - check_space - python-any-r1_pkg_setup -} - -src_prepare() { - sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die - - local flag - for flag in "${SANITIZER_FLAGS[@]}"; do - if ! use "${flag}"; then - local cmake_flag=${flag/-/_} - sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ - cmake/config-ix.cmake || die - fi - done - - # TODO: fix these tests to be skipped upstream - if use asan && ! use profile; then - rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die - fi - if use ubsan && ! use cfi; then - > test/cfi/CMakeLists.txt || die - fi - # hangs, sigh - rm test/tsan/getline_nohang.cpp || die - - llvm.org_src_prepare -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - # pre-set since we need to pass it to cmake - BUILD_DIR=${WORKDIR}/compiler-rt_build - - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - local flag want_sanitizer=OFF - for flag in "${SANITIZER_FLAGS[@]}"; do - if use "${flag}"; then - want_sanitizer=ON - break - fi - done - - local mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" - # use a build dir structure consistent with install - # this makes it possible to easily deploy test-friendly clang - -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${LLVM_MAJOR}" - - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) - # builtins & crt installed by sys-libs/compiler-rt - -DCOMPILER_RT_BUILD_BUILTINS=OFF - -DCOMPILER_RT_BUILD_CRT=OFF - -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer) - -DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof) - -DCOMPILER_RT_BUILD_ORC=$(usex orc) - -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) - -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}" - -DCOMPILER_RT_BUILD_XRAY=$(usex xray) - - -DPython3_EXECUTABLE="${PYTHON}" - ) - - if use amd64; then - mycmakeargs+=( - -DCAN_TARGET_i386=$(usex abi_x86_32) - -DCAN_TARGET_x86_64=$(usex abi_x86_64) - ) - fi - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - # they are created during src_test() - -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang++" - ) - - # same flags are passed for build & tests, so we need to strip - # them down to a subset supported by clang - CC=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang \ - CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++ \ - strip-unsupported-flags - fi - - if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then - mycmakeargs+=( - # setting -isysroot is disabled with compiler-rt-prefix-paths.patch - # this allows adding arm64 support using SDK in EPREFIX - -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" - # Set version based on the SDK in EPREFIX - # This disables i386 for SDK >= 10.15 - # Will error if has_use tsan and SDK < 10.12 - -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" - # Use our libtool instead of looking it up with xcrun - -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" - ) - fi - - cmake_src_configure - - if use test; then - local sys_dir=( "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/lib/* ) - [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" - [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" - - # copy clang over since resource_dir is located relatively to binary - # therefore, we can put our new libraries in it - mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_MAJOR}/{bin,$(get_libdir)},clang/${LLVM_MAJOR}/include} || die - cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/bin/clang{,++} \ - "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/bin/ || die - cp "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/include/*.h \ - "${BUILD_DIR}"/lib/clang/${LLVM_MAJOR}/include/ || die - cp "${sys_dir}"/*builtins*.a \ - "${BUILD_DIR}/lib/clang/${LLVM_MAJOR}/lib/${sys_dir##*/}/" || die - # we also need LLVMgold.so for gold-based tests - if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so ]]; then - ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so \ - "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/ || die - fi - fi -} - -src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - # disable sandbox to have it stop clobbering LD_PRELOAD - local -x SANDBOX_ON=0 - # wipe LD_PRELOAD to make ASAN happy - local -x LD_PRELOAD= - - cmake_build check-all -} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240404.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240404.ebuild deleted file mode 100644 index 57f868d54be6..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240404.ebuild +++ /dev/null @@ -1,217 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit check-reqs cmake flag-o-matic llvm.org llvm-utils python-any-r1 - -DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="${LLVM_MAJOR}" -IUSE="+abi_x86_32 abi_x86_64 +clang +debug test" -# base targets -IUSE+=" +libfuzzer +memprof +orc +profile +xray" -# sanitizer targets, keep in sync with config-ix.cmake -# NB: ubsan, scudo deliberately match two entries -SANITIZER_FLAGS=( - asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo - shadowcallstack gwp-asan -) -IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" -REQUIRED_USE=" - || ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray ) - test? ( - cfi? ( ubsan ) - gwp-asan? ( scudo ) - ) -" -RESTRICT=" - !clang? ( test ) - !test? ( test ) -" - -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} - virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] -" -BDEPEND=" - clang? ( sys-devel/clang ) - elibc_glibc? ( net-libs/libtirpc ) - test? ( - $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") - =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} - sys-libs/compiler-rt:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) -" - -LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support third-party ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" -} - -check_space() { - if use test; then - local CHECKREQS_DISK_BUILD=11G - check-reqs_pkg_pretend - fi -} - -pkg_pretend() { - check_space -} - -pkg_setup() { - check_space - python-any-r1_pkg_setup -} - -src_prepare() { - sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die - - local flag - for flag in "${SANITIZER_FLAGS[@]}"; do - if ! use "${flag}"; then - local cmake_flag=${flag/-/_} - sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ - cmake/config-ix.cmake || die - fi - done - - # TODO: fix these tests to be skipped upstream - if use asan && ! use profile; then - rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die - fi - if use ubsan && ! use cfi; then - > test/cfi/CMakeLists.txt || die - fi - # hangs, sigh - rm test/tsan/getline_nohang.cpp || die - - llvm.org_src_prepare -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - # pre-set since we need to pass it to cmake - BUILD_DIR=${WORKDIR}/compiler-rt_build - - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - local flag want_sanitizer=OFF - for flag in "${SANITIZER_FLAGS[@]}"; do - if use "${flag}"; then - want_sanitizer=ON - break - fi - done - - local mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" - # use a build dir structure consistent with install - # this makes it possible to easily deploy test-friendly clang - -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${LLVM_MAJOR}" - - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) - # builtins & crt installed by sys-libs/compiler-rt - -DCOMPILER_RT_BUILD_BUILTINS=OFF - -DCOMPILER_RT_BUILD_CRT=OFF - -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer) - -DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof) - -DCOMPILER_RT_BUILD_ORC=$(usex orc) - -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) - -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}" - -DCOMPILER_RT_BUILD_XRAY=$(usex xray) - - -DPython3_EXECUTABLE="${PYTHON}" - ) - - if use amd64; then - mycmakeargs+=( - -DCAN_TARGET_i386=$(usex abi_x86_32) - -DCAN_TARGET_x86_64=$(usex abi_x86_64) - ) - fi - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - # they are created during src_test() - -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang++" - ) - - # same flags are passed for build & tests, so we need to strip - # them down to a subset supported by clang - CC=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang \ - CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++ \ - strip-unsupported-flags - fi - - if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then - mycmakeargs+=( - # setting -isysroot is disabled with compiler-rt-prefix-paths.patch - # this allows adding arm64 support using SDK in EPREFIX - -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" - # Set version based on the SDK in EPREFIX - # This disables i386 for SDK >= 10.15 - # Will error if has_use tsan and SDK < 10.12 - -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" - # Use our libtool instead of looking it up with xcrun - -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" - ) - fi - - cmake_src_configure - - if use test; then - local sys_dir=( "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/lib/* ) - [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" - [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" - - # copy clang over since resource_dir is located relatively to binary - # therefore, we can put our new libraries in it - mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_MAJOR}/{bin,$(get_libdir)},clang/${LLVM_MAJOR}/include} || die - cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/bin/clang{,++} \ - "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/bin/ || die - cp "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/include/*.h \ - "${BUILD_DIR}"/lib/clang/${LLVM_MAJOR}/include/ || die - cp "${sys_dir}"/*builtins*.a \ - "${BUILD_DIR}/lib/clang/${LLVM_MAJOR}/lib/${sys_dir##*/}/" || die - # we also need LLVMgold.so for gold-based tests - if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so ]]; then - ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so \ - "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/ || die - fi - fi -} - -src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - # disable sandbox to have it stop clobbering LD_PRELOAD - local -x SANDBOX_ON=0 - # wipe LD_PRELOAD to make ASAN happy - local -x LD_PRELOAD= - - cmake_build check-all -} diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240420.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240420.ebuild new file mode 100644 index 000000000000..57f868d54be6 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-19.0.0_pre20240420.ebuild @@ -0,0 +1,217 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +inherit check-reqs cmake flag-o-matic llvm.org llvm-utils python-any-r1 + +DESCRIPTION="Compiler runtime libraries for clang (sanitizers & xray)" +HOMEPAGE="https://llvm.org/" + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="${LLVM_MAJOR}" +IUSE="+abi_x86_32 abi_x86_64 +clang +debug test" +# base targets +IUSE+=" +libfuzzer +memprof +orc +profile +xray" +# sanitizer targets, keep in sync with config-ix.cmake +# NB: ubsan, scudo deliberately match two entries +SANITIZER_FLAGS=( + asan dfsan lsan msan hwasan tsan ubsan safestack cfi scudo + shadowcallstack gwp-asan +) +IUSE+=" ${SANITIZER_FLAGS[@]/#/+}" +REQUIRED_USE=" + || ( ${SANITIZER_FLAGS[*]} libfuzzer orc profile xray ) + test? ( + cfi? ( ubsan ) + gwp-asan? ( scudo ) + ) +" +RESTRICT=" + !clang? ( test ) + !test? ( test ) +" + +DEPEND=" + sys-devel/llvm:${LLVM_MAJOR} + virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] +" +BDEPEND=" + clang? ( sys-devel/clang ) + elibc_glibc? ( net-libs/libtirpc ) + test? ( + $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") + =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} + sys-libs/compiler-rt:${LLVM_MAJOR} + ) + !test? ( + ${PYTHON_DEPS} + ) +" + +LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) +LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support third-party ) +llvm.org_set_globals + +python_check_deps() { + use test || return 0 + python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" +} + +check_space() { + if use test; then + local CHECKREQS_DISK_BUILD=11G + check-reqs_pkg_pretend + fi +} + +pkg_pretend() { + check_space +} + +pkg_setup() { + check_space + python-any-r1_pkg_setup +} + +src_prepare() { + sed -i -e 's:-Werror::' lib/tsan/go/buildgo.sh || die + + local flag + for flag in "${SANITIZER_FLAGS[@]}"; do + if ! use "${flag}"; then + local cmake_flag=${flag/-/_} + sed -i -e "/COMPILER_RT_HAS_${cmake_flag^^}/s:TRUE:FALSE:" \ + cmake/config-ix.cmake || die + fi + done + + # TODO: fix these tests to be skipped upstream + if use asan && ! use profile; then + rm test/asan/TestCases/asan_and_llvm_coverage_test.cpp || die + fi + if use ubsan && ! use cfi; then + > test/cfi/CMakeLists.txt || die + fi + # hangs, sigh + rm test/tsan/getline_nohang.cpp || die + + llvm.org_src_prepare +} + +src_configure() { + llvm_prepend_path "${LLVM_MAJOR}" + + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" + + # pre-set since we need to pass it to cmake + BUILD_DIR=${WORKDIR}/compiler-rt_build + + if use clang; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + strip-unsupported-flags + fi + + local flag want_sanitizer=OFF + for flag in "${SANITIZER_FLAGS[@]}"; do + if use "${flag}"; then + want_sanitizer=ON + break + fi + done + + local mycmakeargs=( + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" + # use a build dir structure consistent with install + # this makes it possible to easily deploy test-friendly clang + -DCOMPILER_RT_OUTPUT_DIR="${BUILD_DIR}/lib/clang/${LLVM_MAJOR}" + + -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) + # builtins & crt installed by sys-libs/compiler-rt + -DCOMPILER_RT_BUILD_BUILTINS=OFF + -DCOMPILER_RT_BUILD_CRT=OFF + -DCOMPILER_RT_BUILD_LIBFUZZER=$(usex libfuzzer) + -DCOMPILER_RT_BUILD_MEMPROF=$(usex memprof) + -DCOMPILER_RT_BUILD_ORC=$(usex orc) + -DCOMPILER_RT_BUILD_PROFILE=$(usex profile) + -DCOMPILER_RT_BUILD_SANITIZERS="${want_sanitizer}" + -DCOMPILER_RT_BUILD_XRAY=$(usex xray) + + -DPython3_EXECUTABLE="${PYTHON}" + ) + + if use amd64; then + mycmakeargs+=( + -DCAN_TARGET_i386=$(usex abi_x86_32) + -DCAN_TARGET_x86_64=$(usex abi_x86_64) + ) + fi + + if use test; then + mycmakeargs+=( + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags)" + + # they are created during src_test() + -DCOMPILER_RT_TEST_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang" + -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAJOR}/bin/clang++" + ) + + # same flags are passed for build & tests, so we need to strip + # them down to a subset supported by clang + CC=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang \ + CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++ \ + strip-unsupported-flags + fi + + if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then + mycmakeargs+=( + # setting -isysroot is disabled with compiler-rt-prefix-paths.patch + # this allows adding arm64 support using SDK in EPREFIX + -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" + # Set version based on the SDK in EPREFIX + # This disables i386 for SDK >= 10.15 + # Will error if has_use tsan and SDK < 10.12 + -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" + # Use our libtool instead of looking it up with xcrun + -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" + ) + fi + + cmake_src_configure + + if use test; then + local sys_dir=( "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/lib/* ) + [[ -e ${sys_dir} ]] || die "Unable to find ${sys_dir}" + [[ ${#sys_dir[@]} -eq 1 ]] || die "Non-deterministic compiler-rt install: ${sys_dir[*]}" + + # copy clang over since resource_dir is located relatively to binary + # therefore, we can put our new libraries in it + mkdir -p "${BUILD_DIR}"/lib/{llvm/${LLVM_MAJOR}/{bin,$(get_libdir)},clang/${LLVM_MAJOR}/include} || die + cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/bin/clang{,++} \ + "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/bin/ || die + cp "${EPREFIX}"/usr/lib/clang/${LLVM_MAJOR}/include/*.h \ + "${BUILD_DIR}"/lib/clang/${LLVM_MAJOR}/include/ || die + cp "${sys_dir}"/*builtins*.a \ + "${BUILD_DIR}/lib/clang/${LLVM_MAJOR}/lib/${sys_dir##*/}/" || die + # we also need LLVMgold.so for gold-based tests + if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so ]]; then + ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/LLVMgold.so \ + "${BUILD_DIR}"/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/ || die + fi + fi +} + +src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + # disable sandbox to have it stop clobbering LD_PRELOAD + local -x SANDBOX_ON=0 + # wipe LD_PRELOAD to make ASAN happy + local -x LD_PRELOAD= + + cmake_build check-all +} diff --git a/sys-libs/compiler-rt/Manifest b/sys-libs/compiler-rt/Manifest index b1fb0d09f524..25dfa1593f62 100644 --- a/sys-libs/compiler-rt/Manifest +++ b/sys-libs/compiler-rt/Manifest @@ -1,27 +1,22 @@ DIST llvm-gentoo-patchset-15.0.7.tar.xz 19300 BLAKE2B b70e81d744c2eba5cd851e7b690ce8979b3064973f522be7c93bfb541860000a4bc8b17219f8788dfc8a527217dd13946cf7836640698ddd3d4b3fde493dfbf8 SHA512 daffff6ae4a0874aff1a423b4bb36701ecb5a35a36ae91d4ed7fda58b83e50ffcdc30498c84be4711fd3e1f227bf312dbe930019203e0a131944439af2aa94f7 DIST llvm-gentoo-patchset-16.0.6-r4.tar.xz 18732 BLAKE2B 2f00135700b5e4f0d0e049e13c1da06fd37017b7f455419157ac441bb7d4de12e3e25f4d8480431c1074cfa6a5d66a38ae63d95faefaa4e9c8cd5810c082a596 SHA512 f61c82a195307dc6cb42e09b3c82af2b37827583884ff2de0ef300290fb8f92e90a08895d12e5dec9b29a232c2e942a2d5951dab431e02722fcafbcd1e2b7976 DIST llvm-gentoo-patchset-17.0.6.tar.xz 1792 BLAKE2B 21b34b436333c0b37522d4340cccc84a572701f6e267cf7c6adfa9be419913f5a6c9ee40a6be5c62d12fbd868912801d30381573c4459c05676e05785cccaefe SHA512 2d90b5e7fcbb950249ef7133fac1ed3dcb758a4d92732119049526cea0b291bd4e9738c4c0d806d70e7d769e1906f8ef3930066c206c00b6ec7d3509ed0fed19 -DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948 DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7 DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447 DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30 DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340 -DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783 -DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29 DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386 -DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07 DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1 +DIST llvm-project-f03cd2db91956456f1c5e2da86d3c50183eebd28.tar.gz 209375254 BLAKE2B 1d7e043d04323edb64b2ef2309fbcb4f82a959f45391e815133cc0891d5a497bbb81101aab460e9bf67e75aa906e13ad1877c3850829dcad397ed626dc8f2792 SHA512 6775e03a44b2133bd4a4b473ab007599321daa19dc7f3cc47f95cf9d110e83e982bf48a6b1d43038b0f0a2c0fef2f689aefd20132b25a90ef19342683e2d2e50 EBUILD compiler-rt-15.0.7.ebuild 4238 BLAKE2B 22d56dbe24c92400bf58942390b06af70fddba89d8fecc9b85162dd7a41c6ee592eaaf883f5ad483f65f74fabccc28f94528688410ee36e2d5279efcc6066de0 SHA512 ca49d23def580d4dcfc4058768eeb9deb6e59ea44575da272d1c142fffe0bf4e3d3c7c9fa6182ab348a3aab11879af116a549cb1a3a03b27b4bf4151cf892aaa EBUILD compiler-rt-16.0.6-r4.ebuild 5226 BLAKE2B 7d2d76d79ce49f3d175de87fa982439ceade80787a4f4f96cbda9a0e7c161e89fc49646908e32fd35ed3629956ed0ff79ff2f74754a705264f2d6e2f02f831cb SHA512 14ba6b2644e4b0bcab31e686d395b859eab9ee8ba7adb2242e4fd80d07290cff1243cd644ee8fec53f536dd13d150a16761255ff938ed0c6e717f26165e93945 EBUILD compiler-rt-16.0.6.ebuild 5198 BLAKE2B 2fe2310703d44d330d97b1fa1b407d99898070604037be31ca762fe65043e1d3d1e046298dc74f3d0cbb3493f985661e362b217170cbe1bf74a47dddfe8987ca SHA512 cc9aabc22f689bfc677ceb74793441674aeca2586a28ff96b812af4822d1b8b5a4147484e41f0bf95ae995488d3e8ee77684fd684b9dab8ade4f1fa57e80c709 EBUILD compiler-rt-17.0.6.ebuild 5218 BLAKE2B 3f488320228fd2a3d1caed790e8e21c7c363769c4d8b912fd5a964b4e802e1b58b297336c527b451edb74ff42c4bdd236795210c4f225ca98a6980fed95d6771 SHA512 abbe2f679a1af7c012ecae32b57b244f7ad84a5d44151a4b7ad799524061f8b65504bd6aa169a91d1a16b878845f40b47e4a1f0253a3ff9ccbe8dbb736db1fb1 -EBUILD compiler-rt-18.1.3.ebuild 4971 BLAKE2B 74a850ae9ab5c05d0806f6fb6403b7b54141cb0fe43b0e2bfca44d0eb7a25579d390988082fc277b21a66e3b978a37ad9ed1c39ace261aeabf1ab230427e5f3e SHA512 23283ed4a7b7704a4237ec2628633ce81554d501fae10391b90e1983dfb64d86c9dc0d7cbe8d3ae2525591377fac783ae6c1dae8093596ad2ac7d6dda911433b EBUILD compiler-rt-18.1.4.ebuild 4971 BLAKE2B 74a850ae9ab5c05d0806f6fb6403b7b54141cb0fe43b0e2bfca44d0eb7a25579d390988082fc277b21a66e3b978a37ad9ed1c39ace261aeabf1ab230427e5f3e SHA512 23283ed4a7b7704a4237ec2628633ce81554d501fae10391b90e1983dfb64d86c9dc0d7cbe8d3ae2525591377fac783ae6c1dae8093596ad2ac7d6dda911433b EBUILD compiler-rt-19.0.0.9999.ebuild 4868 BLAKE2B 479ff19239f03c3bcb25cde41a2cb5c6a9a8569e376fc08a2a5affd62bc766a85d68ea080570a373d6f3258c0b1f96211bbe552e82255186ad105fca88f597a0 SHA512 4e19eaf37ca1d3d140be8a4d2bad0f3d69d62c0884d131aac9b3ee4bc58a5e1dd4ca0540cc1153cc293c9bd9521bea1688f7f2b298ca8a24c4c0aedc20d3d753 -EBUILD compiler-rt-19.0.0_pre20240330.ebuild 4868 BLAKE2B 479ff19239f03c3bcb25cde41a2cb5c6a9a8569e376fc08a2a5affd62bc766a85d68ea080570a373d6f3258c0b1f96211bbe552e82255186ad105fca88f597a0 SHA512 4e19eaf37ca1d3d140be8a4d2bad0f3d69d62c0884d131aac9b3ee4bc58a5e1dd4ca0540cc1153cc293c9bd9521bea1688f7f2b298ca8a24c4c0aedc20d3d753 -EBUILD compiler-rt-19.0.0_pre20240404.ebuild 4868 BLAKE2B 479ff19239f03c3bcb25cde41a2cb5c6a9a8569e376fc08a2a5affd62bc766a85d68ea080570a373d6f3258c0b1f96211bbe552e82255186ad105fca88f597a0 SHA512 4e19eaf37ca1d3d140be8a4d2bad0f3d69d62c0884d131aac9b3ee4bc58a5e1dd4ca0540cc1153cc293c9bd9521bea1688f7f2b298ca8a24c4c0aedc20d3d753 EBUILD compiler-rt-19.0.0_pre20240410.ebuild 4868 BLAKE2B 479ff19239f03c3bcb25cde41a2cb5c6a9a8569e376fc08a2a5affd62bc766a85d68ea080570a373d6f3258c0b1f96211bbe552e82255186ad105fca88f597a0 SHA512 4e19eaf37ca1d3d140be8a4d2bad0f3d69d62c0884d131aac9b3ee4bc58a5e1dd4ca0540cc1153cc293c9bd9521bea1688f7f2b298ca8a24c4c0aedc20d3d753 +EBUILD compiler-rt-19.0.0_pre20240420.ebuild 4868 BLAKE2B 479ff19239f03c3bcb25cde41a2cb5c6a9a8569e376fc08a2a5affd62bc766a85d68ea080570a373d6f3258c0b1f96211bbe552e82255186ad105fca88f597a0 SHA512 4e19eaf37ca1d3d140be8a4d2bad0f3d69d62c0884d131aac9b3ee4bc58a5e1dd4ca0540cc1153cc293c9bd9521bea1688f7f2b298ca8a24c4c0aedc20d3d753 MISC metadata.xml 416 BLAKE2B 79a58249c94b605ba57f346c4e05b43853cf6cfb8bb65a4f4e3c44039cccfdb83dd31bfaaaf398bcbdc393efabdfc7ed186fe775976c46227e74decf2c8f4fb2 SHA512 ce30c79a575e5933effb1fec36f9a4ef02d9f97f312feb39c55a88cbda9a1bae1d7af2ec4ad5f66212cbb2cdbfb26f1a436689f16f410153c9d65eb010264c48 diff --git a/sys-libs/compiler-rt/compiler-rt-18.1.3.ebuild b/sys-libs/compiler-rt/compiler-rt-18.1.3.ebuild deleted file mode 100644 index e2a452caad61..000000000000 --- a/sys-libs/compiler-rt/compiler-rt-18.1.3.ebuild +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake crossdev flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="Compiler runtime library for clang (built-in part)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="${LLVM_MAJOR}" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos" -IUSE="+abi_x86_32 abi_x86_64 +clang debug test" -RESTRICT="!test? ( test ) !clang? ( test )" - -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( sys-devel/clang ) - test? ( - $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") - =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) -" - -LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" -} - -pkg_pretend() { - if ! use clang && ! tc-is-clang; then - ewarn "Building using a compiler other than clang may result in broken atomics" - ewarn "library. Enable USE=clang unless you have a very good reason not to." - fi -} - -pkg_setup() { - if target_is_not_host || tc-is-cross-compiler ; then - # strips vars like CFLAGS="-march=x86_64-v3" for non-x86 architectures - CHOST=${CTARGET} strip-unsupported-flags - # overrides host docs otherwise - DOCS=() - fi - python-any-r1_pkg_setup -} - -test_compiler() { - target_is_not_host && return - $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - # pre-set since we need to pass it to cmake - BUILD_DIR=${WORKDIR}/${P}_build - - if use clang && ! is_crosspkg; then - # Only do this conditionally to allow overriding with - # e.g. CC=clang-13 in case of breakage - if ! tc-is-clang ; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - fi - - strip-unsupported-flags - fi - - if ! is_crosspkg && ! test_compiler ; then - local nolib_flags=( -nodefaultlibs -lc ) - - if test_compiler "${nolib_flags[@]}"; then - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" - elif test_compiler "${nolib_flags[@]}" -nostartfiles; then - # Avoiding -nostartfiles earlier on for bug #862540, - # and set available entry symbol for bug #862798. - nolib_flags+=( -nostartfiles -emain ) - - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" - fi - fi - - local mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" - - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) - -DCOMPILER_RT_BUILD_LIBFUZZER=OFF - -DCOMPILER_RT_BUILD_MEMPROF=OFF - -DCOMPILER_RT_BUILD_ORC=OFF - -DCOMPILER_RT_BUILD_PROFILE=OFF - -DCOMPILER_RT_BUILD_SANITIZERS=OFF - -DCOMPILER_RT_BUILD_XRAY=OFF - - -DPython3_EXECUTABLE="${PYTHON}" - ) - - if use amd64 && ! target_is_not_host; then - mycmakeargs+=( - -DCAN_TARGET_i386=$(usex abi_x86_32) - -DCAN_TARGET_x86_64=$(usex abi_x86_64) - ) - fi - - if is_crosspkg; then - # Needed to target built libc headers - export CFLAGS="${CFLAGS} -isystem /usr/${CTARGET}/usr/include" - mycmakeargs+=( - # Without this, the compiler will compile a test program - # and fail due to no builtins. - -DCMAKE_C_COMPILER_WORKS=1 - -DCMAKE_CXX_COMPILER_WORKS=1 - - # Without this, compiler-rt install location is not unique - # to target triples, only to architecture. - # Needed if you want to target multiple libcs for one arch. - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON - - -DCMAKE_ASM_COMPILER_TARGET="${CTARGET}" - -DCMAKE_C_COMPILER_TARGET="${CTARGET}" - -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON - ) - fi - - if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then - mycmakeargs+=( - # setting -isysroot is disabled with compiler-rt-prefix-paths.patch - # this allows adding arm64 support using SDK in EPREFIX - -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" - # Set version based on the SDK in EPREFIX. - # This disables i386 for SDK >= 10.15 - -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" - # Use our libtool instead of looking it up with xcrun - -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" - ) - fi - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++" - ) - fi - - cmake_src_configure -} - -src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - - cmake_build check-builtins -} diff --git a/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240330.ebuild b/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240330.ebuild deleted file mode 100644 index 75ff3c155c03..000000000000 --- a/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240330.ebuild +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake crossdev flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="Compiler runtime library for clang (built-in part)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="${LLVM_MAJOR}" -IUSE="+abi_x86_32 abi_x86_64 +clang +debug test" -RESTRICT="!test? ( test ) !clang? ( test )" - -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( sys-devel/clang ) - test? ( - $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") - =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) -" - -LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" -} - -pkg_pretend() { - if ! use clang && ! tc-is-clang; then - ewarn "Building using a compiler other than clang may result in broken atomics" - ewarn "library. Enable USE=clang unless you have a very good reason not to." - fi -} - -pkg_setup() { - if target_is_not_host || tc-is-cross-compiler ; then - # strips vars like CFLAGS="-march=x86_64-v3" for non-x86 architectures - CHOST=${CTARGET} strip-unsupported-flags - # overrides host docs otherwise - DOCS=() - fi - python-any-r1_pkg_setup -} - -test_compiler() { - target_is_not_host && return - $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - # pre-set since we need to pass it to cmake - BUILD_DIR=${WORKDIR}/${P}_build - - if use clang && ! is_crosspkg; then - # Only do this conditionally to allow overriding with - # e.g. CC=clang-13 in case of breakage - if ! tc-is-clang ; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - fi - - strip-unsupported-flags - fi - - if ! is_crosspkg && ! test_compiler ; then - local nolib_flags=( -nodefaultlibs -lc ) - - if test_compiler "${nolib_flags[@]}"; then - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" - elif test_compiler "${nolib_flags[@]}" -nostartfiles; then - # Avoiding -nostartfiles earlier on for bug #862540, - # and set available entry symbol for bug #862798. - nolib_flags+=( -nostartfiles -emain ) - - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" - fi - fi - - local mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" - - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) - -DCOMPILER_RT_BUILD_LIBFUZZER=OFF - -DCOMPILER_RT_BUILD_MEMPROF=OFF - -DCOMPILER_RT_BUILD_ORC=OFF - -DCOMPILER_RT_BUILD_PROFILE=OFF - -DCOMPILER_RT_BUILD_SANITIZERS=OFF - -DCOMPILER_RT_BUILD_XRAY=OFF - - -DPython3_EXECUTABLE="${PYTHON}" - ) - - if use amd64 && ! target_is_not_host; then - mycmakeargs+=( - -DCAN_TARGET_i386=$(usex abi_x86_32) - -DCAN_TARGET_x86_64=$(usex abi_x86_64) - ) - fi - - if is_crosspkg; then - # Needed to target built libc headers - export CFLAGS="${CFLAGS} -isystem /usr/${CTARGET}/usr/include" - mycmakeargs+=( - # Without this, the compiler will compile a test program - # and fail due to no builtins. - -DCMAKE_C_COMPILER_WORKS=1 - -DCMAKE_CXX_COMPILER_WORKS=1 - - # Without this, compiler-rt install location is not unique - # to target triples, only to architecture. - # Needed if you want to target multiple libcs for one arch. - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON - - -DCMAKE_ASM_COMPILER_TARGET="${CTARGET}" - -DCMAKE_C_COMPILER_TARGET="${CTARGET}" - -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON - ) - fi - - if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then - mycmakeargs+=( - # setting -isysroot is disabled with compiler-rt-prefix-paths.patch - # this allows adding arm64 support using SDK in EPREFIX - -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" - # Set version based on the SDK in EPREFIX. - # This disables i386 for SDK >= 10.15 - -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" - # Use our libtool instead of looking it up with xcrun - -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" - ) - fi - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++" - ) - fi - - cmake_src_configure -} - -src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - - cmake_build check-builtins -} diff --git a/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240404.ebuild b/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240404.ebuild deleted file mode 100644 index 75ff3c155c03..000000000000 --- a/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240404.ebuild +++ /dev/null @@ -1,171 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake crossdev flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="Compiler runtime library for clang (built-in part)" -HOMEPAGE="https://llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="${LLVM_MAJOR}" -IUSE="+abi_x86_32 abi_x86_64 +clang +debug test" -RESTRICT="!test? ( test ) !clang? ( test )" - -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( sys-devel/clang ) - test? ( - $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") - =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) -" - -LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" -} - -pkg_pretend() { - if ! use clang && ! tc-is-clang; then - ewarn "Building using a compiler other than clang may result in broken atomics" - ewarn "library. Enable USE=clang unless you have a very good reason not to." - fi -} - -pkg_setup() { - if target_is_not_host || tc-is-cross-compiler ; then - # strips vars like CFLAGS="-march=x86_64-v3" for non-x86 architectures - CHOST=${CTARGET} strip-unsupported-flags - # overrides host docs otherwise - DOCS=() - fi - python-any-r1_pkg_setup -} - -test_compiler() { - target_is_not_host && return - $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - # pre-set since we need to pass it to cmake - BUILD_DIR=${WORKDIR}/${P}_build - - if use clang && ! is_crosspkg; then - # Only do this conditionally to allow overriding with - # e.g. CC=clang-13 in case of breakage - if ! tc-is-clang ; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - fi - - strip-unsupported-flags - fi - - if ! is_crosspkg && ! test_compiler ; then - local nolib_flags=( -nodefaultlibs -lc ) - - if test_compiler "${nolib_flags[@]}"; then - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" - elif test_compiler "${nolib_flags[@]}" -nostartfiles; then - # Avoiding -nostartfiles earlier on for bug #862540, - # and set available entry symbol for bug #862798. - nolib_flags+=( -nostartfiles -emain ) - - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" - fi - fi - - local mycmakeargs=( - -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" - - -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) - -DCOMPILER_RT_BUILD_LIBFUZZER=OFF - -DCOMPILER_RT_BUILD_MEMPROF=OFF - -DCOMPILER_RT_BUILD_ORC=OFF - -DCOMPILER_RT_BUILD_PROFILE=OFF - -DCOMPILER_RT_BUILD_SANITIZERS=OFF - -DCOMPILER_RT_BUILD_XRAY=OFF - - -DPython3_EXECUTABLE="${PYTHON}" - ) - - if use amd64 && ! target_is_not_host; then - mycmakeargs+=( - -DCAN_TARGET_i386=$(usex abi_x86_32) - -DCAN_TARGET_x86_64=$(usex abi_x86_64) - ) - fi - - if is_crosspkg; then - # Needed to target built libc headers - export CFLAGS="${CFLAGS} -isystem /usr/${CTARGET}/usr/include" - mycmakeargs+=( - # Without this, the compiler will compile a test program - # and fail due to no builtins. - -DCMAKE_C_COMPILER_WORKS=1 - -DCMAKE_CXX_COMPILER_WORKS=1 - - # Without this, compiler-rt install location is not unique - # to target triples, only to architecture. - # Needed if you want to target multiple libcs for one arch. - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON - - -DCMAKE_ASM_COMPILER_TARGET="${CTARGET}" - -DCMAKE_C_COMPILER_TARGET="${CTARGET}" - -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON - ) - fi - - if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then - mycmakeargs+=( - # setting -isysroot is disabled with compiler-rt-prefix-paths.patch - # this allows adding arm64 support using SDK in EPREFIX - -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" - # Set version based on the SDK in EPREFIX. - # This disables i386 for SDK >= 10.15 - -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" - # Use our libtool instead of looking it up with xcrun - -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" - ) - fi - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - - -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++" - ) - fi - - cmake_src_configure -} - -src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - - cmake_build check-builtins -} diff --git a/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240420.ebuild b/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240420.ebuild new file mode 100644 index 000000000000..75ff3c155c03 --- /dev/null +++ b/sys-libs/compiler-rt/compiler-rt-19.0.0_pre20240420.ebuild @@ -0,0 +1,171 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +inherit cmake crossdev flag-o-matic llvm.org llvm-utils python-any-r1 +inherit toolchain-funcs + +DESCRIPTION="Compiler runtime library for clang (built-in part)" +HOMEPAGE="https://llvm.org/" + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="${LLVM_MAJOR}" +IUSE="+abi_x86_32 abi_x86_64 +clang +debug test" +RESTRICT="!test? ( test ) !clang? ( test )" + +DEPEND=" + sys-devel/llvm:${LLVM_MAJOR} +" +BDEPEND=" + clang? ( sys-devel/clang ) + test? ( + $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") + =sys-devel/clang-${LLVM_VERSION}*:${LLVM_MAJOR} + ) + !test? ( + ${PYTHON_DEPS} + ) +" + +LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) +llvm.org_set_globals + +python_check_deps() { + use test || return 0 + python_has_version ">=dev-python/lit-15[${PYTHON_USEDEP}]" +} + +pkg_pretend() { + if ! use clang && ! tc-is-clang; then + ewarn "Building using a compiler other than clang may result in broken atomics" + ewarn "library. Enable USE=clang unless you have a very good reason not to." + fi +} + +pkg_setup() { + if target_is_not_host || tc-is-cross-compiler ; then + # strips vars like CFLAGS="-march=x86_64-v3" for non-x86 architectures + CHOST=${CTARGET} strip-unsupported-flags + # overrides host docs otherwise + DOCS=() + fi + python-any-r1_pkg_setup +} + +test_compiler() { + target_is_not_host && return + $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \ + <<<'int main() { return 0; }' &>/dev/null +} + +src_configure() { + llvm_prepend_path "${LLVM_MAJOR}" + + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" + + # pre-set since we need to pass it to cmake + BUILD_DIR=${WORKDIR}/${P}_build + + if use clang && ! is_crosspkg; then + # Only do this conditionally to allow overriding with + # e.g. CC=clang-13 in case of breakage + if ! tc-is-clang ; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + fi + + strip-unsupported-flags + fi + + if ! is_crosspkg && ! test_compiler ; then + local nolib_flags=( -nodefaultlibs -lc ) + + if test_compiler "${nolib_flags[@]}"; then + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" + ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" + elif test_compiler "${nolib_flags[@]}" -nostartfiles; then + # Avoiding -nostartfiles earlier on for bug #862540, + # and set available entry symbol for bug #862798. + nolib_flags+=( -nostartfiles -emain ) + + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" + ewarn "${CC} seems to lack runtime, trying with ${nolib_flags[*]}" + fi + fi + + local mycmakeargs=( + -DCOMPILER_RT_INSTALL_PATH="${EPREFIX}/usr/lib/clang/${LLVM_MAJOR}" + + -DCOMPILER_RT_INCLUDE_TESTS=$(usex test) + -DCOMPILER_RT_BUILD_LIBFUZZER=OFF + -DCOMPILER_RT_BUILD_MEMPROF=OFF + -DCOMPILER_RT_BUILD_ORC=OFF + -DCOMPILER_RT_BUILD_PROFILE=OFF + -DCOMPILER_RT_BUILD_SANITIZERS=OFF + -DCOMPILER_RT_BUILD_XRAY=OFF + + -DPython3_EXECUTABLE="${PYTHON}" + ) + + if use amd64 && ! target_is_not_host; then + mycmakeargs+=( + -DCAN_TARGET_i386=$(usex abi_x86_32) + -DCAN_TARGET_x86_64=$(usex abi_x86_64) + ) + fi + + if is_crosspkg; then + # Needed to target built libc headers + export CFLAGS="${CFLAGS} -isystem /usr/${CTARGET}/usr/include" + mycmakeargs+=( + # Without this, the compiler will compile a test program + # and fail due to no builtins. + -DCMAKE_C_COMPILER_WORKS=1 + -DCMAKE_CXX_COMPILER_WORKS=1 + + # Without this, compiler-rt install location is not unique + # to target triples, only to architecture. + # Needed if you want to target multiple libcs for one arch. + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON + + -DCMAKE_ASM_COMPILER_TARGET="${CTARGET}" + -DCMAKE_C_COMPILER_TARGET="${CTARGET}" + -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON + ) + fi + + if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then + mycmakeargs+=( + # setting -isysroot is disabled with compiler-rt-prefix-paths.patch + # this allows adding arm64 support using SDK in EPREFIX + -DDARWIN_macosx_CACHED_SYSROOT="${EPREFIX}/MacOSX.sdk" + # Set version based on the SDK in EPREFIX. + # This disables i386 for SDK >= 10.15 + -DDARWIN_macosx_OVERRIDE_SDK_VERSION="$(realpath ${EPREFIX}/MacOSX.sdk | sed -e 's/.*MacOSX\(.*\)\.sdk/\1/')" + # Use our libtool instead of looking it up with xcrun + -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool" + ) + fi + + if use test; then + mycmakeargs+=( + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags)" + + -DCOMPILER_RT_TEST_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang" + -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin/clang++" + ) + fi + + cmake_src_configure +} + +src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + + cmake_build check-builtins +} diff --git a/sys-libs/glibc/Manifest b/sys-libs/glibc/Manifest index 6b50c2878dfd..823f6c66bf6e 100644 --- a/sys-libs/glibc/Manifest +++ b/sys-libs/glibc/Manifest @@ -34,8 +34,6 @@ DIST glibc-2.38-patches-10.tar.xz 60792 BLAKE2B e228568f9e9cfa719ee9f2f91d220efa DIST glibc-2.38-patches-11.tar.xz 67188 BLAKE2B 5025fd72359842a357e7c2cd76de3e717c9bd117259dd8be93aa6fcd906f8b65e266388bf685e611bfa439d57c03e0a4f7d024d7a766ff275277936f76f1ecbf SHA512 d0fa1c11c153c7ada8668d865a15c7c47013956b5fa1e0d0e2b7e24cea5d3e16909dc8f9ba9b2b392d85271ed71603deb440ead19de50fd61b53a6c1f73d467b DIST glibc-2.38-patches-12.tar.xz 83568 BLAKE2B 051f32976d82cfe510084a94a4a40f328531eab8601454685c906405a96bb92527780378ccf6bfa42ab9cbadc405545d3bd28d0c4a15927d1a1c18a7a23c513f SHA512 a66d567680f5b34e35d1e4c5c2a4a9b0af67450cc0ea4a03074ec66953d79e4d0e9e921ca44717b3ca45f5910a8cdb033818bc111efd93b41666610cc8478b67 DIST glibc-2.38.tar.xz 18913712 BLAKE2B f9b039f0ef98a7dd8e1cba228ed10286b9e4fbe4dd89af4d26fa5c4e4cf266f19c2746b44d797ce54739d86499e74cf334aaf311bcf6e30120fd7748453e653f SHA512 a6dd5e42dcd63d58e2820c783522c8c895890b6e8c8e6c83b025553de0cc77cdf227e7044e431ead98c89c68a9ce4dd63509b47e647775fb2075f011849c1900 -DIST glibc-2.39-patches-1.tar.xz 14316 BLAKE2B e0a05eb98d11ed4bc332b9267bc363ed8d7cfed8e9a1e7d1e854802830326241b231fc6fcca4f97bf80e52c361863f21fe09e060febe3234e1f6dd9e6cfa78f8 SHA512 0391ed526fc5686fd6e3a01beb18d92702ad7b5f8ad06651f1a1be174b16d7ab367cf3375b98e9c54b9dffee2e3416b22d60963dcf3a96e0d6141b682943ccd2 -DIST glibc-2.39-patches-2.tar.xz 18860 BLAKE2B 9ef3ff522820e650876dcda6ea78294fa5ad5301c2f5284d296a44e6c3c71a401c5da5aa097bdd2c9336fe8f89c931d9b5f8c127d5599c8ae962e2e64718842c SHA512 6cacd95576c5802a800cffa7e2939b3ab7db886ce8ae5e117182ac461ab8c207f4b5c2a05bf80e9214f13d9c9e43d136de0d2dc5f48c3d3389299eafad19a75c DIST glibc-2.39-patches-3.tar.xz 69980 BLAKE2B 08239eb30c0059ea7ff750287f9349ebc4dff3416aa4711db2cdfedf5a01ba000e135b390528cc77e50c20cb2656aaa571c299542b495fe72828301f61702548 SHA512 47c87e568ce6bdddf42605d8c422869c238be13e77905051b214fed51265de0cd35c2031d0fc906019058f5a159b6b99ed52cb177450db2f710ce398770b3e85 DIST glibc-2.39.tar.xz 18520988 BLAKE2B 9d98459a2d58401e07c081e0d841935b23998da75a7eb5a7ebd23a1f9ebab99dee623fe166397c1b6c926960c570f62dbca5cb3b5ce84a918adff6b7a15e16bb SHA512 818f58172a52815b4338ea9f2a69ecaa3335492b9f8f64cbf8afb24c0d737982341968ecd79631cae3d3074ab0ae4bc6056fc4ba3ffe790849dc374835cd57e2 DIST glibc-systemd-20210729.tar.gz 1480 BLAKE2B 37722c7579df782d890e44dbab99c3de52ab466eb9de80d82405e9bb5620bf39ffc8c5f466a435bdb86ef6d36dd7019c0736573916bda6c67d02a2581e0ec979 SHA512 efd75af58b50522c28cdac7abd1fc56555bc1bb042512c90d8340c1ec09c5791b3872a305bf83723252bbde5855b75d958c041083457765c4cfd170732d09238 @@ -54,9 +52,7 @@ EBUILD glibc-2.36-r8.ebuild 52468 BLAKE2B 005a5537d1cbcc1ba128174c06aa9fe797b2f1 EBUILD glibc-2.37-r10.ebuild 52997 BLAKE2B 5302881267c59582fbdb775dd789597c199461735a92cf91d2609e1827b80fdfd5514d836867a917895ab2f0c1ea61d4a899321ae490e68af33c17456b20c164 SHA512 c0010d3a73918e95ab9cfc50c3cf452b528a028e78a4522659df3be3f8f753094bd2ba5542d539a83a76d51608d563054a3560f25ee0a862757730e1cd18adad EBUILD glibc-2.38-r10.ebuild 54293 BLAKE2B a1e9e5df6cf6454cd823f4c497113b4b958ee48f2e7caa1f0faa8f0a798d287b4c9b333b3e10a51f0f687fcea77f1cbf10aeb2d254f9d636e3224a645e39eb82 SHA512 49bd7ced8fe1781929d1b416dd121f247a2902bf258af361826fe58ef0192cb31055855fcf8cd36f8893e3013dc915febc8899bf4c61fc8010aa36480d245552 EBUILD glibc-2.38-r11.ebuild 54516 BLAKE2B 5f54284b49ed56c0d22b425300d4926655d81755e6ba27417dc1fdc5e1137a50b9ae3de26c7475844b93b7b1ba815ab54e5d52c4c91b881a029a6320bdb0063b SHA512 e37b8a2498d8c0444843406e53b4b5f3fff873cee1521218eb5de364308c3dadb7d599314ba34efaf09d6b1309fa8e6fdb468e708597390252d4858d8047440c -EBUILD glibc-2.38-r12.ebuild 54523 BLAKE2B dc72f4d0c7e92331de1c5ee991acdc59d610685eed564a1781f804ce0486b35f9f2f9c6e0cff102b56c098ca0abb0ed4b17dc091c86256f5c0cabec584771d46 SHA512 6dc8b00de8216c3e94193eb24228127f1323804a020d16f8f3d65551938d0c70a5cb1bd4f04e73d9df408d6c30128f897d4fab23781e7461ec28176bbfbbd0d3 -EBUILD glibc-2.39-r1.ebuild 54002 BLAKE2B 132527fc9289b6526837df002fb5dc518cc988b6e995a4fce5d73f7c6a7304875509c469716dc50544bda7f9b61261cf52788d1e41951eab9604699276d042d2 SHA512 5bb5854dce0382146af3f68c11e45075fe32e81ac93cff5bc1cc1d4938c7ce31092d1e7a1bd1cfe1364c0d79686d8c523445dfa8df8f82cf260c18a37b915296 -EBUILD glibc-2.39-r2.ebuild 54302 BLAKE2B e26f05667f9d11fc20122ec156912645e40e8f72b31f4c3c6af1b55facdf225855c1e666b439483156e1fcf6bf7cea57d69c186dc5aeb0bbe073cd7ec3b1450e SHA512 2b79905886b56d3d0e2f710dd1c9d9f89e71b9d6d705b26fc74ae9ef73ce4d1ee18a1c12e2978f46c37795f7939bb3cb5a3c2f5738e6b6c736c776bc99b1c393 +EBUILD glibc-2.38-r12.ebuild 54520 BLAKE2B 88d849a733ccd8170fee4ecbce1370c100268b53065b06485ebffe5fea229a8894d3c3442af7d74e81e868c81fa18c9c14d7d1c64cc1c1bbe3a263a6af3ec9e4 SHA512 e4132e862e2b588bb66f2c03750b6eec31983c132665e9e9e6f33729f7215bf24568d239db71b3e7cbddb1dedae5a1b650f7c0f3ed0df84798e8219b309cb0b1 EBUILD glibc-2.39-r3.ebuild 54302 BLAKE2B 6f11bf8a572f860d3285d6da4869881e9eaf9a88ce3a1166493e645bf8006d0d760304f2dba3636b1304947a0a6ff9e6952b0472c83f919af0778c03c4e43f7f SHA512 3a8c30464a6015dfc8ea77b2fe1998cd374c37e05e79ac02f262530150b73796675073cf4645074a7e4508bf074724c58cd12efaa9d155fd9a26c329854d8439 EBUILD glibc-9999.ebuild 54303 BLAKE2B fb17c851cddbdfb5417aa0e11847b2e4a1219db670b652f17e8b0952105c66782b9d4f4d58e343e57bc0a0d41c4ed4527fb65485f36fd011908a7e2b06dfc9ba SHA512 3d496f1df146744c303ba005b48d134babce84e9e4f43e85acb589620e21afa5dc944dab43b903169d3057a20bc6a37f074076bb4d532230b79401e702c0be5f MISC metadata.xml 2142 BLAKE2B 765ba540eb10afccd1bade4de56f0c13ce269225500a62d1d17328194de69e7fa15d359a14eac6bfa8a36df45344db3d52f5e1811b174cf1fa2bfb95ad7760a7 SHA512 2f4a148c076a0967663d14e76b85a698ddae7093ff299b0dc95a6c3b00957c9bf73443f2bace9670eb62a45465efbcca892bb52b6aac8577acb2bc5f74a7397c diff --git a/sys-libs/glibc/glibc-2.38-r12.ebuild b/sys-libs/glibc/glibc-2.38-r12.ebuild index e55dc707ba7e..3b8eb3e54825 100644 --- a/sys-libs/glibc/glibc-2.38-r12.ebuild +++ b/sys-libs/glibc/glibc-2.38-r12.ebuild @@ -39,7 +39,7 @@ MIN_PAX_UTILS_VER="1.3.3" if [[ ${PV} == 9999* ]]; then inherit git-r3 else - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc ~x86" SRC_URI="mirror://gnu/glibc/${P}.tar.xz" SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz" fi diff --git a/sys-libs/glibc/glibc-2.39-r1.ebuild b/sys-libs/glibc/glibc-2.39-r1.ebuild deleted file mode 100644 index f78730d16ac5..000000000000 --- a/sys-libs/glibc/glibc-2.39-r1.ebuild +++ /dev/null @@ -1,1714 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc -# Please read & adapt the page as necessary if obsolete. - -PYTHON_COMPAT=( python3_{10..12} ) -TMPFILES_OPTIONAL=1 - -inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic gnuconfig \ - multilib systemd multiprocessing tmpfiles - -DESCRIPTION="GNU libc C library" -HOMEPAGE="https://www.gnu.org/software/libc/" -LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE" -SLOT="2.2" - -EMULTILIB_PKG="true" - -# Gentoo patchset (ignored for live ebuilds) -PATCH_VER=1 -PATCH_DEV=dilfridge - -# gcc mulitilib bootstrap files version -GCC_BOOTSTRAP_VER=20201208 - -# systemd integration version -GLIBC_SYSTEMD_VER=20210729 - -# Minimum kernel version that glibc requires -MIN_KERN_VER="3.2.0" - -# Minimum pax-utils version needed (which contains any new syscall changes for -# its seccomp filter!). Please double check this! -MIN_PAX_UTILS_VER="1.3.3" - -# Minimum systemd version needed (which contains any new syscall changes for -# its seccomp filter!). Please double check this! -MIN_SYSTEMD_VER="254.9-r1" - -if [[ ${PV} == 9999* ]]; then - inherit git-r3 -else - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa -ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" - SRC_URI="mirror://gnu/glibc/${P}.tar.xz" - SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz" -fi - -SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )" -SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )" - -IUSE="audit caps cet compile-locales custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd perl profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla" - -# Here's how the cross-compile logic breaks down ... -# CTARGET - machine that will target the binaries -# CHOST - machine that will host the binaries -# CBUILD - machine that will build the binaries -# If CTARGET != CHOST, it means you want a libc for cross-compiling. -# If CHOST != CBUILD, it means you want to cross-compile the libc. -# CBUILD = CHOST = CTARGET - native build/install -# CBUILD != (CHOST = CTARGET) - cross-compile a native build -# (CBUILD = CHOST) != CTARGET - libc for cross-compiler -# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler -# For install paths: -# CHOST = CTARGET - install into / -# CHOST != CTARGET - install into /usr/CTARGET/ -# -export CBUILD=${CBUILD:-${CHOST}} -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} == ${CHOST} ]] ; then - if [[ ${CATEGORY} == cross-* ]] ; then - export CTARGET=${CATEGORY#cross-} - fi -fi - -# Note [Disable automatic stripping] -# Disabling automatic stripping for a few reasons: -# - portage's attempt to strip breaks non-native binaries at least on -# arm: bug #697428 -# - portage's attempt to strip libpthread.so.0 breaks gdb thread -# enumeration: bug #697910. This is quite subtle: -# * gdb uses glibc's libthread_db-1.0.so to enumerate threads. -# * libthread_db-1.0.so needs access to libpthread.so.0 local symbols -# via 'ps_pglobal_lookup' symbol defined in gdb. -# * 'ps_pglobal_lookup' uses '.symtab' section table to resolve all -# known symbols in 'libpthread.so.0'. Specifically 'nptl_version' -# (unexported) is used to sanity check compatibility before enabling -# debugging. -# Also see https://sourceware.org/gdb/wiki/FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint -# * normal 'strip' command trims '.symtab' -# Thus our main goal here is to prevent 'libpthread.so.0' from -# losing it's '.symtab' entries. -# - similarly, valgrind requires knowledge about symbols in ld.so: -# bug #920753 -# As Gentoo's strip does not allow us to pass less aggressive stripping -# options and does not check the machine target we strip selectively. - -# We need a new-enough binutils/gcc to match upstream baseline. -# Also we need to make sure our binutils/gcc supports TLS, -# and that gcc already contains the hardened patches. -# Lastly, let's avoid some openssh nastiness, bug 708224, as -# convenience to our users. - -IDEPEND=" - !compile-locales? ( sys-apps/locale-gen ) -" -BDEPEND=" - ${PYTHON_DEPS} - >=app-misc/pax-utils-${MIN_PAX_UTILS_VER} - sys-devel/bison - compile-locales? ( sys-apps/locale-gen ) - doc? ( - dev-lang/perl - sys-apps/texinfo - ) - test? ( - dev-lang/perl - >=net-dns/libidn2-2.3.0 - ) -" -COMMON_DEPEND=" - gd? ( media-libs/gd:2= ) - nscd? ( selinux? ( - audit? ( sys-process/audit ) - caps? ( sys-libs/libcap ) - ) ) - suid? ( caps? ( sys-libs/libcap ) ) - selinux? ( sys-libs/libselinux ) - systemtap? ( dev-debug/systemtap ) -" -DEPEND="${COMMON_DEPEND} -" -RDEPEND="${COMMON_DEPEND} - !' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h') - ALT_BUILD_HEADERS=${header_path%/linux/version.h} - fi - fi - fi - echo "${ALT_BUILD_HEADERS}" -} - -alt_libdir() { - echo $(alt_prefix)/$(get_libdir) -} -alt_usrlibdir() { - echo $(alt_prefix)/usr/$(get_libdir) -} - -builddir() { - echo "${WORKDIR}/build-${ABI}-${CTARGET}-$1" -} - -do_compile_test() { - local ret save_cflags=${CFLAGS} - CFLAGS+=" $1" - shift - - pushd "${T}" >/dev/null - - rm -f glibc-test* - printf '%b' "$*" > glibc-test.c - - # We assume CC is already set up. - nonfatal emake glibc-test - ret=$? - - popd >/dev/null - - CFLAGS=${save_cflags} - return ${ret} -} - -do_run_test() { - local ret - - if [[ ${MERGE_TYPE} == "binary" ]] ; then - # ignore build failures when installing a binary package #324685 - do_compile_test "" "$@" 2>/dev/null || return 0 - else - if ! do_compile_test "" "$@" ; then - ewarn "Simple build failed ... assuming this is desired #324685" - return 0 - fi - fi - - pushd "${T}" >/dev/null - - ./glibc-test - ret=$? - rm -f glibc-test* - - popd >/dev/null - - return ${ret} -} - -setup_target_flags() { - # This largely mucks with compiler flags. None of which should matter - # when building up just the headers. - just_headers && return 0 - - case $(tc-arch) in - x86) - # -march needed for #185404 #199334 - # TODO: When creating the first glibc cross-compile, this test will - # always fail as it does a full link which in turn requires glibc. - # Probably also applies when changing multilib profile settings (e.g. - # enabling x86 when the profile was amd64-only previously). - # We could change main to _start and pass -nostdlib here so that we - # only test the gcc code compilation. Or we could do a compile and - # then look for the symbol via scanelf. - if ! do_compile_test "" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - filter-flags '-march=*' - export CFLAGS="-march=${t} ${CFLAGS}" - einfo "Auto adding -march=${t} to CFLAGS #185404" - fi - # For compatibility with older binaries at slight performance cost. - use stack-realign && export CFLAGS+=" -mstackrealign" - ;; - amd64) - # -march needed for #185404 #199334 - # TODO: See cross-compile issues listed above for x86. - if [[ ${ABI} == x86 ]]; then - if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - # Normally the target is x86_64-xxx, so turn that into the -march that - # gcc actually accepts. #528708 - [[ ${t} == "x86_64" ]] && t="x86-64" - filter-flags '-march=*' - # ugly, ugly, ugly. ugly. - CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") - export CFLAGS_x86="${CFLAGS_x86} -march=${t}" - einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})" - fi - # For compatibility with older binaries at slight performance cost. - use stack-realign && export CFLAGS_x86+=" -mstackrealign" - - # Workaround for bug #823780. - # Need to save/restore CC because earlier on, we stuff it full of CFLAGS, and tc-getCPP doesn't like that. - CC_mangled=${CC} - CC=${glibc__GLIBC_CC} - if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then - export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f" - einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})" - fi - CC=${CC_mangled} - fi - ;; - mips) - # The mips abi cannot support the GNU style hashes. #233233 - filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both - ;; - ppc|ppc64) - # Many arch-specific implementations do not work on ppc with - # cache-block not equal to 128 bytes. This breaks memset: - # https://sourceware.org/PR26522 - # https://bugs.gentoo.org/737996 - # Use default -mcpu=. For ppc it means non-multiarch setup. - filter-flags '-mcpu=*' - ;; - sparc) - # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though. - filter-flags "-fcall-used-g7" - append-flags "-fcall-used-g6" - - local cpu - case ${CTARGET} in - sparc64-*) - cpu="sparc64" - case $(get-flag mcpu) in - v9) - # We need to force at least v9a because the base build doesn't - # work with just v9. - # https://sourceware.org/bugzilla/show_bug.cgi?id=19477 - append-flags "-Wa,-xarch=v9a" - ;; - esac - ;; - sparc-*) - case $(get-flag mcpu) in - v8|supersparc|hypersparc|leon|leon3) - cpu="sparcv8" - ;; - *) - cpu="sparcv9" - ;; - esac - ;; - esac - [[ -n ${cpu} ]] && CTARGET_OPT="${cpu}-${CTARGET#*-}" - ;; - esac -} - -setup_flags() { - # Make sure host make.conf doesn't pollute us - if is_crosscompile || tc-is-cross-compiler ; then - CHOST=${CTARGET} strip-unsupported-flags - fi - - # Store our CFLAGS because it's changed depending on which CTARGET - # we are building when pulling glibc on a multilib profile - CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}} - CFLAGS=${CFLAGS_BASE} - CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}} - CXXFLAGS=${CXXFLAGS_BASE} - ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}} - ASFLAGS=${ASFLAGS_BASE} - - # Allow users to explicitly avoid flag sanitization via - # USE=custom-cflags. - if ! use custom-cflags; then - # Over-zealous CFLAGS can often cause problems. What may work for one - # person may not work for another. To avoid a large influx of bugs - # relating to failed builds, we strip most CFLAGS out to ensure as few - # problems as possible. - strip-flags - # Lock glibc at -O2; we want to be conservative here. - filter-flags '-O?' - append-flags -O2 - fi - - strip-unsupported-flags - filter-lto - filter-flags -m32 -m64 '-mabi=*' - - # glibc aborts if rpath is set by LDFLAGS - filter-ldflags '-Wl,-rpath=*' - - # ld can't use -r & --relax at the same time, bug #788901 - # https://sourceware.org/PR27837 - filter-ldflags '-Wl,--relax' - - # Flag added for cross-prefix, but causes ldconfig to segfault. Not needed - # anyway because glibc already handles this by itself. - filter-ldflags '-Wl,--dynamic-linker=*' - - # some weird software relies on sysv hashes in glibc, bug 863863, bug 864100 - # we have to do that here already so mips can filter it out again :P - if use hash-sysv-compat ; then - append-ldflags '-Wl,--hash-style=both' - fi - - # #492892 - filter-flags -frecord-gcc-switches - - # #898098 - filter-flags -fno-builtin - - # #829583 - filter-lfs-flags - - unset CBUILD_OPT CTARGET_OPT - if use multilib ; then - CTARGET_OPT=$(get_abi_CTARGET) - [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST) - fi - - setup_target_flags - - if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then - CBUILD_OPT=${CTARGET_OPT} - fi - - # glibc's headers disallow -O0 and fail at build time: - # include/libc-symbols.h:75:3: #error "glibc cannot be compiled without optimization" - # https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F - replace-flags -O0 -O1 - - # glibc handles this internally already where it's appropriate; - # can't always have SSP when we're the ones setting it up, etc - filter-flags '-fstack-protector*' - - # Similar issues as with SSP. Can't inject yourself that early. - filter-flags '-fsanitize=*' - - # See end of bug #830454; we handle this via USE=cet - filter-flags '-fcf-protection=*' - - # When bootstrapping, we may have a situation where - # CET-enabled gcc from seed is used to build CET-disabled - # glibc. As such, gcc implicitly enables CET if no - # -fcf-protection flag is passed. For a typical package it - # should not be a problem, but for glibc it matters as it is - # dealing with CET in ld.so. So if CET is supposed to be - # disabled for glibc, be explicit about it. - if (use amd64 || use x86) && ! use cet; then - append-flags '-fcf-protection=none' - fi -} - -use_multiarch() { - # Allow user to disable runtime arch detection in multilib. - use multiarch || return 1 - # Make sure binutils is new enough to support indirect functions, - # #336792. This funky sed supports gold and bfd linkers. - local bver nver - bver=$($(tc-getLD ${CTARGET}) -v | sed -n -r '1{s:[^0-9]*::;s:^([0-9.]*).*:\1:;p}') - case $(tc-arch ${CTARGET}) in - amd64|x86) nver="2.20" ;; - arm) nver="2.22" ;; - hppa) nver="2.23" ;; - ppc|ppc64) nver="2.20" ;; - # ifunc support was added in 2.23, but glibc also needs - # machinemode which is in 2.24. - s390) nver="2.24" ;; - sparc) nver="2.21" ;; - *) return 1 ;; - esac - ver_test ${bver} -ge ${nver} -} - -# Setup toolchain variables that had historically been defined in the -# profiles for these archs. -setup_env() { - # silly users - unset LD_RUN_PATH - unset LD_ASSUME_KERNEL - - if is_crosscompile || tc-is-cross-compiler ; then - multilib_env ${CTARGET_OPT:-${CTARGET}} - - if ! use multilib ; then - MULTILIB_ABIS=${DEFAULT_ABI} - else - MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}} - fi - - # If the user has CFLAGS_ in their make.conf, use that, - # and fall back on CFLAGS. - local VAR=CFLAGS_${CTARGET//[-.]/_} - CFLAGS=${!VAR-${CFLAGS}} - einfo " $(printf '%15s' 'Manual CFLAGS:') ${CFLAGS}" - fi - - setup_flags - - export ABI=${ABI:-${DEFAULT_ABI:-default}} - - if just_headers ; then - # Avoid mixing host's CC and target's CFLAGS_${ABI}: - # At this bootstrap stage we have only binutils for - # target but not compiler yet. - einfo "Skip CC ABI injection. We can't use (cross-)compiler yet." - return 0 - fi - - # Glibc does not work with gold (for various reasons) #269274. - tc-ld-disable-gold - - if use doc ; then - export MAKEINFO=makeinfo - else - export MAKEINFO=/dev/null - fi - - # Reset CC and CXX to the value at start of emerge - export CC=${glibc__ORIG_CC:-${CC:-$(tc-getCC ${CTARGET})}} - export CXX=${glibc__ORIG_CXX:-${CXX:-$(tc-getCXX ${CTARGET})}} - - # and make sure glibc__ORIG_CC and glibc__ORIG_CXX is defined now. - export glibc__ORIG_CC=${CC} - export glibc__ORIG_CXX=${CXX} - - if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; then - export glibc__force_gcc=yes - # once this is toggled on, it needs to stay on, since with CPP manipulated - # tc-is-clang does not work correctly anymore... - fi - - if [[ ${glibc__force_gcc} == "yes" ]] ; then - # If we are running in an otherwise clang/llvm environment, we need to - # recover the proper gcc and binutils settings here, at least until glibc - # is finally building with clang. So let's override everything that is - # set in the clang profiles. - # Want to shoot yourself into the foot? Set USE=custom-cflags, that's always - # a good start into that direction. - # Also, if you're crosscompiling, let's assume you know what you are doing. - # Hopefully. - # Last, we need the settings of the *build* environment, not of the - # target environment... - - local current_binutils_path=$(env ROOT="${BROOT}" binutils-config -B) - local current_gcc_path=$(env ROOT="${BROOT}" gcc-config -B) - einfo "Overriding clang configuration, since it won't work here" - - export CC="${current_gcc_path}/gcc" - export CPP="${current_gcc_path}/cpp" - export CXX="${current_gcc_path}/g++" - export LD="${current_binutils_path}/ld.bfd" - export AR="${current_binutils_path}/ar" - export AS="${current_binutils_path}/as" - export NM="${current_binutils_path}/nm" - export STRIP="${current_binutils_path}/strip" - export RANLIB="${current_binutils_path}/ranlib" - export OBJCOPY="${current_binutils_path}/objcopy" - export STRINGS="${current_binutils_path}/strings" - export OBJDUMP="${current_binutils_path}/objdump" - export READELF="${current_binutils_path}/readelf" - export ADDR2LINE="${current_binutils_path}/addr2line" - - # do we need to also do flags munging here? yes! at least... - filter-flags '-fuse-ld=*' - filter-flags '-D_FORTIFY_SOURCE=*' - - else - - # this is the "normal" case - - export CC="$(tc-getCC ${CTARGET})" - export CXX="$(tc-getCXX ${CTARGET})" - - # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure - # can't detect them automatically due to ${CHOST} mismatch and fallbacks - # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup(). - export NM="$(tc-getNM ${CTARGET})" - export READELF="$(tc-getREADELF ${CTARGET})" - - fi - - # We need to export CFLAGS with abi information in them because glibc's - # configure script checks CFLAGS for some targets (like mips). Keep - # around the original clean value to avoid appending multiple ABIs on - # top of each other. (Why does the comment talk about CFLAGS if the code - # acts on CC?) - export glibc__GLIBC_CC=${CC} - export glibc__GLIBC_CXX=${CXX} - - export glibc__abi_CFLAGS="$(get_abi_CFLAGS)" - - # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760 - # To build .S (assembly) files with the same ABI-specific flags - # upstream currently recommends adding CFLAGS to CC/CXX: - # https://sourceware.org/PR23273 - # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS - # and breaks multiarch support. See 659030#c3 for an example. - # The glibc configure script doesn't properly use LDFLAGS all the time. - export CC="${glibc__GLIBC_CC} ${glibc__abi_CFLAGS} ${CFLAGS} ${LDFLAGS}" - - # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548 - export CXX="${glibc__GLIBC_CXX} ${glibc__abi_CFLAGS} ${CFLAGS}" - - if is_crosscompile; then - # Assume worst-case bootstrap: glibc is built for the first time - # with ${CTARGET}-g++ not available yet. We avoid - # building auxiliary programs that require C++: bug #683074 - # It should not affect final result. - export libc_cv_cxx_link_ok=no - # The line above has the same effect. We set CXX explicitly - # to make build logs less confusing. - export CXX= - fi -} - -foreach_abi() { - setup_env - - local ret=0 - local abilist="" - if use multilib ; then - abilist=$(get_install_abis) - else - abilist=${DEFAULT_ABI} - fi - local -x ABI - for ABI in ${abilist:-default} ; do - setup_env - einfo "Running $1 for ABI ${ABI}" - $1 - : $(( ret |= $? )) - done - return ${ret} -} - -glibc_banner() { - local b="Gentoo ${PVR}" - [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" (patchset ${PATCH_VER})" - echo "${b}" -} - -# The following Kernel version handling functions are mostly copied from portage -# source. It's better not to use linux-info.eclass here since a) it adds too -# much magic, see bug 326693 for some of the arguments, and b) some of the -# functions are just not provided. - -g_get_running_KV() { - uname -r - return $? -} - -g_KV_major() { - [[ -z $1 ]] && return 1 - local KV=$@ - echo "${KV%%.*}" -} - -g_KV_minor() { - [[ -z $1 ]] && return 1 - local KV=$@ - KV=${KV#*.} - echo "${KV%%.*}" -} - -g_KV_micro() { - [[ -z $1 ]] && return 1 - local KV=$@ - KV=${KV#*.*.} - echo "${KV%%[^[:digit:]]*}" -} - -g_KV_to_int() { - [[ -z $1 ]] && return 1 - local KV_MAJOR=$(g_KV_major "$1") - local KV_MINOR=$(g_KV_minor "$1") - local KV_MICRO=$(g_KV_micro "$1") - local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO )) - - # We make version 2.2.0 the minimum version we will handle as - # a sanity check ... if its less, we fail ... - if [[ ${KV_int} -ge 131584 ]] ; then - echo "${KV_int}" - return 0 - fi - return 1 -} - -g_int_to_KV() { - local version=$1 major minor micro - major=$((version / 65536)) - minor=$(((version % 65536) / 256)) - micro=$((version % 256)) - echo ${major}.${minor}.${micro} -} - -eend_KV() { - [[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]] - eend $? -} - -get_kheader_version() { - printf '#include \nLINUX_VERSION_CODE\n' | \ - $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ - tail -n 1 -} - -# We collect all sanity checks here. Consistency is not guranteed between -# pkg_ and src_ phases, so we call this function both in pkg_pretend and in -# src_unpack. -sanity_prechecks() { - # Prevent native builds from downgrading - if [[ ${MERGE_TYPE} != "buildonly" ]] && \ - [[ -z ${ROOT} ]] && \ - [[ ${CBUILD} == ${CHOST} ]] && \ - [[ ${CHOST} == ${CTARGET} ]] ; then - - # The high rev # is to allow people to downgrade between -r# - # versions. We want to block 2.20->2.19, but 2.20-r3->2.20-r2 - # should be fine. Hopefully we never actually use a r# this - # high. - if has_version ">${CATEGORY}/${P}-r10000" ; then - eerror "Sanity check to keep you from breaking your system:" - eerror " Downgrading glibc is not supported and a sure way to destruction." - [[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system." - fi - - if ! do_run_test '#include \n#include \nint main(){return syscall(1000)!=-1;}\n' ; then - eerror "Your old kernel is broken. You need to update it to a newer" - eerror "version as syscall() will break. See bug 279260." - die "Old and broken kernel." - fi - fi - - if [[ ${CTARGET} == i386-* ]] ; then - eerror "i386 CHOSTs are no longer supported." - eerror "Chances are you don't actually want/need i386." - eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml" - die "Please fix your CHOST" - fi - - if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then - ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS." - ewarn "This will result in a 50% performance penalty when running with a 32bit" - ewarn "hypervisor, which is probably not what you want." - fi - - # ABI-specific checks follow here. Hey, we have a lot more specific conditions that - # we test for... - if ! is_crosscompile ; then - if use amd64 && use multilib && [[ ${MERGE_TYPE} != "binary" ]] ; then - ebegin "Checking that IA32 emulation is enabled in the running kernel" - echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c" - local STAT - if ${CC-${CHOST}-gcc} ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then - "${T}/check-ia32-emulation.elf32" - STAT=$? - else - # Don't fail here to allow single->multi ABI switch - # or recover from breakage like bug #646424 - ewarn "Failed to compile the ABI test. Broken host glibc?" - STAT=0 - fi - rm -f "${T}/check-ia32-emulation.elf32" - eend $STAT - [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib glibc." - fi - - fi - - # When we actually have to compile something... - if ! just_headers && [[ ${MERGE_TYPE} != "binary" ]] ; then - if [[ -d "${ESYSROOT}"/usr/lib/include ]] ; then - # bug #833620, bug #643302 - eerror "Found ${ESYSROOT}/usr/lib/include directory!" - eerror "This is known to break glibc's build." - eerror "Please backup its contents then remove the directory." - die "Found directory (${ESYSROOT}/usr/lib/include) which will break build (bug #833620)!" - fi - - if [[ ${CTARGET} == *-linux* ]] ; then - local run_kv build_kv want_kv - - run_kv=$(g_get_running_KV) - build_kv=$(g_int_to_KV $(get_kheader_version)) - want_kv=${MIN_KERN_VER} - - if ! is_crosscompile && ! tc-is-cross-compiler ; then - # Building fails on an non-supporting kernel - ebegin "Checking running kernel version (${run_kv} >= ${want_kv})" - if ! eend_KV ${run_kv} ${want_kv} ; then - echo - eerror "You need a kernel of at least ${want_kv}!" - die "Kernel version too low!" - fi - fi - - # Do not run this check for pkg_pretend, just pkg_setup and friends (if we ever get used there). - # It's plausible (seen it in the wild) that Portage will (correctly) schedule a linux-headers - # upgrade before glibc, but because pkg_pretend gets run before any packages are merged at all (not - # just glibc), the whole emerge gets aborted without a good reason. We probably don't - # need to run this check at all given we have a dependency on the right headers, - # but let's leave it as-is for now. - if [[ ${EBUILD_PHASE_FUNC} != pkg_pretend ]] ; then - ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})" - if ! eend_KV ${build_kv} ${want_kv} ; then - echo - eerror "You need linux-headers of at least ${want_kv}!" - die "linux-headers version too low!" - fi - fi - fi - fi -} - -upgrade_warning() { - is_crosscompile && return - - if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then - local oldv newv=$(ver_cut 1-2 ${PV}) - for oldv in ${REPLACING_VERSIONS}; do - if ver_test ${oldv} -lt ${newv}; then - ewarn "After upgrading glibc, please restart all running processes." - ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)." - ewarn "Alternatively, reboot your system." - ewarn "(See bug #660556, bug #741116, bug #823756, etc)" - break - fi - done - fi -} - -# -# the phases -# - -# pkg_pretend - -pkg_pretend() { - upgrade_warning -} - -# pkg_setup - -pkg_setup() { - # see bug 682570 - [[ -z ${BOOTSTRAP_RAP} ]] && python-any-r1_pkg_setup -} - -# src_unpack - -src_unpack() { - setup_env - - einfo "Checking general environment sanity." - sanity_prechecks - - use multilib-bootstrap && unpack gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz - - if [[ ${PV} == 9999* ]] ; then - EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/glibc-patches.git" - EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git - git-r3_src_unpack - mv patches-git/9999 patches || die - - EGIT_REPO_URI="https://sourceware.org/git/glibc.git" - EGIT_CHECKOUT_DIR=${S} - git-r3_src_unpack - else - unpack ${P}.tar.xz - - cd "${WORKDIR}" || die - unpack glibc-${PV}-patches-${PATCH_VER}.tar.xz - fi - - cd "${WORKDIR}" || die - use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz -} - -# src_prepare - -src_prepare() { - local patchsetname - if ! use vanilla ; then - if [[ ${PV} == 9999* ]] ; then - patchsetname="from git master" - else - patchsetname="${PV}-${PATCH_VER}" - fi - einfo "Applying Gentoo Glibc patchset ${patchsetname}" - eapply "${WORKDIR}"/patches - einfo "Done." - fi - - default - - gnuconfig_update - - cd "${WORKDIR}" || die - find . -name configure -exec touch {} + - - # Fix permissions on some of the scripts. - chmod u+x "${S}"/scripts/*.sh - - cd "${S}" || die -} - -# src_configure - -glibc_do_configure() { - dump_build_environment - - local myconf=() - - # Use '=strong' instead of '=all' to protect only functions - # worth protecting from stack smashes. - myconf+=( --enable-stack-protector=$(usex ssp strong no) ) - - # Keep a whitelist of targets supporing IFUNC. glibc's ./configure - # is not robust enough to detect proper support: - # https://bugs.gentoo.org/641216 - # https://sourceware.org/PR22634#c0 - case $(tc-arch ${CTARGET}) in - # Keep whitelist of targets where autodetection mostly works. - amd64|x86|sparc|ppc|ppc64|arm|arm64|s390|riscv|loong) ;; - # Blacklist everywhere else - *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;; - esac - - case ${ABI}-${CTARGET} in - amd64-x86_64-*|x32-x86_64-*-*-gnux32) myconf+=( $(use_enable cet) ) ;; - *) ;; - esac - - [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp ) - - myconf+=( --enable-kernel=${MIN_KERN_VER} ) - - # Since SELinux support is only required for nscd, only enable it if: - # 1. USE selinux - # 2. only for the primary ABI on multilib systems - # 3. Not a crosscompile - if ! is_crosscompile && use selinux ; then - if use multilib ; then - if is_final_abi ; then - myconf+=( --with-selinux ) - else - myconf+=( --without-selinux ) - fi - else - myconf+=( --with-selinux ) - fi - else - myconf+=( --without-selinux ) - fi - - # Force a few tests where we always know the answer but - # configure is incapable of finding it. - if is_crosscompile ; then - export \ - libc_cv_c_cleanup=yes \ - libc_cv_forced_unwind=yes - fi - - myconf+=( - --disable-werror - --enable-bind-now - --enable-fortify-source - --build=${CBUILD_OPT:-${CBUILD}} - --host=${CTARGET_OPT:-${CTARGET}} - $(use_enable profile) - $(use_with gd) - --with-headers=$(build_eprefix)$(alt_build_headers) - --prefix="$(host_eprefix)/usr" - --sysconfdir="$(host_eprefix)/etc" - --localstatedir="$(host_eprefix)/var" - --libdir='$(prefix)'/$(get_libdir) - --mandir='$(prefix)'/share/man - --infodir='$(prefix)'/share/info - --libexecdir='$(libdir)'/misc/glibc - --with-bugurl=https://bugs.gentoo.org/ - --with-pkgversion="$(glibc_banner)" - $(use_multiarch || echo --disable-multi-arch) - $(use_enable systemtap) - $(use_enable nscd) - - # /usr/bin/mtrace has a Perl shebang. Gentoo Prefix QA checks fail if - # Perl hasn't been installed inside the prefix yet and configure picks - # up a Perl from outside the prefix instead. configure will fail to - # execute Perl during configure if we're cross-compiling a prefix, but - # it will just disable mtrace in that case. - # Note: mtrace is needed by the test suite. - ac_cv_path_PERL="$(usex perl "${EPREFIX}"/usr/bin/perl $(usex test "${EPREFIX}"/usr/bin/perl $(usex doc "${EPREFIX}"/usr/bin/perl no)))" - - # locale data is arch-independent - # https://bugs.gentoo.org/753740 - libc_cv_complocaledir='${exec_prefix}/lib/locale' - - # On aarch64 there is no way to override -mcpu=native, and if - # the current cpu does not support SVE configure fails. - # Let's boldly assume our toolchain can always build SVE instructions. - libc_cv_aarch64_sve_asm=yes - - ${EXTRA_ECONF} - ) - - # We rely on sys-libs/timezone-data for timezone tools normally. - myconf+=( $(use_enable vanilla timezone-tools) ) - - # These libs don't have configure flags. - ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no) - ac_cv_lib_cap_cap_init=$(usex caps || echo no) - - # There is no configure option for this and we need to export it - # since the glibc build will re-run configure on itself - export libc_cv_rootsbindir="$(host_eprefix)/sbin" - export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)" - - local builddir=$(builddir nptl) - mkdir -p "${builddir}" - cd "${builddir}" - set -- "${S}"/configure "${myconf[@]}" - echo "$@" - "$@" || die "failed to configure glibc" - - # If we're trying to migrate between ABI sets, we need - # to lie and use a local copy of gcc. Like if the system - # is built with MULTILIB_ABIS="amd64 x86" but we want to - # add x32 to it, gcc/glibc don't yet support x32. - # - if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib-bootstrap ; then - echo 'int main(void){}' > "${T}"/test.c || die - if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then - sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die - fi - fi -} - -glibc_headers_configure() { - export ABI=default - - local builddir=$(builddir "headers") - mkdir -p "${builddir}" - cd "${builddir}" - - # if we don't have a compiler yet, we can't really test it now ... - # hopefully they don't affect header generation, so let's hope for - # the best here ... - local v vars=( - ac_cv_header_cpuid_h=yes - libc_cv_{386,390,alpha,arm,hppa,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes - libc_cv_asm_cfi_directives=yes - libc_cv_broken_visibility_attribute=no - libc_cv_c_cleanup=yes - libc_cv_compiler_powerpc64le_binary128_ok=yes - libc_cv_forced_unwind=yes - libc_cv_gcc___thread=yes - libc_cv_mlong_double_128=yes - libc_cv_mlong_double_128ibm=yes - libc_cv_ppc_machine=yes - libc_cv_ppc_rel16=yes - libc_cv_predef_fortify_source=no - libc_cv_target_power8_ok=yes - libc_cv_visibility_attribute=yes - libc_cv_z_combreloc=yes - libc_cv_z_execstack=yes - libc_cv_z_initfirst=yes - libc_cv_z_nodelete=yes - libc_cv_z_nodlopen=yes - libc_cv_z_relro=yes - libc_mips_abi=${ABI} - libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard) - # These libs don't have configure flags. - ac_cv_lib_audit_audit_log_user_avc_message=no - ac_cv_lib_cap_cap_init=no - ) - - einfo "Forcing cached settings:" - for v in "${vars[@]}" ; do - einfo " ${v}" - export ${v} - done - - local headers_only_arch_CPPFLAGS=() - - # Blow away some random CC settings that screw things up. #550192 - if [[ -d ${S}/sysdeps/mips ]]; then - pushd "${S}"/sysdeps/mips >/dev/null - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die - - # Force the mips ABI to the default. This is OK because the set of - # installed headers in this phase is the same between the 3 ABIs. - # If this ever changes, this hack will break, but that's unlikely - # as glibc discourages that behavior. - # https://crbug.com/647033 - sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die - - popd >/dev/null - fi - - local myconf=() - - case ${CTARGET} in - aarch64*) - # The configure checks fail during cross-build, so disable here - # for headers-only - myconf+=( - --disable-mathvec - ) ;; - riscv*) - # RISC-V interrogates the compiler to determine which target to - # build. If building the headers then we don't strictly need a - # RISC-V compiler, so the built-in definitions that are provided - # along with all RISC-V compiler might not exist. This causes - # glibc's RISC-V preconfigure script to blow up. Since we're just - # building the headers any value will actually work here, so just - # pick the standard one (rv64g/lp64d) to make the build scripts - # happy for now -- the headers are all the same anyway so it - # doesn't matter. - headers_only_arch_CPPFLAGS+=( - -D__riscv_xlen=64 - -D__riscv_flen=64 - -D__riscv_float_abi_double=1 - -D__riscv_atomic=1 - ) ;; - esac - - myconf+=( - --disable-sanity-checks - --enable-hacker-mode - --disable-werror - --enable-bind-now - --build=${CBUILD_OPT:-${CBUILD}} - --host=${CTARGET_OPT:-${CTARGET}} - --with-headers=$(build_eprefix)$(alt_build_headers) - --prefix="$(host_eprefix)/usr" - ${EXTRA_ECONF} - ) - - # Nothing is compiled here which would affect the headers for the target. - # So forcing CC/CFLAGS is sane. - local headers_only_CC=$(tc-getBUILD_CC) - local headers_only_CFLAGS="-O1 -pipe" - local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}" - local headers_only_LDFLAGS="" - set -- "${S}"/configure "${myconf[@]}" - echo \ - "CC=${headers_only_CC}" \ - "CFLAGS=${headers_only_CFLAGS}" \ - "CPPFLAGS=${headers_only_CPPFLAGS}" \ - "LDFLAGS=${headers_only_LDFLAGS}" \ - "$@" - CC=${headers_only_CC} \ - CFLAGS=${headers_only_CFLAGS} \ - CPPFLAGS=${headers_only_CPPFLAGS} \ - LDFLAGS="" \ - "$@" || die "failed to configure glibc" -} - -do_src_configure() { - if just_headers ; then - glibc_headers_configure - else - glibc_do_configure nptl - fi -} - -src_configure() { - foreach_abi do_src_configure -} - -# src_compile - -do_src_compile() { - emake -C "$(builddir nptl)" -} - -src_compile() { - if just_headers ; then - return - fi - - foreach_abi do_src_compile -} - -# src_test - -glibc_src_test() { - cd "$(builddir nptl)" - - local myxfailparams="" - if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then - local virt=$(systemd-detect-virt 2>/dev/null) - if [[ ${virt} == systemd-nspawn ]] ; then - ewarn "Skipping extra tests because in systemd-nspawn container" - XFAIL_TEST_LIST+=( "${XFAIL_NSPAWN_TEST_LIST[@]}" ) - fi - - for myt in ${XFAIL_TEST_LIST[@]} ; do - myxfailparams+="test-xfail-${myt}=yes " - done - fi - - # sandbox does not understand unshare() and prevents - # writes to /proc/, which makes many tests fail - - # we give the tests a bit more time to avoid spurious - # bug reports on slow arches - - SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=16 emake ${myxfailparams} check -} - -src_test() { - if just_headers ; then - return - fi - - foreach_abi glibc_src_test || die "tests failed" -} - -# src_install - -run_locale_gen() { - # if the host locales.gen contains no entries, we'll install everything - local root="$1" - local inplace="" - - if [[ "${root}" == "--inplace-glibc" ]] ; then - inplace="--inplace-glibc" - root="$2" - fi - - local locale_list="${root%/}/etc/locale.gen" - - pushd "${ED}"/$(get_libdir) >/dev/null - - if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then - [[ -z ${inplace} ]] && ewarn "Generating all locales; edit /etc/locale.gen to save time/space" - locale_list="${root%/}/usr/share/i18n/SUPPORTED" - fi - - # bug 736794: we need to be careful with the parallelization... the number of - # processors saved in the environment of a binary package may differ strongly - # from the number of processes available during postinst - local mygenjobs="$(makeopts_jobs)" - if [[ "${EMERGE_FROM}" == "binary" ]] ; then - mygenjobs="$(nproc)" - fi - - set -- locale-gen ${inplace} --jobs "${mygenjobs}" --config "${locale_list}" \ - --destdir "${root}" - echo "$@" - "$@" - - popd >/dev/null -} - -glibc_do_src_install() { - local builddir=$(builddir nptl) - cd "${builddir}" - - emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install - - # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support - # which come without headers etc. Only needed for binary packages since the - # external net-libs/libnsl has increased soversion. Keep only versioned libraries. - find "${D}" -name "libnsl.a" -delete - find "${D}" -name "libnsl.so" -delete - - # Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need - # to infer upstream version: - # '#define VERSION "2.26.90"' -> '2.26.90' - local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h) - - # Avoid stripping binaries not targeted by ${CHOST}. Or else - # ${CHOST}-strip would break binaries build for ${CTARGET}. - is_crosscompile && dostrip -x / - - # gdb thread introspection relies on local libpthreads symbols. stripping breaks it - # See Note [Disable automatic stripping] - dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so - # valgrind requires knowledge about ld.so symbols. - dostrip -x $(alt_libdir)/ld-*.so* - - if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then - # Move versioned .a file out of libdir to evade portage QA checks - # instead of using gen_usr_ldscript(). We fix ldscript as: - # "GROUP ( /usr/lib64/libm-.a ..." -> "GROUP ( /usr/lib64/glibc-/libm-.a ..." - sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"/$(alt_usrlibdir)/libm.a || die - dodir $(alt_usrlibdir)/${P} - mv "${ED}"/$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"/$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die - fi - - # We configure toolchains for standalone prefix systems with a sysroot, - # which is prepended to paths in ld scripts, so strip the prefix from these. - # Before: GROUP ( /foo/lib64/libc.so.6 /foo/usr/lib64/libc_nonshared.a AS_NEEDED ( /foo/lib64/ld-linux-x86-64.so.2 ) ) - # After: GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) - if [[ -n $(host_eprefix) ]] ; then - local file - grep -lZIF "ld script" "${ED}/$(alt_usrlibdir)"/lib*.{a,so} 2>/dev/null | while read -rd '' file ; do - sed -i "s|$(host_eprefix)/|/|g" "${file}" || die - done - fi - - # We'll take care of the cache ourselves - rm -f "${ED}"/etc/ld.so.cache - - # Everything past this point just needs to be done once ... - is_final_abi || return 0 - - # Make sure the non-native interp can be found on multilib systems even - # if the main library set isn't installed into the right place. Maybe - # we should query the active gcc for info instead of hardcoding it ? - local i ldso_abi ldso_name - local ldso_abi_list=( - # x86 - amd64 /lib64/ld-linux-x86-64.so.2 - x32 /libx32/ld-linux-x32.so.2 - x86 /lib/ld-linux.so.2 - # mips - o32 /lib/ld.so.1 - n32 /lib32/ld.so.1 - n64 /lib64/ld.so.1 - # powerpc - ppc /lib/ld.so.1 - # riscv - ilp32d /lib/ld-linux-riscv32-ilp32d.so.1 - ilp32 /lib/ld-linux-riscv32-ilp32.so.1 - lp64d /lib/ld-linux-riscv64-lp64d.so.1 - lp64 /lib/ld-linux-riscv64-lp64.so.1 - # s390 - s390 /lib/ld.so.1 - s390x /lib/ld64.so.1 - # sparc - sparc32 /lib/ld-linux.so.2 - sparc64 /lib64/ld-linux.so.2 - ) - case $(tc-endian) in - little) - ldso_abi_list+=( - # arm - arm64 /lib/ld-linux-aarch64.so.1 - # ELFv2 (glibc does not support ELFv1 on LE) - ppc64 /lib64/ld64.so.2 - ) - ;; - big) - ldso_abi_list+=( - # arm - arm64 /lib/ld-linux-aarch64_be.so.1 - # ELFv1 (glibc does not support ELFv2 on BE) - ppc64 /lib64/ld64.so.1 - ) - ;; - esac - if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib - fi - for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do - ldso_abi=${ldso_abi_list[i]} - has ${ldso_abi} $(get_install_abis) || continue - - ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}" - if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then - dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name} - fi - done - - # In the LSB 5.0 definition, someone had the excellent idea to "standardize" - # the runtime loader name, see also https://xkcd.com/927/ - # Normally, in Gentoo one should never come across executables that require this. - # However, binary commercial packages are known to adhere to weird practices. - # https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-AMD64/LSB-Core-AMD64.html#BASELIB - local lsb_ldso_name native_ldso_name lsb_ldso_abi - local lsb_ldso_abi_list=( - # x86 - amd64 ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3 - ) - for (( i = 0; i < ${#lsb_ldso_abi_list[@]}; i += 3 )) ; do - lsb_ldso_abi=${lsb_ldso_abi_list[i]} - native_ldso_name=${lsb_ldso_abi_list[i+1]} - lsb_ldso_name=${lsb_ldso_abi_list[i+2]} - has ${lsb_ldso_abi} $(get_install_abis) || continue - - if [[ ! -L ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} && ! -e ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} ]] ; then - dosym ${native_ldso_name} "$(alt_prefix)/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name}" - fi - done - - # With devpts under Linux mounted properly, we do not need the pt_chown - # binary to be setuid. This is because the default owners/perms will be - # exactly what we want. - if ! use suid ; then - find "${ED}" -name pt_chown -exec chmod -s {} + - fi - - ################################################################# - # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY # - ################################################################# - - # Make sure we install some symlink hacks so that when we build - # a 2nd stage cross-compiler, gcc finds the target system - # headers correctly. See gcc/doc/gccinstall.info - if is_crosscompile ; then - # We need to make sure that /lib and /usr/lib always exists. - # gcc likes to use relative paths to get to its multilibs like - # /usr/lib/../lib64/. So while we don't install any files into - # /usr/lib/, we do need it to exist. - keepdir $(alt_prefix)/lib - keepdir $(alt_prefix)/usr/lib - - dosym usr/include $(alt_prefix)/sys-include - return 0 - fi - - # Files for Debian-style locale updating - dodir /usr/share/i18n - sed \ - -e "/^#/d" \ - -e "/SUPPORTED-LOCALES=/d" \ - -e "s: \\\\::g" -e "s:/: :g" \ - "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \ - || die "generating /usr/share/i18n/SUPPORTED failed" - - cd "${S}" || die - - # Install misc network config files - insinto /etc - doins posix/gai.conf - - if use systemd ; then - doins "${WORKDIR}/glibc-systemd-${GLIBC_SYSTEMD_VER}/gentoo-config/nsswitch.conf" - else - doins nss/nsswitch.conf - fi - - # Gentoo-specific - newins "${FILESDIR}"/host.conf-1 host.conf - - if use nscd ; then - doins nscd/nscd.conf - - newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd - - local nscd_args=( - -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):" - ) - - sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd - - use systemd && systemd_dounit nscd/nscd.service - newtmpfiles nscd/nscd.tmpfiles nscd.conf - fi - - echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc - doenvd "${T}"/00glibc - - for d in BUGS ChangeLog CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do - [[ -s ${d} ]] && dodoc ${d} - done - dodoc -r ChangeLog.old - - # Prevent overwriting of the /etc/localtime symlink. We'll handle the - # creation of the "factory" symlink in pkg_postinst(). - rm -f "${ED}"/etc/localtime - - # Generate all locales if this is a native build as locale generation - if use compile-locales && ! is_crosscompile ; then - run_locale_gen --inplace-glibc "${ED}/" - fi -} - -glibc_headers_install() { - local builddir=$(builddir "headers") - cd "${builddir}" - emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install-headers - - insinto $(alt_headers)/gnu - doins "${S}"/include/gnu/stubs.h - - # Make sure we install the sys-include symlink so that when - # we build a 2nd stage cross-compiler, gcc finds the target - # system headers correctly. See gcc/doc/gccinstall.info - dosym usr/include $(alt_prefix)/sys-include -} - -src_install() { - if just_headers ; then - export ABI=default - glibc_headers_install - return - fi - - foreach_abi glibc_do_src_install - - if ! use static-libs ; then - einfo "Not installing static glibc libraries" - find "${ED}" -name "*.a" -and -not -name "*_nonshared.a" -delete - fi -} - -# Simple test to make sure our new glibc isn't completely broken. -# Make sure we don't test with statically built binaries since -# they will fail. Also, skip if this glibc is a cross compiler. -# -# If coreutils is built with USE=multicall, some of these files -# will just be wrapper scripts, not actual ELFs we can test. -glibc_sanity_check() { - cd / #228809 - - # We enter ${ED} so to avoid trouble if the path contains - # special characters; for instance if the path contains the - # colon character (:), then the linker will try to split it - # and look for the libraries in an unexpected place. This can - # lead to unsafe code execution if the generated prefix is - # within a world-writable directory. - # (e.g. /var/tmp/portage:${HOSTNAME}) - pushd "${ED}"/$(get_libdir) >/dev/null - - # first let's find the actual dynamic linker here - # symlinks may point to the wrong abi - local newldso=$(find . -maxdepth 1 -name 'ld*so.?' -type f -print -quit) - - einfo Last-minute run tests with ${newldso} in /$(get_libdir) ... - - local x striptest - for x in cal date env free ls true uname uptime ; do - x=$(type -p ${x}) - [[ -z ${x} || ${x} != ${EPREFIX}/* ]] && continue - striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) || continue - case ${striptest} in - *"statically linked"*) continue;; - *"ASCII text"*) continue;; - esac - # We need to clear the locale settings as the upgrade might want - # incompatible locale data. This test is not for verifying that. - LC_ALL=C \ - ${newldso} --library-path . ${x} > /dev/null \ - || die "simple run test (${x}) failed" - done - - popd >/dev/null -} - -pkg_preinst() { - # nothing to do if just installing headers - just_headers && return - - einfo "Checking general environment sanity." - sanity_prechecks - - # prepare /etc/ld.so.conf.d/ for files - mkdir -p "${EROOT}"/etc/ld.so.conf.d - - # Default /etc/hosts.conf:multi to on for systems with small dbs. - if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then - sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf - einfo "Defaulting /etc/host.conf:multi to on" - fi - - [[ -n ${ROOT} ]] && return 0 - [[ -d ${ED}/$(get_libdir) ]] || return 0 - [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check - - if [[ -L ${EROOT}/usr/lib/locale ]]; then - # Help portage migrate this to a directory - # https://bugs.gentoo.org/753740 - rm "${EROOT}"/usr/lib/locale || die - fi - - # Keep around libcrypt so that Perl doesn't break when merging libxcrypt - # (libxcrypt is the new provider for now of libcrypt.so.{1,2}). - # bug #802207 - if has_version "${CATEGORY}/${PN}[crypt]" && ! has preserve-libs ${FEATURES}; then - PRESERVED_OLD_LIBCRYPT=1 - cp -p "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" "${T}/libcrypt$(get_libname 1)" || die - else - PRESERVED_OLD_LIBCRYPT=0 - fi -} - -glibc_refresh_ldconfig() { - if [[ ${MERGE_TYPE} == buildonly ]]; then - return - fi - - # Version check could be added to avoid unnecessary work, but ldconfig - # should finish quickly enough to not matter. - ebegin "Refreshing ld.so.cache" - ldconfig -i - if ! eend $?; then - ewarn "Failed to refresh the ld.so.cache for you. Some programs may be broken" - ewarn "before you manually do so (ldconfig -i)." - fi -} - -pkg_postinst() { - # nothing to do if just installing headers - just_headers && return - - if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then - # Generate fastloading iconv module configuration file. - "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}/" - fi - - if ! is_crosscompile && [[ -z ${ROOT} ]] ; then - # glibc-2.38+ on loong has ldconfig support added, but the ELF e_flags - # handling has changed as well, which means stale ldconfig auxiliary - # cache entries and failure to lookup libgcc_s / libstdc++ (breaking - # every C++ application) / libgomp etc., among other breakages. - # - # To fix this, simply refresh the ld.so.cache without using the - # auxiliary cache if we're natively installing on loong. This should - # be done relatively soon because we want to minimize the breakage - # window for the affected programs. - use loong && glibc_refresh_ldconfig - - use compile-locales || run_locale_gen "${EROOT}/" - fi - - upgrade_warning - - # Check for sanity of /etc/nsswitch.conf, take 2 - if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then - local entry - for entry in passwd group shadow; do - if grep -E -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then - ewarn "" - ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been" - ewarn "removed from glibc and is now provided by the package" - ewarn " sys-auth/libnss-nis" - ewarn "Install it now to keep your NIS setup working." - ewarn "" - fi - done - fi - - if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then - cp -p "${T}/libcrypt$(get_libname 1)" "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" || die - preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1) - - elog "Please ignore a possible later error message about a file collision involving" - elog "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1). We need to preserve this file for the moment to keep" - elog "the upgrade working, but it also needs to be overwritten when" - elog "sys-libs/libxcrypt is installed. See bug 802210 for more details." - fi -} diff --git a/sys-libs/glibc/glibc-2.39-r2.ebuild b/sys-libs/glibc/glibc-2.39-r2.ebuild deleted file mode 100644 index ab73ae4098aa..000000000000 --- a/sys-libs/glibc/glibc-2.39-r2.ebuild +++ /dev/null @@ -1,1724 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc -# Please read & adapt the page as necessary if obsolete. - -PYTHON_COMPAT=( python3_{10..12} ) -TMPFILES_OPTIONAL=1 - -inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic gnuconfig \ - multilib systemd multiprocessing tmpfiles - -DESCRIPTION="GNU libc C library" -HOMEPAGE="https://www.gnu.org/software/libc/" -LICENSE="LGPL-2.1+ BSD HPND ISC inner-net rc PCRE" -SLOT="2.2" - -EMULTILIB_PKG="true" - -# Gentoo patchset (ignored for live ebuilds) -PATCH_VER=2 -PATCH_DEV=dilfridge - -# gcc mulitilib bootstrap files version -GCC_BOOTSTRAP_VER=20201208 - -# systemd integration version -GLIBC_SYSTEMD_VER=20210729 - -# Minimum kernel version that glibc requires -MIN_KERN_VER="3.2.0" - -# Minimum pax-utils version needed (which contains any new syscall changes for -# its seccomp filter!). Please double check this! -MIN_PAX_UTILS_VER="1.3.3" - -# Minimum systemd version needed (which contains any new syscall changes for -# its seccomp filter!). Please double check this! -MIN_SYSTEMD_VER="254.9-r1" - -if [[ ${PV} == 9999* ]]; then - inherit git-r3 -else - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa -ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" - SRC_URI="mirror://gnu/glibc/${P}.tar.xz" - SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz" -fi - -SRC_URI+=" multilib-bootstrap? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )" -SRC_URI+=" systemd? ( https://gitweb.gentoo.org/proj/toolchain/glibc-systemd.git/snapshot/glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz )" - -IUSE="audit caps cet compile-locales custom-cflags doc gd hash-sysv-compat headers-only +multiarch multilib multilib-bootstrap nscd perl profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla" - -# Here's how the cross-compile logic breaks down ... -# CTARGET - machine that will target the binaries -# CHOST - machine that will host the binaries -# CBUILD - machine that will build the binaries -# If CTARGET != CHOST, it means you want a libc for cross-compiling. -# If CHOST != CBUILD, it means you want to cross-compile the libc. -# CBUILD = CHOST = CTARGET - native build/install -# CBUILD != (CHOST = CTARGET) - cross-compile a native build -# (CBUILD = CHOST) != CTARGET - libc for cross-compiler -# CBUILD != CHOST != CTARGET - cross-compile a libc for a cross-compiler -# For install paths: -# CHOST = CTARGET - install into / -# CHOST != CTARGET - install into /usr/CTARGET/ -# -export CBUILD=${CBUILD:-${CHOST}} -export CTARGET=${CTARGET:-${CHOST}} -if [[ ${CTARGET} == ${CHOST} ]] ; then - if [[ ${CATEGORY} == cross-* ]] ; then - export CTARGET=${CATEGORY#cross-} - fi -fi - -# Note [Disable automatic stripping] -# Disabling automatic stripping for a few reasons: -# - portage's attempt to strip breaks non-native binaries at least on -# arm: bug #697428 -# - portage's attempt to strip libpthread.so.0 breaks gdb thread -# enumeration: bug #697910. This is quite subtle: -# * gdb uses glibc's libthread_db-1.0.so to enumerate threads. -# * libthread_db-1.0.so needs access to libpthread.so.0 local symbols -# via 'ps_pglobal_lookup' symbol defined in gdb. -# * 'ps_pglobal_lookup' uses '.symtab' section table to resolve all -# known symbols in 'libpthread.so.0'. Specifically 'nptl_version' -# (unexported) is used to sanity check compatibility before enabling -# debugging. -# Also see https://sourceware.org/gdb/wiki/FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint -# * normal 'strip' command trims '.symtab' -# Thus our main goal here is to prevent 'libpthread.so.0' from -# losing it's '.symtab' entries. -# - similarly, valgrind requires knowledge about symbols in ld.so: -# bug #920753 -# As Gentoo's strip does not allow us to pass less aggressive stripping -# options and does not check the machine target we strip selectively. - -# We need a new-enough binutils/gcc to match upstream baseline. -# Also we need to make sure our binutils/gcc supports TLS, -# and that gcc already contains the hardened patches. -# Lastly, let's avoid some openssh nastiness, bug 708224, as -# convenience to our users. - -IDEPEND=" - !compile-locales? ( sys-apps/locale-gen ) -" -BDEPEND=" - ${PYTHON_DEPS} - >=app-misc/pax-utils-${MIN_PAX_UTILS_VER} - sys-devel/bison - compile-locales? ( sys-apps/locale-gen ) - doc? ( - dev-lang/perl - sys-apps/texinfo - ) - test? ( - dev-lang/perl - >=net-dns/libidn2-2.3.0 - ) -" -COMMON_DEPEND=" - gd? ( media-libs/gd:2= ) - nscd? ( selinux? ( - audit? ( sys-process/audit ) - caps? ( sys-libs/libcap ) - ) ) - suid? ( caps? ( sys-libs/libcap ) ) - selinux? ( sys-libs/libselinux ) - systemtap? ( dev-debug/systemtap ) -" -DEPEND="${COMMON_DEPEND} -" -RDEPEND="${COMMON_DEPEND} - !' | $(tc-getCPP ${CTARGET}) ${CFLAGS} 2>&1 | grep -o '[^"]*linux/version.h') - ALT_BUILD_HEADERS=${header_path%/linux/version.h} - fi - fi - fi - echo "${ALT_BUILD_HEADERS}" -} - -alt_libdir() { - echo $(alt_prefix)/$(get_libdir) -} -alt_usrlibdir() { - echo $(alt_prefix)/usr/$(get_libdir) -} - -builddir() { - echo "${WORKDIR}/build-${ABI}-${CTARGET}-$1" -} - -do_compile_test() { - local ret save_cflags=${CFLAGS} - CFLAGS+=" $1" - shift - - pushd "${T}" >/dev/null - - rm -f glibc-test* - printf '%b' "$*" > glibc-test.c - - # We assume CC is already set up. - nonfatal emake glibc-test - ret=$? - - popd >/dev/null - - CFLAGS=${save_cflags} - return ${ret} -} - -do_run_test() { - local ret - - if [[ ${MERGE_TYPE} == "binary" ]] ; then - # ignore build failures when installing a binary package #324685 - do_compile_test "" "$@" 2>/dev/null || return 0 - else - if ! do_compile_test "" "$@" ; then - ewarn "Simple build failed ... assuming this is desired #324685" - return 0 - fi - fi - - pushd "${T}" >/dev/null - - ./glibc-test - ret=$? - rm -f glibc-test* - - popd >/dev/null - - return ${ret} -} - -setup_target_flags() { - # This largely mucks with compiler flags. None of which should matter - # when building up just the headers. - just_headers && return 0 - - case $(tc-arch) in - x86) - # -march needed for #185404 #199334 - # TODO: When creating the first glibc cross-compile, this test will - # always fail as it does a full link which in turn requires glibc. - # Probably also applies when changing multilib profile settings (e.g. - # enabling x86 when the profile was amd64-only previously). - # We could change main to _start and pass -nostdlib here so that we - # only test the gcc code compilation. Or we could do a compile and - # then look for the symbol via scanelf. - if ! do_compile_test "" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - filter-flags '-march=*' - export CFLAGS="-march=${t} ${CFLAGS}" - einfo "Auto adding -march=${t} to CFLAGS #185404" - fi - # For compatibility with older binaries at slight performance cost. - use stack-realign && export CFLAGS+=" -mstackrealign" - ;; - amd64) - # -march needed for #185404 #199334 - # TODO: See cross-compile issues listed above for x86. - if [[ ${ABI} == x86 ]]; then - if ! do_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n'; then - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - # Normally the target is x86_64-xxx, so turn that into the -march that - # gcc actually accepts. #528708 - [[ ${t} == "x86_64" ]] && t="x86-64" - filter-flags '-march=*' - # ugly, ugly, ugly. ugly. - CFLAGS_x86=$(CFLAGS=${CFLAGS_x86} filter-flags '-march=*'; echo "${CFLAGS}") - export CFLAGS_x86="${CFLAGS_x86} -march=${t}" - einfo "Auto adding -march=${t} to CFLAGS_x86 #185404 (ABI=${ABI})" - fi - # For compatibility with older binaries at slight performance cost. - use stack-realign && export CFLAGS_x86+=" -mstackrealign" - - # Workaround for bug #823780. - # Need to save/restore CC because earlier on, we stuff it full of CFLAGS, and tc-getCPP doesn't like that. - CC_mangled=${CC} - CC=${glibc__GLIBC_CC} - if tc-is-gcc && (($(gcc-major-version) == 11)) && (($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then - export CFLAGS_x86="${CFLAGS_x86} -mno-avx512f" - einfo "Auto adding -mno-avx512f to CFLAGS_x86 for buggy GCC version (bug #823780) (ABI=${ABI})" - fi - CC=${CC_mangled} - fi - ;; - mips) - # The mips abi cannot support the GNU style hashes. #233233 - filter-ldflags -Wl,--hash-style=gnu -Wl,--hash-style=both - ;; - ppc|ppc64) - # Many arch-specific implementations do not work on ppc with - # cache-block not equal to 128 bytes. This breaks memset: - # https://sourceware.org/PR26522 - # https://bugs.gentoo.org/737996 - # Use default -mcpu=. For ppc it means non-multiarch setup. - filter-flags '-mcpu=*' - ;; - sparc) - # Both sparc and sparc64 can use -fcall-used-g6. -g7 is bad, though. - filter-flags "-fcall-used-g7" - append-flags "-fcall-used-g6" - - local cpu - case ${CTARGET} in - sparc64-*) - cpu="sparc64" - case $(get-flag mcpu) in - v9) - # We need to force at least v9a because the base build doesn't - # work with just v9. - # https://sourceware.org/bugzilla/show_bug.cgi?id=19477 - append-flags "-Wa,-xarch=v9a" - ;; - esac - ;; - sparc-*) - case $(get-flag mcpu) in - v8|supersparc|hypersparc|leon|leon3) - cpu="sparcv8" - ;; - *) - cpu="sparcv9" - ;; - esac - ;; - esac - [[ -n ${cpu} ]] && CTARGET_OPT="${cpu}-${CTARGET#*-}" - ;; - esac -} - -setup_flags() { - # Make sure host make.conf doesn't pollute us - if is_crosscompile || tc-is-cross-compiler ; then - CHOST=${CTARGET} strip-unsupported-flags - fi - - # Store our CFLAGS because it's changed depending on which CTARGET - # we are building when pulling glibc on a multilib profile - CFLAGS_BASE=${CFLAGS_BASE-${CFLAGS}} - CFLAGS=${CFLAGS_BASE} - CXXFLAGS_BASE=${CXXFLAGS_BASE-${CXXFLAGS}} - CXXFLAGS=${CXXFLAGS_BASE} - ASFLAGS_BASE=${ASFLAGS_BASE-${ASFLAGS}} - ASFLAGS=${ASFLAGS_BASE} - - # Allow users to explicitly avoid flag sanitization via - # USE=custom-cflags. - if ! use custom-cflags; then - # Over-zealous CFLAGS can often cause problems. What may work for one - # person may not work for another. To avoid a large influx of bugs - # relating to failed builds, we strip most CFLAGS out to ensure as few - # problems as possible. - strip-flags - # Lock glibc at -O2; we want to be conservative here. - filter-flags '-O?' - append-flags -O2 - fi - - strip-unsupported-flags - filter-lto - filter-flags -m32 -m64 '-mabi=*' - - # glibc aborts if rpath is set by LDFLAGS - filter-ldflags '-Wl,-rpath=*' - - # ld can't use -r & --relax at the same time, bug #788901 - # https://sourceware.org/PR27837 - filter-ldflags '-Wl,--relax' - - # Flag added for cross-prefix, but causes ldconfig to segfault. Not needed - # anyway because glibc already handles this by itself. - filter-ldflags '-Wl,--dynamic-linker=*' - - # some weird software relies on sysv hashes in glibc, bug 863863, bug 864100 - # we have to do that here already so mips can filter it out again :P - if use hash-sysv-compat ; then - append-ldflags '-Wl,--hash-style=both' - fi - - # #492892 - filter-flags -frecord-gcc-switches - - # #898098 - filter-flags -fno-builtin - - # #829583 - filter-lfs-flags - - unset CBUILD_OPT CTARGET_OPT - if use multilib ; then - CTARGET_OPT=$(get_abi_CTARGET) - [[ -z ${CTARGET_OPT} ]] && CTARGET_OPT=$(get_abi_CHOST) - fi - - setup_target_flags - - if [[ -n ${CTARGET_OPT} && ${CBUILD} == ${CHOST} ]] && ! is_crosscompile; then - CBUILD_OPT=${CTARGET_OPT} - fi - - # glibc's headers disallow -O0 and fail at build time: - # include/libc-symbols.h:75:3: #error "glibc cannot be compiled without optimization" - # https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F - replace-flags -O0 -O1 - - # glibc handles this internally already where it's appropriate; - # can't always have SSP when we're the ones setting it up, etc - filter-flags '-fstack-protector*' - - # Similar issues as with SSP. Can't inject yourself that early. - filter-flags '-fsanitize=*' - - # See end of bug #830454; we handle this via USE=cet - filter-flags '-fcf-protection=*' - - # When bootstrapping, we may have a situation where - # CET-enabled gcc from seed is used to build CET-disabled - # glibc. As such, gcc implicitly enables CET if no - # -fcf-protection flag is passed. For a typical package it - # should not be a problem, but for glibc it matters as it is - # dealing with CET in ld.so. So if CET is supposed to be - # disabled for glibc, be explicit about it. - if ! use cet; then - if use amd64 || use x86; then - append-flags '-fcf-protection=none' - elif use arm64; then - append-flags '-mbranch-protection=none' - fi - fi -} - -use_multiarch() { - # Allow user to disable runtime arch detection in multilib. - use multiarch || return 1 - # Make sure binutils is new enough to support indirect functions, - # #336792. This funky sed supports gold and bfd linkers. - local bver nver - bver=$($(tc-getLD ${CTARGET}) -v | sed -n -r '1{s:[^0-9]*::;s:^([0-9.]*).*:\1:;p}') - case $(tc-arch ${CTARGET}) in - amd64|x86) nver="2.20" ;; - arm) nver="2.22" ;; - hppa) nver="2.23" ;; - ppc|ppc64) nver="2.20" ;; - # ifunc support was added in 2.23, but glibc also needs - # machinemode which is in 2.24. - s390) nver="2.24" ;; - sparc) nver="2.21" ;; - *) return 1 ;; - esac - ver_test ${bver} -ge ${nver} -} - -# Setup toolchain variables that had historically been defined in the -# profiles for these archs. -setup_env() { - # silly users - unset LD_RUN_PATH - unset LD_ASSUME_KERNEL - - if is_crosscompile || tc-is-cross-compiler ; then - multilib_env ${CTARGET_OPT:-${CTARGET}} - - if ! use multilib ; then - MULTILIB_ABIS=${DEFAULT_ABI} - else - MULTILIB_ABIS=${MULTILIB_ABIS:-${DEFAULT_ABI}} - fi - - # If the user has CFLAGS_ in their make.conf, use that, - # and fall back on CFLAGS. - local VAR=CFLAGS_${CTARGET//[-.]/_} - CFLAGS=${!VAR-${CFLAGS}} - einfo " $(printf '%15s' 'Manual CFLAGS:') ${CFLAGS}" - fi - - setup_flags - - export ABI=${ABI:-${DEFAULT_ABI:-default}} - - if just_headers ; then - # Avoid mixing host's CC and target's CFLAGS_${ABI}: - # At this bootstrap stage we have only binutils for - # target but not compiler yet. - einfo "Skip CC ABI injection. We can't use (cross-)compiler yet." - return 0 - fi - - # Glibc does not work with gold (for various reasons) #269274. - tc-ld-disable-gold - - if use doc ; then - export MAKEINFO=makeinfo - else - export MAKEINFO=/dev/null - fi - - # Reset CC and CXX to the value at start of emerge - export CC=${glibc__ORIG_CC:-${CC:-$(tc-getCC ${CTARGET})}} - export CXX=${glibc__ORIG_CXX:-${CXX:-$(tc-getCXX ${CTARGET})}} - export CPP=${glibc__ORIG_CPP:-${CPP:-$(tc-getCPP ${CTARGET})}} - - # and make sure glibc__ORIG_CC and glibc__ORIG_CXX is defined now. - export glibc__ORIG_CC=${CC} - export glibc__ORIG_CXX=${CXX} - export glibc__ORIG_CPP=${CPP} - - if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; then - export glibc__force_gcc=yes - # once this is toggled on, it needs to stay on, since with CPP manipulated - # tc-is-clang does not work correctly anymore... - fi - - if [[ ${glibc__force_gcc} == "yes" ]] ; then - # If we are running in an otherwise clang/llvm environment, we need to - # recover the proper gcc and binutils settings here, at least until glibc - # is finally building with clang. So let's override everything that is - # set in the clang profiles. - # Want to shoot yourself into the foot? Set USE=custom-cflags, that's always - # a good start into that direction. - # Also, if you're crosscompiling, let's assume you know what you are doing. - # Hopefully. - # Last, we need the settings of the *build* environment, not of the - # target environment... - - local current_binutils_path=$(env ROOT="${BROOT}" binutils-config -B) - local current_gcc_path=$(env ROOT="${BROOT}" gcc-config -B) - einfo "Overriding clang configuration, since it won't work here" - - export CC="${current_gcc_path}/gcc" - export CPP="${current_gcc_path}/cpp" - export CXX="${current_gcc_path}/g++" - export LD="${current_binutils_path}/ld.bfd" - export AR="${current_binutils_path}/ar" - export AS="${current_binutils_path}/as" - export NM="${current_binutils_path}/nm" - export STRIP="${current_binutils_path}/strip" - export RANLIB="${current_binutils_path}/ranlib" - export OBJCOPY="${current_binutils_path}/objcopy" - export STRINGS="${current_binutils_path}/strings" - export OBJDUMP="${current_binutils_path}/objdump" - export READELF="${current_binutils_path}/readelf" - export ADDR2LINE="${current_binutils_path}/addr2line" - - # do we need to also do flags munging here? yes! at least... - filter-flags '-fuse-ld=*' - filter-flags '-D_FORTIFY_SOURCE=*' - - else - - # this is the "normal" case - - export CC="$(tc-getCC ${CTARGET})" - export CXX="$(tc-getCXX ${CTARGET})" - export CPP="$(tc-getCPP ${CTARGET})" - - # Always use tuple-prefixed toolchain. For non-native ABI glibc's configure - # can't detect them automatically due to ${CHOST} mismatch and fallbacks - # to unprefixed tools. Similar to multilib.eclass:multilib_toolchain_setup(). - export NM="$(tc-getNM ${CTARGET})" - export READELF="$(tc-getREADELF ${CTARGET})" - - fi - - # We need to export CFLAGS with abi information in them because glibc's - # configure script checks CFLAGS for some targets (like mips). Keep - # around the original clean value to avoid appending multiple ABIs on - # top of each other. (Why does the comment talk about CFLAGS if the code - # acts on CC?) - export glibc__GLIBC_CC=${CC} - export glibc__GLIBC_CXX=${CXX} - export glibc__GLIBC_CPP=${CPP} - - export glibc__abi_CFLAGS="$(get_abi_CFLAGS)" - - # CFLAGS can contain ABI-specific flags like -mfpu=neon, see bug #657760 - # To build .S (assembly) files with the same ABI-specific flags - # upstream currently recommends adding CFLAGS to CC/CXX: - # https://sourceware.org/PR23273 - # Note: Passing CFLAGS via CPPFLAGS overrides glibc's arch-specific CFLAGS - # and breaks multiarch support. See 659030#c3 for an example. - # The glibc configure script doesn't properly use LDFLAGS all the time. - export CC="${glibc__GLIBC_CC} ${glibc__abi_CFLAGS} ${CFLAGS} ${LDFLAGS}" - - # Some of the tests are written in C++, so we need to force our multlib abis in, bug 623548 - export CXX="${glibc__GLIBC_CXX} ${glibc__abi_CFLAGS} ${CFLAGS}" - - export CPP="${glibc__GLIBC_CPP} ${glibc__abi_CFLAGS}" - - if is_crosscompile; then - # Assume worst-case bootstrap: glibc is built for the first time - # with ${CTARGET}-g++ not available yet. We avoid - # building auxiliary programs that require C++: bug #683074 - # It should not affect final result. - export libc_cv_cxx_link_ok=no - # The line above has the same effect. We set CXX explicitly - # to make build logs less confusing. - export CXX= - fi -} - -foreach_abi() { - setup_env - - local ret=0 - local abilist="" - if use multilib ; then - abilist=$(get_install_abis) - else - abilist=${DEFAULT_ABI} - fi - local -x ABI - for ABI in ${abilist:-default} ; do - setup_env - einfo "Running $1 for ABI ${ABI}" - $1 - : $(( ret |= $? )) - done - return ${ret} -} - -glibc_banner() { - local b="Gentoo ${PVR}" - [[ -n ${PATCH_VER} ]] && ! use vanilla && b+=" (patchset ${PATCH_VER})" - echo "${b}" -} - -# The following Kernel version handling functions are mostly copied from portage -# source. It's better not to use linux-info.eclass here since a) it adds too -# much magic, see bug 326693 for some of the arguments, and b) some of the -# functions are just not provided. - -g_get_running_KV() { - uname -r - return $? -} - -g_KV_major() { - [[ -z $1 ]] && return 1 - local KV=$@ - echo "${KV%%.*}" -} - -g_KV_minor() { - [[ -z $1 ]] && return 1 - local KV=$@ - KV=${KV#*.} - echo "${KV%%.*}" -} - -g_KV_micro() { - [[ -z $1 ]] && return 1 - local KV=$@ - KV=${KV#*.*.} - echo "${KV%%[^[:digit:]]*}" -} - -g_KV_to_int() { - [[ -z $1 ]] && return 1 - local KV_MAJOR=$(g_KV_major "$1") - local KV_MINOR=$(g_KV_minor "$1") - local KV_MICRO=$(g_KV_micro "$1") - local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO )) - - # We make version 2.2.0 the minimum version we will handle as - # a sanity check ... if its less, we fail ... - if [[ ${KV_int} -ge 131584 ]] ; then - echo "${KV_int}" - return 0 - fi - return 1 -} - -g_int_to_KV() { - local version=$1 major minor micro - major=$((version / 65536)) - minor=$(((version % 65536) / 256)) - micro=$((version % 256)) - echo ${major}.${minor}.${micro} -} - -eend_KV() { - [[ $(g_KV_to_int $1) -ge $(g_KV_to_int $2) ]] - eend $? -} - -get_kheader_version() { - printf '#include \nLINUX_VERSION_CODE\n' | \ - $(tc-getCPP ${CTARGET}) -I "$(build_eprefix)$(alt_build_headers)" - | \ - tail -n 1 -} - -# We collect all sanity checks here. Consistency is not guranteed between -# pkg_ and src_ phases, so we call this function both in pkg_pretend and in -# src_unpack. -sanity_prechecks() { - # Prevent native builds from downgrading - if [[ ${MERGE_TYPE} != "buildonly" ]] && \ - [[ -z ${ROOT} ]] && \ - [[ ${CBUILD} == ${CHOST} ]] && \ - [[ ${CHOST} == ${CTARGET} ]] ; then - - # The high rev # is to allow people to downgrade between -r# - # versions. We want to block 2.20->2.19, but 2.20-r3->2.20-r2 - # should be fine. Hopefully we never actually use a r# this - # high. - if has_version ">${CATEGORY}/${P}-r10000" ; then - eerror "Sanity check to keep you from breaking your system:" - eerror " Downgrading glibc is not supported and a sure way to destruction." - [[ ${I_ALLOW_TO_BREAK_MY_SYSTEM} = yes ]] || die "Aborting to save your system." - fi - - if ! do_run_test '#include \n#include \nint main(){return syscall(1000)!=-1;}\n' ; then - eerror "Your old kernel is broken. You need to update it to a newer" - eerror "version as syscall() will break. See bug 279260." - die "Old and broken kernel." - fi - fi - - if [[ ${CTARGET} == i386-* ]] ; then - eerror "i386 CHOSTs are no longer supported." - eerror "Chances are you don't actually want/need i386." - eerror "Please read https://www.gentoo.org/doc/en/change-chost.xml" - die "Please fix your CHOST" - fi - - if [[ -e /proc/xen ]] && [[ $(tc-arch) == "x86" ]] && ! is-flag -mno-tls-direct-seg-refs ; then - ewarn "You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS." - ewarn "This will result in a 50% performance penalty when running with a 32bit" - ewarn "hypervisor, which is probably not what you want." - fi - - # ABI-specific checks follow here. Hey, we have a lot more specific conditions that - # we test for... - if ! is_crosscompile ; then - if use amd64 && use multilib && [[ ${MERGE_TYPE} != "binary" ]] ; then - ebegin "Checking that IA32 emulation is enabled in the running kernel" - echo 'int main(){return 0;}' > "${T}/check-ia32-emulation.c" - local STAT - if ${CC-${CHOST}-gcc} ${CFLAGS_x86} "${T}/check-ia32-emulation.c" -o "${T}/check-ia32-emulation.elf32"; then - "${T}/check-ia32-emulation.elf32" - STAT=$? - else - # Don't fail here to allow single->multi ABI switch - # or recover from breakage like bug #646424 - ewarn "Failed to compile the ABI test. Broken host glibc?" - STAT=0 - fi - rm -f "${T}/check-ia32-emulation.elf32" - eend $STAT - [[ $STAT -eq 0 ]] || die "CONFIG_IA32_EMULATION must be enabled in the kernel to compile a multilib glibc." - fi - - fi - - # When we actually have to compile something... - if ! just_headers && [[ ${MERGE_TYPE} != "binary" ]] ; then - if [[ -d "${ESYSROOT}"/usr/lib/include ]] ; then - # bug #833620, bug #643302 - eerror "Found ${ESYSROOT}/usr/lib/include directory!" - eerror "This is known to break glibc's build." - eerror "Please backup its contents then remove the directory." - die "Found directory (${ESYSROOT}/usr/lib/include) which will break build (bug #833620)!" - fi - - if [[ ${CTARGET} == *-linux* ]] ; then - local run_kv build_kv want_kv - - run_kv=$(g_get_running_KV) - build_kv=$(g_int_to_KV $(get_kheader_version)) - want_kv=${MIN_KERN_VER} - - if ! is_crosscompile && ! tc-is-cross-compiler ; then - # Building fails on an non-supporting kernel - ebegin "Checking running kernel version (${run_kv} >= ${want_kv})" - if ! eend_KV ${run_kv} ${want_kv} ; then - echo - eerror "You need a kernel of at least ${want_kv}!" - die "Kernel version too low!" - fi - fi - - # Do not run this check for pkg_pretend, just pkg_setup and friends (if we ever get used there). - # It's plausible (seen it in the wild) that Portage will (correctly) schedule a linux-headers - # upgrade before glibc, but because pkg_pretend gets run before any packages are merged at all (not - # just glibc), the whole emerge gets aborted without a good reason. We probably don't - # need to run this check at all given we have a dependency on the right headers, - # but let's leave it as-is for now. - if [[ ${EBUILD_PHASE_FUNC} != pkg_pretend ]] ; then - ebegin "Checking linux-headers version (${build_kv} >= ${want_kv})" - if ! eend_KV ${build_kv} ${want_kv} ; then - echo - eerror "You need linux-headers of at least ${want_kv}!" - die "linux-headers version too low!" - fi - fi - fi - fi -} - -upgrade_warning() { - is_crosscompile && return - - if [[ ${MERGE_TYPE} != buildonly && -n ${REPLACING_VERSIONS} && -z ${ROOT} ]]; then - local oldv newv=$(ver_cut 1-2 ${PV}) - for oldv in ${REPLACING_VERSIONS}; do - if ver_test ${oldv} -lt ${newv}; then - ewarn "After upgrading glibc, please restart all running processes." - ewarn "Be sure to include init (telinit u) or systemd (systemctl daemon-reexec)." - ewarn "Alternatively, reboot your system." - ewarn "(See bug #660556, bug #741116, bug #823756, etc)" - break - fi - done - fi -} - -# -# the phases -# - -# pkg_pretend - -pkg_pretend() { - upgrade_warning -} - -# pkg_setup - -pkg_setup() { - # see bug 682570 - [[ -z ${BOOTSTRAP_RAP} ]] && python-any-r1_pkg_setup -} - -# src_unpack - -src_unpack() { - setup_env - - einfo "Checking general environment sanity." - sanity_prechecks - - use multilib-bootstrap && unpack gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz - - if [[ ${PV} == 9999* ]] ; then - EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/glibc-patches.git" - EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git - git-r3_src_unpack - mv patches-git/9999 patches || die - - EGIT_REPO_URI="https://sourceware.org/git/glibc.git" - EGIT_CHECKOUT_DIR=${S} - git-r3_src_unpack - else - unpack ${P}.tar.xz - - cd "${WORKDIR}" || die - unpack glibc-${PV}-patches-${PATCH_VER}.tar.xz - fi - - cd "${WORKDIR}" || die - use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz -} - -# src_prepare - -src_prepare() { - local patchsetname - if ! use vanilla ; then - if [[ ${PV} == 9999* ]] ; then - patchsetname="from git master" - else - patchsetname="${PV}-${PATCH_VER}" - fi - einfo "Applying Gentoo Glibc patchset ${patchsetname}" - eapply "${WORKDIR}"/patches - einfo "Done." - fi - - default - - gnuconfig_update - - cd "${WORKDIR}" || die - find . -name configure -exec touch {} + - - # Fix permissions on some of the scripts. - chmod u+x "${S}"/scripts/*.sh - - cd "${S}" || die -} - -# src_configure - -glibc_do_configure() { - dump_build_environment - - local myconf=() - - # Use '=strong' instead of '=all' to protect only functions - # worth protecting from stack smashes. - myconf+=( --enable-stack-protector=$(usex ssp strong no) ) - - # Keep a whitelist of targets supporing IFUNC. glibc's ./configure - # is not robust enough to detect proper support: - # https://bugs.gentoo.org/641216 - # https://sourceware.org/PR22634#c0 - case $(tc-arch ${CTARGET}) in - # Keep whitelist of targets where autodetection mostly works. - amd64|x86|sparc|ppc|ppc64|arm|arm64|s390|riscv|loong) ;; - # Blacklist everywhere else - *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;; - esac - - case ${ABI}-${CTARGET} in - amd64-x86_64-*|x32-x86_64-*-*-gnux32) myconf+=( $(use_enable cet) ) ;; - *) ;; - esac - - [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp ) - - myconf+=( --enable-kernel=${MIN_KERN_VER} ) - - # Since SELinux support is only required for nscd, only enable it if: - # 1. USE selinux - # 2. only for the primary ABI on multilib systems - # 3. Not a crosscompile - if ! is_crosscompile && use selinux ; then - if use multilib ; then - if is_final_abi ; then - myconf+=( --with-selinux ) - else - myconf+=( --without-selinux ) - fi - else - myconf+=( --with-selinux ) - fi - else - myconf+=( --without-selinux ) - fi - - # Force a few tests where we always know the answer but - # configure is incapable of finding it. - if is_crosscompile ; then - export \ - libc_cv_c_cleanup=yes \ - libc_cv_forced_unwind=yes - fi - - myconf+=( - --disable-werror - --enable-bind-now - --enable-fortify-source - --build=${CBUILD_OPT:-${CBUILD}} - --host=${CTARGET_OPT:-${CTARGET}} - $(use_enable profile) - $(use_with gd) - --with-headers=$(build_eprefix)$(alt_build_headers) - --prefix="$(host_eprefix)/usr" - --sysconfdir="$(host_eprefix)/etc" - --localstatedir="$(host_eprefix)/var" - --libdir='$(prefix)'/$(get_libdir) - --mandir='$(prefix)'/share/man - --infodir='$(prefix)'/share/info - --libexecdir='$(libdir)'/misc/glibc - --with-bugurl=https://bugs.gentoo.org/ - --with-pkgversion="$(glibc_banner)" - $(use_multiarch || echo --disable-multi-arch) - $(use_enable systemtap) - $(use_enable nscd) - - # /usr/bin/mtrace has a Perl shebang. Gentoo Prefix QA checks fail if - # Perl hasn't been installed inside the prefix yet and configure picks - # up a Perl from outside the prefix instead. configure will fail to - # execute Perl during configure if we're cross-compiling a prefix, but - # it will just disable mtrace in that case. - # Note: mtrace is needed by the test suite. - ac_cv_path_PERL="$(usex perl "${EPREFIX}"/usr/bin/perl $(usex test "${EPREFIX}"/usr/bin/perl $(usex doc "${EPREFIX}"/usr/bin/perl no)))" - - # locale data is arch-independent - # https://bugs.gentoo.org/753740 - libc_cv_complocaledir='${exec_prefix}/lib/locale' - - # On aarch64 there is no way to override -mcpu=native, and if - # the current cpu does not support SVE configure fails. - # Let's boldly assume our toolchain can always build SVE instructions. - libc_cv_aarch64_sve_asm=yes - - ${EXTRA_ECONF} - ) - - # We rely on sys-libs/timezone-data for timezone tools normally. - myconf+=( $(use_enable vanilla timezone-tools) ) - - # These libs don't have configure flags. - ac_cv_lib_audit_audit_log_user_avc_message=$(usex audit || echo no) - ac_cv_lib_cap_cap_init=$(usex caps || echo no) - - # There is no configure option for this and we need to export it - # since the glibc build will re-run configure on itself - export libc_cv_rootsbindir="$(host_eprefix)/sbin" - export libc_cv_slibdir="$(host_eprefix)/$(get_libdir)" - - local builddir=$(builddir nptl) - mkdir -p "${builddir}" - cd "${builddir}" - set -- "${S}"/configure "${myconf[@]}" - echo "$@" - "$@" || die "failed to configure glibc" - - # If we're trying to migrate between ABI sets, we need - # to lie and use a local copy of gcc. Like if the system - # is built with MULTILIB_ABIS="amd64 x86" but we want to - # add x32 to it, gcc/glibc don't yet support x32. - # - if [[ -n ${GCC_BOOTSTRAP_VER} ]] && use multilib-bootstrap ; then - echo 'int main(void){}' > "${T}"/test.c || die - if ! $(tc-getCC ${CTARGET}) ${CFLAGS} ${LDFLAGS} "${T}"/test.c -Wl,-emain -lgcc 2>/dev/null ; then - sed -i -e '/^CC = /s:$: -B$(objdir)/../'"gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}/${ABI}:" config.make || die - fi - fi -} - -glibc_headers_configure() { - export ABI=default - - local builddir=$(builddir "headers") - mkdir -p "${builddir}" - cd "${builddir}" - - # if we don't have a compiler yet, we can't really test it now ... - # hopefully they don't affect header generation, so let's hope for - # the best here ... - local v vars=( - ac_cv_header_cpuid_h=yes - libc_cv_{386,390,alpha,arm,hppa,mips,{powerpc,sparc}{,32,64},sh,x86_64}_tls=yes - libc_cv_asm_cfi_directives=yes - libc_cv_broken_visibility_attribute=no - libc_cv_c_cleanup=yes - libc_cv_compiler_powerpc64le_binary128_ok=yes - libc_cv_forced_unwind=yes - libc_cv_gcc___thread=yes - libc_cv_mlong_double_128=yes - libc_cv_mlong_double_128ibm=yes - libc_cv_ppc_machine=yes - libc_cv_ppc_rel16=yes - libc_cv_predef_fortify_source=no - libc_cv_target_power8_ok=yes - libc_cv_visibility_attribute=yes - libc_cv_z_combreloc=yes - libc_cv_z_execstack=yes - libc_cv_z_initfirst=yes - libc_cv_z_nodelete=yes - libc_cv_z_nodlopen=yes - libc_cv_z_relro=yes - libc_mips_abi=${ABI} - libc_mips_float=$([[ $(tc-is-softfloat) == "yes" ]] && echo soft || echo hard) - # These libs don't have configure flags. - ac_cv_lib_audit_audit_log_user_avc_message=no - ac_cv_lib_cap_cap_init=no - ) - - einfo "Forcing cached settings:" - for v in "${vars[@]}" ; do - einfo " ${v}" - export ${v} - done - - local headers_only_arch_CPPFLAGS=() - - # Blow away some random CC settings that screw things up. #550192 - if [[ -d ${S}/sysdeps/mips ]]; then - pushd "${S}"/sysdeps/mips >/dev/null - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=32:' mips32/Makefile mips64/n32/Makefile || die - sed -i -e '/^CC +=/s:=.*:= -D_MIPS_SZPTR=64:' mips64/n64/Makefile || die - - # Force the mips ABI to the default. This is OK because the set of - # installed headers in this phase is the same between the 3 ABIs. - # If this ever changes, this hack will break, but that's unlikely - # as glibc discourages that behavior. - # https://crbug.com/647033 - sed -i -e 's:abiflag=.*:abiflag=_ABIO32:' preconfigure || die - - popd >/dev/null - fi - - local myconf=() - - case ${CTARGET} in - aarch64*) - # The configure checks fail during cross-build, so disable here - # for headers-only - myconf+=( - --disable-mathvec - ) ;; - riscv*) - # RISC-V interrogates the compiler to determine which target to - # build. If building the headers then we don't strictly need a - # RISC-V compiler, so the built-in definitions that are provided - # along with all RISC-V compiler might not exist. This causes - # glibc's RISC-V preconfigure script to blow up. Since we're just - # building the headers any value will actually work here, so just - # pick the standard one (rv64g/lp64d) to make the build scripts - # happy for now -- the headers are all the same anyway so it - # doesn't matter. - headers_only_arch_CPPFLAGS+=( - -D__riscv_xlen=64 - -D__riscv_flen=64 - -D__riscv_float_abi_double=1 - -D__riscv_atomic=1 - ) ;; - esac - - myconf+=( - --disable-sanity-checks - --enable-hacker-mode - --disable-werror - --enable-bind-now - --build=${CBUILD_OPT:-${CBUILD}} - --host=${CTARGET_OPT:-${CTARGET}} - --with-headers=$(build_eprefix)$(alt_build_headers) - --prefix="$(host_eprefix)/usr" - ${EXTRA_ECONF} - ) - - # Nothing is compiled here which would affect the headers for the target. - # So forcing CC/CFLAGS is sane. - local headers_only_CC=$(tc-getBUILD_CC) - local headers_only_CFLAGS="-O1 -pipe" - local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE ${headers_only_arch_CPPFLAGS[*]}" - local headers_only_LDFLAGS="" - set -- "${S}"/configure "${myconf[@]}" - echo \ - "CC=${headers_only_CC}" \ - "CFLAGS=${headers_only_CFLAGS}" \ - "CPPFLAGS=${headers_only_CPPFLAGS}" \ - "LDFLAGS=${headers_only_LDFLAGS}" \ - "$@" - CC=${headers_only_CC} \ - CFLAGS=${headers_only_CFLAGS} \ - CPPFLAGS=${headers_only_CPPFLAGS} \ - LDFLAGS="" \ - "$@" || die "failed to configure glibc" -} - -do_src_configure() { - if just_headers ; then - glibc_headers_configure - else - glibc_do_configure nptl - fi -} - -src_configure() { - foreach_abi do_src_configure -} - -# src_compile - -do_src_compile() { - emake -C "$(builddir nptl)" -} - -src_compile() { - if just_headers ; then - return - fi - - foreach_abi do_src_compile -} - -# src_test - -glibc_src_test() { - cd "$(builddir nptl)" - - local myxfailparams="" - if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then - local virt=$(systemd-detect-virt 2>/dev/null) - if [[ ${virt} == systemd-nspawn ]] ; then - ewarn "Skipping extra tests because in systemd-nspawn container" - XFAIL_TEST_LIST+=( "${XFAIL_NSPAWN_TEST_LIST[@]}" ) - fi - - for myt in ${XFAIL_TEST_LIST[@]} ; do - myxfailparams+="test-xfail-${myt}=yes " - done - fi - - # sandbox does not understand unshare() and prevents - # writes to /proc/, which makes many tests fail - - # we give the tests a bit more time to avoid spurious - # bug reports on slow arches - - SANDBOX_ON=0 LD_PRELOAD= TIMEOUTFACTOR=16 emake ${myxfailparams} check -} - -src_test() { - if just_headers ; then - return - fi - - foreach_abi glibc_src_test || die "tests failed" -} - -# src_install - -run_locale_gen() { - # if the host locales.gen contains no entries, we'll install everything - local root="$1" - local inplace="" - - if [[ "${root}" == "--inplace-glibc" ]] ; then - inplace="--inplace-glibc" - root="$2" - fi - - local locale_list="${root%/}/etc/locale.gen" - - pushd "${ED}"/$(get_libdir) >/dev/null - - if [[ -z $(locale-gen --list --config "${locale_list}") ]] ; then - [[ -z ${inplace} ]] && ewarn "Generating all locales; edit /etc/locale.gen to save time/space" - locale_list="${root%/}/usr/share/i18n/SUPPORTED" - fi - - # bug 736794: we need to be careful with the parallelization... the number of - # processors saved in the environment of a binary package may differ strongly - # from the number of processes available during postinst - local mygenjobs="$(makeopts_jobs)" - if [[ "${EMERGE_FROM}" == "binary" ]] ; then - mygenjobs="$(nproc)" - fi - - set -- locale-gen ${inplace} --jobs "${mygenjobs}" --config "${locale_list}" \ - --destdir "${root}" - echo "$@" - "$@" - - popd >/dev/null -} - -glibc_do_src_install() { - local builddir=$(builddir nptl) - cd "${builddir}" - - emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install - - # This version (2.26) provides some compatibility libraries for the NIS/NIS+ support - # which come without headers etc. Only needed for binary packages since the - # external net-libs/libnsl has increased soversion. Keep only versioned libraries. - find "${D}" -name "libnsl.a" -delete - find "${D}" -name "libnsl.so" -delete - - # Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need - # to infer upstream version: - # '#define VERSION "2.26.90"' -> '2.26.90' - local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h) - - # Avoid stripping binaries not targeted by ${CHOST}. Or else - # ${CHOST}-strip would break binaries build for ${CTARGET}. - is_crosscompile && dostrip -x / - - # gdb thread introspection relies on local libpthreads symbols. stripping breaks it - # See Note [Disable automatic stripping] - dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.so - # valgrind requires knowledge about ld.so symbols. - dostrip -x $(alt_libdir)/ld-*.so* - - if [[ -e ${ED}/$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then - # Move versioned .a file out of libdir to evade portage QA checks - # instead of using gen_usr_ldscript(). We fix ldscript as: - # "GROUP ( /usr/lib64/libm-.a ..." -> "GROUP ( /usr/lib64/glibc-/libm-.a ..." - sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"/$(alt_usrlibdir)/libm.a || die - dodir $(alt_usrlibdir)/${P} - mv "${ED}"/$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"/$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die - fi - - # We configure toolchains for standalone prefix systems with a sysroot, - # which is prepended to paths in ld scripts, so strip the prefix from these. - # Before: GROUP ( /foo/lib64/libc.so.6 /foo/usr/lib64/libc_nonshared.a AS_NEEDED ( /foo/lib64/ld-linux-x86-64.so.2 ) ) - # After: GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) - if [[ -n $(host_eprefix) ]] ; then - local file - grep -lZIF "ld script" "${ED}/$(alt_usrlibdir)"/lib*.{a,so} 2>/dev/null | while read -rd '' file ; do - sed -i "s|$(host_eprefix)/|/|g" "${file}" || die - done - fi - - # We'll take care of the cache ourselves - rm -f "${ED}"/etc/ld.so.cache - - # Everything past this point just needs to be done once ... - is_final_abi || return 0 - - # Make sure the non-native interp can be found on multilib systems even - # if the main library set isn't installed into the right place. Maybe - # we should query the active gcc for info instead of hardcoding it ? - local i ldso_abi ldso_name - local ldso_abi_list=( - # x86 - amd64 /lib64/ld-linux-x86-64.so.2 - x32 /libx32/ld-linux-x32.so.2 - x86 /lib/ld-linux.so.2 - # mips - o32 /lib/ld.so.1 - n32 /lib32/ld.so.1 - n64 /lib64/ld.so.1 - # powerpc - ppc /lib/ld.so.1 - # riscv - ilp32d /lib/ld-linux-riscv32-ilp32d.so.1 - ilp32 /lib/ld-linux-riscv32-ilp32.so.1 - lp64d /lib/ld-linux-riscv64-lp64d.so.1 - lp64 /lib/ld-linux-riscv64-lp64.so.1 - # s390 - s390 /lib/ld.so.1 - s390x /lib/ld64.so.1 - # sparc - sparc32 /lib/ld-linux.so.2 - sparc64 /lib64/ld-linux.so.2 - ) - case $(tc-endian) in - little) - ldso_abi_list+=( - # arm - arm64 /lib/ld-linux-aarch64.so.1 - # ELFv2 (glibc does not support ELFv1 on LE) - ppc64 /lib64/ld64.so.2 - ) - ;; - big) - ldso_abi_list+=( - # arm - arm64 /lib/ld-linux-aarch64_be.so.1 - # ELFv1 (glibc does not support ELFv2 on BE) - ppc64 /lib64/ld64.so.1 - ) - ;; - esac - if [[ ${SYMLINK_LIB} == "yes" ]] && [[ ! -e ${ED}/$(alt_prefix)/lib ]] ; then - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) $(alt_prefix)/lib - fi - for (( i = 0; i < ${#ldso_abi_list[@]}; i += 2 )) ; do - ldso_abi=${ldso_abi_list[i]} - has ${ldso_abi} $(get_install_abis) || continue - - ldso_name="$(alt_prefix)${ldso_abi_list[i+1]}" - if [[ ! -L ${ED}/${ldso_name} && ! -e ${ED}/${ldso_name} ]] ; then - dosym ../$(get_abi_LIBDIR ${ldso_abi})/${ldso_name##*/} ${ldso_name} - fi - done - - # In the LSB 5.0 definition, someone had the excellent idea to "standardize" - # the runtime loader name, see also https://xkcd.com/927/ - # Normally, in Gentoo one should never come across executables that require this. - # However, binary commercial packages are known to adhere to weird practices. - # https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-AMD64/LSB-Core-AMD64.html#BASELIB - local lsb_ldso_name native_ldso_name lsb_ldso_abi - local lsb_ldso_abi_list=( - # x86 - amd64 ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3 - ) - for (( i = 0; i < ${#lsb_ldso_abi_list[@]}; i += 3 )) ; do - lsb_ldso_abi=${lsb_ldso_abi_list[i]} - native_ldso_name=${lsb_ldso_abi_list[i+1]} - lsb_ldso_name=${lsb_ldso_abi_list[i+2]} - has ${lsb_ldso_abi} $(get_install_abis) || continue - - if [[ ! -L ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} && ! -e ${ED}/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name} ]] ; then - dosym ${native_ldso_name} "$(alt_prefix)/$(get_abi_LIBDIR ${lsb_ldso_abi})/${lsb_ldso_name}" - fi - done - - # With devpts under Linux mounted properly, we do not need the pt_chown - # binary to be setuid. This is because the default owners/perms will be - # exactly what we want. - if ! use suid ; then - find "${ED}" -name pt_chown -exec chmod -s {} + - fi - - ################################################################# - # EVERYTHING AFTER THIS POINT IS FOR NATIVE GLIBC INSTALLS ONLY # - ################################################################# - - # Make sure we install some symlink hacks so that when we build - # a 2nd stage cross-compiler, gcc finds the target system - # headers correctly. See gcc/doc/gccinstall.info - if is_crosscompile ; then - # We need to make sure that /lib and /usr/lib always exists. - # gcc likes to use relative paths to get to its multilibs like - # /usr/lib/../lib64/. So while we don't install any files into - # /usr/lib/, we do need it to exist. - keepdir $(alt_prefix)/lib - keepdir $(alt_prefix)/usr/lib - - dosym usr/include $(alt_prefix)/sys-include - return 0 - fi - - # Files for Debian-style locale updating - dodir /usr/share/i18n - sed \ - -e "/^#/d" \ - -e "/SUPPORTED-LOCALES=/d" \ - -e "s: \\\\::g" -e "s:/: :g" \ - "${S}"/localedata/SUPPORTED > "${ED}"/usr/share/i18n/SUPPORTED \ - || die "generating /usr/share/i18n/SUPPORTED failed" - - cd "${S}" || die - - # Install misc network config files - insinto /etc - doins posix/gai.conf - - if use systemd ; then - doins "${WORKDIR}/glibc-systemd-${GLIBC_SYSTEMD_VER}/gentoo-config/nsswitch.conf" - else - doins nss/nsswitch.conf - fi - - # Gentoo-specific - newins "${FILESDIR}"/host.conf-1 host.conf - - if use nscd ; then - doins nscd/nscd.conf - - newinitd "$(prefixify_ro "${FILESDIR}"/nscd-1)" nscd - - local nscd_args=( - -e "s:@PIDFILE@:$(strings "${ED}"/usr/sbin/nscd | grep nscd.pid):" - ) - - sed -i "${nscd_args[@]}" "${ED}"/etc/init.d/nscd - - use systemd && systemd_dounit nscd/nscd.service - newtmpfiles nscd/nscd.tmpfiles nscd.conf - fi - - echo 'LDPATH="include ld.so.conf.d/*.conf"' > "${T}"/00glibc - doenvd "${T}"/00glibc - - for d in BUGS ChangeLog CONFORMANCE FAQ NEWS NOTES PROJECTS README* ; do - [[ -s ${d} ]] && dodoc ${d} - done - dodoc -r ChangeLog.old - - # Prevent overwriting of the /etc/localtime symlink. We'll handle the - # creation of the "factory" symlink in pkg_postinst(). - rm -f "${ED}"/etc/localtime - - # Generate all locales if this is a native build as locale generation - if use compile-locales && ! is_crosscompile ; then - run_locale_gen --inplace-glibc "${ED}/" - fi -} - -glibc_headers_install() { - local builddir=$(builddir "headers") - cd "${builddir}" - emake install_root="${D}/$(build_eprefix)$(alt_prefix)" install-headers - - insinto $(alt_headers)/gnu - doins "${S}"/include/gnu/stubs.h - - # Make sure we install the sys-include symlink so that when - # we build a 2nd stage cross-compiler, gcc finds the target - # system headers correctly. See gcc/doc/gccinstall.info - dosym usr/include $(alt_prefix)/sys-include -} - -src_install() { - if just_headers ; then - export ABI=default - glibc_headers_install - return - fi - - foreach_abi glibc_do_src_install - - if ! use static-libs ; then - einfo "Not installing static glibc libraries" - find "${ED}" -name "*.a" -and -not -name "*_nonshared.a" -delete - fi -} - -# Simple test to make sure our new glibc isn't completely broken. -# Make sure we don't test with statically built binaries since -# they will fail. Also, skip if this glibc is a cross compiler. -# -# If coreutils is built with USE=multicall, some of these files -# will just be wrapper scripts, not actual ELFs we can test. -glibc_sanity_check() { - cd / #228809 - - # We enter ${ED} so to avoid trouble if the path contains - # special characters; for instance if the path contains the - # colon character (:), then the linker will try to split it - # and look for the libraries in an unexpected place. This can - # lead to unsafe code execution if the generated prefix is - # within a world-writable directory. - # (e.g. /var/tmp/portage:${HOSTNAME}) - pushd "${ED}"/$(get_libdir) >/dev/null - - # first let's find the actual dynamic linker here - # symlinks may point to the wrong abi - local newldso=$(find . -maxdepth 1 -name 'ld*so.?' -type f -print -quit) - - einfo Last-minute run tests with ${newldso} in /$(get_libdir) ... - - local x striptest - for x in cal date env free ls true uname uptime ; do - x=$(type -p ${x}) - [[ -z ${x} || ${x} != ${EPREFIX}/* ]] && continue - striptest=$(LC_ALL="C" file -L ${x} 2>/dev/null) || continue - case ${striptest} in - *"statically linked"*) continue;; - *"ASCII text"*) continue;; - esac - # We need to clear the locale settings as the upgrade might want - # incompatible locale data. This test is not for verifying that. - LC_ALL=C \ - ${newldso} --library-path . ${x} > /dev/null \ - || die "simple run test (${x}) failed" - done - - popd >/dev/null -} - -pkg_preinst() { - # nothing to do if just installing headers - just_headers && return - - einfo "Checking general environment sanity." - sanity_prechecks - - # prepare /etc/ld.so.conf.d/ for files - mkdir -p "${EROOT}"/etc/ld.so.conf.d - - # Default /etc/hosts.conf:multi to on for systems with small dbs. - if [[ $(wc -l < "${EROOT}"/etc/hosts) -lt 1000 ]] ; then - sed -i '/^multi off/s:off:on:' "${ED}"/etc/host.conf - einfo "Defaulting /etc/host.conf:multi to on" - fi - - [[ -n ${ROOT} ]] && return 0 - [[ -d ${ED}/$(get_libdir) ]] || return 0 - [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check - - if [[ -L ${EROOT}/usr/lib/locale ]]; then - # Help portage migrate this to a directory - # https://bugs.gentoo.org/753740 - rm "${EROOT}"/usr/lib/locale || die - fi - - # Keep around libcrypt so that Perl doesn't break when merging libxcrypt - # (libxcrypt is the new provider for now of libcrypt.so.{1,2}). - # bug #802207 - if has_version "${CATEGORY}/${PN}[crypt]" && ! has preserve-libs ${FEATURES}; then - PRESERVED_OLD_LIBCRYPT=1 - cp -p "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" "${T}/libcrypt$(get_libname 1)" || die - else - PRESERVED_OLD_LIBCRYPT=0 - fi -} - -glibc_refresh_ldconfig() { - if [[ ${MERGE_TYPE} == buildonly ]]; then - return - fi - - # Version check could be added to avoid unnecessary work, but ldconfig - # should finish quickly enough to not matter. - ebegin "Refreshing ld.so.cache" - ldconfig -i - if ! eend $?; then - ewarn "Failed to refresh the ld.so.cache for you. Some programs may be broken" - ewarn "before you manually do so (ldconfig -i)." - fi -} - -pkg_postinst() { - # nothing to do if just installing headers - just_headers && return - - if ! tc-is-cross-compiler && [[ -x ${EROOT}/usr/sbin/iconvconfig ]] ; then - # Generate fastloading iconv module configuration file. - "${EROOT}"/usr/sbin/iconvconfig --prefix="${ROOT}/" - fi - - if ! is_crosscompile && [[ -z ${ROOT} ]] ; then - # glibc-2.38+ on loong has ldconfig support added, but the ELF e_flags - # handling has changed as well, which means stale ldconfig auxiliary - # cache entries and failure to lookup libgcc_s / libstdc++ (breaking - # every C++ application) / libgomp etc., among other breakages. - # - # To fix this, simply refresh the ld.so.cache without using the - # auxiliary cache if we're natively installing on loong. This should - # be done relatively soon because we want to minimize the breakage - # window for the affected programs. - use loong && glibc_refresh_ldconfig - - use compile-locales || run_locale_gen "${EROOT}/" - fi - - upgrade_warning - - # Check for sanity of /etc/nsswitch.conf, take 2 - if [[ -e ${EROOT}/etc/nsswitch.conf ]] && ! has_version sys-auth/libnss-nis ; then - local entry - for entry in passwd group shadow; do - if grep -E -q "^[ \t]*${entry}:.*nis" "${EROOT}"/etc/nsswitch.conf; then - ewarn "" - ewarn "Your ${EROOT}/etc/nsswitch.conf uses NIS. Support for that has been" - ewarn "removed from glibc and is now provided by the package" - ewarn " sys-auth/libnss-nis" - ewarn "Install it now to keep your NIS setup working." - ewarn "" - fi - done - fi - - if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then - cp -p "${T}/libcrypt$(get_libname 1)" "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1)" || die - preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1) - - elog "Please ignore a possible later error message about a file collision involving" - elog "${EROOT}/$(get_libdir)/libcrypt$(get_libname 1). We need to preserve this file for the moment to keep" - elog "the upgrade working, but it also needs to be overwritten when" - elog "sys-libs/libxcrypt is installed. See bug 802210 for more details." - fi -} diff --git a/sys-libs/libcxx/Manifest b/sys-libs/libcxx/Manifest index 7574dd364c17..f1871286b0d8 100644 --- a/sys-libs/libcxx/Manifest +++ b/sys-libs/libcxx/Manifest @@ -1,25 +1,20 @@ DIST llvm-gentoo-patchset-15.0.7-r1.tar.xz 21400 BLAKE2B 6b149cb721ac476b728bf9b0197f630d3db40622b85e3d099cdbc1d85ec14872d4e1eb0c94be6edc20fc6187da29b42f934dfb765f2077425a5b919900bb97c0 SHA512 d84d48caa3781633c7c6147e0b786417e93e4b5c9d1393809164e6d355a56673013ed0ea9bc3309488d7cfb794c1b336c888adc52dcd95e70c16d9208c36bd15 DIST llvm-gentoo-patchset-16.0.6.tar.xz 17340 BLAKE2B 37cdf4b38367b4256d4f7a25d1b4f41758e5f81be8e20a1c94a10d6c5e36642e9672121b455e73a0bac2eb40467ef2db4b43789b2912a6790593d97b8b5c27e3 SHA512 2c02b9d8a4c5af9fddcd26c95dc66fffae32cb5b7f85c65a1aa4ed00dd8cd5b01cc1975a711aee63c0b8b11e9dc20f2bc05ea753904eb516892b820f02aff825 -DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948 DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7 DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447 DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30 DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340 -DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783 -DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29 DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386 -DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07 DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1 +DIST llvm-project-f03cd2db91956456f1c5e2da86d3c50183eebd28.tar.gz 209375254 BLAKE2B 1d7e043d04323edb64b2ef2309fbcb4f82a959f45391e815133cc0891d5a497bbb81101aab460e9bf67e75aa906e13ad1877c3850829dcad397ed626dc8f2792 SHA512 6775e03a44b2133bd4a4b473ab007599321daa19dc7f3cc47f95cf9d110e83e982bf48a6b1d43038b0f0a2c0fef2f689aefd20132b25a90ef19342683e2d2e50 EBUILD libcxx-15.0.7-r1.ebuild 5283 BLAKE2B 4380fc5b851054a5ec226ee4c92a2b79511d73ac9b3f8bccc977211601eca36113fc0ae605854da53898507021f24a8b319197605c556244d84253bede7b84f4 SHA512 0a5859269422e794deb43ed960651a1dea830af28b5e395f32e28de8e67a1f399507340230af1c84248853f554e751709a60a9a78aeb0eb42804cb41907dbfce EBUILD libcxx-16.0.6.ebuild 5300 BLAKE2B 4714e22ad2fdcb07c62ead4cfa47fb4734e45dc055700b63a0f24cd6e93dde960c638fa16f55f4c04c6130fc2a7fa5729814c4aee12e9953f603ea5ccb706cc1 SHA512 3eab779107b5c737d971abe29b7bd9f44a73570957bd7d54d6aaa98ec78a6045d7d69272d611f7f09c60e1aa30bbad46b4bd1358b0b2c69e5bc686ab21444857 EBUILD libcxx-17.0.6.ebuild 5280 BLAKE2B a882313471af07942a0772efa642800ba85545227f7dfe281cd7fcdc686ecda82692d273550b28cca2de47b1b9fda87717c98c52ffafdf1155d5269a3733f48a SHA512 d9a2932d7b9e26dea0e62dfd3aeac08ad0206a242d3d42d83e55b93cc767195a67bc0eb3da38cb8d51930175f94bac6496184d6d4be516014e0208c3f852d427 -EBUILD libcxx-18.1.3.ebuild 5447 BLAKE2B 262f4dd0ccb046dcdf7f6970350381a9a48530f7db546f1b6cef5493b5e2a657a403bb0b5fda0d2d100420c6f8f1bac82f635efa8ad6c70d4476ad101c35eb13 SHA512 74ddb2227a2c8cd3d106861dc8155720f757011933835a36b8a5c133de68db80c14d93ad0cd8c3fa62232ce1e0871889b6db15c4bd53d2c1ea34762d93addc0c EBUILD libcxx-18.1.4.ebuild 5447 BLAKE2B 262f4dd0ccb046dcdf7f6970350381a9a48530f7db546f1b6cef5493b5e2a657a403bb0b5fda0d2d100420c6f8f1bac82f635efa8ad6c70d4476ad101c35eb13 SHA512 74ddb2227a2c8cd3d106861dc8155720f757011933835a36b8a5c133de68db80c14d93ad0cd8c3fa62232ce1e0871889b6db15c4bd53d2c1ea34762d93addc0c EBUILD libcxx-19.0.0.9999.ebuild 5397 BLAKE2B 800024bbb9b69c7c159d05bf481db08bfb4c89b93a517410a892cd80a0a0bbf07119d0babcc952283bfc4dff51dd4ea4253a63cbc3f301db6e281074e4a2061a SHA512 61a3676d06d6e5f44e5a6f0de8f05c0af5384c3e940b2f504bddbe6b9a806ae5c5ff8311f6986a284338761e554894ddb1bec7f5e1b324a6e211b1d60f0eb635 -EBUILD libcxx-19.0.0_pre20240330.ebuild 5397 BLAKE2B 800024bbb9b69c7c159d05bf481db08bfb4c89b93a517410a892cd80a0a0bbf07119d0babcc952283bfc4dff51dd4ea4253a63cbc3f301db6e281074e4a2061a SHA512 61a3676d06d6e5f44e5a6f0de8f05c0af5384c3e940b2f504bddbe6b9a806ae5c5ff8311f6986a284338761e554894ddb1bec7f5e1b324a6e211b1d60f0eb635 -EBUILD libcxx-19.0.0_pre20240404.ebuild 5397 BLAKE2B 800024bbb9b69c7c159d05bf481db08bfb4c89b93a517410a892cd80a0a0bbf07119d0babcc952283bfc4dff51dd4ea4253a63cbc3f301db6e281074e4a2061a SHA512 61a3676d06d6e5f44e5a6f0de8f05c0af5384c3e940b2f504bddbe6b9a806ae5c5ff8311f6986a284338761e554894ddb1bec7f5e1b324a6e211b1d60f0eb635 EBUILD libcxx-19.0.0_pre20240410.ebuild 5397 BLAKE2B 800024bbb9b69c7c159d05bf481db08bfb4c89b93a517410a892cd80a0a0bbf07119d0babcc952283bfc4dff51dd4ea4253a63cbc3f301db6e281074e4a2061a SHA512 61a3676d06d6e5f44e5a6f0de8f05c0af5384c3e940b2f504bddbe6b9a806ae5c5ff8311f6986a284338761e554894ddb1bec7f5e1b324a6e211b1d60f0eb635 +EBUILD libcxx-19.0.0_pre20240420.ebuild 5397 BLAKE2B 800024bbb9b69c7c159d05bf481db08bfb4c89b93a517410a892cd80a0a0bbf07119d0babcc952283bfc4dff51dd4ea4253a63cbc3f301db6e281074e4a2061a SHA512 61a3676d06d6e5f44e5a6f0de8f05c0af5384c3e940b2f504bddbe6b9a806ae5c5ff8311f6986a284338761e554894ddb1bec7f5e1b324a6e211b1d60f0eb635 MISC metadata.xml 598 BLAKE2B b7a60449e0d8e4e7605ec203dfaa45b17a265b024e21a3bcfe05a3aeb6c3d19a1d2a218cb1f9ac9ed52296f0d6e723fed251f364341fb70cbd91b747962db580 SHA512 a23f912efff52c4687767023da826ace8c6e5dcd5e69ece86aabbea99da89e48ba81cdc292f03193e2e8a05743e62ebf4d4735d038e0cc4b42714fa277569335 diff --git a/sys-libs/libcxx/libcxx-18.1.3.ebuild b/sys-libs/libcxx/libcxx-18.1.3.ebuild deleted file mode 100644 index a6fca47e6c29..000000000000 --- a/sys-libs/libcxx/libcxx-18.1.3.ebuild +++ /dev/null @@ -1,210 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="New implementation of the C++ standard library, targeting C++11" -HOMEPAGE="https://libcxx.llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~sparc ~x86 ~arm64-macos ~x64-macos" -IUSE="+clang +libcxxabi +static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - libcxxabi? ( - ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] - ) - !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) -" -DEPEND=" - ${RDEPEND} - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( - sys-devel/clang:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - dev-debug/gdb[python] - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - ) -" - -LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -pkg_setup() { - python-any-r1_pkg_setup - - if ! use libcxxabi && ! tc-is-gcc ; then - eerror "To build ${PN} against libsupc++, you have to use gcc. Other" - eerror "compilers are not supported. Please set CC=gcc and CXX=g++" - eerror "and try again." - die - fi -} - -src_prepare() { - # hanging tests - # https://github.com/llvm/llvm-project/issues/73791 - rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_* || die - rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.*_equals* || die - - cmake_src_prepare -} - -test_compiler() { - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # note: we need to do this before multilib kicks in since it will - # alter the CHOST - local cxxabi cxxabi_incs - if use libcxxabi; then - cxxabi=system-libcxxabi - cxxabi_incs="${EPREFIX}/usr/include/c++/v1" - else - local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" - cxxabi=libsupc++ - cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" - fi - - multilib-minimal_src_configure -} - -multilib_src_configure() { - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link to compiler-rt - local use_compiler_rt=OFF - [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON - - # bootstrap: cmake is unhappy if compiler can't link to stdlib - local nolib_flags=( -nodefaultlibs -lc ) - if ! test_compiler; then - if test_compiler "${nolib_flags[@]}"; then - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" - fi - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" - -DPython3_EXECUTABLE="${PYTHON}" - -DLLVM_ENABLE_RUNTIMES=libcxx - -DLLVM_INCLUDE_TESTS=OFF - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DLIBCXX_ENABLE_SHARED=ON - -DLIBCXX_ENABLE_STATIC=$(usex static-libs) - -DLIBCXX_CXX_ABI=${cxxabi} - -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} - # we're using our own mechanism for generating linker scripts - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - -DLIBCXX_INCLUDE_TESTS=$(usex test) - -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt} - # this is broken with standalone builds, and also meaningless - -DLIBCXXABI_USE_LLVM_UNWINDER=OFF - ) - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - -DPython3_EXECUTABLE="${PYTHON}" - ) - fi - cmake_src_configure -} - -multilib_src_compile() { - cmake_src_compile - if [[ ${CHOST} != *-darwin* ]] ; then - gen_shared_ldscript - use static-libs && gen_static_ldscript - fi -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-cxx -} - -multilib_src_install() { - cmake_src_install - # since we've replaced libc++.{a,so} with ldscripts, now we have to - # install the extra symlinks - if [[ ${CHOST} != *-darwin* ]] ; then - dolib.so lib/libc++_shared.so - use static-libs && dolib.a lib/libc++_static.a - fi -} - -# Usage: deps -gen_ldscript() { - local output_format - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" - - cat <<-END_LDSCRIPT -/* GNU ld script - Include missing dependencies -*/ -${output_format} -GROUP ( $@ ) -END_LDSCRIPT -} - -gen_static_ldscript() { - # Move it first. - mv lib/libc++{,_static}.a || die - # Generate libc++.a ldscript for inclusion of its dependencies so that - # clang++ -stdlib=libc++ -static works out of the box. - local deps=( - libc++_static.a - $(usex libcxxabi libc++abi.a libsupc++.a) - ) - # On Linux/glibc it does not link without libpthread or libdl. It is - # fine on FreeBSD. - use elibc_glibc && deps+=( libpthread.a libdl.a ) - - gen_ldscript "${deps[*]}" > lib/libc++.a || die -} - -gen_shared_ldscript() { - # Move it first. - mv lib/libc++{,_shared}.so || die - local deps=( - libc++_shared.so - # libsupc++ doesn't have a shared version - $(usex libcxxabi libc++abi.so libsupc++.a) - ) - - gen_ldscript "${deps[*]}" > lib/libc++.so || die -} diff --git a/sys-libs/libcxx/libcxx-19.0.0_pre20240330.ebuild b/sys-libs/libcxx/libcxx-19.0.0_pre20240330.ebuild deleted file mode 100644 index e29d57a316d3..000000000000 --- a/sys-libs/libcxx/libcxx-19.0.0_pre20240330.ebuild +++ /dev/null @@ -1,210 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="New implementation of the C++ standard library, targeting C++11" -HOMEPAGE="https://libcxx.llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -IUSE="+clang +libcxxabi +static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - libcxxabi? ( - ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] - ) - !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) -" -DEPEND=" - ${RDEPEND} - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( - sys-devel/clang:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - dev-debug/gdb[python] - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - ) -" - -LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -pkg_setup() { - python-any-r1_pkg_setup - - if ! use libcxxabi && ! tc-is-gcc ; then - eerror "To build ${PN} against libsupc++, you have to use gcc. Other" - eerror "compilers are not supported. Please set CC=gcc and CXX=g++" - eerror "and try again." - die - fi -} - -src_prepare() { - # hanging tests - # https://github.com/llvm/llvm-project/issues/73791 - rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_* || die - rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.*_equals* || die - - cmake_src_prepare -} - -test_compiler() { - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # note: we need to do this before multilib kicks in since it will - # alter the CHOST - local cxxabi cxxabi_incs - if use libcxxabi; then - cxxabi=system-libcxxabi - cxxabi_incs="${EPREFIX}/usr/include/c++/v1" - else - local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" - cxxabi=libsupc++ - cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" - fi - - multilib-minimal_src_configure -} - -multilib_src_configure() { - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link to compiler-rt - local use_compiler_rt=OFF - [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON - - # bootstrap: cmake is unhappy if compiler can't link to stdlib - local nolib_flags=( -nodefaultlibs -lc ) - if ! test_compiler; then - if test_compiler "${nolib_flags[@]}"; then - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" - fi - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" - -DPython3_EXECUTABLE="${PYTHON}" - -DLLVM_ENABLE_RUNTIMES=libcxx - -DLLVM_INCLUDE_TESTS=OFF - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DLIBCXX_ENABLE_SHARED=ON - -DLIBCXX_ENABLE_STATIC=$(usex static-libs) - -DLIBCXX_CXX_ABI=${cxxabi} - -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} - # we're using our own mechanism for generating linker scripts - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - -DLIBCXX_INCLUDE_TESTS=$(usex test) - -DLIBCXX_INSTALL_MODULES=ON - -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt} - # this is broken with standalone builds, and also meaningless - -DLIBCXXABI_USE_LLVM_UNWINDER=OFF - ) - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - -DPython3_EXECUTABLE="${PYTHON}" - ) - fi - cmake_src_configure -} - -multilib_src_compile() { - cmake_src_compile - if [[ ${CHOST} != *-darwin* ]] ; then - gen_shared_ldscript - use static-libs && gen_static_ldscript - fi -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-cxx -} - -multilib_src_install() { - cmake_src_install - # since we've replaced libc++.{a,so} with ldscripts, now we have to - # install the extra symlinks - if [[ ${CHOST} != *-darwin* ]] ; then - dolib.so lib/libc++_shared.so - use static-libs && dolib.a lib/libc++_static.a - fi -} - -# Usage: deps -gen_ldscript() { - local output_format - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" - - cat <<-END_LDSCRIPT -/* GNU ld script - Include missing dependencies -*/ -${output_format} -GROUP ( $@ ) -END_LDSCRIPT -} - -gen_static_ldscript() { - # Move it first. - mv lib/libc++{,_static}.a || die - # Generate libc++.a ldscript for inclusion of its dependencies so that - # clang++ -stdlib=libc++ -static works out of the box. - local deps=( - libc++_static.a - $(usex libcxxabi libc++abi.a libsupc++.a) - ) - # On Linux/glibc it does not link without libpthread or libdl. It is - # fine on FreeBSD. - use elibc_glibc && deps+=( libpthread.a libdl.a ) - - gen_ldscript "${deps[*]}" > lib/libc++.a || die -} - -gen_shared_ldscript() { - # Move it first. - mv lib/libc++{,_shared}.so || die - local deps=( - libc++_shared.so - # libsupc++ doesn't have a shared version - $(usex libcxxabi libc++abi.so libsupc++.a) - ) - - gen_ldscript "${deps[*]}" > lib/libc++.so || die -} diff --git a/sys-libs/libcxx/libcxx-19.0.0_pre20240404.ebuild b/sys-libs/libcxx/libcxx-19.0.0_pre20240404.ebuild deleted file mode 100644 index e29d57a316d3..000000000000 --- a/sys-libs/libcxx/libcxx-19.0.0_pre20240404.ebuild +++ /dev/null @@ -1,210 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="New implementation of the C++ standard library, targeting C++11" -HOMEPAGE="https://libcxx.llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -IUSE="+clang +libcxxabi +static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - libcxxabi? ( - ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] - ) - !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) -" -DEPEND=" - ${RDEPEND} - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( - sys-devel/clang:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - dev-debug/gdb[python] - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - ) -" - -LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -pkg_setup() { - python-any-r1_pkg_setup - - if ! use libcxxabi && ! tc-is-gcc ; then - eerror "To build ${PN} against libsupc++, you have to use gcc. Other" - eerror "compilers are not supported. Please set CC=gcc and CXX=g++" - eerror "and try again." - die - fi -} - -src_prepare() { - # hanging tests - # https://github.com/llvm/llvm-project/issues/73791 - rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_* || die - rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.*_equals* || die - - cmake_src_prepare -} - -test_compiler() { - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - # note: we need to do this before multilib kicks in since it will - # alter the CHOST - local cxxabi cxxabi_incs - if use libcxxabi; then - cxxabi=system-libcxxabi - cxxabi_incs="${EPREFIX}/usr/include/c++/v1" - else - local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" - cxxabi=libsupc++ - cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" - fi - - multilib-minimal_src_configure -} - -multilib_src_configure() { - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link to compiler-rt - local use_compiler_rt=OFF - [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON - - # bootstrap: cmake is unhappy if compiler can't link to stdlib - local nolib_flags=( -nodefaultlibs -lc ) - if ! test_compiler; then - if test_compiler "${nolib_flags[@]}"; then - local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" - ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" - fi - fi - - local libdir=$(get_libdir) - local mycmakeargs=( - -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" - -DPython3_EXECUTABLE="${PYTHON}" - -DLLVM_ENABLE_RUNTIMES=libcxx - -DLLVM_INCLUDE_TESTS=OFF - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - - -DLIBCXX_ENABLE_SHARED=ON - -DLIBCXX_ENABLE_STATIC=$(usex static-libs) - -DLIBCXX_CXX_ABI=${cxxabi} - -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} - # we're using our own mechanism for generating linker scripts - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - -DLIBCXX_INCLUDE_TESTS=$(usex test) - -DLIBCXX_INSTALL_MODULES=ON - -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt} - # this is broken with standalone builds, and also meaningless - -DLIBCXXABI_USE_LLVM_UNWINDER=OFF - ) - - if use test; then - mycmakeargs+=( - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - -DPython3_EXECUTABLE="${PYTHON}" - ) - fi - cmake_src_configure -} - -multilib_src_compile() { - cmake_src_compile - if [[ ${CHOST} != *-darwin* ]] ; then - gen_shared_ldscript - use static-libs && gen_static_ldscript - fi -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-cxx -} - -multilib_src_install() { - cmake_src_install - # since we've replaced libc++.{a,so} with ldscripts, now we have to - # install the extra symlinks - if [[ ${CHOST} != *-darwin* ]] ; then - dolib.so lib/libc++_shared.so - use static-libs && dolib.a lib/libc++_static.a - fi -} - -# Usage: deps -gen_ldscript() { - local output_format - output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') - [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" - - cat <<-END_LDSCRIPT -/* GNU ld script - Include missing dependencies -*/ -${output_format} -GROUP ( $@ ) -END_LDSCRIPT -} - -gen_static_ldscript() { - # Move it first. - mv lib/libc++{,_static}.a || die - # Generate libc++.a ldscript for inclusion of its dependencies so that - # clang++ -stdlib=libc++ -static works out of the box. - local deps=( - libc++_static.a - $(usex libcxxabi libc++abi.a libsupc++.a) - ) - # On Linux/glibc it does not link without libpthread or libdl. It is - # fine on FreeBSD. - use elibc_glibc && deps+=( libpthread.a libdl.a ) - - gen_ldscript "${deps[*]}" > lib/libc++.a || die -} - -gen_shared_ldscript() { - # Move it first. - mv lib/libc++{,_shared}.so || die - local deps=( - libc++_shared.so - # libsupc++ doesn't have a shared version - $(usex libcxxabi libc++abi.so libsupc++.a) - ) - - gen_ldscript "${deps[*]}" > lib/libc++.so || die -} diff --git a/sys-libs/libcxx/libcxx-19.0.0_pre20240420.ebuild b/sys-libs/libcxx/libcxx-19.0.0_pre20240420.ebuild new file mode 100644 index 000000000000..e29d57a316d3 --- /dev/null +++ b/sys-libs/libcxx/libcxx-19.0.0_pre20240420.ebuild @@ -0,0 +1,210 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 +inherit toolchain-funcs + +DESCRIPTION="New implementation of the C++ standard library, targeting C++11" +HOMEPAGE="https://libcxx.llvm.org/" + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="0" +IUSE="+clang +libcxxabi +static-libs test" +REQUIRED_USE="test? ( clang )" +RESTRICT="!test? ( test )" + +RDEPEND=" + libcxxabi? ( + ~sys-libs/libcxxabi-${PV}[static-libs?,${MULTILIB_USEDEP}] + ) + !libcxxabi? ( >=sys-devel/gcc-4.7:=[cxx] ) +" +DEPEND=" + ${RDEPEND} + sys-devel/llvm:${LLVM_MAJOR} +" +BDEPEND=" + clang? ( + sys-devel/clang:${LLVM_MAJOR} + ) + !test? ( + ${PYTHON_DEPS} + ) + test? ( + dev-debug/gdb[python] + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') + ) +" + +LLVM_COMPONENTS=( runtimes libcxx{,abi} llvm/{cmake,utils/llvm-lit} cmake ) +llvm.org_set_globals + +python_check_deps() { + use test || return 0 + python_has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +pkg_setup() { + python-any-r1_pkg_setup + + if ! use libcxxabi && ! tc-is-gcc ; then + eerror "To build ${PN} against libsupc++, you have to use gcc. Other" + eerror "compilers are not supported. Please set CC=gcc and CXX=g++" + eerror "and try again." + die + fi +} + +src_prepare() { + # hanging tests + # https://github.com/llvm/llvm-project/issues/73791 + rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/fetch_* || die + rm ../libcxx/test/std/atomics/atomics.types.generic/atomics.types.float/operator.*_equals* || die + + cmake_src_prepare +} + +test_compiler() { + $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ + <<<'int main() { return 0; }' &>/dev/null +} + +src_configure() { + llvm_prepend_path "${LLVM_MAJOR}" + + # note: we need to do this before multilib kicks in since it will + # alter the CHOST + local cxxabi cxxabi_incs + if use libcxxabi; then + cxxabi=system-libcxxabi + cxxabi_incs="${EPREFIX}/usr/include/c++/v1" + else + local gcc_inc="${EPREFIX}/usr/lib/gcc/${CHOST}/$(gcc-fullversion)/include/g++-v$(gcc-major-version)" + cxxabi=libsupc++ + cxxabi_incs="${gcc_inc};${gcc_inc}/${CHOST}" + fi + + multilib-minimal_src_configure +} + +multilib_src_configure() { + if use clang; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + strip-unsupported-flags + fi + + # link to compiler-rt + local use_compiler_rt=OFF + [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON + + # bootstrap: cmake is unhappy if compiler can't link to stdlib + local nolib_flags=( -nodefaultlibs -lc ) + if ! test_compiler; then + if test_compiler "${nolib_flags[@]}"; then + local -x LDFLAGS="${LDFLAGS} ${nolib_flags[*]}" + ewarn "${CXX} seems to lack runtime, trying with ${nolib_flags[*]}" + fi + fi + + local libdir=$(get_libdir) + local mycmakeargs=( + -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" + -DPython3_EXECUTABLE="${PYTHON}" + -DLLVM_ENABLE_RUNTIMES=libcxx + -DLLVM_INCLUDE_TESTS=OFF + -DLLVM_LIBDIR_SUFFIX=${libdir#lib} + + -DLIBCXX_ENABLE_SHARED=ON + -DLIBCXX_ENABLE_STATIC=$(usex static-libs) + -DLIBCXX_CXX_ABI=${cxxabi} + -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${cxxabi_incs} + # we're using our own mechanism for generating linker scripts + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_INCLUDE_BENCHMARKS=OFF + -DLIBCXX_INCLUDE_TESTS=$(usex test) + -DLIBCXX_INSTALL_MODULES=ON + -DLIBCXX_USE_COMPILER_RT=${use_compiler_rt} + # this is broken with standalone builds, and also meaningless + -DLIBCXXABI_USE_LLVM_UNWINDER=OFF + ) + + if use test; then + mycmakeargs+=( + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags)" + -DPython3_EXECUTABLE="${PYTHON}" + ) + fi + cmake_src_configure +} + +multilib_src_compile() { + cmake_src_compile + if [[ ${CHOST} != *-darwin* ]] ; then + gen_shared_ldscript + use static-libs && gen_static_ldscript + fi +} + +multilib_src_test() { + local -x LIT_PRESERVES_TMP=1 + cmake_build check-cxx +} + +multilib_src_install() { + cmake_src_install + # since we've replaced libc++.{a,so} with ldscripts, now we have to + # install the extra symlinks + if [[ ${CHOST} != *-darwin* ]] ; then + dolib.so lib/libc++_shared.so + use static-libs && dolib.a lib/libc++_static.a + fi +} + +# Usage: deps +gen_ldscript() { + local output_format + output_format=$($(tc-getCC) ${CFLAGS} ${LDFLAGS} -Wl,--verbose 2>&1 | sed -n 's/^OUTPUT_FORMAT("\([^"]*\)",.*/\1/p') + [[ -n ${output_format} ]] && output_format="OUTPUT_FORMAT ( ${output_format} )" + + cat <<-END_LDSCRIPT +/* GNU ld script + Include missing dependencies +*/ +${output_format} +GROUP ( $@ ) +END_LDSCRIPT +} + +gen_static_ldscript() { + # Move it first. + mv lib/libc++{,_static}.a || die + # Generate libc++.a ldscript for inclusion of its dependencies so that + # clang++ -stdlib=libc++ -static works out of the box. + local deps=( + libc++_static.a + $(usex libcxxabi libc++abi.a libsupc++.a) + ) + # On Linux/glibc it does not link without libpthread or libdl. It is + # fine on FreeBSD. + use elibc_glibc && deps+=( libpthread.a libdl.a ) + + gen_ldscript "${deps[*]}" > lib/libc++.a || die +} + +gen_shared_ldscript() { + # Move it first. + mv lib/libc++{,_shared}.so || die + local deps=( + libc++_shared.so + # libsupc++ doesn't have a shared version + $(usex libcxxabi libc++abi.so libsupc++.a) + ) + + gen_ldscript "${deps[*]}" > lib/libc++.so || die +} diff --git a/sys-libs/libcxxabi/Manifest b/sys-libs/libcxxabi/Manifest index cd835cc65b52..9435b1320e32 100644 --- a/sys-libs/libcxxabi/Manifest +++ b/sys-libs/libcxxabi/Manifest @@ -1,23 +1,18 @@ -DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948 DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7 DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447 DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30 DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340 -DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783 -DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29 DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386 -DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07 DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1 +DIST llvm-project-f03cd2db91956456f1c5e2da86d3c50183eebd28.tar.gz 209375254 BLAKE2B 1d7e043d04323edb64b2ef2309fbcb4f82a959f45391e815133cc0891d5a497bbb81101aab460e9bf67e75aa906e13ad1877c3850829dcad397ed626dc8f2792 SHA512 6775e03a44b2133bd4a4b473ab007599321daa19dc7f3cc47f95cf9d110e83e982bf48a6b1d43038b0f0a2c0fef2f689aefd20132b25a90ef19342683e2d2e50 EBUILD libcxxabi-15.0.7.ebuild 2911 BLAKE2B 5f2004d2f68fe4eddb0b22be82d28fcca7954d0e3ad9a5510744adc4d0dfd7a1ab9fd928404adcd3eeecc58703f51117d0a80e5895b53e0ae7b71621ad5a435c SHA512 5b8e2c6abdec785649aa41b7f05ab86ecab30ff0631d6078c9b1052b406c320c5847b8f16ffa6d9e62ba4a6bca5959b18770810924d6e6da264fb08d6ff738d0 EBUILD libcxxabi-16.0.6.ebuild 2932 BLAKE2B 837ab88ee88d5497b8bddb9f001d4b4ddd44ed982ef47114c965174135ed136abd0e3a6f3848a4aba53d0ca3748c54674cb28de8d46fda3bb7a90f326d41c7c6 SHA512 e4ebf7f35d2cad3bf3ba02754c85fee1cd1c4e52887770698ebaa3ef2fe66873f468677d307ea2d6956c2f6d3ac9b61943461193a5315f1e8a2846f2463b0581 EBUILD libcxxabi-17.0.6.ebuild 2932 BLAKE2B 837ab88ee88d5497b8bddb9f001d4b4ddd44ed982ef47114c965174135ed136abd0e3a6f3848a4aba53d0ca3748c54674cb28de8d46fda3bb7a90f326d41c7c6 SHA512 e4ebf7f35d2cad3bf3ba02754c85fee1cd1c4e52887770698ebaa3ef2fe66873f468677d307ea2d6956c2f6d3ac9b61943461193a5315f1e8a2846f2463b0581 -EBUILD libcxxabi-18.1.3.ebuild 2764 BLAKE2B 1d716983ec2cf1f3ad73b9a3947feb5deddd91750495d7fe5eb9d3ecea9545c7dd4bde00a348272e92aec46845286f9a844077ece2b91a80222bae44c22a514b SHA512 7d94d2fe04acbbc8651c1b7588f9b94603de10aaefc949aaa408d7e7f8d53ccca9b411a2a7f3af7edc2a4f05008977dddd039c7ac1cf17968ba59c7484b3bb68 EBUILD libcxxabi-18.1.4.ebuild 2764 BLAKE2B 1d716983ec2cf1f3ad73b9a3947feb5deddd91750495d7fe5eb9d3ecea9545c7dd4bde00a348272e92aec46845286f9a844077ece2b91a80222bae44c22a514b SHA512 7d94d2fe04acbbc8651c1b7588f9b94603de10aaefc949aaa408d7e7f8d53ccca9b411a2a7f3af7edc2a4f05008977dddd039c7ac1cf17968ba59c7484b3bb68 EBUILD libcxxabi-19.0.0.9999.ebuild 2684 BLAKE2B d72cf1584537afd3d13263975a4f903819f6844cac728daab626b269f460865cac59c3199d38ced179ce041294db940b31f07ca74eeabd452f8e2f775e3e206d SHA512 ac7f20fa097c17349959154cce8c75a2083b04d4fb1241d6917c0fd14348a848f9158d050b9791754fc02ec4cd1bc2d82a8ef678a7b025e15524e5af945c9bc1 -EBUILD libcxxabi-19.0.0_pre20240330.ebuild 2684 BLAKE2B d72cf1584537afd3d13263975a4f903819f6844cac728daab626b269f460865cac59c3199d38ced179ce041294db940b31f07ca74eeabd452f8e2f775e3e206d SHA512 ac7f20fa097c17349959154cce8c75a2083b04d4fb1241d6917c0fd14348a848f9158d050b9791754fc02ec4cd1bc2d82a8ef678a7b025e15524e5af945c9bc1 -EBUILD libcxxabi-19.0.0_pre20240404.ebuild 2684 BLAKE2B d72cf1584537afd3d13263975a4f903819f6844cac728daab626b269f460865cac59c3199d38ced179ce041294db940b31f07ca74eeabd452f8e2f775e3e206d SHA512 ac7f20fa097c17349959154cce8c75a2083b04d4fb1241d6917c0fd14348a848f9158d050b9791754fc02ec4cd1bc2d82a8ef678a7b025e15524e5af945c9bc1 EBUILD libcxxabi-19.0.0_pre20240410.ebuild 2684 BLAKE2B d72cf1584537afd3d13263975a4f903819f6844cac728daab626b269f460865cac59c3199d38ced179ce041294db940b31f07ca74eeabd452f8e2f775e3e206d SHA512 ac7f20fa097c17349959154cce8c75a2083b04d4fb1241d6917c0fd14348a848f9158d050b9791754fc02ec4cd1bc2d82a8ef678a7b025e15524e5af945c9bc1 +EBUILD libcxxabi-19.0.0_pre20240420.ebuild 2684 BLAKE2B d72cf1584537afd3d13263975a4f903819f6844cac728daab626b269f460865cac59c3199d38ced179ce041294db940b31f07ca74eeabd452f8e2f775e3e206d SHA512 ac7f20fa097c17349959154cce8c75a2083b04d4fb1241d6917c0fd14348a848f9158d050b9791754fc02ec4cd1bc2d82a8ef678a7b025e15524e5af945c9bc1 MISC metadata.xml 438 BLAKE2B 0a830a06a53a6cdaf138ad7620fe366fae05c1c1451267d6a58caf7da5ce8f5a26d302fab53b9460920074ab5a65991d3bd24fde087809e8dc12188dd94c7676 SHA512 d53e13c497569636fb453a159c5ca5ddfabf8e5debd5f92e5149c52d54c876753842ab73293d6d08e2d9b279363b4f0c743eed3a5027a61246c6b60496be8e87 diff --git a/sys-libs/libcxxabi/libcxxabi-18.1.3.ebuild b/sys-libs/libcxxabi/libcxxabi-18.1.3.ebuild deleted file mode 100644 index 8865a2ce4c2c..000000000000 --- a/sys-libs/libcxxabi/libcxxabi-18.1.3.ebuild +++ /dev/null @@ -1,111 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="Low level support for a standard C++ library" -HOMEPAGE="https://libcxxabi.llvm.org/" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~riscv ~sparc ~x86 ~arm64-macos ~x64-macos" -IUSE="+clang +static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -# in 15.x, cxxabi.h is moving from libcxx to libcxxabi -RDEPEND+=" - !/dev/null - int test[sizeof(void *) == 8 ? 1 : -1]; - EOF - then - build_omptarget=ON - fi - - local libdir="$(get_libdir)" - local mycmakeargs=( - -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}" - - -DLIBOMP_USE_HWLOC=$(usex hwloc) - -DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin) - -DLIBOMP_OMPT_SUPPORT=$(usex ompt) - - -DOPENMP_ENABLE_LIBOMPTARGET=${build_omptarget} - - # do not install libgomp.so & libiomp5.so aliases - -DLIBOMP_INSTALL_ALIASES=OFF - # disable unnecessary hack copying stuff back to srcdir - -DLIBOMP_COPY_EXPORTS=OFF - ) - - if [[ ${build_omptarget} == ON ]]; then - local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) - local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) - mycmakeargs+=( - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" - ) - - if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then - mycmakeargs+=( - -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=$(usex llvm_targets_AMDGPU) - -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=$(usex llvm_targets_NVPTX) - - # prevent trying to access the GPU - -DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND - -DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND - ) - else - mycmakeargs+=( - -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF - -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF - ) - fi - fi - - use test && mycmakeargs+=( - # this project does not use standard LLVM cmake macros - -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" - -DOPENMP_LIT_ARGS="$(get_lit_flags)" - - -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")" - -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")" - ) - addpredict /dev/nvidiactl - cmake_src_configure -} - -multilib_src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - - cmake_build check-libomp -} diff --git a/sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild b/sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild deleted file mode 100644 index a40d0aed1c41..000000000000 --- a/sys-libs/libomp/libomp-19.0.0_pre20240330.ebuild +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit flag-o-matic cmake-multilib linux-info llvm.org llvm-utils -inherit python-single-r1 toolchain-funcs - -DESCRIPTION="OpenMP runtime library for LLVM/clang compiler" -HOMEPAGE="https://openmp.llvm.org" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0/${LLVM_SOABI}" -IUSE=" - +debug gdb-plugin hwloc offload ompt test - llvm_targets_AMDGPU llvm_targets_NVPTX -" -REQUIRED_USE=" - gdb-plugin? ( ${PYTHON_REQUIRED_USE} ) -" -RESTRICT="!test? ( test )" - -RDEPEND=" - gdb-plugin? ( ${PYTHON_DEPS} ) - hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] ) - offload? ( - dev-libs/libffi:=[${MULTILIB_USEDEP}] - ~sys-devel/llvm-${PV}[${MULTILIB_USEDEP}] - llvm_targets_AMDGPU? ( dev-libs/rocr-runtime:= ) - ) -" -# tests: -# - dev-python/lit provides the test runner -# - sys-devel/llvm provide test utils (e.g. FileCheck) -# - sys-devel/clang provides the compiler to run tests -DEPEND=" - ${RDEPEND} -" -BDEPEND=" - dev-lang/perl - offload? ( - llvm_targets_AMDGPU? ( sys-devel/clang ) - llvm_targets_NVPTX? ( sys-devel/clang ) - virtual/pkgconfig - ) - test? ( - ${PYTHON_DEPS} - $(python_gen_cond_dep ' - dev-python/lit[${PYTHON_USEDEP}] - ') - sys-devel/clang - ) -" - -LLVM_COMPONENTS=( openmp cmake llvm/include ) -llvm.org_set_globals - -kernel_pds_check() { - if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then - local CONFIG_CHECK="~!SCHED_PDS" - local ERROR_SCHED_PDS="\ -PDS scheduler versions >= 0.98c < 0.98i (e.g. used in kernels >= 4.13-pf11 -< 4.14-pf9) do not implement sched_yield() call which may result in horrible -performance problems with libomp. If you are using one of the specified -kernel versions, you may want to disable the PDS scheduler." - - check_extra_config - fi -} - -pkg_pretend() { - kernel_pds_check -} - -pkg_setup() { - if use gdb-plugin || use test; then - python-single-r1_pkg_setup - fi -} - -multilib_src_configure() { - use offload && llvm_prepend_path "${LLVM_MAJOR}" - - # LTO causes issues in other packages building, #870127 - filter-lto - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - local build_omptarget=OFF - # upstream disallows building libomptarget when sizeof(void*) != 8 - if use offload && - "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null \ - <<-EOF &>/dev/null - int test[sizeof(void *) == 8 ? 1 : -1]; - EOF - then - build_omptarget=ON - fi - - local libdir="$(get_libdir)" - local mycmakeargs=( - -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}" - - -DLIBOMP_USE_HWLOC=$(usex hwloc) - -DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin) - -DLIBOMP_OMPT_SUPPORT=$(usex ompt) - - -DOPENMP_ENABLE_LIBOMPTARGET=${build_omptarget} - - # do not install libgomp.so & libiomp5.so aliases - -DLIBOMP_INSTALL_ALIASES=OFF - # disable unnecessary hack copying stuff back to srcdir - -DLIBOMP_COPY_EXPORTS=OFF - ) - - if [[ ${build_omptarget} == ON ]]; then - local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) - local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) - mycmakeargs+=( - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" - ) - - if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then - mycmakeargs+=( - -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=$(usex llvm_targets_AMDGPU) - -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=$(usex llvm_targets_NVPTX) - - # prevent trying to access the GPU - -DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND - -DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND - ) - else - mycmakeargs+=( - -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF - -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF - ) - fi - fi - - use test && mycmakeargs+=( - # this project does not use standard LLVM cmake macros - -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" - -DOPENMP_LIT_ARGS="$(get_lit_flags)" - - -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")" - -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")" - ) - addpredict /dev/nvidiactl - cmake_src_configure -} - -multilib_src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - - cmake_build check-libomp -} diff --git a/sys-libs/libomp/libomp-19.0.0_pre20240404.ebuild b/sys-libs/libomp/libomp-19.0.0_pre20240404.ebuild deleted file mode 100644 index a40d0aed1c41..000000000000 --- a/sys-libs/libomp/libomp-19.0.0_pre20240404.ebuild +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit flag-o-matic cmake-multilib linux-info llvm.org llvm-utils -inherit python-single-r1 toolchain-funcs - -DESCRIPTION="OpenMP runtime library for LLVM/clang compiler" -HOMEPAGE="https://openmp.llvm.org" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0/${LLVM_SOABI}" -IUSE=" - +debug gdb-plugin hwloc offload ompt test - llvm_targets_AMDGPU llvm_targets_NVPTX -" -REQUIRED_USE=" - gdb-plugin? ( ${PYTHON_REQUIRED_USE} ) -" -RESTRICT="!test? ( test )" - -RDEPEND=" - gdb-plugin? ( ${PYTHON_DEPS} ) - hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] ) - offload? ( - dev-libs/libffi:=[${MULTILIB_USEDEP}] - ~sys-devel/llvm-${PV}[${MULTILIB_USEDEP}] - llvm_targets_AMDGPU? ( dev-libs/rocr-runtime:= ) - ) -" -# tests: -# - dev-python/lit provides the test runner -# - sys-devel/llvm provide test utils (e.g. FileCheck) -# - sys-devel/clang provides the compiler to run tests -DEPEND=" - ${RDEPEND} -" -BDEPEND=" - dev-lang/perl - offload? ( - llvm_targets_AMDGPU? ( sys-devel/clang ) - llvm_targets_NVPTX? ( sys-devel/clang ) - virtual/pkgconfig - ) - test? ( - ${PYTHON_DEPS} - $(python_gen_cond_dep ' - dev-python/lit[${PYTHON_USEDEP}] - ') - sys-devel/clang - ) -" - -LLVM_COMPONENTS=( openmp cmake llvm/include ) -llvm.org_set_globals - -kernel_pds_check() { - if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then - local CONFIG_CHECK="~!SCHED_PDS" - local ERROR_SCHED_PDS="\ -PDS scheduler versions >= 0.98c < 0.98i (e.g. used in kernels >= 4.13-pf11 -< 4.14-pf9) do not implement sched_yield() call which may result in horrible -performance problems with libomp. If you are using one of the specified -kernel versions, you may want to disable the PDS scheduler." - - check_extra_config - fi -} - -pkg_pretend() { - kernel_pds_check -} - -pkg_setup() { - if use gdb-plugin || use test; then - python-single-r1_pkg_setup - fi -} - -multilib_src_configure() { - use offload && llvm_prepend_path "${LLVM_MAJOR}" - - # LTO causes issues in other packages building, #870127 - filter-lto - - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - local build_omptarget=OFF - # upstream disallows building libomptarget when sizeof(void*) != 8 - if use offload && - "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null \ - <<-EOF &>/dev/null - int test[sizeof(void *) == 8 ? 1 : -1]; - EOF - then - build_omptarget=ON - fi - - local libdir="$(get_libdir)" - local mycmakeargs=( - -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}" - - -DLIBOMP_USE_HWLOC=$(usex hwloc) - -DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin) - -DLIBOMP_OMPT_SUPPORT=$(usex ompt) - - -DOPENMP_ENABLE_LIBOMPTARGET=${build_omptarget} - - # do not install libgomp.so & libiomp5.so aliases - -DLIBOMP_INSTALL_ALIASES=OFF - # disable unnecessary hack copying stuff back to srcdir - -DLIBOMP_COPY_EXPORTS=OFF - ) - - if [[ ${build_omptarget} == ON ]]; then - local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) - local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) - mycmakeargs+=( - -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" - -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" - ) - - if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then - mycmakeargs+=( - -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=$(usex llvm_targets_AMDGPU) - -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=$(usex llvm_targets_NVPTX) - - # prevent trying to access the GPU - -DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND - -DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND - ) - else - mycmakeargs+=( - -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF - -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF - ) - fi - fi - - use test && mycmakeargs+=( - # this project does not use standard LLVM cmake macros - -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" - -DOPENMP_LIT_ARGS="$(get_lit_flags)" - - -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")" - -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")" - ) - addpredict /dev/nvidiactl - cmake_src_configure -} - -multilib_src_test() { - # respect TMPDIR! - local -x LIT_PRESERVES_TMP=1 - - cmake_build check-libomp -} diff --git a/sys-libs/libomp/libomp-19.0.0_pre20240420.ebuild b/sys-libs/libomp/libomp-19.0.0_pre20240420.ebuild new file mode 100644 index 000000000000..a40d0aed1c41 --- /dev/null +++ b/sys-libs/libomp/libomp-19.0.0_pre20240420.ebuild @@ -0,0 +1,160 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +inherit flag-o-matic cmake-multilib linux-info llvm.org llvm-utils +inherit python-single-r1 toolchain-funcs + +DESCRIPTION="OpenMP runtime library for LLVM/clang compiler" +HOMEPAGE="https://openmp.llvm.org" + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="0/${LLVM_SOABI}" +IUSE=" + +debug gdb-plugin hwloc offload ompt test + llvm_targets_AMDGPU llvm_targets_NVPTX +" +REQUIRED_USE=" + gdb-plugin? ( ${PYTHON_REQUIRED_USE} ) +" +RESTRICT="!test? ( test )" + +RDEPEND=" + gdb-plugin? ( ${PYTHON_DEPS} ) + hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] ) + offload? ( + dev-libs/libffi:=[${MULTILIB_USEDEP}] + ~sys-devel/llvm-${PV}[${MULTILIB_USEDEP}] + llvm_targets_AMDGPU? ( dev-libs/rocr-runtime:= ) + ) +" +# tests: +# - dev-python/lit provides the test runner +# - sys-devel/llvm provide test utils (e.g. FileCheck) +# - sys-devel/clang provides the compiler to run tests +DEPEND=" + ${RDEPEND} +" +BDEPEND=" + dev-lang/perl + offload? ( + llvm_targets_AMDGPU? ( sys-devel/clang ) + llvm_targets_NVPTX? ( sys-devel/clang ) + virtual/pkgconfig + ) + test? ( + ${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/lit[${PYTHON_USEDEP}] + ') + sys-devel/clang + ) +" + +LLVM_COMPONENTS=( openmp cmake llvm/include ) +llvm.org_set_globals + +kernel_pds_check() { + if use kernel_linux && kernel_is -lt 4 15 && kernel_is -ge 4 13; then + local CONFIG_CHECK="~!SCHED_PDS" + local ERROR_SCHED_PDS="\ +PDS scheduler versions >= 0.98c < 0.98i (e.g. used in kernels >= 4.13-pf11 +< 4.14-pf9) do not implement sched_yield() call which may result in horrible +performance problems with libomp. If you are using one of the specified +kernel versions, you may want to disable the PDS scheduler." + + check_extra_config + fi +} + +pkg_pretend() { + kernel_pds_check +} + +pkg_setup() { + if use gdb-plugin || use test; then + python-single-r1_pkg_setup + fi +} + +multilib_src_configure() { + use offload && llvm_prepend_path "${LLVM_MAJOR}" + + # LTO causes issues in other packages building, #870127 + filter-lto + + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" + + local build_omptarget=OFF + # upstream disallows building libomptarget when sizeof(void*) != 8 + if use offload && + "$(tc-getCC)" ${CFLAGS} ${CPPFLAGS} -c -x c - -o /dev/null \ + <<-EOF &>/dev/null + int test[sizeof(void *) == 8 ? 1 : -1]; + EOF + then + build_omptarget=ON + fi + + local libdir="$(get_libdir)" + local mycmakeargs=( + -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}" + + -DLIBOMP_USE_HWLOC=$(usex hwloc) + -DLIBOMP_OMPD_GDB_SUPPORT=$(multilib_native_usex gdb-plugin) + -DLIBOMP_OMPT_SUPPORT=$(usex ompt) + + -DOPENMP_ENABLE_LIBOMPTARGET=${build_omptarget} + + # do not install libgomp.so & libiomp5.so aliases + -DLIBOMP_INSTALL_ALIASES=OFF + # disable unnecessary hack copying stuff back to srcdir + -DLIBOMP_COPY_EXPORTS=OFF + ) + + if [[ ${build_omptarget} == ON ]]; then + local ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi) + local ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi) + mycmakeargs+=( + -DFFI_INCLUDE_DIR="${ffi_cflags#-I}" + -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}" + ) + + if has "${CHOST%%-*}" aarch64 powerpc64le x86_64; then + mycmakeargs+=( + -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=$(usex llvm_targets_AMDGPU) + -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=$(usex llvm_targets_NVPTX) + + # prevent trying to access the GPU + -DLIBOMPTARGET_AMDGPU_ARCH=LIBOMPTARGET_AMDGPU_ARCH-NOTFOUND + -DLIBOMPTARGET_NVPTX_ARCH=LIBOMPTARGET_NVPTX_ARCH-NOTFOUND + ) + else + mycmakeargs+=( + -DLIBOMPTARGET_BUILD_AMDGPU_PLUGIN=OFF + -DLIBOMPTARGET_BUILD_CUDA_PLUGIN=OFF + ) + fi + fi + + use test && mycmakeargs+=( + # this project does not use standard LLVM cmake macros + -DOPENMP_LLVM_LIT_EXECUTABLE="${EPREFIX}/usr/bin/lit" + -DOPENMP_LIT_ARGS="$(get_lit_flags)" + + -DOPENMP_TEST_C_COMPILER="$(type -P "${CHOST}-clang")" + -DOPENMP_TEST_CXX_COMPILER="$(type -P "${CHOST}-clang++")" + ) + addpredict /dev/nvidiactl + cmake_src_configure +} + +multilib_src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + + cmake_build check-libomp +} diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest index 3ea3d9e36836..3a413c02b88a 100644 --- a/sys-libs/llvm-libunwind/Manifest +++ b/sys-libs/llvm-libunwind/Manifest @@ -1,23 +1,18 @@ -DIST llvm-project-12735916bd3a63aa9f316af8eebfe9420cfec489.tar.gz 208645973 BLAKE2B 4a64dcaa15cb592634eceb384ecfc11173dbf0285402c32be2b8056374bb8ecef8fa1055fbe353a0836c84b75736cc05f3a14428bc431c18362cfaa7bf96a50a SHA512 ee42f7db322c84dfae3c67ffcfff2ee8d56d6bd4a0412b6bd4f8952ac1da4d57d18fa38011fe514631363b4cc143327be887792dd2e9562942261c99e655d948 DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 DIST llvm-project-16.0.6.src.tar.xz 118013488 BLAKE2B 95192d39cbd2914e5609db365965f1c00bfea6c2d653b3996bd2acef8a2b37e37f6fc8a9d2b65711ad72657e0ef52c42f733053cf65051e7822f27396c30406d SHA512 89a67ebfbbc764cc456e8825ecfa90707741f8835b1b2adffae0b227ab1fe5ca9cce75b0efaffc9ca8431cae528dc54fd838867a56a2b645344d9e82d19ab1b7 DIST llvm-project-16.0.6.src.tar.xz.sig 566 BLAKE2B 2060cebd5ed57cb8a86a44238c43dfd4b921649298b10c3d19da308374c1e49869174294e29943c2af459fe06428264e26881d6c1288ebbc48686cc2cf467c7a SHA512 ca249262c7102e0889ec1bdc6f71a3a6f0e7e5d5fbab8abcd6fccd2871e7955eff7af5b055a76006097baf0dfaf2f5069eff3035b3107fc552abdb2481b21447 DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e0654111941649e15794179641806f18919f1dc68c41ca0cabd5693b5096d05dccc3a391cd20d34af1137bf8af92ed3117a1ce84d1b2 SHA512 6d85bf749e0d77553cc215cbfa61cec4ac4f4f652847f56f946b6a892a99a5ea40b6ab8b39a9708a035001f007986941ccf17e4635260a8b0c1fa59e78d41e30 DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340 -DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783 -DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29 DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386 -DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07 DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1 +DIST llvm-project-f03cd2db91956456f1c5e2da86d3c50183eebd28.tar.gz 209375254 BLAKE2B 1d7e043d04323edb64b2ef2309fbcb4f82a959f45391e815133cc0891d5a497bbb81101aab460e9bf67e75aa906e13ad1877c3850829dcad397ed626dc8f2792 SHA512 6775e03a44b2133bd4a4b473ab007599321daa19dc7f3cc47f95cf9d110e83e982bf48a6b1d43038b0f0a2c0fef2f689aefd20132b25a90ef19342683e2d2e50 EBUILD llvm-libunwind-15.0.7.ebuild 3032 BLAKE2B 9b47e894db1a764f3eca3135f4caba68261953f4433af017b7bb53181e345ad26c570733f997022c53c9ef49a0a3b823188d92cfcc16a2113825d767b1ffab2a SHA512 0b68480fb2a8e5a351574e81fbcff824cd324754ed40378f06fec12fedbba94a921043d72db6ecc37f8b0680b7f518bbbd8d63f69ce8d84f86ca522653d293fb EBUILD llvm-libunwind-16.0.6-r1.ebuild 3440 BLAKE2B eafe21a3de172043ca0039ba27c80c64d32b02cc86bdb5a6d108ded35770e0352216337cbf24ee4fde43b699a68a85c8145be2d17510d525452bfd5a02674998 SHA512 164fdc1c62405e02c035af7997b8522b51f5b9337d2bb66d7fc9b1f45df74ec70d31b26dc5324c59792d32c543fe18abf74ed3b07a64c131e3c1bb4f9f733c5d EBUILD llvm-libunwind-17.0.6.ebuild 3440 BLAKE2B eafe21a3de172043ca0039ba27c80c64d32b02cc86bdb5a6d108ded35770e0352216337cbf24ee4fde43b699a68a85c8145be2d17510d525452bfd5a02674998 SHA512 164fdc1c62405e02c035af7997b8522b51f5b9337d2bb66d7fc9b1f45df74ec70d31b26dc5324c59792d32c543fe18abf74ed3b07a64c131e3c1bb4f9f733c5d -EBUILD llvm-libunwind-18.1.3.ebuild 3407 BLAKE2B 6c48a4e9caebd60890460e91e7e64324d66a97813023d582c869b0060468576de1b307160c435587f013ad632335a9968d61731ee4157c5d2272d817ee74a309 SHA512 919fda22d1de77a0db1c6fa14eeee7b6d7444af767e849aacdf952e9b66732c0ac06ae14a6dca2176a59df9738223e11ee8035d3c99bf0ea13799699fadb7d68 EBUILD llvm-libunwind-18.1.4.ebuild 3407 BLAKE2B 6c48a4e9caebd60890460e91e7e64324d66a97813023d582c869b0060468576de1b307160c435587f013ad632335a9968d61731ee4157c5d2272d817ee74a309 SHA512 919fda22d1de77a0db1c6fa14eeee7b6d7444af767e849aacdf952e9b66732c0ac06ae14a6dca2176a59df9738223e11ee8035d3c99bf0ea13799699fadb7d68 EBUILD llvm-libunwind-19.0.0.9999.ebuild 3316 BLAKE2B 013ff60e8fa1fa480e1e56c6c8c1d5a657d946264a279a8fad53e3047fcde1f439e10b25e151af0d9c3f7f6fe014c2cf3372d311f3963c78e633e986b28a33e5 SHA512 4aaa97553c0e3e5421fe5864b81fdcd0e8a1167e37bec37e8706d3b9b939b5220a171576f800bdc6ae25f2bbfd60b063c84934d1daa0bdfd6989a80d08044301 -EBUILD llvm-libunwind-19.0.0_pre20240330.ebuild 3316 BLAKE2B 013ff60e8fa1fa480e1e56c6c8c1d5a657d946264a279a8fad53e3047fcde1f439e10b25e151af0d9c3f7f6fe014c2cf3372d311f3963c78e633e986b28a33e5 SHA512 4aaa97553c0e3e5421fe5864b81fdcd0e8a1167e37bec37e8706d3b9b939b5220a171576f800bdc6ae25f2bbfd60b063c84934d1daa0bdfd6989a80d08044301 -EBUILD llvm-libunwind-19.0.0_pre20240404.ebuild 3316 BLAKE2B 013ff60e8fa1fa480e1e56c6c8c1d5a657d946264a279a8fad53e3047fcde1f439e10b25e151af0d9c3f7f6fe014c2cf3372d311f3963c78e633e986b28a33e5 SHA512 4aaa97553c0e3e5421fe5864b81fdcd0e8a1167e37bec37e8706d3b9b939b5220a171576f800bdc6ae25f2bbfd60b063c84934d1daa0bdfd6989a80d08044301 EBUILD llvm-libunwind-19.0.0_pre20240410.ebuild 3316 BLAKE2B 013ff60e8fa1fa480e1e56c6c8c1d5a657d946264a279a8fad53e3047fcde1f439e10b25e151af0d9c3f7f6fe014c2cf3372d311f3963c78e633e986b28a33e5 SHA512 4aaa97553c0e3e5421fe5864b81fdcd0e8a1167e37bec37e8706d3b9b939b5220a171576f800bdc6ae25f2bbfd60b063c84934d1daa0bdfd6989a80d08044301 +EBUILD llvm-libunwind-19.0.0_pre20240420.ebuild 3316 BLAKE2B 013ff60e8fa1fa480e1e56c6c8c1d5a657d946264a279a8fad53e3047fcde1f439e10b25e151af0d9c3f7f6fe014c2cf3372d311f3963c78e633e986b28a33e5 SHA512 4aaa97553c0e3e5421fe5864b81fdcd0e8a1167e37bec37e8706d3b9b939b5220a171576f800bdc6ae25f2bbfd60b063c84934d1daa0bdfd6989a80d08044301 MISC metadata.xml 438 BLAKE2B 2a36fbbc59e137056029c62aef6d167d9c82531c2582d7bad5cb13cc36e5c4c9518ffe8c56d06bbcfd97ad22eda71a8b776f3984195f53d06cf45659b438dc00 SHA512 4f18b054072d00e5440faa31a59f9ef587d035b5f25e30913f0b1449debee967fa794fae2548e87db3fb2177ce853ab075e1f11f3cc763f5d7fdf06147108845 diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-18.1.3.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-18.1.3.ebuild deleted file mode 100644 index 944fc4144f4e..000000000000 --- a/sys-libs/llvm-libunwind/llvm-libunwind-18.1.3.ebuild +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="C++ runtime stack unwinder from LLVM" -HOMEPAGE="https://llvm.org/docs/ExceptionHandling.html" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~arm64-macos ~x64-macos" -IUSE="+clang debug static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - !sys-libs/libunwind -" -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( - sys-devel/clang:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - ) -" - -LLVM_COMPONENTS=( runtimes libunwind libcxx llvm/cmake cmake ) -LLVM_TEST_COMPONENTS=( libcxxabi llvm/utils/llvm-lit ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -multilib_src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - local libdir=$(get_libdir) - - # https://github.com/llvm/llvm-project/issues/56825 - # also separately bug #863917 - filter-lto - - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link to compiler-rt - # https://github.com/gentoo/gentoo/pull/21516 - local use_compiler_rt=OFF - [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON - - # Respect upstream build type assumptions (bug #910436) where they do: - # -DLIBUNWIND_ENABLE_ASSERTIONS=ON => - # -DCMAKE_BUILD_TYPE=DEBUG => -UNDEBUG - # -DCMAKE_BUILD_TYPE!=debug => -DNDEBUG - # -DLIBUNWIND_ENABLE_ASSERTIONS=OFF => - # -UNDEBUG - # See also https://github.com/llvm/llvm-project/issues/86#issuecomment-1649668826. - use debug || append-cppflags -DNDEBUG - - local mycmakeargs=( - -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" - -DPython3_EXECUTABLE="${PYTHON}" - -DLLVM_ENABLE_RUNTIMES="libunwind" - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - -DLLVM_INCLUDE_TESTS=OFF - -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug) - -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs) - -DLIBUNWIND_INCLUDE_TESTS=$(usex test) - -DLIBUNWIND_INSTALL_HEADERS=ON - - # support non-native unwinding; given it's small enough, - # enable it unconditionally - -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON - - # avoid dependency on libgcc_s if compiler-rt is used - -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt} - ) - if use test; then - mycmakeargs+=( - -DLLVM_ENABLE_RUNTIMES="libunwind;libcxxabi;libcxx" - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx" - - -DLIBCXXABI_LIBDIR_SUFFIX= - -DLIBCXXABI_ENABLE_SHARED=OFF - -DLIBCXXABI_ENABLE_STATIC=ON - -DLIBCXXABI_USE_LLVM_UNWINDER=ON - -DLIBCXXABI_INCLUDE_TESTS=OFF - - -DLIBCXX_LIBDIR_SUFFIX= - -DLIBCXX_ENABLE_SHARED=OFF - -DLIBCXX_ENABLE_STATIC=ON - -DLIBCXX_CXX_ABI=libcxxabi - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) - -DLIBCXX_HAS_GCC_S_LIB=OFF - -DLIBCXX_INCLUDE_TESTS=OFF - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - ) - fi - - cmake_src_configure -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-unwind -} - -multilib_src_install() { - DESTDIR=${D} cmake_build install-unwind -} diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240330.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240330.ebuild deleted file mode 100644 index df7d3e6095bc..000000000000 --- a/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240330.ebuild +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="C++ runtime stack unwinder from LLVM" -HOMEPAGE="https://llvm.org/docs/ExceptionHandling.html" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -IUSE="+clang +debug static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - !sys-libs/libunwind -" -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( - sys-devel/clang:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - ) -" - -LLVM_COMPONENTS=( runtimes libunwind libcxx llvm/cmake cmake ) -LLVM_TEST_COMPONENTS=( libcxxabi llvm/utils/llvm-lit ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -multilib_src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - local libdir=$(get_libdir) - - # https://github.com/llvm/llvm-project/issues/56825 - # also separately bug #863917 - filter-lto - - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link to compiler-rt - # https://github.com/gentoo/gentoo/pull/21516 - local use_compiler_rt=OFF - [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON - - # Respect upstream build type assumptions (bug #910436) where they do: - # -DLIBUNWIND_ENABLE_ASSERTIONS=ON => - # -DCMAKE_BUILD_TYPE=DEBUG => -UNDEBUG - # -DCMAKE_BUILD_TYPE!=debug => -DNDEBUG - # -DLIBUNWIND_ENABLE_ASSERTIONS=OFF => - # -UNDEBUG - # See also https://github.com/llvm/llvm-project/issues/86#issuecomment-1649668826. - use debug || append-cppflags -DNDEBUG - - local mycmakeargs=( - -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" - -DPython3_EXECUTABLE="${PYTHON}" - -DLLVM_ENABLE_RUNTIMES="libunwind" - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - -DLLVM_INCLUDE_TESTS=OFF - -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug) - -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs) - -DLIBUNWIND_INCLUDE_TESTS=$(usex test) - -DLIBUNWIND_INSTALL_HEADERS=ON - - # support non-native unwinding; given it's small enough, - # enable it unconditionally - -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON - - # avoid dependency on libgcc_s if compiler-rt is used - -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt} - ) - if use test; then - mycmakeargs+=( - -DLLVM_ENABLE_RUNTIMES="libunwind;libcxxabi;libcxx" - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx" - - -DLIBCXXABI_LIBDIR_SUFFIX= - -DLIBCXXABI_ENABLE_SHARED=OFF - -DLIBCXXABI_ENABLE_STATIC=ON - -DLIBCXXABI_USE_LLVM_UNWINDER=ON - -DLIBCXXABI_INCLUDE_TESTS=OFF - - -DLIBCXX_LIBDIR_SUFFIX= - -DLIBCXX_ENABLE_SHARED=OFF - -DLIBCXX_ENABLE_STATIC=ON - -DLIBCXX_CXX_ABI=libcxxabi - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) - -DLIBCXX_HAS_GCC_S_LIB=OFF - -DLIBCXX_INCLUDE_TESTS=OFF - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - ) - fi - - cmake_src_configure -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-unwind -} - -multilib_src_install() { - DESTDIR=${D} cmake_build install-unwind -} diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240404.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240404.ebuild deleted file mode 100644 index df7d3e6095bc..000000000000 --- a/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240404.ebuild +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 -inherit toolchain-funcs - -DESCRIPTION="C++ runtime stack unwinder from LLVM" -HOMEPAGE="https://llvm.org/docs/ExceptionHandling.html" - -LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" -SLOT="0" -IUSE="+clang +debug static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - !sys-libs/libunwind -" -DEPEND=" - sys-devel/llvm:${LLVM_MAJOR} -" -BDEPEND=" - clang? ( - sys-devel/clang:${LLVM_MAJOR} - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - ) -" - -LLVM_COMPONENTS=( runtimes libunwind libcxx llvm/cmake cmake ) -LLVM_TEST_COMPONENTS=( libcxxabi llvm/utils/llvm-lit ) -llvm.org_set_globals - -python_check_deps() { - use test || return 0 - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -multilib_src_configure() { - llvm_prepend_path "${LLVM_MAJOR}" - - local libdir=$(get_libdir) - - # https://github.com/llvm/llvm-project/issues/56825 - # also separately bug #863917 - filter-lto - - if use clang; then - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link to compiler-rt - # https://github.com/gentoo/gentoo/pull/21516 - local use_compiler_rt=OFF - [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON - - # Respect upstream build type assumptions (bug #910436) where they do: - # -DLIBUNWIND_ENABLE_ASSERTIONS=ON => - # -DCMAKE_BUILD_TYPE=DEBUG => -UNDEBUG - # -DCMAKE_BUILD_TYPE!=debug => -DNDEBUG - # -DLIBUNWIND_ENABLE_ASSERTIONS=OFF => - # -UNDEBUG - # See also https://github.com/llvm/llvm-project/issues/86#issuecomment-1649668826. - use debug || append-cppflags -DNDEBUG - - local mycmakeargs=( - -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" - -DPython3_EXECUTABLE="${PYTHON}" - -DLLVM_ENABLE_RUNTIMES="libunwind" - -DLLVM_LIBDIR_SUFFIX=${libdir#lib} - -DLLVM_INCLUDE_TESTS=OFF - -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug) - -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs) - -DLIBUNWIND_INCLUDE_TESTS=$(usex test) - -DLIBUNWIND_INSTALL_HEADERS=ON - - # support non-native unwinding; given it's small enough, - # enable it unconditionally - -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON - - # avoid dependency on libgcc_s if compiler-rt is used - -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt} - ) - if use test; then - mycmakeargs+=( - -DLLVM_ENABLE_RUNTIMES="libunwind;libcxxabi;libcxx" - -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" - -DLLVM_LIT_ARGS="$(get_lit_flags)" - -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx" - - -DLIBCXXABI_LIBDIR_SUFFIX= - -DLIBCXXABI_ENABLE_SHARED=OFF - -DLIBCXXABI_ENABLE_STATIC=ON - -DLIBCXXABI_USE_LLVM_UNWINDER=ON - -DLIBCXXABI_INCLUDE_TESTS=OFF - - -DLIBCXX_LIBDIR_SUFFIX= - -DLIBCXX_ENABLE_SHARED=OFF - -DLIBCXX_ENABLE_STATIC=ON - -DLIBCXX_CXX_ABI=libcxxabi - -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF - -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) - -DLIBCXX_HAS_GCC_S_LIB=OFF - -DLIBCXX_INCLUDE_TESTS=OFF - -DLIBCXX_INCLUDE_BENCHMARKS=OFF - ) - fi - - cmake_src_configure -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-unwind -} - -multilib_src_install() { - DESTDIR=${D} cmake_build install-unwind -} diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240420.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240420.ebuild new file mode 100644 index 000000000000..df7d3e6095bc --- /dev/null +++ b/sys-libs/llvm-libunwind/llvm-libunwind-19.0.0_pre20240420.ebuild @@ -0,0 +1,128 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +inherit cmake-multilib flag-o-matic llvm.org llvm-utils python-any-r1 +inherit toolchain-funcs + +DESCRIPTION="C++ runtime stack unwinder from LLVM" +HOMEPAGE="https://llvm.org/docs/ExceptionHandling.html" + +LICENSE="Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )" +SLOT="0" +IUSE="+clang +debug static-libs test" +REQUIRED_USE="test? ( clang )" +RESTRICT="!test? ( test )" + +RDEPEND=" + !sys-libs/libunwind +" +DEPEND=" + sys-devel/llvm:${LLVM_MAJOR} +" +BDEPEND=" + clang? ( + sys-devel/clang:${LLVM_MAJOR} + ) + !test? ( + ${PYTHON_DEPS} + ) + test? ( + $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') + ) +" + +LLVM_COMPONENTS=( runtimes libunwind libcxx llvm/cmake cmake ) +LLVM_TEST_COMPONENTS=( libcxxabi llvm/utils/llvm-lit ) +llvm.org_set_globals + +python_check_deps() { + use test || return 0 + python_has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +multilib_src_configure() { + llvm_prepend_path "${LLVM_MAJOR}" + + local libdir=$(get_libdir) + + # https://github.com/llvm/llvm-project/issues/56825 + # also separately bug #863917 + filter-lto + + if use clang; then + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + strip-unsupported-flags + fi + + # link to compiler-rt + # https://github.com/gentoo/gentoo/pull/21516 + local use_compiler_rt=OFF + [[ $(tc-get-c-rtlib) == compiler-rt ]] && use_compiler_rt=ON + + # Respect upstream build type assumptions (bug #910436) where they do: + # -DLIBUNWIND_ENABLE_ASSERTIONS=ON => + # -DCMAKE_BUILD_TYPE=DEBUG => -UNDEBUG + # -DCMAKE_BUILD_TYPE!=debug => -DNDEBUG + # -DLIBUNWIND_ENABLE_ASSERTIONS=OFF => + # -UNDEBUG + # See also https://github.com/llvm/llvm-project/issues/86#issuecomment-1649668826. + use debug || append-cppflags -DNDEBUG + + local mycmakeargs=( + -DCMAKE_CXX_COMPILER_TARGET="${CHOST}" + -DPython3_EXECUTABLE="${PYTHON}" + -DLLVM_ENABLE_RUNTIMES="libunwind" + -DLLVM_LIBDIR_SUFFIX=${libdir#lib} + -DLLVM_INCLUDE_TESTS=OFF + -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug) + -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs) + -DLIBUNWIND_INCLUDE_TESTS=$(usex test) + -DLIBUNWIND_INSTALL_HEADERS=ON + + # support non-native unwinding; given it's small enough, + # enable it unconditionally + -DLIBUNWIND_ENABLE_CROSS_UNWINDING=ON + + # avoid dependency on libgcc_s if compiler-rt is used + -DLIBUNWIND_USE_COMPILER_RT=${use_compiler_rt} + ) + if use test; then + mycmakeargs+=( + -DLLVM_ENABLE_RUNTIMES="libunwind;libcxxabi;libcxx" + -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" + -DLLVM_LIT_ARGS="$(get_lit_flags)" + -DLIBUNWIND_LIBCXX_PATH="${WORKDIR}/libcxx" + + -DLIBCXXABI_LIBDIR_SUFFIX= + -DLIBCXXABI_ENABLE_SHARED=OFF + -DLIBCXXABI_ENABLE_STATIC=ON + -DLIBCXXABI_USE_LLVM_UNWINDER=ON + -DLIBCXXABI_INCLUDE_TESTS=OFF + + -DLIBCXX_LIBDIR_SUFFIX= + -DLIBCXX_ENABLE_SHARED=OFF + -DLIBCXX_ENABLE_STATIC=ON + -DLIBCXX_CXX_ABI=libcxxabi + -DLIBCXX_ENABLE_ABI_LINKER_SCRIPT=OFF + -DLIBCXX_HAS_MUSL_LIBC=$(usex elibc_musl) + -DLIBCXX_HAS_GCC_S_LIB=OFF + -DLIBCXX_INCLUDE_TESTS=OFF + -DLIBCXX_INCLUDE_BENCHMARKS=OFF + ) + fi + + cmake_src_configure +} + +multilib_src_test() { + local -x LIT_PRESERVES_TMP=1 + cmake_build check-unwind +} + +multilib_src_install() { + DESTDIR=${D} cmake_build install-unwind +} -- cgit v1.2.3