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 4.0] Symbol lookup error when linking dylibs #39782

Closed
mattico opened this issue Feb 13, 2017 · 5 comments
Closed

[LLVM 4.0] Symbol lookup error when linking dylibs #39782

mattico opened this issue Feb 13, 2017 · 5 comments

Comments

@mattico
Copy link
Contributor

mattico commented Feb 13, 2017

cc #37609

These two tests fail when testing the compiler with a current LLVM build from the release_40 branch.

run-make/llvm-pass
run-make/rustc-macro-dep-files

The two failures are similar enough that they're probably related.

test [run-make] run-make/llvm-pass ... FAILED

stdout:
------------------------------------------
c++ -ffunction-sections -fdata-sections -fPIC -m64  -I/home/matt/Code/llvm/include -I/home/matt/Code/llvm/build-40/include  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -g  -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -c llvm-function-pass.so.cc -o /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu/libllvm-function-pass.o
ar crus /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu/libllvm-function-pass.a /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu/libllvm-function-pass.o
c++ -ffunction-sections -fdata-sections -fPIC -m64  -I/home/matt/Code/llvm/include -I/home/matt/Code/llvm/build-40/include  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -g  -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -c llvm-module-pass.so.cc -o /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu/libllvm-module-pass.o
ar crus /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu/libllvm-module-pass.a /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu/libllvm-module-pass.o
LD_LIBRARY_PATH="/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc' --out-dir /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu -L /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu  plugin.rs -C prefer-dynamic
LD_LIBRARY_PATH="/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc' --out-dir /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu -L /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu  main.rs
Makefile:9: recipe for target 'all' failed

------------------------------------------
stderr:
------------------------------------------
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: symbol lookup error: /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/llvm-pass.stage1-x86_64-unknown-linux-gnu/libsome_plugin.so: undefined symbol: _ZN12rustc_plugin8registry8Registry18register_llvm_pass17h3ddb9f4cf0e74ab9E
make: *** [all] Error 127
test [run-make] run-make/rustc-macro-dep-files ... FAILED

stdout:
------------------------------------------
LD_LIBRARY_PATH="/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/rustc-macro-dep-files.stage1-x86_64-unknown-linux-gnu:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc' --out-dir /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/rustc-macro-dep-files.stage1-x86_64-unknown-linux-gnu -L /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/rustc-macro-dep-files.stage1-x86_64-unknown-linux-gnu  foo.rs
LD_LIBRARY_PATH="/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/rustc-macro-dep-files.stage1-x86_64-unknown-linux-gnu:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/release/deps:/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:" '/home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc' --out-dir /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/rustc-macro-dep-files.stage1-x86_64-unknown-linux-gnu -L /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/rustc-macro-dep-files.stage1-x86_64-unknown-linux-gnu  bar.rs --emit dep-info
Makefile:4: recipe for target 'all' failed

------------------------------------------
stderr:
------------------------------------------
error: /home/matt/Code/Rust/rust/build/x86_64-unknown-linux-gnu/test/run-make/rustc-macro-dep-files.stage1-x86_64-unknown-linux-gnu/libfoo.so: undefined symbol: _ZN40_$LT$alloc..raw_vec..RawVec$LT$T$GT$$GT$6double14_MSG_FILE_LINE17h026b1bdceb71d8dcE
  --> bar.rs:12:1
   |
12 | extern crate foo;
   | ^^^^^^^^^^^^^^^^^

make: *** [all] Error 101
@mattico mattico changed the title [LLVM 4.0] Symbol lookup error with LLVM 4.0 [LLVM 4.0] Symbol lookup error when linking dylibs Feb 13, 2017
@mattico
Copy link
Contributor Author

mattico commented Feb 13, 2017

Oh and these tests only fail with a stage 1 compiler... stage 2 works fine.

@japaric
Copy link
Member

japaric commented Feb 13, 2017

Oh and these tests only fail with a stage 1 compiler... stage 2 works fine.

Do these tests pass with a stage1 compiler that doesn't include the LLVM change? IME, stage1 test suite almost never suceeds.

@mattico
Copy link
Contributor Author

mattico commented Feb 13, 2017

Hm. The contributing guide suggests that running tests on stage 1 is okay. I suppose that all tests should always pass but the ones which aren't run on every PR tend to bitrot. Definitely need to try this with another LLVM version, still waiting for the compile to finish...

@mattico
Copy link
Contributor Author

mattico commented Feb 14, 2017

Can now confirm these tests do pass using in-tree LLVM.

@mattico
Copy link
Contributor Author

mattico commented Apr 25, 2017

I'm going to close this, since the issue is certainly resolved now that we're on LLVM 4 and the tests are passing.

@mattico mattico closed this as completed Apr 25, 2017
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

2 participants