1918N/A#
1918N/A# CDDL HEADER START
1918N/A#
1918N/A# The contents of this file are subject to the terms of the
1918N/A# Common Development and Distribution License (the "License").
1918N/A# You may not use this file except in compliance with the License.
1918N/A#
1918N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1918N/A# or http://www.opensolaris.org/os/licensing.
1918N/A# See the License for the specific language governing permissions
1918N/A# and limitations under the License.
1918N/A#
1918N/A# When distributing Covered Code, include this CDDL HEADER in each
1918N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1918N/A# If applicable, add the following below this CDDL HEADER, with the
1918N/A# fields enclosed by brackets "[]" replaced with your own identifying
1918N/A# information: Portions Copyright [yyyy] [name of copyright owner]
1918N/A#
1918N/A# CDDL HEADER END
1918N/A#
3996N/A# Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
1918N/A#
1918N/Ainclude ../../make-rules/shared-macros.mk
1918N/A
1918N/ACOMPONENT_NAME= gcc
1918N/ACOMPONENT_VERSION= 4.7.3
1918N/ACOMPONENT_PROJECT_URL= http://gcc.gnu.org/
1918N/ACOMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
1918N/ACOMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
1918N/ACOMPONENT_ARCHIVE_HASH= \
1918N/A sha256:34a273937eb63ee710784b65bcf9fb3cfcd79d02848f80c75f8254abd14c79c8
1918N/ACOMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE)
1918N/ACOMPONENT_BUGDB= utility/gnu-compiler
1918N/A
3661N/ATPNO= 14467
3661N/A
3996N/Ainclude $(WS_MAKE_RULES)/prep.mk
3996N/Ainclude $(WS_MAKE_RULES)/configure.mk
3996N/Ainclude $(WS_MAKE_RULES)/ips.mk
1918N/A
1918N/A# The GNU compiler wants the GNU utilities.
1918N/APATH=/usr/gnu/bin:/usr/bin:/usr/perl5/bin
1918N/A
1918N/APARCH = $(MACH:i386=i386-pc)
1918N/AGNU_ARCH = $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION)
1918N/A
1918N/APKG_MACROS += GNU_ARCH="$(GNU_ARCH)"
1918N/A
2551N/AVERSION_NUMBERS = $(subst ., ,$(COMPONENT_VERSION))
2551N/AGCC_VERSION=$(word 1,$(VERSION_NUMBERS)).$(word 2,$(VERSION_NUMBERS))
2551N/APKG_MACROS += GCC_VERSION=$(GCC_VERSION)
2551N/APKG_MACROS += GCC_V=$(word 1,$(VERSION_NUMBERS))$(word 2,$(VERSION_NUMBERS))
2551N/APKG_MACROS += GCC_BASEDIR=usr/gcc/$(GCC_VERSION)
2551N/A
2551N/A
1918N/A# This product bootstraps itself. The gcc flags are not the same
1918N/A# as Studio flags. -O2 means different things for the two compilers
1918N/ACFLAGS=-g -O2
2549N/ACXXFLAGS=-g -O2
1918N/A
2549N/A# direct binding cause various testsuite failures
2549N/ALD_B_DIRECT=
1918N/A
2549N/A# /usr/lib/ld/map.noexdata destroys Intel
2549N/ALD_MAP_NOEXDATA.i386=
2549N/A
1918N/A# /usr/lib/ld/map.noexbss destroys SPARC
2549N/Aifeq ($(MACH),sparc)
2549N/ALD_MAP_NOEXBSS=
2549N/Aendif
1918N/A
2549N/A# for some reason the fixincludes target fails with bash on Solaris.
1918N/ACONFIG_SHELL = /bin/sh
1918N/AMAKESHELL = /bin/sh
2549N/ACOMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL)
2549N/ACOMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL)
1918N/A
1918N/ACONFIGURE_PREFIX = /usr/gcc/4.7
1918N/A
1918N/ACONFIGURE_OPTIONS += --infodir=$(CONFIGURE_PREFIX)/share/info
1918N/ACONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib
1918N/ACONFIGURE_OPTIONS += --enable-languages="c,c++,fortran,objc"
1918N/ACONFIGURE_OPTIONS += --enable-shared
1918N/ACONFIGURE_OPTIONS += --with-gmp-include=/usr/include/gmp
1918N/ACONFIGURE_OPTIONS += --with-mpfr-include=/usr/include/mpfr
1918N/ACONFIGURE_OPTIONS += --without-gnu-ld --with-ld=/usr/bin/ld
1918N/A
1918N/ACONFIGURE_ENV += PYTHON="$(PYTHON)"
1918N/A
1918N/A# sparc and x86 use different assemblers
1918N/ACONFIGURE_OPTIONS.sparc += --without-gnu-as --with-as=/usr/bin/as
1918N/ACONFIGURE_OPTIONS.i386 += --with-gnu-as --with-as=/usr/gnu/bin/as
1918N/ACONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
1918N/A
1918N/ACONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
2549N/ACONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)"
1918N/A
1918N/ACOMPONENT_BUILD_TARGETS=bootstrap
1918N/A
2549N/A# compile python modules
1918N/ACOMPONENT_POST_INSTALL_ACTION = \
2549N/A ( gfind $(PROTOUSRDIR) -name '*.py' | xargs -n 1 dirname | sort -u | \
2549N/A xargs $(PYTHON) -m compileall )
2549N/A# strip elves, strip ignores non-elf files
2549N/ACOMPONENT_POST_INSTALL_ACTION += ; \
2549N/A ( gfind $(PROTOUSRDIR) -type f -perm /0111 | xargs /usr/bin/strip -x \
2549N/A 2>/dev/null ; exit 0 )
1918N/A
1918N/A# ASLR has side-effects with libitm and libgomp.
1918N/A# Disable ASLR for now.
1918N/AASLR_MODE=$(ASLR_DISABLE)
1918N/A
1918N/Abuild: $(BUILD_32)
1918N/A
1918N/Ainstall: $(INSTALL_32)
1918N/A
1918N/A# To ensure that all tests that are expected to pass actually
2549N/A# pass, we have to increase the stacksize limit to at least
2549N/A# 16MB. Otherwise we'll get spurious failures in the test
1918N/A# harness (gcc.c-torture/compile/limits-exprparen.c and others).
2549N/A# With the soft stacksize limit set to 16384 we get reasonably good
1918N/A# test results.
2549N/ACOMPONENT_PRE_TEST_ACTION = ulimit -Ss 16384
2549N/ACOMPONENT_TEST_ARGS = -k -i
2549N/ACOMPONENT_TEST_TARGETS = check check-target
2549N/A
2549N/Atest: $(TEST_32)
1918N/A
3996N/A
1918N/A
3996N/AREQUIRED_PACKAGES += library/gmp
3996N/AREQUIRED_PACKAGES += library/mpc
3996N/AREQUIRED_PACKAGES += library/mpfr
3996N/AREQUIRED_PACKAGES += system/library
3996N/AREQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime
3996N/AREQUIRED_PACKAGES += system/library/math
3996N/AREQUIRED_PACKAGES += system/linker