[v2,2/3] ci: add aarch64 clang cross-compilation builds

Message ID 1601548239-2990-3-git-send-email-juraj.linkes@pantheon.tech (mailing list archive)
State Superseded, archived
Headers
Series aarch64 clang cross compilation |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Juraj Linkeš Oct. 1, 2020, 10:30 a.m. UTC
  Mirror the existing gcc jobs - build static and shared libs.
Use arm64_armv8_linux_clang_ubuntu1804 meson cross file.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  9 +++++++--
 .travis.yml        | 22 ++++++++++++++++++++--
 2 files changed, 27 insertions(+), 4 deletions(-)
  

Comments

Aaron Conole Oct. 1, 2020, 1:31 p.m. UTC | #1
Juraj Linkeš <juraj.linkes@pantheon.tech> writes:

> Mirror the existing gcc jobs - build static and shared libs.
> Use arm64_armv8_linux_clang_ubuntu1804 meson cross file.
>
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .ci/linux-build.sh |  9 +++++++--
>  .travis.yml        | 22 ++++++++++++++++++++--
>  2 files changed, 27 insertions(+), 4 deletions(-)
>
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
> index d079801d7..137f51e91 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -28,11 +28,16 @@ install_libabigail() {
>      rm ${version}.tar.gz
>  }
>  
> -if [ "$AARCH64" = "1" ]; then
> +if [ "$AARCH64_GCC" = "1" ]; then

Why do we need to do this?

CC_FOR_BUILD and CC should be either 'gcc' or 'clang' - so we could just
key off of those instead of having to do this new set of variables, yes?

