mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-06 00:29:07 +08:00
ci: turn on the alignment check
to catch issues like https://github.com/libbpf/libbpf/issues/391
This commit is contained in:
committed by
Andrii Nakryiko
parent
ea10235072
commit
14414c6ea5
@@ -17,6 +17,16 @@ mkdir -p "$OUT"
|
|||||||
|
|
||||||
export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
|
export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
|
||||||
|
|
||||||
|
# The alignment check is turned off by default on OSS-Fuzz/CFLite so it should be
|
||||||
|
# turned on explicitly there. It was borrowed from
|
||||||
|
# https://github.com/google/oss-fuzz/pull/7092
|
||||||
|
if [[ "$SANITIZER" == undefined ]]; then
|
||||||
|
additional_ubsan_checks=alignment
|
||||||
|
UBSAN_FLAGS="-fsanitize=$additional_ubsan_checks -fno-sanitize-recover=$additional_ubsan_checks"
|
||||||
|
CFLAGS+=" $UBSAN_FLAGS"
|
||||||
|
CXXFLAGS+=" $UBSAN_FLAGS"
|
||||||
|
fi
|
||||||
|
|
||||||
# Ideally libbelf should be built using release tarballs available
|
# Ideally libbelf should be built using release tarballs available
|
||||||
# at https://sourceware.org/elfutils/ftp/. Unfortunately sometimes they
|
# at https://sourceware.org/elfutils/ftp/. Unfortunately sometimes they
|
||||||
# fail to compile (for example, elfutils-0.185 fails to compile with LDFLAGS enabled
|
# fail to compile (for example, elfutils-0.185 fails to compile with LDFLAGS enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user