|
From: | Sergey Korshunoff |
Subject: | Re: [Tinycc-devel] [BUG] x86_64-tcc compiled by i386-tcc is wrong |
Date: | Fri, 20 Mar 2015 18:09:55 +0300 |
I changed defines in tcc.h like #define _GNU_SOURCE #include "config.h" #include <stdarg.h> +#ifdef TCC_TARGET_X86_64 + #undef i386 + #undef __i386 + #undef __i386__ + #ifndef __x86_64__ + #define __x86_64__ + #endif +#endif +#ifdef TCC_TARGET_X86 + #undef __x86_64__ + #ifndef i386 + #define i386 + #define __i386 + #define __i386__ + #endif +#endif then preprocess a sources by i386-tcc. When i386-tcc is used to link x86_64-tcc then result of the test program is wrong. When x86_64 is used to link the same source then result of the test program is right. Conclusion: crt*.o for the x86_64 possibly perform a x86_64 registers cleaning. This registers need to be cleaned on start of the x86_64 program generated by the x86_64-tcc (independed the crt*.o used)
[Prev in Thread] | Current Thread | [Next in Thread] |