/
_bare.py
87 lines (77 loc) · 2.02 KB
/
_bare.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
from SCons.Script import Import
Import("env")
board_config = env.BoardConfig()
machine_flags = [
"-mcmodel=medany",
"-mabi=lp64f",
"-march=rv64imafc",
]
env.Append(
ASFLAGS=machine_flags,
ASPPFLAGS=[
"-x", "assembler-with-cpp",
],
CCFLAGS = machine_flags + [
"-fno-common",
"-ffunction-sections",
"-fdata-sections",
"-fstrict-volatile-bitfields",
"-fno-zero-initialized-in-bss",
"-Os",
"-ggdb",
"-Wall",
"-Werror=all",
"-Wno-error=unused-function",
"-Wno-error=unused-but-set-variable",
"-Wno-error=unused-variable",
"-Wno-error=deprecated-declarations",
"-Wno-multichar",
"-Wextra",
"-Werror=frame-larger-than=65536",
"-Wno-unused-parameter",
"-Wno-sign-compare",
"-Wno-error=missing-braces",
"-Wno-error=return-type",
"-Wno-error=pointer-sign",
"-Wno-missing-braces",
"-Wno-strict-aliasing",
"-Wno-implicit-fallthrough",
"-Wno-missing-field-initializers",
"-Wno-int-to-pointer-cast",
"-Wno-error=comment",
"-Wno-error=logical-not-parentheses",
"-Wno-error=duplicate-decl-specifier",
"-Wno-error=parentheses",
"-Wno-error=maybe-uninitialized"
],
CFLAGS = [
"-std=gnu11",
"-Wno-pointer-to-int-cast",
"-Wno-old-style-declaration"
],
CXXFLAGS = [
"-std=gnu++17"
],
CPPDEFINES = [
"CONFIG_LOG_ENABLE", #debug flags
("CONFIG_LOG_LEVEL", "LOG_INFO"),
("DEBUG", "1"),
"__riscv64",
"K210",
("ARCH", "K210"),
("F_CPU", "$BOARD_F_CPU")
],
LINKFLAGS = [
"-nostartfiles",
"-static",
"-Wl,--gc-sections",
"-Wl,-static",
"-Wl,--start-group",
"-Wl,--whole-archive",
"-Wl,--no-whole-archive",
"-Wl,--end-group",
"-Wl,-EL",
"-Wl,--no-relax"
#"-T ${SDK_ROOT}/lds/kendryte.ld"
]
)