rtissera / libchdr

Standalone library for reading MAME's CHDv1-v5 formats.
BSD 3-Clause "New" or "Revised" License
98 stars 42 forks source link

compile failure on libretro buildbot run #127

Closed irixxxx closed 4 months ago

irixxxx commented 4 months ago

I get this from the lr-picodrive buildbot run for the libretro-build-libnx-aarch64 job:

aarch64-none-elf-gcc -c -opico/cd/libchdr/deps/zstd-1.5.6/lib/decompress/huf_decompress.o pico/cd/libchdr/deps/zstd-1.5.6/lib/decompress/huf_decompress.c -Ipico/cd/libchdr/deps/lzma-24.05/include -Ipico/cd/libchdr/include  -I/builds/libretro/picodrive -I platform/libretro/libretro-common/include -I platform/libretro/libretro-common/include/compat -I platform/libretro/libretro-common/include/encodings -I platform/libretro/libretro-common/include/formats -I platform/libretro/libretro-common/include/streams -I platform/libretro/libretro-common/include/string -I platform/libretro/libretro-common/include/vfs -DREVISION=\"-dab9c6e\" -O3 -fomit-frame-pointer -ffast-math -I/opt/devkitpro/libnx/include/ -fPIE -Wl,--allow-multiple-definition -specs=/opt/devkitpro/libnx/switch.specs -D__SWITCH__ -DHAVE_LIBNX -DARM -D__aarch64__=1 -march=armv8-a -mtune=cortex-a57 -mtp=soft -ffast-math -mcpu=cortex-a57+crc+fp+simd -ffunction-sections -Ifrontend/switch -ftree-vectorize -D__LIBRETRO__ -DUSE_LIBRETRO_VFS  -O3 -DNDEBUG -I/builds/libretro/picodrive -falign-functions=2 -DREVISION=\"-dab9c6e\" -DUSE_LIBCHDR -Izlib -DEMU_F68K -D_USE_CZ80 -Ipico/cd/libchdr/deps/zstd-1.5.6/lib -Wno-unused
huf_decompress_amd64.S
pico/cd/libchdr/deps/zstd-1.5.6/lib/decompress/huf_decompress_amd64.S:12: fatal error: opening dependency file /pico/cd/libchdr/deps/zstd-1.5.6/lib/decompress/huf_decompress_amd64.d: No such file or directory
   12 | 
      | 
compilation terminated.

Other aarch64 targets seem to compile fine though.

rtissera commented 4 months ago

This is a platform define problem in zstd code or makefile, it tries to open a x86_64 assembly-built object which does not exists since we're on aarch64

irixxxx commented 4 months ago

Just a question: why is it compiling on other aarch64 targets? Also, picodrive isn't using the sub-Makefile, it has a file list in its master Make. Should I exclude this file when not on aarch64?

irixxxx commented 4 months ago

I took a glance at the asm file, and as it looks it should assemble everywhere. If it's not x86_64, it comes down to an empty file, with some special handling for aarch64 to set the right properties for an empty file. I think that's ok. It also compiles fine for mips and ppc targets. The big question is, why is this not working for libnx? What kind of dependency file is the compiler expecting here?

rtissera commented 4 months ago

Yeah I share the same analysis of the assembly file. And I have no idea of what .d it expects, but I do the rule in the sub-dir Makefile : https://github.com/rtissera/libchdr/blob/master/deps/zstd-1.5.6/lib/Makefile Please note this is vanilla zstd-1.5.6 from facebook, no local changes

Le sam. 15 juin 2024 à 16:14, irixxxx @.***> a écrit :

I took a glance at the asm file, and as it looks it should assemble everywhere. If it's not x86_64, it comes down to an empty file, with some special handling for aarch64 to set the right properties for an empty file. I think that's ok. It also compiles fine for mips and ppc targets. The big question is, why is this not working for libnx? What kind of dependency file is the compiler expecting here?

— Reply to this email directly, view it on GitHub https://github.com/rtissera/libchdr/issues/127#issuecomment-2169738814, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW4WBM4SYHAX734ZUU7WRLZHRD2RAVCNFSM6AAAAABJLSLKYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRZG4ZTQOBRGQ . You are receiving this because you commented.Message ID: @.***>

irixxxx commented 4 months ago

I'll just exclude it for any architecture not including the substring x86 then. That's probably the best thing to do here. However, I reckon anyone doing meson builds might hit the same problem, as the meson build file apparently isn't looking at the arch.

rtissera commented 4 months ago

Yeah I agree especially if you want to make a release soon. Actually you might also use some zstd define to disable asm

Le sam. 15 juin 2024 à 16:24, irixxxx @.***> a écrit :

I'll just exclude it for any architecture not including the substring x86 then. That's probably the best thing to do here. However, I reckon anyone doing meson builds might hit the same problem, as the meson build file apparently isn't looking at the arch.

— Reply to this email directly, view it on GitHub https://github.com/rtissera/libchdr/issues/127#issuecomment-2169768097, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW4WBOEFXETF5WIZ3CQC6DZHRFDHAVCNFSM6AAAAABJLSLKYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRZG43DQMBZG4 . You are receiving this because you commented.Message ID: @.***>

irixxxx commented 4 months ago

Taking out the asm file from the build solves the issue. FYI, from notaz I got the info that devkitpro's switch_rules reference a DEPSDIR variable which needs to be set in Makefile.libretro.