Skip to content

can't build head on my os x 10.8 machine #10941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cartazio opened this issue Dec 12, 2013 · 16 comments
Closed

can't build head on my os x 10.8 machine #10941

cartazio opened this issue Dec 12, 2013 · 16 comments

Comments

@cartazio
Copy link
Contributor

I recently installed rust head a few days ago, and today I did a clone into a directory so i could peruse rustc source. I just tried to build that clone today, at commit 1b12dca and the install fails.

heres the relevant build log

nb: i have xcode 5 installed, but the gcc in my path is gcc 4.8.


compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/libstd.dylib
link: x86_64-apple-darwin/rustllvm/librustllvm.a
cp: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustllvm.a
cp: x86_64-apple-darwin/stage1/lib/rustc/x86_64-apple-darwin/lib/librustllvm.a
cp: x86_64-apple-darwin/stage2/lib/rustc/x86_64-apple-darwin/lib/librustllvm.a
/Users/carter/Desktop/repoScratcher/rust/src/libstd/lib.rs:46:0: 46:23 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/libstd/lib.rs:46 #[pkgid="std#0.9-pre"];
                                                              ^~~~~~~~~~~~~~~~~~~~~~~
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/libextra.dylib
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustuv.dylib
/Users/carter/Desktop/repoScratcher/rust/src/librustuv/lib.rs:37:0: 37:26 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/librustuv/lib.rs:37 #[pkgid="rustuv#0.9-pre"];
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/carter/Desktop/repoScratcher/rust/src/libextra/lib.rs:23:0: 23:25 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/libextra/lib.rs:23 #[pkgid="extra#0.9-pre"];
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
cp: x86_64-apple-darwin/stage1/lib/libstd.dylib
cp: x86_64-apple-darwin/stage1/lib/librustuv.dylib
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/libsyntax.dylib
cp: x86_64-apple-darwin/stage1/lib/libextra.dylib
/Users/carter/Desktop/repoScratcher/rust/src/libsyntax/lib.rs:16:0: 16:26 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/libsyntax/lib.rs:16 #[pkgid="syntax#0.9-pre"];
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib
cp: x86_64-apple-darwin/stage1/lib/libsyntax.dylib
/Users/carter/Desktop/repoScratcher/rust/src/librustc/lib.rs:11:0: 11:25 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/librustc/lib.rs:11 #[pkgid="rustc#0.9-pre"];
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-o' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc-8581899a03b03e-0.9-pre.dylib' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/rustc.o' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/llvm/Release+Asserts/lib' '-L/Users/carter/Desktop/repoScratcher/rust/.rust' '-L/Users/carter/Desktop/repoScratcher/rust' '-lrustllvm' '-lstdc++' '-lLLVMInstrumentation' '-lLLVMInterpreter' '-lLLVMMCJIT' '-lLLVMJIT' '-lLLVMRuntimeDyld' '-lLLVMExecutionEngine' '-lLLVMAsmParser' '-lLLVMLinker' '-lLLVMBitWriter' '-lLLVMBitReader' '-lLLVMipo' '-lLLVMVectorize' '-lLLVMMipsDisassembler' '-lLLVMMipsCodeGen' '-lLLVMMipsAsmParser' '-lLLVMMipsDesc' '-lLLVMMipsInfo' '-lLLVMMipsAsmPrinter' '-lLLVMARMDisassembler' '-lLLVMARMCodeGen' '-lLLVMARMAsmParser' '-lLLVMARMDesc' '-lLLVMARMInfo' '-lLLVMARMAsmPrinter' '-lLLVMX86Disassembler' '-lLLVMX86AsmParser' '-lLLVMX86CodeGen' '-lLLVMSelectionDAG' '-lLLVMAsmPrinter' '-lLLVMMCParser' '-lLLVMCodeGen' '-lLLVMObjCARCOpts' '-lLLVMScalarOpts' '-lLLVMInstCombine' '-lLLVMTransformUtils' '-lLLVMipa' '-lLLVMAnalysis' '-lLLVMX86Desc' '-lLLVMX86Info' '-lLLVMTarget' '-lLLVMX86AsmPrinter' '-lLLVMMC' '-lLLVMObject' '-lLLVMX86Utils' '-lLLVMCore' '-lLLVMSupport' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lstd-6425b930ca146ae9-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lextra-aaa96aab146eb38e-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lsyntax-2bb2d559d93ae8f0-0.9-pre' '-lpthread' '-lstdc++' '-dynamiclib' '-Wl,-dylib' '-Wl,-install_name,@rpath/librustc-8581899a03b03e-0.9-pre.dylib' '-lmorestack' '-Wl,-rpath,@loader_path/.' '-Wl,-rpath,/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib'
note: ld: warning: directory not found for option '-L/Users/carter/Desktop/repoScratcher/rust/.rust'
Undefined symbols for architecture x86_64:
  "std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::RegToMem::runOnFunction(llvm::Function&) in libLLVMScalarOpts.a(Reg2Mem.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
  "std::__detail::_List_node_base::_M_unhook()", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/librustc/lib.rs:393
