Permalink
Browse files

[OS-826] illumos-extra should deliver gcc4

  • Loading branch information...
1 parent a95ad96 commit 9582bd958689007da31e1aa072cd1e36b44ca18c @JohnSonnenschein JohnSonnenschein committed with Super-User Jan 2, 2012
Showing with 119 additions and 1 deletion.
  1. +1 −1 Makefile
  2. +95 −0 gcc4/Makefile
  3. BIN gcc4/gcc-4.4.4.tar.bz2
  4. +23 −0 gcc4/git_source
View
@@ -26,7 +26,7 @@
PATH=/sbin:/usr/sbin:/usr/bin:/opt/SUNWspro/bin:/opt/local/bin
BASE=$(PWD)
DESTDIR=$(BASE)/proto
-SUBDIRS= bash bzip2 curl gcc gnupg gtar gzip less libexpat libidn libm libxml \
+SUBDIRS= bash bzip2 curl gcc gcc4 gnupg gtar gzip less libexpat libidn libm libxml \
libz ncurses node.js nss-nspr ntp openldap openssl perl rsync screen socat uuid vim wget
NAME=illumos-extra
View
@@ -0,0 +1,95 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+#
+# Copyright 2011 Joyent Inc.
+#
+
+VER=gcc-4.4.4
+
+SFW_PATH="/opt/local/bin:/usr/sfw/bin:/usr/bin:/usr/ccs/bin:/opt/local/bin"
+
+BASE=$(PWD)
+DESTDIR=$(BASE)/../proto
+
+all: $(VER)-i386-build/config.status
+ (cd $(VER)-i386-build; env - \
+ CC=gcc \
+ CFLAGS="-g -O2" \
+ DESTDIR=$(DESTDIR) \
+ STAGE1_CFLAGS="-g -O2" \
+ CFLAGS_FOR_TARGET="-g -O2" \
+ PATH=$(SFW_PATH) \
+ MAKE=gmake gmake \
+ CFLAGS="-g -O2" \
+ STAGE1_CFLAGS="-g -O2" \
+ CFLAGS_FOR_TARGET="-g -O2" -j128 bootstrap)
+
+install: all
+ (cd $(VER)-i386-build; env - \
+ CC=gcc \
+ CFLAGS="-g -O2" \
+ STAGE1_CFLAGS="-g -O2" \
+ CFLAGS_FOR_TARGET="-g -O2" \
+ DESTDIR=$(DESTDIR) \
+ PATH=$(SFW_PATH) \
+ MAKE=gmake gmake \
+ CFLAGS="-g -O2" \
+ STAGE1_CFLAGS="-g -O2" \
+ CFLAGS_FOR_TARGET="-g -O2" -j128 install)
+
+$(VER)-i386-build/config.status: $(VER)-i386-build $(VER)/configure
+ (cd $(VER)-i386-build; env - \
+ CC=gcc \
+ CFLAGS="-g -O2" \
+ DESTDIR=$(DESTDIR) \
+ PATH=$(SFW_PATH) \
+ MAKE=gmake \
+ ../$(VER)/configure \
+ --prefix=/usr/gcc4 \
+ --with-as=/usr/sfw/bin/gas \
+ --with-gnu-as \
+ --with-ld=/usr/ccs/bin/ld \
+ --without-gnu-ld \
+ --enable-languages="c,c++,fortran" \
+ --enable-shared \
+ --with-gmp=/opt/local \
+ --with-mpfr=/opt/local \
+ --disable-nls \
+ --with-included-gettext)
+
+$(VER)/configure: $(VER).tar.bz2
+ /usr/bin/bzcat $(VER).tar.bz2 | gtar xpf - --no-same-owner
+ touch $(VER)/configure
+
+$(VER)-i386-build:
+ mkdir -p $@
+
+clean:
+ -rm -rf $(VER)-i386-build
+
+
+FRC:
View
Binary file not shown.
View
@@ -0,0 +1,23 @@
+git://github.com/joyent/gcc
+branch il-4_4_4
+
+HEAD:
+commit 43d517ea3eb78c23ace5f3e6e579fb29d28f71ba
+Author: Richard Lowe <richlowe@richlowe.net>
+Date: Wed Dec 14 02:32:14 2011 +0000
+
+ config: Do not force runpath entries unless necessary
+
+ Sun patched their GCC3 to force /lib:/usr/lib:/usr/sfw/lib into the runpath, in
+ that order, such that /usr/sfw libraries did not take precedence over system
+ libraries, but nevertheless libgcc did not need a specific -R entry to be added
+ to the command line when building.
+
+ This has caused us nothing but trouble when patching it forward, since suddenly
+ we need our _own_ prefix in thre too, and it must beat /usr/sfw, and because
+ it's using -R it means that LD_RUN_PATH doesn't function, and because it's
+ unexpected it causes confusion for 3rd party software.
+
+ This change only uses -R to force the runpath in the BSD compat environment, as
+ GCC upstream does, leaving the sole artifact of Sun's change being the addition
+ of /lib to the default library search path. (-YP)

0 comments on commit 9582bd9

Please sign in to comment.