New comment by mintsuki on void-packages repository https://github.com/void-linux/void-packages/pull/31658#issuecomment-869008021 Comment: > Building a full gcc toolchain will end painfull. You can try to use add `cross-x86_64-linux-gnu` for `i686*` and `x86_64-musl` builds. (I initial forgot that we have it available on `i686` nowadays). > > So you can add this after checksum > > ```shell > case "$XBPS_TARGET_MACHINE" in > x86_64);; > *) hostmakedepends+=" cross-x86_64-linux-gnu";; > esac > ``` > > and this as do_build > > ```shell > do_build() { > if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then > make > else > CFLAGS="" make CROSS_COMPILE="x86_64-linux-gnu-" \ > CC="x86_64-linux-gnu-gcc" TOOLCHAIN="x86_64-linux-gnu" \ > CC_TOOLCHAIN="x86_64-linux-gnu-gcc" > make bin/limine-install TOOLCHAIN="x86_64-linux-gnu" > fi > } > ``` > > The build system does all kinds of wonky assumptions, this should workaround most/all of them. It needs a cross compiler on musl too, or alternatively an implementation of `stdint.h` that works. Using the provided cross compiler would be ideal. The cross compiler *does* build, and check the CI, everything else builds fine too, except `i686` where I assume the build system passes `-mtune=i686` to the CFLAGS when it should not do that as it will break stuff. This can also easily be worked around by just unsetting the `CFLAGS` or stripping out the `-mtune` flag from them.