Fix build with recent binutils
Recent binutils considered the .gnu.warning.symbol section as a fatal error when run with --fatal-warnings which makes any users of "insecure" functions from libc failing to build with recent binutils. Introduce a new macro: LD_FATAL_WARNINGS=no to run ld(1) with --no-fatal-warnings for the users of "insecure" functions Differential Revision: https://reviews.freebsd.org/D1320
This commit is contained in:
@@ -15,6 +15,7 @@ SRCDIR= ${GCCLIB}/libssp
|
|||||||
|
|
||||||
LIB= ssp
|
LIB= ssp
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
|
LD_FATAL_WARNINGS= no
|
||||||
|
|
||||||
SRCS= ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
|
SRCS= ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
|
||||||
memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \
|
memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ CONTRIB= ${.CURDIR}/../../../contrib/bsnmp/lib
|
|||||||
|
|
||||||
LIB= bsnmp
|
LIB= bsnmp
|
||||||
SHLIB_MAJOR= 6
|
SHLIB_MAJOR= 6
|
||||||
|
LD_FATAL_WARNINGS= no
|
||||||
|
|
||||||
CFLAGS+= -I${CONTRIB} -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY
|
CFLAGS+= -I${CONTRIB} -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY
|
||||||
CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DQUADFMT='"llu"' -DQUADXFMT='"llx"'
|
CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DQUADFMT='"llu"' -DQUADXFMT='"llx"'
|
||||||
|
|||||||
+6
-1
@@ -207,7 +207,12 @@ _LIBS+= ${SHLIB_NAME}
|
|||||||
|
|
||||||
SOLINKOPTS= -shared -Wl,-x
|
SOLINKOPTS= -shared -Wl,-x
|
||||||
.if !defined(ALLOW_SHARED_TEXTREL)
|
.if !defined(ALLOW_SHARED_TEXTREL)
|
||||||
SOLINKOPTS+= -Wl,--fatal-warnings -Wl,--warn-shared-textrel
|
.if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no"
|
||||||
|
SOLINKOPTS+= -Wl,--no-fatal-warnings
|
||||||
|
.else
|
||||||
|
SOLINKOPTS+= -Wl,--fatal-warnings
|
||||||
|
.endif
|
||||||
|
SOLINKOPTS+= -Wl,--warn-shared-textrel
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
.if target(beforelinking)
|
.if target(beforelinking)
|
||||||
|
|||||||
Reference in New Issue
Block a user