mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-08 10:58:22 -03:00
build: use -mbig-obj
for mingw-w64 Debug builds
Windows cross builds using `-O0` currently fail to compile, as some objects have too many sections. As a convenience, add `-mbig-obj` to our compile flags when using the `Debug` build type, so that if someone tries to build this way, it will work. This would also be needed if we switched the depends flags to -O0. `-mbig-obj` > On PE/COFF target this option forces the use of big object > file format, which allows more than 32768 sections. Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
This commit is contained in:
parent
d73f37dda2
commit
2b9ff4a66d
1 changed files with 9 additions and 0 deletions
|
@ -298,6 +298,15 @@ if(WIN32)
|
|||
try_append_linker_flag("-Wl,--major-subsystem-version,6" TARGET core_interface)
|
||||
try_append_linker_flag("-Wl,--minor-subsystem-version,2" TARGET core_interface)
|
||||
endif()
|
||||
|
||||
# Workaround producing large object files, which cannot be handled by the assembler.
|
||||
# More likely to happen with no, or lower levels of optimisation.
|
||||
# See discussion in https://github.com/bitcoin/bitcoin/issues/28109.
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
try_append_cxx_flags("/bigobj" TARGET core_interface_debug SKIP_LINK)
|
||||
else()
|
||||
try_append_cxx_flags("-Wa,-mbig-obj" TARGET core_interface_debug SKIP_LINK)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Use 64-bit off_t on 32-bit Linux.
|
||||
|
|
Loading…
Reference in a new issue