|
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, Oracle and/or its affiliates. All rights reserved. |
|
22 # |
|
23 export PARFAIT_BUILD=no |
|
24 |
|
25 include ../../make-rules/shared-macros.mk |
|
26 |
|
27 COMPONENT_NAME= gcc |
|
28 COMPONENT_VERSION= 4.8.2 |
|
29 COMPONENT_PROJECT_URL= http://gcc.gnu.org/ |
|
30 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
|
31 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz |
|
32 COMPONENT_ARCHIVE_HASH= \ |
|
33 sha256:2ea77114344a06c45dd5791275311e91d306545aa5ec9db31d24174f6965e880 |
|
34 COMPONENT_ARCHIVE_URL= http://ftp.gnu.org/gnu/gcc/$(COMPONENT_SRC)/$(COMPONENT_ARCHIVE) |
|
35 COMPONENT_BUGDB= utility/gnu-compiler |
|
36 |
|
37 include ../../make-rules/prep.mk |
|
38 include ../../make-rules/configure.mk |
|
39 include ../../make-rules/ips.mk |
|
40 |
|
41 COMPILER=gcc |
|
42 |
|
43 # The GNU compiler wants the GNU utilities. |
|
44 PATH=/usr/gnu/bin:/usr/bin:/usr/perl5/bin |
|
45 |
|
46 PARCH = $(MACH:i386=i386-pc) |
|
47 GNU_ARCH = $(PARCH:sparc=sparc-sun)-solaris$(SOLARIS_VERSION) |
|
48 |
|
49 PKG_MACROS += GNU_ARCH="$(GNU_ARCH)" |
|
50 |
|
51 VERSION_NUMBERS = $(subst ., ,$(COMPONENT_VERSION)) |
|
52 GCC_VERSION=$(word 1,$(VERSION_NUMBERS)).$(word 2,$(VERSION_NUMBERS)) |
|
53 PKG_MACROS += GCC_VERSION=$(GCC_VERSION) |
|
54 PKG_MACROS += GCC_V=$(word 1,$(VERSION_NUMBERS))$(word 2,$(VERSION_NUMBERS)) |
|
55 PKG_MACROS += GCC_BASEDIR=usr/gcc/$(GCC_VERSION) |
|
56 |
|
57 CFLAGS.i386 = -mtune=opteron -march=opteron |
|
58 CFLAGS.sparc = -mtune=ultrasparc -mcpu=ultrasparc -mno-unaligned-doubles |
|
59 CFLAGS = -g -O2 |
|
60 CFLAGS += $(CFLAGS.$(MACH)) |
|
61 CXXFLAGS = -g -O2 |
|
62 CXXFLAGS += $(CFLAGS.$(MACH)) |
|
63 |
|
64 # direct binding cause various testsuite failures |
|
65 LD_B_DIRECT= |
|
66 |
|
67 # /usr/lib/ld/map.noexdata destroys Intel |
|
68 LD_MAP_NOEXDATA.i386= |
|
69 |
|
70 # /usr/lib/ld/map.noexbss destroys SPARC |
|
71 ifeq ($(MACH),sparc) |
|
72 LD_MAP_NOEXBSS= |
|
73 endif |
|
74 |
|
75 |
|
76 # for some reason the fixincludes target fails with bash on Solaris. |
|
77 CONFIG_SHELL = /bin/sh |
|
78 MAKESHELL = /bin/sh |
|
79 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL) |
|
80 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL) |
|
81 |
|
82 CONFIGURE_PREFIX = /usr/gcc/4.8 |
|
83 |
|
84 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_PREFIX)/share/info |
|
85 CONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib |
|
86 CONFIGURE_OPTIONS += --enable-languages="c,c++,fortran,objc" |
|
87 CONFIGURE_OPTIONS += --enable-shared |
|
88 CONFIGURE_OPTIONS += --with-gmp-include=/usr/include/gmp |
|
89 CONFIGURE_OPTIONS += --with-mpfr-include=/usr/include/mpfr |
|
90 CONFIGURE_OPTIONS += --without-gnu-ld --with-ld=/usr/bin/ld |
|
91 |
|
92 CONFIGURE_ENV += PYTHON="$(PYTHON)" |
|
93 |
|
94 # sparc and x86 use different assemblers |
|
95 CONFIGURE_OPTIONS.sparc += --without-gnu-as --with-as=/usr/bin/as |
|
96 CONFIGURE_OPTIONS.i386 += --with-gnu-as --with-as=/usr/gnu/bin/as |
|
97 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH)) |
|
98 |
|
99 CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" |
|
100 CONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)" |
|
101 |
|
102 COMPONENT_BUILD_TARGETS=bootstrap |
|
103 |
|
104 # compile python modules |
|
105 COMPONENT_POST_INSTALL_ACTION = \ |
|
106 ( gfind $(PROTOUSRDIR) -name '*.py' | xargs -n 1 dirname | sort -u | \ |
|
107 xargs $(PYTHON) -m compileall ) |
|
108 # strip elves, strip ignores non-elf files |
|
109 COMPONENT_POST_INSTALL_ACTION += ; \ |
|
110 ( gfind $(PROTOUSRDIR) -type f -perm /0111 | xargs /usr/bin/strip -x \ |
|
111 2>/dev/null ; exit 0 ) |
|
112 |
|
113 # ASLR has side-effects with libitm and libgomp. |
|
114 # Disable ASLR for now. |
|
115 ASLR_MODE=$(ASLR_DISABLE) |
|
116 |
|
117 build: $(BUILD_32) |
|
118 |
|
119 install: $(INSTALL_32) |
|
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 test: $(TEST_32) |
|
132 |
|
133 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) |
|
134 |
|
135 include ../../make-rules/depend.mk |
|
136 |