make: *** [x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib] Error 101
carter repoScratcher/rust ‹master› » make                                                                                                        2 ↵
cfg: build triple x86_64-apple-darwin
cfg: host triples x86_64-apple-darwin
cfg: target triples x86_64-apple-darwin
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: host for x86_64-apple-darwin is x86_64
cfg: os for x86_64-apple-darwin is apple-darwin
cfg: using gcc
cfg: no llnextgen found, omitting grammar-verification
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib
/Users/carter/Desktop/repoScratcher/rust/src/librustc/lib.rs:11:0: 11:25 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/librustc/lib.rs:11 #[pkgid="rustc#0.9-pre"];
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-o' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc-8581899a03b03e-0.9-pre.dylib' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/rustc.o' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/llvm/Release+Asserts/lib' '-L/Users/carter/Desktop/repoScratcher/rust/.rust' '-L/Users/carter/Desktop/repoScratcher/rust' '-lrustllvm' '-lstdc++' '-lLLVMInstrumentation' '-lLLVMInterpreter' '-lLLVMMCJIT' '-lLLVMJIT' '-lLLVMRuntimeDyld' '-lLLVMExecutionEngine' '-lLLVMAsmParser' '-lLLVMLinker' '-lLLVMBitWriter' '-lLLVMBitReader' '-lLLVMipo' '-lLLVMVectorize' '-lLLVMMipsDisassembler' '-lLLVMMipsCodeGen' '-lLLVMMipsAsmParser' '-lLLVMMipsDesc' '-lLLVMMipsInfo' '-lLLVMMipsAsmPrinter' '-lLLVMARMDisassembler' '-lLLVMARMCodeGen' '-lLLVMARMAsmParser' '-lLLVMARMDesc' '-lLLVMARMInfo' '-lLLVMARMAsmPrinter' '-lLLVMX86Disassembler' '-lLLVMX86AsmParser' '-lLLVMX86CodeGen' '-lLLVMSelectionDAG' '-lLLVMAsmPrinter' '-lLLVMMCParser' '-lLLVMCodeGen' '-lLLVMObjCARCOpts' '-lLLVMScalarOpts' '-lLLVMInstCombine' '-lLLVMTransformUtils' '-lLLVMipa' '-lLLVMAnalysis' '-lLLVMX86Desc' '-lLLVMX86Info' '-lLLVMTarget' '-lLLVMX86AsmPrinter' '-lLLVMMC' '-lLLVMObject' '-lLLVMX86Utils' '-lLLVMCore' '-lLLVMSupport' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lstd-6425b930ca146ae9-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lextra-aaa96aab146eb38e-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lsyntax-2bb2d559d93ae8f0-0.9-pre' '-lpthread' '-lstdc++' '-dynamiclib' '-Wl,-dylib' '-Wl,-install_name,@rpath/librustc-8581899a03b03e-0.9-pre.dylib' '-lmorestack' '-Wl,-rpath,@loader_path/.' '-Wl,-rpath,/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib'
note: ld: warning: directory not found for option '-L/Users/carter/Desktop/repoScratcher/rust/.rust'
Undefined symbols for architecture x86_64:
  "std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::RegToMem::runOnFunction(llvm::Function&) in libLLVMScalarOpts.a(Reg2Mem.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
  "std::__detail::_List_node_base::_M_unhook()", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/librustc/lib.rs:393
make: *** [x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib] Error 101


@cartazio
Copy link
Contributor Author

the key piece seems to be

error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-o' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc-8581899a03b03e-0.9-pre.dylib' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/rustc.o' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/llvm/Release+Asserts/lib' '-L/Users/carter/Desktop/repoScratcher/rust/.rust' '-L/Users/carter/Desktop/repoScratcher/rust' '-lrustllvm' '-lstdc++' '-lLLVMInstrumentation' '-lLLVMInterpreter' '-lLLVMMCJIT' '-lLLVMJIT' '-lLLVMRuntimeDyld' '-lLLVMExecutionEngine' '-lLLVMAsmParser' '-lLLVMLinker' '-lLLVMBitWriter' '-lLLVMBitReader' '-lLLVMipo' '-lLLVMVectorize' '-lLLVMMipsDisassembler' '-lLLVMMipsCodeGen' '-lLLVMMipsAsmParser' '-lLLVMMipsDesc' '-lLLVMMipsInfo' '-lLLVMMipsAsmPrinter' '-lLLVMARMDisassembler' '-lLLVMARMCodeGen' '-lLLVMARMAsmParser' '-lLLVMARMDesc' '-lLLVMARMInfo' '-lLLVMARMAsmPrinter' '-lLLVMX86Disassembler' '-lLLVMX86AsmParser' '-lLLVMX86CodeGen' '-lLLVMSelectionDAG' '-lLLVMAsmPrinter' '-lLLVMMCParser' '-lLLVMCodeGen' '-lLLVMObjCARCOpts' '-lLLVMScalarOpts' '-lLLVMInstCombine' '-lLLVMTransformUtils' '-lLLVMipa' '-lLLVMAnalysis' '-lLLVMX86Desc' '-lLLVMX86Info' '-lLLVMTarget' '-lLLVMX86AsmPrinter' '-lLLVMMC' '-lLLVMObject' '-lLLVMX86Utils' '-lLLVMCore' '-lLLVMSupport' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lstd-6425b930ca146ae9-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lextra-aaa96aab146eb38e-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lsyntax-2bb2d559d93ae8f0-0.9-pre' '-lpthread' '-lstdc++' '-dynamiclib' '-Wl,-dylib' '-Wl,-install_name,@rpath/librustc-8581899a03b03e-0.9-pre.dylib' '-lmorestack' '-Wl,-rpath,@loader_path/.' '-Wl,-rpath,/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib'
note: ld: warning: directory not found for option '-L/Users/carter/Desktop/repoScratcher/rust/.rust'
Undefined symbols for architecture x86_64:
  "std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::RegToMem::runOnFunction(llvm::Function&) in libLLVMScalarOpts.a(Reg2Mem.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
  "std::__detail::_List_node_base::_M_unhook()", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@alexcrichton
Copy link
Member

I would recommend blowing away your local LLVM build tree and rebuilding LLVM. I've seen this often happen when LLVM gets out of date.

@cartazio
Copy link
Contributor Author

I'll try that next. But i literally only did the clone < 1 hour ago! How could the llvm be out of date already?

@alexcrichton
Copy link
Member

Hm, if this is a fresh build, then that's a little disturbing. This normally happens when old checkouts are updated with a new LLVM and things get out of sync. In your case, an LLVM rebuild may not be sufficient (sorry I should have read the initial report a little more closely).

@cartazio
Copy link
Contributor Author

another important point is that i did make -j2, maybe I discovered a race condition in the build that borks something?

i'm going to try make clean ; wipe out llvm ; ./configure ; make with no -jN / -j flags and see if that works

@eminence
Copy link
Contributor

i believe make clean-llvm is the canonical way to clean your local LLVM build tree

@cartazio
Copy link
Contributor Author

ok, well, i'm going to just clone a fresh tree. Just tried building again and got

