cdavis at mymail.mines.edu
Mon Oct 11 10:18:41 CDT 2010
On 10/11/10 8:54 AM, Jeff Cook wrote:
> Just wondering if anyone has experimented building WINE with LLVM
> instead of GCC.
I have. It's how I got involved in LLVM in the first place :). My very
first post to cfe-dev (the Clang development mailing list) was, in fact,
asking about building Wine with Clang.
> If so, what results were gotten?
After I fixed Clang (yes, I fixed Clang; I even have commit access to
their repository), it was able to build Wine, but the resulting Wine
didn't behave quite right compared to GCC-compiled Wine. Clang and LLVM
have come a long way since then--this was about a year ago, just so you
know--so I'm going to try again right now.
You can ask Austin English, too. He builds Wine with Clang and sends
patches to fix the warnings Clang reports.
> My understanding is that WINE tries hard
> to be pretty portable and non-GCC-specific, so I would expect good
This was my experience of about a year ago:
Wine uses--uh, used (does it still use?)--the 'static inline' extension
of GCC, which I had to implement in Clang because it claims to be GCC.
The other Clang devs were not pleased that I had to do that.
I also had to fix Clang to respect function pointers' declared calling
convention. Before then, you got tons of warnings when you compiled Wine
with Clang, because Clang would ignore the numerous __stdcall keywords
in the function pointer declarations. And that was a symptom of a bigger
problem where Clang wouldn't code-gen calls through those function
pointers right. It took me a while to get that one right.
Another time, I implemented the 'force_align_arg_pointer' attribute in
Clang (as well as the backend stuff in LLVM), which Wine needs to work
right on Mac OS X. The other Clang devs all pressured me ("+1! That's an
excellent idea!") to warn when the attribute was used on a function
pointer, where it is useless. So I did. Then I sent a patch to Wine to
disable it, but AJ stepped in and pressured me to take it out. After
explaining his position to the other Clang devs (basically, it boiled
down to "warning about this is stupid, especially if GCC doesn't warn
and Clang claims to be GCC"), they let me take it out.
Also, for a short time you had to tell Clang to compile in gnu89 mode
instead of gnu99; Wine was not yet C99 compliant then.
More information about the wine-devel