AArch64 ILP32 Toolchain

From LEAP Wiki
Revision as of 06:47, 1 March 2016 by Michael Huang (Talk | contribs)

Jump to: navigation, search
Idea.png
This is a draft!
More details are coming soon.

Introduction

This page describes the details about using ILP32 AArch64 toolchain on LEAP.

Requirements

  • Latest LEAP kernel (4.3+)
  • Docker
  • Docker image with AArch64 ILP32 Toolchain

Using ILP32 toolchain

1. You need LEAP running on ARM64 platform: Installation instructions

2. Install the latest LEAP kernel (4.3+) and Docker

yum install kernel docker

3. Since docker is not able to start using systemctl start docker for some reasons, we can still start docker manually

systemctl start docker-storage-setup && screen -dm docker daemon

4. Fetch our AArch64 ILP32 docker image from DockerHub


Sources and Patches

GCC

Source: Linaro GCC 4.9.4

Patches:

Licenses: GNU GPLv2, GNU GPLv3

Description: This is Linaro's 4.9.4 GCC release from June 2015. The above two patches are there to allow building for the aarch64_ilp32 target.

Binutils

Source: Binutils (commit 9fde51ed303ea3ecbaa7c0084ea417e775a5db29)

Patches:

Licenses: GNU GPLv2, GNU GPLv3

Description: This is Binutils from the master branch. The above patch allows building for the aarch64_ilp32 target.

GLIBC

Source: GLIBC thunderx-ilp32-32timetoff_t branch (commit 574af3313a602be1197bbc3b5ea9b88b58063244)

Patches:

Licenses: GNU GPLv2

Description: This is a WIP GLIBC with the ilp32 patches applied. The above patch allows building for the aarch64_ilp32 target.

Building ILP32 toolchain manually

Overview

Script

The following is a guideline showing snippets of a script which will build the ILP32 toolchain natively on LEAP. The script in full can be found here.

The script will assume that:

  • You have obtained the sources above and have applied their respective patches.
  • You are running LEAP with a 4.3 or higher kernel.
  • You have sudo access.
  • The source directories are all in the current directory and have the names gcc, glibc and binutils-gdb respectively.


1. Firstly we will set up some variables that will be used in the script. Mainly these are paths and flags which can be adjusted to your needs and preferences.

# Set up the variables
INSTALL_PATH_LP64=/opt/lp64
INSTALL_PATH_ILP32=/opt/ilp32
TARGET_LP64=aarch64-leap-linux-gnu
TARGET_ILP32=aarch64_ilp32-linux-gnu
GCC_CONFIG_LP64="--enable-languages=c,c++,fortran"
GCC_CONFIG_ILP32="${GCC_CONFIG_LP64} --with-multilib-list=ilp32"
 
GLIBC_COMMON="--disable-multilib --disable-profile --disable-debug \
              --disable-werror --without-gd --enable-shared \
              --enable-static-nss --enable-obsolete-rpc libc_cv_forced_unwind=yes"
 
GLIBC_CONFIG_LP64="--build=$MACHTYPE --host=${TARGET_LP64} --target=${TARGET_LP64} \
                   --with-headers=${INSTALL_PATH_LP64}/${TARGET_LP64}/include/ \
                   ${GLIBC_COMMON}"
 
GLIBC_CONFIG_ILP32="--build=$MACHTYPE --host=${TARGET_ILP32} --target=${TARGET_ILP32} \
                    --with-headers=${INSTALL_PATH_ILP32}/${TARGET_ILP32}/include/ \ 
                    ${GLIBC_COMMON}"
PMAKE=-j10


 


 

Extra links