Switched to g++
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
|
||||
COMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-gcc
|
||||
COMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-g++
|
||||
# CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostdlib
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding -nostartfiles -nostdlib
|
||||
CC_FLAGS = -march=rv32im -mabi=ilp32 -O0 -Wl,-Bstatic,-T,linker.ld -ffreestanding
|
||||
|
||||
DMP = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objdump
|
||||
CPY = ~/dev/riscv-gnu-toolchain/drops/bin/riscv32-unknown-elf-objcopy
|
||||
|
||||
# VX_STR = ../../startup/vx_start.s
|
||||
|
||||
|
||||
NEWLIB = ../../newlib/newlib.c ../../newlib/newlib_notimp.c ../../newlib/newlib.s
|
||||
VX_STR = ../../startup/vx_start.s
|
||||
VX_STR =
|
||||
VX_INT = ../../intrinsics/vx_intrinsics.s
|
||||
VX_IO = ../../io/vx_io.s ../../io/vx_io.c
|
||||
VX_API = ../../vx_api/vx_api.c
|
||||
VX_TEST = ../../tests/tests.c
|
||||
VX_FIO = ../../fileio/fileio.s
|
||||
LIBS = ./libs/libvecadd.a /home/fares/dev/pocl/drops_riscv_rt/lib/static/libOpenCL.a ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libc.a ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
|
||||
LIBS = -Wl,--whole-archive ./libs/libvecadd.a -Wl,--no-whole-archive ./libs/libOpenCL.a ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libc.a ~/dev/riscv-gnu-toolchain/drops/riscv32-unknown-elf/lib/libstdc++.a -static-libgcc -lgcc
|
||||
|
||||
VX_MAIN = vx_pocl_main
|
||||
|
||||
@@ -27,4 +29,4 @@ HEX: ELF
|
||||
$(CPY) -O ihex $(VX_MAIN).elf $(VX_MAIN).hex
|
||||
|
||||
ELF:
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_TEST) $(VX_MAIN).c $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
$(COMP) $(CC_FLAGS) $(VX_STR) $(VX_FIO) $(NEWLIB) $(VX_INT) $(VX_IO) $(VX_API) $(VX_TEST) $(VX_MAIN).c $(LIBS) -Iinclude -o $(VX_MAIN).elf
|
||||
|
||||
@@ -10,6 +10,7 @@ OUTPUT_ARCH(riscv)
|
||||
ENTRY(_start)
|
||||
SECTIONS
|
||||
{
|
||||
PROVIDE(__stack_top = 0x6ffff000);
|
||||
. = 0x70000000;
|
||||
.FileIO :
|
||||
{
|
||||
|
||||
@@ -54,6 +54,10 @@ typedef struct {
|
||||
static int g_num_kernels = 0;
|
||||
static kernel_info_t g_kernels [MAX_KERNELS];
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int _pocl_register_kernel(const char* name, const void* pfn, uint32_t num_args, uint32_t num_locals, const uint8_t* arg_types, const uint32_t* local_sizes) {
|
||||
printf("******** _pocl_register_kernel\n");
|
||||
printf("Name to register: %s\n", name);
|
||||
@@ -100,6 +104,10 @@ int _pocl_query_kernel(const char* name, const void** p_pfn, uint32_t* p_num_arg
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
int exitcode = 0;
|
||||
cl_context context = NULL;
|
||||
cl_command_queue commandQueue = NULL;
|
||||
@@ -130,7 +138,8 @@ void cleanup() {
|
||||
int main (int argc, char **argv) {
|
||||
vx_tmc(1);
|
||||
|
||||
printf("vecadd running\n");
|
||||
vx_print_str("Hello from vecadd\n");
|
||||
printf("New cleared vecadd running\n");
|
||||
|
||||
cl_platform_id platform_id;
|
||||
cl_device_id device_id;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user