[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] f67977: Rescue Win64 cygwin/mingw build and fix issue #498

Nicolas Cellier noreply at github.com
Thu Oct 1 07:30:07 UTC 2020


  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: f679770b318090f0abdddeabc59568a6520ed7f2
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/f679770b318090f0abdddeabc59568a6520ed7f2
  Author: Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>
  Date:   2020-10-01 (Thu, 01 Oct 2020)

  Changed paths:
    M build.win64x64/common/Makefile.tools

  Log Message:
  -----------
  Rescue Win64 cygwin/mingw build and fix issue #498

I (Nicolas Cellier) guess that this only affect cygwin build since there is a parallel Makefile.msvc.tools
`-mno-stack-arg-probe` prevents stack overflow detection when trying to allocate more than a page size on stack, see:
https://archive.is/J01oT

This option makes the VM crash at startup when built for mingw target via cygwin cross-platform toolchain.
Removing the option let the VM start, and the image can at least run some essential SUnit TestCase
Note sure however whether the VM is fully operational or not because I do not know if `-mno-stack-arg-probe` is really required or just an optimization...

`-mno-stack-arg-probe` could eventually work if we would be able to allocate a big enough stack at startup.
That's what we do when using MSVC tool chain:

> ../common/Makefile.msvc.tools:# the default stack size to 2Mb to avoid crashes in the JIT's alloca.
> ../common/Makefile.msvc.tools:DEFAULT_STACK_SIZE:=2097152
> ../common/Makefile.msvc.tools:STACK_LD_FLAG=/STACK:$(DEFAULT_STACK_SIZE),$(DEFAULT_STACK_SIZE)
> ../common/Makefile.msvc.tools:BASELDFLAGS:= $(STACK_LD_FLAG) /DYNAMICBASE /LARGEADDRESSAWARE /NXCOMPAT /DEBUG:FULL

This is supposed to have a solution in mingw too, see:
https://stackoverflow.com/questions/52406183/mingw-stack-size-reserved-or-committed

That's exactly what we are trying to do here:

> ../common/Makefile.tools:BASELDFLAGS:=-m64 -mthreads -Wl,--stack -Xlinker 2097152,2097152 -Wl,$(EXPORT)

Unfortunately, this option is apparently ignored (or overriden?)...




More information about the Vm-dev mailing list