summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-06-12 21:45:10 +0000
committerEric Andersen <andersen@codepoet.org>2001-06-12 21:45:10 +0000
commit92773db48eb6be7bc3ef12f44e4b163a7f5e0af3 (patch)
tree7a5097716ad65c0899d917a25379131e26a7e47b /include
parent23f586ed1edb81cea7c976eb1f2354ab24294908 (diff)
Cleanup the toploevel makefile handing of shared libs. Add weak_alias
define, and set things up so nasty old coff toolchains can now compile things and should actually work again. -Erik
Diffstat (limited to 'include')
-rw-r--r--include/features.h23
-rw-r--r--include/unistd.h6
2 files changed, 18 insertions, 11 deletions
diff --git a/include/features.h b/include/features.h
index 54330dae9..af64066d9 100644
--- a/include/features.h
+++ b/include/features.h
@@ -45,6 +45,10 @@
# define __restrict /* Ignore */
#endif
+/* __extension__ is known in gcc 2.8 above. */
+#if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
+# define __extension__ /* Ignore */
+#endif
#ifdef __STDC__
@@ -105,13 +109,20 @@
#undef __need_uClibc_config_h
-#if 1 /* This only works with GNU ld, but that is what we use 'round these parts */
-#define link_warning(symbol, msg) \
-asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \
-static const char __evoke_link_warning_##symbol[] \
-__attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
+/* Some nice features only work properly with ELF */
+#if defined HAVE_ELF
+# define link_warning(symbol, msg) \
+ asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \
+ static const char __evoke_link_warning_##symbol[] \
+ __attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
+# define weak_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
#else
-# define link_warning(symbol, msg)
+# define link_warning(symbol, msg) \
+ asm (".stabs \"" msg "\",30,0,0,0\n\t" \
+ ".stabs \"" #symbol "\",1,0,0,0\n");
+# define weak_alias(name, aliasname) \
+ __asm__(".global alias\n.set alias,original");
#endif
diff --git a/include/unistd.h b/include/unistd.h
index 16deb1ac3..b13d0c1f1 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -649,7 +649,7 @@ extern int setegid __P ((__gid_t __gid));
#ifdef __UCLIBC_HAS_MMU__
extern __pid_t fork __P ((void));
#else
-#define fork fork_not_available_on_mmuless_systems
+#define fork fork_not_available_on_mmuless_systems__use_vfork
#endif
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
@@ -1008,10 +1008,6 @@ extern int pthread_atfork __P ((void (*__prepare) (void),
void (*__child) (void)));
#endif
-#ifdef __VFORK_MACRO__
-#include <bits/vfork.h>
-#endif
-
__END_DECLS
#endif /* unistd.h */