Commit graph

323 commits

Author SHA1 Message Date
brook
590147deae Add logic so GCC_REQD+=7.x works. 2017-07-18 18:27:31 +00:00
joerg
03f704711c Retire CLANG_NO_VALUE_PROPAGATION_PASS. CVP has been fixed in LLVM to
require much less memory.
2017-07-11 19:41:20 +00:00
khorben
e519f07826 Register support for PKGSRC_USE_STACK_CHECK
This adds -fstack-check to the CFLAGS (with GCC on NetBSD x86). Only
tested on NetBSD/amd64 so far.

Disabled by default.
2017-07-09 14:30:07 +00:00
joerg
5f789069ad Fix typo. 2017-06-25 01:41:15 +00:00
kamil
0e21766de5 Correct ccache(1) typo: CPPATH -> CPPPATH 2017-06-17 02:47:20 +00:00
kamil
df999dfb68 Correct shadowing system compiler with a pkgsrc one in ccache
ccache needs to call real compiler and it detects it with looking in $PATH.
In case of usage of /usr/local/bin/clang as the desired pkgsrc $CC option,
it will be shadowed by /usr/pkg/bin/clang if someone will build it in as a
package. Workaround the problem with setting CCACHE_PATH through
PKGSRC_MAKE_ENV. Little bit overzelaously set it to
${CCPATH:H}:${CXXPATH:H}:${CPPATH:H}, just in case that they might be in
different paths. To ensure that they are not shadowed in narrow cases,
there is an option to rename clang to xclang or similar and use it this
way in $PKG_CC.

While there, introduce new user settable option: CCACHE_LOGFILE.
If set, ccache logs to file specified in ${CCACHE_LOGFILE:Q}.

+# CCACHE_LOGFILE
+#       If set to a file path, ccache will write information on what it is
+#       doing to the specified file. This is useful for tracking down
+#       problems.

This fixes another set of problems building large projects like Clang, LLVM
with ccache.

Sponsored by <The NetBSD Foundation>
2017-06-17 01:44:54 +00:00
jperkin
c657f15637 Consolidate setting of SSP flags now that multiple compilers support it. 2017-05-18 08:14:08 +00:00
khorben
8b017f6b3a Register support for SSP on FreeBSD and clang (on x86 architectures)
Support for SSP (Stack-Smashing Protection) is optional so this should not
affect default builds.

Tested on FreeBSD/amd64 (10.3-RELEASE-p11)
2017-05-18 01:29:55 +00:00
joerg
8b20e378ad Add GCC_VERSION_SUFFIX, which can be used i.e. on SuSE systems to select
between different compiler versions.
2017-05-04 18:44:12 +00:00
khorben
4211ac7e85 Add granularity to PKGSRC_USE_FORTIFY and PKGSRC_USE_RELRO
The new options are, for FORTIFY:
  "no"     Do not pass any flags for FORTIFY
  "weak"   Pass -D_FORTIFY_SOURCE=1
  "strong" Pass -D_FORTIFY_SOURCE=2

This allows users to reduce the level of FORTIFY specified if necessary
or desired. The previous setting as "yes" is now equivalent to "strong"
(the default when enabling).

The new options are, for RELRO:
  "no"      Do not pass any flags for RELRO
  "partial" Pass -Wl,-z,relro
  "full"    Pass -Wl,-z,relro -Wl,-z,now

This allows users to reduce the level of RELRO specified if necessary or
desired. The previous setting as "yes" is now equivalent to "full" (the
default when enabling).

This is intended to match the changes committed by jperkin@ (for SSP)
after our discussion a (long) while back.

No functional change intended (with the settings supported so far).
2017-04-16 23:12:37 +00:00
jperkin
4c279ad5d4 Let GCC 4.4 handle requests for GCC 4.[0-4] to ensure we are consistent in
using the closest match for each request, as well as fixing platforms where
GCC 6 does not yet build or is unsupported.
2017-04-10 12:22:07 +00:00
kamil
142e04fc75 Fix path to cross-libtool-base in f2c.mk for crossbuilding 2017-03-05 10:40:18 +00:00
maya
2ab36e5237 Remove last mentions of gcc45,46,47 in mk/.
No functional change intended.
2016-12-29 23:16:26 +00:00
maya
bc1d2b7489 Remove some of the mentions for gcc{45,46,47}.
No functional change intended.
Still a few left.
2016-12-29 23:07:17 +00:00
maya
e2f57f6d5e Make GCC_REQD+= 4.5 to 4.8 resolve to 4.8 (dropping the possibility to
match for 4.5, 4.6, 4.7, which will soon be dropped).

This commit is the functional change. Cleanup will be done in separate
commits.
2016-12-29 22:21:13 +00:00
marino
e7a91fc2fa Upgrade USE_LANGUAGES=ada to use lang/gcc5-aux instead of lang/gcc-aux
This large commit accomplishes the following:

