On 32-bit platforms, add a bunch of symbols from libgcc.a used to
support 64-bit arithmetic.
It looks like these symbols are defined in libc on some platforms but
not others, but it shouldn't do any harm to include them in the list
of symbols that the linker knows about even if they're also in libc.
They were already included for some platforms (cygwin, mingw, and
darwin), this commit just includes then whenever we're compiling with
gcc on a 32-bit platform.
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: Linker.c,v 1.117 2003/03/31 12:35:21 simonmar Exp $
+ * $Id: Linker.c,v 1.118 2003/03/31 14:02:32 simonmar Exp $
*
* (c) The GHC Team, 2000-2003
*
*
* (c) The GHC Team, 2000-2003
*
SymX(uname) \
SymX(unlink) \
SymX(utime) \
SymX(uname) \
SymX(unlink) \
SymX(utime) \
- SymX(waitpid) \
- Sym(__divdi3) \
- Sym(__udivdi3) \
- Sym(__moddi3) \
- Sym(__umoddi3)
#elif !defined(mingw32_TARGET_OS)
#define RTS_MINGW_ONLY_SYMBOLS /**/
#elif !defined(mingw32_TARGET_OS)
#define RTS_MINGW_ONLY_SYMBOLS /**/
Sym(opendir) \
Sym(readdir) \
Sym(rewinddir) \
Sym(opendir) \
Sym(readdir) \
Sym(rewinddir) \
- Sym(closedir) \
- Sym(__divdi3) \
- Sym(__udivdi3) \
- Sym(__moddi3) \
- Sym(__umoddi3)
#define RTS_LONG_LONG_SYMS /* nothing */
#endif
#define RTS_LONG_LONG_SYMS /* nothing */
#endif
-#ifdef ia64_TARGET_ARCH
-/* force these symbols to be present */
-#define RTS_EXTRA_SYMBOLS \
- Sym(__divsf3)
-#elif defined(powerpc_TARGET_ARCH)
-#define RTS_EXTRA_SYMBOLS \
+// 64-bit support functions in libgcc.a
+#if defined(__GNUC__) && SIZEOF_VOID_P <= 4
+#define RTS_LIBGCC_SYMBOLS \
Sym(__divdi3) \
Sym(__udivdi3) \
Sym(__moddi3) \
Sym(__divdi3) \
Sym(__udivdi3) \
Sym(__moddi3) \
Sym(__ashrdi3) \
Sym(__lshrdi3) \
Sym(__eprintf)
Sym(__ashrdi3) \
Sym(__lshrdi3) \
Sym(__eprintf)
+#else
+#define RTS_LIBGCC_SYMBOLS
+#endif
+
+#ifdef ia64_TARGET_ARCH
+/* force these symbols to be present */
+#define RTS_EXTRA_SYMBOLS \
+ Sym(__divsf3)
+#elif defined(powerpc_TARGET_ARCH)
// Symbols that don't have a leading underscore
// on Mac OS X. They have to receive special treatment,
// see machoInitSymbolsWithoutUnderscore()
// Symbols that don't have a leading underscore
// on Mac OS X. They have to receive special treatment,
// see machoInitSymbolsWithoutUnderscore()
RTS_POSIX_ONLY_SYMBOLS
RTS_MINGW_ONLY_SYMBOLS
RTS_CYGWIN_ONLY_SYMBOLS
RTS_POSIX_ONLY_SYMBOLS
RTS_MINGW_ONLY_SYMBOLS
RTS_CYGWIN_ONLY_SYMBOLS
#undef Sym
#undef SymX
#undef SymX_redirect
#undef Sym
#undef SymX
#undef SymX_redirect
RTS_POSIX_ONLY_SYMBOLS
RTS_MINGW_ONLY_SYMBOLS
RTS_CYGWIN_ONLY_SYMBOLS
RTS_POSIX_ONLY_SYMBOLS
RTS_MINGW_ONLY_SYMBOLS
RTS_CYGWIN_ONLY_SYMBOLS
{ 0, 0 } /* sentinel */
};
{ 0, 0 } /* sentinel */
};