[v5,4/4] ci: add aarch64 -> arm32 cross compiling jobs
diff mbox series

Message ID 1594024094-15515-5-git-send-email-juraj.linkes@pantheon.tech
State Deferred
Delegated to: David Marchand
Headers show
Series
  • aarch64 -> arm32 cross compilation support
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/travis-robot warning Travis build: failed
ci/checkpatch success coding style OK

Commit Message

Juraj Linkeš July 6, 2020, 8:28 a.m. UTC
Add two jobs (static and shared libs), both building on aarch64 and
producing 32 bit arm binaries. Do not run tests in these jobs.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
---
 .ci/linux-build.sh |  7 ++++++-
 .travis.yml        | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

Comments

Juraj Linkeš July 6, 2020, 9:11 a.m. UTC | #1
> -----Original Message-----
> From: Juraj Linkeš <juraj.linkes@pantheon.tech>
> Sent: Monday, July 6, 2020 10:28 AM
> To: bruce.richardson@intel.com; aconole@redhat.com;
> maicolgabriel@hotmail.com
> Cc: dev@dpdk.org; Juraj Linkeš <juraj.linkes@pantheon.tech>
> Subject: [PATCH v5 4/4] ci: add aarch64 -> arm32 cross compiling jobs
> 
> Add two jobs (static and shared libs), both building on aarch64 and producing 32
> bit arm binaries. Do not run tests in these jobs.
> 
> Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
> ---
>  .ci/linux-build.sh |  7 ++++++-
>  .travis.yml        | 19 +++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index d079801d7..e5407fb37
> 100755
> --- a/.ci/linux-build.sh
> +++ b/.ci/linux-build.sh
> @@ -33,6 +33,11 @@ if [ "$AARCH64" = "1" ]; then
>      OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
>  fi
> 
> +if [ "$ARM" = "1" ]; then
> +    # convert the arch specifier
> +    OPTS="$OPTS --cross-file config/arm/arm_armv7a_linux_gcc"
> +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 [ "$(uname -m)" = "x86_64" ]; then
>      devtools/test-null.sh
>  fi
> 

Now that I think about this a bit more, shouldn't this check be "if this is a native build, run test-null.sh?". If so, should we do something like this?
if file build/app/dpdk-testpmd | sed 's/-/_/g' | grep -q "$(uname -m)"; then
    devtools/test-null.sh
fi

The sed is there because file returns x86-64 and uname returns x86_64.

What do you think?

> diff --git a/.travis.yml b/.travis.yml
> index 14f812423..baba29539 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -21,6 +21,10 @@ _aarch64_packages: &aarch64_packages
>    - *required_packages
>    - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-
> gnu]
> 
> +_arm_packages: &arm_packages
> +  - *required_packages
> +  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross,
> +pkg-config-arm-linux-gnueabihf]
> +
>  _libabigail_build_packages: &libabigail_build_packages
>    - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
> 
> @@ -124,6 +128,21 @@ jobs:
>          packages:
>            - *required_packages
>            - *libabigail_build_packages
> +  # aarch64 cross-compiling arm jobs
> +  - env: DEF_LIB="shared" ARM=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_packages
> +  - env: DEF_LIB="static" ARM=1
> +    arch: arm64
> +    compiler: gcc
> +    addons:
> +      apt:
> +        packages:
> +          - *arm_packages
>    # aarch64 clang jobs
>    - env: DEF_LIB="static"
>      arch: arm64
> --
> 2.20.1

Patch
diff mbox series

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index d079801d7..e5407fb37 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -33,6 +33,11 @@  if [ "$AARCH64" = "1" ]; then
     OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
 fi
 
+if [ "$ARM" = "1" ]; then
+    # convert the arch specifier
+    OPTS="$OPTS --cross-file config/arm/arm_armv7a_linux_gcc"
+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 [ "$(uname -m)" = "x86_64" ]; then
     devtools/test-null.sh
 fi
 
diff --git a/.travis.yml b/.travis.yml
index 14f812423..baba29539 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,10 @@  _aarch64_packages: &aarch64_packages
   - *required_packages
   - [gcc-aarch64-linux-gnu, libc6-dev-arm64-cross, pkg-config-aarch64-linux-gnu]
 
+_arm_packages: &arm_packages
+  - *required_packages
+  - [gcc-arm-linux-gnueabihf, libc6-dev-armhf-cross, pkg-config-arm-linux-gnueabihf]
+
 _libabigail_build_packages: &libabigail_build_packages
   - [autoconf, automake, libtool, pkg-config, libxml2-dev, libdw-dev]
 
@@ -124,6 +128,21 @@  jobs:
         packages:
           - *required_packages
           - *libabigail_build_packages
+  # aarch64 cross-compiling arm jobs
+  - env: DEF_LIB="shared" ARM=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_packages
+  - env: DEF_LIB="static" ARM=1
+    arch: arm64
+    compiler: gcc
+    addons:
+      apt:
+        packages:
+          - *arm_packages
   # aarch64 clang jobs
   - env: DEF_LIB="static"
     arch: arm64