diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile index b068376..1bc3ae8 100644 --- a/src/Makefile +++ b/src/Makefile | |||
| @@ -100,7 +100,7 @@ obj/imgui_impl_opengl3.o: $(IMGUI_DIR)/imgui_impl_opengl3.cpp | |||
| 100 | $(CXX) -c $(CXXFLAGS) -o $@ $< | 100 | $(CXX) -c $(CXXFLAGS) -o $@ $< |
| 101 | 101 | ||
| 102 | bitflash: $(IMGUI_OBJS) $(NODE_OBJS) $(GUI_OBJS) | 102 | bitflash: $(IMGUI_OBJS) $(NODE_OBJS) $(GUI_OBJS) |
| 103 | $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) | 103 | $(CXX) $(CXXFLAGS) $(LDHARDFLAGS) -o $@ $^ $(LIBS) |
| 104 | @echo "Built: bitflash" | 104 | @echo "Built: bitflash" |
| 105 | 105 | ||
| 106 | # ---- headless node --------------------------------------------------------- | 106 | # ---- headless node --------------------------------------------------------- |
| @@ -114,6 +114,20 @@ bitflash: $(IMGUI_OBJS) $(NODE_OBJS) $(GUI_OBJS) | |||
| 114 | # Objects go to obj-node/ because main_gui.cpp is compiled twice, with and | 114 | # Objects go to obj-node/ because main_gui.cpp is compiled twice, with and |
| 115 | # without -DBITFLASH_NO_GUI, and the two must not overwrite each other. | 115 | # without -DBITFLASH_NO_GUI, and the two must not overwrite each other. |
| 116 | 116 | ||
| 117 | # RandomX links a hand-written assembly JIT stub, jit_compiler_x86_static.S, | ||
| 118 | # which carries no .note.GNU-stack marker. Older binutils -- Debian 12's, which | ||
| 119 | # is what builds against the oldest glibc we ship to -- reads a missing marker | ||
| 120 | # as "this object wants an executable stack" and marks the whole binary RWE, | ||
| 121 | # switching NX off for the process. Newer toolchains default the other way, so | ||
| 122 | # identical source produced GNU_STACK RW on Ubuntu 26.04 and RWE on bookworm, | ||
| 123 | # announced by nothing louder than a linker warning in the middle of the build. | ||
| 124 | # | ||
| 125 | # Assert it here rather than inherit whichever default the build host happens | ||
| 126 | # to carry. The JIT maps its own W^X pages and never executes from the stack, | ||
| 127 | # so nothing needs the permission this takes away. Check with: | ||
| 128 | # readelf -lW bitflash-node | grep -A1 GNU_STACK # expect RW, not RWE | ||
| 129 | LDHARDFLAGS = -Wl,-z,noexecstack | ||
| 130 | |||
| 117 | NODE_LIBS = -L$(SECP_LIB) -lsecp256k1 \ | 131 | NODE_LIBS = -L$(SECP_LIB) -lsecp256k1 \ |
| 118 | -L$(RANDOMX_DIR)/build -lrandomx \ | 132 | -L$(RANDOMX_DIR)/build -lrandomx \ |
| 119 | -lsodium -lssl -lcrypto -ldb_cxx -lpthread | 133 | -lsodium -lssl -lcrypto -ldb_cxx -lpthread |
| @@ -134,7 +148,7 @@ obj-node/sha.o: sha.cpp sha.h | |||
| 134 | $(CXX) -c $(CXXFLAGS) -DBITFLASH_NO_GUI -O3 -o $@ $< | 148 | $(CXX) -c $(CXXFLAGS) -DBITFLASH_NO_GUI -O3 -o $@ $< |
| 135 | 149 | ||
| 136 | bitflash-node: $(NODE_ONLY_OBJS) | 150 | bitflash-node: $(NODE_ONLY_OBJS) |
| 137 | $(CXX) $(CXXFLAGS) -o $@ $^ $(NODE_LIBS) | 151 | $(CXX) $(CXXFLAGS) $(LDHARDFLAGS) -o $@ $^ $(NODE_LIBS) |
| 138 | @echo "Built: bitflash-node (headless, no libGL needed)" | 152 | @echo "Built: bitflash-node (headless, no libGL needed)" |
| 139 | 153 | ||
| 140 | obj-fuzz/%.o: %.cpp $(HEADERS) | 154 | obj-fuzz/%.o: %.cpp $(HEADERS) |