Skip to content

GnuCompiler.has_arguments: detect "not supported for this target" warnings#15876

Open
lzwind wants to merge 1 commit into
mesonbuild:masterfrom
lzwind:fix/get_supported_arguments_stderr_check
Open

GnuCompiler.has_arguments: detect "not supported for this target" warnings#15876
lzwind wants to merge 1 commit into
mesonbuild:masterfrom
lzwind:fix/get_supported_arguments_stderr_check

Conversation

@lzwind

@lzwind lzwind commented Jun 2, 2026

Copy link
Copy Markdown

Summary

  • GCC may exit with code 0 while emitting a warning that an option is "not supported for this target" (e.g., HPPA with -fstack-protector). Previously, has_arguments() only checked for cross-language warnings ("is valid for C/ObjC" / "is valid for C++/ObjC++").
  • Added the "not supported for this target" pattern to the stderr inspection in has_arguments() so such flags are correctly reported as unsupported.

Partially fixes: #5355

Test plan

  • Verify that compiler.get_supported_arguments() correctly returns false for target-unsupported flags (e.g., -fstack-protector on HPPA)
  • Verify existing cross-language warning detection still works
  • Verify that genuinely supported flags are not affected

…nings

GCC may exit with code 0 while emitting a warning that an option is
"not supported for this target" (e.g., HPPA with -fstack-protector).
Add this pattern to the stderr inspection in has_arguments() so such
flags are correctly reported as unsupported.

Fixes: mesonbuild#5355
@lzwind lzwind requested a review from dcbaker as a code owner June 2, 2026 09:58
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.

compiler.get_supported_arguments reports success for unsupported flags

1 participant