Mac os x linux free download. HPC on Mac OS X Tools for High Performance Scientific Computation on Mac OS X. OS X versus Linux. OS X and Linux users share a similar desire to avoid using Windows. But after that the two groups often split apart when it comes to the question of OS X versus Linux.
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 work on my way. I only have a MacBook. When I tried to build the Linux kernel, it complained that elf.h was not found.
I download an elf.h from internet. Now it complains: NO ELF
Best facebook app for mac. I tried copying the entire /usr/include from my Linux desktop, and set it as the include directory, and still get strange errors like “u8” not declared
What is the standard way of doing kernel development on Mac? I have a virtual machine running Linux on the same Mac, and it will be used to test the modified kernel. However, I don’t really want to build kernel on it, as it is kinda slow.
First, I agree that it’s usually simpler to just use a Linux VM. That said, if you really want to do this, I have successfully compiled Linux kernel code using the procedure below.
Before you can even start, you may need to install the Linux source tree on a case-sensitive filesystem on your Mac. (the default HFS filesystem is case insensitive.) I won’t cover that here, but a lot of people do this to compile the Android source tree, so you can use Google to find instructions.
First you’ll need the following files to cross-compile a kernel on an OS X box (copy them from your known-working Linux VM to your local /usr/include):
Next you’ll need malloc.h to be in the expected location for a Linux system, so do:
Finally, you’ll need to worry about whether or not the compiler installed on your system is suitable for building the Linux kernel. I have used this procedure for kernels compiled for Android, using an appropriate cross-compiler toolchain, but I’m not sure if you can successfully compile a Linux kernel with the default gcc compiler on OS X (assuming you have the one that comes with Xcode…)
EDIT: You may also want to follow the steps pointed out in the bug linked in the comment above from “nmagerko”, to ensure you have the correct dependencies, and the GNU version of sed. In particular:
This is a common question (well, usually it’s building on Windows, but the answer is the same).
Just don’t do it. You’re going to have so much trouble getting anything to build correctly, it’s just not worth it.
Use a virtual machine, as you said yourself. It’s a little slower, but not all that much, and at least building will work correctly.
Kernel development is hard enough without introducing additional, unnecessary problems.
Here is an update for Android 6.0 Marshmallow and OSX 10.10 Yosemite. I have done several successful cross builds using this method. The only limitation is that I have only done these with the full AOSP source checked out.
I used brew’s libelf to get a nice package managed elf library. This gets us the elf file we need to include, usr/local/opt/libelf/include/libelf/gelf.h
But this will still throw errors on build if you symlink it to usr/local/include as apparently some definitions are missing. So I stole the missing definitions from <kernel_source>/arch/arm/include/asm/elf.h and created a shim include file:
That should be enough to get the build to complete. If anyone needs further information on this, I have a post that covers a full Android kernel build on OSX.
I’ve made symlinks to the missing OSX headers from the linux host ones and apparently it worked out well! In my setup I have sync’d the whole AOSP repo, which includes all prebuilts, but the ones that I am actually using to built the kernel are:
Clone them so that the following directory tree is valid:
Make sure you checkout the appropriate branch/tag, according to your Android target version.
Not sure if it’s the proper way to do it, but putting the a bunch of linux headers in /usr/local/include resolves all issues. Don’t forget to chmod +x the script.
Kernel: arch/arm/boot/zImage-dtb is ready
This works as of kitkat (didn’t try earlier versions) – make -j8 ARCH=arm CROSS_COMPILE=arm-eabi- HOSTCFLAGS='-I ./external/elfutils/libelf'
This assumes the rest of the android build is set up as usual and the kernel directory is in the android build.
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 Best raid drives for mac.
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/