diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index 9d56f6b484..ca620cd057 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -28,7 +28,10 @@ rule ArchitectureSetup architecture # our gcc4 compiler. See this discussion on some issues: # http://www.freelists.org/post/haiku-development/hrev45320-Yet-another-nonobvious-effect-of-ftreevrp-optimization if $(gccVersion[1]) >= 3 { - gccBaseFlags += -fno-strict-aliasing -fno-tree-vrp ; + gccBaseFlags += -fno-strict-aliasing ; + if ! $(CLANG) { + gccBaseFlags += -fno-tree-vrp ; + } } # disable array bounds warnings on gcc 4.6 or newer since they trigger @@ -473,8 +476,12 @@ rule ArchitectureSetupWarnings architecture HAIKU_WERROR_ARCH = $(architecture) ; rule EnableWerror dirTokens : scope { - SetConfigVar WARNINGS : HAIKU_TOP $(dirTokens) : treatAsErrors - : $(scope) ; + # Clang gives way more warnings than GCC, so that code won't compile + # -Werror when using Clang. + if ! $(CLANG) { + SetConfigVar WARNINGS : HAIKU_TOP $(dirTokens) : treatAsErrors + : $(scope) ; + } } # Work-around for GCC 2 problem -- despite -Wno-multichar it reports @@ -486,6 +493,15 @@ rule ArchitectureSetupWarnings architecture WARNINGS on $(file) = $(WARNINGS) ; } + if $(CLANG) { + # We need -integrated-as, as otherwise Clang uses GCC as assembler and + # passes -fheinous-gnu-extensions to GCC, which GCC does not understand + # then errors out. + AppendToConfigVar CCFLAGS : + HAIKU_TOP src system libroot posix glibc : + -integrated-as -fgnu89-inline -fheinous-gnu-extensions : global ; + } + EnableWerror src add-ons accelerants 3dfx ; EnableWerror src add-ons accelerants ati ; EnableWerror src add-ons accelerants common ;