Bug #81577 Unable to build MySQL Server 5.7.12 with -DWITH_UBSAN
Submitted: 24 May 2016 16:06 Modified: 20 Nov 2018 9:10
Reporter: Yura Sorokin (OCA) Email Updates:
Status: Won't fix Impact on me:
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.12 OS:Any
Assigned to: CPU Architecture:Any

[24 May 2016 16:06] Yura Sorokin
Cannot build MySQL Server 5.7.12 with undefined behavior sanitizer turned on.

The following error is generated
../libperfschema.a(pfs_instr.cc.o):(.data.rel+0x18): undefined reference to `typeinfo for THD'
../libperfschema.a(pfs_instr.cc.o):(.data.rel+0x48): undefined reference to `typeinfo for THD'
../libperfschema.a(pfs_instr.cc.o):(.data.rel+0x78): undefined reference to `typeinfo for THD'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [storage/perfschema/unittest/pfs-t] Error 1
make[1]: *** [storage/perfschema/unittest/CMakeFiles/pfs-t.dir/all] Error 2
make: *** [all] Error 2

How to repeat:
git clone https://github.com/mysql/mysql-server.git
mkdir mysql-build
cd mysql-build
CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake \
 ../mysql-server \
 -DBUILD_CONFIG=mysql_release \
 -DFEATURE_SET=community \
 -DWITH_SSL=system \
 -DWITH_ZLIB=system \
 -DWITH_BOOST=../deps \
[25 May 2016 6:14] Umesh Shastry
Hello Yura Sorokin,

Thank you for the report.

[20 Nov 2018 9:10] Dyre Tjeldvoll
Posted by developer:
Thank you for bringing this to our attention! Since this bug was filed we have started to run UBSAN regularly on our development branches and have fixed all issues reported. And sice we do not normally backport such fixes to GA releases, we need to close this bug.