Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yakamoz423/2dd9312538799edb36ab58ba36d0afe7 to your computer and use it in GitHub Desktop.
Save yakamoz423/2dd9312538799edb36ab58ba36d0afe7 to your computer and use it in GitHub Desktop.
Build static versions of binutils, for example ld, gprof, nm, strip, objdump, ar, strings; with mingw or on *nix
VERSION=2.25
wget http://ftp.gnu.org/gnu/binutils/binutils-$VERSION.tar.gz || exit 1
tar xzf binutils-$VERSION.tar.gz || exit 1
cd binutils-$VERSION || exit 1
./configure --disable-nls --prefix=$(pwd)/bin || exit 1
make configure-host || exit 1
make LDFLAGS="-all-static" || exit 1
make install || exit 1
@yakamoz423
Copy link
Author

Ezbob
Ezbob commented on Jun 23, 2020
I was surprised that this works, but I just tried this with binutils 2.34 and it work like a charm too! Thanks!

Ezbob
Ezbob commented on Jun 23, 2020
You can also use make install-strip to shrink the binary sizes when installing

yakamoz423
yakamoz423 commented 2 hours ago
Awesome! I build binutils-2.40 on MSYS2 (MinGW x86_64), by configuring with --enable-targets=all to obtain binutils-multiarch version, and it works too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment