Skip to content

cmake: Avoid overlinking - #34

Merged
hebasto merged 5 commits into
cmake-stagingfrom
231019-cmake-M
Nov 9, 2023
Merged

hebasto merged 5 commits into
cmake-stagingfrom
231019-cmake-M

Conversation

@hebasto

@hebasto hebasto commented Oct 19, 2023 •

Copy link
Copy Markdown
Owner

Additionally, this PR fixes "ld: warning: ignoring duplicate libraries" on macOS:

[....] Linking CXX executable test_bitcoin
ld: warning: ignoring duplicate libraries: '../../libleveldb.a', '../libbitcoin_common.a', '../univalue/libunivalue.a', '../util/libbitcoin_util.a'
[....] Linking CXX executable bench_bitcoin
ld: warning: ignoring duplicate libraries: '../../libleveldb.a', '../univalue/libunivalue.a', '../wallet/libbitcoin_wallet.a'

The third commit makes the bitcoin_wallet library a direct dependency of bitcoind rather bitcoin_node, that is outlined in https://github.com/bitcoin/bitcoin/blob/master/doc/design/libraries.md.

@fanquake

Copy link
Copy Markdown

If these exist in master, why do they need to be fixed here (at least, at this point)? Doesn't that just make the difference in behaviour between master, and the cmake branches larger, and potentially harder to review?

I would expect changes to land in master first, and then incorporate them here?

@hebasto

hebasto commented Oct 19, 2023 •

Copy link
Copy Markdown
Owner Author

If these exist in master...

It does. UPD. See #34 (comment)

... why do they need to be fixed here (at least, at this point)?

It can be done at any point. It can be postponed, of course.

Doesn't that just make the difference in behaviour between master, and the cmake branches larger, and potentially harder to review?

The duplicated libraries, which are passed to a linker, do not affect the resulted binaries, don't they?

I would expect changes to land in master first, and then incorporate them here?

It could be not so easy as in here.

@hebasto

hebasto commented Oct 26, 2023

Copy link
Copy Markdown
Owner Author

Rebased.

@theuni

theuni commented Oct 26, 2023

Copy link
Copy Markdown

If I understand correctly, the duplicated libs don't happen in master because we don't use transitive linking for deps. So in master, libbitcoin_zmq (for example) has no dependencies, where in CMake it does.

From what I can tell, this is simply cleaning up where those dependencies were over-specified for CMake?

@hebasto

hebasto commented Oct 26, 2023

Copy link
Copy Markdown
Owner Author

If I understand correctly, the duplicated libs don't happen in master...

It happens in master.

(at least on macOS with the recent Xcode)

@hebasto

hebasto commented Oct 26, 2023 •

Copy link
Copy Markdown
Owner Author

From what I can tell, this is simply cleaning up where those dependencies were over-specified for CMake?

That's correct. UPD. See #34 (comment)

@theuni

theuni commented Oct 26, 2023

Copy link
Copy Markdown

If I understand correctly, the duplicated libs don't happen in master...

It happens in master.

(at least on macOS with the recent Xcode)

Could you please give an an example of exactly what is duplicated in master? I agree with @fanquake that if there's some broken behavior we don't want to carry forward, we should fix it upstream first.

So it seems, then, that this is a mix of upsteram fixes and CMake fixups? Please help us to understand what's happening here :)

@hebasto

hebasto commented Oct 27, 2023 •

Copy link
Copy Markdown
Owner Author

I have to admit that my previous comments were not as precise as they should be. I'm sorry about that.

I double checked the master branch on macOS Sonoma. There indeed are ld: warning: ignoring duplicate libraries warnings. But they differs from ones reported in the PR description. And they have different causes.

For example, the following code in the master branch:

bitcoin/configure.ac

Lines 1430 to 1434 in 9477ad9

AC_CHECK_HEADERS(
[miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])],
[have_miniupnpc=no]
)

expands the AC_CHECK_LIB macro three times:

checking for miniupnpc/miniupnpc.h... yes
checking for upnpDiscover in -lminiupnpc... yes
checking for miniupnpc/upnpcommands.h... yes
checking for upnpDiscover in -lminiupnpc... (cached) yes
checking for miniupnpc/upnperrors.h... yes
checking for upnpDiscover in -lminiupnpc... (cached) yes