>      # convert the arch specifier
>      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
>  fi
>  
> +if [ "$AARCH64_CLANG" = "1" ]; then
> +    # convert the arch specifier
> +    OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804"
> +fi
> +
>  if [ "$BUILD_DOCS" = "1" ]; then
>      OPTS="$OPTS -Denable_docs=true"
>  fi
> @@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
>  meson build --werror $OPTS
>  ninja -C build
>  
> -if [ "$AARCH64" != "1" ]; then
> +if [ "$AARCH64_GCC" != "1" ] && [ "$AARCH64_CLANG" != 1 ]; then
>      devtools/test-null.sh
>  fi
>  
> diff --git a/.travis.yml b/.travis.yml
> index d6eeab371..1f769d823 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -18,6 +18,10 @@ _aarch64_packages: &aarch64_packages
>    - *required_packages
>    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
>  
> +_aarch64_clang_packages: &aarch64_clang_packages
> +  - *required_packages
> +  - [libgcc-8-dev-arm64-cross, libatomic1-arm64-cross, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
> +
>  _build_32b_packages: &build_32b_packages
>    - *required_packages
>    - [gcc-multilib]
> @@ -69,20 +73,34 @@ jobs:
>          packages:
>            - *build_32b_packages
>    # x86_64 cross-compiling aarch64 jobs
> -  - env: DEF_LIB="static" AARCH64=1
> +  - env: DEF_LIB="static" AARCH64_GCC=1
>      arch: amd64
>      compiler: gcc
>      addons:
>        apt:
>          packages:
>            - *aarch64_packages
> -  - env: DEF_LIB="shared" AARCH64=1
> +  - env: DEF_LIB="shared" AARCH64_GCC=1
>      arch: amd64
>      compiler: gcc
>      addons:
>        apt:
>          packages:
>            - *aarch64_packages
> +  - env: DEF_LIB="static" AARCH64_CLANG=1
> +    arch: amd64
> +    compiler: clang
> +    addons:
> +      apt:
> +        packages:
> +          - *aarch64_clang_packages
> +  - env: DEF_LIB="shared" AARCH64_CLANG=1
> +    arch: amd64
> +    compiler: clang
> +    addons:
> +      apt:
> +        packages:
> +          - *aarch64_clang_packages
>    # aarch64 gcc jobs
>    - env: DEF_LIB="static"
>      arch: arm64
  
Juraj Linkeš Oct. 1, 2020, 2:43 p.m. UTC | #2
> -----Original Message-----
> From: Aaron Conole <aconole@redhat.com>
> Sent: Thursday, October 1, 2020 3:32 PM
> To: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Cc: thomas@monjalon.net; david.marchand@redhat.com;
> maicolgabriel@hotmail.com; dev@dpdk.org
> Subject: Re: [PATCH v2 2/3] ci: add aarch64 clang cross-compilation builds
> 
> Juraj Linkeš <juraj.linkes@pantheon.tech> writes:
> 
> > Mirror the existing gcc jobs - build static and shared libs.
> > Use arm64_armv8_linux_clang_ubuntu1804 meson cross file.
> >
> > Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> > ---
> >  .ci/linux-build.sh |  9 +++++++--
> >  .travis.yml        | 22 ++++++++++++++++++++--
> >  2 files changed, 27 insertions(+), 4 deletions(-)
> >
> > diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index
> > d079801d7..137f51e91 100755
> > --- a/.ci/linux-build.sh
> > +++ b/.ci/linux-build.sh
> > @@ -28,11 +28,16 @@ install_libabigail() {
> >      rm ${version}.tar.gz
> >  }
> >
> > -if [ "$AARCH64" = "1" ]; then
> > +if [ "$AARCH64_GCC" = "1" ]; then
> 
> Why do we need to do this?
> 
> CC_FOR_BUILD and CC should be either 'gcc' or 'clang' - so we could just key off
> of those instead of having to do this new set of variables, yes?
> 

I didn't think of these variables. I'll make use of them, that's better, thanks.

> >      # convert the arch specifier
> >      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
> >  fi
> >
> > +if [ "$AARCH64_CLANG" = "1" ]; then
> > +    # convert the arch specifier
> > +    OPTS="$OPTS --cross-file
> config/arm/arm64_armv8_linux_clang_ubuntu1804"
> > +fi
> > +
> >  if [ "$BUILD_DOCS" = "1" ]; then
> >      OPTS="$OPTS -Denable_docs=true"
> >  fi
> > @@ -53,7 +58,7 @@ OPTS="$OPTS --buildtype=debugoptimized"
> >  meson build --werror $OPTS
> >  ninja -C build
> >
> > -if [ "$AARCH64" != "1" ]; then
> > +if [ "$AARCH64_GCC" != "1" ] && [ "$AARCH64_CLANG" != 1 ]; then
> >      devtools/test-null.sh
> >  fi
> >
> > diff --git a/.travis.yml b/.travis.yml index d6eeab371..1f769d823
> > 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -18,6 +18,10 @@ _aarch64_packages: &aarch64_packages
> >    - *required_packages
> >    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross,
> > pkg-config-aarch64-linux-gnu]
> >
> > +_aarch64_clang_packages: &aarch64_clang_packages
> > +  - *required_packages
> > +  - [libgcc-8-dev-arm64-cross, libatomic1-arm64-cross,
> > +libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
> > +
> >  _build_32b_packages: &build_32b_packages
> >    - *required_packages
> >    - [gcc-multilib]
> > @@ -69,20 +73,34 @@ jobs:
> >          packages:
> >            - *build_32b_packages
> >    # x86_64 cross-compiling aarch64 jobs
> > -  - env: DEF_LIB="static" AARCH64=1
> > +  - env: DEF_LIB="static" AARCH64_GCC=1
> >      arch: amd64
> >      compiler: gcc
> >      addons:
> >        apt:
> >          packages:
> >            - *aarch64_packages
> > -  - env: DEF_LIB="shared" AARCH64=1
> > +  - env: DEF_LIB="shared" AARCH64_GCC=1
> >      arch: amd64
> >      compiler: gcc
> >      addons:
> >        apt:
> >          packages:
> >            - *aarch64_packages
> > +  - env: DEF_LIB="static" AARCH64_CLANG=1
> > +    arch: amd64
> > +    compiler: clang
> > +    addons:
> > +      apt:
> > +        packages:
> > +          - *aarch64_clang_packages
> > +  - env: DEF_LIB="shared" AARCH64_CLANG=1
> > +    arch: amd64
> > +    compiler: clang
> > +    addons:
> > +      apt:
> > +        packages:
> > +          - *aarch64_clang_packages
> >    # aarch64 gcc jobs
> >    - env: DEF_LIB="static"
> >      arch: arm64
>
  

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..137f51e91 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -28,11 +28,16 @@  install_libabigail() {
     rm ${version}.tar.gz
 }
 
-if [ "$AARCH64" = "1" ]; then
+if [ "$AARCH64_GCC" = "1" ]; then
     # convert the arch specifier
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$AARCH64_CLANG" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_clang_ubuntu1804"
+fi
+
 if [ "$BUILD_DOCS" = "1" ]; then
     OPTS="$OPTS -Denable_docs=true"
 fi
@@ -53,7 +58,7 @@  OPTS="$OPTS --buildtype=debugoptimized"
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "1" ]; then
+if [ "$AARCH64_GCC" != "1" ] && [ "$AARCH64_CLANG" != 1 ]; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index d6eeab371..1f769d823 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,10 @@  _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_aarch64_clang_packages: &aarch64_clang_packages
+  - *required_packages
+  - [libgcc-8-dev-arm64-cross, libatomic1-arm64-cross, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
+
 _build_32b_packages: &build_32b_packages
   - *required_packages
   - [gcc-multilib]
@@ -69,20 +73,34 @@  jobs:
         packages:
           - *build_32b_packages
   # x86_64 cross-compiling aarch64 jobs
-  - env: DEF_LIB="static" AARCH64=1
+  - env: DEF_LIB="static" AARCH64_GCC=1
     arch: amd64
     compiler: gcc
     addons:
       apt:
         packages:
           - *aarch64_packages
-  - env: DEF_LIB="shared" AARCH64=1
+  - env: DEF_LIB="shared" AARCH64_GCC=1
     arch: amd64
     compiler: gcc
     addons:
       apt:
         packages:
           - *aarch64_packages
+  - env: DEF_LIB="static" AARCH64_CLANG=1
+    arch: amd64
+    compiler: clang
+    addons:
+      apt:
+        packages:
+          - *aarch64_clang_packages
+  - env: DEF_LIB="shared" AARCH64_CLANG=1
+    arch: amd64
+    compiler: clang
+    addons:
+      apt:
+        packages:
+          - *aarch64_clang_packages
   # aarch64 gcc jobs
   - env: DEF_LIB="static"
     arch: arm64