From 6fc8ee4fa695940657da550101ed79da923fb0fe Mon Sep 17 00:00:00 2001 From: jperkin Date: Mon, 12 Nov 2018 14:22:58 +0000 Subject: 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. --- mk/platform/FreeBSD.mk | 3 ++- mk/platform/SunOS.mk | 13 +++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'mk/platform') diff --git a/mk/platform/FreeBSD.mk b/mk/platform/FreeBSD.mk index fac7fc22486..973b6ed645c 100644 --- a/mk/platform/FreeBSD.mk +++ b/mk/platform/FreeBSD.mk @@ -1,4 +1,4 @@ -# $NetBSD: FreeBSD.mk,v 1.36 2017/10/03 13:18:00 jperkin Exp $ +# $NetBSD: FreeBSD.mk,v 1.37 2018/11/12 14:22:58 jperkin Exp $ # # Variable definitions for the FreeBSD operating system. @@ -77,6 +77,7 @@ PKG_HAVE_KQUEUE= # defined _OPSYS_SUPPORTS_SSP= yes .endif +_OPSYS_SUPPORTS_CTF= yes # Compact Type Format conversion. _OPSYS_SUPPORTS_CWRAPPERS= yes _OPSYS_CAN_CHECK_SHLIBS= yes # use readelf in check/bsd.check-vars.mk _OPSYS_CAN_CHECK_SSP= no # only supports libssp at this time diff --git a/mk/platform/SunOS.mk b/mk/platform/SunOS.mk index c7cd4837fca..bd7f920bbd1 100644 --- a/mk/platform/SunOS.mk +++ b/mk/platform/SunOS.mk @@ -1,4 +1,4 @@ -# $NetBSD: SunOS.mk,v 1.78 2018/11/05 19:26:38 schmonz Exp $ +# $NetBSD: SunOS.mk,v 1.79 2018/11/12 14:22:58 jperkin Exp $ # # Variable definitions for the SunOS/Solaris operating system. @@ -127,13 +127,10 @@ _OPSYS_INCLUDE_DIRS?= /usr/include _OPSYS_SUPPORTS_CWRAPPERS= yes .endif -# support FORTIFY (with GCC) -_OPSYS_SUPPORTS_FORTIFY=yes - -# support stack protection (with GCC) -_OPSYS_SUPPORTS_SSP?= yes - -_OPSYS_CAN_CHECK_SHLIBS= yes # requires readelf +_OPSYS_SUPPORTS_CTF= yes # Compact Type Format conversion. +_OPSYS_SUPPORTS_FORTIFY= yes # Requires GCC +_OPSYS_SUPPORTS_SSP?= yes # Requires GCC +_OPSYS_CAN_CHECK_SHLIBS= yes # Requires readelf # check for maximum command line length and set it in configure's environment, # to avoid a test required by the libtool script that takes forever. -- cgit v1.2.3