[squeak-dev] Re: vm build environment on windows

Henry Lavado henrylavado at gmx.com
Sat Oct 10 12:58:38 UTC 2015


Marcel, here is a list of issues I ran into, and my attempts at solving 
them. The result is more compilation errors.

1) using Cygwin 64bit I had a problem with cygwin1.dll causing a seg 
fault. There is literature about the problem mentioning fixing some 
source and recompiling. I bailed on this effort.
2) switched to 32bit Cygwin
3) The patch file is for 64bit so I am translating by hand and attaching 
the results. NOTE #1
4) 32-bit patch couldn't find files to modify, so I modified by hand.
5) running mvm, I got another set of errors for undeclared, late in the 
build, listed below

NOTES
#1 - I think there are 2 spots with -mno-cygwin that are not covered by 
the script but I didn't want to figure out how to encode it correctly. 
It would be better with a new patch generated.
#2 - since 32 and 64 -bit windows are different, having 2 different 
build targets may make sense.

Regards,
Henry


i686-pc-mingw32-gcc -o build/vm/sqWin32Main.o 
-I/usr/i686-pc-mingw32/sys-root/mingw/include -msse2 -ggdb2 -mwindows 
-mthreads -mwin32 -mno-rtd -mms-bitfields -mno-accumulate-outgoing-args 
-mstack-arg-probe -D_MT -O2 -march=pentium4 -momit-leaf-frame-pointer 
-funroll-loops -D_MT -fno-builtin-printf -fno-builtin-putchar 
-fno-builtin-bzero -I. -I../../spursrc/vm -I../../platforms/win32/vm 
-I../../platforms/Cross/vm 
-I../../platforms/win32/third-party/dx9sdk/Include  -DCOGMTVM=0 
-DDEBUGVM=0 -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -DWIN32 
-DWIN32_FILE_SUPPORT -DNO_ISNAN -DNO_SERVICE -DNO_STD_FILE_SUPPORT 
-D'TZ="EDT"' -DNDEBUG -D'VM_LABEL(foo)=0'  -DLSB_FIRST 
-D'VM_NAME="Squeak"' -DX86  -DCROQUET -c 
../../platforms/win32/vm/sqWin32Main.c
../../platforms/win32/vm/sqWin32Main.c:1:0: warning: unwind tables 
currently require either a frame pointer or -maccumulate-outgoing-args 
for correctness [enabled by default]
../../platforms/win32/vm/sqWin32Main.c: In function 
‘squeakExceptionHandler’:
../../platforms/win32/vm/sqWin32Main.c:133:18: error: ‘_RC_NEAR’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:18: note: each undeclared 
identifier is reported only once for each function it appears in
../../platforms/win32/vm/sqWin32Main.c:133:18: error: ‘_PC_53’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:18: error: ‘_EM_INVALID’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:18: error: ‘_EM_ZERODIVIDE’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:18: error: ‘_EM_OVERFLOW’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:18: error: ‘_EM_UNDERFLOW’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:18: error: ‘_EM_INEXACT’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:18: error: ‘_EM_DENORMAL’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:31: error: ‘_MCW_EM’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:41: error: ‘_MCW_RC’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:51: error: ‘_MCW_PC’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:133:61: error: ‘_MCW_IC’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c: In function ‘sqMain’:
../../platforms/win32/vm/sqWin32Main.c:1306:14: error: ‘_RC_NEAR’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:14: error: ‘_PC_53’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:14: error: ‘_EM_INVALID’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:14: error: ‘_EM_ZERODIVIDE’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:14: error: ‘_EM_OVERFLOW’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:14: error: ‘_EM_UNDERFLOW’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:14: error: ‘_EM_INEXACT’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:14: error: ‘_EM_DENORMAL’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:27: error: ‘_MCW_EM’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:37: error: ‘_MCW_RC’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:47: error: ‘_MCW_PC’ 
undeclared (first use in this function)
../../platforms/win32/vm/sqWin32Main.c:1306:57: error: ‘_MCW_IC’ 
undeclared (first use in this function)
Makefile:324: recipe for target 'build/vm/sqWin32Main.o' failed
make: *** [build/vm/sqWin32Main.o] Error 1



-------------- next part --------------
Index: build.win32x86/squeak.cog.spur/Makefile
===================================================================
--- build.win32x86/squeak.cog.spur/Makefile	(revision 3440)
+++ build.win32x86/squeak.cog.spur/Makefile	(working copy)
@@ -102,9 +102,9 @@
 DXDIR:=     $(PLATDIR)/win32/third-party/dx9sdk/Include
 
 #############################################################################
-# C compiler settings (gcc-3.4.4 cygwin 19.24)
+# C compiler settings (gcc-4.9.2 cygwin)
 #
-CC:=gcc
+CC:=i686-pc-mingw32-gcc
 
 # VM config flags.
 ifeq ("$(CONFIGURATION)","product")
@@ -126,11 +126,12 @@
 # Set minimum version to WindowsXP (see /cygwin/usr/include//w32api/w32api.h)
 WINVER:=-D_WIN32_WINNT=0x0501 -DWINVER=0x0501
 
