summaryrefslogtreecommitdiff
path: root/bsp
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2023-06-26 20:24:58 -0400
committerMan, Jianting (Meco) <[email protected]>2023-06-26 22:42:30 -0400
commit53c435212c8d150bf95595a6000381ef76392aec (patch)
tree493f70d4d577e4a2156eaee0e4eb6c5e4e5c90e7 /bsp
parent4b3f14565d1ebc3e5a3c3c543eacf46debe8130b (diff)
[bsp][ch32v208w] fix C++ compling errors
Diffstat (limited to 'bsp')
-rw-r--r--bsp/wch/risc-v/ch32v208w-r0/SConstruct2
-rw-r--r--bsp/wch/risc-v/ch32v208w-r0/board/linker_scripts/link.lds9
-rw-r--r--bsp/wch/risc-v/ch32v208w-r0/rtconfig.py4
3 files changed, 13 insertions, 2 deletions
diff --git a/bsp/wch/risc-v/ch32v208w-r0/SConstruct b/bsp/wch/risc-v/ch32v208w-r0/SConstruct
index 487eb28892..f2454981ea 100644
--- a/bsp/wch/risc-v/ch32v208w-r0/SConstruct
+++ b/bsp/wch/risc-v/ch32v208w-r0/SConstruct
@@ -24,7 +24,7 @@ env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc',
- CXX = rtconfig.CXX,
+ CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
diff --git a/bsp/wch/risc-v/ch32v208w-r0/board/linker_scripts/link.lds b/bsp/wch/risc-v/ch32v208w-r0/board/linker_scripts/link.lds
index 389d440cca..3105304920 100644
--- a/bsp/wch/risc-v/ch32v208w-r0/board/linker_scripts/link.lds
+++ b/bsp/wch/risc-v/ch32v208w-r0/board/linker_scripts/link.lds
@@ -66,10 +66,19 @@ SECTIONS
__rtmsymtab_end = .;
. = ALIGN(4);
+ /* section information for initial. */
+ . = ALIGN(4);
+ __rt_init_start = .;
+ KEEP(*(SORT(.rti_fn*)))
+ __rt_init_end = .;
+
+ . = ALIGN(4);
+
PROVIDE(__ctors_start__ = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE(__ctors_end__ = .);
+
. = ALIGN(4);
_etext = .;
diff --git a/bsp/wch/risc-v/ch32v208w-r0/rtconfig.py b/bsp/wch/risc-v/ch32v208w-r0/rtconfig.py
index fee6d63ed1..a6df5fe22d 100644
--- a/bsp/wch/risc-v/ch32v208w-r0/rtconfig.py
+++ b/bsp/wch/risc-v/ch32v208w-r0/rtconfig.py
@@ -17,7 +17,7 @@ else:
if os.getenv('RTT_EXEC_PATH'):
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
-
+
BUILD = 'debug'
#BUILD = 'release'
@@ -57,6 +57,8 @@ if PLATFORM == 'gcc':
else:
CFLAGS += ' -O2'
+ CXXFLAGS = CFLAGS
+
POST_ACTION = OBJCPY + ' -O binary $TARGET ' + TARGET_NAME + '\n'
POST_ACTION += SIZE + ' $TARGET\n'