[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] build perl5 with tcc?
From: |
Jared Maddox |
Subject: |
Re: [Tinycc-devel] build perl5 with tcc? |
Date: |
Sun, 19 Jul 2015 23:25:35 -0500 |
> Date: Fri, 17 Jul 2015 09:11:02 -0400
> From: Chris Marshall <address@hidden>
> To: address@hidden
> Subject: Re: [Tinycc-devel] build perl5 with tcc?
> Message-ID:
> <address@hidden>
> Content-Type: text/plain; charset="utf-8"
>
> Hi David-
>
> I definitely plan to look at the C::TinyCompiler and XS::TCC
> modules once I can get tcc and libtcc running on my cygwin
> setup. Unfortunately, a direct cygwin build is not possible
> since the needed access to the program counter is not supported.
>
If you're talking about the x86 instruction pointer, the hardware
doesn't support direct access. If you're talking about something else,
please clarify.
The "standard" trick is to make a function call to some location, and
grab the return address from the stack. I recall that in some cases
the call is to literally the address immediately after the call,
though writing a function that returns it's own return address is
probably better if you think you'll do it twice or more.
Example code here:
http://stackoverflow.com/questions/599968/reading-program-counter-directly