ponyc
ponyc copied to clipboard
Cant build 32 bit Arm code with clang
I'll detail the errors more in this later. It's a placeholder. There's gnu unwind specific code in posix_except.c for 32 bit Arm that is going to be hard to deal with. There's other errors as well that might be because of differences between unwind for gcc and clang on 32 bit platforms. I need to look into it more.
I've identified some fixes for some of the errors. With those fixes, both gcc and clang work for those sections of code. I'll open a PR for them and then detail the rest of the current errors.
I believe @rtpax is taking a look at this one.
Some updates on what I've done so far, since I haven't had time to make final changes and a PR yet
Clang is building, mostly just removing the struct keyword because some structs became typedefs One changes are incompatible with gcc (_Unwind_Exception.exception_class data type is char[8] instead of uint64_t).
Is there some standardized way to differentiate by compiler in the ponyc codebase, or should I just use #ifdef clang (and do we need to support anything other than clang and gcc?)
#if defined(__clang__) is currently used so that should be fine.
Having a generic, not specific compiler way to do would be best. If that isn't possible then compiler specific it will have to be.
I could do a compiler generic way with some cost to clarity be reinterpreting the bytes as a uint64_t
@rtpax you still interested in working on this? last we spoke you were waiting on the test fixes that are now on main. Is there anything I can do to help bring your fixes to a PR?