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

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new f9a1d198f6 GH-34309: [C++] Disable LTO for aws_lc and s2n-tls (#34349)
f9a1d198f6 is described below

commit f9a1d198f64f888f9dcf716174b43d8a116dde13
Author: Jin Shang <[email protected]>
AuthorDate: Wed Mar 1 12:30:34 2023 +0800

    GH-34309: [C++] Disable LTO for aws_lc and s2n-tls (#34349)
    
    When built with LTO, s2n-tls can't properly intern aws_lc symbols, which 
may cause undefined references.
    
    * Closes: #34309
    
    Lead-authored-by: Jin Shang <[email protected]>
    Co-authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/cmake_modules/ThirdpartyToolchain.cmake                | 11 ++++++++++-
 .../apache-arrow/apt/debian-bookworm/Dockerfile            |  1 -
 .../apache-arrow/apt/debian-bullseye/Dockerfile            |  1 -
 .../apache-arrow/apt/ubuntu-bionic/Dockerfile              |  1 -
 .../apache-arrow/apt/ubuntu-focal/Dockerfile               |  1 -
 .../apache-arrow/apt/ubuntu-jammy/Dockerfile               |  1 -
 .../apache-arrow/apt/ubuntu-kinetic/Dockerfile             |  1 -
 dev/tasks/linux-packages/apache-arrow/debian/rules         |  2 +-
 dev/tasks/linux-packages/apt/build.sh                      |  2 ++
 dev/tasks/linux-packages/github.linux.amd64.yml            | 14 ++++++++------
 dev/tasks/linux-packages/yum/build.sh                      |  4 ++++
 11 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index c345d5a77f..50c3f6c416 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -4855,6 +4855,9 @@ macro(build_awssdk)
   if("s2n-tls" IN_LIST _AWSSDK_LIBS)
     set(AWS_LC_C_FLAGS ${EP_C_FLAGS})
     string(APPEND AWS_LC_C_FLAGS " -Wno-error=overlength-strings 
-Wno-error=pedantic")
+    # Link time optimization is causing trouble like #34349
+    string(REPLACE "-flto=auto" "" AWS_LC_C_FLAGS "${AWS_LC_C_FLAGS}")
+    string(REPLACE "-ffat-lto-objects" "" AWS_LC_C_FLAGS "${AWS_LC_C_FLAGS}")
 
     set(AWS_LC_CMAKE_ARGS ${AWSSDK_COMMON_CMAKE_ARGS})
     list(APPEND AWS_LC_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${AWS_LC_PREFIX}
@@ -4868,11 +4871,17 @@ macro(build_awssdk)
                         BUILD_BYPRODUCTS ${AWS_LC_STATIC_LIBRARY})
     add_dependencies(AWS::crypto aws_lc_ep)
 
+    set(S2N_TLS_C_FLAGS ${EP_C_FLAGS})
+    # Link time optimization is causing trouble like #34349
+    string(REPLACE "-flto=auto" "" S2N_TLS_C_FLAGS "${S2N_TLS_C_FLAGS}")
+    string(REPLACE "-ffat-lto-objects" "" S2N_TLS_C_FLAGS "${S2N_TLS_C_FLAGS}")
+
     set(S2N_TLS_CMAKE_ARGS ${AWSSDK_COMMON_CMAKE_ARGS})
     list(APPEND
          S2N_TLS_CMAKE_ARGS
          -DS2N_INTERN_LIBCRYPTO=ON # internalize libcrypto to avoid name 
conflict with openssl
-         -DCMAKE_PREFIX_PATH=${AWS_LC_PREFIX}) # path to find crypto provided 
by aws-lc
+         -DCMAKE_PREFIX_PATH=${AWS_LC_PREFIX} # path to find crypto provided 
by aws-lc
+         -DCMAKE_C_FLAGS=${S2N_TLS_C_FLAGS})
 
     externalproject_add(s2n_tls_ep
                         ${EP_COMMON_OPTIONS}
diff --git 
a/dev/tasks/linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile 
b/dev/tasks/linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile
index 37f9e7bcad..6ac032739b 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-bookworm/Dockerfile
@@ -38,7 +38,6 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     build-essential \
-    ccache \
     clang \
     cmake \
     debhelper \
diff --git 
a/dev/tasks/linux-packages/apache-arrow/apt/debian-bullseye/Dockerfile 
b/dev/tasks/linux-packages/apache-arrow/apt/debian-bullseye/Dockerfile
index bf5c24c016..7509b293bb 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/debian-bullseye/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/debian-bullseye/Dockerfile
@@ -34,7 +34,6 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     build-essential \
-    ccache \
     clang \
     cmake \
     debhelper \
diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-bionic/Dockerfile 
b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-bionic/Dockerfile
index 12bc265b00..469fa02491 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-bionic/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-bionic/Dockerfile
@@ -32,7 +32,6 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     build-essential \
-    ccache \
     clang-10 \
     cmake \
     devscripts \
diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile 
b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile
index 0a76938267..951646ccd1 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-focal/Dockerfile
@@ -32,7 +32,6 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     build-essential \
-    ccache \
     clang \
     cmake \
     debhelper \
diff --git a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile 
b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile
index df36652c69..18f1ffd484 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-jammy/Dockerfile
@@ -32,7 +32,6 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     build-essential \
-    ccache \
     clang \
     cmake \
     debhelper \
diff --git 
a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-kinetic/Dockerfile 
b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-kinetic/Dockerfile
index b371bc7949..ebc0e60a81 100644
--- a/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-kinetic/Dockerfile
+++ b/dev/tasks/linux-packages/apache-arrow/apt/ubuntu-kinetic/Dockerfile
@@ -32,7 +32,6 @@ RUN \
   apt update ${quiet} && \
   apt install -y -V ${quiet} \
     build-essential \
-    ccache \
     clang \
     clang-tools \
     cmake \
diff --git a/dev/tasks/linux-packages/apache-arrow/debian/rules 
b/dev/tasks/linux-packages/apache-arrow/debian/rules
index c8d0628efa..8ff16a37e1 100755
--- a/dev/tasks/linux-packages/apache-arrow/debian/rules
+++ b/dev/tasks/linux-packages/apache-arrow/debian/rules
@@ -21,7 +21,7 @@ override_dh_auto_configure:
          ARROW_CUDA=OFF;                                       \
          ARROW_PLASMA=OFF;                                     \
        fi;                                                     \
-       if [ $$(arch) = "x86_64" ]; then                                \
+       if [ $$(arch) = "x86_64" ]; then                        \
          ARROW_FLIGHT=ON;                                      \
          ARROW_FLIGHT_SQL=ON;                                  \
        else                                                    \
diff --git a/dev/tasks/linux-packages/apt/build.sh 
b/dev/tasks/linux-packages/apt/build.sh
index 80566f5740..bc4c61e622 100755
--- a/dev/tasks/linux-packages/apt/build.sh
+++ b/dev/tasks/linux-packages/apt/build.sh
@@ -92,11 +92,13 @@ fi
 : ${DEB_BUILD_OPTIONS:="parallel=$(nproc)"}
 # DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS} noopt"
 export DEB_BUILD_OPTIONS
+df -h
 if [ "${DEBUG:-no}" = "yes" ]; then
   run debuild "${debuild_options[@]}" "${dpkg_buildpackage_options[@]}"
 else
   run debuild "${debuild_options[@]}" "${dpkg_buildpackage_options[@]}" > 
/dev/null
 fi
+df -h
 if which ccache > /dev/null 2>&1; then
   ccache --show-stats --verbose || :
 fi
diff --git a/dev/tasks/linux-packages/github.linux.amd64.yml 
b/dev/tasks/linux-packages/github.linux.amd64.yml
index d6488d5e71..f9e408f312 100644
--- a/dev/tasks/linux-packages/github.linux.amd64.yml
+++ b/dev/tasks/linux-packages/github.linux.amd64.yml
@@ -27,16 +27,18 @@ jobs:
       {{ macros.github_checkout_arrow()|indent }}
       {{ macros.github_login_dockerhub()|indent }}
 
+      - name: Free up disk space
+        run: |
+          df -h
+          # 5.3GB
+          sudo rm -rf /opt/hostedtoolcache/CodeQL || :
+          # 1.4GB
+          sudo rm -rf /opt/hostedtoolcache/go || :
+          df -h
       - name: Set up Ruby
         uses: ruby/setup-ruby@v1
         with:
           ruby-version: '3.1'
-      - name: Cache ccache
-        uses: actions/cache@v2
-        with:
-          path: arrow/dev/tasks/linux-packages/apache-arrow/{{ task_namespace 
}}/build/{{ target }}/ccache
-          key: linux-{{ task_namespace }}-ccache-{{ target }}-{{ "${{ 
hashFiles('arrow/cpp/**') }}" }}
-          restore-keys: linux-{{ task_namespace }}-ccache-{{ target }}-
       - name: Build
         run: |
           set -e
diff --git a/dev/tasks/linux-packages/yum/build.sh 
b/dev/tasks/linux-packages/yum/build.sh
index fad37e3c3c..264684bb16 100755
--- a/dev/tasks/linux-packages/yum/build.sh
+++ b/dev/tasks/linux-packages/yum/build.sh
@@ -129,6 +129,8 @@ run cp \
     /host/tmp/${PACKAGE}.spec \
     rpmbuild/SPECS/
 
+df -h
+
 run cat <<BUILD > build.sh
 #!/usr/bin/env bash
 
@@ -158,6 +160,8 @@ else
   fi
 fi
 
+df -h
+
 if which ccache > /dev/null 2>&1; then
   ccache --show-stats --verbose || :
 fi

Reply via email to