Print this page
6648 illumos build should be explicit about C standards

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libm/Makefile.libm.com
          +++ new/usr/src/lib/libm/Makefile.libm.com
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16  LIBMDIR         = $(SRC)/lib/libm
  17   17  
  18   18  LIBMSRC         = $(LIBMDIR)/common
  19   19  
  20   20  CPP_CMD         = $(CC) -E -Xs
  21   21  
  22   22  ASSUFFIX_sparc  = S
  23   23  ASSUFFIX_i386   = s
  24   24  ASSUFFIX        = $(ASSUFFIX_$(MACH))
  25   25  
  26      -# C99MODE of neither enabled nor disabled is "no_lib", whereby we expect
  27      -# C99-the-language, but don't modify the behaviour of library routines.  This
  28      -# is VERY IMPORTANT, as -xc99=%all, for instance, would link us with
       26 +# With studio C99MODE 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 -xc99=%all, for instance, would link us with
  29   29  # values-xpg6, which would introduce an __xpg6 to our object with the C99
  30   30  # flags set, causing us to default C99 libm behaviour on, breaking
  31   31  # compatibility.
       32 +#
       33 +# We must then, unfortunately, defeat the GNU compiler _defaulting_ to C99, by
       34 +# in that case setting it back to gnu89, which _also_ accepts C99 syntax as
       35 +# far as is important.
  32   36  C99MODE         =
       37 +CFLAGS          += -_gcc=-std=gnu89
       38 +CFLAGS64        += -_gcc=-std=gnu89
  33   39  
  34   40  M4FLAGS         = -D__STDC__ -DPIC
  35   41  
  36   42  LDBLDIR_sparc   = Q
  37   43  LDBLDIR_i386    = LD
  38   44  LDBLDIR         = $(LDBLDIR_$(MACH))
  39   45  
  40   46  LM_IL           = $(LIBMDIR)/$(TARGET_ARCH)/src/locallibm.il
  41   47  
  42   48  CFLAGS          += $(C_PICFLAGS) $(XSTRCONST) $(LM_IL)
  43   49  CFLAGS64        += $(C_PICFLAGS) $(XSTRCONST) $(LM_IL)
  44   50  sparc_CFLAGS    += -Wa,-xarch=v8plus
  45   51  
  46   52  CPPFLAGS        += -I$(LIBMSRC)/C \
  47   53                  -I$(LIBMSRC)/$(LDBLDIR) -I$(LIBMDIR)/$(TARGET_ARCH)/src
  48   54  
  49   55  # GCC needs __C99FEATURES__ such that the implementations of isunordered,
  50   56  # isgreaterequal, islessequal, etc, exist.  This is basically equivalent to
  51   57  # providing no -xc99 to Studio, in that it gets us the C99 language features,
  52      -# but not values-xpg6, the reason for which is outline with C99MODE.
       58 +# but not values-xpg6, the reason for which is outlined with C99MODE.
  53   59  CFLAGS          += -_gcc=-D__C99FEATURES__
  54   60  CFLAGS64        += -_gcc=-D__C99FEATURES__
  55   61  
  56   62  # libm depends on integer overflow characteristics
  57   63  CFLAGS          += -_gcc=-fno-strict-overflow
  58   64  CFLAGS64        += -_gcc=-fno-strict-overflow
  59   65  
  60   66  $(DYNLIB)       := LDLIBS += -lc
  61   67  
  62   68  $(LINTLIB)      := SRCS = $(LIBMSRC)/$(LINTSRC)
↓ open down ↓ 29 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX