From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id AA8871382C5 for ; Sun, 27 Dec 2020 09:50:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 04DB3E0BE4; Sun, 27 Dec 2020 09:50:57 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D53A5E0BE4 for ; Sun, 27 Dec 2020 09:50:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CE8CA340FBE for ; Sun, 27 Dec 2020 09:50:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D92C5478 for ; Sun, 27 Dec 2020 09:50:52 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1609062573.597a22dec78d405170e09ec9f971d5146e0bfadf.grobian@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/compiler-rt-sanitizers/, sys-libs/compiler-rt-sanitizers/files/9999/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc1.ebuild sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc2.ebuild sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild sys-libs/compiler-rt-sanitizers/files/9999/compiler-rt-prefix-paths.patch X-VCS-Directories: sys-libs/compiler-rt-sanitizers/ sys-libs/compiler-rt-sanitizers/files/9999/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 597a22dec78d405170e09ec9f971d5146e0bfadf X-VCS-Branch: master Date: Sun, 27 Dec 2020 09:50:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 497d9757-03e3-4b22-9f35-d439e7556352 X-Archives-Hash: 8318c4f4401f235abfa51730d464b473 commit: 597a22dec78d405170e09ec9f971d5146e0bfadf Author: Jacob Floyd gmail com> AuthorDate: Sun Dec 20 22:03:21 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Dec 27 09:49:33 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=597a22de sys-libs/compiler-rt-sanitizers: Fix Darwin prefix paths Gentoo Prefix does not follow standard Apple practice of using --sysroot or --isysroot on everything because we have to account for two "root"s. 1) EPREFIX is "root" 2) EPREFIX/MacOSX.sdk is also sysroot as it provides system headers. So, adjust sys-libs/compiler-rt-sanitizers to prevent them from adding the sysroot flags on Darwin. Also adjust some CMAKE args to ensure it is using EPREFIX/MacOSX.sdk instead of looking things up with xcrun. Bug: https://bugs.gentoo.org/758167 Signed-off-by: Jacob Floyd gmail.com> Signed-off-by: Fabian Groffen gentoo.org> .../compiler-rt-sanitizers-11.0.0.ebuild | 15 +++- .../compiler-rt-sanitizers-11.0.1.9999.ebuild | 15 +++- .../compiler-rt-sanitizers-11.0.1_rc1.ebuild | 15 +++- .../compiler-rt-sanitizers-11.0.1_rc2.ebuild | 15 +++- .../compiler-rt-sanitizers-12.0.0.9999.ebuild | 15 +++- .../files/9999/compiler-rt-prefix-paths.patch | 79 ++++++++++++++++++++++ 6 files changed, 144 insertions(+), 10 deletions(-) diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild index 24deafb6666..f767718861c 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.0.ebuild @@ -35,6 +35,10 @@ BDEPEND=" sys-libs/compiler-rt:${SLOT} ) ${PYTHON_DEPS}" +PATCHES=( + "${FILESDIR}/9999/compiler-rt-prefix-paths.patch" +) + python_check_deps() { use test || return 0 has_version "dev-python/lit[${PYTHON_USEDEP}]" @@ -110,8 +114,15 @@ src_configure() { if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then mycmakeargs+=( - # disable use of SDK for the system itself - -DDARWIN_macosx_CACHED_SYSROOT=/ + # 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 while building tsan if 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 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild index 81547ee1605..14dbd46a8db 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1.9999.ebuild @@ -48,6 +48,10 @@ LLVM_COMPONENTS=( compiler-rt ) LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) llvm.org_set_globals +PATCHES=( + "${FILESDIR}/9999/compiler-rt-prefix-paths.patch" +) + python_check_deps() { use test || return 0 has_version "dev-python/lit[${PYTHON_USEDEP}]" @@ -145,8 +149,15 @@ src_configure() { if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then mycmakeargs+=( - # disable use of SDK for the system itself - -DDARWIN_macosx_CACHED_SYSROOT=/ + # 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 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc1.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc1.ebuild index 1e3a849c675..cc4d0af346b 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc1.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc1.ebuild @@ -37,6 +37,10 @@ LLVM_COMPONENTS=( compiler-rt ) LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) llvm.org_set_globals +PATCHES=( + "${FILESDIR}/9999/compiler-rt-prefix-paths.patch" +) + python_check_deps() { use test || return 0 has_version "dev-python/lit[${PYTHON_USEDEP}]" @@ -112,8 +116,15 @@ src_configure() { if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then mycmakeargs+=( - # disable use of SDK for the system itself - -DDARWIN_macosx_CACHED_SYSROOT=/ + # 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 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc2.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc2.ebuild index f5ea6f732f7..938e4e371e8 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc2.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-11.0.1_rc2.ebuild @@ -48,6 +48,10 @@ LLVM_COMPONENTS=( compiler-rt ) LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) llvm.org_set_globals +PATCHES=( + "${FILESDIR}/9999/compiler-rt-prefix-paths.patch" +) + python_check_deps() { use test || return 0 has_version "dev-python/lit[${PYTHON_USEDEP}]" @@ -149,8 +153,15 @@ src_configure() { if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then mycmakeargs+=( - # disable use of SDK for the system itself - -DDARWIN_macosx_CACHED_SYSROOT=/ + # 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 diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild index 81547ee1605..14dbd46a8db 100644 --- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild +++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-12.0.0.9999.ebuild @@ -48,6 +48,10 @@ LLVM_COMPONENTS=( compiler-rt ) LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest ) llvm.org_set_globals +PATCHES=( + "${FILESDIR}/9999/compiler-rt-prefix-paths.patch" +) + python_check_deps() { use test || return 0 has_version "dev-python/lit[${PYTHON_USEDEP}]" @@ -145,8 +149,15 @@ src_configure() { if use prefix && [[ "${CHOST}" == *-darwin* ]] ; then mycmakeargs+=( - # disable use of SDK for the system itself - -DDARWIN_macosx_CACHED_SYSROOT=/ + # 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 diff --git a/sys-libs/compiler-rt-sanitizers/files/9999/compiler-rt-prefix-paths.patch b/sys-libs/compiler-rt-sanitizers/files/9999/compiler-rt-prefix-paths.patch new file mode 100644 index 00000000000..c27e3c44f68 --- /dev/null +++ b/sys-libs/compiler-rt-sanitizers/files/9999/compiler-rt-prefix-paths.patch @@ -0,0 +1,79 @@ +--- a/compiler-rt/cmake/config-ix.cmake 2020-10-07 05:10:48.000000000 -0500 ++++ b/compiler-rt/cmake/config-ix.cmake 2020-12-13 16:17:43.000000000 -0600 +@@ -424,10 +424,7 @@ + ${DARWIN_COMMON_LINK_FLAGS} + ${DARWIN_osx_MIN_VER_FLAG}=${SANITIZER_MIN_OSX_VERSION}) + +- if(DARWIN_osx_SYSROOT) +- list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT}) +- list(APPEND DARWIN_osx_LINK_FLAGS -isysroot ${DARWIN_osx_SYSROOT}) +- endif() ++ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake) + + # Figure out which arches to use for each OS + darwin_get_toolchain_supported_archs(toolchain_arches) +--- a/compiler-rt/cmake/base-config-ix.cmake 2020-12-13 16:17:13.000000000 -0600 ++++ b/compiler-rt/cmake/base-config-ix.cmake 2020-12-13 16:18:59.000000000 -0600 +@@ -102,23 +102,8 @@ + endif() + + if(APPLE) +- # On Darwin if /usr/include/c++ doesn't exist, the user probably has Xcode but +- # not the command line tools (or is using macOS 10.14 or newer). If this is +- # the case, we need to find the OS X sysroot to pass to clang. +- if(NOT EXISTS /usr/include/c++) +- execute_process(COMMAND xcrun -sdk macosx --show-sdk-path +- OUTPUT_VARIABLE OSX_SYSROOT +- ERROR_QUIET +- OUTPUT_STRIP_TRAILING_WHITESPACE) +- if (NOT OSX_SYSROOT OR NOT EXISTS ${OSX_SYSROOT}) +- message(WARNING "Detected OSX_SYSROOT ${OSX_SYSROOT} does not exist") +- else() +- message(STATUS "Found OSX_SYSROOT: ${OSX_SYSROOT}") +- set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}") +- endif() +- else() +- set(OSX_SYSROOT_FLAG "") +- endif() ++ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake) ++ set(OSX_SYSROOT_FLAG "") + + option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" On) + option(COMPILER_RT_ENABLE_WATCHOS "Enable building for watchOS - Experimental" Off) +--- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 2020-10-07 05:10:48.000000000 -0500 ++++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake 2020-12-13 16:21:32.000000000 -0600 +@@ -273,7 +273,8 @@ + ${ARGN}) + set(libname "${name}.${suffix}_${LIB_ARCH}_${LIB_OS}") + add_library(${libname} STATIC ${LIB_SOURCES}) +- if(DARWIN_${LIB_OS}_SYSROOT) ++ # Do not add -isysroot flag on Gentoo Prefix (search paths handled by cmake) ++ if(DARWIN_${LIB_OS}_SYSROOT AND NOT "${LIB_OS}" STREQUAL "osx") + set(sysroot_flag -isysroot ${DARWIN_${LIB_OS}_SYSROOT}) + endif() + +--- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake 2020-10-07 05:10:48.000000000 -0500 ++++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake 2020-12-13 18:12:27.000000000 -0600 +@@ -277,9 +277,10 @@ + if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) + list(APPEND extra_cflags_${libname} "--target=${CMAKE_C_COMPILER_TARGET}") + endif() ++ # Do not add --sysroot flag on Gentoo Prefix (search paths handled by cmake) +- if(CMAKE_SYSROOT) ++ if(CMAKE_SYSROOT AND NOT APPLE) + list(APPEND extra_cflags_${libname} "--sysroot=${CMAKE_SYSROOT}") + endif() + string(REPLACE ";" " " extra_cflags_${libname} "${extra_cflags_${libname}}") + string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions + ${CMAKE_C_COMPILE_OBJECT}) +--- a/compiler-rt/lib/tsan/CMakeLists.txt 2020-12-13 19:42:02.000000000 -0600 ++++ b/compiler-rt/lib/tsan/CMakeLists.txt 2020-12-13 19:42:38.000000000 -0600 +@@ -244,6 +244,7 @@ + # and Clang's versions. As a workaround do not use --sysroot=. on FreeBSD/NetBSD + # until this is addressed. + if(COMPILER_RT_HAS_SYSROOT_FLAG AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD" ++ AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" + AND NOT CMAKE_SYSTEM_NAME MATCHES "NetBSD") + file(GLOB _tsan_generic_sources rtl/tsan*) + file(GLOB _tsan_platform_sources rtl/tsan*posix* rtl/tsan*mac* +