1) Switch USE_LANGUAGES=ada to require lang/gcc5-aux (gcc 5.4) instead
   of lang/gcc-aux (gcc 4.9.2) on gcc.mk
2) Bump affected ports and fix paths as necessary
3) Upgrade devel/gprbuild to the latest release
   - No longer requires lang/gnat_util
   - gprslave requires gcc6-aux, so it was disabled for now
4) Fix lang/gnat_util but set PKG_SKIP_REASON
   - It has no further purpose in the pkgsrc tree
   - It has no practical purpose outside of the pkgsrc tree
   - Indicate intent to remove from tree in Jan. 2017
5) Set devel/GPS as failed with PKG_FAIL_REASON
   - This version of GPS is several years old and at the time they were
     strongly tied to compiler.
   - Latest release of GPS require gcc6-aux (not available) and several
     new and complex dependencies
   - maintainer (me) has no interest to continue supporting it
   - Leaving GPS in place until Jan 2017 to give another person chance to
     upgrade and take over support
   - Latest version in FreeBSD Ports Collection as a reference point
2016-11-25 20:36:49 +00:00
jperkin
c034060ef5 Fix mips ABI setup which cannot have possibly worked for a long time. 2016-10-10 08:26:08 +00:00
maya
7068769a8f Add logic so GCC_REQD+=6.x works
ok jperkin@
2016-09-13 07:59:15 +00:00
maya
3a3ad52105 Introduce GFORTRAN_VERSION, pick which version of gfortran is used.
modified patch from Rin Okuyama
PR pkg/50722: do not hardcode lang/gcc48 in gfortran.mk

"looks ok, needs docs" - wiz
"it'll do for now, ideally I'd like something more robust and possibly
integrate into gcc.mk's path selection" - jperkin
2016-09-12 12:18:13 +00:00
dholland
f39f6090b1 Remove obsolete anti-cycle logic; fixes PR 48961. 2016-07-09 17:12:22 +00:00
jperkin
c02e752f64 Change PKGSRC_USE_SSP to a quad option. The options are now:
"no"     Do not pass any stack protection flags (the default)
   "yes"    Pass -fstack-protector
   "strong" Pass -fstack-protector-strong
   "all"    Pass -fstack-protector-all

This allows users to configure the level of stack smashing protection they
require, and ensures consistent behaviour across platforms.  Users running
on NetBSD who previously used the option will need to change "yes" to "all"
to match the previous default configuration for that platform.

While here use _WRAP_EXTRA_ARGS to ensure the flag gets passed regardless
of whether the package honours CFLAGS, and support additional wrappers.

Discussed a while back with khorben, and used in production for the SmartOS
2016Q1 package sets with the "strong" option.
2016-06-13 13:26:42 +00:00
dbj
dde82c09aa update PKG_{FAIL,SKIP}_REASON with += 2016-04-11 04:22:33 +00:00
khorben
03a56367ef Re-arrange support for FORTIFY/MKPIE/RELRO/SSP
- No _GCC_* anything in mk/bsd.prefs.mk;
- No compiler flags in platform files.

Tested again on NetBSD/amd64, with and without cwrappers, with the same
outcome.

With feedback from jperkin@
2016-03-11 23:54:08 +00:00
khorben
dc4ad6b750 Add support for a number of security features
- Revisit (and rename) support for FORTIFY as PKGSRC_USE_FORTIFY (instead
  of PKGSRC_USE_FORT) for easier support outside NetBSD/gcc;
- PKGSRC_USE_SSP is no longer enabled by default when PKGSRC_USE_FORTIFY
  is enabled;
- PKGSRC_MKPIE builds executables as PIE (to leverage userland ASLR)
- PKGSRC_USE_RELRO builds with a read-only GOT to prevent some exploits
  from functioning.

Tested on NetBSD/amd64 by myself, in every combination, with and without
pkgtools/cwrappers. MKPIE is not supported at the moment with cwrappers.
Also, MKPIE is known to still break a number of packages when enabled (and
actually supported).

Tested on SunOS by jperkin@, thank you!

As discussed on tech-pkg@, the default behavior is not changed, except
where noted above.

ok bsiegert@
2016-03-11 23:03:31 +00:00
jperkin
d11ccc0d54 Pass correct GCC ABI flags on AIX.
Fix from Eric N. Vander Weele <ericvw@gmail.com>
2016-03-02 18:45:21 +00:00
jperkin
7002b040bb Remove mk/find-prefix.mk and its usage from the mk infrastructure.
The find-prefix infrastructure was required in a pkgviews world where
packages installed from pkgsrc could have different installation
prefixes, and this was a way for a dependency prefix to be determined.

Now that pkgviews has been removed there is no longer any need for the
overhead of this infrastructure.  Instead we use BUILDLINK_PREFIX.pkg
for dependencies pulled in via buildlink, or LOCALBASE/PREFIX where the
dependency is coming from pkgsrc.

