diff: remove libc6 handling.
Tyson Dowd
trd at cs.mu.OZ.AU
Thu May 28 15:16:46 AEST 1998
Hi,
Here's a removal of some code added a while ago.
===================================================================
Estimated hours taken: 1
Remove the libc6 detection routines. It appears the new upstream version
of Boehm GC handles this correctly now.
README.Linux:
Remove mention of the problem - it shouldn't happen anymore.
configure.in:
Remove the old mercury_boehm_gc
boehm_gc/os_dep.c:
Use the upstream method for checking for libc version using
__GLIBC__.
boehm_gc/mercury_boehm_gc_conf.h.in:
Remove this file, it is no longer necessary.
Index: README.Linux
===================================================================
RCS file: /home/staff/zs/imp/mercury/README.Linux,v
retrieving revision 1.9
diff -u -t -r1.9 README.Linux
--- README.Linux 1998/04/08 13:55:43 1.9
+++ README.Linux 1998/05/24 07:24:48
@@ -9,13 +9,6 @@
wrongly assume your Linux system uses ELF; if that happens, you will you
have to manually edit the EXT_FOR_SHARED_LIB variable in Mmake.common.
-There are some incompatibilities in different kernel versions and libc
-versions to do with the handling of signals. We had added some
-autoconfiguration code to try to detect which header files need to be
-included, but if you have trouble compiling boehm_gc/os_dep.c, try
-applying the patch below (and send us a bug report if you can).
-Just type `patch boehm_gc/os_dep.c < README.Linux'.
-
On Linux with ELF, shared libraries are supported. However, ELF shared
libraries require position-independent code, and (partly due to
limitations in our current compilation technology, but partly due to
Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.125
diff -u -t -r1.125 configure.in
--- configure.in 1998/03/30 05:22:15 1.125
+++ configure.in 1998/05/24 07:34:00
@@ -39,7 +39,7 @@
exit
fi
#-----------------------------------------------------------------------------#
-AC_CONFIG_HEADER(runtime/mercury_conf.h boehm_gc/mercury_boehm_gc_conf.h)
+AC_CONFIG_HEADER(runtime/mercury_conf.h)
AC_PREFIX_DEFAULT(/usr/local/mercury-`. ./VERSION; echo $VERSION`)
AC_CANONICAL_HOST
FULLARCH="$host"
@@ -1529,46 +1529,6 @@
# and `.o' files, then we should not remove the generated `.c'
# files in the library directory after building the `.o' files.
LIBRARY_RM_C=:
- ;;
-esac
-#-----------------------------------------------------------------------------#
-# The boehm_gc system doesn't use autoconf, but for cases like this,
-# it should.
-# Linux with libc6 souldn't use asm/sigcontext.h, but some versions of the
-# kernel with libc5 need it.
-case "$host" in
- *-*-linux|*-*-linux-gnu)
- AC_MSG_CHECKING(whether we need asm/sigcontext.h)
- AC_CACHE_VAL(mercury_linux_need_asm_sigcontext,
- AC_TRY_RUN([
- #include <asm/sigcontext.h>
- #include <signal.h>
- #include <linux/version.h>
- #if (LINUX_VERSION_CODE >= 0x20100)
- typedef struct sigcontext xxx;
- #else
- typedef struct sigcontext_struct xxx;
- #endif
- typedef void (* REAL_SIG_PF)(int, xxx);
-
- int main() {
- REAL_SIG_PF handler;
- xxx foo;
- if (0) {
- handler(0, foo);
- }
- exit(0);
- }], [mercury_linux_need_asm_sigcontext=yes],
- [mercury_linux_need_asm_sigcontext=no],
- [mercury_linux_need_asm_sigcontext=no])
- )
- AC_MSG_RESULT($mercury_linux_need_asm_sigcontext)
- if test $mercury_linux_need_asm_sigcontext = "yes"; then
- AC_DEFINE(MERCURY_LINUX_NEED_ASM_SIGCONTEXT)
- fi
- ;;
- *)
- mercury_linux_use_asm_signcontext=no
;;
esac
Index: boehm_gc/os_dep.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/boehm_gc/os_dep.c,v
retrieving revision 1.12
diff -u -t -r1.12 os_dep.c
--- os_dep.c 1998/02/11 03:57:56 1.12
+++ os_dep.c 1998/05/24 07:21:24
@@ -16,8 +16,10 @@
and the work-around for SIG_FILL on gnu-win32. -fjh. */
# include "gc_priv.h"
-# include "mercury_boehm_gc_conf.h"
+# include <stdio.h>
+# include <signal.h>
+
# if defined(LINUX) && !defined(POWERPC)
# include <linux/version.h>
# if (LINUX_VERSION_CODE <= 0x10400)
@@ -29,17 +31,18 @@
# include <asm/signal.h>
# undef __KERNEL__
# else
- /* This used to be conditional on (LINUX_VERSION_CODE < 0x20100), */
- /* but that is not the right test, since it is needed for at */
- /* least one 2.1.35 (LINUX_VERSION_CODE = 0x20103) release. */
- /* For the moment I'll just make it unconditional. If you get */
- /* a compilation error at the line below, just comment it out. */
- /* */
- /* 10-Feb-1998 Modified to use autoconf to handle this for */
- /* Mercury -- Tyson Dowd <trd at cs.mu.oz.au> */
-# ifdef MERCURY_LINUX_NEED_ASM_SIGCONTEXT
-# include <asm/sigcontext.h>
-# endif
+ /* Kernels prior to 2.1.1 defined struct sigcontext_struct instead of */
+ /* struct sigcontext. libc6 (glibc2) uses "struct sigcontext" in */
+ /* prototypes, so we have to include the top-level sigcontext.h to */
+ /* make sure the former gets defined to be the latter if appropriate. */
+# include <features.h>
+# if 2 <= __GLIBC__
+# include <sigcontext.h>
+# else /* not 2 <= __GLIBC__ */
+ /* libc5 doesn't have <sigcontext.h>: go directly with the kernel */
+ /* one. Check LINUX_VERSION_CODE to see which we should reference. */
+# include <asm/sigcontext.h>
+# endif /* 2 <= __GLIBC__ */
# endif
# endif
# if !defined(OS2) && !defined(PCR) && !defined(AMIGA) && !defined(MACOS)
--
Tyson Dowd # There isn't any reason why Linux can't be
# implemented as an enterprise computing solution.
trd at cs.mu.oz.au # Find out what you've been missing while you've
http://www.cs.mu.oz.au/~trd # been rebooting Windows NT. -- InfoWorld, 1998.
More information about the developers
mailing list