Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK)) by mollari.NetBSD.org (Postfix) with ESMTPS id B10647A200 for ; Thu, 18 May 2017 01:29:57 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id 247DF857BB; Thu, 18 May 2017 01:29:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id A39038556F for ; Thu, 18 May 2017 01:29:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id MRbp4Xnx2HET for ; Thu, 18 May 2017 01:29:56 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 30AFD84D85 for ; Thu, 18 May 2017 01:29:56 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 2B5BAFBE4; Thu, 18 May 2017 01:29:56 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1495070996116590" MIME-Version: 1.0 Date: Thu, 18 May 2017 01:29:56 +0000 From: "Pierre Pronchery" Subject: CVS commit: pkgsrc/mk To: pkgsrc-changes@NetBSD.org Reply-To: khorben@netbsd.org X-Mailer: log_accum Message-Id: <20170518012956.2B5BAFBE4@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1495070996116590 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: khorben Date: Thu May 18 01:29:56 UTC 2017 Modified Files: pkgsrc/mk/compiler: clang.mk pkgsrc/mk/platform: FreeBSD.mk Log Message: 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) To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 pkgsrc/mk/compiler/clang.mk cvs rdiff -u -r1.33 -r1.34 pkgsrc/mk/platform/FreeBSD.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1495070996116590 Content-Disposition: inline Content-Length: 1920 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/compiler/clang.mk diff -u pkgsrc/mk/compiler/clang.mk:1.15 pkgsrc/mk/compiler/clang.mk:1.16 --- pkgsrc/mk/compiler/clang.mk:1.15 Mon Mar 2 19:59:07 2015 +++ pkgsrc/mk/compiler/clang.mk Thu May 18 01:29:55 2017 @@ -1,4 +1,4 @@ -# $NetBSD: clang.mk,v 1.15 2015/03/02 19:59:07 joerg Exp $ +# $NetBSD: clang.mk,v 1.16 2017/05/18 01:29:55 khorben Exp $ # # This is the compiler definition for the clang compiler. # @@ -53,6 +53,21 @@ _COMPILER_LD_FLAG= -Wl, _LINKER_RPATH_FLAG= -R _COMPILER_RPATH_FLAG= ${_COMPILER_LD_FLAG}${_LINKER_RPATH_FLAG} +# The user can choose the level of stack smashing protection. +.if ${PKGSRC_USE_SSP} == "all" +_SSP_CFLAGS= -fstack-protector-all +.else +_SSP_CFLAGS= -fstack-protector +.endif + +.if ${_PKGSRC_USE_SSP} == "yes" +_WRAP_EXTRA_ARGS.CC+= ${_SSP_CFLAGS} +_WRAP_EXTRA_ARGS.CXX+= ${_SSP_CFLAGS} +CWRAPPERS_APPEND.cc+= ${_SSP_CFLAGS} +CWRAPPERS_APPEND.cxx+= ${_SSP_CFLAGS} +CWRAPPERS_APPEND.f77+= ${_SSP_CFLAGS} +.endif + # _LANGUAGES. is ${LANGUAGES.} restricted to the # ones requested by the package in USE_LANGUAGES. # Index: pkgsrc/mk/platform/FreeBSD.mk diff -u pkgsrc/mk/platform/FreeBSD.mk:1.33 pkgsrc/mk/platform/FreeBSD.mk:1.34 --- pkgsrc/mk/platform/FreeBSD.mk:1.33 Sun Dec 4 15:37:41 2016 +++ pkgsrc/mk/platform/FreeBSD.mk Thu May 18 01:29:56 2017 @@ -1,4 +1,4 @@ -# $NetBSD: FreeBSD.mk,v 1.33 2016/12/04 15:37:41 bsiegert Exp $ +# $NetBSD: FreeBSD.mk,v 1.34 2017/05/18 01:29:56 khorben Exp $ # # Variable definitions for the FreeBSD operating system. @@ -63,6 +63,12 @@ SERIAL_DEVICES?= /dev/cuaa0 PKG_HAVE_KQUEUE= # defined .endif +# Register support for SSP on x86 architectures +.if (${MACHINE_ARCH} == "i386") || \ + (${MACHINE_ARCH} == "x86_64") +_OPSYS_SUPPORTS_SSP= yes +.endif + _OPSYS_SUPPORTS_CWRAPPERS= yes _OPSYS_CAN_CHECK_SHLIBS= yes # use readelf in check/bsd.check-vars.mk --_----------=_1495070996116590--