From c17e7d2a8cc12551a02d28209cd2edbf078d5675 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 20 Sep 2022 11:23:36 +0100 Subject: gentoo auto-resync : 20:09:2022 - 11:23:36 --- sys-libs/Manifest.gz | Bin 14237 -> 14248 bytes sys-libs/compiler-rt-sanitizers/Manifest | 2 +- .../compiler-rt-sanitizers-15.0.0.9999.ebuild | 220 --- .../compiler-rt-sanitizers-15.0.1.9999.ebuild | 220 +++ sys-libs/compiler-rt/Manifest | 2 +- .../compiler-rt/compiler-rt-15.0.0.9999.ebuild | 151 -- .../compiler-rt/compiler-rt-15.0.1.9999.ebuild | 151 ++ sys-libs/glibc/Manifest | 4 +- sys-libs/glibc/glibc-2.36-r1.ebuild | 1611 -------------------- sys-libs/glibc/glibc-2.36-r2.ebuild | 1611 ++++++++++++++++++++ sys-libs/libcxx/Manifest | 2 +- sys-libs/libcxx/libcxx-15.0.0.9999.ebuild | 226 --- sys-libs/libcxx/libcxx-15.0.1.9999.ebuild | 226 +++ sys-libs/libcxxabi/Manifest | 2 +- sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild | 128 -- sys-libs/libcxxabi/libcxxabi-15.0.1.9999.ebuild | 128 ++ sys-libs/libomp/Manifest | 2 +- sys-libs/libomp/libomp-15.0.0.9999.ebuild | 128 -- sys-libs/libomp/libomp-15.0.1.9999.ebuild | 128 ++ sys-libs/llvm-libunwind/Manifest | 2 +- .../llvm-libunwind-15.0.0.9999.ebuild | 127 -- .../llvm-libunwind-15.0.1.9999.ebuild | 127 ++ 22 files changed, 2599 insertions(+), 2599 deletions(-) delete mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-15.0.0.9999.ebuild create mode 100644 sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-15.0.1.9999.ebuild delete mode 100644 sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild create mode 100644 sys-libs/compiler-rt/compiler-rt-15.0.1.9999.ebuild delete mode 100644 sys-libs/glibc/glibc-2.36-r1.ebuild create mode 100644 sys-libs/glibc/glibc-2.36-r2.ebuild delete mode 100644 sys-libs/libcxx/libcxx-15.0.0.9999.ebuild create mode 100644 sys-libs/libcxx/libcxx-15.0.1.9999.ebuild delete mode 100644 sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild create mode 100644 sys-libs/libcxxabi/libcxxabi-15.0.1.9999.ebuild delete mode 100644 sys-libs/libomp/libomp-15.0.0.9999.ebuild create mode 100644 sys-libs/libomp/libomp-15.0.1.9999.ebuild delete mode 100644 sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild create mode 100644 sys-libs/llvm-libunwind/llvm-libunwind-15.0.1.9999.ebuild (limited to 'sys-libs') diff --git a/sys-libs/Manifest.gz b/sys-libs/Manifest.gz index 0f37c7d9a5b1..375aefa23a89 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 69ebdcd9823e..e052815fdd8c 100644 --- a/sys-libs/compiler-rt-sanitizers/Manifest +++ b/sys-libs/compiler-rt-sanitizers/Manifest @@ -12,8 +12,8 @@ DIST llvm-project-303526ef3aa211c1930be2885deae15eeeda3b18.tar.gz 167503164 BLAK DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f EBUILD compiler-rt-sanitizers-13.0.1.ebuild 6369 BLAKE2B 4e8a715cd19dd39087fe7d6cad9e30a7e130c69bde12ea382fc748cc152099607c23b75915c644785820ded954eaba31779f7c58b63a71255f9c6b610afcee7d SHA512 f5a680a5de09feecde1a3038ab185cc3b321eb2dc15b5841cd58863323fd6da727307c44127d2af5077ce2b17744ee5d3f8a17dd3bceea71b1dec2a13555dd66 EBUILD compiler-rt-sanitizers-14.0.6.ebuild 6381 BLAKE2B 010ce621c56c1568eaddeb6f4af6e680f2596106768e3b40bffd3c221df20b565c565793ff14a46b2a96b080a696a9217be0f547c2e85430e9031bd86adc2b90 SHA512 d68b96a7458c8b0d1946523a7c1b20e413de38b7f53bd87b8729103935cdb9ad8fc38863138ba36ffc8da57e0ddcf591c7deeb23fba0d76003adea978b262e37 -EBUILD compiler-rt-sanitizers-15.0.0.9999.ebuild 6325 BLAKE2B 6477a9afca51d95071229d9959af18ac6afebbc1348cbb26a4a9e1253e4a40d57604f74a138b027cf3ec07bffe7e001543a356e5fc5d173e5f83fadd8e646d4e SHA512 9c553af9ff3f8ad99ef2da81a86362abcfcadcbf5407565a60be6c79f9fb89f2ae1f536f8df03cc4f3f797d8019f29d0e949dcbf82f59d2e1b1fa316d9074db2 EBUILD compiler-rt-sanitizers-15.0.0.ebuild 6403 BLAKE2B ec6435ff9186e093602e7304aa3199583bb631d1faf1a872e82ba2123f76a427682eaceb090bf2042bea6fa9f4515b4b0e1ed5543f8398c3de3071a902e883f6 SHA512 74d4d8f0a372703bcbe2f2de63adf24352e68ee46aa332cf942a6df7090c5cd5bac8ed868307244e4d27f2dcd8f1530285c48049495b056f3c09d1d0291fbb22 +EBUILD compiler-rt-sanitizers-15.0.1.9999.ebuild 6325 BLAKE2B 6477a9afca51d95071229d9959af18ac6afebbc1348cbb26a4a9e1253e4a40d57604f74a138b027cf3ec07bffe7e001543a356e5fc5d173e5f83fadd8e646d4e SHA512 9c553af9ff3f8ad99ef2da81a86362abcfcadcbf5407565a60be6c79f9fb89f2ae1f536f8df03cc4f3f797d8019f29d0e949dcbf82f59d2e1b1fa316d9074db2 EBUILD compiler-rt-sanitizers-16.0.0.9999.ebuild 6325 BLAKE2B 6477a9afca51d95071229d9959af18ac6afebbc1348cbb26a4a9e1253e4a40d57604f74a138b027cf3ec07bffe7e001543a356e5fc5d173e5f83fadd8e646d4e SHA512 9c553af9ff3f8ad99ef2da81a86362abcfcadcbf5407565a60be6c79f9fb89f2ae1f536f8df03cc4f3f797d8019f29d0e949dcbf82f59d2e1b1fa316d9074db2 EBUILD compiler-rt-sanitizers-16.0.0_pre20220915.ebuild 6324 BLAKE2B 37416eae59029f44c9888d2ce96dabc2304036fe4ec549fee57da0c12615e210f02b3e462ef5b6024615af8a731f06178a82b1ab82c1f48fade1f7c133c8d95a SHA512 ebe2feca542ed78812dc5d5066b6108e1e217776504a2105b5cc7e7ed80c3b68369fc8ab43408c207a3c9c5754aaeac4431b60c1ed27b139cb21bef8ece44355 EBUILD compiler-rt-sanitizers-16.0.0_pre20220918.ebuild 6325 BLAKE2B 6477a9afca51d95071229d9959af18ac6afebbc1348cbb26a4a9e1253e4a40d57604f74a138b027cf3ec07bffe7e001543a356e5fc5d173e5f83fadd8e646d4e SHA512 9c553af9ff3f8ad99ef2da81a86362abcfcadcbf5407565a60be6c79f9fb89f2ae1f536f8df03cc4f3f797d8019f29d0e949dcbf82f59d2e1b1fa316d9074db2 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-15.0.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-15.0.0.9999.ebuild deleted file mode 100644 index f716dc74b423..000000000000 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-15.0.0.9999.ebuild +++ /dev/null @@ -1,220 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..11} ) -inherit check-reqs cmake flag-o-matic llvm llvm.org 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="$(ver_cut 1-3)" -KEYWORDS="" -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 ) -" - -LLVM_MAX_SLOT=${SLOT%%.*} -DEPEND=" - sys-devel/llvm:${LLVM_MAX_SLOT} - virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] -" -BDEPEND=" - >=dev-util/cmake-3.16 - clang? ( sys-devel/clang ) - elibc_glibc? ( net-libs/libtirpc ) - test? ( - !!=dev-python/lit-15[\${PYTHON_USEDEP}]") - =sys-devel/clang-${PV%_*}*:${LLVM_MAX_SLOT} - sys-libs/compiler-rt:${SLOT} - ) - !test? ( - ${PYTHON_DEPS} - ) -" - -LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) -LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) -LLVM_PATCHSET=9999-1 -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 - llvm_pkg_setup - 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 - - llvm.org_src_prepare -} - -src_configure() { - # 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/${SLOT}" - # 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/${SLOT}" - - -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_MAIN_SRC_DIR="${WORKDIR}/llvm" - -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_MAX_SLOT}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAX_SLOT}/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_MAX_SLOT}/bin/clang \ - CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAX_SLOT}/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/${SLOT}/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_MAX_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die - cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAX_SLOT}/bin/clang{,++} \ - "${BUILD_DIR}"/lib/llvm/${LLVM_MAX_SLOT}/bin/ || die - cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \ - "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die - cp "${sys_dir}"/*builtins*.a \ - "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die - # we also need LLVMgold.so for gold-based tests - if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAX_SLOT}/$(get_libdir)/LLVMgold.so ]]; then - ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAX_SLOT}/$(get_libdir)/LLVMgold.so \ - "${BUILD_DIR}"/lib/llvm/${LLVM_MAX_SLOT}/$(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-15.0.1.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-15.0.1.9999.ebuild new file mode 100644 index 000000000000..f716dc74b423 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-15.0.1.9999.ebuild @@ -0,0 +1,220 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) +inherit check-reqs cmake flag-o-matic llvm llvm.org 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="$(ver_cut 1-3)" +KEYWORDS="" +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 ) +" + +LLVM_MAX_SLOT=${SLOT%%.*} +DEPEND=" + sys-devel/llvm:${LLVM_MAX_SLOT} + virtual/libcrypt[abi_x86_32(-)?,abi_x86_64(-)?] +" +BDEPEND=" + >=dev-util/cmake-3.16 + clang? ( sys-devel/clang ) + elibc_glibc? ( net-libs/libtirpc ) + test? ( + !!=dev-python/lit-15[\${PYTHON_USEDEP}]") + =sys-devel/clang-${PV%_*}*:${LLVM_MAX_SLOT} + sys-libs/compiler-rt:${SLOT} + ) + !test? ( + ${PYTHON_DEPS} + ) +" + +LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) +LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) +LLVM_PATCHSET=9999-1 +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 + llvm_pkg_setup + 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 + + llvm.org_src_prepare +} + +src_configure() { + # 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/${SLOT}" + # 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/${SLOT}" + + -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_MAIN_SRC_DIR="${WORKDIR}/llvm" + -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_MAX_SLOT}/bin/clang" + -DCOMPILER_RT_TEST_CXX_COMPILER="${BUILD_DIR}/lib/llvm/${LLVM_MAX_SLOT}/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_MAX_SLOT}/bin/clang \ + CXX=${EPREFIX}/usr/lib/llvm/${LLVM_MAX_SLOT}/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/${SLOT}/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_MAX_SLOT}/{bin,$(get_libdir)},clang/${SLOT}/include} || die + cp "${EPREFIX}"/usr/lib/llvm/${LLVM_MAX_SLOT}/bin/clang{,++} \ + "${BUILD_DIR}"/lib/llvm/${LLVM_MAX_SLOT}/bin/ || die + cp "${EPREFIX}"/usr/lib/clang/${SLOT}/include/*.h \ + "${BUILD_DIR}"/lib/clang/${SLOT}/include/ || die + cp "${sys_dir}"/*builtins*.a \ + "${BUILD_DIR}/lib/clang/${SLOT}/lib/${sys_dir##*/}/" || die + # we also need LLVMgold.so for gold-based tests + if [[ -f ${EPREFIX}/usr/lib/llvm/${LLVM_MAX_SLOT}/$(get_libdir)/LLVMgold.so ]]; then + ln -s "${EPREFIX}"/usr/lib/llvm/${LLVM_MAX_SLOT}/$(get_libdir)/LLVMgold.so \ + "${BUILD_DIR}"/lib/llvm/${LLVM_MAX_SLOT}/$(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 c1ee3b707d03..da862c23eb74 100644 --- a/sys-libs/compiler-rt/Manifest +++ b/sys-libs/compiler-rt/Manifest @@ -13,8 +13,8 @@ DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69b EBUILD compiler-rt-13.0.1.ebuild 3880 BLAKE2B 83202517f413772d355aa49b5a3bd8b7000c86f6538da1a5ae96de5e84bc7536d0e639b530d1f504dc68b769565504434cc80d25426207b19283b9bc41df3388 SHA512 fe5329aee6c29d408c67af9e9891205fcdf313676780b948975f94ddce31b3f54e68cc041233c81b3005ff94f7685dcc09044f3634760d90e8c18c61f63651c3 EBUILD compiler-rt-14.0.6-r1.ebuild 4252 BLAKE2B 1fe9011c3d20a6e7f09683553e3e86151ce71e3667ce00fe4b5dd6dd8e932b8c9baa9e101f620467d813ffc1615c85e3522ce5732cee293d0bc2f8233c665bab SHA512 857bffe7b552c9e288b7f2e3cb67df1e2c8526b717df7a2bf7a1162de636ce90864a0ef1a9fec2c1f61702f6f491b5b12f6ce26964c133d339785ea7d67fc725 EBUILD compiler-rt-14.0.6.ebuild 4030 BLAKE2B 9881380671f25916b7a9356e14b45fd30b7c5cf5263fcf975b0d5ce0333389d519457dabaf1ac8dfc55f5206594335a5f996adcf26880f8a30c8a5ab99c3c391 SHA512 1ec4d79d5d319c5345caa7399c4d4bee5416af3952b9936f119764e17b1c05c25cc818a0c123c8b55ee31503e633999384d0a227a6c84d380cdbdc169f0f43ea -EBUILD compiler-rt-15.0.0.9999.ebuild 4183 BLAKE2B dc863bb9300dbf0b109642c9e79e6cd1c836209453f5f09e94d0bdb532336f9612af25c2154abe391998b66eddc6900593734570062800635985be4fccbd5581 SHA512 6e63963e9d6f4918714d97f37c69411ad95a7c0ffe03aacc96df829c35172e46b1595505a551063789988f2956674dbc7926128a8a03804458a8baca6280ab34 EBUILD compiler-rt-15.0.0.ebuild 4261 BLAKE2B 2cd705bacc8afa306b3299ba267dbd66133f6fceeff75c8620eb335809fe83753f9ffe5df4549e9849030612f63670e748a72be1f459c1af4e5dce57ddac5f0d SHA512 260a7dd4d6c0cdf663c408188db1996aec6c0bd5d898673bbfa6fe1d1a6ca9b19021dc19cdfad358bb65c5e878f8adbf2b4c4ec1f2446a84b8b6306c4a333e43 +EBUILD compiler-rt-15.0.1.9999.ebuild 4183 BLAKE2B dc863bb9300dbf0b109642c9e79e6cd1c836209453f5f09e94d0bdb532336f9612af25c2154abe391998b66eddc6900593734570062800635985be4fccbd5581 SHA512 6e63963e9d6f4918714d97f37c69411ad95a7c0ffe03aacc96df829c35172e46b1595505a551063789988f2956674dbc7926128a8a03804458a8baca6280ab34 EBUILD compiler-rt-16.0.0.9999.ebuild 4183 BLAKE2B dc863bb9300dbf0b109642c9e79e6cd1c836209453f5f09e94d0bdb532336f9612af25c2154abe391998b66eddc6900593734570062800635985be4fccbd5581 SHA512 6e63963e9d6f4918714d97f37c69411ad95a7c0ffe03aacc96df829c35172e46b1595505a551063789988f2956674dbc7926128a8a03804458a8baca6280ab34 EBUILD compiler-rt-16.0.0_pre20220915.ebuild 4182 BLAKE2B 1d46ef21d22d98bef33a67443e6e0b8e78e741c112b8fdc21dc31d534a86facc19d24eba3fea59885cb60b64910af2c5833ba38e8c60c5030f3cc7901d21ad59 SHA512 d577101ab64336b52825b3ea6863d82c64c6326022a8b31d44b1bc6fb23cf5823dcb53ddba049afe55f8f73903614b9ed754be32e0d71de5276ef9ad3fd05223 EBUILD compiler-rt-16.0.0_pre20220918.ebuild 4183 BLAKE2B dc863bb9300dbf0b109642c9e79e6cd1c836209453f5f09e94d0bdb532336f9612af25c2154abe391998b66eddc6900593734570062800635985be4fccbd5581 SHA512 6e63963e9d6f4918714d97f37c69411ad95a7c0ffe03aacc96df829c35172e46b1595505a551063789988f2956674dbc7926128a8a03804458a8baca6280ab34 diff --git a/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild b/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild deleted file mode 100644 index 236d4a319ccf..000000000000 --- a/sys-libs/compiler-rt/compiler-rt-15.0.0.9999.ebuild +++ /dev/null @@ -1,151 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..11} ) -inherit cmake flag-o-matic llvm llvm.org python-any-r1 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="$(ver_cut 1-3)" -KEYWORDS="" -IUSE="+abi_x86_32 abi_x86_64 +clang debug test" -RESTRICT="!test? ( test ) !clang? ( test )" - -LLVM_MAX_SLOT=${SLOT%%.*} -DEPEND=" - sys-devel/llvm:${LLVM_MAX_SLOT} -" -BDEPEND=" - >=dev-util/cmake-3.16 - clang? ( sys-devel/clang ) - test? ( - $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") - =sys-devel/clang-${PV%_*}*:${LLVM_MAX_SLOT} - ) - !test? ( - ${PYTHON_DEPS} - ) -" - -LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) -LLVM_PATCHSET=9999-1 -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() { - # Darwin Prefix builds do not have llvm installed yet, so rely on - # bootstrap-prefix to set the appropriate path vars to LLVM instead - # of using llvm_pkg_setup. - if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then - llvm_pkg_setup - fi - python-any-r1_pkg_setup -} - -test_compiler() { - $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - # 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; 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 ! 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/${SLOT}" - - -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; then - mycmakeargs+=( - -DCAN_TARGET_i386=$(usex abi_x86_32) - -DCAN_TARGET_x86_64=$(usex abi_x86_64) - ) - 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_MAX_SLOT}/bin/clang" - -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAX_SLOT}/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-15.0.1.9999.ebuild b/sys-libs/compiler-rt/compiler-rt-15.0.1.9999.ebuild new file mode 100644 index 000000000000..236d4a319ccf --- /dev/null +++ b/sys-libs/compiler-rt/compiler-rt-15.0.1.9999.ebuild @@ -0,0 +1,151 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) +inherit cmake flag-o-matic llvm llvm.org python-any-r1 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="$(ver_cut 1-3)" +KEYWORDS="" +IUSE="+abi_x86_32 abi_x86_64 +clang debug test" +RESTRICT="!test? ( test ) !clang? ( test )" + +LLVM_MAX_SLOT=${SLOT%%.*} +DEPEND=" + sys-devel/llvm:${LLVM_MAX_SLOT} +" +BDEPEND=" + >=dev-util/cmake-3.16 + clang? ( sys-devel/clang ) + test? ( + $(python_gen_any_dep ">=dev-python/lit-15[\${PYTHON_USEDEP}]") + =sys-devel/clang-${PV%_*}*:${LLVM_MAX_SLOT} + ) + !test? ( + ${PYTHON_DEPS} + ) +" + +LLVM_COMPONENTS=( compiler-rt cmake llvm/cmake ) +LLVM_PATCHSET=9999-1 +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() { + # Darwin Prefix builds do not have llvm installed yet, so rely on + # bootstrap-prefix to set the appropriate path vars to LLVM instead + # of using llvm_pkg_setup. + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then + llvm_pkg_setup + fi + python-any-r1_pkg_setup +} + +test_compiler() { + $(tc-getCC) ${CFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c - \ + <<<'int main() { return 0; }' &>/dev/null +} + +src_configure() { + # 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; 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 ! 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/${SLOT}" + + -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; then + mycmakeargs+=( + -DCAN_TARGET_i386=$(usex abi_x86_32) + -DCAN_TARGET_x86_64=$(usex abi_x86_64) + ) + 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_MAX_SLOT}/bin/clang" + -DCOMPILER_RT_TEST_CXX_COMPILER="${EPREFIX}/usr/lib/llvm/${LLVM_MAX_SLOT}/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 3215c9d6c316..e8a71ed3972b 100644 --- a/sys-libs/glibc/Manifest +++ b/sys-libs/glibc/Manifest @@ -30,7 +30,7 @@ DIST glibc-2.35-loongarch-patches-20220522.tar.xz 44728 BLAKE2B 09e7a061f3269ebd DIST glibc-2.35-patches-11.tar.xz 222648 BLAKE2B e4c9c9cd033a02183645993af112df20207de8fc51e8f889a567cea1e688dff5d95916a59c6184c0c8c8ca4958b33ba1748cb75185deeae3e15be5eeb49255c7 SHA512 db14b78a50a4fe537a082c8f596a30516b2d5e26958baee65e165e627efdd0e0d6df9393fbfd04062a3fa6f66ef3f9aac4981ffb4f644ef561417c743bbc8a3e DIST glibc-2.35-patches-9.tar.xz 183612 BLAKE2B 921664953ed39560ab850754209dbda1f71fbcc5bcc9ec21c187385ea659b90ea055e60961eca266ab3cc81213ed04747aa925dd96a352676fa19d2e63306968 SHA512 24c9ecb6ad890c95bc0e7db3e0c1f20768c728ac0590450fad05aed578623bc33d256d2c4d14a8d8e5c5e9fed7acfab3683053d236f51886cd5a6de93f925ddc DIST glibc-2.35.tar.xz 18165952 BLAKE2B 623c728884f070cd87ffeb9203f74206197c52405ac9bc44f3dd519a3468b8e8ae2536c883e5d17d94417dbd1e91775de2e674314e4ff7424f9720026d6b7063 SHA512 e7336ce27561be5d7c217832a1136fb327e057bd8d3f92925b35c97e3e9f9e486948b5a1e03e5e4090772ef06437a074d10b82e68f17f1ad8f22077ee39e1b66 -DIST glibc-2.36-patches-2.tar.xz 27096 BLAKE2B a7b6ead31476980a3e5851d060249184b7ad75faa2bec8b07fc1a45899eb81a983ab354514d8dd2c0a4c53b83c54587e7e982a9fece8354894f0f9f96c675368 SHA512 fb09cc4d7e96303322953bd597e30d1bf6ce17efd27d678d78addf18bf8fdeac7ad6c9313d15c17c71df99c0ea4f66aad2333365784caf6f381d26ccdfd186a8 +DIST glibc-2.36-patches-3.tar.xz 67004 BLAKE2B 185180e113c7aa257b9798577c4f7d80eea169efb02c8a91b203cad1cd65cc51b35e66cf9106978efd0d0c03c834e51e348f27097a04290aed7fec1158c7bc56 SHA512 704cca2d3aaa75694600af6e3aeb20fbebe97f6a03036334382cfd6752dfa0a091d772d350b085907a0722c53aac6fccd9df320ec2d4cd303eba36a3c0e0f39b DIST glibc-2.36.tar.xz 18610836 BLAKE2B f8375e084043f032609e66fd98c234249df57a595c59672acb1bb8c69aed64d339d526611553449492b097cda900ad1d9bae8873d7f5932b10a9a0d8c9210c55 SHA512 9ea0bbda32f83a85b7da0c34f169607fb8a102f0a11a914e6bf531be47d1bef4f5307128286cffa1e2dc5879f0e6ccaef527dd353486883fa332a0b44bde8b3e DIST glibc-systemd-20210729.tar.gz 1480 BLAKE2B 37722c7579df782d890e44dbab99c3de52ab466eb9de80d82405e9bb5620bf39ffc8c5f466a435bdb86ef6d36dd7019c0736573916bda6c67d02a2581e0ec979 SHA512 efd75af58b50522c28cdac7abd1fc56555bc1bb042512c90d8340c1ec09c5791b3872a305bf83723252bbde5855b75d958c041083457765c4cfd170732d09238 DIST glibc-systemd-20210814.tar.gz 1469 BLAKE2B 10fa7bcb46d4fdce9c0ab353cbd30871e9b09a347a13a9c9a3b5777f931aa3c826c158d2e49532c604d4a834f2fab4089b67495fb88d0398945dc50d45ad9ef1 SHA512 5346a9ea459a1e6ccf665389f2a294de1e16f1e3e05cdf07e3dd99ed0e4f6f8b52cc333d4bff3c75ac90ab6ce70cd4ab2b3e126f920ce7979abd6dda56315efc @@ -45,6 +45,6 @@ EBUILD glibc-2.33-r14.ebuild 48617 BLAKE2B bd3d13ab2419162e08cb204e279b1d570d5e6 EBUILD glibc-2.34-r14.ebuild 49608 BLAKE2B 387023eb99a184e90ae50a09375e9858307f458c4d48b487d50d83bbe571b0b186eeea1ce8a71bc1f243e4220b04eaf7426b75182157655fe44d31bbb60b4e6d SHA512 578c2f6599045b34410dc0905e35263325bb28fd73b6f5c8d487b432e966088b189e24fd16a1055efdf93128c5343db88b1adc514659f878aaefe2426ced56dc EBUILD glibc-2.35-r10.ebuild 49673 BLAKE2B a45f1fa2f44517eebbb9a0e6996a2dab4356a8d82600aa92c4b38053e4be16b1c9224c6774445cff6c89850d8ac0a0b7b49902342e3cb308878e7027e20c46a4 SHA512 1a9974afdd95d71358961fbe9391b7cc0e70d6eb1f81b48c2981d88fef244d365afeb978fdff73e27dfd0ae8663d1c0b0f333fd5a7d80e157711342063bb18d7 EBUILD glibc-2.35-r8.ebuild 49600 BLAKE2B fb94b2cffb0c865d09df914cacb735cc58d05d8bd01d38c6b54f04122b3aa52cb520bd3fa71430d2c994019cf340f33b4c52cb5990dce56a5739e016d86872d2 SHA512 5989fd748a51403724e2fa3ea70c2387840e3661923aa62749d178ff9bb0d23e81f39772800772ec551744f2c7ff3f9277fbd92ea8ce0f1b9fa91c581eb5c4c7 -EBUILD glibc-2.36-r1.ebuild 49863 BLAKE2B 02d88c87a4bc2870bfbb514a9d158ddbc144620de35dfd742da41fd31f56c609019010031c9e274b646ff6342d36522f44ddce7c8a9dc563d0f6a8ce8a4f826d SHA512 3196bbf2835f675a73f4c764eb86f0047093c3d3f8e6a439fe8d21f493a81351b8dab528146865d4b48bf98c15d928dfed147f02eb384d7026e3fa525496c107 +EBUILD glibc-2.36-r2.ebuild 49863 BLAKE2B 4533b76ee493c451c377a0acc4379ad514003c4878d0a88642747f8cdc11877a26e8f2a98260845e80d771e665c7d0535c6bd861b16a52991da67a9dc1dc04b2 SHA512 1685b928732103bfd79dda07331283ea3c77be2aa9c282d3dc4ea08d70e08ac36ef7f15e85f844ba0ec07fcd04f5e43a094c626f8ac9b1d32b2550be30025802 EBUILD glibc-9999.ebuild 49793 BLAKE2B 7e893dc3731e6720dbb75193492ae249a27ddff432f60ab56b39aa95d853ee22280eb34a501e160a70a67ec6b4fa65741883e2a93b27741ae025b4297729aed2 SHA512 c6e8ec4db042b40d111bb96f79fcf3956ab515cbd5c297e74fb2978b8c87948cc58366ad4e57aeb4099522a2960456c3e8811400f5dcf271ae22913bd172c2a1 MISC metadata.xml 1937 BLAKE2B 3c40fcba241335a5a9ca1e53e339fdd51b9304d723b177117c508ff56d152e1ddecde3a0c0bc95b0654c4289d3a87090ba8342d687594c119b3bc127f77b41aa SHA512 056c639e4ecf0f8046363db19de01c580bc0f5d754868ab82cf4fdf576058877a4b28c1516afd08d1afa4ac107b4f35cf8fe681254788382c8387cf03915d1c7 diff --git a/sys-libs/glibc/glibc-2.36-r1.ebuild b/sys-libs/glibc/glibc-2.36-r1.ebuild deleted file mode 100644 index 3b5e0a61d825..000000000000 --- a/sys-libs/glibc/glibc-2.36-r1.ebuild +++ /dev/null @@ -1,1611 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc -# Please read & adapt the page as necessary if obsolete. - -PYTHON_COMPAT=( python3_{8..11} ) -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 - -if [[ ${PV} == 9999* ]]; then - inherit git-r3 -else - #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" - KEYWORDS="~loong" - SRC_URI="mirror://gnu/glibc/${P}.tar.xz" - SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz" -fi - -RELEASE_VER=${PV} - -GCC_BOOTSTRAP_VER=20201208 - -LOCALE_GEN_VER=2.22 - -GLIBC_SYSTEMD_VER=20210729 - -SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${LOCALE_GEN_VER}.tar.gz" -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 +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla" - -# 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" - -# 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. -# 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. - -# gzip, grep, awk are needed by locale-gen, bug 740750 - -BDEPEND=" - ${PYTHON_DEPS} - >=app-misc/pax-utils-${MIN_PAX_UTILS_VER} - sys-devel/bison - doc? ( sys-apps/texinfo ) - !compile-locales? ( - app-arch/gzip - sys-apps/grep - virtual/awk - ) -" -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-util/systemtap ) -" -DEPEND="${COMMON_DEPEND} - compile-locales? ( - app-arch/gzip - sys-apps/grep - virtual/awk - ) - test? ( >=net-dns/libidn2-2.3.0 ) -" -RDEPEND="${COMMON_DEPEND} - app-arch/gzip - sys-apps/grep - virtual/awk - sys-apps/gentoo-functions - !' | $(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. - 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 - 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-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' - - # #492892 - filter-flags -frecord-gcc-switches - - # #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" - 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=' -} - -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=${__ORIG_CC:-${CC:-$(tc-getCC ${CTARGET})}} - export CXX=${__ORIG_CXX:-${CXX:-$(tc-getCXX ${CTARGET})}} - - # and make sure __ORIC_CC and __ORIG_CXX is defined now. - export __ORIG_CC=${CC} - export __ORIG_CXX=${CXX} - - if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; 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 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_CC=${CC} - export __GLIBC_CXX=${CXX} - - export __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_CC} ${__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_CXX} ${__abi_CFLAGS} ${CFLAGS}" - - if is_crosscompile; then - # Assume worst-case bootstrap: glibc is buil first time - # when ${CTARGET}-g++ is 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+=" p${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 - - # Users have had a chance to phase themselves, time to give em the boot - if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then - eerror "You still haven't deleted ${EROOT}/etc/locales.build." - eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher." - die "Lazy upgrader detected" - 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() { - 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() { - # 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-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz - fi - - cd "${WORKDIR}" || die - unpack locale-gen-${LOCALE_GEN_VER}.tar.gz - use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz -} - -src_prepare() { - local patchsetname - if ! use vanilla ; then - if [[ ${PV} == 9999* ]] ; then - patchsetname="from git master" - else - patchsetname="${RELEASE_VER}-${PATCH_VER}" - fi - einfo "Applying Gentoo Glibc Patchset ${patchsetname}" - eapply "${WORKDIR}"/patches - einfo "Done." - fi - - eapply "${FILESDIR}"/2.35/glibc-2.35-make-4.4-MAKEFLAGS.patch - - default - - gnuconfig_update - - cd "${WORKDIR}" - find . -name configure -exec touch {} + - - # move the external locale-gen to its old place - mkdir extra || die - mv locale-gen-${LOCALE_GEN_VER} extra/locale || die - - eprefixify extra/locale/locale-gen - - # Fix permissions on some of the scripts. - chmod u+x "${S}"/scripts/*.sh - - cd "${S}" -} - -glibc_do_configure() { - - local v - for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM AR AS STRIP RANLIB OBJCOPY STRINGS OBJDUMP READELF; do - einfo " $(printf '%15s' ${v}:) ${!v}" - done - - echo - 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) ;; - # Blacklist everywhere else - *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;; - esac - - # Enable Intel Control-flow Enforcement Technology on amd64 if requested - case ${CTARGET} in - x86_64-*) 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 - --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_enable crypt) - $(use_multiarch || echo --disable-multi-arch) - $(use_enable systemtap) - $(use_enable nscd) - - # locale data is arch-independent - # https://bugs.gentoo.org/753740 - libc_cv_complocaledir='${exec_prefix}/lib/locale' - - # -march= option tricks build system to infer too - # high ISA level: https://sourceware.org/PR27318 - libc_cv_include_x86_isa_level=no - # Explicit override of https://sourceware.org/PR27991 - # exposes a bug in glibc's configure: - # https://sourceware.org/PR27991 - libc_cv_have_x86_lahf_sahf=no - libc_cv_have_x86_movbe=no - - ${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" - - # ia64 static cross-compilers are a pita in so much that they - # can't produce static ELFs (as the libgcc.a is broken). so - # disable building of the programs for those targets if it - # doesn't work. - # XXX: We could turn this into a compiler test, but ia64 is - # the only one that matters, so this should be fine for now. - if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then - sed -i '1i+link-static = touch $@' config.make - fi - - # 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 'main(){}' > "${T}"/test.c - 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,ia64,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 - - case ${CTARGET} in - 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 - - local myconf=() - 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" - $(use_enable crypt) - ${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 -} - -do_src_compile() { - emake -C "$(builddir nptl)" -} - -src_compile() { - if just_headers ; then - return - fi - - foreach_abi do_src_compile -} - -glibc_src_test() { - cd "$(builddir nptl)" - - local myxfailparams="" - if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then - 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 -} - -do_src_test() { - local ret=0 - - glibc_src_test - : $(( ret |= $? )) - - return ${ret} -} - -src_test() { - if just_headers ; then - return - fi - - # Give tests more time to complete. - export TIMEOUTFACTOR=5 - - foreach_abi do_src_test || die "tests failed" -} - -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 - - set -- locale-gen ${inplace} --jobs $(makeopts_jobs) --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 libpthreas symbols. stripping breaks it - # See Note [Disable automatic stripping] - dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.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'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 "${WORKDIR}"/extra/locale - dosbin locale-gen - doman *.[0-8] - insinto /etc - doins locale.gen - - keepdir /usr/lib/locale - - cd "${S}" - - # 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}/" - sed -e 's:COMPILED_LOCALES="":COMPILED_LOCALES="1":' -i "${ED}"/usr/sbin/locale-gen || die - 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 - - # 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 ! use crypt && 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 -} - -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 - 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.36-r2.ebuild b/sys-libs/glibc/glibc-2.36-r2.ebuild new file mode 100644 index 000000000000..665006b33b60 --- /dev/null +++ b/sys-libs/glibc/glibc-2.36-r2.ebuild @@ -0,0 +1,1611 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# Bumping notes: https://wiki.gentoo.org/wiki/Project:Toolchain/sys-libs/glibc +# Please read & adapt the page as necessary if obsolete. + +PYTHON_COMPAT=( python3_{8..11} ) +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=3 +PATCH_DEV=dilfridge + +if [[ ${PV} == 9999* ]]; then + inherit git-r3 +else + #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + KEYWORDS="~loong" + SRC_URI="mirror://gnu/glibc/${P}.tar.xz" + SRC_URI+=" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz" +fi + +RELEASE_VER=${PV} + +GCC_BOOTSTRAP_VER=20201208 + +LOCALE_GEN_VER=2.22 + +GLIBC_SYSTEMD_VER=20210729 + +SRC_URI+=" https://gitweb.gentoo.org/proj/locale-gen.git/snapshot/locale-gen-${LOCALE_GEN_VER}.tar.gz" +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 +crypt custom-cflags doc gd headers-only +multiarch multilib multilib-bootstrap nscd profile selinux +ssp stack-realign +static-libs suid systemd systemtap test vanilla" + +# 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" + +# 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. +# 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. + +# gzip, grep, awk are needed by locale-gen, bug 740750 + +BDEPEND=" + ${PYTHON_DEPS} + >=app-misc/pax-utils-${MIN_PAX_UTILS_VER} + sys-devel/bison + doc? ( sys-apps/texinfo ) + !compile-locales? ( + app-arch/gzip + sys-apps/grep + virtual/awk + ) +" +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-util/systemtap ) +" +DEPEND="${COMMON_DEPEND} + compile-locales? ( + app-arch/gzip + sys-apps/grep + virtual/awk + ) + test? ( >=net-dns/libidn2-2.3.0 ) +" +RDEPEND="${COMMON_DEPEND} + app-arch/gzip + sys-apps/grep + virtual/awk + sys-apps/gentoo-functions + !' | $(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. + 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 + 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-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' + + # #492892 + filter-flags -frecord-gcc-switches + + # #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" + 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=' +} + +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=${__ORIG_CC:-${CC:-$(tc-getCC ${CTARGET})}} + export CXX=${__ORIG_CXX:-${CXX:-$(tc-getCXX ${CTARGET})}} + + # and make sure __ORIC_CC and __ORIG_CXX is defined now. + export __ORIG_CC=${CC} + export __ORIG_CXX=${CXX} + + if tc-is-clang && ! use custom-cflags && ! is_crosscompile ; 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 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_CC=${CC} + export __GLIBC_CXX=${CXX} + + export __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_CC} ${__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_CXX} ${__abi_CFLAGS} ${CFLAGS}" + + if is_crosscompile; then + # Assume worst-case bootstrap: glibc is buil first time + # when ${CTARGET}-g++ is 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+=" p${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 + + # Users have had a chance to phase themselves, time to give em the boot + if [[ -e ${EROOT}/etc/locale.gen ]] && [[ -e ${EROOT}/etc/locales.build ]] ; then + eerror "You still haven't deleted ${EROOT}/etc/locales.build." + eerror "Do so now after making sure ${EROOT}/etc/locale.gen is kosher." + die "Lazy upgrader detected" + 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() { + 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() { + # 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-${RELEASE_VER}-patches-${PATCH_VER}.tar.xz + fi + + cd "${WORKDIR}" || die + unpack locale-gen-${LOCALE_GEN_VER}.tar.gz + use systemd && unpack glibc-systemd-${GLIBC_SYSTEMD_VER}.tar.gz +} + +src_prepare() { + local patchsetname + if ! use vanilla ; then + if [[ ${PV} == 9999* ]] ; then + patchsetname="from git master" + else + patchsetname="${RELEASE_VER}-${PATCH_VER}" + fi + einfo "Applying Gentoo Glibc Patchset ${patchsetname}" + eapply "${WORKDIR}"/patches + einfo "Done." + fi + + eapply "${FILESDIR}"/2.35/glibc-2.35-make-4.4-MAKEFLAGS.patch + + default + + gnuconfig_update + + cd "${WORKDIR}" + find . -name configure -exec touch {} + + + # move the external locale-gen to its old place + mkdir extra || die + mv locale-gen-${LOCALE_GEN_VER} extra/locale || die + + eprefixify extra/locale/locale-gen + + # Fix permissions on some of the scripts. + chmod u+x "${S}"/scripts/*.sh + + cd "${S}" +} + +glibc_do_configure() { + + local v + for v in ABI CBUILD CHOST CTARGET CBUILD_OPT CTARGET_OPT CC CXX LD {AS,C,CPP,CXX,LD}FLAGS MAKEINFO NM AR AS STRIP RANLIB OBJCOPY STRINGS OBJDUMP READELF; do + einfo " $(printf '%15s' ${v}:) ${!v}" + done + + echo + 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) ;; + # Blacklist everywhere else + *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;; + esac + + # Enable Intel Control-flow Enforcement Technology on amd64 if requested + case ${CTARGET} in + x86_64-*) 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 + --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_enable crypt) + $(use_multiarch || echo --disable-multi-arch) + $(use_enable systemtap) + $(use_enable nscd) + + # locale data is arch-independent + # https://bugs.gentoo.org/753740 + libc_cv_complocaledir='${exec_prefix}/lib/locale' + + # -march= option tricks build system to infer too + # high ISA level: https://sourceware.org/PR27318 + libc_cv_include_x86_isa_level=no + # Explicit override of https://sourceware.org/PR27991 + # exposes a bug in glibc's configure: + # https://sourceware.org/PR27991 + libc_cv_have_x86_lahf_sahf=no + libc_cv_have_x86_movbe=no + + ${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" + + # ia64 static cross-compilers are a pita in so much that they + # can't produce static ELFs (as the libgcc.a is broken). so + # disable building of the programs for those targets if it + # doesn't work. + # XXX: We could turn this into a compiler test, but ia64 is + # the only one that matters, so this should be fine for now. + if is_crosscompile && [[ ${CTARGET} == ia64* ]] ; then + sed -i '1i+link-static = touch $@' config.make + fi + + # 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 'main(){}' > "${T}"/test.c + 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,ia64,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 + + case ${CTARGET} in + 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 + + local myconf=() + 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" + $(use_enable crypt) + ${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 +} + +do_src_compile() { + emake -C "$(builddir nptl)" +} + +src_compile() { + if just_headers ; then + return + fi + + foreach_abi do_src_compile +} + +glibc_src_test() { + cd "$(builddir nptl)" + + local myxfailparams="" + if [[ "${GENTOO_GLIBC_XFAIL_TESTS}" == "yes" ]] ; then + 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 +} + +do_src_test() { + local ret=0 + + glibc_src_test + : $(( ret |= $? )) + + return ${ret} +} + +src_test() { + if just_headers ; then + return + fi + + # Give tests more time to complete. + export TIMEOUTFACTOR=5 + + foreach_abi do_src_test || die "tests failed" +} + +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 + + set -- locale-gen ${inplace} --jobs $(makeopts_jobs) --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 libpthreas symbols. stripping breaks it + # See Note [Disable automatic stripping] + dostrip -x $(alt_libdir)/libpthread-${upstream_pv}.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'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 "${WORKDIR}"/extra/locale + dosbin locale-gen + doman *.[0-8] + insinto /etc + doins locale.gen + + keepdir /usr/lib/locale + + cd "${S}" + + # 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}/" + sed -e 's:COMPILED_LOCALES="":COMPILED_LOCALES="1":' -i "${ED}"/usr/sbin/locale-gen || die + 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 + + # 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 ! use crypt && 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 +} + +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 + 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 72916f70e093..b8b5b1d81160 100644 --- a/sys-libs/libcxx/Manifest +++ b/sys-libs/libcxx/Manifest @@ -9,8 +9,8 @@ DIST llvm-project-303526ef3aa211c1930be2885deae15eeeda3b18.tar.gz 167503164 BLAK DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f EBUILD libcxx-13.0.1.ebuild 6768 BLAKE2B 71b0f62e35538d718d99e3d43447f98752933868d999bf831969a6940d3a817452789c2044e9ca3bb4d5d1f0c2976fc276c4d10cb018c44e0cc6109095d9c6d6 SHA512 a12023fa135a7945e8088b34421f575cab32bb8ac53f1aeaa61bcf2a7b9fe045a6e21efba168056ef47b165ef3100e382100f910c84dee972017de6355d2e9c0 EBUILD libcxx-14.0.6.ebuild 6948 BLAKE2B 203e04f4e2603ec0b8e3cd672ca2458c971e4ec3c1d24ea65f85db143561d349d9b7e4b4a58f7c57f5c0caa519e5a79f99f0a76c404aeba47b0bcc683adcb572 SHA512 c1a353dd558c68d439ab66e089e26993e66f1729f7879912413531bbd89318338649dccde1f84a32784de380997d2611d6b7cf86841feb47c3c0c8d67bfe28df -EBUILD libcxx-15.0.0.9999.ebuild 6032 BLAKE2B 2c175eb985c128a7f026017df48b0ae570333ef76baf18ef782905f4b1b9496a7949ee03d96ba5342b596c45e53001d0a57b42abf3fecda9ea9d80649aa1d2a4 SHA512 9b35653834dc11ca1186acdcdafaf979e52de62d0ed9846cca858ea5d8a20ea52de6010ee024799decaa730a43d9f562a5e50320cfe875eb48161d81afba0097 EBUILD libcxx-15.0.0.ebuild 6080 BLAKE2B 50c1bc2fe69e0fa31d06f1ec83f740615b6ce934f3c191832c49358b126da6629d00ab167104e43a1976b6a30cf2fac12401964c7c55e26044253666997eb978 SHA512 925ee29c8d2b63ef156abd4c20993ed194d3e6c4935c1ed14922beecbfcae05cc0eb95f36fb7861a9d185be75acec2f73f249973a51928745d3faed9e914d378 +EBUILD libcxx-15.0.1.9999.ebuild 6032 BLAKE2B 2c175eb985c128a7f026017df48b0ae570333ef76baf18ef782905f4b1b9496a7949ee03d96ba5342b596c45e53001d0a57b42abf3fecda9ea9d80649aa1d2a4 SHA512 9b35653834dc11ca1186acdcdafaf979e52de62d0ed9846cca858ea5d8a20ea52de6010ee024799decaa730a43d9f562a5e50320cfe875eb48161d81afba0097 EBUILD libcxx-16.0.0.9999.ebuild 6032 BLAKE2B 2c175eb985c128a7f026017df48b0ae570333ef76baf18ef782905f4b1b9496a7949ee03d96ba5342b596c45e53001d0a57b42abf3fecda9ea9d80649aa1d2a4 SHA512 9b35653834dc11ca1186acdcdafaf979e52de62d0ed9846cca858ea5d8a20ea52de6010ee024799decaa730a43d9f562a5e50320cfe875eb48161d81afba0097 EBUILD libcxx-16.0.0_pre20220915.ebuild 6032 BLAKE2B 2c175eb985c128a7f026017df48b0ae570333ef76baf18ef782905f4b1b9496a7949ee03d96ba5342b596c45e53001d0a57b42abf3fecda9ea9d80649aa1d2a4 SHA512 9b35653834dc11ca1186acdcdafaf979e52de62d0ed9846cca858ea5d8a20ea52de6010ee024799decaa730a43d9f562a5e50320cfe875eb48161d81afba0097 EBUILD libcxx-16.0.0_pre20220918.ebuild 6032 BLAKE2B 2c175eb985c128a7f026017df48b0ae570333ef76baf18ef782905f4b1b9496a7949ee03d96ba5342b596c45e53001d0a57b42abf3fecda9ea9d80649aa1d2a4 SHA512 9b35653834dc11ca1186acdcdafaf979e52de62d0ed9846cca858ea5d8a20ea52de6010ee024799decaa730a43d9f562a5e50320cfe875eb48161d81afba0097 diff --git a/sys-libs/libcxx/libcxx-15.0.0.9999.ebuild b/sys-libs/libcxx/libcxx-15.0.0.9999.ebuild deleted file mode 100644 index 07049e01ed34..000000000000 --- a/sys-libs/libcxx/libcxx-15.0.0.9999.ebuild +++ /dev/null @@ -1,226 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..11} ) -inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ - 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="" -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] ) -" -# llvm-6 for new lit options -# clang-3.9.0 installs necessary target symlinks unconditionally -# which removes the need for MULTILIB_USEDEP -DEPEND=" - ${RDEPEND} - >=sys-devel/llvm-6 -" -BDEPEND=" - clang? ( - sys-devel/clang - ) - !test? ( - ${PYTHON_DEPS} - ) - test? ( - >=dev-util/cmake-3.16 - sys-devel/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() { - # Darwin Prefix builds do not have llvm installed yet, so rely on - # bootstrap-prefix to set the appropriate path vars to LLVM instead - # of using llvm_pkg_setup. - if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then - llvm_pkg_setup - fi - 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 -} - -test_compiler() { - $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ - <<<'int main() { return 0; }' &>/dev/null -} - -src_configure() { - # 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 && ! tc-is-clang; then - # Only do this conditionally to allow overriding with - # e.g. CC=clang-13 in case of breakage - local -x CC=${CHOST}-clang - local -x CXX=${CHOST}-clang++ - strip-unsupported-flags - fi - - # link against compiler-rt instead of libgcc if this is what clang does - local want_compiler_rt=OFF - if tc-is-clang; then - local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ - ${LDFLAGS} -print-libgcc-file-name) - if [[ ${compiler_rt} == *libclang_rt* ]]; then - want_compiler_rt=ON - fi - fi - - # 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=${want_compiler_rt} - ) - - if use test; then - local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) - [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" - - 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 -} - -pkg_postinst() { - elog "This package (${PN}) is mainly intended as a replacement for the C++" - elog "standard library when using clang." - elog "To use it, instead of libstdc++, use:" - elog " clang++ -stdlib=libc++" - elog "to compile your C++ programs." -} diff --git a/sys-libs/libcxx/libcxx-15.0.1.9999.ebuild b/sys-libs/libcxx/libcxx-15.0.1.9999.ebuild new file mode 100644 index 000000000000..07049e01ed34 --- /dev/null +++ b/sys-libs/libcxx/libcxx-15.0.1.9999.ebuild @@ -0,0 +1,226 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) +inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ + 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="" +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] ) +" +# llvm-6 for new lit options +# clang-3.9.0 installs necessary target symlinks unconditionally +# which removes the need for MULTILIB_USEDEP +DEPEND=" + ${RDEPEND} + >=sys-devel/llvm-6 +" +BDEPEND=" + clang? ( + sys-devel/clang + ) + !test? ( + ${PYTHON_DEPS} + ) + test? ( + >=dev-util/cmake-3.16 + sys-devel/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() { + # Darwin Prefix builds do not have llvm installed yet, so rely on + # bootstrap-prefix to set the appropriate path vars to LLVM instead + # of using llvm_pkg_setup. + if [[ ${CHOST} != *-darwin* ]] || has_version dev-lang/llvm; then + llvm_pkg_setup + fi + 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 +} + +test_compiler() { + $(tc-getCXX) ${CXXFLAGS} ${LDFLAGS} "${@}" -o /dev/null -x c++ - \ + <<<'int main() { return 0; }' &>/dev/null +} + +src_configure() { + # 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 && ! tc-is-clang; then + # Only do this conditionally to allow overriding with + # e.g. CC=clang-13 in case of breakage + local -x CC=${CHOST}-clang + local -x CXX=${CHOST}-clang++ + strip-unsupported-flags + fi + + # link against compiler-rt instead of libgcc if this is what clang does + local want_compiler_rt=OFF + if tc-is-clang; then + local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ + ${LDFLAGS} -print-libgcc-file-name) + if [[ ${compiler_rt} == *libclang_rt* ]]; then + want_compiler_rt=ON + fi + fi + + # 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=${want_compiler_rt} + ) + + if use test; then + local clang_path=$(type -P "${CHOST:+${CHOST}-}clang" 2>/dev/null) + [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" + + 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 +} + +pkg_postinst() { + elog "This package (${PN}) is mainly intended as a replacement for the C++" + elog "standard library when using clang." + elog "To use it, instead of libstdc++, use:" + elog " clang++ -stdlib=libc++" + elog "to compile your C++ programs." +} diff --git a/sys-libs/libcxxabi/Manifest b/sys-libs/libcxxabi/Manifest index 639fa1ab26bd..1d43b2d39ea7 100644 --- a/sys-libs/libcxxabi/Manifest +++ b/sys-libs/libcxxabi/Manifest @@ -7,8 +7,8 @@ DIST llvm-project-303526ef3aa211c1930be2885deae15eeeda3b18.tar.gz 167503164 BLAK DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f EBUILD libcxxabi-13.0.1.ebuild 3593 BLAKE2B 2e8717a8dadf431dc4360e4cee5d74875153f375f241388e3cc47410c9ecf4c97f2641c276927a99c6643460bbd1f7bddae72b06e7994e162cc1e7f3fd5e4fbe SHA512 4c943fe5483f94329e3f9390c8ddeaf89dc168220696fd5eb00692e7458d6ff92d3b37343bd6de23df70eea814243aee75bc8d75681ecb944a66cf37562fbdf7 EBUILD libcxxabi-14.0.6.ebuild 3509 BLAKE2B e6fa29bba6fcc72fa1c049ba696fd9cb6b34b0d89be89e449a21a9ba31c2e01d944ca15b1414043ba1def938dbdca144c37fdecdd39158dc3932ca7b7587f428 SHA512 4cd09cc7b0a0df878d2e2594750a80a18ee6aa09b195cb190ed8432464ec2563ea7b026d2748e6e0d198091e54e07aabdadc7f68919a3a81a4079d67262054f2 -EBUILD libcxxabi-15.0.0.9999.ebuild 3291 BLAKE2B 4b65300aaa146a9a864ae63fc829c0a0ca8e44f07a19a5b7bf3c13f26bc26340a81479f0f29483b7b1ecad810de7701d92fc247b34340e7d2d674dc554213f09 SHA512 cb6fdea8f3964ec39d350652ffa8a913758298eb22ccbe9a70f4ffd26f40b04747a13b88382c5dd64cc9a45541165b2df966bd2d3f3b0f9ec063e38e9640e052 EBUILD libcxxabi-15.0.0.ebuild 3339 BLAKE2B 2fa9fdaefa07c7acb984c41365ad894150d30ecde568436bbe5cd5f55b1a2b25aad7a6880d4915979c5402e0252ba860b5fbe8d5aaa4ff276698c8530ede90be SHA512 0fe88d8e1ceb47885738f44b2fab2b9a737b2e0257ec5a0dffe359c5cf1921f9f0893f04f3e75c2715b74b12e63b7c20952d461f73768b5f3aef165de2e79b8b +EBUILD libcxxabi-15.0.1.9999.ebuild 3291 BLAKE2B 4b65300aaa146a9a864ae63fc829c0a0ca8e44f07a19a5b7bf3c13f26bc26340a81479f0f29483b7b1ecad810de7701d92fc247b34340e7d2d674dc554213f09 SHA512 cb6fdea8f3964ec39d350652ffa8a913758298eb22ccbe9a70f4ffd26f40b04747a13b88382c5dd64cc9a45541165b2df966bd2d3f3b0f9ec063e38e9640e052 EBUILD libcxxabi-16.0.0.9999.ebuild 3291 BLAKE2B 4b65300aaa146a9a864ae63fc829c0a0ca8e44f07a19a5b7bf3c13f26bc26340a81479f0f29483b7b1ecad810de7701d92fc247b34340e7d2d674dc554213f09 SHA512 cb6fdea8f3964ec39d350652ffa8a913758298eb22ccbe9a70f4ffd26f40b04747a13b88382c5dd64cc9a45541165b2df966bd2d3f3b0f9ec063e38e9640e052 EBUILD libcxxabi-16.0.0_pre20220915.ebuild 3291 BLAKE2B 4b65300aaa146a9a864ae63fc829c0a0ca8e44f07a19a5b7bf3c13f26bc26340a81479f0f29483b7b1ecad810de7701d92fc247b34340e7d2d674dc554213f09 SHA512 cb6fdea8f3964ec39d350652ffa8a913758298eb22ccbe9a70f4ffd26f40b04747a13b88382c5dd64cc9a45541165b2df966bd2d3f3b0f9ec063e38e9640e052 EBUILD libcxxabi-16.0.0_pre20220918.ebuild 3291 BLAKE2B 4b65300aaa146a9a864ae63fc829c0a0ca8e44f07a19a5b7bf3c13f26bc26340a81479f0f29483b7b1ecad810de7701d92fc247b34340e7d2d674dc554213f09 SHA512 cb6fdea8f3964ec39d350652ffa8a913758298eb22ccbe9a70f4ffd26f40b04747a13b88382c5dd64cc9a45541165b2df966bd2d3f3b0f9ec063e38e9640e052 diff --git a/sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild deleted file mode 100644 index 893a76363592..000000000000 --- a/sys-libs/libcxxabi/libcxxabi-15.0.0.9999.ebuild +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..11} ) -inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ - 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="" -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) - [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" - - 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_build cxxabi -} - -multilib_src_test() { - local -x LIT_PRESERVES_TMP=1 - cmake_build check-cxxabi -} - -multilib_src_install() { - DESTDIR="${D}" cmake_build install-cxxabi -} diff --git a/sys-libs/libcxxabi/libcxxabi-15.0.1.9999.ebuild b/sys-libs/libcxxabi/libcxxabi-15.0.1.9999.ebuild new file mode 100644 index 000000000000..893a76363592 --- /dev/null +++ b/sys-libs/libcxxabi/libcxxabi-15.0.1.9999.ebuild @@ -0,0 +1,128 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) +inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ + 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="" +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) + [[ -n ${clang_path} ]] || die "Unable to find ${CHOST}-clang for tests" + + 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_build cxxabi +} + +multilib_src_test() { + local -x LIT_PRESERVES_TMP=1 + cmake_build check-cxxabi +} + +multilib_src_install() { + DESTDIR="${D}" cmake_build install-cxxabi +} diff --git a/sys-libs/libomp/Manifest b/sys-libs/libomp/Manifest index 1783aef189ee..b44cf5eb3e1d 100644 --- a/sys-libs/libomp/Manifest +++ b/sys-libs/libomp/Manifest @@ -9,8 +9,8 @@ DIST llvm-project-303526ef3aa211c1930be2885deae15eeeda3b18.tar.gz 167503164 BLAK DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f EBUILD libomp-13.0.1.ebuild 3824 BLAKE2B 0279bdb26184ae64679d3f0550edcf2c92d79075b009363d747497f6900bc72689cf739130f93789b3f915cdd3b2545403d7c8406357d3e19a9462769cbbdb47 SHA512 8afe5b22d8ddcdc960f3d59610d088fd48c2717e930df6d14eda0a66f830d5e85437b03163bff9a4ed86aa2dc8e7e36d31af1fd6e3ece967366d02ee1f5fc03d EBUILD libomp-14.0.6-r1.ebuild 3834 BLAKE2B a4cf91535d7fa11de76c0216c71ec695422395d165b109ea7462f13f74e7bd0d42c4f460d0d054847d9b3900253ec8ea79ec756b2a5522bb84056fdf4f71a45e SHA512 c3a106baeb7786c079463434cab720139ec93c7055838062faaa7167cf9417ab5e80b7775edcb15f28d05ad6b647f71e92c284008833bbf849ae2a69f8e93372 -EBUILD libomp-15.0.0.9999.ebuild 3238 BLAKE2B fafb13944cc61b270ee0e2a6ae6d91ca9bfd84bc9d19a3b07f170a055ba74733135d0766d9ec225c47256f2c49a73a9dafd45b5faffa3b746dd84a9efd7c79a5 SHA512 9670c82e79a3c74da35937a5ac0b3bab90988434a9135e38aa7a47ebff207b8a7baa5b2f37b3f8e3922b99927f73f1d3314983fae84b81391c9d8b4590d386f5 EBUILD libomp-15.0.0.ebuild 3304 BLAKE2B 56e88732e220b9db120373b23ac22022a4f004fe16cad74e901eca92fd1d9fdd9806b23e0aa0702ea126de11c597f5d218f15d44a4f53ffe17e265ff26d529df SHA512 c39eafaf1fa1cca970fc67c4501f9e260d02fc140572d3c41ce98b5cef3ee4a8b187f3601b9549c0095d9d6fe3155e9e282cc195468ccbbf3fcb4612d36eed8e +EBUILD libomp-15.0.1.9999.ebuild 3238 BLAKE2B fafb13944cc61b270ee0e2a6ae6d91ca9bfd84bc9d19a3b07f170a055ba74733135d0766d9ec225c47256f2c49a73a9dafd45b5faffa3b746dd84a9efd7c79a5 SHA512 9670c82e79a3c74da35937a5ac0b3bab90988434a9135e38aa7a47ebff207b8a7baa5b2f37b3f8e3922b99927f73f1d3314983fae84b81391c9d8b4590d386f5 EBUILD libomp-16.0.0.9999.ebuild 3327 BLAKE2B a08b75142261e7b7883cf50882ecb58c61033ac3903156c44eb9aa8199feffaaed9c64caa315107ec74635be8411cebd27100401e87c59a38ca4c3f9f703d745 SHA512 34073aa6cde91649f9b3549a8e48459b421931e62b7177d870fa1084ac3efacc011cd10900e8adfc1e2861be4cd1797fb45a5a4237660e8b3a01203759e3d449 EBUILD libomp-16.0.0_pre20220915.ebuild 3327 BLAKE2B a08b75142261e7b7883cf50882ecb58c61033ac3903156c44eb9aa8199feffaaed9c64caa315107ec74635be8411cebd27100401e87c59a38ca4c3f9f703d745 SHA512 34073aa6cde91649f9b3549a8e48459b421931e62b7177d870fa1084ac3efacc011cd10900e8adfc1e2861be4cd1797fb45a5a4237660e8b3a01203759e3d449 EBUILD libomp-16.0.0_pre20220918.ebuild 3327 BLAKE2B a08b75142261e7b7883cf50882ecb58c61033ac3903156c44eb9aa8199feffaaed9c64caa315107ec74635be8411cebd27100401e87c59a38ca4c3f9f703d745 SHA512 34073aa6cde91649f9b3549a8e48459b421931e62b7177d870fa1084ac3efacc011cd10900e8adfc1e2861be4cd1797fb45a5a4237660e8b3a01203759e3d449 diff --git a/sys-libs/libomp/libomp-15.0.0.9999.ebuild b/sys-libs/libomp/libomp-15.0.0.9999.ebuild deleted file mode 100644 index 0baa3f18fd8b..000000000000 --- a/sys-libs/libomp/libomp-15.0.0.9999.ebuild +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..11} ) -inherit cmake-multilib linux-info llvm llvm.org python-any-r1 - -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" -KEYWORDS="" -IUSE=" - debug hwloc offload ompt test - llvm_targets_AMDGPU llvm_targets_NVPTX -" -RESTRICT="!test? ( test )" - -RDEPEND=" - hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] ) - offload? ( - virtual/libelf:=[${MULTILIB_USEDEP}] - dev-libs/libffi:=[${MULTILIB_USEDEP}] - ~sys-devel/llvm-${PV}[${MULTILIB_USEDEP}] - ) -" -# 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_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') - sys-devel/clang - ) -" - -LLVM_COMPONENTS=( openmp cmake llvm/include ) -llvm.org_set_globals - -python_check_deps() { - python_has_version "dev-python/lit[${PYTHON_USEDEP}]" -} - -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() { - use offload && LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup - use test && python-any-r1_pkg_setup -} - -multilib_src_configure() { - # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 - use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" - - local libdir="$(get_libdir)" - local mycmakeargs=( - -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}" - - -DLIBOMP_USE_HWLOC=$(usex hwloc) - -DLIBOMP_OMPT_SUPPORT=$(usex ompt) - - -DOPENMP_ENABLE_LIBOMPTARGET=$(usex offload) - - # 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 use offload; then - 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) - ) - 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-15.0.1.9999.ebuild b/sys-libs/libomp/libomp-15.0.1.9999.ebuild new file mode 100644 index 000000000000..0baa3f18fd8b --- /dev/null +++ b/sys-libs/libomp/libomp-15.0.1.9999.ebuild @@ -0,0 +1,128 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) +inherit cmake-multilib linux-info llvm llvm.org python-any-r1 + +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" +KEYWORDS="" +IUSE=" + debug hwloc offload ompt test + llvm_targets_AMDGPU llvm_targets_NVPTX +" +RESTRICT="!test? ( test )" + +RDEPEND=" + hwloc? ( >=sys-apps/hwloc-2.5:0=[${MULTILIB_USEDEP}] ) + offload? ( + virtual/libelf:=[${MULTILIB_USEDEP}] + dev-libs/libffi:=[${MULTILIB_USEDEP}] + ~sys-devel/llvm-${PV}[${MULTILIB_USEDEP}] + ) +" +# 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_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') + sys-devel/clang + ) +" + +LLVM_COMPONENTS=( openmp cmake llvm/include ) +llvm.org_set_globals + +python_check_deps() { + python_has_version "dev-python/lit[${PYTHON_USEDEP}]" +} + +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() { + use offload && LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup + use test && python-any-r1_pkg_setup +} + +multilib_src_configure() { + # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 + use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG" + + local libdir="$(get_libdir)" + local mycmakeargs=( + -DOPENMP_LIBDIR_SUFFIX="${libdir#lib}" + + -DLIBOMP_USE_HWLOC=$(usex hwloc) + -DLIBOMP_OMPT_SUPPORT=$(usex ompt) + + -DOPENMP_ENABLE_LIBOMPTARGET=$(usex offload) + + # 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 use offload; then + 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) + ) + 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 2a2a578348d5..cd8f5caf84eb 100644 --- a/sys-libs/llvm-libunwind/Manifest +++ b/sys-libs/llvm-libunwind/Manifest @@ -10,7 +10,7 @@ DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69b EBUILD llvm-libunwind-13.0.1-r1.ebuild 3912 BLAKE2B 4d66504181497e9234ce0192dc75d68dd89652739f5b40f4ce5a6bac927b128be1f45feb0e960650d06fb4086592b6833f51972b77e908c525cf5257b88e3908 SHA512 70ca5f5567e654c33524b459f000dba8aa9b93c0b108ad88bd3eed3d7154904e6c775d54a0d9245d9f41d6229ae42a74ed6ed6728e31e94feae253106f463e53 EBUILD llvm-libunwind-14.0.6-r1.ebuild 3301 BLAKE2B 838c03d69e46a441ccbd7d9524fbde37e02c2f8ffa607ccdecf9fd7073a0d733d305457e574456dd519b7449825a538208e3b308235a65d687c4e76321f1b415 SHA512 acb17241c88b5a6ff0bbebe215a48bf603cc16f1e94f11f51a0b6d6934c940cf9b56c5c6090c96f64f4f6db1826764e7028d990cc7d44cb6a528639518820ac2 EBUILD llvm-libunwind-15.0.0-r1.ebuild 3211 BLAKE2B 3b571057d64e66c251162fcca18ef7ccbac88502d9b3e361b517db79ac678b20a046f4a9a1918db5b2eeb05e97c63acd6fa3547ce1bf36edaacb5b86ca59d46c SHA512 17b1cdae0f7e86b1508c3b479902e1b3ebf082678b267bf0b2970dfdafcd2db7d5e049ad031aaaf4c05d61e079860bbc56d985719d7308c8e94ae993440df122 -EBUILD llvm-libunwind-15.0.0.9999.ebuild 3151 BLAKE2B 3a4ae553d69ce72fb64c7cf23d87d41d06927107049708d397e40c6fccda5b0477aea36cd7b06ac2e631b30c1b52ef52f6e2a48d32e889c487a2007c7fb7b91c SHA512 5c6df3a28f4d565ac296efe4fe65b872a56a01037d590fc893ae3304756e6eeb0c60f10e8e78e2e09c496fb22ddaa85e3386d810e1f7271af9df9f46c2d39c96 +EBUILD llvm-libunwind-15.0.1.9999.ebuild 3151 BLAKE2B 3a4ae553d69ce72fb64c7cf23d87d41d06927107049708d397e40c6fccda5b0477aea36cd7b06ac2e631b30c1b52ef52f6e2a48d32e889c487a2007c7fb7b91c SHA512 5c6df3a28f4d565ac296efe4fe65b872a56a01037d590fc893ae3304756e6eeb0c60f10e8e78e2e09c496fb22ddaa85e3386d810e1f7271af9df9f46c2d39c96 EBUILD llvm-libunwind-16.0.0.9999.ebuild 3151 BLAKE2B 3a4ae553d69ce72fb64c7cf23d87d41d06927107049708d397e40c6fccda5b0477aea36cd7b06ac2e631b30c1b52ef52f6e2a48d32e889c487a2007c7fb7b91c SHA512 5c6df3a28f4d565ac296efe4fe65b872a56a01037d590fc893ae3304756e6eeb0c60f10e8e78e2e09c496fb22ddaa85e3386d810e1f7271af9df9f46c2d39c96 EBUILD llvm-libunwind-16.0.0_pre20220915.ebuild 3171 BLAKE2B 03585a3024f9960d8fc2e2fb1a236ad049ab1318f7456288106289d762af0f07948736f38acb4f492942bfc90ccf66bc8141e0f63d6944f073d9447fd117300e SHA512 0c70bac02cbce95fbbcdd53da594f3f682b675ed17cc6131ce78f0713b4ebc4c6d6574ef71c2819b1b82c69d84a2766e35f805086a19bb3f8dfb97bfd0a05da6 EBUILD llvm-libunwind-16.0.0_pre20220918.ebuild 3151 BLAKE2B 3a4ae553d69ce72fb64c7cf23d87d41d06927107049708d397e40c6fccda5b0477aea36cd7b06ac2e631b30c1b52ef52f6e2a48d32e889c487a2007c7fb7b91c SHA512 5c6df3a28f4d565ac296efe4fe65b872a56a01037d590fc893ae3304756e6eeb0c60f10e8e78e2e09c496fb22ddaa85e3386d810e1f7271af9df9f46c2d39c96 diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild deleted file mode 100644 index c682d12707f2..000000000000 --- a/sys-libs/llvm-libunwind/llvm-libunwind-15.0.0.9999.ebuild +++ /dev/null @@ -1,127 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{8..11} ) -inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ - 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="" -IUSE="+clang debug static-libs test" -REQUIRED_USE="test? ( clang )" -RESTRICT="!test? ( test )" - -RDEPEND=" - !sys-libs/libunwind -" -# llvm-6 for new lit options -DEPEND=" - >=sys-devel/llvm-6 -" -BDEPEND=" - clang? ( - sys-devel/clang - ) - !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() { - local use_compiler_rt=OFF - local libdir=$(get_libdir) - - # https://github.com/llvm/llvm-project/issues/56825 - # also separately bug #863917 - filter-lto - - if use clang && ! tc-is-clang; then - # Only do this conditionally to allow overriding with - # e.g. CC=clang-13 in case of breakage - 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 - if tc-is-clang; then - local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ - ${LD_FLAGS} -print-libgcc-file-name) - if [[ ${compiler_rt} == *libclang_rt* ]]; then - use_compiler_rt=ON - fi - fi - - 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-15.0.1.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.1.9999.ebuild new file mode 100644 index 000000000000..c682d12707f2 --- /dev/null +++ b/sys-libs/llvm-libunwind/llvm-libunwind-15.0.1.9999.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..11} ) +inherit cmake-multilib flag-o-matic llvm llvm.org python-any-r1 \ + 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="" +IUSE="+clang debug static-libs test" +REQUIRED_USE="test? ( clang )" +RESTRICT="!test? ( test )" + +RDEPEND=" + !sys-libs/libunwind +" +# llvm-6 for new lit options +DEPEND=" + >=sys-devel/llvm-6 +" +BDEPEND=" + clang? ( + sys-devel/clang + ) + !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() { + local use_compiler_rt=OFF + local libdir=$(get_libdir) + + # https://github.com/llvm/llvm-project/issues/56825 + # also separately bug #863917 + filter-lto + + if use clang && ! tc-is-clang; then + # Only do this conditionally to allow overriding with + # e.g. CC=clang-13 in case of breakage + 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 + if tc-is-clang; then + local compiler_rt=$($(tc-getCC) ${CFLAGS} ${CPPFLAGS} \ + ${LD_FLAGS} -print-libgcc-file-name) + if [[ ${compiler_rt} == *libclang_rt* ]]; then + use_compiler_rt=ON + fi + fi + + 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