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.
Note
This may take a while to build. Feel free to do something else
while this is building.
Static MinGW-w64-GCC Dependencies
Required
MinGW-w64-Binutils-2.44 and MinGW-w64-headers-13.0.0
Installation of Static MinGW-w64-GCC
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 && cd ..
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
Note
Run ../configure
--help for a full list of options.
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, and thus are prefixed with the
architecture triplet, such as x86_64-w64-mingw32-gcc. For
in-depth descriptions, read
https://www.linuxfromscratch.org/lfs/view/development/chapter08/gcc.html#contents-gcc.