building Linux kernel on Mac OS X

后端 未结 6 1047
执念已碎
执念已碎 2021-01-30 14:29

I am doing a project to modify the Linux kernel. I have a desktop Linux machine and I have no problem building kernel on it.

However, I am going on a trip and I want to

6条回答
  •  一整个雨季
    2021-01-30 14:51

    one update with arm64 kernel build on OSX 10.15.4 Catalina .

    My intention is to natively build latest(5.7) arm64 kernel on macOS, and play it on qemu-system-aarch64 . btw, toolchain built from crosstool-ng.

    1) Firstly follow above steps, to include some header files. I put them under my home folder

    $ ls ~/usr/include/ -l

    drwxr-xr-x 4 yupluo01 admin 128 May 4 16:47 bits

    -rw-r--r-- 1 yupluo01 admin 177346 May 4 16:23 elf.h

    -rw-r--r-- 1 yupluo01 admin 17079 May 4 16:23 features.h

    drwxr-xr-x 4 yupluo01 admin 128 May 4 16:44 gnu

    -rw-r--r-- 1 yupluo01 admin 6186 May 4 16:33 malloc.h

    -rw-r--r-- 1 yupluo01 admin 2290 May 4 16:43 stdc-predef.h

    2) second, some hack for host uuid code ,as the uuid_t type on mac is different as linux : scripts/mod/file2alias.c Remove uuid_t definition by one macro BUILD_ON_LINUX, and comment code in do_tee_entry()

    3) make ARCH=arm64 HOSTCFLAGS="-I /usr/local/include -I ~/usr/include -I /usr/local/opt/openssl/include/ -L /usr/local/opt/openssl/lib/ -DBUILD_ON_LINUX=0" CROSS_COMPILE=aarch64-unknown-linux-gnu- O=out_arm64/

提交回复
热议问题