Resource icon

Software Android-x86 Kernel Toolchain GCC 4.9 with Plugins 2

Source
Chromium
Compatible With
Nougat
Hello once again I have built a kernel toolchain with being able to use plugins for my build. Make sure to set your kernel config to CONFIG_HAVE_GCC_PLUGINS=y. You can use this toolchain in the build system just edit your kernel.mk file. From the initial test that I have done it runs better than the stock toolchain. You will be prompted to load the plugins once you execute your make command. The plugins and --with-tune=intel configuration it makes a big difference in kernel performance. I have no succes with the STACKLEAK plugin but every other one works. The Binutils vesion is 2.33.90 it's been updated.I have built a few kernels with lld. You need to edit your kernel Makefile but it works. You can use binutils or LLVM to build your kernel. The LLVM component is the brand new version 18.0 and works flawlessly. LLVM is only supported on kernels that have clang support. The ld.lld executable is 55 MB it works pretty good it provides a much needed update. After you install the kernel it may need another reboot to get the WiFi working. Here is a link to the source code:
GCC-4.9.

Screenshot_20231123-085357.png


Here is the configuration:

../gcc-refs_heads_master/configure --enable-languages=c,c++ --prefix=/home/ryan/Videos/x86_64-linux-android-gcc-4.9 --with-newlib LDFLAGS='-lgcc -latomic' --disable-multilib --target=x86_64-linux-android --build=x86_64-linux-gnu --disable-decimal-float --disable-docs --disable-libffi --disable-libmudflap --disable-libquadmath --disable-libstdcxx-pch --disable-nls --disable-shared --enable-default-ssp --enable-threads=posix --with-gnu-as --with-gnu-ld --with-linker-hash-style=gnu --with-newlib --with-pkgversion='Rigo GCC' --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-tune=intel --with-arch=x86-64 --with-python --disable-bootstrap --enable-plugins --enable-libgomp --enable-gnu-indirect-function --disable-libcilkrts --disable-libsanitizer --enable-gold --enable-threads --enable-graphite=yes --enable-eh-frame-hdr-for-static --enable-gold=default CC=/home/ryan/android-x86/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux-gcc LD=/home/ryan/android-x86/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux-ld.gold CXX=/home/ryan/android-x86/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/bin/x86_64-linux-g++

Instructions:

export PATH=$PATH:/path to toolchain bin folder.
make O=out android-x86_64_defconfig
make O=out ARCH=x86_64 LD=/path to x86_64-linux-androidkernel-ld.bfd CROSS_COMPILE=x86_64-linux-androidkernel- bzImage modules
sudo make O=out modules_install

Thats all it takes to build a kernel cheers.

Latest updates

  1. Android-x86 Kernel toolchain with LLD from LLVM 18

    I have built a few kernels with lld. You need to edit your kernel Makefile but it works. You can...
Top