ponyc icon indicating copy to clipboard operation
ponyc copied to clipboard

Cant build 32 bit Arm code with clang

Open SeanTAllen opened this issue 4 years ago • 5 comments
trafficstars

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.

SeanTAllen avatar Sep 16 '21 02:09 SeanTAllen

I believe @rtpax is taking a look at this one.

SeanTAllen avatar Oct 03 '21 22:10 SeanTAllen

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?)

rtpax avatar Oct 07 '21 13:10 rtpax

#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.

SeanTAllen avatar Oct 07 '21 13:10 SeanTAllen

I could do a compiler generic way with some cost to clarity be reinterpreting the bytes as a uint64_t

rtpax avatar Oct 07 '21 14:10 rtpax

@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?

SeanTAllen avatar Jan 15 '22 22:01 SeanTAllen