Toolchain Overlay File: Difference between revisions

From Linux/Xtensa
Jump to navigation Jump to search
m (Update conversion script)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==


The ''Overlay'' is a tar file that includes modified versions of processor configuration dependent files that are required by various toolchain tools, such as binutils, gcc, and gdb. The overlay described here has a specific layout and is intended for toolchain generators, such as buildroot or crosstool-NG.  
The ''Overlay'' is a tar file that includes modified versions of processor configuration dependent files that are required by various toolchain tools, such as binutils, gcc, and gdb. The overlay described here has a specific layout and is intended for toolchain generators, such as buildroot, OpenADK or crosstool-NG.  


== Creating the overlay ==
== Creating the overlay ==
Line 11: Line 11:
The following script converts this file and writes the modified version to xtensa-overlay.tar. Simply provide the path and name of the overlay provided by Tensilica when running the script:
The following script converts this file and writes the modified version to xtensa-overlay.tar. Simply provide the path and name of the overlay provided by Tensilica when running the script:


  ./script xtensa-config-overlay.tar.gz
  ./make-overlay.sh $XTENSA_CORE path/to/xtensa-config-overlay.tar.gz .


The file xtensa-overlay.tar created by the script can now be used to build buildroot or crosstool-NG. For more information how to configure those generators, please see [[Buildroot]] or [[crosstool-NG]].
The file xtensa_$XTENSA_CORE.tar.gz created by the script can now be used to build buildroot or crosstool-NG. For more information how to configure those generators, please see [[Buildroot]] or [[crosstool-NG]].


(Note that there is also a similar overlay file in the generated processor package provided by Tensilica, but it has a different directory layout and is not suitable for the script provided below. It can be found under .../$XTENSA_CORE/xtensa-elf/src/linux/misc/linux-overlay.tar.gz)
(Note that there is also a similar overlay file in the generated processor package provided by Tensilica, but it has a different directory layout and is not suitable for the script provided below. It can be found under .../$XTENSA_CORE/xtensa-elf/src/linux/misc/linux-overlay.tar.gz)
Line 19: Line 19:
== Conversion Script ==
== Conversion Script ==


#!/bin/sh
https://github.com/foss-xtensa/xtensa-config/blob/master/make-overlay.sh
if [ $# -ne 1 ]; then
  echo "Error: No overlay file specified"
  exit 1
fi
if [ $1 == "xtensa-overlay.tar" ]; then
  echo "Error: Input file must be named other than 'xtensa-overlay.tar'"
  exit 1
fi
if [ ! -f $1 ]; then
  echo "Error: Overlay file $1 not found"
  exit 1
fi
TMPDIR=`mktemp -d`
tar xzf $1 -C $TMPDIR
mkdir -p $TMPDIR/overlay/binutils/bfd $TMPDIR/overlay/binutils/ld \
          $TMPDIR/overlay/binutils/include $TMPDIR/overlay/gcc/include \
          $TMPDIR/overlay/gdb/bfd $TMPDIR/overlay/gdb/gdb/regformats \
          $TMPDIR/overlay/gdb/gdb/gdbserver $TMPDIR/overlay/gdb/include
mv $TMPDIR/binutils/xtensa-config.h $TMPDIR/overlay/binutils/include
mv $TMPDIR/binutils/xtensa-modules.c $TMPDIR/overlay/binutils/bfd
mv $TMPDIR/gcc/xtensa-config.h $TMPDIR/overlay/gcc/include
mv $TMPDIR/gdb/xtensa-config.c $TMPDIR/overlay/gdb/gdb
mv $TMPDIR/gdb/xtensa-config.h $TMPDIR/overlay/gdb/include
mv $TMPDIR/gdb/xtensa-modules.c $TMPDIR/overlay/gdb/bfd
mv $TMPDIR/gdb/xtensa-xtregs.c $TMPDIR/overlay/gdb/gdb/gdbserver
mv $TMPDIR/gdb/reg-xtensa.dat $TMPDIR/overlay/gdb/gdb/regformats
tar cf xtensa-overlay.tar -C $TMPDIR/overlay/ binutils gcc gdb
rm -fr $TMPDIR


== Example Files ==
== Example Files ==
Line 55: Line 27:
* http://www.linux-xtensa.org/pub/xtensa-config-overlay.tar.gz - Original overlay file provided by Tensilica
* http://www.linux-xtensa.org/pub/xtensa-config-overlay.tar.gz - Original overlay file provided by Tensilica
* http://www.linux-xtensa.org/pub/xtensa-overlay.tgz - : Generated overlay file, applicable to buildroot and crosstool-NG
* http://www.linux-xtensa.org/pub/xtensa-overlay.tgz - : Generated overlay file, applicable to buildroot and crosstool-NG
== Ready to go overlay archives (can be used with buildroot and OpenADK) ==
https://github.com/jcmvbkbc/xtensa-toolchain-build/tree/master/overlays

Latest revision as of 21:23, 26 July 2017

Introduction

The Overlay is a tar file that includes modified versions of processor configuration dependent files that are required by various toolchain tools, such as binutils, gcc, and gdb. The overlay described here has a specific layout and is intended for toolchain generators, such as buildroot, OpenADK or crosstool-NG.

Creating the overlay

The overlay file shipped by Tensilica uses a flat directory structure, which is not suitable for buildroot or crosstool-NG at the moment. The file is part of the generated processor package, and can be found in the XtDevTools directory:

XtDevTools/install/build/$VERSION/$XTENSA_CORE/src/xtensa-config-overlay.tar.gz

The following script converts this file and writes the modified version to xtensa-overlay.tar. Simply provide the path and name of the overlay provided by Tensilica when running the script:

./make-overlay.sh $XTENSA_CORE path/to/xtensa-config-overlay.tar.gz .

The file xtensa_$XTENSA_CORE.tar.gz created by the script can now be used to build buildroot or crosstool-NG. For more information how to configure those generators, please see Buildroot or crosstool-NG.

(Note that there is also a similar overlay file in the generated processor package provided by Tensilica, but it has a different directory layout and is not suitable for the script provided below. It can be found under .../$XTENSA_CORE/xtensa-elf/src/linux/misc/linux-overlay.tar.gz)

Conversion Script

https://github.com/foss-xtensa/xtensa-config/blob/master/make-overlay.sh

Example Files

The following files are the original and generated overlay file for the DC_D_233L processor.

Ready to go overlay archives (can be used with buildroot and OpenADK)

https://github.com/jcmvbkbc/xtensa-toolchain-build/tree/master/overlays