Open TheCloudlessSky opened 6 years ago
Thanks for the instructions! It worked nicely for me, cross-compiled to arm! This were my steps:
$ git clone https://github.com/WolfgangSt/libelf
$ cd libelf
$ autoreconf -fvi
$ CC="arm-linux-gnueabi-gcc" ./configure --host=arm-linux-gnueabi --disable-shared
$ make
$ cd ../
$ git clone https://github.com/dkogan/ltrace
$ cd ltrace
$ ./autogen.sh
$ CFLAGS="-Wno-error -Wl,-static -static-libgcc -static" CPPFLAGS="-I/home/user/libelf/lib -D__LIBELF_INTERNAL__" LDFLAGS="-L/home/user/libelf/lib" ./configure --host=arm-linux-gnueabi --disable-shared
$ make
Copied ltrace to the arm linux system and it executed ok... but always gav error: "Couldn't get data of section #0 from "/proc/xxxx/exe"
Luckly these builds worked. Saved my life!
Hey,
Thanks a lot for these binaries - they've been incredibly useful for me 😄. I was trying to create a static build of ltrace when I gave up and found your project. Would you be willing to share the exact steps you took to create the static binary of ltrace? I've been running into issues getting libelf to statically link properly and I'd really like to see how someone else is doing it. Here's what I have on Ubuntu using a specific ARM cross compiler:
$ git clone https://github.com/WolfgangSt/libelf
$ cd libelf
$ autoreconf -fvi
$ CC="my-arm-cross-compiler" ./configure --host=my-arm-cross-compiler --disable-shared
$ make
(libelf is now built)$ cd ../
$ wget https://www.ltrace.org/ltrace_0.7.3.orig.tar.bz2
$ tar xvjf ./ltrace_0.7.3.orig.tar.bz2
$ cd ltrace-0.7.3
$ autoreconf -fvi
$ CFLAGS="-Wno-error -Wl,-static -static-libgcc -static" CPPFLAGS="-I/path/to/built/libelf/lib -D__LIBELF_INTERNAL__" LDFLAGS="-L/path/to/built/libelf/lib" ./configure --host=my-arm-cross-compiler --disable-shared
$ make
But this is failing with errors (e.g. libelf not linking properly) and I'd like to see where I'm going wrong. So, I would appreciate it if you have the time to provide instructions on how to create a static binary of ltrace for ARM.