Skip to content
  • Hennadii Stepanov's avatar
    c66609c7
    net: Add libnatpmp support · c66609c7
    Hennadii Stepanov authored and Calin Culianu's avatar Calin Culianu committed
    
    
    Co-authored-by: default avatarCalin Culianu <calin.culianu@gmail.com>
    
    Taken from ABC: https://reviews.bitcoinabc.org/D12075
    Depends on !1836
    
    Summary
    ---
    
    bitcoin/bitcoin@a8d9f27 (main commit)
    > net: Add libnatpmp support
    
    bitcoin/bitcoin@ae749d1
    > doc: Add libnatpmp stuff
    
    Note: I excluded the changes in tor.md, as the documentation added
    in that file is not yet applicable until core#18077 is fully backported.
    I suggest we should backport this tohether with the release notes.
    
    ---
    
    [[bitcoin/bitcoin#21320 | core#21320]]:
    > build: fix libnatpmp macos cross compile
    >
    > Currently, our cross-compile of libnatpmp for macOS doesn't work at all.
    > The wrong archiver is used, which produces an archive the linker doesn't like.
    >
    > Fix this by using the right `ar` (we do the same for upnp).
    >
    > While we're at it, we fixe the build so that we are using our c/ppflags.
    > This  means building with `-O2` rather than `-Os`.
    
    ----
    
    [[bitcoin/bitcoin#21209 | core#21209]]:
    > build: compile libnatpmp with -DNATPMP_STATICLIB on Windows
    >
    > This fixes linking issues and mirrors what we do with miniupnpc.
    
    > build: use newer source for libnatpmp
    >
    > The source we are currently using is from 2015. The upstream repo has
    > received a small number of bug fixes and improvements since then.
    > Including one that fixes an issue for Windows users:
    > miniupnp/libnatpmp#13.
    >
    > The source we are currently using is the most recent "official" release,
    > however I don't think it's worth waiting for a new one. The maintainer
    > was prompted to do so in Oct 2020, then again in Jan of this year, and
    > no release has eventuated. Given libnatpmp is a new inclusion into our
    > repository, I think we should be using this newer source.
    >
    > This also cleans up a few warnings we currently see in depends builds
    
    ----
    
    [[bitcoin/bitcoin#25917 | core#25917]]:
    > depends: libnatpmp 07004b97cf691774efebe70404cf22201e4d330d
    >
    > This pulls in two changes I've upstreamed:
    > Support for pkg-config: miniupnp/libnatpmp#19
    > Suppressing a deprecation warning: miniupnp/libnatpmp#28
    
    ----
    
    This is a backport of [[bitcoin/bitcoin#18077 | core#18077]] [7 & 12/13], [[bitcoin/bitcoin#21320 | core#21320]], [[bitcoin/bitcoin#21209 | core#21209]] and [[bitcoin/bitcoin#25917 | core#25917]]
    
    Test Plan
    ---
    
    - `cmake .. -GNinja ninja all check-all`
    - Do a gitian and/or depends build
    c66609c7
    net: Add libnatpmp support
    Hennadii Stepanov authored and Calin Culianu's avatar Calin Culianu committed
    
    
    Co-authored-by: default avatarCalin Culianu <calin.culianu@gmail.com>
    
    Taken from ABC: https://reviews.bitcoinabc.org/D12075
    Depends on !1836
    
    Summary
    ---
    
    bitcoin/bitcoin@a8d9f27 (main commit)
    > net: Add libnatpmp support
    
    bitcoin/bitcoin@ae749d1
    > doc: Add libnatpmp stuff
    
    Note: I excluded the changes in tor.md, as the documentation added
    in that file is not yet applicable until core#18077 is fully backported.
    I suggest we should backport this tohether with the release notes.
    
    ---
    
    [[bitcoin/bitcoin#21320 | core#21320]]:
    > build: fix libnatpmp macos cross compile
    >
    > Currently, our cross-compile of libnatpmp for macOS doesn't work at all.
    > The wrong archiver is used, which produces an archive the linker doesn't like.
    >
    > Fix this by using the right `ar` (we do the same for upnp).
    >
    > While we're at it, we fixe the build so that we are using our c/ppflags.
    > This  means building with `-O2` rather than `-Os`.
    
    ----
    
    [[bitcoin/bitcoin#21209 | core#21209]]:
    > build: compile libnatpmp with -DNATPMP_STATICLIB on Windows
    >
    > This fixes linking issues and mirrors what we do with miniupnpc.
    
    > build: use newer source for libnatpmp
    >
    > The source we are currently using is from 2015. The upstream repo has
    > received a small number of bug fixes and improvements since then.
    > Including one that fixes an issue for Windows users:
    > miniupnp/libnatpmp#13.
    >
    > The source we are currently using is the most recent "official" release,
    > however I don't think it's worth waiting for a new one. The maintainer
    > was prompted to do so in Oct 2020, then again in Jan of this year, and
    > no release has eventuated. Given libnatpmp is a new inclusion into our
    > repository, I think we should be using this newer source.
    >
    > This also cleans up a few warnings we currently see in depends builds
    
    ----
    
    [[bitcoin/bitcoin#25917 | core#25917]]:
    > depends: libnatpmp 07004b97cf691774efebe70404cf22201e4d330d
    >
    > This pulls in two changes I've upstreamed:
    > Support for pkg-config: miniupnp/libnatpmp#19
    > Suppressing a deprecation warning: miniupnp/libnatpmp#28
    
    ----
    
    This is a backport of [[bitcoin/bitcoin#18077 | core#18077]] [7 & 12/13], [[bitcoin/bitcoin#21320 | core#21320]], [[bitcoin/bitcoin#21209 | core#21209]] and [[bitcoin/bitcoin#25917 | core#25917]]
    
    Test Plan
    ---
    
    - `cmake .. -GNinja ninja all check-all`
    - Do a gitian and/or depends build
Loading