[PATCH] D120251: [clang][driver][wasm] Fix libstdc++ target-dependent include dir
Timm Bäder via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 21 07:04:17 PST 2022
tbaeder created this revision.
tbaeder added a reviewer: sbc100.
Herald added subscribers: sunfish, jgravelle-google, dschuff.
tbaeder requested review of this revision.
Herald added subscribers: cfe-commits, aheejin.
Herald added a project: clang.
As an alternative to https://reviews.llvm.org/D119056 that addresses the issues raised with that patch and fixes the test case to succeed.
I think this does what Jonathan explained in https://reviews.llvm.org/D119056#3313911
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D120251
Files:
clang/lib/Driver/ToolChains/WebAssembly.cpp
clang/test/Driver/wasm-toolchain.cpp
Index: clang/test/Driver/wasm-toolchain.cpp
===================================================================
--- clang/test/Driver/wasm-toolchain.cpp
+++ clang/test/Driver/wasm-toolchain.cpp
@@ -80,7 +80,7 @@
// COMPILE_STDCXX: clang{{.*}}" "-cc1"
// COMPILE_STDCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]*]]"
// COMPILE_STDCXX: "-isysroot" "[[SYSROOT:[^"]+]]"
-// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/wasm32-wasi/c++/4.8"
+// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/4.8/wasm32-wasi"
// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/c++/4.8"
// COMPILE_STDCXX: "-internal-isystem" "[[RESOURCE_DIR]]{{(/|\\\\)}}include"
// COMPILE_STDCXX: "-internal-isystem" "[[SYSROOT:[^"]+]]/include/wasm32-wasi"
Index: clang/lib/Driver/ToolChains/WebAssembly.cpp
===================================================================
--- clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -528,7 +528,7 @@
// First add the per-target include path if the OS is known.
if (IsKnownOs) {
- std::string TargetDir = LibPath + "/" + MultiarchTriple + "/c++/" + Version;
+ std::string TargetDir = LibPath + "/c++/" + Version + "/" + MultiarchTriple;
addSystemInclude(DriverArgs, CC1Args, TargetDir);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120251.410295.patch
Type: text/x-patch
Size: 1322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220221/70be85e8/attachment.bin>
More information about the cfe-commits
mailing list