Steps causing the bug to occur
- Follow instructions in vuo-0.5.1 README.md up to “LLVM and Clang 3.2”
- cd /tmp
- curl -OL http://llvm.org/releases/3.2/llvm-3.2.src.tar.gz
- curl -OL http://llvm.org/releases/3.2/clang-3.2.src.tar.gz
- tar zxf llvm-3.2.src.tar.gz
- cd llvm-3.2.src/tools
- tar zxf …/…/clang-3.2.src.tar.gz
- mv clang-3.2.src clang
- cd …
- CC=gcc CXX=g++ CFLAGS=“-march=x86-64” CXXFLAGS=“-march=x86-64” LDFLAGS=“-Wl,|checking for mmap of files… yes
-macosx_version_min,10.6” ./configure --prefix=/usr/local/Cellar/llvm/3.2 --enab|checking if /dev/zero is needed for mmap… no
le-optimized --disable-bindings --enable-targets=host
checking for C compiler default output file name… configure: error: C compiler cannot create executables
See `config.log’ for more details.
-----------
Core tests.
-----------
configure:2088: checking for C compiler version
configure:2095: gcc --version >&5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
configure:2098: $? = 0
configure:2105: gcc -v >&5
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
configure:2108: $? = 0
configure:2115: gcc -V >&5
clang: error: argument to ‘-V’ is missing (expected 1 value)
clang: error: no input files
configure:2118: $? = 1
configure:2141: checking for C compiler default output file name
configure:2168: gcc -march=x86-64 -Wl,-macosx_version_min,10.6 conftest.c >&5
Undefined symbols for architecture x86_64:
“start”, referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:2171: $? = 1
configure: failed program was:
| /* confdefs.h. /
| #define PACKAGE_NAME “LLVM”
| #define PACKAGE_TARNAME “llvm”
| #define PACKAGE_VERSION “3.2svn”
| #define PACKAGE_STRING “LLVM 3.2svn”
| #define PACKAGE_BUGREPORT “http://llvm.org/bugs/”
| #define LLVM_VERSION_MAJOR 3
| #define LLVM_VERSION_MINOR 2
| / end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2210: error: C compiler cannot create executables
See `config.log’ for more details.
Tried simpler case:
cat > foo.c
#include <stdio.h>
int main()
{
printf(“Moi maailma!\n”);
}
^D
gcc -march=x86-64 -v -Wl,-macosx_version_min,10.6 foo.c
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang” -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disabl
e-free -disable-llvm-verifier -main-file-name foo.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu x86-64 -target-l
inker-version 224.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/5.0 -fdebug-compilation-dir
/Users/a2deh/Vuo/Source/llvm-3.2.src -ferror-limit 19 -fmessage-length 225 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-
method=mixed -fobjc-default-synthesize-properties -fencode-extended-block-signature -fdiagnostics-show-option -o /var/folders/_5/stlctlyj07qcpzjy22qfpdxm0000gn/T/fo
o-RBoLPF.o -x c foo.c
clang -cc1 version 5.0 based upon LLVM 3.3svn default target x86_64-apple-darwin12.5.0
#include “…” search starts here:
#include <…> search starts here:
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/5.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld” -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o a.out -ma
cosx_version_min 10.6 /var/folders/_5/stlctlyj07qcpzjy22qfpdxm0000gn/T/foo-RBoLPF.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
olchain/usr/bin/…/lib/clang/5.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
“start”, referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Solution:
gcc -march=x86-64 -v -Wl,-macosx_version_min,10.6 foo.c
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang” -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disabl
e-free -disable-llvm-verifier -main-file-name foo.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu x86-64 -target-l
inker-version 224.1 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/5.0 -fdebug-compilation-dir
/Users/a2deh/Vuo/Source/llvm-3.2.src -ferror-limit 19 -fmessage-length 225 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-
method=mixed -fobjc-default-synthesize-properties -fencode-extended-block-signature -fdiagnostics-show-option -o /var/folders/_5/stlctlyj07qcpzjy22qfpdxm0000gn/T/fo
o-7AdnAv.o -x c foo.c
clang -cc1 version 5.0 based upon LLVM 3.3svn default target x86_64-apple-darwin12.5.0
#include “…” search starts here:
#include <…> search starts here:
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/lib/clang/5.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld” -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o a.out -ma
cosx_version_min 10.8 /var/folders/_5/stlctlyj07qcpzjy22qfpdxm0000gn/T/foo-7AdnAv.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xcto
olchain/usr/bin/…/lib/clang/5.0/lib/darwin/libclang_rt.osx.a
./a.out
Moi maailma!
IT WORKED!!!
How did the result differ from what you expected?
It didn’t work, as shown above.
When did you first notice this bug?
When trying to compile sources.
Have you found a workaround?
Yes, a fix, shown above.
Use:
LDFLAGS=“-Wl,-macosx_version_min,10.8”
instead of:
LDFLAGS=“-Wl,-macosx_version_min,10.6”
Change line 53 of README.md to:
CC=gcc CXX=g++ CFLAGS="-march=x86-64" CXXFLAGS="-march=x86-64" LDFLAGS="-Wl,-macosx_version_min,10.8" ./configure --prefix=/usr/local/Cellar/llvm/3.2 --enable-optimized --disable-bindings --enable-targets=host
Other notes
- Vuo version: 0.5.1
- macOS version: OS X 10.8
Yay! Now I’ll go through the rest of the instructions and see if I can compile my own extension!