我要为基于aarch64的设备编译内核
内核源码准备好了。
和内核文档说我应该使用ARM-EABI的arm-eabi-4.9工具链来编译内核。
但它是什么? 不同类型的GCC编译器还是什么?
是否与GCC 4.9相同?
为什么我想知道这个,因为我想对编译器进行一些修改,那么我如何从源代码为ARM EABI构建arm-eabi-4.9工具链 ?
我在网上做了一些研究,但我发现了gcc 4.9的构建过程和一些关于arm-none-eabi的信息。
我最初在GCC 4.9上做了修改
我可以使用这些来源,然后为arm,aarch64 --->构建GCC 4.9工具链,然后使用此工具链构建内核吗?
i'm going to compile kernel for my aarch64 based device
kernel sources are ready.
and kernel docs are saying that i should use arm-eabi-4.9 toolchain for ARM EABI for compilation kernel.
but what is it? different type of GCC compiler or what?
is it same as GCC 4.9 ?
why i want to know this because i want to make some modifications into compiler so how can i build arm-eabi-4.9 toolchain for ARM EABI from source ?
i have made some research on the net but i found building process of gcc 4.9 and some info about arm-none-eabi..
i have made modifications originally on top of GCC 4.9 this
can i use this sources and then building GCC 4.9 toolchain for arm,aarch64 ---> and then building kernel with using this toolchain ?
最满意答案
在编译gcc时,一些配置标志将其构建为交叉编译器...您只能为一对主机/目标体系结构构建gcc二进制文件。 当主机和目标相同时,您将获得正常的gcc编译器。 如果没有,你会得到一个交叉编译器。
要设置目标,需要在运行./configure时添加--target选项
工具链是架构的gcc交叉编译器+一些基本库(如glibc)。 你也需要建造这些......
工具链名称由arch [-vendor] [-os] - eabi
arm-none-eabi ,是一个用于裸机ARM(无操作系统)的交叉编译器。
arm-linux-gnueabi是ARM二进制文件的交叉编译器,它将使用eabi在ARM Linux操作系统下运行(也可以使用它来构建内核)。
还有那些是arm工具链,你正在寻找aarch64-linux-gnu
考虑寻找一个预构建的工具链(linaro,embedian),需要进行一些微调,所以最好从一个工作二进制文件开始,然后运行gcc -v来展示它是如何构建的。
When compiling gcc, some configuration flags build it as a cross compiler... You can only build gcc binaries for one pair of host/target architectures. When host and target are the same, you get a normal gcc compiler. If not, you get a cross compiler.
To set the target you need to add the --target option when running ./configure
A toolchain is a gcc crosscompilier for an architecture + some basic libraries (like glibc). You'll need to build those too...
toolchain names go by arch [-vendor] [-os] - eabi
arm-none-eabi, is a crosscompiler for baremetal ARM (no OS).
arm-linux-gnueabi is a crosscompiler for ARM binaries that'll run under a and ARM linux OS using eabi ( Use this for building kernels too).
Also those are arm toolchains, you're looking for aarch64-linux-gnu
Consider looking for a prebuilt toolchain (linaro, embedian), there is some fine tuning required, so it's better to start with a working binary, and running gcc -v to show how it was built.
更多推荐
发布评论