This post is very old - but nothing has changes as far as AOSP is concerned, so in case anyone is interested and runs into this problem when building for QEMU:
There is actually a nice and shorter way to build the kernel for your QEMU target provided by the AOSP: 1. cd to your kernel source dir (Only goldfish 2.6.29 works out of the box for the emulator) 2. ${ANDROID_BUILD_TOP}/external/qemu/distrib/build-kernel.sh -j=64 --arch=x86 --out=$YourOutDir 3. emulator -kernel ${YourOutDir}/kernel-qemu # run emulator: Step #2 calls the toolbox.sh wrapper scripts which works around the SSE disabling gcc warning - which happens for GCC < 4.5 (as in the AOSP prebuilt X86 toolchain). This script adds the " -mfpmath=387 -fno-pic" in case it is an X86 and that in turn eliminates the compilation errors seen above. To have finer control over the build process, you can use the "toolbox.sh" wrapper and set some other stuff without modifying the script files. An example for building the same emulator is below: # Set arch export ARCH=x86 # Have make refer to the QEMU wrapper script for building android over x86 (eliminates the errors listed above) export CROSS_COMPILE=${ANDROID_BUILD_TOP}/external/qemu/distrib/kernel-toolchain/android-kernel-toolchain- # Put your cross compiler here. I am using the AOSP prebuilt one in this example export REAL_CROSS_COMPILE=${ANDROID_BUILD_TOP}/prebuilt/linux-x86/toolchain/i686-android-linux-4.4.3/bin/i686-android-linux- # Configure your kernel - here I am taking the default goldfish_defconfig make goldfish_defconfig # build make -j64 # Run emulator: emulator -kernel arch/x86/boot/bzImage -show-kernel This works for the 2.6.29 goldfish branch. If anyone is using the emulator with a 3+ kernel I would be like to hear about it. > > -- unsubscribe: android-kernel+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-kernel