[clang] [WebAssembly] Clang support for exception-based lookup paths (PR #185775)
Alex Crichton via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 10 17:08:56 PDT 2026
================
@@ -34,6 +34,15 @@ std::string WebAssembly::getMultiarchTriple(const Driver &D,
TargetTriple.getOSAndEnvironmentName()).str();
}
+/// Returns a directory name in which separate objects compile with/without
+/// exceptions may lie. This is used both for `#include` paths as well as lib
+/// paths.
+static std::string GetCXXExceptionsDir(const ArgList &DriverArgs) {
+ if (DriverArgs.getLastArg(options::OPT_fwasm_exceptions))
+ return "eh";
+ return "noeh";
----------------
alexcrichton wrote:
My thinking behind this was that if the no-eh libs are in the default location then there's a risk they're used if things are misconfigured and the `eh` path is lost. By separating these directories entirely it'd help catch misconfigurations because the libraries would be entirely missing as opposed to possibly overlapping.
For now with wasi-sdk only libcxx and friends are compiled twice, I was thinking that there'd be libc in the "default location" and then libcxx would be located both in the "eh" and "noeh" locations compiled separately
https://github.com/llvm/llvm-project/pull/185775
More information about the cfe-commits
mailing list