1 |
commit: 9f5cbe65e5f2689faf356e647d889aa3dab0cdd4 |
2 |
Author: Guilherme Amadio <amadio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jul 5 17:27:25 2018 +0000 |
4 |
Commit: Guilherme Amadio <amadio <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jul 5 17:38:15 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f5cbe65 |
7 |
|
8 |
profiles: fix sys-devel/clang on standalone prefix |
9 |
|
10 |
On standalone prefix, sys-devel/clang needs to be configured with |
11 |
-DDEFAULT_SYSROOT=${EPREFIX} and also needs the same treatment as |
12 |
sys-devel/gcc to remove --sysroot=${EPREFIX} from ld calls. |
13 |
|
14 |
profiles/features/prefix/standalone/profile.bashrc | 11 ++++++++++- |
15 |
1 file changed, 10 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/profiles/features/prefix/standalone/profile.bashrc b/profiles/features/prefix/standalone/profile.bashrc |
18 |
index 60a2af632d1..d167e7a9155 100644 |
19 |
--- a/profiles/features/prefix/standalone/profile.bashrc |
20 |
+++ b/profiles/features/prefix/standalone/profile.bashrc |
21 |
@@ -15,12 +15,21 @@ if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == configure ]]; the |
22 |
eend $? |
23 |
done |
24 |
|
25 |
- # use sysroot of toolchain to get currect include and library at compile time |
26 |
+ # use sysroot of toolchain to get correct include and library at compile time |
27 |
EXTRA_ECONF="${EXTRA_ECONF} --with-sysroot=${EPREFIX}" |
28 |
|
29 |
ebegin "remove --sysroot call on ld for native toolchain" |
30 |
sed -i 's/--sysroot=%R//' gcc/gcc.c |
31 |
eend $? |
32 |
+elif [[ ${CATEGORY}/${PN} == sys-devel/clang && ${EBUILD_PHASE} == configure ]]; then |
33 |
+ ebegin "Use ${EPREFIX} as default sysroot" |
34 |
+ sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" "${S}"/CMakeLists.txt |
35 |
+ eend $? |
36 |
+ pushd "${S}/lib/Driver/ToolChains" >/dev/null |
37 |
+ ebegin "Remove --sysroot call on ld for native toolchain" |
38 |
+ sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp |
39 |
+ eend $? |
40 |
+ popd >/dev/null |
41 |
elif [[ ${CATEGORY}/${PN} == sys-devel/binutils && ${EBUILD_PHASE} == prepare ]]; then |
42 |
ebegin "Prefixifying native library path" |
43 |
sed -i -r "/NATIVE_LIB_DIRS/s,((/usr(/local|)|)/lib),${EPREFIX}\1,g" \ |