aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2025-03-16 13:09:21 +0000
committerstephan <stephan@noemail.net>2025-03-16 13:09:21 +0000
commitab689657943f08ec31d1b73cc8e60bfbb2bd5ad3 (patch)
tree92dace859efba8a24d8c68b4079ecb63b50d2dd6
parent539442300c35e465c7e583949169a99392e8a241 (diff)
downloadsqlite-ab689657943f08ec31d1b73cc8e60bfbb2bd5ad3.tar.gz
sqlite-ab689657943f08ec31d1b73cc8e60bfbb2bd5ad3.zip
Add --asan-fsanitize=... configure flag to the canonical build to optionally set -fsantize flags for the fuzzcheck-asan tool. Teach proj-check-fsanitiz to fail for flags which the compiler emits any warning for, for reasons described in its comments.
FossilOrigin-Name: 013730e9b92af39cb7fd2871df9b4bc81b8990f918892bd79370704421672da0
-rw-r--r--Makefile.in2
-rw-r--r--auto.def5
-rw-r--r--autosetup/proj.tcl5
-rw-r--r--autosetup/sqlite-config.tcl4
-rw-r--r--main.mk4
-rw-r--r--manifest20
-rw-r--r--manifest.uuid2
7 files changed, 26 insertions, 16 deletions
diff --git a/Makefile.in b/Makefile.in
index 91135edba..6a2ba323a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -136,7 +136,7 @@ HAVE_WASI_SDK = @HAVE_WASI_SDK@
libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@
# -fsanitize flags for the fuzzcheck-asap app
-CFLAGS.fuzzcheck.fsanitize = @CFLAGS_FUZZCHECK_FSANITIZE@
+CFLAGS.fuzzcheck-asan.fsanitize = @CFLAGS_ASAN_FSANITIZE@
T.cc.sqlite = $(T.cc) @TARGET_DEBUG@
diff --git a/auto.def b/auto.def
index dcc7371ec..ee852dddf 100644
--- a/auto.def
+++ b/auto.def
@@ -46,7 +46,10 @@ sqlite-configure canonical {
define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools]
- define CFLAGS_FUZZCHECK_FSANITIZE [proj-check-fsanitize {address bounds-strict}]
+ if {[set fsan [join [opt-val asan-fsanitize] ","]] in {auto ""}} {
+ set fsan address,bounds-strict
+ }
+ define CFLAGS_ASAN_FSANITIZE [proj-check-fsanitize [split $fsan ", "]]
sqlite-handle-tcl
sqlite-handle-emsdk
diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl
index e00710b5d..ba5427b6a 100644
--- a/autosetup/proj.tcl
+++ b/autosetup/proj.tcl
@@ -1051,7 +1051,10 @@ proc proj-check-soname {{libname "libfoo.so.0"}} {
proc proj-check-fsanitize {{opts {address bounds-strict}}} {
set sup {}
foreach opt $opts {
- cc-with {} {
+ # -nooutput is used because -fsanitize=hwaddress will otherwise
+ # pass this test on x86_64, but then warn at build time that
+ # "hwaddress is not supported for this target".
+ cc-with {-nooutput 1} {
if {[cc-check-flags "-fsanitize=$opt"]} {
lappend sup $opt
}
diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl
index 111d822c2..899d8a507 100644
--- a/autosetup/sqlite-config.tcl
+++ b/autosetup/sqlite-config.tcl
@@ -337,6 +337,10 @@ proc sqlite-configure {buildMode configScript} {
=> {Enable #line macros in the amalgamation}
dynlink-tools
=> {Dynamically link libsqlite3 to certain tools which normally statically embed it}
+ asan-fsanitize:=auto
+ => {Comma- or space-separated list of -fsanitize flags for use with the
+ fuzzcheck-asan tool. Only those which the compiler claims to support
+ will actually be used. May be provided multiple times.}
}
{*} {
dump-defines=0
diff --git a/main.mk b/main.mk
index ff25719f5..97a747566 100644
--- a/main.mk
+++ b/main.mk
@@ -2169,10 +2169,10 @@ fuzzy: fuzzcheck$(T.exe)
xbin: fuzzcheck$(T.exe)
# -fsanitize=... flags for fuzzcheck-asan.
-CFLAGS.fuzzcheck.fsanitize ?= -fsanitize=address
+CFLAGS.fuzzcheck-asan.fsanitize ?= -fsanitize=address
fuzzcheck-asan$(T.exe): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP)
- $(T.link) -o $@ $(CFLAGS.fuzzcheck.fsanitize) $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) \
+ $(T.link) -o $@ $(CFLAGS.fuzzcheck-asan.fsanitize) $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) \
sqlite3.c $(LDFLAGS.libsqlite3)
fuzzy: fuzzcheck-asan$(T.exe)
xbin: fuzzcheck-asan$(T.exe)
diff --git a/manifest b/manifest
index d5e77ae0e..6fe3756f0 100644
--- a/manifest
+++ b/manifest
@@ -1,9 +1,9 @@
-C Configure-internal\sdoc\scleanups.\sNo\sfunctional\schanges.
-D 2025-03-16T12:27:21.085
+C Add\s--asan-fsanitize=...\sconfigure\sflag\sto\sthe\scanonical\sbuild\sto\soptionally\sset\s-fsantize\sflags\sfor\sthe\sfuzzcheck-asan\stool.\sTeach\sproj-check-fsanitiz\sto\sfail\sfor\sflags\swhich\sthe\scompiler\semits\sany\swarning\sfor,\sfor\sreasons\sdescribed\sin\sits\scomments.
+D 2025-03-16T13:09:21.699
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
-F Makefile.in 2788f5a3c36e26817707003170871936d44f46c5b45f8cbefe07c9f1a51a8988
+F Makefile.in 2c4d3c20e42ddd7596432c8d45feeaf709f93b37279e274ea413034912a4f840
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
F Makefile.msc ef04498c7e227a0f459b105bb4952f26cc985d1d6340a367e62d5a79c4689dfb
F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1
@@ -14,7 +14,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531
-F auto.def 619383263dfd0ee31df6a9d3e9828f65943d9fbcd274084046680641e5de53cb
+F auto.def 23f0e7eb5eff4cf922963e667ed630793ed60300df59ef9d93c87a23e31c7232
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
F autoconf/Makefile.in 6c98c82f52aa27a5c586080cf7c61c811174c2b6d8b8de33fd657d78d541dd7d
F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b
@@ -49,8 +49,8 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d
F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f
F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
-F autosetup/proj.tcl 5832513884aab068ab67fc8081a06793749312bce85509f27a822ad1e4df62f0
-F autosetup/sqlite-config.tcl a650eced0ad414bca6335bbd33136dfd0d0dc4dc7c279e7836fcdc471771eb44
+F autosetup/proj.tcl bdf0489d4ce8110fc1d4a09b1e2e274e50dd51711637b55c7c63a6a7ecec2aa5
+F autosetup/sqlite-config.tcl 3dddc1f949acfc1cad9faf13ece5095ce5ee34dea96f50aeb96aa91641c3a08c
F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3
@@ -705,7 +705,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36
F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61
F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
-F main.mk 49dc86f98d28724ffab580159ed46a1c2658d5c01e227794ce8e48128a420967
+F main.mk 11b4da311dedf3bf0301999b307c117fe1b5e4fdc260cb35105d235db0fec13b
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
@@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P c0d9b9fad3a2f23941927f1be2abded3bde2f2b04f7a5f3cc0a54a978020ebaa
-R 3e2bab33a1215d3d1df21710dcb6fd5c
+P be3a2e631100b711996b9524a54fc604966513a62d83fc916270a6226da7adab
+R 699bb2f6a1869a511409b94aecd9b45c
U stephan
-Z 677359532c348140e3ec1f8ae1a81268
+Z b465670c31108cfd99bca4e96066f044
# Remove this line to create a well-formed Fossil manifest.
diff --git a/manifest.uuid b/manifest.uuid
index 8d58c317d..fec909f33 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-be3a2e631100b711996b9524a54fc604966513a62d83fc916270a6226da7adab
+013730e9b92af39cb7fd2871df9b4bc81b8990f918892bd79370704421672da0