This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 808694a400dfad3402e81896dbef1294321089ca
Author: zhengyu16 <[email protected]>
AuthorDate: Mon Jan 5 11:47:10 2026 +0800

    libarchive: optimize code size
    
    1. add UTILS_LIBARCHIVE_UNICODE_NORMALIZATION
        Enable Unicode NFC/NFD normalization for filename handling.
        Disabling it can reduce the size of about 17K code (under LTO),
        or 29K without LTO.
    2. disable HAVE_LANGINFO, HAVE_ICONV according to CONFIG_LIBC_LOCALE
    
    Signed-off-by: zhengyu16 <[email protected]>
    Signed-off-by: tengshuangshuang <[email protected]>
---
 system/libarchive/Kconfig  | 9 ++++++++-
 system/libarchive/config.h | 6 ++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/system/libarchive/Kconfig b/system/libarchive/Kconfig
index abff7ef1e..004770360 100644
--- a/system/libarchive/Kconfig
+++ b/system/libarchive/Kconfig
@@ -5,11 +5,18 @@
 
 config UTILS_LIBARCHIVE
        tristate "libarchive"
-       depends on LIBC_LOCALE
        default n
 
 if UTILS_LIBARCHIVE
 
+config UTILS_LIBARCHIVE_UNICODE_NORMALIZATION
+       bool "Enable Unicode normalization support"
+       default n
+       ---help---
+               Enable Unicode NFC/NFD normalization for filename handling.
+               This feature is primarily needed for macOS HFS+ filesystem
+               compatibility and cross-platform filename comparison.
+
 config UTILS_LIBARCHIVE_BSDUNZIP
        bool "Enable bsdunzip"
        depends on LIB_ZLIB
diff --git a/system/libarchive/config.h b/system/libarchive/config.h
index 273e3ade0..2664141fe 100644
--- a/system/libarchive/config.h
+++ b/system/libarchive/config.h
@@ -672,10 +672,12 @@ typedef uint64_t uintmax_t;
 #define HAVE_GRP_H 1
 
 /* Define to 1 if you have the `iconv' function. */
+#ifdef CONFIG_LIBC_LOCALE
 #define HAVE_ICONV 1
 
 /* Define to 1 if you have the <iconv.h> header file. */
 #define HAVE_ICONV_H 1
+#endif
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
@@ -684,7 +686,9 @@ typedef uint64_t uintmax_t;
 /* #undef HAVE_IO_H */
 
 /* Define to 1 if you have the <langinfo.h> header file. */
+#ifdef CONFIG_LIBC_LOCALE
 #define HAVE_LANGINFO_H 1
+#endif
 
 /* Define to 1 if you have the `lchflags' function. */
 /* #undef HAVE_LCHFLAGS */
@@ -927,7 +931,9 @@ typedef uint64_t uintmax_t;
 /* #undef HAVE_NETTLE_SHA_H */
 
 /* Define to 1 if you have the `nl_langinfo' function. */
+#ifdef CONFIG_LIBC_LOCALE
 #define HAVE_NL_LANGINFO 1
+#endif
 
 /* Define to 1 if you have the `openat' function. */
 #define HAVE_OPENAT 1

Reply via email to