Skip to content

Ubuntu 20.10 build fix

Created by: etheling

Ubuntu 20.10 and others have upgraded to GCC 10 and/or Linux 5.5 or newer kernels breaking the build:

Looks like sysctl(mib, 2, &totalphys64, &len, NULL, 0); syscall is only used inside #ifdef APPLE block in retrodep/memory.c. It feels pretty safe to wrap #include <sys/sysctl.h> to #ifdef APPLE to make this problem disappear.

sources/src/od-generic/memory.c has similar sysctl construct, but since it appears not to be used when compiling on Ubuntu 20.10, I didn't touch it.

Caveat emptor - these changes sort of sweep the problem under the rug. But at least in the interim these fixes allow compiling lr-uae on Ubuntu 20.10 and other distros with recent kernels / toolchain.

Merge request reports