From c724e848734322d92ae288b49cc49342641ca7b3 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 9 Aug 2024 07:45:29 -0400 Subject: [PATCH] MT#55283 add PIE build flags Fixes: /bin/ld: dynamic STT_GNU_IFUNC symbol `s16_mix_in.lto_priv.234' with pointer equality in `/tmp/ccDfEly2.ltrans2.ltrans.o' can not be used when making an executable; recompile with -fPIE and relink with -pie closes #1846 Change-Id: Ic31f2e064e88bc931f3438eff7b362ad611b7d84 (cherry picked from commit d9c27af99d178e7e25c8b630a6654659c4dbfcda) --- lib/common.Makefile | 3 +++ t/Makefile | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/common.Makefile b/lib/common.Makefile index 187753857..b3608f3a2 100644 --- a/lib/common.Makefile +++ b/lib/common.Makefile @@ -1,5 +1,8 @@ include ../lib/lib.Makefile +CFLAGS += -fPIE +LDFLAGS += -pie + all: $(MAKE) $(TARGET) $(MANS) diff --git a/t/Makefile b/t/Makefile index 3afe915a5..fdcbb3762 100644 --- a/t/Makefile +++ b/t/Makefile @@ -254,10 +254,10 @@ PRELOAD_CFLAGS += -D_GNU_SOURCE -std=c11 PRELOAD_LIBS += -ldl tests-preload.so: tests-preload.c - $(CC) $(PRELOAD_CFLAGS) -o $@ -shared -fPIC $< $(LDFLAGS) $(PRELOAD_LIBS) + $(CC) $(PRELOAD_CFLAGS) -o $@ -shared -fPIC $< $(PRELOAD_LIBS) time-fudge-preload.so: time-fudge-preload.c - $(CC) $(PRELOAD_CFLAGS) -o $@ -shared -fPIC $< $(LDFLAGS) $(PRELOAD_LIBS) + $(CC) $(PRELOAD_CFLAGS) -o $@ -shared -fPIC $< $(PRELOAD_LIBS) spandsp_send_fax_pcm.c: spandsp_logging.h spandsp_send_fax_t38.c: spandsp_logging.h