Print this page
11871 smatch should not hammer linux procfs path
Reviewed by: John Levon <john.levon@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/Makefile
+++ new/usr/src/tools/smatch/Makefile
1 1 #
2 2 # This file and its contents are supplied under the terms of the
3 3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 4 # You may only use this file in accordance with the terms of version
5 5 # 1.0 of the CDDL.
6 6 #
7 7 # A full copy of the text of the CDDL should have accompanied this
8 8 # source. A copy of the CDDL is also available via the Internet at
9 9 # http://www.illumos.org/license/CDDL.
10 10 #
11 -# Copyright (c) 2019, Joyent, Inc.
11 +# Copyright 2019 Joyent, Inc.
12 12 #
13 13
14 14 #
15 15 # The src/ sub-directory is un-modified copy of
16 -# https://github.com/illumos/smatch/tree/0.5.1-il-5
16 +# https://github.com/illumos/smatch/tree/0.5.1-il-6
17 17 #
18 18 # This Makefile installs just enough for us to be able to run smatch
19 19 # locally.
20 20 #
21 21
22 22 PROG = smatch
23 -SPARSE_VERSION = 0.5.1-il-5
23 +SPARSE_VERSION = 0.5.1-il-6
24 24
25 25 include ../Makefile.tools
26 26
27 27 # We have to build smatch before we can use cw
28 28 i386_CC = $(GNUC_ROOT)/bin/gcc
29 29 sparc_CC = $(GNUC_ROOT)/bin/gcc
30 30 # sparc doesn't recognise -msave-args
31 31 i386_SMATCHFLAGS = -msave-args
32 32 sparc_SMATCHFLAGS =
33 33
34 34 CFLAGS = -O -m64 $($(MACH)_SMATCHFLAGS) -D__sun -Wall -Wno-unknown-pragmas -std=gnu99 -nodefaultlibs
35 35
36 36 SMATCHDATADIR = $(ROOTONBLDSHARE)/smatch
37 37
38 38 CFLAGS += -DSMATCHDATADIR='"$(SMATCHDATADIR)"'
39 39 CFLAGS += -DGCC_BASE='"/no/such/dir"'
40 40 CFLAGS += -DMULTIARCH_TRIPLET=NULL
41 41
42 42 LDLIBS += -lsqlite3 -lcrypto -lm -lgcc -lc
43 43 LDFLAGS = $(MAPFILE.NES:%=-Wl,-M%)
44 44 LDFLAGS += -L$(NATIVE_ADJUNCT)/lib -R$(NATIVE_ADJUNCT)/lib
45 45
46 46 CPPFLAGS += -nostdinc
47 47 CPPFLAGS += -Isrc/
48 48 CPPFLAGS += -I$(NATIVE_ADJUNCT)/include
49 49
50 50 # no install.bin
51 51 INS.file = $(RM) $@; $(CP) $< $(@D); $(CHMOD) $(FILEMODE) $@
52 52 INS.dir = mkdir -p $@; $(CHMOD) $(DIRMODE) $@
53 53
54 54 SMATCH_CHECK_OBJS:sh=ls src/check_*.c | sed -e 's+\.c+.o+;s+src/++;'
55 55
56 56 OBJS = smatch.o $(SMATCH_CHECK_OBJS)
57 57
58 58 OBJS += smatch_flow.o smatch_conditions.o smatch_slist.o smatch_states.o \
59 59 smatch_helper.o smatch_type.o smatch_hooks.o smatch_function_hooks.o \
60 60 smatch_modification_hooks.o smatch_extra.o smatch_estate.o smatch_math.o \
61 61 smatch_sval.o smatch_ranges.o smatch_implied.o smatch_ignore.o smatch_project.o \
62 62 smatch_var_sym.o smatch_tracker.o smatch_files.o smatch_expression_stacks.o \
63 63 smatch_equiv.o smatch_buf_size.o smatch_strlen.o smatch_capped.o smatch_db.o \
64 64 smatch_expressions.o smatch_returns.o smatch_parse_call_math.o \
65 65 smatch_param_limit.o smatch_param_filter.o \
66 66 smatch_param_set.o smatch_comparison.o smatch_param_compare_limit.o smatch_local_values.o \
67 67 smatch_function_ptrs.o smatch_annotate.o smatch_string_list.o \
68 68 smatch_param_cleared.o smatch_start_states.o \
69 69 smatch_recurse.o smatch_data_source.o smatch_type_val.o \
70 70 smatch_common_functions.o smatch_struct_assignment.o \
71 71 smatch_unknown_value.o smatch_stored_conditions.o avl.o \
72 72 smatch_function_info.o smatch_links.o smatch_auto_copy.o \
73 73 smatch_type_links.o smatch_untracked_param.o smatch_impossible.o \
74 74 smatch_strings.o smatch_param_used.o smatch_container_of.o smatch_address.o \
75 75 smatch_buf_comparison.o smatch_real_absolute.o smatch_scope.o \
76 76 smatch_imaginary_absolute.o smatch_parameter_names.o \
77 77 smatch_return_to_param.o smatch_passes_array_size.o \
78 78 smatch_constraints.o smatch_constraints_required.o \
79 79 smatch_fn_arg_link.o smatch_about_fn_ptr_arg.o smatch_mtag.o \
80 80 smatch_mtag_map.o smatch_mtag_data.o \
81 81 smatch_param_to_mtag_data.o smatch_mem_tracker.o smatch_array_values.o \
82 82 smatch_nul_terminator.o smatch_assigned_expr.o smatch_kernel_user_data.o \
83 83 smatch_statement_count.o smatch_bits.o smatch_integer_overflow.o
84 84
85 85 OBJS += target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
86 86 expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
87 87 char.o sort.o allocate.o compat-linux.o ptrlist.o \
88 88 builtin.o \
89 89 stats.o \
90 90 flow.o cse.o simplify.o memops.o liveness.o storage.o unssa.o \
91 91 dissect.o \
92 92 macro_table.o token_store.o hashtable.o
93 93
94 94 SMATCH_DATA = \
95 95 illumos_kernel.skipped_functions \
96 96 illumos_user.skipped_functions
97 97
98 98 SMATCH_DB_DATA = \
99 99 return_states.schema \
100 100 call_implies.schema \
101 101 type_value.schema \
102 102 param_map.schema \
103 103 function_type_size.schema \
104 104 parameter_name.schema \
105 105 fn_ptr_data_link.schema \
106 106 constraints.schema \
107 107 mtag_about.schema \
108 108 type_info.schema \
109 109 function_type_info.schema \
110 110 caller_info.schema \
111 111 function_type_value.schema \
112 112 return_implies.schema \
113 113 type_size.schema \
114 114 constraints_required.schema \
115 115 fn_data_link.schema \
116 116 mtag_alias.schema \
117 117 common_caller_info.schema \
118 118 data_info.schema \
119 119 function_type.schema \
120 120 db.schema \
121 121 mtag_data.schema \
122 122 function_ptr.schema \
123 123 sink_info.schema \
124 124 local_values.schema \
125 125 mtag_map.schema
126 126
127 127 ROOTONBLDDATAFILES = $(SMATCH_DATA:%=$(SMATCHDATADIR)/smatch_data/%)
128 128 ROOTONBLDDATAFILES += $(SMATCH_DB_DATA:%=$(SMATCHDATADIR)/smatch_data/db/%)
129 129
130 130 BUILT_HEADERS = src/version.h src/check_list_local.h
131 131
132 132 .KEEP_STATE:
133 133
134 134 .PARALLEL: $(OBJS)
135 135
136 136 all: $(PROG)
137 137
138 138 install: all .WAIT $(ROOTONBLDMACHPROG) $(ROOTONBLDDATAFILES)
139 139
140 140 clean:
141 141 rm -f $(OBJS) $(BUILT_HEADERS)
142 142
143 143 $(ROOTONBLDDATAFILES): $(SMATCHDATADIR)/smatch_data/db
144 144
145 145 $(SMATCHDATADIR)/smatch_data/%: src/smatch_data/%
146 146 $(INS.file)
147 147
148 148 $(SMATCHDATADIR)/smatch_data/db:
149 149 $(INS.dir)
150 150
151 151 $(SMATCHDATADIR)/smatch_data:
152 152 $(INS.dir)
153 153
154 154 $(PROG): $(OBJS)
155 155 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
156 156 $(POST_PROCESS)
157 157
158 158 %.o: src/%.c $(BUILT_HEADERS)
159 159 $(COMPILE.c) -o $@ $<
160 160
161 161 %.o: src/cwchash/%.c
162 162 $(COMPILE.c) -o $@ $<
163 163
164 164 src/check_list_local.h:
165 165 touch src/check_list_local.h
166 166
167 167 src/version.h:
168 168 echo '#define SPARSE_VERSION "$(SPARSE_VERSION)"' > src/version.h
169 169
170 170 include ../Makefile.targ
↓ open down ↓ |
137 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX