diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-06-12 21:45:10 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-06-12 21:45:10 +0000 |
commit | 92773db48eb6be7bc3ef12f44e4b163a7f5e0af3 (patch) | |
tree | 7a5097716ad65c0899d917a25379131e26a7e47b /include/features.h | |
parent | 23f586ed1edb81cea7c976eb1f2354ab24294908 (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/features.h')
-rw-r--r-- | include/features.h | 23 |
1 files changed, 17 insertions, 6 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 |