ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.73k stars 267 forks source link

Error compiling box64 0.2.8 with GCC 13.3.0 within Buildroot #1551

Open rtissera opened 3 months ago

rtissera commented 3 months ago

Target : AArch64 generic , RPI5ARM64, others...

Box64 0.2.6 compiles just fine in the same environment. Box64 0.2.8 errors on custommem.c :

Building C object CMakeFiles/box64.dir/src/custommem.c.o {standard input}: Assembler messages: {standard input}:7113: Error: symbol `mmap64' is already defined make[3]: *** [CMakeFiles/box64.dir/build.make:439: CMakeFiles/box64.dir/src/custommem.c.o] Error 1

Any idea ?

ptitSeb commented 3 months ago

custommem.c define a overloaded mmap64 symbol, over libc one. It's important for the BOX64_MMAP32=1 handling. If it doesn't work for you, you can comment lines 1720-1740 of that file, but then this function will not work...

rtissera commented 3 months ago

Thanks for your quick answer, I am attempting an RV64 build to see if it's AArch64 specific or an issue on my toolchain/environment. Maybe I should save generated output assembly code frrom GCC to inspect the issue further.

rtissera commented 3 months ago

Same issue on RV64 build (as expected since custommem.c is not architecture-dependent..). Need to find why GCC 13.3 creeps on that in cross-compiling environment (GLIBC 2.38.44).

ptitSeb commented 3 months ago

Never seen this issue before. And overloading function is pretty common... Maybe those 2 function (mmap and munmap) should be moved to a separate file, with limited include file to avoid declaration of libc mmap64?

rtissera commented 3 months ago

Let me try your solution and come back to you

Le dim. 2 juin 2024 à 23:13, ptitSeb @.***> a écrit :

Never seen this issue before. And overloading function is pretty common... Maybe those 2 function (mmap and munmap) should be moved to a separate file, with limited include file to avoid declaration of libc mmap64?

— Reply to this email directly, view it on GitHub https://github.com/ptitSeb/box64/issues/1551#issuecomment-2144023098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW4WBP3CTJKLWS4HJTPOILZFODINAVCNFSM6AAAAABIVKI5MOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBUGAZDGMBZHA . You are receiving this because you authored the thread.Message ID: @.***>

rtissera commented 3 months ago

https://github.com/ptitSeb/box64/pull/1552 passes okay.