axpbox icon indicating copy to clipboard operation
axpbox copied to clipboard

Use fopen64, fix segfault in fseek on arm #29

Open RaymiiOrg opened this issue 4 years ago • 8 comments

RaymiiOrg avatar Jan 19 '21 11:01 RaymiiOrg

There is also this: https://github.com/madler/zlib/blob/master/contrib/minizip/ioapi.h#L24 - which does not have arm support. But I did use it for reference.

It might also help to debug why the fopen call segfaults. The debugging experience on this arm machine is so slow, I didn't do that. One "real" second takes about 10 seconds on the poor machine.

RaymiiOrg avatar Jan 20 '21 06:01 RaymiiOrg

I wonder why HAVE_FOPEN64 is not set on the machine, check_symbol_exists(fopen64 "stdio.h" HAVE_FOPEN64) should set it. I'll quickly boot up an ARM VM, try to look into this and give an update very soon.

lenticularis39 avatar Jan 21 '21 19:01 lenticularis39

So on my test VM (QEMU TCG aarch64 Alpine Linux) fopen64 is not found by CMake, although it compiles fine with it. I believe this is a build system problem and this is only a workaround (that may cause build failure in cases where fopen64 is not available on an ARM platform for some reason).

lenticularis39 avatar Jan 21 '21 20:01 lenticularis39

So on my test VM (QEMU TCG aarch64 Alpine Linux) fopen64 is not found by CMake, although it compiles fine with it. I believe this is a build system problem and this is only a workaround (that may cause build failure in cases where fopen64 is not available on an ARM platform for some reason).

Okay that's good to know. I'll see what I can find in the direction of cmake as for a fix or workaround.

RaymiiOrg avatar Jan 22 '21 03:01 RaymiiOrg

I've updated the request, could you please take a new look @lenticularis39 ?

RaymiiOrg avatar Jan 22 '21 11:01 RaymiiOrg

That seems quite complicated for a simple feature test, of course it's better that nothing, but I have the feeling it may be too much code for something that could be done more in a simpler way. I'll try to look into the headers once I'll have some time for it, which should be soon.

lenticularis39 avatar Jan 22 '21 20:01 lenticularis39

Oh sorry, wrong PR :D

lenticularis39 avatar Jan 22 '21 20:01 lenticularis39

That seems quite complicated for a simple feature test, of course it's better that nothing, but I have the feeling it may be too much code for something that could be done more in a simpler way. I'll try to look into the headers once I'll have some time for it, which should be soon.

It's indeed quite a bit of code. The Mac os x build kept failing for me with other (simpler) tests sadly... Please let me know if there's anything I can do or test 🙃

RaymiiOrg avatar Jan 22 '21 21:01 RaymiiOrg