Browse Source

[libgcc] Make __libgcc architecture-specific

tags/v0.9.6
Michael Brown 16 years ago
parent
commit
849e4b12d6

+ 14
- 0
src/arch/i386/include/bits/compiler.h View File

@@ -6,6 +6,20 @@
6 6
 /** Declare a function with standard calling conventions */
7 7
 #define __asmcall __attribute__ (( cdecl, regparm(0) ))
8 8
 
9
+/**
10
+ * Declare a function with libgcc implicit linkage
11
+ *
12
+ * It seems as though gcc expects its implicit arithmetic functions to
13
+ * be cdecl, even if -mrtd is specified.  This is somewhat
14
+ * inconsistent; for example, if -mregparm=3 is used then the implicit
15
+ * functions do become regparm(3).
16
+ *
17
+ * The implicit calls to memcpy() and memset() which gcc can generate
18
+ * do not seem to have this inconsistency; -mregparm and -mrtd affect
19
+ * them in the same way as any other function.
20
+ */
21
+#define __libgcc __attribute__ (( cdecl ))
22
+
9 23
 #endif /* ASSEMBLY */
10 24
 
11 25
 #endif /* _BITS_COMPILER_H */

+ 1
- 1
src/libgcc/__divdi3.c View File

@@ -4,7 +4,7 @@
4 4
 
5 5
 #include "libgcc.h"
6 6
 
7
-LIBGCC int64_t __divdi3(int64_t num, int64_t den)
7
+__libgcc int64_t __divdi3(int64_t num, int64_t den)
8 8
 {
9 9
   int minus = 0;
10 10
   int64_t v;

+ 1
- 1
src/libgcc/__moddi3.c View File

@@ -4,7 +4,7 @@
4 4
 
5 5
 #include "libgcc.h"
6 6
 
7
-LIBGCC int64_t __moddi3(int64_t num, int64_t den)
7
+__libgcc int64_t __moddi3(int64_t num, int64_t den)
8 8
 {
9 9
   int minus = 0;
10 10
   int64_t v;

+ 1
- 1
src/libgcc/__udivdi3.c View File

@@ -4,7 +4,7 @@
4 4
 
5 5
 #include "libgcc.h"
6 6
 
7
-LIBGCC uint64_t __udivdi3(uint64_t num, uint64_t den)
7
+__libgcc uint64_t __udivdi3(uint64_t num, uint64_t den)
8 8
 {
9 9
   return __udivmoddi4(num, den, NULL);
10 10
 }

+ 1
- 1
src/libgcc/__udivmoddi4.c View File

@@ -1,6 +1,6 @@
1 1
 #include "libgcc.h"
2 2
 
3
-LIBGCC uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
3
+__libgcc uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem_p)
4 4
 {
5 5
   uint64_t quot = 0, qbit = 1;
6 6
 

+ 1
- 1
src/libgcc/__umoddi3.c View File

@@ -4,7 +4,7 @@
4 4
 
5 5
 #include "libgcc.h"
6 6
 
7
-LIBGCC uint64_t __umoddi3(uint64_t num, uint64_t den)
7
+__libgcc uint64_t __umoddi3(uint64_t num, uint64_t den)
8 8
 {
9 9
   uint64_t v;
10 10
 

+ 6
- 18
src/libgcc/libgcc.h View File

@@ -4,23 +4,11 @@
4 4
 #include <stdint.h>
5 5
 #include <stddef.h>
6 6
 
7
-/*
8
- * It seems as though gcc expects its implicit arithmetic functions to
9
- * be cdecl, even if -mrtd is specified.  This is somewhat
10
- * inconsistent; for example, if -mregparm=3 is used then the implicit
11
- * functions do become regparm(3).
12
- *
13
- * The implicit calls to memcpy() and memset() which gcc can generate
14
- * do not seem to have this inconsistency; -mregparm and -mrtd affect
15
- * them in the same way as any other function.
16
- *
17
- */
18
-#define LIBGCC __attribute__ (( cdecl ))
19
-
20
-extern LIBGCC uint64_t __udivmoddi4(uint64_t num, uint64_t den, uint64_t *rem);
21
-extern LIBGCC uint64_t __udivdi3(uint64_t num, uint64_t den);
22
-extern LIBGCC uint64_t __umoddi3(uint64_t num, uint64_t den);
23
-extern LIBGCC int64_t __divdi3(int64_t num, int64_t den);
24
-extern LIBGCC int64_t __moddi3(int64_t num, int64_t den);
7
+extern __libgcc uint64_t __udivmoddi4 ( uint64_t num, uint64_t den,
8
+					uint64_t *rem );
9
+extern __libgcc uint64_t __udivdi3  (uint64_t num, uint64_t den );
10
+extern __libgcc uint64_t __umoddi3 ( uint64_t num, uint64_t den );
11
+extern __libgcc int64_t __divdi3 ( int64_t num, int64_t den );
12
+extern __libgcc int64_t __moddi3 ( int64_t num, int64_t den );
25 13
 
26 14
 #endif /* _LIBGCC_H */

Loading…
Cancel
Save