Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Add support for LLVM 14 (Rust 1.60) #312

Open
rsdy opened this issue Apr 7, 2022 · 9 comments · May be fixed by #316
Open

Add support for LLVM 14 (Rust 1.60) #312

rsdy opened this issue Apr 7, 2022 · 9 comments · May be fixed by #316

Comments

@rsdy
Copy link
Collaborator

rsdy commented Apr 7, 2022

The latest stable is now built against LLVM14.

@nbaksalyar
Copy link
Contributor

This is blocked by llvm-sys: https://gitlab.com/taricorp/llvm-sys.rs/-/issues/30

@rsdy
Copy link
Collaborator Author

rsdy commented Apr 7, 2022

Note that I'm probably going to use this upgrade opportunity to deprecate support for LLVM versions <13. RedBPF 3 will only support 13 +14.

@nbaksalyar
Copy link
Contributor

I submitted a patch for llvm-sys and my fork can be used to start implementing support for llvm14 in redbpf. I can give it a try. :)

@nbaksalyar nbaksalyar linked a pull request Apr 10, 2022 that will close this issue
@b0bleet
Copy link

b0bleet commented May 3, 2022

Hi is there any update for LLVM 14 support?
@nbaksalyar

@rsdy
Copy link
Collaborator Author

rsdy commented May 3, 2022

@b0bleet I'm a bit cautious on merging this, but should be functional. If you're keen on testing, that would be super helpful. The biggest obstacle in mergin #316 is fixing the CI.

@DerekStrickland
Copy link

Hi @rsdy . I've got this PR staged to upgrade the build images to llvm14. CI for the images is passing here. I might have made some invalid assumptions, or upgraded too much, so just let me know, and I will revise.

@DerekStrickland
Copy link

Sorry this has stalled a bit. I started a new job recently. Hoping to get back to this later this week. When I left off I found a couple of more changes to the upstream build-images repo that I'll need to submit around pinning linux header versions on some distros.

Also, I started running into variable kernel implementations and was struggling to find the right mechanism to dynamically change the implementation based on what the kernel supports as documented in this Rust Forum thread. Unfortunately, it seems like there are multiple inconsistencies based on distro. If there is already a way that you are handling this, please feel free to point me towards the right example code. Otherwise, I'll take a pass at it as best as I can devise.

@rsdy
Copy link
Collaborator Author

rsdy commented Nov 7, 2022

@DerekStrickland thanks a lot for your work, and bringing this to the Rust forum. I think the combination of the two approaches brought up in the thread is probably the correct thing to do.

I can't take a look in depth at the code right now, but https://github.com/BLAKE3-team/BLAKE3 pops into mind, where a significant amount of CPU feature detection happens in build.rs. Setting those cfg variables through the build file allows subsequent checks on them while building the crate. I should probably add that some heuristics translate feature-flags into internal cfg variables, too.

We should have all the code that parses Linux kernel versions that would allow you to toggle necessary feature tags. I should be able to get more in-depth look towards the end of the week if you think that's helpful.

@DerekStrickland
Copy link

Thanks for the guidance. I'll take a look at the link you provided after Wednesday, and reach back out if I have further questions, or something to review.

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

Successfully merging a pull request may close this issue.

4 participants