Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import("//testing/libfuzzer/fuzzer_test.gni") | |
| 6 | |
| 5 declare_args() { | 7 declare_args() { |
| 6 # Controls whether the build should uses the version of sqlite3 library | 8 # Controls whether the build should uses the version of sqlite3 library |
| 7 # shipped with the system (currently only supported on iOS) or the one | 9 # shipped with the system (currently only supported on iOS) or the one |
| 8 # shipped with Chromium source. | 10 # shipped with Chromium source. |
| 9 use_system_sqlite = is_ios | 11 use_system_sqlite = is_ios |
| 10 } | 12 } |
| 11 | 13 |
| 12 if (!use_system_sqlite) { | 14 if (!use_system_sqlite) { |
| 13 config("sqlite_warnings") { | 15 config("sqlite_warnings") { |
| 14 cflags = [] | 16 cflags = [] |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 27 # http://www.sqlite.org/faq.html#q17 | 29 # http://www.sqlite.org/faq.html#q17 |
| 28 "-Wno-int-to-pointer-cast", | 30 "-Wno-int-to-pointer-cast", |
| 29 "-Wno-pointer-to-int-cast", | 31 "-Wno-pointer-to-int-cast", |
| 30 ] | 32 ] |
| 31 } | 33 } |
| 32 } | 34 } |
| 33 | 35 |
| 34 # "sqlite3" can cause conflicts with the system library. | 36 # "sqlite3" can cause conflicts with the system library. |
| 35 component("chromium_sqlite3") { | 37 component("chromium_sqlite3") { |
| 36 visibility = [ ":*" ] | 38 visibility = [ ":*" ] |
| 37 | |
| 38 sources = [ | 39 sources = [ |
| 39 "amalgamation/config.h", | 40 "amalgamation/config.h", |
| 40 "amalgamation/sqlite3.c", | 41 "amalgamation/sqlite3.c", |
| 41 "amalgamation/sqlite3.h", | 42 "amalgamation/sqlite3.h", |
| 42 "src/src/recover.c", | 43 "src/src/recover.c", |
| 43 "src/src/recover.h", | 44 "src/src/recover.h", |
| 44 "src/src/recover_varint.c", | 45 "src/src/recover_varint.c", |
| 45 ] | 46 ] |
| 46 | 47 |
| 47 cflags = [] | 48 cflags = [] |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 "fdatasync=fdatasync", | 123 "fdatasync=fdatasync", |
| 123 ] | 124 ] |
| 124 } | 125 } |
| 125 | 126 |
| 126 # Pull in config.h on Linux. This allows use of preprocessor macros which | 127 # Pull in config.h on Linux. This allows use of preprocessor macros which |
| 127 # are not available to the build config. | 128 # are not available to the build config. |
| 128 if (is_linux) { | 129 if (is_linux) { |
| 129 defines += [ "_HAVE_SQLITE_CONFIG_H" ] | 130 defines += [ "_HAVE_SQLITE_CONFIG_H" ] |
| 130 } | 131 } |
| 131 | 132 |
| 133 if (use_libfuzzer) { | |
|
mmoroz
2016/11/11 15:24:05
That's wrong, we have another flag which should wo
Scott Hess - ex-Googler
2016/11/11 15:43:09
WRT my LGTM, consider it sticky WRT the other code
| |
| 134 # Limit max length of data blobs and queries by 128M for fuzzing build. | |
| 135 defines += [ | |
| 136 "SQLITE_MAX_LENGTH=128000000", | |
| 137 "SQLITE_MAX_SQL_LENGTH=128000000", | |
| 138 ] | |
| 139 } | |
| 140 | |
| 132 include_dirs = [ "amalgamation" ] | 141 include_dirs = [ "amalgamation" ] |
| 133 | 142 |
| 134 configs -= [ "//build/config/compiler:chromium_code" ] | 143 configs -= [ "//build/config/compiler:chromium_code" ] |
| 135 configs += [ | 144 configs += [ |
| 136 "//build/config/compiler:no_chromium_code", | 145 "//build/config/compiler:no_chromium_code", |
| 137 | 146 |
| 138 # Must be after no_chromium_code for warning flags to be ordered | 147 # Must be after no_chromium_code for warning flags to be ordered |
| 139 # correctly. | 148 # correctly. |
| 140 ":sqlite_warnings", | 149 ":sqlite_warnings", |
| 141 ] | 150 ] |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 "//third_party/icu", | 258 "//third_party/icu", |
| 250 ] | 259 ] |
| 251 if (is_clang) { | 260 if (is_clang) { |
| 252 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 261 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
| 253 # conversion from string literal to bool. | 262 # conversion from string literal to bool. |
| 254 configs -= [ "//build/config/clang:extra_warnings" ] | 263 configs -= [ "//build/config/clang:extra_warnings" ] |
| 255 } | 264 } |
| 256 } | 265 } |
| 257 } | 266 } |
| 258 } | 267 } |
| 268 | |
| 269 fuzzer_test("sqlite3_prepare_v2_fuzzer") { | |
| 270 sources = [ | |
| 271 "fuzz/sqlite3_prepare_v2_fuzzer.cc", | |
| 272 ] | |
| 273 deps = [ | |
| 274 ":sqlite", | |
| 275 ] | |
| 276 dict = "//testing/libfuzzer/fuzzers/dicts/generated/sqlite3_prepare_v2_fuzzer. dict" | |
| 277 } | |
| OLD | NEW |