mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Remove libc dependency
This commit is contained in:
parent
c75969a9e8
commit
70a5e45129
@ -28,7 +28,8 @@ CFLAGS += -I. -I../include/CMSIS -I../include/StdPeriph -I../include/USB_OTG -I.
|
||||
# Linker Flags
|
||||
LDFLAGS = -mcpu=cortex-m4 -mabi=aapcs-linux -mthumb -mlittle-endian -mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
#LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(BIN).map -Tstm32f4xx.ld -L. -L../lib
|
||||
LDFLAGS += -Tstm32f4xx.ld -L. -L../lib
|
||||
#LDFLAGS += -nostdlib -Tstm32f4xx.ld -L. -L../lib
|
||||
LDFLAGS += -nostdlib -Tstm32f4xx.ld -L. -L../lib
|
||||
|
||||
|
||||
# Sources
|
||||
@ -37,9 +38,10 @@ OBJS = $(addprefix $(BUILD_DIR)/, $(SRCS:.c=.o))
|
||||
|
||||
# Libraries
|
||||
#LIB = -lmp -lc -lm -ldsp -lstdperiph -lusbcore -lusbdevcore
|
||||
LIB = -lmp -lc -lm -ldsp -lstdperiph
|
||||
LIB = -lmp -ldsp -lstdperiph
|
||||
|
||||
all:: $(BUILD_DIR) $(BUILD_DIR) $(BUILD_DIR)/$(BIN).bin
|
||||
$(SIZE) $(BUILD_DIR)/$(BIN).elf
|
||||
|
||||
$(BUILD_DIR):
|
||||
mkdir $@
|
||||
@ -53,7 +55,7 @@ $(BUILD_DIR)/$(BIN).elf: $(OBJS)
|
||||
$(CC) $(LDFLAGS) $(OBJS) $(LIB) -o $@
|
||||
|
||||
stats: $(BIN).elf
|
||||
$(SIZE) $(BIN).elf
|
||||
$(SIZE) $(BUILD_DIR)/$(BIN).elf
|
||||
|
||||
clean:
|
||||
$(RM) -fr $(BUILD_DIR)
|
||||
|
||||
@ -101,6 +101,6 @@ void array_resize(struct array *array, int idx)
|
||||
|
||||
void array_sort(struct array *array, array_comp comp)
|
||||
{
|
||||
qsort(array->data, array->index, sizeof(void*), comp);
|
||||
//qsort(array->data, array->index, sizeof(void*), comp);
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ ENTRY(Reset_Handler)
|
||||
MEMORY
|
||||
{
|
||||
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K
|
||||
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 512K
|
||||
FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 896K
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||
CCM (w!rx) : ORIGIN = 0x10000000, LENGTH = 64K
|
||||
}
|
||||
@ -21,7 +21,7 @@ _ram_end = 0x10010000; /* 64KB CCM */
|
||||
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
_stack_size = 0x1000; /* required amount of stack */
|
||||
_heap_size = 0x8000; /* required amount of heap */
|
||||
_heap_size = 0x8000; /* 0xC800 required amount of heap */
|
||||
_cache_size = 0x4000; /* required amount of cache */
|
||||
|
||||
_main_ram_start = 0x20000000;
|
||||
@ -56,39 +56,6 @@ SECTIONS
|
||||
_exit = .;
|
||||
} >FLASH_TEXT
|
||||
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
} >FLASH_TEXT
|
||||
|
||||
.ARM : {
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
} >FLASH_TEXT
|
||||
|
||||
.preinit_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array*))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
} >FLASH_TEXT
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
} >FLASH_TEXT
|
||||
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(.fini_array*))
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
} >FLASH_TEXT
|
||||
|
||||
/* used by the startup to initialize data */
|
||||
_sidata = .;
|
||||
|
||||
@ -140,15 +107,5 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
} >CCM
|
||||
|
||||
/* Remove information from the standard libraries */
|
||||
/*
|
||||
/DISCARD/ :
|
||||
{
|
||||
libc.a ( * )
|
||||
libm.a ( * )
|
||||
libgcc.a ( * )
|
||||
}
|
||||
*/
|
||||
|
||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user