-INCLUDEPATH:= -isystem/usr/include/mingw -I/usr/include/w32api
+INCLUDEPATH:= -I/usr/i686-pc-mingw32/sys-root/mingw/include
 # define _MT to eliminate the inline versions of printf et al in mingw/stdio.h
-NOBUILTIN:= -D_MT -fno-builtin-printf -fno-builtin-putchar -fno-builtin-fprintf
-CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mthreads -mno-cygwin -mwin32 \
-	-mno-rtd -mms-bitfields -mno-accumulate-outgoing-args $(OFLAGS) $(NOBUILTIN)
+NOBUILTIN:= -D_MT -fno-builtin-printf -fno-builtin-putchar -fno-builtin-bzero
+CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mthreads -mwin32 \
+	-mno-rtd -mms-bitfields -maccumulate-outgoing-args -mstack-arg-probe \
+	$(OFLAGS) $(NOBUILTIN)
 TZ:=$(shell date +%Z)
 DEFS:=	$(COGDEFS) $(WINVER) -DWIN32 -DWIN32_FILE_SUPPORT -DNO_ISNAN \
 		-DNO_SERVICE -DNO_STD_FILE_SUPPORT -D'TZ="$(TZ)"' \
@@ -145,26 +146,28 @@
 #       The switch '-mwindows' gives us a GUI app instead of a console app.
 #		Newer cygwins want --export-all-symbols in place of --export-dynamic.
 #
-LD:=	 gcc
-EXPORT:=--export-dynamic
-#EXPORT:=--export-all-symbols
-BASELDFLAGS:=-mno-cygwin -mthreads -Wl,--large-address-aware,$(EXPORT) -L/usr/lib/mingw
+LD:=i686-w64-mingw32-gcc
+#EXPORT:=--export-dynamic
+EXPORT:=--export-all-symbols
+BASELDFLAGS:=-mthreads -Wl,--large-address-aware,$(EXPORT) \
+	-L/usr/i686-pc-mingw32/sys-root/mingw/lib
 LDFLAGS:= -mwindows $(BASELDFLAGS)
 CONSOLELDFLAGS:= -mconsole $(BASELDFLAGS)
 STDLIBS:= -lddraw -ldinput -lopengl32 -lwsock32 -lcomdlg32 -lole32 -lwinmm \
-	-lversion -lwininet -luser32 -lgdi32 -lpsapi -lkernel32 -lcrtdll \
-	-ldsound -lsecur32
+	-lversion -lwininet -luser32 -lgdi32 -lpsapi -lkernel32 -lmsvcrt \
+	-ldsound -lsecur32 -lws2_32
 
 #############################################################################
 # Tools to use
 #
-AR:= ar rc
+AR:= i686-pc-mingw32-ar rc
 CP:= cp
 RM:= rm
-DLLTOOL:=	dlltool
-DLLWRAP:=	dllwrap
-STRIP:=	strip
-OBJCOPY:=	objcopy
+DLLTOOL:= i686-pc-mingw32-dlltool
+DLLWRAP:= i686-pc-mingw32-dllwrap
+STRIP:= i686-pc-mingw32-strip
+OBJCOPY:= i686-pc-mingw32-objcopy
+NM:= i686-pc-mingw32-nm
 
 #############################################################################
 # RC settings
@@ -171,7 +174,7 @@
 #
 # Note: RC compiles the .rc files into linkable .o files
 #
-RC:=	 windres
+RC:= i686-pc-mingw32-windres
 SVNREV:= $(shell sed -e "s/^static.*SvnRawRevisionString.*Rev: \([0-9][0-9]*\).*/\\1/p" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h)
 RCFLAGS:= --include-dir $(PLATDIR)/win32/misc -D_WIN32 -DFILEVERSIONVALUES=4,0,$(SVNREV),0 '-DFILEVERSIONSTRING=\"5.0.$(SVNREV)\\0\"'
 
@@ -230,13 +233,13 @@
 	@echo -----------------------------------------------------
 
 eitheror.exe: $(WIN32UTILDIR)/eitheror.c
-	$(CC) -o $@ -O1 -mconsole -mno-cygwin $<
+	$(CC) -o $@ -O1 -mconsole $<
 
 mingw32ver.exe: $(WIN32UTILDIR)/mingw32ver.c
-	$(CC) -o $@ -O1 -mconsole -mno-cygwin $<
+	$(CC) -o $@ -O1 -mconsole $<
 
 mkNamedPrims.exe: $(WIN32UTILDIR)/mkNamedPrims.c
-	$(CC) -o $@ -mconsole -mno-cygwin $<
+	$(CC) -o $@ -mconsole $<
 
 $(BTOBJ):	$(WIN32MISCDIR)/btext.c
 	$(CC) -c -o $@ -fomit-frame-pointer -O2 $<
@@ -250,13 +253,13 @@
 	$(CC) -o $(OBJDIR)/version.o $(CFLAGS) $(INCLUDES) $(DEFS) -c $(WIN32DIR)/version.c
 	$(LD) $(LDFLAGS) -o $(VMEXE) \
 			$(BTOBJ) $(VMOBJ) $(VMEXP) $(OBJDIR)/resource.o $(LIBS) $(STDLIBS) $(ETOBJ)
