Re: [Mesa-dev] [PATCH] configure.ac: Drop LLVM compiler flags more radically
On 17/02/17 06:01 PM, Eero Tamminen wrote: > Hi, > > On 10.02.2017 02:59, Michel Dänzer wrote: >> On 09/02/17 10:50 PM, Emil Velikov wrote: >>> On 9 February 2017 at 08:07, Michel Dänzerwrote: From: Michel Dänzer 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. > > Out of curiosity, where this stuff is applied? > > (If you're removing all of them, result is hard to debug, non-optimized > binary...) > > >>> Yes, please ! >>> Reviewed-by: Emil Velikov >> >> >>> Out of curiosity: >>> Are you speaking of personal experience ? What was stored in the >>> c/cpp/cxx flags that triggered build failure ? >> >> Building LLVM with clang 4.0 resulted in llvm-config --cxxflags >> containing -Wstring-conversion and -fcolor-diagnostics, which aren't >> supported by gcc 6.3. > > There are generic flags that have been supported by few decades, which > are not going to change, like -O[1-3], -Wall, -g. Only the specific > optimization & warning flags are something that differ between compiler > versions (as new ones get added). strip_unwanted_llvm_flags() only affects LLVM_CXXFLAGS, so this change doesn't remove any compiler flags used by Mesa itself, it just prevents llvm-config from unnecessarily adding potentially harmful compiler flags when compiling some LLVM related Mesa code. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] configure.ac: Drop LLVM compiler flags more radically
Hi, On 10.02.2017 02:59, Michel Dänzer wrote: On 09/02/17 10:50 PM, Emil Velikov wrote: On 9 February 2017 at 08:07, Michel Dänzerwrote: From: Michel Dänzer 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. Out of curiosity, where this stuff is applied? (If you're removing all of them, result is hard to debug, non-optimized binary...) Yes, please ! Reviewed-by: Emil Velikov Out of curiosity: Are you speaking of personal experience ? What was stored in the c/cpp/cxx flags that triggered build failure ? Building LLVM with clang 4.0 resulted in llvm-config --cxxflags containing -Wstring-conversion and -fcolor-diagnostics, which aren't supported by gcc 6.3. There are generic flags that have been supported by few decades, which are not going to change, like -O[1-3], -Wall, -g. Only the specific optimization & warning flags are something that differ between compiler versions (as new ones get added). - Eero ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] configure.ac: Drop LLVM compiler flags more radically
On 09/02/17 10:50 PM, Emil Velikov wrote: > On 9 February 2017 at 08:07, Michel Dänzerwrote: >> From: Michel Dänzer >> >> 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. >> > Yes, please ! > Reviewed-by: Emil Velikov Thanks! > Out of curiosity: > Are you speaking of personal experience ? What was stored in the > c/cpp/cxx flags that triggered build failure ? Building LLVM with clang 4.0 resulted in llvm-config --cxxflags containing -Wstring-conversion and -fcolor-diagnostics, which aren't supported by gcc 6.3. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] configure.ac: Drop LLVM compiler flags more radically
On 9 February 2017 at 08:07, Michel Dänzerwrote: > From: Michel Dänzer > > 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. > Yes, please ! Reviewed-by: Emil Velikov Out of curiosity: Are you speaking of personal experience ? What was stored in the c/cpp/cxx flags that triggered build failure ? -Emil ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] configure.ac: Drop LLVM compiler flags more radically
Reviewed-by: Marek OlšákMarek On Thu, Feb 9, 2017 at 9:07 AM, Michel Dänzer wrote: > From: Michel Dänzer > > 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. > > Signed-off-by: Michel Dänzer > --- > configure.ac | 33 - > 1 file changed, 12 insertions(+), 21 deletions(-) > > diff --git a/configure.ac b/configure.ac > index a6ceee95a3..87a751e2fa 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -894,27 +894,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() { > -- > 2.11.0 > > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] configure.ac: Drop LLVM compiler flags more radically
From: Michel DänzerDrop 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. Signed-off-by: Michel Dänzer --- configure.ac | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index a6ceee95a3..87a751e2fa 100644 --- a/configure.ac +++ b/configure.ac @@ -894,27 +894,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() { -- 2.11.0 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev