"crossgcc" names a property both GCC builds share: /x-gcc is a plain
cross build and /gcc is a Canadian cross, so "cross" does not tell them
apart, and it points at the bootstrap compiler, which is the one queue
it does not apply to.
What separates the queues is reach. Both push onto the same tree, which
is never popped: src/gcc goes on before the bootstrap compiler and is
still applied when the shipped compiler configures, so it reaches both.
The second queue goes on top afterward and reaches only the compiler
that ships. Name it for that.
As a bonus the directories now sort in push order; crossgcc sorted
before gcc while being applied after it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Per the upstream release notes, the only documented change is that Swift
policy CMP0215's NEW behavior now also requires CMP0157 and CMP0195 to
be set to NEW. force-ninja.patch still applies.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Move each component's patches from flat, prefixed file names into a
per-component directory with a quilt series file, dropping the number
prefixes: application order is now stated by series rather than
enforced by lexicographic glob expansion. Outside the build, a queue
is managed by our own quilt against an unpacked tarball from source/
with QUILT_PATCHES=/path/to/src/<component>. The shipped kit carries
the same layout under $W64DEVKIT_HOME/src, consumable by the bundled
quilt.exe the same way.
Inside the build, apply queues with Debian's original quilt rather
than a native build of src/quilt.cpp, whose amalgamation is
Windows-only. This keeps battle-tested GNU patch as the engine, and
makes every image build a conformance check: series semantics mean
whatever the reference implementation says, and a queue our clone
manages must be accepted by original quilt. The .pc state is removed
after each push because source trees are never popped, and a stale
.pc from one queue blocks pushing a second queue onto the same tree,
which happens twice: gcc then crossgcc, mingw then gendef.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
makensis is retargetable: the architecture of the installers it emits
is decided by which precompiled stub it attaches, stubs and plugins
are stored under target-suffixed names, and a script selects one with
"Target x86-unicode" (or CPU x86). Its default remains amd64, chosen
by the bitness of makensis itself. Add a second stub-and-plugin pass
so the multilib kit can emit 32-bit installers, which remain the
traditional choice even for 64-bit payloads since they run on every
Windows and can fail politely on 32-bit hosts.
The NSIS build derives each tool from XGCC_W32_PREFIX and never adds
-m32 on its own, so present the multilib compiler through an i686
interface: wrapper scripts that forward with -m32, --32, and
--target=pe-i386, mirroring the aliases the kit itself ships. The
x86-ansi extras come along unconditionally, matching the standalone
x86 kit's layout.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CMAKE_C_FLAGS and CMAKE_CXX_FLAGS are real CMake variable names, and
profile values sit in the environment of every RUN, including the other
cmake invocations that do not pass these flags explicitly. CMake does
not read them from the environment today, but it honors a growing list
of CMAKE_* environment variables, so real names are a latent hazard.
Rename them and document the naming discipline alongside the profiles,
which also covers why CRT_LIB32/CRT_LIB64 avoid their obvious names.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Use the selected VARIANT directly for multilib-only control flow rather
than maintaining a separate EXTRA_32 boolean. Redeclare the global build
argument in the selected cross stage so each conditional can state the
actual profile requirement explicitly.
Represent GCC multilib and mingw-w64 CRT selections as enable or disable
state instead of storing complete configure options. Form the GCC and CRT
arguments at their call sites, which keeps punctuation out of the profile
data and makes the three configurations easier to compare.
Remove the standalone x86 WINNT_FLAGS override. The
mingw-default-win32-winnt patch already substitutes Windows XP for every
__i386__ compilation, so passing the same header default through configure
was redundant. Keep the separate Windows 7 CMake flags because CMake and
its bundled curl cannot build against the XP target.
Rename the remaining values that intentionally contain complete command
arguments to GCC_ARCH_FLAG, GCC_MANIFEST_FLAG, and ZSTD_THREAD_FLAG. The
component scope and representation are now visible in each name.
Verify the resulting x64, x86, and multilib Dockerfiles with build checks
and complete cross-toolchain builds. Confirm that only the multilib profile
executes the secondary 32-bit runtime and alias blocks and that each GCC and
CRT configure command receives the expected enable or disable options.
Replace the loosely coordinated collection of x86 build arguments with
a single VARIANT selector. Define x64, x86, and multilib configuration
stages, then select the requested stage as the common cross-compiler
base. This keeps each supported configuration closed and prevents
callers from combining incompatible architecture settings.
Make x64 the default standalone profile. It targets
x86_64-w64-mingw32, disables GCC multilib support, builds only the
64-bit CRT, and omits the secondary 32-bit libraries and aliases.
Keep the standalone x86 behavior in its own profile. It targets
i686-w64-mingw32, retains the Pentium 4 default, enables only the
32-bit CRT, preserves the Windows XP header default and manifest
behavior, selects the 32-bit BusyBox and NSIS configurations, disables
zstd threading, and raises _WIN32_WINNT only while building CMake.
CMake and its bundled curl require at least Windows Vista APIs, so the
C and C++ flags continue to target Windows 7 without changing the
XP-oriented default of the installed toolchain.
Define multilib as an x86_64 compiler with GCC multilib enabled, both
CRT library sets installed, and the existing i686 forwarding aliases.
Use a dedicated EXTRA_32 setting for the secondary lib32 libraries,
winpthreads builds, thread support object, and aliases instead of
inferring that work from the spelling of a GCC configure option.
Expose independent CRT_LIB32 and CRT_LIB64 settings so each profile
selects exactly the runtime libraries it needs.
Pass the profile's CMake C and C++ flags directly rather than building
an optional argument list through shell positional parameters. Keep all
other profile-specific values next to the selected base stage, including
GCC architecture and manifest flags, BusyBox configuration, zstd
options, and NSIS target architecture.
Simplify multibuild.sh to pass only VARIANT to Docker. Add -m for the
multilib flavor, make -a build all three profiles, and remove the old
argument-file and Dockerfile-patch fallback paths. Update unsigned and
signed CI builds to select x64 or x86 directly, remove the obsolete
variant-x86.args bundle, and document the new build interface.
Verify all three profiles with docker build --check and complete cross
toolchain builds. Smoke-test x64 and x86 compilation, plus both the
64-bit compiler and i686 alias in the multilib profile. Also build the
x64 and x86 CMake targets to exercise both the empty and Windows 7
CMake flag configurations.
Hoist every variant-sensitive value into an ARG at the top of the cross
stage, with defaults producing the x64 kit, and gate the multilib-only
sidecar builds on MULTILIB. The x86 variant becomes a set of NAME=value
overrides in src/variant-x86.args, which multibuild.sh turns into
--build-arg options. A plain "docker build" continues to work untouched,
downloads stay shared between variants, and the patch mechanism remains
available as a fallback for a future variant needing structural changes.
One hazard of this approach: ARGs leak into the environment of every
subsequent RUN in the stage, and configure scripts read arbitrary
environment variables. mingw-w64-crt decides whether to build the Win64
runtime by testing whether a shell variable named LIB64 is merely set,
so an ARG of that name forced lib64 on past an explicit --disable-lib64.
Hence CRT_LIB64. Keep ARG names clear of names configure might consult.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Keep x86_64 as the default output while enabling the GCC and mingw-w64
32-bit multilib under lib32. Build 32-bit support archives, CRT
libraries, and winpthreads for both the bootstrap and final sysroots so
each compiler stage has a complete i686 runtime.
Use pentium4 as the 32-bit architecture baseline. Add a GCC specs rule
that defaults _WIN32_WINNT to 0x0501 only under -m32 and only when the
caller has not supplied a value, preserving the existing x64 default and
explicit overrides.
Retain the x86_64-w64-mingw32-prefixed tools and add a separate build
step for an i686-w64-mingw32 interface. Compiler drivers inject -m32.
Target-sensitive binutils select their 32-bit modes explicitly: as uses
--32, ld uses -m i386pe, dlltool uses -m i386 with --as-flags=--32, and
windres uses --target=pe-i386. Input-driven inspection and archive tools
forward without a target override.
These forwarding executables provide both prefixed interfaces without
duplicating a second binutils installation. They deliberately remain
selectors for the underlying x86_64-configured multilib compiler rather
than spoofing its configured target identity.
Direct, Autoconf, CMake, and Libtool probes using the i686-prefixed
interface all produced PE-i386 output.
BuildKit keys ADD --checksum on the checksum and the URL basename, not
on the host, so re-pointing a download at another mirror is a cache hit
and does not even resolve the host. Swapping mirrors during an ftp.gnu.org
outage no longer costs a re-download of everything, which is the trap
that made the recent debian:trixie-slim digest bump so expensive.
Stages that fetched several tarballs in one curl now get one ADD each,
so a mirror change re-fetches a single file rather than all of dl-cross.
Names come from ADD's dest where the URL basename differs, replacing
curl --remote-header-name. This matters beyond cosmetics: every stage's
/dl/*.* is copied into /source/, so these names ship in the source
distribution. GitHub archive refs are the four affected downloads.
ADD cannot run a shell, so expat's tag gains an EXPAT_TAG arg rather
than deriving it from EXPAT_VERSION with tr.
Drops curl from base. BuildKit verifies TLS with its own trust store,
so the downloads are now authenticated rather than passing --insecure.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The archives are identical except for .frp_describe, which is gitignored
and absent from GitHub archives. Without it the Makefile finds neither a
git checkout nor a source directory named after the tag, and the version
degrades from 1.38.0.git-6075-g169694ebd to 1.38.0.git. Recreate the
file after extraction.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
- Windows path rewriting is now case-insensitive and Unicode-aware, and
ignore_headers_in_manifest matches case-insensitively on Windows.
- Detects C23 #embed directives and assembler .incbin directives,
preventing false cache hits.
- Removed the cpp_extension (CCACHE_EXTENSION) option; preprocessor
output is now processed in memory instead of via temporary files.
- Fixed a size overflow when allocating very large files on Windows.
Both Windows console output patches were regenerated against 4.14.
Ccache captures compiler diagnostics and writes them to the terminal
itself. Its Unix-style isatty and TERM checks do not reliably describe
Win32 console capabilities, and its byte-oriented output path cannot
preserve Unicode outside the active code page.
The color bug can be reproduced in a legacy console without virtual
terminal processing:
printf 'int main(void) { return undeclared; }\n' > error.c
TERM=cygwin ccache gcc -c error.c
The diagnostic contains literal escape sequences such as ?[01m?[K
instead of colored text.
The Unicode bug can be reproduced with a non-ASCII identifier:
printf 'float π(void) { return 3; }\nvoid f(void) { float unused = π(); }\n' > unicode.c
ccache gcc -Wall -Wextra -c unicode.c
ccache gcc -Wall -Wextra -c unicode.c
The source line emitted by ccache renders π as mojibake on both captured
and cached diagnostic output.
Add two ccache patches. The first detects native console handles with
GetConsoleMode, enables virtual terminal processing when available, and
otherwise translates supported SGR and erase-line sequences with Win32
console APIs. Redirected output remains unchanged.
The second decodes valid UTF-8 and writes non-ASCII text to native
consoles with WriteConsoleW. ASCII, invalid UTF-8, and redirected output
retain the existing byte-oriented path.
Apply both patches when building ccache.
Fixesskeeto/w64devkit#413.
Per the upstream release notes: "This version made no changes to
documented features or interfaces. Some implementation updates were
made to support ecosystem changes and/or fix regressions."
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Binutils 2.47 includes several fixes for PE-COFF weak external fixes
from 2e2848327d8f, afec39e439ea, and 65043894aaac. The last of these
fixes GCC PR124263 so gcc-contract-violation-handler is no longer
needed.
It also includes 18ca02157d9c, which automatically promotes oversized
PE-COFF objects to BigObj. The limit was also increased to the safe
limit for regular COFF in d9d09c878e56.
The debugger breakpoint path normalization fix landed upstream (as
cmSystemTools::ToNormalizedPathOnDisk), so drop the local patch.
cmake-force-ninja.patch is still needed.
CMake 4.4.0 bundles curl 8.20.0, whose curl_setup.h now hard-errors
if _WIN32_WINNT < 0x0600. CMake's bundled copy explicitly disables
curl's CURL_TARGET_WINDOWS_VERSION option (wrapped in "if(0) XXX
not needed for build within cmake"), so the flag has to reach C
compilation directly. Add CMAKE_C_FLAGS matching the existing
CMAKE_CXX_FLAGS override.
These functions are static emulations present in every libmsvcr*.a,
but the headers declare them dllimport (_CRTIMP), so callers reference
__imp__strtof_l and __imp__wcstof_l, which nothing defines, and the
link fails. Define fake import pointers alongside the definitions, as
already done for other statically-emulated functions such as
__acrt_iob_func and _initialize_onexit_table.
The _strtof_l half was merged upstream after v14.0.0 as 373c7dd0
("crt: Add missing __MINGW_IMP_SYMBOL for _strtof_l()"). The
_wcstof_l half is the same fix for the wide variant, which remains
broken upstream.
dl-aas-sign was added but never added to the source-collection
stage, so the aas-sign source tarball was missing from the published
source.tar release artifact even though we now ship aas-sign.exe.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds aas-sign as a Windows binary in $PREFIX/bin/ so users can sign
their own PE outputs with Azure Trusted Signing from inside the
toolchain. Same source as build-aas-sign (the Linux helper used at
release time); on Windows aas-sign's CMakeLists uses WinHTTP + BCrypt
instead of mbedtls, so the build is self-contained.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a CLI-only NSIS install for compiling .nsi scripts. Skips the
GUI wizards (makensisw, the NSIS installer creator) and documentation.
Path-resolution problem: makensis at $PREFIX/bin/makensis.exe would
auto-detect NSISDIR=$PREFIX (parent dir of bin), so NSIS would look
for $PREFIX/{Include,Stubs,Plugins,...} -- collides with w64devkit's
own $PREFIX/include on Windows's case-insensitive filesystem. Solve
by installing the real makensis under $PREFIX/share/nsis/bin/, where
auto-detection lands correctly on $PREFIX/share/nsis. A small alias
EXE at $PREFIX/bin/makensis.exe (built from the existing alias.c)
exec's it. Fully relocatable, no env vars.
New stages: dl-nsis, build-nsis. SCons + python3 only inside
build-nsis (not base) to avoid cache invalidation. TARGET_ARCH
derived from $ARCH at build time so the same Dockerfile works for
x64 and x86 -- no variant-x86.patch hunk needed.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The busybox-w32 mingw64u_defconfig sets CONFIG_BASH_IS_ASH=y so the
ash shell is also installed under the name "bash". That collides
with any real bash on PATH (e.g. Git for Windows). Flip the Kconfig
"choice" to BASH_IS_NONE and drop bash from the alias list. The shell
is still available as ash and as sh.
CONFIG_ASH_BASH_COMPAT etc. (bash-style features inside ash) are
unrelated and remain enabled.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
quilt is the only C++20 source in the project and pulls in libstdc++
headers, so its compile takes much longer than the other ~10 -nostdlib
C utilities built inline in `final`. Splitting it out lets BuildKit
cache it independently -- it's now only rebuilt when src/quilt.cpp
itself changes, rather than on every final-stage cache miss.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop busybox-005-disable-utf8-check.patch, now handled upstream.
Add a join.exe alias for the new join applet.
busybox-w32 gained crond and crontab applets, but I have decided to
disable them. It also gained a uuidgen applet, but we already have a
more complete, more appropriate implementation.
https://frippery.org/busybox/release-notes/FRP-6075.html