Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys While visibility "protected" is nominaly supported b...
details: https://anonhg.NetBSD.org/src/rev/6a3ff6179a58
branches: trunk
changeset: 787018:6a3ff6179a58
user: martin <martin%NetBSD.org@localhost>
date: Wed May 29 19:02:30 2013 +0000
description:
While visibility "protected" is nominaly supported by gcc 4.0 and 4.1
it does not actually work - the compiler does not emmit ".protected"
asm statements for used references to protected symbols, which then
causes the linker to fail and/or produce unloadable libraries.
This recently happened to port vax by the locale changes.
Backporting a fix (ASM_OUTPUT_EXTERNAL in gcc target config) is not
feasible.
So: define __dso_protected only starting with gcc 4.2.
diffstat:
sys/sys/cdefs.h | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r fa45e9ace971 -r 6a3ff6179a58 sys/sys/cdefs.h
--- a/sys/sys/cdefs.h Wed May 29 15:22:19 2013 +0000
+++ b/sys/sys/cdefs.h Wed May 29 19:02:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.106 2013/04/30 14:45:15 joerg Exp $ */
+/* $NetBSD: cdefs.h,v 1.107 2013/05/29 19:02:30 martin Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -281,7 +281,6 @@
#if __GNUC_PREREQ__(4, 0)
# define __dso_public __attribute__((__visibility__("default")))
# define __dso_hidden __attribute__((__visibility__("hidden")))
-# define __dso_protected __attribute__((__visibility__("protected")))
# define __BEGIN_PUBLIC_DECLS \
_Pragma("GCC visibility push(default)") __BEGIN_EXTERN_C
# define __END_PUBLIC_DECLS __END_EXTERN_C _Pragma("GCC visibility pop")
@@ -290,13 +289,17 @@
# define __END_HIDDEN_DECLS __END_EXTERN_C _Pragma("GCC visibility pop")
#else
# define __dso_public
-# define __dso_protected
# define __dso_hidden
# define __BEGIN_PUBLIC_DECLS __BEGIN_EXTERN_C
# define __END_PUBLIC_DECLS __END_EXTERN_C
# define __BEGIN_HIDDEN_DECLS __BEGIN_EXTERN_C
# define __END_HIDDEN_DECLS __END_EXTERN_C
#endif
+#if __GNUC_PREREQ__(4, 2)
+# define __dso_protected __attribute__((__visibility__("protected")))
+#else
+# define __dso_protected
+#endif
#define __BEGIN_DECLS __BEGIN_PUBLIC_DECLS
#define __END_DECLS __END_PUBLIC_DECLS
Home |
Main Index |
Thread Index |
Old Index