which ends with:

$ make print-MINIUPNPC_LIBS
MINIUPNPC_LIBS=-lminiupnpc -lminiupnpc -lminiupnpc

Another duplicated linked library is -levent that is caused by:

$ make print-EVENT_PTHREADS_LIBS
EVENT_PTHREADS_LIBS=-levent_pthreads -levent
$ make print-EVENT_LIBS
EVENT_LIBS=-levent

From what I can tell, this is simply cleaning up where those dependencies were over-specified for CMake?

This PR is CMake-specific and fixes my own mistakes such as over-specified libraries to link and link order.

@fanquake

Copy link
Copy Markdown

Opened to bitcoin#28755 to remove some of the unrelated warnings.

@hebasto

hebasto commented Oct 31, 2023

Copy link
Copy Markdown
Owner Author

Rebased.

fanquake added a commit to fanquake/bitcoin that referenced this pull request Oct 31, 2023
Having the link check in the header check loop means we get `-lminiupnpc
-lminiupnpc -lminiupnpc` on the link line. This is unnecessary, and
results in warnings, i.e:
```bash
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
```

These warnings have been occurring since the new linker released with
Xcode 15, and also came up in hebasto#34.
@hebasto

hebasto commented Oct 31, 2023

Copy link
Copy Markdown
Owner Author

Rebased.

fanquake added a commit to bitcoin-core/gui that referenced this pull request Nov 1, 2023
…nking

b74e449 build: remove potential for duplciate natpmp linking (fanquake)
4e95096 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto/bitcoin#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449
  hebasto:
    ACK b74e449, it fixes one issue mentioned in hebasto/bitcoin#34 (comment).
  TheCharlatan:
    ACK b74e449
  theuni:
    ACK b74e449

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36

@theuni theuni left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, makes more sense after dropping the unrelated upstream stuff.

Comment thread src/bench/CMakeLists.txt Resolved
Comment thread src/zmq/CMakeLists.txt
target_link_libraries(bitcoin_zmq
PRIVATE
core
leveldb

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally unrelated to CMake/this PR, but univalue is an unfortunate dependency for zmq. Seems to me it'd make sense to move zmq/rpc.cpp to rpc/zmq.cpp :)

@hebasto

hebasto commented Nov 7, 2023

Copy link
Copy Markdown
Owner Author

Rebased.

@theuni theuni left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than the comment about the added deps. I'm confused why this works without them.

Comment thread src/bench/CMakeLists.txt Outdated
leveldb
bitcoin_node
$<TARGET_NAME_IF_EXISTS:bitcoin_wallet>
bitcoin_common

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the new deps (bitcoin_common, bitcoin_consensus, etc)? Were they necessary before?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, the "duplicate libraries" warnings still being emitted. Besides, both test_bitcoin and bench_bitcoin targets do use symbols from the added libraries.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't understand. libs are added here but none are removed. How does that eliminate any dupes?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/test/CMakeLists.txt

add_executable(test_bitcoin
main.cpp
$<TARGET_OBJECTS:bitcoin_consensus>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this change about?

@hebasto hebasto Nov 7, 2023 •

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before CMake 3.12, the only way to consume the object library--which is a mere unarchived collection of object files, not a real library--was to add $<TARGET_OBJECTS:bitcoin_consensus> to sources. Now we can use an idiomatic way: target_link_libraries(test_bitcoin bitcoin_consensus).

In short, it is a modernization after bumping the minimum required CMake version from 3.10 to 3.16.

@hebasto

hebasto commented Nov 9, 2023

Copy link
Copy Markdown
Owner Author

I'm having trouble understanding several of the changes here. Deps are hopping around from libs to binaries.

Could you please add some extra info in the commit messages about what's happening so we reviewers don't have to try to interpret your changes?

Done. Sorry for the mess :)

@theuni

theuni commented Nov 9, 2023

Copy link
Copy Markdown

I'm having trouble understanding several of the changes here. Deps are hopping around from libs to binaries.
Could you please add some extra info in the commit messages about what's happening so we reviewers don't have to try to interpret your changes?

Done.

Ahhh. So much better :)

