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

Support building with LLVM 18 #3051

Merged
merged 5 commits into from
Mar 13, 2024
Merged

Support building with LLVM 18 #3051

merged 5 commits into from
Mar 13, 2024

Conversation

danobi
Copy link
Member

@danobi danobi commented Mar 12, 2024

Support building bpftrace against the recently released LLVM 18.

Checklist
  • Language changes are updated in man/adoc/bpftrace.adoc
  • User-visible and non-trivial changes updated in CHANGELOG.md
  • The new behaviour is covered by tests

wentao-windriver and others added 4 commits March 12, 2024 12:56
"runtime:call" in ptest gets the following FAILED:
python: No such file or directory
replace python with python3 in the test scripts.

$export BPFTRACE_RUNTIME_TEST_EXECUTABLE=/usr/bin
$cd /usr/lib/bpftrace/ptest/tests
$python3 runtime/engine/main.py --filter="call.*"
***
[ RUN      ] call.strftime_microsecond_extension_rollover
[  FAILED  ] call.strftime_microsecond_extension_rollover
	Command: /usr/bin/bpftrace -e 'BEGIN { printf("%s - %s\n", strftime
    ("1%f", 1000000123000), strftime("1%f", 0)); exit(); }' | tail -n
    +2 | xargs -I{} python -c "print({})"
	Unclean exit code: 127
	Output: __BPFTRACE_NOTIFY_PROBES_ATTACHED\nxargs: python: No such
    file or directory\n
***

Signed-off-by: Wentao Zhang <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
getPtrTy is added in LLVM-15 and is to be used instead of getInt8PtrTy
which is gone in LLVM-18 onwards

llvm/llvm-project@7e0802aeb5b90

Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Daniel Xu <[email protected]>
llvm 18 has change CodeGenOpt::Level/CodeGenFileType into enum classes via
llvm/llvm-project@0a1aa6c

Signed-off-by: Khem Raj <[email protected]>
Signed-off-by: Daniel Xu <[email protected]>
@danobi danobi requested review from ajor, viktormalik and fbs as code owners March 12, 2024 19:12
@danobi danobi mentioned this pull request Mar 12, 2024
3 tasks
@danobi danobi added the do-not-squash Do not squash PR commits label Mar 12, 2024
Copy link
Contributor

@viktormalik viktormalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that LLVM 18 is not in nixpkgs, yet, so we should just merge this and add the CI job once it is available.

@danobi danobi merged commit ce9a456 into bpftrace:master Mar 13, 2024
19 checks passed
@kloczek
Copy link

kloczek commented Apr 4, 2024

Is it possible to backport this PR to release/0.20.x branch or release new version out of master? 🤔

@danobi
Copy link
Member Author

danobi commented Apr 4, 2024

Hi @kloczek , speaking for myself, I'd prefer not to yet. We don't have LLVM 18 running in CI yet. So consider llvm 18 support under development.

@kloczek
Copy link

kloczek commented May 17, 2024

Any update about LLVM 18.1.x supporting new version? 🤔

@danobi
Copy link
Member Author

danobi commented May 17, 2024

@kloczek almost! Nix is about to release 24.05 (NixOS/nixpkgs#303285) which contains llvm 18 package

@danobi
Copy link
Member Author

danobi commented May 27, 2024

Quick update: nix 24.05 is out and llvm 18 is present. I'm having a bit of trouble getting the nix build to function. Currently stuck with this error:

$ ./result/bin/bpftrace
./result/bin/bpftrace: error while loading shared libraries: libicuuc.so.74: cannot open shared object file: No such file or directory

LD_DEBUG=all is quite helpful. Seems like this is related to the recent lldb dependency addition:

$ LD_DEBUG=all ./result/bin/bpftrace
[..]
   2726159:     file=libicuuc.so.74 [0];  needed by /nix/store/hcag2qn4njvps4wpy7fnjb20y80fynni-lldb-18.1.5-lib/lib/../../../../lib/libxml2.so.2 [0]
   2726159:     find library=libicuuc.so.74 [0]; searching
[..]

I filed NixOS/nixpkgs#315214 .

@jordalgo
Copy link
Contributor

@tyroguru We're you seeing a similar issue in your VM?

@danobi
Copy link
Member Author

danobi commented May 28, 2024

Looks like master is broken atm too: NixOS/nixpkgs#315214 (comment)

@tyroguru
Copy link
Contributor

tyroguru commented May 28, 2024

@tyroguru We're you seeing a similar issue in your VM?

@jordalgo Yes, that was it. Well remembered!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-squash Do not squash PR commits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants