Skip to content
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

LLVM ERROR: Undefined temporary symbol when compiling wasm-bindgen-macro-support on powerpc64+powerpc64le linux #58516

Open
infinity0 opened this issue Feb 16, 2019 · 5 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. O-PowerPC Target: PowerPC processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@infinity0
Copy link
Contributor

infinity0 commented Feb 16, 2019

See log here https://buildd.debian.org/status/fetch.php?pkg=rust-wasm-bindgen-macro-support&arch=ppc64el&ver=0.2.33-1&stamp=1549258418&raw=0

The same issue is reproducible with the rustc binary from here, but one needs to first work around #58334/#57345 by building your cargo, e.g. the Debian cargo package works.

Stack traces, but locals are optimised out:

Debian rustc

$ cargo build --verbose --verbose
[..]
$ rust-gdb -q rustc
[..]
(gdb) break llvm::report_fatal_error
[..]
(gdb) run --crate-name wasm_bindgen_macro_support crates/macro-support/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="spans"' --cfg 'feature="wasm-bindgen-backend"' -C metadata=267ded4c6ac04022 -C extra-filename=-267ded4c6ac04022 --out-dir $HOME/wasm-bindgen/target/debug/deps -C incremental=$HOME/wasm-bindgen/target/debug/incremental -L dependency=$HOME/wasm-bindgen/target/debug/deps --extern proc_macro2=$HOME/wasm-bindgen/target/debug/deps/libproc_macro2-ddf6fe723d049424.rlib --extern quote=$HOME/wasm-bindgen/target/debug/deps/libquote-bd5442aa4aee0f1c.rlib --extern syn=$HOME/wasm-bindgen/target/debug/deps/libsyn-a5d8e6188798fcb2.rlib --extern wasm_bindgen_backend=$HOME/wasm-bindgen/target/debug/deps/libwasm_bindgen_backend-c8bf27854c4fe469.rlib --extern wasm_bindgen_shared=$HOME/wasm-bindgen/target/debug/deps/libwasm_bindgen_shared-216cd9cb4202c473.rlib
[..]
(gdb) bt
#0  __gthread_mutex_lock () at /usr/lib/gcc/powerpc64le-linux-gnu/8/../../../../include/powerpc64le-linux-gnu/c++/8/bits/gthr-default.h:747
#1  lock () at /usr/lib/gcc/powerpc64le-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:103
#2  lock_guard () at /usr/lib/gcc/powerpc64le-linux-gnu/8/../../../../include/c++/8/bits/std_mutex.h:162
#3  report_fatal_error () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/Support/ErrorHandling.cpp:101
#4  0x00003fffb202973c in llvm::MCContext::reportError(llvm::SMLoc, llvm::Twine const&) () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/MC/MCContext.cpp:628
#5  0x00003fffb20056a8 in computeSymbolTable () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/MC/ELFObjectWriter.cpp:645
#6  writeObject () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/MC/ELFObjectWriter.cpp:1151
#7  0x00003fffb171ed30 in ?? () from /usr/lib/powerpc64le-linux-gnu/libLLVM-7.so.1
#8  0x00003fffb201b9b4 in Finish () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/MC/MCAssembler.cpp:849
#9  0x00003fffb204aef0 in FinishImpl () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/MC/MCObjectStreamer.cpp:683
#10 0x00003fffb2039474 in FinishImpl () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/MC/MCELFStreamer.cpp:674
#11 0x00003fffb20561c4 in Finish () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/MC/MCStreamer.cpp:863
#12 0x00003fffb1718324 in doFinalization () at /build/llvm-toolchain-7-4s73DP/llvm-toolchain-7-7.0.1/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1548
#13 0x0000000000000000 in ?? ()

Upstream rustc

$ export PATH=$HOME/vroot/usr/bin:$HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/bin:/usr/local/bin:/usr/bin:/bin
$ export LD_LIBRARY_PATH=$HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rust-std-powerpc64le-unknown-linux-gnu/lib/rustlib/powerpc64le-unknown-linux-gnu/lib
$ export RUSTFLAGS="-L $LD_LIBRARY_PATH"
$ export RUSTDOCFLAGS="-L $LD_LIBRARY_PATH"
$ which cargo
$HOME/vroot/usr/bin/cargo
$ which rustc
$HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/bin/rustc
$ cargo build --verbose --verbose
[..]
$ rust-gdb -q rustc
[..]
(gdb) break llvm::report_fatal_error
[..]
(gdb) run --crate-name wasm_bindgen_macro_support crates/macro-support/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="spans"' --cfg 'feature="wasm-bindgen-backend"' -C metadata=56e98bc84653fd36 -C extra-filename=-56e98bc84653fd36 --out-dir $HOME/wasm-bindgen/target/debug/deps -C incremental=$HOME/wasm-bindgen/target/debug/incremental -L dependency=$HOME/wasm-bindgen/target/debug/deps --extern proc_macro2=$HOME/wasm-bindgen/target/debug/deps/libproc_macro2-a9b42ce46045ad3d.rlib --extern quote=$HOME/wasm-bindgen/target/debug/deps/libquote-b533d9dc523383f1.rlib --extern syn=$HOME/wasm-bindgen/target/debug/deps/libsyn-73f28adcf440f43e.rlib --extern wasm_bindgen_backend=$HOME/wasm-bindgen/target/debug/deps/libwasm_bindgen_backend-0d6dbe292e1636ee.rlib --extern wasm_bindgen_shared=$HOME/wasm-bindgen/target/debug/deps/libwasm_bindgen_shared-7b78e47489df9616.rlib -L $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rust-std-powerpc64le-unknown-linux-gnu/lib/rustlib/powerpc64le-unknown-linux-gnu/lib
[..]
(gdb) bt
#0  0x00003fffb3ab339c in llvm::report_fatal_error(llvm::Twine const&, bool) ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#1  0x00003fffb395f540 in llvm::MCContext::reportError(llvm::SMLoc, llvm::Twine const&) ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#2  0x00003fffb393488c in (anonymous namespace)::ELFWriter::computeSymbolTable(llvm::MCAssembler&, llvm::MCAsmLayout const&, llvm::DenseMap<llvm::MCSectionELF const*, unsigned int, llvm::DenseMapInfo<llvm::MCSectionELF const*>, llvm::detail::DenseMapPair<llvm::MCSectionELF const*, unsigned int> > const&, llvm::DenseMap<llvm::MCSymbol const*, unsigned int, llvm::DenseMapInfo<llvm::MCSymbol const*>, llvm::detail::DenseMapPair<llvm::MCSymbol const*, unsigned int> > const&, std::map<llvm::MCSectionELF const*, std::pair<unsigned long, unsigned long>, std::less<llvm::MCSectionELF const*>, std::allocator<std::pair<llvm::MCSectionELF const* const, std::pair<unsigned long, unsigned long> > > >&) () from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#3  0x00003fffb393695c in (anonymous namespace)::ELFWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout const&) [clone .constprop.391] ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#4  0x00003fffb3938e30 in (anonymous namespace)::ELFSingleObjectWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout const&) ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#5  0x00003fffb3950fa8 in llvm::MCAssembler::Finish() () from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#6  0x00003fffb39852d0 in llvm::MCObjectStreamer::FinishImpl() ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#7  0x00003fffb3972e60 in llvm::MCELFStreamer::FinishImpl() () from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#8  0x00003fffb3993468 in llvm::MCStreamer::Finish() () from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#9  0x00003fffb29e4810 in llvm::AsmPrinter::doFinalization(llvm::Module&) ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#10 0x00003fffb1b5d774 in (anonymous namespace)::PPCLinuxAsmPrinter::doFinalization(llvm::Module&) ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#11 0x00003fffb379b188 in llvm::FPPassManager::doFinalization(llvm::Module&) ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#12 0x00003fffb37aa888 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#13 0x00003fffb37aab3c in llvm::legacy::PassManager::run(llvm::Module&) ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#14 0x00003fffb1710244 in LLVMRustWriteOutputFile () from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#15 0x00003fffb162baac in rustc_codegen_llvm::back::write::write_output_file ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#16 0x00003fffb162f638 in rustc_codegen_llvm::back::write::codegen::{{closure}} ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#17 0x00003fffb162e92c in rustc_codegen_llvm::back::write::codegen ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#18 0x00003fffb15e43a0 in rustc_codegen_ssa::back::write::execute_work_item ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#19 0x00003fffb16d0d9c in std::sys_common::backtrace::__rust_begin_short_backtrace ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#20 0x00003fffb15a2fd8 in std::panicking::try::do_call () from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#21 0x00003fffb7c62e84 in __rust_maybe_catch_panic () at src/libpanic_unwind/lib.rs:102
#22 0x00003fffb15ac188 in <F as alloc::boxed::FnBox<A>>::call_box ()
   from $HOME/rust-1.32.0-powerpc64le-unknown-linux-gnu/rustc/lib/rustlib/powerpc64le-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so
