From nobody Sat Jul 13 05:22:56 2024 X-Original-To: dev-commits-src-all@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 4WLcL8528Yz5PvKy; Sat, 13 Jul 2024 05:22:56 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WLcL84GBnz4nLr; Sat, 13 Jul 2024 05:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720848176; 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=/ttodKYNwFqogvcTaIKSWW81hEJiW9WCO46axFm26/s=; b=NWbe8p7fnYoClEmqazmYbA+si4sl8TWOi+OKkbOOcVgoGO1EcdYaSaip3p2jg8SlEuBVsj DiyhxCoK4F/oGGgUSkz2y+kx459Xu2rlNZuTV1N/XuYK/NOsPDsGqdQjvHL+e0FT9xBDgK o3y75A2l0jTVDIPRHDRCWZtR9DahbEJKqiMmlrajfiJ2fZDIxHozYKv8kZfFbhpNNvI8WW aymLWo4NmPC6xqDx6o9dYyWU1csF8e80E3kIcRAjgvZCcHBJk5/zWZ41P3AijReT1iyA8K HCQ8JyFCZqzwgiZtNm3WRDNQ2/dTCtgNXtiqhXOTEj3alDNRHaL2O4WPO0A+GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720848176; a=rsa-sha256; cv=none; b=mwfiPtpxIjgCVWrGYn6rsGpYFofLociFrM7xAmsiUOnhqnUqXHFu0HQfLocL29dQfQKtfJ UqVA6kKKKCZt1TOBSuRXe6tLkuhibeMIJHby0yz4BeCT0VFqHSudhvPdjNzIpWqLyegT21 psNtUZ988ejPntZe9MLW5IW0N5dzt3Uw6t4En+ZotY9DDbnLQttz8zKOel0Fvduwqm6Qn9 RMx5AOXpLV/g7jBcUoO3MN/Hfyqc9/6qFOcFBki9uCO39Lrhg83uDSMkTSgjOhqN/T29Bk zprh4c8Hz8q81j8k1d67n06a2b12371heuCUIxp2hosHOAYV1SfhKhVaiQs5SQ== 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=1720848176; 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=/ttodKYNwFqogvcTaIKSWW81hEJiW9WCO46axFm26/s=; b=pJBJpHBNB+nz1wyWTrNAyGdj4gCld8t/2LdJonTZp5FVxTGfCuYthxm/q7N7IkDJ0FtE7R jryp1XdpZRmN/br7eFZzt+0zm1zq8GgHTgnrNMRXURiQINcSnEQOjqYhb69Vgke9K6oqqV jm8B6sVyVOyD7yxmmlRaXb5/ZXWapADbTeuTE4nHoA179sj1JGUjCb5y90XQ7eOt1PiKC1 aKljfEst5lNce3G4megtY07+RuroBKrI0Ob+Pj/varOu2nxDDBc/4X5FwpOydLxCQFdcxr p6X8ZFf+xj57hPR+PmpDWn0ykE7Aog7fzK4FtS6Sg5YdvBfL9mN5ESLYX7sruQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WLcL83qFVz1Cj5; Sat, 13 Jul 2024 05:22:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46D5MuvM032314; Sat, 13 Jul 2024 05:22:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46D5Muis032311; Sat, 13 Jul 2024 05:22:56 GMT (envelope-from git) Date: Sat, 13 Jul 2024 05:22:56 GMT Message-Id: <202407130522.46D5Muis032311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 41c233dec6c1 - main - Prepare some build fixes in advance of more _FORTIFY_SOURCE List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 41c233dec6c15c543d3042c06833c1623456743c Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=41c233dec6c15c543d3042c06833c1623456743c commit 41c233dec6c15c543d3042c06833c1623456743c Author: Kyle Evans AuthorDate: 2024-07-13 05:16:09 +0000 Commit: Kyle Evans CommitDate: 2024-07-13 05:16:23 +0000 Prepare some build fixes in advance of more _FORTIFY_SOURCE ZFS' libspl needs to be made aware that we have strlcat(3) and strlcpy(3) to avoid some more complicated declaration duplication, so go ahead and define these HAVE_ macros now. libprocstat has to define `_KERNEL` and include kernel headers in order to get what it wants, but this results in sys/cdefs.h being included too late and we pick up the build breaking version of the __RENAME definition. Just explicitly include sys/cdefs.h earlier rather than disabling _FORTIFY_SOURCE. The zfs/ subdir only builds an object that holds some structures and sizes, so just disable _FORTIFY_SOURCE there entirely rather than trying to move #define _KERNEL into the file.. While we're here, make sure that we disable _FORTIFY_SOURCE in the bootloader because we don't have the symbol renaming support today to do it as cleanly as we'd like. ssp/ssp.h needs to be pulled into the libsa environment so that other bits can understand that ssp is disabled in the consistent __SSP_FORTIFY_LEVEL way that we try to do. Reviewed by: allanjude (previous version), markj Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45676 --- cddl/Makefile.inc | 1 + lib/libbe/Makefile | 2 +- lib/libproc/Makefile | 2 +- lib/libprocstat/zfs.c | 2 ++ lib/libprocstat/zfs/Makefile | 1 + sbin/bectl/Makefile | 2 +- stand/defs.mk | 2 ++ stand/libsa/Makefile | 3 ++- 8 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cddl/Makefile.inc b/cddl/Makefile.inc index b306a28b5c84..f07baf295b89 100644 --- a/cddl/Makefile.inc +++ b/cddl/Makefile.inc @@ -5,6 +5,7 @@ OPENSOLARIS_SYS_DISTDIR= ${.CURDIR}/../../../sys/cddl/contrib/opensolaris IGNORE_PRAGMA= YES CFLAGS+= -DNEED_SOLARIS_BOOLEAN +CFLAGS+= -DHAVE_STRLCAT -DHAVE_STRLCPY # Do not lint the CDDL stuff. It is all externally maintained and # lint output is wasteful noise here. diff --git a/lib/libbe/Makefile b/lib/libbe/Makefile index 87c032ae3a0c..099efed52d9f 100644 --- a/lib/libbe/Makefile +++ b/lib/libbe/Makefile @@ -61,7 +61,7 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzfs CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h -CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -DHAVE_ISSETUGID -DHAVE_STRLCAT -DHAVE_STRLCPY CFLAGS.be.c= -Wno-cast-qual CFLAGS.be_access.c= -Wno-cast-qual CFLAGS.be_error.c= -Wno-cast-qual diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile index 67c4e642ea00..ae00bdc4ba90 100644 --- a/lib/libproc/Makefile +++ b/lib/libproc/Makefile @@ -24,7 +24,7 @@ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h -CFLAGS+= -DHAVE_ISSETUGID -DHAVE_BOOLEAN +CFLAGS+= -DHAVE_ISSETUGID -DHAVE_BOOLEAN -DHAVE_STRLCAT -DHAVE_STRLCPY CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libctf/common \ -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common \ -I${SRCTOP}/sys/cddl/compat/opensolaris diff --git a/lib/libprocstat/zfs.c b/lib/libprocstat/zfs.c index 422f923ac15c..665b1e5abe24 100644 --- a/lib/libprocstat/zfs.c +++ b/lib/libprocstat/zfs.c @@ -26,6 +26,8 @@ * SUCH DAMAGE. */ +#include /* __RENAME */ + #include #include diff --git a/lib/libprocstat/zfs/Makefile b/lib/libprocstat/zfs/Makefile index da689fdd3e81..3fa6f985c694 100644 --- a/lib/libprocstat/zfs/Makefile +++ b/lib/libprocstat/zfs/Makefile @@ -5,6 +5,7 @@ SRCS= zfs_defs.c OBJS= zfs_defs.o WARNS?= 1 +FORTIFY_SOURCE= 0 CFLAGS+= -DIN_BASE -D__KERNEL__ -D_KERNEL -I. -I${.CURDIR} CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include diff --git a/sbin/bectl/Makefile b/sbin/bectl/Makefile index d640de33bf72..531f54cca18d 100644 --- a/sbin/bectl/Makefile +++ b/sbin/bectl/Makefile @@ -22,7 +22,7 @@ CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h -CFLAGS+= -DHAVE_ISSETUGID +CFLAGS+= -DHAVE_ISSETUGID -DHAVE_STRLCAT -DHAVE_STRLCPY CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h HAS_TESTS= yes diff --git a/stand/defs.mk b/stand/defs.mk index 3624b9311161..452ba060c504 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -2,6 +2,8 @@ .if !defined(__BOOT_DEFS_MK__) __BOOT_DEFS_MK__=${MFILE} +FORTIFY_SOURCE= 0 + # We need to define all the MK_ options before including src.opts.mk # because it includes bsd.own.mk which needs the right MK_ values, # espeically MK_CTF. diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index bc85a3dcb0de..c5de2c9b8e13 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -195,7 +195,7 @@ MAN=libsa.3 # Create a subset of includes that are safe, as well as adjusting those that aren't # The lists may drive people nuts, but they are explicitly opt-in -FAKE_DIRS=xlocale arpa +FAKE_DIRS=xlocale arpa ssp SAFE_INCS=a.out.h assert.h elf.h inttypes.h limits.h nlist.h setjmp.h stddef.h stdbool.h string.h strings.h time.h unistd.h uuid.h STAND_H_INC=ctype.h fcntl.h signal.h stdio.h stdlib.h OTHER_INC=stdarg.h errno.h stdint.h @@ -210,6 +210,7 @@ beforedepend: ln -sf ${SYSDIR}/sys/stdint.h stdint.h; \ ln -sf ${SRCTOP}/include/arpa/inet.h arpa/inet.h; \ ln -sf ${SRCTOP}/include/arpa/tftp.h arpa/tftp.h; \ + ln -sf ${SRCTOP}/include/ssp/ssp.h ssp/ssp.h; \ for i in _time.h _strings.h _string.h; do \ [ -f xlocale/$$i ] || :> xlocale/$$i; \ done; \