Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#30743: depends: build libevent with `-D_GNU_SOU…
Browse files Browse the repository at this point in the history
…RCE`

5567754 depends: build libevent with -D_GNU_SOURCE (fanquake)

Pull request description:

  Currently, builds of libevent in depends, using CMake, fail on some systems, like Alpine, with the following:
  ```bash
  /bitcoin/depends/work/build/aarch64-unknown-linux-musl/libevent/2.1.12-stable-1516ed47ea8/evmap.c: In function 'evmap_signal_add_':
  /bitcoin/depends/work/build/aarch64-unknown-linux-musl/libevent/2.1.12-stable-1516ed47ea8/evmap.c:456:31: error: 'NSIG' undeclared (first use in this function)
    456 |         if (sig < 0 || sig >= NSIG)
  ```

  From what I can tell the `GNU_SOURCE` "detection" in libevents CMake build system, never? really worked, primarily relies on looking for a deprecated define, and it's not clear what a nice fix is. For now, always build with `_GNU_SOURCE`, to match the autotools behaviour.

ACKs for top commit:
  TheCharlatan:
    ACK 5567754

Tree-SHA512: 4552b4a92867e8fa2af0ffa39b2be6c994bf739de7ce6a7c581590be486da81f7d93fca816854548c1e912347d33a35218c441b5058c3cbd3e82c74a9b7c78d9
  • Loading branch information
fanquake committed Sep 5, 2024
2 parents f794a0d + 5567754 commit 79772cd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions depends/packages/libevent.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ define $(package)_set_vars
$(package)_config_opts=-DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_OPENSSL=ON
$(package)_config_opts+=-DEVENT__DISABLE_SAMPLES=ON -DEVENT__DISABLE_REGRESS=ON
$(package)_config_opts+=-DEVENT__DISABLE_TESTS=ON -DEVENT__LIBRARY_TYPE=STATIC
$(package)_cppflags += -D_GNU_SOURCE
$(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601

ifeq ($(NO_HARDEN),)
Expand Down

0 comments on commit 79772cd

Please sign in to comment.