![]() This is actually the first step of porting Binutils and GCC to your operating system: Any information you give GCC about your OS will help it run on your OS. ![]() This tutorial teaches you how to set up a cross-compiler that specifically targets your OS. ![]() Additionally part of the instructions here can be applied to other software packages that also use the GNU build system, which will help you port existing software. It also becomes much easier to cross-compile software to your OS when you simply have to invoke x86_64-myos-gcc hello.c -o hello to cross-compile a program. For instance, you can make the compiler define a _myos_ preprocessor macro, know which directories to search for include files in, what special crt*.o files are used when linking against libc, and so on. However, when you proceed it becomes useful if the compiler knows it is targeting your operating system and what its customs are. This is very convenient when starting out as you get a reliable target and the compiler doesn't make any bad assumptions because it thinks it is targeting an existing operating system. Until now you have been using a cross-compiler configured to use an existing generic bare target. The instructions below teach Binutils and GCC how to create programs for a hypothetical OS named 'MyOS'. This tutorial will guide you through creating a toolchain comprising Binutils and GCC that specifically targets your operating system.
0 Comments
Leave a Reply. |