Mon Nov 6 07:02:17 2023 UTC ()
x86/dosboot: Do not page-align data segment

4K alignment is too heavy burden for COM executable with 64K limit :)

Fix binary size overflow for clang/amd64.


(rin)
diff -r1.34 -r1.35 src/sys/arch/i386/stand/dosboot/Makefile

cvs diff -r1.34 -r1.35 src/sys/arch/i386/stand/dosboot/Makefile (expand / switch to unified diff)

--- src/sys/arch/i386/stand/dosboot/Makefile 2023/11/06 06:53:52 1.34
+++ src/sys/arch/i386/stand/dosboot/Makefile 2023/11/06 07:02:17 1.35
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.34 2023/11/06 06:53:52 rin Exp $ 1# $NetBSD: Makefile,v 1.35 2023/11/06 07:02:17 rin Exp $
2 2
3S= ${.CURDIR}/../../../.. 3S= ${.CURDIR}/../../../..
4 4
5BASE= dosboot 5BASE= dosboot
6PROG= ${BASE}.com 6PROG= ${BASE}.com
7NEWVERSWHAT= "DOS Boot" 7NEWVERSWHAT= "DOS Boot"
8STARTFILE= ${DOSSTART} 8STARTFILE= ${DOSSTART}
9RELOC= 0x100 9RELOC= 0x100
10 10
11SRCS= main.c devopen.c exec.c exec_multiboot1.c exec_multiboot2.c 11SRCS= main.c devopen.c exec.c exec_multiboot1.c exec_multiboot2.c
12 12
13CPPFLAGS+= -DSLOW # for libz 13CPPFLAGS+= -DSLOW # for libz
14CPPFLAGS+= -DCOMPAT_386BSD_MBRPART 14CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
@@ -24,22 +24,25 @@ CFLAGS+= -Wall -Wmissing-prototypes -Wst @@ -24,22 +24,25 @@ CFLAGS+= -Wall -Wmissing-prototypes -Wst
24# XXX should go into library 24# XXX should go into library
25SRCS+= getopt.c 25SRCS+= getopt.c
26.PATH: ${.CURDIR}/../libsa 26.PATH: ${.CURDIR}/../libsa
27 27
28# XXX these should depend on the size of the image 28# XXX these should depend on the size of the image
29CPPFLAGS+= -DSTACK_START=0x10000 29CPPFLAGS+= -DSTACK_START=0x10000
30SAMISCCPPFLAGS+= -DHEAP_START=0x20000 -DHEAP_LIMIT=0x50000 30SAMISCCPPFLAGS+= -DHEAP_START=0x20000 -DHEAP_LIMIT=0x50000
31SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no SA_ENABLE_LS_OP=yes 31SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no SA_ENABLE_LS_OP=yes
32I386MISCMAKEFLAGS= I386_INCLUDE_DOS=yes 32I386MISCMAKEFLAGS= I386_INCLUDE_DOS=yes
33 33
34# DOS command line arguments are located at 0x0000. 34# DOS command line arguments are located at 0x0000.
35COPTS.doscommain.c+= -fno-delete-null-pointer-checks 35COPTS.doscommain.c+= -fno-delete-null-pointer-checks
36 36
 37# Do not page-align data segment.
 38LDFLAGS+= -Wl,-N
 39
37VERSIONFILE= ${.CURDIR}/version 40VERSIONFILE= ${.CURDIR}/version
38 41
39.include <bsd.init.mk> 42.include <bsd.init.mk>
40 43
41release: check_RELEASEDIR 44release: check_RELEASEDIR
42 ${HOST_INSTALL_FILE} -m ${BINMODE} dosboot.com \ 45 ${HOST_INSTALL_FILE} -m ${BINMODE} dosboot.com \
43 ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc 46 ${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/misc
44 47
45.include "../Makefile.booters" 48.include "../Makefile.booters"