Everything I know about GNU toolchain

As mainly an LLVM person, I occasionally contribute to GNU toolchain projects. This is sometimes for fun, sometimes for investigating why an (usually ancient) feature works in a particular way, sometimes for pushing forward a toolchain feature with the mind of both communities, or sometimes just for getting sense of how things work with mailing list+GNU make. For a debug build, I normally place my build directory out/debug directly under the project root. Dependency chain of a port: GCC needs binutils. Linux kernel needs GCC. glibc needs Linux kernel. binutils…

How to compile coreutils / binutils for aarch64 in x64

Dockcross git clone https://github.com/dockcross/dockcross.git cd dockcross docker run --rm dockcross/linux-arm64> ./dockcross-linux-arm64 chmod +x ./dockcross-linux-arm64 mv ./dockcross-linux-arm64 ~/bin/ Coreutils / Binutils //Go to the repository diretory dockcross-linux-arm64 bash //In the docker work diretory ./bootstrap(only for coreutils) mkdir aarch64 cd aarch64 ../configure make make check(run official test) Building GDB Natively Ever since the GDB and the binutils repositories were integrated (due to the git migration), it has become a bit more complex to build GDB. Of course, you can still do a simple ./configure && make, but you might actually want to disable…

How to launch ARM aarch64 VM with QEMU from scratch

The below instructions will allow for bringing up an ARM VM from scratch. To launch an aarch64 VM we first need to install a few dependencies, including QEMU and the qemu-efi-aarch64 package, which includes the efi firmware. apt-get install qemu-system-arm apt-get install qemu-efi-aarch64 apt-get install qemu-utils Create the flash images with the correct sizes. dd if=/dev/zero of=flash1.img bs=1M count=64 dd if=/dev/zero of=flash0.img bs=1M count=64 dd if=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd of=flash0.img conv=notrunc Create a dedicated directory (folder) on your host system to contain this virtual machine. Download the latest  “Virtual” ISO file for…