summaryrefslogtreecommitdiffstats
path: root/BUILD/compile-pentium64-ubsan
blob: 538b5e884cf4c27f1449687a2e69bb96cada9ef6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh
# Copyright (c) 2018, MariaDB Corporation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1335  USA

# Compilation with UBSAN, The Undefined Behavior Sanitizer
# We have to use -Wno-uninitialized and -Wno-unitialized we get a lot of false
# positive warnings for this when compiling with -fsanitize=undefined.
# We also have to compile without Spider as linking with Spider library does
# not work. (errno: 11, undefined symbol: _ZTI12ha_partition)

path=`dirname $0`
. "$path/SETUP.sh"

#
# Enable UBSAN, UndefinedBehaviorSanitizer. Detects undefined behavior like:
# - Using misaligned or null pointer
# - Signed integer overflow
# - Conversion to, from, or between floating-point types which would overflow
#   the destination
#

extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized"
extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider"

. "$path/FINISH.sh"