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

DXR Clang build fails on /usr/bin/ld: cannot find -load #11823

Closed
klibby opened this issue Jun 22, 2016 · 6 comments
Closed

DXR Clang build fails on /usr/bin/ld: cannot find -load #11823

klibby opened this issue Jun 22, 2016 · 6 comments

Comments

@klibby
Copy link

klibby commented Jun 22, 2016

Attempting to build servo on Ubuntu 14.04.3 LTS, to get a searchable index under DXR (dxr.mozilla.org), and it's bombing out (full log is available at https://jenkins-dxr.mozilla.org/job/servo/7/console):

14:35:46 /bin/bash ./libtool --tag=CC --mode=link clang -Xclang -load -Xclang /builds/dxr-build-env/dxr/dxr/plugins/clang/libclang-index-plugin.so -Xclang -add-plugin -Xclang dxr-index -Xclang -plugin-arg-dxr-index -Xclang /builds/dxr-build-env/src/servo/servo -fPIC -O3 -o png-fix-itxt contrib/tools/png-fix-itxt.o -lm -lz -lm
14:35:46 libtool: link: clang -Xclang -Xclang /builds/dxr-build-env/dxr/dxr/plugins/clang/libclang-index-plugin.so -Xclang -add-plugin -Xclang dxr-index -Xclang -plugin-arg-dxr-index -Xclang /builds/dxr-build-env/src/servo/servo -fPIC -O3 -o png-fix-itxt contrib/tools/png-fix-itxt.o -load -lz -lm
14:35:46 libtool: compile: clang -Xclang -load -Xclang /builds/dxr-build-env/dxr/dxr/plugins/clang/libclang-index-plugin.so -Xclang -add-plugin -Xclang dxr-index -Xclang -plugin-arg-dxr-index -Xclang /builds/dxr-build-env/src/servo/servo -DHAVE_CONFIG_H -I. -I/builds/dxr-build-env/src/servo/servo/.cargo/git/checkouts/rust-png-f44ec0131d7a5ba6/master/png-sys/libpng-1.6.16 -fPIC -O3 -MT pngwutil.lo -MD -MP -MF .deps/pngwutil.Tpo -c /builds/dxr-build-env/src/servo/servo/.cargo/git/checkouts/rust-png-f44ec0131d7a5ba6/master/png-sys/libpng-1.6.16/pngwutil.c -o pngwutil.o >/dev/null 2>&1
14:35:46 make[1]: Leaving directory `/builds/dxr-build-env/src/servo/servo/target/release/build/png-sys-c0fc68e5ccc34308/out'
14:35:46
14:35:46 --- stderr
14:35:46 clang: warning: argument unused during compilation: '-Xclang -Xclang'
14:35:46 clang: warning: argument unused during compilation: '-Xclang -add-plugin'
14:35:46 clang: warning: argument unused during compilation: '-Xclang dxr-index'
14:35:46 clang: warning: argument unused during compilation: '-Xclang -plugin-arg-dxr-index'
14:35:46 clang: warning: argument unused during compilation: '-Xclang /builds/dxr-build-env/src/servo/servo'
14:35:46 /usr/bin/ld: cannot find -load
14:35:46 clang: error: linker command failed with exit code 1 (use -v to see invocation)
14:35:46 make[1]: *** [png-fix-itxt] Error 1
14:35:46 make[1]: *** Waiting for unfinished jobs....
14:35:46 make: *** [all] Error 2
14:35:46 thread '

' panicked at 'assertion failed: cmd.stdout(Stdio::inherit()).stderr(Stdio::inherit()).status().unwrap().success()', /builds/dxr-build-env/src/servo/servo/.cargo/git/checkouts/rust-png-f44ec0131d7a5ba6/master/png-sys/build.rs:59

I'm not sure if this is properly fixed on servo's side, or DXR's (/cc @erikrose) though.

klibby pushed a commit to mozilla-platform-ops/dxr-infra that referenced this issue Jun 22, 2016
@jdm
Copy link
Member

jdm commented Jun 22, 2016

@nrc does this mean anything to you?

@jdm
Copy link
Member

jdm commented Jun 22, 2016

This doesn't look like something that Servo controls, however.

@nrc
Copy link

nrc commented Jun 22, 2016

Looks like it's on the Clang side rather than the Rust side. I never did get DXR to index Servo properly, although I didn't see this error (I managed to index the codebase, just couldn't get DXR to make sense of the index). That was quite a while ago though.

@highfive
Copy link

cc @aneeshusa

@edunham
Copy link
Contributor

edunham commented Jul 14, 2017

Closing as "almost certainly dxr's problem" and "probably went away or someone would have said something in the past year". If either of these assumptions is incorrect -- if there's an action you'd like a Servo infrastructure person to take on this issue -- please feel free to re-open.

@edunham edunham closed this as completed Jul 14, 2017
@dylanmckay
Copy link

dylanmckay commented Jul 26, 2018

In case anybody else encounters this same bug.

I've encountered this exact same error whilst indexing LLVM trunk with DXR.

My dxr.config looks like this

[llvm-project_llvm]
source_folder = /code/llvm
build_command = mkdir -p build && cd build && cmake -G "Unix Makefiles" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR ../ && make

DXR index output:

dev_1  | Scanning dependencies of target llvm-tblgen
dev_1  | [  8%] Linking CXX executable ../../bin/llvm-tblgen
dev_1  | clang: warning: argument unused during compilation: '-Xclang -load'
dev_1  | clang: warning: argument unused during compilation: '-Xclang /home/dxr/dxr/dxr/plugins/clang/libclang-index-plugin.so'
dev_1  | clang: warning: argument unused during compilation: '-Xclang -add-plugin'
dev_1  | clang: warning: argument unused during compilation: '-Xclang dxr-index'
dev_1  | clang: warning: argument unused during compilation: '-Xclang -plugin-arg-dxr-index'
dev_1  | clang: warning: argument unused during compilation: '-Xclang /code/llvm'
dev_1  | CMakeFiles/obj.llvm-tblgen.dir/AsmMatcherEmitter.cpp.o: In function `(anonymous namespace)::MatchableInfo::dump() const':
dev_1  | /code/llvm/utils/TableGen/AsmMatcherEmitter.cpp:803: undefined reference to `llvm::errs()'

Which means this really is likely DXR's fault somewhere.

NOTE: This was fixed by updating clang from 3.8 to 4.0. @klibby is probably using the DXR dockerfile which is based upon Ubuntu 14.04.3 LTS. I've made a bunch of changes to it locally, including updating to Ubuntu 16.04. 14.04 only has clang versions up to 3.9.

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

No branches or pull requests

7 participants