Just wondering if anyone has experimented building WINE with LLVM instead of GCC. For those who haven't been following it closely, LLVM/Clang is fairly mature now and can now build some really mammoth projects. Has anyone experimented in building WINE with LLVM/Clang? If so, what results were gotten? My understanding is that WINE tries hard to be pretty portable and non-GCC-specific, so I would expect good results...
Thanks From Jeff
On Mon, Oct 11, 2010 at 4:54 PM, Jeff Cook jeff@deserettechnology.com wrote:
Just wondering if anyone has experimented building WINE with LLVM instead of GCC. For those who haven't been following it closely, LLVM/Clang is fairly mature now and can now build some really mammoth projects. Has anyone experimented in building WINE with LLVM/Clang? If so, what results were gotten? My understanding is that WINE tries hard to be pretty portable and non-GCC-specific, so I would expect good results...
Wine is mostly used and developed on Linux, so parts of it were fairly GCC specific, but I think most of it has been fixed by now so its compatible with LLVM/clang.
Have a look at the Wiki page as well: http://wiki.winehq.org/Clang
Thanks From Jeff
Damjan Jovanovic
On Mon, 2010-10-11 at 08:54 -0600, Jeff Cook wrote:
Just wondering if anyone has experimented building WINE with LLVM instead of GCC.
Yes, several people used LLVM/CLANG for Wine and send patches.
From the commits:
http://source.winehq.org/git/wine.git/?a=search&st=commit&s=CLANG&am...
You are welcome to Help.
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 results...
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.
Chip
On Mon, Oct 11, 2010 at 8:18 AM, Charles Davis cdavis@mymail.mines.edu wrote:
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 results...
Charles would be the one to thank for most of the fixes (to Clang and Wine). Henri Verbeet and Ricardo Filipe sent quite a few patches as well. All of them can be found here:
http://source.winehq.org/git/wine.git/?a=search&h=HEAD&st=commit&...
For its current status, my test scripts builds wine daily with gcc and clang and submits test results. You can compare them here (for today's results): http://test.winehq.org/data/9d18f10a0d1f2d39f6f47fd4b0f439e9fffd20b2/index_W...
look for 'ae-ub1004' for the plain gcc versus 'ae-ub1004-clang' for clang. Currently, gcc fails 8 tests for me, clang fails 15.
2010/10/12 Austin English austinenglish@gmail.com:
On Mon, Oct 11, 2010 at 8:18 AM, Charles Davis cdavis@mymail.mines.edu wrote:
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 results...
Charles would be the one to thank for most of the fixes (to Clang and Wine). Henri Verbeet and Ricardo Filipe sent quite a few patches as well. All of them can be found here:
http://source.winehq.org/git/wine.git/?a=search&h=HEAD&st=commit&...
For its current status, my test scripts builds wine daily with gcc and clang and submits test results. You can compare them here (for today's results): http://test.winehq.org/data/9d18f10a0d1f2d39f6f47fd4b0f439e9fffd20b2/index_W...
look for 'ae-ub1004' for the plain gcc versus 'ae-ub1004-clang' for clang. Currently, gcc fails 8 tests for me, clang fails 15.
-- -Austin
to be clear, my patches and henri's were mostly cleanups and wine bug fixes found with clang's analysis tool. not really fixes to build with llvm/clang.