[Acer Iconia A500] FFU5y:
I am currently trying to build CM9 for my A500 on my Mac (which is running OS X 10.8). It is failing while building the kernel, with the error:

Undefined symbols for architecture i386:
"android::renderscript::rsi_Allocation1DElementData(android::renderscript::Context*, void*, unsigned int, unsigned int, void const*, unsigned long, unsigned int)", referenced from:
...
android::renderscript::rsp_Allocation2DElementData(android::renderscript::Context*, void const*, unsigned long)in libRS.a(rsgApiReplay.o)

I'll describe the steps I followed to get to that point below, but first: It doesn't look like I'm the only one having this problem, but it doesn't look common - I found the same error in three pastebins: 1, 2, 3. The interesting thing is that 1 and 2 there are both on OS X (both contain 'out/host/darwin-x86/'), and they are for different devices.

Anyway, to get to that point I did the following:

(Following the CyanogenMod Wiki template for Mac OS X building)

1. Trashed my entire MacPorts tree using the commands provided in the CyanogenMod wiki.

2. Reinstalled all the ports I already had installed, along with those indicated in the CyanogenMod wiki. I used the supplied command, but then after the described error appeared the first time, I installed all the ports with the +universal directive as well.

3. Checked out the code for CM9 using:

repo init -u http:github.com/CyanogenMod/android.git -b ics --reference=/Volumes/Backup/AndroidDevelopment/cm9/mirror/CyanogenMod/
repo sync

4. Following the post by waydownsouth, ran:

. build/envsetup.sh
lunch cm_a500-userdebug

This synced the a500 bits from the repository

5. Plugged in the tablet, and entered the commands:

cd device/acer/a500
./extract-files.sh

A bunch of files downloaded, and all was well.

6. I returned to the root of my working directory, and ran:

brunch cm_a500-userdebug

and received the error:

It bombed with:
make: *** No rule to make target `vendor/cm/proprietary/RomManager.apk', needed by `out/target/product/a500/system/app/RomManager.apk'. Stop.
make: *** Waiting for unfinished jobs....

7. Got the prebuilts using the commands:

cd vendor/cm
./get-prebuilts

8. Returned to the root of the working directory again, and ran:

brunch cm_a500-userdebug

It looked like it was working until I received the error:

Result was:
target thumb C++: libwebcore <= external/webkit/Source/WebCore/xml/XPathP****r.cpp
out/target/product/a500/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/XPathGrammar.hpp: In member function 'WebCore::XPath::Expression* WebCore::XPath::P****r::p****Statement(const WTF::String&, WTF::PassRefPtr<WebCore::XPathNSResolver>, WebCore::ExceptionCode&)':
out/target/product/a500/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/XPathGrammar.hpp:106: error: too many arguments to function 'int WebCore::XPath::xpathyyp****()'
external/webkit/Source/WebCore/xml/XPathP****r.cpp:480: error: at this point in file
make: *** [out/target/product/a500/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/xml/XPathP****r.o] Error 1

9. I found that the above error was due to Bison 2.6, and I shopped around, and found a patch which appeared to address this issue. It didn't apply quite correctly (on file Source/WebCore/xml/XPathP****r.cpp), but I manually merged that file.

10. I shut down and restarted (because I was going from one place to another, and stuff in on an external drive) so I got my environment variables set etc. again by running:

9. At this point, I shut down. When I recommenced, I ran
. build/envsetup.sh
lunch cm_a500-userdebug
brunch cm_a500-userdebug

Webkit built correctly this time, but then I hit the error:

/Volumes/Backup/AndroidDevelopment/cm9/working_copy_2/kernel/acer/t20-common/scripts/mod/mk_elfconfig.c:4:17: error: elf.h: No such file or directory
/Volumes/Backup/AndroidDevelopment/cm9/working_copy_2/kernel/acer/t20-common/scripts/mod/mk_elfconfig.c: In function ‘main’:
/Volumes/Backup/AndroidDevelopment/cm9/working_copy_2/kernel/acer/t20-common/scripts/mod/mk_elfconfig.c:9: error: ‘EI_NIDENT’ undeclared (first use in this function)
/Volumes/Backup/AndroidDevelopment/cm9/working_copy_2/kernel/acer/t20-common/scripts/mod/mk_elfconfig.c:9: error: (Each undeclared identifier is reported only once
...
make[4]: *** [scripts/mod/mk_elfconfig] Error 1

11. I looked around and found one thread which suggested I copy the elf.h file to /external/elfutils/libelf but that didn't appear to fix the problem, so deleted the elf.h file from that directory again.

Then I found another thread which suggested the way to solve the problem was to build the kernel separately, and in advance using the command:

make -j`sysctl -an hw.logicalcpu` ARCH=arm CROSS_COMPILE=./prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- HOSTCFLAGS="-I./external/elfutils/libelf"

(Note that I changed the paths here to match my system).

To save from having to recompile everything every time, I ran:

export USE_CCACHE=1 && ./prebuilt/darwin-x86/ccache/ccache -M 20G

Then I used the command identified above (i.e. make -j`sysctl -an hw.logicalcpu` ...).

It failed after quite some time with the error:

Build failed with:
Undefined symbols for architecture i386:
"android::renderscript::rsi_Allocation1DElementData(android::renderscript::Context*, void*, unsigned int, unsigned int, void const*, unsigned long, unsigned int)", referenced from:
android::renderscript::rspr_Allocation1DElementData(android::renderscript::Context*, android::renderscript::Fifo*, unsigned char*, unsigned long)in libRS.a(rsgApiReplay.o)
android::renderscript::rsp_Allocation1DElementData(android::renderscript::Context*, void const*, unsigned long)in libRS.a(rsgApiReplay.o)
"android::renderscript::rsi_Allocation2DElementData(android::renderscript::Context*, void*, unsigned int, unsigned int, unsigned int, RsAllocationCubemapFace, void const*, unsigned long, unsigned int)", referenced from:
android::renderscript::rspr_Allocation2DElementData(android::renderscript::Context*, android::renderscript::Fifo*, unsigned char*, unsigned long)in libRS.a(rsgApiReplay.o)
android::renderscript::rsp_Allocation2DElementData(android::renderscript::Context*, void const*, unsigned long)in libRS.a(rsgApiReplay.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

As I noted above, it seems like one or two other people have had this error also. At this point, I'm basically stumped. I've never really done much C/C++ dev, so I'm fairly unfamiliar with reading the output of the linker. Looking over it, I wouldn't have expected it to need i386 symbols for libRS.a (if that is indeed what it is looking for symbols of) because it is building for ARM, but I could just be completely misunderstanding the output.

Anyway, if anyone has suggestions as to what might be causing the problem or how to address it (or even wants to briefly explain what that linker error actually means in a clearer way) that would be great. I've fought with CM7 builds in the past (for the Moto Defy) and basically given up because I couldn't get them to build. I'd rather not just do that again.