From d2f19c477cb65b01f0d9e6b83b30176d18bd8027 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 24 Dec 2025 23:33:07 +0800 Subject: fix cross toolchain on linux --- xmake/platforms/linux/xmake.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 = -- cgit v1.3.1