Android NDK compatibility patch for Debug+Asserts build

Jonathan Roelofs jonathan at codesourcery.com
Sun Sep 14 17:28:19 PDT 2014



On 9/13/14 8:14 PM, Jeffrey Brusseau wrote:
> Ok, here's my new patch for making LLVM/Clang build using the NDK toolchain.
> This time my configuration looked like:
> ../llvm/configure --host=arm-linux-androideabi --build=i686-pc-linux-gnu
> --prefix=/home/bobajeff/android-ext
>
> The configure script didn't seem to detect that I was cross-compiling unless I
> used the host and build flags. It didn't seem like the prefix flag would make it
> pick up the NDK compiler either.
'--prefix' only tells configure where you'd like `make install` to copy the 
build products to. Yes, '--build', '--target', and '--host' are the correct way 
to specify that you're cross compiling.
>
> Anyway I ran:
> make ENABLE_OPTIMIZED=1
>
> Everything built fine.
>
> Then I ran:
> make ENABLE_OPTIMIZED=1 check-all
>
> I got "Could not find llvm-config in
> /home/bobajeff/Downloads/LLVM4Android/build/Release+Asserts/bin"
> I looked and it's in there. I think it just tried to run it but because it's a
> Arm binary and my system is x86 it couldn't.
I'd only expect `make check-all` to work on 'host' because it has to run things 
like llc, clang, and FileCheck which are build to run on '--host'.

In your case, it probably makes sense to keep two builds of the tree around: one 
for the cross build, and another where build and host are both 
i686-pc-linux-gnu.  Then you can write patches for the cross build case, test 
them on your device, and then apply the patches to the other tree, build that, 
and test there to make sure you haven't broken any of the tests for other platforms.


Cheers,

Jon

>
> What do you think?
>
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the llvm-commits mailing list