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

[BUG] Cannot compile <9-runqlat>'s code in Ubuntu 22.04 #86

Open
musicBoxes opened this issue Dec 19, 2023 · 5 comments
Open

[BUG] Cannot compile <9-runqlat>'s code in Ubuntu 22.04 #86

musicBoxes opened this issue Dec 19, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@musicBoxes
Copy link

Error message:

INFO [ecc_rs::bpf_compiler] Compiling bpf object...
error: unknown argument: '-target bpf'
/home/runjie/Desktop/bpf-developer-tutorial/src/9-runqlat/core_fixes.bpf.h:28:6: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
/home/runjie/Desktop/bpf-developer-tutorial/src/9-runqlat/core_fixes.bpf.h:51:6: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
/home/runjie/Desktop/bpf-developer-tutorial/src/9-runqlat/core_fixes.bpf.h:79:6: error: use of unknown builtin '__builtin_preserve_type_info' [-Wimplicit-function-declaration]
/home/runjie/Desktop/bpf-developer-tutorial/src/9-runqlat/core_fixes.bpf.h:79:6: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]
/home/runjie/Desktop/bpf-developer-tutorial/src/9-runqlat/core_fixes.bpf.h:79:6: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
/home/runjie/Desktop/bpf-developer-tutorial/src/9-runqlat/core_fixes.bpf.h:107:6: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
INFO [ecc_rs::bpf_compiler] Generating export types...
INFO [ecc_rs::bpf_compiler] Generating package json..
INFO [ecc_rs::bpf_compiler] Packing ebpf object and config into package.json..

My clang version is clang 14, which is default clang version in Ubuntu 22.04. I also try to use clang 16. However, the error message is same.

@musicBoxes musicBoxes added the bug Something isn't working label Dec 19, 2023
@Officeyutong
Copy link
Contributor

How did you invoke ecc?

@musicBoxes
Copy link
Author

I try to use ecc by (1) adding the ecc's folder into $PATH, (2) using absolute path of ecc, and (3) adding sudo into command. However, all methods failed to compile 9-runqlat's code.

@Officeyutong
Copy link
Contributor

Officeyutong commented Dec 21, 2023

I try to use ecc by (1) adding the ecc's folder into $PATH, (2) using absolute path of ecc, and (3) adding sudo into command. However, all methods failed to compile 9-runqlat's code.

Which version of ecc are you using? May I have a look at the output of ecc -v? And how did you switch the version of clang?

@musicBoxes
Copy link
Author

Here is the output of ecc -V: ecc-rs 0.3.4.
For the switching of clang version, I first use apt remove to uninstall clang-14. And then I copy clang-16 to /bin/ and /usr/bin/ because ecc cannot find clang-16 if I simply add clang-16 into $PATH.

@Officeyutong Officeyutong self-assigned this Jan 2, 2024
@NorthFat
Copy link

请问这个问题解决了吗?我遇到了同样的问题:
环境ubuntu 20.04.06
rustup 1.27.0 (bbb9276d2 2024-03-08)
rustc 1.77.0 (aedd173a2 2024-03-17)
Ubuntu clang version 16.0.6 (++20231112100455+7cbf1a259152-1exp120231112100542.106)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants