[Top][All Lists]

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

Re: [Tinycc-devel] .fill .rept broken by "Clean up 64bit immediate suppo

From: Michael Matz
Subject: Re: [Tinycc-devel] .fill .rept broken by "Clean up 64bit immediate support"
Date: Mon, 16 May 2016 02:45:01 +0200 (CEST)
User-agent: Alpine 2.20 (LSU 67 2015-01-07)


On Sun, 15 May 2016, Sergey Korshunoff wrote:

The idea of using only tcc headers for lib/* compilation might sound good at 
first, but tcc
doesn't provide all standard headers (and shouldn't because it's not a full 
toolchain with C
library); it really relies on the existence of working/compatible target headers 
that also the lib/* > implementation can use.

But we can compile a cross-tcc compilers on i386 host w/o right
headers for target.
Why we stop on lib/* compilation? lib/* is a small support library for
the target.

Sure. Then first someone needs to rewrite the lib/* code such that it doesn't use any target headers at all.

It don't use/need a full target headers.

So, I offer two patches for you to try. The first (removing the typedefs from stddef.h) is more > correct, and the second might be more compatible with current behaviour.

The first patch don't helps.

Why not?  (I.e. what's still broken?)

And the second is not correct: with this patch a produced library use a host intptr_t (32 bit) for 64 bit targets.

No.  Read again:

+#elif defined(TCC_TARGET_X86_64) || defined(TCC_TARGET_ARM64)
     tcc_define_symbol(s, "__SIZE_TYPE__", "unsigned long");
     tcc_define_symbol(s, "__PTRDIFF_TYPE__", "long");
+    tcc_define_symbol(s, "__SIZE_TYPE__", "unsigned int");
+    tcc_define_symbol(s, "__PTRDIFF_TYPE__", "int");

On the two real 64bit targets we have ptrdiff_t will be long (64bit), on the 32bit targets it will be int (32bit). (Well, and win64 is handled as before).


reply via email to

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