-	nm --numeric-sort --defined-only -f bsd $(VMEXE) >$(VMMAP)
+	$(NM) --numeric-sort --defined-only -f bsd $(VMEXE) >$(VMMAP)
 
 $(CONSOLEVMEXE): $(VMOBJ) $(LIBS) $(VMEXP) resource.o $(BTOBJ) $(ETOBJ)
 	$(CC) -o $(OBJDIR)/version.o $(CFLAGS) $(INCLUDES) $(DEFS) -c $(WIN32DIR)/version.c
 	$(LD) $(CONSOLELDFLAGS) -o $(CONSOLEVMEXE) \
 			$(BTOBJ) $(VMOBJ) $(VMEXP) $(OBJDIR)/resource.o $(LIBS) $(STDLIBS) $(ETOBJ)
-	nm --numeric-sort --defined-only -f bsd $(CONSOLEVMEXE) >$(CONSOLEVMMAP)
+	$(NM) --numeric-sort --defined-only -f bsd $(CONSOLEVMEXE) >$(CONSOLEVMMAP)
 
 ifneq ($STRIPEXE,)
 $(STRIPEXE): $(VMEXE)
Index: build.win32x86/squeak.cog.spur/Makefile.plugin
===================================================================
--- build.win32x86/squeak.cog.spur/Makefile.plugin	(revision 3440)
+++ build.win32x86/squeak.cog.spur/Makefile.plugin	(working copy)
@@ -1,7 +1,7 @@
 #############################################################################
 # Generic Makefile for plugins
 #############################################################################
-AR:= ar rc
+AR:= i686-pc-mingw32-ar rc
 CP:= cp
 RM:= rm
 
@@ -46,18 +46,19 @@
 LIBSRC:= $(notdir $(MAKERSRC) $(WIN32SRC) $(CROSSSRC))
 
 #############################################################################
-# C compiler settings (gcc-3.4.4 cygwin 19.24)
+# C compiler settings (gcc-4.9.2 cygwin 19.24)
 #
 NDEBUG:=-DNDEBUG
 # Set minimum version to WindowsXP (see /cygwin/usr/include//w32api/w32api.h)
 WINVER:=-D_WIN32_WINNT=0x0501 -DWINVER=0x0501
-CC:=	gcc
+CC:=i686-pc-mingw32-gcc
 # define _MT to eliminate the inline versions of printf et al in mingw/stdio.h
 OFLAGS:= -D_MT -O1 -march=pentium4 -momit-leaf-frame-pointer -funroll-loops \
-		-fno-builtin-printf -fno-builtin-putchar -fno-builtin-fprintf
-INCLUDEPATH:= -isystem/usr/include/mingw -I/usr/include/w32api
-CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mdll -mno-cygwin -mwin32 \
-	-mno-rtd -mms-bitfields -mno-accumulate-outgoing-args $(OFLAGS)
+		-fno-builtin-printf -fno-builtin-putchar -fno-builtin-bzero
+INCLUDEPATH:= -I/usr/i686-pc-mingw32/sys-root/mingw/include
+CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mdll -mwin32 \
+	-mno-rtd -mms-bitfields -maccumulate-outgoing-args \
+	-mstack-arg-probe $(OFLAGS)
 DEFS:=	$(WINVER) -DWIN32 -DWIN32_FILE_SUPPORT -DNO_ISNAN \
 		-DNO_SERVICE -DNO_STD_FILE_SUPPORT \
 		$(NDEBUG) -DLSB_FIRST -DVM_NAME=\"$(VM)\" -DX86 $(XDEFS)
@@ -68,9 +69,9 @@
 # Note: By default DLLTOOL/DLLWRAP do the work for everything related to plugins
 # but if LINK_WITH_GCC we use gcc and if LINK_WITH_GPP we use g++.
 #
-DLLTOOL:=	dlltool
-DLLWRAP:=	dllwrap -mno-cygwin
-#OPTSTRIP:=	strip # for production
+DLLTOOL:=	i686-pc-mingw32-dlltool
+DLLWRAP:=	i686-pc-mingw32-dllwrap
+#OPTSTRIP:=	i686-pc-mingw32-strip # for production
 OPTSTRIP:=	echo not doing strip
 
 .SUFFIXES:	.c .cpp .o .s .rc .res .dep
Index: build.win32x86/squeak.cog.spur/mvm
===================================================================
--- build.win32x86/squeak.cog.spur/mvm	(revision 3440)
+++ build.win32x86/squeak.cog.spur/mvm	(working copy)
@@ -4,10 +4,10 @@
 make assert 2>&1 | tee LOGA
 make 2>&1 | tee LOGF
 ls -rlt build*/vm/Squeak*.exe
-if test -f ../../sources/SqueakV41.sources; then
+if test -f ../../sources/SqueakV50.sources; then
 	for d in build buildast builddbg; do
-		if [ -d $d/vm -a !  -f $d/vm/SqueakV41.sources ]; then
-			ln ../../sources/SqueakV41.sources $d/vm
+		if [ -d $d/vm -a !  -f $d/vm/SqueakV50.sources ]; then
+			ln ../../sources/SqueakV50.sources $d/vm
 		fi
 	done
 fi
