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

Use CFLAGS from the Makefile #118

Open
bavshin-f5 opened this issue Jan 13, 2025 · 0 comments
Open

Use CFLAGS from the Makefile #118

bavshin-f5 opened this issue Jan 13, 2025 · 0 comments

Comments

@bavshin-f5
Copy link
Member

Some compiler flags can affect the bindings or the binary in significant for us ways. At the very least, we should be able to find the preprocessor flags (-D) and pass to bindgen. That requires improving our Makefile parser and collecting more variables.

A practical example: I've been trying to enforce the alignment requirements by statically asserting that the NGX_ALIGNMENT the nginx binary was built with is large enough (improperly aligned pointers are UB in Rust, and some of the core:: APIs verify alignment), and found that it wasn't possible to detect that the alignment was overridden via auto/configure --with-cc-opt="-DNGX_ALIGNMENT=8".

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

No branches or pull requests

1 participant