Debian Codegraph @

BUILD/compile-pentium64-ubsan

raw
1 #! /bin/sh
2 # Copyright (c) 2018, MariaDB Corporation.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; version 2 of the License.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
16
17 # Compilation with UBSAN, The Undefined Behavior Sanitizer
18 # We have to use -Wno-uninitialized and -Wno-unitialized we get a lot of false
19 # positive warnings for this when compiling with -fsanitize=undefined.
20 # We also have to compile without Spider as linking with Spider library does
21 # not work. (errno: 11, undefined symbol: _ZTI12ha_partition)
22
23 path=`dirname $0`
24 . "$path/SETUP.sh"
25
26 #
27 # Enable UBSAN, UndefinedBehaviorSanitizer. Detects undefined behavior like:
28 # - Using misaligned or null pointer
29 # - Signed integer overflow
30 # - Conversion to, from, or between floating-point types which would overflow
31 # the destination
32 #
33
34 extra_flags="$pentium64_cflags $debug_cflags -fsanitize=undefined -DWITH_UBSAN -Wno-conversion -Wno-uninitialized -Wno-unused-parameter"
35 extra_configs="$pentium_configs $debug_configs -DWITH_UBSAN=ON -DMYSQL_MAINTAINER_MODE=NO --without-spider"
36
37 . "$path/FINISH.sh"