From 09007b4a0321c594083fe1b5e67edbc8b257844b Mon Sep 17 00:00:00 2001 From: Bitflash Date: Sat, 1 Aug 2026 21:27:09 -0300 Subject: build: list every header, so editing one rebuilds what includes it (#99) sockcount.h was in neither makefile's HEADERS, so editing it rebuilt only the objects whose .cpp had also changed and the rest kept the old struct layout -- one object indexing a shared function-local static by the old layout and another by the new one, in the same binary. compat.h and font_roboto.h were missing from one list each. Verified with a full clean rebuild: no duplicate-section warning. --- src/Makefile | 9 ++++++++- src/makefile.mingw | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 3eaf2ba..5ded7d6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -39,10 +39,17 @@ LIBS = -L$(SECP_LIB) -lsecp256k1 \ -lsodium -lssl -lcrypto -ldb_cxx -lpthread \ -lglfw -lGL +# Every header a .cpp here includes has to be listed, not just the interesting +# ones. sockcount.h was missing, and it declares a struct that lives in a +# function-local static shared across translation units: editing it rebuilt +# some objects and not others, and the linker said so in a warning easy to walk +# past -- "duplicate section ... has different size". That is one object +# indexing a struct by the old layout and another by the new one, in the same +# binary. Nothing crashed here, and nothing would say so if it had. HEADERS = headers_core.h headers.h util.h main.h serialize.h uint256.h \ key.h bignum.h script.h db.h base58.h net.h nostr.h \ randomx_pow.h btfaddr.h btfchan.h btfrv.h btftunnel.h market.h \ - selftest.h walletcmd.h compat.h + selftest.h walletcmd.h compat.h sockcount.h font_roboto.h IMGUI_OBJS = obj/imgui.o obj/imgui_draw.o obj/imgui_tables.o \ obj/imgui_widgets.o obj/imgui_impl_glfw.o obj/imgui_impl_opengl3.o diff --git a/src/makefile.mingw b/src/makefile.mingw index 94d2146..5be3704 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -46,10 +46,17 @@ NODE_OBJS = obj/util.o obj/script.o obj/db.o obj/net.o obj/main.o \ GUI_OBJS = obj/gui.o obj/main_gui.o obj/bitflash_res.o +# Every header a .cpp here includes has to be listed, not just the interesting +# ones. sockcount.h was missing, and it declares a struct that lives in a +# function-local static shared across translation units: editing it rebuilt +# some objects and not others, and the linker said so in a warning easy to walk +# past -- "duplicate section ... has different size". That is one object +# indexing a struct by the old layout and another by the new one, in the same +# binary. Nothing crashed here, and nothing would say so if it had. HEADERS = headers_core.h headers.h util.h main.h serialize.h uint256.h \ key.h bignum.h script.h db.h base58.h net.h nostr.h \ randomx_pow.h btfaddr.h btfchan.h btfrv.h btftunnel.h market.h \ - selftest.h walletcmd.h + selftest.h walletcmd.h sockcount.h compat.h font_roboto.h all: bitflash.exe -- cgit v1.2.3