Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/crossdev:master commit in: /
Date: Thu, 28 Dec 2017 17:47:31
Message-Id: 1514483087.eedf77d75e5c31e21ec249ba7d4341c32e3ae84f.slyfox@gentoo
1 commit: eedf77d75e5c31e21ec249ba7d4341c32e3ae84f
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 28 17:44:47 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 28 17:44:47 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/crossdev.git/commit/?id=eedf77d7
7
8 crossdev: change USE=sanitize to whitelist
9
10 asan needs explicit support code for every arch/OS.
11 Currently the following seem to have support:
12 - amd64-glibc
13 - x86-glibc
14 - arm-glibc
15 - aarch64-glibc
16 - powerpc64-glibc
17 - mips-glibc
18 - mips64-glibc (n32 ABI, fails to build)
19
20 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
21
22 crossdev | 26 ++++++++++++++++++++++++--
23 1 file changed, 24 insertions(+), 2 deletions(-)
24
25 diff --git a/crossdev b/crossdev
26 index 1cd59fb..76f9a06 100755
27 --- a/crossdev
28 +++ b/crossdev
29 @@ -323,8 +323,6 @@ parse_target() {
30 KPKG="[none]"
31 STAGE_DEFAULT=${STAGE_LIBC}
32 GUSE+=" cxx -openmp" #489798
33 - # asan needs OS support to implement sanitizers
34 - GUSE+=" -sanitize"
35 MULTILIB_USE="yes" #407275
36 WITH_DEF_HEADERS="no"
37 ;;
38 @@ -335,6 +333,30 @@ parse_target() {
39 KPKG="[none]"
40 ;;
41 esac
42 +
43 + local sanitizer_support=no
44 + # Whitelist asan on explicitly supported arches fo linux.
45 + # Broken examples:
46 + # - musl libc
47 + # - bare metal targets
48 + # Untested examples:
49 + # - *BSD
50 + case ${CTARGET} in
51 + # glibc targets
52 + *-gnu*)
53 + case ${CTARGET} in
54 + mips64*)
55 + # has some support code, fails to build
56 + ;;
57 + x86_64*|i?86*|arm*|aarch64|powerpc64)
58 + sanitizer_support=yes
59 + ;;
60 + esac
61 + ;;
62 + esac
63 + if [[ $sanitizer_support = "no" ]]; then
64 + GUSE+=" -sanitize"
65 + fi
66 }
67
68 parse_repo_config() {