Commit Graph

7 Commits

Author SHA1 Message Date
Baptiste Daroussin 70070f043c Features/pie: allow static-pie:
Add a variable to ease passing arguments necessary to build static pie files
2023-01-19 11:51:05 +01:00
Daniel Engberg c447a044bb Mk/Features/lto.mk: Use DEV_WARNING instead of IGNORE
Instead of using IGNORE issue a warning via DEV_WARNING instead.
Change suggested by tobik

Reviewed by:	pkubaj (via private mail)
2023-01-06 20:30:53 +01:00
Baptiste Daroussin cc0e861e23 hardening: add relro and bind_now features
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=
2022-10-26 10:34:03 +02:00
Jatin Kataria c6e7c894c6 features: Add support to build ports as PIE executables.
This will allow utilization of ASLR provided by the kernel.

Sponsored by:	Netflix
2022-10-26 10:22:12 +02:00
Daniel Engberg 46898c7c8e Mk/Features/lto.mk: Add checks for powerpc64 and riscv64
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)
2022-09-30 12:12:18 +02:00
Daniel Engberg 83a19a60d1 Mk/Features/lto.mk: Use Cargo and Meson toggles
Use corresponding toggles for each build framework to enable LTO

Reviewed by:	pkubaj (maintainer)
Differential Revision:	https://reviews.freebsd.org/D36696
2022-09-26 23:57:18 +02:00
Baptiste Daroussin b26839acc2 framework: generalize WITH_ code
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
2022-07-27 15:21:32 +02:00