From owner-svn-src-projects@FreeBSD.ORG Wed Oct 14 08:49:39 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8397C106566B; Wed, 14 Oct 2009 08:49:39 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 71D2D8FC14; Wed, 14 Oct 2009 08:49:39 +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 n9E8nd42030646; Wed, 14 Oct 2009 08:49:39 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9E8ndpZ030645; Wed, 14 Oct 2009 08:49:39 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <200910140849.n9E8ndpZ030645@svn.freebsd.org> From: Roman Divacky Date: Wed, 14 Oct 2009 08:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198071 - projects/clangbsd/contrib/gcc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2009 08:49:39 -0000 Author: rdivacky Date: Wed Oct 14 08:49:38 2009 New Revision: 198071 URL: http://svn.freebsd.org/changeset/base/198071 Log: crtstuff.c fixes from llvm-gcc. this should prevent llvm optimizing out stuff which in turn prevents the csu from working. Modified: projects/clangbsd/contrib/gcc/crtstuff.c Modified: projects/clangbsd/contrib/gcc/crtstuff.c ============================================================================== --- projects/clangbsd/contrib/gcc/crtstuff.c Wed Oct 14 03:36:59 2009 (r198070) +++ projects/clangbsd/contrib/gcc/crtstuff.c Wed Oct 14 08:49:38 2009 (r198071) @@ -178,11 +178,23 @@ CTOR_LIST_BEGIN; static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_LIST__[1] +/* LLVM LOCAL begin */ +#ifdef __llvm__ + __attribute__ ((__used__, aligned(sizeof(func_ptr)))) +#else __attribute__ ((__unused__, aligned(sizeof(func_ptr)))) +#endif +/* LLVM LOCAL end */ = { (func_ptr) (-1) }; #else STATIC func_ptr __CTOR_LIST__[1] +/* LLVM LOCAL begin */ +#ifdef __llvm__ + __attribute__ ((__used__, section(".ctors"), aligned(sizeof(func_ptr)))) +#else __attribute__ ((__unused__, section(".ctors"), aligned(sizeof(func_ptr)))) +#endif +/* LLVM LOCAL end */ = { (func_ptr) (-1) }; #endif /* __CTOR_LIST__ alternatives */ @@ -191,11 +203,23 @@ DTOR_LIST_BEGIN; #elif defined(DTORS_SECTION_ASM_OP) asm (DTORS_SECTION_ASM_OP); STATIC func_ptr __DTOR_LIST__[1] +/* LLVM LOCAL begin */ +#ifdef __llvm__ + __attribute__ ((used, aligned(sizeof(func_ptr)))) +#else __attribute__ ((aligned(sizeof(func_ptr)))) +#endif +/* LLVM LOCAL end */ = { (func_ptr) (-1) }; #else STATIC func_ptr __DTOR_LIST__[1] +/* LLVM LOCAL begin */ +#ifdef __llvm__ + __attribute__((used, section(".dtors"), aligned(sizeof(func_ptr)))) +#else __attribute__((section(".dtors"), aligned(sizeof(func_ptr)))) +#endif +/* LLVM LOCAL end */ = { (func_ptr) (-1) }; #endif /* __DTOR_LIST__ alternatives */ @@ -203,7 +227,13 @@ STATIC func_ptr __DTOR_LIST__[1] /* Stick a label at the beginning of the frame unwind info so we can register and deregister it with the exception handling library code. */ STATIC EH_FRAME_SECTION_CONST char __EH_FRAME_BEGIN__[] +/* LLVM LOCAL begin */ +#ifdef __llvm__ + __attribute__((used, section(EH_FRAME_SECTION_NAME), aligned(4))) +#else __attribute__((section(EH_FRAME_SECTION_NAME), aligned(4))) +#endif +/* LLVM LOCAL end */ = { }; #endif /* USE_EH_FRAME_REGISTRY */ @@ -459,11 +489,23 @@ CTOR_LIST_END; static func_ptr force_to_data[1] __attribute__ ((__unused__)) = { }; asm (CTORS_SECTION_ASM_OP); STATIC func_ptr __CTOR_END__[1] +/* LLVM LOCAL begin */ +#ifdef __llvm__ + __attribute__((used, aligned(sizeof(func_ptr)))) +#else __attribute__((aligned(sizeof(func_ptr)))) +#endif +/* LLVM LOCAL end */ = { (func_ptr) 0 }; #else STATIC func_ptr __CTOR_END__[1] +/* LLVM LOCAL begin */ +#ifdef __llvm__ + __attribute__((used, section(".ctors"), aligned(sizeof(func_ptr)))) +#else __attribute__((section(".ctors"), aligned(sizeof(func_ptr)))) +#endif +/* LLVM LOCAL end */ = { (func_ptr) 0 }; #endif @@ -472,11 +514,24 @@ DTOR_LIST_END; #elif defined(DTORS_SECTION_ASM_OP) asm (DTORS_SECTION_ASM_OP); STATIC func_ptr __DTOR_END__[1] +/* LLVM LOCAL begin */ +#ifdef __llvm__ + __attribute__ ((__used__, aligned(sizeof(func_ptr)))) +#else __attribute__ ((unused, aligned(sizeof(func_ptr)))) +#endif +/* LLVM LOCAL end */ = { (func_ptr) 0 }; #else STATIC func_ptr __DTOR_END__[1] +/* LLVM LOCAL begin */ +#ifdef __llvm__ +/* FIXME: Remove when external weak linkage will be alive. */ + __attribute__((__used__, section(".dtors"), aligned(sizeof(func_ptr)))) +#else __attribute__((unused, section(".dtors"), aligned(sizeof(func_ptr)))) +#endif +/* LLVM LOCAL end */ = { (func_ptr) 0 }; #endif