Permalink
Switch branches/tags
version-14_01_1 version-14_01 version-13_05_2 version-13_05_1 version-13_05 version-12_08-branchpoint version-12_08-GIT version-11_07_2 version-11_07_1 version-11_07 version-11_07-branchpoint version-11_01 version-11_01-branchpoint version-10_04_2 version-10_04_1 version-10_04 version-10_04-branchpoint version-0_13_1 version-0_13-branchpoint version-0_12_2 version-0_12_1 version-0_12-branchpoint version-0_11_0 version-0_11-branchpoint version-0_10 version-0_9_1 version-0_9 version-0_9_x-snapshot version-0_9_x-snapshot-19991220 unstable-version-0_13_1-x86_64-unknown-linux-gnu-libc2_3 unstable-version-0_13_1-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_13-branch-x86_64-unknown-linux-gnu-libc2_3 unstable-version-0_13-branch-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_12_2-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12_2-i386-pc-solaris2_8 unstable-version-0_12_1-i686-pc-linux-libc2_3-gnu-O4-intermod unstable-version-0_12_1-i686-pc-linux-libc2_3-gnu-O2 unstable-version-0_12_1-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12_1-i386-pc-solaris2_8 unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O5 unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O4-intermod unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O4-hlc unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O2 unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O5 unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O3 unstable-version-0_12-branch-i386-pc-solaris2_8 unstable-version-0_11_0-sparc-sun-solaris2_7 unstable-version-0_11_0-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5 unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-lcc unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-hlc unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4-asm unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O3 unstable-version-0_11_0-i386-pc-solaris2_8 unstable-version-0_11-branch-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-hlc unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-hlc unstable-version-0_11-branch-alpha-dec-osf5_1 unstable-version-0_10_y-sparc-sun-solaris2_7 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-intermod unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-hlc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O4-hlc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O2 unstable-version-0_10_y-i586-pc-linux-libc2_1-gnu-O0 unstable-version-0_10_y-alpha-dec-osf5_1 unstable-version-0_10_y-alpha-dec-osf3_2 unstable-version-0_10_x-sparc-sun-solaris2_7 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O4-hlc unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O3 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O2 unstable-version-0_10_x-i586-pc-linux-libc2_1-gnu-O0 unstable-version-0_10_x-alpha-dec-osf3_2 termination2_trunk stable-version-0_11_0-i686-pc-linux-libc2_3-gnu-O5-intermod stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5 stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-lcc stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-hlc stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4 stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4-asm stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O3 stable-version-0_11-branch-i686-pc-linux-libc2_3-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-lcc stable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5 stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-lcc stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-hlc stable-version-0_11-branch-alpha-dec-osf5_1
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
168 lines (138 sloc) 4.38 KB
This file documents how to use lcc 4.1 as the C compiler when
installing Mercury on Linux.
Some of the same issues may arise when using lcc on other systems,
or when using other versions of lcc.
1. You can get lcc from <http://www.cs.princeton.edu/software/lcc/>.
In particular Linux RPM's are available from
<ftp://ftp.cs.princeton.edu/pub/packages/lcc/contrib>.
2. Apply the following patches:
(i) On at least some versions of Linux, the following patch must be
applied to /usr/include/stdint.h. This is because the Boehm (et al)
collector uses elf.h, and the version of elf.h that gets installed on
Linux uses by default is not compatible with lcc -- it uses
typedefs defined as `long long' in stdint.h.
If you prefer you can copy stdint.h to /usr/local/lib/lcc-4.1/include
and then apply the patch there.
This should be fixed in newer versions of glibc.
--- /usr/include/stdint.h Sun Nov 7 03:23:27 1999
+++ ./stdint.h Tue Nov 21 05:25:39 2000
@@ -28,6 +28,22 @@
#include <stddef.h>
#include <bits/wordsize.h>
+#ifdef __GNUC__
+__extension__
+typedef long long __long_long;
+__extension__
+typedef unsigned long long __u_long_long;
+#else
+typedef struct {
+ long __ll_first;
+ long __ll_second;
+} __long_long;
+typedef struct {
+ unsigned long __ull_first;
+ unsigned long __ull_second;
+} __u_long_long;
+#endif
+
/* Exact integral types. */
/* Signed. */
@@ -42,8 +58,10 @@
typedef long int int64_t;
# else
__extension__
-typedef long long int int64_t;
+typedef __long_long int64_t;
# endif
+#else
+typedef __long_long int64_t;
#endif
/* Unsigned. */
@@ -54,7 +72,7 @@
typedef unsigned long int uint64_t;
#else
__extension__
-typedef unsigned long long int uint64_t;
+typedef __u_long_long uint64_t;
#endif
@@ -68,7 +86,7 @@
typedef long int int_least64_t;
#else
__extension__
-typedef long long int int_least64_t;
+typedef __long_long int_least64_t;
#endif
/* Unsigned. */
@@ -79,7 +97,7 @@
typedef unsigned long int uint_least64_t;
#else
__extension__
-typedef unsigned long long int uint_least64_t;
+typedef __u_long_long uint_least64_t;
#endif
@@ -95,7 +113,7 @@
typedef int int_fast16_t;
typedef int int_fast32_t;
__extension__
-typedef long long int int_fast64_t;
+typedef __long_long int_fast64_t;
#endif
/* Unsigned. */
@@ -108,7 +126,7 @@
typedef unsigned int uint_fast16_t;
typedef unsigned int uint_fast32_t;
__extension__
-typedef unsigned long long int uint_fast64_t;
+typedef __u_long_long uint_fast64_t;
#endif
@@ -134,9 +152,9 @@
typedef unsigned long int uintmax_t;
#else
__extension__
-typedef long long int intmax_t;
+typedef __long_long intmax_t;
__extension__
-typedef unsigned long long int uintmax_t;
+typedef __u_long_long uintmax_t;
#endif
(ii) On some versions of Linux, the following patch must be
applied to /usr/local/lib/lcc-4.1/include/stdio.h.
This is due to an incompatibility between glibc's <sys/types.h>
and lcc's <stdio.h>.
--- stdio.h.orig Thu Jul 6 10:12:07 2000
+++ stdio.h Sun Feb 4 18:33:46 2001
@@ -444,18 +444,20 @@
are originally defined in the Large File Support API. */
/* Types needed in these functions. */
-#ifndef off_t
+#if !defined off_t && !defined __off_t_defined
# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
# else
typedef __off64_t off_t;
# endif
# define off_t off_t
+# define __off_t_defined
#endif
-#if defined __USE_LARGEFILE64 && !defined off64_t
+#if defined __USE_LARGEFILE64 && !defined off64_t && !defined __off64_t_defined
typedef __off64_t off64_t;
# define off64_t off64_t
+# define __off64_t_defined
#endif
(iii) lcc 4.1 on at least some versions of Linux has a bug where
`lcc -static' is broken. To work around that, rename the
original `lcc' program as `lcc.orig' and replace it with the
following script:
#!/bin/sh
lcc.orig "$@" -lc -lgcc
This results in some spurious warnings when invoking `lcc -c ...',
but ensures that `lcc -static ...' works.
3. When invoking `configure', use the `--with-cc=lcc' option.
4. If you run into a fixed limit with lcc, it might be necessary
to pass the `--max-jump-table-size' to mmc, e.g. by putting
`EXTRA_MCFLAGS=--max-jump-table-size 100' in Mmake.params.
This requires recompiling the Mercury sources to C,
so you need to have a working Mercury compiler already installed
(e.g. one built using gcc instead of lcc).
5. Otherwise, follow the normal installation instructions in the INSTALL file.