aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile.am
AgeCommit message (Collapse)Author
2019-02-15Merge #15391: Add compile time verification of assumptions we're currently ↵Wladimir J. van der Laan
making implicitly/tacitly 7cee85807c4db679003c6659d247a2fe74c2464a Add compile time verification of assumptions we're currently making implicitly/tacitly (practicalswift) Pull request description: Add compile time verification of assumptions we're currently making implicitly/tacitly. As suggested by @sipa in https://github.com/bitcoin/bitcoin/pull/14239#issuecomment-462508012 and @MarcoFalke in https://github.com/bitcoin/bitcoin/pull/14479#issuecomment-462534878. Tree-SHA512: e68fe51164dbd3eeb76aa8a7e83dfcd3b4d5a66037c0f1822bbbd189bbe3c280e03b3b10af870880ecc09b612e62fb3d9bcd6cf1e16cb7ba818c257db0712ce4
2019-02-14Add WriteHDKeypath function and move *HDKeypath to util/bip32.{h,cpp}Andrew Chow
Creates new files util/bip32.h and util/bip32.cpp for containing BIP 32 stuff. Moves FormatKeyPath from descriptor.cpp to util/bip32. Adds a wrapper around it to prepent the 'm' for when just the BIP 32 style keypath is needed.
2019-02-14Add compile time verification of assumptions we're currently making ↵practicalswift
implicitly/tacitly
2019-02-11Move PSBT definitions and code to separate filesGlenn Willen
Move non-wallet PSBT code to src/psbt.{h,cpp}, and PSBT wallet code to src/wallet/psbtwallet.{h,cpp}. This commit contains only code movement (and adjustments to includes and Makefile.am.)
2019-02-11Factor BroadcastTransaction out of sendrawtransactionGlenn Willen
Factor out a new BroadcastTransaction function, performing the core work of the sendrawtransaction rpc, so that it can be used from the GUI code. Move it from src/rpc/ to src/node/.
2019-01-31Merge #13926: [Tools] bitcoin-wallet - a tool for creating and managing ↵MarcoFalke
wallets offline 3c3e31c3a4 [tests] Add wallet-tool test (João Barbosa) 49d2374acf [tools] Add wallet inspection and modification tool (Jonas Schnelli) Pull request description: Adds an offline tool `bitcoin-wallet-tool` for wallet creation and maintenance. Currently this tool can create a new wallet file, display information on an existing wallet, and run the salvage and zapwallettxes maintenance tasks on an existing wallet. It can later be extended to support other common wallet maintenance tasks. Doing wallet maintenance tasks in an offline tool makes much more sense (and is potentially safer) than having to spin up a full node. Tree-SHA512: 75a28b8a58858d9d76c7532db40eacdefc5714ea5aab536fb1dc9756e2f7d750d69d68d59c50a68e633ce38fb5b8c3e3d4880db30fe01561e07ce58d42bceb2b
2019-01-30[tools] Add wallet inspection and modification toolJonas Schnelli
This commit adds wallet-tool, a tool for creating and interacting with wallet files. Original implementation was by Jonas Schnelli <dev@jonasschnelli.ch> with modifications by John Newbery <john@johnnewbery.com> MSVC files were provided by Chun Kuan Lee <ken2812221@gmail.com>: build: Add MSVC project files for bitcoin-wallet-tool
2019-01-30Merge #14711: Remove uses of chainActive and mapBlockIndex in wallet codeMeshCollider
44de1561a Remove remaining chainActive references from CWallet (Russell Yanofsky) db21f0264 Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis (Russell Yanofsky) 2ffb07929 Add findFork and findBlock to the Chain interface (Russell Yanofsky) d93c4c1d6 Add time methods to the Chain interface (Russell Yanofsky) 700c42b85 Add height, depth, and hash methods to the Chain interface (Russell Yanofsky) Pull request description: This change removes uses of `chainActive` and `mapBlockIndex` globals in wallet code. It is a refactoring change which does not affect external behavior. This is the next step in the larger #10973 refactoring change, which removes all other accesses to node global variables from wallet code. Doing this is useful to provide a better defined interface between the wallet and node, and necessary to allow wallet and node code to run in separate processes in #10102. Tree-SHA512: 4dcec8a31c458f54e2ea6ecf01e430469b0994c5b41a21a2d150efa67cd209f4c93ae210a101e064b3a87c52c6edfc70b070e979992be0e3a00fd425de6230a8
2019-01-16net: move BanMan to its own filesCory Fields
2019-01-15Add height, depth, and hash methods to the Chain interfaceRussell Yanofsky
And use them to remove uses of chainActive and mapBlockIndex in wallet code This commit does not change behavior. Co-authored-by: Ben Woosley <ben.woosley@gmail.com>
2018-11-15Merge #13815: util: Add [[nodiscard]] to all {Decode,Parse}[...](...) ↵MarcoFalke
functions returning bool 9cc0230cfc Add NODISCARD to all {Decode,Parse}[...](...) functions returning bool. Sort includes. (practicalswift) 579497e77a tests: Explicitly ignore the return value of DecodeBase58(...) (practicalswift) 145fe95ec7 tests: Check return value of ParseParameters(...) (practicalswift) 7c5bc2a523 miner: Default to DEFAULT_BLOCK_MIN_TX_FEE if unable to parse -blockmintxfee (practicalswift) Pull request description: Changes in this PR: * ~~Add linter to make sure the return value of `Parse[...](...)` is checked~~ * Add `__attribute__((warn_unused_result))` to all `{Decode,Parse}[...](...)` functions returning `bool` * Fix violations Context: * #13712: `wallet: Fix non-determinism in ParseHDKeypath(...). Avoid using an uninitialized variable in path calculation.` would have been prevented by this Tree-SHA512: 41a97899f2d5a26584235fa02b1ebfb4faacd81ea97e927022955a658fa7e15d07a1443b4b7635151a43259a1adf8f2f4de3c1c75d7b5f09f0d5496463a1dae6
2018-11-06Remove direct node->wallet calls in init.cppRussell Yanofsky
Route calls during node initialization and shutdown that would happen between a node process and wallet processes through the serializable `Chain::Client` interface, rather than `WalletInitInterface` which is now simpler and only deals with early initialization and parameter interaction. This commit mostly does not change behavior. The only change is that the "Wallet disabled!" and "No wallet support compiled in!" messages are now logged earlier during startup.
2018-11-06Add skeleton chain and client classesRussell Yanofsky
This commit does not change behavior. It just adds new skeleton classes that don't do anything and aren't instantiated yet.
2018-11-05blockfilter: Use unordered_set instead of set in blockfilter.Jim Posen
2018-11-05Extract CSipHasher to it's own file in crypto/ directory.Jim Posen
This is a move-only commit with the exception of changes to includes.
2018-11-05Add NODISCARD to all {Decode,Parse}[...](...) functions returning bool. Sort ↵practicalswift
includes.
2018-11-04scripted-diff: Move util files to separate directory.Jim Posen
-BEGIN VERIFY SCRIPT- mkdir -p src/util git mv src/util.h src/util/system.h git mv src/util.cpp src/util/system.cpp git mv src/utilmemory.h src/util/memory.h git mv src/utilmoneystr.h src/util/moneystr.h git mv src/utilmoneystr.cpp src/util/moneystr.cpp git mv src/utilstrencodings.h src/util/strencodings.h git mv src/utilstrencodings.cpp src/util/strencodings.cpp git mv src/utiltime.h src/util/time.h git mv src/utiltime.cpp src/util/time.cpp sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj -END VERIFY SCRIPT-
2018-10-09build: Add --disable-bip70 configure optionWladimir J. van der Laan
This patch adds a --disable-bip70 configure option that disables BIP70 payment request support. When disabled, this removes the dependency of the GUI on OpenSSL and Protobuf.
2018-09-27Merge #12246: Bugfix: Only run bitcoin-tx tests when bitcoin-tx is enabledMarcoFalke
a2a04a5abb Bugfix: Only run bitcoin-tx tests when bitcoin-tx is enabled (Luke Dashjr) 92af71cea9 configure: Make it possible to build only one of bitcoin-cli or bitcoin-tx (Luke Dashjr) Pull request description: Includes #5618 (which the reasons for rejecting no longer hold true) Tree-SHA512: f30a8e4a2f70166b7cabef77c4674163b3a9da14c6a547d34f00d1056a19bf4d23e22851eea726fad2afc8735d5473ae91122c770b65ac3886663dc20e2c5b70
2018-09-23MOVEONLY: Move versionbits info out of versionbits.oJorge Timón
2018-09-13build: Remove libssl from LDADD unless guiMarcoFalke
2018-09-13configure: Make it possible to build only one of bitcoin-cli or bitcoin-txLuke Dashjr
2018-09-12build: Move interfaces/* to libbitcoin_serverWladimir J. van der Laan
These are shared between bitcoind and bitcoin-qt. It is unnecessary for them to be linked against the other utilities.
2018-09-07[build] Move dummy wallet into its own .cpp file.John Newbery
Removes the ifdef ENABLE_WALLET from init.cpp.
2018-08-25blockfilter: Implement GCSFilter constructors.Jim Posen
2018-08-25blockfilter: Declare GCSFilter class for BIP 158 impl.Jim Posen
2018-07-27Output descriptors modulePieter Wuille
2018-07-24Add -avoidpartialspends and m_avoid_partial_spendsKarl-Johan Alm
2018-07-17Extract MakeUnique into utilmemory.hBen Woosley
And use it to reduce chainparamsbase's direct reliance on util.h to only args handling. utilmemory.h can be replaced with <memory> once we move to C++14.
2018-07-13Merge #13072: Update createmultisig RPC to support segwitPieter Wuille
f40b3b82df [tests] functional test for createmultisig RPC (Anthony Towns) b9024fdda3 segwit support for createmultisig RPC (Anthony Towns) d58055d25f Move AddAndGetDestinationForScript from wallet to outputype module (Anthony Towns) 9a44db2e46 Add outputtype module (Anthony Towns) Pull request description: Adds an "address_type" parameter that accepts "legacy", "p2sh-segwit", and "bech32" to choose the type of address created. Defaults to "legacy" rather than the value of the `-address-type` option for backwards compatibility. As part of implementing this, OutputType is moved from wallet into its own module, and `AddAndGetDestinationForScript` is changed to apply to a `CKeyStore` rather than a wallet, and to invoke `keystore.AddCScript(script)` itself rather than expecting the caller to have done that. Fixes #12502 Tree-SHA512: a08c1cfa89976e4fd7d29caa90919ebd34a446354d17abb862e99f2ee60ed9bc19d8a21a18547c51dc3812cb9fbed86af0bef2f1e971f62bf95cade4a7d86237
2018-07-12Merge #13177: GCC-7 and glibc-2.27 back compat codeWladimir J. van der Laan
253f5929097548fb10ef995002dedbb8dadb6a0d Add stdin, stdout, stderr to ignored export list (Chun Kuan Lee) fc6a9f2ab18ca8466d65d14c263c4f78f9ccebbf Use IN6ADDR_ANY_INIT instead of in6addr_any (Cory Fields) 908c1d7745f0ed117b0374fcc8486f83bf743bfc GCC-7 and glibc-2.27 compat code (Chun Kuan Lee) Pull request description: The `__divmoddi4` code was modified from https://github.com/gcc-mirror/gcc/blob/master/libgcc/libgcc2.c . I manually find the older glibc version of log2f by objdump, use `.symver` to specify the certain version. Tree-SHA512: e8d875652003618c73e019ccc420e7a25d46f4eaff1c7a1a6bfc1770b3b46f074b368b2cb14df541b5ab124cca41dede4e28fe863a670589b834ef6b8713f9c4
2018-07-09Merge #13386: SHA256 implementations based on Intel SHA ExtensionsWladimir J. van der Laan
66b2cf1ccfad545a8ec3f2a854e23f647322bf30 Use immintrin.h everywhere for intrinsics (Pieter Wuille) 4c935e2eee456ff66cdfb908b0edffdd1e8a6c04 Add SHA256 implementation using using Intel SHA intrinsics (Pieter Wuille) 268400d3188200c9e3dcd3482c4853354388a721 [Refactor] CPU feature detection logic for SHA256 (Pieter Wuille) Pull request description: Based on #13191. This adds SHA256 implementations that use Intel's SHA Extension instructions (using intrinsics). This needs GCC 4.9 or Clang 3.4. In addition to #13191, two extra implementations are provided: * (a) A variable-length SHA256 implementation using SHA extensions. * (b) A 2-way 64-byte input double-SHA256 implementation using SHA extensions. Benchmarks for 9001-element Merkle tree root computation on an AMD Ryzen 1800X system: * Using generic C++ code (pre-#10821): 6.1ms * Using SSE4 (master, #10821): 4.6ms * Using 4-way SSE4 specialized for 64-byte inputs (#13191): 2.8ms * Using 8-way AVX2 specialized for 64-byte inputs (#13191): 2.1ms * Using 2-way SHA-NI specialized for 64-byte inputs (this PR): 0.56ms Benchmarks for 32-byte SHA256 on the same system: * Using SSE4 (master, #10821): 190ns * Using SHA-NI (this PR): 53ns Benchmarks for 1000000-byte SHA256 on the same system: * Using SSE4 (master, #10821): 2.5ms * Using SHA-NI (this PR): 0.51ms Tree-SHA512: 2b319e33b22579f815d91f9daf7994a5e1e799c4f73c13e15070dd54ba71f3f6438ccf77ae9cbd1ce76f972d9cbeb5f0edfea3d86f101bbc1055db70e42743b7
2018-07-09Merge #13570: RPC: Add new "getzmqnotifications" methodWladimir J. van der Laan
161e8d40a4e4c0e701b6c8142b8dcacf2190545e RPC: Add new getzmqnotifications method. (Daniel Kraft) caac39b0ace38aa088d88c1a5a9a9dbb4d2e893f Make ZMQ notification interface instance global. (Daniel Kraft) Pull request description: This adds a new RPC method `getzmqnotifications`, which returns information about all active ZMQ notification endpoints. This is useful for software that layers on top of bitcoind, so it can verify that ZeroMQ is enabled and also figure out where it should listen. See #13526. Tree-SHA512: edce722925741c84ddbf7b3a879fc9db1907e5269d0d97138fe724035d93ee541c2118c24fa92f4197403f380d0e25c2fda5ca6c62d526792ea749cf527a99a0
2018-07-10segwit support for createmultisig RPCAnthony Towns
2018-07-09Add outputtype moduleAnthony Towns
Moves OutputType into its own module
2018-07-05Merge #12788: [build] Tune wildcards for LIBSECP256K1 targetWladimir J. van der Laan
98b181323 [build] Tune wildcards for LIBSECP256K1 target (Karl-Johan Alm) Pull request description: Automake would think the target was out of date every time because e.g. '.deps' was updated. Note: I am assuming that secp256k1 depends on `*.h`, `*.c`, ~~and `libsecp256k1-config.h`~~ (it's `.h` so already included), aside from pre-existing `include/*`. If there are other files that would require a rebuild of the `LIBSECP256K1` target, they should probably be added. It would be neat if you could exclude specific files, rather than split it up like this, but it doesn't seem possible (https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html#Wildcard-Function) Should probably note this: ```Bash $ V=1 make check VERBOSE=1 Making check in src make[1]: Entering directory '/home/user/workspace/bitcoin/src' make[2]: Entering directory '/home/user/workspace/bitcoin/src' make -C secp256k1 libsecp256k1.la make[3]: Entering directory '/home/user/workspace/bitcoin/src/secp256k1' make[3]: 'libsecp256k1.la' is up to date. make[3]: Leaving directory '/home/user/workspace/bitcoin/src/secp256k1' make check-TESTS check-local make[3]: Entering directory '/home/user/workspace/bitcoin/src' make[4]: Entering directory '/home/user/workspace/bitcoin/src' make -C secp256k1 libsecp256k1.la make[5]: Entering directory '/home/user/workspace/bitcoin/src/secp256k1' make[5]: 'libsecp256k1.la' is up to date. make[5]: Leaving directory '/home/user/workspace/bitcoin/src/secp256k1' PASS: test/test_bitcoin.exe ``` Tree-SHA512: 62b133c76e882788dae0c14208a9f5acdbd731c2e7a248f9e01f488b8ec13f9d637d7ad0d63e18d324bb4e088f1836a936649b0fb97bee679eaadedbeed5c981
2018-07-05RPC: Add new getzmqnotifications method.Daniel Kraft
This adds a new RPC method "getzmqnotifications", which returns information about all active ZMQ notification endpoints. This is useful for software that layers on top of bitcoind, so it can verify that ZeroMQ is enabled and also figure out where it should listen. See https://github.com/bitcoin/bitcoin/issues/13526.
2018-06-26Add SHA256 implementation using using Intel SHA intrinsicsPieter Wuille
2018-06-25Break circular dependency: init -> * -> init by extracting shutdown.hBen Woosley
Most includers just wanted to react to pending shutdown. This isolates access to `fRequestShutdown` and limits access to the shutdown api functions, including the new `AbortShutdown` for setting it to `false`. Note I originally called `AbortShutdown` `CancelShutdown` but that name was already taken by winuser.h https://travis-ci.org/bitcoin/bitcoin/jobs/386913329 This change also triggered a build error in bench. Fixing it required moving LIBBITCOIN_SERVER after LIBBITCOIN_WALLET in bench_bench_bitcoin_LDADD To make server definitions in src/net.cpp available to wallet methods in src/wallet/wallet.cpp. Specifically, solving: libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): In function `CWalletTx::RelayWalletTransaction(CConnman*)': wallet.cpp:(.text+0x3f0e): undefined reference to `CConnman::NodeFullyConnected(CNode const*)' collect2: error: ld returned 1 exit status https://travis-ci.org/bitcoin/bitcoin/jobs/392133581 Need for remaining init.h includes confirmed via a thorough search with a more specific regex: \bInterrupt\(\)|\bShutdown\(\)|\bInitLogging\(\)|\bInitParameterInteraction\(\)|\bAppInitBasicSetup\(\)|\bAppInitParameterInteraction\(\)|\bAppInitSanityChecks\(\)|\bAppInitLockDataDirectory\(\)|\bAppInitMain\(\)|\bSetupServerArgs\(\)|\bLicenseInfo\(\)|g_wallet_init_interface|init.h
2018-06-18Move rpc/util.cpp from libbitcoin-util to libbitcoin-serverChun Kuan Lee
2018-06-12[build] Tune wildcards for LIBSECP256K1 targetKarl-Johan Alm
Automake would think the target was out of date every time because e.g. '.deps' was updated.
2018-06-11Merge #13408: crypto: cleanup sha256 buildWladimir J. van der Laan
f68049dd879c216d1e98b6635eec488f8e936ed4 crypto: cleanup sha256 build (Cory Fields) Pull request description: Requested by @sipa in #13386. Rather than appending all possible cpu variants to all targets, create a convenience variable that encompasses all. Tree-SHA512: 8e9ab2185515672b79bb7925afa4f3fbfe921bfcbe61456833d15457de4feba95290de17514344ce42ee81cc38b252476cd0c29432ac48c737c2225ed515a4bd
2018-06-06crypto: cleanup sha256 buildCory Fields
Rather than appending all possible cpu variants to all targets, create a convenience variable that encompasses all.
2018-06-04MOVEONLY: Move BaseIndex to its own file.Jim Posen
2018-06-04Merge #13191: Specialized double-SHA256 with 64 byte inputs with SSE4.1 and AVX2Wladimir J. van der Laan
4defdfab94504018f822dc34a313ad26cedc8255 [MOVEONLY] Move unused Merkle branch code to tests (Pieter Wuille) 4437d6e1f3107a20a8c7b66be8b4b972a82e3b28 8-way AVX2 implementation for double SHA256 on 64-byte inputs (Pieter Wuille) 230294bf5fdeba7213471cd0b795fb7aa36e5717 4-way SSE4.1 implementation for double SHA256 on 64-byte inputs (Pieter Wuille) 1f0e7ca09c9d7c5787c218156fa5096a1bdf2ea8 Use SHA256D64 in Merkle root computation (Pieter Wuille) d0c96328833127284574bfef26f96aa2e4afc91a Specialized double sha256 for 64 byte inputs (Pieter Wuille) 57f34630fb6c3e218bd19535ac607008cb894173 Refactor SHA256 code (Pieter Wuille) 0df017889b4f61860092e1d54e271092cce55f62 Benchmark Merkle root computation (Pieter Wuille) Pull request description: This introduces a framework for specialized double-SHA256 with 64 byte inputs. 4 different implementations are provided: * Generic C++ (reusing the normal SHA256 code) * Specialized C++ for 64-byte inputs, but no special instructions * 4-way using SSE4.1 intrinsics * 8-way using AVX2 intrinsics On my own system (AVX2 capable), I get these benchmarks for computing the Merkle root of 9001 leaves (supported lengths / special instructions / parallellism): * 7.2 ms with varsize/naive/1way (master, non-SSE4 hardware) * 5.8 ms with size64/naive/1way (this PR, non-SSE4 capable systems) * 4.8 ms with varsize/SSE4/1way (master, SSE4 hardware) * 2.9 ms with size64/SSE4/4way (this PR, SSE4 hardware) * 1.1 ms with size64/AVX2/8way (this PR, AVX2 hardware) Tree-SHA512: efa32d48b32820d9ce788ead4eb583949265be8c2e5f538c94bc914e92d131a57f8c1ee26c6f998e81fb0e30675d4e2eddc3360bcf632676249036018cff343e
2018-06-02GCC-7 and glibc-2.27 compat codeChun Kuan Lee
2018-05-298-way AVX2 implementation for double SHA256 on 64-byte inputsPieter Wuille
2018-05-294-way SSE4.1 implementation for double SHA256 on 64-byte inputsPieter Wuille
2018-05-22build: split warnings out of CXXFLAGSCory Fields
CXXFLAGS should not be modified anyway. Also, this will enable us to selectively disable warnings.
2018-05-14Merge #13005: Make --enable-debug to pick better optionsWladimir J. van der Laan
9e49db2 Make --enable-debug to pick better options (Evan Klitzke) Pull request description: Cherry-picked (and rebased) 94189645e67f364c4445d62e2b00c282d885cbbf from the "up for grabs" PR: "[build] Make --enable-debug pick better options" (#12695). See previous review in #12695. Tree-SHA512: a93cdadcf13e2ef8519acb1ce4f41ce95057a388347bb0a86a5c164dc7d0b0d14d4bb2a466082d5a100b8d50de65c605c40abaed555e8ea77c99e28800a34439