@@ -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
@@ -1815,6 +1842,12 @@ srcck1.exe: $(TOP)\tool\srcck1.c
18151842sourcetest: srcck1.exe $(SQLITE3C)
18161843 srcck1.exe $(SQLITE3C)
18171844
1845+ src-verify.exe: $(TOP)\tool\src-verify.c
1846+ $(LTLINK) $(NO_WARN) $(TOP)\tool\src-verify.c
1847+
1848+ verify-source: src-verify.exe
1849+ src-verify.exe $(TOP)
1850+
18181851fuzzershell.exe: $(TOP)\tool\fuzzershell.c $(SQLITE3C) $(SQLITE3H)
18191852 $(LTLINK) $(NO_WARN) $(FUZZERSHELL_COMPILE_OPTS) $(TOP)\tool\fuzzershell.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
18201853
@@ -1878,7 +1911,7 @@ mptest: mptester.exe
18781911 move vdbe.new tsrc\vdbe.c
18791912 echo > .target_source
18801913
1881- sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL)
1914+ sqlite3.c: .target_source sqlite3ext.h sqlite3session.h $(MKSQLITE3C_TOOL) src-verify.exe
18821915 $(TCLSH_CMD) $(MKSQLITE3C_TOOL) $(MKSQLITE3C_ARGS)
18831916
18841917sqlite3-all.c: sqlite3.c $(TOP)\tool\split-sqlite3c.tcl
@@ -2234,8 +2267,8 @@ SHELL_SRC = \
22342267 $(TOP)\src\shell.c.in \
22352268 $(TOP)\ext\misc\appendvfs.c \
22362269 $(TOP)\ext\misc\completion.c \
2237- $(TOP)\ext\misc\base64.c \
2238- $(TOP)\ext\misc\base85.c \
2270+ $(TOP)\ext\misc\base64.c \
2271+ $(TOP)\ext\misc\base85.c \
22392272 $(TOP)\ext\misc\decimal.c \
22402273 $(TOP)\ext\misc\fileio.c \
22412274 $(TOP)\ext\misc\ieee754.c \
@@ -2246,9 +2279,10 @@ SHELL_SRC = \
22462279 $(TOP)\ext\expert\sqlite3expert.c \
22472280 $(TOP)\ext\expert\sqlite3expert.h \
22482281 $(TOP)\ext\misc\memtrace.c \
2249- $(TOP)/ext/recover/dbdata.c \
2250- $(TOP)/ext/recover/sqlite3recover.c \
2251- $(TOP)/ext/recover/sqlite3recover.h \
2282+ $(TOP)\ext\misc\pcachetrace.c \
2283+ $(TOP)\ext\recover\dbdata.c \
2284+ $(TOP)\ext\recover\sqlite3recover.c \
2285+ $(TOP)\ext\recover\sqlite3recover.h \
22522286 $(TOP)\src\test_windirent.c
22532287
22542288# If use of zlib is enabled, add the "zipfile.c" source file.
@@ -2492,10 +2526,13 @@ testrunner: testfixture.exe
24922526#
24932527devtest: testfixture.exe fuzztest testrunner
24942528
2529+ mdevtest:
2530+ $(TCLSH_CMD) $(TOP)\test\testrunner.tcl mdevtest
2531+
24952532# Testing for a release
24962533#
24972534releasetest: testfixture.exe fuzztest
2498- testfixture.exe $(TOP)/ test/ testrunner.tcl release
2535+ testfixture.exe $(TOP)\ test\ testrunner.tcl release
24992536
25002537
25012538smoketest: $(TESTPROGS)
@@ -2523,14 +2560,14 @@ sqlite3_expert.exe: $(SQLITE3C) $(TOP)\ext\expert\sqlite3expert.h $(TOP)\ext\exp
25232560 $(LTLINK) $(NO_WARN) $(TOP)\ext\expert\sqlite3expert.c $(TOP)\ext\expert\expert.c $(SQLITE3C) $(TLIBS)
25242561
25252562CHECKER_DEPS =\
2526- $(TOP)/ tool/ mkccode.tcl \
2563+ $(TOP)\ tool\ mkccode.tcl \
25272564 sqlite3.c \
2528- $(TOP)/ src/ tclsqlite.c \
2529- $(TOP)/ ext/ repair/ sqlite3_checker.tcl \
2530- $(TOP)/ ext/ repair/ checkindex.c \
2531- $(TOP)/ ext/ repair/ checkfreelist.c \
2532- $(TOP)/ ext/ misc/ btreeinfo.c \
2533- $(TOP)/ ext/ repair/ sqlite3_checker.c.in
2565+ $(TOP)\ src\ tclsqlite.c \
2566+ $(TOP)\ ext\ repair\ sqlite3_checker.tcl \
2567+ $(TOP)\ ext\ repair\ checkindex.c \
2568+ $(TOP)\ ext\ repair\ checkfreelist.c \
2569+ $(TOP)\ ext\ misc\ btreeinfo.c \
2570+ $(TOP)\ ext\ repair\ sqlite3_checker.c.in
25342571
25352572sqlite3_checker.c: $(CHECKER_DEPS)
25362573 $(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\ext\repair\sqlite3_checker.c.in > $@
@@ -2669,4 +2706,5 @@ clean:
26692706 del /Q showshm.exe sqlite3_checker.* sqlite3_expert.exe 2>NUL
26702707 del /Q fts5.* fts5parse.* 2>NUL
26712708 del /Q lsm.h lsm1.c 2>NUL
2709+ del /q src-verify.exe 2>NUL
26722710# <</mark>>
0 commit comments