Bug#1107632: libscrypt FTBFS on hppa due to missing fPIC flag
Package: libscrypt
Version: 1.22-1
Tags: patch
Usertags: hppa
Package fails to build from source because of this error:
/usr/bin/ld: sha256.o: relocation R_PARISC_DPREL21L can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: BFD (GNU Binutils for Debian) 2.44 internal error, aborting at ../../bfd/elf32-hppa.c:3905 in elf32_hppa_relocate_section
The patch below fixes it.
Can you apply if you think this is the correct solution?
Thanks,
Helge
diff -up ./Makefile.org ./Makefile
--- ./Makefile.org 2025-06-10 22:15:27.029856275 +0000
+++ ./Makefile 2025-06-10 22:12:26.894502911 +0000
@@ -5,7 +5,7 @@ MAKE_DIR ?= install -d
INSTALL_DATA ?= install
CC?=gcc
-CFLAGS?=$(CFLAGS_EXTRA) -D_FORTIFY_SOURCE=2 -fPIC
+CFLAGS+=$(CFLAGS_EXTRA) -D_FORTIFY_SOURCE=2 -fPIC
LDFLAGS?=$(LDFLAGS_EXTRA) -Wl,-soname,libscrypt.so.0 -Wl,--version-script=libscrypt.version
CFLAGS_EXTRA?=-Wl,-rpath=. -O2 -Wall -g -fstack-protector
LDFLAGS_EXTRA?=-Wl,-z,relro
Reply to: