tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Trouble on x86-64, not windows, not gcc


From: Michael Matz
Subject: Re: [Tinycc-devel] Trouble on x86-64, not windows, not gcc
Date: Sun, 10 Jul 2016 19:21:57 +0200 (CEST)
User-agent: Alpine 2.20 (LSU 67 2015-01-07)

Hi,

On Sat, 9 Jul 2016, David Mertens wrote:

When run on Mac systems, I get errors about "incompatible redefinition of
'va_list'".

Is that the message from TCC or from some other compiler? The other compiler should use its own <stdarg.h>, not TCCs version. If the message comes from TCC, what are the two definitions of va_list and where does the one not coming from TCCs <stdarg.h> comes from?

(Ultimately the layout of va_list has to be compatible between compilers on the same system anyway; it's dictated by the psABI.)

Looking at the source files involved, I'm pretty sure this occurs on x86-64 systems that are neither Windows nor built with gcc. Such systems include 64-bit Macs and BSDs using clang.

Normal BSDs use the sysv ELF psABI, so better have the same definition of va_list like in TCCs <stdarg.h>. Darwin uses the same layout as sysv as well. What could happen is that there are some (and different) type aliases in between va_list and the real struct type.

It might also occur on Solaris, though I've not received any reports from that system yet.

Solaris as well.

TCC's handling of variable argument lists are spelled out in stdarg.h, with implementation in libtcc1.c. I think that for 64-bit machines, we should also check for clang, and then use clang-compatible definitions. I think I could just check if __llvm__ and/or __clang__ are defined, and then insert the appropriate definitions. Does this sound right?

Not quite. The definition of va_list depends on the system, not on the compiler. clang can be used with different systems. So if anything the appropriate define would be something MacOS/Darwin related.

I'd be happy to work on a solution, but I don't have access to a Mac machine
or a BSD system. I'm not interested in going through a full-on BSD
installation at this time, so if anybody knows where I could find a
pre-canned BSD virtualbox image with working git and cc, I'd be much
obliged.

You need some Darwin system to properly solve this. I wonder how you get the above error message on Mac if you don't have to Macs?


Ciao,
Michael.



reply via email to

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