A logical error in the configure file (probable) #13735

issue sergeyklay opened this issue on July 21, 2018
  1. sergeyklay commented at 10:48 PM on July 21, 2018: none

    Hello,

    It seems to me that here is a logical error: https://github.com/bitcoin/bitcoin/blob/07ce278455757fb46dab95fb9b97a3f6b1b84faf/configure.ac#L47-L53

    All code below "hopes" that CXXFLAGS_overridden is no when CXXFLAGS is empty. Right? In my opinion the variable name a bit confusing. I read entire configure.ac file several times and still not sure if I understood it correctly. What do you think about "can_override_cxxflags" name?

  2. ken2812221 commented at 11:27 PM on July 21, 2018: contributor

    This variable indicates that CXXFLAGS has been overridden, like ./configure CXXFLAGS=-O2, then CXXFLAGS_overridden=yes ./configure, then CXXFLAGS_overridden=no

  3. fanquake added the label Build system on Jul 22, 2018
  4. sergeyklay commented at 7:45 AM on July 22, 2018: none

    @ken2812221 Yes. I thought so too. But take a look for example at this condition: https://github.com/bitcoin/bitcoin/blob/eeae4711f338ef2621f2f0295b974dee846cc36f/configure.ac#L245-L249

    Do we need clean the CXXFLAGS here? Isn't the CXXFLAGS empty here (due to CXXFLAGS_overridden is no)?

  5. ken2812221 commented at 7:59 AM on July 22, 2018: contributor

    Default CXXFLAGS is not empty, It is -g -O2. We don't use this flag when we are debugging, so we clear it.

  6. sergeyklay commented at 8:30 AM on July 22, 2018: none

    Previously we're convinced that CXXFLAGS is empty. As I can see there is no code, before 245 line that sets CXXFLAGS. For CXXFLAGS="-g -O2" the CXXFLAGS_overridden would be yes. Why do we need clear CXXFLAGS for CXXFLAGS_overridden=no? It seems I'm confused again :)

  7. sergeyklay commented at 8:50 AM on July 22, 2018: none

    Aha! Got it:

    + AC_MSG_WARN("CXXFLAGS=$CXXFLAGS")
      AC_PROG_CXX
    + AC_MSG_ERROR("CXXFLAGS=$CXXFLAGS")
    
    + configure: WARNING: "CXXFLAGS="
      checking for g++... g++
      checking whether the C++ compiler works... yes
      checking for C++ compiler default output file name... a.out
      checking for suffix of executables... 
      checking whether we are cross compiling... no
      checking for suffix of object files... o
      checking whether we are using the GNU C++ compiler... yes
      checking whether g++ accepts -g... yes
      checking for style of include used by make... GNU
      checking dependency style of g++... gcc3
    + configure: error: "CXXFLAGS=-g -O2"
    

    Thank you for your patience and clarification :)

  8. sergeyklay closed this on Jul 22, 2018

  9. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-01 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me