File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ Check and configure compilation options.
44
55include_guard (GLOBAL )
66
7- include (CheckLinkerFlag)
87include (CheckSourceRuns)
98include (CMakePushCheckState)
109include (PHP/CheckCompilerFlag)
@@ -365,12 +364,18 @@ if(PHP_UNDEFINED_SANITIZER)
365364 # args cannot be cast to void*. In that case, set -fno-sanitize=function.
366365 if (NOT CMAKE_CROSSCOMPILING )
367366 cmake_push_check_state(RESET)
368- set (CMAKE_REQUIRED_FLAGS -fno-sanitize-recover=undefined)
367+ set (
368+ CMAKE_REQUIRED_FLAGS
369+ "-fsanitize=undefined -fno-sanitize-recover=undefined"
370+ )
369371 check_source_runs(C [[
370- void foo(char *string) {}
372+ void foo(char *string) {
373+ (void)string;
374+ }
371375 int main(void) {
372376 void (*f)(void *) = (void (*)(void *))foo;
373377 f("foo");
378+ return 0;
374379 }
375380 ]] _php_ubsan_works)
376381 cmake_pop_check_state()
You can’t perform that action at this time.
0 commit comments