Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
   1 #
   2 # This file and its contents are supplied under the terms of the
   3 # Common Development and Distribution License ("CDDL"), version 1.0.
   4 # You may only use this file in accordance with the terms of version
   5 # 1.0 of the CDDL.
   6 #
   7 # A full copy of the text of the CDDL should have accompanied this
   8 # source.  A copy of the CDDL is also available via the Internet at
   9 # http://www.illumos.org/license/CDDL.
  10 #
  11 # Copyright (c) 2019, Joyent, Inc.
  12 #
  13 
  14 #
  15 # The src/ sub-directory is un-modified copy of
  16 # https://github.com/illumos/smatch/tree/0.5.1-il-4
  17 #
  18 # This Makefile installs just enough for us to be able to run smatch
  19 # locally.
  20 #
  21 
  22 PROG = smatch
  23 SPARSE_VERSION = 0.5.1-il-4
  24 
  25 include ../Makefile.tools
  26 
  27 # We have to build smatch before we can use cw
  28 i386_CC = $(GNUC_ROOT)/bin/gcc
  29 sparc_CC = $(GNUC_ROOT)/bin/gcc
  30 # sparc doesn't recognise -msave-args
  31 i386_SMATCHFLAGS = -msave-args
  32 sparc_SMATCHFLAGS =
  33 
  34 CFLAGS = -O -m64 $($(MACH)_SMATCHFLAGS) -D__sun -Wall -Wno-unknown-pragmas -std=gnu99 -nodefaultlibs
  35 
  36 SMATCHDATADIR = $(ROOTONBLDSHARE)/smatch
  37 
  38 CFLAGS += -DSMATCHDATADIR='"$(SMATCHDATADIR)"'
  39 CFLAGS += -DGCC_BASE='"/no/such/dir"'
  40 CFLAGS += -DMULTIARCH_TRIPLET=NULL
  41 
  42 LDLIBS += -lsqlite3 -lcrypto -lm -lgcc -lc
  43 LDFLAGS = $(MAPFILE.NES:%=-Wl,-M%)


  75         smatch_buf_comparison.o smatch_real_absolute.o smatch_scope.o \
  76         smatch_imaginary_absolute.o smatch_parameter_names.o \
  77         smatch_return_to_param.o smatch_passes_array_size.o \
  78         smatch_constraints.o smatch_constraints_required.o \
  79         smatch_fn_arg_link.o smatch_about_fn_ptr_arg.o smatch_mtag.o \
  80         smatch_mtag_map.o smatch_mtag_data.o \
  81         smatch_param_to_mtag_data.o smatch_mem_tracker.o smatch_array_values.o \
  82         smatch_nul_terminator.o smatch_assigned_expr.o smatch_kernel_user_data.o \
  83         smatch_statement_count.o smatch_bits.o smatch_integer_overflow.o
  84 
  85 OBJS += target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
  86         expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
  87         char.o sort.o allocate.o compat-linux.o ptrlist.o \
  88         builtin.o \
  89         stats.o \
  90         flow.o cse.o simplify.o memops.o liveness.o storage.o unssa.o \
  91         dissect.o \
  92         macro_table.o token_store.o hashtable.o
  93 
  94 SMATCH_DATA = \
  95         illumos_kernel.no_return_funcs \
  96         illumos_kernel.skipped_functions \
  97         illumos_user.no_return_funcs \
  98         illumos_user.skipped_functions
  99 
 100 SMATCH_DB_DATA = \
 101         return_states.schema \
 102         call_implies.schema \
 103         type_value.schema \
 104         param_map.schema \
 105         function_type_size.schema \
 106         parameter_name.schema \
 107         fn_ptr_data_link.schema \
 108         constraints.schema \
 109         mtag_about.schema \
 110         type_info.schema \
 111         function_type_info.schema \
 112         caller_info.schema \
 113         function_type_value.schema \
 114         return_implies.schema \
 115         type_size.schema \
 116         constraints_required.schema \
 117         fn_data_link.schema \


   1 #
   2 # This file and its contents are supplied under the terms of the
   3 # Common Development and Distribution License ("CDDL"), version 1.0.
   4 # You may only use this file in accordance with the terms of version
   5 # 1.0 of the CDDL.
   6 #
   7 # A full copy of the text of the CDDL should have accompanied this
   8 # source.  A copy of the CDDL is also available via the Internet at
   9 # http://www.illumos.org/license/CDDL.
  10 #
  11 # Copyright (c) 2019, Joyent, Inc.
  12 #
  13 
  14 #
  15 # The src/ sub-directory is un-modified copy of
  16 # https://github.com/illumos/smatch/tree/0.5.1-il-5
  17 #
  18 # This Makefile installs just enough for us to be able to run smatch
  19 # locally.
  20 #
  21 
  22 PROG = smatch
  23 SPARSE_VERSION = 0.5.1-il-5
  24 
  25 include ../Makefile.tools
  26 
  27 # We have to build smatch before we can use cw
  28 i386_CC = $(GNUC_ROOT)/bin/gcc
  29 sparc_CC = $(GNUC_ROOT)/bin/gcc
  30 # sparc doesn't recognise -msave-args
  31 i386_SMATCHFLAGS = -msave-args
  32 sparc_SMATCHFLAGS =
  33 
  34 CFLAGS = -O -m64 $($(MACH)_SMATCHFLAGS) -D__sun -Wall -Wno-unknown-pragmas -std=gnu99 -nodefaultlibs
  35 
  36 SMATCHDATADIR = $(ROOTONBLDSHARE)/smatch
  37 
  38 CFLAGS += -DSMATCHDATADIR='"$(SMATCHDATADIR)"'
  39 CFLAGS += -DGCC_BASE='"/no/such/dir"'
  40 CFLAGS += -DMULTIARCH_TRIPLET=NULL
  41 
  42 LDLIBS += -lsqlite3 -lcrypto -lm -lgcc -lc
  43 LDFLAGS = $(MAPFILE.NES:%=-Wl,-M%)


  75         smatch_buf_comparison.o smatch_real_absolute.o smatch_scope.o \
  76         smatch_imaginary_absolute.o smatch_parameter_names.o \
  77         smatch_return_to_param.o smatch_passes_array_size.o \
  78         smatch_constraints.o smatch_constraints_required.o \
  79         smatch_fn_arg_link.o smatch_about_fn_ptr_arg.o smatch_mtag.o \
  80         smatch_mtag_map.o smatch_mtag_data.o \
  81         smatch_param_to_mtag_data.o smatch_mem_tracker.o smatch_array_values.o \
  82         smatch_nul_terminator.o smatch_assigned_expr.o smatch_kernel_user_data.o \
  83         smatch_statement_count.o smatch_bits.o smatch_integer_overflow.o
  84 
  85 OBJS += target.o parse.o tokenize.o pre-process.o symbol.o lib.o scope.o \
  86         expression.o show-parse.o evaluate.o expand.o inline.o linearize.o \
  87         char.o sort.o allocate.o compat-linux.o ptrlist.o \
  88         builtin.o \
  89         stats.o \
  90         flow.o cse.o simplify.o memops.o liveness.o storage.o unssa.o \
  91         dissect.o \
  92         macro_table.o token_store.o hashtable.o
  93 
  94 SMATCH_DATA = \

  95         illumos_kernel.skipped_functions \

  96         illumos_user.skipped_functions
  97 
  98 SMATCH_DB_DATA = \
  99         return_states.schema \
 100         call_implies.schema \
 101         type_value.schema \
 102         param_map.schema \
 103         function_type_size.schema \
 104         parameter_name.schema \
 105         fn_ptr_data_link.schema \
 106         constraints.schema \
 107         mtag_about.schema \
 108         type_info.schema \
 109         function_type_info.schema \
 110         caller_info.schema \
 111         function_type_value.schema \
 112         return_implies.schema \
 113         type_size.schema \
 114         constraints_required.schema \
 115         fn_data_link.schema \