Skip to content

Commit

Permalink
Add gcc14 14.2.0-il-1
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Oct 20, 2024
1 parent 8c7c102 commit cd9b17e
Show file tree
Hide file tree
Showing 44 changed files with 5,833 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/gcc-runtime/build-runtime++.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

PKG=system/library/g++-runtime
PROG=libstdc++
VER=12
VER=14
SUMMARY="GNU C++ compiler runtime dependencies"
DESC="$SUMMARY"

Expand Down
2 changes: 1 addition & 1 deletion build/gcc-runtime/build-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

PKG=system/library/gcc-runtime
PROG=libgcc_s
VER=12
VER=14
SUMMARY="GNU compiler runtime dependencies"
DESC="$SUMMARY"

Expand Down
209 changes: 209 additions & 0 deletions build/gcc14/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
#!/usr/bin/bash
#
# {{{ CDDL HEADER
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
# }}}
#
# Copyright 2014 OmniTI Computer Consulting, Inc. All rights reserved.
# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

. ../../lib/build.sh

PKG=developer/gcc14
PROG=gcc
VER=14.2.0
ILVER=il-1
SUMMARY="gcc $VER-$ILVER"
DESC="The GNU Compiler Collection"

GCCMAJOR=${VER%%.*}
OPT=/opt/gcc-$GCCMAJOR

BMI_EXPECTED=1

PREFIX=$OPT

# Build gcc with itself
set_gccver $GCCMAJOR

set_arch 64
set_ssp none
ARCH=${TRIPLETS[amd64]}

XFORM_ARGS="-D MAJOR=$GCCMAJOR -D OPT=$OPT -D GCCVER=$VER -D TRIPLET=$ARCH"

# We're building the 64-bit version of the compiler and tools but we want
# to install it in the standard bin/lib locations. Gcc will take care of
# building and putting the 32/64 objects in the right places. We also want
# to unset all of the flags that we usually pass for a 64-bit object so that
# gcc can properly create the multilib targets.
CONFIGURE_OPTS[amd64]="${CONFIGURE_OPTS[i386]}"
clear_archflags

# Use bash for all shells - some corruption occurs in libstdc++-v3/config.status
# otherwise.
export CONFIG_SHELL=$SHELL
export MAKESHELL=$SHELL
# Place the GNU utilities first in the path
export PATH=$GNUBIN:$PATH

LANGUAGES="c,c++,lto"

RUN_DEPENDS_IPS="
developer/linker
developer/gnu-binutils
system/header
system/library/c-runtime
system/library/g++-runtime
system/library/gcc-runtime
"

BUILD_DEPENDS_IPS="
ooce/developer/autogen
ooce/developer/dejagnu
"

export LD=/bin/ld
export LD_FOR_HOST=$LD
export LD_FOR_TARGET=$LD
export STRIP="/usr/bin/strip -x"
export STRIP_FOR_TARGET="$STRIP"

HARDLINK_TARGETS="
${PREFIX/#\/}/bin/$ARCH-gcc-$VER
${PREFIX/#\/}/bin/$ARCH-gcc-ar
${PREFIX/#\/}/bin/$ARCH-gcc-nm
${PREFIX/#\/}/bin/$ARCH-gcc-ranlib
${PREFIX/#\/}/bin/$ARCH-c++
${PREFIX/#\/}/bin/$ARCH-g++
"

PKGDIFF_HELPER="
s^/$GCCMAJOR\\.[0-9]\\.[0-9]([/ ])^/$GCCMAJOR.x.x\\1^
s^/gcc-$GCCMAJOR\\.[0-9]\\.[0-9]^/gcc-$GCCMAJOR.x.x^
"

CONFIGURE_OPTS="
--prefix=$OPT
--host $ARCH
--build $ARCH
--target $ARCH
--with-gmp-include=/usr/include/gmp
--with-ld=$LD --without-gnu-ld
--with-as=/usr/bin/gas --with-gnu-as
--with-build-time-tools=/usr/gnu/${TRIPLETS[amd64]}/bin
--with-build-config=no
--enable-languages=$LANGUAGES
--with-arch-32=i586
--enable-shared
--with-system-zlib
--enable-plugins
--enable-__cxa_atexit
--enable-initfini-array
--disable-libitm
--with-diagnostics-urls=auto-if-env
enable_frame_pointer=yes
"
CONFIGURE_OPTS[WS]="
--with-boot-ldflags=\"-R$OPT/lib\"
--with-boot-cflags=\"-O2\"
--with-pkgversion=\"$DISTRO $RELVER/$VER-$ILVER\"
--with-bugurl=$HOMEURL/about/contact
"
LDFLAGS="-R$OPT/lib"
CPPFLAGS+=" -D_TS_ERRNO"

# gcc uses posix_fallocate() to extend temporary files on disk.
# Although OmniOS has the posix_fallocate() function, ZFS does not support it.
# Even though the function properly returns EINVAL, gcc does not handle that
# and fall back to something else (like ftruncate()).
# Filed upstream at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100358
export ac_cv_func_posix_fallocate=no

# If the selected compiler is the same version as the one we're building
# then the three-stage bootstrap is unecessary and some build time can be
# saved.
if [ -z "$FORCE_BOOTSTRAP" -a "`gcc -dumpversion`" = "$VER" ]; then
CONFIGURE_OPTS+=" --disable-bootstrap"
logmsg -n "--- disabling bootstrap"
else
logmsg -n "--- full bootstrap build"
fi

make_install() {
logmsg "--- make install"
logcmd $MAKE DESTDIR=${DESTDIR} install-strip || \
logerr "--- Make install failed"
}

tests() {
# Specific tests to ensure that certain features are properly detected
$EGREP -s gcc_cv_as_eh_frame=yes $TMPDIR/$BUILDDIR/gcc/config.log \
|| logerr "The .eh_frame based unwinder is not enabled"

$EGREP -s gcc_cv_use_emutls=no \
$TMPDIR/$BUILDDIR/$ARCH/libgcc/config.log \
|| logerr "Emulated TLS is enabled"

$EGREP -s gcc_cv_libc_provides_ssp=yes $TMPDIR/$BUILDDIR/gcc/config.log \
|| logerr "libc support for SSP was not detected"

[ -n "$SKIP_TESTSUITE" ] && return
if [ -z "$BATCH" ] && ! ask_to_testsuite; then
return
fi

export GUILE_AUTO_COMPILE=0
export PATH+=:$OOCEBIN
# Some gcc tests (e.g. limits-exprparen.c) need a larger stack
ulimit -Ss 16385
# Lots of tests create core files via assertions
ulimit -c 0
# Running tests in parallel leads to inconsistent results
MAKE_TESTSUITE_ARGS+=" -j$MJOBS"
# This causes the testsuite to be run three times, once with -m32, once
# with -m64 and once with -m64 and -msave-args
MAKE_TESTSUITE_ARGS+=" RUNTESTFLAGS=--target_board=unix/\{-m32,-m64,-m64/-msave-args\}"
# If not in batch mode, we've already asked whether this should be run
# above, so set BATCH
BATCH=1 run_testsuite "-k check" "" build.log.testsuite
pushd $TMPDIR/$BUILDDIR >/dev/null
# Sort the test results in the individual summary files
find $TMPDIR/$BUILDDIR -name '*.sum' -type f | while read s; do
cp $s $s.orig
nawk '
/^Running target unix/ { sorting = 1; print; next }
/Summary .*===$/ { close("sort -k2"); sorting = 0; print; next }
sorting { print | "sort -k2" }
# The version lines include the build path
/ version / { next }
{ print }
' < $s.orig > $s
done
make_param mail-report.log
cat mail-report.log > $SRCDIR/testsuite.log.detail
$EGREP ' Summary (for .*)?===$|^#' mail-report.log > $SRCDIR/testsuite.log
popd >/dev/null
}

init
download_source $PROG $PROG $VER
patch_source
# gcc should be built out-of-tree
prep_build autoconf -oot
build -noctf
tests
logcmd cp $TMPDIR/$SRC_BUILDDIR/COPYING* $TMPDIR/$BUILDDIR
make_package
clean_up

# Vim hints
# vim:ts=4:sw=4:et:fdm=marker
3 changes: 3 additions & 0 deletions build/gcc14/files/soname.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
opt/gcc-14/lib/amd64/libcc1.so.0.0.0
opt/gcc-14/lib/gcc/x86_64-pc-solaris2.11/14.2.0/plugin/libcc1plugin.so.0.0.0
opt/gcc-14/lib/gcc/x86_64-pc-solaris2.11/14.2.0/plugin/libcp1plugin.so.0.0.0
52 changes: 52 additions & 0 deletions build/gcc14/local.mog
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source. A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.

# Copyright 2024 OmniOS Community Edition (OmniOSce) Association.

license COPYING license=GPLv2
license COPYING.LIB license=LGPLv2.1
license COPYING.RUNTIME license="GCC runtime license"
license COPYING3 license=GPLv3
license COPYING3.LIB license=LGPLv3

# Mediated symlinks
<transform link target=$(OPT)/ -> default mediator gcc>
<transform link target=$(OPT)/ -> default mediator-version $(MAJOR)>

link path=usr/bin/g++ target=$(OPT)/bin/g++
link path=usr/bin/gcc target=$(OPT)/bin/gcc
link path=usr/bin/gcov target=$(OPT)/bin/gcov
link path=usr/bin/gcpp target=$(OPT)/bin/cpp

link path=usr/share/man/man1/g++.1 target=$(OPT)/share/man/man1/g++.1
link path=usr/share/man/man1/gcc.1 target=$(OPT)/share/man/man1/gcc.1
link path=usr/share/man/man1/gcov.1 target=$(OPT)/share/man/man1/gcov.1
link path=usr/share/man/man1/gcpp.1 target=$(OPT)/share/man/man1/cpp.1

# Symlinks to make the compiler tools available as xxx-14.
# These are not mediated.

<transform link path=usr/.*-$(MAJOR)(\.1)?$ -> delete mediator .>
<transform link path=usr/.*-$(MAJOR)(\.1)?$ -> delete mediator-version .>
<transform link path=usr/.*-$(MAJOR)(\.1)?$ -> delete mediator-priority .>

link path=usr/bin/g++-$(MAJOR) target=$(OPT)/bin/g++
link path=usr/bin/gcc-$(MAJOR) target=$(OPT)/bin/gcc
link path=usr/bin/gcov-$(MAJOR) target=$(OPT)/bin/gcov
link path=usr/bin/gcpp-$(MAJOR) target=$(OPT)/bin/cpp

link path=usr/share/man/man1/g++-$(MAJOR).1 target=$(OPT)/share/man/man1/g++.1
link path=usr/share/man/man1/gcc-$(MAJOR).1 target=$(OPT)/share/man/man1/gcc.1
link path=usr/share/man/man1/gcov-$(MAJOR).1 target=$(OPT)/share/man/man1/gcov.1
link path=usr/share/man/man1/gcpp-$(MAJOR).1 target=$(OPT)/share/man/man1/cpp.1

link path=$(OPT)/lib/gcc/$(TRIPLET)/$(MAJOR) target=$(GCCVER)
link path=$(OPT)/include/c++/$(MAJOR) target=$(GCCVER)

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
From e32e90221c3f1993e00c874b0ea5b1b8051eead3 Mon Sep 17 00:00:00 2001
From: Richard Lowe <[email protected]>
Date: Wed, 5 Mar 2014 04:12:52 +0000
Subject: gcc: enable the .eh_frame based unwinder

---
gcc/configure | 9 ++++++---
gcc/configure.ac | 9 ++++++---
2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index abc8bfdc2443..cd02dd8bf67c 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -26122,11 +26122,12 @@ if test $in_tree_ld != yes ; then
# numbers can be used in ld.so.1 feature checks even if a different
# linker is configured.
ld_ver=`$gcc_cv_ld -V 2>&1`
- if echo "$ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
- ld_vers=`echo $ld_ver | sed -n \
- -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'`
+ if echo "$ld_ver" | $EGREP 'Solaris Link Editors|Solaris ELF Utilities' > /dev/null; then
+ ld_vers=`echo $ld_ver | /bin/sed -n \
+ -E 's,^.*: (5|1[0-9])\.[0-9][0-9]*-([0-9]\.[0-9][0-9]*).*$,\2,p'`
ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
+ ld_vers_isillumos=`echo "$ld_ver" | grep '(illumos)'`
fi
;;
esac
@@ -32379,6 +32380,8 @@ elif test x$gcc_cv_ld != x; then
# Sun ld has various bugs in .eh_frame_hdr support before version 1.2251.
if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2251; then
gcc_cv_ld_eh_frame_hdr=yes
+ elif test "$ld_vers_minor" -ge 1735 && test -n "$ld_vers_isillumos"; then
+ gcc_cv_ld_eh_frame_hdr=yes
fi
;;
esac
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 1d2cefa3f6a3..dc2a8c4dfd40 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3155,11 +3155,12 @@ if test $in_tree_ld != yes ; then
# numbers can be used in ld.so.1 feature checks even if a different
# linker is configured.
ld_ver=`$gcc_cv_ld -V 2>&1`
- if echo "$ld_ver" | grep 'Solaris Link Editors' > /dev/null; then
- ld_vers=`echo $ld_ver | sed -n \
- -e 's,^.*: 5\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\1,p'`
+ if echo "$ld_ver" | $EGREP 'Solaris Link Editors|Solaris ELF Utilities' > /dev/null; then
+ ld_vers=`echo $ld_ver | /bin/sed -n \
+ -E 's,^.*: (5|1[0-9])\.[0-9][0-9]*-([0-9]\.[0-9][0-9]*).*$,\2,p'`
ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
+ ld_vers_isillumos=`echo "$ld_ver" | grep '(illumos)'`
fi
;;
esac
@@ -6112,6 +6113,8 @@ elif test x$gcc_cv_ld != x; then
# Sun ld has various bugs in .eh_frame_hdr support before version 1.2251.
if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2251; then
gcc_cv_ld_eh_frame_hdr=yes
+ elif test "$ld_vers_minor" -ge 1735 && test -n "$ld_vers_isillumos"; then
+ gcc_cv_ld_eh_frame_hdr=yes
fi
;;
esac
42 changes: 42 additions & 0 deletions build/gcc14/patches/0003-intl-Don-t-use-UTF-8-quotes.-Ever.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 372ec75767eb8273164c2d7082c6af025627e164 Mon Sep 17 00:00:00 2001
From: Richard Lowe <[email protected]>
Date: Tue, 11 Mar 2014 21:50:30 +0000
Subject: intl: Don't use UTF-8 quotes. Ever.

---
gcc/intl.cc | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/gcc/intl.cc b/gcc/intl.cc
index 6f653bff9b80..175b882515fd 100644
--- a/gcc/intl.cc
+++ b/gcc/intl.cc
@@ -74,17 +74,11 @@ gcc_init_libintl (void)

if (!strcmp (open_quote, "`") && !strcmp (close_quote, "'"))
{
- /* Untranslated quotes that it may be possible to replace with
- U+2018 and U+2019; but otherwise use "'" instead of "`" as
- opening quote. */
+ /*
+ * open_quote is ` purely for ease of translation. If they aren't
+ * translated, use ' for both
+ */
open_quote = "'";
-#if defined HAVE_LANGINFO_CODESET
- if (locale_utf8)
- {
- open_quote = "\xe2\x80\x98";
- close_quote = "\xe2\x80\x99";
- }
-#endif
}
}

@@ -145,6 +139,3 @@ get_spaces (const char *str)
spaces[len] = '\0';
return spaces;
}
-
-
-
Loading

0 comments on commit cd9b17e

Please sign in to comment.