summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/arch/i386/include/bits/compiler.h14
-rw-r--r--src/libgcc/__divdi3.c2
-rw-r--r--src/libgcc/__moddi3.c2
-rw-r--r--src/libgcc/__udivdi3.c2
-rw-r--r--src/libgcc/__udivmoddi4.c2
-rw-r--r--src/libgcc/__umoddi3.c2
-rw-r--r--src/libgcc/libgcc.h24
7 files changed, 25 insertions, 23 deletions
diff --git a/src/arch/i386/include/bits/compiler.h b/src/arch/i386/include/bits/compiler.h
index af796069..119a9a21 100644
--- a/src/arch/i386/include/bits/compiler.h
+++ b/src/arch/i386/include/bits/compiler.h
@@ -6,6 +6,20 @@
/** Declare a function with standard calling conventions */
#define __asmcall __attribute__ (( cdecl, regparm(0) ))
+/**
+ * Declare a function with libgcc implicit linkage
+ *
+ * It seems as though gcc expects its implicit arithmetic functions to
+ * be cdecl, even if -mrtd is specified. This is somewhat
+ * inconsistent; for example, if -mregparm=3 is used then the implicit
+ * functions do become regparm(3).
+ *
+ * The implicit calls to memcpy() and memset() which gcc can generate
+ * do not seem to have this inconsistency; -mregparm and -mrtd affect
+ * them in the same way as any other function.
+ */
+#define __libgcc __attribute__ (( cdecl ))
+
#endif /* ASSEMBLY */
#endif /* _BITS_COMPILER_H */
diff --git a/src/libgcc/__divdi3.c b/src/libgcc/__divdi3.c
index 36f0b37f..7097b11e 100644
--- a/src/libgcc/__divdi3.c
+++ b/src/libgcc/__divdi3.c
@@ -4,7 +4,7 @@
#include "libgcc.h"
-LIBGCC int64_t __divdi3(int64_t num, int64_t den)
+__libgcc int64_t __divdi3(int64_t num, int64_t den)
{
int minus = 0;
int64_t v;
diff --git a/src/libgcc/__moddi3.c b/src/libgcc/__moddi3.c
index eb7784b7..d671bbc4 100644
--- a/src/libgcc/__moddi3.c
+++ b/src/libgcc/__moddi3.c
@@ -4,7 +4,7 @@
#include "libgcc.h"
-LIBGCC int64_t __moddi3(int64_t num, int64_t den)
+__libgcc int64_t __moddi3(int64_t num, int64_t den)
{
int minus = 0;
int64_t v;
diff --git a/src/libgcc/__udivdi3.c b/src/libgcc/__udivdi3.c
index 9ae0c3dc..f5a14de2 100644
--- a/src/libgcc/__udivdi3.c
+++ b/src/libgcc/__udivdi3.c
@@ -4,7 +4,7 @@
#include "libgcc.h"
-LIBGCC uint64_t __udivdi3(uint64_t num, uint64_t den)
+__libgcc uint64_t __udivdi3(uint64_t num, uint64_t den)
{
return __udivmoddi4(num, den, NULL);
}
diff --git a/src/libgcc/__udivmoddi4.c b/src/libgcc/__udivmoddi4.c
index 59966edb..21e0d51f 100644
--- a/src/libgcc/__udivmoddi4.c
+++ b/src/libgcc/__udivmoddi4.c
@@ -1,6 +1,6 @@
#include "libgcc.h"
-LIBGCC uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
+__libgcc uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
{
uint64_t quot = 0, qbit = 1;
diff --git a/src/libgcc/__umoddi3.c b/src/libgcc/__umoddi3.c
index f6c76cb6..fb4da991 100644
--- a/src/libgcc/__umoddi3.c
+++ b/src/libgcc/__umoddi3.c
@@ -4,7 +4,7 @@
#include "libgcc.h"
-LIBGCC uint64_t __umoddi3(uint64_t num, uint64_t den)
+__libgcc uint64_t __umoddi3(uint64_t num, uint64_t den)
{
uint64_t v;
diff --git a/src/libgcc/libgcc.h b/src/libgcc/libgcc.h
index 5b4a6244..d3e9bdd7 100644
--- a/src/libgcc/libgcc.h
+++ b/src/libgcc/libgcc.h
@@ -4,23 +4,11 @@
#include <stdint.h>
#include <stddef.h>
-/*
- * It seems as though gcc expects its implicit arithmetic functions to
- * be cdecl, even if -mrtd is specified. This is somewhat
- * inconsistent; for example, if -mregparm=3 is used then the implicit
- * functions do become regparm(3).
- *
- * The implicit calls to memcpy() and memset() which gcc can generate
- * do not seem to have this inconsistency; -mregparm and -mrtd affect
- * them in the same way as any other function.
- *
- */
-#define LIBGCC __attribute__ (( cdecl ))
-
-extern LIBGCC uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem);
-extern LIBGCC uint64_t __udivdi3(uint64_t num, uint64_t den);
-extern LIBGCC uint64_t __umoddi3(uint64_t num, uint64_t den);
-extern LIBGCC int64_t __divdi3(int64_t num, int64_t den);
-extern LIBGCC int64_t __moddi3(int64_t num, int64_t den);
+extern __libgcc uint64_t __udivmoddi4 ( uint64_t num, uint64_t den,
+ uint64_t *rem );
+extern __libgcc uint64_t __udivdi3 (uint64_t num, uint64_t den );
+extern __libgcc uint64_t __umoddi3 ( uint64_t num, uint64_t den );
+extern __libgcc int64_t __divdi3 ( int64_t num, int64_t den );
+extern __libgcc int64_t __moddi3 ( int64_t num, int64_t den );
#endif /* _LIBGCC_H */