summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHao Zhu <[email protected]>2018-12-26 09:40:52 +0800
committerBernard Xiong <[email protected]>2019-01-09 15:13:03 +0800
commit064688992ec9d8839d79641d1bb787ad0e32328c (patch)
tree1b65a8df1c64eaaa5b1a38ffd1ae42bf5838affb
parent8529b41e7cf1310a619751240c10c754cd51965b (diff)
[bsp] [stm32] stm32f7支持c++环境
编译报错 Warning: L6330W: Undefined symbol SHT$$INIT_ARRAY$$Base (referred from crt_init.o). Unused section has been removed. Warning: L6330W: Undefined symbol SHT$$INIT_ARRAY$$Limit (referred from crt_init.o). Unused section has been removed.
-rw-r--r--bsp/stm32/stm32f767-fire-challenger/rtconfig.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bsp/stm32/stm32f767-fire-challenger/rtconfig.py b/bsp/stm32/stm32f767-fire-challenger/rtconfig.py
index 11cbdba8c4..060abb2deb 100644
--- a/bsp/stm32/stm32f767-fire-challenger/rtconfig.py
+++ b/bsp/stm32/stm32f767-fire-challenger/rtconfig.py
@@ -34,6 +34,7 @@ if PLATFORM == 'gcc':
# toolchains
PREFIX = 'arm-none-eabi-'
CC = PREFIX + 'gcc'
+ CXX = PREFIX + 'g++'
AS = PREFIX + 'gcc'
AR = PREFIX + 'ar'
CXX = PREFIX + 'g++'
@@ -42,6 +43,7 @@ if PLATFORM == 'gcc':
SIZE = PREFIX + 'size'
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
+ STRIP = PREFIX + 'strip'
DEVICE = ' -mcpu=cortex-m7 -mthumb -mfpu=fpv5-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
CFLAGS = DEVICE + ' -std=c99 -Dgcc'
@@ -59,9 +61,18 @@ if PLATFORM == 'gcc':
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
+ # module setting
+ CXXFLAGS = ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
+ M_CFLAGS = CFLAGS + ' -mlong-calls -fPIC '
+ M_CXXFLAGS = CXXFLAGS + ' -mlong-calls -fPIC'
+ M_LFLAGS = DEVICE + CXXFLAGS + ' -Wl,--gc-sections,-z,max-page-size=0x4' +\
+ ' -shared -fPIC -nostartfiles -static-libgcc'
+ M_POST_ACTION = STRIP + ' -R .hash $TARGET\n' + SIZE + ' $TARGET \n'
+
elif PLATFORM == 'armcc':
# toolchains
CC = 'armcc'
+ CXX = 'armcc'
AS = 'armasm'
AR = 'armar'
LINK = 'armlink'
@@ -91,6 +102,7 @@ elif PLATFORM == 'armcc':
elif PLATFORM == 'iar':
# toolchains
CC = 'iccarm'
+ CXX = 'iccarm'
AS = 'iasmarm'
AR = 'iarchive'
LINK = 'ilinkarm'
@@ -131,5 +143,7 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config "board/linker_scripts/link.icf"'
LFLAGS += ' --entry __iar_program_start'
+ CXXFLAGS = CFLAGS
+
EXEC_PATH = EXEC_PATH + '/arm/bin/'
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin' \ No newline at end of file