#23 0x00003fffb7c5787c in _$LT$alloc..boxed..Box$LT$$LP$dyn$u20$alloc..boxed..FnBox$LT$A$C$$u20$Output$u3d$R$GT$$u20$$u2b$$u20$$u27$a$RP$$GT$$u20$as$u20$core..ops..function..FnOnce$LT$A$GT$$GT$::call_once::hcb2877104e64de51 () at /rustc/9fda7c2237db910e41d6a712e9a2139b352e558b/src/liballoc/boxed.rs:683
#24 std::sys_common::thread::start_thread () at src/libstd/sys_common/thread.rs:24
#25 std::sys::unix::thread::Thread::new::thread_start () at src/libstd/sys/unix/thread.rs:90
#26 0x00003fffb4f28e04 in start_thread (arg=0x0) at pthread_create.c:486
#27 0x00003fffb7ad3cd8 in clone () at ../sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S:82
@infinity0
Copy link
Contributor Author

Same problem with rustc 1.31.0 and wasm-bindgen git HEAD (9e40a6d02b8bd67fe9ed5e19e327138490ffe979).

@jonas-schievink jonas-schievink added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. O-PowerPC Target: PowerPC processors labels Feb 16, 2019
@infinity0
Copy link
Contributor Author

Still happening with version rustc 1.36.0-nightly (963184bbb 2019-05-18).

@jonas-schievink jonas-schievink added the C-bug Category: This is a bug. label May 19, 2019
@infinity0
Copy link
Contributor Author

If I make this change, the error goes away:

--- src/parser.rs.orig  2019-05-19 18:26:44.678343192 +0000
+++ src/parser.rs       2019-05-19 18:26:55.530510339 +0000
@@ -64,9 +64,6 @@
                 if used.get() {
                     continue
                 }
-                if !cfg!(feature = "strict-macro") {
-                    continue
-                }
                 let span = match attr {
                     $(BindgenAttr::$variant(span, ..) => span,)*
                 };

@infinity0
Copy link
Contributor Author

Work around filed for that crate as rustwasm/wasm-bindgen#1545

@infinity0 infinity0 changed the title 1.32.0 rustc binary for powerpc64le linux gives LLVM ERROR: Undefined temporary symbol when compiling wasm-bindgen-macro-support LLVM ERROR: Undefined temporary symbol when compiling wasm-bindgen-macro-support on powerpc64+powerpc64le linux May 19, 2019
alexcrichton added a commit to rustwasm/wasm-bindgen that referenced this issue May 21, 2019
@workingjubilee
Copy link
Member

Hmm, this looks like it's related to #42476 perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. O-PowerPC Target: PowerPC processors T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants