Apple LLVM compiler 3.1 error - iOS 5; Xcode 4.3 - iphone

I have been receiving this error for a long time and I don't know what to do.
In order to keep the question short, I have written the error into a .rtf file and put it into CloudApp. Here's the link: http://cl.ly/0T3n1Q123u352T372t0m
I think it has something to do with "CLAPIDeserializer.m".
I will appreciate any help. Thank you.
ERROR:
CompileC
/Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/Objects-normal/armv7/CLAPIDeserializer.o
"Cloud/API Parsing/CLAPIDeserializer.m" normal armv7 objective-c
com.apple.compilers.llvm.clang.1_0.compiler
cd "/Users/juniorpond/Documents/Dropbox/Triple J Studios/Applications/Applications/CloudSend/Test/Test"
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-x objective-c -arch armv7 -fmessage-length=0 -std=gnu99 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
-Wprotocol -Wdeprecated-declarations -g -Wno-conversion -Wno-sign-conversion -mthumb "-DIBOutlet=attribute((iboutlet))" "-DIBOutletCollection(ClassName)=attribute((iboutletcollection(ClassName)))"
"-DIBAction=void)attribute((ibaction)" -miphoneos-version-min=5.1
-iquote /Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/Test-generated-files.hmap
-I/Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/Test-own-target-headers.hmap
-I/Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/Test-all-target-headers.hmap
-iquote /Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/Test-project-headers.hmap
-I/Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Products/Debug-iphoneos/include
-I/Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/DerivedSources/armv7
-I/Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/DerivedSources
-F/Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Products/Debug-iphoneos
-include /Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/PrecompiledHeaders/Test-Prefix-clsydhfesjzmtrbgszvgmeofhzfq/Test-Prefix.pch
-MMD -MT dependencies -MF /Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/Objects-normal/armv7/CLAPIDeserializer.d
--serialize-diagnostics /Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/Objects-normal/armv7/CLAPIDeserializer.dia
-c "/Users/juniorpond/Documents/Dropbox/Triple J Studios/Applications/Applications/CloudSend/Test/Test/Cloud/API
Parsing/CLAPIDeserializer.m" -o
/Users/juniorpond/Library/Developer/Xcode/DerivedData/Test-fqacaiejputxwicubwhguzleizde/Build/Intermediates/Test.build/Debug-iphoneos/Test.build/Objects-normal/armv7/CLAPIDeserializer.o
clang: error: unable to execute command: posix_spawn failed: Resource
temporarily unavailable clang: error: clang frontend command failed
due to signal 1 (use -v to see invocation) clang: note: diagnostic
msg: Please submit a bug report to
http://developer.apple.com/bugreporter/ and include command line
arguments and all diagnostic information. clang: error: unable to
execute command: posix_spawn failed: Resource temporarily unavailable
clang: note: diagnostic msg: Error generating preprocessed source(s).
Command
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
failed with exit code 255

When this happens, close xcode and issue the "purge" command in Terminal then restart xcode. That solved this error for me.

It means your OS X kernel cannot spawn any more processes for your user ID. There is a maximum number of processes per user:
To see your process limitation:
sysctl kern.maxprocperuid
To check how many processes you have running:
ps aux | grep username | wc -l
To see how many zombie process:
ps -v -u username | grep -v grep | awk '{print $2}' | grep Z | wc -l
To see what they are:
for pid in `ps -v -u username | grep -v grep | awk '{print $1, $2}' | grep Z | awk '{print $1}'`
do
ps -o command="" -p $pid >> zombies.txt
done
None of these processes can be killed, and purge won't work on my mac, 10.8.2.
You could temporarily increase the max user processes count:
sudo sysctl -w kern.maxprocperuid=1024
Then in your .bash_profile or .bashrc add:
ulimit -u 1024
And change Finder’s limits:
sudo launchctl limit maxproc 1024
But really, it's time for coffee and give your mac a reboot..

I had this same problem with a project that I have under GIT with some of my team, the problem was that some of my team forgot to commit some new added files.
So, the .xcodeproj project it self was taking into consideration that it has some ViewControllers, but they weren't physically exist.
As soon as I added the missing view controllers, the project got built properly.
Hope this can help your situation.

just do it!!
1.Turn off your mac computer.
2.Turn on mac computer.
3.Run XCode

I had to do a clean to fix this. product>clean from xcode. rebooting & purging didn't help, cleaning fixed it.

The message says
clang frontend command failed due to signal 1 (use -v to see
invocation)
Try adding a "-v" to your "Other C Flags" under Build Settings of your project and see what it spits out...

Related

Swift compiler error at the time of compiling

Trying to compile a .swift file using the swift compiler in Ubuntu 19.10 but facing this error at the time of compilation.
$ swiftc swift.swift
/usr/bin/ld.gold: fatal error: swift: open: Is a directory
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
I have also tried it with -v parameter and it shows this:
$ swiftc -v swift.swift
Swift version 5.1 (swift-5.1.2-RELEASE)
Target: x86_64-unknown-linux-gnu
/home/takshaksh/swift/usr/bin/swift -frontend -c -primary-file swift.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -module-name swift -o /tmp/swift-2339bd.o
/home/takshaksh/swift/usr/bin/swift-autolink-extract /tmp/swift-2339bd.o -o /tmp/swift-0db3ba.autolink
/home/takshaksh/swift/usr/bin/clang++ -fuse-ld=gold -pie -target x86_64-unknown-linux-gnu -Xlinker -rpath -Xlinker /home/takshaksh/swift/usr/lib/swift/linux /home/takshaksh/swift/usr/lib/swift/linux/x86_64/swiftrt.o /tmp/swift-2339bd.o #/tmp/swift-0db3ba.autolink -L /home/takshaksh/swift/usr/lib/swift/linux -lswiftCore --target=x86_64-unknown-linux-gnu -v -o swift
clang version 7.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/takshaksh/swift/usr/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;#m64
Selected multilib: .;#m64
"/usr/bin/ld.gold" -pie --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o swift /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/home/takshaksh/swift/usr/lib/swift/linux -L/usr/lib/gcc/x86_64-linux-gnu/9 -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -L/home/takshaksh/swift/usr/bin/../lib -L/lib -L/usr/lib -rpath /home/takshaksh/swift/usr/lib/swift/linux /home/takshaksh/swift/usr/lib/swift/linux/x86_64/swiftrt.o /tmp/swift-2339bd.o -lswiftSwiftOnoneSupport -lswiftCore -lswiftCore -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
/usr/bin/ld.gold: fatal error: swift: open: Is a directory
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
:0: error: link command failed with exit code 1 (use -v to see invocation)

Build ICU for 64 bit iOS

