1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00

added option for arm/thumb mode

This commit is contained in:
Bogdan Marinescu 2008-08-02 17:59:47 +00:00
parent b0d76b66c9
commit 8ad0f6f31c

View File

@ -1,6 +1,6 @@
# Configuration file for the AT91SAM7X(256/512) backend
cpumode = ARGUMENTS.get( 'cpumode', 'arm' ).lower()
cpumode = ARGUMENTS.get( 'cpumode', 'thumb' ).lower()
specific_files = "board_cstartup.s board_lowlevel.c board_memories.c usart.c pmc.c pio.c platform.c tc.c"
if cputype == 'at91sam7x256':
@ -11,15 +11,24 @@ else:
print "Invalid AT91SAM7X CPU %s", cputype
sys.exit( -1 )
# Check CPU mode
if cpumode == 'arm':
modeflag = ''
elif cpumode == 'thumb':
modeflag = '-mthumb'
else:
print "Invalid CPU mode %s", cpumode
sys.exit( -1 )
# Prepend with path
specific_files = " ".join( [ "src/platform/%s/%s" % ( platform, f ) for f in specific_files.split() ] )
ldscript = "src/platform/%s/%s" % ( platform, ldscript )
# Toolset data
tools[ 'at91sam7x' ] = {}
tools[ 'at91sam7x' ][ 'cccom' ] = "arm-elf-gcc -mcpu=arm7tdmi -mthumb %s %s -ffunction-sections -fdata-sections %s -Wall -c $SOURCE -o $TARGET" % ( opt, local_include, cdefs )
tools[ 'at91sam7x' ][ 'linkcom' ] = "arm-elf-gcc -nostartfiles -nostdlib -mthumb -T %s -Wl,--gc-sections -Wl,-e,entry -Wl,--allow-multiple-definition -o $TARGET $SOURCES %s -lc -lgcc -lm" % ( ldscript, local_libs )
tools[ 'at91sam7x' ][ 'ascom' ] = "arm-elf-gcc -x assembler-with-cpp %s -mcpu=arm7tdmi -mthumb %s -D__ASSEMBLY__ -Wall -c $SOURCE -o $TARGET" % ( local_include, cdefs )
tools[ 'at91sam7x' ][ 'cccom' ] = "arm-elf-gcc -mcpu=arm7tdmi %s %s %s -ffunction-sections -fdata-sections %s -Wall -c $SOURCE -o $TARGET" % ( modeflag, opt, local_include, cdefs )
tools[ 'at91sam7x' ][ 'linkcom' ] = "arm-elf-gcc -nostartfiles -nostdlib %s -T %s -Wl,--gc-sections -Wl,-e,entry -Wl,--allow-multiple-definition -o $TARGET $SOURCES %s -lc -lgcc -lm" % ( modeflag, ldscript, local_libs )
tools[ 'at91sam7x' ][ 'ascom' ] = "arm-elf-gcc -x assembler-with-cpp %s -mcpu=arm7tdmi %s %s -D__ASSEMBLY__ -Wall -c $SOURCE -o $TARGET" % ( local_include, modeflag, cdefs )
# Programming function for LPC2888
def progfunc_at91sam7x( target, source, env ):