summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Stefani <luca.stefani.ge1@gmail.com>2019-03-01 15:30:59 +0100
committerChristian Hoffmann <chrmhoffmann@gmail.com>2019-09-29 19:33:33 +0200
commit8d4e9e0451e6f9e50ccab8f3b89614c2324e6bff (patch)
treeb900d442a338babe5d2fc8081d2f50ffee833bbb
parent9550c87abf5b934ff0fa83f77e7e1978e73c3a59 (diff)
downloadandroid_art-8d4e9e0451e6f9e50ccab8f3b89614c2324e6bff.tar.gz
android_art-8d4e9e0451e6f9e50ccab8f3b89614c2324e6bff.tar.bz2
android_art-8d4e9e0451e6f9e50ccab8f3b89614c2324e6bff.zip
Add an option to disable sse4.2 features
* Infra needs that Change-Id: I5b44ed474738ca842715d6ad46b6e56341838d7a (cherry picked from commit a590a49a84ea90227a967d2d51f02223db1d5938)
-rw-r--r--build/Android.bp9
-rw-r--r--build/art.go5
2 files changed, 5 insertions, 9 deletions
diff --git a/build/Android.bp b/build/Android.bp
index 7b807d56b7..6e20e7b94b 100644
--- a/build/Android.bp
+++ b/build/Android.bp
@@ -140,15 +140,6 @@ art_global_defaults {
// Bug: 15446488. We don't omit the frame pointer to work around
// clang/libunwind bugs that cause SEGVs in run-test-004-ThreadStress.
"-fno-omit-frame-pointer",
- // The build assumes that all our x86/x86_64 hosts (such as buildbots and developer
- // desktops) support at least sse4.2/popcount. This firstly implies that the ART
- // runtime binary itself may exploit these features. Secondly, this implies that
- // the ART runtime passes these feature flags to dex2oat and JIT by calling the
- // method InstructionSetFeatures::FromCppDefines(). Since invoking dex2oat directly
- // does not pick up these flags, cross-compiling from a x86/x86_64 host to a
- // x86/x86_64 target should not be affected.
- "-msse4.2",
- "-mpopcnt",
],
},
},
diff --git a/build/art.go b/build/art.go
index 4db8da28e0..58dc181a86 100644
--- a/build/art.go
+++ b/build/art.go
@@ -177,6 +177,11 @@ func hostFlags(ctx android.BaseContext) []string {
cflags = append(cflags, "-DART_ENABLE_ADDRESS_SANITIZER=1")
}
+ if !envFalse(ctx, "CPU_SSE42") {
+ cflags = append(cflags, "-msse4.2")
+ cflags = append(cflags, "-mpopcnt")
+ }
+
return cflags
}