Index: build.win32x86/squeak.cog.spur/plugins.ext
===================================================================
--- build.win32x86/squeak.cog.spur/plugins.ext	(revision 3440)
+++ build.win32x86/squeak.cog.spur/plugins.ext	(working copy)
@@ -2,7 +2,5 @@
 # N.B. SqueakSSL is not ready for prime time.  Compiles but does not link fully.
 # See platforms/win32/plugins/SqueakSSL/Makefile
 EXTERNAL_PLUGINS = \
-BochsIA32Plugin \
 SqueakFFIPrims \
 Win32OSProcessPlugin
-
Index: build.win32x86/squeak.cog.v3/Makefile
===================================================================
--- build.win32x86/squeak.cog.v3/Makefile	(revision 3440)
+++ build.win32x86/squeak.cog.v3/Makefile	(working copy)
@@ -118,9 +118,9 @@
 DXDIR:=     $(PLATDIR)/win32/third-party/dx9sdk/Include
 
 #############################################################################
-# C compiler settings (gcc-3.4.4 cygwin 19.24)
+# C compiler settings (gcc-4.9.2 cygwin)
 #
-CC:=gcc
+CC:=i686-pc-mingw32-gcc
 
 # VM config flags.
 ifeq ("$(CONFIGURATION)","product")
@@ -142,15 +142,15 @@
 else
 COGDEFS:=-DCOGMTVM=0 -DDEBUGVM=$(DEBUGVM)
 endif
-
 # Set minimum version to WindowsXP (see /cygwin/usr/include//w32api/w32api.h)
 WINVER:=-D_WIN32_WINNT=0x0501 -DWINVER=0x0501
 
-INCLUDEPATH:= -isystem/usr/include/mingw -I/usr/include/w32api
+# INCLUDEPATH:= -isystem/usr/include/mingw -I/usr/include/w32api
+INCLUDEPATH:= -I/usr/i686-pc-mingw32/sys-root/mingw/include
 # define _MT to eliminate the inline versions of printf et al in mingw/stdio.h
-NOBUILTIN:= -D_MT -fno-builtin-printf -fno-builtin-putchar -fno-builtin-fprintf
-CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mthreads -mno-cygwin -mwin32 \
-	-mno-rtd -mms-bitfields -mno-accumulate-outgoing-args $(OFLAGS) $(NOBUILTIN)
+NOBUILTIN:= -D_MT -fno-builtin-printf -fno-builtin-putchar -fno-builtin-bzero
+CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mthreads -mwin32 \
+	-mno-rtd -mms-bitfields -maccumulate-outgoing-args -mstack-arg-probe $(OFLAGS) $(NOBUILTIN)
 TZ:=$(shell date +%Z)
 DEFS:=	$(COGDEFS) $(WINVER) -DWIN32 -DWIN32_FILE_SUPPORT -DNO_ISNAN \
 		-DNO_SERVICE -DNO_STD_FILE_SUPPORT -D'TZ="$(TZ)"' \
@@ -165,26 +165,28 @@
 #       The switch '-mwindows' gives us a GUI app instead of a console app.
 #		Newer cygwins want --export-all-symbols in place of --export-dynamic.
 #
-LD:=	 gcc
-EXPORT:=--export-dynamic
-#EXPORT:=--export-all-symbols
-BASELDFLAGS:=-mno-cygwin -mthreads -Wl,--large-address-aware,$(EXPORT) -L/usr/lib/mingw
+
+LD:=i686-w64-mingw32-gcc
+#EXPORT:=--export-dynamic
+EXPORT:=--export-all-symbols
+BASELDFLAGS:=-mthreads -Wl,--large-address-aware,$(EXPORT) -L/usr/i686-pc-mingw32/sys-root/mingw/lib
 LDFLAGS:= -mwindows $(BASELDFLAGS)
 CONSOLELDFLAGS:= -mconsole $(BASELDFLAGS)
 STDLIBS:= -lddraw -ldinput -lopengl32 -lwsock32 -lcomdlg32 -lole32 -lwinmm \
-	-lversion -lwininet -luser32 -lgdi32 -lpsapi -lkernel32 -lcrtdll \
-	-ldsound -lsecur32
+	-lversion -lwininet -luser32 -lgdi32 -lpsapi -lkernel32 -lmsvcrt \
+	-ldsound -lsecur32 -lws2_32
 
 #############################################################################
 # Tools to use
 #
-AR:= ar rc
+AR:= i686-pc-mingw32-ar rc
 CP:= cp
 RM:= rm
-DLLTOOL:=	dlltool
-DLLWRAP:=	dllwrap
-STRIP:=	strip
-OBJCOPY:=	objcopy
+DLLTOOL:= i686-pc-mingw32-dlltool
+DLLWRAP:= i686-pc-mingw32-dllwrap
+STRIP:=	i686-pc-mingw32-strip
+OBJCOPY:= i686-pc-mingw32-objcopy
+NM:=i686-pc-mingw32-nm
 
 #############################################################################
 # RC settings
@@ -191,7 +193,7 @@
 #
 # Note: RC compiles the .rc files into linkable .o files
 #
