From cee0474d82ff8d524c6a8265b81ace41225b820f Mon Sep 17 00:00:00 2001 From: Jérôme Leclercq Date: Tue, 13 May 2025 11:13:07 +0200 Subject: target_triple: allow to pass system/abi to cross --- xmake/modules/core/tools/rustc/target_triple.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xmake/modules/core/tools/rustc/target_triple.lua b/xmake/modules/core/tools/rustc/target_triple.lua index ddbf052ea..6064b041c 100644 --- a/xmake/modules/core/tools/rustc/target_triple.lua +++ b/xmake/modules/core/tools/rustc/target_triple.lua @@ -47,8 +47,12 @@ function _translate_plat(plat, arch, opt) return "-pc-windows-msvc" elseif plat == "mingw" or plat == "msys" then return "-pc-windows-gnu" - elseif plat == "linux" or plat == "cross" then + elseif plat == "linux" then return "-unknown-linux-gnu" + elseif plat == "cross" then + local system = opt and opt.system or "-unknown-linux" + local abi = opt and opt.abi or "-gnu" + return system .. abi elseif plat == "macosx" then return "-apple-darwin" elseif plat == "android" then -- cgit v1.3.1 From eef0da798d9f5fc404dd14e8b9639fc58c93c274 Mon Sep 17 00:00:00 2001 From: Jérôme Leclercq Date: Tue, 13 May 2025 12:01:26 +0200 Subject: Update target_triple.lua --- xmake/modules/core/tools/rustc/target_triple.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/modules/core/tools/rustc/target_triple.lua b/xmake/modules/core/tools/rustc/target_triple.lua index 6064b041c..f15f0da11 100644 --- a/xmake/modules/core/tools/rustc/target_triple.lua +++ b/xmake/modules/core/tools/rustc/target_triple.lua @@ -50,9 +50,9 @@ function _translate_plat(plat, arch, opt) elseif plat == "linux" then return "-unknown-linux-gnu" elseif plat == "cross" then - local system = opt and opt.system or "-unknown-linux" - local abi = opt and opt.abi or "-gnu" - return system .. abi + local system = opt and opt.system or "unknown-linux" + local abi = opt and opt.abi or "gnu" + return "-" .. system .. "-" .. abi elseif plat == "macosx" then return "-apple-darwin" elseif plat == "android" then -- cgit v1.3.1 From 1e2a3547ac922910605c155866ae7a82d1f27c2a Mon Sep 17 00:00:00 2001 From: Jérôme Leclercq Date: Tue, 13 May 2025 15:00:39 +0200 Subject: Update target_triple.lua --- xmake/modules/core/tools/rustc/target_triple.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/xmake/modules/core/tools/rustc/target_triple.lua b/xmake/modules/core/tools/rustc/target_triple.lua index f15f0da11..98bc9cf3c 100644 --- a/xmake/modules/core/tools/rustc/target_triple.lua +++ b/xmake/modules/core/tools/rustc/target_triple.lua @@ -49,10 +49,6 @@ function _translate_plat(plat, arch, opt) return "-pc-windows-gnu" elseif plat == "linux" then return "-unknown-linux-gnu" - elseif plat == "cross" then - local system = opt and opt.system or "unknown-linux" - local abi = opt and opt.abi or "gnu" - return "-" .. system .. "-" .. abi elseif plat == "macosx" then return "-apple-darwin" elseif plat == "android" then -- cgit v1.3.1