nolib.zip is my actual project. nolib-test is a sample to recreate my problem.
The goal of my project is to read some input from a text file and execute a shell command based on the input. I don't like the shim creator app that comes with
chocolatey so I'm writing my own.
The code that raised this bug for me was where I read the input file into a buffer. I want to get the file size then create an appropriately sized buffer. Because I pass a variable for the array size, poasm wants to check the stack (for overflow?). __chkstk (I assume) is part of pocrt.lib. and since I omitted it, I get unresolved external symbol. If I try to put a dummy function in my code, I get a redefinition error.
I understand that I can compile the chkstk function I found in wcrt source and link to that lib but I wondered if I could put it as inline asm in my project.
So you should be able to reproduce like this
- Create a blank project
- Check the compiler option 'Omit default library name from object files
- Set the linker entry point to _start
- create a _start function, declare an int x initialized to 2, create an array of size x