diff --git a/xmake/modules/core/tools/clang.lua b/xmake/modules/core/tools/clang.lua index 76a1f773bcc..a7e5b1d1127 100644 --- a/xmake/modules/core/tools/clang.lua +++ b/xmake/modules/core/tools/clang.lua @@ -271,7 +271,7 @@ function nf_runtime(self, runtime, opt) local target = opt.target or opt local is_cxx = target and (target.sourcekinds and table.contains(table.wrap(target:sourcekinds()), "cxx")) if is_cxx then - maps["c++_static"] = "-stdlib=libc++" + maps["c++_static"] = {"-stdlib=libc++", "-lc++abi"} maps["c++_shared"] = "-stdlib=libc++" maps["stdc++_static"] = "-stdlib=libstdc++" maps["stdc++_shared"] = "-stdlib=libstdc++" diff --git a/xmake/toolchains/ndk/load.lua b/xmake/toolchains/ndk/load.lua index 4e60f0075ad..93df46e6168 100644 --- a/xmake/toolchains/ndk/load.lua +++ b/xmake/toolchains/ndk/load.lua @@ -318,8 +318,8 @@ function main(toolchain) -- The NDK's libc++ now comes directly from our LLVM toolchain above 26b -- https://github.com/xmake-io/xmake/issues/4614 if ndk_cxxstl == "c++_static" then - toolchain:add("ldflags", "-static-libstdc++") - toolchain:add("shflags", "-static-libstdc++") + toolchain:add("ldflags", "-static-libstdc++", "-lc++abi") + toolchain:add("shflags", "-static-libstdc++", "-lc++abi") if arm32 then toolchain:add("syslinks", "unwind", "atomic") end