Skip to content

CheckCompilerFlags: Revert "Catch linker warning about ignored flags"

Revert !6836 (merged). It regressed cases where incidental linker warnings were previously tolerated. Revert the change pending further investigation.

This also requires a fix to CheckLinkerFlag to catch linker warnings when the checked flag is ignored. Prior to !6877 (merged), the checks for -pie and -no_pie on macOS failed due to executing the compiler directly without any -isysroot, producing ld: library not found for -lc++. See issues #23053 (closed) and #19180. The failing check for -pie was a bug because it is supported on macOS, both for x86_64 and arm64, and the commit fixed that check. However, -no_pie is not supported on macOS arm64. The above commit was only able to detect that due to !6836 (merged), which we are reverting. Instead, catch only the linker warning about the exact flag being checked.

Fixes: #23432 (closed)
Issue: #22961
Backport: release

Edited by Brad King

Merge request reports