Please consider this a request to do the same for future fixups.

@theuni theuni left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested nor compared to the upstream deps, but changes make sense to me now that they have context.

Left one more question.

Comment thread src/CMakeLists.txt
)
if(ENABLE_WALLET)
target_sources(bitcoin_node PRIVATE wallet/init.cpp)
target_link_libraries(bitcoin_node PRIVATE bitcoin_wallet)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to go ahead and use TARGET_IF_NAME_EXISTS for target_sources here as well? Seems odd to leave only one behind.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Done.

univalue
Boost::headers
PUBLIC
univalue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to comment that I'd rather see this be PRIVATE and have univalue included by the binaries as needed, but test_util pretty clearly exports univalue as part of its interface, so PUBLIC univalue actually follows the code as-is quite well I think.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing univalue into usage requirements, and removing it from build specifications for the bench_bitcoin and test_bitcoin targets, fixes actually, "ld: warning: ignoring duplicate libraries" on macOS.

Makes the `bitcoin_wallet` library a direct dependency of `bitcoind`
rather `bitcoin_node`, that is outlined in
bitcoin/bitcoin@master/doc/design/libraries.md.
1) Drop unneeded dependencies in `test_util`.

2) Adjust dependencies for `bench_bitcoin` (removed uneeded ones and
add `bitcoin_node`, required after step (1).

@theuni theuni left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 8342981

@hebasto
hebasto merged this pull request into cmake-staging Nov 9, 2023
janus pushed a commit to BitgesellOfficial/bitgesell that referenced this pull request Apr 1, 2024
Having the link check in the header check loop means we get `-lminiupnpc
-lminiupnpc -lminiupnpc` on the link line. This is unnecessary, and
results in warnings, i.e:
```bash
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
```

These warnings have been occurring since the new linker released with
Xcode 15, and also came up in hebasto/bitcoin#34.
DashCoreAutoGuix pushed a commit to DashCoreAutoGuix/dash that referenced this pull request Jul 29, 2025
b74e449 build: remove potential for duplciate natpmp linking (fanquake)
4e95096 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449
  hebasto:
    ACK b74e449, it fixes one issue mentioned in hebasto#34 (comment).
  TheCharlatan:
    ACK b74e449
  theuni:
    ACK b74e449

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
DashCoreAutoGuix pushed a commit to DashCoreAutoGuix/dash that referenced this pull request Aug 5, 2025
b74e449 build: remove potential for duplciate natpmp linking (fanquake)
4e95096 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449
  hebasto:
    ACK b74e449, it fixes one issue mentioned in hebasto#34 (comment).
  TheCharlatan:
    ACK b74e449
  theuni:
    ACK b74e449

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
Shailendra53 pushed a commit to CryptoTuraTeam/dash that referenced this pull request Jun 19, 2026
b74e449 build: remove potential for duplciate natpmp linking (fanquake)
4e95096 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449
  hebasto:
    ACK b74e449, it fixes one issue mentioned in hebasto#34 (comment).
  TheCharlatan:
    ACK b74e449
  theuni:
    ACK b74e449

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
vijaydasmp pushed a commit to vijaydasmp/dash that referenced this pull request Jun 21, 2026
b74e449 build: remove potential for duplciate natpmp linking (fanquake)
4e95096 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449
  hebasto:
    ACK b74e449, it fixes one issue mentioned in hebasto#34 (comment).
  TheCharlatan:
    ACK b74e449
  theuni:
    ACK b74e449

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
Kino1994 pushed a commit to Kino1994/bitcoin-full-history that referenced this pull request Jun 28, 2026
Having the link check in the header check loop means we get `-lminiupnpc
-lminiupnpc -lminiupnpc` on the link line. This is unnecessary, and
results in warnings, i.e:
```bash
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
```

These warnings have been occurring since the new linker released with
Xcode 15, and also came up in hebasto/bitcoin#34.
Kino1994 pushed a commit to Kino1994/bitcoin-full-history that referenced this pull request Jun 28, 2026
…nking

b432320 build: remove potential for duplciate natpmp linking (fanquake)
482b30d build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto/bitcoin#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b432320
  hebasto:
    ACK b432320, it fixes one issue mentioned in hebasto/bitcoin#34 (comment).
  TheCharlatan:
    ACK b432320
  theuni:
    ACK b432320

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
BigcoinBGC pushed a commit to BigcoinBGC/bigcoin that referenced this pull request Jun 30, 2026
Having the link check in the header check loop means we get `-lminiupnpc
-lminiupnpc -lminiupnpc` on the link line. This is unnecessary, and
results in warnings, i.e:
```bash
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
```

These warnings have been occurring since the new linker released with
Xcode 15, and also came up in hebasto/bitcoin#34.
BigcoinBGC pushed a commit to BigcoinBGC/bigcoin that referenced this pull request Jun 30, 2026
…nking

7d78b3f build: remove potential for duplciate natpmp linking (fanquake)
a521ce5 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto/bitcoin#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK 7d78b3f
  hebasto:
    ACK 7d78b3f, it fixes one issue mentioned in hebasto/bitcoin#34 (comment).
  TheCharlatan:
    ACK 7d78b3f
  theuni:
    ACK 7d78b3f

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
Kino1994 pushed a commit to Kino1994/bitcoin-full-history that referenced this pull request Aug 19, 2026
Having the link check in the header check loop means we get `-lminiupnpc
-lminiupnpc -lminiupnpc` on the link line. This is unnecessary, and
results in warnings, i.e:
```bash
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
```

These warnings have been occurring since the new linker released with
Xcode 15, and also came up in hebasto/bitcoin#34.
Kino1994 pushed a commit to Kino1994/bitcoin-full-history that referenced this pull request Aug 19, 2026
…nking

b74e449ffa9965f18037f0322ea178e2fe1dbc18 build: remove potential for duplciate natpmp linking (fanquake)
4e9509695206bd952da00a2b1c90a92db31a0fe7 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto/bitcoin#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449ffa9965f18037f0322ea178e2fe1dbc18
  hebasto:
    ACK b74e449ffa9965f18037f0322ea178e2fe1dbc18, it fixes one issue mentioned in hebasto/bitcoin#34 (comment).
  TheCharlatan:
    ACK b74e449ffa9965f18037f0322ea178e2fe1dbc18
  theuni:
    ACK b74e449ffa9965f18037f0322ea178e2fe1dbc18

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
DCG-Claude added a commit to thepastaclaw/dash that referenced this pull request Oct 22, 2026
b74e449 build: remove potential for duplciate natpmp linking (fanquake)
4e95096 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449
  hebasto:
    ACK b74e449, it fixes one issue mentioned in hebasto#34 (comment).
  TheCharlatan:
    ACK b74e449
  theuni:
    ACK b74e449

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
DCG-Claude added a commit to thepastaclaw/dash that referenced this pull request Oct 24, 2026
b74e449 build: remove potential for duplciate natpmp linking (fanquake)
4e95096 build: remove duplicate -lminiupnpc linking (fanquake)

Pull request description:

  Having the link check in the header check loop means we get `-lminiupnpc -lminiupnpc -lminiupnpc` on the link line.
  This is unnecessary, and results in warnings, i.e:
  ```bash
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ld: warning: ignoring duplicate libraries: '-levent', '-lminiupnpc'
  ```

  These warnings have been occurring since the new macOS linker released with Xcode 15, and also came up in hebasto#34.

  There are other duplicate lib issues, i.e with `-levent` + `-levent_pthreads -levent`, but those are less straight forward to solve, and won't be included here.

ACKs for top commit:
  jonatack:
    ACK b74e449
  hebasto:
    ACK b74e449, it fixes one issue mentioned in hebasto#34 (comment).
  TheCharlatan:
    ACK b74e449
  theuni:
    ACK b74e449

Tree-SHA512: 987a56ef17cbaf273cb672c41016f3f615b16889317325a9e88135d0c41f01af3840ad44a6f811a7df97f5873c9cd957e60aaa1b99bd408b17b4b1ffe2c68f36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants