Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-30 Thread Domingo Alvarez Duarte
First of all thanks for Daniel for the fix ! I followed the code on fossil-scm with printfs on va_start/va_end using the previous tcc stdargs implementation and it showed me that both the parent and child do va_end on the same pointer that's why the segfault. And as I looked on the generated

Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-30 Thread Daniel Glöckner
On Sun, Mar 30, 2014 at 04:10:48PM +0100, Domingo Alvarez Duarte wrote: I followed the code on fossil-scm with printfs on va_start/va_end using the previous tcc stdargs implementation and it showed me that both the parent and child do va_end on the same pointer that's why the segfault. As long

Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-29 Thread Daniel Glöckner
Errr. I see you now fiddled with that on mob. Commit c025478d7c03, rewriting va* to not use malloc. That's completely wrong. You've effectively changed the ABI of stdarg, and hence interoperability with every non-TCC compiler. The public va_list on x86_64 _must_ be a pointer. Actually

Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-29 Thread Daniel Glöckner
On Sat, Mar 29, 2014 at 11:46:26PM +0100, Daniel Glöckner wrote: Actually sizeof(va_list) is 24 on x86_64 GCC although va_list is passed as a pointer. So we should typedef void *va_list[3]; Or simply typedef struct __va_list_struct va_list[1];

Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-29 Thread Daniel Glöckner
On Sat, Mar 29, 2014 at 11:52:42PM +0100, Daniel Glöckner wrote: Or simply typedef struct __va_list_struct va_list[1]; Fixed in mob. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-29 Thread Michael Matz
Hi, On Sat, 29 Mar 2014, Domingo Alvarez Duarte wrote: Thanks for pointing it and show an example to test ! Now going back to the original problem the original tcc implementation leaks memory on: void *__va_copy(struct __va_list_struct *src) {     struct __va_list_struct *dest =        

Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-28 Thread Domingo Alvarez Duarte
I found that on X86_64 linux if I do not free the memory on __va_end(), the compiled fossil-scm server works, I suspect is something with the fork/threads. --- void __va_end(struct __va_list_struct *ap) { //free(ap); } Cheers ! On Thu, Mar 27, 2014 at 12:23 PM, Domingo Alvarez Duarte