-RC:=	 windres
+RC:= i686-pc-mingw32-windres
 SVNREV:= $(shell sed -e "s/^static.*SvnRawRevisionString.*Rev: \([0-9][0-9]*\).*/\\1/p" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h)
 RCFLAGS:= --include-dir $(PLATDIR)/win32/misc -D_WIN32 -DFILEVERSIONVALUES=4,0,$(SVNREV),0 '-DFILEVERSIONSTRING=\"4.0.$(SVNREV)\\0\"'
 
@@ -269,13 +271,13 @@
 	@echo -----------------------------------------------------
 
 eitheror.exe: $(WIN32UTILDIR)/eitheror.c
-	$(CC) -o $@ -O1 -mconsole -mno-cygwin $<
+	$(CC) -o $@ -O1 -mconsole $<
 
 mingw32ver.exe: $(WIN32UTILDIR)/mingw32ver.c
-	$(CC) -o $@ -O1 -mconsole -mno-cygwin $<
+	$(CC) -o $@ -O1 -mconsole $<
 
 mkNamedPrims.exe: $(WIN32UTILDIR)/mkNamedPrims.c
-	$(CC) -o $@ -mconsole -mno-cygwin $<
+	$(CC) -o $@ -mconsole $<
 
 $(BTOBJ):	$(WIN32MISCDIR)/btext.c
 	$(CC) -c -o $@ -fomit-frame-pointer -O2 $<
@@ -289,13 +291,13 @@
 	$(CC) -o $(OBJDIR)/version.o $(CFLAGS) $(INCLUDES) $(DEFS) -c $(WIN32DIR)/version.c
 	$(LD) $(LDFLAGS) -o $(VMEXE) \
 			$(BTOBJ) $(VMOBJ) $(VMEXP) $(OBJDIR)/resource.o $(LIBS) $(STDLIBS) $(ETOBJ)
-	nm --numeric-sort --defined-only -f bsd $(VMEXE) >$(VMMAP)
+	$(NM) --numeric-sort --defined-only -f bsd $(VMEXE) >$(VMMAP)
 
 $(CONSOLEVMEXE): $(VMOBJ) $(LIBS) $(VMEXP) resource.o $(BTOBJ) $(ETOBJ)
 	$(CC) -o $(OBJDIR)/version.o $(CFLAGS) $(INCLUDES) $(DEFS) -c $(WIN32DIR)/version.c
 	$(LD) $(CONSOLELDFLAGS) -o $(CONSOLEVMEXE) \
 			$(BTOBJ) $(VMOBJ) $(VMEXP) $(OBJDIR)/resource.o $(LIBS) $(STDLIBS) $(ETOBJ)
-	nm --numeric-sort --defined-only -f bsd $(CONSOLEVMEXE) >$(CONSOLEVMMAP)
+	$(NM) --numeric-sort --defined-only -f bsd $(CONSOLEVMEXE) >$(CONSOLEVMMAP)
 
 ifneq ($STRIPEXE,)
 $(STRIPEXE): $(VMEXE)
Index: build.win32x86/squeak.cog.v3/Makefile.plugin
===================================================================
--- build.win32x86/squeak.cog.v3/Makefile.plugin	(revision 3440)
+++ build.win32x86/squeak.cog.v3/Makefile.plugin	(working copy)
@@ -1,7 +1,7 @@
 #############################################################################
 # Generic Makefile for plugins
 #############################################################################
-AR:= ar rc
+AR:= i686-pc-mingw32-ar rc
 CP:= cp
 RM:= rm
 
@@ -46,18 +46,19 @@
 LIBSRC:= $(notdir $(MAKERSRC) $(WIN32SRC) $(CROSSSRC))
 
 #############################################################################
-# C compiler settings (gcc-3.4.4 cygwin 19.24)
+# C compiler settings (gcc-4.9.2 cygwin)
 #
 NDEBUG:=-DNDEBUG
 # Set minimum version to WindowsXP (see /cygwin/usr/include//w32api/w32api.h)
 WINVER:=-D_WIN32_WINNT=0x0501 -DWINVER=0x0501
-CC:=	gcc
+CC:= i686-pc-mingw32-gcc
 # define _MT to eliminate the inline versions of printf et al in mingw/stdio.h
 OFLAGS:= -D_MT -O1 -march=pentium4 -momit-leaf-frame-pointer -funroll-loops \
-		-fno-builtin-printf -fno-builtin-putchar -fno-builtin-fprintf
-INCLUDEPATH:= -isystem/usr/include/mingw -I/usr/include/w32api
-CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mdll -mno-cygwin -mwin32 \
-	-mno-rtd -mms-bitfields -mno-accumulate-outgoing-args $(OFLAGS)
+		-fno-builtin-printf -fno-builtin-putchar -fno-builtin-bzero
+# INCLUDEPATH:= -isystem/usr/include/mingw -I/usr/include/w32api
+INCLUDEPATH:= -I/usr/i686-pc-mingw32/sys-root/mingw/include
+CFLAGS:= $(INCLUDEPATH) -msse2 -ggdb2 -mwindows -mdll -mwin32 \
+	-mno-rtd -mms-bitfields -maccumulate-outgoing-args -mstack-arg-probe $(OFLAGS)
 DEFS:=	$(WINVER) -DWIN32 -DWIN32_FILE_SUPPORT -DNO_ISNAN \
 		-DNO_SERVICE -DNO_STD_FILE_SUPPORT \
 		$(NDEBUG) -DLSB_FIRST -DVM_NAME=\"$(VM)\" -DX86 $(XDEFS)
