Skip to content

Fix flags usage for static build - #203

Merged
qmonnet merged 1 commit into
mainfrom
pr/static-flags
Jul 19, 2025
Merged

Fix flags usage for static build#203
qmonnet merged 1 commit into
mainfrom
pr/static-flags

Conversation

@qmonnet

@qmonnet qmonnet commented Jul 19, 2025

Copy link
Copy Markdown
Member

The flag we've been using and documenting for static builds does the work, but is not correct:

  • It should be "-static" (compiler option, as expected by gcc for example) and not "--static" (linker option, gcc translates the former into the latter when invoking the linker).

  • It should not be passed with the CFLAGS (or in our case, EXTRA_CFLAGS), but instead with the LDFLAGS (or EXTRA_LDFLAGS), because it is a flag that will be passed to the linker.

Fix it in the README.md and in CI/release workflows.

The flag we've been using and documenting for static builds does the
work, but is not correct:

- It should be "-static" (compiler option, as expected by gcc for
  example) and not "--static" (linker option, gcc translates the former
  into the latter when invoking the linker).

- It should not be passed with the CFLAGS (or in our case,
  EXTRA_CFLAGS), but instead with the LDFLAGS (or EXTRA_LDFLAGS),
  because it is a flag that will be passed to the linker.

Fix it in the README.md and in CI/release workflows. We also need to
adjust feature detection to take the EXTRA_LDFLAGS (so far ignored) into
account.

Signed-off-by: Quentin Monnet <qmo@kernel.org>
@qmonnet
qmonnet merged commit 4565cfe into main Jul 19, 2025
5 checks passed
@qmonnet
qmonnet deleted the pr/static-flags branch July 19, 2025 01:49
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

Successfully merging this pull request may close these issues.

1 participant