mirror of
https://github.com/saymrwulf/pulp-runtime.git
synced 2026-11-17 08:41:03 +00:00
Make init.c LLVM-compliant by disabling .ctors
This commit is contained in:
parent
d812c92404
commit
3b10f5f51e
2 changed files with 9 additions and 3 deletions
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
typedef void (*fptr)(void);
|
typedef void (*fptr)(void);
|
||||||
|
|
||||||
|
#ifndef PULP_LLVM
|
||||||
static fptr ctor_list[1] __attribute__((section(".ctors.start"))) = { (fptr) -1 };
|
static fptr ctor_list[1] __attribute__((section(".ctors.start"))) = { (fptr) -1 };
|
||||||
static fptr dtor_list[1] __attribute__((section(".dtors.start"))) = { (fptr) -1 };
|
static fptr dtor_list[1] __attribute__((section(".dtors.start"))) = { (fptr) -1 };
|
||||||
|
|
||||||
|
|
@ -46,6 +47,7 @@ static void pos_init_do_dtors(void)
|
||||||
(**fpp)();
|
(**fpp)();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
extern int main(int argc, const char * const argv[]);
|
extern int main(int argc, const char * const argv[]);
|
||||||
|
|
@ -72,7 +74,9 @@ void pos_init_start()
|
||||||
|
|
||||||
// Call global and static constructors
|
// Call global and static constructors
|
||||||
// Each module may do private initializations there
|
// Each module may do private initializations there
|
||||||
|
#ifndef PULP_LLVM
|
||||||
pos_init_do_ctors();
|
pos_init_do_ctors();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Now that the system is ready, activate IO
|
// Now that the system is ready, activate IO
|
||||||
pos_io_start();
|
pos_io_start();
|
||||||
|
|
@ -93,5 +97,7 @@ void pos_init_stop()
|
||||||
pos_io_stop();
|
pos_io_stop();
|
||||||
|
|
||||||
/* Call global and static destructors */
|
/* Call global and static destructors */
|
||||||
|
#ifndef PULP_LLVM
|
||||||
pos_init_do_dtors();
|
pos_init_do_dtors();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@ endif
|
||||||
PULP_ARCH_OBJDFLAGS ?=
|
PULP_ARCH_OBJDFLAGS ?=
|
||||||
else ifdef USE_CV32E40X
|
else ifdef USE_CV32E40X
|
||||||
PULP_LDFLAGS +=
|
PULP_LDFLAGS +=
|
||||||
PULP_CFLAGS += -D__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32
|
PULP_CFLAGS += -D__riscv__ -UARCHI_CORE_HAS_PULPV2 -DRV_ISA_RV32 -DPULP_LLVM
|
||||||
PULP_ARCH_CFLAGS ?= -march=rv32imc --target=riscv32
|
PULP_ARCH_CFLAGS ?= -march=rv32imcxfir --target=riscv32
|
||||||
PULP_ARCH_LDFLAGS ?= -march=rv32imc --target=riscv32
|
PULP_ARCH_LDFLAGS ?= -march=rv32imcxfir --target=riscv32
|
||||||
PULP_ARCH_OBJDFLAGS ?= -D
|
PULP_ARCH_OBJDFLAGS ?= -D
|
||||||
else
|
else
|
||||||
PULP_LDFLAGS +=
|
PULP_LDFLAGS +=
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue