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

Mac linker error: dyld: Symbol not found: _futimens #5418

Closed
n8gray opened this Issue Jul 24, 2017 · 37 comments

Comments

Projects
None yet
@n8gray
Copy link

n8gray commented Jul 24, 2017

Following the tutorial here I've installed Rust and Emscripten. But when I try to compile a simple rust file to WebAssembly I get an error from llvm-ar. I'm on macOS Sierra 10.12.5:

[i852946@LAXM00618711A]% uname -a
Darwin LAXM00618711A 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64

[i852946@LAXM00618711A]% rustc --version
rustc 1.19.0 (0ade33941 2017-07-17)

[i852946@LAXM00618711A]% emcc --version
emcc (Emscripten gcc/clang-like replacement) 1.37.15 (commit 519de4c4160f37af5e0c24a5cc2f57d142ad0c65)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[i852946@LAXM00618711A]% cat main.rs
fn main() {
    println!("Hello, world!");
}

[i852946@LAXM00618711A]% rustc --target=wasm32-unknown-emscripten main.rs -o main.html
error: linking with `emcc` failed: exit code: 1
  |
  = note: "emcc" "-s" "DISABLE_EXCEPTION_CATCHING=0" "-L" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib" "main.0.o" "-o" "main.html" "-s" "EXPORTED_FUNCTIONS=[\"_main\",\"_rust_eh_personality\"]" "-O0" "--memory-init-file" "0" "-g0" "-s" "DEFAULT_LIBRARY_FUNCS_TO_INCLUDE=[]" "-L" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-f4594d3e53dcb114.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/librand-1efbcfd8938372b6.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcollections-532a3dbf317eff86.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd_unicode-cfbd6648f7db2ee5.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_unwind-a0157c0ca919c364.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-488b4ab4bd53a138.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-ca07b617414dd0fa.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc_system-68e33a366943aef4.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-88c194c15fdb6521.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-687e6a964d22cbb4.rlib" "/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-987729be881d4d32.rlib" "-l" "c" "-s" "BINARYEN=1" "-s" "ERROR_ON_UNDEFINED_SYMBOLS=1"
  = note: extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-488b4ab4bd53a138.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_ypnCpN_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_ypnCpN_archive_contents/unwind-488b4ab4bd53a138.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-488b4ab4bd53a138.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x000000010570d138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x000000010570c366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010570d77e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x00000001092c5b4d _sigtramp + 1225711661
          5  libsystem_platform.dylib 0x00000001092d0464 _sigtramp + 1225754948
          6  libsystem_platform.dylib 0x00000001092ab793 _sigtramp + 1225604211
          7  libsystem_platform.dylib 0x00000001092ab89e _sigtramp + 1225604478
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x0000000105955358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x000000010558f33c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x000000010558dce6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x000000010558b599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libunwind-488b4ab4bd53a138.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_unwind-a0157c0ca919c364.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_VOH6_8_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_VOH6_8_archive_contents/panic_unwind-a0157c0ca919c364.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_unwind-a0157c0ca919c364.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x0000000105c2e138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x0000000105c2d366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x0000000105c2e77e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x000000010c25db4d _sigtramp + 1275617325
          5  libsystem_platform.dylib 0x000000010c268464 _sigtramp + 1275660612
          6  libsystem_platform.dylib 0x000000010c243793 _sigtramp + 1275509875
          7  libsystem_platform.dylib 0x000000010c24389e _sigtramp + 1275510142
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x0000000105e76358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x0000000105ab033c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x0000000105aaece6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x0000000105aac599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          14 libdyld.dylib            0x0000000000000003 start + 1073970639
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libpanic_unwind-a0157c0ca919c364.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcollections-532a3dbf317eff86.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_y7Qv4f_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_y7Qv4f_archive_contents/collections-532a3dbf317eff86.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcollections-532a3dbf317eff86.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x000000010d65c138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x000000010d65b366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010d65c77e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x00000001116e0b4d _sigtramp + 1364234285
          5  libsystem_platform.dylib 0x00000001116eb464 _sigtramp + 1364277572
          6  libsystem_platform.dylib 0x00000001116c6793 _sigtramp + 1364126835
          7  libsystem_platform.dylib 0x00000001116c689e _sigtramp + 1364127102
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x000000010d8a4358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x000000010d4de33c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x000000010d4dcce6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x000000010d4da599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          14 libdyld.dylib            0x0000000000000003 start + 1073970639
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcollections-532a3dbf317eff86.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/librand-1efbcfd8938372b6.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_vP2t_J_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_vP2t_J_archive_contents/rand-1efbcfd8938372b6.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/librand-1efbcfd8938372b6.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x000000010146e138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x000000010146d366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010146e77e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x000000010dae3b4d _sigtramp + 1301332013
          5  libsystem_platform.dylib 0x000000010daee464 _sigtramp + 1301375300
          6  libsystem_platform.dylib 0x000000010dac9793 _sigtramp + 1301224563
          7  libsystem_platform.dylib 0x000000010dac989e _sigtramp + 1301224830
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x00000001016b6358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x00000001012f033c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x00000001012eece6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x00000001012ec599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/librand-1efbcfd8938372b6.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd_unicode-cfbd6648f7db2ee5.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_Nn6f4y_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_Nn6f4y_archive_contents/std_unicode-cfbd6648f7db2ee5.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd_unicode-cfbd6648f7db2ee5.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x000000010c1ac138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x000000010c1ab366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010c1ac77e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x0000000112eb2b4d _sigtramp + 1389211693
          5  libsystem_platform.dylib 0x0000000112ebd464 _sigtramp + 1389254980
          6  libsystem_platform.dylib 0x0000000112e98793 _sigtramp + 1389104243
          7  libsystem_platform.dylib 0x0000000112e9889e _sigtramp + 1389104510
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x000000010c3f4358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x000000010c02e33c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x000000010c02cce6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x000000010c02a599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          14 libdyld.dylib            0x0000000000000003 start + 1073970639
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd_unicode-cfbd6648f7db2ee5.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-ca07b617414dd0fa.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_cCct0w_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_cCct0w_archive_contents/alloc-ca07b617414dd0fa.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-ca07b617414dd0fa.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x0000000107956138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x0000000107955366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010795677e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x0000000110136b4d _sigtramp + 1341517869
          5  libsystem_platform.dylib 0x0000000110141464 _sigtramp + 1341561156
          6  libsystem_platform.dylib 0x000000011011c793 _sigtramp + 1341410419
          7  libsystem_platform.dylib 0x000000011011c89e _sigtramp + 1341410686
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x0000000107b9e358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x00000001077d833c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x00000001077d6ce6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x00000001077d4599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc-ca07b617414dd0fa.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc_system-68e33a366943aef4.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_fUCxR6_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_fUCxR6_archive_contents/alloc_system-68e33a366943aef4.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc_system-68e33a366943aef4.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x0000000103229138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x0000000103228366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010322977e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x0000000107c2bb4d _sigtramp + 1202012205
          5  libsystem_platform.dylib 0x0000000107c36464 _sigtramp + 1202055492
          6  libsystem_platform.dylib 0x0000000107c11793 _sigtramp + 1201904755
          7  libsystem_platform.dylib 0x0000000107c1189e _sigtramp + 1201905022
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x0000000103471358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x00000001030ab33c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x00000001030a9ce6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x00000001030a7599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          14 libdyld.dylib            0x0000000000000003 start + 1073970639
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liballoc_system-68e33a366943aef4.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-f4594d3e53dcb114.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_CJwaUu_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_CJwaUu_archive_contents/std-f4594d3e53dcb114.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-f4594d3e53dcb114.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x000000010508c138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x000000010508b366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010508c77e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x000000010c1c4b4d _sigtramp + 1274990637
          5  libsystem_platform.dylib 0x000000010c1cf464 _sigtramp + 1275033924
          6  libsystem_platform.dylib 0x000000010c1aa793 _sigtramp + 1274883187
          7  libsystem_platform.dylib 0x000000010c1aa89e _sigtramp + 1274883454
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x00000001052d4358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x0000000104f0e33c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x0000000104f0cce6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x0000000104f0a599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-f4594d3e53dcb114.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-88c194c15fdb6521.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_mEKXWd_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_mEKXWd_archive_contents/libc-88c194c15fdb6521.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-88c194c15fdb6521.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x00000001054d6138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x00000001054d5366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x00000001054d677e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x000000011160bb4d _sigtramp + 1363361837
          5  libsystem_platform.dylib 0x0000000111616464 _sigtramp + 1363405124
          6  libsystem_platform.dylib 0x00000001115f1793 _sigtramp + 1363254387
          7  libsystem_platform.dylib 0x00000001115f189e _sigtramp + 1363254654
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x000000010571e358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x000000010535833c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x0000000105356ce6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x0000000105354599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/liblibc-88c194c15fdb6521.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-987729be881d4d32.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_smgjDK_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_smgjDK_archive_contents/compiler_builtins-987729be881d4d32.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-987729be881d4d32.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x000000010c594138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x000000010c593366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010c59477e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x000000010ed69b4d _sigtramp + 1320755245
          5  libsystem_platform.dylib 0x000000010ed74464 _sigtramp + 1320798532
          6  libsystem_platform.dylib 0x000000010ed4f793 _sigtramp + 1320647795
          7  libsystem_platform.dylib 0x000000010ed4f89e _sigtramp + 1320648062
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x000000010c7dc358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x000000010c41633c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x000000010c414ce6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x000000010c412599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcompiler_builtins-987729be881d4d32.rlib 
          
          extract archive contents(/Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-687e6a964d22cbb4.rlib) failed with error: llvm-ar failed to extract file(s) ['/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_I6YX8R_archive_contents/rust.metadata.bin', '/private/var/folders/ss/x9rj8hxn6rx0xb0jq3qk1nyd77n725/T/emscripten_temp_I6YX8R_archive_contents/core-687e6a964d22cbb4.0.bytecode.deflate'] from archive file /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-687e6a964d22cbb4.rlib! Error:dyld: lazy symbol binding failed: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib
          
          0  llvm-ar                  0x000000010699a138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
          1  llvm-ar                  0x0000000106999366 llvm::sys::RunSignalHandlers() + 86
          2  llvm-ar                  0x000000010699a77e SignalHandler(int) + 366
          3  libsystem_platform.dylib 0x00007fffc01d7b3a _sigtramp + 26
          4  libsystem_platform.dylib 0x0000000114233b4d _sigtramp + 1409663021
          5  libsystem_platform.dylib 0x000000011423e464 _sigtramp + 1409706308
          6  libsystem_platform.dylib 0x0000000114219793 _sigtramp + 1409555571
          7  libsystem_platform.dylib 0x000000011421989e _sigtramp + 1409555838
          8  libdyld.dylib            0x00007fffbffc4282 dyld_stub_binder + 282
          9  llvm-ar                  0x0000000106be2358 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 12850
          10 llvm-ar                  0x000000010681c33c performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 4156
          11 llvm-ar                  0x000000010681ace6 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 1126
          12 llvm-ar                  0x0000000106818599 main + 361
          13 libdyld.dylib            0x00007fffbffc8235 start + 1
          Stack dump:
          0.	Program arguments: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar xo /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libcore-687e6a964d22cbb4.rlib 
          
          Traceback (most recent call last):
            File "/SAPDevelop/src/Swift2WebAssembly/emsdk/emscripten/incoming/emcc", line 13, in <module>
              emcc.run()
            File "/SAPDevelop/src/Swift2WebAssembly/emsdk/emscripten/incoming/emcc.py", line 1419, in run
              final = shared.Building.link(linker_inputs, DEFAULT_FINAL, force_archive_contents=force_archive_contents, temp_files=misc_temp_files, just_calculate=just_calculate)
            File "/SAPDevelop/src/Swift2WebAssembly/emsdk/emscripten/incoming/tools/shared.py", line 1774, in link
              Building.read_link_inputs(filter(lambda x: not x.startswith('-'), files))
            File "/SAPDevelop/src/Swift2WebAssembly/emsdk/emscripten/incoming/tools/shared.py", line 1700, in read_link_inputs
              raise Exception('llvm-ar failed on archive ' + archive_names[n] + '!')
          Exception: llvm-ar failed on archive /Users/i852946/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/wasm32-unknown-emscripten/lib/libstd-f4594d3e53dcb114.rlib!
          

error: aborting due to previous error

I've also reported this to the Rust project since I'm not sure where the problem lies.

@kripken

This comment has been minimized.

Copy link
Member

kripken commented Jul 24, 2017

This stuff looks like a weird OS X linking issue. I don't know much about OS X, but it looks like a problem between your system libs and the build of LLVM. Maybe linked on another machine with other system libs or something like that?

dyld: Symbol not found: _futimens
            Referenced from: /SAPDevelop/src/Swift2WebAssembly/emsdk/clang/fastcomp/build_incoming_64/bin/llvm-ar
            Expected in: /usr/lib/libSystem.B.dylib

What is Swift2WebAssembly, btw?

@kripken kripken closed this Jul 24, 2017

@kripken

This comment has been minimized.

Copy link
Member

kripken commented Jul 24, 2017

(oops, hit wrong button before)

@kripken kripken reopened this Jul 24, 2017

@jedisct1

This comment has been minimized.

Copy link

jedisct1 commented Aug 29, 2017

Same issue here, but I'm not using Rust, just emcc.

See https://gist.github.com/f5066409ceeab4e254149d9b6c374bc0

This happens while compiling libsodium.js, with the incoming branch of emscripten.

macOS 10.12, Xcode 9b6.

@OlegSmelov

This comment has been minimized.

Copy link

OlegSmelov commented Sep 29, 2017

Workaround. I used homebrew instead, but encountered the same problem. Since there's something wrong with llvm-ar, I used llvm-ar from llvm homebrew package instead:

brew install llvm
mv /usr/local/opt/emscripten/libexec/llvm/bin/llvm-ar /usr/local/opt/emscripten/libexec/llvm/bin/llvm-ar.old
ln -s /usr/local/opt/llvm/bin/llvm-ar /usr/local/opt/emscripten/libexec/llvm/bin/llvm-ar

Change paths where necessary.

mosra added a commit to mosra/corrade that referenced this issue Oct 3, 2017

mosra added a commit to mosra/corrade that referenced this issue Oct 3, 2017

@n8gray

This comment has been minimized.

Copy link

n8gray commented Oct 3, 2017

@kripken: I just noticed your question! Swift2WebAssembly was me trying to hack the Swift compiler to produce wasm. I didn't make any progress to speak of. :(

@trzecieu

This comment has been minimized.

Copy link
Contributor

trzecieu commented Oct 18, 2017

Here is some trace of investigation:

1

It looks connected to rust-lang/rust#42997
What in fact is caused by having XCode9 and macOS10.12: (other case: https://gitlab.kitware.com/cmake/cmake/issues/17101)
I've tried to compile locally sdk-incoming and it looks that it's not compilation environment specific problem.

2

Some fixes in the upstream project: llvm-mirror/llvm@0e3a936#diff-2eeb0237a3e7842df96b4c1280614125
Looks that the flag is propagated nicely further to Makefiles, but during compilation I've got

In file included from /Users/piotr.paczkowski/SDK/emsdk_git/clang/fastcomp/src/lib/Support/Path.cpp:1174:
/Users/piotr.paczkowski/SDK/emsdk_git/clang/fastcomp/src/lib/Support/Unix/Path.inc:462:7: error: 'futimens' is only available on macOS 10.13 or newer [-Werror,-Wunguarded-availability-new]
  if (::futimens(FD, Times))
      ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/stat.h:373:5: note: 'futimens' has been explicitly marked partial here
int     futimens(int __fd, const struct timespec __times[2]) __API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
        ^
/Users/piotr.paczkowski/SDK/emsdk_git/clang/fastcomp/src/lib/Support/Unix/Path.inc:462:7: note: enclose 'futimens' in a __builtin_available check to silence this warning
  if (::futimens(FD, Times))
      ^~~~~~~~~~

3

This looks that the test check_symbol_exists(futimens sys/stat.h HAVE_FUTIMENS) # returns false positive result.
Strangely I haven't found anything extra in the upstream project to prevent using futimens.

4

Once I've forced flag HAVE_FUTIMENS=0 and I've compiled llvm-ar, it works nicely.

Update

OK It looks that I had a problem with a false positive results due a CMakeCache, after removing the build folder it has started to work, here you can find a PR: emscripten-core/emscripten-fastcomp#200

@opiepj

This comment has been minimized.

Copy link

opiepj commented Oct 30, 2017

Just upgraded my emsdk to 1.37.22 and getting the same issue

@trzecieu

This comment has been minimized.

Copy link
Contributor

trzecieu commented Oct 30, 2017

The fix should be a part of version 1.37.23, what's unreleased yet at the moment.

@notedit

This comment has been minimized.

Copy link

notedit commented Nov 15, 2017

version 1.37.22 same issue

@thomaswmanion

This comment has been minimized.

Copy link

thomaswmanion commented Nov 22, 2017

How do you get 1.37.23? It doesn't look like it is available through the emsdk.

@rspq

This comment has been minimized.

Copy link

rspq commented Nov 23, 2017

I followed the script at https://github.com/GodotBuilder/godot-builds/pull/9/files, worked a treat

@ghost

This comment has been minimized.

Copy link

ghost commented Dec 7, 2017

So, emscripten on macOS is basically broken until 1.37.23 is released? That's ridiculous. This should have a hot fix.

@dasa

This comment has been minimized.

Copy link
Contributor

dasa commented Dec 7, 2017

1.37.24 was released 3 days ago: https://github.com/kripken/emscripten/releases

@kripken

This comment has been minimized.

Copy link
Member

kripken commented Dec 7, 2017

There may be an issue with the emsdk fetching it, though (our bots don't seem to, I'm not sure why - might need to wait for @juj to get back and look at it). Otherwise, though, the emsdk should be able to fetch incoming (instead of a tag) and build that.

@ghost

This comment has been minimized.

Copy link

ghost commented Dec 7, 2017

I used the package at https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz that the link on the official website points to. ./emsdk install latest did not give me a newer version. I did it yesterday and today. Are the binaries always a couple of releases behind?

@kripken

This comment has been minimized.

Copy link
Member

kripken commented Dec 7, 2017

The binaries need to be built by the bots, yes, and there is a problem there that only @juj can investigate.

But if you install incoming using the sdk, that will work (it will build the binaries for you locally), http://kripken.github.io/emscripten-site/docs/tools_reference/emsdk.html?highlight=emsdk%20incoming#how-do-i-track-the-latest-emscripten-development-with-the-sdk

@dasa

This comment has been minimized.

Copy link
Contributor

dasa commented Dec 7, 2017

1.37.24 is available using Homebrew.

@kripken

This comment has been minimized.

Copy link
Member

kripken commented Dec 7, 2017

Interesting, thanks @dasa - I wasn't aware brew had frequent updates of emscripten. Perhaps our docs should suggest using it on OS X?

@dasa

This comment has been minimized.

Copy link
Contributor

dasa commented Dec 7, 2017

@ghost

This comment has been minimized.

Copy link

ghost commented Dec 7, 2017

Huh, yes, that sounds like a good idea to me. I'm already using Homebrew and would've installed it via that if I that had been one of the endorsed ways of installing it. I might've installed it that way in any case if I had known about it, but I tend to expect that the official install method gives me a fresher release than a package manager. I think I've seen some CLI installers actually use Homebrew if it's available?

@allenGKC

This comment has been minimized.

Copy link

allenGKC commented Dec 19, 2017

@rspq I have tried your method and works well. Thanks very much

@ilovezfs

This comment has been minimized.

Copy link

ilovezfs commented Dec 19, 2017

Is this now fixed? I'm confused why we still have people talking about workarounds.

@olilarkin

This comment has been minimized.

Copy link

olilarkin commented Dec 20, 2017

I have this issue after following the instructions here on macos 10.12 http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html

@shawwn

This comment has been minimized.

Copy link

shawwn commented Dec 21, 2017

I'm having this issue when trying to use wargo:

https://github.com/lord/wargo

cargo new --bin meow
cd meow
wargo build

The wargo build step fails.

@pengbins

This comment has been minimized.

Copy link

pengbins commented Dec 22, 2017

Just install emsdk to 1.37.26 and getting the same issue

  Referenced from: /Users/me/tools/emsdk-portable/clang/e1.37.26_64bit/llvm-ar (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _futimens
  Referenced from: /Users/me/tools/emsdk-portable/clang/e1.37.26_64bit/llvm-ar (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib

0  llvm-ar                  0x00000001014e2d88 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  llvm-ar                  0x00000001014e3336 SignalHandler(int) + 358
2  libsystem_platform.dylib 0x00007fffbccf8b3a _sigtramp + 26
3  libsystem_platform.dylib 0x00000001057cab4d _sigtramp + 1219305517
4  libsystem_platform.dylib 0x00000001057d5464 _sigtramp + 1219348804
5  libsystem_platform.dylib 0x00000001057b0793 _sigtramp + 1219198067
6  libsystem_platform.dylib 0x00000001057b089e _sigtramp + 1219198334
7  libdyld.dylib            0x00007fffbcae5282 dyld_stub_binder + 282
8  llvm-ar                  0x0000000101719340 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 10650
9  llvm-ar                  0x00000001013aae6d performOperation(ArchiveOperation, llvm::object::Archive*, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer> >, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 2013
10 llvm-ar                  0x00000001013aa0a2 performOperation(ArchiveOperation, std::__1::vector<llvm::NewArchiveMember, std::__1::allocator<llvm::NewArchiveMember> >*) + 930
11 llvm-ar                  0x00000001013a7c99 main + 361
12 libdyld.dylib            0x00007fffbcae9235 start + 1
Stack dump:
0.	Program arguments: /Users/me/tools/emsdk-portable/clang/e1.37.26_64bit/llvm-ar xo /Users/me/XXXX.a

Traceback (most recent call last):
  File "/Users/me/tools/emsdk-portable/emscripten/1.37.26/em++", line 16, in <module>
    emcc.run()
@hjs062

This comment has been minimized.

Copy link

hjs062 commented Dec 24, 2017

In my case(macOS 10.12.6, emscripten 1.37.27), I got this issue because virtual destructors.

.cpp including virtual destructors was compiled, but was not linked.(I don't know why.)

If virtual destructors are unnecessary, try not to use that .

class A
{
public:
A();
~A();
};
is ok.

class A
{
public:
A();
virtual ~A();
};
is not ok.

class A
{
public:
A();
~A();
virtual void B();
};
is ok.

@MisterFister666

This comment has been minimized.

Copy link

MisterFister666 commented Dec 26, 2017

Still hosed. emscription 1.37.27, osx 10.11.6

Any chance of getting a fix? This is a complete, pencils down, stop work sortof bug.

@rbalicki2

This comment has been minimized.

Copy link

rbalicki2 commented Dec 31, 2017

Does anyone know whether this works on high sierra?

@shawwn

This comment has been minimized.

Copy link

shawwn commented Dec 31, 2017

@dasa

This comment has been minimized.

Copy link
Contributor

dasa commented Dec 31, 2017

Does anyone know whether this works on high sierra?

I haven't had this problem since upgrading to High Sierra.

@MisterFister666

This comment has been minimized.

Copy link

MisterFister666 commented Jan 1, 2018

It's definitely some bug with emscription's copy of llvm-ar.

. i did what was suggested above, and installed llvm using homebrew.
. then i removed the llvm-ar that emscripten installed in
emsdk-portable/clang/e1.37.27_64bit/
. then i made a symbolic link in the emscription directory where i removed the llvm-ar to the working llvm-ar installed by homebrew (in my case the call was:
'ln -s /usr/local/opt/llvm/bin/llvm-ar ~/local/bin/emsdk-portable/clang/e1.37.27_64bit/llvm-ar'
)

After that, the bug stopped and I was able to successfully compile C to js.

@juj

This comment has been minimized.

Copy link
Collaborator

juj commented Jan 3, 2018

Looking into this now..

@juj juj self-assigned this Jan 3, 2018

@kripken kripken added the Important label Jan 3, 2018

@juj

This comment has been minimized.

Copy link
Collaborator

juj commented Jan 3, 2018

The issue is the same as here: emscripten-core/emscripten-fastcomp#200, but for some reason the PR to fix did not apparently catch all cases.

This is now tackled in two ways:

  1. In emsdk, if building from source on macOS SDK < 10.13, -DHAVE_FUTIMENS=0 is passed to the build: juj/emsdk@f3ac553
  2. The macOS build systems have been updated to build targeting macOS SDKs 10.11, where this symbol was not present.

I'm having trouble verifying since I don't have an actual macOS 10.11 device at hand. It would be great to hear from someone who does, whether after git pulling latest emsdk emsdk install sdk-incoming-64bit works properly after that commit?

@shawwn

This comment has been minimized.

Copy link

shawwn commented Jan 3, 2018

@urkle

This comment has been minimized.

Copy link
Contributor

urkle commented Jan 8, 2018

@juj is there prebuilt build I can test to verify the fixes to the build system?

@bzz

This comment has been minimized.

Copy link

bzz commented Mar 31, 2018

Updating to 1.37.36 (and installing python2 as a workaround for #6275) solved the issue on macOS 10.12 for me.

Thank you all!

@juj

This comment has been minimized.

Copy link
Collaborator

juj commented Apr 4, 2018

I'll close this as fixed, I think we should actually now be double fixing this issue since we are using devernay/xcodelegacy to explicitly pin to an older macOS SDK to keep supporting old versions.

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