diff options
| author | Alexander Kabaev <kan@FreeBSD.org> | 2009-06-28 23:51:39 +0000 |
|---|---|---|
| committer | Alexander Kabaev <kan@FreeBSD.org> | 2009-06-28 23:51:39 +0000 |
| commit | a162c9ae9c55a9593b15ef618f4df0a045e39dbd (patch) | |
| tree | 601ae0a8f92e47fd15b2574968520ee80c372d0e /gnu | |
| parent | 49c8326a790004bd9229fc97a07a40f874373bcf (diff) | |
Notes
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/lib/libgcc/Makefile | 8 | ||||
| -rw-r--r-- | gnu/lib/libssp/libssp_nonshared/Makefile | 2 | ||||
| -rw-r--r-- | gnu/usr.bin/cc/cc_tools/freebsd-native.h | 8 |
3 files changed, 16 insertions, 2 deletions
diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile index 49b96e6e3a03..65c99d05c845 100644 --- a/gnu/lib/libgcc/Makefile +++ b/gnu/lib/libgcc/Makefile @@ -6,6 +6,12 @@ LIB= gcc SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib +# +# libgcc is linked in last and thus cannot depend on ssp symbols coming +# from earlier libraries. Disable stack protection for this library. +# +WITHOUT_SSP= yes + .include <bsd.own.mk> .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" @@ -18,7 +24,7 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \ -I${.CURDIR}/../../usr.bin/cc/cc_tools LDFLAGS+= -nodefaultlibs -LDADD+= -lc +LDADD+= -lc -lssp_nonshared OBJS= # added to below in various ways depending on TARGET_ARCH diff --git a/gnu/lib/libssp/libssp_nonshared/Makefile b/gnu/lib/libssp/libssp_nonshared/Makefile index 1dcd54f6d557..94544951fdfd 100644 --- a/gnu/lib/libssp/libssp_nonshared/Makefile +++ b/gnu/lib/libssp/libssp_nonshared/Makefile @@ -13,6 +13,6 @@ SRCS= ssp-local.c CFLAGS+= -DHAVE_CONFIG_H CFLAGS+= -I${.CURDIR}/.. -I${GCCLIB}/libssp -I${GCCLIB}/include -CFLAGS+= -fPIC -DPIC +CFLAGS+= -fPIC -DPIC -fvisibility=hidden .include <bsd.lib.mk> diff --git a/gnu/usr.bin/cc/cc_tools/freebsd-native.h b/gnu/usr.bin/cc/cc_tools/freebsd-native.h index 6f7fd7b81f51..b9ddea131909 100644 --- a/gnu/usr.bin/cc/cc_tools/freebsd-native.h +++ b/gnu/usr.bin/cc/cc_tools/freebsd-native.h @@ -62,3 +62,11 @@ /* FreeBSD is 4.4BSD derived */ #define bsd4_4 + +/* + * Link in libssp_nonshared to get local hidden symbol for + * __stack_chk_fail_local into each binary that needs it. + * Linux does this with static part of their libc.so linker script, we reuse + * libssp_nonshared.a for the same purpose. + */ +#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}" |
