Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 677521 Details for
Bug 757513
Re-enable building newer cmake on clang-based darwin prefix
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bootstrap-prefix.sh modifications for bootstrapping cmake with clang
0001-Fix-bootstrapping-cmake-with-clang-on-darwin.patch (text/plain), 4.47 KB, created by
Jacob Floyd
on 2020-12-10 04:10:43 UTC
(
hide
)
Description:
bootstrap-prefix.sh modifications for bootstrapping cmake with clang
Filename:
MIME Type:
Creator:
Jacob Floyd
Created:
2020-12-10 04:10:43 UTC
Size:
4.47 KB
patch
obsolete
>From 1134e15cfdcf59314babfad4a116b4c6128fc6ac Mon Sep 17 00:00:00 2001 >From: Jacob Floyd <jacob.floyd@copart.com> >Date: Wed, 2 Dec 2020 20:28:19 -0600 >Subject: [PATCH 1/4] Fix bootstrapping cmake with clang on darwin > >This is for the clang-based bootstrap. > >Uses C_INCLUDE_PATH and CPLUS_INCLUDE_PATH env vars to add the >darwin-specific include paths. It uses EPREFIX/MacOSX.sdk similar to the >DARWIN_USE_GCC bootstrap. > >Also, this should work with either CommandLineTools or Xcode provided >developer compiler + headers. > >Bug: https://bugs.gentoo.org/757513 > >Signed-off-by: Jacob Floyd <cognifloyd@gmail.com> >--- > scripts/bootstrap-prefix.sh | 47 ++++++++++++++++++++++++++++++------- > 1 file changed, 38 insertions(+), 9 deletions(-) > >diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh >index c6a79b1ec5..e8471bde99 100755 >--- a/scripts/bootstrap-prefix.sh >+++ b/scripts/bootstrap-prefix.sh >@@ -91,6 +91,27 @@ efetch() { > return 0 > } > >+darwin_symlink_sdk() { >+ # setup MacOSX.sdk symlink for GCC/clang, this should probably be >+ # managed using an eselect module in the future >+ rm -f "${ROOT}/MacOSX.sdk" >+ local SDKPATH=$(xcrun --show-sdk-path --sdk macosx) >+ local SDKVERSION=$(xcrun --show-sdk-version --sdk macosx) >+ ( cd ${ROOT} && ln -s "${SDKPATH}" MacOSX.sdk ) >+ einfo "using system sources (${SDKVERSION}) from: ${SDKPATH}" >+} >+ >+darwin_include_paths_for_clang() { >+ # only used on clang-based darwin installs >+ >+ local XCODE_PATH=$(xcode-select -p) >+ # Xcode.app path is deeper than CommandLineTools path >+ [[ "${XCODE_PATH}" == */CommandLineTools ]] || XCODE_PATH+="/Toolchains/XcodeDefault.xctoolchain" >+ >+ export C_INCLUDE_PATH="${ROOT}/MacOSX.sdk/usr/include" >+ export CPLUS_INCLUDE_PATH="${XCODE_PATH}/usr/include/c++/v1:${C_INCLUDE_PATH}" >+} >+ > configure_cflags() { > export CPPFLAGS="-I${ROOT}/tmp/usr/include" > >@@ -242,6 +263,10 @@ configure_toolchain() { > CC=clang > CXX=clang++ > linker=sys-devel/binutils-apple >+ if [[ ! -d /usr/include ]]; then >+ darwin_symlink_sdk >+ export INCLUDE_EPREFIX_DARWIN_SDK=1 >+ fi > ;; > *"Apple LLVM version "*) > vers=${ccvers#*Apple LLVM version } >@@ -507,13 +532,7 @@ bootstrap_setup() { > esac > > if [[ ${DARWIN_USE_GCC} == 1 ]] ; then >- # setup MacOSX.sdk symlink for GCC, this should probably be >- # managed using an eselect module in the future >- rm -f "${ROOT}"/MacOSX.sdk >- local SDKPATH=$(xcrun --show-sdk-path --sdk macosx) >- ( cd "${ROOT}" && ln -s "${SDKPATH}" MacOSX.sdk ) >- einfo "using system sources from ${SDKPATH}" >- >+ darwin_symlink_sdk > # amend profile, to use gcc one > profile="${profile}/gcc" > fi >@@ -535,6 +554,14 @@ bootstrap_setup() { > # Use package.use to disable in the portage tree to be shared between > # stage2 and stage3. The hack will be undone during tree sync in stage3. > cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF >+ # rhash (dep of cmake) configure can't find the openssl/libressl. >+ # ssl use flag allows RHash to "use optimized algorithms" >+ # but rhash will work fine without, so disable during bootstrap. >+ app-crypt/rhash -ssl >+ # sys-libs/jsoncpp cannot be installed in stage2 and early stage3 >+ # because jsoncpp requires meson which is not available yet. >+ # So, cmake needs to temporarily bootstrap its own jsconcpp. >+ dev-util/cmake -system-jsoncpp > # Most binary Linux distributions seem to fancy toolchains that > # do not do c++ support (need to install a separate package). > sys-libs/ncurses -cxx >@@ -1382,6 +1409,7 @@ bootstrap_stage1() { > > configure_toolchain > export CC CXX >+ [[ ${INCLUDE_EPREFIX_DARWIN_SDK} == 1 ]] && darwin_include_paths_for_clang > > # run all bootstrap_* commands in a subshell since the targets > # frequently pollute the environment using exports which affect >@@ -1646,6 +1674,7 @@ bootstrap_stage2() { > # Find out what toolchain packages we need, and configure LDFLAGS > # and friends. > configure_toolchain || return 1 >+ [[ ${INCLUDE_EPREFIX_DARWIN_SDK} == 1 ]] && darwin_include_paths_for_clang > configure_cflags || return 1 > export CONFIG_SHELL="${ROOT}"/tmp/bin/bash > export CC CXX >@@ -1740,8 +1769,8 @@ bootstrap_stage2() { > [[ ${CHOST} == *-solaris* ]] && echo "=dev-libs/libffi-3.3_rc0" \ > >> "${ROOT}"/tmp/etc/portage/package.mask > >- # unlock GCC on Darwin for DARWIN_USE_GCC bootstraps >- if [[ ${DARWIN_USE_GCC} == 1 ]] ; then >+ # unlock Darwin builds for GCC and clang bootstraps >+ if [[ -d "${ROOT}/MacOSX.sdk" ]] ; then > rm -f "${ROOT}"/tmp/MacOSX.sdk > ( cd "${ROOT}"/tmp && ln -s ../MacOSX.sdk ) > fi >-- >2.28.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 757513
:
675634
|
675637
|
675796
|
675799
|
676357
|
677521