]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ci: add build coverage for riscv64 42431/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Fri, 29 May 2026 17:17:25 +0000 (18:17 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 2 Jun 2026 12:20:29 +0000 (13:20 +0100)
This is already a primary architecture in Ubuntu, and more distributions
are adding support for it. It's too slow for emulation, but we can at
least verify that compilation works.

Use the arm worker, for two reasons:

- it is already set up with ports.ubuntu.com so we don't have to muck
  with apt sources manually
- it is used a lot less than the x86 worker

.github/workflows/build-test.sh
.github/workflows/build-test.yml
.github/workflows/riscv64-gcc.cross [new file with mode: 0644]

index 784340ec4501919d519e6b4eea4ce251f7d21fba..9c3d2e73382e2d2aca2c6c93c6255e43b4237b34 100755 (executable)
@@ -96,6 +96,9 @@ if [[ -n "$CROSS_ARCH" ]]; then
         armhf)
             triplet=arm-linux-gnueabihf
             ;;
+        riscv64)
+            triplet=riscv64-linux-gnu
+            ;;
         *)
             fatal "Unsupported cross architecture: $CROSS_ARCH"
             ;;
index 2596b3edb5e9d671425e96152b69064d29e296c4..a5b202713956bc1f234f7aaae8fa9bdb6dae807c 100644 (file)
@@ -42,6 +42,9 @@ jobs:
           - env: { COMPILER: "gcc",   COMPILER_VERSION: "13", LINKER: "bfd", CROSS_ARCH: "armhf"  }
             runner: [ ubuntu-24.04-arm ]
             python-version: ''
+          - env: { COMPILER: "gcc",   COMPILER_VERSION: "13", LINKER: "bfd", CROSS_ARCH: "riscv64"  }
+            runner: [ ubuntu-24.04-arm ]
+            python-version: ''
           - env: { COMPILER: "clang", COMPILER_VERSION: "18", LINKER: "lld"  }
             runner: [ ubuntu-24.04-s390x ]
             python-version: ''
diff --git a/.github/workflows/riscv64-gcc.cross b/.github/workflows/riscv64-gcc.cross
new file mode 100644 (file)
index 0000000..8096e45
--- /dev/null
@@ -0,0 +1,21 @@
+[binaries]
+c = 'riscv64-linux-gnu-gcc'
+cpp = 'riscv64-linux-gnu-g++'
+ar = 'riscv64-linux-gnu-gcc-ar'
+nm = 'riscv64-linux-gnu-gcc-nm'
+strip = 'riscv64-linux-gnu-strip'
+pkgconfig = 'pkg-config'
+
+[properties]
+needs_exe_wrapper = true
+pkg_config_libdir = '/usr/lib/riscv64-linux-gnu/pkgconfig:/usr/share/pkgconfig'
+c_args = ['-O2', '-pipe', '-g', '-feliminate-unused-debug-types']
+c_link_args = ['-fuse-ld=bfd', '-Wl,-O1', '-Wl,--hash-style=gnu', '-Wl,--as-needed', '-Wl,-z,relro,-z,now,-z,noexecstack']
+cpp_args = []
+cpp_link_args = ['-fuse-ld=bfd', '-Wl,-O1', '-Wl,--hash-style=gnu', '-Wl,--as-needed', '-Wl,-z,relro,-z,now,-z,noexecstack']
+
+[host_machine]
+system = 'linux'
+cpu_family = 'riscv64'
+cpu = 'riscv64'
+endian = 'little'