summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2019-11-22 13:16:49 +0000
committerJohn Levon <john.levon@joyent.com>2019-11-25 15:25:09 +0000
commiteb44bcc7bc940d7cc1f4c10afa5a1cb7ec0dd198 (patch)
treecea99fd08a84916701c61417d86a4eae0c83e09f
parentaefa9c84b0a900bedba3a7ed885f0ea75f3fe1ea (diff)
downloadillumos-joyent-eb44bcc7bc940d7cc1f4c10afa5a1cb7ec0dd198.tar.gz
12013 fix smatch build for GCC4
Reviewed by: Dan McDonald <danmcd@joyent.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
-rw-r--r--usr/src/tools/smatch/Makefile2
-rw-r--r--usr/src/tools/smatch/src/Makefile4
-rw-r--r--usr/src/tools/smatch/src/check_arm64_tagged.c9
-rw-r--r--usr/src/tools/smatch/src/ident-list.h2
-rw-r--r--usr/src/tools/smatch/src/smatch_data/illumos_kernel.skipped_functions1
-rw-r--r--usr/src/tools/smatch/src/smatch_data/illumos_user.skipped_functions6
-rw-r--r--usr/src/tools/smatch/src/smatch_kernel_user_data.c9
7 files changed, 21 insertions, 12 deletions
diff --git a/usr/src/tools/smatch/Makefile b/usr/src/tools/smatch/Makefile
index 145c08de28..b68d5634e2 100644
--- a/usr/src/tools/smatch/Makefile
+++ b/usr/src/tools/smatch/Makefile
@@ -20,7 +20,7 @@
#
PROG = smatch
-SPARSE_VERSION = 0.6.1-rc1-il-1
+SPARSE_VERSION = 0.6.1-rc1-il-2
include ../Makefile.tools
diff --git a/usr/src/tools/smatch/src/Makefile b/usr/src/tools/smatch/src/Makefile
index 495cc6192d..164fa1bd33 100644
--- a/usr/src/tools/smatch/src/Makefile
+++ b/usr/src/tools/smatch/src/Makefile
@@ -1,4 +1,4 @@
-VERSION=0.6.1-rc1-il-1
+VERSION=0.6.1-rc1-il-2
########################################################################
# The following variables can be overwritten from the command line
@@ -9,7 +9,7 @@ CC ?= gcc
LD = $(CC)
AR = ar
-CFLAGS ?= -O2 -g
+CFLAGS ?= -g
DESTDIR ?=
PREFIX ?= $(HOME)
diff --git a/usr/src/tools/smatch/src/check_arm64_tagged.c b/usr/src/tools/smatch/src/check_arm64_tagged.c
index e126552e59..d4d00873e1 100644
--- a/usr/src/tools/smatch/src/check_arm64_tagged.c
+++ b/usr/src/tools/smatch/src/check_arm64_tagged.c
@@ -154,8 +154,13 @@ int rl_range_has_min_value(struct range_list *rl, sval_t sval)
static bool rl_is_tagged(struct range_list *rl)
{
- sval_t invalid = { .type = &ullong_ctype, .value = (1ULL << 56) };
- sval_t invalid_kernel = { .type = &ullong_ctype, .value = (0xff8ULL << 52) };
+ sval_t invalid;
+ sval_t invalid_kernel;
+
+ invalid.type = &ullong_ctype;
+ invalid.value = 1ULL << 56;
+ invalid_kernel.type = &ullong_ctype;
+ invalid_kernel.value = 0xff8ULL << 52;
/*
* We only care for tagged addresses, thus ignore anything where the
diff --git a/usr/src/tools/smatch/src/ident-list.h b/usr/src/tools/smatch/src/ident-list.h
index 096b1c2358..4ffd756301 100644
--- a/usr/src/tools/smatch/src/ident-list.h
+++ b/usr/src/tools/smatch/src/ident-list.h
@@ -31,7 +31,7 @@ IDENT(static);
/* C99 keywords */
IDENT(restrict); IDENT(__restrict); IDENT(__restrict__);
IDENT(_Bool);
-IDENT(_Complex);
+IDENT_RESERVED(_Complex);
IDENT_RESERVED(_Imaginary);
/* C11 keywords */
diff --git a/usr/src/tools/smatch/src/smatch_data/illumos_kernel.skipped_functions b/usr/src/tools/smatch/src/smatch_data/illumos_kernel.skipped_functions
index 3617b9b806..029d02aad9 100644
--- a/usr/src/tools/smatch/src/smatch_data/illumos_kernel.skipped_functions
+++ b/usr/src/tools/smatch/src/smatch_data/illumos_kernel.skipped_functions
@@ -3,6 +3,7 @@ ECDSA_VerifyDigest
dtrace_disx86
elf32exec
elfexec
+emlxs_sli4_process_unsol_rcv
iscsi_ioctl
lm_idle_chk
ld64_sym_validate
diff --git a/usr/src/tools/smatch/src/smatch_data/illumos_user.skipped_functions b/usr/src/tools/smatch/src/smatch_data/illumos_user.skipped_functions
index f82ff4f38a..2842a7bc96 100644
--- a/usr/src/tools/smatch/src/smatch_data/illumos_user.skipped_functions
+++ b/usr/src/tools/smatch/src/smatch_data/illumos_user.skipped_functions
@@ -1,8 +1,6 @@
/*
- * The below functions cause smatch to fail with "turning off implications after
- * 60 seconds" or similar, generally because they're too large for it to handle.
- *
- * This will disable analysis altogether.
+ * These are specific functions that are generally too complex for smatch to
+ * reasonably handle.
*/
/* libast */
diff --git a/usr/src/tools/smatch/src/smatch_kernel_user_data.c b/usr/src/tools/smatch/src/smatch_kernel_user_data.c
index ca4c7cd315..cda3b58d9d 100644
--- a/usr/src/tools/smatch/src/smatch_kernel_user_data.c
+++ b/usr/src/tools/smatch/src/smatch_kernel_user_data.c
@@ -681,10 +681,15 @@ static void handle_eq_noteq(struct expression *expr)
static struct range_list *strip_negatives(struct range_list *rl)
{
sval_t min = rl_min(rl);
- sval_t minus_one = { .type = rl_type(rl), .value = -1 };
- sval_t over = { .type = rl_type(rl), .value = INT_MAX + 1ULL };
+ sval_t minus_one;
+ sval_t over;
sval_t max = sval_type_max(rl_type(rl));
+ minus_one.type = rl_type(rl);
+ minus_one.value = -1;
+ over.type = rl_type(rl);
+ over.value = INT_MAX + 1ULL;
+
if (!rl)
return NULL;