build: compile univalue as c++11 #12467

pull theuni wants to merge 3 commits into bitcoin:master from theuni:fix-subconfigure-args changing 3 files +361 −7
  1. theuni commented at 4:09 am on February 17, 2018: member

    Reported by irc user (and maybe github user?) @esotericnonsense.

    Building bitcoin as c++11 and univalue as c++03/c++14 (depending on compiler version) is pretty scary. It’s surprising that this hasn’t caused any issues yet.

    I’m afraid the fix is a big pile of autotools nonsense, but the changes are pretty straightforward:

    • Add a new macro to simplify passing args to subconfigures (univalue and secp256k1)
    • Pass our modified CXX down to univalue
    • If using depends, don’t reset the values passed to subconfigures to their defaults

    The good news is that this makes it much easier to tweak subconfigure args in the future.

  2. fanquake added the label Build system on Feb 17, 2018
  3. theuni commented at 5:02 am on February 17, 2018: member
    Grr, there’s a bug in the macro’s handling of subdirs. I’ll have to fix this up next week.
  4. laanwj commented at 9:55 am on February 17, 2018: member

    Concept ACK.

    Building bitcoin as c++11 and univalue as c++03/c++14 (depending on compiler version) is pretty scary

    There are certainly some rough edge cases, but in theory (no compiler bugs) this should be ok, right? Is there any official guideline about this?

    Doesn’t building against system libraries have the same risks? You can never be sure what c++ standard they were compiled with, certainly not with compilers changing the default all the time.

  5. theuni force-pushed on Mar 5, 2018
  6. theuni commented at 8:25 pm on March 5, 2018: member

    @laanwj I think we’re probably ok here, but I have no idea what happens when differing abi’s get linked in together.

    This could certainly be a problem if univalue was built as a shared lib though, as we could miss thrown exceptions due to differing type signatures. IIRC we actually had that issue at some point catching boost exceptions.

  7. fanquake commented at 2:40 pm on March 14, 2018: member
    This needs a rebase.
  8. theuni force-pushed on Mar 15, 2018
  9. depends: use ac_cv_* rather than the vars themselves for config.site
    Also don't set the value if it's already set.
    
    This allows the value to be updated then passed to a subconfigure, which
    would otherwise be reinitialized by the config.site
    f52f539c98
  10. build: replace AC_CONFIG_SUBDIRS with AX_SUBDIRS_CONFIGURE
    AX_SUBDIRS_CONFIGURE allows us to cleanly add/remove/filter what gets passed to
    subconfigures.
    
    This should be a no op.
    09f0630421
  11. build: pass c++ std version to univalue
    Once we're certain that our CXX is compiling as c++11, pass it to univalue for
    use there as well.
    
    This avoids having a binary trying to conform to 2 abi's simultaneously.
    8816f3dcae
  12. theuni force-pushed on Mar 15, 2018
  13. MarcoFalke commented at 1:33 pm on March 18, 2018: member

    Travis fails with

    0/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: univalue/.libs/libunivalue.a(libunivalue_la-univalue.o): relocation R_ARM_THM_MOVW_ABS_NC against `_ZNSs4_Rep20_S_empty_rep_storageE' can not be used when making a shared object; recompile with -fPIC
    1univalue/.libs/libunivalue.a: error adding symbols: Bad value
    2collect2: error: ld returned 1 exit status
    
  14. laanwj commented at 4:24 pm on April 10, 2018: member
    @theuni ping
  15. fanquake commented at 7:40 am on July 18, 2018: member
    @theuni Do you want to get this into 0.17.0?
  16. theuni commented at 8:45 pm on July 18, 2018: member
    This hit an annoying snag and didn’t end up working. Closing.
  17. theuni closed this on Jul 18, 2018

  18. theuni referenced this in commit 54971a0e65 on Jul 15, 2021
  19. theuni referenced this in commit 99ff70651f on Jul 15, 2021
  20. theuni referenced this in commit e3fa615e4f on Jul 15, 2021
  21. fanquake referenced this in commit 140a4737a9 on Aug 6, 2021
  22. MarcoFalke 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: 2024-07-08 22:13 UTC

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