components/gcc53/Makefile
changeset 5342 e55d87e99ecd
child 5419 0a6df3707968
equal deleted inserted replaced
5341:acafdc8d7dfc 5342:e55d87e99ecd
       
     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, 2016, 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=	5.3.0
       
    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:b7f5f56bd7db6f4fcaa95511dbf69fc596115b976b5352c06531c2fc95ece2f4
       
    36 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
       
    37 COMPONENT_BUGDB=        utility/gnu-compiler
       
    38 
       
    39 TPNO=			26089
       
    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 # since we are patching inclhack.def, we want to regenerate fixincl.x
       
    49 COMPONENT_PREP_ACTION = (cd $(@D)/fixincludes ; ./genfixes)
       
    50 
       
    51 PARCH =         $(MACH64:amd64=x86_64-pc)
       
    52 GNU_ARCH =      $(PARCH:sparc=sparcv9-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 # direct binding causes various testsuite failures
       
    63 LD_B_DIRECT=
       
    64 
       
    65 # /usr/lib/ld/map.noexdata destroys Intel
       
    66 LD_MAP_NOEXDATA.i386=
       
    67 
       
    68 # /usr/lib/ld/map.noexbss  destroys SPARC
       
    69 ifeq ($(MACH),sparc)
       
    70 LD_MAP_NOEXBSS=
       
    71 endif
       
    72 
       
    73 
       
    74 # for some reason the fixincludes target fails with bash on Solaris.
       
    75 CONFIG_SHELL = /bin/sh
       
    76 MAKESHELL = /bin/sh
       
    77 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
       
    78 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
       
    79 
       
    80 CONFIGURE_PREFIX = /usr/gcc/5.3
       
    81 
       
    82 # We are going to build the 64-bit version of the compiler and tools, but we
       
    83 # want it to install in the normal .../{bin|lib}/... locations.  GCC will
       
    84 # take care of building and putting 32/64 bit objects in the right place
       
    85 # under there.
       
    86 CONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
       
    87 CONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib
       
    88 
       
    89 CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_PREFIX)/share/info
       
    90 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
       
    91 CONFIGURE_OPTIONS +=	--enable-languages="c,c++,fortran,objc"
       
    92 CONFIGURE_OPTIONS +=	--enable-shared
       
    93 CONFIGURE_OPTIONS +=	--enable-initfini-array
       
    94 CONFIGURE_OPTIONS +=	--disable-rpath
       
    95 CONFIGURE_OPTIONS +=	--with-system-zlib
       
    96 CONFIGURE_OPTIONS +=	--with-build-config=no
       
    97 CONFIGURE_OPTIONS +=	--with-gmp-include=/usr/include/gmp
       
    98 CONFIGURE_OPTIONS +=	--with-mpfr-include=/usr/include/mpfr
       
    99 CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=/usr/bin/ld
       
   100 CONFIGURE_OPTIONS +=	--with-gnu-as --with-as=/usr/gnu/bin/as
       
   101 
       
   102 # If the compiler used to build matches the compiler being built, there is no
       
   103 # need for a 3 stage build.
       
   104 ifneq ($(shell $(CC) --version | grep $(COMPONENT_VERSION)),)
       
   105 CONFIGURE_OPTIONS +=    --disable-bootstrap
       
   106 else
       
   107 COMPONENT_BUILD_TARGETS=bootstrap
       
   108 endif
       
   109 
       
   110 CONFIGURE_OPTIONS +=	BOOT_CFLAGS='-g -O2'
       
   111 
       
   112 # This is the target and it must be last
       
   113 CONFIGURE_OPTIONS +=    $(GNU_ARCH)
       
   114 
       
   115 
       
   116 CONFIGURE_ENV     += PYTHON="$(PYTHON)"
       
   117 
       
   118 CONFIGURE_ENV +=	CXX_FOR_BUILD="$(CXX) $(CC_BITS)"
       
   119 
       
   120 # compile python modules
       
   121 COMPONENT_POST_INSTALL_ACTION = \
       
   122 	( gfind $(PROTO_DIR)$(CONFIGURE_PREFIX) -name '*.py' | \
       
   123 	  xargs -n 1 dirname | sort -u | \
       
   124 	  xargs $(PYTHON) -m compileall )
       
   125 
       
   126 ASLR_MODE=$(ASLR_ENABLE)
       
   127 
       
   128 configure:	$(CONFIGURE_64)
       
   129 
       
   130 build:		$(BUILD_64)
       
   131 
       
   132 install:	$(INSTALL_64)
       
   133 
       
   134 # To ensure that all tests that are expected to pass actually
       
   135 # pass, we have to increase the stacksize limit to at least
       
   136 # 16MB. Otherwise we'll get spurious failures in the test
       
   137 # harness (gcc.c-torture/compile/limits-exprparen.c and others).
       
   138 # With the soft stacksize limit set to 16384 we get reasonably good
       
   139 # test results.
       
   140 COMPONENT_PRE_TEST_ACTION = ulimit -Ss 16384
       
   141 COMPONENT_TEST_ARGS = -k -i
       
   142 COMPONENT_TEST_TARGETS = check check-target
       
   143 
       
   144 COMPONENT_TEST_ENV += TCL_LIBRARY="/usr/lib/tcl8.5"
       
   145 
       
   146 # We don't have DejaGNU in S11.
       
   147 ifeq ($(OS_VERSION), 5.12)
       
   148   COMPONENT_TEST_ENV += DEJAGNULIBS="/usr/share/dejagnu"
       
   149 endif
       
   150 
       
   151 COMPONENT_TEST_TRANSFORMS += \
       
   152 	'-e "s|\(Test Run By\).*|\1|" ' \
       
   153 	'-e "/\(Missing header fix: \).*/d" ' \
       
   154 	'-e "/\(\\*\\*\\* complex.h\).*/d" ' \
       
   155 	'-e "/\(\\*\\*\\* math.h\).*/d" ' \
       
   156 	'-e "/\(\\*\\*\\* stdio.h\).*/d" '
       
   157 
       
   158 # Master test results are different between x86 and SPARC.
       
   159 COMPONENT_TEST_MASTER = \
       
   160 	$(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH)-$(BITS).master
       
   161 
       
   162 test:	$(TEST_64)
       
   163 
       
   164 system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
       
   165 
       
   166 
       
   167 REQUIRED_PACKAGES += developer/test/dejagnu
       
   168 REQUIRED_PACKAGES += library/gmp
       
   169 REQUIRED_PACKAGES += library/isl
       
   170 REQUIRED_PACKAGES += library/mpc
       
   171 REQUIRED_PACKAGES += library/mpfr
       
   172 REQUIRED_PACKAGES += library/zlib
       
   173 REQUIRED_PACKAGES += runtime/tcl-8
       
   174 REQUIRED_PACKAGES += shell/bash
       
   175 REQUIRED_PACKAGES += shell/ksh93
       
   176 REQUIRED_PACKAGES += system/library
       
   177 REQUIRED_PACKAGES += system/library/math