Please note that User Registration has been temporarily disabled due to a recent increase in automated registrations. If anyone needs an account, please request one here: RequestAccount. Thanks for your patience!--Wmat (talk)
Please email User:Wmat if you experience any issues with the Request Account form.

Difference between revisions of "ARMCompilers"

From eLinux.org
Jump to: navigation, search
(ARM Cortex Floating Point)
(mikroPascal PRO for ARM®)
 
(18 intermediate revisions by 10 users not shown)
Line 1: Line 1:
== gcc compiler ==
+
[[Category: Linux]]
 +
[[Category: OMAP]]
 +
This page is about compilers ([[Toolchains|toolchains]]) for ARM (Linux) based boards, mainly focussed to [[BeagleBoard#Cortex_A8_ARM_features|ARM Cortex A8]] on [[BeagleBoard]].
  
 +
== GCC compiler ==
 +
 +
=== Recommendations ===
 
[http://www.codesourcery.com/ CodeSourcery] [http://www.codesourcery.com/gnu_toolchains/arm/download.html '''ARM GNU/Linux''' tool chain] is the version with the support for the latest ARM architecture.  Mainline [http://gcc.gnu.org/ gcc] also has stable ARM support.  Enhancements are made in the Codesourcery version first, and are then pushed back to mainline.
 
[http://www.codesourcery.com/ CodeSourcery] [http://www.codesourcery.com/gnu_toolchains/arm/download.html '''ARM GNU/Linux''' tool chain] is the version with the support for the latest ARM architecture.  Mainline [http://gcc.gnu.org/ gcc] also has stable ARM support.  Enhancements are made in the Codesourcery version first, and are then pushed back to mainline.
  
[http://www.codesourcery.com/gnu_toolchains/arm/portal/release313 2007q3 version] is recommended.  An [http://people.mozilla.com/~vladimir/misc/cs2007q3-armel.tar.gz ARM-native version of CS2007q3 has been built] as well.  You can also install a native tool-chain from Angstrom.
+
As of August 2009, [http://www.codesourcery.com/sgpp/lite/arm/portal/release858 2009q1-203 version] is recommended.  If you look for native tool chain, you can also install a native tool-chain from Angstrom. More recent versions from 2011 (such as [http://www.codesourcery.com/sgpp/lite/arm/portal/release1803 2011.03-41 version]) should work just fine as well.
  
Note: A user reports that he found the use of CodeSourcery tool chain version 2007q1-21 and 2008q1-126 as strange. He has been using [http://www.codesourcery.com/gnu_toolchains/arm/portal/release313 '''2007q3-51'''] for a couple of months now.
+
Note: If you will use only [[BeagleBoardAndOpenEmbeddedGit|OpenEmbedded (OE)]] to build code for your Beagle, you don't need to download the CodeSourcery compiler. OE builds a cross-compiler from source as part of the bitbake process.
 +
 
 +
The [http://free-electrons.com/blog/beagle-labs/ Free Electrons] Beagle [http://free-electrons.com/doc/training/beagle/labs.pdf training material] uses [http://ymorin.is-a-geek.org/projects/crosstool Crosstool-ng].
 +
 
 +
=== Limitations===
  
 
Note: Some users report problems using Linux installer version. If installer doesn't work for you, download tar version (section ''Advanced Packages''), copy extracted ''arm-2007q3'' directory to ''/opt/codesourcery/arm-none-linux-gnueabi/'' and add ''/opt/codesourcery/arm-none-linux-gnueabi/arm-2007q3/bin'' to your path.
 
Note: Some users report problems using Linux installer version. If installer doesn't work for you, download tar version (section ''Advanced Packages''), copy extracted ''arm-2007q3'' directory to ''/opt/codesourcery/arm-none-linux-gnueabi/'' and add ''/opt/codesourcery/arm-none-linux-gnueabi/arm-2007q3/bin'' to your path.
  
* Note: CodeSourcery [http://groups.google.com/group/beagleboard/msg/63163389873902c3 2007q3] has an issue with -Os option. There is a [http://groups.google.com/group/beagleboard/msg/d4170b16029920ee fix] (needs recompilation)
+
* Note: CodeSourcery [http://groups.google.com/group/beagleboard/msg/63163389873902c3 2007q3] has the following issues:
 +
** Broken -Os option. There is a [http://groups.google.com/group/beagleboard/msg/d4170b16029920ee fix] (needs recompilation)
 +
** Started to [http://marc.info/?l=linux-omap&m=123878607426122&w=2 miscompile Linux kernel] with >= ~2.6.29 ([http://marc.info/?l=linux-omap&m=124027585911690&w=2 analysis by Richard Woodruff]) ([http://marc.info/?l=linux-omap&m=124267322526315&w=2 disabling ARM_UNWIND solves it]).
  
 
* Note: CodeSourcery [http://groups.google.com/group/beagleboard/msg/63163389873902c3? 2008q1] has the following issues:
 
* Note: CodeSourcery [http://groups.google.com/group/beagleboard/msg/63163389873902c3? 2008q1] has the following issues:
Line 18: Line 29:
 
* Note: CodeSourcery 2008q3 (now replaced by 2008q3-72) has the following issues:
 
* Note: CodeSourcery 2008q3 (now replaced by 2008q3-72) has the following issues:
 
** [http://hardwarebug.org/2008/10/11/codesourcery-gcc-2008q3-fail/ Broken NEON] support using ''-fmpu=neon -mfloat-abi=softfp -mcpu=cortex-a8 -O3''
 
** [http://hardwarebug.org/2008/10/11/codesourcery-gcc-2008q3-fail/ Broken NEON] support using ''-fmpu=neon -mfloat-abi=softfp -mcpu=cortex-a8 -O3''
** [http://www.beagleboard.org/irclogs/index.php?date=2008-10-11#T20:32:17 Miscompiles] U-Boot
+
** It was told to [http://www.beagleboard.org/irclogs/index.php?date=2008-10-11#T20:32:17 miscompile] U-Boot, but this seems to be fixed with recent [[BeagleBoard#U-Boot|U-Boot]] and 2008q3-72 below.
  
 
* Note: CodeSourcery 2008q3-72 has the following issues:
 
* Note: CodeSourcery 2008q3-72 has the following issues:
 
** See [http://hardwarebug.org/2008/11/28/codesourcery-fails-again/ small problem with vectorization].
 
** See [http://hardwarebug.org/2008/11/28/codesourcery-fails-again/ small problem with vectorization].
  
Note: If you will use only [[BeagleBoardAndOpenEmbeddedGit|OpenEmbedded (OE)]] to build code for your Beagle, you don't need to download the CodeSourcery compiler. OE builds a cross-compiler from source as part of the bitbake process.
+
* Note: CodeSourcery 2009q1 has the following issues:
 +
** Floating-point code can be slower than with 2007q3, see [http://hardwarebug.org/2009/08/05/arm-compiler-shoot-out/ FFmpeg benchmarks].
 +
 
 +
== GDB debugger ==
  
== ARM RVDS compiler ==
+
gdb supports native debug or 'gdbserver' remote debug.  For debug support for VFPv3 and NEON, you must use the 'gdbserver' approach - see [http://groups.google.com/group/beagleboard/browse_thread/thread/4b0e82be1e106242 How to enable VFPv3/NEON debug].
  
ARM has the [http://www.arm.com/products/DevTools/RVDSPro.html Realview Developer Suite], with arguably better code generation than gcc.  An [http://www.arm.com/products/DevTools/RVDSEvalCD.html DVD evaluation version] is available (or download via internet by [https://silver.arm.com/login/register.tm registering] followed by [https://silver.arm.com/licensing/autoeval.tm download]).
+
== The ARM Compiler (formerly RVCT) ==
  
ARM RVDS tools can be used to generate Linux applications and shared-libraries, by following the [http://infocenter.arm.com/help/topic/com.arm.doc.dai0212a/DAI0212A_building_linux_apps_with_rvct40_and_gnu.pdf Apps Note 212 Building Linux applications using RVCT v4.0 and the GNU Tools and Libraries]
+
ARM has the [http://www.arm.com/ds5 Development Studio 5 (DS-5)], which contains the ARM reference compiler. A 30-day [http://www.arm.com/ds5 evaluation version] is available for download.
  
ARM RVDS can also work in [http://www.scratchbox.org/ Scratchbox], by following  [http://infocenter.arm.com/help/topic/com.arm.doc.dai0221a/DAI0221A_rvds_compiler_scratchbox.pdf Apps Note 221 RealView Development Suite 4.0 ARM Compiler for Scratchbox]
+
The ARM Compiler toolchain can be used to generate Linux applications and shared-libraries and is generally highly compatible with GCC. It also bundles the industry leading vectorizing compiler for [http://www.arm.com/products/processors/technologies/neon.php ARM NEON-]enabled devices.
  
== ARM Cortex Floating Point ==
+
== Free Pascal ==
  
There are two types of instructions in the ARM v7 ISA that handle floating point:
+
[[Free Pascal]] can target multiple processor architectures, including ARM. 16 MB of RAM is required. Binaries as well as Free Pascal itself run on any ARM Linux installation.
  
1) '''VFPv3'''  Floating point instruction set (used for single/double precision scalar operations).
+
There are two ways to create binaries for the ARM architecture:
These is used by gcc for C floating point operations on 'float' and 'double'
+
  
2) '''NEON'''  [http://www.arm.com/products/multimedia/neon/ NEON] vectorized single precision operations (2 values in a D-register, or 4 values in a Q-register)
+
* Cross compiling: This creates code for an ARM-based embedded system from a different development system (e.g. an Intel-based or PPC-based computer)
These can be use by gcc when -ftree-vectorize is enabled and -mfpu=neon is specified, and the code can be vectorized.  In other cases the VFPv3 scalar ops will be used.
+
* Development directly on the target platform. This is possible with most ARM-based Linux systems.
  
ARM Cortex-A processors have separate floating point pipelines that handle these different instructions.
+
Both modes are supported by pure Free Pascal and by the [[Lazarus]] IDE.
  
On Cortex-A8, the designers' focus was on the NEON unit performance which can sustain 1 cycle/instr throughput (processing 2 single-precision values at once).  The scalar VFPv3 FPU cannot achieve this level of performance (cycle timings are in the Cortex-A8 TRM download), but it is still a lot better than doing floating point using integer instructions.
+
== mikroPascal PRO for ARM® ==
  
If you need the highest performance floating point on Cortex-A8, you need to use single precision and ensure the code uses the NEON vectorized instructions:
+
mikroPascal PRO for ARM® by MikroElektronika is a commercial Pascal compiler for ARM® Cortex-M3™ and Cortex-M4™ devices.
* use gcc with -ftree-vectorize  (possibly modify source code to make it vector friendly)
+
* use NEON instrinsics (#include <arm_neon.h>, float32x2_t datatype and vmul_f32() etc)
+
* use NEON asm directly
+
  
On Cortex-A9, there is a much higher performance floating point unit which can sustain 1 cycle/instr throughput, with low result latencies.
+
[[Category:Compiler]]

Latest revision as of 20:48, 2 May 2013

This page is about compilers (toolchains) for ARM (Linux) based boards, mainly focussed to ARM Cortex A8 on BeagleBoard.

GCC compiler

Recommendations

CodeSourcery ARM GNU/Linux tool chain is the version with the support for the latest ARM architecture. Mainline gcc also has stable ARM support. Enhancements are made in the Codesourcery version first, and are then pushed back to mainline.

As of August 2009, 2009q1-203 version is recommended. If you look for native tool chain, you can also install a native tool-chain from Angstrom. More recent versions from 2011 (such as 2011.03-41 version) should work just fine as well.

Note: If you will use only OpenEmbedded (OE) to build code for your Beagle, you don't need to download the CodeSourcery compiler. OE builds a cross-compiler from source as part of the bitbake process.

The Free Electrons Beagle training material uses Crosstool-ng.

Limitations

Note: Some users report problems using Linux installer version. If installer doesn't work for you, download tar version (section Advanced Packages), copy extracted arm-2007q3 directory to /opt/codesourcery/arm-none-linux-gnueabi/ and add /opt/codesourcery/arm-none-linux-gnueabi/arm-2007q3/bin to your path.

  • Note: CodeSourcery 2008q1 has the following issues:
    • Vectorization + NEON is broken
    • building static binaries with cortex-a8 flag (or any ARMv7a core) is broken
    • some armv6 compilations end in ICE.
  • Note: CodeSourcery 2008q3 (now replaced by 2008q3-72) has the following issues:
    • Broken NEON support using -fmpu=neon -mfloat-abi=softfp -mcpu=cortex-a8 -O3
    • It was told to miscompile U-Boot, but this seems to be fixed with recent U-Boot and 2008q3-72 below.
  • Note: CodeSourcery 2009q1 has the following issues:

GDB debugger

gdb supports native debug or 'gdbserver' remote debug. For debug support for VFPv3 and NEON, you must use the 'gdbserver' approach - see How to enable VFPv3/NEON debug.

The ARM Compiler (formerly RVCT)

ARM has the Development Studio 5 (DS-5), which contains the ARM reference compiler. A 30-day evaluation version is available for download.

The ARM Compiler toolchain can be used to generate Linux applications and shared-libraries and is generally highly compatible with GCC. It also bundles the industry leading vectorizing compiler for ARM NEON-enabled devices.

Free Pascal

Free Pascal can target multiple processor architectures, including ARM. 16 MB of RAM is required. Binaries as well as Free Pascal itself run on any ARM Linux installation.

There are two ways to create binaries for the ARM architecture:

  • Cross compiling: This creates code for an ARM-based embedded system from a different development system (e.g. an Intel-based or PPC-based computer)
  • Development directly on the target platform. This is possible with most ARM-based Linux systems.

Both modes are supported by pure Free Pascal and by the Lazarus IDE.

mikroPascal PRO for ARM®

mikroPascal PRO for ARM® by MikroElektronika is a commercial Pascal compiler for ARM® Cortex-M3™ and Cortex-M4™ devices.