Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Jun 2009 01:33:59 +0000 (UTC)
From:      Alexander Kabaev <kan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195152 - in head: . gnu/lib/libgcc gnu/lib/libssp/libssp_nonshared gnu/usr.bin/cc/cc_tools lib/libc lib/libc/sys libexec/rtld-elf
Message-ID:  <200906290133.n5T1Xx8g027068@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kan
Date: Mon Jun 29 01:33:59 2009
New Revision: 195152
URL: http://svn.freebsd.org/changeset/base/195152

Log:
  Back out previous revision until better tested fix is ready.
  
  Approved by: re (impliciti, by approving previos check-in)

Modified:
  head/Makefile.inc1
  head/gnu/lib/libgcc/Makefile
  head/gnu/lib/libssp/libssp_nonshared/Makefile
  head/gnu/usr.bin/cc/cc_tools/freebsd-native.h
  head/lib/libc/Makefile
  head/lib/libc/sys/Symbol.map
  head/lib/libc/sys/stack_protector.c
  head/libexec/rtld-elf/Makefile

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sun Jun 28 23:51:39 2009	(r195151)
+++ head/Makefile.inc1	Mon Jun 29 01:33:59 2009	(r195152)
@@ -1069,7 +1069,7 @@ libraries:
 #
 # static libgcc.a prerequisite for shared libc
 #
-_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc
+_prereq_libs= gnu/lib/libgcc
 
 # These dependencies are not automatically generated:
 #

Modified: head/gnu/lib/libgcc/Makefile
==============================================================================
--- head/gnu/lib/libgcc/Makefile	Sun Jun 28 23:51:39 2009	(r195151)
+++ head/gnu/lib/libgcc/Makefile	Mon Jun 29 01:33:59 2009	(r195152)
@@ -6,12 +6,6 @@ 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"
 
@@ -24,7 +18,7 @@ CFLAGS+=	-DIN_GCC -DIN_LIBGCC2 -D__GCC_F
 		-I${.CURDIR}/../../usr.bin/cc/cc_tools
 
 LDFLAGS+=	-nodefaultlibs
-LDADD+=		-lc -lssp_nonshared
+LDADD+=		-lc
 
 OBJS=		# added to below in various ways depending on TARGET_ARCH
 

Modified: head/gnu/lib/libssp/libssp_nonshared/Makefile
==============================================================================
--- head/gnu/lib/libssp/libssp_nonshared/Makefile	Sun Jun 28 23:51:39 2009	(r195151)
+++ head/gnu/lib/libssp/libssp_nonshared/Makefile	Mon Jun 29 01:33:59 2009	(r195152)
@@ -13,6 +13,6 @@ SRCS=	ssp-local.c
 
 CFLAGS+= -DHAVE_CONFIG_H
 CFLAGS+= -I${.CURDIR}/..  -I${GCCLIB}/libssp  -I${GCCLIB}/include
-CFLAGS+= -fPIC -DPIC -fvisibility=hidden
+CFLAGS+= -fPIC -DPIC
 
 .include <bsd.lib.mk>

Modified: head/gnu/usr.bin/cc/cc_tools/freebsd-native.h
==============================================================================
--- head/gnu/usr.bin/cc/cc_tools/freebsd-native.h	Sun Jun 28 23:51:39 2009	(r195151)
+++ head/gnu/usr.bin/cc/cc_tools/freebsd-native.h	Mon Jun 29 01:33:59 2009	(r195152)
@@ -62,11 +62,3 @@
 
 /* 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}"

Modified: head/lib/libc/Makefile
==============================================================================
--- head/lib/libc/Makefile	Sun Jun 28 23:51:39 2009	(r195151)
+++ head/lib/libc/Makefile	Mon Jun 29 01:33:59 2009	(r195152)
@@ -26,7 +26,7 @@ PRECIOUSLIB=
 #
 DPADD+=	${LIBGCC}
 LDFLAGS+= -nodefaultlibs
-LDADD+= -lgcc -lssp_nonshared
+LDADD+= -lgcc
 
 # Define (empty) variables so that make doesn't give substitution
 # errors if the included makefiles don't change these:

Modified: head/lib/libc/sys/Symbol.map
==============================================================================
--- head/lib/libc/sys/Symbol.map	Sun Jun 28 23:51:39 2009	(r195151)
+++ head/lib/libc/sys/Symbol.map	Mon Jun 29 01:33:59 2009	(r195152)
@@ -282,6 +282,7 @@ FBSD_1.0 {
 	socket;
 	socketpair;
 	__stack_chk_fail;
+	__stack_chk_fail_local;
 	__stack_chk_guard;
 	stat;
 	statfs;

Modified: head/lib/libc/sys/stack_protector.c
==============================================================================
--- head/lib/libc/sys/stack_protector.c	Sun Jun 28 23:51:39 2009	(r195151)
+++ head/lib/libc/sys/stack_protector.c	Mon Jun 29 01:33:59 2009	(r195152)
@@ -47,6 +47,7 @@ static void __guard_setup(void) __attrib
 static void __fail(const char *);
 void __stack_chk_fail(void);
 void __chk_fail(void);
+void __stack_chk_fail_local(void);
 
 /*LINTED used*/
 static void
@@ -108,4 +109,8 @@ __chk_fail(void)
 	__fail("buffer overflow detected; terminated");
 }
 
-__sym_compat(__stack_chk_fail_local, __stack_chk_fail, FBSD_1.0);
+void
+__stack_chk_fail_local(void)
+{
+	__stack_chk_fail();
+}

Modified: head/libexec/rtld-elf/Makefile
==============================================================================
--- head/libexec/rtld-elf/Makefile	Sun Jun 28 23:51:39 2009	(r195151)
+++ head/libexec/rtld-elf/Makefile	Mon Jun 29 01:33:59 2009	(r195152)
@@ -22,7 +22,7 @@ MLINKS=		rtld.1 ld-elf.so.1.1 \
 CFLAGS+=	-fpic -DPIC
 LDFLAGS+=	-shared -Wl,-Bsymbolic
 DPADD=		${LIBC_PIC}
-LDADD=		-lc_pic -lssp_nonshared
+LDADD=		-lc_pic
 
 .if ${MACHINE_ARCH} != "ia64"
 .if ${MK_SYMVER} == "yes"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906290133.n5T1Xx8g027068>