Here is the way to compile x86 goldfish and run on emulator
* AOSP Marshmallow + Goldfish 3.4
* ARCH=x86 (You don't need to set SUBARCH)
* Compiler version : gcc-4.8 (prebuilt x86 compiler from Android NDK)
(Set CROSS_COMPILE environment variable)
$ make ARCH=x86 CC="${CROSS_COMPILE}gcc -mno-android" goldfish_defconfig
$ make ARCH=x86 CC="${CROSS_COMPILE}gcc -mno-android" -j40
And use 'arch/x86/boot/bzImage' as 'kernel-qemu' image
Please note that you SHOULD use '-mno-android' option to build linux kernel with NDK toolchains.
The reason is, '-mandroid' option is enabled by default at GCC in NDK(file name is something like *-*-android*)
Remember that NDK toolchain is used to build native executable or libraries run on Android devices.
And, in general, build environment of linux kernel is 'GCC' + 'GLIBC'.
(Note that, linux kernel binary even if it runs on Android device, it doesn't have any dependency on Android platform(ex. bionic or libc))
So, to build linux kernel, '-mandroid' option should be disabled by using '-mno-android' option.
'Domain > Android' 카테고리의 다른 글
Android NDK binary built with aarch64-llvm doesn't detect 'divide by zero'! (0) | 2023.09.18 |
---|---|
[Ninja] Feature of build-tool : Implicit dependency to input '.ninja' file (0) | 2016.03.04 |
[Android] signing verification (0) | 2015.02.11 |
[Android] 죽지않는 service 만들기. (0) | 2015.02.11 |
[Android] Package verification with signature. (0) | 2015.02.02 |