Re: [Tinycc-devel] How do I disable all runtime error checks in TCC?

2019-05-15 Thread Daniel Glöckner
On Wed, May 15, 2019 at 03:50:06PM -0700, Ben Hutchinson wrote:
> I would like to make it so it doesn't insert ANY error checking code such
> as stack checks, etc, into my program's code. You can tell if it is doing a
> stack check because if you use -nostdlib, you can compile some very simple
> programs, but if you try more complex programs it will give you the error:
> tcc: error: undefined symbol '__chkstk'

__chkstk is not for error checking. __chkstk is needed on Windows when
the stack frame of a function exceeds 4 kB, because Windows allows the
stack to grow only one page at a time. So __chkstk just touches all
stack pages needed by the function in the correct order.

If you are confident that you don't need __chkstk, you can provide your
own dummy implementation.

Best regards

  Daniel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] How do I disable all runtime error checks in TCC?

2019-05-15 Thread Ben Hutchinson
I would like to make it so it doesn't insert ANY error checking code such
as stack checks, etc, into my program's code. You can tell if it is doing a
stack check because if you use -nostdlib, you can compile some very simple
programs, but if you try more complex programs it will give you the error:
tcc: error: undefined symbol '__chkstk'

You also can tell if you haven't used -nostdlib because if you then look at
the resulting code in a debugger, you can see that it inserted a bunch of
extra code in your function that isn't there when you create less complex
programs (extra code, that goes beyond the required additional code for
simply making the more complex program, and clearly constitutes code that
the compiler inserted for error checking purposes).

This means that if it were using the standard library (which has been
disabled via the -nostdlib command line parameter), it would be using a
function called __chkstk. However, I wish to completely disable this error
checking code (and ALL other error checks that require standard C functions
and insertion of bloating code in my program). This will cut down on the
final size of the compiled program and increase its running speed, by
eliminating unnecessary runtime-error checking code from being put into my
program.

If it is possible to COMPLETELY disable these runtime error checks, please
let me know. If it is not possible in the current revision of TCC, please
consider in a future version of TCC allowing a command line switch to
completely disable the insertion of runtime error checking code.
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel