Skip to content

Commit

Permalink
Merge bitcoin#30743: depends: build libevent with -D_GNU_SOURCE
Browse files Browse the repository at this point in the history
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 authored and PastaPastaPasta committed Sep 28, 2024
1 parent 2d4fd07 commit 3487842
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
endef

Expand Down

0 comments on commit 3487842

Please sign in to comment.