Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162698740
D57861.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D57861.diff
View Options
diff --git a/stand/defs.mk b/stand/defs.mk
--- a/stand/defs.mk
+++ b/stand/defs.mk
@@ -181,6 +181,15 @@
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
--- a/stand/efi/gptboot/Makefile
+++ b/stand/efi/gptboot/Makefile
@@ -11,7 +11,7 @@
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
--- a/stand/efi/loader/Makefile
+++ b/stand/efi/loader/Makefile
@@ -45,6 +45,7 @@
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.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
--- a/stand/i386/gptboot/Makefile
+++ b/stand/i386/gptboot/Makefile
@@ -28,7 +28,7 @@
-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
--- a/stand/i386/gptzfsboot/Makefile
+++ b/stand/i386/gptzfsboot/Makefile
@@ -36,7 +36,7 @@
-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
--- a/stand/i386/loader/Makefile
+++ b/stand/i386/loader/Makefile
@@ -56,7 +56,7 @@
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
--- a/stand/libsa/Makefile
+++ b/stand/libsa/Makefile
@@ -100,7 +100,6 @@
# 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.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
--- a/stand/loader.mk
+++ b/stand/loader.mk
@@ -57,7 +57,7 @@
#
.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
--- a/stand/uboot/Makefile
+++ b/stand/uboot/Makefile
@@ -49,7 +49,7 @@
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}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 16, 9:58 PM (3 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35128489
Default Alt Text
D57861.diff (4 KB)
Attached To
Mode
D57861: loader: Add defines for ZLIB_CFLAGS, BZIP2_CFLAGS and ZSTD_CFLAGS
Attached
Detach File
Event Timeline
Log In to Comment