pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang gcc12: added version 12.1.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f046991bbd4a
branches:  trunk
changeset: 380834:f046991bbd4a
user:      adam <adam%pkgsrc.org@localhost>
date:      Thu Jun 16 15:43:54 2022 +0000

description:
gcc12: added version 12.1.0

GCC 12

Caveats

An ABI incompatibility between C and C++ when passing or returning by value certain aggregates containing zero width bit-fields has been discovered on various targets. As mentioned in PR102024, since 
the PR42217 fix in GCC 4.5 the C++ front-end has been removing zero width bit-fields from the internal representation of the aggregates after the layout of those aggregates, but the C front-end kept 
them, so passing e.g. struct S { float a; int : 0; float b; } or struct T { float c; int : 0; } by value could differ between C and C++. Starting with GCC 12 the C++ front-end no longer removes those 
bit-fields from the internal representation and per clarified psABI some targets have been changed, so that they either ignore those bit-fields in the argument passing by value decisions in both C 
and C++, or they always take them into account. x86-64, ARM and AArch64 will always ignore them (so there is a C ABI incompatibility between GCC 11 and earlier with GCC 12 or later), PowerPC64 ELFv2 
and S/390 always take them into account (so there is a C++ ABI incompatibility, GCC 4.4 and earlier compatible with GCC 12 or later, incompatible with GCC 4.5 through GCC 11). RISC-V has changed the 
handling of these already starting with GCC 10. As the ABI requires, MIPS takes them into account handling function return values so there is a C++ ABI incompatibility with GCC 4.5 through 11. For 
function arguments on MIPS, refer to the MIPS specific entry. GCC 12 on the above targets will report such incompatibilities as warnings or other diagnostics unless -Wno-psabi is used.
C: Computed gotos require a pointer type now.
C++: Two non-standard std::pair constructors have been deprecated. These allowed the use of an rvalue and a literal 0 to construct a pair containing a move-only type and a pointer. The nullptr 
keyword should be used to initialize the pointer member instead of a literal 0, as this is portable to other C++ implementations.
The configuration option --enable-libstdcxx-allocator no longer supports the bitmap, mt, and pool arguments. Those configurations had been broken for some time.
Fortran: OpenMP code using the omp_lib.h include file can no longer be compiled with -std=f95 but now requires at least -std=f2003. Alternatively, use the omp_lib module, which still supports 
-std=f95 and is recommended to be used instead in general.
OpenMP offloading to Intel MIC has been deprecated and will be removed in a future release.
The cr16 target with the cr16-*-* configuration has been obsoleted and will be removed in a future release.
The hppa[12]*-*-hpux10* and hppa[12]*-*-hpux11* configurations targeting 32-bit PA-RISC with HP-UX have been obsoleted and will be removed in a future release.
The m32c*-*-rtems* configuration has been obsoleted and will be removed in a future release.
The support for the m32r-*-linux*, m32rle-*-linux*, m68k*-*-openbsd* and vax-*-openbsd* configurations has been removed.
STABS: Support for emitting the STABS debugging format is deprecated and will be removed in the next release. All ports now default to emit DWARF (version 2 or later) debugging info or are obsoleted.
The optimization level -Ofast now implies -fno-semantic-interposition.

General Improvements

Vectorization is enabled at -O2 which is now equivalent to the original -O2 -ftree-vectorize -fvect-cost-model=very-cheap. Note that default vectorizer cost model has been changed which used to 
behave as -fvect-cost-model=cheap were specified.
GCC now supports the ShadowCallStack sanitizer, which can be enabled using the command-line option -fsanitize=shadow-call-stack. This sanitizer currently only works on AArch64 targets and it requires 
an environment in which all code has been compiled with -ffixed-r18. Its primary initial user is the Linux kernel.

diffstat:

 lang/Makefile                                                  |    4 +-
 lang/gcc12-libs/DESCR                                          |    7 +
 lang/gcc12-libs/Makefile                                       |   66 ++
 lang/gcc12-libs/buildlink3.mk                                  |   46 +
 lang/gcc12/DESCR                                               |    2 +
 lang/gcc12/Makefile                                            |  212 ++++++++
 lang/gcc12/buildlink3.mk                                       |   24 +
 lang/gcc12/distinfo                                            |   29 +
 lang/gcc12/options.mk                                          |  161 ++++++
 lang/gcc12/patches/patch-fixincludes_inclhack.def              |   36 +
 lang/gcc12/patches/patch-gcc_Makefile.in                       |   15 +
 lang/gcc12/patches/patch-gcc_config.gcc                        |  237 ++++++++++
 lang/gcc12/patches/patch-gcc_config.host                       |   15 +
 lang/gcc12/patches/patch-gcc_config_aarch64_aarch64-netbsd.h   |   18 +
 lang/gcc12/patches/patch-gcc_config_arm_arm.h                  |   45 +
 lang/gcc12/patches/patch-gcc_config_arm_bpabi.h                |   22 +
 lang/gcc12/patches/patch-gcc_config_arm_elf.h                  |   14 +
 lang/gcc12/patches/patch-gcc_config_arm_netbsd-eabi.h          |   57 ++
 lang/gcc12/patches/patch-gcc_config_arm_netbsd-elf.h           |   80 +++
 lang/gcc12/patches/patch-gcc_config_nvptx_gen-opt.sh           |   15 +
 lang/gcc12/patches/patch-gcc_configure                         |   26 +
 lang/gcc12/patches/patch-isl_configure                         |   26 +
 lang/gcc12/patches/patch-libffi_configure                      |   16 +
 lang/gcc12/patches/patch-libffi_testsuite_libffi.call_float2.c |   15 +
 lang/gcc12/patches/patch-libgcc_config.host                    |   25 +
 lang/gcc12/patches/patch-libgcc_crtstuff.c                     |   15 +
 lang/gcc12/patches/patch-libgfortran_io_io.h                   |   18 +
 lang/gcc12/patches/patch-libquadmath_printf_quadmath-printf.c  |   26 +
 lang/gcc12/patches/patch-libquadmath_strtod_strtod__l.c        |   23 +
 lang/gcc12/patches/patch-libstdc++-v3_libsupc++_new__opa.cc    |   17 +
 lang/gcc12/version.mk                                          |    2 +
 31 files changed, 1313 insertions(+), 1 deletions(-)

diffs (truncated from 1448 to 300 lines):

diff -r 06073f9fe49d -r f046991bbd4a lang/Makefile
--- a/lang/Makefile     Thu Jun 16 15:25:24 2022 +0000
+++ b/lang/Makefile     Thu Jun 16 15:43:54 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.649 2022/05/13 14:27:35 ryoon Exp $
+# $NetBSD: Makefile,v 1.650 2022/06/16 15:43:54 adam Exp $
 #
 
 COMMENT=       Programming languages
@@ -69,6 +69,8 @@
 SUBDIR+=       gcc10
 SUBDIR+=       gcc10-aux
 SUBDIR+=       gcc10-libs
+SUBDIR+=       gcc12
+SUBDIR+=       gcc12-libs
 SUBDIR+=       gcc2
 SUBDIR+=       gcc5-aux
 SUBDIR+=       gcc6
