1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2026-10-23 06:08:56 +03:00
Commit Graph

518 Commits

Author SHA1 Message Date
Christopher Wellons
8b00eb6100 Add .ash_profile support to ash
Ash shares ~/.profile with every other POSIX-ish shell on the machine,
so there is no place for login-time configuration that only ash should
see. Give it the escape hatch bash has: try ~/.ash_profile first and
fall back to ~/.profile only when it does not exist, matching bash's
.bash_profile chain.

read_profile already distinguishes "opened" from "missing" through
setinputfile with INPUT_NOFILE_OK, but discards it. Return that instead
of void; the two other call sites keep ignoring the result.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-30 12:51:24 -04:00
Christopher Wellons
90c83d12a6 Swap GNU downloads to a mirror
The main GNU site has been down for a few days.
2026-08-28 06:52:43 -04:00
Christopher Wellons
700c0611fc Fetch sources with ADD --checksum instead of curl
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>
2026-08-27 22:46:07 -04:00
Christopher Wellons
9aec47017c Add a .dockerignore
The build context was the whole working tree, including source/ (227MB
of release tarballs), release artifacts, and .git. BuildKit only sends
files matched by a COPY, so little of this was transferred, but it was
still walked and hashed on every build, and a COPY with a broad pattern
would silently pull in the lot.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-27 22:32:17 -04:00
Christopher Wellons
c17ba6fb19 Fetch busybox-w32 from GitHub instead of frippery.org
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>
2026-08-27 21:11:48 -04:00
Christopher Wellons
58ad9865a5 Self-locate GCC driver so the toolchain works without PATH
The driver trusted argv[0], which requires a PATH search when it lacks
a directory component, as with w64devkit command aliases. Instead ask
Win32 for the true module path. Also search the driver's own directory
for subprograms, because as and ld live in bin/ rather than a tooldir.
Invoked by absolute path, the toolchain no longer needs its bin/ in
PATH, and remains relocatable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-27 20:59:35 -04:00
Christopher Wellons
af35517988 Upgrade to ccache 4.14
- 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.
2026-08-23 15:29:42 -04:00
Peter0x44
8611d4d242 Fixes for ccache output on Windows consoles
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.

