aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2017-12-28 17:44:47 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2017-12-28 17:44:47 +0000
commiteedf77d75e5c31e21ec249ba7d4341c32e3ae84f (patch)
tree4a25dfe34dee13f941b102169d13c5954a2ca620
parentDisable USE=sanitize on bare metal targets (diff)
downloadcrossdev-eedf77d75e5c31e21ec249ba7d4341c32e3ae84f.tar.gz
crossdev-eedf77d75e5c31e21ec249ba7d4341c32e3ae84f.tar.bz2
crossdev-eedf77d75e5c31e21ec249ba7d4341c32e3ae84f.zip
crossdev: change USE=sanitize to whitelist
asan needs explicit support code for every arch/OS. Currently the following seem to have support: - amd64-glibc - x86-glibc - arm-glibc - aarch64-glibc - powerpc64-glibc - mips-glibc - mips64-glibc (n32 ABI, fails to build) Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rwxr-xr-xcrossdev26
1 files changed, 24 insertions, 2 deletions
diff --git a/crossdev b/crossdev
index 1cd59fb..76f9a06 100755
--- a/crossdev
+++ b/crossdev
@@ -323,8 +323,6 @@ parse_target() {
KPKG="[none]"
STAGE_DEFAULT=${STAGE_LIBC}
GUSE+=" cxx -openmp" #489798
- # asan needs OS support to implement sanitizers
- GUSE+=" -sanitize"
MULTILIB_USE="yes" #407275
WITH_DEF_HEADERS="no"
;;
@@ -335,6 +333,30 @@ parse_target() {
KPKG="[none]"
;;
esac
+
+ local sanitizer_support=no
+ # Whitelist asan on explicitly supported arches fo linux.
+ # Broken examples:
+ # - musl libc
+ # - bare metal targets
+ # Untested examples:
+ # - *BSD
+ case ${CTARGET} in
+ # glibc targets
+ *-gnu*)
+ case ${CTARGET} in
+ mips64*)
+ # has some support code, fails to build
+ ;;
+ x86_64*|i?86*|arm*|aarch64|powerpc64)
+ sanitizer_support=yes
+ ;;
+ esac
+ ;;
+ esac
+ if [[ $sanitizer_support = "no" ]]; then
+ GUSE+=" -sanitize"
+ fi
}
parse_repo_config() {