Closed tobil4sk closed 7 months ago
In IOSPlatform
, commands
is an array of arrays. Each sub-array is handled independently, meaning the two flags aren't set at once. Your error must be coming from somewhere else.
Each sub-array is handled independently, meaning the two flags aren't set at once.
Ah you're right... So the HXCPP_ARM64
flag is being set from elsewhere. Worth noting that this problem happened when compiling ios from m1.
Maybe the problem is just that the host architecture results in a flag being added, when that should not be happening.
This would go unnoticed on intel mac is because the x86_64 architecture does not result in a -arch flag being set, so even if the host architecture bled through into the compiler flags it wouldn't cause any issues:
After further debugging, it looks like the problem lies with hxcpp, not lime: https://github.com/HaxeFoundation/hxcpp/pull/1079
By default, when running
lime rebuild ios
, both armv7 and arm64 architecture flags are active. See: https://github.com/openfl/lime/blob/e6205bf3aaace23c7e2458841da4435ff9879eaf/tools/platforms/IOSPlatform.hx#L478-L482This means that
HXCPP_ARMV7
andHXCPP_ARM64
are set at once: https://github.com/openfl/lime/blob/e6205bf3aaace23c7e2458841da4435ff9879eaf/tools/platforms/IOSPlatform.hx#L491-L493The hxcpp code does not allow for these flags to be set at once (see https://github.com/HaxeFoundation/hxcpp/blob/18f87b949464ddcf24c6a83a2f7b8f76233540bc/toolchain/iphoneos-toolchain.xml#L43-L47).
The compiler receives
-arch armv7 arm64
, so only armv7 is treated as an architecture flag, and thearm64
is treated as a file to be compiled, resulting in the error:Perhaps it's fine to just no longer set
HXCPP_ARMV7
by default? Considering the commit message here: https://github.com/openfl/lime/commit/f34b595e70785758d3517030466a954af17027bb.