From c0b2a1a4b4a98b829b363da51f9c2ddf4c4eb61a Mon Sep 17 00:00:00 2001 From: bernard Date: Sat, 2 Dec 2017 10:53:19 +0800 Subject: [PATCH 1/3] [Tools] Add g++ link patch when enble C++. --- tools/building.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/building.py b/tools/building.py index 79c013527b..d855aaebdc 100644 --- a/tools/building.py +++ b/tools/building.py @@ -303,6 +303,11 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [ LINKCOMSTR = 'LINK $TARGET' ) + # fix the linker for C++ + if GetDepend('RT_USING_CPLUSPLUS'): + if env['LINK'].find('gcc') != -1: + env['LINK'] = env['LINK'].replace('gcc', 'g++') + # we need to seperate the variant_dir for BSPs and the kernels. BSPs could # have their own components etc. If they point to the same folder, SCons # would find the wrong source code to compile. From 9463fd9ae8fa112d3d8a6d01552e94e912deb881 Mon Sep 17 00:00:00 2001 From: bernard Date: Sat, 2 Dec 2017 10:53:42 +0800 Subject: [PATCH 2/3] [BSP] Add '-nostartfiles' to link flags. --- bsp/qemu-vexpress-a9/rtconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/qemu-vexpress-a9/rtconfig.py b/bsp/qemu-vexpress-a9/rtconfig.py index 0bd53277f5..1592f574f5 100644 --- a/bsp/qemu-vexpress-a9/rtconfig.py +++ b/bsp/qemu-vexpress-a9/rtconfig.py @@ -37,7 +37,7 @@ if PLATFORM == 'gcc': CFLAGS = DEVICE + ' -Wall' AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__' LINK_SCRIPT = 'link.lds' - LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors'+\ + LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors'+\ ' -T %s' % LINK_SCRIPT CPATH = '' From 89af35b0c3d665c77473e07ce4ac698ca3f32019 Mon Sep 17 00:00:00 2001 From: bernard Date: Sat, 2 Dec 2017 16:37:50 +0800 Subject: [PATCH 3/3] [BSP] Add qemu-nographic script --- bsp/qemu-vexpress-a9/qemu-nographic.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 bsp/qemu-vexpress-a9/qemu-nographic.sh diff --git a/bsp/qemu-vexpress-a9/qemu-nographic.sh b/bsp/qemu-vexpress-a9/qemu-nographic.sh new file mode 100644 index 0000000000..bf808dead2 --- /dev/null +++ b/bsp/qemu-vexpress-a9/qemu-nographic.sh @@ -0,0 +1 @@ +qemu-system-arm -M vexpress-a9 -kernel rtthread.elf -nographic