@@ -68,9 +69,9 @@
 # Note: By default DLLTOOL/DLLWRAP do the work for everything related to plugins
 # but if LINK_WITH_GCC we use gcc and if LINK_WITH_GPP we use g++.
 #
-DLLTOOL:=	dlltool
-DLLWRAP:=	dllwrap -mno-cygwin
-#OPTSTRIP:=	strip # for production
+DLLTOOL:=i686-pc-mingw32-dlltool
+DLLWRAP:=i686-pc-mingw32-dllwrap
+#OPTSTRIP:=	i686-pc-mingw32-strip # for production
 OPTSTRIP:=	echo not doing strip
 
 .SUFFIXES:	.c .cpp .o .s .rc .res .dep
Index: build.win32x86/squeak.cog.v3/mvm
===================================================================
--- build.win32x86/squeak.cog.v3/mvm	(revision 3440)
+++ build.win32x86/squeak.cog.v3/mvm	(working copy)
@@ -1,16 +1,16 @@
 #!/bin/sh
 rm -rf build*/vm/Croquet*.exe build*/vm/Squeak*.exe
-make debug 2>&1 | tee LOGD
-make assert 2>&1 | tee LOGA
-make 2>&1 | tee LOGF
-make THREADING=multi CONFIGURATION=debug 2>&1 | tee LOGTD
-make THREADING=multi CONFIGURATION=assert 2>&1 | tee LOGTA
-make THREADING=multi 2>&1 | tee LOGTF
+make debug 2>LOGD_E | tee LOGD
+make assert 2>LOGA_E | tee LOGA
+make 2>LOGF_E | tee LOGF
+#make THREADING=multi CONFIGURATION=debug 2>&1 | tee LOGTD
+#make THREADING=multi CONFIGURATION=assert 2>&1 | tee LOGTA
+#make THREADING=multi 2>&1 | tee LOGTF
 ls -rlt build*/vm/Squeak*.exe
-if test -f ../../sources/SqueakV41.sources; then
+if test -f ../../sources/SqueakV46.sources; then
 	for d in build buildast builddbg; do
-		if [ -d $d/vm -a !  -f $d/vm/SqueakV41.sources ]; then
-			ln ../../sources/SqueakV41.sources $d/vm
+		if [ -d $d/vm -a !  -f $d/vm/SqueakV46.sources ]; then
+			ln ../../sources/SqueakV46.sources $d/vm
 		fi
 	done
 fi
Index: build.win32x86/squeak.cog.v3/plugins.ext
===================================================================
--- build.win32x86/squeak.cog.v3/plugins.ext	(revision 3440)
+++ build.win32x86/squeak.cog.v3/plugins.ext	(working copy)
@@ -2,7 +2,5 @@
 # N.B. SqueakSSL is not ready for prime time.  Compiles but does not link fully.
 # See platforms/win32/plugins/SqueakSSL/Makefile
 EXTERNAL_PLUGINS = \
-BochsIA32Plugin \
 SqueakFFIPrims \
 Win32OSProcessPlugin
-
Index: platforms/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c
===================================================================
--- platforms/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c	(revision 3440)
+++ platforms/Cross/plugins/Mpeg3Plugin/libmpeg/changesForSqueak.c	(working copy)
@@ -128,7 +128,7 @@
 #endif
 
 #ifdef WIN32
-int bzero(char* block, long size) {
+void bzero(void* block, size_t size) {
 	ZeroMemory(block,size);
 }
 #endif
Index: platforms/win32/Makefile.mingw32
===================================================================
--- platforms/win32/Makefile.mingw32	(revision 3440)
+++ platforms/win32/Makefile.mingw32	(working copy)
@@ -1,5 +1,5 @@
 #############################################################################
-# Makefile for Win32 Squeak using gcc-2.95.2 and MingW32
+# Makefile for Win32 Squeak using gcc-4.9.2 and cygwin
 #############################################################################
 ifndef SRCDIR
 include plugins/plugins.ext
@@ -10,7 +10,7 @@
 endif
 
 
-AR = ar rc
+AR = i686-pc-mingw32-ar rc
 CP = cp
 RM = rm
 
@@ -92,7 +92,7 @@
 #############################################################################
 # C compiler settings (for egcs-1.1.2)
 #
-CC=		gcc
+CC=	i686-pc-mingw32-gcc
 OFLAGS=         -O2
 CFLAGS=		-g -mpentium -mwindows -Werror-implicit-function-declaration -fomit-frame-pointer -funroll-loops -fschedule-insns2 $(OFLAGS)
 DEFS=		-DWIN32_FILE_SUPPORT -DNO_SERVICE -DNO_STD_FILE_SUPPORT -DNDEBUG -DLSB_FIRST -DVM_NAME=\"$(VM)\" -DX86 $(XDEFS)
@@ -110,7 +110,7 @@
 # Note: I had to use 'gcc' instead of 'ld' to prevent unresolved symbols
 #       The switch '-mwindows' gives us a GUI app instead of a console app.
 #
-LD=			gcc
+LD=	i686-pc-mingw32-ld
 LDFLAGS=	-mwindows
 STDLIBS=	-lddraw -ldinput -lopengl32 -lwsock32 -lcomdlg32 -lole32 -lwinmm -luser32 -lgdi32 -lkernel32
 CRTLIB =	-lcrtdll
@@ -128,8 +128,8 @@
 #
 # Note: DLLTOOL/DLLWRAP does the work for everything related to plugins
 #
-DLLTOOL=	dlltool
-DLLWRAP=	dllwrap
+DLLTOOL=i686-pc-mingw32-dlltool
+DLLWRAP=i686-pc-mingw32-dllwrap
 
 #############################################################################
 # RC settings
@@ -137,7 +137,7 @@
 # Note: RC compiles the .rc files into linkable .o files
 #       !!!WARNING!!! windres can break if you have MacAfee VShield running!!!
 #
-RC=			windres
+RC=i686-pc-mingw32-windres
 RCFLAGS=	--include-dir $(SRCDIR)/misc
 
 .SUFFIXES:
Index: platforms/win32/plugins/DropPlugin/sqWin32Drop.c
===================================================================
--- platforms/win32/plugins/DropPlugin/sqWin32Drop.c	(revision 3440)
+++ platforms/win32/plugins/DropPlugin/sqWin32Drop.c	(working copy)
@@ -22,13 +22,6 @@
 #endif
 
 int sqSecFileAccessCallback(void *function) {
-#ifndef _MSC_VER
-#warning "REMOVE THIS NONSENSE"
-#warning "REMOVE THIS NONSENSE"
-#warning "REMOVE THIS NONSENSE"
-#warning "REMOVE THIS NONSENSE"
-#warning "REMOVE THIS NONSENSE"
-#endif
   return 0;
 }
 
Index: platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c
===================================================================
--- platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c	(revision 3440)
+++ platforms/win32/plugins/HostWindowPlugin/sqWin32HostWindowPlugin.c	(working copy)
@@ -289,7 +289,7 @@
     bmi->bmiHeader.biWidth = nPix;
     bmi->bmiHeader.biHeight = 1;
     bmi->bmiHeader.biSizeImage = 0;
-    bitsPtr = dispBits + start + (updateRect.top * pitch);
+    bitsPtr = (int)dispBits + start + (updateRect.top * pitch);
     for(line = updateRect.top; line < updateRect.bottom; line++) {
       lines = SetDIBitsToDevice(dc, left, line, nPix, 1, 0, 0, 0, 1,
 				(void*) bitsPtr, bmi, DIB_RGB_COLORS);
Index: platforms/win32/plugins/SocketPlugin/sqWin32NewNet.c
===================================================================
--- platforms/win32/plugins/SocketPlugin/sqWin32NewNet.c	(revision 3440)
+++ platforms/win32/plugins/SocketPlugin/sqWin32NewNet.c	(working copy)
@@ -1363,7 +1363,7 @@
      of windows get this done without failing. */
   if(runningVista && socketType == TCPSocketType) {
     unsigned int val = 65536;
-    setsockopt(newSocket, SOL_SOCKET, SO_RCVBUF, &val, sizeof(val));
+    setsockopt(newSocket, SOL_SOCKET, SO_RCVBUF, (char*)&val, sizeof(val));
   }
 
   /* initialize private socket structure */
Index: platforms/win32/plugins/SocketPlugin/winsock2.h
===================================================================
--- platforms/win32/plugins/SocketPlugin/winsock2.h	(revision 3440)
+++ platforms/win32/plugins/SocketPlugin/winsock2.h	(working copy)
@@ -825,8 +825,8 @@
     SOCKET_ADDRESS  Address[1];
 } SOCKET_ADDRESS_LIST, * LPSOCKET_ADDRESS_LIST;
 
-#ifndef __BLOB_T_DEFINED /* also in wtypes.h and nspapi.h */
-#define __BLOB_T_DEFINED
+#ifndef _BLOB_DEFINED /* also in wtypes.h and nspapi.h */
+#define _BLOB_DEFINED
 typedef struct _BLOB {
 	ULONG	cbSize;
 	BYTE	*pBlobData;
Index: platforms/win32/vm/sqGnu.h
===================================================================
--- platforms/win32/vm/sqGnu.h	(revision 3440)
+++ platforms/win32/vm/sqGnu.h	(working copy)
@@ -164,7 +164,7 @@
 
 #define PROFILE_BYTECODE(x) __asm__("movl %0, _bcProfileCurrent" : : "i" (x))
 
-#define PROFILE_BYTECODE_END __asm__("
+#define PROFILE_BYTECODE_END __asm__(" \
 	cmpl $0, _profilerActive;\
 	je 0f;\
 	pushl %ebx;\
Index: platforms/win32/vm/sqWin32GUID.c
===================================================================
--- platforms/win32/vm/sqWin32GUID.c	(revision 3440)
+++ platforms/win32/vm/sqWin32GUID.c	(working copy)
@@ -11,7 +11,10 @@
 #include <dsound.h>
 #include <dsconf.h>
 #include <d3d.h>
+
+#define DIRECTINPUT_VERSION 0x0800
 #include <dinput.h>
+
 #include <unknwn.h>
 
 
Index: platforms/win32/vm/sqWin32Threads.c
===================================================================
--- platforms/win32/vm/sqWin32Threads.c	(revision 3440)
+++ platforms/win32/vm/sqWin32Threads.c	(working copy)
@@ -13,7 +13,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #ifdef __MINGW32__
-# define _STRUCT_NAME(foo) foo
 # include <basetyps.h>
 #endif
 #include <limits.h>
Index: src/plugins/HostWindowPlugin/HostWindowPlugin.c
===================================================================
--- src/plugins/HostWindowPlugin/HostWindowPlugin.c	(revision 3440)
+++ src/plugins/HostWindowPlugin/HostWindowPlugin.c	(working copy)
@@ -370,7 +370,7 @@
 {
 	sqInt bottom;
 	sqInt d;
-	unsigned *dispBits;
+	unsigned char *dispBits;
 	sqInt h;
 	sqInt left;
 	sqInt ok;
@@ -381,7 +381,7 @@
 
 	windowIndex = stackIntegerValue(8);
 	success(isWords(stackValue(7)));
-	dispBits = ((unsigned *) (firstIndexableField(stackValue(7))));
+	dispBits = ((unsigned char *) (firstIndexableField(stackValue(7))));
 	w = stackIntegerValue(6);
 	h = stackIntegerValue(5);
 	d = stackIntegerValue(4);
Index: src/plugins/MIDIPlugin/MIDIPlugin.c
===================================================================
--- src/plugins/MIDIPlugin/MIDIPlugin.c	(revision 3440)
+++ src/plugins/MIDIPlugin/MIDIPlugin.c	(working copy)
@@ -212,7 +212,7 @@
 	if (failed()) {
 		return null;
 	}
-	sz = sqMIDIGetPortName(portNum, portName, 0xFF);
+	sz = sqMIDIGetPortName(portNum, (int)portName, 0xFF);
 	nameObj = instantiateClassindexableSize(classString(), sz);
 	if (failed()) {
 		return null;
Index: src/plugins/SerialPlugin/SerialPlugin.c
===================================================================
--- src/plugins/SerialPlugin/SerialPlugin.c	(revision 3440)
+++ src/plugins/SerialPlugin/SerialPlugin.c	(working copy)
@@ -185,7 +185,7 @@
 	success((startIndex >= 1)
 	 && (((startIndex + count) - 1) <= (byteSizeOf(((sqInt)(long)(array) - BaseHeaderSize)))));
 	arrayPtr = ((((sqInt)array)) + startIndex) - 1;
-	bytesRead = serialPortReadInto( portNum, count, arrayPtr);
+	bytesRead = serialPortReadInto( portNum, count, (void*)arrayPtr);
 	_return_value = integerObjectOf(bytesRead);
 	if (failed()) {
 		return null;
@@ -219,7 +219,7 @@
 	 && (((startIndex + count) - 1) <= (byteSizeOf(((sqInt)(long)(array) - BaseHeaderSize)))));
 	if (!(failed())) {
 		arrayPtr = ((((sqInt)array)) + startIndex) - 1;
-		bytesWritten = serialPortWriteFrom(portNum, count, arrayPtr);
+		bytesWritten = serialPortWriteFrom(portNum, count, (void*)arrayPtr);
 	}
 	_return_value = integerObjectOf(bytesWritten);
 	if (failed()) {
Index: src/plugins/SoundCodecPrims/SoundCodecPrims.c
===================================================================
--- src/plugins/SoundCodecPrims/SoundCodecPrims.c	(revision 3440)
+++ src/plugins/SoundCodecPrims/SoundCodecPrims.c	(working copy)
@@ -131,7 +131,7 @@
 	}
 	srcSize = slotSizeOf(src);
 	dstSize = (slotSizeOf(dst)) * 2;
-	gsmDecode(state + BaseHeaderSize, frameCount, src, srcIndex, srcSize, dst, dstIndex, dstSize, &srcDelta, &dstDelta);
+	gsmDecode(state + BaseHeaderSize, frameCount, src, srcIndex, srcSize, dst, dstIndex, dstSize, (long int*)&srcDelta, (long int*)&dstDelta);
 	if (failed()) {
 		return null;
 	}
@@ -174,7 +174,7 @@
 	}
 	srcSize = (slotSizeOf(src)) * 2;
 	dstSize = slotSizeOf(dst);
-	gsmEncode(state + BaseHeaderSize, frameCount, src, srcIndex, srcSize, dst, dstIndex, dstSize, &srcDelta, &dstDelta);
+	gsmEncode(state + BaseHeaderSize, frameCount, src, srcIndex, srcSize, dst, dstIndex, dstSize, (long int*)&srcDelta, (long int*)&dstDelta);
 	if (failed()) {
 		return null;
 	}


More information about the Squeak-dev mailing list