Overblog
Edit post Follow this blog Administration + Create my blog

Bionic on x86_64

Posted on by Денис Крыськов

Google published a number of GCC toolchains targeting a number of platforms (including x86 and x86_64 Android), and claims that the toolchain is open-source, but forgot to publish compilation instructions. x86 Android toolchain exists since 2011. Toolchain binary code installs on Gentoo/amd64 via dev-util/android-ndk*ebuild. Toolchain source code is supposed to be downloadable with /opt/android-ndk/build/tools/download-toolchain-sources.sh script and compilable with /opt/android-ndk/build/tools/build-gcc.sh. However download-toolchain-sources.sh is terribly broken because it attempts to download code that is no longer online and attempts to apply patches that are already applied or no longer apply. And README on build-gcc.sh insists that building toolchain is not supported for x86*-linux-android.

Patching download-toolchain-sources.sh here and there, I managed to take hold on Google toolchain source. The code looks very similar to files already already stored in my /distfiles/. Disabling graphite voodoo, and using the following setup

/opt/android-ndk/build/tools/build-gcc.sh \
/tmp/toolchain-sources \
/opt/android-ndk \
x86_64-linux-android-4.9 \
--build-out=/tmp/build-gcc/really \
--gdb-version=7.10 --binutils-version=2.25 \
--ppl-version=1.0 \
--verbose --try-64

, I got a (nearly) working GCC toolchain. By nearly I mean that 64-bit compilation against bionic not including pmmintrin.h succeeds and produces code that natively runs on my Haswell Gentoo desktop (dynamic code runs via /system/bin/linker64).

I only consider software open-source if it compiles on my Gentoo desktop without calling or linking any binary code not present in Gentoo basic installation. I hope that bionic library and gcc targeting x86_64-linux-android are indeed open-source. I hope to create ebuild scripts that make the toolchain soon

Comment on this post