svn commit: r229380 - in stable/9: secure/lib/libcrypto share/mk
Konstantin Belousov
kib at FreeBSD.org
Tue Jan 3 10:02:45 UTC 2012
Author: kib
Date: Tue Jan 3 10:02:44 2012
New Revision: 229380
URL: http://svn.freebsd.org/changeset/base/229380
Log:
MFC r228307:
Force linker error when created shared library contains a relocation
against text. Provide the override switch to turn off the strict
behaviour. Apparently, openssl libcrypto needs it due to assembler
code not being PIC.
Modified:
stable/9/secure/lib/libcrypto/Makefile
stable/9/share/mk/bsd.lib.mk
Directory Properties:
stable/9/secure/lib/libcrypto/ (props changed)
stable/9/share/mk/ (props changed)
Modified: stable/9/secure/lib/libcrypto/Makefile
==============================================================================
--- stable/9/secure/lib/libcrypto/Makefile Tue Jan 3 10:01:12 2012 (r229379)
+++ stable/9/secure/lib/libcrypto/Makefile Tue Jan 3 10:02:44 2012 (r229380)
@@ -7,6 +7,7 @@ SUBDIR= engines
LIB= crypto
SHLIB_MAJOR= 6
+ALLOW_SHARED_TEXTREL=
NO_LINT=
Modified: stable/9/share/mk/bsd.lib.mk
==============================================================================
--- stable/9/share/mk/bsd.lib.mk Tue Jan 3 10:01:12 2012 (r229379)
+++ stable/9/share/mk/bsd.lib.mk Tue Jan 3 10:02:44 2012 (r229380)
@@ -183,6 +183,11 @@ SOBJS+= ${OBJS:.o=.So}
.if defined(SHLIB_NAME)
_LIBS+= ${SHLIB_NAME}
+SOLINKOPTS= -shared -Wl,-x
+.if !defined(ALLOW_SHARED_TEXTREL)
+SOLINKOPTS+= -Wl,--fatal-warnings -Wl,--warn-shared-textrel
+.endif
+
.if target(beforelinking)
${SHLIB_NAME}: ${SOBJS} beforelinking
.else
@@ -194,11 +199,11 @@ ${SHLIB_NAME}: ${SOBJS}
@ln -fs ${.TARGET} ${SHLIB_LINK}
.endif
.if !defined(NM)
- @${CC} ${LDFLAGS} ${SSP_CFLAGS} -shared -Wl,-x \
+ @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
-o ${.TARGET} -Wl,-soname,${SONAME} \
`lorder ${SOBJS} | tsort -q` ${LDADD}
.else
- @${CC} ${LDFLAGS} ${SSP_CFLAGS} -shared -Wl,-x \
+ @${CC} ${LDFLAGS} ${SSP_CFLAGS} ${SOLINKOPTS} \
-o ${.TARGET} -Wl,-soname,${SONAME} \
`NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD}
.endif
More information about the svn-src-stable-9
mailing list