User:CesarB/Compiling for EABI
From Openmoko
(→New packages: change gcc-cross-uboot to not install libgcc into rootfs) |
({{note|This page is kept only for historical purposes. 2007.2 already uses EABI by default.}}; pin revision on local overlay link) |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
+ | {{note|This page is kept only for historical purposes. 2007.2 already uses EABI by default.}} | ||
+ | |||
This is an experiment on compiling the OpenMoko distribution for ARM EABI instaed of the old ABI. | This is an experiment on compiling the OpenMoko distribution for ARM EABI instaed of the old ABI. | ||
Line 11: | Line 13: | ||
== How to do it == | == How to do it == | ||
− | I used a [ | + | I used a [{{fullurl:User:CesarB/Using a local overlay|oldid=13652}} local overlay] to do the compilation. This way, my changes do not get mixed with the upstream changes. |
=== Configuration changes === | === Configuration changes === | ||
Line 140: | Line 142: | ||
== Does it work? == | == Does it work? == | ||
− | + | It seems to work correctly. | |
== More information == | == More information == |
Latest revision as of 07:21, 26 August 2007
NOTE: This page is kept only for historical purposes. 2007.2 already uses EABI by default. |
This is an experiment on compiling the OpenMoko distribution for ARM EABI instaed of the old ABI.
Most of it is easy; you just have to change TARGET_OS
from linux
to linux-gnueabi
. However, there's a small problem.
Contents |
[edit] The problem: u-boot
u-boot does not compile with the EABI; in fact, it explicitly overrides the ABI. Simply disabling the override is not a good idea; it's there for a reason (probably because some functions are implemented directly in assembly, and need to explicitly be coded to correctly follow the chosen ABI).
The way I worked around this is by creating two cross-compilation toolchains; one for uboot, and one for everything else.
[edit] How to do it
I used a local overlay to do the compilation. This way, my changes do not get mixed with the upstream changes.
[edit] Configuration changes
The main configuration change is on distro/include/openmoko.inc
, where you should change TARGET_OS
from "linux"
to "linux-gnueabi"
.
I also removed the three PREFERRED_PROVIDER
for libc-for-gcc
(under the comment # EABI stuff
) and added a new one:
PREFERRED_PROVIDERS += " virtual/${TARGET_PREFIX}libc-for-gcc:glibc-intermediate"
This one matches better the way the recipes are coded.
[edit] Bugfix
The uboot-gta01_svn.bb recipe hardcodes the name of the objcopy
binary; the fix is on bug 647.
[edit] New packages
The alternate ABI cross compiler needs seven new packages, and a modified uboot-gta01 package.
These new packages are actually nothing more than small patches over the original packages; I symlinked the original packages from the original trees (with one special case: uboot-gta01_svn.bb
was symlinked as uboot-gta01_svn.bb.inc
so the new package would override the original one).
- binutils/binutils-cross-uboot_2.17.50.0.5.bb
# Override ABI TARGET_OS = "linux" HOST_OS = "linux" require binutils-cross_${PV}.bb
- gcc/gcc-cross-initial-uboot_4.1.1.bb
# Override ABI TARGET_OS = "linux" HOST_OS = "linux" require gcc-cross-initial_${PV}.bb
- gcc/gcc-cross-uboot_4.1.1.bb
# Override ABI TARGET_OS = "linux" HOST_OS = "linux" require gcc-cross_${PV}.bb PACKAGES = "" # Override the method from gcc-cross so we don't try to install libgcc do_install () { oe_runmake 'DESTDIR=${D}' install }
- glibc/glibc-initial-uboot_2.5.bb
# Override ABI TARGET_OS = "linux" HOST_OS = "linux" require glibc-initial_${PV}.bb DEPENDS = "linux-libc-headers-uboot" RDEPENDS_${PN}-dev = "linux-libc-headers-uboot-dev"
- glibc/glibc-intermediate-uboot_2.5.bb
# Override ABI TARGET_OS = "linux" HOST_OS = "linux" require glibc-intermediate_${PV}.bb DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers-uboot" RDEPENDS_${PN}-dev = "linux-libc-headers-uboot-dev"
- glibc/glibc-uboot_2.5.bb
# Override ABI TARGET_OS = "linux" HOST_OS = "linux" require glibc_${PV}.bb PACKAGES = "" PROVIDES = "virtual/${TARGET_PREFIX}libc" DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial', 'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} linux-libc-headers-uboot" RDEPENDS_${PN}-dev = "linux-libc-headers-uboot-dev"
- linux-libc-headers/linux-libc-headers-uboot_2.6.18.bb
# Override ABI TARGET_OS = "linux" HOST_OS = "linux" FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/linux-libc-headers-${PV}" require linux-libc-headers_${PV}.bb
- uboot/uboot-gta01_svn.bb
# Do not use EABI TARGET_OS = "linux" HOST_OS = "linux" require uboot-gta01_${PV}.bb.inc INHIBIT_DEFAULT_DEPS = "1" DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}libc"
[edit] Other changes
At the same time, I also changed TARGET_ARCH
to armv4t
instead of arm
, and TARGET_VENDOR
to -openmoko
. This requires several other patches (some recipes and packages do not know that armv4t
implies arm
), and is not needed to build with EABI.
[edit] Bulding with dash
Some other patches are needed to make the build work with dash. bug 646 is one of them; the other one (a similar problem on linux-libc-headers_2.6.18.bb) will be submitted to MokoMakefile later.
[edit] Does it work?
It seems to work correctly.