depends: Fix libX11 build on gcc 8 #12990

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1804-dependsGCC8Fix changing 2 files +68 −0
  1. MarcoFalke commented at 5:54 PM on April 15, 2018: member
  2. depends: Fix libX11 build on gcc 8 fa461f49c9
  3. MarcoFalke added the label Build system on Apr 15, 2018
  4. MarcoFalke commented at 6:00 PM on April 15, 2018: member

    Checking out the commit below mine gives this error:

    $ git checkout fa461f49c9147037fa63a141a5390f614ad2438e~ && gcc --version && make -j 2 libX11
    gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20)
    
    Building libX11...
    make[4]: Entering directory 'bitcoin/depends/work/build/x86_64-pc-linux-gnu/libX11/1.6.2-bcf0487a3e3/modules/im/ximcp'
      CC       imLcIm.lo
    In function '_XimWriteCachedDefaultTree',
        inlined from '_XimCreateDefaultTree' at imLcIm.c:635:2,
        inlined from '_XimLocalOpenIM' at imLcIm.c:722:5:
    imLcIm.c:488:5: error: 'strcpy' forming offset 2 is out of the bounds [0, 1] [-Werror=array-bounds]
         strcpy (m->fname+strlen(name)+1, encoding);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: some warnings being treated as errors
    
  5. fanquake commented at 8:39 AM on April 16, 2018: member

    @MarcoFalke Is there anything else needed to recreated this? I've tested on Ubuntu 18.04 with GCC 8.0.1 20180414 (experimental) [trunk revision 259383] and don't see any errors when building libX11 inside depends.

  6. MarcoFalke commented at 12:20 PM on April 16, 2018: member

    Indeed... My gcc claims "20180324" and yours "20180414", not sure if that is the cause.

  7. MarcoFalke commented at 3:51 PM on April 16, 2018: member

    For reference: I reproduced this by running a fedora:28 docker container.

  8. laanwj commented at 6:31 AM on April 17, 2018: member

    Concept ACK, if there is no released version of libX11 with this patch yet.

  9. MarcoFalke commented at 5:16 PM on April 17, 2018: member

    Further looking at this by using the gcc8 from the opensuse:tumbleweed docker gives a nice basis for bisecting gcc:

    gcc8 [trunk revision 258445] --> fails
    gcc8 [trunk revision 259308] --> succeeds
    
  10. ryanofsky commented at 10:35 PM on April 17, 2018: member

    utACK fa461f49c9147037fa63a141a5390f614ad2438e. I didn't build but I did check out the upstream repository and confirm the patch is identical to the commit on the master branch.

  11. MarcoFalke commented at 11:43 PM on April 17, 2018: member

    I slightly tend toward closing this, since it might be a bug on gcc8, which is not yet released and only meant for beta testing.

  12. fanquake commented at 6:45 AM on April 18, 2018: member

    I think I agree. Patching a dependency because it won't compile at some point between two experimental versions of a compiler doesn't seem entirely necessary.

  13. laanwj commented at 7:04 AM on April 18, 2018: member

    I think I agree. Patching a dependency because it won't compile at some point between two experimental versions of a compiler doesn't seem entirely necessary.

    Agree - I concept ACKed because this patch is upstream so we'd get it with a bump of libX11 too. If it is a temporary work-around for an intermediate broken experimental compiler I'd also tend toward closing this. We can't accommodate for every broken tool out there.

  14. laanwj closed this on Apr 18, 2018

  15. MarcoFalke deleted the branch on Apr 18, 2018
  16. 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: 2026-04-17 06:15 UTC

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