Skip to content
Commit 27546a65 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

[libcxx] [test] Use -fms-runtime-lib= for picking the CRT to use

This is a more correct way of linking against a specific runtime
library with the GCC-like clang frontend.

This avoids having to pass -D_DEBUG (and passes flags like -D_DLL,
which we should be passing if linking against the dynamic CRT).

When -fms-runtime-lib= is specified, each compiled object file gets
embedded directives instructing the linker about what CRT it should
link against. The -nostdlib we pass to the compiler driver only
inhibits the libs that the compiler driver passes to the linker
command.

Thus, this also avoids having to specify -lmsvcrt, -lmsvcrtd,
-llibcmt or -llibcmtd, and -loldnames.

Based on a patch by Andrew Ng.

The -fms-runtime-lib= option was added in Clang 16, but libcxx
now has dropped support for Clang 15.

Differential Revision: https://reviews.llvm.org/D155562
parent 61873540
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment