-
-
Save cfstras/9f94a710c90d0161f23d to your computer and use it in GitHub Desktop.
See the bash script below. :) | |
Tested on debian bookworm-slim (`docker pull debian:bookworm-slim`). | |
### Prerequisites | |
```bash | |
apt update | |
apt install -y build-essential wget bison | |
``` | |
### Build | |
```bash | |
wget https://gist.githubusercontent.com/cfstras/9f94a710c90d0161f23d/raw/build.sh | |
chmod a+x build.sh | |
./build.sh | |
``` |
#!/bin/bash | |
set -euo pipefail | |
VERSION=2.41 | |
[[ -s "binutils-$VERSION.tar.gz" ]] || wget "http://ftp.gnu.org/gnu/binutils/binutils-$VERSION.tar.gz" | |
tar xzf "binutils-$VERSION.tar.gz" | |
cd "binutils-$VERSION" | |
./configure --disable-nls --prefix="$(pwd)/bin" | |
make configure-host | |
make LDFLAGS="-all-static" | |
make install | |
echo "output in binutils-$VERSION/bin/bin:" | |
ls bin/bin |
Still works with binutils 2.41. Thanks!
prdbg.c: In function 'tg_class_baseclass':
prdbg.c:2220:7: warning: 'free' called on a pointer to an unallocated object '18446744073709551610' [-Wfree-nonheap-object]
2220 | free (t);
| ^~~~~~~~
prdbg.c: In function 'pr_class_baseclass':
prdbg.c:1311:7: warning: 'free' called on a pointer to an unallocated object '18446744073709551610' [-Wfree-nonheap-object]
1311 | free (t);
| ^~~~~~~~
CC demanguse.o
CC rddbg.o
CC debug.o
CC stabs.o
CC rdcoff.o
CC elfcomm.o
make[4]: *** No rule to make target '../libctf/libctf.la', needed by 'objdump'. Stop.
make[4]: Leaving directory '/Depot/jjjj/binutils-28.03.2024/binutils'
I got some errors ... :(
@rubyFeedback Just tested this successfully on Debian bookworm -- what OS and compiler are you using?
Thank you! It is exactly I was looking for, it did work flawlessly!