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

clang: error: no such file or directory: 'crs' #44

Closed
ctaggart opened this issue May 6, 2019 · 8 comments · Fixed by #45
Closed

clang: error: no such file or directory: 'crs' #44

ctaggart opened this issue May 6, 2019 · 8 comments · Fixed by #45

Comments

@ctaggart
Copy link

ctaggart commented May 6, 2019

I'm guessing that I'm missing some build dependency. I've installed clang 8.0 and I've trying to build with

ctaggart@rustasia:~/wasi-sysroot$ make WASM_CC=/usr/bin/clang-8

But the build ends with:

clang: error: no such file or directory: 'crs'
clang: error: no such file or directory: '/home/ctaggart/wasi-sysroot/sysroot/lib/wasm32-wasi/libc.a'
Makefile:225: recipe for target '/home/ctaggart/wasi-sysroot/sysroot/lib/wasm32-wasi/libc.a' failed
make: *** [/home/ctaggart/wasi-sysroot/sysroot/lib/wasm32-wasi/libc.a] Error 1

I installed clang using instructions from http://apt.llvm.org/

sudo apt-get install clang-8 lldb-8 lld-8

Do I need something else?

@ctaggart
Copy link
Author

ctaggart commented May 6, 2019

Here is the full output from:

ctaggart@rustasia:~/wasi-sysroot$ make WASM_CC=/usr/bin/clang-8 &> build.txt

build.txt

@jedisct1
Copy link
Member

jedisct1 commented May 6, 2019

Do you have the llvm-ar and llvm-nm commands on your system?

@jedisct1
Copy link
Member

jedisct1 commented May 6, 2019

If not, I think you need the llvm package, too.

@ctaggart
Copy link
Author

ctaggart commented May 6, 2019

I've got llvm-ar-8 and llvm-nm-8. It looks like everything was installed already:

ctaggart@rustasia:~$ sudo apt-get install libllvm8 llvm-8 llvm-8-dev llvm-8-runtime
Reading package lists... Done
Building dependency tree
Reading state information... Done
libllvm8 is already the newest version (1:8.0.1~svn359952-1~exp1~20190504005826.64).
libllvm8 set to manually installed.
llvm-8 is already the newest version (1:8.0.1~svn359952-1~exp1~20190504005826.64).
llvm-8 set to manually installed.
llvm-8-dev is already the newest version (1:8.0.1~svn359952-1~exp1~20190504005826.64).
llvm-8-dev set to manually installed.
llvm-8-runtime is already the newest version (1:8.0.1~svn359952-1~exp1~20190504005826.64).
llvm-8-runtime set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
ctaggart@rustasia:~$ llvm-
llvm-ar-8              llvm-c-test-8          llvm-dlltool-8         llvm-link-8            llvm-nm-8              llvm-ranlib-8          llvm-stress-8
llvm-as-8              llvm-cvtres-8          llvm-dwarfdump-8       llvm-lto2-8            llvm-objcopy-8         llvm-rc-8              llvm-strings-8
llvm-bcanalyzer-8      llvm-cxxdump-8         llvm-dwp-8             llvm-lto-8             llvm-objdump-8         llvm-readelf-8         llvm-strip-8
llvm-cat-8             llvm-cxxfilt-8         llvm-elfabi-8          llvm-mc-8              llvm-opt-report-8      llvm-readobj-8         llvm-symbolizer-8
llvm-cfi-verify-8      llvm-cxxmap-8          llvm-exegesis-8        llvm-mca-8             llvm-pdbutil-8         llvm-rtdyld-8          llvm-tblgen-8
llvm-config-8          llvm-diff-8            llvm-extract-8         llvm-modextract-8      llvm-PerfectShuffle-8  llvm-size-8            llvm-undname-8
llvm-cov-8             llvm-dis-8             llvm-lib-8             llvm-mt-8              llvm-profdata-8        llvm-split-8           llvm-xray-8

@jedisct1
Copy link
Member

jedisct1 commented May 6, 2019

The mandatory -8 suffix is the issue here.

In addition to WASM_CC, you need to define WASM_NM and WASM_AR.

@ctaggart
Copy link
Author

ctaggart commented May 6, 2019

Yes, that was it!

make WASM_CC=/usr/bin/clang-8 WASM_NM=/usr/bin/llvm-nm-8 WASM_AR=/usr/bin/llvm-ar-8
The build succeeded! The generated sysroot is in /home/ctaggart/wasi-sysroot/sysroot

@ctaggart ctaggart closed this as completed May 6, 2019
jedisct1 added a commit that referenced this issue May 6, 2019
Also make it explicit that we currently need clang 8+

Fixes #44
@ctaggart
Copy link
Author

ctaggart commented May 6, 2019

Looks like I could/should have added /usr/lib/llvm-8/bin to my PATH to simplify things.

ctaggart@rustasia:~/libgit2/build$ ls /usr/lib/llvm-8/bin
bugpoint   ld.lld          lldb-server-8      llvm-ar          llvm-c-test   llvm-dlltool    llvm-link        llvm-nm              llvm-ranlib   llvm-stress      obj2yaml
clang      llc             lldb-server-8.0.1  llvm-as          llvm-cvtres   llvm-dwarfdump  llvm-lto         llvm-objcopy         llvm-rc       llvm-strings     opt
clang++    lld             lldb-test          llvm-bcanalyzer  llvm-cxxdump  llvm-dwp        llvm-lto2        llvm-objdump         llvm-readelf  llvm-strip       sanstats
clang-8    lldb            lldb-vscode        llvm-cat         llvm-cxxfilt  llvm-elfabi     llvm-mc          llvm-opt-report      llvm-readobj  llvm-symbolizer  verify-uselistorder
clang-cpp  lldb-argdumper  lld-link           llvm-cfi-verify  llvm-cxxmap   llvm-exegesis   llvm-mca         llvm-pdbutil         llvm-rtdyld   llvm-tblgen      wasm-ld
dsymutil   lldb-mi         lli                llvm-config      llvm-diff     llvm-extract    llvm-modextract  llvm-PerfectShuffle  llvm-size     llvm-undname     yaml2obj
ld64.lld   lldb-server     lli-child-target   llvm-cov         llvm-dis      llvm-lib        llvm-mt          llvm-profdata        llvm-split    llvm-xray        yaml-bench

@jedisct1
Copy link
Member

jedisct1 commented May 6, 2019

Either work :)

But overriding the default system compiler can have unintended implications if you recompile system packages from source.

sunfishcode pushed a commit that referenced this issue May 6, 2019
Also make it explicit that we currently need clang 8+

Fixes #44
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

Successfully merging a pull request may close this issue.

2 participants