I was surprised that this didn't work:
./configure --enable-debug CXXFLAGS="-DDEBUG_LOCKORDER"
@theuni : I don't THINK this will have unintended consequences, is there a reason --enable-debug overwrote CFLAGS/CXXFLAGS?
Preserve user-passed CXXFLAGS with --enable-debug #6434
pull gavinandresen wants to merge 1 commits into bitcoin:master from gavinandresen:preserve_CXXFLAGS changing 1 files +3 −2-
gavinandresen commented at 1:22 PM on July 14, 2015: contributor
-
theuni commented at 5:07 PM on July 14, 2015: member
@gavinandresen looks good to me, agreed that the behavior is unexpected. A few thoughts, though:
- I believe it's that way because "-O2 -g" are already added by default. After this change, a
./configure --enable-debugwill end up with duped flags I think. Not a problem really, the last flag wins. - You really want to be passing that in as
CPPFLAGS=-DDEBUG_LOCKORDERanyway. Those are pre-processor flags, which exist separately so they don't get mixed up in arguments about optim flags and etc. - IMO There should be no need to pass
-DDEBUG_LOCKORDERvia a flag, that kinda defeats the purpose of having configure options to begin with. How about just adding-DDEBUG_LOCKORDERto CPPFLAGS in the --enable-debug case?
- I believe it's that way because "-O2 -g" are already added by default. After this change, a
-
gavinandresen commented at 9:45 PM on July 14, 2015: contributor
RE: CPPFLAGS: hmm, then --enable-debug should add -DDEBUG to CPPFLAGS instead of CFLAGS/CXXFLAGS...
RE: adding -DDEBUG_LOCKORDER to --enable-debug: sounds good to me.
-
laanwj commented at 6:54 AM on July 15, 2015: member
How about just adding -DDEBUG_LOCKORDER to CPPFLAGS in the --enable-debug case?
Sounds good to me.
Although maybe then it should be documented then that the flag doesn't just add debug information, but also enables specific debug functionality.
Or maybe that's already clear:
--enable-debug use debug compiler flags and macros (default is no) - laanwj added the label Build system on Jul 15, 2015
-
83b48c8971
configure --enable-debug changes
Three changes to how configure --enable-debug behaves: 1. Preserve user-passed CXXFLAGS/CFLAGS 2. Compile with -DDEBUG_LOCKORDER 3. Add -DDEBUG -DDEBUG_LOCKORDER to CPPFLAGS (since they are preprocessor options)
- gavinandresen force-pushed on Jul 15, 2015
-
gavinandresen commented at 6:10 PM on July 15, 2015: contributor
Tweaked based on comments:
Three changes to how configure --enable-debug behaves:
- Preserve user-passed CXXFLAGS/CFLAGS
- Compile with -DDEBUG_LOCKORDER
- Add -DDEBUG -DDEBUG_LOCKORDER to CPPFLAGS (since they are preprocessor options)
-
theuni commented at 6:40 PM on July 15, 2015: member
Thanks, looks good.
- laanwj merged this on Jul 17, 2015
- laanwj closed this on Jul 17, 2015
- laanwj referenced this in commit 059b3525c4 on Jul 17, 2015
- luke-jr referenced this in commit 899c189df9 on Jan 9, 2016
- luke-jr referenced this in commit 4be978311d on Jan 10, 2016
- zkbot referenced this in commit df07f9ad23 on Feb 15, 2017
- zkbot referenced this in commit ec069ce96c on Mar 3, 2017
- zkbot referenced this in commit 702eefc71a on Mar 3, 2017
- zkbot referenced this in commit 99c4c6de0c on Mar 3, 2017
- DrahtBot locked this on Sep 8, 2021
Contributors
Labels