haileys / doslinux

Run Linux programs on DOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build scripts do not use cross compiler for linux!

lpsantil opened this issue · comments

A major oversight (even on my part!), the linux build script (https://github.com/haileys/doslinux/blob/master/script/build-linux) doesn't actually use the arguments to call the cross-compiler! I discovered this when porting doslinux to Fedora 38.

Currently, it seems like F38's gcc 13 is too new to build Linux kernel 5.8.9. Ubuntu 22.04's gcc 11 is fine. I think F36 might work OOTB but I'd have to build a VM to verify that. May do that even though it's gone EOL in May 2023.

One way to cross-compile the Linux 5.8.9 kernel (based on https://gts3.org/2017/cross-kernel.html) is to do the following

## DL Linux
# https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.8.9.tar.gz
## Extract Linux Kernel source
# tar zxvf linux-5.8.9.tar.gz
## Copy in the config
# cp -v linux-config-doslinux linux-5.8.9/
## Build
# cd linux-5.8.9 && make -j4 ARCH=x86 CROSS_COMPILE=i386-linux-musl

This is building for me w/F38, a gcc 9.4.0 cross-compiler in /usr/local/. I'm off to verify this in Ubuntu 22.04 now.