Makefile revision 7295
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# CDDL HEADER START
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# The contents of this file are subject to the terms of the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# Common Development and Distribution License (the "License").
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# You may not use this file except in compliance with the License.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# or http://www.opensolaris.org/os/licensing.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# See the License for the specific language governing permissions
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# and limitations under the License.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# When distributing Covered Code, include this CDDL HEADER in each
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# If applicable, add the following below this CDDL HEADER, with the
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# fields enclosed by brackets "[]" replaced with your own identifying
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# information: Portions Copyright [yyyy] [name of copyright owner]
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# CDDL HEADER END
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncexport PARFAIT_BUILD=no
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncBUILD_BITS= 64
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPILER= gcc
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncinclude ../../make-rules/shared-macros.mk
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_NAME= gcc
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_VERSION= 5.4.0
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_PROJECT_URL= http://gcc.gnu.org/
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_ARCHIVE_HASH= \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync sha256:37089e80c3f2e9a0663d7ccc51c2a6c7dbbf3275bc1e4ed1ed3b1460cd5b3030
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_BUGDB= utility/gnu-compiler
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncTPNO= 29354
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# Use gcc's default flags instead of userland's.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCFLAGS=
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCPPFLAGS=
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCXXFLAGS=
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncinclude $(WS_MAKE_RULES)/common.mk
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# The GNU compiler wants the GNU utilities.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPATH=$(GNUBIN):$(USRBINDIR):$(USRDIR)/perl5/bin
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPARCH = $(MACH:i386=x86_64-pc)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncGNU_ARCH = $(PARCH:sparc=sparcv9-sun)-solaris$(SOLARIS_VERSION)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPKG_MACROS += GNU_ARCH="$(GNU_ARCH)"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncVERSION_NUMBERS = $(subst ., ,$(COMPONENT_VERSION))
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncGCC_VERSION=$(word 1,$(VERSION_NUMBERS)).$(word 2,$(VERSION_NUMBERS))
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncGCC_MAJOR_VERSION=$(word 1,$(VERSION_NUMBERS))
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPKG_MACROS += GCC_MAJOR_VERSION=$(GCC_MAJOR_VERSION)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPKG_MACROS += GCC_VERSION=$(GCC_VERSION)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncPKG_MACROS += GCC_BASEDIR=$(CONFIGURE_PREFIX)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# direct binding causes various testsuite failures
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncLD_B_DIRECT=
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# /usr/lib/ld/map.noexdata destroys Intel
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncLD_MAP_NOEXDATA.i386=
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# /usr/lib/ld/map.noexbss destroys SPARC
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncLD_MAP_NOEXBSS.sparc=
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# Mapfiles map.noexdata and map.noexbss mark the data + bss and bss
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# segments non executable on x86 and SPARC respectively. The protection
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# extends to the heap segment, if the heap is brk based, as is the case
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# with gcc. Since the introduction of NXHEAP, this is controlled
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# separately by the NXHEAP extension itself. Whether the heap should be
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# executable or not should be reevaluated. For now, try to avoid
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# "destruction" as hinted above.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncNXHEAP_MODE = $(NXHEAP_DISABLE)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# for some reason the fixincludes target fails with bash on Solaris.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIG_SHELL = /bin/sh
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncMAKESHELL = /bin/sh
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_PREFIX = /usr/gcc/$(GCC_MAJOR_VERSION)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_INFODIR = $(CONFIGURE_PREFIX)/share/info
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# We are going to build the 64-bit version of the compiler and tools, but we
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# want it to install in the normal .../{bin|lib}/... locations. GCC will
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# take care of building and putting 32/64 bit objects in the right place
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# under there.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_BINDIR.64 = $(CONFIGURE_PREFIX)/bin
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_LIBDIR.64 = $(CONFIGURE_PREFIX)/lib
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --enable-languages="c,c++,fortran,objc"
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --enable-shared
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --enable-initfini-array
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --disable-rpath
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --with-system-zlib
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --with-build-config=no
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --with-gmp-include=$(USRINCDIR)/gmp
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --with-mpfr-include=$(USRINCDIR)/mpfr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --without-gnu-ld --with-ld=$(USRBINDIR)/ld
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --with-gnu-as --with-as=$(GNUBIN)/as
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# If the compiler used to build matches the compiler being built, there is no
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# need for a 3 stage build.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncifneq ($(shell $(CC) --version | grep $(COMPONENT_VERSION)),)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += --disable-bootstrap
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncelse
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_BUILD_TARGETS=bootstrap
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncendif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += BOOT_CFLAGS='-g -O2'
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# This is the target and it must be last
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_OPTIONS += $(GNU_ARCH)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCONFIGURE_ENV += PYTHON="$(PYTHON)"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# compile python modules
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_POST_INSTALL_ACTION = \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ( gfind $(PROTO_DIR)$(CONFIGURE_PREFIX) -name '*.py' | \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xargs -n 1 dirname | sort -u | \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync xargs $(PYTHON) -m compileall )
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_BUILD_ARGS += $(JOBS:%=-j%)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_PRE_TEST_ENV += TCL_LIBRARY="$(USRLIBDIR)/tcl8.5"
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# We don't have DejaGNU in S11.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncifeq ($(OS_VERSION), 5.12)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync COMPONENT_PRE_TEST_ENV += DEJAGNULIBS="$(USRSHAREDIR)/dejagnu"
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncendif
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# Run the tests and generate a summary report, then output the summary
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# report into the results file.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# To ensure that all tests that are expected to pass actually
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# pass, we have to increase the stacksize limit to at least
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# 16MB. Otherwise we'll get spurious failures in the test
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# harness (gcc.c-torture/compile/limits-exprparen.c and others).
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# With the soft stacksize limit set to 16384 we get reasonably good
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# test results.
f78b12e570284aa8291f4ca1add24937fd107403vboxsync#
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_PRE_TEST_ACTION += \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync (cd $(COMPONENT_TEST_DIR) ; \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync ulimit -Ss 16385 ; \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync $(ENV) $(COMPONENT_PRE_TEST_ENV) \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync $(GMAKE) -k -i $(JOBS:%=-j%) check check-target ; \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync $(GMAKE) mail-report.log)
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_TEST_CMD = $(CAT)
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_TEST_TARGETS = mail-report.log
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsync# Master test results are different between x86 and SPARC.
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncCOMPONENT_TEST_MASTER = \
f78b12e570284aa8291f4ca1add24937fd107403vboxsync $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
f78b12e570284aa8291f4ca1add24937fd107403vboxsync
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += developer/test/dejagnu
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += library/gmp
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += library/isl
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += library/mpc
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += library/mpfr
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += library/zlib
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += runtime/tcl-8
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += shell/bash
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += shell/ksh93
f78b12e570284aa8291f4ca1add24937fd107403vboxsyncREQUIRED_PACKAGES += system/library/math
f78b12e570284aa8291f4ca1add24937fd107403vboxsync