OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # The yasm build process creates a slew of small C subprograms that | 5 # The yasm build process creates a slew of small C subprograms that |
6 # dynamically generate files at various point in the build process. This makes | 6 # dynamically generate files at various point in the build process. This makes |
7 # the build integration moderately complex. | 7 # the build integration moderately complex. |
8 # | 8 # |
9 # There are three classes of dynamically generated files: | 9 # There are three classes of dynamically generated files: |
10 # 1) C source files that should be included in the build (eg., lc3bid.c) | 10 # 1) C source files that should be included in the build (eg., lc3bid.c) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 configs -= [ "//build/config/compiler:chromium_code" ] | 128 configs -= [ "//build/config/compiler:chromium_code" ] |
129 configs += [ | 129 configs += [ |
130 ":yasm_config", | 130 ":yasm_config", |
131 "//build/config/compiler:no_chromium_code", | 131 "//build/config/compiler:no_chromium_code", |
132 ] | 132 ] |
133 deps = [ | 133 deps = [ |
134 "//build/config/sanitizers:deps", | 134 "//build/config/sanitizers:deps", |
135 ] | 135 ] |
136 } | 136 } |
137 | 137 |
138 config("re2c_warnings") { | |
139 # re2c is missing CLOSEVOP from one switch. | |
140 if (is_clang) { | |
141 cflags = [ | |
142 # re2c is missing CLOSEVOP from one switch. | |
143 "-Wno-switch", | |
144 | |
145 # re2c contains many static functions in headers (because it's | |
146 # a C library predating C99.) | |
147 "-Wno-unused-function", | |
148 ] | |
149 } | |
150 } | |
151 | |
152 executable("re2c") { | 138 executable("re2c") { |
153 sources = [ | 139 sources = [ |
154 "source/patched-yasm/tools/re2c/actions.c", | 140 "source/patched-yasm/tools/re2c/actions.c", |
155 "source/patched-yasm/tools/re2c/code.c", | 141 "source/patched-yasm/tools/re2c/code.c", |
156 "source/patched-yasm/tools/re2c/dfa.c", | 142 "source/patched-yasm/tools/re2c/dfa.c", |
157 "source/patched-yasm/tools/re2c/main.c", | 143 "source/patched-yasm/tools/re2c/main.c", |
158 "source/patched-yasm/tools/re2c/mbo_getopt.c", | 144 "source/patched-yasm/tools/re2c/mbo_getopt.c", |
159 "source/patched-yasm/tools/re2c/parser.c", | 145 "source/patched-yasm/tools/re2c/parser.c", |
160 "source/patched-yasm/tools/re2c/scanner.c", | 146 "source/patched-yasm/tools/re2c/scanner.c", |
161 "source/patched-yasm/tools/re2c/substr.c", | 147 "source/patched-yasm/tools/re2c/substr.c", |
162 "source/patched-yasm/tools/re2c/translate.c", | 148 "source/patched-yasm/tools/re2c/translate.c", |
163 ] | 149 ] |
164 | 150 |
| 151 config("re2c_warnings") { |
| 152 # re2c is missing CLOSEVOP from one switch. |
| 153 if (is_clang) { |
| 154 cflags = [ |
| 155 # re2c is missing CLOSEVOP from one switch. |
| 156 "-Wno-switch", |
| 157 |
| 158 # re2c contains many static functions in headers (because it's |
| 159 # a C library predating C99.) |
| 160 "-Wno-unused-function", |
| 161 ] |
| 162 } |
| 163 } |
165 configs -= [ "//build/config/compiler:chromium_code" ] | 164 configs -= [ "//build/config/compiler:chromium_code" ] |
166 configs += [ | 165 configs += [ |
167 ":re2c_warnings", | |
168 ":yasm_config", | 166 ":yasm_config", |
169 "//build/config/compiler:no_chromium_code", | 167 "//build/config/compiler:no_chromium_code", |
| 168 ":re2c_warnings", |
170 ] | 169 ] |
171 deps = [ | 170 deps = [ |
172 "//build/config/sanitizers:deps", | 171 "//build/config/sanitizers:deps", |
173 ] | 172 ] |
174 } | 173 } |
175 | 174 |
176 config("yasm_warnings") { | |
177 if (is_clang) { | |
178 cflags = [ | |
179 # reg3264type in x86expr.c is unused. | |
180 "-Wno-unused-local-typedef", | |
181 ] | |
182 } | |
183 } | |
184 | |
185 executable("yasm") { | 175 executable("yasm") { |
186 sources = [ | 176 sources = [ |
187 "source/patched-yasm/frontends/yasm/yasm-options.c", | 177 "source/patched-yasm/frontends/yasm/yasm-options.c", |
188 "source/patched-yasm/frontends/yasm/yasm.c", | 178 "source/patched-yasm/frontends/yasm/yasm.c", |
189 "source/patched-yasm/libyasm/assocdat.c", | 179 "source/patched-yasm/libyasm/assocdat.c", |
190 "source/patched-yasm/libyasm/bc-align.c", | 180 "source/patched-yasm/libyasm/bc-align.c", |
191 "source/patched-yasm/libyasm/bc-data.c", | 181 "source/patched-yasm/libyasm/bc-data.c", |
192 "source/patched-yasm/libyasm/bc-incbin.c", | 182 "source/patched-yasm/libyasm/bc-incbin.c", |
193 "source/patched-yasm/libyasm/bc-org.c", | 183 "source/patched-yasm/libyasm/bc-org.c", |
194 "source/patched-yasm/libyasm/bc-reserve.c", | 184 "source/patched-yasm/libyasm/bc-reserve.c", |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 # File generated by compile_re2c_lc3b | 251 # File generated by compile_re2c_lc3b |
262 "$target_gen_dir/lc3bid.c", | 252 "$target_gen_dir/lc3bid.c", |
263 | 253 |
264 # File generated by generate_module | 254 # File generated by generate_module |
265 "$target_gen_dir/module.c", | 255 "$target_gen_dir/module.c", |
266 ] | 256 ] |
267 | 257 |
268 configs -= [ "//build/config/compiler:chromium_code" ] | 258 configs -= [ "//build/config/compiler:chromium_code" ] |
269 configs += [ | 259 configs += [ |
270 ":yasm_config", | 260 ":yasm_config", |
271 ":yasm_warnings", | |
272 "//build/config/compiler:no_chromium_code", | 261 "//build/config/compiler:no_chromium_code", |
273 "//build/config/compiler:no_incompatible_pointer_warnings", | 262 "//build/config/compiler:no_incompatible_pointer_warnings", |
274 ] | 263 ] |
275 | 264 |
| 265 config("yasm_warnings") { |
| 266 if (is_clang) { |
| 267 cflags = [ |
| 268 # reg3264type in x86expr.c is unused. |
| 269 "-Wno-unused-local-typedef", |
| 270 ] |
| 271 } |
| 272 } |
| 273 configs += [ ":yasm_warnings" ] |
| 274 |
276 # Yasm generates a bunch of .c files which its source file #include. | 275 # Yasm generates a bunch of .c files which its source file #include. |
277 # Add the |target_gen_dir| into the include path so it can find them. | 276 # Add the |target_gen_dir| into the include path so it can find them. |
278 # Ideally, these generated .c files would be placed into a separate | 277 # Ideally, these generated .c files would be placed into a separate |
279 # directory, but the gen_x86_insn.py script does not make this easy. | 278 # directory, but the gen_x86_insn.py script does not make this easy. |
280 include_dirs = [ yasm_gen_include_dir ] | 279 include_dirs = [ yasm_gen_include_dir ] |
281 | 280 |
282 if (!is_win) { | 281 if (!is_win) { |
283 cflags = [ | 282 cflags = [ |
284 "-ansi", | 283 "-ansi", |
285 "-pedantic", | 284 "-pedantic", |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 497 |
499 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 498 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
500 outputs = [ | 499 outputs = [ |
501 "$yasm_gen_include_dir/x86insns.c", | 500 "$yasm_gen_include_dir/x86insns.c", |
502 "$yasm_gen_include_dir/x86insn_gas.gperf", | 501 "$yasm_gen_include_dir/x86insn_gas.gperf", |
503 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 502 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
504 ] | 503 ] |
505 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 504 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
506 } | 505 } |
507 } | 506 } |
OLD | NEW |