From owner-svn-src-all@FreeBSD.ORG Tue Aug 24 00:23:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7D0610656AE; Tue, 24 Aug 2010 00:23:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB7858FC1A; Tue, 24 Aug 2010 00:23:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7O0Ne4B058067; Tue, 24 Aug 2010 00:23:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7O0Neq9058065; Tue, 24 Aug 2010 00:23:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201008240023.o7O0Neq9058065@svn.freebsd.org> From: Rui Paulo Date: Tue, 24 Aug 2010 00:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211729 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Aug 2010 00:23:41 -0000 Author: rpaulo Date: Tue Aug 24 00:23:40 2010 New Revision: 211729 URL: http://svn.freebsd.org/changeset/base/211729 Log: Mark the following static variables as __used__ instead of __unused__: o force_to_data o __CTOR_LIST__ o __do_global_dtors_aux_fini_array_entry o __frame_dummy_init_array_entry This is necessary because Clang is smart enough to optimize out these variables was they were marked as __unused__ (and they are also static). The end result was programs segfaulting because these symbols weren't present. This follows the upstream revision 159228 and the author of that revision (Jan Hubicka ) allowed us to backport this to our GPLv2 GCC. Discussed with: core Modified: head/contrib/gcc/crtstuff.c Modified: head/contrib/gcc/crtstuff.c ============================================================================== --- head/contrib/gcc/crtstuff.c Tue Aug 24 00:17:05 2010 (r211728) +++ head/contrib/gcc/crtstuff.c Tue Aug 24 00:23:40 2010 (r211729) @@ -175,14 +175,14 @@ CTOR_LIST_BEGIN; #elif defined(CTORS_SECTION_ASM_OP) /* Hack: force cc1 to switch to .data section early, so that assembling __CTOR_LIST__ does not undo our behind-the-back change to .ctors. */ -static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { }; +static func_ptr force_to_data[1] __attribute__ ((__used__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_LIST__[1] - __attribute__ ((__unused__, aligned(sizeof(func_ptr)))) + __attribute__ ((__used__, aligned(sizeof(func_ptr)))) = { (func_ptr) (-1) }; #else STATIC func_ptr __CTOR_LIST__[1] - __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr)))) + __attribute__ ((__used__, section(".ctors"), aligned(sizeof(func_ptr)))) = { (func_ptr) (-1) }; #endif /* __CTOR_LIST__ alternatives */ @@ -308,7 +308,7 @@ __do_global_dtors_aux (void) CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) #else /* !defined(FINI_SECTION_ASM_OP) */ static func_ptr __do_global_dtors_aux_fini_array_entry[] - __attribute__ ((__unused__, section(".fini_array"))) + __attribute__ ((__used__, section(".fini_array"))) = { __do_global_dtors_aux }; #endif /* !defined(FINI_SECTION_ASM_OP) */ @@ -348,7 +348,7 @@ frame_dummy (void) CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, frame_dummy) #else /* defined(INIT_SECTION_ASM_OP) */ static func_ptr __frame_dummy_init_array_entry[] - __attribute__ ((__unused__, section(".init_array"))) + __attribute__ ((__used__, section(".init_array"))) = { frame_dummy }; #endif /* !defined(INIT_SECTION_ASM_OP) */ #endif /* USE_EH_FRAME_REGISTRY || JCR_SECTION_NAME */ @@ -456,7 +456,7 @@ CTOR_LIST_END; #elif defined(CTORS_SECTION_ASM_OP) /* Hack: force cc1 to switch to .data section early, so that assembling __CTOR_LIST__ does not undo our behind-the-back change to .ctors. */ -static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { }; +static func_ptr force_to_data[1] __attribute__ ((__used__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_END__[1] __attribute__((aligned(sizeof(func_ptr))))