Skip to content

Instantly share code, notes, and snippets.

@daniel-trinh
Created September 19, 2014 04:38
Show Gist options
  • Save daniel-trinh/53265734e208c2e9c3ae to your computer and use it in GitHub Desktop.
Save daniel-trinh/53265734e208c2e9c3ae to your computer and use it in GitHub Desktop.
Compiling hello_world v0.0.1 (file:///Users/danieltrinh/src/oss/rust_stuff/hello_world)
error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-o' '/Users/danieltrinh/src/oss/rust_stuff/hello_world/target/hello_world' '/Users/danieltrinh/src/oss/rust_stuff/hello_world/target/hello_world.o' '-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a' '-nodefaultlibs' '-fno-lto' '-Wl,-dead_strip' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libnative-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librand-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libsync-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librustrt-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcollections-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libunicode-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcore-4e7c5e5c.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liblibc-4e7c5e5c.rlib' '-L' '/Users/danieltrinh/src/oss/rust_stuff/hello_world/target' '-L' '/Users/danieltrinh/src/oss/rust_stuff/hello_world/target/deps' '-L' '/Users/danieltrinh/src/oss/rust_stuff/hello_world/.rust' '-L' '/Users/danieltrinh/src/oss/rust_stuff/hello_world' '-lSystem' '-lpthread' '-lc' '-lm' '-lcompiler-rt'
note: ld: warning: directory not found for option '-L/Users/danieltrinh/src/oss/rust_stuff/hello_world/.rust'
Assertion failed: (_mode == modeFinalAddress), function finalAddress, file /SourceCache/ld64/ld64-123.2.1/src/ld/ld.hpp, line 573.
0 0x1078f071c __assert_rtn + 76
1 0x10796901c ld::tool::OutputFile::addressOf(ld::Internal const&, ld::Fixup const*, ld::Atom const**) + 172
2 0x10796ba25 ld::tool::OutputFile::applyFixUps(ld::Internal&, unsigned long long, ld::Atom const*, unsigned char*) + 3909
3 0x107967f70 ld::tool::OutputFile::writeOutputFile(ld::Internal&) + 816
4 0x107960ab9 ld::tool::OutputFile::write(ld::Internal&) + 153
5 0x1078f0caa main + 1178
6 0x1078df2b4 start + 52
collect2: ld returned 1 exit status
@daniel-trinh
Copy link
Author

% ld -v
@(#)PROGRAM:ld  PROJECT:ld64-123.2.1
llvm version 3.0svn, from Apple Clang 2.1 (build 163.7.1)
% cc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
% rustc -v
rustc 0.12.0-nightly (9508faa22 2014-09-17 23:45:36 +0000)

@daniel-trinh
Copy link
Author

Managed to fix this by pointing gcc, cc, and clang to the latest clang version

% clang -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment