Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warnings from capnproto when building via add_subdirectory #138

Closed
ryanofsky opened this issue Jan 28, 2025 · 10 comments · Fixed by #146
Closed

Compiler warnings from capnproto when building via add_subdirectory #138

ryanofsky opened this issue Jan 28, 2025 · 10 comments · Fixed by #146

Comments

@ryanofsky
Copy link
Collaborator

Originally posted by @Sjors in bitcoin/bitcoin#31741 (review)

On (M4) macOS 15.2 I get a flood of warnings, which means I can't use -DWERROR=ON:

In file included from /opt/homebrew/include/capnp/common.h:31:
/opt/homebrew/include/kj/windows-sanity.h:39:6: warning: '_WIN32' is not defined, evaluates to 0 [-Wundef]
   39 | #if !_WIN32 && !__CYGWIN__
      |      ^
/opt/homebrew/include/kj/windows-sanity.h:39:17: warning: '__CYGWIN__' is not defined, evaluates to 0 [-Wundef]
   39 | #if !_WIN32 && !__CYGWIN__
      |     

/opt/homebrew/include/capnp/common.h:33:5: warning: 'CAPNP_DEBUG_TYPES' is not defined, evaluates to 0 [-Wundef]

/opt/homebrew/include/capnp/raw-schema.h:26:5: warning: '_MSC_VER' is not defined, evaluates to 0 [-Wundef]

/opt/homebrew/include/kj/async-prelude.h:34:6: warning: 'KJ_NO_EXCEPTIONS' is not defined, evaluates to 0 [-Wundef]
@ryanofsky
Copy link
Collaborator Author

Using bitcoin/bitcoin#31741 (https://github.com/ryanofsky/bitcoin/commits/pr/subtree.3) I don't see any warnings on my sstem, so help to provide more steps to reproduce.

If you can try building with make -C build VERBOSE=1 ... that would also help show the compiler comment lines so we can see if there's something wrong with -I -isystem -Wno-system-headers options that are being passed might be causing this issue.

@Sjors
Copy link
Member

Sjors commented Jan 28, 2025

On 93ba80b3d78fa1c4e7f614df6517b9cb492d05d7 (build directory deleted)

macOS 15.2 with Xcode 16.2

