Skip to content

Commit 84e723c

Browse files
committed
ci: Use clang for Linux builds
1 parent f6d9bb5 commit 84e723c

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/build-linux.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,21 @@ jobs:
1717
arch: [x86_64, aarch64]
1818
configuration: [debug, release]
1919
env:
20+
ARTIFACT_NAME: xemu-ubuntu-${{ matrix.arch }}-${{ matrix.configuration }}
2021
CCACHE_DIR: /tmp/xemu-ccache
2122
CCACHE_MAXSIZE: 512M
2223
XEMU_BUILD_OPTIONS: ${{ matrix.configuration == 'debug' && '--debug' || '' }}
23-
ARTIFACT_NAME: xemu-ubuntu-${{ matrix.arch }}-${{ matrix.configuration }}
2424
DEB_BUILD_MAINT_OPTIONS: optimize=-lto
25+
DEB_CFLAGS_MAINT_APPEND: -gdwarf-4 -gstrict-dwarf
26+
DEB_CXXFLAGS_MAINT_APPEND: -gdwarf-4 -gstrict-dwarf
27+
DEB_LDFLAGS_MAINT_APPEND: -Wl,--build-id=sha1
28+
CC: ccache clang-21
29+
CXX: ccache clang++-21
30+
CC_LD: lld-21
31+
CXX_LD: lld-21
32+
AR: llvm-ar-21
33+
RANLIB: llvm-ranlib-21
34+
NM: llvm-nm-21
2535
steps:
2636
- name: Initialize compiler cache
2737
id: cache
@@ -46,10 +56,19 @@ jobs:
4656
Built from ${{ inputs.pkg_version }})\n\
4757
-- Matt Borgerson <[email protected]> $(date -R)" > debian/changelog
4858
popd
59+
- name: Add LLVM APT repository
60+
run: |
61+
sudo install -d /etc/apt/keyrings
62+
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key \
63+
| sudo gpg --dearmor -o /etc/apt/keyrings/llvm.gpg
64+
sudo tee /etc/apt/sources.list.d/llvm.list <<EOF
65+
deb [signed-by=/etc/apt/keyrings/llvm.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main
66+
deb-src [signed-by=/etc/apt/keyrings/llvm.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-21 main
67+
EOF
4968
- name: Install dependencies
5069
run: |
5170
sudo apt-get -qy update
52-
sudo apt-get install ccache libfuse2 libusb-1.0-0-dev
71+
sudo apt-get install ccache libfuse2 libusb-1.0-0-dev clang-21 lld-21 llvm-21-dev
5372
pushd src
5473
sudo apt-get -qy build-dep .
5574
- name: Setup ccache

0 commit comments

Comments
 (0)