Cross-compiling Panama: clang_getClangVersion detection

Aleksey Shipilev shade at redhat.com
Fri May 31 08:24:43 UTC 2019


Hi,

I was trying to build aarch64 in "foreign" and ran into trouble. My CI cross-compiles with base
system cross-compiler. Which means it can compile the binaries, but cannot execute them, including
those configure tries to test. So, configure fails with:

checking for clang_getClangVersion in -lclang... no
configure: error: Cannot locate libclang or headers at the specified locations:
            /home/buildbot/deps/clang-llvm/aarch64/lib
            /home/buildbot/deps/clang-llvm/aarch64/include

Configure and build passes after the hack like this:

diff -r f94dd38a20f4 make/autoconf/lib-clang.m4
--- a/make/autoconf/lib-clang.m4    Wed May 29 23:14:34 2019 +0200
+++ b/make/autoconf/lib-clang.m4    Thu May 30 22:34:38 2019 +0200
@@ -120,7 +120,7 @@

      AC_CHECK_HEADER("clang-c/Index.h", [], [ENABLE_LIBCLANG="false"])
      if test "x$ENABLE_LIBCLANG" = "xtrue"; then
-      if test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
+      if test "x$TOOLCHAIN_TYPE" = "xmicrosoft" || test "x$COMPILE_TYPE" = "xcross"; then
          # Just trust the lib is there
          LIBS=$LIBCLANG_LIBS
        else

If that makes sense, can you please push this into Panama somewhere?

-- 
Thanks,
-Aleksey



More information about the panama-dev mailing list