Skip to content

Use CFLAGS from the Makefile #118

Open
@bavshin-f5

Description

@bavshin-f5

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions