This is an archive of the discontinued LLVM Phabricator instance.

[CMake] Don't add -lstdc++ to LDFLAGS
ClosedPublic

Authored by arichardson on Oct 16 2020, 8:36 AM.

Details

Summary

If the target includes a C++ source file, CMake will automatically link
the C++ standard library. This is useful when building on platforms where
libstdc++.so does not exist (e.g. CheriBSD since we only use libc++.so).

Event Timeline

arichardson created this revision.Oct 16 2020, 8:36 AM
arichardson requested review of this revision.Oct 16 2020, 8:36 AM
smeenai accepted this revision.Oct 16 2020, 11:43 AM

Both CMake and the driver (assuming it's invoked as clang++/g++) should take care of adding the C++ standard library, so this LGTM.

This revision is now accepted and ready to land.Oct 16 2020, 11:43 AM

Seems like the test-suite repository doesn't auto-close revisions.

Committed as https://github.com/llvm/llvm-test-suite/commit/eef6375030183ff0a3d3defd3b408d246931a140.

arichardson closed this revision.Oct 18 2020, 9:14 AM