diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2025-02-07 10:33:44 +0100 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2025-02-07 11:38:12 +0100 |
commit | 6e1026cacada6056f2be6b74baf426c984305867 (patch) | |
tree | d6efab63cca3db0e32d89b66fd84303263914ad4 /compilerplugins/clang/test/buriedassign.cxx | |
parent | a4cde4fa1a18a99e6eb808ed9c00cad8a56081fe (diff) |
external/firebird: Avoid ODR violation issues from sanitizer builds
My local ASan/UBSan builds of d37c60c5e2b793c0934d431e59c8cb3ff1a170b6
"external/firebird: Drop -fno-rtti from sanitizer builds" against LLVM 21 trunk
had been fine, but <https://ci.libreoffice.org/job/lo_ubsan/3459/> against
lode's LLVM 12.0.1 started to fail with
> ==3374322==ERROR: AddressSanitizer: odr-violation (0x0000007af7a0):
> [1] size=16 'typeinfo for Firebird::Exception' /home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/firebird/src/common/fb_exception.cpp
> [2] size=16 'typeinfo for Firebird::Exception' /home/tdf/lode/jenkins/workspace/lo_ubsan/workdir/UnpackedTarball/firebird/src/common/fb_exception.cpp
> These globals were registered at these points:
> [1]:
> #0 0x440738 in __asan_register_globals.part.0 /home/tdf/lode/packages/llvm-llvmorg-12.0.1.src/compiler-rt/lib/asan/asan_globals.cpp:360:3
> #1 0x68237b in asan.module_ctor (/workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql+0x68237b)
>
> [2]:
> #0 0x440738 in __asan_register_globals.part.0 /home/tdf/lode/packages/llvm-llvmorg-12.0.1.src/compiler-rt/lib/asan/asan_globals.cpp:360:3
> #1 0x7f5ccdec01ab in asan.module_ctor (/workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2+0x9b41ab)
What appears to make a difference there is
<https://github.com/llvm/llvm-project/commit/1ada819c237bf724e6eaa1c82b2742e3eb57a5d5>
"[asan] Default to -fsanitize-address-use-odr-indicator for non-Windows", first
appearing in LLVM 16: My local ASan/UBSan LLVM 21 trunk build, which builds
external/firebird fine, has
> 0000000000ee5166 B __odr_asan_gen__ZTIN8Firebird9ExceptionE
> 000000000045b960 D _ZTIN8Firebird9ExceptionE
in workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql and
> 0000000000e49920 b __odr_asan_gen__ZTIN8Firebird9ExceptionE
> 0000000000b9d100 D _ZTIN8Firebird9ExceptionE
in workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2, but
when I rebuild it with -fno-sanitize-address-use-odr-indicator, it has only
> 000000000045bbc0 D _ZTIN8Firebird9ExceptionE
in workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql and only
> 0000000000b9d1c0 D _ZTIN8Firebird9ExceptionE
in workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2, and
fails the same way as <https://ci.libreoffice.org/job/lo_ubsan/3459/>.
So make the "Drop -fno-rtti" patch depend on Clang >= 16 (recorded, for
simplicity, with a bespoke new CLANG_16 config_host.mk variable).
Change-Id: I70a8ce8eb535265d592d470718d6b3a6765d5bcd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181235
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'compilerplugins/clang/test/buriedassign.cxx')
0 files changed, 0 insertions, 0 deletions