From 2f6103bb2b519ecd87575c604d1124c2473def67 Mon Sep 17 00:00:00 2001 From: Liam Mitchell Date: Fri, 13 Jun 2025 00:37:20 +0000 Subject: Update to recent UE toolchain, and link statically against toolchain libc++ and libc++abi --- xmake.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'xmake.lua') diff --git a/xmake.lua b/xmake.lua index 9b433689d..d2ba88df5 100644 --- a/xmake.lua +++ b/xmake.lua @@ -40,6 +40,15 @@ if is_plat("windows") then add_requires("7z") end +-- If we're using the UE cross-compile toolchain, we need to ensure we link statically +-- against the toolchain libc++ and libc++abi, as the system ones can differ in ABI +-- leading to nasty crashes +if is_plat("linux") and "$(env UE_TOOLCHAIN_DIR)" ~= "" then + add_ldflags("-static-libstdc++") + add_ldflags("$(projectdir)/thirdparty/ue-libcxx/lib64/libc++.a") + add_ldflags("$(projectdir)/thirdparty/ue-libcxx/lib64/libc++abi.a") +end + add_requires("vcpkg::mimalloc") if has_config("zensentry") then @@ -107,6 +116,7 @@ if is_os("linux") or is_os("macosx") then add_cxxflags("-Wno-unused-private-field") add_cxxflags("-Wno-unused-value") add_cxxflags("-Wno-unused-variable") + add_cxxflags("-Wno-vla-cxx-extension") end -- Turn use of undefined cpp macros into errors -- cgit v1.2.3 From 0e125c72c58d41f6088aefde6e0d4e9c00b85578 Mon Sep 17 00:00:00 2001 From: Liam Mitchell Date: Fri, 13 Jun 2025 22:47:45 +0000 Subject: Use llvm-objcopy provided by UE toolchain --- xmake.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'xmake.lua') diff --git a/xmake.lua b/xmake.lua index d2ba88df5..2b72b8af3 100644 --- a/xmake.lua +++ b/xmake.lua @@ -47,6 +47,7 @@ if is_plat("linux") and "$(env UE_TOOLCHAIN_DIR)" ~= "" then add_ldflags("-static-libstdc++") add_ldflags("$(projectdir)/thirdparty/ue-libcxx/lib64/libc++.a") add_ldflags("$(projectdir)/thirdparty/ue-libcxx/lib64/libc++abi.a") + set_toolset("objcopy", "$(env UE_TOOLCHAIN_DIR)/bin/llvm-objcopy") end add_requires("vcpkg::mimalloc") -- cgit v1.2.3 From 18028888178f65cbfeffdb2e24569c4cbadcac04 Mon Sep 17 00:00:00 2001 From: Liam Mitchell Date: Fri, 13 Jun 2025 23:07:17 +0000 Subject: Temporarily disable stripping of symbols while investigating issues with toolchain versions of objcopy --- xmake.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xmake.lua') diff --git a/xmake.lua b/xmake.lua index 2b72b8af3..ea7183900 100644 --- a/xmake.lua +++ b/xmake.lua @@ -117,6 +117,9 @@ if is_os("linux") or is_os("macosx") then add_cxxflags("-Wno-unused-private-field") add_cxxflags("-Wno-unused-value") add_cxxflags("-Wno-unused-variable") +end + +if is_os("linux") then add_cxxflags("-Wno-vla-cxx-extension") end @@ -188,6 +191,7 @@ set_languages("cxx20") -- always generate debug information set_symbols("debug") +set_strip("none") includes("src/transports") includes("src/zenbase") -- cgit v1.2.3