1
0
mirror of https://github.com/skeeto/w64devkit.git synced 2025-08-06 11:42:39 +03:00
Commit Graph

191 Commits

Author SHA1 Message Date
Christopher Wellons
80bc198205 Run busybox-w32 in UTF-8 code page on Windows 10+
This allows busybox-w32 to handle wide paths, even including tab
completion. However, it currently does not permit wide character
console inputs (no alt codes).
2022-11-13 22:07:36 -05:00
Christopher Wellons
30c739277b Use configure option instead of hacking config.gcc
This option isn't listed in the root configure script, so I didn't know
it existed until now.
2022-11-08 22:56:41 -05:00
Christopher Wellons
c5c9f6d259 Bump to 1.17.0 v1.17.0 2022-11-02 21:03:52 -04:00
Christopher Wellons
20f1d620b1 Use cross-toolchain ar to when building PDCurses
The native ar is not necessarily compatible with Mingw-w64, particularly
aarch64-linux-gnu-ar when compiling w64devkit from a Raspberry Pi.
2022-11-02 21:03:52 -04:00
Christopher Wellons
32e2f8bdd0 Refresh the variant patches 2022-11-02 08:26:05 -04:00
Christopher Wellons
5f3d7b8485 Enable GDB TUI support via PDCurses
This introduces yet another dependency, but it's a substantial gain for
a small cost.

GDB lacks "--with-libcurses-prefix" so I had to manually list the path
in LDFLAGS. Otherwise the GDB configure script fails to find waddstr and
gives up even though actually linking gdb.exe works fine without it.

The capitalized file name for PDCurses introduces a small sorting issue
in SHA256SUMS. Lexicographic collation with PDCurses at the top? A more
natural collation with PDCurses in the middle? I generate the listing
via "sha256sum *" in Bash, and in my locale Bash uses the latter, so
that's what I'll use.
2022-11-01 10:46:35 -04:00
Christopher Wellons
34945ffe86 Upgrade to GDB 11.2
For w64devkit, nothing significant relative to GDB 11.1.
2022-11-01 08:43:51 -04:00
Christopher Wellons
1000d8e9c0 Upgrade to GNU Make 4.4 2022-10-31 23:54:30 -04:00
Christopher Wellons
fa0c76ef09 Upgrade to Expat 2.5.0
Fixes CVE-2022-43680, though GDB's use of Expat is not vulnerable in the
first place.
2022-10-30 19:42:54 -04:00
Peter0x44
ded508907b Correct some typos in README.md 2022-10-11 21:14:41 +01:00
Christopher Wellons
c6ae174900 Delete useless Binutils programs
Obviously elfedit and readelf are not useful on Windows. GProf has not
worked on Windows since Binutils 2.36 because it doesn't support PIE. It
was never effective in the first place, so it probably wasn't ever worth
including.
2022-10-01 15:20:48 -04:00
Christopher Wellons
0b63b1c90b Support absolute paths in alias.c 2022-09-27 18:08:51 -04:00
Christopher Wellons
7950ba3122 Change the way "freestanding" binaries are built
In the future I plan to call these "CRT-free" rather than "freestanding"
since it is more accurate. This approach has been trial-and-error due to
its unusual nature, the lack of convention, non-existing documentation,
and poor implicit defaults in the GNU toolchain. After spending time
navigating the problem space and discovering its pitfalls, I understand
much better how to construct these binaries. The changes at a high level
and their reasoning:

Avoid -ffreestanding since this is not really its purpose. It may still
be necessary to use -fno-builtin to prevent certain CRT calls.

Replace -fno-ident with -Wl,--gc-sections. It accomplishes the same and
much more. Even better, it is only needed at link time.

Do not qualify mainCRTStartup with WINAPI. By default, the GNU linker
looks for this symbol as the entry point. Not finding one, it silently
chooses the beginning of the .text section as the entry point. Marked
WINAPI, it gets __stdcall-decorated on i686 and is no longer recognized
by the linker. In the past I have been lucky that "main" happened to be
the first function in .text, so this worked out. This is incompatible
with the MSVC toolchain (an oversight in MinGW / Mingw-w64) since it is
explicitly documented that the entry point uses __stdcall. Since there
are no arguments, __stdcall and __cdecl happen to be identical, which is
why nobody notices.

