[PATCH 06/14] FreeBSD update of __strong_reference, etc.

Craig Howland howland@LGSInnovations.com
Wed Apr 17 15:19:00 GMT 2013


On 04/17/2013 09:16 AM, Sebastian Huber wrote:
> newlib/ChangeLog
> 2013-04-17  Sebastian Huber <sebastian.huber@embedded-brains.de>
>
> 	* libc/include/sys/cdefs.h (__strong_reference): Use definition
> 	of latest FreeBSD source.
Should the change log entry highlight that the __strong_reference change is such 
that the user will likely have to edit any code that uses it (given that a ; is 
removed)?  Perhaps something like "Potentially incompatible change, ; removed."?
> 	(__sym_compat): New define.
> 	(__sym_default): Likewise.
> ---
>   newlib/libc/include/sys/cdefs.h |   16 +++++++++++++---
>   1 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h
> index 1cae5ec..62c7aae 100644
> --- a/newlib/libc/include/sys/cdefs.h
> +++ b/newlib/libc/include/sys/cdefs.h
> @@ -223,9 +223,11 @@
>   #define	__DEQUALIFY(type, var)	((type)(uintptr_t)(const volatile void *)(var))
>   #endif
>   
> -#ifdef __GNUC__
> +#if defined(__GNUC__) || defined(__INTEL_COMPILER)
> +#ifndef __INTEL_COMPILER
>   #define	__strong_reference(sym,aliassym)	\
> -	extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
> +	extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
> +#endif
>   #ifdef __ELF__
>   #ifdef __STDC__
>   #define	__weak_reference(sym,alias)	\
> @@ -235,6 +237,10 @@
>   	__asm__(".section .gnu.warning." #sym);	\
>   	__asm__(".asciz \"" msg "\"");	\
>   	__asm__(".previous")
> +#define	__sym_compat(sym,impl,verid)	\
> +	__asm__(".symver " #impl ", " #sym "@" #verid)
> +#define	__sym_default(sym,impl,verid)	\
> +	__asm__(".symver " #impl ", " #sym "@@" #verid)
>   #else
>   #define	__weak_reference(sym,alias)	\
>   	__asm__(".weak alias");		\
> @@ -243,6 +249,10 @@
>   	__asm__(".section .gnu.warning.sym"); \
>   	__asm__(".asciz \"msg\"");	\
>   	__asm__(".previous")
> +#define	__sym_compat(sym,impl,verid)	\
> +	__asm__(".symver impl, sym@verid")
> +#define	__sym_default(impl,sym,verid)	\
> +	__asm__(".symver impl, sym@@verid")
>   #endif	/* __STDC__ */
>   #else	/* !__ELF__ */
>   #ifdef __STDC__
> @@ -261,6 +271,6 @@
>   	__asm__(".stabs \"_/**/sym\",1,0,0,0")
>   #endif	/* __STDC__ */
>   #endif	/* __ELF__ */
> -#endif	/* __GNUC__ */
> +#endif	/* __GNUC__ || __INTEL_COMPILER */
>   
>   #endif /* !_SYS_CDEFS_H_ */



More information about the Newlib mailing list