15 Commits

Author SHA1 Message Date
Jan Beich
b40aa97071 Mk/Features: WITH_PIE - add cmake support
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
2024-05-14 10:39:24 +02:00
Gleb Popov
c2afef5c25 Features/testing.mk: Introduce the TESTING_UNSAFE knob.
Approved by:	tcberner
2024-03-01 22:26:53 +03:00
Gleb Popov
d7700ff7fd Framework: Introduce testing feature
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
2024-02-29 09:07:11 +03:00
Piotr Kubaj
1b286170da Mk/Features/lto.mk: explicitly disable LTO for Rust when LTO_UNSAFE
Some ports enable LTO in Cargo.toml and need -C lto=no
being passed to disable it.
2024-02-11 12:48:55 +01:00
Gleb Popov
2c24a73ff2 Features/debuginfo.mk: Automatically generate a subpackage with debugging info.
Differential Revision: https://reviews.freebsd.org/D43515

Tested by:	flo
Approved by:	portmgr, emaste
2024-02-03 09:31:13 +03:00
Olivier Cochard
0592024317 features: Add support to enable sanitizers
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
2024-01-18 21:13:43 +01:00
Piotr Kubaj
2059b93bb8 Mk/Features/lto.mk: allow LTO on powerpc64 2023-08-10 22:02:29 +02:00
Gleb Popov
37b6619345 Uses/cabal.mk: Add support for LTO feature.
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>
2023-02-27 21:11:10 +03:00
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