qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] meson: Use -fno-sanitize=function when available
@ 2024-07-28 15:44 Akihiko Odaki
  2024-07-28 23:54 ` Richard Henderson
  2024-08-16  5:59 ` Thomas Huth
  0 siblings, 2 replies; 4+ messages in thread
From: Akihiko Odaki @ 2024-07-28 15:44 UTC (permalink / raw)
  To: Alex Bennée, Philippe Mathieu-Daudé, Thomas Huth,
	Wainer dos Santos Moschetta, Beraldo Leal, Paolo Bonzini,
	Marc-André Lureau, Daniel P. Berrangé
  Cc: qemu-devel, Akihiko Odaki

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. Add it to meson.build for such. It is not removed from
.gitlab-ci.d/buildtest.yml because -fno-sanitize=function in meson.build
does not affect --extra-cflags due to argument ordering.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
Changes in v2:
- Dropped the change of: .gitlab-ci.d/buildtest.yml
- Link to v1: https://lore.kernel.org/r/20240714-function-v1-1-cc2acb4171ba@daynix.com
---
 meson.build                | 1 +
 .gitlab-ci.d/buildtest.yml | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index 5613b62a4f42..a4169c572ba9 100644
--- a/meson.build
+++ b/meson.build
@@ -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)
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index aa327824052d..d83e50abd933 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -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: 93b799fafd9170da3a79a533ea6f73a18de82e22
change-id: 20240714-function-7d32c723abbc

Best regards,
-- 
Akihiko Odaki <akihiko.odaki@daynix.com>



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] meson: Use -fno-sanitize=function when available
  2024-07-28 15:44 [PATCH v2] meson: Use -fno-sanitize=function when available Akihiko Odaki
@ 2024-07-28 23:54 ` Richard Henderson
  2024-08-16  6:03   ` Thomas Huth
  2024-08-16  5:59 ` Thomas Huth
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2024-07-28 23:54 UTC (permalink / raw)
  To: qemu-devel

On 7/29/24 01:44, Akihiko Odaki wrote:
> 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. Add it to meson.build for such. It is not removed from
> .gitlab-ci.d/buildtest.yml because -fno-sanitize=function in meson.build
> does not affect --extra-cflags due to argument ordering.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> Changes in v2:
> - Dropped the change of: .gitlab-ci.d/buildtest.yml
> - Link to v1: https://lore.kernel.org/r/20240714-function-v1-1-cc2acb4171ba@daynix.com
> ---
>   meson.build                | 1 +
>   .gitlab-ci.d/buildtest.yml | 1 -
>   2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 5613b62a4f42..a4169c572ba9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -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)
> diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
> index aa327824052d..d83e50abd933 100644
> --- a/.gitlab-ci.d/buildtest.yml
> +++ b/.gitlab-ci.d/buildtest.yml
> @@ -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: 93b799fafd9170da3a79a533ea6f73a18de82e22
> change-id: 20240714-function-7d32c723abbc
> 
> Best regards,

Doesn't work, because --extra-cflags comes last and overrides it.

I think we need to drop -fsanitize=undefined from --extra-cflags as well, and use 
--enable-sanitizers.  I think it should be ok to leave -fno-sanitize-recover=undefined in 
extra.


r~


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] meson: Use -fno-sanitize=function when available
  2024-07-28 15:44 [PATCH v2] meson: Use -fno-sanitize=function when available Akihiko Odaki
  2024-07-28 23:54 ` Richard Henderson
@ 2024-08-16  5:59 ` Thomas Huth
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2024-08-16  5:59 UTC (permalink / raw)
  To: Akihiko Odaki, Alex Bennée, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Beraldo Leal, Paolo Bonzini,
	Marc-André Lureau, Daniel P. Berrangé
  Cc: qemu-devel

On 28/07/2024 17.44, Akihiko Odaki wrote:
> 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. Add it to meson.build for such. It is not removed from
> .gitlab-ci.d/buildtest.yml because -fno-sanitize=function in meson.build
> does not affect --extra-cflags due to argument ordering.
> 
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> Changes in v2:
> - Dropped the change of: .gitlab-ci.d/buildtest.yml
> - Link to v1: https://lore.kernel.org/r/20240714-function-v1-1-cc2acb4171ba@daynix.com
> ---
>   meson.build                | 1 +
>   .gitlab-ci.d/buildtest.yml | 1 -
>   2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meson.build b/meson.build
> index 5613b62a4f42..a4169c572ba9 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -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)
> diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
> index aa327824052d..d83e50abd933 100644
> --- a/.gitlab-ci.d/buildtest.yml
> +++ b/.gitlab-ci.d/buildtest.yml
> @@ -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

I'm confused, in the patch description you say that buildtest.yml does not 
get changed anymore, but this hunk here does it anyway? Did you maybe send 
out v1 by accident again?

  Thomas




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] meson: Use -fno-sanitize=function when available
  2024-07-28 23:54 ` Richard Henderson
@ 2024-08-16  6:03   ` Thomas Huth
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2024-08-16  6:03 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel

On 29/07/2024 01.54, Richard Henderson wrote:
> On 7/29/24 01:44, Akihiko Odaki wrote:
>> 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. Add it to meson.build for such. It is not removed from
>> .gitlab-ci.d/buildtest.yml because -fno-sanitize=function in meson.build
>> does not affect --extra-cflags due to argument ordering.
>>
>> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
>> ---
>> Changes in v2:
>> - Dropped the change of: .gitlab-ci.d/buildtest.yml
>> - Link to v1: 
>> https://lore.kernel.org/r/20240714-function-v1-1-cc2acb4171ba@daynix.com
>> ---
>>   meson.build                | 1 +
>>   .gitlab-ci.d/buildtest.yml | 1 -
>>   2 files changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meson.build b/meson.build
>> index 5613b62a4f42..a4169c572ba9 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -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)
>> diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
>> index aa327824052d..d83e50abd933 100644
>> --- a/.gitlab-ci.d/buildtest.yml
>> +++ b/.gitlab-ci.d/buildtest.yml
>> @@ -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: 93b799fafd9170da3a79a533ea6f73a18de82e22
>> change-id: 20240714-function-7d32c723abbc
>>
>> Best regards,
> 
> Doesn't work, because --extra-cflags comes last and overrides it.
> 
> I think we need to drop -fsanitize=undefined from --extra-cflags as well, 
> and use --enable-sanitizers.  I think it should be ok to leave 
> -fno-sanitize-recover=undefined in extra.

That could be a solution, too, but I think the change in meson.build should 
then also be moved to the spot where -fsanitize=undefined is added.

  Thomas




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-16  6:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-28 15:44 [PATCH v2] meson: Use -fno-sanitize=function when available Akihiko Odaki
2024-07-28 23:54 ` Richard Henderson
2024-08-16  6:03   ` Thomas Huth
2024-08-16  5:59 ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).