Skip to content

MarvellServer/ThunderX-GCC-ILP32-build

Repository files navigation

This repository contains two distinct things: scripts for building a toolchain with ILP32 support and Benchmark configurations; just SPECCPU2017 for the moment.

ThunderX-GCC-ILP32-build

The script will build the toolchain with ILP32 support. You need to install all the toolchain build essential tools for your OS distribution. We are assuming you have installed the TXOS (ThunderX OS) latest available version on ThunderX2 or later version of the hardware and installed all the dependency packages. We support the build procedure only on the latest available TXOS.

Operating System: ThunderX OS (TXOS) version txos-20.03 or later

Hardware : ThunderX2 or later version.

You can try on other OS, but we won't support. e.g. CentOS/Debian/Ubuntu ..etc. But you may need to install the dependency packages.

Debian/Ubuntu:

sudo apt-get install libc6 gnat g++ gawk binutils gzip bzip2 make tar perl zip unzip autoconf automake gettext gperf dejagnu tcl tk autogen guile-2.0 flex texinfo subversion ssh diffutils patch build-essential libncurses5-dev bison byacc flex

CentOS/TXOS:

sudo yum groupinstall "Development Tools"

sudo yum install autoconf automake binutils bison flex gcc gcc-c++ gettext libtool make patch pkgconfig redhat-rpm-config rpm-build rpm-sign ctags elfutils indent patchutils kernel-devel make

sudo yum install gawk binutils gzip bzip2 make tar perl zip unzip autoconf automake gettext tcl tk flex subversion diffutils patch bison byacc flex

dnf config-manager --enable PowerTools

dnf install texinfo

or

You can also download, compile and install texinfo - http://ftp.gnu.org/gnu/texinfo/

./configure --prefix=/usr/local

make -j$(nproc)

make install

How to run the toolchain build script

You have to clone the git repository to get the script.

$ git clone https://github.com/MarvellServer/ThunderX-GCC-ILP32-build.git

$ cd ThunderX-GCC-ILP32-build

Where to create a toolchain directory

You can create the toolchain install directory wherever you want. But when you install the toolchain using untar or rpm commands it will install in the same path. Let's create the toolchain install directory under /opt and give permission to script as a user in the same path.

Create an install directory

$ sudo mkdir /opt/toolchain-tot-ilp32

Give user permission to install the GCC/ILP32 toolchain in the same path.

$ sudo chown YourUsername:YourUsername /opt/toolchain-tot-ilp32

Execute the build script as a user

NOTE: Avoid to run the script as a root, because it may cause your host machine rootfs unless you know exactly what you are doing

$ ./build_gcc_toolchain.sh /opt/toolchain-tot-ilp32 TRUE TRUE

toolchain-tot-ilp32 - INSTALLDIR of the built toolchain.

TRUE - Does the MULTILIB installation.

TRUE - Does the LIBMVEC installation.

Where the tar file is created.

The tar file toolchain-tot-ilp32.tar.bz2 is generated by the script under your directory Absolute-Path/ThunderX-GCC-ILP32-build

How to create RPM file from tar file

You can generate the RPM from tar file in 2 ways. One method is to use the alien tool. The other method is to generate the RPM using the SPEC file. In the first method you have to install the alien tool

Convert tar.gz using alien tool

Download alien from site currently the best place to download the tarball is from http://packages.debian.org/unstable/source/alien

Extract tarball and install alien tool

$ tar -zxvf alien_8.88.tar.gz

$ cd alien

$ perl Makefile.PL

$ make -j$(nproc)

$ sudo make install

$ cd ..

Let’s check alien is working or not. If you don't find alien command you can also use alien.pl script

$ alien –to-rpm alien_8.88.tar.gz

Note: Please check help of alien (e.g. alien –help)

for example:

[nbhat@localhost ThunderX-GCC-ILP32-build]$ alien --to-rpm toolchain-tot-ilp32.tar.bz2 --target=aarch64

You can ignore the Warning:

Warning: alien is not running as root!

Warning: Ownerships of files in the generated packages will probably be wrong.

The RPM file is generated with the name

toolchain-tot-ilp32-1-2.aarch64.rpm generated

How to install RPM file

You can install the RPM file using the command

$ sudo rpm -ivh toolchain-tot-ilp32-1-2.aarch64.rpm --nodeps

The RPM will be installed under /opt/toolchain-tot-ilp32

How to uninstall RPM file

You can uninstall the RPM using the below command

$ sudo rpm -e toolchain-tot-ilp32-1-2.aarch64

RPM Build/Install/Uninstall using SPEC file

How to build the RPM using SPEC file

You have to execute the SPEC file as below

ThunderX-GCC-ILP32-build]$ rpmbuild --target aarch64 -bb toolchain_tot_ilp32.spec

The RPM is built and deployed under your home directory rpmbuild/RPMS/aarch64/

ThunderX-GCC-ILP32-build]$ ls ~/rpmbuild/RPMS/aarch64/

toolchain-tot-ilp32-1.0-2.el8.aarch64.rpm

Install the RPM package

You can install the RPM using the command from the location rpmbuild/RPMS/aarch64

ThunderX-GCC-ILP32-build]$ sudo rpm -ivh ~/rpmbuild/RPMS/aarch64/toolchain-tot-ilp32-1.0-2.el8.aarch64.rpm

This will install the toolchain under /opt/toolchain-tot-ilp32 path

Uninstall the RPM package

The un-installation can be done using -e switch option

ThunderX-GCC-ILP32-build]$ sudo rpm -e toolchain-tot-ilp32-1.0-2.el8.aarch64

Reference:

https://gcc.gnu.org/install/prerequisites.html

https://prasadlinuxblog.wordpress.com/2012/08/29/convert-tar-gz-to-rpm-on-centos/

About

Toolchain standalone build script with GCC+ILP32

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •