[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-12 Thread nathan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

Nathan Sidwell  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #18 from Nathan Sidwell  ---
Fixed e2aa8a5f982 2021-01-11 | libcody: Simplify configure [PR 98414, 98509]

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-11 Thread nathan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #17 from Nathan Sidwell  ---
libcody should be being built with -fno-exceptions -fno-rtti, that it isn;t
suggests I'm configuring it wrong.

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-11 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

Martin Liška  changed:

   What|Removed |Added

   Assignee|marxin at gcc dot gnu.org  |nathan at gcc dot 
gnu.org

--- Comment #16 from Martin Liška  ---
Based on Jakub's review, leading that to Nathan.

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-11 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

Martin Liška  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #15 from Martin Liška  ---
I have a fix :)

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-11 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #14 from Martin Liška  ---
When building GCC w/o bootstrap I see that libcody properly sets -fno-rtti:

g++ -std=c++11 -g -O2 -fno-enforce-eh-specs -fno-stack-protector
-fno-threadsafe-statics -fno-exceptions -fno-rtti
-fdebug-prefix-map=/home/marxin/Programming/gcc/libcody/= -W -Wall -include
config.h -I/home/marxin/Programming/gcc/libcody \
  -MMD -MP -MF packet.d -c -o packet.o
/home/marxin/Programming/gcc/libcody/packet.cc

But it's not true for --with-build-config=bootstrap-ubsan in stage2:

/home/mliska/Programming/gcc/objdir/./prev-gcc/xg++
-B/home/mliska/Programming/gcc/objdir/./prev-gcc/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu

-I/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
 -I/home/mliska/Programming/gcc/libstdc++-v3/libsupc++
-L/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-g -O2 -fno-checking -fsanitize=undefined -DUBSAN_BOOTSTRAP -include config.h
-I../../libcody
-I/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
-I/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
-I/home/mliska/Programming/gcc/libstdc++-v3/libsupc++ \
  -MMD -MP -MF packet.d -c -o packet.o ../../libcody/packet.cc

while other gcc/*.o objects have -fno-rtti:

/home/mliska/Programming/gcc/objdir/./prev-gcc/xg++
-B/home/mliska/Programming/gcc/objdir/./prev-gcc/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu

-I/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
 -I/home/mliska/Programming/gcc/libstdc++-v3/libsupc++
-L/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/mliska/Programming/gcc/objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
 -fno-PIE -c   -g -O2 -fno-checking -fsanitize=undefined -DUBSAN_BOOTSTRAP 
-DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag
-Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I.
-I. -I../../gcc -I../../gcc/. -I../../gcc/../include
-I../../gcc/../libcpp/include -I../../gcc/../libcody 
-I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber
-I../../gcc/../libbacktrace   -o ipa-icf.o -MT ipa-icf.o -MMD -MP -MF
./.deps/ipa-icf.TPo ../../gcc/ipa-icf.c

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-11 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #13 from Jakub Jelinek  ---
Well, that is a fix for the bootstrap-ubsan issues, but not the above small
testcase showing the problems for users.
But sure, as this is a problem that exists many years and nobody reported it
before, it is enough to fix just the bootstrap-ubsan stuff for GCC 11.

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-11 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #12 from Martin Liška  ---
I've got it!
It can be fixed with -fno-rtti and apparently libcody's objects do miss that :)

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-11 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #11 from Martin Liška  ---
There's a self-container test-case:

$ cat resolver.ii
class Resolver {
  int GetCMIName();
  virtual char GetCMISuffix() { return 'c'; }
};
int Resolver::GetCMIName() { GetCMISuffix(); return 0; }

int main() {}

$ -static-libstdc++ -static-libgcc -fsanitize=undefined -static-libubsan
[fine]

$ g++ -fsanitize=undefined resolver.ii -static-libstdc++ -static-libubsan
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/10/libubsan.a(ubsan_type_hash_itanium.o): in
function `findBaseAtOffset(__cxxabiv1::__class_type_info const*, long)':
/home/abuild/rpmbuild/BUILD/gcc-10.2.1+git1030/obj-x86_64-suse-linux/x86_64-suse-linux/libsanitizer/ubsan/../../../../libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:161:
undefined reference to `__dynamic_cast'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
/home/abuild/rpmbuild/BUILD/gcc-10.2.1+git1030/obj-x86_64-suse-linux/x86_64-suse-linux/libsanitizer/ubsan/../../../../libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:165:
undefined reference to `typeinfo for __cxxabiv1::__vmi_class_type_info'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
/home/abuild/rpmbuild/BUILD/gcc-10.2.1+git1030/obj-x86_64-suse-linux/x86_64-suse-linux/libsanitizer/ubsan/../../../../libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:165:
undefined reference to `__dynamic_cast'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/10/libubsan.a(ubsan_type_hash_itanium.o): in
function `isDerivedFromAtOffset(__cxxabiv1::__class_type_info const*,
__cxxabiv1::__class_type_info const*, long)':
/home/abuild/rpmbuild/BUILD/gcc-10.2.1+git1030/obj-x86_64-suse-linux/x86_64-suse-linux/libsanitizer/ubsan/../../../../libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:124:
undefined reference to `__dynamic_cast'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
/home/abuild/rpmbuild/BUILD/gcc-10.2.1+git1030/obj-x86_64-suse-linux/x86_64-suse-linux/libsanitizer/ubsan/../../../../libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:128:
undefined reference to `typeinfo for __cxxabiv1::__vmi_class_type_info'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
/home/abuild/rpmbuild/BUILD/gcc-10.2.1+git1030/obj-x86_64-suse-linux/x86_64-suse-linux/libsanitizer/ubsan/../../../../libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:128:
undefined reference to `__dynamic_cast'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld:
/usr/lib64/gcc/x86_64-suse-linux/10/libubsan.a(ubsan_type_hash_itanium.o): in
function `__ubsan::checkDynamicType(void*, void*, unsigned long)':
/home/abuild/rpmbuild/BUILD/gcc-10.2.1+git1030/obj-x86_64-suse-linux/x86_64-suse-linux/libsanitizer/ubsan/../../../../libsanitizer/ubsan/ubsan_type_hash_itanium.cpp:231:
undefined reference to `__dynamic_cast'
collect2: error: ld returned 1 exit status

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-07 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #10 from Martin Liška  ---
(In reply to Martin Liška from comment #9)
> (In reply to Jakub Jelinek from comment #8)
> > I don't.  LIBUBSAN_SPEC comes from gcc.c, while the libstdc++ stuff comes
> > from cp/g++spec.c and the ordering between the two is hard to achieve, plus
> > it is unclear if we shouldn't for -static-libubsan instead just add another
> > -lstdc++ copy (but one honoring -static-libstdc++).
> 
> Hm, and what about something like that:
> 
> diff --git a/config/bootstrap-ubsan.mk b/config/bootstrap-ubsan.mk
> index 1d85fe1c836..b2a474ae158 100644
> --- a/config/bootstrap-ubsan.mk
> +++ b/config/bootstrap-ubsan.mk
> @@ -2,7 +2,7 @@
>  
>  STAGE2_CFLAGS += -fsanitize=undefined -DUBSAN_BOOTSTRAP
>  STAGE3_CFLAGS += -fsanitize=undefined -DUBSAN_BOOTSTRAP
> -POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan
> -DUBSAN_BOOTSTRAP \
> +POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan -lstdc++
> -DUBSAN_BOOTSTRAP \
> -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \
> -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/ \
> -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/.libs

That's not going to work:

./xgcc -B./ -B/usr/local/x86_64-pc-linux-gnu/bin/ -isystem
/usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include
-L/home/mliska/Programming/gcc/objdir/gcc/../ld -xc++ -nostdinc /dev/null -S -o
/dev/null -fself-test=../../gcc/testsuite/selftests
./cc1./cc1plus: : /usr/lib64/libstdc++.so.6/usr/lib64/libstdc++.so.6: : version
`GLIBCXX_3.4.29' not found (required by ./cc1)version `GLIBCXX_3.4.29' not
found (required by ./cc1plus)

leaving to Nathan.

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-05 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #9 from Martin Liška  ---
(In reply to Jakub Jelinek from comment #8)
> I don't.  LIBUBSAN_SPEC comes from gcc.c, while the libstdc++ stuff comes
> from cp/g++spec.c and the ordering between the two is hard to achieve, plus
> it is unclear if we shouldn't for -static-libubsan instead just add another
> -lstdc++ copy (but one honoring -static-libstdc++).

Hm, and what about something like that:

diff --git a/config/bootstrap-ubsan.mk b/config/bootstrap-ubsan.mk
index 1d85fe1c836..b2a474ae158 100644
--- a/config/bootstrap-ubsan.mk
+++ b/config/bootstrap-ubsan.mk
@@ -2,7 +2,7 @@

 STAGE2_CFLAGS += -fsanitize=undefined -DUBSAN_BOOTSTRAP
 STAGE3_CFLAGS += -fsanitize=undefined -DUBSAN_BOOTSTRAP
-POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan -DUBSAN_BOOTSTRAP
\
+POSTSTAGE1_LDFLAGS += -fsanitize=undefined -static-libubsan -lstdc++
-DUBSAN_BOOTSTRAP \
  -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ \
  -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/ \
  -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/ubsan/.libs

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-05 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #8 from Jakub Jelinek  ---
I don't.  LIBUBSAN_SPEC comes from gcc.c, while the libstdc++ stuff comes from
cp/g++spec.c and the ordering between the two is hard to achieve, plus it is
unclear if we shouldn't for -static-libubsan instead just add another -lstdc++
copy (but one honoring -static-libstdc++).

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-05 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #7 from Martin Liška  ---
All right, the linker command line is:

/home/marxin/Programming/testcases//objdir/./prev-gcc/collect2 -plugin
/home/marxin/Programming/testcases//objdir/./prev-gcc/liblto_plugin.so
-plugin-opt=/home/marxin/Programming/testcases//objdir/./prev-gcc/lto-wrapper
-plugin-opt=-fresolution=cc1plus.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh
--eh-frame-hdr -m elf_x86_64 -export-dynamic -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -o cc1plus /usr/lib/../lib64/crt1.o
/usr/lib/../lib64/crti.o
/home/marxin/Programming/testcases//objdir/./prev-gcc/crtbegin.o
-L/home/marxin/Programming/testcases//objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/marxin/Programming/testcases//objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-L./../zlib -L/home/marxin/Programming/testcases//objdir/./prev-gcc
-L/home/marxin/Programming/testcases//objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/marxin/Programming/testcases//objdir/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-L/home/marxin/Programming/testcases//objdir/prev-x86_64-pc-linux-gnu/libsanitizer
-L/home/marxin/Programming/testcases//objdir/prev-x86_64-pc-linux-gnu/libsanitizer/ubsan
-L/home/marxin/Programming/testcases//objdir/prev-x86_64-pc-linux-gnu/libsanitizer/ubsan/.libs
-L/lib/../lib64 -L/usr/lib/../lib64 cp/cp-lang.o c-family/stub-objc.o cp/call.o
cp/class.o cp/constexpr.o cp/constraint.o cp/coroutines.o cp/cp-gimplify.o
cp/cp-objcp-common.o cp/cp-ubsan.o cp/cvt.o cp/cxx-pretty-print.o cp/decl.o
cp/decl2.o cp/dump.o cp/error.o cp/except.o cp/expr.o cp/friend.o cp/init.o
cp/lambda.o cp/lex.o cp/logic.o cp/mangle.o mapper-resolver.o cp/method.o
cp/module.o cp/name-lookup.o cp/optimize.o cp/parser.o cp/pt.o cp/ptree.o
cp/rtti.o cp/search.o cp/semantics.o cp/tree.o cp/typeck.o cp/typeck2.o
cp/vtable-class-hierarchy.o attribs.o incpath.o c-family/c-common.o
c-family/c-cppbuiltin.o c-family/c-dump.o c-family/c-format.o
c-family/c-gimplify.o c-family/c-indentation.o c-family/c-lex.o
c-family/c-omp.o c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o
c-family/c-pragma.o c-family/c-pretty-print.o c-family/c-semantics.o
c-family/c-ada-spec.o c-family/c-ubsan.o c-family/known-headers.o
c-family/c-attribs.o c-family/c-warn.o c-family/c-spellcheck.o i386-c.o
glibc-c.o cc1plus-checksum.o libbackend.a main.o libcommon-target.a libcommon.a
../libcpp/libcpp.a ../libcody/libcody.a ../libdecnumber/libdecnumber.a
libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lmpc -lmpfr -lgmp -lz
-Bstatic -lstdc++ -Bdynamic -lm -Bstatic -lubsan -Bdynamic -ldl -lrt -lpthread
-lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh
/home/marxin/Programming/testcases//objdir/./prev-gcc/crtend.o
/usr/lib/../lib64/crtn.o

when I replace -Bstatic -lstdc++ .. -Bstatic -lubsan with:
-Bstatic -lubsan -Bstatic -lstdc++

it works.

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-05 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #6 from Martin Liška  ---
I replaced cp/mapper-client.o cp/mapper-resolver.o just with:

$ cat mapper-resolver.ii
namespace Cody {
enum class Flags : unsigned;
class Resolver {
  virtual int IncludeTranslateRequest(int *s, Flags flags, int );
};
}  // namespace Cody
class module_resolver : public Cody::Resolver {
  virtual int IncludeTranslateRequest(int *s, Cody::Flags,
  int ) override;

 private:
};
int module_resolver::IncludeTranslateRequest(int *s, Cody::Flags,
 int ) {}

which needs the symbol:

nm mapper-resolver.o
...
 U _ZTVN10__cxxabiv120__si_class_type_infoE

Jakub: Does it confirm your description. Do you know how to fix that?

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-05 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #5 from Jakub Jelinek  ---
Likely it just is the first TU that needs -fsanitize=vptr sanitization...
Seems -lubsan comes after -lstdc++ when linking with -fsanitize=undefined
-static-libstdc++ -static-libubsan so if the vptr checking code needs to be
linked, it isn't satisfied.

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-05 Thread nathan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

--- Comment #4 from Nathan Sidwell  ---
there isn't a dynamic cast in the mapper (or libcody)

[Bug bootstrap/98414] [11 Regression] UBSAN bootstrap is broken: ubsan/ubsan_type_hash_itanium.cpp:162: undefined reference to `__dynamic_cast' since r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a

2021-01-05 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98414

Martin Liška  changed:

   What|Removed |Added

Summary|[11 Regression] UBSAN   |[11 Regression] UBSAN
   |bootstrap is broken:|bootstrap is broken:
   |ubsan/ubsan_type_hash_itani |ubsan/ubsan_type_hash_itani
   |um.cpp:162: undefined   |um.cpp:162: undefined
   |reference to|reference to
   |`__dynamic_cast'|`__dynamic_cast' since
   ||r11-6083-gb7dfc2074c78415d4
   ||51eb34d1608016c80b1c41a
   Keywords|needs-bisection |
 CC||nathan at gcc dot gnu.org

--- Comment #3 from Martin Liška  ---
So it started when c++ module mapper was added:
r11-6083-gb7dfc2074c78415d451eb34d1608016c80b1c41a