This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 96e648ac4a3d80a5d2194c834d82035fc90039e4
Author: Joe McDonnell <[email protected]>
AuthorDate: Thu May 4 20:34:24 2023 -0700

    KUDU-3474: Add zlib as dependency of libunwind for ARM
    
    On ARM, libunwind includes support for compressed
    .debug_info sections if zlib is available during
    compilation. This means that libunwind can require zlib
    at link time, but only for ARM architecture.
    
    This modifies the build to add a zlib dependency for
    libunwind if the architecture is ARM. It also reorders
    the thirdparty build so that zlib is built before
    libunwind. This is not strictly necessary, but it means
    that libunwind would consistently have support for
    compressed .debug_info sections on ARM. This does not
    impact x86_64.
    
    Testing:
     - Ran an ARM build on Ubuntu 20.04
    
    Change-Id: Iee87b908a5771c2bd7c1a653504a1449d0792280
    Reviewed-on: http://gerrit.cloudera.org:8080/19846
    Reviewed-by: Alexey Serbin <[email protected]>
    Tested-by: Alexey Serbin <[email protected]>
---
 CMakeLists.txt                 | 8 +++++++-
 thirdparty/build-thirdparty.sh | 9 +++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91bd2fe6c..cf476d6c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -984,11 +984,17 @@ list(APPEND KUDU_BASE_LIBS glog)
 ##
 ## Doesn't build on OSX.
 if (NOT APPLE)
+  set(LIBUNWIND_DEPS)
+  # On ARM, libunwind takes a dependency on zlib
+  if("${ARCH_NAME}" MATCHES "aarch64")
+    set(LIBUNWIND_DEPS zlib)
+  endif()
   find_package(LibUnwind REQUIRED)
   include_directories(SYSTEM ${UNWIND_INCLUDE_DIR})
   ADD_THIRDPARTY_LIB(unwind
     STATIC_LIB "${UNWIND_STATIC_LIB}"
-    SHARED_LIB "${UNWIND_SHARED_LIB}")
+    SHARED_LIB "${UNWIND_SHARED_LIB}"
+    DEPS "${LIBUNWIND_DEPS}")
   list(APPEND KUDU_BASE_LIBS unwind)
 endif()
 
diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh
index b53e151dd..937beeda7 100755
--- a/thirdparty/build-thirdparty.sh
+++ b/thirdparty/build-thirdparty.sh
@@ -313,14 +313,15 @@ save_env
 EXTRA_CFLAGS="-g $EXTRA_CFLAGS"
 EXTRA_CXXFLAGS="-g $EXTRA_CXXFLAGS"
 
-if [ -n "$OS_LINUX" ] && [ -n "$F_UNINSTRUMENTED" -o -n "$F_LIBUNWIND" ]; then
-  build_libunwind
-fi
-
 if [ -n "$F_UNINSTRUMENTED" -o -n "$F_ZLIB" ]; then
   build_zlib
 fi
 
+# Put this after zlib to allow ARM builds to pick up compressed .debug_info 
support
+if [ -n "$OS_LINUX" ] && [ -n "$F_UNINSTRUMENTED" -o -n "$F_LIBUNWIND" ]; then
+  build_libunwind
+fi
+
 if [ -n "$F_UNINSTRUMENTED" -o -n "$F_LZ4" ]; then
   build_lz4
 fi

Reply via email to