From 6cdccfb2df2e63ff87e8c7f93c01a5b30ca9695c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 9 Nov 2026 14:02:52 +0700 Subject: [PATCH] fix -fPIC issues --- Makefile.defs | 4 ++-- client/Makefile | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile.defs b/Makefile.defs index 7304bb5f6..dcaa346ec 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -185,8 +185,8 @@ ifneq ($(NOHARDENING),1) ifndef IS_WINDOWS ifndef IS_DARWIN - ifeq ($(ARCH),x86_64) - CFLAGS += -fcf-protection=full + ifneq ($(findstring x86_64,$(shell $(CC) -dumpmachine 2>/dev/null)),) + DEFCFLAGS += -fcf-protection=full endif DEFCFLAGS += -fPIC DEFCXXFLAGS += -fPIC diff --git a/client/Makefile b/client/Makefile index ee083429c..0d7f13f65 100644 --- a/client/Makefile +++ b/client/Makefile @@ -548,6 +548,13 @@ ifeq ($(QT_FOUND),1) # On OSX Qt6 is claiming for a C++11 compiler (gnu++14 works too, but if nothing it fails) PM3CXXFLAGS += -std=c++11 endif + # Qt built with reduce-relocations needs -fPIC (not -fPIE), also when CFLAGS is overridden + ifndef IS_WINDOWS + ifndef IS_DARWIN + PM3CFLAGS += -fPIC + PM3CXXFLAGS += -fPIC + endif + endif endif PM3CXXFLAGS += -DHAVE_SNPRINTF