llvm[4]: Compiling Local.cpp for Release+Asserts build
llvm[4]: Compiling SpecialCaseList.cpp for Release+Asserts build
llvm[4]: Linking Release+Asserts unit test Utils (without symbols)
llvm[4]: ======= Finished Linking Release+Asserts Unit test Utils (without symbols)
llvm[5]: Compiling sample.c for Release+Asserts build
llvm[5]: Building Release+Asserts Archive Library libsample.a
llvm[5]: Compiling main.c for Release+Asserts build
llvm[5]: Linking Release+Asserts executable Sample (without symbols)
llvm[5]: ======= Finished Linking Release+Asserts Executable Sample (without symbols)
make[2]: Nothing to be done for `all'.
llvm[1]: ***** Completed Release+Asserts Build
compile: x86_64-apple-darwin/rt/stage0/arch/x86_64/_context.o
compile: x86_64-apple-darwin/rt/stage0/arch/x86_64/record_sp.o
link: x86_64-apple-darwin/rt/stage0/librustrt.a
/usr/bin/ranlib: file: x86_64-apple-darwin/rt/stage0/librustrt.a(rust_android_dummy.o) has no symbols
/usr/bin/ranlib: file: x86_64-apple-darwin/rt/stage0/librustrt.a(record_sp.o) has no symbols
cp: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustrt.a
compile: x86_64-apple-darwin/rt/stage0/arch/x86_64/morestack.o
link: x86_64-apple-darwin/rt/stage0/arch/x86_64/libmorestack.a
cp: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/libmorestack.a
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/libstd.dylib
/Users/carter/Desktop/repoScratcher/rust/src/libstd/lib.rs:46:0: 46:23 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/libstd/lib.rs:46 #[pkgid="std#0.9-pre"];
                                                              ^~~~~~~~~~~~~~~~~~~~~~~
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/libextra.dylib
/Users/carter/Desktop/repoScratcher/rust/src/libextra/lib.rs:23:0: 23:25 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/libextra/lib.rs:23 #[pkgid="extra#0.9-pre"];
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) obj.target/libuv/src/fs-poll.o
  CC(target) obj.target/libuv/src/inet.o
  CC(target) obj.target/libuv/src/uv-common.o
  CC(target) obj.target/libuv/src/version.o
  CC(target) obj.target/libuv/src/unix/async.o
  CC(target) obj.target/libuv/src/unix/core.o
  CC(target) obj.target/libuv/src/unix/dl.o
  CC(target) obj.target/libuv/src/unix/fs.o
  CC(target) obj.target/libuv/src/unix/getaddrinfo.o
  CC(target) obj.target/libuv/src/unix/loop.o
  CC(target) obj.target/libuv/src/unix/loop-watcher.o
  CC(target) obj.target/libuv/src/unix/pipe.o
  CC(target) obj.target/libuv/src/unix/poll.o
  CC(target) obj.target/libuv/src/unix/process.o
  CC(target) obj.target/libuv/src/unix/signal.o
  CC(target) obj.target/libuv/src/unix/stream.o
  CC(target) obj.target/libuv/src/unix/tcp.o
  CC(target) obj.target/libuv/src/unix/thread.o
  CC(target) obj.target/libuv/src/unix/threadpool.o
  CC(target) obj.target/libuv/src/unix/timer.o
  CC(target) obj.target/libuv/src/unix/tty.o
  CC(target) obj.target/libuv/src/unix/udp.o
  CC(target) obj.target/libuv/src/unix/proctitle.o
  CC(target) obj.target/libuv/src/unix/darwin.o
  CC(target) obj.target/libuv/src/unix/fsevents.o
  CC(target) obj.target/libuv/src/unix/darwin-proctitle.o
  CC(target) obj.target/libuv/src/unix/kqueue.o
  LIBTOOL-STATIC libuv.a
compile: x86_64-apple-darwin/rt/uv_support/rust_uv.o
link: x86_64-apple-darwin/rt/uv_support/libuv_support.a
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustuv.dylib
/Users/carter/Desktop/repoScratcher/rust/src/librustuv/lib.rs:37:0: 37:26 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/librustuv/lib.rs:37 #[pkgid="rustuv#0.9-pre"];
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/libsyntax.dylib
/Users/carter/Desktop/repoScratcher/rust/src/libsyntax/lib.rs:16:0: 16:26 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/libsyntax/lib.rs:16 #[pkgid="syntax#0.9-pre"];
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
compile: x86_64-apple-darwin/rustllvm/RustWrapper.o
compile: x86_64-apple-darwin/rustllvm/PassWrapper.o
link: x86_64-apple-darwin/rustllvm/librustllvm.a
cp: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustllvm.a
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib
/Users/carter/Desktop/repoScratcher/rust/src/librustc/lib.rs:11:0: 11:25 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/librustc/lib.rs:11 #[pkgid="rustc#0.9-pre"];
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-o' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc-8581899a03b03e-0.9-pre.dylib' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/rustc.o' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/llvm/Release+Asserts/lib' '-L/Users/carter/Desktop/repoScratcher/rust/.rust' '-L/Users/carter/Desktop/repoScratcher/rust' '-lrustllvm' '-lstdc++' '-lLLVMInstrumentation' '-lLLVMInterpreter' '-lLLVMMCJIT' '-lLLVMJIT' '-lLLVMRuntimeDyld' '-lLLVMExecutionEngine' '-lLLVMAsmParser' '-lLLVMLinker' '-lLLVMBitWriter' '-lLLVMBitReader' '-lLLVMipo' '-lLLVMVectorize' '-lLLVMMipsDisassembler' '-lLLVMMipsCodeGen' '-lLLVMMipsAsmParser' '-lLLVMMipsDesc' '-lLLVMMipsInfo' '-lLLVMMipsAsmPrinter' '-lLLVMARMDisassembler' '-lLLVMARMCodeGen' '-lLLVMARMAsmParser' '-lLLVMARMDesc' '-lLLVMARMInfo' '-lLLVMARMAsmPrinter' '-lLLVMX86Disassembler' '-lLLVMX86AsmParser' '-lLLVMX86CodeGen' '-lLLVMSelectionDAG' '-lLLVMAsmPrinter' '-lLLVMMCParser' '-lLLVMCodeGen' '-lLLVMObjCARCOpts' '-lLLVMScalarOpts' '-lLLVMInstCombine' '-lLLVMTransformUtils' '-lLLVMipa' '-lLLVMAnalysis' '-lLLVMX86Desc' '-lLLVMX86Info' '-lLLVMTarget' '-lLLVMX86AsmPrinter' '-lLLVMMC' '-lLLVMObject' '-lLLVMX86Utils' '-lLLVMCore' '-lLLVMSupport' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lstd-6425b930ca146ae9-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lextra-aaa96aab146eb38e-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lsyntax-2bb2d559d93ae8f0-0.9-pre' '-lpthread' '-lstdc++' '-dynamiclib' '-Wl,-dylib' '-Wl,-install_name,@rpath/librustc-8581899a03b03e-0.9-pre.dylib' '-lmorestack' '-Wl,-rpath,@loader_path/.' '-Wl,-rpath,/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib'
note: ld: warning: directory not found for option '-L/Users/carter/Desktop/repoScratcher/rust/.rust'
Undefined symbols for architecture x86_64:
  "std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::RegToMem::runOnFunction(llvm::Function&) in libLLVMScalarOpts.a(Reg2Mem.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
  "std::__detail::_List_node_base::_M_unhook()", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/librustc/lib.rs:393
make: *** [x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib] Error 101


i'm confused by the

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/librustc/lib.rs:393
make: *** [x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib] Error 101

because theres no

task 'rustc' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/libsyntax/diagnostic.rs:102

on my computer..

@cartazio
Copy link
Contributor Author

I did a completely fresh clone, and got

compile: x86_64-apple-darwin/rustllvm/RustWrapper.o
compile: x86_64-apple-darwin/rustllvm/PassWrapper.o
link: x86_64-apple-darwin/rustllvm/librustllvm.a
cp: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustllvm.a
compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib
/Users/carter/Desktop/repoScratcher/rust/src/librustc/lib.rs:11:0: 11:25 warning: unknown crate attribute, #[warn(attribute_usage)] on by default
/Users/carter/Desktop/repoScratcher/rust/src/librustc/lib.rs:11 #[pkgid="rustc#0.9-pre"];
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-o' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc-8581899a03b03e-0.9-pre.dylib' 'x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/rustc.o' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/llvm/Release+Asserts/lib' '-L/Users/carter/Desktop/repoScratcher/rust/.rust' '-L/Users/carter/Desktop/repoScratcher/rust' '-lrustllvm' '-lstdc++' '-lLLVMInstrumentation' '-lLLVMInterpreter' '-lLLVMMCJIT' '-lLLVMJIT' '-lLLVMRuntimeDyld' '-lLLVMExecutionEngine' '-lLLVMAsmParser' '-lLLVMLinker' '-lLLVMBitWriter' '-lLLVMBitReader' '-lLLVMipo' '-lLLVMVectorize' '-lLLVMMipsDisassembler' '-lLLVMMipsCodeGen' '-lLLVMMipsAsmParser' '-lLLVMMipsDesc' '-lLLVMMipsInfo' '-lLLVMMipsAsmPrinter' '-lLLVMARMDisassembler' '-lLLVMARMCodeGen' '-lLLVMARMAsmParser' '-lLLVMARMDesc' '-lLLVMARMInfo' '-lLLVMARMAsmPrinter' '-lLLVMX86Disassembler' '-lLLVMX86AsmParser' '-lLLVMX86CodeGen' '-lLLVMSelectionDAG' '-lLLVMAsmPrinter' '-lLLVMMCParser' '-lLLVMCodeGen' '-lLLVMObjCARCOpts' '-lLLVMScalarOpts' '-lLLVMInstCombine' '-lLLVMTransformUtils' '-lLLVMipa' '-lLLVMAnalysis' '-lLLVMX86Desc' '-lLLVMX86Info' '-lLLVMTarget' '-lLLVMX86AsmPrinter' '-lLLVMMC' '-lLLVMObject' '-lLLVMX86Utils' '-lLLVMCore' '-lLLVMSupport' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lstd-6425b930ca146ae9-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lextra-aaa96aab146eb38e-0.9-pre' '-L/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-lsyntax-2bb2d559d93ae8f0-0.9-pre' '-lpthread' '-lstdc++' '-dynamiclib' '-Wl,-dylib' '-Wl,-install_name,@rpath/librustc-8581899a03b03e-0.9-pre.dylib' '-lmorestack' '-Wl,-rpath,@loader_path/.' '-Wl,-rpath,/Users/carter/Desktop/repoScratcher/rust/x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib'
note: ld: warning: directory not found for option '-L/Users/carter/Desktop/repoScratcher/rust/.rust'
Undefined symbols for architecture x86_64:
  "std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::RegToMem::runOnFunction(llvm::Function&) in libLLVMScalarOpts.a(Reg2Mem.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
  "std::__detail::_List_node_base::_M_unhook()", referenced from:
      (anonymous namespace)::MemsetRanges::addRange(long long, long long, llvm::Value*, unsigned int, llvm::Instruction*) in libLLVMScalarOpts.a(MemCpyOptimizer.o)
      (anonymous namespace)::MipsELFObjectWriter::sortRelocs(llvm::MCAssembler const&, std::vector<llvm::ELFRelocationEntry, std::allocator<llvm::ELFRelocationEntry> >&) in libLLVMMipsDesc.a(MipsELFObjectWriter.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/libsyntax/diagnostic.rs:102
task '<main>' failed at 'explicit failure', /Users/rustbuild/src/rust-buildbot/slave/snap3-mac/build/src/librustc/lib.rs:393
make: *** [x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/librustc.dylib] Error 101```

