Skip to content

Commit ac923e7

Browse files
committed
Merge bitcoin/bitcoin#29287: depends: Do not override CFLAGS when building SQLite with DEBUG=1
5fb8f0f depends: Do not override CFLAGS when building SQLite with DEBUG=1 (Hennadii Stepanov) 2b0dd88 depends: Ensure definitions are passed when building SQLite with DEBUG=1 (Hennadii Stepanov) Pull request description: The `--enable-debug` configure option for the SQLite package does two things: ```autoconf #----------------------------------------------------------------------- # --enable-debug # AC_ARG_ENABLE(debug, [AS_HELP_STRING( [--enable-debug], [build with debugging features enabled [default=no]])], [], []) AC_MSG_CHECKING([Build type]) if test x"$enable_debug" = "xyes"; then BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" CFLAGS="-g -O0" AC_MSG_RESULT([debug]) else AC_MSG_RESULT([release]) fi #----------------------------------------------------------------------- ``` It adds three preprocessor definitions and overrides `CFLAGS` with `"-g -O0"`. The latter breaks the user's ability to provide sanitizer and LTO flags. This PR might be especially useful for OSS-Fuzz where `DEBUG=1` has been used since google/oss-fuzz#10503. Also it makes a workaround for building SQLite for 32-bit unneeded. For details, please refer to https://github.com/hebasto/oss-fuzz/tree/240120-sqlite. Changes in bitcoin/bitcoin#29282 might not be strictly required now. However, I consider them an improvement. ACKs for top commit: fanquake: ACK 5fb8f0f - downstream is also green, so i'll fixup the PR there. Tree-SHA512: 8593d8a0237ebb270d5da763fb65ed642ab8ed0d44e57704a34154621f49e3d5c58b462cc0070251fa1ba556c58a3c7d3620530d6839dc6dc9e0887010330eca
2 parents 7699a1a + 5fb8f0f commit ac923e7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

depends/packages/sqlite.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ $(package)_config_opts_linux=--with-pic
1111
$(package)_config_opts_freebsd=--with-pic
1212
$(package)_config_opts_netbsd=--with-pic
1313
$(package)_config_opts_openbsd=--with-pic
14-
$(package)_config_opts_debug=--enable-debug
15-
$(package)_cflags+=-DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DEPRECATED
16-
$(package)_cflags+=-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_JSON -DSQLITE_LIKE_DOESNT_MATCH_BLOBS
17-
$(package)_cflags+=-DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_AUTOINIT
14+
# We avoid using `--enable-debug` because it overrides CFLAGS, a behavior we want to prevent.
15+
$(package)_cflags_debug += -g
16+
$(package)_cppflags_debug += -DSQLITE_DEBUG
17+
$(package)_cppflags+=-DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DEPRECATED
18+
$(package)_cppflags+=-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_JSON -DSQLITE_LIKE_DOESNT_MATCH_BLOBS
19+
$(package)_cppflags+=-DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_AUTOINIT
1820
endef
1921

2022
define $(package)_preprocess_cmds

0 commit comments

Comments
 (0)