Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Thu, 27 Sep 2018 16:23:56
Message-Id: 1538065149.b46e329dd9ccf01cfdd722f38db341ead34ac418.whissi@gentoo
1 commit: b46e329dd9ccf01cfdd722f38db341ead34ac418
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 27 14:51:52 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 27 16:19:09 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b46e329d
7
8 mozconfig-v6.60.eclass: add USE=clang
9
10 See commit 59c9e92b639712d4c37ece540582db83afdc8608 for details.
11
12 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
13
14 eclass/mozconfig-v6.60.eclass | 31 ++++++++++++++++++++++++++-----
15 1 file changed, 26 insertions(+), 5 deletions(-)
16
17 diff --git a/eclass/mozconfig-v6.60.eclass b/eclass/mozconfig-v6.60.eclass
18 index c124baef74e..a9b04fd7730 100644
19 --- a/eclass/mozconfig-v6.60.eclass
20 +++ b/eclass/mozconfig-v6.60.eclass
21 @@ -75,7 +75,7 @@ inherit flag-o-matic toolchain-funcs mozcoreconf-v6
22 # Set the variable to any value if the use flag should exist but not be default-enabled.
23
24 # use-flags common among all mozilla ebuilds
25 -IUSE="${IUSE} dbus debug neon pulseaudio selinux startup-notification system-harfbuzz
26 +IUSE="${IUSE} clang dbus debug neon pulseaudio selinux startup-notification system-harfbuzz
27 system-icu system-jpeg system-libevent system-sqlite system-libvpx"
28
29 # some notes on deps:
30 @@ -155,6 +155,10 @@ DEPEND="app-arch/zip
31 app-arch/unzip
32 >=sys-devel/binutils-2.30
33 sys-apps/findutils
34 + clang? (
35 + >=sys-devel/llvm-4.0.1[gold]
36 + >=sys-devel/lld-4.0.1
37 + )
38 pulseaudio? ( media-sound/pulseaudio )
39 elibc_glibc? (
40 virtual/cargo
41 @@ -189,6 +193,20 @@ RDEPEND+="
42 # }
43
44 mozconfig_config() {
45 + if use clang && ! tc-is-clang ; then
46 + # Force clang
47 + einfo "Enforcing the use of clang due to USE=clang ..."
48 + CC=${CHOST}-clang
49 + CXX=${CHOST}-clang++
50 + strip-unsupported-flags
51 + elif ! use clang && ! tc-is-gcc ; then
52 + # Force gcc
53 + einfo "Enforcing the use of gcc due to USE=-clang ..."
54 + CC=${CHOST}-gcc
55 + CXX=${CHOST}-gcc++
56 + strip-unsupported-flags
57 + fi
58 +
59 # Migrated from mozcoreconf-2
60 mozconfig_annotate 'system_libs' \
61 --with-system-zlib \
62 @@ -200,11 +218,14 @@ mozconfig_config() {
63 # Must pass release in order to properly select linker
64 mozconfig_annotate 'Enable by Gentoo' --enable-release
65
66 - # Must pass --enable-gold if using ld.gold
67 - if tc-ld-is-gold ; then
68 - mozconfig_annotate 'tc-ld-is-gold=true' --enable-gold
69 + # Avoid auto-magic on linker
70 + if use clang ; then
71 + # This is upstream's default
72 + mozconfig_annotate "forcing ld=lld due to USE=clang" --enable-linker=lld
73 + elif tc-ld-is-gold ; then
74 + mozconfig_annotate "linker is set to gold" --enable-linker=gold
75 else
76 - mozconfig_annotate 'tc-ld-is-gold=false' --disable-gold
77 + mozconfig_annotate "linker is set to bfd" --enable-linker=bfd
78 fi
79
80 if has bindist ${IUSE}; then