**Motivation**

Xcode provides the ability to manipulate whatever compiler/linker toolchain is needed, but default Xcode configuration assumes Mac SDK and adds a number of default flags that do not appear anywhere in the project itself. 

If these flags could be disabled/removed, Xcode's native build system could be used to control foreign compilers/toolchains such as xtensa-elf-gcc and surrounding tools, while gaining the benefit of Xcode's code highlighting and clang's analytics. This would be a strongly preferable option to the external makefile option that Xcode supports directly, which does not integrate particularly nicely with the rest of Xcode. 

**Motivation TL;DR**

If Xcode's default flags could be disabled, Xcode could directly support compiling code for the ESP8266 (using CC=xtensa-elf-gcc). 

The default flags (which assume Mac OS) are not supported by xtensa-elf-gcc and prevent its use. 

The flags are the only reason this does not work.

**Example**

The most basic compilation produces a clang command with these flags:

> 
> -x c 
> 
> 
> -arch x86\_64 
> 
> 
> -fmessage-length=0 
> 
> 
> -fdiagnostics-show-note-include-stack 
> 
> 
> -fmacro-backtrace-limit=0 
> 
> 
> -std=gnu99 
> 
> 
> -Wno-trigraphs 
> 
> 
> -fpascal-strings 
> 
> 
> -O0 
> 
> 
> -fno-common 
> 
> 
> -Wno-missing-field-initializers 
> 
> 
> -Wno-missing-prototypes 
> 
> 
> -Werror=return-type 
> 
> 
> -Wdocumentation 
> 
> 
> -Wunreachable-code 
> 
> 
> -Werror=deprecated-objc-isa-usage 
> 
> 
> -Werror=objc-root-class 
> 
> 
> -Wno-missing-braces 
> 
> 
> -Wparentheses 
> 
> 
> -Wswitch 
> 
> 
> -Wunused-function 
> 
> 
> -Wno-unused-label 
> 
> 
> -Wno-unused-parameter 
> 
> 
> -Wunused-variable 
> 
> 
> -Wunused-value 
> 
> 
> -Wempty-body 
> 
> 
> -Wconditional-uninitialized 
> 
> 
> -Wno-unknown-pragmas 
> 
> 
> -Wno-shadow 
> 
> 
> -Wno-four-char-constants 
> 
> 
> -Wno-conversion 
> 
> 
> -Wconstant-conversion 
> 
> 
> -Wint-conversion
> 
> 
> -Wbool-conversion 
> 
> 
> -Wenum-conversion 
> 
> 
> -Wshorten-64-to-32 
> 
> 
> -Wpointer-sign 
> 
> 
> -Wno-newline-eof 
> 
> 
> -DDEBUG=1 
> 
> 
> -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
> 
> 
> -fasm-blocks 
> 
> 
> -fstrict-aliasing 
> 
> 
> -Wdeprecated-declarations 
> 
> 
> -mmacosx-version-min=10.12 
> 
> 
> -g 
> 
> 
> -Wno-sign-conversion 
> 
> 
> -Winfinite-recursion 
> 
> 
> -iquote [generated-files.hmap] 
> 
> 
> -I[own-target-headers.hmap]
> 
> 
> -I[all-target-headers.hmap]
> 
> 
> -iquote [project-headers.hmap] 
> 
> 
> -I[Build/Products/Debug/include] 
> 
> 
> -I[Build/Intermediates/libESP8266.build/Debug/libESP8266.build/DerivedSources/x86\_64]
> 
> 
> -I[Build/Intermediates/libESP8266.build/Debug/libESP8266.build/DerivedSources]
> 
> 
> -F[Build/Products/Debug] 
> 
> 
> -MMD 
> 
> 
> -MT dependencies 
> 
> 
> -MF [Build/Intermediates/libESP8266.build/Debug/libESP8266.build/Objects-normal/x86\_64/main.d]
> 
> 
> --serialize-diagnostics [Build/Intermediates/libESP8266.build/Debug/libESP8266.build/Objects-normal/x86\_64/main.dia]
> 
> 
> -c /Users/asher/Projects/Arduino/libESP8266/main.c 
> 
> 
> -o [main.o]
> 
> 
> 

Obviously a few of these are more or less necessary (-c, -o, the various -Is, etc.) but most ought to be totally optional. 

**The Question**

So where are they coming from? I've tried editing the basic template, and even after reducing all Mac related aspects, the result is the same. Are they added programmatically somewhere? If so, it is (presumably) in DevToolsCore or IDEFoundation?