summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-01-18 07:03:45 +0300
committerGitHub <[email protected]>2026-01-18 07:03:45 +0300
commit1a1bd325e89760de71cb6bfc4088e5d326a15cd3 (patch)
tree18b8c17312624002e7265dfef5074dfc535e641d
parent197a78f0f28b01710b45486fe589580e9b09ff2a (diff)
parente8a618fab3758a3ca1b0b630d7c5b0dc4e08a7c5 (diff)
Merge branch 'xmake-io:dev' into case
-rwxr-xr-xcore/src/tbox/inc/bsd/tbox.config.h4
-rwxr-xr-xcore/src/tbox/inc/cygwin/tbox.config.h6
-rw-r--r--core/src/tbox/inc/haiku/tbox.config.h6
-rwxr-xr-xcore/src/tbox/inc/iphoneos/tbox.config.h4
-rwxr-xr-xcore/src/tbox/inc/linux/tbox.config.h4
-rwxr-xr-xcore/src/tbox/inc/macosx/tbox.config.h4
-rwxr-xr-xcore/src/tbox/inc/mingw/tbox.config.h6
-rwxr-xr-xcore/src/tbox/inc/msys/tbox.config.h6
-rw-r--r--core/src/tbox/inc/solaris/tbox.config.h4
-rw-r--r--xmake/rules/c++/modules/gcc/support.lua3
-rw-r--r--xmake/rules/c++/modules/msvc/support.lua4
-rw-r--r--xmake/rules/linker/link_scripts/xmake.lua28
12 files changed, 62 insertions, 17 deletions
diff --git a/core/src/tbox/inc/bsd/tbox.config.h b/core/src/tbox/inc/bsd/tbox.config.h
index 7ae7ddd71..dc9664136 100755
--- a/core/src/tbox/inc/bsd/tbox.config.h
+++ b/core/src/tbox/inc/bsd/tbox.config.h
@@ -84,6 +84,10 @@
#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP 1
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/* #undef TB_CONFIG_LIBC_HAVE_WCSUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_WCSLWR */
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/core/src/tbox/inc/cygwin/tbox.config.h b/core/src/tbox/inc/cygwin/tbox.config.h
index c20d7a228..2e2ee8a84 100755
--- a/core/src/tbox/inc/cygwin/tbox.config.h
+++ b/core/src/tbox/inc/cygwin/tbox.config.h
@@ -68,6 +68,8 @@
#define TB_CONFIG_LIBC_HAVE_STRCASECMP 1
#define TB_CONFIG_LIBC_HAVE_STRNCMP 1
#define TB_CONFIG_LIBC_HAVE_STRNCASECMP 1
+/* #undef TB_CONFIG_LIBC_HAVE_STRUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_STRLWR */
#define TB_CONFIG_LIBC_HAVE_WCSCAT 1
#define TB_CONFIG_LIBC_HAVE_WCSNCAT 1
@@ -84,6 +86,10 @@
/* #undef TB_CONFIG_LIBC_HAVE_WCSNCASECMP */
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/* #undef TB_CONFIG_LIBC_HAVE_WCSUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_WCSLWR */
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/core/src/tbox/inc/haiku/tbox.config.h b/core/src/tbox/inc/haiku/tbox.config.h
index 2b38412c5..8a9e72ad8 100644
--- a/core/src/tbox/inc/haiku/tbox.config.h
+++ b/core/src/tbox/inc/haiku/tbox.config.h
@@ -68,6 +68,8 @@
#define TB_CONFIG_LIBC_HAVE_STRCASECMP 1
#define TB_CONFIG_LIBC_HAVE_STRNCMP 1
#define TB_CONFIG_LIBC_HAVE_STRNCASECMP 1
+/*#undef TB_CONFIG_LIBC_HAVE_STRUPR*/
+/*#undef TB_CONFIG_LIBC_HAVE_STRLWR*/
#define TB_CONFIG_LIBC_HAVE_WCSCAT 1
#define TB_CONFIG_LIBC_HAVE_WCSNCAT 1
@@ -84,6 +86,10 @@
#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP 1
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/*#undef TB_CONFIG_LIBC_HAVE_WCSUPR*/
+/*#undef TB_CONFIG_LIBC_HAVE_WCSLWR*/
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/core/src/tbox/inc/iphoneos/tbox.config.h b/core/src/tbox/inc/iphoneos/tbox.config.h
index 25fa73deb..290786a50 100755
--- a/core/src/tbox/inc/iphoneos/tbox.config.h
+++ b/core/src/tbox/inc/iphoneos/tbox.config.h
@@ -84,6 +84,10 @@
#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP 1
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/* #undef TB_CONFIG_LIBC_HAVE_WCSUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_WCSLWR */
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/core/src/tbox/inc/linux/tbox.config.h b/core/src/tbox/inc/linux/tbox.config.h
index ec06d847b..6bb77a491 100755
--- a/core/src/tbox/inc/linux/tbox.config.h
+++ b/core/src/tbox/inc/linux/tbox.config.h
@@ -79,6 +79,10 @@
#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP 1
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/* #undef TB_CONFIG_LIBC_HAVE_WCSUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_WCSLWR */
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/core/src/tbox/inc/macosx/tbox.config.h b/core/src/tbox/inc/macosx/tbox.config.h
index 203f42b89..8e0ee484c 100755
--- a/core/src/tbox/inc/macosx/tbox.config.h
+++ b/core/src/tbox/inc/macosx/tbox.config.h
@@ -79,6 +79,10 @@
#define TB_CONFIG_LIBC_HAVE_WCSNCASECMP 1
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/* #undef TB_CONFIG_LIBC_HAVE_WCSUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_WCSLWR */
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/core/src/tbox/inc/mingw/tbox.config.h b/core/src/tbox/inc/mingw/tbox.config.h
index c20d7a228..2e2ee8a84 100755
--- a/core/src/tbox/inc/mingw/tbox.config.h
+++ b/core/src/tbox/inc/mingw/tbox.config.h
@@ -68,6 +68,8 @@
#define TB_CONFIG_LIBC_HAVE_STRCASECMP 1
#define TB_CONFIG_LIBC_HAVE_STRNCMP 1
#define TB_CONFIG_LIBC_HAVE_STRNCASECMP 1
+/* #undef TB_CONFIG_LIBC_HAVE_STRUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_STRLWR */
#define TB_CONFIG_LIBC_HAVE_WCSCAT 1
#define TB_CONFIG_LIBC_HAVE_WCSNCAT 1
@@ -84,6 +86,10 @@
/* #undef TB_CONFIG_LIBC_HAVE_WCSNCASECMP */
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/* #undef TB_CONFIG_LIBC_HAVE_WCSUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_WCSLWR */
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/core/src/tbox/inc/msys/tbox.config.h b/core/src/tbox/inc/msys/tbox.config.h
index c20d7a228..2e2ee8a84 100755
--- a/core/src/tbox/inc/msys/tbox.config.h
+++ b/core/src/tbox/inc/msys/tbox.config.h
@@ -68,6 +68,8 @@
#define TB_CONFIG_LIBC_HAVE_STRCASECMP 1
#define TB_CONFIG_LIBC_HAVE_STRNCMP 1
#define TB_CONFIG_LIBC_HAVE_STRNCASECMP 1
+/* #undef TB_CONFIG_LIBC_HAVE_STRUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_STRLWR */
#define TB_CONFIG_LIBC_HAVE_WCSCAT 1
#define TB_CONFIG_LIBC_HAVE_WCSNCAT 1
@@ -84,6 +86,10 @@
/* #undef TB_CONFIG_LIBC_HAVE_WCSNCASECMP */
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/* #undef TB_CONFIG_LIBC_HAVE_WCSUPR */
+/* #undef TB_CONFIG_LIBC_HAVE_WCSLWR */
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/core/src/tbox/inc/solaris/tbox.config.h b/core/src/tbox/inc/solaris/tbox.config.h
index 4aa3c21df..89bce47bc 100644
--- a/core/src/tbox/inc/solaris/tbox.config.h
+++ b/core/src/tbox/inc/solaris/tbox.config.h
@@ -84,6 +84,10 @@
/*#undef TB_CONFIG_LIBC_HAVE_WCSNCASECMP*/
#define TB_CONFIG_LIBC_HAVE_WCSTOMBS 1
#define TB_CONFIG_LIBC_HAVE_MBSTOWCS 1
+#define TB_CONFIG_LIBC_HAVE_TOWLOWER 1
+#define TB_CONFIG_LIBC_HAVE_TOWUPPER 1
+/*#undef TB_CONFIG_LIBC_HAVE_WCSUPR*/
+/*#undef TB_CONFIG_LIBC_HAVE_WCSLWR*/
#define TB_CONFIG_LIBC_HAVE_GMTIME 1
#define TB_CONFIG_LIBC_HAVE_MKTIME 1
diff --git a/xmake/rules/c++/modules/gcc/support.lua b/xmake/rules/c++/modules/gcc/support.lua
index 112272893..623444ce4 100644
--- a/xmake/rules/c++/modules/gcc/support.lua
+++ b/xmake/rules/c++/modules/gcc/support.lua
@@ -311,7 +311,8 @@ function get_cppversionflag(target)
if cppversionflag == nil then
local compinst = target:compiler("cxx")
local flags = compinst:compflags({target = target})
- cppversionflag = table.find_if(flags, function(v) string.startswith(v, "-std=c++") end) or "-std=c++20"
+ local idx = table.find_first_if(flags, function(_, v) return string.startswith(v, "-std=c++") end)
+ cppversionflag = (idx and flags[idx]) or "-std=c++20"
_g.cppversionflag = cppversionflag
end
return cppversionflag or nil
diff --git a/xmake/rules/c++/modules/msvc/support.lua b/xmake/rules/c++/modules/msvc/support.lua
index 1f066de43..588921d0e 100644
--- a/xmake/rules/c++/modules/msvc/support.lua
+++ b/xmake/rules/c++/modules/msvc/support.lua
@@ -261,7 +261,9 @@ function get_cppversionflag(target)
if cppversionflag == nil then
local compinst = target:compiler("cxx")
local flags = compinst:compflags({target = target})
- cppversionflag = table.find_if(flags, function(v) string.startswith(v, "/std:c++") end) or "/std:c++latest"
+ local idx = table.find_first_if(flags, function(_, v) return string.startswith(v, "/std:c++") end)
+ cppversionflag = (idx and flags[idx]) or "/std:c++latest"
+ _g.cppversionflag = cppversionflag
end
return cppversionflag or nil
end
diff --git a/xmake/rules/linker/link_scripts/xmake.lua b/xmake/rules/linker/link_scripts/xmake.lua
index 72411543b..e5fa32bb6 100644
--- a/xmake/rules/linker/link_scripts/xmake.lua
+++ b/xmake/rules/linker/link_scripts/xmake.lua
@@ -24,28 +24,26 @@ rule("linker.link_scripts")
if not target:is_binary() and not target:is_shared() then
return
end
- local scriptfile
local sourcebatch = target:sourcebatches()["linker.link_scripts"]
- if sourcebatch then
- for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
- scriptfile = sourcefile
- break
- end
- end
- if not scriptfile then
+ if not sourcebatch or not sourcebatch.sourcefiles or #sourcebatch.sourcefiles == 0 then
return
end
+
-- @note apple's linker does not support it
if target:is_plat("macosx", "iphoneos", "watchos", "appletvos") then
return
end
- if target:has_tool("ld", "gcc", "gxx", "clang", "clangxx") or
- target:has_tool("sh", "gcc", "gxx", "clang", "clangxx") then
- target:add(target:is_shared() and "shflags" or "ldflags", "-T " .. scriptfile, {force = true})
- target:data_add("linkdepfiles", scriptfile)
- elseif target:has_tool("ld", "ld") or target:has_tool("sh", "ld") then
- target:add(target:is_shared() and "shflags" or "ldflags", "-T " .. scriptfile, {force = true})
- target:data_add("linkdepfiles", scriptfile)
+
+ -- Check for supported linkers (GNU and LLVM linkers support multiple -T flags)
+ if target:has_tool("ld", "gcc", "gxx", "clang", "clangxx", "ld") or
+ target:has_tool("sh", "gcc", "gxx", "clang", "clangxx", "ld") then
+
+ -- Add all linker scripts with -T flag
+ -- https://github.com/xmake-io/xmake/issues/7227
+ for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
+ target:add(target:is_shared() and "shflags" or "ldflags", "-T " .. sourcefile, {force = true})
+ target:data_add("linkdepfiles", sourcefile)
+ end
end
end)