cmake -B build -DWERROR=OFF -DBUILD_MULTIPROCESS=ON
log
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SQLite3: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/include (found suitable version "3.43.2", minimum required is "3.7.17")
-- Performing Test CXX_SUPPORTS__WERROR
-- Performing Test CXX_SUPPORTS__WERROR - Success
-- Setting build type to "RelWithDebInfo" as none was specified
-- Performing Test CXX_SUPPORTS__G3
-- Performing Test CXX_SUPPORTS__G3 - Success
-- Performing Test LINKER_SUPPORTS__G3
-- Performing Test LINKER_SUPPORTS__G3 - Success
-- Performing Test CXX_SUPPORTS__FTRAPV
-- Performing Test CXX_SUPPORTS__FTRAPV - Success
-- Performing Test LINKER_SUPPORTS__FTRAPV
-- Performing Test LINKER_SUPPORTS__FTRAPV - Success
-- Performing Test LINKER_SUPPORTS__WL__FATAL_WARNINGS
-- Performing Test LINKER_SUPPORTS__WL__FATAL_WARNINGS - Success
-- Performing Test LINKER_SUPPORTS__WL__DEAD_STRIP
-- Performing Test LINKER_SUPPORTS__WL__DEAD_STRIP - Success
-- Performing Test LINKER_SUPPORTS__WL__DEAD_STRIP_DYLIBS
-- Performing Test LINKER_SUPPORTS__WL__DEAD_STRIP_DYLIBS - Success
-- Performing Test LINKER_SUPPORTS__WL__HEADERPAD_MAX_INSTALL_NAMES
-- Performing Test LINKER_SUPPORTS__WL__HEADERPAD_MAX_INSTALL_NAMES - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found Boost: /opt/homebrew/include (found suitable version "1.87.0", minimum required is "1.73.0")
-- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE
-- Performing Test NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE - Failed
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "2.3.0")
-- Found Libevent: /opt/homebrew/Cellar/libevent/2.1.12_1/lib (found suitable version "2.1.12-stable", minimum required is "2.1.8")
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
-- Performing Test HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR - Failed
-- Looking for C++ include sys/prctl.h
-- Looking for C++ include sys/prctl.h - not found
-- Looking for C++ include sys/resources.h
-- Looking for C++ include sys/resources.h - not found
-- Looking for C++ include sys/vmmeter.h
-- Looking for C++ include sys/vmmeter.h - found
-- Looking for C++ include vm/vm_param.h
-- Looking for C++ include vm/vm_param.h - not found
-- Looking for O_CLOEXEC
-- Looking for O_CLOEXEC - found
-- Looking for fdatasync
-- Looking for fdatasync - not found
-- Looking for fork
-- Looking for fork - found
-- Looking for pipe2
-- Looking for pipe2 - not found
-- Looking for setsid
-- Looking for setsid - found
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include ifaddrs.h
-- Looking for C++ include ifaddrs.h - found
-- Performing Test IFADDR_LINKS_WITHOUT_LIBSOCKET
-- Performing Test IFADDR_LINKS_WITHOUT_LIBSOCKET - Success
-- Performing Test STD_ATOMIC_LINKS_WITHOUT_LIBATOMIC
-- Performing Test STD_ATOMIC_LINKS_WITHOUT_LIBATOMIC - Success
-- Looking for std::system
-- Looking for std::system - found
-- Looking for ::_wsystem
-- Looking for ::_wsystem - not found
-- Performing Test STRERROR_R_CHAR_P
-- Performing Test STRERROR_R_CHAR_P - Failed
-- Looking for malloc_info
-- Looking for malloc_info - not found
-- Performing Test HAVE_MALLOPT_ARENA_MAX
-- Performing Test HAVE_MALLOPT_ARENA_MAX - Failed
-- Performing Test HAVE_POSIX_FALLOCATE
-- Performing Test HAVE_POSIX_FALLOCATE - Failed
-- Performing Test HAVE_STRONG_GETAUXVAL
-- Performing Test HAVE_STRONG_GETAUXVAL - Failed
-- Performing Test HAVE_SOCKADDR_UN
-- Performing Test HAVE_SOCKADDR_UN - Success
-- Performing Test HAVE_GETRANDOM
-- Performing Test HAVE_GETRANDOM - Failed
-- Performing Test HAVE_GETENTROPY_RAND
-- Performing Test HAVE_GETENTROPY_RAND - Success
-- Performing Test HAVE_SYSCTL
-- Performing Test HAVE_SYSCTL - Success
-- Performing Test HAVE_SYSCTL_ARND
-- Performing Test HAVE_SYSCTL_ARND - Failed
-- Performing Test HAVE_SSE41
-- Performing Test HAVE_SSE41 - Failed
-- Performing Test HAVE_AVX2
-- Performing Test HAVE_AVX2 - Failed
-- Performing Test HAVE_X86_SHANI
-- Performing Test HAVE_X86_SHANI - Failed
-- Performing Test HAVE_ARM_SHANI
-- Performing Test HAVE_ARM_SHANI - Success
-- Performing Test CXX_SUPPORTS__WALL
-- Performing Test CXX_SUPPORTS__WALL - Success
-- Performing Test CXX_SUPPORTS__WEXTRA
-- Performing Test CXX_SUPPORTS__WEXTRA - Success
-- Performing Test CXX_SUPPORTS__WGNU
-- Performing Test CXX_SUPPORTS__WGNU - Success
-- Performing Test CXX_SUPPORTS__WFORMAT__WFORMAT_SECURITY
-- Performing Test CXX_SUPPORTS__WFORMAT__WFORMAT_SECURITY - Success
-- Performing Test CXX_SUPPORTS__WVLA
-- Performing Test CXX_SUPPORTS__WVLA - Success
-- Performing Test CXX_SUPPORTS__WSHADOW_FIELD
-- Performing Test CXX_SUPPORTS__WSHADOW_FIELD - Success
-- Performing Test CXX_SUPPORTS__WTHREAD_SAFETY
-- Performing Test CXX_SUPPORTS__WTHREAD_SAFETY - Success
-- Performing Test CXX_SUPPORTS__WLOOP_ANALYSIS
-- Performing Test CXX_SUPPORTS__WLOOP_ANALYSIS - Success
-- Performing Test CXX_SUPPORTS__WREDUNDANT_DECLS
-- Performing Test CXX_SUPPORTS__WREDUNDANT_DECLS - Success
-- Performing Test CXX_SUPPORTS__WUNUSED_MEMBER_FUNCTION
-- Performing Test CXX_SUPPORTS__WUNUSED_MEMBER_FUNCTION - Success
-- Performing Test CXX_SUPPORTS__WDATE_TIME
-- Performing Test CXX_SUPPORTS__WDATE_TIME - Success
-- Performing Test CXX_SUPPORTS__WCONDITIONAL_UNINITIALIZED
-- Performing Test CXX_SUPPORTS__WCONDITIONAL_UNINITIALIZED - Success
-- Performing Test CXX_SUPPORTS__WDUPLICATED_BRANCHES
-- Performing Test CXX_SUPPORTS__WDUPLICATED_BRANCHES - Failed
-- Performing Test CXX_SUPPORTS__WDUPLICATED_COND
-- Performing Test CXX_SUPPORTS__WDUPLICATED_COND - Failed
-- Performing Test CXX_SUPPORTS__WLOGICAL_OP
-- Performing Test CXX_SUPPORTS__WLOGICAL_OP - Failed
-- Performing Test CXX_SUPPORTS__WOVERLOADED_VIRTUAL
-- Performing Test CXX_SUPPORTS__WOVERLOADED_VIRTUAL - Success
-- Performing Test CXX_SUPPORTS__WSUGGEST_OVERRIDE
-- Performing Test CXX_SUPPORTS__WSUGGEST_OVERRIDE - Success
-- Performing Test CXX_SUPPORTS__WIMPLICIT_FALLTHROUGH
-- Performing Test CXX_SUPPORTS__WIMPLICIT_FALLTHROUGH - Success
-- Performing Test CXX_SUPPORTS__WUNREACHABLE_CODE
-- Performing Test CXX_SUPPORTS__WUNREACHABLE_CODE - Success
-- Performing Test CXX_SUPPORTS__WDOCUMENTATION
-- Performing Test CXX_SUPPORTS__WDOCUMENTATION - Success
-- Performing Test CXX_SUPPORTS__WSELF_ASSIGN
-- Performing Test CXX_SUPPORTS__WSELF_ASSIGN - Success
-- Performing Test CXX_SUPPORTS__WBIDI_CHARS_ANY
-- Performing Test CXX_SUPPORTS__WBIDI_CHARS_ANY - Failed
-- Performing Test CXX_SUPPORTS__WUNDEF
-- Performing Test CXX_SUPPORTS__WUNDEF - Success
-- Performing Test CXX_SUPPORTS__WUNUSED_PARAMETER
-- Performing Test CXX_SUPPORTS__WUNUSED_PARAMETER - Success
-- Performing Test CXX_SUPPORTS__FNO_EXTENDED_IDENTIFIERS
-- Performing Test CXX_SUPPORTS__FNO_EXTENDED_IDENTIFIERS - Failed
-- Performing Test CXX_SUPPORTS__FDEBUG_PREFIX_MAP_A_B
-- Performing Test CXX_SUPPORTS__FDEBUG_PREFIX_MAP_A_B - Success
-- Performing Test CXX_SUPPORTS__FMACRO_PREFIX_MAP_A_B
-- Performing Test CXX_SUPPORTS__FMACRO_PREFIX_MAP_A_B - Success
-- Performing Test CXX_SUPPORTS__FSTACK_REUSE_NONE
-- Performing Test CXX_SUPPORTS__FSTACK_REUSE_NONE - Failed
-- Performing Test CXX_SUPPORTS__U_FORTIFY_SOURCE__D_FORTIFY_SOURCE_3_cc10
-- Performing Test CXX_SUPPORTS__U_FORTIFY_SOURCE__D_FORTIFY_SOURCE_3_cc10 - Success
-- Performing Test LINKER_SUPPORTS__U_FORTIFY_SOURCE__D_FORTIFY_SOURCE_3_cc10
-- Performing Test LINKER_SUPPORTS__U_FORTIFY_SOURCE__D_FORTIFY_SOURCE_3_cc10 - Success
-- Performing Test CXX_SUPPORTS__WSTACK_PROTECTOR
-- Performing Test CXX_SUPPORTS__WSTACK_PROTECTOR - Success
-- Performing Test CXX_SUPPORTS__FSTACK_PROTECTOR_ALL
-- Performing Test CXX_SUPPORTS__FSTACK_PROTECTOR_ALL - Success
-- Performing Test LINKER_SUPPORTS__FSTACK_PROTECTOR_ALL
-- Performing Test LINKER_SUPPORTS__FSTACK_PROTECTOR_ALL - Success
-- Performing Test CXX_SUPPORTS__FCF_PROTECTION_FULL
-- Performing Test CXX_SUPPORTS__FCF_PROTECTION_FULL - Failed
-- Performing Test CXX_SUPPORTS__FSTACK_CLASH_PROTECTION
-- Performing Test CXX_SUPPORTS__FSTACK_CLASH_PROTECTION - Failed
-- Performing Test CXX_SUPPORTS__MBRANCH_PROTECTION_BTI
-- Performing Test CXX_SUPPORTS__MBRANCH_PROTECTION_BTI - Success
-- Performing Test LINKER_SUPPORTS__WL___ENABLE_RELOC_SECTION
-- Performing Test LINKER_SUPPORTS__WL___ENABLE_RELOC_SECTION - Failed
-- Performing Test LINKER_SUPPORTS__WL___DYNAMICBASE
-- Performing Test LINKER_SUPPORTS__WL___DYNAMICBASE - Failed
-- Performing Test LINKER_SUPPORTS__WL___NXCOMPAT
-- Performing Test LINKER_SUPPORTS__WL___NXCOMPAT - Failed
-- Performing Test LINKER_SUPPORTS__WL___HIGH_ENTROPY_VA
-- Performing Test LINKER_SUPPORTS__WL___HIGH_ENTROPY_VA - Failed
-- Performing Test LINKER_SUPPORTS__WL__Z_RELRO
-- Performing Test LINKER_SUPPORTS__WL__Z_RELRO - Failed
-- Performing Test LINKER_SUPPORTS__WL__Z_NOW
-- Performing Test LINKER_SUPPORTS__WL__Z_NOW - Failed
-- Performing Test LINKER_SUPPORTS__WL__Z_SEPARATE_CODE
-- Performing Test LINKER_SUPPORTS__WL__Z_SEPARATE_CODE - Failed
-- Performing Test LINKER_SUPPORTS__WL__FIXUP_CHAINS
-- Performing Test LINKER_SUPPORTS__WL__FIXUP_CHAINS - Success
-- Found Python3: /opt/homebrew/Frameworks/Python.framework/Versions/3.13/bin/python3.13 (found suitable version "3.13.1", minimum required is "3.10") found components: Interpreter
-- Found Doxygen: /opt/homebrew/bin/doxygen (found version "1.13.2") found components: doxygen dot
-- Performing Test HAVE_BUILTIN_PREFETCH
-- Performing Test HAVE_BUILTIN_PREFETCH - Success
-- Performing Test HAVE_MM_PREFETCH
-- Performing Test HAVE_MM_PREFETCH - Failed
-- Performing Test HAVE_SSE42
-- Performing Test HAVE_SSE42 - Failed
-- Performing Test HAVE_ARM64_CRC32C
-- Performing Test HAVE_ARM64_CRC32C - Success
-- Looking for F_FULLFSYNC
-- Looking for F_FULLFSYNC - found
-- Performing Test HAVE_CLMUL
-- Performing Test HAVE_CLMUL - Failed
CMake Deprecation Warning at src/ipc/libmultiprocess/CMakeLists.txt:5 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- Found ZLIB: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk/usr/lib/libz.tbd (found version "1.2.12")
-- Performing Test HAVE_PTHREAD_GETNAME_NP
-- Performing Test HAVE_PTHREAD_GETNAME_NP - Success
-- Performing Test HAVE_PTHREAD_THREADID_NP
-- Performing Test HAVE_PTHREAD_THREADID_NP - Success
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP
-- Performing Test HAVE_PTHREAD_GETTHREADID_NP - Failed

Configuring secp256k1 subtree...
-- The C compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test HAVE_X86_64_ASM
-- Performing Test HAVE_X86_64_ASM - Failed
-- Could NOT find Valgrind (missing: Valgrind_INCLUDE_DIR Valgrind_WORKS) 
-- Performing Test C_SUPPORTS__PEDANTIC
-- Performing Test C_SUPPORTS__PEDANTIC - Success
-- Performing Test C_SUPPORTS__WALL
-- Performing Test C_SUPPORTS__WALL - Success
-- Performing Test C_SUPPORTS__WCAST_ALIGN
-- Performing Test C_SUPPORTS__WCAST_ALIGN - Success
-- Performing Test C_SUPPORTS__WCAST_ALIGN_STRICT
-- Performing Test C_SUPPORTS__WCAST_ALIGN_STRICT - Failed
-- Performing Test C_SUPPORTS__WCONDITIONAL_UNINITIALIZED
-- Performing Test C_SUPPORTS__WCONDITIONAL_UNINITIALIZED - Success
-- Performing Test C_SUPPORTS__WEXTRA
-- Performing Test C_SUPPORTS__WEXTRA - Success
-- Performing Test C_SUPPORTS__WNESTED_EXTERNS
-- Performing Test C_SUPPORTS__WNESTED_EXTERNS - Success
-- Performing Test C_SUPPORTS__WNO_LONG_LONG
-- Performing Test C_SUPPORTS__WNO_LONG_LONG - Success
-- Performing Test C_SUPPORTS__WNO_OVERLENGTH_STRINGS
-- Performing Test C_SUPPORTS__WNO_OVERLENGTH_STRINGS - Success
-- Performing Test C_SUPPORTS__WNO_UNUSED_FUNCTION
-- Performing Test C_SUPPORTS__WNO_UNUSED_FUNCTION - Success
-- Performing Test C_SUPPORTS__WRESERVED_IDENTIFIER
-- Performing Test C_SUPPORTS__WRESERVED_IDENTIFIER - Success
-- Performing Test C_SUPPORTS__WSHADOW
-- Performing Test C_SUPPORTS__WSHADOW - Success
-- Performing Test C_SUPPORTS__WSTRICT_PROTOTYPES
-- Performing Test C_SUPPORTS__WSTRICT_PROTOTYPES - Success
-- Performing Test C_SUPPORTS__WUNDEF
-- Performing Test C_SUPPORTS__WUNDEF - Success


