mirror of
https://github.com/marqs85/ossc
synced 2025-12-13 12:36:07 +03:00
change compiler and libc to optimize size
This commit is contained in:
parent
9af171947a
commit
2725351039
@ -190,7 +190,7 @@ CREATE_ELF_DERIVED_FILES := 0
|
|||||||
CREATE_LINKER_MAP := 1
|
CREATE_LINKER_MAP := 1
|
||||||
|
|
||||||
# Common arguments for ALT_CFLAGSs
|
# Common arguments for ALT_CFLAGSs
|
||||||
APP_CFLAGS_DEFINED_SYMBOLS :=
|
APP_CFLAGS_DEFINED_SYMBOLS := -DPICOLIBC_INTEGER_PRINTF_SCANF
|
||||||
ifeq ($(ENABLE_AUDIO),y)
|
ifeq ($(ENABLE_AUDIO),y)
|
||||||
APP_CFLAGS_DEFINED_SYMBOLS += -DENABLE_AUDIO
|
APP_CFLAGS_DEFINED_SYMBOLS += -DENABLE_AUDIO
|
||||||
endif
|
endif
|
||||||
@ -216,6 +216,7 @@ SYS_LIB :=
|
|||||||
BSP_ROOT_DIR := ../sys_controller_bsp/
|
BSP_ROOT_DIR := ../sys_controller_bsp/
|
||||||
|
|
||||||
# List of application specific include directories, library directories and library names
|
# List of application specific include directories, library directories and library names
|
||||||
|
APP_INCLUDE_DIRS += /usr/lib/picolibc/riscv64-unknown-elf/include
|
||||||
APP_INCLUDE_DIRS += it6613
|
APP_INCLUDE_DIRS += it6613
|
||||||
APP_INCLUDE_DIRS += tvp7002
|
APP_INCLUDE_DIRS += tvp7002
|
||||||
APP_INCLUDE_DIRS += ths7353
|
APP_INCLUDE_DIRS += ths7353
|
||||||
@ -396,7 +397,7 @@ APP_ASFLAGS := $(APP_ASM_INC_DIRS) \
|
|||||||
$(ASFLAGS)
|
$(ASFLAGS)
|
||||||
|
|
||||||
# Arguments only for the linker.
|
# Arguments only for the linker.
|
||||||
APP_LDFLAGS := $(APP_LDFLAGS_USER) --specs=nano.specs -nostartfiles
|
APP_LDFLAGS := $(APP_LDFLAGS_USER) --specs=picolibc.specs -nostartfiles
|
||||||
|
|
||||||
ifneq ($(LINKER_SCRIPT),)
|
ifneq ($(LINKER_SCRIPT),)
|
||||||
APP_LDFLAGS += -T'$(LINKER_SCRIPT)'
|
APP_LDFLAGS += -T'$(LINKER_SCRIPT)'
|
||||||
@ -657,11 +658,11 @@ build_post_process :
|
|||||||
# included makefile fragment.
|
# included makefile fragment.
|
||||||
#
|
#
|
||||||
ifeq ($(DEFAULT_CROSS_COMPILE),)
|
ifeq ($(DEFAULT_CROSS_COMPILE),)
|
||||||
DEFAULT_CROSS_COMPILE := riscv32-unknown-elf-
|
DEFAULT_CROSS_COMPILE := riscv64-unknown-elf-
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(DEFAULT_STACKREPORT),)
|
ifeq ($(DEFAULT_STACKREPORT),)
|
||||||
DEFAULT_STACKREPORT := riscv32-unknown-elf-size
|
DEFAULT_STACKREPORT := riscv64-unknown-elf-size
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(DEFAULT_DOWNLOAD),)
|
ifeq ($(DEFAULT_DOWNLOAD),)
|
||||||
@ -715,7 +716,7 @@ AR := $(CROSS_COMPILE)ar
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(origin LD),default)
|
ifeq ($(origin LD),default)
|
||||||
LD := $(CROSS_COMPILE)g++
|
LD := $(CROSS_COMPILE)gcc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(origin RM),default)
|
ifeq ($(origin RM),default)
|
||||||
@ -760,7 +761,7 @@ ifeq ($(MKDIR),)
|
|||||||
MKDIR := $(DEFAULT_MKDIR)
|
MKDIR := $(DEFAULT_MKDIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RV_OBJCOPY = riscv32-unknown-elf-objcopy
|
RV_OBJCOPY = riscv64-unknown-elf-objcopy
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# PATTERN RULES TO BUILD OBJECTS
|
# PATTERN RULES TO BUILD OBJECTS
|
||||||
|
|||||||
@ -2,6 +2,6 @@
|
|||||||
OUTPUT_ARCH(riscv)
|
OUTPUT_ARCH(riscv)
|
||||||
|
|
||||||
/* required to correctly link newlib */
|
/* required to correctly link newlib */
|
||||||
GROUP( -lc -lgloss -lgcc -lsupc++ )
|
GROUP( -lc -lgcc )
|
||||||
|
|
||||||
INCLUDE link.common.ld
|
INCLUDE link.common.ld
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
#define SD_SPI_BASE I2C_OPENCORES_1_BASE
|
#define SD_SPI_BASE I2C_OPENCORES_1_BASE
|
||||||
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
|
#include <stdio.h>
|
||||||
#define OS_PRINTF(...)
|
#define OS_PRINTF(...)
|
||||||
#define ErrorF(...)
|
#define ErrorF(...)
|
||||||
#define printf(...)
|
#define printf(...)
|
||||||
@ -38,6 +39,8 @@
|
|||||||
#define printf dd_printf
|
#define printf dd_printf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define sniprintf snprintf
|
||||||
|
|
||||||
#define WAITLOOP_SLEEP_US 10000
|
#define WAITLOOP_SLEEP_US 10000
|
||||||
|
|
||||||
#endif /* SYSCONFIG_H_ */
|
#endif /* SYSCONFIG_H_ */
|
||||||
|
|||||||
@ -73,9 +73,9 @@ extern int* (*alt_errno) (void);
|
|||||||
|
|
||||||
#include "alt_types.h"
|
#include "alt_types.h"
|
||||||
|
|
||||||
#undef errno
|
/*#undef errno
|
||||||
|
|
||||||
extern int errno;
|
extern int errno;*/
|
||||||
|
|
||||||
static ALT_INLINE int* alt_get_errno(void)
|
static ALT_INLINE int* alt_get_errno(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -112,10 +112,10 @@ SOPC_FILE := ../../sys.sopcinfo
|
|||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Archiver command. Creates library files.
|
# Archiver command. Creates library files.
|
||||||
AR = riscv32-unknown-elf-ar
|
AR = riscv64-unknown-elf-ar
|
||||||
|
|
||||||
# Assembler command. Note that CC is used for .S files.
|
# Assembler command. Note that CC is used for .S files.
|
||||||
AS = riscv32-unknown-elf-gcc
|
AS = riscv64-unknown-elf-gcc
|
||||||
|
|
||||||
# Custom flags only passed to the archiver. This content of this variable is
|
# Custom flags only passed to the archiver. This content of this variable is
|
||||||
# directly passed to the archiver rather than the more standard "ARFLAGS". The
|
# directly passed to the archiver rather than the more standard "ARFLAGS". The
|
||||||
@ -139,10 +139,10 @@ BSP_CFLAGS_OPTIMIZATION = -Os
|
|||||||
BSP_CFLAGS_WARNINGS = -Wall
|
BSP_CFLAGS_WARNINGS = -Wall
|
||||||
|
|
||||||
# C compiler command.
|
# C compiler command.
|
||||||
CC = riscv32-unknown-elf-gcc -xc
|
CC = riscv64-unknown-elf-gcc -xc
|
||||||
|
|
||||||
# C++ compiler command.
|
# C++ compiler command.
|
||||||
CXX = riscv32-unknown-elf-gcc -xc++
|
CXX = riscv64-unknown-elf-gcc -xc++
|
||||||
|
|
||||||
# Command used to remove files during 'clean' target.
|
# Command used to remove files during 'clean' target.
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
@ -339,6 +339,7 @@ BSP_CFLAGS += \
|
|||||||
BSP_CPPFLAGS += \
|
BSP_CPPFLAGS += \
|
||||||
$(addprefix -I, $(BSP_INC_DIRS)) \
|
$(addprefix -I, $(BSP_INC_DIRS)) \
|
||||||
$(addprefix -I, $(ALT_INCLUDE_DIRS)) \
|
$(addprefix -I, $(ALT_INCLUDE_DIRS)) \
|
||||||
|
$(addprefix -I, /usr/lib/picolibc/riscv64-unknown-elf/include) \
|
||||||
$(ALT_CPPFLAGS) \
|
$(ALT_CPPFLAGS) \
|
||||||
$(CPPFLAGS)
|
$(CPPFLAGS)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user