summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-02-09 13:00:03 +0900
committerEmil Velikov <emil.l.velikov@gmail.com>2017-03-04 15:30:35 +0000
commit9ab1704f42bbaca8c43af51fbc08532ab62c1026 (patch)
tree4773ad571e61fe8f6cd308f208339c49b787e240
parentcfdda1939779782d36e144fa9a1d30e97163199e (diff)
configure.ac: Drop LLVM compiler flags more radically
Drop all -m*, -W*, -O*, -g* and -f* flags, with the exception of -fno-rtti, which must be used if it's part of the llvm-config --cxxflags output. We don't want LLVM to dictate the flags we use, and it can even cause build failures, e.g. if LLVM and Mesa are built with different compilers. While we're at it, eat any whitespace preceding dropped flags as well. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 0f53404565b9ef9da9d7022b5732463acd496742) Nominated-by: Marek Olšák <marek.olsak@amd.com> Bugzilla: https://bugs.freedesktop.org/100028
-rw-r--r--configure.ac33
1 files changed, 12 insertions, 21 deletions
diff --git a/configure.ac b/configure.ac
index 399166ac8ec..bdcf14da5f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -943,27 +943,18 @@ llvm_add_target() {
# $1 is the llvm-config command with arguments.
strip_unwanted_llvm_flags() {
# Use \> (marks the end of the word)
- echo `$1` | sed \
- -e 's/-march=\S*//g' \
- -e 's/-mtune=\S*//g' \
- -e 's/-mcpu=\S*//g' \
- -e 's/-DNDEBUG\>//g' \
- -e 's/-D_GNU_SOURCE\>//g' \
- -e 's/-pedantic\>//g' \
- -e 's/-Wcovered-switch-default\>//g' \
- -e 's/-O.\>//g' \
- -e 's/-g\>//g' \
- -e 's/-Wall\>//g' \
- -e 's/-Wcast-qual\>//g' \
- -e 's/-Woverloaded-virtual\>//g' \
- -e 's/-fcolor-diagnostics\>//g' \
- -e 's/-fdata-sections\>//g' \
- -e 's/-ffunction-sections\>//g' \
- -e 's/-fno-exceptions\>//g' \
- -e 's/-fomit-frame-pointer\>//g' \
- -e 's/-fvisibility-inlines-hidden\>//g' \
- -e 's/-fPIC\>//g' \
- -e 's/-fstack-protector-strong\>//g'
+ echo " `$1`" | sed \
+ -e 's/\s\+-m\S*//g' \
+ -e 's/\s\+-DNDEBUG\>//g' \
+ -e 's/\s\+-D_GNU_SOURCE\>//g' \
+ -e 's/\s\+-pedantic\>//g' \
+ -e 's/\s\+-W\S*//g' \
+ -e 's/\s\+-O\S*//g' \
+ -e 's/\s\+-g\S*//g' \
+ -e 's/-fno-rtti\>/-Fno-rtti/g' \
+ -e 's/\s\+-f\S*//g' \
+ -e 's/-Fno-rtti\>/-fno-rtti/g' \
+ -e 's/^ //'
}
llvm_set_environment_variables() {