1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2026-10-24 17:39:18 +03:00
Commit Graph

73 Commits

Author SHA1 Message Date
g-berthiaume
16ed33fa2d Add make2compdb, JSON Compilation Database tool
Closes #251.
2026-09-17 08:17:43 -04:00
Christopher Wellons
5561bfe3ab recycle: Mention in README.md 2026-09-17 08:17:34 -04:00
Peter0x44
f7ba9d67da Merge multilib support into x64 variant 2026-08-30 13:13:16 -04:00
Peter0x44
2e424d7941 Replace variant arguments with build profiles
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.
2026-08-30 13:13:16 -04:00
Peter0x44
83f3251d4a Add x86 multilib toolchain support
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.
2026-08-30 13:13:16 -04:00
Christopher Wellons
a5cc1b2768 Add note about libiconv (#68, #403) 2026-06-20 09:06:41 -04:00
Christopher Wellons
614fe39553 Introduce most of C11 threads
Closes #388.
2026-05-25 20:53:35 -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
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
dacd0812bd Introduce dcmake CMake debugger UI
I wrote this new tool yesterday after reading about "cmake --debugger"
the night before, and it's already been powerful and useful. In the past
this would be a month-long project, but in 2026 it only takes a day.
2026-04-05 22:40:02 -04:00
Christopher Wellons
7b0c1bc38b Update language about optimizing for size
This changed in 1d10baf and I forgot to update README.md.
2026-04-05 22:11:20 -04:00
Christopher Wellons
9fb9b6cef5 Small updates to README.md
Thanks to T.J. Kotha for suggesting the llvm-mingw recommendation.
2026-03-27 09:27:27 -04:00
Peter0x44
ef0ad50bd7 Add GitHub Actions build
Add workflow that builds x64/x86 exes, with Docker caching

Closes #292.
2026-03-15 16:59:21 -04:00
Christopher Wellons
fa8d54d4e5 Break the build into independent stages
By breaking independent parts of the build into stages breaks implied
dependencies between those parts. A tool built later will not require
rebuilding when earlier unrelated tools are changed. That includes
upgrades to require new downloads. Most tools can be upgraded without
requiring unnecessary rebuilds.
2026-03-10 20:54:07 -04:00
Christopher Wellons
d8ee5fc502 Introduce CMake and Ninja
Unlike "standard" CMake, this build defaults to the Ninja generator and
w64dk toolchain without looking for Visual Studio.
2026-03-06 18:11:02 -05:00
Christopher Wellons
c5bb7fbc74 Add ccache to the distribution (#327) 2026-03-02 07:24:12 -05:00
Christopher Wellons
bd88ba2208 Drop note about Go from README.md (#290)
Go (gc toolchain) does not yet support bigobj, and so cgo is currently
incompatible with w64dk. Bootstrapping Go 1.4 from C still works, but
even that's increasingly impractical anyway.
2025-09-24 18:26:03 -04:00
Christopher Wellons
76ffbe9ec9 Reword library installation procedure (fixes #231)
I forgot to update this with 3a38668 (or ff4bb19). The situation has
simplified now that the architecture triple is gone from the sysroot.
2025-06-28 21:45:26 -04:00
Yoshi662
515693903f Update path in README.md
Updated the path in the Usage section in the README.md due to a possible
confusion
2025-05-27 15:46:23 -04:00
Christopher Wellons
17ff96cf81 Update links to C and C++ drafts
These pages are more reliable than the Stack Overflow answer, which
currently cannot be accessed without JavaScript.
2025-05-02 14:21:08 -04:00
Christopher Wellons
36ac343fc3 gcc: Patch misaligned AVX spills (GCC bug 54412)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
2025-02-17 18:45:27 -05:00
Christopher Wellons
62e236cf95 Add operating system support section to README.md 2024-09-19 11:26:50 -04:00
Christopher Wellons
f60a892e13 Add details about MSVCRT and AVX in README.md
UCRT is gradually growing in popularity, and it wasn't obvious from
README.md that w64devkit is a traditional MSVCRT toolchain.

The AVX issue comes up from time to time, just infrequently enough that
I need to rediscover the solution each time. Documentation in README.md
will be easier to find next time, warns those who haven't been bitten
yet, and documents the mitigation offline. Since it is unlikely to be
fixed any time soon, medium term I should figure out a small patch that
makes GCC only emit unaligned AVX moves. The penalty for unaligned moves
is 0% on newer processors and up to 10% on older ones. That's certainly
better than crashing due to a compilier bug.

https://lemire.me/blog/2012/05/31/data-alignment-for-speed-myth-or-reality/
2024-09-06 22:18:30 -04:00
Christopher Wellons
ecc5c65615 Replace .zip with a self-extracting 7-zip (#87)
Cuts the distribution size by around 60%, and unpacks around 100x faster
than Windows built-in .zip support. However, 7-zip is the worst packaged
project included so far. The source release is a tarbomb with a URL that
contains two variations of the release version. It is not designed for
cross-compilation, and so requires minor source corrections and a custom
build script. Still, considering the circumstances, it's surprising how
easily it compiles.
2024-07-29 17:15:26 -04:00
Christopher Wellons
85a52aac4e Enable Fortran compiler in all builds
When I first put w64devkit together, there were incompatibilities with
Binutils and supporting gfortran was difficult. It's been stable for
years, and I want to simplify the download options.
2024-07-29 17:12:31 -04:00
Christopher Wellons
6b6b6449d7 Remove Cppcheck from the distribution
I was initially impressed with its output, but over time I've found it
less and less useful. I hardly use it anymore, and it would at best be
neglected if left in the distribution. The build script is retained in
the contrib/ directory, and it's easy to build natively from source.
2024-07-29 17:12:31 -04:00
Christopher Wellons
ec561dae94 Remove NASM from the distribution
It's proven less useful than I originally hoped, and it's nearly always
better to use the GNU assembler instead. NASM doesn't support DWARF with
COFF, so it cannot be debugged with GDB. It's also ~100x slower than as,
which makes a huge different for generated assembly. With the autotools
fixes, it's now easy to natively build NASM from source using w64dk.
2024-07-29 17:12:31 -04:00
Christopher Wellons
28912083d7 Add note to README about ordinal hints
Reflects changes in 6a19f821. Regarding the compression comment, this
little change shrank the distribution .zip by 0.5%.
2024-06-07 12:10:44 -04:00
Christopher Wellons
77f0afe4fb Add peports to the README, expanding a new section
The new order reflects general usefulness. I'm probably the only user of
debugbreak, even if frequent, so move it to the end of the list.
2024-06-07 11:21:17 -04:00
Christopher Wellons
43bf1e56c9 New runtime library: libchkstk
Provides 32-bit and 64-bit ___chkstk_ms and __chkstk. The former can
replace the libgcc implementation. Better license, about half the size,
and substantially faster when used on a hot path. The purpose and role
is similar to libmemory.
2024-02-02 22:01:33 -05:00
Christopher Wellons
41aff0cf84 Add notes to README.md about vc++filt and libmemory
These new additions had not yet been documented, and are unlikely to be
discovered by chance. I dropped __USE_MINGW_ANSI_STDIO because now that
I've learned more I realized it has no practical use. If one cares about
this issue, one wouldn't use stdio in the first place, especially not
the particularly poor Microsoft stdio.
2024-01-06 14:43:37 -05:00
Christopher Wellons
2b0ae5a7f3 Add note to README.md about PowerShell (#69, #76)
Despite appearances, the ">" operator is actually a pipe to Out-File,
and GetFileType() returns FILE_TYPE_PIPE for that handle. It is not
seekable and does not behave like a file. By default it re-encodes its
input, which is virtually always destructive, unwanted, and surprising.
Regardless of the wording in its documentation, it is not possible to
connect process output to a file, and PowerShell does not support file
redirection.
2023-07-06 13:52:59 -04:00
Christopher Wellons
c0bc4707ab Update README.md note about UBSan for GCC >= 13
The new option name is a lot nicer, so encourage its use! I don't know
if the old option will ever be removed.
2023-05-02 18:24:51 -04:00
Daniel Martín
db1f3f68de Fix 404 Win32 link
The file is available via the Internet Archive, luckily.
2023-02-05 23:04:36 +01:00
Christopher Wellons
16f300cd69 Add a library installation section to the README
Except for the pkg-config part, these already worked. The new pkg-config
command expands and complements the options.
2023-01-27 11:50:01 -05:00
Peter0x44
ded508907b Correct some typos in README.md 2022-10-11 21:14:41 +01:00
Christopher Wellons
6d4549f78a Update README with note about debugbreak 2022-08-05 16:23:49 -04:00
Christopher Wellons
2b9b65319d Introduce w64devkit.ini for configuration 2022-08-05 16:18:11 -04:00
Christopher Wellons
df7da2193e Move "Cppcheck tips" to the bottom of the README 2022-08-04 12:19:28 -04:00
Christopher Wellons
b854d363b9 Add the Cppcheck command line program
Cppcheck is a static analysis tool that's pretty easy to build and
include. Its "addons" are excluded since they depend on Python, as are
the "platforms" configuration since none of them are useful for Windows
applications. The "win32A" and "win32W" platforms are already embedded
within the tool.

It has a "FILESDIR" option to locate its configuration data. Relative
paths are unsupported, and so this feature is useless for a "portable"
Windows application. Fortunately it searches next to the executable, so
it can still find its configuration as long as it resides in the same
directory. These should not be in bin/, so build an alias to redirect
execution into share/.

This is yet another open source project that does not publish a stable
source tarball, so this build is likely to fail in the future when
GitHub changes its tarball layout. The --remote-header-name curl option
tells it to pick up the GitHub-provided name rather than use the request
path. Fortunately this doesn't seem to interfere with other downloads.
2022-08-04 12:14:07 -04:00
Christopher Wellons
b89061ac7e Add note about UBSan availability to README 2022-07-04 10:00:55 -04:00
Christopher Wellons
f08f24108f README.md: Two more documentation links 2021-09-26 17:30:07 -04:00
Christopher Wellons
3b38e752f1 Add README links to various offline documentation 2021-09-26 16:41:49 -04:00
Christopher Wellons
45b1fc5552 Set environment variables W64DEVKIT, W64DEVKIT_HOME 2021-09-25 16:06:50 -04:00
Christopher Wellons
adf9aa7449 Remove activate.bat (replaced by w64devkit.exe) 2021-09-25 14:27:32 -04:00
Christopher Wellons
6b45d148a6 Tweak the README with updated information
The "releases" section needs emphasis since GitHub doesn't give it good
visiblitiy, and lots of people seem to miss it. Also, in the time since
w64devkit came about, Mingw-w64 itself and other distributions have
improved, picking up features once unique to w64devkit. The previous
claims are less strong now.
2021-09-15 22:53:43 -04:00
Christopher Wellons
f611616f61 Use --with-pic and restore Fortran README note
Fixes #12.
2021-09-15 21:35:36 -04:00
Christopher Wellons
2c0d69b22b Remove Fortran information from the README
Even GCC 11 GFortran remains incompatible with Binutils 2.36.1. Since
this is unlike to be fixed anytime soon, just drop Fortran support.
2021-04-27 16:40:33 -04:00
Christopher Wellons
626212f1b5 Introduce a new standalone launcher
This launcher doesn't depend on cmd.exe, which eliminates another
annoyance. Credit for the icon goes to Kelsey Wellons.
2021-02-28 20:04:39 -05:00
Christopher Wellons
ada316516c README.md updates and tweaks
Mingw-w64 v8.0.0 finally puts to rest the long-standing and irritating
issues with __USE_MINGW_ANSI_STDIO. As other distributions update they
will be on par with w64devkit on this point.

Msys2 supports optional static linking, and it does this well (though
optimized for speed, not size).
2021-02-11 14:56:59 -05:00