From 824d9394b529bb1fc521e4a4df8c4e3458ec5641 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 18 Oct 2019 13:29:06 +0200 Subject: Properly handle comma in CLANGFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...which would cause an error that STRINGIFY takes only a single argument. According to chris_wot on IRC, LLVM 6.0 on Ubuntu 18.04.3 LTS output of `llvm --cxxflags` (as is used in configure.ac to determine what ultimately ends up in CLANGFLAGS here) includes e.g. -Wl,--no-keep-files-mapped. Change-Id: Iff570840fe62c2aa2d972431e610a05fe2f6922c Reviewed-on: https://gerrit.libreoffice.org/81037 Reviewed-by: Luboš Luňák Tested-by: Jenkins --- compilerplugins/Makefile-clang.mk | 2 +- compilerplugins/clang/sharedvisitor/analyzer.cxx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/compilerplugins/Makefile-clang.mk b/compilerplugins/Makefile-clang.mk index 9e6b7fd490b2..8e66b7e5b93c 100644 --- a/compilerplugins/Makefile-clang.mk +++ b/compilerplugins/Makefile-clang.mk @@ -265,7 +265,7 @@ $(CLANGOUTDIR)/sharedvisitor/analyzer$(CLANG_EXE_EXT): $(CLANGINDIR)/sharedvisit | $(CLANGOUTDIR)/sharedvisitor $(call gb_Output_announce,$(subst $(BUILDDIR)/,,$@),$(true),GEN,1) $(QUIET)$(COMPILER_PLUGINS_CXX) $(CLANGDEFS) $(CLANGCXXFLAGS) $(CLANGWERROR) $(CLANGINCLUDES) \ - -I$(BUILDDIR)/config_host -DCLANGFLAGS="$(CLANGTOOLDEFS)" \ + -I$(BUILDDIR)/config_host -DCLANGFLAGS='"$(CLANGTOOLDEFS)"' \ -DLO_CLANG_USE_ANALYZER_PCH=$(LO_CLANG_USE_ANALYZER_PCH) \ -c $< -o $(CLANGOUTDIR)/sharedvisitor/analyzer.o -MMD -MT $@ -MP \ -MF $(CLANGOUTDIR)/sharedvisitor/analyzer.d diff --git a/compilerplugins/clang/sharedvisitor/analyzer.cxx b/compilerplugins/clang/sharedvisitor/analyzer.cxx index 4d8e2b2bb763..d0f5d4e7a8a7 100644 --- a/compilerplugins/clang/sharedvisitor/analyzer.cxx +++ b/compilerplugins/clang/sharedvisitor/analyzer.cxx @@ -241,10 +241,8 @@ int main(int argc, char** argv) } args.push_back(argv[i] + prefixlen); } -#define STRINGIFY2(a) #a -#define STRINGIFY(a) STRINGIFY2(a) SmallVector< StringRef, 20 > clangflags; - SplitString( STRINGIFY(CLANGFLAGS), clangflags ); + SplitString( CLANGFLAGS, clangflags ); args.insert( args.end(), clangflags.begin(), clangflags.end()); args.insert( args.end(), -- cgit