Alternatively I could use -Wl,--entry= to choose an entry point, which
at least produces a warning when the symbol is not found. However, this
accepts the decorated symbol name, and so the exact invocation depends
on the target: i686 or x86-64. Rather inconvenient. The implicit search
for mainCRTStartup resolves this automatically, except when __stdcall is
involved, per above.

If using more than two pages of local variables in any function, you
must disable the stack probe with -mno-stack-arg-probe because the probe
is provided by the CRT. Normally the stack grows with use, and the probe
handles large stack frames that may jump the guard page. Instead commit
a larger stack at startup: "-Xlinker --stack=Z,Z" where Z is the desired
size, e.g. use 0x100000 to commit a 1MiB stack.
2022-09-27 17:46:38 -04:00
Christopher Wellons
ec1dde6f89 Upgrade to Expat 2.4.9
Various bug fixes, particularly for Windows. Also fixes CVE-2022-40674,
though GDB's use of Expat is not vulnerable in the first place.
2022-09-23 10:39:47 -04:00
Christopher Wellons
619ee80a6d cppcheck.mak: use explicit .exe extension in target 2022-09-11 19:02:58 -04:00
Christopher Wellons
644e2cdde9 Add a Cppcheck makefile for parallel building
The one-shot command works, but only use a single core. This build
benefits significantly from parallelization, and make is the easiest way
to do it. Since the original Cppcheck makefile doesn't do the right
thing, supply a custom build.
2022-09-11 12:02:35 -04:00
Christopher Wellons
5a16f373da Silence GDB output by default 2022-09-07 23:18:02 -04:00
Christopher Wellons
6fff86fc4b Default GCC debug format to DWARF 4
Even the latest GDB release does not correctly support DWARF 5 from GCC,
most notably preprocessor macros. This is a bug in either GCC or GDB and
is present across every platform tested. DWARF 4 works fine, so stick to
it for now.
2022-09-07 22:57:52 -04:00
Christopher Wellons
2557f8c9f8 Upgrade to GDB 11.1
GDB 11.1 introduced a new dependency on GMP, so the build from now on is
slightly changed and larger.
2022-09-07 22:57:52 -04:00
Christopher Wellons
4215d98eb2 Bump to 1.16.1 v1.16.1 2022-09-05 14:08:03 -04:00
Christopher Wellons
c940f7b282 busybox: Backport patch to fix $HOME completion 2022-09-05 12:17:35 -04:00
Christopher Wellons
2be62a2f28 Update to GCC 12.2.0 2022-08-19 09:17:00 -04:00
Christopher Wellons
7131dccdcb Set WIN32_LEAN_AND_MEAN in alias.c
This program is compiled many times, and 99% of the build time is GCC
parsing windows.h repeatedly. This macro trims the header and cuts the
build time almost in half, which will improve the overall w64devkit
build time.
2022-08-16 12:50:33 -04:00
Christopher Wellons
078377b465 Refresh the variant patches 2022-08-05 18:14:03 -04:00
Christopher Wellons
3f3144312d Bump to 1.16.0 v1.16.0 2022-08-05 17:56:59 -04: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
7f02f57f52 w64devkit.c: Omit stack probe, commit a larger stack
Reserving and comitting a bigger stack makes the i686 build more
reliable, and allows for more use of automatic variables.
2022-08-05 16:18:11 -04:00
Christopher Wellons
8e8d389c98 Upgrade to Binutils 2.39 2022-08-05 11:17:35 -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
4282797c5e Upgrade to Vim 9.0 2022-07-05 22:10:01 -04:00
Christopher Wellons
27d0106262 Build Vim as a DLL with stubs
Vim is substantially smaller because vim.exe and gvim.exe are now
effectively the same binary. On Windows these must be distinct binaries
since they target the "console" and "windows" subsystems separately.
"vim -g" now works correctly, though "vim -g -f" still does not work.