secp256k1 configure summary
===========================
Build artifacts:
  library type ........................ Static
Optional modules:
  ECDH ................................ OFF
  ECDSA pubkey recovery ............... ON
  extrakeys ........................... ON
  schnorrsig .......................... ON
  musig ............................... OFF
  ElligatorSwift ...................... ON
Parameters:
  ecmult window size .................. 15
  ecmult gen table size ............... 86 KiB
Optional features:
  assembly ............................ OFF
  external callbacks .................. OFF
Optional binaries:
  benchmark ........................... OFF
  noverify_tests ...................... ON
  tests ............................... ON
  exhaustive tests .................... ON
  ctime_tests ......................... OFF
  examples ............................ OFF

Cross compiling ....................... FALSE
Valgrind .............................. OFF
Preprocessor defined macros ........... ENABLE_MODULE_ELLSWIFT=1 ENABLE_MODULE_SCHNORRSIG=1 ENABLE_MODULE_EXTRAKEYS=1 ENABLE_MODULE_RECOVERY=1 ECMULT_WINDOW_SIZE=15 COMB_BLOCKS=43 COMB_TEETH=6
C compiler ............................ AppleClang 16.0.0.16000026, /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
CFLAGS ................................ 
Compile options ....................... -pedantic -Wall -Wcast-align -Wconditional-uninitialized -Wextra -Wnested-externs -Wno-long-long -Wno-overlength-strings -Wno-unused-function -Wreserved-identifier -Wshadow -Wstrict-prototypes -Wundef
Build type:
 - CMAKE_BUILD_TYPE ................... RelWithDebInfo
 - CFLAGS ............................. -O2 -g 
 - LDFLAGS for executables ............ 
 - LDFLAGS for shared libraries ....... 



