Skip to contentSkip to conversation

meson: Use -fno-sanitize=function when available

PATCH Applied Akihiko Odaki 3 participants 4 messages Jul 14, 2024 – Jul 16, 2024 Arm/Amlogic Meson SoC support

v1 of 4 Applied Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: Use -fno-sanitize=function when available

Commit 23ef50ae2d0c (".gitlab-ci.d/buildtest.yml: Use -fno-sanitize=function in the clang-system job") adds -fno-sanitize=function for the CI but doesn't add the flag in the other context. Move it to meson.build.

---
 meson.build                | 1 +
 .gitlab-ci.d/buildtest.yml | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -0
index 6a93da48e1b5..80447833f07a 100644
@@ -609,6 +609,7 @@ if host_os != 'openbsd' and \
 endif
 
 qemu_common_flags += cc.get_supported_arguments(hardening_flags)
+qemu_common_flags += cc.get_supported_arguments('-fno-sanitize=function')
 
 add_global_arguments(qemu_common_flags, native: false, language: all_languages)
 add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
.gitlab-ci.d/buildtest.yml +0 -1
index e3a0758bd9e5..a57822d65182 100644
@@ -430,7 +430,6 @@ clang-system:
     IMAGE: fedora
     CONFIGURE_ARGS: --cc=clang --cxx=clang++
       --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
-      --extra-cflags=-fno-sanitize=function
     TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu
     MAKE_CHECK_ARGS: check-qtest check-tcg
 

---
base-commit: f2cb4026fccfe073f84a4b440e41d3ed0c3134f6
change-id: 20240714-function-7d32c723abbc

Best regards,

Signature · 1 line
Akihiko Odaki <[email protected]>
#1 lore raw
Quoted 16 lines · Akihiko Odaki

Commit 23ef50ae2d0c (".gitlab-ci.d/buildtest.yml: Use

(quoted diff) +0 -2
-fno-sanitize=function in the clang-system job") adds
-fno-sanitize=function for the CI but doesn't add the flag in the

other context. Move it to meson.build.

---
 meson.build                | 1 +
 .gitlab-ci.d/buildtest.yml | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
meson.build +0 -0
index 6a93da48e1b5..80447833f07a 100644

meson.build if host_os != 'openbsd' and \ · line 613

Quoted 5 lines
meson.build +1 -0
@@ -609,6 +609,7 @@ if host_os != 'openbsd' and \
 endif
 
 qemu_common_flags += cc.get_supported_arguments(hardening_flags)
+qemu_common_flags +=
 cc.get_supported_arguments('-fno-sanitize=function')

What about checking the other hardening flags?

Quoted 21 lines
meson.build +0 -0
 add_global_arguments(qemu_common_flags, native: false, language: all_languages)
 add_global_link_arguments(qemu_ldflags, native: false, language: all_languages)
.gitlab-ci.d/buildtest.yml +0 -2
index e3a0758bd9e5..a57822d65182 100644
@@ -430,7 +430,6 @@ clang-system:
     IMAGE: fedora
     CONFIGURE_ARGS: --cc=clang --cxx=clang++
       --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
-      --extra-cflags=-fno-sanitize=function
     TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu
     MAKE_CHECK_ARGS: check-qtest check-tcg
 
 
---

base-commit: f2cb4026fccfe073f84a4b440e41d3ed0c3134f6
change-id: 20240714-function-7d32c723abbc

Best regards,

Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#2 lore raw
Quoted 20 lines · Alex Bennée
Quoted 18 lines · Akihiko Odaki

Commit 23ef50ae2d0c (".gitlab-ci.d/buildtest.yml: Use

(quoted diff) +0 -2
-fno-sanitize=function in the clang-system job") adds
-fno-sanitize=function for the CI but doesn't add the flag in the

other context. Move it to meson.build.

---
  meson.build                | 1 +
  .gitlab-ci.d/buildtest.yml | 1 -
  2 files changed, 1 insertion(+), 1 deletion(-)
meson.build +0 -0
index 6a93da48e1b5..80447833f07a 100644
@@ -609,6 +609,7 @@ if host_os != 'openbsd' and \
  endif
 
Quoted 5 lines

meson.build if host_os != 'openbsd' and \ · line 613

Quoted 3 lines
meson.build +1 -0
  qemu_common_flags += cc.get_supported_arguments(hardening_flags)
+qemu_common_flags +=
  cc.get_supported_arguments('-fno-sanitize=function')

What about checking the other hardening flags?

-fsanitize=function is the only hardening flag that we decided to disable for now. Context:
https://lore.kernel.org/qemu-devel/[email protected]/