-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[linux-kernel] Prepare zstd for the Linux Kernel #2289
Conversation
4fc16ad
to
38302ef
Compare
The problem was just that |
17b85e8
to
a57fb69
Compare
The PR is now complete, except any CI problems or problems that show up in further testing. |
a57fb69
to
6851ca1
Compare
regarding |
Yeah, the ifdef parsing only handles simple cases. If there are extra parenthesizes for example, it doesn't handle it. But, it will only do the transform when it can prove it is correct. I tried to use a full pre-processor engine. But, it ended up way too complex, so I went back to regexes. The regexes handle all the variants of the preprocessor that show up in the zstd codebase.
This script gets run by Github Actions, and then the generated code is tested. I also manually ran tests like Additionally, the changes the script makes get printed out like a |
6851ca1
to
1d7efb5
Compare
This PR introduces a substantial impact on the public API A potential alternative could have been to keep the symbols present and published in The advantage is that On the downside, absence of a symbol can provide a compile-time signal in a way that a runtime error code cannot. While I acknowledge that none of these solutions looks perfect, |
Let's just drop that commit then. The goal is exclusively on the API side. I didn't want to have functions that simply don't work in the kernel's API. But, if you think that the cost for all other uses is too high, then let's skip it. The kernel implementation of |
b978e4a
to
3420c20
Compare
That commit is dropped, there are no longer any changes to |
The unused function definitions are hidden behind a `#ifndef ZSTD_NO_UNUSED_FUNCTIONS` check. Initially hiding all functions which are unused and take up more than 2KB of stack space, because these will show up as warnings in the Linux Kernel build system.
…te zstd in the kernel
current
withcurr
because it collides with a kernel macro.ZSTD_NO_INTRINSICS
macro to avoid explicit intrinsics, since the headers aren't available in the kernel.ZSTD_initCStream_advanced()
with no dictionary and static allocationfreestanding.py
to hardwire preprocessor macros.TODO:
Document the newly added build macros to
lib/README.md