Skip to content

Commit

Permalink
Let's use gcc10 when cross-compiling for LSE support (#11112)
Browse files Browse the repository at this point in the history
Motivation:

LSE (https://mysqlonarm.github.io/ARM-LSE-and-MySQL/) can have a huge performance difference. Let's ensure we use a compiler that can support it.

Modifications:

Update to gc10 when cross-compiling as it supports LSE and enables it by default

Result:

More optimized builds for aarch64
  • Loading branch information
normanmaurer committed Mar 25, 2021
1 parent d520809 commit 72d7ec9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
11 changes: 5 additions & 6 deletions docker/Dockerfile.cross_compile_aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7.6.1810

ARG gcc_version=4.9-2016.02
ARG gcc_version=10.2-2020.11
ENV GCC_VERSION $gcc_version

# Install requirements
Expand All @@ -9,10 +9,9 @@ RUN yum install -y wget tar git make redhat-lsb-core autoconf automake libtool g
# Install Java
RUN yum install -y java-1.8.0-openjdk-devel

# Install aarch64 gcc toolchain
RUN set -x && \
wget https://releases.linaro.org/components/toolchain/binaries/$GCC_VERSION/aarch64-linux-gnu/gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu.tar.xz && \
tar xvf gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu.tar.xz
# Install aarch64 gcc 10.2 toolchain
RUN wget https://developer.arm.com/-/media/Files/downloads/gnu-a/$GCC_VERSION/binrel/gcc-arm-$GCC_VERSION-x86_64-aarch64-none-linux-gnu.tar.xz && \
tar xvf gcc-arm-$GCC_VERSION-x86_64-aarch64-none-linux-gnu.tar.xz && mv gcc-arm-$GCC_VERSION-x86_64-aarch64-none-linux-gnu /opt/
ENV PATH="/opt/gcc-arm-$GCC_VERSION-x86_64-aarch64-none-linux-gnu/bin:${PATH}"

ENV PATH="/gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu/bin:${PATH}"
ENV JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk/"
2 changes: 1 addition & 1 deletion docker/docker-compose.centos-7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
context: ../
dockerfile: docker/Dockerfile.cross_compile_aarch64
args:
gcc_version: "4.9-2016.02"
gcc_version: "10.2-2020.11"
java_version: "adopt@1.8.0-272"

cross-compile-aarch64-common: &cross-compile-aarch64-common
Expand Down
1 change: 1 addition & 0 deletions transport-native-epoll/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@
<arg>${jni.compiler.args.cflags}</arg>
<configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg>
<configureArg>--host=aarch64-linux-gnu</configureArg>
<configureArg>CC=aarch64-none-linux-gnu-gcc</configureArg>
</configureArgs>
</configuration>
<goals>
Expand Down
4 changes: 2 additions & 2 deletions transport-native-unix-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@
<!-- use aarch_64 as this is also what os.detected.arch will use on an aarch64 system -->
<jni.classifier>${os.detected.name}-aarch_64</jni.classifier>
<jni.platform>linux</jni.platform>
<exe.compiler>aarch64-linux-gnu-gcc</exe.compiler>
<exe.archiver>aarch64-linux-gnu-ar</exe.archiver>
<exe.compiler>aarch64-none-linux-gnu-gcc</exe.compiler>
<exe.archiver>arch64-none-linux-gnu-ar</exe.archiver>
</properties>
<build>
<plugins>
Expand Down

0 comments on commit 72d7ec9

Please sign in to comment.