1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

jit/cache tests: Avoid test failure on OpenBSD.

* modules/jit/cache-tests (Files): Add m4/warnings.m4.
(configure.ac): Set and substitute DISABLE_OPENBSD_RETGUARD.
(Makefile.am): Set test_cache_CFLAGS.
* tests/jit/test-cache.c (main): If the compiler defines _RET_PROTECTOR,
skip the test.
This commit is contained in:
Bruno Haible
2024-01-08 18:10:28 +01:00
parent 57b07295e1
commit c6e0b93347
3 changed files with 24 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ Files:
tests/jit/test-cache.c
tests/macros.h
m4/mmap-anon.m4
m4/warnings.m4
Status:
unportable-test
@@ -15,8 +16,14 @@ stdint
configure.ac:
AC_CHECK_HEADERS_ONCE([sys/mman.h])
gl_FUNC_MMAP_ANON
dnl Disable the OpenBSD "retguard" stack protector for this test.
gl_COMPILER_OPTION_IF([-fno-ret-protector],
[DISABLE_OPENBSD_RETGUARD='-fno-ret-protector'],
[DISABLE_OPENBSD_RETGUARD=])
AC_SUBST([DISABLE_OPENBSD_RETGUARD])
Makefile.am:
TESTS += test-cache
check_PROGRAMS += test-cache
test_cache_SOURCES = jit/test-cache.c
test_cache_CFLAGS = $(AM_CFLAGS) $(DISABLE_OPENBSD_RETGUARD)