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

Improve Makefile configurability #22

Merged
merged 7 commits into from
Aug 13, 2024

Conversation

antecrescent
Copy link
Contributor

These changes extend the configuration options of the build, which allows Gentoo authors to drop their patches (gentoo/guru@ffc7513).

This PR changes the logic by which compiler-specific warnings are applied. From the commit message:

The cc-option filters out unknown flags which make the compiler error
out.
Note that Clang enables Wunused-command-line-argument by default and
merely emits a warning but incurs no error, when it encounters such a
flag. GCC on the other hand exits unsuccessfully when it is passed a
flag of the form -Wunknown-warning, but no diagnostic is produced for
-Wno-unknown-warning unless other diagnostics are produced.

As a result, we now may pass unknown flags to the compiler as long as they don't cause the build to crash (by themselves).
On the plus side, this approach allows us not to keep track of which compiler support which flags and we don't rely on the existence of the gcc and clang binaries anymore.
Its usage is discouraged in favor of their target-prefixed variants for cross-compilation, as they may accidentally compile for the host instead of the target.
The same argument applies for the usage of pkg-config vs. a freely configurable PKG_CONFIG.

The cc-option filters out unknown flags which make the compiler error
out.
Note that Clang enables Wunused-command-line-argument by default and
merely emits a warning but incurs no error, when it encounters such a
flag.  GCC on the other hand exits unsuccessfully when it is passed a
flag of the form -Wunknown-warning, but no diagnostic is produced for
-Wno-unknown-warning unless other diagnostics are produced.
@gwenhael-le-moine gwenhael-le-moine merged commit ad6539e into gwenhael-le-moine:main Aug 13, 2024
2 checks passed
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.

2 participants