From nobody Fri May 1 02:59:02 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g6G2t56w8z6bbVF for ; Fri, 01 May 2026 02:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g6G2t2txXz4KVP for ; Fri, 01 May 2026 02:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777604342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sAkpLPH0iWU+PTHvp1kvLSVCjg4idOwXylF/Fg/r/Z8=; b=mjMKs6oHSXioLDm0OtmNq5db9bidJlHf7QisNiA2ywL/piURqeFwPnDEsjFTWtKzXZMP42 /wvrrPak1NEqheAubzPXULOl218+9zw2tpHQY8nMGYpwNhV7w5QPqDP29aLrUP7pXONuF+ dSZJnG/6VPXG0I711KYDwbKfvO+LjjnqXuPTE/6ZqeOz1YRSboT0CbHnSZ1feKYlP86mxl N39C843zRnwL/FDwZs0EyjpSfKdMvpAS9JfXw9YP8ElkucVyVFZbiIyi4rBdfnaA1lKHUB T0EfU5fbfI5FLa0PScs9Hdeq/7c/FiOVsDvj5Jt7SoLY/HlERch9XU1wLGcMdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777604342; a=rsa-sha256; cv=none; b=eS1n6PvaDo/MmHJK3nfp62jp24Kkj/9x8zs+mp0NvFMfavaZvuATaS7RSQx63QjpNwTLbC I8qLLZy27KQ0pCP+ZI9Fd1w3pT4UTdv4uPnQ36QZ9CP4QchFX8tuEk7gSdGJWpiBxzz8T6 Xh7K5pjDxkcCPTogBERqpdko1VnRMGxx3cuEGnolYcvf+yIzZ27lM3dsT7ZuMyevMGiyMx c73e5Va1eYdBwBNGhn9E2udH0S+mvwUZHriEnrwvSpr7bQLttQoReWTUZUwfdsfbj/QfMi L9lLvYZxAFIP4xRrdfWzrJc4oOL/BuqaDrC2MYYA7ixYAmmiiQckzM0PhQWOYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777604342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sAkpLPH0iWU+PTHvp1kvLSVCjg4idOwXylF/Fg/r/Z8=; b=yc5cxsk6ZuVI1a7vmUhEfnPb7ZbUKDZTrFPKPvmsCfpU7NdGaqG+bowaFX9y67ROjWG7eg 9LgMN7/oSjpBKl9pZ0CeIHRdYmJq6yV1i7bsqWDBnibFJpoPLy1neifT9CD68azH8D7F+x htFwSo3QXlxMFLJGHDyuP9ZRI12VYNj42qGg/5MYt5Wm2XqWukJ6CoyTYyMq2cEfFA8ipa CSt+OnhtBnlhoMIOgPaKPBqYPWf7aFOU77jQeEAk51Pfnvg5UDdhPsBzBiGlPtoaEt9PN9 2bHLjJmSpmQ/ktXv/JqRxIsF9H/Px9BqeYXUale7WeXFsq/AoUIgVZUOWOW5bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g6G2t2SfTzgCv for ; Fri, 01 May 2026 02:59:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 423b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 01 May 2026 02:59:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: c46a0b590716 - main - build: provide a FORTIFY_SOURCE. override List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c46a0b590716144d772eeba83ca88d96ee12c2f1 Auto-Submitted: auto-generated Date: Fri, 01 May 2026 02:59:02 +0000 Message-Id: <69f416f6.423b6.4efd6213@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=c46a0b590716144d772eeba83ca88d96ee12c2f1 commit c46a0b590716144d772eeba83ca88d96ee12c2f1 Author: Kyle Evans AuthorDate: 2026-05-01 02:57:51 +0000 Commit: Kyle Evans CommitDate: 2026-05-01 02:58:48 +0000 build: provide a FORTIFY_SOURCE. override For native files we can do more minimal fixes to avoid this large of a hammer, but for third party files it may not be worth the effort to try and patch them. NetBSD has the original _FORTIFY_SOURCE implementation that ours is based on, for instance, but tests sourced from there can't do an __ssp_real(foo) without being certain that `foo` actually has a fortified definition. This change does always define _FORTIFY_SOURCE as a result, so gate it on CFLAGS not already containing _FORTIFY_SOURCE definitions. PR: 294881 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56733 --- share/mk/bsd.sys.mk | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 93e7c8572310..5bd8cd3362d1 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -321,9 +321,12 @@ SSP_CFLAGS?= -fstack-protector-strong .endif CFLAGS+= ${SSP_CFLAGS} .endif # SSP -.if ${FORTIFY_SOURCE} > 0 -CFLAGS+= -D_FORTIFY_SOURCE=${FORTIFY_SOURCE} -CXXFLAGS+= -D_FORTIFY_SOURCE=${FORTIFY_SOURCE} + +.if empty(CFLAGS:M-D_FORTIFY_SOURCE*) +CFLAGS+= -D_FORTIFY_SOURCE=${FORTIFY_SOURCE.${.IMPSRC:T}:U${FORTIFY_SOURCE}} +.endif +.if empty(CXXFLAGS:M-D_FORTIFY_SOURCE*) +CXXFLAGS+= -D_FORTIFY_SOURCE=${FORTIFY_SOURCE.${.IMPSRC:T}:U${FORTIFY_SOURCE}} .endif # Additional flags passed in CFLAGS and CXXFLAGS when MK_DEBUG_FILES is