Module Name: src
Committed By: christos
Date: Fri Nov 1 23:06:17 UTC 2024
Modified Files:
src/share/mk: bsd.lib.mk
Log Message:
We need -fPIC too otherwise we end up with R_X86_64_PLT32 and not
R_X86_64_REX_GOTPCRELX and we can't build .so objects. I think we can
remove the -fPIE and use only -fPIC but this works for now.
To generate a diff of this commit:
cvs rdiff -u -r1.409 -r1.410 src/share/mk/bsd.lib.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/mk/bsd.lib.mk
diff -u src/share/mk/bsd.lib.mk:1.409 src/share/mk/bsd.lib.mk:1.410
--- src/share/mk/bsd.lib.mk:1.409 Thu Oct 31 17:53:40 2024
+++ src/share/mk/bsd.lib.mk Fri Nov 1 19:06:17 2024
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.lib.mk,v 1.409 2024/10/31 21:53:40 rillig Exp $
+# $NetBSD: bsd.lib.mk,v 1.410 2024/11/01 23:06:17 christos Exp $
# @(#)bsd.lib.mk 8.3 (Berkeley) 4/22/94
.include <bsd.init.mk>
@@ -57,6 +57,12 @@ realinstall: checkver libinstall
CFLAGS+= ${PIE_CFLAGS}
AFLAGS+= ${PIE_AFLAGS}
.endif
+# The -fPIC is needed for libraries that include other libares
+# The order matters here, PIC needs to be last
+.if ${LIBISPRIVATE} == "pic"
+CFLAGS+= -fPIC
+AFLAGS+= -fPIC
+.endif
PGFLAGS+= -pg
.if ${MKPIC} != "no"