components/gcc48/Makefile
changeset 7016 401dd746ea8d
parent 7015 47aaa6f8ec6e
child 7017 25872950aa80
equal deleted inserted replaced
7015:47aaa6f8ec6e 7016:401dd746ea8d
     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 
       
    22 #
       
    23 # Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 BUILD_BITS= 32
       
    26 COMPILER= gcc
       
    27 export PARFAIT_BUILD=no
       
    28 include ../../make-rules/shared-macros.mk
       
    29 
       
    30 COMPONENT_NAME=		gcc
       
    31 COMPONENT_VERSION=	4.8.2
       
    32 COMPONENT_PROJECT_URL=	http://gcc.gnu.org/
       
    33 COMPONENT_ARCHIVE_HASH= \
       
    34     sha256:2ea77114344a06c45dd5791275311e91d306545aa5ec9db31d24174f6965e880
       
    35 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
       
    36 COMPONENT_BUGDB=        utility/gnu-compiler
       
    37 
       
    38 TPNO=			15448
       
    39 
       
    40 include $(WS_MAKE_RULES)/gnu-component.mk
       
    41 
       
    42 # The GNU compiler wants the GNU utilities.
       
    43 PATH=$(GNUBIN):$(USRBINDIR):/usr/perl5/bin
       
    44 
       
    45 PARCH =         $(MACH:i386=i386-pc)
       
    46 GNU_ARCH =      $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
       
    47 
       
    48 PKG_MACROS +=   GNU_ARCH="$(GNU_ARCH)"
       
    49 
       
    50 VERSION_NUMBERS = $(subst ., ,$(COMPONENT_VERSION))
       
    51 GCC_VERSION=$(word 1,$(VERSION_NUMBERS)).$(word 2,$(VERSION_NUMBERS))
       
    52 PKG_MACROS +=	GCC_VERSION=$(GCC_VERSION)
       
    53 PKG_MACROS +=	GCC_V=$(word 1,$(VERSION_NUMBERS))$(word 2,$(VERSION_NUMBERS))
       
    54 PKG_MACROS +=	GCC_BASEDIR=usr/gcc/$(GCC_VERSION)
       
    55 
       
    56 # Make sure to pass -m32/64 any time the installed GCC is used
       
    57 CC += $(CC_BITS)
       
    58 CXX += $(CC_BITS)
       
    59 
       
    60 # Specify the C Standard to use when building
       
    61 CC += -std=gnu89
       
    62 
       
    63 CFLAGS.i386 = -mtune=opteron -march=opteron
       
    64 CFLAGS.sparc = -mtune=ultrasparc -mcpu=ultrasparc -mno-unaligned-doubles
       
    65 CFLAGS = -g -O2 
       
    66 CFLAGS += $(CFLAGS.$(MACH))
       
    67 CXXFLAGS = -g -O2
       
    68 CXXFLAGS += $(CFLAGS.$(MACH))
       
    69 
       
    70 # direct binding causes various testsuite failures
       
    71 LD_B_DIRECT=
       
    72 
       
    73 # /usr/lib/ld/map.noexdata destroys Intel
       
    74 LD_MAP_NOEXDATA.i386=
       
    75 
       
    76 # /usr/lib/ld/map.noexbss  destroys SPARC
       
    77 LD_MAP_NOEXBSS.sparc=
       
    78 
       
    79 
       
    80 # for some reason the fixincludes target fails with bash on Solaris.
       
    81 CONFIG_SHELL = /bin/sh
       
    82 MAKESHELL = /bin/sh
       
    83 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
       
    84 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
       
    85 
       
    86 CONFIGURE_PREFIX =	/usr/gcc/4.8
       
    87 CONFIGURE_INFODIR =	$(CONFIGURE_PREFIX)/share/info
       
    88 
       
    89 CONFIGURE_OPTIONS +=	--infodir=$(CONFIGURE_INFODIR)
       
    90 CONFIGURE_OPTIONS +=	--libexecdir=$(CONFIGURE_PREFIX)/lib
       
    91 CONFIGURE_OPTIONS +=	--enable-languages="c,c++,fortran,objc"
       
    92 CONFIGURE_OPTIONS +=	--enable-shared
       
    93 CONFIGURE_OPTIONS +=	--with-build-config=no
       
    94 CONFIGURE_OPTIONS +=	--with-gmp-include=$(USRINCDIR)/gmp
       
    95 CONFIGURE_OPTIONS +=	--with-mpfr-include=$(USRINCDIR)/mpfr
       
    96 CONFIGURE_OPTIONS +=	--without-gnu-ld --with-ld=$(LD)
       
    97 CONFIGURE_OPTIONS +=   --with-isl=no
       
    98 CONFIGURE_OPTIONS +=   --with-cloog=no
       
    99 
       
   100 CONFIGURE_ENV     += PYTHON="$(PYTHON)"
       
   101 
       
   102 # sparc and x86 use different assemblers
       
   103 CONFIGURE_OPTIONS.sparc +=	--without-gnu-as --with-as=$(USRBINDIR)/as
       
   104 CONFIGURE_OPTIONS.i386 +=	--with-gnu-as --with-as=$(GNUBIN)/as
       
   105 
       
   106 COMPONENT_BUILD_TARGETS=bootstrap
       
   107 
       
   108 # compile python modules
       
   109 COMPONENT_POST_INSTALL_ACTION = \
       
   110     ( gfind $(PROTOUSRDIR) -name '*.py' | xargs -n 1 dirname | sort -u | \
       
   111         xargs $(PYTHON) -m compileall )
       
   112 # strip elves, strip ignores non-elf files
       
   113 COMPONENT_POST_INSTALL_ACTION += ; \
       
   114     ( gfind $(PROTOUSRDIR) -type f -perm /0111 | xargs /usr/bin/strip -x \
       
   115         2>/dev/null ; exit 0 )
       
   116 
       
   117 # ASLR has side-effects with libitm and libgomp.
       
   118 # Disable ASLR for now.
       
   119 ASLR_MODE=$(ASLR_DISABLE)
       
   120 
       
   121 # To ensure that all tests that are expected to pass actually
       
   122 # pass, we have to increase the stacksize limit to at least
       
   123 # 16MB. Otherwise we'll get spurious failures in the test
       
   124 # harness (gcc.c-torture/compile/limits-exprparen.c and others).
       
   125 # With the soft stacksize limit set to 16384 we get reasonably good
       
   126 # test results.
       
   127 COMPONENT_PRE_TEST_ACTION = ulimit -Ss 16384
       
   128 COMPONENT_TEST_ARGS = -k -i
       
   129 COMPONENT_TEST_TARGETS = check check-target
       
   130 
       
   131 COMPONENT_TEST_TRANSFORMS += \
       
   132 	'-e "s|\(Test Run By\).*|\1|" ' \
       
   133 	'-e "/\(Missing header fix: \).*/d" ' \
       
   134 	'-e "/\(\\*\\*\\* complex.h\).*/d" ' \
       
   135 	'-e "/\(\\*\\*\\* math.h\).*/d" ' \
       
   136 	'-e "/\(\\*\\*\\* stdio.h\).*/d" '
       
   137 
       
   138 # Master test results are different between x86 and SPARC.
       
   139 COMPONENT_TEST_MASTER = \
       
   140 	$(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH)-$(BITS).master
       
   141 
       
   142 
       
   143 REQUIRED_PACKAGES += library/gmp
       
   144 REQUIRED_PACKAGES += library/mpc
       
   145 REQUIRED_PACKAGES += library/mpfr
       
   146 REQUIRED_PACKAGES += shell/bash
       
   147 REQUIRED_PACKAGES += shell/ksh93
       
   148 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
       
   149 REQUIRED_PACKAGES += system/library/math