From 6553ba237916125be8e389f46a4006ed6e92abaf Mon Sep 17 00:00:00 2001 From: martinoluca Date: Fri, 25 Sep 2015 12:15:15 -0100 Subject: [PATCH] Replace the gmodules flag of Xcode's clang with equivalent ones Summary: See D2465673, replacing `-gmodule` with equivalent flags, as per http://reviews.llvm.org/D11958 The `-fmodule-format` is not available on Xcode's clang, so skip it for now. --- infer/lib/clang/clang_wrapper | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/infer/lib/clang/clang_wrapper b/infer/lib/clang/clang_wrapper index 28d72e828..66fb73970 100755 --- a/infer/lib/clang/clang_wrapper +++ b/infer/lib/clang/clang_wrapper @@ -15,14 +15,19 @@ COMMAND=("${CLANG_COMPILER}${XX}") # Remove command line options not supported by the opensource compiler or the plugins. for X in "$@" do - if [ "$X" != "-fapplication-extension" ] - then + if [ "$X" == "-fapplication-extension" ]; then + continue + elif [ "$X" == "-gmodules" ]; then + # gmodules is an alias for "-g -fmodule-format=obj -dwarf-ext-refs" + # but "-fmodule-format" is not available, so skip it for now. + COMMAND+=("-g" "-dwarf-ext-refs") + else COMMAND+=("$X") fi done # Never error on warnings. Clang is often more strict than Apple's version. # These arguments are appended to override previous opposite settings. -COMMAND+=(-Wno-error -Qunused-arguments) +COMMAND+=("-Wno-error" "-Qunused-arguments") "${COMMAND[@]}"