I'm trying to move my app to 64 bit arm processors (and 64 bit simulator), and for that I need to recompile the ICU library (49).
After three days I reached the point where the library compiles fine, and the script I'm using puts together various architectures into one (snippet):
# ...
#x86_64
DEVROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
SDKROOT=$DEVROOT/SDKs/iPhoneSimulator7.0.sdk
SYSROOT=$SDKROOT
export CFLAGS="-I$SDKROOT/usr/include/ -I./include/ $ICU_FLAGS -arch x86_64 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=7.0 -O3 -DU_HAVE_GCC_ATOMICS=0"
export CXXFLAGS="$CFLAGS"
export CC="$TOOLCHAINSROOT/usr/bin/clang"
export CXX="$TOOLCHAINSROOT/usr/bin/clang++"
export LDFLAGS="-L$SDKROOT/usr/lib/ -isysroot $SDKROOT -Wl,-dead_strip -miphoneos-version-min=7.0"
mkdir -p $BUILDDIR/iosbuild/x86_64
cd $BUILDDIR/iosbuild/x86_64
gnumake clean
sh $ICU_PATH/source/configure --host=arm-apple-darwin --enable-static --disable-shared -with-cross-build=$BUILDDIR/hostbuild --prefix=$BUILDDIR/iosbuild/x86_64 --with-data-packaging=library
gnumake
gnumake clean install
# ...
#x86_64
mkdir -p ${BUILDDIR}/iosbuild/x86_64/lib/libicudata
cd ${BUILDDIR}/iosbuild/x86_64/lib/libicudata
ar -x "${BUILDDIR}/iosbuild/x86_64/lib/libicudata.a"
mkdir -p ${BUILDDIR}/iosbuild/x86_64/lib/libicui18n
cd ${BUILDDIR}/iosbuild/x86_64/lib/libicui18n
ar -x "${BUILDDIR}/iosbuild/x86_64/lib/libicui18n.a"
mkdir -p ${BUILDDIR}/iosbuild/x86_64/lib/libicuio
cd ${BUILDDIR}/iosbuild/x86_64/lib/libicuio
ar -x "${BUILDDIR}/iosbuild/x86_64/lib/libicuio.a"
mkdir -p ${BUILDDIR}/iosbuild/x86_64/lib/libicule
cd ${BUILDDIR}/iosbuild/x86_64/lib/libicule
ar -x "${BUILDDIR}/iosbuild/x86_64/lib/libicule.a"
mkdir -p ${BUILDDIR}/iosbuild/x86_64/lib/libiculx
cd ${BUILDDIR}/iosbuild/x86_64/lib/libiculx
ar -x "${BUILDDIR}/iosbuild/x86_64/lib/libiculx.a"
mkdir -p ${BUILDDIR}/iosbuild/x86_64/lib/libicutest
cd ${BUILDDIR}/iosbuild/x86_64/lib/libicutest
ar -x "${BUILDDIR}/iosbuild/x86_64/lib/libicutest.a"
mkdir -p ${BUILDDIR}/iosbuild/x86_64/lib/libicutu
cd ${BUILDDIR}/iosbuild/x86_64/lib/libicutu
ar -x "${BUILDDIR}/iosbuild/x86_64/lib/libicutu.a"
mkdir -p ${BUILDDIR}/iosbuild/x86_64/lib/libicuuc
cd ${BUILDDIR}/iosbuild/x86_64/lib/libicuuc
ar -x "${BUILDDIR}/iosbuild/x86_64/lib/libicuuc.a"
ar -qc ${BUILDDIR}/iosbuild/x86_64/lib/libcombinedicu.a ${BUILDDIR}/iosbuild/x86_64/lib/libicudata/*.o ${BUILDDIR}/iosbuild/x86_64/lib/libicudata/*.ao ${BUILDDIR}/iosbuild/x86_64/lib/libicuuc/*.ao ${BUILDDIR}/iosbuild/x86_64/lib/libicui18n/*.ao ${BUILDDIR}/iosbuild/x86_64/lib/libicuio/*.ao ${BUILDDIR}/iosbuild/x86_64/lib/libicule/*.ao ${BUILDDIR}/iosbuild/x86_64/lib/libiculx/*.ao ${BUILDDIR}/iosbuild/x86_64/lib/libicutest/*.ao ${BUILDDIR}/iosbuild/x86_64/lib/libicutu/*.ao ${BUILDDIR}/iosbuild/x86_64/lib/libicuuc/*.ao
# ...
#put them together
lipo -create -arch x86_64 "${BUILDDIR}/iosbuild/x86_64/lib/libcombinedicu.a"
-arch i386 "${BUILDDIR}/iosbuild/i386/lib/libcombinedicu.a"
"${BUILDDIR}/iosbuild/arm64/lib/libcombinedicu.a"
"${BUILDDIR}/iosbuild/armv7s/lib/libcombinedicu.a"
-arch armv7 "${BUILDDIR}/iosbuild/armv7/lib/libcombinedicu.a"
-o "$FRAMEWORK_DIR/Versions/Current/$FRAMEWORK_NAME"
The problem is, when I'm compiling the app from XCode (for the 64 bit simulator), I get the following errors regarding the built ICU framework:
ld: warning: directory not found for option '-F"/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxPro/../BIMxEngine/extern/icu"'
duplicate symbol _OSAtomicIncrement32 in:
/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxEngine/extern/icu/ICU.framework/ICU(unistr.ao)
/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxEngine/extern/icu/ICU.framework/ICU(mutex.ao)
duplicate symbol _OSAtomicIncrement32Barrier in:
/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxEngine/extern/icu/ICU.framework/ICU(unistr.ao)
/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxEngine/extern/icu/ICU.framework/ICU(mutex.ao)
duplicate symbol _OSAtomicDecrement32 in:
/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxEngine/extern/icu/ICU.framework/ICU(unistr.ao)
/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxEngine/extern/icu/ICU.framework/ICU(mutex.ao)
duplicate symbol _OSAtomicDecrement32Barrier in:
/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxEngine/extern/icu/ICU.framework/ICU(unistr.ao)
/Users/gliptak/ac/m-220/Sources/VBExplorer/BIMxEngine/extern/icu/ICU.framework/ICU(mutex.ao)
...
ld: 64 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
As far as I can tell the mentioned functions are declared in system headers, and are not inline, so how can this error exist?
Do you have any ideas what I might do wrong?
UPDATE: indeed, those functions are static inline, so they cause the problem. So the question is now how do I avoid duplication?
UPDATE: tried the -std=gnu89 flag for the C compiler, no effect...
Found a solution here (confirmed working building on/for Mavericks). Could also be resolved using SVN trunk of icu4c, since that uses C++11 barriers instead.

How can I get pkg-config to work within eclipse juno (Mac OS X)?

I try to get gtkmm running within eclipse. This is my makefile (without the cleaning):
all : main.cpp
#export PATH+=/opt/local/bin;
#echo PATH=$(PATH);
g++ -v `pkg-config gtkmm-2.4 --cflags` \
-O0 -g3 -Wall -S \
-o main.o main.cpp;
g++ -v -o main.exe main.o \
`pkg-config gtkmm-2.4 \
--libs` ;
In the Console I get (amongst other output):
PATH=/usr/bin:/bin:/usr/sbin:/sbin
g++ -v `pkg-config gtkmm-2.4 --cflags` \
-O0 -g3 -Wall -S \
-o main.o main.cpp;
/bin/sh: pkg-config: command not found
I did:
ln -s /usr/bin/pkg-config /opt/local/bin/pkg-config
And when I type
/usr/bin/pkg-config
in Terminal, I get:
Must specify package names on the command line
So I assume pkg-config works in the "Terminal" ... But not in eclipse.
What can I do?
Thanks!
Nils
I don't know exactly what solved my Problem, since now, it works.
I guess it was one of the following:
makefile now looks like this:
all: main.cpp
g++ -v `pkg-config gtkmm-2.4 --cflags`-O0 -g3 -Wall -c -o main.o main.cpp;
g++ -v -o main.exe main.o `pkg-config gtkmm-2.4 --libs`
clean:
rm -f main.exe main.o
I have smybolic link towards pkg-config within /bin:
sudo ln -s /opt/local/bin/pkg-config /bin/pkg-config
I installed XQuartz
I updated MacPorts and all outdated ports:
sudo port -v selfupdate
sudo port upgrade outdated

xcodebuild not finding gcc 4.2

I am trying to run xcodebuild and I am getting the following error:
2011-12-11 04:42:22.834 xcodebuild[9155:4203] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 127 returned from shell command: /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2 -v -E -dM -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -x objective-c -c /dev/null 2>&1" UserInfo=0x4001a61a0 {NSLocalizedDescription=Non-zero exit code 127 returned from shell command: /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2 -v -E -dM -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -x objective-c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory}
2011-12-11 04:42:22.835 xcodebuild[9155:4203] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'objective-c'.
Compiler: /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2
Reason: /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2 -v -E -dM -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -x objective-c -c /dev/null 2>&1
2011-12-11 04:42:22.895 xcodebuild[9155:4203] error: Error Domain=NSPOSIXErrorDomain Code=2 "Non-zero exit code 127 returned from shell command: /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2 -v -E -dM -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -x c -c /dev/null 2>&1" UserInfo=0x4013cbb80 {NSLocalizedDescription=Non-zero exit code 127 returned from shell command: /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2 -v -E -dM -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -x c -c /dev/null 2>&1, NSLocalizedFailureReason=No such file or directory}
2011-12-11 04:42:22.900 xcodebuild[9155:4203] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c'.
Compiler: /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2
Reason: /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2 -v -E -dM -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -x c -c /dev/null 2>&1
Any idea why this is? I am guessing that it is because I don't have gcc-4.2 in the following path:
/Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/Frameworks/DevToolsCore.framework/Resources/gcc-4.2
as of right now gcc-4.2 is located at usr/bin. The question is how do I redirect it?
This could be be related to your $CC variable in your shell ( it keeps track of your compiler ) you can find more information from jMoody on github
Essentially you need to remove $CC
How did you select the compiler? Go to the Xcode navigator, click on the upmost item, then in the right window on your project (not the target), then Build Settings. U and in the section Build Options you can select the compiler. Usually you can choose between LLVM gcc-4.x and some Apple LLVM x.
Have you used xcode-select to select the version of Xcode you want to use?
Manpage.

bdw-gc install failed on lion with brew

i am install w3m with brew on lion. when i use the origin formula the installation is filed.
then i following the issues 7068 of homebrew update the bdw-gc.rb formula script
require 'formula'
class BdwGc < Formula
# url 'http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz'
url 'http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2alpha6.tar.gz'
homepage 'http://www.hpl.hp.com/personal/Hans_Boehm/gc/'
# 7.1
# md5 '2ff9924c7249ef7f736ecfe6f08f3f9b'
# 7.2alpha6
md5 '319d0b18cc4eb735c8038ece9df055e4'
fails_with_llvm "LLVM gives an unsupported inline asm error", :build => 2335
def install
# ucontext has been deprecated in 10.6
# use this flag to force the header to compile
# ENV.append 'CPPFLAGS', "-D_XOPEN_SOURCE" if MacOS.snow_leopard?
ENV.append 'CPPFLAGS', "-D_XOPEN_SOURCE"# if MacOS.snow_leopard?
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make install"
end
end
and reinstall it, but it's still failed. here is the install log
brew install bdw-gc
==> Downloading http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2alp
File already downloaded in /Users/akira/Library/Caches/Homebrew
==> ./configure --disable-debug --prefix=/usr/local/Cellar/bdw-gc/6
==> make install
........
libtool: compile: /usr/bin/llvm-gcc -DHAVE_CONFIG_H -I./include -I./include -I./libatomic_ops/src -I./libatomic_ops/src -D_XOPEN_SOURCE -fexceptions -O3 -march=core2 -w -pipe -c obj_map.c -o obj_map.o >/dev/null 2>&1
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/llvm-gcc -DHAVE_CONFIG_H -I./include -I./include -I./libatomic_ops/src -I./libatomic_ops/src -D_XOPEN_SOURCE -fexceptions -O3 -march=core2 -w -pipe -c -o pcr_interface.lo pcr_interface.c
./libatomic_ops/src/atomic_ops/sysdeps/gcc/x86_64.h: In function 'AO_test_and_set_full':
./libatomic_ops/src/ato==> Exit Status: 2
http://github.com/mxcl/homebrew/blob/master/Library/Formula/bdw-gc.rb#L22
==> Environment
HOMEBREW_VERSION: 0.8
HEAD: bc90bd554da6bd1199bdec92a830edbca24fa34e
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: quad-core 64-bit sandybridge
OS X: 10.7.2
Kernel Architecture: x86_64
Ruby: 1.8.7-249
/usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Xcode: 4.2
GCC-4.0: N/A
GCC-4.2: build 5666
LLVM: build 2336
MacPorts or Fink? false
X11 installed? true
==> Build Flags
CC: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CXX: /usr/bin/llvm-g++ => /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
LD: /usr/bin/llvm-gcc => /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CFLAGS: -O3 -march=core2 -w -pipe
CXXFLAGS: -O3 -march=core2 -w -pipe
CPPFLAGS: -D_XOPEN_SOURCE
MAKEFLAGS: -j4
Error: Failed executing: make install
These existing issues may help you:
https://github.com/mxcl/homebrew/issues/7068
Otherwise, please report the bug:
https://github.com/mxcl/homebrew/wiki/checklist-before-filing-a-new-issue
any suggestion?
this problem was fixed by Jack Nagel at Nov 15, 2011.
see the detail
bdw-gc: add 7.2alpha6 as the '--devel' version
but this batch still got a problem. the "make check" step does not works,so you can just skip this step and "make install".