Darwin test suite now XFAILs -g3 tests with dyld on current OS versions.
Tests using -g3 debugging on Darwin are now marked as expected failures for current OS versions due to incompatibility with dyld's static linker.
The GCC test suite on Darwin has been updated to mark certain tests as expected failures (XFAIL) when they are compiled with the -g3 debugging flag on current operating system versions. This is a workaround for a known incompatibility where Darwin’s default static linker, dyld, does not correctly handle the output generated by -g3. Since there is no immediate fix for this linker limitation, marking these tests as XFAIL prevents spurious failures in the test suite.
In Details
This commit introduces XFAIL markers for specific dwarf2 debug tests (dwarf2-macro.c, dwarf2-macro2.c) when run on Darwin 23+. The issue stems from an incompatibility between GCC's -g3 debug information generation (which produces extensive DWARF debug data) and Darwin's static linker, dyld. The linker currently fails to process this output correctly, leading to test failures. As a workaround, these tests are now skipped under these specific conditions until the upstream linker issue is resolved.
For Context
When you compile code, you can often include 'debugging information' using flags like -g. This information allows debuggers to show you original source code lines, variable values, and function call stacks, which is crucial for finding and fixing bugs. The flag -g3 tells the compiler to include a very comprehensive set of debugging information. On macOS (Darwin), the system uses a 'dynamic linker' called dyld to prepare programs for execution. Currently, there's a problem where dyld doesn't correctly handle the very detailed debugging information generated by -g3. Because of this, certain tests within the GCC compiler's own testing suite on macOS were failing. This update doesn't fix the underlying linker problem, but it tells the GCC test suite to expect these particular tests to fail on recent macOS versions when using -g3, so the overall test results remain clean and accurate while the linker issue is outstanding.