Your message dated Sat, 19 Nov 2022 15:36:25 +0000
with message-id <[email protected]>
and subject line Bug#1000941: Removed package(s) from unstable
has caused the Debian Bug report #990101,
regarding clang-11: Problem building mixed C & C++ code with UBSan sanitizer
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
990101: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990101
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: clang-11
Version: 1:11.0.1-2~bpo10+1
Severity: normal

If I have a mixed C/C++ code with classes with virtual function in it, and I
am trying to build it with BUSan with -fno-sanitize-recover=undefined option,
then I get undefined reference error messages

/home/nataraj/test/ubsan_cpp_c/library.cpp:8: undefined reference to 
`__ubsan_vptr_type_cache'
/usr/bin/ld: /home/nataraj/test/ubsan_cpp_c/library.cpp:8: undefined reference 
to `__ubsan_handle_dynamic_type_cache_miss_abort'

I can fix these undefined references by specifying explicitly linking to
clang_rt.ubsan_standalone_cxx-x86_64 library, but this is not how it should
work as I can guess.

Here I offer a sample project that allows to reproduce the problem. (I am not
sure I will be able to add attach via reportbug, if not, I will attach it in
the next message)

When I buitld this project as written in build_ubsan_broken.sh:

make clean

CC=clang-11 CXX=clang++-11 \
CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" \
CXXFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" \
LDFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined"\
 make

building will fail.

But if I add -Wl,--whole-archive -L/usr/lib/clang/11/lib/linux/ 
-lclang_rt.ubsan_standalone_cxx-x86_64 -Wl,--no-whole-archive
to LDFLAGS (see build_ubsan_wokarounded.sh), it will successfully build:

make clean

# Using hack suggested in 
http://clang-developers.42468.n3.nabble.com/fsanitize-undefined-and-shared-libraries-td4029561.html#a4029653
CC=clang-11 CXX=clang++-11 \
CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" \
CXXFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined" \
LDFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined 
-Wl,--whole-archive -L/usr/lib/clang/11/lib/linux/ 
-lclang_rt.ubsan_standalone_cxx-x86_64 -Wl,--no-whole-archive"\
 make

I guess this should be fixed and symbols from 
clang_rt.ubsan_standalone_cxx-x86_64 should be added to some library that are
linked by default when you use -fsanitize=undefined

-- System Information:
Debian Release: 10.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-9-amd64 (SMP w/8 CPU cores)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), 
LANGUAGE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages clang-11 depends on:
ii  binutils                2.31.1-16
ii  libc6                   2.28-10
ii  libc6-dev               2.28-10
ii  libclang-common-11-dev  1:11.0.1-2~bpo10+1
ii  libclang-cpp11          1:11.0.1-2~bpo10+1
ii  libclang1-11            1:11.0.1-2~bpo10+1
ii  libgcc-8-dev            8.3.0-6
ii  libgcc1                 1:8.3.0-6
ii  libllvm11               1:11.0.1-2~bpo10+1
ii  libobjc-8-dev           8.3.0-6
ii  libstdc++-8-dev         8.3.0-6
ii  libstdc++6              8.3.0-6

Versions of packages clang-11 recommends:
pn  libomp-11-dev  <none>
ii  llvm-11-dev    1:11.0.1-2~bpo10+1
ii  python3        3.7.3-1

Versions of packages clang-11 suggests:
pn  clang-11-doc  <none>

-- no debconf information

Attachment: ubsan_cpp_c.tgz
Description: application/gzip


--- End Message ---
--- Begin Message ---
Version: 1:11.1.0-6+rm

Dear submitter,

as the package llvm-toolchain-11 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1000941

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
[email protected].

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)

--- End Message ---

Reply via email to