@@ -52,6 +52,13 @@ MINIMAL_AMALGAMATION = 0
5252USE_STDCALL = 0
5353!ENDIF
5454
55+ # Set this non-0 to use structured exception handling (SEH) for WAL mode
56+ # in the core library.
57+ #
58+ !IFNDEF USE_SEH
59+ USE_SEH = 1
60+ !ENDIF
61+
5562# Set this non-0 to have the shell executable link against the core dynamic
5663# link library.
5764#
@@ -218,6 +225,12 @@ WIN32HEAP = 0
218225OSTRACE = 0
219226!ENDIF
220227
228+ # enable address sanitizer using ASAN=1 on the command-line.
229+ #
230+ !IFNDEF ASAN
231+ ASAN = 0
232+ !ENDIF
233+
221234# Set this to one of the following values to enable various debugging
222235# features. Each level includes the debugging options from the previous
223236# levels. Currently, the recognized values for DEBUG are:
@@ -389,6 +402,13 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS
389402OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1
390403!ENDIF
391404
405+ # Should structured exception handling (SEH) be enabled for WAL mode in
406+ # the core library?
407+ #
408+ !IF $(USE_SEH)!=0
409+ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_USE_SEH=1
410+ !ENDIF
411+
392412# These are the "extended" SQLite compilation options used when compiling for
393413# the Windows 10 platform.
394414#
@@ -877,6 +897,13 @@ RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
877897!ENDIF
878898!ENDIF
879899
900+
901+ # Address sanitizer if ASAN=1
902+ #
903+ !IF $(ASAN)>0
904+ TCC = $(TCC) /fsanitize=address
905+ !ENDIF
906+
880907# <<mark>>
881908# The locations of the Tcl header and library files. Also, the library that
882909# non-stubs enabled programs using Tcl must link against. These variables
@@ -1807,6 +1834,12 @@ srcck1.exe: $(TOP)\tool\srcck1.c
18071834sourcetest: srcck1.exe $(SQLITE3C)
18081835 srcck1.exe $(SQLITE3C)
18091836
1837+ src-verify.exe: $(TOP)\tool\src-verify.c
1838+ $(LTLINK) $(NO_WARN) $(TOP)\tool\src-verify.c
1839+
1840+ verify-source: src-verify.exe
1841+ src-verify.exe $(TOP)
1842+
18101843fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
18111844 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
18121845
@@ -1870,7 +1903,7 @@ mptest: mptester.exe
18701903 move vdbe.new tsrc\vdbe.c
18711904 echo > .target_source
18721905
1873- sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL)
1906+ sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL) src-verify.exe
18741907 $(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
18751908
18761909sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
@@ -2226,8 +2259,8 @@ SHELL_SRC = \
22262259 $(TOP)\src\shell.c.in \
22272260 $(TOP)\ext\misc\appendvfs.c \
22282261 $(TOP)\ext\misc\completion.c \
2229- $(TOP)\ext\misc\base64.c \
2230- $(TOP)\ext\misc\base85.c \
2262+ $(TOP)\ext\misc\base64.c \
2263+ $(TOP)\ext\misc\base85.c \
22312264 $(TOP)\ext\misc\decimal.c \
22322265 $(TOP)\ext\misc\fileio.c \
22332266 $(TOP)\ext\misc\ieee754.c \
@@ -2238,9 +2271,10 @@ SHELL_SRC = \
22382271 $(TOP)\ext\expert\sqlite3expert.c \
22392272 $(TOP)\ext\expert\sqlite3expert.h \
22402273 $(TOP)\ext\misc\memtrace.c \
2241- $(TOP)/ext/recover/dbdata.c \
2242- $(TOP)/ext/recover/sqlite3recover.c \
2243- $(TOP)/ext/recover/sqlite3recover.h \
2274+ $(TOP)\ext\misc\pcachetrace.c \
2275+ $(TOP)\ext\recover\dbdata.c \
2276+ $(TOP)\ext\recover\sqlite3recover.c \
2277+ $(TOP)\ext\recover\sqlite3recover.h \
22442278 $(TOP)\src\test_windirent.c
22452279
22462280# If use of zlib is enabled, add the "zipfile.c" source file.
@@ -2484,10 +2518,13 @@ testrunner: testfixture.exe
24842518#
24852519devtest: testfixture.exe fuzztest testrunner
24862520
2521+ mdevtest:
2522+ $(TCLSH_CMD) $(TOP)\test\testrunner.tcl mdevtest
2523+
24872524# Testing for a release
24882525#
24892526releasetest: testfixture.exe fuzztest
2490- testfixture.exe $(TOP)/ test/ testrunner.tcl release
2527+ testfixture.exe $(TOP)\ test\ testrunner.tcl release
24912528
24922529
24932530smoketest: $(TESTPROGS)
@@ -2515,14 +2552,14 @@ sqlite3_expert.exe: $(SQLITE3C) $(TOP)\ext\expert\sqlite3expert.h $(TOP)\ext\exp
25152552 $(LTLINK) $(NO_WARN) $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c $(SQLITE3C) $(TLIBS)
25162553
25172554CHECKER_DEPS =\
2518- $(TOP)/ tool/ mkccode.tcl \
2555+ $(TOP)\ tool\ mkccode.tcl \
25192556 sqlite3.c \
2520- $(TOP)/ src/ tclsqlite.c \
2521- $(TOP)/ ext/ repair/ sqlite3_checker.tcl \
2522- $(TOP)/ ext/ repair/ checkindex.c \
2523- $(TOP)/ ext/ repair/ checkfreelist.c \
2524- $(TOP)/ ext/ misc/ btreeinfo.c \
2525- $(TOP)/ ext/ repair/ sqlite3_checker.c.in
2557+ $(TOP)\ src\ tclsqlite.c \
2558+ $(TOP)\ ext\ repair\ sqlite3_checker.tcl \
2559+ $(TOP)\ ext\ repair\ checkindex.c \
2560+ $(TOP)\ ext\ repair\ checkfreelist.c \
2561+ $(TOP)\ ext\ misc\ btreeinfo.c \
2562+ $(TOP)\ ext\ repair\ sqlite3_checker.c.in
25262563
25272564sqlite3_checker.c: $(CHECKER_DEPS)
25282565 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\ext\repair\sqlite3_checker.c.in > $@
@@ -2661,4 +2698,5 @@ clean:
26612698 del /Q showshm.exe sqlite3_checker.* sqlite3_expert.exe 2>NUL
26622699 del /Q fts5.* fts5parse.* 2>NUL
26632700 del /Q lsm.h lsm1.c 2>NUL
2701+ del /q src-verify.exe 2>NUL
26642702# <</mark>>
0 commit comments