mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 12:11:08 +01:00
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. Discussed with: bf MFC after: 2 weeks
This commit is contained in:
parent
93c26de0ad
commit
bd4632e6ca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228307
@ -7,6 +7,7 @@ SUBDIR= engines
|
||||
|
||||
LIB= crypto
|
||||
SHLIB_MAJOR= 6
|
||||
ALLOW_SHARED_TEXTREL=
|
||||
|
||||
NO_LINT=
|
||||
|
||||
|
@ -167,6 +167,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
|
||||
@ -178,11 +183,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
|
||||
|
Loading…
Reference in New Issue
Block a user