summaryrefslogtreecommitdiff
path: root/mk/compiler
AgeCommit message (Collapse)AuthorFilesLines
2022-12-09mk/compiler/ccache.mk: Use ccache3gdt1-2/+10
The update to ccache4 caused a large increase in dependencies, breaking builds using e.g. "PKGSRC_COMPILER=ccache gcc", and the pre-update discussion of consequences and how to deal with it did not occur. The right long-term solution is to have a variable to select which ccache is used, and per-version circular dependency lists, accomoding both those who wish to use ccache 3 on low-resource machines and those who wish to use ccache 4. With 20224 branch manager hat on, I don't want to deal with ccache instability (or any instability at all now that we are past 12/1), so I have set ccache.mk to depend on ccache3, the status quo ante argumentum. Note that if one has any ccache installed, it will be used, so people that want to use ccache4 can just install it and then flip on "PKGSRC_COMPILER=ccache gcc".
2022-12-06mk: Use gcc12 for gfortran on Darwin/aarch64.jperkin1-1/+5
2022-11-23mk: Only add obsolete GCC_REQD if required.jperkin1-5/+11
Each GCC_REQD entry has an associated cost as it invokes pkg_admin to see if it's suitable, so only add 2.8.0 and 3.0 when absolutely necessary.
2022-08-01mk: add stack-clash option to PKGSRC_USE_STACK_CHECKwiz1-3/+5
2022-07-07mk: Remove -std overrides for clang.jperkin1-5/+1
Reported to cause problems on FreeBSD, and clang is generally pretty aggressive about defaulting to newer versions anyway.
2022-07-07mk: Move GCC <= 4.4 override out of for loop.jperkin1-4/+4
Possible performance improvement, no funtional change.
2022-07-05mk: Add support for newer C standards.jperkin2-7/+15
For now the GCC "c99 == gnu99" override is kept, but gnu99 is now supported as a specific value for USE_LANGUAGES, so we may want to be specific where required. c11 and c17 (and the corresponding gnu11/gnu17 versions) are newly supported.
2022-06-16gcc.mk: support gcc12adam1-6/+41
2022-05-28gcc.mk: restore GCC 6 handlinggutteridge1-8/+49
This is partly intended as a workaround to fix behaviour on NetBSD 8.x where GCC 7 was being pulled in universally after the prior commits here. Now it behaves as expected. There is an unaddressed issue in this code that needs to be examined further. (This has been discussed in more than one recent thread on teck-pkg@, including John Klos's report of this issue.) In any case, GCC 6 has also seen build improvements by nia@, who noted it's safe to simply revert part of the original change set, in one of those discussions on tech-pkg. (We can't use the hack introduced in the prior revisions for GCC 6, though, or this same broken dependency pattern occurs and will universally force GCC 6 instead of 7 on NetBSD 8.x.) Tested on NetBSD 8.2_STABLE and 9.2_STABLE with various packages, including tcsh, the original reported issue.
2022-05-21gcc.mk: fix syntaxnia1-5/+5
2022-05-21gcc.mk: Force USE_GCC_RUNTIME (etc.) on older NetBSD versions thatnia1-43/+24
request a newer compiler. Stop selecting gcc6, it receives very limited testing due to NetBSD 9 having gcc7, and probably doesn't work due to some newer hardening checks stopping it from building.
2022-04-07Make pkglint happyadam1-2/+2
2022-04-07gcc.mk: gcc8 and gcc9 from pkgsrc do not build on 32-bit netbsd armnia1-1/+12
workaround PR pkg/56679
2022-04-04mk: Fix malformed conditional.jperkin1-2/+2
There's no guarantee that POSSIBLE_GFORTRAN_VERSION is a numeric value, so cannot be compared as such. For example on my macOS it is set to "clang-12 (clang-1205.0.22.9)". This really needs to be normalised correctly at some point.
2022-04-04mk: Cross-eyed hacks to support cross-libtool.riastradh1-2/+2
For a long time, when cross-building, say from native=amd64 to target=powerpc, it was necessary to: 1. cross-build a _powerpc_ package called cross-libtool-base-powerpc, and then 2. install the powerpc package _natively_ with `pkg_add -m x86_64' to override the architecture check that normally forbids this kind of shenanigans, in order to cross-build anything that uses libtool as a tool. This is partly because libtool doesn't follow the normal GNU convention of `./configure --build=<native platform> --host=<platform package will run on> --target=<platform package is configured to operate on>' -- in this example, build=amd64, host=amd64, target=powerpc. Instead, libtool expects to be cross-built itself, even if it's going to run as a tool. It's not as bonkers as it sounds at first: libtool is just a shell script, and it caches various information about the (cross-building!) toolchain it is built with so it can use that information later when it is run as a tool itself to cross-compile other software. To make this work, we need to create the toolchain wrappers for libtool _as if_ we were cross-building even if we are building a native package. So mk/tools uses a new flag TOOLS_USE_CROSS_COMPILE instead of USE_CROSS_COMPILE, and libtool internally sets MACHINE_ARCH=${TARGET_ARCH} (in the example above, powerpc) to make it look like we're cross-building. The new TOOLS_CROSS_DESTDIR is an alias for the (defaulted) CROSS_DESTDIR, which must now be set unconditionally in mk.conf in order for libtool to know where the cross-destdir will be; _CROSS_DESTDIR remains empty when building any native packages (including the native cross-libtool package). Finally, we need to make the resulting package be a native package, with MACHINE_ARCH set to the one that it will be installed on (in the example above, amd64), so I added an indirection _BUILD_DEFS.${var} to replace var on its own in the build definitions that get baked into the package, shown by `pkg_info -B'. Setting _BUILD_DEFS.MACHINE_ARCH=${NATIVE_MACHINE_ARCH} ensures that this mutant hybrid cross-built libtool still produces a native package. All of this logic is gated on setting USE_CROSS_COMPILE in mk.conf or LIBTOOL_CROSS_COMPILE in the package makefile, so it should be safe for non-cross-builds -- when USE_CROSS_COMPILE=no and you're not building cross-libtool, everything is as before.
2022-04-02gfortran: Correct notion of check. All pkgsrc gccs before version 10 arenia1-3/+7
broken on 32-bit arm.
2022-04-02gfortran.mk: Use gcc version 10 on all arm-type netbsds.nia1-3/+5
2022-03-13mk: MKPIE is not GCC-specific. Should help ObjC packages.nia2-10/+16
2022-01-30compiler/clang.mk: do not disable PIE supportwiz1-6/+1
joerg says clang has the same interface for this like gcc
2022-01-19Emit a warning when PKGSRC_MKPIE==yes but PKGSRC_COMPILER==clangpho1-1/+6
Prior to this change PKGSRC_MKPIE was silently ignored when clang was chosen for the compiler, i.e. executables were never built as PIE. This became an error after introducing a post-build check for it. Of course we should add a MKPIE support for clang, but for now we just emit a warning. Otherwise we cannot build packages such as devel/gnustep-base which requires clang to build.
2022-01-18Add a package-settable variable PKGSRC_OVERRIDE_MKPIEpho1-1/+3
This is needed by packages that require hand-holding in building PIE. Also a post-build check for MKPIE is performed by default when PKG_DEVELOPER=YES.
2021-12-22mk: Set the default page size when compiling with RELRO with GCC onnia1-1/+5
NetBSD/mips. PR pkg/56559
2021-12-19mk/compiler: Return the cwrappers stuff for RELRO now that it doesn'tnia2-2/+6
cause any noticable breakage.
2021-11-29mk: Use OPSYS_VERSION where appropriate.jperkin1-3/+3
Should improve readability and in some cases avoid potential failure due to string comparisons being used. No other functional change intended.
2021-11-07mk: revert RELRO default and cease use of wrappers until some morenia2-6/+2
substantial changes to infrastructure and testing can be performed to ensure it's applied universally without breaking anything
2021-11-06mk: Correct the wrappers invocation for RELRO. This should help manynia2-4/+6
remaining packages that fail to build with RELRO that were uncaught by my original bulk builds due to CHECK_RELRO failing to work (sorry...)
2021-11-02mk: Make it possible for a package to fall back to partial RELRO.nia2-10/+12
This helps certain X.Org modules.
2021-10-08gcc.mk: Avoid matching gcc2, gcc3.nia1-96/+8
2021-10-04mk: omit space between -z and relronia2-6/+6
prevents mangling by wrappers in mysterious circumstances
2021-10-01Prune gcc34, gcc44.nia1-35/+5
2021-08-03clang.mk: add support for PKGSRC_USE_SSP=strongnia1-1/+3
2021-08-03gcc.mk: Add support for MKPIE when compiling Fortran code.nia1-1/+5
PR pkg/56337
2021-08-01gcc.mk: Remove bogus test for NetBSD.nia1-4/+2
2021-04-25various fixes for arm64 big endian support.mrg1-2/+2
most of these simply extend matching from "aarch64" to "aarch64eb" in various forms of code. most remaining uses in pkgsrc of "MACHINE_ARCH == aarch64" are because of missing aarch64eb support, such as most of the binary-bootstrap requiring languages like rust, go, and java. no pkg-bump because this shouldn't change packages on systems that could already build all of these.
2021-04-06mk: Remove lingering gcc5 referencenia1-4/+2
2021-04-02mk: Remove gcc44 bitsnia1-35/+5
2021-04-02mk: use gcc6-aux for adania1-9/+9
2021-04-02mk: Remove references to gcc48/gcc49, as done elsewhere herenia1-6/+2
2021-02-04mk/compiler/gcc.mk: Remove stray mid-line \gdt1-2/+2
(Apparently left over from reducing the vast number of gcc versions.)
2021-01-17g/c gcc48, gcc49, gcc5 logicmaya1-77/+6
2021-01-17If the base GCC isn't enough, and GCC_REQD=4.5 to 6, use gcc6.maya1-32/+5
gcc4.8,4.9,5 have bugs preventing them from being useful within pkgsrc for the primary use case that finds them handy: glibc + FORTIFY + those GCC versions = build failures. Additionally, requiring fewer versions of GCC is an improvement for the vast majority of use-cases considered. We might want to bump this further than gcc6 later on, but this is a big improvement for CentOS builds.
2020-12-05mk: fix a duplicate GCC9 variable to refer to GCC10 insteadwiz1-2/+2
Noted by Jackson Bryn in PR 55842.
2020-10-28mk: expand _USE_GCC_SHLIB section to gcc9/gcc10wiz1-2/+7
2020-10-20mk/compiler/gfortran.mk: bump default from gcc9 to gcc10 on current aarch64tnn1-1/+6
lang/gcc8 has patches for NetBSD/aarch64 and lang/gcc10 has support mostly upstreamed. Nobody seems interested in fixing gcc9, but the pkgsrc logic defaults to it when the system compiler is GCC 9 which leads to broken fortran packages. Let's just skip forward to gcc10.
2020-10-06mk: fix undefined variables for current make running in -dL moderillig1-2/+4
In lint mode, NetBSD's make is stricter about undefined variables. In conditions, the function arguments must be fully defined.
2020-09-21Xcode 12 (or its associated Command Line Tools) ships with default-onschmonz1-1/+11
-Werror=implicit-function-declaration, which will be great someday when we're ready for it. Until then, on macOS, detect this situation and tell the cc wrapper to prepend -Wno-error=implicit-function-declaration. Taking mail/qmail as our example, this fixes the build on Catalina with "Apple clang version 12.0.0 (clang-1200.0.32.2)". Adding -Werror=implicit-function-declaration to CPPFLAGS or CFLAGS (in mk.conf or on the command line) re-fails the build, as expected, with a pile of "error: implicit declaration of function". Also as expected, a full -Werror fails earlier on one of the many other problems with qmail's code. For clang on non-macOS platforms, no change. clang-and-wrapper-ok: joerg@ during-the-freeze-ok: gdt@
2020-09-02mk/compiler: Support GCC_REQD=9 or 10ryoon1-4/+71
A pert of PR pkg/55637.
2020-06-02mk/compiler.mk: check for too late GCC_REQD and USE_LANGUAGESrillig1-1/+4
For USE_LANGUAGES there is already a pkglint warning, but for GCC_REQD it is missing. It's better to have this check directly in the infrastructure since it is more reliable. This check is disabled by default, to not cause any new breakage. It should be enabled in bulk builds.
2020-05-31mk/compiler: Set -fcommon for GCC 10sjmulder1-1/+4
As with clang. Default got flipped with v10.
2020-05-30mk/compiler: Fix version check for GCC 10sjmulder1-2/+2
Caused SSP flags to be omitted in GCC 10. Check flipped because all new GCC versions can be expected to support it.