void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.58k stars 2.15k forks source link

Tracking: packages broken on larger pagesize kernels (like rpi5-kernel) #48260

Open classabbyamp opened 9 months ago

classabbyamp commented 9 months ago

Some programs have issues when running on kernels with larger pagesizes.

jemalloc

One common case is programs (especially rust programs) that use jemalloc. this was fixed in #48194 for the jemalloc package itself and all rust packages built in the future, but some packages still may need a rebuild. This often manifests itself like this:

<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
memory allocation of 5 bytes failed

Probably broken

as yet untested, based on https://github.com/AsahiLinux/docs/wiki/Broken-Software#broken-packages

broken

dkwo commented 9 months ago

zig was definitely broken last year on 16k, the relevant pr's are in progress https://github.com/ziglang/zig/pull/17382

dkwo commented 5 months ago

For zig, we may consider this patch to mem.zig:

pub const page_size = switch (builtin.cpu.arch) {
    .wasm32, .wasm64 => 64 * 1024,
    .aarch64 => switch (builtin.os.tag) {
+        .macos, .ios, .watchos, .tvos, .linux => 16 * 1024,
-        .macos, .ios, .watchos, .tvos, => 16 * 1024,
        else => 4 * 1024,
    },
    .sparc64 => 8 * 1024,
    else => 4 * 1024,
};

I don't know how many aarch64 machines this would break, but at least it could be usable on rpi5 and apple.

Calandracas606 commented 4 months ago

AFAIK F2FS still won't work, since it requires userspace support from f2fs-tools, which hasn't had a release yet.

dkwo commented 2 months ago

Surprisingly, river from void's repo works fine on apple silicon (16k kernel), even though zig is broken. How is this possible??

Calandracas606 commented 2 months ago

Surprisingly, river from void's repo works fine on apple silicon (16k kernel), even though zig is broken. How is this possible??

this makes sense, and works for the same reason that any cross compiled binaries work.

the zig compiler may be broken when using a 16k build machine, but binaries built by the compiler may work just fine.

this is exactly the same as why cross compilers work. the aarch64 gcc cross compiler runs on a x86_64 build machine, and outputs binaries which run on an aarch64 machine