HxGodot / hxgodot

A Haxe GDExtension for Godot 4
MIT License
232 stars 11 forks source link

crash running example project on mac (arm64 and x86_64) #59

Open shakesoda opened 11 months ago

shakesoda commented 11 months ago

I modified my SConstruct to have appropriate flags for arm (-march=armv8.5-a and -D HXCPP_ARM64) respectively, tried running both with native arch and in rosetta with arch -x86_64 godot main.tscn on the example project (godot 4.2 stable), got good prints until "was geht", then it crashes and reports heap corruption. i haven't dug into it but test_vector4i is next in the gdscript, so i assume that's failing. bindings generated with haxe 4.3.2, since i saw 4.3.3 doesn't work.

filed separately from #28 and #53 because it seems to be a different issue

shakesoda commented 11 months ago

update: i was able to get a working result with a quick hack by switching HXCPP_M64 to HXCPP_ARM64 at RunMain.hx:243 (doGenerateBindings)

seems another path is needed in the generator, i assume my problem for both x86_64 and arm64 crashing is that it didn't match my bindings properly.

needing to regenerate the bindings per arch seems a bit problematic, i'll need to have a few different copies of them for different arch builds i suppose.

with a little more poking around squash the creeps runs, but unhandled input crashes / #53 applies, making it unusable.

dazKind commented 11 months ago

Hi there!

Yes, generating arm64 builds can be a bit challenging since I dont have a M1 machine available most of the time.

Concerning different copies of the bindings: I will give this some thought, maybe we can macro this in a smart way