Print this page
10063 basic support for smatch
10153 checkpaths shouldn't check packaging exceptions
   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 
  12 #
  13 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.

  14 #
  15 
  16 LIBMDIR         = $(SRC)/lib/libm
  17 
  18 LIBMSRC         = $(LIBMDIR)/common
  19 
  20 CPP_CMD         = $(CC) -E -Xs
  21 
  22 ASSUFFIX_sparc  = S
  23 ASSUFFIX_i386   = s
  24 ASSUFFIX        = $(ASSUFFIX_$(MACH))
  25 
  26 # With studio CSTD of neither enabled nor disabled is "no_lib", whereby we
  27 # expect C99-the-language, but don't modify the behaviour of library routines.
  28 # This is VERY IMPORTANT, as $(CSTD_GNU99), for instance, would link us with
  29 # values-xpg6, which would introduce an __xpg6 to our object with the C99
  30 # flags set, causing us to default C99 libm behaviour on, breaking
  31 # compatibility.
  32 #
  33 # We must then, unfortunately, defeat the GNU compiler _defaulting_ to C99, by


  46 LM_IL           = $(LIBMDIR)/$(TARGET_ARCH)/src/locallibm.il
  47 
  48 CFLAGS          += $(C_PICFLAGS) $(XSTRCONST) $(LM_IL)
  49 CFLAGS64        += $(C_PICFLAGS) $(XSTRCONST) $(LM_IL)
  50 sparc_CFLAGS    += -Wa,-xarch=v8plus
  51 
  52 CPPFLAGS        += -I$(LIBMSRC)/C \
  53                 -I$(LIBMSRC)/$(LDBLDIR) -I$(LIBMDIR)/$(TARGET_ARCH)/src
  54 
  55 # GCC needs __C99FEATURES__ such that the implementations of isunordered,
  56 # isgreaterequal, islessequal, etc, exist.  This is basically equivalent to
  57 # providing no -xc99 to Studio, in that it gets us the C99 language features,
  58 # but not values-xpg6, the reason for which is outlined with CSTD.
  59 CFLAGS          += -_gcc=-D__C99FEATURES__
  60 CFLAGS64        += -_gcc=-D__C99FEATURES__
  61 
  62 # libm depends on integer overflow characteristics
  63 CFLAGS          += -_gcc=-fno-strict-overflow
  64 CFLAGS64        += -_gcc=-fno-strict-overflow
  65 




  66 $(DYNLIB)       := LDLIBS += -lc
  67 
  68 $(LINTLIB)      := SRCS = $(LIBMSRC)/$(LINTSRC)
  69 
  70 CLEANFILES      += pics/*.s pics/*.S
  71 
  72 FPDEF_amd64     = -DARCH_amd64
  73 FPDEF_sparc     = -DCG89 -DARCH_v8plus -DFPADD_TRAPS_INCOMPLETE_ON_NAN
  74 FPDEF_sparcv9   = -DARCH_v9 -DFPADD_TRAPS_INCOMPLETE_ON_NAN
  75 FPDEF           = $(FPDEF_$(TARGET_ARCH))
  76 
  77 ASFLAGS         = -P -D_ASM $(FPDEF)
  78 
  79 XARCH_sparc     = v8plus
  80 XARCH_sparcv9   = v9
  81 XARCH_i386      = f80387
  82 XARCH_amd64     = amd64
  83 XARCH           = $(XARCH_$(TARGET_ARCH))
  84 
  85 ASOPT_sparc     = -xarch=$(XARCH) $(AS_PICFLAGS)
   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 
  12 #
  13 # Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  14 # Copyright (c) 2018, Joyent, Inc.
  15 #
  16 
  17 LIBMDIR         = $(SRC)/lib/libm
  18 
  19 LIBMSRC         = $(LIBMDIR)/common
  20 
  21 CPP_CMD         = $(CC) -E -Xs
  22 
  23 ASSUFFIX_sparc  = S
  24 ASSUFFIX_i386   = s
  25 ASSUFFIX        = $(ASSUFFIX_$(MACH))
  26 
  27 # With studio CSTD of neither enabled nor disabled is "no_lib", whereby we
  28 # expect C99-the-language, but don't modify the behaviour of library routines.
  29 # This is VERY IMPORTANT, as $(CSTD_GNU99), for instance, would link us with
  30 # values-xpg6, which would introduce an __xpg6 to our object with the C99
  31 # flags set, causing us to default C99 libm behaviour on, breaking
  32 # compatibility.
  33 #
  34 # We must then, unfortunately, defeat the GNU compiler _defaulting_ to C99, by


  47 LM_IL           = $(LIBMDIR)/$(TARGET_ARCH)/src/locallibm.il
  48 
  49 CFLAGS          += $(C_PICFLAGS) $(XSTRCONST) $(LM_IL)
  50 CFLAGS64        += $(C_PICFLAGS) $(XSTRCONST) $(LM_IL)
  51 sparc_CFLAGS    += -Wa,-xarch=v8plus
  52 
  53 CPPFLAGS        += -I$(LIBMSRC)/C \
  54                 -I$(LIBMSRC)/$(LDBLDIR) -I$(LIBMDIR)/$(TARGET_ARCH)/src
  55 
  56 # GCC needs __C99FEATURES__ such that the implementations of isunordered,
  57 # isgreaterequal, islessequal, etc, exist.  This is basically equivalent to
  58 # providing no -xc99 to Studio, in that it gets us the C99 language features,
  59 # but not values-xpg6, the reason for which is outlined with CSTD.
  60 CFLAGS          += -_gcc=-D__C99FEATURES__
  61 CFLAGS64        += -_gcc=-D__C99FEATURES__
  62 
  63 # libm depends on integer overflow characteristics
  64 CFLAGS          += -_gcc=-fno-strict-overflow
  65 CFLAGS64        += -_gcc=-fno-strict-overflow
  66 
  67 # sparse currently has no _Complex support
  68 CFLAGS          += -_smatch=off
  69 CFLAGS64        += -_smatch=off
  70 
  71 $(DYNLIB)       := LDLIBS += -lc
  72 
  73 $(LINTLIB)      := SRCS = $(LIBMSRC)/$(LINTSRC)
  74 
  75 CLEANFILES      += pics/*.s pics/*.S
  76 
  77 FPDEF_amd64     = -DARCH_amd64
  78 FPDEF_sparc     = -DCG89 -DARCH_v8plus -DFPADD_TRAPS_INCOMPLETE_ON_NAN
  79 FPDEF_sparcv9   = -DARCH_v9 -DFPADD_TRAPS_INCOMPLETE_ON_NAN
  80 FPDEF           = $(FPDEF_$(TARGET_ARCH))
  81 
  82 ASFLAGS         = -P -D_ASM $(FPDEF)
  83 
  84 XARCH_sparc     = v8plus
  85 XARCH_sparcv9   = v9
  86 XARCH_i386      = f80387
  87 XARCH_amd64     = amd64
  88 XARCH           = $(XARCH_$(TARGET_ARCH))
  89 
  90 ASOPT_sparc     = -xarch=$(XARCH) $(AS_PICFLAGS)