Project Stage 1 - Building GCC Compiler on aarch64 server

Intro
This series of Project Stage X is about the Project for SPO600 course at Seneca College.

In this post, I will describe Process of Building GCC Compiler on aarch64 server 
I refered to the instruction on Wiki

1. Access the server using the following command

ssh username@aarch64-003.spo600.cdot.systems #arrch64 machinessh username@x86-001.spo600.cdot.systems #arrch64 machine

2. Clone the GCC compiler from github

## currently in ~ directory
mkdir project
cd project
git clone git://gcc.gnu.org/git/gcc.git

3. Congiure the build

mkdir ~/project/gcc-build-001
cd ~/project/gcc-build-001
~/project/gcc/configure --prefix=$HOME/project/gcc-test-001

4. Perform the build

time make -j 24 |& tee build.log
This took me 93 minutes and 40 seconds.

5. Install the build

* Run the following command inside the gcc-build-001 directory
make install

6. Add `PATH` to use the test gcc compiler(that we just built) as default.

PATH=$HOME/project/gcc-test-001/bin:$PATH

7. Check which gcc the system is using

which gcc

If the PATH is correctly set, then it will display: "~/project/gcc-test-001/bin/gcc" If the PATH is NOT correctly set, then it will display: "/usr/bin/gcc" It means it's still using the system's gcc compiler. As we have successfully built compiler, not it is a time to explore the codebase. It will continue in the next post

Comments

popular posts in this blog

Project Stage 2 - part 2 : Clone-Pruning Analysis Pass

Project Stage 2 part 4 - Testing clone-test-core.c file with Modified GCC file and making further modification

Project Stage 2 part 3 - Compile a program with revised GCC