[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] TCC very interesting error

From: grischka
Subject: Re: [Tinycc-devel] TCC very interesting error
Date: Wed, 28 Oct 2009 12:53:37 +0100

In general, it is not possible to use object code from msvc or mingw with tcc
on windows, because although the code might work instruction-wise, tinycc could not link it because it use a different object format (i.e. ELF).

This is the reason why we need to use TCC itself to compile __chkstk.S. In any case, until we fixed the TCC assembler such that it can do that correctly again, you can use the current master branch, it does not have that problem.

I suspect it has to do with the 16-bit assembler support added in this commit:

I know there are more than one person out there who should be able to fix this, I just hope it happens ;)

--- grischka

----- Original Message ----- From: "Rutenis Turcinas" <address@hidden>
To: <address@hidden>
Sent: Wednesday, October 28, 2009 12:03 PM
Subject: Re: [Tinycc-devel] TCC very interesting error

I have found in google a solution for "undefined reference to `_chkstk'":

Current solution is to copy the CHKSTK.OBJ from MSVC6. I renamed it to
chkstk.o so that CMake would let me link with it in MinGW. (url to that

But is it possible? Can it help in my problem? Or my case is somewhat

2009/10/27 grischka <address@hidden>

Adding this one more variable causes the local stack grow over 4096.  This
requires the usage of __chkstk on windows (because there, unlike on linux,
each new stack page needs to be touched explicitely to make sure it gets
physically mapped)

However there seems a problem with latest TCC having problems to assemble
its own __chkstk function.  In particular there are some 66 prefixes that
not be there.  See below.

Mr. Frederic Feret, would you look into it ?

--- grischka

004010A0     66:872C24         xchg [esp],bp
004010A4     55                push ebp
004010A5     66:8D6C24 04      lea bp,[esp+4]
004010AA     51                push ecx
004010AB     89E9              mov ecx,ebp
004010AD     66:81E9 0010      sub cx,1000
004010B2     66:8501           test [ecx],ax
004010B5     66:2D 0010        sub ax,1000
004010B9     66:3D 0010        cmp ax,1000
004010BD   - 66:7D ED          jge short 000010AD
004010C0     29C1              sub ecx,eax
004010C2     66:8501           test [ecx],ax
004010C5     89E0              mov eax,esp
004010C7     89CC              mov esp,ecx
004010C9     66:8B08           mov cx,[eax]
004010CC     66:FF60 04        jmp near [eax+4]


Tinycc-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]