On Jan 1, 2013, at 9:35 AM, Per Johansson wrote:
But llvm-mc isn't a tool intended to be used by the end user. It's an LLVM developer's tool intended to be used to test and play with LLVM's MC library (which Clang uses to implement its integrated assembler). The help output even says "llvm machine code playground". That's why Apple doesn't distribute it with Xcode.
The right thing IMO is to test if we're compiling with Clang. If we are, then we should test if Clang is using its integrated assembler; if it is, then we should invoke Clang instead of the system assembler to assemble. This way, the user doesn't have to pass yet another option to configure in case he's using Clang.
I have a patch to hack-fix winebuild to invoke Clang if we're being compiled by Clang; I can fix it to test for Clang and Clang's integrated assembler in configure and send it to the list--something I really should've done a while ago.
Chip
On Tue, Jan 1, 2013 at 6:00 PM, Charles Davis cdavis5x@gmail.com wrote:
The right thing IMO is to test if we're compiling with Clang. If we are, then we should test if Clang is using its integrated assembler; if it is, then we should invoke Clang instead of the system assembler to assemble. This way, the user doesn't have to pass yet another option to configure in case he's using Clang.
I have a patch to hack-fix winebuild to invoke Clang if we're being compiled by Clang; I can fix it to test for Clang and Clang's integrated assembler in configure and send it to the list--something I really should've done a while ago.
Sure, sounds like a better plan. I tried briefly to use clang, but there were a lot of undefined symbol errors I wasn't sure how to fix. Tell me if you want some help with the patch.
Regards,
On Tue, Jan 1, 2013 at 7:11 PM, Per Johansson per@morth.org wrote:
Btw, I should probably add that there's currently no way to build unpatched wine on 10.8 (and probably 10.7), as gcc-apple-4.2 get a conflict about cpu_type_t and pure gcc is not up to date with the latest Objective-C syntax in the system headers. Being able to build with clang would help a lot.
Regards,
On Jan 1, 2013, at 4:36 PM, Per Johansson wrote:
Patch is sent.
I tried briefly to use clang, but there were a lot of undefined symbol errors I wasn't sure how to fix.
What kind of undefined symbol errors? Other than the ones I got because as(1) from cctools can't grok CFI pseudo-ops (and probably never will because of Clang), I don't know of any symbol problems building Wine with Clang on Mac OS. Might have something to do with my system version (I'm still on 10.6, and I probably won't move until I find some way to run -arch ppc apps since Apple gutted Rosetta from 10.7...)
That probably means some system header is including--directly or indirectly--<mach/machine.h> (the system header that defines Mach's cpu_type_t) somewhere inside the server (which defines Wine's cpu_type_t), where it wasn't before. Want me to file a radar? (The last time something like this happened, I was told to file a radar with Apple. Amazingly, it worked! It probably helped that I pointed out which header pulled in a header that it didn't need; this time might be more difficult.)
Do you actually not have the Wine vs. Mach cpu_type_t issue with Clang? I'd find that interesting.
Chip
Regards,
Per Johansson
On Wed, Jan 2, 2013 at 3:12 AM, Charles Davis cdavis5x@gmail.com wrote:
What kind of undefined symbol errors? Other than the ones I got because as(1) from cctools can't grok CFI pseudo-ops (and probably never will because of Clang), I don't know of any symbol problems building Wine with Clang on Mac OS. Might have something to do with my system version (I'm still on 10.6, and I probably won't move until I find some way to run -arch ppc apps since Apple gutted Rosetta from 10.7...)
I think I simply forgot to add the -c flag, silly me. Patch seems to work, I'm getting some compile errors but I suppose it's a different problem:
avifile.DPJO1m.s:443:2: error: invalid operand for instruction lretw ^ avifile.DPJO1m.s:580:2: error: invalid operand for instruction lretw ^
Do you actually not have the Wine vs. Mach cpu_type_t issue with Clang? I'd find that interesting.
Yes, it doesn't appear with clang, and also not with gcc-mp-4.x from macports. I could open a radar myself (only have free membership), but I don't mind it too much since the default gcc compiler doesn't work anyway (wine bug 28030), so it might just as well get an error compiling if we get clang working.
Regards,
On Jan 2, 2013, at 5:35 AM, Per Johansson wrote:
That's fixed in LLVM/Clang trunk. (I know, because I fixed it myself. A while ago, actually; I'm surprised Xcode doesn't have it yet.) Maybe the next version of Xcode will pick up the fix. Someone should really prod Apple about this :).
I suspect that's because Clang and newer GCC are smarter about identical typedefs. The ObjC BOOL vs. Wine BOOL issue wasn't about identical typedefs, because an ObjC BOOL is a "signed char" while a Wine BOOL is an "int". But a Mach cpu_type_t is an "integer_t"... which, ultimately, is a plain "int", the same as Wine's cpu_type_t.
Yeah, I'm not sure anyone really cares about the dead Apple GCC branch anymore... except AJ, but that's because his old Mac mini is stuck on 10.5, where we don't even have that problem. So long as Wine compiles with Apple GCC 4.x on Leopard, he'll be happy :).
Chip
Regards,
Per Johansson