Skip to content

Commit 3cacd96

Browse files
committed
busybox-w32: Enable UTF-8 in 64-bit builds
The x86 build supports Windows XP, but the x64 build supports no earlier than Windows 7 (my personal favorite). Windows XP outright rejects EXEs with a UTF-8 manifest, but Windows 7 simply ignores it. That permits GCC to continue operating on Windows 7 with a UTF-8 manifest (as of GCC 13), which must be disabled entirely in x86 builds for Windows XP. The same can be done with busybox-w32 by disabling the UTF-8 check and gracefully degrading to original "ANSI-only" behavior when the manifest is ignored.
1 parent f60a892 commit 3cacd96

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ RUN /make-$MAKE_VERSION/configure \
382382
WORKDIR /busybox-w32
383383
COPY src/busybox-* $PREFIX/src/
384384
RUN cat $PREFIX/src/busybox-*.patch | patch -p1 \
385-
&& make mingw64_defconfig \
385+
&& make mingw64u_defconfig \
386386
&& sed -ri 's/^(CONFIG_AR)=y/\1=n/' .config \
387387
&& sed -ri 's/^(CONFIG_ASCII)=y/\1=n/' .config \
388388
&& sed -ri 's/^(CONFIG_DPKG\w*)=y/\1=n/' .config \
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Allow it to run without UTF-8 support, such as on Windows 7.
2+
--- a/libbb/appletlib.c
3+
+++ b/libbb/appletlib.c
4+
@@ -1331,3 +1331,3 @@
5+
#if ENABLE_PLATFORM_MINGW32
6+
-# if ENABLE_FEATURE_UTF8_MANIFEST
7+
+# if ENABLE_FEATURE_UTF8_MANIFEST && 0
8+
if (GetACP() != CP_UTF8) {

src/variant-x86.patch

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@
3939
--disable-win32-registry \
4040
+ --disable-win32-utf8-manifest \
4141
--enable-mingw-wildcard \
42+
@@ -384,3 +389,3 @@
43+
RUN cat $PREFIX/src/busybox-*.patch | patch -p1 \
44+
- && make mingw64u_defconfig \
45+
+ && make mingw64_defconfig \
46+
&& sed -ri 's/^(CONFIG_AR)=y/\1=n/' .config \

0 commit comments

Comments
 (0)