From 4ff0f496a4204b01991bcc804217da9fc2e8bb49 Mon Sep 17 00:00:00 2001 From: Anari Jalakas Date: Thu, 8 Jan 2026 12:11:47 +0200 Subject: [PATCH] readline: add $(FPIC) to LDFLAGS Ensure -fPIC is passed during the linking stage to fix LTO build failures (relocation errors) on MIPS and other architectures. Fixes: #20436 Signed-off-by: Anari Jalakas Link: https://github.com/openwrt/openwrt/pull/21455 Signed-off-by: Hauke Mehrtens --- package/libs/readline/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/libs/readline/Makefile b/package/libs/readline/Makefile index 7962cf6340b..a067a516c60 100644 --- a/package/libs/readline/Makefile +++ b/package/libs/readline/Makefile @@ -57,7 +57,10 @@ CONFIGURE_VARS += \ bash_cv_termcap_lib=libncursesw TARGET_CFLAGS += $(FPIC) -HOST_CFLAGS += $(FPIC) +TARGET_LDFLAGS += $(FPIC) + +HOST_CFLAGS += $(HOST_FPIC) +HOST_LDFLAGS += $(HOST_FPIC) define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include -- 2.47.3