Compilation of Android M
For the new version of Android system (6.0 start?? ), at compile time, it is supported to compile the Binaries of two CPU architectures (i.e., 32-bit and 64-bit)at the same time, which is called "Multilib build".
For native static libraries and shared libraries, the compilation system compiles Binary of two architectures at the same time.
Product_packages will decide which binary will be put into System Image.
The system defaults to the compiled 64-bit version, which can be customized by modifying the boardconfig.mk file.
Product configuration (entire system)
In Boardconfig.mk, the following variables can be configured second CPU architecture and ABI (Application binary interface):
Target_2nd_archtarget_2nd_arch_varianttarget_2nd_cpu_varianttarget_2nd_cpu_abitarget_2nd_cpu_abi2
Take Build/target/board/generic_arm64/boardconfig.mk as an example:
Target_no_bootloader: = truetarget_no_kernel:= truetarget_arch: = arm64target_arch_variant: = armv8-atarget_cpu_variant:= Generictarget_cpu_abi:= Arm64-v8atarget_2nd_arch:= Armtarget_2nd_cpu_abi:= armeabi-v7atarget_2nd_cpu_abi2:= Armeabi
If you want to change to a default compiled 32-bit system, you can set the following variables:
Target_prefer_32_bit: = True
Configuring the module in ANDROID.MK
In the andorid.mk of a module, the local_multilib variable can be used to override the Target_prefer_32_bit set by the system .
Local_multilib can be set to:
"Both" //Build both 32-bit and-bit"+"/ /Build-bit"+" //Build-bit" First "for devicedevice") "
You can also compile Binaries for the specified schema by using the "local_module_target_arch" variable for the specified schema:
: = arm
Reference documents:
https://source.android.com/source/64-bit-builds.html (please fq~~~ yourself)https://www.ibm.com/developerworks/cn/opensource/os-cn-android-build/
Android M 6.0 Build about 64-bit (__arm64__)