cross-compilation conditional - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Torsten Schmits

how would I detect, via CPP, that I'm cross-compiling to arm? is there something like the arm_HOST_ARCH macro for the target architechture?

Georgi Lyubenov // googleson78

I never manage to successfully search for CPP flags..

Torsten Schmits

whoopsie, that's the one I used. I typoed in my post

Torsten Schmits

so using #if !defined(arm_HOST_ARCH) when compiling for android with Obelisk does not appear to work. I assume that "host" here means the system I am compiling on, not for, is that correct?

Torsten Schmits

mea culpa, it does work, but I didn't get to that point because it appears to compile for aarch64 first :upside_down: using aarch64_HOST_ARCH seems to match as well.

Georgi Lyubenov // googleson78

:facepalm: and I answered without reading your question carefully.. sorry

Georgi Lyubenov // googleson78

so wait, in the end, these variables match what you are compiling for, not what you are compiling on (because you said "it does work")?

Torsten Schmits

apparently, yes! using #if defined (arm_HOST_ARCH) || defined (aarch64_HOST_ARCH) causes the whole build to succeed.

Torsten Schmits

maybe it means "hosting the RTS" or something