Re: [Tinycc-devel] (no subject)

2019-05-10 Thread Daniel Glöckner
Hi Andy,

On Fri, May 10, 2019 at 07:30:24PM +0300, ANDY TAKKER wrote:
> A lot of words are said about compatibility and portability, but GCC
> and PCC bring one result, and TCC is completely different.

Let's for a second assume that you run that code on an architecture with
sizeof(char*) == sizeof(int).

Why should TCC generate the same output as GCC and PCC?
You attempt to skip the prologue of the function by adding 3 to the
address, but the prologue is not standardized. The one used by TCC
is different from the one used by GCC. Just compare the output of
GCC with -O0 and GCC with -O3 -fomit-frame-pointer. That should also
give you different results. And with -O3 GCC might even decide to omit
that asm statement because it has no needed outputs, doesn't clobber
anything and isn't marked as volatile.

> Here is
> another interesting link closely related to the TCC.
> https://forum.nasm.us/index.php?topic=2524.0

If you have access to the output of that obscure mix of compiler,
assembler, and linker, please provide the disassembly of the _start
function.

> nop jump:

Sometimes TCC has to reserve space for an instruction before it knows
if it is needed or how long it will be. To fill the gaps, it uses nops.

Best regards,

  Daniel

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


[Tinycc-devel] tcc_relocate is missing in libtcc.dll

2019-05-10 Thread Antoni Nowinowski
Hello,
I'm working on small jit project that's already worked with precompiled tcc 
downloaded from bellard.org/tcc/. To be more 
"professional" I compiled tcc from source as described in tcc-win32.txt . 
Resulting libtcc.dll wasn't exporting tcc_relocate (I used both gcc and msvc in 
both mob and master branches). To my suprise libtcc.dll compiled by tcc 
contained the missing function but it was crashing jit project executable 
compiled with appropriate lib file. Is this expected behaviour? If yes, how to 
achieve effect similar to libtcc_test.c? Finally, why libtcc_test.c is gone? 
Thank you for your patience.

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