Understanding gcc compilation steps : Linux compilation steps

Copy paste the below shell script and execute on your terminal. $ vim understanding_compilation_with_gcc.sh Copy below highlighted code and run the script as, $ bash understanding_compilation_with_gcc.sh ————- code start ——————— #!/bin/bash echo “ For any given input file, the file name suffix determines what kind of compilation is done: file.c C source code that must … Read more

How kernel images are built / compiled

/bin/bash scripts/link-vmlinux.sh arm-linux-gnueabihf-ld -EL -p –no-undefined -X –pic-veneer –build-id LD vmlinux.o scripts/mod/modpost -m -a -o ./Module.symvers -S vmlinux.o GEN .version /bin/bash ./scripts/mkcompile_h include/generated/compile.h \“arm” “y” “” “arm-linux-gnueabihf-gcc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=6 -march=armv6k -mtune=arm1136j-s -msoft-float -Uarm -fno-delete-null-pointer-checks -O2 –param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments … Read more

Cross compiling Linux kernel for Beagleboard

We assume, we are compiling for omap3 beagleboard embedded hardware platform, $ cd /home/devbee $ mkdir beagleboard $ cd beagleboard Clone the kernel $ git clone https://github.com/beagleboard/linux.git Download toolchain $ wget -c https://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz Extract Toolchain $ tar xvf  gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz Now, use the below script to compile and generate uImage, $ vim compile.sh $ source compile.sh

Solved : java.lang.OutOfMemoryError: Java heap space

When I was trying to compile latest repo sync Android source code ( Android 10 ), and tried to compile demo application, I got an error as, When tried to find out some related information, I found that this error is due to less JAVA heap memory and we need to increase that memory, so … Read more

Solved error : android.view.InflateException: Binary XML file line #16: Error inflating class androidx.constraintlayout.ConstraintLayout

Recently when we migrated one of our android application to AndroidX, using android studio’s option from “Refactor -> Migrate to AndroidX” , it was expected that everything should work fine but during compilation it failed with following error, Solution This error has came because android was not able to find “androidx.constraintlayout.ConstraintLayout” class after migrating to … Read more

What is Clang ? How to compile C program using clang ?

What is Clang ? Clang is a compiler front end for the C, C++, Objective-C and Objective-C++ programming languages. It uses the LLVM compiler infrastructure as its back end. It is designed to act as a drop-in replacement for the GNU Compiler Collection (GCC), supporting most of its compilation flags and unofficial language extensions. Clang … Read more

How to build Cross-Toolchain using meta-toolchain recipe from Yocto / Poky ?

This article assumes, you already have development environment setup for yocto, if not please read and setup as per “Building Yocto for Raspberry Pi / Creating Embedded Linux for RPi using Yocto” Along with recipes for building a compiler for its internal use, OpenEmbedded also has recipes to create a full toolchain / cross-compiler environment for … Read more

How to build target and host Sysroot with yocto / poky ?

If you want to build some external packages which are using sysroot within yocto framework or buildsystem, you will first need to build the sysroot which you can then link with the package during compilation. The matching target sysroot contains needed headers and libraries for generating binaries that run on the target architecture. The sysroot … Read more

What is m4 and How to Fix: “m4: command not found” error

If you have installed fresh Ubuntu on your development machine and tried to compile some opensource source code which uses “autoconf” for generating Makefile for compilation, its highly possible that you may see an error as below, what is m4 ? GNU ‘m4’ is an implementation of the traditional UNIX macro processor. ‘m4’ is a … Read more