jjb: binutils-gdb: add macos build
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 25 Apr 2023 18:38:31 +0000 (14:38 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Tue, 25 Apr 2023 20:12:03 +0000 (16:12 -0400)
Add a macos job that only builds, but does not run tests.

Change-Id: Ie64a97a173153189ebe20b507a46f38c46d55139

jobs/binutils-gdb.yaml
scripts/binutils-gdb/build.sh

index 22a9f03c8171f3227c48c483861a2d0ed978cf71..36e52f7f7c78c41e8b801528041faaa861f9659f 100644 (file)
       - email:
           recipients: 'simon.marchi@efficios.com'
 
+- job-template:
+    name: binutils-gdb_{version}_macosbuild
+    defaults: binutils-gdb
+
+    <<: *binutils-gdb_matrix_axes_defaults
+    <<: *binutils-gdb_builders_defaults
+
+    publishers:
+      - email:
+          recipients: 'simon.marchi@efficios.com'
+
 - job-template:
     name: dev_gerrit_binutils-gdb_linuxbuild
     defaults: binutils-gdb
       - 'binutils-gdb_{version}_linuxbuild':
           platforms: !!python/tuple [jammy-amd64]
           target_boards: !!python/tuple ["unix", "native-gdbserver", "native-extended-gdbserver"]
+      - 'binutils-gdb_{version}_macosbuild':
+          platforms: !!python/tuple [macos-amd64, macos-arm64]
+          target_boards: !!python/tuple ["unix"]
 
 - project:
     name: gerrit-gdb
index 61fe515ed6329a6ea345c2d68720097c6d623e1c..765888c2fc08f1748de3cb0421c865f858bc2645 100755 (executable)
@@ -150,6 +150,18 @@ SRCDIR="$WORKSPACE/src/binutils-gdb"
 TMPDIR="$WORKSPACE/tmp"
 PREFIX="/build"
 
+function use_ccache()
+{
+    case "$platform" in
+    macos-*)
+        return 1
+        ;;
+    *)
+        return 0
+        ;;
+    esac
+}
+
 # Create tmp directory
 rm -rf "$TMPDIR"
 mkdir -p "$TMPDIR"
@@ -158,14 +170,31 @@ export TMPDIR
 export CFLAGS="-O2 -g -fsanitize=address"
 export CXXFLAGS="-O2 -g -fsanitize=address -D_GLIBCXX_DEBUG=1"
 export LDFLAGS="-fsanitize=address"
-export CC="ccache cc"
-export CXX="ccache c++"
+export CC="cc"
+export CXX="c++"
+
+if use_ccache; then
+       CC="ccache $CC"
+       CXX="ccache $CXX"
+fi
+
+# To make GDB find libcc1.so
+export LD_LIBRARY_PATH="/usr/lib/gcc/x86_64-linux-gnu/11:${LD_LIBRARY_PATH:-}"
 
 # Set platform variables
+export TAR=tar
+export MAKE=make
+
 case "$platform" in
+macos-*)
+    export NPROC="getconf _NPROCESSORS_ONLN"
+    export PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+    export CPPFLAGS="-I/opt/local/include"
+    export LDFLAGS="-L/opt/local/lib"
+    export PYTHON="python3.9"
+    export PYTHON_CONFIG="python3.9-config"
+    ;;
 *)
-    export MAKE=make
-    export TAR=tar
     export NPROC=nproc
     ;;
 esac
@@ -210,6 +239,12 @@ case "$conf" in
     ;;
 esac
 
+case "$platform" in
+macos-*)
+    CONF_OPTS+=("--disable-werror")
+    ;;
+esac
+
 # Build type
 # oot     : out-of-tree build
 # dist    : build via make dist
@@ -233,11 +268,18 @@ esac
 # We are now inside a configured build directory
 
 # BUILD!
-$MAKE -j "$($NPROC)" V=1 MAKEINFO=/bin/true
+$MAKE -j "$($NPROC)" V=1 MAKEINFO=true
 
 # Install in the workspace
 $MAKE install DESTDIR="$WORKSPACE"
 
+case "$platform" in
+macos-*)
+    # Stop there, don't run tests on macOS.
+    exit 0
+    ;;
+esac
+
 case "$target_board" in
 unix | native-gdbserver | native-extended-gdbserver)
     RUNTESTFLAGS="--target_board=$target_board"
This page took 0.028092 seconds and 4 git commands to generate.