PPC GNU Toolchain Integration

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(Linker Switches)
(Compiler Switches)
 
Line 29: Line 29:
* -no-eabi: Don't use EABI.
* -no-eabi: Don't use EABI.
-
With these switches the compiler generates FLE machine code compatible with PPC e200zx cores.
+
With these switches the compiler generates PPC machine code in FLE mode compatible with PPC e200zx cores.
= Linker Switches =
= Linker Switches =

Latest revision as of 16:04, 24 September 2014

Contents

Background

In the freeware software distribution there is no GNU compiler toolchain that natively supports PPC e200zx cores. However, it is possible to generate compatible code for PPC e200zx cores acting on compiler and linker switches of any GNU Compiler Toolchian for PPC.

NOTE: All freeware GNU compiler toolchains generate PPC code in FLE mode ONLY!!!

The choose of Macraigor System GNU Tools PowerPC GNU Toolkit V:4.7.0-0 as GNU Toolchain for PPC was made basing on suggestion of Lauterbach support team.

The integration was based on PowerPC cross development with GNU Toolchain and Eclipse guide released by Ronetix.

Freescale MPC5554 build example

The PowerPC cross development with GNU Toolchain and Eclipse guide released by Ronetix provides a build example for Freescale MPC5554 MCU.

Inside the build example package there is a Makefile with the followings compiler/linker build configuration switches:

 PROJECT = mpc_ram
 LDSCRIPT= ./prj/MPC5554_SRAM.ld
 OPT = -O0
 MCU = 8540
 MCFLAGS = -mcpu=$(MCU)
 ASFLAGS = $(MCFLAGS)  -g -mno-eabi -mregnames -Wa,-mregnames -Wa,-mbooke32 -Wa,-me500 -misel=yes -mspe=yes -mfloat-gprs=no -msoft-float -mno-string -msdata=none -Wa,-I./inc -gdwarf-2
 CPFLAGS = $(MCFLAGS) $(OPT) -g -mno-eabi -mregnames -Wa,-mregnames -Wa,-mbooke32 -Wa,-me500 -misel=yes -mspe=yes -mfloat-gprs=no -msoft-float -mno-string -msdata=none -gdwarf-2
 LDFLAGS = $(MCFLAGS) -Wl,-g -Wl,-T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)

Compiler Switches

  • -mcpu=8540: Use features of and schedule code for given CPU (8540)
  • -me500: Generate code for Motorola e500 core complex
  • -mbooke32: Generate code for 32-bit PowerPC BookE
  • -no-eabi: Don't use EABI.

With these switches the compiler generates PPC machine code in FLE mode compatible with PPC e200zx cores.

Linker Switches

  • -nostdlib: Only use library directories specified on the command line.
  • -nostartfiles: Do not use the standard system startup files when linking. The standard system libraries are used normally, unless -nostdlib or -nodefaultlibs is used.

With these switches the linker DO NOT includes startup-code and standard libraries.

Personal tools