yang.li | 5bef2f6 | 2022-01-11 14:08:06 +0800 | [diff] [blame] | 1 | # Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved. |
| 2 | |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | |
Xiaohu.Huang | be56506 | 2021-10-15 17:29:19 +0800 | [diff] [blame] | 5 | set(common_flags "") |
Xiaohu.Huang | be56506 | 2021-10-15 17:29:19 +0800 | [diff] [blame] | 6 | set(c_flags "") |
| 7 | |
| 8 | set(linker_flags "-Wl,--print-memory-usage,-Map=${TARGET_NAME}.map,--gc-sections") |
| 9 | |
| 10 | if(CONFIG_LIBC_STD) |
Xiaohu.Huang | 89a650b | 2021-12-31 17:31:55 +0800 | [diff] [blame] | 11 | set(linker_flags "${linker_flags},--wrap=_malloc_r,--wrap=_free_r,--wrap=_realloc_r,--wrap=_calloc_r") |
Xiaohu.Huang | be56506 | 2021-10-15 17:29:19 +0800 | [diff] [blame] | 12 | endif() |
| 13 | |
Kelvin Zhang | 83cb3da | 2022-03-21 16:33:27 +0800 | [diff] [blame^] | 14 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -g -ffunction-sections -fdata-sections -fno-common -fgnu89-inline -march=rv32imc -mabi=ilp32") |
Xiaohu.Huang | be56506 | 2021-10-15 17:29:19 +0800 | [diff] [blame] | 15 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --specs=nano.specs --specs=nosys.specs") |
Kelvin Zhang | 83cb3da | 2022-03-21 16:33:27 +0800 | [diff] [blame^] | 16 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -g -ffunction-sections -fdata-sections -fno-common -fno-builtin -fgnu89-inline -march=rv32imc -mabi=ilp32 -nostdlib") |
Xiaohu.Huang | be56506 | 2021-10-15 17:29:19 +0800 | [diff] [blame] | 17 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --specs=nano.specs --specs=nosys.specs") |
Kelvin Zhang | 83cb3da | 2022-03-21 16:33:27 +0800 | [diff] [blame^] | 18 | set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -O2 -g -ffunction-sections -fdata-sections -fno-common -fgnu89-inline -march=rv32imc -mabi=ilp32 -D__ASM") |
Xiaohu.Huang | be56506 | 2021-10-15 17:29:19 +0800 | [diff] [blame] | 19 | set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} --specs=nano.specs --specs=nosys.specs") |