Skip to content

Commit

Permalink
Fix Windows build of GCC with recent MinGW toolchains
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddieChopin committed Apr 8, 2024
1 parent eeb1cf5 commit 886ee8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ All notable changes to this project will be documented in this file.
- Fixed documentation generation for newlib.
- New versions of GDB finally use Python 3 for Windows, so fix the build by using packaged Python from NuGet.
- Fixed build of GDB by using proper argument for mpfr.
- Fixed Windows build of GCC with recent MinGW toolchains
([upstream patch](https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609514.html)).

[221119](https://github.com/FreddieChopin/bleeding-edge-toolchain/compare/221106...221119)
------------------------------------------------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions build-bleeding-edge-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,14 @@ extract() {
extract "${binutilsArchive}"
extract "${expatArchive}"
extract "${gccArchive}"
if [ ! -f "${gcc}_patched" ]; then
messageB "Patching ${gcc}"
(
cd "${gcc}"
sed -Ei 's,^( *)#( *)include <windows\.h>,\1#\2define WIN32_LEAN_AND_MEAN\n&,' $(grep -Flr "<windows.h>")
)
touch "${gcc}_patched"
fi
if [ "${skipGdb}" = "n" ]; then
extract "${gdbArchive}"
fi
Expand Down

0 comments on commit 886ee8f

Please sign in to comment.