GCC-7 and glibc-2.27 back compat code #13177

pull ken2812221 wants to merge 3 commits into bitcoin:master from ken2812221:compat changing 5 files +51 −2
  1. ken2812221 commented at 4:08 PM on May 6, 2018: contributor

    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.

  2. ken2812221 renamed this:
    GCC-7 and glibc-2.27 compat code
    WIP[]GCC-7 and glibc-2.27 compat code
    on May 6, 2018
  3. ken2812221 renamed this:
    WIP[]GCC-7 and glibc-2.27 compat code
    [WIP]GCC-7 and glibc-2.27 compat code
    on May 6, 2018
  4. ken2812221 force-pushed on May 6, 2018
  5. ken2812221 force-pushed on May 6, 2018
  6. ken2812221 commented at 11:50 PM on May 6, 2018: contributor

    Still have some probleams. Why doesn't it be allowed to export these symbols.

    bitcoin-cli: export of symbol stdout not allowed
    bitcoin-cli: export of symbol stderr not allowed
    bitcoin-tx: export of symbol stdout not allowed
    bitcoin-tx: export of symbol stdin not allowed
    bitcoin-tx: export of symbol stderr not allowed
    qt/bitcoin-qt: export of symbol stdout not allowed
    qt/bitcoin-qt: export of symbol in6addr_any not allowed
    qt/bitcoin-qt: export of symbol stderr not allowed
    
  7. ken2812221 renamed this:
    [WIP]GCC-7 and glibc-2.27 compat code
    [WIP]GCC-7 and glibc-2.27 back compat code
    on May 7, 2018
  8. ken2812221 force-pushed on May 7, 2018
  9. meshcollider added the label Build system on May 7, 2018
  10. ken2812221 cross-referenced this on May 7, 2018 from issue Change gitian-descriptors to use bionic instead by ken2812221
  11. laanwj commented at 9:29 AM on May 7, 2018: member

    Still have some probleams. Why doesn't it be allowed to export these symbols.

    Because it's an executable - it's unnecessary to export any symbols, so if that happens that usually points towards a problem during linking that can cause weird issues with shared libraries later on. (however, maybe there's a good reason for these then they could be added to the exceptions)

  12. ken2812221 commented at 10:31 AM on May 7, 2018: contributor

    I actually don't know this too much, but I think thery all need to be exported.

    0000000002537398 g    D  .bss   0000000000000000  Base        _end
    000000000251ca40 g    DO .bss   0000000000000008  GLIBC_2.2.5 stdout
    000000000251ca30 g    D  .data  0000000000000000  Base        _edata
    00000000024a7d00  w   DO .data.rel.ro   0000000000000010  GLIBC_2.2.5 in6addr_any
    000000000251ca30 g    D  .bss   0000000000000000  Base        __bss_start
    000000000251ca60 g    DO .bss   0000000000000008  GLIBC_2.2.5 stderr
    000000000014a690 g    DF .init  0000000000000000  Base        _init
    00000000016596b0 g    DF .fini  0000000000000000  Base        _fini
    
    
  13. laanwj commented at 10:42 AM on May 7, 2018: member

    _end _fini and such are harmless to export. I don't think they're strictly necessary for execution, but they're just part of the linking process, and delimit the various sections. Not sure about the rest, though. stdout/stderr/in6addr_any sound like they should be exported from the C library, not our executable. I'll look into it as well when I get around to playing around with Ubuntu 18.04 (I guess that's where you find this combination?).

    FYI @theuni.

  14. theuni commented at 1:36 PM on May 8, 2018: member

    @laanwj Thanks.

    Those are interesting. in6addr_any is weak-linked for some reason. If necessary we could just define a new constant. No clue about stdout/stderr, I'll have to play with that as well. @ken2812221 Is it not sufficient to define the replacements with their own symbol names? Why use __wrap__?

  15. theuni commented at 2:35 PM on May 8, 2018: member

    This should take care of in6addr_any:

    --- a/src/net.cpp
    +++ b/src/net.cpp
    @@ -2254,7 +2254,7 @@ bool CConnman::InitBinds(const std::vector<CService>& binds, const std::vector<C
         if (binds.empty() && whiteBinds.empty()) {
             struct in_addr inaddr_any;
             inaddr_any.s_addr = INADDR_ANY;
    -        fBound |= Bind(CService(in6addr_any, GetListenPort()), BF_NONE);
    +        fBound |= Bind(CService((in6_addr)IN6ADDR_ANY_INIT, GetListenPort()), BF_NONE);
             fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound ? BF_REPORT_ERROR : BF_NONE);
         }
         return fBound;
    
  16. ken2812221 force-pushed on May 8, 2018
  17. ken2812221 commented at 5:12 PM on May 8, 2018: contributor

    This should take care of in6addr_any:

    Thanks. That does work.

    Is it not sufficient to define the replacements with their own symbol names? Why use wrap?

    I thought it would conflict with the library, so I didn't try that before. But it works now. No. it doesn't, this would cause a segfault on Travis.

  18. ken2812221 force-pushed on May 8, 2018
  19. ken2812221 force-pushed on May 10, 2018
  20. ken2812221 force-pushed on May 10, 2018
  21. ken2812221 force-pushed on May 10, 2018
  22. ken2812221 force-pushed on May 14, 2018
  23. MarcoFalke added this to the milestone 0.17.0 on May 31, 2018
  24. ken2812221 force-pushed on Jun 2, 2018
  25. ken2812221 force-pushed on Jun 2, 2018
  26. ken2812221 commented at 6:01 PM on June 2, 2018: contributor

    I couldn't find any way not to export stdin, stdout, stderr. Also, it is harmless to export them since glibc is versioned, so I just ignore them in symbol-check.py.

  27. ken2812221 renamed this:
    [WIP]GCC-7 and glibc-2.27 back compat code
    GCC-7 and glibc-2.27 back compat code
    on Jun 2, 2018
  28. GCC-7 and glibc-2.27 compat code 908c1d7745
  29. Use IN6ADDR_ANY_INIT instead of in6addr_any fc6a9f2ab1
  30. ken2812221 force-pushed on Jun 2, 2018
  31. Add stdin, stdout, stderr to ignored export list 253f592909
  32. ken2812221 force-pushed on Jun 2, 2018
  33. TheCharlatan cross-referenced this on Jul 7, 2018 from issue Add depends 32-bit arm support for bitcoin-qt by TheCharlatan
  34. DrahtBot cross-referenced this on Jul 9, 2018 from issue Audit string.h inclusion by Empact
  35. MarcoFalke assigned theuni on Jul 11, 2018
  36. Sjors commented at 10:59 AM on July 12, 2018: member

    This improves #13604 such that it produces ARM binaries that work on Xenial when cross-compiling on Bionic.

  37. laanwj commented at 2:26 PM on July 12, 2018: member

    utACK 253f5929097548fb10ef995002dedbb8dadb6a0d

  38. laanwj merged this on Jul 12, 2018
  39. laanwj closed this on Jul 12, 2018

  40. laanwj referenced this in commit dcb154e5aa on Jul 12, 2018
  41. ken2812221 deleted the branch on Jul 12, 2018
  42. theuni commented at 5:50 PM on July 12, 2018: member

    Sorry for the late review...

    I really dislike the use of wrap here. I suspect it will get in the way of things like sanitizers and lto, and it really shouldn't be necessary since the other compat stubs manage to work without it.

    I'll follow up with another PR if I can come up with a working solution without wrapping.

  43. ken2812221 commented at 5:55 PM on July 12, 2018: contributor

    It caused a segfault on travis for qt 4. But qt 4 has gone now. I am not sure if we should get rid of wrap.

  44. Bushstar cross-referenced this on Jul 13, 2018 from issue commits from bitcoin/master by Bushstar
  45. fanquake referenced this in commit 19d8ca5cc1 on Jul 16, 2018
  46. underdarkskies referenced this in commit a17756f4bb on Jul 26, 2018
  47. underdarkskies referenced this in commit 777e12c4cd on Jul 26, 2018
  48. cfox referenced this in commit 74079801de on Jul 26, 2018
  49. codablock referenced this in commit f411823c9a on Aug 13, 2018
  50. codablock referenced this in commit 5c5bea3d72 on Aug 13, 2018
  51. UdjinM6 referenced this in commit c09f57bd78 on Aug 13, 2018
  52. Fuzzbawls cross-referenced this on Aug 27, 2018 from issue [Build] GCC-7 and glibc-2.27 back compat by Fuzzbawls
  53. sickpig cross-referenced this on Jan 28, 2019 from issue Propaedeutic changes needed to move the gitian build to Ubuntu 18.04 by sickpig
  54. alejandromgk referenced this in commit eae1493884 on Feb 20, 2019
  55. alejandromgk referenced this in commit 7aea08a255 on Apr 3, 2019
  56. CryptoCentric referenced this in commit b1e5fac728 on Apr 25, 2019
  57. CryptAxe referenced this in commit 240b580985 on Jun 10, 2019
  58. bitcoin 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-20 06:55 UTC