Add __attribute__ ((sysv_abi)) only if it's really needed.

Some compilers don't support it.
This commit is contained in:
Vladimir Serbinenko 2013-12-18 13:09:39 +01:00
parent 1962ed95cc
commit eba2afeda1
4 changed files with 24 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2013-12-18 Vladimir Serbinenko <phcoder@gmail.com>
Add __attribute__ ((sysv_abi)) only if it's really needed.
Some compilers don't support it.
2013-12-18 Vladimir Serbinenko <phcoder@gmail.com> 2013-12-18 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/lib/syslinux_parse.c: Declare timeout unsigned. * grub-core/lib/syslinux_parse.c: Declare timeout unsigned.

View file

@ -104,6 +104,14 @@ grub_memcpy (void *dest, const void *src, grub_size_t n)
#define GRUB_BUILTIN_ATTR #define GRUB_BUILTIN_ATTR
#endif #endif
#if defined(__x86_64__) && !defined (GRUB_UTIL)
#if defined (__MINGW32__) || defined (__CYGWIN__) || defined (__MINGW64__)
#define GRUB_ASM_ATTR __attribute__ ((sysv_abi))
#else
#define GRUB_ASM_ATTR
#endif
#endif
/* Prototypes for aliases. */ /* Prototypes for aliases. */
#ifndef GRUB_UTIL #ifndef GRUB_UTIL
int GRUB_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); int GRUB_BUILTIN_ATTR EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n);

View file

@ -21,7 +21,7 @@
typedef unsigned long grub_jmp_buf[8]; typedef unsigned long grub_jmp_buf[8];
int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE __attribute__ ((sysv_abi)); int grub_setjmp (grub_jmp_buf env) RETURNS_TWICE GRUB_ASM_ATTR;
void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn,sysv_abi)); void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)) GRUB_ASM_ATTR;
#endif /* ! GRUB_SETJMP_CPU_HEADER */ #endif /* ! GRUB_SETJMP_CPU_HEADER */

View file

@ -19,16 +19,18 @@
#ifndef GRUB_XEN_CPU_HYPERCALL_HEADER #ifndef GRUB_XEN_CPU_HYPERCALL_HEADER
#define GRUB_XEN_CPU_HYPERCALL_HEADER 1 #define GRUB_XEN_CPU_HYPERCALL_HEADER 1
int EXPORT_FUNC (grub_xen_sched_op) (int cmd, void *arg) __attribute__ ((sysv_abi)); #include <grub/misc.h>
int grub_xen_update_va_mapping (void *addr, uint64_t pte, uint64_t flags) __attribute__ ((sysv_abi));
int EXPORT_FUNC (grub_xen_event_channel_op) (int op, void *arg) __attribute__ ((sysv_abi)); int EXPORT_FUNC (grub_xen_sched_op) (int cmd, void *arg) GRUB_ASM_ATTR;
int grub_xen_update_va_mapping (void *addr, uint64_t pte, uint64_t flags) GRUB_ASM_ATTR;
int EXPORT_FUNC (grub_xen_event_channel_op) (int op, void *arg) GRUB_ASM_ATTR;
int grub_xen_mmuext_op (mmuext_op_t * ops, int grub_xen_mmuext_op (mmuext_op_t * ops,
unsigned int count, unsigned int count,
unsigned int *pdone, unsigned int foreigndom) __attribute__ ((sysv_abi)); unsigned int *pdone, unsigned int foreigndom) GRUB_ASM_ATTR;
int EXPORT_FUNC (grub_xen_mmu_update) (const struct mmu_update * reqs, int EXPORT_FUNC (grub_xen_mmu_update) (const struct mmu_update * reqs,
unsigned count, unsigned *done_out, unsigned count, unsigned *done_out,
unsigned foreigndom) __attribute__ ((sysv_abi)); unsigned foreigndom) GRUB_ASM_ATTR;
int EXPORT_FUNC (grub_xen_grant_table_op) (int, void *, int) __attribute__ ((sysv_abi)); int EXPORT_FUNC (grub_xen_grant_table_op) (int, void *, int) GRUB_ASM_ATTR;
#endif #endif