@cartazio
Copy link
Contributor Author

I've a theory that the issue is that i'm using gcc rather than clang. (specifically i'm using gcc 4.8)

I'll try using ./configure --enable-clang and report back.

and if that fails, I'll try to use the rust i've got installed locally as the boostrap one instead

@cartazio
Copy link
Contributor Author

still getting this problem

@cartazio
Copy link
Contributor Author

heres the output of my most recent configure run, where the associated build is currently in progress

build setup done as follow:

clone ; cd rust ; mkdir build ; ../configure ; make

nb, prior build attempts have been variations of clone ; cd rust ; ./configure ; make with experiments passing various flags to ./configure




CFG_PREFIX           := /usr/local
CFG_LOCAL_RUST_ROOT  := /usr/local
CFG_LLVM_ROOT        := 
CFG_ANDROID_CROSS_PATH := /opt/ndk_standalone
CFG_MINGW32_CROSS_PATH := 
CFG_BUILD            := x86_64-apple-darwin
CFG_HOST             := x86_64-apple-darwin
CFG_TARGET           := x86_64-apple-darwin
CFG_LOCALSTATEDIR    := /var/lib
CFG_SYSCONFDIR       := /etc
CFG_DATADIR          := /usr/local/share
CFG_INFODIR          := /usr/local/share/info
CFG_MANDIR           := /usr/local/share/man
CFG_LIBDIR           := /usr/local/lib
CFG_PERL             := /usr/bin/perl
CFG_CURLORWGET       := /usr/bin/curl
CFG_PYTHON           := /usr/local/bin/python2.7
CFG_GIT              := /usr/local/bin/git
CFG_CLANG            := /usr/bin/clang++
CFG_CCACHE           := 
CFG_GCC              := /Users/carter/bin/gcc
CFG_LD               := /usr/bin/ld
CFG_VALGRIND         := /usr/local/bin/valgrind
CFG_PERF             := 
CFG_ISCC             := 
CFG_LLNEXTGEN        := 
CFG_PANDOC           := /Users/carter/Library/Haskell/bin/pandoc
CFG_PDFLATEX         := /usr/texbin/pdflatex
CFG_XETEX            := /usr/texbin/xetex
CFG_LUATEX           := /usr/texbin/luatex
CFG_NODE             := /usr/local/bin/node
CFG_GDB              := /usr/bin/gdb
CFG_ADB              := 
CFG_SRC_DIR          := /Users/carter/Desktop/repoScratcher/rust/
CFG_BUILD_DIR        := /Users/carter/Desktop/repoScratcher/rust/build/
CFG_OSTYPE           := apple-darwin
CFG_CPUTYPE          := x86_64
CFG_CONFIGURE_ARGS   := 
CFG_PREFIX           := /usr/local
CFG_BUILD            := x86_64-apple-darwin
CFG_HOST             := x86_64-apple-darwin
CFG_TARGET           := x86_64-apple-darwin
CFG_C_COMPILER       := gcc
CFG_LIBDIR           := lib
CFG_DISABLE_MANAGE_SUBMODULES := 
CFG_ANDROID_CROSS_PATH := /opt/ndk_standalone
CFG_MINGW32_CROSS_PATH := 
CFG_MANDIR           := /usr/local/share/man
CFG_LLVM_ROOT        := 
CFG_LLVM_SRC_DIR     := /Users/carter/Desktop/repoScratcher/rust/src/llvm/
CFG_LLVM_BUILD_DIR_x86_64_apple_darwin := /Users/carter/Desktop/repoScratcher/rust/build/x86_64-apple-darwin/llvm
CFG_LLVM_INST_DIR_x86_64_apple_darwin := /Users/carter/Desktop/repoScratcher/rust/build/x86_64-apple-darwin/llvm/Release+Asserts

@cartazio
Copy link
Contributor Author

so brew install rust --HEAD works. this makes me suspect that somehow linking is using my llvm rather than rusts. Will report back on further experimentation

@cartazio
Copy link
Contributor Author

failed again. same error as before.

now i'm testing brew install rust --HEAD, which had worked a few days ago. Ok, that worked.

will try some more ideas. This is weird

@cartazio
Copy link
Contributor Author

current theory: cc points to xcode 5 clang, but gcc points to gcc 4.8.
doing more build testing to see having gcc and cc point to the same things works.

@cartazio
Copy link
Contributor Author

solution:

cc,gcc,g++ need to respectively point to gcc,gcc,g++ or clang,clang,clang++, not some combination thereof.

this can be determined by

cc -version
gcc --version
g++ --version 

though this could also use the -v flag, which seems to give much more info

@cartazio
Copy link
Contributor Author

closing this ticket, will open another one for checking for version compat

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
[`no_effect`]: Suggest adding `return` if applicable

Closes rust-lang#10941

Unfortunately doesn't catch anything complex as `no_effect` already wouldn't, but I'm fine with that (it catches `ControlFlow` at least :D)

changelog: [`no_effect`]: Suggest adding `return` if statement has same type as function's return type and is the last statement in a block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants