Skip to content

Commit

Permalink
ci: add a CI job for compiling with clang
Browse files Browse the repository at this point in the history
  • Loading branch information
no92 committed Mar 23, 2024
1 parent 345f2af commit 554ea51
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 9 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ jobs:
matrix:
arch: [x86_64, riscv64, aarch64, x86]
builds: [mlibc, mlibc-static, mlibc-shared, mlibc-ansi-only, mlibc-headers-only]
compiler: [gcc, clang]
exclude:
- compiler: clang
include:
- arch: x86_64
builds: mlibc
compiler: clang
name: Build mlibc
runs-on: ubuntu-20.04
container:
Expand All @@ -18,7 +25,7 @@ jobs:
apt-get update
apt-get install -y ninja-build qemu-user \
python3-setuptools python3-jsonschema \
python3-pexpect python3-pip netbase
python3-pexpect python3-pip netbase clang lld
pip install --break-system-packages -U xbstrap pyexpect meson
- name: Prepare directories
run: |
Expand All @@ -39,6 +46,7 @@ jobs:
cat > bootstrap-site.yml << EOF
define_options:
arch: ${{matrix.arch}}
compiler: ${{matrix.compiler}}
EOF
xbstrap init ../src
working-directory: build/
Expand Down
18 changes: 10 additions & 8 deletions ci/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
declare_options:
- name: arch
default: x86_64
- name: compiler
default: gcc

sources:
- name: mlibc
Expand All @@ -13,7 +15,7 @@ sources:
format: 'tar.xz'
version: '6.1.8'

tools:
tools: []

packages:
- name: mlibc
Expand All @@ -28,14 +30,14 @@ packages:
- '--prefix=/usr'
- '--libdir=lib'
- '--buildtype=debugoptimized'
- "-Dc_args=['-Wno-error=maybe-uninitialized']"
- "-Dcpp_args=['-Wno-error=maybe-uninitialized']"
- "-Dc_args=['-Wno-error=maybe-uninitialized', '-Wno-unknown-warning-option']"
- "-Dcpp_args=['-Wno-error=maybe-uninitialized', '-Wno-unknown-warning-option']"
- "-Dbuild_tests=true"
- "-Db_sanitize=undefined"
- "-Ddefault_library=both"
- "-Dwerror=true"
- '-Dlinux_kernel_headers=@BUILD_ROOT@/packages/linux-headers/usr/include'
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:[email protected]"
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:arch@-@OPTION:compiler@.cross-file"
- '@THIS_SOURCE_DIR@'
environ:
CFLAGS: '-Wno-error=maybe-uninitialized'
Expand Down Expand Up @@ -66,7 +68,7 @@ packages:
- "-Ddefault_library=static"
- "-Dwerror=true"
- '-Dlinux_kernel_headers=@BUILD_ROOT@/packages/linux-headers/usr/include'
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:[email protected]"
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:arch@-@OPTION:compiler@.cross-file"
- '@THIS_SOURCE_DIR@'
build:
- args: ['ninja']
Expand All @@ -93,7 +95,7 @@ packages:
- "-Ddefault_library=shared"
- "-Dwerror=true"
- '-Dlinux_kernel_headers=@BUILD_ROOT@/packages/linux-headers/usr/include'
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:[email protected]"
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:arch@-@OPTION:compiler@.cross-file"
- '@THIS_SOURCE_DIR@'
build:
- args: ['ninja']
Expand Down Expand Up @@ -125,7 +127,7 @@ packages:
- "-Ddisable_glibc_option=true"
- "-Ddisable_bsd_option=true"
- '-Dlinux_kernel_headers=@BUILD_ROOT@/packages/linux-headers/usr/include'
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:[email protected]"
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:arch@-@OPTION:compiler@.cross-file"
- '@THIS_SOURCE_DIR@'
build:
- args: ['ninja']
Expand All @@ -152,7 +154,7 @@ packages:
- "-Dwerror=true"
- "-Dheaders_only=true"
- '-Dlinux_kernel_headers=@BUILD_ROOT@/packages/linux-headers/usr/include'
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:[email protected]"
- "--cross-file=@THIS_SOURCE_DIR@/ci/linux-@OPTION:arch@-@OPTION:compiler@.cross-file"
- '@THIS_SOURCE_DIR@'
build:
- args: ['ninja']
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions ci/linux-x86_64-clang.cross-file
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[binaries]
c = 'clang'
c_ld = 'lld'
cpp = 'clang++'
cpp_ld = 'lld'

[host_machine]
system = 'linux'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
File renamed without changes.

0 comments on commit 554ea51

Please sign in to comment.