Static MinGW-w64-GCC-14.2.0

Introduction to Static MinGW-w64-GCC

MinGW-w64-GCC provides GCC compilers for MinGW-w64, allowing users and applications to compile code targetting Windows. This will be done in steps to avoid the need for already present binaries. This is the static build, which will have limited support but will be able to compile software better for the MinGW-w64 targets.

Static MinGW-w64-GCC Dependencies

Required

MinGW-w64-binutils-2.43.1 and MinGW-w64-headers-12.0.0

Optional

GDB and Valgrind (for tests)

[Note]

Note

This may take a while to build. Feel free to do something else while this is building.

Installation of Static MinGW-w64-GCC

[Important]

Important

Although you are compiling for another host and running make install is generally safe, it is recommended to not run make install until you are confident the build was successful.

x86_64 Installation of Static MinGW-w64-GCC

Install x86_64 Static MinGW-w64-GCC by running the following commands:

mkdir build-x86_64-mingw-w64-static &&
cd    build-x86_64-mingw-w64-static &&

../configure                             \
    --prefix=/usr                        \
    --target=x86_64-w64-mingw32          \
    --disable-shared                     \
    --disable-multilib                   \
    --disable-threads                    \
    --enable-languages=c,c++ &&

make all-gcc

Now, as the root user:

make install-gcc

i686 Installation of Static MinGW-w64-GCC

Install i686 Static MinGW-w64-GCC by running the following commands:

mkdir build-i686-mingw-w64-static &&
cd    build-i686-mingw-w64-static &&

../configure                             \
    --prefix=/usr                        \
    --target=i686-w64-mingw32            \
    --disable-shared                     \
    --disable-multilib                   \
    --disable-threads                    \
    --enable-languages=c,c++ &&

make all-gcc

Now, as the root user:

make install-gcc

Command Explanations

mkdir build; cd build: The GCC documentation recommends building the package in a dedicated build directory.

--disable-shared: This option disables building shared libraries. They will be built later.

--disable-multilib: This option ensures that files are created for the specific architecture of your computer.

--disable-threads: This option disables thread support due to building errors in GCC. This support will be built in later.

--enable-languages=c,c++: This command builds support for C and C++. Refer to https://www.linuxfromscratch.org/blfs/view/svn/general/gcc.html to find what other languages are supported.

Contents

There are no binaries specific to this package besides the format the compilers are targetting. For in-depth descriptions, read https://www.linuxfromscratch.org/lfs/view/stable/chapter08/gcc.html#contents-gcc