Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/csu/common Make with work with gcc 4.5 or clang.



details:   https://anonhg.NetBSD.org/src/rev/ccbe21a30868
branches:  trunk
changeset: 784415:ccbe21a30868
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jan 28 06:17:57 2013 +0000

description:
Make with work with gcc 4.5 or clang.

diffstat:

 lib/csu/common/crt0-common.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r bddc5199e3e0 -r ccbe21a30868 lib/csu/common/crt0-common.c
--- a/lib/csu/common/crt0-common.c      Mon Jan 28 06:16:05 2013 +0000
+++ b/lib/csu/common/crt0-common.c      Mon Jan 28 06:17:57 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crt0-common.c,v 1.10 2013/01/22 22:57:37 matt Exp $ */
+/* $NetBSD: crt0-common.c,v 1.11 2013/01/28 06:17:57 matt Exp $ */
 
 /*
  * Copyright (c) 1998 Christos Zoulas
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: crt0-common.c,v 1.10 2013/01/22 22:57:37 matt Exp $");
+__RCSID("$NetBSD: crt0-common.c,v 1.11 2013/01/28 06:17:57 matt Exp $");
 
 #include <sys/types.h>
 #include <sys/exec.h>
@@ -95,10 +95,17 @@
  * Since we don't need .init or .fini sections, just code them in C
  * to make life easier.
  */
+#if __GNUC_PREREQ__(4,5) || defined(__clang__)
+static const fptr_t init_array_start[1] __weak_reference(__init_array_start);
+static const fptr_t init_array_end[1] __weak_reference(__init_array_end);
+static const fptr_t fini_array_start[1] __weak_reference(__fini_array_start);
+static const fptr_t fini_array_end[1] __weak_reference(__fini_array_end);
+#else
 extern const fptr_t init_array_start[] __weak_reference(__init_array_start);
 extern const fptr_t init_array_end[] __weak_reference(__init_array_end);
 extern const fptr_t fini_array_start[] __weak_reference(__fini_array_start);
 extern const fptr_t fini_array_end[] __weak_reference(__fini_array_end);
+#endif
 
 static inline void
 _init(void)



Home | Main Index | Thread Index | Old Index