|
34 | 34 | # |
35 | 35 |
|
36 | 36 | src_picocrt = [] |
| 37 | +src_picocrt_none = files('crt0-none.c') |
37 | 38 |
|
38 | 39 | machine_dir = 'machine' / host_cpu_family |
39 | 40 | picocrt_march_add='' |
@@ -64,25 +65,30 @@ foreach target : targets |
64 | 65 | crt_hosted_name = 'crt0-hosted.o' |
65 | 66 | crt_minimal_name = 'crt0-minimal.o' |
66 | 67 | crt_semihost_name = 'crt0-semihost.o' |
| 68 | + crt_none_name = 'crt0-none.o' |
67 | 69 | libcrt_name = 'crt0' |
68 | 70 | libcrt_hosted_name = 'crt0-hosted' |
69 | 71 | libcrt_minimal_name = 'crt0-minimal' |
70 | 72 | libcrt_semihost_name = 'crt0-semihost' |
| 73 | + libcrt_none_name = 'crt0-none' |
71 | 74 | else |
72 | 75 | crt_name = join_paths(target, 'crt0.o') |
73 | 76 | crt_hosted_name = join_paths(target, 'crt0-hosted.o') |
74 | 77 | crt_minimal_name = join_paths(target, 'crt0-minimal.o') |
75 | 78 | crt_semihost_name = join_paths(target, 'crt0-semihost.o') |
| 79 | + crt_none_name = join_paths(target, 'crt0-none.o') |
76 | 80 | libcrt_name = join_paths(target, 'libcrt0') |
77 | 81 | libcrt_hosted_name = join_paths(target, 'libcrt0-hosted') |
78 | 82 | libcrt_minimal_name = join_paths(target, 'libcrt0-minimal') |
79 | 83 | libcrt_semihost_name = join_paths(target, 'libcrt0-semihost') |
| 84 | + libcrt_none_name = join_paths(target, 'libcrt0-none') |
80 | 85 | endif |
81 | 86 |
|
82 | 87 | crt0_name = 'crt0' + target |
83 | 88 | crt0_hosted_name = 'crt0_hosted' + target |
84 | 89 | crt0_minimal_name = 'crt0_minimal' + target |
85 | 90 | crt0_semihost_name = 'crt0_semihost' + target |
| 91 | + crt0_none_name = 'crt0_none' + target |
86 | 92 |
|
87 | 93 | _c_args = value[1] + arg_fnobuiltin + ['-ffreestanding'] |
88 | 94 | _link_args = value[1] + ['-r', '-ffreestanding'] |
@@ -185,4 +191,19 @@ foreach target : targets |
185 | 191 | c_args : value[1] + ['-DCRT0_EXIT', '-DCRT0_SEMIHOST']) |
186 | 192 | endif |
187 | 193 | endif |
| 194 | + |
| 195 | + # The 'none' variant is completely empty |
| 196 | + _crt = executable(crt_none_name, |
| 197 | + src_picocrt_none, |
| 198 | + include_directories : inc, |
| 199 | + install : true, |
| 200 | + install_dir : instdir, |
| 201 | + c_args : _c_args, |
| 202 | + link_args : _link_args) |
| 203 | + |
| 204 | + set_variable(crt0_none_name, |
| 205 | + _crt.extract_objects(src_picocrt_none) |
| 206 | + ) |
| 207 | + |
| 208 | + |
188 | 209 | endforeach |
0 commit comments