NOTE: The procedures described in the following sections must be completed before this step:
RPM automatically unarchives the source and applies any needed patches so you do NOT have to manually perform the procedures described Unarchiving the Tools and Applying RTEMS Patches.
This section describes the process of building binutils, gcc, and
newlib using RPM. RPM is a packaging format which can be used to
distribute binary files as well as to capture the procedure and
source code used to produce those binary files. Before
attempting to build any RPM from source, it is necessary to
ensure that all required source and patches are in the SOURCES
directory under the RPM root (probably /usr/src/redhat
or
/usr/local/src/redhat
) on your machine. This procedure
starts by installing the source RPMs as shown in the following
example:
rpm -i rtems-4.6-i386-rtems-binutils-collection-2.13.2.1-2.nosrc.rpm rpm -i rtems-4.6-i386-rtems-gcc-newlib-gcc3.2.3newlib1.11.0-2.nosrc.rpm
The RTEMS tool source RPMS are called "nosrc" to indicate that one or
more source files required to produce the RPMs are not present.
The RTEMS source RPMs typically include all required patches, but do not
include the large .tar.gz
or .tgz
files for
each component such as BINUTILS, GCC, or NEWLIB. These are shared
by all RTEMS RPMs regardless of target CPU and there was no reason
to duplicate them. You will have to get the required source
archive files by hand and place them in the SOURCES
directory
before attempting to build. If you forget to do this, RPM is
smart -- it will tell you what is missing. To determine what is
included or referenced by a particular RPM, use a command like the
following:
$ rpm -q -l -p rtems-4.6-i386-rtems-gcc-newlib-gcc3.2.3newlib1.11.0-1.nosrc.rpm gcc-3.2.3-rtems-20030507a.diff i386-rtems-gcc-3.2.3-newlib-1.11.0.spec newlib-1.11.0-rtems-20030507.diff
Notice that there are patch files (the .diff
files) and a file
describing the build procedure and files produced (the .spec
file),
but no source archives (the *tar.*
files).
When installing this source RPM
(rpm -U rtems-4.6-i386-rtems-gcc-newlib-gcc3.2.3newlib1.11.0-1.nosrc.rpm
),
the .spec
file is placed in the SPECS
directory under the RPM root
directory, while the *.diff
files are placed into the SOURCES
directory.
The following example illustrates the invocation of RPM to build a new, locally compiled, binutils binary RPM that matches the installed source RPM. This example assumes that all of the required source is installed.
cd <RPM_ROOT_DIRECTORY>/SPECS rpm -bb i386-rtems-binutils-2.13.2.1.spec
If the build completes successfully, RPMS like the following will be generated in a build-host architecture specific subdirectory of the RPMS directory under the RPM root directory.
rtems-4.6-rtems-base-binutils-2.13.2.1-2.i386.rpm rtems-4.6-i386-rtems-binutils-2.13.2.1-2.i386.rpm
NOTE: It may be necessary to remove the build tree in the
BUILD
directory under the RPM root directory.
The following example illustrates the invocation of RPM to build a new, locally compiled, set of GCC and NEWLIB binary RPMs that match the installed source RPM. It is also necessary to install the BINUTILS RPMs and place them in your PATH. This example assumes that all of the required source is installed.
cd <RPM_ROOT_DIRECTORY>/RPMS/i386 rpm -i rtems-4.6-rtems-base-binutils-2.13.2.1-2.i386.rpm rpm -i rtems-4.6-i386-rtems-binutils-2.13.2.1-2.i386.rpm export PATH=/opt/rtems-4.6/bin:$PATH cd <RPM_ROOT_DIRECTORY>/SPECS rpm -bb i386-rtems-gcc-3.2.3-newlib-1.11.0.spec
If the build completes successfully, a set of RPMS like the following will be generated in a build-host architecture specific subdirectory of the RPMS directory under the RPM root directory.
rtems-4.6-rtems-base-gcc-gcc3.2.3newlib1.11.0-2.i386.rpm rtems-4.6-rtems-base-g77-gcc3.2.3newlib1.11.0-2.i386.rpm rtems-4.6-rtems-base-gcj-gcc3.2.3newlib1.11.0-2.i386.rpm rtems-4.6-i386-rtems-gcc-gcc3.2.3newlib1.11.0-2.i386.rpm rtems-4.6-i386-rtems-g77-gcc3.2.3newlib1.11.0-2.i386.rpm rtems-4.6-i386-rtems-gcj-gcc3.2.3newlib1.11.0-2.i386.rpm rtems-4.6-i386-rtems-objc-gcc3.2.3newlib1.11.0-2.i386.rpm
NOTE: Some targets do not support building all languages.
NOTE: It may be necessary to remove the build tree in the
BUILD
directory under the RPM root directory.
Copyright © 1988-2004 OAR Corporation