summaryrefslogtreecommitdiff
path: root/mk/compiler
AgeCommit message (Collapse)AuthorFilesLines
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.
2020-04-17Adjust last to really prepend in the case of cwrappers.joerg1-2/+3
2020-04-17clang 10 defaults to -fno-common with significant fallout in pkgsrc.joerg1-3/+3
Override that by prepending -fcommon.
2020-03-30mk/compiler: Make gfortran the default fortran compiler.nia2-13/+2
Discussed on tech-pkg@ before freeze.
2020-03-26mk/compiler/gfortran.mk: Add comment about gcc 4.8 handlinggdt1-1/+4
The code maps gcc-4.8.x to "4", and then won't find gcc4. This is a bug, but it may be that it's just as well to never match 4.X of any kind, and use 7 anyway. Explain this issue with a \todo to fix the bug or document the consequences as intended. (This is a comment-only change.)
2020-03-26mk/compiler/gfortran.mk: Fix bugs in version selectiongdt1-3/+3
Adjust regexp that removes .Y.Z from gcc-X.Y.Z. Test for gcc being contained in PKGSRC_COMPILER, vs ==, so that a value of "ccache gcc" is handled properly. (ok for mk during freeze jperkin@)
2020-03-14mk: default to gfortran on aarch64, there's no g95 for aarch64nia2-2/+10
2020-03-07Match indentation.maya1-2/+2
2020-03-07Test that the lang/gccN exists before defaulting to N as the gfortran version.maya1-3/+6
Issue most immediately obvious when trying GCC 9, but probably applies to some other versions as well.
2020-02-26mk/compiler/gfortran: Default to same major version as base GCCbacon1-2/+9
GFORTRAN_VERSION should match CC_VERSION as closely as possible for ABI compatibility. This update tries to match GFORTRAN_VERSION to CC_VERSION if the base compiler is GCC. If base compiler is not GCC, default to a mainstream version likely to work with base clang/llvm.
2019-09-19mk/compiler/gcc.mk: reorder variables in _VARGROUPS sectionrillig1-12/+13
By listing the public variables first, the focus is put on the most important variables.
2019-09-18mk/compiler/gcc.mk: add missing variables to _VARGROUPS sectionrillig1-5/+9
2019-09-18mk/compiler/gcc.mk: search for GCCBASE/bin/gcc as wellrillig1-1/+6
A default installation of GCC doesn't install bin/cc but only bin/gcc. Adding bin/cc is only done by the pgksrc packages, not by the upstream package. The previous strategy of just checking whether ${GCCBASE}/bin/${CC:[1]} exists did not work in such a situation. Therefore, if CC still has its default value from sys.mk, that is changed to the intended gcc, which then detects the base GCC properly. See https://mail-index.netbsd.org/pkgsrc-users/2019/09/07/msg029329.html. See https://mail-index.netbsd.org/tech-pkg/2019/09/18/msg021976.html.
2019-09-18mk/compiler: replace complicated :M_asdf_ modifier with :[1]rillig1-4/+4
The :[1] modifier has been added to bmake in 2006.
2019-09-08mk/compiler/gcc.mk: refactoring for PKGPATH comparisonrillig1-16/+16
Since PKGPATH can only ever consist of a single path, there is no point in applying the :M modifier to it.
2019-09-07mk/compiler/gcc.mk: improve _VARGROUPS sectionrillig1-27/+24
2019-09-07mk/compiler/gcc.mk: update _VARGROUPSrillig1-6/+46
2019-09-02mk: use a single form for headings in the documentation commentsrillig1-3/+3
2019-07-15Do not pass -std=c++03 to GCC 4.4ryoon2-2/+14
No objection on tech-pkg@.
2019-07-09aarch64 has no compiler flag for ABI=64.riastradh1-1/+4
2019-07-09Avoid passing _CC as cross-compiler to recursive makes.riastradh1-1/+5
This way we don't inadvertently tell a native dependency that it is supposed to be compiled with the cross-compiler. No functional change intended for USE_CROSS_COMPILE=no.
2019-04-20mk: fix pkglint warnings about ambiguous variablesrillig1-2/+2
When a Makefile fragment contains $0, this means a Makefile variable, not a shell or AWK variable. The bug in ccc.mk survived unnoticed for almost 15 years. The bug in gnu-configure.mk for MirBSD got only half as old.
2019-01-09Add RELRO support for clang, based on the gcc logic.wiz1-1/+15
2018-11-12mk: Add CTF infrastructure support.jperkin2-2/+6
Platform support is determined by _OPSYS_SUPPORTS_CTF from mk/platform, the user enables support by setting PKGSRC_USE_CTF=yes, and packages can explicitly disable support with CTF_SUPPORTED=no or skip certain files with CTF_FILES_SKIP. The path to ctfconvert is configured via TOOLS_PLATFORM.ctfconvert. If all of the requisite variables are enabled, a compiler-specific debug flag is passed via the wrappers to ensure we have DWARF information to convert, _INSTALL_UNSTRIPPED is explicitly defined to avoid binaries being stripped prior to conversion, and the conversion is performed during the install stage. It is recommended that users who enable the feature also set STRIP_DEBUG=yes to reduce the final binary size once the conversion has been performed. This has been used for the past year in Joyent SmartOS builds. FreeBSD is marked as supported but is untested.
2018-10-29Don't rely on gcc version fallthrough for GCC_REQD+=8abs1-2/+2
(Thanks to eagle eyes from leot@)
2018-10-28Add GCC_REQD+=8 support to compiler/gcc.mkabs1-4/+38
2018-10-09Support single digit GCC_REQ values (5, 6 or 7)abs1-9/+9
Do not add 4 to avoid confusion between gcc44/48/49 Also switch USE_PKGSRC_GCC_RUNTIME checks to use _GCC_PKGBASE to match against selected gcc
2018-10-08Remove trailing whitespacerillig1-2/+2
2018-08-22Remove clauses 3,4 from TNF-only copyright blocks.maya7-56/+7
This is based on the decision The NetBSD Foundation made in 2008 to do so, which was already applied to src. This change has been applied to code which is likely not in other repositories. ok board@, reviewed by riastradh@
2018-07-11mk/compiler/gcc.mk: Darwin needs _USE_GCC_SHLIB too.jperkin1-2/+3
2018-05-24mk/compiler/gcc.mk: move _GCC_LDFLAGS setting for relro.wiz1-6/+6
At the previous location it was overridden if a gcc from pkgsrc was used. Problem found by bacon@