Configure summary
=================
Executables:
  bitcoind ............................ ON
  bitcoin-node (multiprocess) ......... ON
  bitcoin-qt (GUI) .................... OFF
  bitcoin-gui (GUI, multiprocess) ..... OFF
  bitcoin-cli ......................... ON
  bitcoin-tx .......................... ON
  bitcoin-util ........................ ON
  bitcoin-wallet ...................... ON
  bitcoin-chainstate (experimental) ... OFF
  libbitcoinkernel (experimental) ..... OFF
Optional features:
  wallet support ...................... ON
   - descriptor wallets (SQLite) ...... ON
   - legacy wallets (Berkeley DB) ..... OFF
  external signer ..................... ON
  ZeroMQ .............................. OFF
  USDT tracing ........................ OFF
  QR code (GUI) ....................... OFF
  DBus (GUI, Linux only) .............. OFF
Tests:
  test_bitcoin ........................ ON
  test_bitcoin-qt ..................... OFF
  bench_bitcoin ....................... OFF
  fuzz binary ......................... OFF

Cross compiling ....................... FALSE
C++ compiler .......................... AppleClang 16.0.0.16000026, /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
CMAKE_BUILD_TYPE ...................... RelWithDebInfo
Preprocessor defined macros ........... OBJC_OLD_DISPATCH_PROTOTYPES=0
C++ compiler flags .................... -O2 -g -std=c++20 -fPIC -fdebug-prefix-map=/Users/sjors/dev/bitcoin/src=. -fmacro-prefix-map=/Users/sjors/dev/bitcoin/src=. -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -mbranch-protection=bti
Linker flags .......................... -O2 -g -Wl,-dead_strip -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -fstack-protector-all -Wl,-fixup_chains -fPIE -Xlinker -pie