Provides a reasonable performance win due to the reduction of `pkg_info
-qp` calls, some of which were redundant anyway as they were duplicating
the same information provided by BUILDLINK_PREFIX.pkg.
2015-11-25 13:05:47 +00:00
he
076c67fb2c Correction to the previous: we must use ${GREP} -E, there's no ${EGREP} here. 2015-10-09 17:27:09 +00:00
he
d734d0f99c Extend the pattern matching the -v output from pcc. 2015-10-08 21:09:53 +00:00
jperkin
0d3f90c1e9 Ensure the dependency is satisfied by gcc48 rather than potentially pulling
in the gcc48-libs package which isn't supported at this time.
2015-09-11 15:23:21 +00:00
jperkin
46bed0257b Pull in gcc48 as a full dependency. We don't yet have the fine-grained
approach of gcc.mk to only pull in when required, but this fixes a lot of
packages which previously failed check-shlibs.
2015-09-10 19:52:57 +00:00
khorben
ae79ea7d78 Add support for compiling with stack-smashing protection
This is enabled with PKGSRC_USE_SSP in mk.conf(5), as documented there.
Most NetBSD platforms are supported (when compiling with gcc).

After consensus on tech-pkg@.
2015-07-26 22:13:17 +00:00
ryoon
a12c1aca05 Add gcc5 support. 2015-07-16 12:09:04 +00:00
joerg
e653c23aa8 PR 49877: Expand correct variable. From Greg Onufer. 2015-05-03 23:16:41 +00:00
tnn
a0c69e7229 correct MACHINE_ARCH and compiler flags for HP-UX 64-bit ABI 2015-04-27 10:33:49 +00:00
wiz
3edd7dcf75 Finish move of lang/gcc to lang/gcc2.
Let me know if I broke something.
2015-04-25 10:33:29 +00:00
joerg
e7863e1a9d Until there is evidence to the contrary, provide _COMPILER_ABI_FLAG on
all platforms.
2015-04-18 19:53:59 +00:00
jperkin
77f65015b1 Append LIBABISUFFIX to the GCC library path. Fixes Linux and SunOS
multilib systems where it is the default, no change on other platforms.
2015-04-02 23:50:25 +00:00
jperkin
397ff2bff0 Don't include the main GCC libraries in linker paths when using
USE_PKGSRC_GCC_RUNTIME.  Fixes check-shlibs when using the GCC runtime
packages as previously the main libraries were being picked up instead
of the runtime ones we'd asked for.
2015-04-02 23:42:15 +00:00
jperkin
878760eddb Don't recompute _GCC_PREFIX and _GCC_SUBPREFIX in the general case. At
best this does nothing, and at worst it is actively harmful when using
multilib systems.  It's possible the mips case is broken too, but I do
not have any hardware to test that on, so for now leave the special mips
MABIFLAG handling intact.

Fixes multilib SunOS builds.
2015-04-02 23:21:01 +00:00
tnn
96fef8ab60 Extend the list of packages that ccache.mk avoids in order to prevent
circular dependency errors on platforms where most builtins are provided
by pkgsrc.
2015-03-20 17:53:14 +00:00
joerg
8e50ffaa74 LLVM's correlated value propagation pass is known to require a lot of
memory and CPU time for certain input. Provide a variable
(CLANG_NO_VALUE_PROPAGATION_PASS) for selectively disabling it in those
places known to trigger it.
2015-03-02 19:59:06 +00:00
jperkin
02cde34c40 Ensure additional C99 flags are passed via cwrappers too. 2015-02-04 14:11:50 +00:00
dbj
a4e4a24a87 ressurect support for PKGSRC_FORTRAN=gfortran and point it at gcc48
This is useful on x86_64 darwin, which isn't supported by g95
2015-01-27 04:53:46 +00:00
ryoon
f17050927e Add gcc46-libs support code. 2015-01-01 01:33:05 +00:00
joerg
bad8146eae cwrappers should get -Qunused-arguments too. 2014-12-03 14:05:25 +00:00
ryoon
147cedb460 Fix GCC49 pattern.
From richard@, thank you.
2014-11-03 13:06:39 +00:00
ryoon
e470b7e219 Restore monolithic gcc48 and gcc48-libs.
* No objection on tech-pkg@ mailing list.
2014-10-31 14:22:20 +00:00
jperkin
a4c97eaf1e Improve comments around USE_PKGSRC_GCC and GCC_REQD. 2014-09-06 08:32:55 +00:00
jperkin
c564162241 Fix lang/gcc49 dependency logic, based on lang/gcc47. 2014-09-05 22:11:10 +00:00
jperkin
ec9f1b3b4a Add infrastructure support for lang/gcc49 and lang/gcc49-libs 2014-09-04 18:52:53 +00:00