Testsuite: Removes duplicate Asan and pthread libraries for Darwin
GCC's testsuite for C++ on Darwin no longer includes redundant Asan and pthread libraries, avoiding linker complaints.
This commit updates the GCC C++ testsuite for Darwin to prevent duplicate linking of libraries. On newer versions of Darwin, the linker reports errors when asan (AddressSanitizer) and pthread libraries are included redundantly. The asan library is already provided by the compiler’s specifications, and pthread is part of libSystem, so the test configuration has been adjusted to omit these explicit links, resolving linker complaints and ensuring cleaner test execution.
In Details
This change in gcc/testsuite/g++.dg/asan/deep-thread-stack-1.C modifies the linker flags for Darwin targets. Specifically, it removes redundant explicit links to asan and pthread libraries. On modern Darwin toolchains, the asan library is implicitly added via compiler driver specs (-fsanitize=address), and pthread functionality is subsumed by libSystem. Duplicate explicit linking of these libraries generates linker warnings or errors, which this patch rectifies by ensuring the testsuite avoids these redundant specifications, aligning it with current Darwin linker behavior.
For Context
This update affects how GCC's automated tests for C++ programs run on Apple's Darwin operating system (which powers macOS). The tests, especially those checking memory safety features like AddressSanitizer (Asan), were encountering problems with the linker—the tool that combines compiled code into a final program. The linker on newer Darwin systems would complain because it saw the asan and pthread (for multi-threading) libraries being included twice: once automatically by the compiler setup and again explicitly in the test configuration. This fix removes the redundant explicit inclusions from the test configuration, making the tests run smoothly on modern Darwin environments without unnecessary errors from the linker.