commit afc94997ef49b61071e0a37923eca4da7bdfa63a
parent 2b7d7a60693067f4fe8a881662b01c96e5a0fd34
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 25 Sep 2023 15:07:31 +0200
Update flags to link the htpp executable
Add the CFLAGS used when compiling the position-independent
executable. This follows the recommendation of the GCC manual for the
-pie option: "For predictable results, you must also specify the same
set of options used for compilation"
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
@@ -33,7 +33,7 @@ build_library: .config $(DEP)
$(DEP) $(OBJ): config.mk
htpp: $(OBJ)
- $(CC) -o $@ $(OBJ) $(LDFLAGS) $(DPDC_LIBS)
+ $(CC) $(CFLAGS) $(DPDC_CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(DPDC_LIBS)
.config: config.mk
@if ! $(PKG_CONFIG) --atleast-version $(SCMAP_VERSION) scmap; then \
diff --git a/config.mk b/config.mk
@@ -71,6 +71,6 @@ CFLAGS = $(CFLAGS_$(BUILD_TYPE))
################################################################################
LDFLAGS_HARDENED = -pie -Wl,-z,relro,-z,now
-LDFLAGS_DEBUG = $(LDFLAGS_HARDENED)
-LDFLAGS_RELEASE = -s $(LDFLAGS_HARDENED)
-LDFLAGS = $(LDFLAGS_$(BUILD_TYPE))
+LDFLAGS_DEBUG =
+LDFLAGS_RELEASE = -s
+LDFLAGS = $(LDFLAGS_$(BUILD_TYPE)) $(LDFLAGS_HARDENED)