falkTX / Carla

Audio plugin host
https://kx.studio/carla
1.55k stars 144 forks source link

Fix build with musl libc 1.2.4 #1806

Closed vimproved closed 9 months ago

vimproved commented 10 months ago

Musl 1.2.4 gated the LFS64 compatibility shims behind the _LARGEFILE64_SOURCE macro, and they will be removed entirely in musl 1.2.5. Instead, always use the normal stat function instead of stat64, and set -D_FILE_OFFSET_BITS=64, which ensures that functions will always be 64-bits on 32-bit glibc platforms (and does nothing on other platforms).

falkTX commented 10 months ago

I believe this breaks mingw and wasm builds, it shouldn't be enabled by default. Lets see if the CI jobs fail

vimproved commented 10 months ago

I believe this breaks mingw and wasm builds, it shouldn't be enabled by default. Lets see if the CI jobs fail

Oh alright, I don't usually work on software with mingw/wasm builds, sorry. Will fix ASAP.

falkTX commented 10 months ago

is there a way to tell which libc is in use? or maybe we always enable this but just for unix platforms..?

since juce is going away, the only place where this is needed now is the ysfx module. there is already a few tidybits about this, and tbh it has become a mess... so at the moment I dont know the best way to proceed

falkTX commented 10 months ago

I mispoke, this is obviously needed on the water module code. but in there we can easily use compiler macros to check for stat64 availability

vimproved commented 10 months ago

I mispoke, this is obviously needed on the water module code. but in there we can easily use compiler macros to check for stat64 availability

Yeah, the best idea here is probably replacing CARLA_OS_LINUX with __GLIBC__

falkTX commented 9 months ago

forgot about this before, merging now, thanks!