3

I'm working on a project, where I need to modify dd for Android, but I can't figure out how to build it. I've tried a simple way using arm-linux-gnueabi-gcc dd.c -o dd, but of course that wouldn't work. And I also can't find a makefile.

Is it possible to just build dd or do I need to build toolbox or the whole system? In any case, how do I do that?

I found the source code here.

EDIT: Is it possible to build the GNU core utils for arm? I tried using ./configure --host=arm-linux --target=arm-linux && make, but file dd still returns executable, x86-64.

drZaius
  • 129
  • 2
  • 13

1 Answers1

1

After lots of googling I was finally able to build the GNU core utils for arm.

I first had to set the environment variables CC and CXX to arm-linux-gnueabi-gcc and LDFLAGS to -static. Then I just ran ./configure --target=arm-linux --host=arm-linux && make and that's it.

drZaius
  • 129
  • 2
  • 13
  • This answer does not explain the difference between compiling coreutils for Linux and for Android. As currently presented, the coreutils built using this answer do not run on Android because they are linked against glibc, not Android's bionic libc. So the post does not answer the "(Android)" part of the question. – Jonathan Ben-Avraham Mar 08 '16 at 10:21
  • Gosh what a luck, I couldn't do that, `make` gave error right away because trying to run an ARM-compiled tool on my machine (`make-prime-list`) – Campa Feb 21 '18 at 16:16