components/gcc49/patches/000-sol2.h.patch
changeset 5205 eaff9ab86216
child 5210 f83eefca4ec2
equal deleted inserted replaced
5204:766639d560b9 5205:eaff9ab86216
       
     1 # Stefan Teleman <[email protected]>
       
     2 # We need to raise a number of macros depending on which Language
       
     3 # Standard we are compiling for.
       
     4 # We also need to link in specific *.o's to the Language Standard
       
     5 # we are compiling for.
       
     6 # Solaris specific internal patch.
       
     7 --- gcc/config/sol2.h	2014-05-28 04:37:50.000000000 -0700
       
     8 +++ gcc/config/sol2.h	2015-11-10 16:03:47.892113304 -0800
       
     9 @@ -89,11 +89,76 @@
       
    10  	   library.  */					\
       
    11  	if (c_dialect_cxx ())				\
       
    12  	  {						\
       
    13 +        if ((cxx_dialect == cxx98) || (cxx_dialect == cxx03))  \
       
    14 +        { \
       
    15 +          builtin_define ("__STDC_VERSION__=199409L");         \
       
    16 +          builtin_define ("_XOPEN_SOURCE=500");                \
       
    17 +        } \
       
    18 +        else if (cxx_dialect == cxx11)                         \
       
    19 +        { \
       
    20 +          builtin_define ("__STDC_VERSION__=199901L");         \
       
    21 +          builtin_define ("_STDC_C99=1");                      \
       
    22 +          builtin_define ("__C99FEATURES__=1");                \
       
    23 +          builtin_define ("__XPG7_THREAD_MODEL__=1");          \
       
    24 +          builtin_define ("_XOPEN_SOURCE=700");                \
       
    25 +          builtin_define ("__STDC_ISO_10646__=201011L");       \
       
    26 +          builtin_define ("__STDC_MB_MIGHT_NEQ_WC__=1");       \
       
    27 +          builtin_define ("__STDCPP_STRICT_POINTER_SAFETY__=1");  \
       
    28 +          builtin_define ("__STDCPP_THREADS__=1");             \
       
    29 +        } \
       
    30 +        else if ((cxx_dialect > cxx11) || (cxx_dialect == cxx1y)) \
       
    31 +        { \
       
    32 +          builtin_define ("__STDC_VERSION__=201112L");         \
       
    33 +          builtin_define ("_STDC_C99=1");                      \
       
    34 +          builtin_define ("_STDC_C11=1");                      \
       
    35 +          builtin_define ("__C99FEATURES__=1");                \
       
    36 +          builtin_define ("__XPG7_THREAD_MODEL__=1");          \
       
    37 +          builtin_define ("_XOPEN_SOURCE=700");                \
       
    38 +          builtin_define ("__STDC_ISO_10646__=201011L");       \
       
    39 +          builtin_define ("__STDC_MB_MIGHT_NEQ_WC__=1");       \
       
    40 +          builtin_define ("__STDCPP_STRICT_POINTER_SAFETY__=1");  \
       
    41 +          builtin_define ("__STDC_LIB_EXT1__=201112L");         \
       
    42 +          builtin_define ("__STDCPP_THREADS__=1");             \
       
    43 +        } \
       
    44 +        else \
       
    45 +        { \
       
    46  	    builtin_define ("__STDC_VERSION__=199901L");\
       
    47  	    builtin_define ("_XOPEN_SOURCE=600");	\
       
    48 +        } \
       
    49  	    builtin_define ("_LARGEFILE_SOURCE=1");	\
       
    50  	    builtin_define ("_LARGEFILE64_SOURCE=1");	\
       
    51 -	    builtin_define ("__EXTENSIONS__");		\
       
    52 +        builtin_define ("_FILE_OFFSET_BITS=64");              \
       
    53 +        builtin_define ("__EXTENSIONS__=1");                  \
       
    54 +        builtin_define ("_REENTRANT=1");                      \
       
    55 +      }                                                       \
       
    56 +      if (c_language == clk_c)                                \
       
    57 +      { \
       
    58 +        builtin_define ("_LARGEFILE_SOURCE=1");	\
       
    59 +        builtin_define ("_LARGEFILE64_SOURCE=1");	\
       
    60 +        builtin_define ("_FILE_OFFSET_BITS=64");              \
       
    61 +        builtin_define ("_REENTRANT=1");                      \
       
    62 +        builtin_define ("__EXTENSIONS__=1");                  \
       
    63 +        if (flag_isoc11 == 1)                                 \
       
    64 +        { \
       
    65 +          builtin_define ("_STDC_C11=1");                     \
       
    66 +          builtin_define ("__STDC_ISO_10646__=201011L");      \
       
    67 +          builtin_define ("__STDC_MB_MIGHT_NEQ_WC__=1");      \
       
    68 +          builtin_define ("__STDC_ANALYZABLE=1");             \
       
    69 +          builtin_define ("__STDC_IEC_559__=1");              \
       
    70 +          builtin_define ("__STDC_IEC_559_COMPLEX__=1");      \
       
    71 +          builtin_define ("__STDC_LIB_EXT1__=201112L");       \
       
    72 +          builtin_define ("__XPG7_THREAD_MODEL__=1");         \
       
    73 +          builtin_define ("_XOPEN_SOURCE=700");               \
       
    74 +        } \
       
    75 +        else if (flag_isoc99 == 1)                            \
       
    76 +        { \
       
    77 +          builtin_define ("__C99FEATURES__=1");               \
       
    78 +          if (flag_isoc11 == 0)                               \
       
    79 +          { \
       
    80 +            builtin_define ("_STDC_C99=1");                   \
       
    81 +            builtin_define ("_XOPEN_SOURCE=600");             \
       
    82 +          } \
       
    83 +        } \
       
    84  	  }						\
       
    85  	TARGET_SUB_OS_CPP_BUILTINS();			\
       
    86      } while (0)
       
    87 @@ -109,7 +174,12 @@
       
    88  #define ASM_SPEC_BASE \
       
    89  "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} -s %(asm_cpu)"
       
    90  
       
    91 +/* GAS wants -KPIC, Sun as wants -K PIC */
       
    92 +#ifdef USE_GAS
       
    93  #define ASM_PIC_SPEC " %{fpic|fpie|fPIC|fPIE:-K PIC}"
       
    94 +#else
       
    95 +#define ASM_PIC_SPEC " %{fpic|fpie|fPIC|fPIE:-K PIC}"
       
    96 +#endif
       
    97  
       
    98  #undef LIB_SPEC
       
    99  #define LIB_SPEC \
       
   100 @@ -127,8 +197,62 @@
       
   101  #endif
       
   102  
       
   103  #undef STARTFILE_ARCH32_SPEC
       
   104 -#define STARTFILE_ARCH32_SPEC "%{ansi:values-Xc.o%s} \
       
   105 -			    %{!ansi:values-Xa.o%s}"
       
   106 +#define STARTFILE_ARCH32_SPEC "%{std=c++0x:values-Xc.o%s} \
       
   107 +  %{std=c++0x:values-xpg6.o%s} \
       
   108 +  %{std=c++14:values-Xc.o%s} \
       
   109 +  %{std=c++14:values-xpg6.o%s} \
       
   110 +  %{std=c++11:values-Xc.o%s} \
       
   111 +  %{std=c++11:values-xpg6.o%s} \
       
   112 +  %{std=c11:values-Xc.o%s} \
       
   113 +  %{std=c11:values-xpg6.o%s} \
       
   114 +  %{std=c1x:values-Xc.o%s} \
       
   115 +  %{std=c1x:values-xpg6.o%s} \
       
   116 +  %{std=c99:values-Xc.o%s} \
       
   117 +  %{std=c99:values-xpg6.o%s} \
       
   118 +  %{std=c9x:values-Xc.o%s} \
       
   119 +  %{std=c9x:values-xpg6.o%s} \
       
   120 +  %{std=gnu++0x:values-Xc.o%s} \
       
   121 +  %{std=gnu++0x:values-xpg6.o%s} \
       
   122 +  %{std=gnu++14:values-Xc.o%s} \
       
   123 +  %{std=gnu++14:values-xpg6.o%s} \
       
   124 +  %{std=gnu++11:values-Xc.o%s} \
       
   125 +  %{std=gnu++11:values-xpg6.o%s} \
       
   126 +  %{std=gnu11:values-Xc.o%s} \
       
   127 +  %{std=gnu11:values-xpg6.o%s} \
       
   128 +  %{std=gnu1x:values-Xc.o%s} \
       
   129 +  %{std=gnu1x:values-xpg6.o%s} \
       
   130 +  %{std=gnu99:values-Xc.o%s} \
       
   131 +  %{std=gnu99:values-xpg6.o%s} \
       
   132 +  %{std=gnu9x:values-Xc.o%s} \
       
   133 +  %{std=gnu9x:values-xpg6.o%s} \
       
   134 +  %{std=f2003:values-Xc.o%s} \
       
   135 +  %{std=f2003:values-xpg6.o%s} \
       
   136 +  %{std=f2008:values-Xc.o%s} \
       
   137 +  %{std=f2008:values-xpg6.o%s} \
       
   138 +  %{std=f2008ts:values-Xc.o%s} \
       
   139 +  %{std=f2008ts:values-xpg6.o%s} \
       
   140 +  %{std=f95:values-Xa.o%s} \
       
   141 +  %{std=f95:values-xpg4.o%s} \
       
   142 +  %{std=gnu:values-Xa.o%s} \
       
   143 +  %{std=gnu:values-xpg4.o%s} \
       
   144 +  %{std=legacy:values-Xa.o%s} \
       
   145 +  %{std=legacy:values-xpg4.o%s} \
       
   146 +  %{std=c++03:values-Xa.o%s} \
       
   147 +  %{std=c++03:values-xpg4.o%s} \
       
   148 +  %{std=c++98:values-Xa.o%s} \
       
   149 +  %{std=c++98:values-xpg4.o%s} \
       
   150 +  %{std=c89:values-Xa.o%s} \
       
   151 +  %{std=c89:values-xpg4.o%s} \
       
   152 +  %{std=c90:values-Xa.o%s} \
       
   153 +  %{std=c90:values-xpg4.o%s} \
       
   154 +  %{std=gnu++03:values-Xa.o%s} \
       
   155 +  %{std=gnu++03:values-xpg4.o%s} \
       
   156 +  %{std=gnu++98:values-Xa.o%s} \
       
   157 +  %{std=gnu++98:values-xpg4.o%s} \
       
   158 +  %{std=gnu89:values-Xa.o%s} \
       
   159 +  %{std=gnu89:values-xpg4.o%s} \
       
   160 +  %{std=gnu90:values-Xa.o%s} \
       
   161 +  %{std=gnu90:values-xpg4.o%s}"
       
   162  
       
   163  #undef STARTFILE_ARCH_SPEC
       
   164  #define STARTFILE_ARCH_SPEC STARTFILE_ARCH32_SPEC
       
   165 @@ -154,8 +278,8 @@
       
   166    "%{G:-G} \
       
   167     %{YP,*} \
       
   168     %{R*} \
       
   169 -   %{!YP,*:%{p|pg:-Y P,%R/usr/ccs/lib/libp:%R/usr/lib/libp:%R/usr/ccs/lib:%R/lib:%R/usr/lib} \
       
   170 -	   %{!p:%{!pg:-Y P,%R/usr/ccs/lib:%R/lib:%R/usr/lib}}}"
       
   171 +   %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp:%R/lib:%R/usr/lib} \
       
   172 +     %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib}}}"
       
   173  
       
   174  #undef LINK_ARCH32_SPEC
       
   175  #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
       
   176 @@ -191,6 +315,10 @@
       
   177  #define LINK_CLEARCAP_SPEC ""
       
   178  #endif
       
   179  
       
   180 +/*
       
   181 + * Change -z textwarn to -z text after clearing that [-fpie|-fPIE]
       
   182 + * no longer generates any text relocation warnings.
       
   183 + */
       
   184  #undef  LINK_SPEC
       
   185  #define LINK_SPEC \
       
   186    "%{h*} %{v:-V} \
       
   187 @@ -199,6 +327,8 @@
       
   188     %{shared:-G -dy %{!mimpure-text:-z text}} " \
       
   189     LINK_LIBGCC_MAPFILE_SPEC LINK_CLEARCAP_SPEC " \
       
   190     %{symbolic:-Bsymbolic -G -dy -z text} \
       
   191 +   %{fpie:-Qy -z direct -z textwarn -z type=pie -z aslr=enable} \
       
   192 +   %{fPIE:-Qy -z direct -z textwarn -z type=pie -z aslr=enable} \
       
   193     %(link_arch) \
       
   194     %{Qy:} %{!Qn:-Qy}"
       
   195