diff -r 06073f9fe49d -r f046991bbd4a lang/gcc12-libs/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc12-libs/DESCR     Thu Jun 16 15:43:54 2022 +0000
@@ -0,0 +1,7 @@
+The GNU Compiler Collection (GCC) includes front ends for C, C++, Objective-C,
+Fortran, and Go, as well as libraries for these languages (libstdc++,
+libgfortran, ...).
+
+This packages provides GCC support libraries in a specific location and allows
+packages to depend on just the libraries rather than having to pull in the full
+GCC package.
diff -r 06073f9fe49d -r f046991bbd4a lang/gcc12-libs/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc12-libs/Makefile  Thu Jun 16 15:43:54 2022 +0000
@@ -0,0 +1,66 @@
+# $NetBSD: Makefile,v 1.1 2022/06/16 15:43:55 adam Exp $
+
+GCC_PKGNAME=   gcc12
+.include       "../../lang/${GCC_PKGNAME}/version.mk"
+
+DISTNAME=      gcc-${GCC12_DIST_VERSION}
+PKGNAME=       ${GCC_PKGNAME}-libs-${GCC12_DIST_VERSION}
+
+## The PKGREVISION of this package needs to be at least 1 more than the
+## PKGREVISION of the lang/gcc12 package so that with the dependence pattern
+## '{gcc12,gcc12-libs}>=12.1.*' pkg_add will choose gcc12-libs over gcc12.
+PKGREVISION=   1
+
+CATEGORIES=    lang
+MASTER_SITES=  # empty
+DISTFILES=     # empty
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://gcc.gnu.org/
+COMMENT=       The GNU Compiler Collection (GCC) support shared libraries
+LICENSE=       gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3
+
+USE_TOOLS+=    pax
+
+NO_BUILD=              yes
+CHECK_SHLIBS=          no
+RELRO_SUPPORTED=       no
+
+## Depend on exactly ${GCC12_DIST_VERSION}.
+BUILD_DEPENDS+=                ${GCC_PKGNAME}-${GCC12_DIST_VERSION}{,nb[0-9]*}:../../lang/gcc12
+
+.include "../../mk/bsd.prefs.mk"
+
+LIBGCC_SUBPREFIX=      ${GCC_PKGNAME}
+LIBGCC_PREFIX=         ${LOCALBASE}/${LIBGCC_SUBPREFIX}
+GCC_TARGET_MACHINE?=   ${MACHINE_GNU_PLATFORM}
+BUILD_DEFS+=           GCC_TARGET_MACHINE
+
+.if ${SHLIB_TYPE} == "dylib"
+SHLIB_EXT=     dylib
+.else
+SHLIB_EXT=     so
+.endif
+
+LIBRARY_FILES= ${WRKDIR}/lib_files
+
+GENERATE_PLIST+=       ${SED} -e 's,^,${LIBGCC_SUBPREFIX}/${GCC_TARGET_MACHINE}/,' \
+                       ${LIBRARY_FILES};
+GENERATE_PLIST+=       ${GREP} -q 'lib/' ${LIBRARY_FILES} || \
+                       ${ECHO} '@pkgdir ${LIBGCC_SUBPREFIX}/${GCC_TARGET_MACHINE}/lib';
+
+${LIBRARY_FILES}:
+       ${PKG_INFO} -qL '${GCC_PKGNAME}-${GCC12_DIST_VERSION}*' |       \
+       ${SED} -n -e's,^${LIBGCC_PREFIX}/,,' -e'/libexec\//d'           \
+               -e'/libgij/d;/libgcj/d;/libjvm/d'                       \
+               -e'/lib.*\.${SHLIB_EXT}/p' >${LIBRARY_FILES}
+
+do-install: ${LIBRARY_FILES}
+       ${TEST} -d ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/lib ||      \
+               ${MKDIR} ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/lib
+       cd ${LIBGCC_PREFIX} &&                                          \
+         ${PAX} -rw ${DESTDIR}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE} <${LIBRARY_FILES}
+
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 06073f9fe49d -r f046991bbd4a lang/gcc12-libs/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc12-libs/buildlink3.mk     Thu Jun 16 15:43:54 2022 +0000
@@ -0,0 +1,46 @@
+# $NetBSD: buildlink3.mk,v 1.1 2022/06/16 15:43:55 adam Exp $
+
+BUILDLINK_TREE+=       gcc12-libs
+
+.if !defined(GCC12_LIBS_BUILDLINK3_MK)
+GCC12_LIBS_BUILDLINK3_MK:=
+
+.if !empty(USE_PKGSRC_GCC_RUNTIME:M[Yy][Ee][Ss])
+BUILDLINK_API_DEPENDS.gcc12-libs+=     gcc12-libs>=12.1.0
+.else
+BUILDLINK_API_DEPENDS.gcc12-libs+=     {gcc12,gcc12-libs}>=12.1.0
+.endif
+BUILDLINK_PKGSRCDIR.gcc12-libs=                ../../lang/gcc12-libs
+BUILDLINK_DEPMETHOD.gcc12-libs?=       full
+
+BUILDLINK_PASSTHRU_DIRS+=      ${BUILDLINK_PREFIX.gcc12-libs}/gcc12
+
+BUILDLINK_FILES.gcc12-libs=    #empty
+BUILDLINK_AUTO_VARS.gcc12-libs=        no
+
+.if !empty(USE_PKGSRC_GCC_RUNTIME:M[Yy][Ee][Ss])
+# Use custom specs file to ensure we link against pkgsrc libraries.
+SPECS_LIBGCC=          ${WRAPPER_DIR}/specs.libgcc
+WRAPPER_TARGETS+=      ${SPECS_LIBGCC}
+
+LIBGCC_SUBPREFIX=      gcc12
+LIBGCC_PREFIX=         ${BUILDLINK_PREFIX.gcc12-libs}/${LIBGCC_SUBPREFIX}
+GCC_TARGET_MACHINE?=   ${MACHINE_GNU_PLATFORM}
+
+${SPECS_LIBGCC}:
+       @${ECHO} "*link_libgcc:" >${SPECS_LIBGCC}
+       @${ECHO} "%D ${LINKER_RPATH_FLAG}${LIBGCC_PREFIX}/${GCC_TARGET_MACHINE}/lib/%M" >>${SPECS_LIBGCC}
+
+_WRAP_EXTRA_ARGS.CC+=  -specs=${SPECS_LIBGCC}
+_WRAP_EXTRA_ARGS.CXX+= -specs=${SPECS_LIBGCC}
+_WRAP_EXTRA_ARGS.FC+=  -specs=${SPECS_LIBGCC}
+CWRAPPERS_APPEND.cc+=  -specs=${SPECS_LIBGCC}
+CWRAPPERS_APPEND.cxx+= -specs=${SPECS_LIBGCC}
+CWRAPPERS_APPEND.f77+= -specs=${SPECS_LIBGCC}
+.endif
+
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.endif # GCC12_LIBS_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -gcc12-libs
diff -r 06073f9fe49d -r f046991bbd4a lang/gcc12/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc12/DESCR  Thu Jun 16 15:43:54 2022 +0000
@@ -0,0 +1,2 @@
+The GNU Compiler Collection (GCC) includes front ends for C, C++, Objective-C,
+Fortran, and Go.
diff -r 06073f9fe49d -r f046991bbd4a lang/gcc12/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/gcc12/Makefile       Thu Jun 16 15:43:54 2022 +0000
@@ -0,0 +1,212 @@
+# $NetBSD: Makefile,v 1.1 2022/06/16 15:43:55 adam Exp $
+
+GCC_PKGNAME=           gcc12
+.include               "version.mk"
+
+DISTNAME=      gcc-${GCC12_DIST_VERSION}
+PKGNAME=       ${GCC_PKGNAME}-${GCC12_DIST_VERSION}
+## When bumping the PKGREVISION of this package the PKGREVISION of
+## lang/gcc12-libs needs to be bumped to be at least 1 more than the
+## PKGREVISION of this package!
+CATEGORIES=    lang
+MASTER_SITES=  ${MASTER_SITE_GNU:=gcc/gcc-${GCC12_DIST_VERSION}/}
+EXTRACT_SUFX=  .tar.xz
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://gcc.gnu.org/
+COMMENT=       The GNU Compiler Collection (GCC) - 12.0 Release Series
+LICENSE=       gnu-gpl-v2 AND gnu-gpl-v3 AND gnu-lgpl-v2 AND gnu-lgpl-v3
+
+DISTFILES=             ${DEFAULT_DISTFILES}
+EXTRACT_ONLY=          ${DEFAULT_DISTFILES}
+
+# Relocations result in a linker error on AArch64, but not x86.
+MKPIE_SUPPORTED=       no
+CHECK_RELRO_SKIP+=     ${GCC_PKGNAME}/lib/*
+
+NOT_FOR_PLATFORM=      Interix-*-*
+
+USE_LANGUAGES=         c99 c++
+USE_TOOLS+=            gmake makeinfo sed:run tar:build
+USE_TOOLS.NetBSD+=     gsed
+
+GNU_CONFIGURE=         yes
+GNU_CONFIGURE_STRICT=  no
+## Build outside ${WRKSRC}
+OBJDIR=                        ../build
+CONFIGURE_DIRS=                ${OBJDIR}
+CONFIGURE_SCRIPT=      ../${DISTNAME}/configure
+GCC_SUBPREFIX=         ${GCC_PKGNAME}
+GCC_PREFIX=            ${PREFIX}/${GCC_SUBPREFIX}
+GNU_CONFIGURE_PREFIX=  ${GCC_PREFIX}
+INFO_FILES=            yes
+CONFIGURE_ARGS+=       --disable-libstdcxx-pch
+
+UNLIMIT_RESOURCES+=    datasize
+UNLIMIT_RESOURCES+=    stacksize
+
+CHECK_PORTABILITY_SKIP+=       contrib/*
+
+.include "../../mk/bsd.prefs.mk"
+
+LANGS=                 c
+
+# In some cases LINKER_RPATH_FLAG needs a trailing space.
+LINKER_RPATH_FLAG:=    ${LINKER_RPATH_FLAG:S/-rpath/& /}
+
+## The Library rpath to use in end programs.
+LDFLAGS_FOR_TARGET=    ${LDFLAGS:M${COMPILER_RPATH_FLAG}*:N*/usr/lib*} ${LDFLAGS:M-Wl,-z*}
+
+# The "-static-libstdc++ -static-libgcc" flags are normally added to the
+# boot-ldflags by configure but because we are supply the boot-ldflags
+# we mash supply them.
+BOOT_LDFLAGS=          -static-libstdc++ -static-libgcc ${LDFLAGS_FOR_TARGET}
+# Needed on Darwin when LDFLAGS point to a SDK
+BOOT_LDFLAGS+=         ${LDFLAGS:M-Wl,-syslibroot*}
+# GCC does not understand this option; remove it, or stage build will fail
+BUILDLINK_TRANSFORM+=  rm:-stdlib=libc++
+
+# Disable fixincludes on SmartOS, header changes result in broken includes
+# being generated, see https://github.com/joyent/pkgsrc-legacy/issues/270
+.if ${OS_VARIANT} == "SmartOS"
+SUBST_CLASSES+=                fixinc
+SUBST_STAGE.fixinc=    pre-configure
+SUBST_FILES.fixinc=    gcc/Makefile.in
+SUBST_SED.fixinc=      -e "s,\./fixinc.sh,-c true,"
+.endif
+
+.include "options.mk"
+
+## For graphite support.
+.if !empty(PKG_OPTIONS:Mgcc-graphite)
+
+post-extract:
+       ${TAR} -jxf ${DISTDIR}/${ISL16}.tar.bz2 -C ${WRKSRC}
+       ${MV} ${WRKSRC}/${ISL16} ${WRKSRC}/isl
+.endif
+
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-*)
+# on NetBSD, use the native SSP code in libc
+CONFIGURE_ARGS+=       --disable-libssp
+# Match base libstdc++ major
+SUBST_CLASSES+=                libstdc
+SUBST_STAGE.libstdc=   pre-configure
+SUBST_FILES.libstdc=   libstdc++-v3/configure
+SUBST_MESSAGE.libstdc= Bumping libstdc++ major to 7
+SUBST_SED.libstdc=     -e 's,libtool_VERSION=6:,libtool_VERSION=7:,g'
+.else
+CONFIGURE_ARGS+=       --enable-libssp
+.endif
+
+## For target librarys and libjava programs.
+CONFIGURE_ENV+=                LDFLAGS_FOR_TARGET=${LDFLAGS_FOR_TARGET:Q}
+
+CONFIGURE_ARGS+=       --enable-languages=${LANGS:Q}
+CONFIGURE_ARGS+=       --enable-shared
+CONFIGURE_ARGS+=       --enable-long-long
+CONFIGURE_ARGS+=       --with-local-prefix=${GCC_PREFIX:Q}
+CONFIGURE_ARGS+=       --enable-threads=posix
+CONFIGURE_ARGS+=       --with-boot-ldflags=${BOOT_LDFLAGS:Q}
+CONFIGURE_ARGS+=       --without-zstd
+# causes build errors even when using lang/gcc12 to self-host.
+CONFIGURE_ARGS.SunOS+= --disable-libsanitizer
+# multilib on Darwin requires fat-binaries
+CONFIGURE_ARGS.Darwin+=        --disable-multilib
+.if !empty(OSX_SDK_PATH)
+CONFIGURE_ARGS.Darwin+=        --with-sysroot=${OSX_SDK_PATH}
+.endif
+CONFIGURE_ARGS.NetBSD+=        --with-gnu-ld --with-ld=/usr/bin/ld
+CONFIGURE_ARGS.NetBSD+=        --with-gnu-as --with-as=/usr/bin/as
+MAKE_ENV.NetBSD+=      ac_cv_func_clock_gettime=yes
+MAKE_ENV.NetBSD+=      ac_cv_func_gethostbyname_r=no
+MAKE_ENV.NetBSD+=      ac_cv_func_freelocale=no
+MAKE_ENV.NetBSD+=      ac_cv_func_newlocale=no
+MAKE_ENV.NetBSD+=      ac_cv_func_uselocale=no
+MAKE_ENV.SunOS+=       ac_cv_func_mkostemp=no
+
+.if !empty(PKGSRC_COMPILER:Mclang) || ${OPSYS} == "DragonFly"
+CONFIGURE_ARGS+=       --disable-bootstrap
+.endif
+
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) || !empty(MACHINE_PLATFORM:MLinux-*-i386)
+CONFIGURE_ARGS+=       --with-arch=i486 --with-tune=i486
+.endif
+
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-x86_64) || !empty(MACHINE_PLATFORM:MLinux-*-x86_64)
+CONFIGURE_ARGS+=       --with-arch=nocona --with-tune=nocona --with-fpmath=sse
+.endif
+
+.if !empty(MACHINE_PLATFORM:MDarwin-[0-8].*-*)
+CONFIGURE_ARGS+=       --with-dwarf2
+.endif



Home | Main Index | Thread Index | Old Index