22386263 GCC 4.9.3 in Solaris 11 needs more XPG
22386281 GCC 4.9.3 in Solaris 11 can't use libc's __cxa_atexit
--- a/components/gcc49/Makefile Thu Dec 17 09:49:53 2015 -0800
+++ b/components/gcc49/Makefile Thu Dec 17 16:01:28 2015 -0800
@@ -48,6 +48,11 @@
PATCH_LEVEL := 0
ENABLE_CLOOG := 0
+ENABLE_CXA_ATEXIT=yes
+ifeq ($(OS_VERSION), 5.11)
+ ENABLE_CXA_ATEXIT=no
+endif
+
PARCH = $(MACH:i386=i386-pc)
GNU_ARCH = $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
@@ -143,7 +148,7 @@
# VTable verification needs additional linker support.
CONFIGURE_OPTIONS += --enable-vtable-verify=no
CONFIGURE_OPTIONS += --enable-comdat=yes
-CONFIGURE_OPTIONS += --enable-__cxa_atexit=yes
+CONFIGURE_OPTIONS += --enable-__cxa_atexit=$(ENABLE_CXA_ATEXIT)
# Although this is required by the C++11/C++14 standards,
# it appears broken in 4.9.3.
@@ -211,7 +216,11 @@
COMPONENT_TEST_TARGETS = check check-target
COMPONENT_TEST_ENV += TCL_LIBRARY="/usr/lib/tcl8.5"
-COMPONENT_TEST_ENV += DEJAGNULIBS="/usr/share/dejagnu"
+
+# We don't have DejaGNU in S11.
+ifeq ($(OS_VERSION), 5.12)
+ COMPONENT_TEST_ENV += DEJAGNULIBS="/usr/share/dejagnu"
+endif
test: $(TEST_32)
--- a/components/gcc49/patches/000-sol2.h.patch Thu Dec 17 09:49:53 2015 -0800
+++ b/components/gcc49/patches/000-sol2.h.patch Thu Dec 17 16:01:28 2015 -0800
@@ -3,10 +3,9 @@
# Standard we are compiling for.
# We also need to link in specific *.o's to the Language Standard
# we are compiling for.
-# Solaris specific internal patch.
--- gcc/config/sol2.h 2014-05-28 04:37:50.000000000 -0700
-+++ gcc/config/sol2.h 2015-11-10 16:03:47.892113304 -0800
[email protected]@ -89,11 +89,76 @@
++++ gcc/config/sol2.h 2015-12-17 10:34:30.939353421 -0800
[email protected]@ -89,11 +89,80 @@
library. */ \
if (c_dialect_cxx ()) \
{ \
@@ -14,6 +13,7 @@
+ { \
+ builtin_define ("__STDC_VERSION__=199409L"); \
+ builtin_define ("_XOPEN_SOURCE=500"); \
++ builtin_define ("_XPG5=1"); \
+ } \
+ else if (cxx_dialect == cxx11) \
+ { \
@@ -22,6 +22,7 @@
+ builtin_define ("__C99FEATURES__=1"); \
+ builtin_define ("__XPG7_THREAD_MODEL__=1"); \
+ builtin_define ("_XOPEN_SOURCE=700"); \
++ builtin_define ("_XPG6=1"); \
+ builtin_define ("__STDC_ISO_10646__=201011L"); \
+ builtin_define ("__STDC_MB_MIGHT_NEQ_WC__=1"); \
+ builtin_define ("__STDCPP_STRICT_POINTER_SAFETY__=1"); \
@@ -35,16 +36,18 @@
+ builtin_define ("__C99FEATURES__=1"); \
+ builtin_define ("__XPG7_THREAD_MODEL__=1"); \
+ builtin_define ("_XOPEN_SOURCE=700"); \
++ builtin_define ("_XPG7=1"); \
+ builtin_define ("__STDC_ISO_10646__=201011L"); \
+ builtin_define ("__STDC_MB_MIGHT_NEQ_WC__=1"); \
+ builtin_define ("__STDCPP_STRICT_POINTER_SAFETY__=1"); \
-+ builtin_define ("__STDC_LIB_EXT1__=201112L"); \
++ builtin_define ("__STDC_LIB_EXT1__=201112L"); \
+ builtin_define ("__STDCPP_THREADS__=1"); \
+ } \
+ else \
+ { \
builtin_define ("__STDC_VERSION__=199901L");\
builtin_define ("_XOPEN_SOURCE=600"); \
++ builtin_define ("_XPG6=1"); \
+ } \
builtin_define ("_LARGEFILE_SOURCE=1"); \
builtin_define ("_LARGEFILE64_SOURCE=1"); \
@@ -84,7 +87,7 @@
} \
TARGET_SUB_OS_CPP_BUILTINS(); \
} while (0)
[email protected]@ -109,7 +174,12 @@
[email protected]@ -109,7 +178,12 @@
#define ASM_SPEC_BASE \
"%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} -s %(asm_cpu)"
@@ -97,7 +100,7 @@
#undef LIB_SPEC
#define LIB_SPEC \
[email protected]@ -127,8 +197,62 @@
[email protected]@ -127,8 +201,62 @@
#endif
#undef STARTFILE_ARCH32_SPEC
@@ -162,7 +165,7 @@
#undef STARTFILE_ARCH_SPEC
#define STARTFILE_ARCH_SPEC STARTFILE_ARCH32_SPEC
[email protected]@ -154,8 +278,8 @@
[email protected]@ -154,8 +282,8 @@
"%{G:-G} \
%{YP,*} \
%{R*} \
@@ -173,7 +176,7 @@
#undef LINK_ARCH32_SPEC
#define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
[email protected]@ -191,6 +315,10 @@
[email protected]@ -191,6 +319,10 @@
#define LINK_CLEARCAP_SPEC ""
#endif
@@ -184,7 +187,7 @@
#undef LINK_SPEC
#define LINK_SPEC \
"%{h*} %{v:-V} \
[email protected]@ -199,6 +327,8 @@
[email protected]@ -199,6 +331,8 @@
%{shared:-G -dy %{!mimpure-text:-z text}} " \
LINK_LIBGCC_MAPFILE_SPEC LINK_CLEARCAP_SPEC " \
%{symbolic:-Bsymbolic -G -dy -z text} \