From 64030a7cc32c27ac48fdda6df6bc403d25ae9c44 Mon Sep 17 00:00:00 2001 From: mariusmonton Date: Sun, 13 Jan 2019 18:20:02 +0100 Subject: [PATCH] fixed Makefile errors --- tests/C/trace/Makefile | 4 ++-- tests/C/trace/trace.c | 2 +- tests/C/trace2/Makefile | 4 ++-- tests/C/trace2/trace2.c | 2 +- tests/C/trace3/Makefile | 4 ++-- tests/C/trace3/trace3.c | 5 +++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/C/trace/Makefile b/tests/C/trace/Makefile index 7026d26..c0aa67c 100644 --- a/tests/C/trace/Makefile +++ b/tests/C/trace/Makefile @@ -2,14 +2,14 @@ TARGET = trace TARGET_ARCH=riscv32 -CC = riscv32-unknown-linux-gnu-gcc +CC = riscv32-unknown-elf-gcc # compiling flags here #CFLAGS = -Wall -I. -O0 -nostartfiles -march=rv32i -mabi=ilp32 CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 --entry main #CFLAGS = -Wall -I. -O0 -nodefaultlibs -march=rv32i -mabi=ilp32 -LINKER = riscv32-unknown-linux-gnu-gcc +LINKER = riscv32-unknown-elf-gcc # linking flags here LFLAGS = -I. --entry main LIBS = $(EXTRA_LIBS) diff --git a/tests/C/trace/trace.c b/tests/C/trace/trace.c index c1727c0..7bfc59c 100644 --- a/tests/C/trace/trace.c +++ b/tests/C/trace/trace.c @@ -1,7 +1,7 @@ #define TRACE (*(unsigned char *)0x40000000) -void main(void) { +int main(void) { TRACE = 'H'; TRACE = 'e'; diff --git a/tests/C/trace2/Makefile b/tests/C/trace2/Makefile index 9b2501f..a6b7721 100644 --- a/tests/C/trace2/Makefile +++ b/tests/C/trace2/Makefile @@ -2,14 +2,14 @@ TARGET = trace2 TARGET_ARCH=riscv32 -CC = riscv32-unknown-linux-gnu-gcc +CC = riscv32-unknown-elf-gcc # compiling flags here #CFLAGS = -Wall -I. -O0 -nostartfiles -march=rv32i -mabi=ilp32 CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 --entry main #CFLAGS = -Wall -I. -O0 -nodefaultlibs -march=rv32i -mabi=ilp32 -LINKER = riscv32-unknown-linux-gnu-gcc +LINKER = riscv32-unknown-elf-gcc # linking flags here LFLAGS = -I. --entry main LIBS = $(EXTRA_LIBS) diff --git a/tests/C/trace2/trace2.c b/tests/C/trace2/trace2.c index 1e537f9..911a717 100644 --- a/tests/C/trace2/trace2.c +++ b/tests/C/trace2/trace2.c @@ -1,7 +1,7 @@ #define TRACE (*(unsigned char *)0x40000000) -void main(void) { +int main(void) { int i; for(i=0;i<10;i++) { TRACE = 'a' + i; diff --git a/tests/C/trace3/Makefile b/tests/C/trace3/Makefile index 554024f..fa92738 100644 --- a/tests/C/trace3/Makefile +++ b/tests/C/trace3/Makefile @@ -2,14 +2,14 @@ TARGET = trace3 TARGET_ARCH=riscv32 -CC = riscv32-unknown-linux-gnu-gcc +CC = riscv32-unknown-elf-gcc # compiling flags here #CFLAGS = -Wall -I. -O0 -nostartfiles -march=rv32i -mabi=ilp32 CFLAGS = -Wall -I. -O0 -nostdlib -march=rv32i -mabi=ilp32 --entry main #CFLAGS = -Wall -I. -O0 -nodefaultlibs -march=rv32i -mabi=ilp32 -LINKER = riscv32-unknown-linux-gnu-gcc +LINKER = riscv32-unknown-elf-gcc # linking flags here LFLAGS = -I. --entry main LIBS = $(EXTRA_LIBS) diff --git a/tests/C/trace3/trace3.c b/tests/C/trace3/trace3.c index c93921b..3a9eb52 100644 --- a/tests/C/trace3/trace3.c +++ b/tests/C/trace3/trace3.c @@ -1,12 +1,13 @@ #define TRACE (*(unsigned char *)0x40000000) -void main(void) { +int main(void) { char msg[] = "abcdefg\n"; int i; for (i=0; i<5; i++) { TRACE = msg[i]; } - + asm volatile ("rdcycle t0"); + asm volatile ("rdtime t4"); asm volatile ("ecall"); }