1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-14 16:46:09 +00:00
nixpkgs/pkgs/os-specific/linux/bionic-prebuilt/ndk-version.patch
s1341 1e1d29c2af treewide: Support aarch64-android using minimal prebuilt components
This PR adds a new aarch64 android toolchain, which leverages the
existing crossSystem infrastructure and LLVM builders to generate a
working toolchain with minimal prebuilt components.

The only thing that is prebuilt is the bionic libc. This is because it
is practically impossible to compile bionic outside of an AOSP tree. I
tried and failed, braver souls may prevail. For now I just grab the
relevant binaries from https://android.googlesource.com/.

I also grab the msm kernel sources from there to generate headers. I've
included a minor patch to the existing kernel-headers derivation in
order to expose an internal function.

Everything else, from binutils up, is using stock code. Many thanks to
@Ericson2314 for his help on this, and for building such a powerful
system in the first place!

One motivation for this is to be able to build a toolchain which will
work on an aarch64 linux machine. To my knowledge, there is no existing
toolchain for an aarch64-linux builder and an aarch64-android target.
2021-05-11 15:39:08 +00:00

43 lines
920 B
Diff

--- a/libc/include/android/ndk-version.h 2021-04-01 16:08:03.109183965 +0300
+++ b/libc/include/android/ndk-version.h 2021-04-01 16:07:19.811424641 +0300
@@ -0,0 +1,39 @@
+#pragma once
+
+/**
+ * Set to 1 if this is an NDK, unset otherwise. See
+ * https://android.googlesource.com/platform/bionic/+/master/docs/defines.md.
+ */
+#define __ANDROID_NDK__ 1
+
+/**
+ * Major version of this NDK.
+ *
+ * For example: 16 for r16.
+ */
+#define __NDK_MAJOR__ 22
+
+/**
+ * Minor version of this NDK.
+ *
+ * For example: 0 for r16 and 1 for r16b.
+ */
+#define __NDK_MINOR__ 0
+
+/**
+ * Set to 0 if this is a release build, or 1 for beta 1,
+ * 2 for beta 2, and so on.
+ */
+#define __NDK_BETA__ 0
+
+/**
+ * Build number for this NDK.
+ *
+ * For a local development build of the NDK, this is -1.
+ */
+#define __NDK_BUILD__ 7026061
+
+/**
+ * Set to 1 if this is a canary build, 0 if not.
+ */
+#define __NDK_CANARY__ 0