1

(Perhaps a border-line question on S.O since I am not showing any source code!)

I want to be able to cross-compile (using the latest GCC trunk, i.e. 4.9) a hello world program in C, compiled on Linux/Debian/Sid/x86-64 for Android (4.4.2 on a rooted Nexus 7), and to be executed in an Android terminal emulator. My goal is to learn how to configure the entire cross-tool chain, probably GCC, binutils, and MUSL libc. So I specifically do not want to use any SDK or NDK for Android!

I guess that my Android is an arm-linux-gnueabi GCC 4.9 primary target platform for GCC & binutils. Is this correct?

Then once I compiled my (statically linked with MUSL libc) hello world, how should I transfer it on the tablet? (MTP probably).

PS. I am quite familiar with Linux (and GCC, to which I contribute, and binutils) but I am a complete Android newbie.

PPS: The real motivation is that I want to compile a plugin for a GCC cross-compiler, preparing a talk about GCC plugins

manlio
  • 18,345
  • 14
  • 76
  • 126
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • Since it seems like you want to target the kernel directly, perhaps you should examine diffs of the Android kernel version of interest and corresponding upstream or an arm linux kernel you know how to make a toolchain for. It would seem like major issues would be anything format or identifier wise which causes the kernel to reject an elf, any differences in syscall numbers, and any *differences in data structures passed to or from the kernel*. Or you could just try it blindly and fix problems one by one. You could also see what you can learn from the people running debian in a chroot. – Chris Stratton Mar 16 '14 at 13:21
  • Perhaps you can take a look at Linux from scratch project. Another place that you can look is at wiki.linaro.org, perhaps asking for a direction how they build their toolchains. – rakib_ Mar 16 '14 at 15:40

0 Answers0