[Lldb-commits] [PATCH] Fix for aarch64 lldb-server native builds

Renato Golin renato.golin at linaro.org
Thu Mar 19 11:14:00 PDT 2015


Hi Omair,

While it's good to move away from wrong hard-coded values, but we should make it more generic. If you're building all together, there's a CMake function called get_host_triple() at LLVM's cmake/modules/GetHostTriple.cmake that you could use, or just use LLVM_HOST_TRIPLE.

If that's wrong, than I think Zach is right that this may have to be fixed on the LLVM side.


================
Comment at: cmake/modules/LLDBConfig.cmake:44-49
@@ -43,4 +43,8 @@
     # This is necessary for crosscompile on Ubuntu 14.04 64bit. Need a proper fix.
-    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+    if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "x86_64")
       set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
+    elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "aarch64")
+      set(CMAKE_LIBRARY_ARCHITECTURE "aarch64-linux-gnu")
+    elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "arm")
+      set(CMAKE_LIBRARY_ARCHITECTURE "arm-linux-gnueabi")
     endif()
----------------
zturner wrote:
> Should this be independently of whether LLDB_DISABLE_PYTHON is set, I wonder?  I know the issue only seems to be surfacing for you when linking against python.  But the CMAKE_LIBRARY_ARCHITECTURE  variable is unrelated to linking Python.  On that note, is this something that should be in LLVM's base CMake?
> On that note, is this something that should be in LLVM's base CMake?

I think so. "arm-linux-gnueabi" is definitely not enough for ARM. We may need to re-use what LLVM's base does and set this with that value.

http://reviews.llvm.org/D8447

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list