[~]> clang -v clang version 2.9 (trunk 120281) Target: x86_64-unknown-linux-gnu Thread model: posix [~]> cat test.c #include <unwind.h> int main () { struct _Unwind_Exception exc; struct _Unwind_Context *context; _Unwind_GetCFA (context); return 0; } [~]> clang test.c In file included from test.c:1: /usr/lib64/gcc/x86_64-suse-linux/4.5/include/unwind.h:43:46: error: unknown machine mode '__unwind_word__' typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__))); ^ /usr/lib64/gcc/x86_64-suse-linux/4.5/include/unwind.h:44:45: error: unknown machine mode '__unwind_word__' typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__))); ^ 2 errors generated.
This should be pretty easy to implement if anyone was interested.
This is a check from glibc configure, so I am interested, any pointers?
#define __unwind_word__ word fixes the compilation and I verified gcc produces the same code with this.
Created attachment 6691 [details] proposed fix I've attached one possible implementation of this. I decided to add UnwindWord to the TargetInfo class, but then make it return getPointerWidth(0) with a "// FIXME". As far as I know, unwind_word == word on all platforms. Okay to commit?
(In reply to comment #4) > Created attachment 6691 [details] > proposed fix > > I've attached one possible implementation of this. I decided to add UnwindWord > to the TargetInfo class, but then make it return getPointerWidth(0) with a "// > FIXME". As far as I know, unwind_word == word on all platforms. iirc, on the spu and s/390 there's a difference. http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00969.html
FYI, we're going to have to work around this bug in Firefox, otherwise our stack-walking code won't work. Let me know if there's something we can do to help here. https://bugzilla.mozilla.org/show_bug.cgi?id=826962
(In reply to comment #6) > FYI, we're going to have to work around this bug in Firefox, otherwise our > stack-walking code won't work. > > Let me know if there's something we can do to help here. > > https://bugzilla.mozilla.org/show_bug.cgi?id=826962 Does the patch attached to this bug fix the issue for you? We don't support spu and s/390, so I guess it is fine.
> Does the patch attached to this bug fix the issue for you? We don't support spu > and s/390, so I guess it is fine. I don't have access to my Linux box for the next week, but supposing the patch works, then what? If I'm going to ask people to patch and compile clang to build DMD, I might as well tell them to use GCC to build DMD... I'd sooner stick an "#ifdef CLANG then #define __unwind_word__" above the #include <unwind.h>, I think.
(In reply to comment #8) > > Does the patch attached to this bug fix the issue for you? We don't support spu > > and s/390, so I guess it is fine. > > I don't have access to my Linux box for the next week, but supposing the patch > works, then what? My idea was to commit Nick's patch if it works. The only objection was about two architectures we don't support anymore.
> My idea was to commit Nick's patch if it works. The only objection was about > two architectures we don't support anymore. Ah, "we" was LLVM, not Firefox! Got it. :) I can get back to you in a week, although I'd be pretty surprised if this fix worked for him and not for me...
Fixed in 171781, 171782.