Fixes skeeto/w64devkit#413.
2026-08-16 15:32:43 -05:00
Christopher Wellons
1f5f751172 Upgrade to Expat 2.8.3
Security release fixing CVE-2026-72522.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 14:30:33 -04:00
Christopher Wellons
3c04ff709b Move trap terminate handler out of vterminate.cc
Defining __trap_terminate_handler in vterminate.cc places it in the
same archive member as the verbose terminate handler, so the default
terminate handler dragged __cxa_demangle, __mingw_sprintf, and gdtoa
into every program that can throw, despite --disable-libstdcxx-verbose.
Define it in eh_term_handler.cc instead, alongside the initializer that
references it, so vterminate.o stays out of default links. A trivial
C++ program shrinks from 190K to 104K.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 18:24:58 -04:00
Christopher Wellons
d0d13ce550 Drop arch-prefixed elfedit and readelf aliases
The actual tools are not included and these aliases point at nothing.
Plucked from #412.
2026-08-11 18:56:58 -04:00
Christopher Wellons
6082530e86 Bump to 2.9.1 v2.9.1 2026-08-09 20:04:42 -04:00
Christopher Wellons
9d32fc517a Swap libgomp patch from CRLF to LF
The upstream source is LF so there is no reason for this to be CRLF.
2026-08-07 14:09:05 -04:00
Christopher Wellons
5a10dca37f Upgrade to GCC 16.2.0
All seven gcc-*/crossgcc-* patches still apply, with line offsets only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 13:09:08 -04:00
Christopher Wellons
27c2e0de7a Add a .gitignore
This ignores the output of multibuild.sh and a copy of the source/
directory extracted from the "source" Docker target, which I typically
keep on hand.
2026-08-02 19:57:31 -04:00
Christopher Wellons
a2884c316a Upgrade to CMake 4.4.2
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>
2026-08-02 19:33:04 -04:00
Christopher Wellons
f53bfd0308 binutils: number windmc messages per facility
Message ids for .mc files that use a relative MessageId across a change
of Facility will change. See the patch for details.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-02 19:28:51 -04:00
Christopher Wellons
398961a84f binutils: carry windmc severity, facility forward
Fixes #409, closes #410.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-02 19:28:51 -04:00
Christopher Wellons
819813aec6 binutils: patch windmc to accept BOM (#408) 2026-08-01 14:52:56 -04:00
Christopher Wellons
1233cbea80 Upgrade to CMake 4.4.1
> The FindPython, FindPython3 modules learned to manage, on Windows
> systems, the pydebug ABI flag.
2026-07-29 09:58:11 -04:00
Peter0x44
e11fe5b843 ci: tolerate cache export failures
Sometimes, github actions cache is flaky and fails to export the cache.
Add ignore-error=true so a failing cache upload doesn't fail the CI run
and send a noisy email.
2026-07-27 12:47:52 -05:00
Christopher Wellons
c1a00cccd0 Bump to 2.9.0 v2.9.0 2026-07-26 22:34:55 -04:00
Christopher Wellons
c05722d917 Drop libbacktrace COFF hack after bigobj changes 2026-07-26 21:12:46 -04:00
Peter0x44
e1c35823b2 Remove llama.mak
Upstream has made some choices that make maintaining llama.mak
increasingly impractical. It's not really needed now that w64devkit has
cmake anyway.
2026-07-26 20:09:20 -05:00
Peter0x44
d37cd99adc Drop patches Binutils 2.47 obsoleted
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.
2026-07-26 20:02:44 -05:00
Christopher Wellons
f0cdd55068 Upgrade to Binutils 2.47
https://lists.gnu.org/archive/html/info-gnu/2026-07/msg00006.html
2026-07-26 20:28:57 -04:00
Christopher Wellons
adadb3e9f5 Upgrade to CMake 4.4.0
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.
2026-07-21 09:09:14 -04:00
Christopher Wellons
9a11bb6f53 crt: __MINGW_IMP_SYMBOL for _strtof_l and _wcstof_l
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.
2026-07-10 20:24:08 -04:00
Christopher Wellons
9aff35afb5 Upgrade to Expat 2.8.2
Security release fixing 13 vulnerabilities.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-06 15:08:42 -04:00
Peter0x44
96db5be315 contrib: bump final go version in bootstrap-go-toolchain 2026-06-21 23:27:01 -04:00
Christopher Wellons
a5cc1b2768 Add note about libiconv (#68, #403) 2026-06-20 09:06:41 -04:00
Christopher Wellons
402c2c06eb Upgrade to Binutils 2.46.1 2026-06-08 21:53:09 -04:00
Peter0x44
995d9c68dc fortran libgomp fix patch
Teach libgomp's GFORTRAN probe to accept a target compiler name found
via PATH during the final canadian-cross build.

The configure test only used test -x on the first word of GFORTRAN,
which fails when it is passed as x86_64-w64-mingw32-gfortran plus flags.
Checking command -v in both configure.ac and the generated configure
script keeps FC enabled so libgomp installs the Fortran OpenMP/OpenACC
modules again.
2026-05-28 01:58:23 -04:00
Christopher Wellons
614fe39553 Introduce most of C11 threads
Closes #388.
2026-05-25 20:53:35 -04:00
Christopher Wellons
3dc8d3da44 gcc: Remove -fdeclone-ctor-dtor from -O[sz]
With -fdeclone-ctor-dtor codegen emits a call-site reference for a
std::basic_string ctor that no callee under any configuration emits.
This bug first appeared in GCC 16.
2026-05-25 20:11:08 -04:00
Christopher Wellons
c70b87233c Upgrade to CMake 4.3.3 2026-05-25 09:19:12 -04:00
Christopher Wellons
c55e415d2b gcc: Patch undefined handle_contract_violation #393
libstdc++exp.a's default handle_contract_violation is marked weak so
users can supply their own. PE-COFF __attribute__((weak)) does not act
as an ELF-style fallback definition; it makes the symbol an alias for
some other (strong) definition. With no such definition the default
never resolves and -fcontracts -lstdc++exp fails to link.

Drop the weak attribute so the default is an ordinary strong symbol.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124263
2026-05-25 08:42:28 -04:00
Christopher Wellons
a208bcb70c Include aas-sign source in source.tar
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>
2026-05-19 19:03:08 -04:00
Peter0x44
e98c5305bb llama.mak: update for new llama.cpp webui changes
Unfortunately, the llama.cpp webui now requires node to build (or to
download already-built files from huggingface. I implemented effectively
the same strategy already used in CMake. This complicates the Makefile
considerably, but it's the best way to make it work.

If node is installed, then it will build the llama.cpp webui. If it is
not, it will download the required files from huggingface using wget.

Fixes #387
2026-05-16 19:39:56 -04:00
Christopher Wellons
4c1c3bccab Upgrade to Expat 2.8.1 2026-05-16 13:46:38 -04:00
Christopher Wellons
ef29c3cbfa Upgrade to GDB 17.2
https://lists.gnu.org/archive/html/info-gnu/2026-05/msg00003.html
2026-05-16 13:46:38 -04:00
Peter0x44
4f06aaaa69 contrib: make bootstrap-go-toolchain work on Linux 2026-05-16 08:58:41 -04:00
Christopher Wellons
91f970d632 ci: fix non-release version stripping; gate source.tar on tags
Two issues with non-release builds:

* git describe --always falls back to a commit SHA (e.g. abc123) on
  branches without a recent tag. The old ${GIT_VERSION:1} stripped
  the first character unconditionally -- fine for v2.8.0 -> 2.8.0,
  but produced bc123 from a SHA. Use ${GIT_VERSION#v} instead so the
  v is removed only when present.

* source.tar is a release artifact, not a CI artifact -- the source
  Docker target build, the tar extraction, and the artifact upload
  were running on every push. Gate the three steps on
  startsWith(github.ref, 'refs/tags/') so non-release builds skip
  them entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 08:50:45 -04:00
Peter0x44
8e557fe369 contrib: Add bootstrap-go-toolchain.sh
Ever since w64devkit began forcing bigobj by default, it has been
incompatible with cgo. I patched go to support bigobj, but unfortunately
upstream the patch ran in to bureaucracy/difficulties and I ran out of
patience to get it through. So that means it's not really an option to
use upstream go binaries, it must build from source. Bootstrapping go is
not difficult, but it has grown more tedious as more required stages
have been added to the bootstrap chain.

So, to spare myself some tedium, I have created
bootstrap-go-toolchain.sh. It builds the latest version of go, from
source, using only w64devkit's gcc compiler. It also adds my bigobj
patches to the toolchain, so cgo works properly.
2026-05-10 03:05:13 +01:00
Christopher Wellons
c791bc9e02 nsis: Nudge options around to fix x86 patch
Some patch programs, including busybox-w32, won't apply the patch
otherwise.
2026-05-09 00:44:12 -04:00
Christopher Wellons
6c3bc7d550 Cross-compile aas-sign.exe for the toolchain
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>
2026-05-08 22:56:33 -04:00
Christopher Wellons
7523c6755b busybox: Swap x86 to mingw32w_defconfig (#315) 2026-05-08 22:45:45 -04:00
Christopher Wellons
75ee239be7 Add NSIS 3.12 (makensis only)
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>
2026-05-08 22:44:05 -04:00
Christopher Wellons
74bdb3a1d5 busybox: disable bash applet and bash.exe alias
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>
2026-05-08 10:31:16 -04:00
Christopher Wellons
ba3f4a86ef Upgrade to ccache 4.13.6
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 13:48:36 -04:00