Commit graph

379 commits

Author SHA1 Message Date
nia
9876104df1 mk: Remove lingering gcc5 reference 2021-04-06 12:07:57 +00:00
nia
5cae70c75a mk: Remove gcc44 bits 2021-04-02 17:04:17 +00:00
nia
54b7655c2e mk: use gcc6-aux for ada 2021-04-02 16:54:48 +00:00
nia
51a9ce2ba7 mk: Remove references to gcc48/gcc49, as done elsewhere here 2021-04-02 11:48:16 +00:00
gdt
4f45f1c3c4 mk/compiler/gcc.mk: Remove stray mid-line \
(Apparently left over from reducing the vast number of gcc versions.)
2021-02-04 21:45:13 +00:00
maya
23ad232dfc g/c gcc48, gcc49, gcc5 logic 2021-01-17 16:05:48 +00:00
maya
9c62045f83 If the base GCC isn't enough, and GCC_REQD=4.5 to 6, use gcc6.
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.
2021-01-17 15:32:00 +00:00
wiz
6ea199b786 mk: fix a duplicate GCC9 variable to refer to GCC10 instead
Noted by Jackson Bryn in PR 55842.
2020-12-05 09:24:00 +00:00
wiz
8bb51a1d49 mk: expand _USE_GCC_SHLIB section to gcc9/gcc10 2020-10-28 13:19:25 +00:00
tnn
2f1875f990 mk/compiler/gfortran.mk: bump default from gcc9 to gcc10 on current aarch64
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-20 19:35:07 +00:00
rillig
c44518e90f mk: fix undefined variables for current make running in -dL mode
In lint mode, NetBSD's make is stricter about undefined variables.  In
conditions, the function arguments must be fully defined.
2020-10-06 17:36:50 +00:00
schmonz
36b0b26e17 Xcode 12 (or its associated Command Line Tools) ships with default-on
-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-21 13:09:21 +00:00
ryoon
e00f3c4739 mk/compiler: Support GCC_REQD=9 or 10
A pert of PR pkg/55637.
2020-09-02 16:16:43 +00:00
rillig
c42fb662dc mk/compiler.mk: check for too late GCC_REQD and USE_LANGUAGES
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-06-02 06:58:13 +00:00
sjmulder
a376838f3a mk/compiler: Set -fcommon for GCC 10
As with clang. Default got flipped with v10.
2020-05-31 00:00:13 +00:00
sjmulder
9014f3f496 mk/compiler: Fix version check for GCC 10
Caused SSP flags to be omitted in GCC 10. Check flipped because all new
GCC versions can be expected to support it.
2020-05-30 22:45:36 +00:00
joerg
7134516a02 Adjust last to really prepend in the case of cwrappers. 2020-04-17 13:36:26 +00:00
joerg
76dab5b3cc clang 10 defaults to -fno-common with significant fallout in pkgsrc.
Override that by prepending -fcommon.
2020-04-17 13:35:36 +00:00
nia
73411e4b5f mk/compiler: Make gfortran the default fortran compiler.
Discussed on tech-pkg@ before freeze.
2020-03-30 09:39:24 +00:00
gdt
555a3776ae mk/compiler/gfortran.mk: Add comment about gcc 4.8 handling
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-26 12:44:46 +00:00
gdt
19ce42d824 mk/compiler/gfortran.mk: Fix bugs in version selection
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-26 12:42:02 +00:00
nia
f4ab3d48e8 mk: default to gfortran on aarch64, there's no g95 for aarch64 2020-03-14 10:00:37 +00:00
maya
400c25c7eb Match indentation. 2020-03-07 15:19:20 +00:00
maya
ea06e5b0d2 Test that the lang/gccN exists before defaulting to N as the gfortran version.
Issue most immediately obvious when trying GCC 9, but probably applies to
some other versions as well.
2020-03-07 15:18:19 +00:00
bacon
fe59885718 mk/compiler/gfortran: Default to same major version as base GCC
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.
2020-02-26 15:58:20 +00:00
rillig
1604275256 mk/compiler/gcc.mk: reorder variables in _VARGROUPS section
By listing the public variables first, the focus is put on the most
important variables.
2019-09-19 06:46:59 +00:00
rillig
95fe8ca6c6 mk/compiler/gcc.mk: add missing variables to _VARGROUPS section 2019-09-18 06:46:13 +00:00
rillig
fe8d2392e3 mk/compiler/gcc.mk: search for GCCBASE/bin/gcc as well
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-18 06:35:12 +00:00
rillig
d7f638ee99 mk/compiler: replace complicated :M_asdf_ modifier with :[1]
The :[1] modifier has been added to bmake in 2006.
2019-09-18 06:15:13 +00:00
rillig
e8b4d71240 mk/compiler/gcc.mk: refactoring for PKGPATH comparison
Since PKGPATH can only ever consist of a single path, there is no point
in applying the :M modifier to it.
2019-09-08 09:24:52 +00:00
rillig
a504a7a55a mk/compiler/gcc.mk: improve _VARGROUPS section 2019-09-07 22:20:32 +00:00
rillig
22bac2bbe2 mk/compiler/gcc.mk: update _VARGROUPS 2019-09-07 07:10:15 +00:00
rillig
0ff5dc4a46 mk: use a single form for headings in the documentation comments 2019-09-02 02:23:02 +00:00
ryoon
a73d906dd6 Do not pass -std=c++03 to GCC 4.4
No objection on tech-pkg@.
2019-07-15 16:06:19 +00:00
riastradh
14df6bc748 aarch64 has no compiler flag for ABI=64. 2019-07-09 15:46:02 +00:00
riastradh
2f9efeb223 Avoid passing _CC as cross-compiler to recursive makes.
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-07-09 15:45:46 +00:00
rillig
21c0a41a76 mk: fix pkglint warnings about ambiguous variables
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-04-20 16:32:42 +00:00
wiz
da5215fd50 Add RELRO support for clang, based on the gcc logic. 2019-01-09 13:19:03 +00:00
jperkin
71e098497c mk: Add CTF infrastructure support.
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-11-12 14:22:58 +00:00
abs
c025aae024 Don't rely on gcc version fallthrough for GCC_REQD+=8
(Thanks to eagle eyes from leot@)
2018-10-29 11:53:18 +00:00
abs
2c974aa3c5 Add GCC_REQD+=8 support to compiler/gcc.mk 2018-10-28 22:22:19 +00:00
abs
752fb11aed Support single digit GCC_REQ values (5, 6 or 7)
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-09 15:02:48 +00:00
rillig
b353c90862 Remove trailing whitespace 2018-10-08 20:02:17 +00:00
maya
6c25dec844 Remove clauses 3,4 from TNF-only copyright blocks.
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-08-22 20:48:36 +00:00
jperkin
593ba9f18c mk/compiler/gcc.mk: Darwin needs _USE_GCC_SHLIB too. 2018-07-11 11:11:52 +00:00
wiz
b621cbd744 mk/compiler/gcc.mk: move _GCC_LDFLAGS setting for relro.
At the previous location it was overridden if a gcc from pkgsrc was used.

Problem found by bacon@
2018-05-24 05:47:21 +00:00
jperkin
d8bb1d8957 mk: Fix GCC PKGPATH matches. 2018-05-23 10:17:58 +00:00
jperkin
512dfdee29 mk: Add USE_PKGSRC_GCC_RUNTIME gcc7-libs support. 2018-05-23 08:11:59 +00:00
khorben
fd7a4f25a3 Also append the CFLAGS for MKPIE for c++(1)
From spz@, thanks!
2017-11-29 22:55:15 +00:00
khorben
542893c887 Revert "Always add "-fPIC" when linking with PKGSRC_MKPIE"
It seems to break emulators/qemu.
2017-11-15 19:04:24 +00:00