News, tips, partners, and perspectives for the Oracle Linux operating system and upstream Linux kernel work

Getting Started with Oracle Arm Toolset 8

Contents: Why Arm Toolset 8? | devtoolset-8 or armtoolset-8? | Steps | (1) Download .repo | (2) Enable the collection | (3) yum install | (4) Start a shell | (5) Verify | (6) Problems? | Sources

Why Use Oracle Arm Toolset 8?

Oracle Linux 7 for Arm includes "Oracle Arm Toolset 8", which provides many popular development tools, including:

gcc v8.2.0 Supports the 2017 revision of the ISO C standard.
g++ v8.2.0 Supports the 2017 revision of the  ISO C++ standard.
gfortran v8.2.0 Supports Fortran 2018
go 1.11.1 The Go Programming Language
gdb v8.2 The GNU debugger
binutils v2.31   Binary utilities

The above versions are much more recent than the base system versions.

The base system versions are intentionally kept stable for many years, in order to help ensure compatibility for device drivers and other components that may be intimately tied to a specific compiler version.

For your own applications, you might want to use more modern language features.

For example, Oracle Arm Toolset 8 includes support for C++17.


trs80 Illustration credit: adapted by Jamie Henning from wikipedia, license CC-by-2.0

For a complete list of the software packages in Oracle Arm Toolset 8, see the yum repo page Oracle Linux 7 Software Collections.

devtoolset-8 or armtoolset-8?

If you want to use GCC v8, you will see 2 package sets at Oracle Linux 7 Software Collections:

. . . [etc]


. . . 

How can you decide which collection to choose?

A few differences can be seen in the lists of packages. For example:

oracle-armtoolset-8 includes the languages Ada and Go;
devtoolset-8 includes an updated version of GNU make.

oracle-armtoolset-8 updates support for certain platform-specific optimizations.

The most important difference is in shared library handling for C++ applications:

  • C++ applications compiled with oracle-armtoolset-8 require run-time systems to install oracle-armtoolset-8-libstdc++
  • C++ applications compiled with devtoolset-8 rely only on the system libstdc++ v4.8.5
  • Of course, the v4.8.5 library does not support C++17 features. The devtoolset compilers solve that problem using non-shared linking for library functions that are newer than the 4.8.5 system C++ library. (To be specific: /opt/rh/devtoolset-8/root/usr/lib/gcc/aarch64-redhat-linux/8/libstdc++.so is a linker script that resolves symbols from the v4.8.5 shared library /usr/lib64/libstdc++.so.6 when possible, or from the v8 libstdc++_nonshared.a otherwise.)

    • The devtoolset method has the usual advantage of static linking: fewer runtime dependencies.  The system administrator need not install a new C++ library.
    • The devtoolset method has the usual disadvantages, reducing both security and maintainability. For more detail, use your favorite search engine to look for: static linking considered harmful

Summary: The choice is yours: both provide modern GCC v8 features; from a security and maintainability point of view, you may prefer Oracle Arm Toolset 8.



Installation Steps for Oracle Arm Toolset 8

(1) Download the .repo

Download the Oracle Linux repo file:

# cd /etc/yum.repos.d
# wget http://yum.oracle.com/aarch64/public-yum-ol7.repo

(2) Enable the collection

In the repo file, set enabled=1 for ol7_software_collections:

Edit the .repo file.
Notice that there are many repositories.
At minimum, you should edit the section about the Software Collection Library to set  enabled=1

While you are there, review the other repositories, and decide whether you would like to enable any others. You can view the Software Collection Library in a browser by going to:  http://yum.oracle.com/repo/OracleLinux/OL7/SoftwareCollections/aarch64/index.html

name=Software Collection Library for Oracle Linux 7 ($basearch)

(3) Yum Install

# yum install policycoreutils-python 
# yum install 'oracle-armtoolset-8*'

(3a) Why 2 steps?
The reason for doing the installation in two steps above is that it avoids a possible installation issue -- one user reported Error unpacking rpm package oracle-armtoolset-8-runtime when the installation was done as a single step. As of April 2019, the possible issue is under investigation; in the meantime, the above method is recommended.

(3b) To start over:
If you encounter the above installation issue, to start over, try this sequence:

# yum remove 'oracle-armtoolset-8*'
# yum remove policycoreutils-python
# rm -Rf /opt/oracle/oracle-armtoolset-8/
# yum install policycoreutils-python
# yum install 'oracle-armtoolset-8*'

(4) Start a shell with the software collection

$ scl enable oracle-armtoolset-8 bash

Note that this will start a new shell.   (Of course, you could change the word ‘bash’ above to some other shell if you prefer.)

(5) Verify

Verify that the gcc command invokes the correct copy, and that paths are set as expected:

which gcc
echo $PATH

Expected output:

    • The which command should return:
    • All four echo commands should begin with:


(6) Problems? Wrong gcc? Wrong paths?

If Step (5) gives unexpected output, then check whether your shell initialization files are re-setting the path variables. If so here are four possible solutions:

(6a) norc
Depending on your shell, there is probably an option to start up without initialization. For example, if you are a bash user, you could say:

scl enable oracle-armtoolset-8 "bash --noprofile --norc"

(6b) silence
Alternatively, you can edit your shell initialization files to avoid setting paths, leaving it up to  scl instead.

(6c) (RECOMMENDED) Set paths only in your login shell initialization files.
The easiest solution is probably to check out the documentation for your shell and notice that it probably executes certain file(s) at login time and certain other file(s) when a new sub shell is created. For example, bash at login time will look for
   ~/.bash_profile, ~/.bash_login, or ~/.profile
and for sub shells it looks for
If you do your path setting in ~/.bash_profile and avoid touching paths in .bashrc, then the scl enable command will successfully add Oracle Arm Toolset 8 to your paths.

(6d) (Kludge) enable last
 If for some reason you wish to set paths in your sub shell initialization file, then please ensure that the toolset's enable scriptlet is done last. Here is an example from the bottom of my current .bashrc

   # If this is a shell created by 'scl enable', then make sure that the
   # 'enable' scriplet is done last, after all other path setting has 
   # been completed.
   grandparent_cmd=$(ps -o cmd= $(ps -o ppid= $PPID))
   if [[ "$grandparent_cmd" =~ "scl enable" ]] ; then
      #echo "looks like scl"
      grandparent_which=${grandparent_cmd/scl enable}
      grandparent_which=${grandparent_which// }
      grandparent_enable=$(ls /opt/*/$grandparent_which/enable 2>/dev/null)
      if [[ -f $grandparent_enable ]] ; then
         sourceit="source $grandparent_enable"
         echo doing "'$sourceit'"
         echo "did not find the enable scriplet for '$grandparent_which'"


If you would like the sources, please see  http://yum.oracle.com/repo/OracleLinux/OL7/SoftwareCollections/aarch64/index_src.html

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.