diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile index 781194d0a28..284aa5452fc 100644 --- a/stand/libsa/Makefile +++ b/stand/libsa/Makefile @@ -167,6 +167,17 @@ SRCS+= time.c .PATH: ${SRCTOP}/sys/ufs/ffs SRCS+=ffs_subr.c ffs_tables.c +# +# i386 has a constrained space for its /boot/loader, so compile out the +# extensive messages diagnosing bad superblocks. i386 doesn't support UEFI +# booting, so doing it always makes sense natively there. When we compile +# for 32-bit on amd64, LIBSA_CPUARCH is also i386 and we use libsa32 only +# for the BIOS /boot/loader which has the same constraints. +# +.if ${LIBSA_CPUARCH} == "i386" +CFLAGS.ffs_subr.c+= -DSTANDALONE_SMALL +.endif + CFLAGS.dosfs.c+= -I${LDRSRC} CFLAGS.tftp.c+= -I${LDRSRC} CFLAGS.ufs.c+= -I${LDRSRC} diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index 6b2bbf41c91..01981c78249 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -323,7 +323,11 @@ readsuper(void *devfd, struct fs **fsp, off_t sblockloc, int isaltsblk, * Verify the filesystem values. */ #define ILOG2(num) (fls(num) - 1) -#define MPRINT if (prtmsg) printf +#ifdef STANDALONE_SMALL +#define MPRINT(...) do { } while (0) +#else +#define MPRINT(...) if (prtmsg) printf(__VA_ARGS__) +#endif /* * Print error messages when bad superblock values are found. */