From nobody Fri Jun 26 14:59:16 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 4gmzN43cXQz6jd5Y for ; Fri, 26 Jun 2026 14:59:16 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gmzN42Dpbz3d42 for ; Fri, 26 Jun 2026 14:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782485956; 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=UlA1oD1vBkdmBDL7rTTzC++G5wUXimu9p1JwVlEMqoE=; b=d4zzcDO7grR9fwIVv3JpZwTgoEE0MlTPXVeZQujCfbGStX9j2CYGHAuFDyucU5+B1IKSqe Ufk2qwFMydszNozYyPHchBErfSbveK7hDmErsGppzsTxOEMbiLIpHtuyrVkhWjMxEnrxPW LLh1jAExPjy8rIyGvd+xL7zs80Q6uC9K19+KSYnGNBHvKxKyhUkA7kQTlWgWrE+uhzBY64 uAuc/8w+4KUvgvx6NVd4JF+dVDPCKtwX6WTJ7x9ADe2WrDnG4S2zUBLzYFEMTFP+aD3LVU HwqNnofjT7gj9TF02gQ6twXkrca1DwOjUpdw6hZNL0PJtumz032elSBm1u2Efg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782485956; a=rsa-sha256; cv=none; b=WyIv/wizG0F5WRPrQXJcOV2JENfkhrROx4MASasUsBbJQAHv3U8hp9HNO3OhkpPnnzl7FT lUGioyIrSUkEra+fGv4+Uus9L09/++RG7l2CanImGBRxh1F9mFwSWyTxFaVyppOKII/HhF lfFHS5XjT19IOp9tuKXsBb+OWugLdc2mT22mOx2xxFKSJc3xJw8dAc+KfHV3t6moroZQAU ulF60iXdFA5Mqc0ZXwrP7ekQugr0C8TcqYDt6EcCbWI9YqH1ewGr1aVNdHmks0Wou3XCWF p4GVhEeN4w98vR4Pm/LabM9NdtIMBe2+ArABZuMkgVXytnlEs4859LCbV3EgaA== 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=1782485956; 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=UlA1oD1vBkdmBDL7rTTzC++G5wUXimu9p1JwVlEMqoE=; b=ZHWUrBya+cg3ghI2x0V619YqPUmDfkv5A92FPh+2NlSKZeXvNU8Rd+SO0WQVPx8HpK+AlL p1PAXvIKF0/v1AxVVIN3GaED/V7NGWG0hbjrK7/GQUo1wB8ivfa6qBiKVGBRtTjWNOvpKQ MuywrBegmH/jMh+wmogJYRFCQKdDx7z2gbbHp2CplEx9Yqb1NvwraDCsHqQCtVXeYG5M/V EbVjnXUNLQWqI63kpWkp4PNb2jJ1ViTeATAuhmBClvtEs7Ku6WVwclCeEXGNjRdNTW6taj Wd2NhSdWp6D64IO68qbKyK/Se111qouz7M7cH/EPL3EgrV0C16UBXOBS1h8yMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gmzN41C2dzhqR for ; Fri, 26 Jun 2026 14:59:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 204b6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 26 Jun 2026 14:59:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 53811ed62379 - main - loader: Add defines for ZLIB_CFLAGS, BZIP2_CFLAGS and ZSTD_CFLAGS 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53811ed6237972f92a80627ea2c17ece212315a7 Auto-Submitted: auto-generated Date: Fri, 26 Jun 2026 14:59:16 +0000 Message-Id: <6a3e93c4.204b6.a1ad3dc@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=53811ed6237972f92a80627ea2c17ece212315a7 commit 53811ed6237972f92a80627ea2c17ece212315a7 Author: Warner Losh AuthorDate: 2026-06-26 14:45:42 +0000 Commit: Warner Losh CommitDate: 2026-06-26 14:54:35 +0000 loader: Add defines for ZLIB_CFLAGS, BZIP2_CFLAGS and ZSTD_CFLAGS These are scattered in several places, so centralize the setting of these flags. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D57861 --- stand/defs.mk | 9 +++++++++ stand/efi/gptboot/Makefile | 2 +- stand/efi/loader/Makefile | 3 ++- stand/i386/gptboot/Makefile | 2 +- stand/i386/gptzfsboot/Makefile | 2 +- stand/i386/loader/Makefile | 2 +- stand/libsa/Makefile | 3 +-- stand/loader.mk | 2 +- stand/uboot/Makefile | 2 +- 9 files changed, 18 insertions(+), 9 deletions(-) diff --git a/stand/defs.mk b/stand/defs.mk index ac4f38451111..05108404c538 100644 --- a/stand/defs.mk +++ b/stand/defs.mk @@ -181,6 +181,15 @@ CFLAGS+= -fPIC CFLAGS+= -mno-relax .endif +# ZLIB flags +ZLIB_CFLAGS=-DHAVE_MEMCPY -I${SYSDIR}/contrib/zlib ${NO_WDEPRECATED_NON_PROTOTYPE} + +# BZIP2 flags +BZIP2_CFLAGS=-I${SRCTOP}/contrib/bzip2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS + +# ZSTD client cflags +ZSTD_CFLAGS=-I${SYSDIR}/contrib/zstd/lib + # The boot loader build uses dd status=none, where possible, for reproducible # build output (since performance varies from run to run). Trouble is that # option was recently (10.3) added to FreeBSD and is non-standard. Only use it diff --git a/stand/efi/gptboot/Makefile b/stand/efi/gptboot/Makefile index 7d4c225bc5d4..a3c9c36597ff 100644 --- a/stand/efi/gptboot/Makefile +++ b/stand/efi/gptboot/Makefile @@ -11,7 +11,7 @@ MAN= gptboot.efi.8 CFLAGS+= -I${SRCTOP}/stand/efi/boot1 CFLAGS+= -I${.CURDIR} CFLAGS+= -DBOOTPROG=\"gptboot.efi\" -CFLAGS+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib +CFLAGS+= ${ZLIB_CFLAGS} SRCS+= gpt.c CWARNFLAGS.gpt.c+= -Wno-sign-compare -Wno-cast-align WARNS?=6 diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index addb7652249d..44d7347ee7dd 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -45,6 +45,7 @@ HAVE_ZFS= yes CFLAGS.bootinfo.c += -I$(SRCTOP)/sys/teken CFLAGS.bootinfo.c += -I${SRCTOP}/contrib/pnglite +CFLAGS.decompress.c += ${ZLIB_CFLAGS} ${BZIP2_CFLAGS} ${ZSTD_CFLAGS} CFLAGS.framebuffer.c += -I$(SRCTOP)/sys/teken CFLAGS.framebuffer.c += -I${SRCTOP}/contrib/pnglite CFLAGS.main.c += -I$(SRCTOP)/sys/teken @@ -52,7 +53,7 @@ CFLAGS.main.c += -I${SRCTOP}/contrib/pnglite CFLAGS.gfx_fb.c += -I$(SRCTOP)/sys/teken CFLAGS.gfx_fb.c += -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 CFLAGS.gfx_fb.c += -I${SRCTOP}/contrib/pnglite -CFLAGS.gfx_fb.c += -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib +CFLAGS.gfx_fb.c += ${ZLIB_CFLAGS} # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only diff --git a/stand/i386/gptboot/Makefile b/stand/i386/gptboot/Makefile index 366d82497819..d599c4f6b250 100644 --- a/stand/i386/gptboot/Makefile +++ b/stand/i386/gptboot/Makefile @@ -28,7 +28,7 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -I${LDRSRC} \ -I${BOOTSRC}/i386/common \ -I${BOOTSRC}/i386/boot2 \ - -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib \ + ${ZLIB_CFLAGS} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ diff --git a/stand/i386/gptzfsboot/Makefile b/stand/i386/gptzfsboot/Makefile index 2b3b5422031b..3ac711c6212f 100644 --- a/stand/i386/gptzfsboot/Makefile +++ b/stand/i386/gptzfsboot/Makefile @@ -36,7 +36,7 @@ CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 \ -I${BOOTSRC}/i386/btx/lib \ -I${BOOTSRC}/i386/boot2 \ - -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib \ + ${ZLIB_CFLAGS} \ -Wall -Waggregate-return -Wbad-function-cast \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index 96ad50a75509..fde389b9940e 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -56,7 +56,7 @@ CFLAGS.gfx_fb.c += -I${.CURDIR}/../libi386 CFLAGS.gfx_fb.c += -I$(SRCTOP)/sys/teken CFLAGS.gfx_fb.c += -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4 CFLAGS.gfx_fb.c += -I${SRCTOP}/contrib/pnglite -CFLAGS.gfx_fb.c += -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib +CFLAGS.gfx_fb.c += ${ZLIB_CFLAGS} CFLAGS.gfx_bios.c += -I$(SRCTOP)/sys/teken CFLAGS.gfx_bios.c += -I${SRCTOP}/contrib/pnglite .else diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index 11896cf1a2ab..a0bc47f343b5 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -100,7 +100,6 @@ SRCS+=${i} # https://github.com/madler/zlib/issues/633 documents why we suppress deprecated # prototype warnings. .PATH: ${SRCTOP}/sys/contrib/zlib -ZLIB_CFLAGS=-DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib ${NO_WDEPRECATED_NON_PROTOTYPE} .for i in adler32.c crc32.c infback.c inffast.c inflate.c inftrees.c zutil.c CFLAGS.${i}+=${ZLIB_CFLAGS} SRCS+= ${i} @@ -161,7 +160,7 @@ CFLAGS.ffs_subr.c+= -DSTANDALONE_SMALL CFLAGS.gzipfs.c+= ${ZLIB_CFLAGS} CFLAGS.pkgfs.c+= ${ZLIB_CFLAGS} -CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 -DBZ_NO_STDIO -DBZ_NO_COMPRESS +CFLAGS.bzipfs.c+= ${BZIP2_CFLAGS} # explicit_bzero and calculate_crc32c .PATH: ${SYSDIR}/libkern diff --git a/stand/loader.mk b/stand/loader.mk index 0d94ed3e6263..b34ba08a8e5d 100644 --- a/stand/loader.mk +++ b/stand/loader.mk @@ -57,7 +57,7 @@ SRCS+= metadata.c # .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" -CFLAGS.part.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib +CFLAGS.part.c+= ${ZLIB_CFLAGS} SRCS+= disk.c part.c vdisk.c .endif diff --git a/stand/uboot/Makefile b/stand/uboot/Makefile index becca47944da..c0a349a2e29a 100644 --- a/stand/uboot/Makefile +++ b/stand/uboot/Makefile @@ -49,7 +49,7 @@ SRCS+= copy.c devicename.c elf_freebsd.c glue.c SRCS+= net.c reboot.c time.c SRCS+= uboot_console.c uboot_disk.c uboot_fdt.c uboot_module.c -CFLAGS.glue.c+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib +CFLAGS.glue.c+= ${ZLIB_CFLAGS} CFLAGS+= -I${BOOTSRC}/common CFLAGS+= -I${.CURDIR}