Skip to content

Commit 5b331db

Browse files
committed
CI: update list of compilers
Try using latest gcc and clang versions. We still care about RHEL7: since handling a RHEL7 runner on GitHub is quite complex, let try to use a similar version of gcc, at least
1 parent 149067b commit 5b331db

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ jobs:
8989
nBPF: [""]
9090
lto_gold_linker: [""]
9191
include:
92-
- compiler: "gcc-7" # "Oldest" gcc easily available
92+
- compiler: "gcc-4.9" # "Oldest" gcc easily available. To simulate RHEL7
9393
os: ubuntu-20.04
9494
arch: "x86_64"
9595
gcrypt: ""
9696
pcre: "--with-pcre2"
9797
maxminddb: "--with-maxminddb"
9898
msan: "--with-sanitizer"
9999
nBPF: ""
100-
- compiler: "gcc-12" # "Newest" gcc easily available
100+
- compiler: "gcc-13" # "Newest" gcc easily available
101101
os: ubuntu-22.04
102102
arch: "x86_64"
103103
gcrypt: ""
@@ -114,9 +114,9 @@ jobs:
114114
maxminddb: "--with-maxminddb"
115115
msan: "--with-sanitizer"
116116
nBPF: ""
117-
- compiler: "clang-14" # "Newest" clang easily available
118-
ar: "llvm-ar-14"
119-
ranlib: "llvm-ranlib-14"
117+
- compiler: "clang-17" # "Newest" clang easily available
118+
ar: "llvm-ar-17"
119+
ranlib: "llvm-ranlib-17"
120120
os: ubuntu-22.04
121121
arch: "x86_64"
122122
gcrypt: ""
@@ -141,7 +141,7 @@ jobs:
141141
maxminddb: "--with-maxminddb"
142142
msan: "--with-sanitizer"
143143
nBPF: "nBPF"
144-
- compiler: "clang-14"
144+
- compiler: "clang-17"
145145
os: ubuntu-22.04
146146
arch: "x86_64"
147147
gcrypt: ""
@@ -226,9 +226,22 @@ jobs:
226226
make
227227
cd -
228228
- name: Setup Ubuntu specified compiler
229-
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && ! startsWith(matrix.compiler, 'cc')
230-
run: |
229+
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && ! startsWith(matrix.compiler, 'cc') && ! startsWith(matrix.compiler, 'clang-17')
230+
run: |
231+
#For gcc-4.9 (on ubuntu-20.04)
232+
echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" | sudo tee -a /etc/apt/sources.list
233+
echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe" | sudo tee -a /etc/apt/sources.list
234+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
235+
#For gcc-13 (on ubuntu-22.04)
236+
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
237+
sudo apt-get update
231238
sudo apt-get install ${{ matrix.compiler }}
239+
- name: Setup Ubuntu specified (newest) compiler
240+
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'clang-17')
241+
run: |
242+
wget https://apt.llvm.org/llvm.sh
243+
chmod u+x llvm.sh
244+
sudo ./llvm.sh 17
232245
- name: Install Windows msys2 prerequisites
233246
if: startsWith(matrix.os, 'windows')
234247
uses: msys2/setup-msys2@v2

configure.ac

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,14 @@ AS_IF([test "${with_sanitizer+set}" = set -o "${with_thread_sanitizer+set}" = se
6464
])
6565

6666
AS_IF([test "${with_sanitizer+set}" = set],[
67-
NDPI_CFLAGS="${NDPI_CFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer"
68-
NDPI_LDFLAGS="${NDPI_LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak"
67+
NDPI_CFLAGS="${NDPI_CFLAGS} -fsanitize=address -fsanitize=undefined -fsanitize=leak -fno-omit-frame-pointer"
68+
NDPI_LDFLAGS="${NDPI_LDFLAGS} -fsanitize=address -fsanitize=undefined -fsanitize=leak"
69+
#Sanitizers should work on any compilers that we support (or that we test on CI, at least)
70+
#Exception: "-fsanitize=alignment" is not supported in gcc 4.9
71+
AX_CHECK_COMPILE_FLAG([-fno-sanitize=alignment], [
72+
NDPI_CFLAGS="${NDPI_CFLAGS} -fno-sanitize=alignment"
73+
NDPI_LDFLAGS="${NDPI_LDFLAGS} -fno-sanitize=alignment"
74+
])
6975
])
7076

7177
AS_IF([test "${with_thread_sanitizer+set}" = set],[

0 commit comments

Comments
 (0)