From: "Daniel P. Berrangé" <berrange@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, "Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Ed Maste" <emaste@freebsd.org>, "Thomas Huth" <thuth@redhat.com>,
"Li-Wen Hsu" <lwhsu@freebsd.org>,
"Yonggang Luo" <luoyonggang@gmail.com>,
"Warner Losh" <imp@bsdimp.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Kohei Tokunaga" <ktokunaga.mail@gmail.com>,
"Kyle Evans" <kevans@freebsd.org>
Subject: Re: [PATCH 16/24] build-sys: cfi_debug and safe_stack are not compatible
Date: Fri, 19 Sep 2025 15:25:42 +0100 [thread overview]
Message-ID: <aM1n5j0WzFVaaqVK@redhat.com> (raw)
In-Reply-To: <20250919133320.240145-17-marcandre.lureau@redhat.com>
On Fri, Sep 19, 2025 at 05:33:10PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> It fails to link on fedora >= 41:
> /usr/bin/ld: /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.safestack.a(safestack.cpp.o): in function `__sanitizer_internal_memcpy':
> (.text.__sanitizer_internal_memcpy+0x0): multiple definition of `__sanitizer_internal_memcpy'; /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.ubsan_standalone.a(sanitizer_libc.cpp.o):(.text.__sanitizer_internal_memcpy+0x0): first defined here
> /usr/bin/ld: /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.safestack.a(safestack.cpp.o): in function `__sanitizer_internal_memmove':
> (.text.__sanitizer_internal_memmove+0x0): multiple definition of `__sanitizer_internal_memmove'; /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.ubsan_standalone.a(sanitizer_libc.cpp.o):(.text.__sanitizer_internal_memmove+0x0): first defined here
> /usr/bin/ld: /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.safestack.a(safestack.cpp.o): in function `__sanitizer_internal_memset':
> (.text.__sanitizer_internal_memset+0x0): multiple definition of `__sanitizer_internal_memset'; /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.ubsan_standalone.a(sanitizer_libc.cpp.o):(.text.__sanitizer_internal_memset+0x0): first defined here
>
> cfi_debug seems to pull ubsan which has conflicting symbols with safe_stack.
If this is caused by the switch of dockerfiles from Fedora 40 to 41,
then this commit should be ordered earlier in the series before that
switch so that we are bisectable.
Also if this is a regression in F41 it is probably worth a bug report
against clang in Fedora, that could be referenced in the commit msg.
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> meson.build | 16 ++++++++++------
> .gitlab-ci.d/buildtest.yml | 6 +++---
> 2 files changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 6ade30f36a..856c8f1a85 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -681,13 +681,17 @@ if get_option('cfi')
> error('-fsanitize-cfi-icall-generalize-pointers is not supported by the compiler')
> endif
> if get_option('cfi_debug')
> - if cc.compiles('int main () { return 0; }',
> - name: '-fno-sanitize-trap=cfi-icall',
> - args: ['-flto', '-fsanitize=cfi-icall',
> - '-fno-sanitize-trap=cfi-icall'] )
> - cfi_flags += '-fno-sanitize-trap=cfi-icall'
> + if get_option('safe_stack')
> + error('cfi_debug is not compatible with safe_stack')
IIUC error() terminates meson execution, so it could just
have an 'endif' where and avoid re-indenting all the
following code.
> else
> - error('-fno-sanitize-trap=cfi-icall is not supported by the compiler')
> + if cc.compiles('int main () { return 0; }',
> + name: '-fno-sanitize-trap=cfi-icall',
> + args: ['-flto', '-fsanitize=cfi-icall',
> + '-fno-sanitize-trap=cfi-icall'] )
> + cfi_flags += '-fno-sanitize-trap=cfi-icall'
> + else
> + error('-fno-sanitize-trap=cfi-icall is not supported by the compiler')
> + endif
> endif
> endif
> add_global_arguments(cfi_flags, native: false, language: all_languages)
> diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
> index 8378b663b6..94d646c5a7 100644
> --- a/.gitlab-ci.d/buildtest.yml
> +++ b/.gitlab-ci.d/buildtest.yml
> @@ -479,7 +479,7 @@ build-cfi-aarch64:
> LD_JOBS: 1
> AR: llvm-ar
> IMAGE: fedora
> - CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
> + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi
> --enable-safe-stack --disable-slirp
> TARGETS: aarch64-softmmu
> MAKE_CHECK_ARGS: check-build
> @@ -517,7 +517,7 @@ build-cfi-ppc64-s390x:
> LD_JOBS: 1
> AR: llvm-ar
> IMAGE: fedora
> - CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
> + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi
> --enable-safe-stack --disable-slirp
> TARGETS: ppc64-softmmu s390x-softmmu
> MAKE_CHECK_ARGS: check-build
> @@ -555,7 +555,7 @@ build-cfi-x86_64:
> LD_JOBS: 1
> AR: llvm-ar
> IMAGE: fedora
> - CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
> + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi
> --enable-safe-stack --disable-slirp
> TARGETS: x86_64-softmmu
> MAKE_CHECK_ARGS: check-build
> --
> 2.51.0
>
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-09-19 14:27 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-19 13:32 [PATCH 00/24] CI/build-sys fixes to enable Rust more widely marcandre.lureau
2025-09-19 13:32 ` [PATCH 01/24] gitlab-ci: fix 'needs' property type must be array marcandre.lureau
2025-09-19 14:05 ` Daniel P. Berrangé
2025-09-19 13:32 ` [PATCH 02/24] scripts/archive-source: speed up downloading subprojects marcandre.lureau
2025-09-19 13:50 ` Daniel P. Berrangé
2025-09-22 6:59 ` Marc-André Lureau
2025-09-22 8:08 ` Daniel P. Berrangé
2025-09-22 8:30 ` Paolo Bonzini
2025-09-19 13:32 ` [PATCH 03/24] scripts/archive-source: silence subprojects downloads marcandre.lureau
2025-09-19 13:49 ` Daniel P. Berrangé
2025-09-19 13:32 ` [PATCH 04/24] configure: fix rust meson configuration marcandre.lureau
2025-09-19 14:06 ` Daniel P. Berrangé
2025-09-19 13:32 ` [PATCH 05/24] configure: set the bindgen cross target marcandre.lureau
2025-09-19 15:08 ` Paolo Bonzini
2025-09-19 13:33 ` [PATCH 06/24] RFC: configure: use the same machine as the host triple by default marcandre.lureau
2025-09-19 15:11 ` Paolo Bonzini
2025-09-19 22:27 ` Paolo Bonzini
2025-09-19 13:33 ` [PATCH 07/24] tests/docker/common: print errors to stderr marcandre.lureau
2025-09-19 14:07 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 08/24] tests/docker: use fully qualified image name for emsdk marcandre.lureau
2025-09-19 14:08 ` Daniel P. Berrangé
2025-09-21 3:19 ` Kohei Tokunaga
2025-09-19 13:33 ` [PATCH 09/24] tests/docker/common: print meson log on configure failure marcandre.lureau
2025-09-19 14:09 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 10/24] lcitool: update, switch to f41 marcandre.lureau
2025-09-19 14:10 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 11/24] lcitool/qemu: include libclang-rt for TSAN marcandre.lureau
2025-09-19 14:10 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 12/24] lcitool/alpine: workaround bindgen issue marcandre.lureau
2025-09-19 14:10 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 13/24] tests/lcitool: add missing rust-std dep marcandre.lureau
2025-09-19 14:11 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 14/24] tests: move mips to debian-legacy-test-cross marcandre.lureau
2025-09-19 14:21 ` Daniel P. Berrangé
2025-09-22 8:38 ` Marc-André Lureau
2025-09-22 9:06 ` Daniel P. Berrangé
2025-09-22 9:44 ` Alex Bennée
2025-09-22 15:10 ` Paolo Bonzini
2025-09-22 16:40 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 15/24] tests/lcitool: update to debian13 marcandre.lureau
2025-09-19 14:21 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 16/24] build-sys: cfi_debug and safe_stack are not compatible marcandre.lureau
2025-09-19 14:25 ` Daniel P. Berrangé [this message]
2025-09-19 13:33 ` [PATCH 17/24] tests/docker: add ENABLE_RUST environment marcandre.lureau
2025-09-19 14:37 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 18/24] tests/lcitool: enable rust & refresh marcandre.lureau
2025-09-19 14:39 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 19/24] configure: set the meson executable suffix/ext marcandre.lureau
2025-09-19 14:41 ` Daniel P. Berrangé
2025-09-22 10:34 ` Marc-André Lureau
2025-09-22 10:40 ` Daniel P. Berrangé
2025-09-22 10:45 ` Marc-André Lureau
2025-09-19 13:33 ` [PATCH 20/24] tests/freebsd: enable Rust marcandre.lureau
2025-09-19 14:41 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 21/24] meson: rust-bindgen limit allowlist-file to srcdir/include marcandre.lureau
2025-09-19 13:33 ` [PATCH 22/24] WIP: tests/docker: add rust to debian-legacy-test-cross marcandre.lureau
2025-09-19 14:43 ` Daniel P. Berrangé
2025-09-19 13:33 ` [PATCH 23/24] WIP: gitlab-ci: enable rust for msys2-64bit marcandre.lureau
2025-09-19 13:33 ` [PATCH 24/24] WIP: cirrus/macos: enable Rust marcandre.lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aM1n5j0WzFVaaqVK@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=emaste@freebsd.org \
--cc=imp@bsdimp.com \
--cc=jiaxun.yang@flygoat.com \
--cc=kevans@freebsd.org \
--cc=ktokunaga.mail@gmail.com \
--cc=luoyonggang@gmail.com \
--cc=lwhsu@freebsd.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.