Use cmake specific options to enable position independent code generation.
This fixes several ports (at least multimedia/cmrtlib, math/blas and
math/lapack) which are build with cmake when WITH_PIE is enabled.
PR: 268981
Approved by: portmgr
Setting WITH_TESTING=yes will cause running `make test` between `stage` and
`package` in the default pipeline.
This feature is off by default.
Sponsored by: Serenity Cybersecurity, LLC
Can be activated/deactivated globally via
WITH_SANITIZE
Can be activated individualy via
WITH_SANITIZE_PORTS
Each port can individually mark itself as not supporting the feature
via SANITIZE_UNSAFE=
Approved by: bapt, arrowd
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43497
Haskell code benefits greatly from splitting functions into distinct ELF
sections and then letting the linker to garbage-collect them.
devel/hs-haskell-language-server port goes from 277MiB to 176MiB in size.
net-p2p/cardano-node ports goes 302MiB -> 76.2MiB
Relevant blog post: http://brandon.si/code/linking-smaller-haskell-binaries/
Reported by: Greg Steuck <greg@nest.cx>
As usual with features, this can be activated/deactivated via
WITH/WITHOUT_<feature>
Each port can individually mark itself as not supporting the feature
via <feature>_UNSAFE=
Add checks for powerpc64 and riscv64 since they won't work with LTO.
This is a bit crude on powerpc64 but can be improved upon later.
LTO does work on this platform using GCC but will fail using lld.
This commit also introduces LTO_DISABLE_CHECK which can be used to
override.
Reviewed by: pkubaj (private email)
Use corresponding toggles for each build framework to enable LTO
Reviewed by: pkubaj (maintainer)
Differential Revision: https://reviews.freebsd.org/D36696
Make the definition of WITH_ variable (end user actionable) a define
via a generic code
Move the WITH_DEBUG code into its own file Features/debug.mk
Replace USE_LTO into WITH_LTO and move it into Features/lto.mk
Move WITH_SSP into its own Features/ssp.mk
Add a variable to defined which one are activated by default (here SSP)
Reviewed by: portmgr (tcberner)
Differential Revision: https://reviews.freebsd.org/D35873