From 92773db48eb6be7bc3ef12f44e4b163a7f5e0af3 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 12 Jun 2001 21:45:10 +0000 Subject: 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 --- include/features.h | 23 +++++++++++++++++------ include/unistd.h | 6 +----- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'include') 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 -#endif - __END_DECLS #endif /* unistd.h */ -- cgit v1.2.3