From 9db0648cb1d9b9512dc5c5b7c5ef68db2f891a29 Mon Sep 17 00:00:00 2001 From: martinoluca Date: Mon, 5 Oct 2015 07:06:47 -0700 Subject: [PATCH] Fix compilation failure issue when compiling for armv7k architecture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: @​public Fix issues when compiling for armv7k architecture, replacing it with armv7; Removing also unsupported flags `-fembed-bitcode-marker`, `-mwatchos-version-min` that cause compilation failures. Reviewed By: @akotulski, @jvillard Differential Revision: D2507687 --- infer/lib/clang/clang_wrapper | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/infer/lib/clang/clang_wrapper b/infer/lib/clang/clang_wrapper index 66fb73970..b6f09e0b9 100755 --- a/infer/lib/clang/clang_wrapper +++ b/infer/lib/clang/clang_wrapper @@ -13,17 +13,24 @@ if [ "${0%++}" != "$0" ]; then XX="++"; else XX=""; fi COMMAND=("${CLANG_COMPILER}${XX}") # Remove command line options not supported by the opensource compiler or the plugins. +PREV="" for X in "$@" do - if [ "$X" == "-fapplication-extension" ]; then + if [ "$X" == "-fapplication-extension" ] \ + || [ "$X" == "-fembed-bitcode-marker" ] \ + || [[ "$X" =~ "-mwatchos-version-min" ]]; 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") + elif [ "$X" == "armv7k" ] && [ "$PREV" == "-arch" ]; then + # replace armv7k arch with armv7 + COMMAND+=("armv7") else COMMAND+=("$X") fi + PREV="$X" done # Never error on warnings. Clang is often more strict than Apple's version.