45 PKG_MACROS += GNU_ARCH="$(GNU_ARCH)" |
45 PKG_MACROS += GNU_ARCH="$(GNU_ARCH)" |
46 |
46 |
47 # This product bootstraps itself. The gcc flags are not the same |
47 # This product bootstraps itself. The gcc flags are not the same |
48 # as Studio flags. -O2 means different things for the two compilers |
48 # as Studio flags. -O2 means different things for the two compilers |
49 CFLAGS=-g -O2 |
49 CFLAGS=-g -O2 |
50 CFLAGS_FOR_BUILD=$(CFLAGS) |
50 CXXFLAGS=-g -O2 |
51 |
51 |
52 # CC_BITS may get in the way |
52 # direct binding cause various testsuite failures |
53 CC_BITS= |
53 LD_B_DIRECT= |
54 |
54 |
55 # LD_OPTIONS |
55 # /usr/lib/ld/map.noexdata destroys Intel |
|
56 LD_MAP_NOEXDATA.i386= |
|
57 |
56 # /usr/lib/ld/map.noexbss destroys SPARC |
58 # /usr/lib/ld/map.noexbss destroys SPARC |
57 # /usr/lib/ld/map.noexdata destroys Intel |
59 ifeq ($(MACH),sparc) |
58 GCC_LD_OPTIONS.sparc=-M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.pagealign -z ignore |
60 LD_MAP_NOEXBSS= |
59 GCC_LD_OPTIONS.i386=-M /usr/lib/ld/map.noexstk -M /usr/lib/ld/map.pagealign -z ignore |
61 endif |
60 GCC_LD_OPTIONS = $(GCC_LD_OPTIONS.$(MACH)) |
|
61 LD_OPTIONS := $(GCC_LD_OPTIONS) |
|
62 |
62 |
|
63 # for some reason the fixincludes target fails with bash on Solaris. |
63 CONFIG_SHELL = /bin/sh |
64 CONFIG_SHELL = /bin/sh |
64 MAKESHELL = /bin/sh |
65 MAKESHELL = /bin/sh |
|
66 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL) |
|
67 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL) |
65 |
68 |
66 CONFIGURE_PREFIX = /usr/gcc/4.7 |
69 CONFIGURE_PREFIX = /usr/gcc/4.7 |
67 |
70 |
68 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_PREFIX)/share/info |
71 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_PREFIX)/share/info |
69 CONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib |
72 CONFIGURE_OPTIONS += --libexecdir=$(CONFIGURE_PREFIX)/lib |
72 CONFIGURE_OPTIONS += --with-gmp-include=/usr/include/gmp |
75 CONFIGURE_OPTIONS += --with-gmp-include=/usr/include/gmp |
73 CONFIGURE_OPTIONS += --with-mpfr-include=/usr/include/mpfr |
76 CONFIGURE_OPTIONS += --with-mpfr-include=/usr/include/mpfr |
74 CONFIGURE_OPTIONS += --without-gnu-ld --with-ld=/usr/bin/ld |
77 CONFIGURE_OPTIONS += --without-gnu-ld --with-ld=/usr/bin/ld |
75 |
78 |
76 CONFIGURE_ENV += PYTHON="$(PYTHON)" |
79 CONFIGURE_ENV += PYTHON="$(PYTHON)" |
77 CONFIGURE_ENV += LD_OPTIONS="$(LD_OPTIONS)" |
|
78 |
80 |
79 # sparc and x86 use different assemblers |
81 # sparc and x86 use different assemblers |
80 CONFIGURE_OPTIONS.sparc += --without-gnu-as --with-as=/usr/bin/as |
82 CONFIGURE_OPTIONS.sparc += --without-gnu-as --with-as=/usr/bin/as |
81 CONFIGURE_OPTIONS.i386 += --with-gnu-as --with-as=/usr/gnu/bin/as |
83 CONFIGURE_OPTIONS.i386 += --with-gnu-as --with-as=/usr/gnu/bin/as |
82 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH)) |
84 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH)) |
83 |
85 |
84 CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" |
86 CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)" |
85 |
87 CONFIGURE_OPTIONS += CXXFLAGS="$(CXXFLAGS)" |
86 COMPONENT_BUILD_ENV += SHELL=$(CONFIG_SHELL) |
|
87 COMPONENT_BUILD_ENV += MAKESHELL=$(MAKESHELL) |
|
88 |
88 |
89 COMPONENT_BUILD_TARGETS=bootstrap |
89 COMPONENT_BUILD_TARGETS=bootstrap |
90 |
90 |
|
91 # compile python modules |
91 COMPONENT_POST_INSTALL_ACTION = \ |
92 COMPONENT_POST_INSTALL_ACTION = \ |
92 ( cd $(PROTOUSRDIR)/gcc/4.7/lib ; \ |
93 ( gfind $(PROTOUSRDIR) -name '*.py' | xargs -n 1 dirname | sort -u | \ |
93 $(PYTHON) -m compileall . ; \ |
94 xargs $(PYTHON) -m compileall ) |
94 cd $(PROTOUSRDIR)/gcc/4.7/lib/$(MACH64) ; \ |
95 # strip elves, strip ignores non-elf files |
95 $(PYTHON) -m compileall . ; \ |
96 COMPONENT_POST_INSTALL_ACTION += ; \ |
96 cd $(PROTOUSRDIR)/gcc/4.7/share/gcc-4.7.3/python/libstdcxx ; \ |
97 ( gfind $(PROTOUSRDIR) -type f -perm /0111 | xargs /usr/bin/strip -x \ |
97 $(PYTHON) -m compileall . ; \ |
98 2>/dev/null ; exit 0 ) |
98 cd $(PROTOUSRDIR)/gcc/4.7/share/gcc-4.7.3/python/libstdcxx/v6 ; \ |
|
99 $(PYTHON) -m compileall . ; \ |
|
100 cd $(COMPONENT_DIR) ; \ |
|
101 chmod 0755 ./gcc_post_install_processing.sh ; \ |
|
102 $(SHELL) ./gcc_post_install_processing.sh -protodir=$(PROTO_DIR) \ |
|
103 -python=$(PYTHON) -gccversion=$(COMPONENT_VERSION) ) |
|
104 |
99 |
105 # ASLR has side-effects with libitm and libgomp. |
100 # ASLR has side-effects with libitm and libgomp. |
106 # Disable ASLR for now. |
101 # Disable ASLR for now. |
107 ASLR_MODE=$(ASLR_DISABLE) |
102 ASLR_MODE=$(ASLR_DISABLE) |
108 |
103 |
109 build: $(BUILD_32) |
104 build: $(BUILD_32) |
110 |
105 |
111 install: $(INSTALL_32) |
106 install: $(INSTALL_32) |
112 |
107 |
113 # To ensure that all tests that are expected to pass actually |
108 # To ensure that all tests that are expected to pass actually |
114 # pass, we have to increase the stacksize limit to at least |
109 # pass, we have to increase the stacksize limit to at least |
115 # 16384 Kb. Otherwise we'll get spurious failures in the test |
110 # 16MB. Otherwise we'll get spurious failures in the test |
116 # harness (gcc.c-torture/compile/limits-exprparen.c and others). |
111 # harness (gcc.c-torture/compile/limits-exprparen.c and others). |
117 # With the soft stacksize limit set to 16384 we get very good |
112 # With the soft stacksize limit set to 16384 we get reasonably good |
118 # test results. |
113 # test results. |
119 test: |
114 COMPONENT_PRE_TEST_ACTION = ulimit -Ss 16384 |
120 ( cd $(BUILD_DIR_32)/gcc ; \ |
115 COMPONENT_TEST_ARGS = -k -i |
121 ulimit -Ss 16384 ; \ |
116 COMPONENT_TEST_TARGETS = check check-target |
122 env - LD_OPTIONS=$(LD_OPTIONS) $(GMAKE) -k -i check ; \ |
117 |
123 cd $(BUILD_DIR_32) ; \ |
118 test: $(TEST_32) |
124 env - LD_OPTIONS=$(LD_OPTIONS) $(GMAKE) -k -i check-target ) |
|
125 |
119 |
126 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) |
120 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) |
127 |
121 |
128 include ../../make-rules/depend.mk |
122 include ../../make-rules/depend.mk |
129 |
123 |