Skip to content

Commit

Permalink
For OpenWatcom V2, we now disable the use of -zm - this was causing…
Browse files Browse the repository at this point in the history
… issues - at least for me - with 8086 builds. The OpenWatcom V2 upstream claims they could not replicate it, however. (open-watcom/open-watcom-v2#862) - While here, removed the old and now unused mini-crt0.asm and associated code to avoid further confusion from anyone thinking it was in use, that was for old WATCOM versions only - removed references to the mini-crt0 from the documentation as well.  Closes #16
  • Loading branch information
johnsonjh committed May 9, 2022
1 parent 6fc8d86 commit 8a2264e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 161 deletions.
16 changes: 6 additions & 10 deletions src/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@
# link /STACK:32767 G.OBJ,G.EXE,,,,
#
# * DOS (Watcom C 10, 386):
# wasm crt0 -bt=DOS -ml -2r_
# wcl -DDOS=1 -4 -7 -fp3 -ml -zp2 -oaosilm @g.lkr \
# -fe=g.exe crt0.obj g.c
# -k32767 -fe=g.exe crt0.obj g.c
#
# * Use `-DDEBUG=1` to enable extra debugging checks
# * Use `-DCOLOUR=0` for older curses implementations
#
# For Watcom DOS builds, crt0.asm is optional. It's smaller and faster than
# the default. If it isn't used, -k32767 must be added to set the stack size.
#
# For MS C (real-mode DOS), the compiler produces compact code, so a full
# (non-"TINY_G") build may be practical; add -DFULL_G=1 to the cl invocation.
#
Expand Down Expand Up @@ -259,7 +255,7 @@ endif # !V
@$(VERBOSE); $(RM) -f "g86.exe" 2> /dev/null || $(TRUE)
@$(VERBOSE); $(ENV) WATCOM="$(WATCOM)" INCLUDE="$(WATCOM)/h" \
PATH="$(WATCOM)/$(WATBIN):$${PATH:?}" $(WATWCL) -k32767 \
-bcl=DOS -DDOS=1 -DASM86=0 -0 -ml -fpi -zm @g.lkr \
-bcl=DOS -DDOS=1 -DASM86=0 -0 -ml -fpi @g.lkr \
$(WATDBG) -zp2 -fe=$(OUT)86.exe $(SRC) && \
$(RM) -f "./g.o" 2> /dev/null

Expand All @@ -276,7 +272,7 @@ endif # !V
@$(VERBOSE); $(RM) -f "g386r.exe" 2> /dev/null || $(TRUE)
@$(VERBOSE); $(ENV) WATCOM="$(WATCOM)" INCLUDE="$(WATCOM)/h" \
PATH="$(WATCOM)/$(WATBIN):$${PATH:?}" $(WATWCL) -k32767 \
-bcl=DOS -DDOS=1 -DASM86=1 -3 -ml -fpi -zm @g.lkr \
-bcl=DOS -DDOS=1 -DASM86=1 -3 -ml -fpi @g.lkr \
$(WATDBG) -zp2 -fe=$(OUT)386r.exe $(SRC) && \
$(RM) -f "./g.o" 2> /dev/null

Expand All @@ -293,7 +289,7 @@ endif # !V
@$(VERBOSE); $(RM) -f "./g386p.exe" 2> /dev/null || $(TRUE)
@$(VERBOSE); $(ENV) WATCOM="$(WATCOM)" INCLUDE="$(WATCOM)/h" \
PATH="$(WATCOM)/$(WATBIN):$(WATCOM)/binw:$${PATH:?}" $(WCL386) \
-l=$(EXTENDER) -bt=DOS -DDOS=1 -DASM86=0 -3r -mf -fpi -zm @g.lkr \
-l=$(EXTENDER) -bt=DOS -DDOS=1 -DASM86=0 -3r -mf -fpi @g.lkr \
-k32767 $(WATDBG) -zp2 -DWCL386=1 -fe=$(OUT)386p.exe $(SRC) && \
$(RM) -f "./g.o" 2> /dev/null

Expand All @@ -311,7 +307,7 @@ endif # !V
@$(VERBOSE); $(ENV) WATCOM="$(WATCOM)" \
INCLUDE="$(WATCOM)/h:$(WATCOM)/h/os21x:$${WATCOM_PDC_INCLUDE:?}" \
PATH="$(WATCOM)/$(WATBIN):$${PATH:?}" $(WATWCL) \
-bcl=OS2 -UDOS -DUNIX=1 -2 -ml -fpi -zm @gos2.lkr -k32767 \
-bcl=OS2 -UDOS -DUNIX=1 -2 -ml -fpi @gos2.lkr -k32767 \
$(WATDBG) -D_TIMESPEC_DEFINED -za -zp2 -fe=$(OUT)286p.exe \
$(SRC) "$${WATCOM_PDC_LIBRARY:?}" && $(RM) -f "./g.o" \
2> /dev/null
Expand All @@ -330,7 +326,7 @@ endif # !V
@$(VERBOSE); $(ENV) WATCOM="$(WATCOM)" \
INCLUDE="$(WATCOM)/h:$(WATCOM)/h/os2:$${WATCOM_PDC_INCLUDE:?}" \
PATH="$(WATCOM)/$(WATBIN):$${PATH:?}" $(WCL386) \
-bcl=OS2V2 -UDOS -DUNIX=1 -3r -mf -fpi -zm @gos2.lkr -k32767 \
-bcl=OS2V2 -UDOS -DUNIX=1 -3r -mf -fpi @gos2.lkr -k32767 \
$(WATDBG) -D_TIMESPEC_DEFINED -zp2 -fe=$(OUT)os2p.exe \
$(SRC) "$${WATCOM_PDC_LIBRARY:?}" && $(RM) -f "./g.o" \
2> /dev/null
Expand Down
142 changes: 0 additions & 142 deletions src/crt0.asm

This file was deleted.

20 changes: 11 additions & 9 deletions src/g.c
Original file line number Diff line number Diff line change
Expand Up @@ -1352,15 +1352,17 @@ void Exit(void);
private
void Drive(const int);

#if defined(__WATCOMC__) && !defined(__OS2__)
# pragma aux main aborts;
# pragma aux Quit aborts;
# pragma aux Exit aborts;
# pragma aux g_err aborts;
# pragma aux g_intr aborts;
# pragma aux se_error aborts;
# pragma aux _exit aborts;
#endif /* if defined(__WATCOMC__) && !defined(__OS2__) */
#if 0
# if defined(__WATCOMC__) && !defined(__OS2__)
# pragma aux main aborts;
# pragma aux Quit aborts;
# pragma aux Exit aborts;
# pragma aux g_err aborts;
# pragma aux g_intr aborts;
# pragma aux se_error aborts;
# pragma aux _exit aborts;
# endif /* if defined(__WATCOMC__) && !defined(__OS2__) */
#endif /* 0 */

#define FBSTR \
private \
Expand Down

0 comments on commit 8a2264e

Please sign in to comment.