Fix C++ flags handling (fix relocation error on Fedora 41)

This commit is contained in:
Philippe Teuwen
2026-02-28 17:33:06 +01:00
parent f9cfda9a72
commit 55e58466aa
3 changed files with 5 additions and 4 deletions

View File

@@ -177,6 +177,7 @@ ifneq ($(NOHARDENING),1)
CFLAGS += -fcf-protection=full
endif
DEFCFLAGS += -fPIE
DEFCXXFLAGS += -fPIE
DEFLDFLAGS += -Wl,-z,now -Wl,-z,relro -Wl,-z,noexecstack -pie
endif
endif

View File

@@ -472,7 +472,7 @@ endif
PM3CFLAGS += -DHAVE_SNPRINTF
CXXFLAGS ?= -Wall -Werror
CXXFLAGS ?= $(DEFCXXFLAGS)
CXXFLAGS += $(MYDEFS) $(MYCXXFLAGS) $(MYINCLUDES)
PM3CXXFLAGS = $(CXXFLAGS)
@@ -483,10 +483,10 @@ ifeq ($(QT_FOUND),1)
PM3CXXFLAGS += -DQT_NO_DEBUG
ifeq ($(QT6_FOUND),1)
# Qt6 is claiming for a C++17 compiler
PM3CXXFLAGS += -fPIC -std=c++17
PM3CXXFLAGS += -std=c++17
else
# On OSX Qt6 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails)
PM3CXXFLAGS += -fPIC -std=c++11
PM3CXXFLAGS += -std=c++11
endif
endif

View File

@@ -21,7 +21,7 @@ endif
# macOS needs c++14 standard when compiling c++
ifeq ($(platform),Darwin)
MYCXXFLAGS = -std=c++14
MYCXXFLAGS += -std=c++14
endif
ifneq (,$(findstring MINGW,$(platform)))