summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-12-24 23:33:07 +0800
committerruki <[email protected]>2025-12-24 23:33:07 +0800
commitd2f19c477cb65b01f0d9e6b83b30176d18bd8027 (patch)
treef9a5ef1c11860fb5bc784488eef069f1940917e7
parent47f9f2604141a5995c88d28d00938020a547b6dc (diff)
fix cross toolchain on linux
-rw-r--r--xmake/platforms/linux/xmake.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/platforms/linux/xmake.lua b/xmake/platforms/linux/xmake.lua
index ebaedf975..8b0232241 100644
--- a/xmake/platforms/linux/xmake.lua
+++ b/xmake/platforms/linux/xmake.lua
@@ -29,7 +29,14 @@ platform("linux")
set_formats("symbol", "$(name).sym")
set_installdir("/usr/local")
- set_toolchains("envs", "cross", "gcc", "clang", "yasm", "nasm", "fasm", "cuda", "go", "rust", "swift", "gfortran", "zig", "fpc", "nim")
+
+ -- The cross toolchain should be placed after the host toolchain.
+ -- otherwise, if the host toolchain is explicitly loaded in the target,
+ -- the cross toolchain will be selected incorrectly in toolchain.lua.
+ --
+ -- TODO Perhaps we should handle it better, or remove the cross toolchain.
+ set_toolchains("envs", "gcc", "clang",
+ "cross", "yasm", "nasm", "fasm", "cuda", "go", "rust", "swift", "gfortran", "zig", "fpc", "nim")
set_menu {
config =