MinGW-w64-binutils-2.42

Introduction to MinGW-w64-binutils

MinGW-w64-binutils is a collection of software that can change the state of Windows binaries or make them executable. These binutils are specific to MinGW-w64, and using regular binutils will not work for the proceeding packages.

[Note]

Note

Development versions of GLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

MinGW-w64-binutils Dependencies

Optional

Binary MinGW-w64

Installation of MinGW-w64-binutils

First make sure libiberty does not get installed:

sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in

Now you may proceed.

x86_64 MinGW-w64-binutils

Install x86_64 MinGW-w64-binutils by running the following commands:

mkdir build-x86_64 &&
cd build-x86_64

../configure --prefix=/usr                                \
             --target=x86_64-w64-mingw32                  \
             --infodir=/usr/share/info/x86_64-w64-mingw32 \
             --enable-lto                                 \
             --enable-plugins                             \
             --enable-deterministic-archives              \
             --disable-multilib                           \
             --disable-nls                                \
             --disable-werror

make

Now, as the root user:

make install
rm -v /usr/lib/bfd-plugins/libdep.so

i686 MinGW-w64-binutils

Install i686 MinGW-w64-binutils by running the following commands:

mkdir build-i686 &&
cd build-i686

../configure --prefix=/usr                                \
             --target=i686-w64-mingw32                    \
             --infodir=/usr/share/info/i686-w64-mingw32   \
             --enable-lto                                 \
             --enable-plugins                             \
             --enable-deterministic-archives              \
             --disable-multilib                           \
             --disable-nls                                \
             --disable-werror

make

Now, as the root user:

make install
rm -v /usr/lib/bfd-plugins/libdep.so

Command Explanations

--enable-lto: This option builds lto support.

--enable-plugins: This option enables plugin support for the linker.

--enable-deterministic-archives: This option enables building determinable archives by hardcoding filemodes, timestamps, and file owners into the archive.

--disable-multilib: This option disables multilib support in each architecture. It is not needed and doing a Wine WoW64 build just uses the binaries from each architecture. Do not set --enable-multilib for any MinGW-w64 package or else problems will occur.

--disable-nls: This option disables nls support, disabling output diagnostics in languages other than American English. Omit --disable-nls and invoke --enable-nls to enable nls support.

--disable-werror: This option makes it so warnings won't be considered errors.

--target=*: This option builds files for the architecture passed to it.

rm -v /usr/lib/bfd-plugins/libdep.so: This command removes an unnecessary library.

Contents

Installed Programs: {i686,x86_64}-w64-mingw32-addr2line, {i686,x86_64}-w64-mingw32-c++filt, {i686,x86_64}-w64-mingw32-dllwrap, {i686,x86_64}-w64-mingw32-elfedit, {i686,x86_64}-w64-mingw32-gprof, {i686,x86_64}-w64-mingw32-size, {i686,x86_64}-w64-mingw32-strings, {i686,x86_64}-w64-mingw32-windmc, {i686,x86_64}-w64-mingw32-windres, ar, as, dlltool, ld, ld.bfd, nm, objcopy, ranlib, readelf, and strip (MinGW-w64 specific binaries besides formatting include: {i686,x86_64}-w64-mingw32-dllwrap, {i686,x86_64}-w64-mingw32-windmc, {i686,x86_64}-w64-mingw32-windres, and dlltool)
Installed Libraries: None
Installed Directories: /usr/{i686,x86_64}-w64-mingw32/bin, /usr/{i686,x86_64}-w64-mingw32/lib/ldscripts, and /usr/share/info/{i686,x86_64}-w64-mingw32

Only binutils specific to MinGW-w64 will be explained. For the rest, see binutils-2.42.

Short Descriptions

{i686,x86_64}-w64-mingw32-dllwrap

ancient tool for generating PE style DLLs

{i686,x86_64}-w64-mingw32-windmc

generates Windows message resources

{i686,x86_64}-w64-mingw32-windres

manipulates Windows resources

dlltool

creates files neededto build and use DLLs