Skip to content

Commit 6b7680f

Browse files
committed
Merge branch 'build_opt' into hal-v0.6.0
2 parents 85fcbaf + f94b7a3 commit 6b7680f

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

boards.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ w801.menu.cpu_frq.2MHZ=2MHZ
3333
w801.menu.cpu_frq.2MHZ.build.f_cpu=2000000
3434
#---------------------------------------
3535
# Release /Optimise
36-
w801.menu.opt.release=Release ( -Os)
37-
w801.menu.opt.release.build.flags.optimize=-Os -flto
38-
w801.menu.opt.debug=Debug (-g)
39-
w801.menu.opt.debug.build.flags.optimize=-Og
36+
w80x.menu.opt.default=Default (-O2 -g3)
37+
#w80x.menu.opt.release.build.flags.optimize=-Os -flto
38+
w80x.menu.opt.maxspeed=Maximum speed (-O3)
39+
w80x.menu.opt.maxspeed.build.flags.optimize=-O3
40+
w80x.menu.opt.minsize=Minimum code size ( -Os)
41+
w80x.menu.opt.minsize.build.flags.optimize=-Os
42+
w80x.menu.opt.debug=Debug (-g)
43+
w80x.menu.opt.debug.build.flags.optimize=-Og
4044

4145
#---------------------------------------
4246
# Upload Speed

platform.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,25 @@ compiler.warning_flags.default=
2020
compiler.warning_flags.more=-Wall
2121
compiler.warning_flags.all=-Wall -Wextra
2222

23+
# This can be overridden in boards.txt
24+
build.extra_flags=
25+
build.flags.optimize=-O2 -g3
26+
27+
2328
# Default "compiler.path" is correct, change only if you want to override the initial value
2429
compiler.path={runtime.tools.csky.path}/bin/
2530
compiler.wrapper.path={runtime.tools.w80x_tool.path}/wrapper
2631
compiler.wrapper.path.windows={runtime.tools.w80x_tool.path}/win/busybox" ash "{runtime.tools.w80x_tool.path}/wrapper
2732
compiler.c.cmd=csky-elfabiv2-gcc
28-
compiler.c.flags=-mhard-float -DGCC_COMPILE=1 -O2 -g3 -Wall -ffunction-sections -fdata-sections -c
33+
compiler.c.flags=-mhard-float -DGCC_COMPILE=1 {build.flags.optimize} -Wall -ffunction-sections -fdata-sections -c
2934

3035
compiler.c.elf.flags=-Wl,--gc-sections -Wl,-zmax-page-size=1024 -Wl,--whole-archive
3136
compiler.c.elf.cmd=csky-elfabiv2-gcc
3237

3338
compiler.S.flags=-mhard-float -Wa,--gdwarf2
3439

3540
compiler.cpp.cmd=csky-elfabiv2-g++
36-
compiler.cpp.flags=-mhard-float -DGCC_COMPILE=1 -O2 -g3 -Wall -ffunction-sections -fdata-sections -c
41+
compiler.cpp.flags=-mhard-float -DGCC_COMPILE=1 {build.flags.optimize} -Wall -ffunction-sections -fdata-sections -c
3742

3843
compiler.ar.cmd=csky-elfabiv2-gcc-ar
3944
compiler.ar.flags=ru
@@ -46,8 +51,7 @@ compiler.elf2bin.cmd=csky-elfabiv2-objcopy
4651
compiler.ldflags=-lm -Wl,-T{build.core.path}/ld/gcc_csky.ld
4752
compiler.size.cmd=csky-elfabiv2-size
4853

49-
# This can be overridden in boards.txt
50-
build.extra_flags=
54+
5155

5256

5357

0 commit comments

Comments
 (0)