1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00
freebsd-ports/lang/gcc10/Makefile

158 lines
4.2 KiB
Makefile
Raw Normal View History

Welcome GCC 10.1, the first release of the GCC 10 series! https://gcc.gnu.org/gcc-10/changes.html has a comprehensive overview of many improvements and changes and https://gcc.gnu.org/gcc-10/porting_to.html highlights issues you may encounter porting to this version, though this release series should not bring too many, -fno-common now being the default probably is the one with the largest impact. To give a brief overview of some of the more noticable changes: Several new features from the upcoming C2X revision of the ISO C standard are supported with -std=c2x and -std=gnu2x. Some of these are also supported as extensions when compiling for older language versions. Several C++20 features have been implemented and the libstdc++ runtime library has improved experimental C++2a support. Caveat: The ABI of passing and returning certain C++ classes by value changed on targets including AArch64, ARM, PowerPC ELFv2 in -std=c++17 and -std=c++20 modes. -fanalyzer enables a new static analysis pass and associated warnings, which is more time-consuming, but detects various common errors such as double-free bugs. This is still work in progress, yet definitely worth a try! Extended characters in identifiers may now be specified directly in the input encoding (UTF-8 by default) for the C family of languages, so you can write "const int naïve_π = 3;". The __has_builtin built-in preprocessor operator can be used to query support for built-in functions and __builtin_roundeven has been added. On the Fortran side, the default buffer size for I/O using unformatted files has been increased to 1048576 (and can now be set at run time), mismatches between actual and dummy argument lists in a single file are now rejected with an error (which can be disabled via the new optoins -fallow-argument-mismatch), the handling of a BOZ literal constant has been reworked to provide better conformance to the Fortran 2008 and 2018 standards, and more. Optimization-wise, -fallocation-dce removes unneeded pairs of new and delete operators and -fprofile-partial-training, -fprofile-reproducible, and -fprofile-prefix-path allow for more control over the use of profiles. The inter-procedural optimizers (IPO) have seen many improvements: The inter-procedural scalar replacement of aggregates (IPA-SRA) pass now operates at link time and can remove computing/returning unused return values; -finline-functions is now enabled at -O2 and was retuned; inliner heuristics and function cloning use value-range information to predict the effectivity of individual transformations; and more. Similarly many improvements around link-time optimizations (LTO): A new binary lto-dump shows various information about LTO bytecode object files; the parallel phase of LTO automatically detects a running make's jobserver; LTO bytecode can be compressed with the zstd algorithm; profile maintenance during compilation and hot/cold code partitioning has been improved. Version 2.6 of the OpenACC specification is now supported by the C, C++ and Fortran compilers. GCC 10 adds a number of newly implemented OpenMP 5.0 features on top of the GCC 9 release such as conditional lastprivate clause, scan and loop directives, order(concurrent) and use_device_addr clauses support, if clause on simd construct or partial support for the declare variant directive, getting closer to full support of the OpenMP 5.0 standard. A new warning -Wstring-compare, enabled by -Wextra, warns about equality and inequality expressions between zero and the result of a call to either strcmp and strncmp in some cases. -Wzero-length-bounds, enabled by -Warray-bounds, warns about accesses to elements of zero-length arrays that might overlap other members of the same object. Numerous enhancements to existing warnings, e.g. -Warray-bounds detects more out-of-bounds accesses to member arrays as well as accesses to elements of zero-length arrays, -Wformat-overflow makes full use of string length information computed by the strlen optimization pass, -Wrestrict detects overlapping accesses to dynamically allocated objects, -Wreturn-local-addr diagnoses more instances of return statements returning addresses of automatic variables, -Wstringop-overflow detects more out-of-bounds stores to member arrays including zero-length arrays, dynamically allocated bjects and variable length arrays, as well as more instances of reads of unterminated character arrays by string built-in functions, -Warith-conversion re-enables warnings from -Wconversion, -Wfloat-conversion, and -Wsign-conversion that are now off by default for an expression where the result of an arithmetic operation will not fit in the target type due to promotion, but the operands of the expression do fit in the target type. All architectures have seen improvements, and aarch64 notably has seen several related to the Scalable Vector Extension (SVE). The automatic template instantiation at link time (-frepo) has been removed (finally). Offloading to Heterogeneous System Architecture Intermediate Language (HSAIL) has been deprecated and will likely be removed in a future release. PR: 246700
2020-06-01 21:59:33 +00:00
# Created by: Gerald Pfeifer <gerald@FreeBSD.org>
# $FreeBSD$
PORTNAME= gcc
PORTVERSION= 10.1.0
CATEGORIES= lang
MASTER_SITES= GCC
PKGNAMESUFFIX= ${SUFFIX}
MAINTAINER= gerald@FreeBSD.org
COMMENT= GNU Compiler Collection 10
LICENSE= GPLv3 GPLv3RLE
LICENSE_COMB= multi
ONLY_FOR_ARCHS= aarch64 amd64 arm armv6 armv7 i386 powerpc powerpc64
LIB_DEPENDS= libgmp.so:math/gmp \
libmpfr.so:math/mpfr \
libmpc.so:math/mpc
BUILD_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
RUN_DEPENDS+= ${LOCALBASE}/bin/as:devel/binutils
.if defined(MAINTAINER_MODE)
BUILD_DEPENDS+= runtest:misc/dejagnu
.endif
USES= compiler cpe gmake iconv libtool makeinfo perl5 tar:xz
USE_BINUTILS= yes
USE_PERL5= build
CONFLICTS= gcc10-devel-10.*
CPE_VENDOR= gnu
GCC_VERSION= ${PORTVERSION}
SUFFIX= ${PORTVERSION:C/([0-9]+).*/\1/}
SSP_UNSAFE= yes
CFLAGS:= ${CFLAGS:N-mretpoline}
CXXFLAGS:= ${CXXFLAGS:N-mretpoline}
OPTIONS_DEFINE= BOOTSTRAP GRAPHITE PLUGINS
OPTIONS_DEFAULT= BOOTSTRAP PLUGINS
BOOTSTRAP_DESC= Build using a full bootstrap
GRAPHITE_DESC= Support for Graphite loop optimizations
.if exists(/usr/lib32/libc.so)
OPTIONS_DEFINE_amd64+= MULTILIB
OPTIONS_DEFAULT_amd64+= MULTILIB
OPTIONS_DEFINE_powerpc64+= MULTILIB
OPTIONS_DEFAULT_powerpc64+= MULTILIB
MULTILIB_DESC= Build support for 32-bit and 64-bit targets
MULTILIB_CONFIGURE_ENABLE= multilib
.else
CONFIGURE_ARGS+= --disable-multilib
.endif
PLUGINS_CONFIGURE_ENABLE= plugin
.include <bsd.port.pre.mk>
.if ${ARCH} == amd64
CONFIGURE_TARGET= x86_64-portbld-${OPSYS:tl}${OSREL}
.elif ${ARCH} == powerpc64
CONFIGURE_ENV+= UNAME_m="powerpc64"
. if defined(PPC_ABI) && ${PPC_ABI} == ELFv2
CONFIGURE_ARGS+= --with-abi=elfv2
. else
USE_GCC= 9
. endif
.endif
LANGUAGES:= c,c++,objc,fortran
TARGLIB= ${PREFIX}/lib/gcc${SUFFIX}
TARGLIB32= ${PREFIX}/lib32 # The version information is added later
LIBEXEC= ${PREFIX}/libexec/gcc${SUFFIX}
GNU_CONFIGURE= yes
CONFIGURE_OUTSOURCE= yes
.if empty(PORT_OPTIONS:MBOOTSTRAP)
CONFIGURE_ARGS+=--disable-bootstrap
.else
CONFIGURE_ARGS+=--with-build-config=bootstrap-debug
ALL_TARGET= bootstrap-lean
.endif
INSTALL_TARGET= install-strip
.if ${UID} != 0
BINMODE= 755
.endif
CONFIGURE_ARGS+=--disable-nls \
--enable-gnu-indirect-function \
--libdir=${TARGLIB} \
--libexecdir=${LIBEXEC} \
--program-suffix=${SUFFIX} \
--with-as=${LOCALBASE}/bin/as \
--with-gmp=${LOCALBASE} \
--with-gxx-include-dir=${TARGLIB}/include/c++/ \
--with-ld=${LOCALBASE}/bin/ld \
${ICONV_CONFIGURE_ARG} \
--with-pkgversion="FreeBSD Ports Collection" \
--with-system-zlib
MAKE_ARGS+= MAKEINFOFLAGS="--no-split"
USE_LDCONFIG= ${TARGLIB}
PLIST_SUB+= GCC_VERSION=${GCC_VERSION} \
GNU_HOST=${CONFIGURE_TARGET} \
SUFFIX=${SUFFIX}
INFO= gcc${SUFFIX}/cpp \
gcc${SUFFIX}/cppinternals \
gcc${SUFFIX}/gcc \
gcc${SUFFIX}/gccinstall \
gcc${SUFFIX}/gccint \
gcc${SUFFIX}/gfortran \
gcc${SUFFIX}/libgomp
# Release tarballs (as opposed to snapshots) always carry this.
INFO+= gcc${SUFFIX}/libquadmath \
gcc${SUFFIX}/libitm
SUB_FILES= pkg-message
SUB_LIST+= TARGLIB=${TARGLIB}
.if ${PORT_OPTIONS:MGRAPHITE}
LIB_DEPENDS+= libisl.so:devel/isl
CONFIGURE_ARGS+=--with-isl=${LOCALBASE}
.endif
CONFIGURE_ARGS+=--enable-languages=${LANGUAGES}
pre-everything::
@${ECHO_MSG} "Making GCC ${PORTVERSION} for ${CONFIGURE_TARGET} [${LANGUAGES}]"
pre-configure:
cd ${WRKSRC} ; contrib/gcc_update --touch
@${RM} ${WRKSRC}/gcc/*/*.info*
.if defined(MAINTAINER_MODE)
full-regression-test: build
cd ${TEST_WRKSRC}; ${MAKE_CMD} -sk check \
; ${WRKSRC}/contrib/test_summary
.endif
post-stage:
${RM} ${STAGEDIR}${PREFIX}/man/man7/*
${RM} -r ${STAGEDIR}${TARGLIB}/gcc/*/${GCC_VERSION}/include-fixed/
# Add target libraries and include files to packaging list.
${RM} ${WRKDIR}/PLIST.lib
.if (${ARCH} == amd64 || ${ARCH} == powerpc64) && ${PORT_OPTIONS:MMULTILIB}
${MKDIR} ${STAGEDIR}${TARGLIB32}
${MV} ${STAGEDIR}${PREFIX}/lib/lib32 ${STAGEDIR}${TARGLIB32}/gcc${SUFFIX}
.endif
.for d in ${TARGLIB:S/^${PREFIX}\///} ${TARGLIB32:S/^${PREFIX}\///} ${LIBEXEC:S/^${PREFIX}\///}
cd ${STAGEDIR}${PREFIX} ; if [ -d $d ]; then \
${FIND} $d -type f -o -type l >>${WRKDIR}/PLIST.lib ;\
fi
.endfor
cd ${WRKDIR} ; ${SED} -i -e "/PLIST.lib/ r PLIST.lib" ${TMPPLIST}
.include <bsd.port.post.mk>