aosp build on ubuntu 12.04 clang issues

309 views
Skip to first unread message

Andy Myers

unread,
Apr 19, 2012, 3:25:29 AM4/19/12
to android-...@googlegroups.com
Has anyone successfully built on ubuntu 12.04?  After following the development environment setup page on the AOSP site I seem to get build errors.  Specifically it seems to have a lot of trouble with clang.

Updating Clang version info.
Updating Clang version info.
/bin/bash: -c: line 4: unexpected EOF while looking for matching `"'
/bin/bash: -c: line 6: syntax error: unexpected end of file
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libclangDriver_intermediates/include/clang/Basic/Version.inc] Error 1
make: *** Waiting for unfinished jobs....

The bug seems to be related to how external/clang/clang-version-inc.mk builds up the version info.  The resulting input to sed ends up looking like this:

sed -e "s#@CLANG_VERSION@##define PACKAGE_VERSION "2.8"#g" \
-e "s#@CLANG_VERSION_MAJOR@##define#g" \
-e "s#@CLANG_VERSION_MINOR@#PACKAGE_VERSION#g" \
-e "s#@CLANG_VERSION_PATCHLEVEL@#"2#g" \
-e "s#@CLANG_HAS_VERSION_PATCHLEVEL@#1#g" \
external/clang/include/clang/Basic/Version.inc.in > out/host/linux-x86/obj/STATIC_LIBRARIES/libclangDriver_intermediates/include/clang/Basic/Version.inc

After hardcoding that to produce a valid Version.inc, I'm running into missing symbols in the clang .so's (which may be a result of my hardcoding).  I understand 12.04 builds are experimental but am I the only one with these issues? 


Michael Moussa

unread,
Dec 2, 2012, 9:39:10 PM12/2/12
to android-...@googlegroups.com
Nevermind, my issue went away after a rebuild.

On Friday, November 30, 2012 12:28:50 PM UTC-5, Michael Moussa wrote:
I also have issues building AOSP on my 64 bit Ubuntu 12.04 machine. I ran into errors when building clang. Form what i understand clang is an alternative compiler to gcc and it is experimental and optional in the latest version of the Android NDK. So maybe we can just skip it to get past the error.

Andy Myers

unread,
Apr 3, 2013, 11:11:45 AM4/3/13
to android-...@googlegroups.com
This is ancient, but I thought I'd document the fix for this issue.

The problem turned out to be an environment issue.  I had the GREP_OPTIONS env var set which screws up the build for clang.  Clearing this env var in my build environment gave me a successful build.

There are other environment related problems that have been observed with android builds, some of them (including GREP_OPTIONS) are documented here:


On Thursday, April 19, 2012 3:25:29 AM UTC-4, Andy Myers wrote:
Reply all
Reply to author
Forward
0 new messages