NOTE: The summary above may not exactly match the final applied build flags
      if any additional CMAKE_* or environment variables have been modified.
      To see the exact flags applied, build with the --verbose option.

Attempt to harden executables ......... ON
Treat compiler warnings as errors ..... OFF
Use ccache for compiling .............. ON


-- Configuring done (8.9s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/sjors/dev/bitcoin/build
cmake --build build -j 15 --verbose

That's so verbose it doesn't fit in a comment :-)

https://gist.githubusercontent.com/Sjors/2307c73a2db59ca802f5c32d73d175d1/raw/52766be20a47be34447e9bfb87e86d5780e541ed/gistfile1.txt

@Sjors
Copy link
Member

Sjors commented Jan 30, 2025

@ryanofsky
Copy link
Collaborator Author

@hebasto do you have any ideas on how to fix these warning: 'XXXXX' is not defined, evaluates to 0 [-Wundef] errors?

I know in the old build system we had a SUPPRESS_WARNINGS workaround for this that used -isystem instead of -I to avoid them: 79e197b from bitcoin/bitcoin#29876

But I can't find an equivalent workaround in the cmake build. I would expect -Wundef problem didn't disappear so we much be working around it somehow?

@TheCharlatan
Copy link
Collaborator

Shouldn't these be wrapped in defined(...)?

@ryanofsky
Copy link
Collaborator Author

Shouldn't these be wrapped in defined(...)?

These warnings are coming from capnproto. I think in most projects using #if UNDEFINED_SYMBOL is very common and using -Wundef is more rare, and in general we shouldn't be enforcing warnings in external headers.

@ryanofsky
Copy link
Collaborator Author

Not to mention that if defined(SYMBOL) can cause problems because -DSYMBOL=0 will not work.

@ryanofsky
Copy link
Collaborator Author

I feel like I'm pretty stuck here. I've been trying to make a similar failure happen on my system, but not getting anywhere. I think maybe following changes would be more correct and might get rid of the errors from boost and capnproto here, but this is a bit of a shot in the dark:

--- a/src/ipc/libmultiprocess/CMakeLists.txt
+++ b/src/ipc/libmultiprocess/CMakeLists.txt
@@ -93,10 +93,10 @@ target_include_directories(multiprocess PUBLIC
   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
   $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
   ${CAPNP_INCLUDE_DIRECTORY})
-target_link_libraries(multiprocess PRIVATE CapnProto::capnp)
-target_link_libraries(multiprocess PRIVATE CapnProto::capnp-rpc)
-target_link_libraries(multiprocess PRIVATE CapnProto::kj)
-target_link_libraries(multiprocess PRIVATE CapnProto::kj-async)
+target_link_libraries(multiprocess PUBLIC CapnProto::capnp)
+target_link_libraries(multiprocess PUBLIC CapnProto::capnp-rpc)
+target_link_libraries(multiprocess PUBLIC CapnProto::kj)
+target_link_libraries(multiprocess PUBLIC CapnProto::kj-async)
 set_target_properties(multiprocess PROPERTIES
     PUBLIC_HEADER "${MP_PUBLIC_HEADERS}")
 install(TARGETS multiprocess EXPORT LibTargets
--- a/src/test/CMakeLists.txt
+++ b/src/test/CMakeLists.txt
@@ -164,6 +164,7 @@ endif()
 if(BUILD_MULTIPROCESS)
   target_link_libraries(bitcoin_ipc_test
     PRIVATE
+      Boost::headers
       core_interface
       univalue
   )

@Sjors
Copy link
Member

Sjors commented Jan 30, 2025

I'll give them a try, waiting for the Windows job on the last push: https://github.com/bitcoin/bitcoin/actions/runs/13054985470/job/36423710000?pr=30975

(actually there's no use in waiting for Windows with multiprocess)

@ryanofsky
Copy link
Collaborator Author

The diff suggested in #138 (comment) did seem to successfully fix the header warnings in the macos 14 native job here: bitcoin/bitcoin#30975 (comment)

ryanofsky added a commit to ryanofsky/libmultiprocess that referenced this issue Feb 3, 2025
cmake: Suppress compiler warnings from capnproto headers

Tweak target_link_libraries calls to correctly declare dependencies on
capnproto libraries as public, so capnproto include directories get correctly
added to downstream targets. Without this, compiler warnings can be triggered
from capnproto headers because they are not treated like external headers.

Fixes bitcoin-core#138
ryanofsky added a commit that referenced this issue Feb 3, 2025
72326b5 cmake: Simplify capnp include handling (Ryan Ofsky)
65c7048 cmake: Suppress compiler warnings from capnproto headers (Ryan Ofsky)

Pull request description:

  Tweak `target_link_libraries` calls to correctly declare dependencies on capnproto libraries as public, so capnproto include directories get correctly added to downstream targets. Without this, compiler warnings can be triggered from capnproto headers because they are not treated like external headers.

  Fixes #138

  This should be an alternative to #141

Top commit has no ACKs.

Tree-SHA512: fc8349335db98bd578e59bd8206da6f440aa6be3468cbb08099e94a336dca4c6534a653b1cf25e79c6aef5481f873c8272df895eeeb57988bb621e5b705c562a
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 3, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 3, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 4, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 4, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 5, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 5, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 7, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 7, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 7, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 7, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 10, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 10, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 10, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 10, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 10, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 13, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 13, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 24, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 24, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 25, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 25, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 25, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Feb 25, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 11, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 11, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 12, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 12, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 17, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 17, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 17, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 18, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 18, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 31, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 31, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
ryanofsky added a commit to ryanofsky/bitcoin that referenced this issue Mar 31, 2025
This change is technically not needed to add libmultiprocess as a subtree, but
it avoids a CI failure in followup PR bitcoin#30975 which enables multiprocess build
option in more CI jobs. In that PR, the "macOS 14 native no depends job" fails
due to warnings in boost headers treated as errors, reported in
bitcoin#30975 (comment) and
bitcoin-core/libmultiprocess#138
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 a pull request may close this issue.

3 participants