components/gcc49/Makefile
changeset 5205 eaff9ab86216
child 5210 f83eefca4ec2
equal deleted inserted replaced
5204:766639d560b9 5205:eaff9ab86216
       
     1 #
       
     2 # CDDL HEADER START
       
     3 #
       
     4 # The contents of this file are subject to the terms of the
       
     5 # Common Development and Distribution License (the "License").
       
     6 # You may not use this file except in compliance with the License.
       
     7 #
       
     8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 # or http://www.opensolaris.org/os/licensing.
       
    10 # See the License for the specific language governing permissions
       
    11 # and limitations under the License.
       
    12 #
       
    13 # When distributing Covered Code, include this CDDL HEADER in each
       
    14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 # If applicable, add the following below this CDDL HEADER, with the
       
    16 # fields enclosed by brackets "[]" replaced with your own identifying
       
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 # Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
       
    22 #
       
    23 export PARFAIT_BUILD=no
       
    24 
       
    25 COMPILER=gcc
       
    26 
       
    27 include ../../make-rules/shared-macros.mk
       
    28 
       
    29 COMPONENT_NAME=		gcc
       
    30 COMPONENT_VERSION=	4.9.3
       
    31 COMPONENT_PROJECT_URL=	http://gcc.gnu.org/
       
    32 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
       
    33 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
       
    34 COMPONENT_ARCHIVE_HASH= \
       
    35     sha256:e6c63b40877bc756cc7cfe6ca98013eb15f02ec6c8c2cf68e24533ad1203aaba
       
    36 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
       
    37 COMPONENT_BUGDB=        utility/gnu-compiler
       
    38 
       
    39 TPNO=			24017
       
    40 
       
    41 include $(WS_MAKE_RULES)/prep.mk
       
    42 include $(WS_MAKE_RULES)/configure.mk
       
    43 include $(WS_MAKE_RULES)/ips.mk
       
    44 
       
    45 # The GNU compiler wants the GNU utilities.
       
    46 PATH=/usr/gnu/bin:/usr/bin:/usr/perl5/bin
       
    47 
       
    48 PATCH_LEVEL := 0
       
    49 ENABLE_CLOOG := 0
       
    50 
       
    51 PARCH =         $(MACH:i386=i386-pc)
       
    52 GNU_ARCH =      $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
       
    53 
       
    54 PKG_MACROS +=   GNU_ARCH="$(GNU_ARCH)"
       
    55 
       
    56 VERSION_NUMBERS = $(subst ., ,$(COMPONENT_VERSION))
       
    57 GCC_VERSION=$(word 1,$(VERSION_NUMBERS)).$(word 2,$(VERSION_NUMBERS))
       
    58 PKG_MACROS +=	GCC_VERSION=$(GCC_VERSION)
       
    59 PKG_MACROS +=	GCC_V=$(word 1,$(VERSION_NUMBERS))$(word 2,$(VERSION_NUMBERS))
       
    60 PKG_MACROS +=	GCC_BASEDIR=usr/gcc/$(GCC_VERSION)
       
    61 
       
    62 GNU_SECTIONS_MAPFILE = $(COMPONENT_DIR)/Solaris/map.gnu-sections
       
    63 
       
    64 CFLAGS.i386 = -mtune=opteron -march=opteron -fno-strict-aliasing
       
    65 CFLAGS.sparc = -mtune=ultrasparc3 -mcpu=ultrasparc3 -mvis2 \
       
    66   -mno-unaligned-doubles -mhard-float -fno-strict-aliasing
       
    67 CFLAGS = -g -O2 -pthread
       
    68 CFLAGS += $(CFLAGS.$(MACH))
       
    69 
       
    70 # _REENTRANT is no longer needed in S12, but still needed in S11.
       
    71 CFLAGS += -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
       
    72 CXXFLAGS = -g -O2 -pthread
       
    73 CXXFLAGS += $(CFLAGS.$(MACH))
       
    74 
       
    75 # If not built with largefile support, cc1 and cc1plus will die
       
    76 # on some very large translation units in GCC 4.9 and GCC 5.2.
       
    77 CXXFLAGS += -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
       
    78 
       
    79 # direct binding causes various testsuite failures
       
    80 LD_B_DIRECT=
       
    81 
       
    82 # /usr/lib/ld/map.noexdata destroys Intel
       
    83 LD_MAP_NOEXDATA.i386=
       
    84 
       
    85 # /usr/lib/ld/map.noexbss  destroys SPARC
       
    86 LD_MAP_NOEXDATA.sparc=
       
    87 
       
    88 CLOOG_PREFIX = /usr
       
    89 ISLINCLUDE=$(CLOOG_PREFIX)/include
       
    90 CLOOGINCLUDE=$(CLOOG_PREFIX)/include
       
    91 ISLLIB.32 = $(CLOOG_PREFIX)/lib
       
    92 ISLLIB.64 = $(CLOOG_PREFIX)/lib/$(MACH64)
       
    93 ISLLIB=$(ISLLIB.$(BITS))
       
    94 CLOOGLIB.32 = $(CLOOG_PREFIX)/lib
       
    95 CLOOGLIB.64 = $(CLOOG_PREFIX)/lib/$(MACH64)
       
    96 CLOOGLIB = $(CLOOGLIB.$(BITS))
       
    97 
       
    98 ifeq ($(ENABLE_CLOOG), 1)
       
    99   CPPFLAGS += -I$(CLOOGINCLUDE)
       
   100 endif
       
   101 
       
   102 # We need ELF section coalescing when compiling with -fdata-sections
       
   103 # -ffunction-sections. Otherwise we end up with pathologically high
       
   104 #  number of ELF sections.
       
   105 LD_OPTIONS += -M $(GNU_SECTIONS_MAPFILE)
       
   106 LD_OPTIONS += -z relax=comdat,common,secadj,symbound,transtls
       
   107 
       
   108 # for some reason the fixincludes target fails with bash on Solaris.
       
   109 CONFIG_SHELL = /bin/sh
       
   110 MAKESHELL = /bin/sh
       
   111 
       
   112 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
       
   113 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
       
   114 COMPONENT_BUILD_ENV += LD_OPTIONS="$(LD_OPTIONS)"
       
   115 
       
   116 CONFIGURE_PREFIX = /usr/gcc/$(GCC_VERSION)
       
   117 
       
   118 CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
       
   119 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
       
   120 CONFIGURE_OPTIONS +=	--enable-languages="c,c++,fortran,objc,lto"
       
   121 CONFIGURE_OPTIONS +=	--enable-shared
       
   122 CONFIGURE_OPTIONS +=	--enable-ssp=yes
       
   123 CONFIGURE_OPTIONS +=	--enable-nls=yes
       
   124 
       
   125 # --enable-largefile=yes gets canceled or reset several times by
       
   126 #  several different ./configure's. We have to re-enable it via
       
   127 #  several different patches.
       
   128 CONFIGURE_OPTIONS +=	--enable-largefile=yes
       
   129 CONFIGURE_OPTIONS +=	--with-gmp-include=/usr/include/gmp
       
   130 CONFIGURE_OPTIONS +=	--with-mpfr-include=/usr/include/mpfr
       
   131 CONFIGURE_OPTIONS +=	--with-gnu-as --with-as=/usr/gnu/bin/as
       
   132 CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
       
   133 CONFIGURE_OPTIONS +=    --enable-multilib=yes
       
   134 CONFIGURE_OPTIONS +=    --enable-threads=posix
       
   135 CONFIGURE_OPTIONS +=    --enable-tls=yes
       
   136 CONFIGURE_OPTIONS +=    --enable-libstdcxx-threads=yes
       
   137 CONFIGURE_OPTIONS +=    --enable-libstdcxx-pch=no
       
   138 CONFIGURE_OPTIONS +=    --enable-libstdcxx-visibility=no
       
   139 
       
   140 # This needs additional linker support.
       
   141 CONFIGURE_OPTIONS +=    --enable-initfini-array=yes
       
   142 
       
   143 # VTable verification needs additional linker support.
       
   144 CONFIGURE_OPTIONS +=    --enable-vtable-verify=no
       
   145 CONFIGURE_OPTIONS +=    --enable-comdat=yes
       
   146 CONFIGURE_OPTIONS +=    --enable-__cxa_atexit=yes
       
   147 
       
   148 # Although this is required by the C++11/C++14 standards,
       
   149 # it appears broken in 4.9.3.
       
   150 CONFIGURE_OPTIONS +=    --enable-fully-dynamic-string=yes
       
   151 CONFIGURE_OPTIONS +=    --enable-libstdcxx-debug=yes
       
   152 CONFIGURE_OPTIONS +=    --enable-libstdcxx-threads=yes
       
   153 CONFIGURE_OPTIONS +=    --enable-c99=yes
       
   154 CONFIGURE_OPTIONS +=    --enable-long-long=yes
       
   155 CONFIGURE_OPTIONS +=    --enable-wchar_t=yes
       
   156 CONFIGURE_OPTIONS +=    --with-system-zlib
       
   157 
       
   158 # We'll enable ISL and CLooG as soon as CLooG integrates and is
       
   159 # available on the build machines.
       
   160 ifeq ($(ENABLE_CLOOG), 1)
       
   161   CONFIGURE_OPTIONS +=    --disable-isl-version-check
       
   162   CONFIGURE_OPTIONS +=    --disable-cloog-version-check
       
   163   CONFIGURE_OPTIONS +=    --with-isl=$(CLOOG_PREFIX)
       
   164   CONFIGURE_OPTIONS +=    --with-isl-include=$(ISLINCLUDE)
       
   165   CONFIGURE_OPTIONS +=    --with-isl-lib=$(ISLLIB)
       
   166   CONFIGURE_OPTIONS +=    --with-cloog=$(CLOOG_PREFIX)
       
   167   CONFIGURE_OPTIONS +=    --with-cloog-include=$(CLOOGINCLUDE)
       
   168   CONFIGURE_OPTIONS +=    --with-cloog-lib=$(CLOOGLIB)
       
   169 else
       
   170   CONFIGURE_OPTIONS +=    --with-isl=no
       
   171   CONFIGURE_OPTIONS +=    --with-cloog=no
       
   172 endif
       
   173 
       
   174 CONFIGURE_OPTIONS +=    --with-build-time-tools=/usr/gnu/bin
       
   175 CONFIGURE_OPTIONS +=	CFLAGS="$(CFLAGS)"
       
   176 CONFIGURE_OPTIONS +=	CXXFLAGS="$(CXXFLAGS)"
       
   177 CONFIGURE_OPTIONS +=    CPPFLAGS="$(CPPFLAGS)"
       
   178 
       
   179 CONFIGURE_ENV     += PYTHON="$(PYTHON)"
       
   180 
       
   181 COMPONENT_BUILD_TARGETS=bootstrap
       
   182 
       
   183 # compile python modules
       
   184 COMPONENT_POST_INSTALL_ACTION = \
       
   185     ( gfind $(PROTOUSRDIR) -name '*.py' | xargs -n 1 dirname | sort -u | \
       
   186         xargs $(PYTHON) -m compileall )
       
   187 
       
   188 # strip elves, strip ignores non-elf files
       
   189 COMPONENT_POST_INSTALL_ACTION += ; \
       
   190     ( gfind $(PROTOUSRDIR) -type f -perm /0111 | xargs /usr/bin/strip -x \
       
   191         2>/dev/null ; exit 0 )
       
   192 
       
   193 # ASLR has side-effects with libitm and libgomp.
       
   194 # Disable ASLR for now.
       
   195 ASLR_MODE=$(ASLR_DISABLE)
       
   196 
       
   197 configure:	$(CONFIGURE_32)
       
   198 
       
   199 build:		$(BUILD_32)
       
   200 
       
   201 install:	$(INSTALL_32)
       
   202 
       
   203 # To ensure that all tests that are expected to pass actually
       
   204 # pass, we have to increase the stacksize limit to at least
       
   205 # 16MB. Otherwise we'll get spurious failures in the test
       
   206 # harness (gcc.c-torture/compile/limits-exprparen.c and others).
       
   207 # With the soft stacksize limit set to 16384 we get reasonably good
       
   208 # test results.
       
   209 COMPONENT_PRE_TEST_ACTION = ulimit -Ss 16384
       
   210 COMPONENT_TEST_ARGS = -k -i
       
   211 COMPONENT_TEST_TARGETS = check check-target
       
   212 
       
   213 COMPONENT_TEST_ENV += TCL_LIBRARY="/usr/lib/tcl8.5"
       
   214 COMPONENT_TEST_ENV += DEJAGNULIBS="/usr/share/dejagnu"
       
   215 
       
   216 test:	$(TEST_32)
       
   217 
       
   218 system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
       
   219 
       
   220 ifeq ($(ENABLE_CLOOG), 1)
       
   221   REQUIRED_PACKAGES += library/isl
       
   222   REQUIRED_PACKAGES += developer/cloog
       
   223 endif
       
   224 
       
   225 REQUIRED_PACKAGES += library/gmp
       
   226 REQUIRED_PACKAGES += library/mpc
       
   227 REQUIRED_PACKAGES += library/mpfr
       
   228 REQUIRED_PACKAGES += library/zlib
       
   229 REQUIRED_PACKAGES += shell/bash
       
   230 REQUIRED_PACKAGES += shell/ksh93
       
   231 REQUIRED_PACKAGES += system/library
       
   232 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
       
   233 REQUIRED_PACKAGES += system/library/math
       
   234 REQUIRED_PACKAGES += system/linker
       
   235