Switch to new compiler, need to test

This commit is contained in:
meepingsnesroms
2019-09-21 19:35:05 -07:00
parent 4c7d34facf
commit 01bebf5418
5 changed files with 50 additions and 18 deletions

7
.gitignore vendored
View File

@@ -11,15 +11,10 @@
/tools/palm/hwTestSuite/*.bin
/tools/palm/hwTestSuite/*.grc
/tools/palm/hwTestSuite/*.prc
/tools/palm/hwTestSuite/armCode
/tools/palm/hwTestSuite/TstSuite
/tools/palm/hwTestSuite/TstSuite-sections.s
/tools/palm/hwTestSuite/TstSuite-sections.ld
/tools/palm/muExpansionDriver/*.bin
/tools/palm/muExpansionDriver/*.grc
/tools/palm/muExpansionDriver/*.prc
/tools/palm/muExpansionDriver/muExpDriver
/tools/palm/muExpansionDriver/blobs/*.S68
/tools/palm/muExpansionDriver/blobs/*.L68
/tools/desktop/build-BufferGraphViewer-*
/tools/desktop/build-MakePalmBitmap-*
/tools/desktop/export16BitImageProperly/convert

View File

@@ -0,0 +1,30 @@
MEMORY
{
rom : ORIGIN = 0x10000000, LENGTH = 256K
ram : ORIGIN = 0x20000000, LENGTH = 512K
trash : ORIGIN = 0xffff0000, LENGTH = 65535
}
SECTIONS
{
.vec : {
KEEP( *(.vectors) ) ;
*(.vectors);
} > rom
.text : { *(.text) *(.text.*) ; } > rom
.rodata : { *(.rodata) *(.rodata.*) ; . = ALIGN(4); __data_data = ABSOLUTE(.) ; } > rom
.data : AT ( ADDR ( .rodata ) + SIZEOF ( .rodata ) ) { . = ALIGN(4); __data_start = ADDR ( .data ) + . ; *(.data) ; *(.data.*) ; . = ALIGN(4); __data_end = ADDR ( .data ) + . ; } > ram
.bss : { . = ALIGN(4); __bss_start = ABSOLUTE(.) ; *(.bss) *(.bss.*) *(COMMON) ; . = ALIGN(4); __bss_end = ABSOLUTE(.) ; } > ram
.trash1 : { *(.ARM.exidx) *(.ARM.exidx.*) ; } > trash
.trash2 : { *(.init) *(.init.*) ; *(.fini) *(.fini.*) ; } > trash
}
ENTRY (vecs);

View File

@@ -27,4 +27,4 @@
#define SSSR 0x0008
#define SSDR 0x0010
#endif
#endif

View File

@@ -12,3 +12,9 @@ unsigned long runTest(const void* emulStateP, void* userData68KP, /*Call68KFuncT
return 0;
}
void __attribute__((naked,section(".vectors"))) vecs(void){
asm volatile(
"B runTest \n\t"
);
}

View File

@@ -6,22 +6,22 @@ cd $DIR
APPNAME="TstSuite"
CFLAGS="-palmos4 -O3"
M68K_CFLAGS="-palmos4 -O3"
ARM_CFLAGS="-flto -march=armv5t -Os -g -ggdb3 -I. -ffunction-sections -fdata-sections -ffixed-r9 -fpic -Wno-multichar -Wall"
ARM_LDFLAGS="-flto -Os -g -ggdb3 -Wl,--gc-sections -Wl,-T armLib.lkr -march=armv5t -fpic -ffixed-r9"
if [ "$1" = "debug" ]; then
CFLAGS="$CFLAGS -DDEBUG -g"
M68K_CFLAGS="$M68K_CFLAGS -DDEBUG -g"
fi
# PRC config
m68k-palmos-multigen $APPNAME.def
m68k-palmos-gcc $CFLAGS -c $APPNAME-sections.s -o $APPNAME-sections.o
m68k-palmos-gcc $CFLAGS -c *.c -o $I.o
m68k-palmos-gcc $M68K_CFLAGS -c $APPNAME-sections.s -o $APPNAME-sections.o
#68K compiling
declare -a M68K_C_FILES=($(ls -d *.c))
for I in "${M68K_C_FILES[@]}"; do
m68k-palmos-gcc $CFLAGS -c $I -o $I.o
m68k-palmos-gcc $M68K_CFLAGS -c $I -o $I.o
done
m68k-palmos-gcc -o $APPNAME *.o $APPNAME-sections.ld
rm -rf *.o *.a $APPNAME-sections.s $APPNAME-sections.ld
@@ -31,12 +31,13 @@ cd ./armSideCode
declare -a ARM_C_FILES=($(ls -d *.c))
declare -a ARM_ASM_FILES=($(ls -d *.S))
for I in "${ARM_C_FILES[@]}"; do
arm-palmos-gcc -fPIC $CFLAGS -c $I -o $I.o
arm-none-eabi-gcc $ARM_CFLAGS -c $I -o $I.o
done
for I in "${ARM_ASM_FILES[@]}"; do
arm-palmos-gcc -fPIC $CFLAGS -c $I -o $I.o
arm-none-eabi-gcc $ARM_CFLAGS -c $I -o $I.o
done
arm-palmos-gcc -fPIC -nostartfiles *.o -o ../armc0000.bin
arm-none-eabi-gcc -o ../armCode $ARM_LDFLAGS *.o
arm-none-eabi-objcopy -I elf32-littlearm -O binary ../armCode armc0000.bin -j.vec -j.text -j.rodata -j.data
rm -rf *.o *.a
cd ../
@@ -47,5 +48,5 @@ if type "MakePalmBitmap" &> /dev/null; then
fi
pilrc $APPNAME.rcp
build-prc $APPNAME.def $APPNAME *.bin
rm -rf $APPNAME *.bin
build-prc $APPNAME.def $APPNAME armCode *.bin
# rm -rf $APPNAME armCode *.bin