Enabling VIMDLL requires enabling IME (probably a bug). I also noticed
vimrun.exe isn't stripped, nor does it need to be installed on the PATH.
2022-07-05 22:03:37 -04:00
Christopher Wellons
b89061ac7e Add note about UBSan availability to README 2022-07-04 10:00:55 -04:00
Christopher Wellons
bdf6701b78 Refresh the variant patches 2022-07-04 10:00:49 -04:00
Christopher Wellons
e8d92e7b4f Introduce new "debugbreak" utility
When a console process under GDB is stuck in a loop, it's difficult to
break the program without also killing GDB. This utility can be run from
another console, or even Vim, to cause the debuggee to break.
2022-06-26 22:12:02 -04:00
Christopher Wellons
3e374ea507 Bump to 1.15.0 v1.15.0 2022-06-14 18:52:22 -04:00
Christopher Wellons
a0f2ae7542 Patch out noisy output from gendef
These messages serve no purpose other than to reduce the tool's overall
usefulness.
2022-06-13 17:39:30 -04:00
Christopher Wellons
16aab11404 Upgrade to busybox FRP-4716
* New "jn" command for creating Win32 junctions
* New environment variable $BB_OVERRIDE_APPLETS
* Improved "ls" metadata listings
* Improved "which" command
* Use existing $HOME on login shell startup
* "date" command now supports nanoseconds (%N)
* Improved unix-style executable path handling
* Various bug fixes

https://frippery.org/busybox/release-notes/FRP-4716.html

For w64devkit, I decided to omit the new "tsort" from upstream BusyBox.
2022-06-10 10:28:02 -04:00
Christopher Wellons
72af854bea Disable the BusyBox "link" and "unlink" commands
The "link" command conflicts with MSVC (i.e. vcvars.bat), blocking some
access to its linker. Since this command is a subset of "ln" it does not
need to exist. The related "unlink" command is similarly redundant.
2022-06-09 10:08:09 -04:00
Christopher Wellons
6eb95c8d05 Also set "*_FOR_TARGET" on the second stage GCC
This makes a tiny, but consistent difference in the final size.
2022-05-25 10:29:16 -04:00
Christopher Wellons
1513aa787f Add XML support to GDB via Expat
This is not documented as thoroughly as it should be, but XML support is
necessary for debugging across DLL boundaries, including even stepping
over DLL functions without getting lost. This is a significant upgrade
to GDB.
2022-05-17 16:54:52 -04:00
Christopher Wellons
c1d57fd015 Refresh the variant patches 2022-05-08 21:30:50 -04:00
Christopher Wellons
745ea5ad3f Bump to 1.14.0 v1.14.0 2022-05-06 17:55:54 -04:00
Christopher Wellons
f7e2210c4d Update to GCC 12.1.0
libgfortran now prefers clock_gettime before gettimeofday. Mingw-w64
supplies clock_gettime via winpthreads, so it must be installed before
building libgfortran.
2022-05-06 17:55:54 -04:00
Christopher Wellons
d65e0028b9 Bump to 1.13.0 v1.13.0 2022-04-21 23:29:59 +00:00
Christopher Wellons
f280769303 Update to GCC 11.3.0 2022-04-21 09:36:50 -04:00
Christopher Wellons
8ff35b37d1 Correct the sysroot for native binutils and gcc
The sysroot should include the architecture triple. With the wrong
sysroot, ld couldn't find the Mingw-w64 libraries. This makes it easier
to work with assembly programs.
2022-04-12 22:14:45 -04:00
Christopher Wellons
e822cb136f Bump to 1.12.0 v1.12.0 2022-04-04 15:21:42 -04:00
Christopher Wellons
bcf7a687c9 Upgrade to Binutils 2.38
Note: depends on Mingw-w64 10.0.0.
2022-04-04 14:35:58 -04:00