Closed fujitatomoya closed 5 months ago
I think what could be happening is that you have an old Rust version installed. If it's too old it may not be able to build newer versions of gimli
and I believe they may not even be listed as candidate versions (because they are no candidate). Can you try updating Rust and/or share what version you are using?
Edit: blazesym
requires Rust 1.65
at a minimum.
thanks, it processed further then, but i can see the following error.
tomoyafujita@~/DVT/03_OSS/github.com/libbpf/libbpf-bootstrap/examples/c >rustc -V
rustc 1.78.0 (9b00956e5 2024-04-29)
tomoyafujita@~/DVT/03_OSS/github.com/libbpf/libbpf-bootstrap/examples/c >make
Compiling blazesym-c v0.0.0 (/home/tomoyafujita/DVT/03_OSS/github.com/libbpf/libbpf-bootstrap/blazesym/capi)
error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
--> capi/src/symbolize.rs:614:40
|
587 | let mut syms_last = unsafe { &mut (*result_ptr).syms as *mut blaze_sym };
| -----------------------------------------
| | |
| | backing allocation comes from here
| casting happend here
...
614 | let sym_ref = unsafe { &mut *syms_last };
| ^^^^^^^^^^^^^^^
|
= note: casting from `[blaze_sym; 0]` (0 bytes) to `blaze_sym` (80 bytes)
= note: `#[deny(invalid_reference_casting)]` on by default
error: could not compile `blazesym-c` (lib) due to 1 previous error
make: *** [Makefile:98: /home/tomoyafujita/DVT/03_OSS/github.com/libbpf/libbpf-bootstrap/blazesym/target/release/libblazesym_c.a] Error 101
Yeah, this was due to a change in the Rust compiler. It got addressed way back when, but we haven't had a release since then. Will update the snapshot some more.
Can you update libbpf-bootstrap
to the most recent revision? I don't think your code is up-to-date, as https://github.com/libbpf/libbpf-bootstrap/commit/f189965c3c16f9219e7687c4333b733b375d33a8 should have included the fix.
@danielocfb thanks for checking.
https://github.com/libbpf/libbpf-bootstrap?tab=readme-ov-file#building failed with the following error, i used https://github.com/libbpf/libbpf-bootstrap/commit/087ff1ac047f40abad7eeb62def128b58453b2f1
...
libbpf: failed to find BTF info for global/extern symbol 'dev'
Error: failed to link '.output/minimal_ns.tmp.bpf.o': No such file or directory (2)
make: *** [Makefile:109: .output/minimal_ns.bpf.o] Error 254
make: *** Deleting file '.output/minimal_ns.bpf.o'
Hm, that seems to be a problem with minimal_ns
now :-( You can move to the previous commit and the build will hopefully go through.
I don't know what this issue is about, exactly, and it works for me (tm). But it's conceivable that the incremental build is broken because of earlier build failures getting everything into an inconsistent state. So perhaps try cleaning everything and rebuilding.
as you mentioned, reverting https://github.com/libbpf/libbpf-bootstrap/commit/087ff1ac047f40abad7eeb62def128b58453b2f1 works okay.
What clang
version do you have? Apparently BTF information for globals (which libbpf
seems to require here) is a semi-recent addition (perhaps clang 15 time frame). So you can try upgrading that as well.
with https://github.com/libbpf/libbpf-bootstrap/commit/2dffae1fca82fd9ef4ba15df67606cbfd2eb5412
the followings are what i see with multiple ubuntu distro, clang is too old, and it already says v11 or later
, sorry about that.
so i will go ahead to close this one, thank you very much for iteration.
minimal_ns
)tomoyafujita@~/DVT/03_OSS/github.com/libbpf/libbpf-bootstrap/examples/c >clang --version
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
tomoyafujita@~/DVT/03_OSS/github.com/libbpf/libbpf-bootstrap/examples/c >make
Finished `release` profile [optimized + debuginfo] target(s) in 0.28s
BPF .output/minimal_ns.bpf.o
libbpf: failed to find BTF info for global/extern symbol 'dev'
Error: failed to link '.output/minimal_ns.tmp.bpf.o': No such file or directory (2)
make: *** [Makefile:109: .output/minimal_ns.bpf.o] Error 254
make: *** Deleting file '.output/minimal_ns.bpf.o'
root@tomoyafujita:~/docker_ws/WORK/libbpf-bootstrap/examples/c# clang --version
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
root@tomoyafujita:/# clang --version
Ubuntu clang version 18.1.3 (1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
@danielocfb appreciate your support, closing.
since I am new for libbpf, not really sure what went wrong so posting issue here. it just seems that required package version does not match from blazesym package.
btw, examples seem to work.