ghc-7.4 on CentOS-5.8 ?
Dear all, I need a recent ghc on a not-so-recent (?) CentOS. The ghc binary package (7.2 or 7.4) does not work because of a mismatch in the libc version. ghc-7.0 is working but when I use it to compile 7.4, it breaks with some linker error (relocation R_X86_64_PC32 ...) it also suggests "recompile with -fPIC" but I don't see how. (In this particular case, I absolutely cannot change/update the OS.) Thanks, J.W.
Hi Johannes,
ghc-7.0 is working but when I use it to compile 7.4, it breaks with some linker error (relocation R_X86_64_PC32 ...) it also suggests "recompile with -fPIC" but I don't see how.
I seem to remember that this is a problem with the old version of GCC that's used to build the compiler. It can we avoided, though, by disabling optimizations. Try adding the following lines to a file called "mk/build.mk" before running the build: GhcLibWays = v SRC_HC_OPTS = -H64m -O0 -fasm # -O -H64m GhcStage1HcOpts = -O -fasm GhcStage2HcOpts = -O0 -fasm # -O2 -fasm GhcLibHcOpts = -O -fasm # -O2 -XGenerics GhcHcOpts = -Rghc-timing # GhcLibWays += p # GhcLibWays += dyn NoFibWays = STRIP_CMD = : I attached the RPM spec file that I used to build GHC 7.0.4 on CentOS. It's quite likely that you can use it to automate the 7.4.x build after editing some version numbers and file paths in it. Good luck! :-) Peter Name: ghc Version: 7.0.4 Release: 1 Summary: Glorious Haskell Compiler License: BSD Group: Compiler URL: http://haskell.org/ghc Prefix: /opt/ghc/7.0.4 BuildArch: x86_64 ExclusiveArch: x86_64 ExclusiveOS: Linux Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ghc == 6.12.3 BuildRequires: make BuildRequires: perl BuildRequires: python BuildRequires: gmp-devel BuildRequires: ncurses-devel BuildRequires: zlib-devel BuildRequires: gcc Requires: gmp-devel Requires: ncurses-devel Requires: zlib-devel Requires: gcc %description Glorious Haskell Compiler %clean %{__rm} -rf %{buildroot} %prep %setup %build cat >mk/build.mk <<EOF GhcLibWays = v SRC_HC_OPTS = -H64m -O0 -fasm # -O -H64m GhcStage1HcOpts = -O -fasm GhcStage2HcOpts = -O0 -fasm # -O2 -fasm GhcLibHcOpts = -O -fasm # -O2 -XGenerics GhcHcOpts = -Rghc-timing # GhcLibWays += p # GhcLibWays += dyn NoFibWays = STRIP_CMD = : EOF ./configure --prefix=%{prefix} --with-ghc=/opt/ghc/6.12.3/bin/ghc make %install %{__rm} -rf %{buildroot} make DESTDIR=%{buildroot} install %files %defattr(644,root,root,755) %dir %{prefix} %attr(755,root,root) %{prefix}/bin/ghc %attr(755,root,root) %{prefix}/bin/ghc-%{version} %attr(755,root,root) %{prefix}/bin/ghc-pkg %attr(755,root,root) %{prefix}/bin/ghc-pkg-%{version} %attr(755,root,root) %{prefix}/bin/ghci %attr(755,root,root) %{prefix}/bin/ghci-%{version} %attr(755,root,root) %{prefix}/bin/haddock %attr(755,root,root) %{prefix}/bin/haddock-ghc-%{version} %attr(755,root,root) %{prefix}/bin/hp2ps %attr(755,root,root) %{prefix}/bin/hpc %attr(755,root,root) %{prefix}/bin/hsc2hs %attr(755,root,root) %{prefix}/bin/runghc %attr(755,root,root) %{prefix}/bin/runhaskell %{prefix}/lib %{prefix}/share %attr(755,root,root) %{prefix}/lib/ghc-%{version}/ghc %attr(755,root,root) %{prefix}/lib/ghc-%{version}/ghc-pkg %attr(755,root,root) %{prefix}/lib/ghc-%{version}/haddock %attr(755,root,root) %{prefix}/lib/ghc-%{version}/hsc2hs %attr(755,root,root) %{prefix}/lib/ghc-%{version}/runghc %attr(755,root,root) %{prefix}/lib/ghc-%{version}/unlit %changelog
Here's the steps I had to go go to get ghc7.0 working on RHEL 5.6: http://twdkz.wordpress.com/2011/12/21/installing-ghc-7-0-3-and-the-haskell-p... I expect that the same steps will work for ghc 7.4. I need to use a more recent version of gcc that than supplied with RHEL5.6. Tim On 27/06/2012, at 5:33 PM, Johannes Waldmann wrote:
Dear all,
I need a recent ghc on a not-so-recent (?) CentOS.
The ghc binary package (7.2 or 7.4) does not work because of a mismatch in the libc version.
ghc-7.0 is working but when I use it to compile 7.4, it breaks with some linker error (relocation R_X86_64_PC32 ...) it also suggests "recompile with -fPIC" but I don't see how.
(In this particular case, I absolutely cannot change/update the OS.)
Thanks, J.W.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Johannes, This worked for me: http://justhub.org/download Adit On Wed, Jun 27, 2012 at 4:05 PM, Tim Docker <twd2@dockerz.net> wrote:
Here's the steps I had to go go to get ghc7.0 working on RHEL 5.6:
http://twdkz.wordpress.com/2011/12/21/installing-ghc-7-0-3-and-the-haskell-p...
I expect that the same steps will work for ghc 7.4. I need to use a more recent version of gcc that than supplied with RHEL5.6.
Tim
On 27/06/2012, at 5:33 PM, Johannes Waldmann wrote:
Dear all,
I need a recent ghc on a not-so-recent (?) CentOS.
The ghc binary package (7.2 or 7.4) does not work because of a mismatch in the libc version.
ghc-7.0 is working but when I use it to compile 7.4, it breaks with some linker error (relocation R_X86_64_PC32 ...) it also suggests "recompile with -fPIC" but I don't see how.
(In this particular case, I absolutely cannot change/update the OS.)
Thanks, J.W.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- adit.io
Whether you are trying to build your own GHC compilers on CentOS 5 or just get a working GHC, http://justhub.org/download is a good place to start as you will be able to get a variety of compilers and platforms and the GCC and binutils packages used to build them (installed in /usr/hs/gcc and /usr/hs/binutils). Chris From: haskell-cafe-bounces@haskell.org [mailto:haskell-cafe-bounces@haskell.org] On Behalf Of aditya bhargava Sent: 28 June 2012 01:23 To: Tim Docker Cc: Johannes Waldmann; haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] ghc-7.4 on CentOS-5.8 ? Johannes, This worked for me: http://justhub.org/download Adit On Wed, Jun 27, 2012 at 4:05 PM, Tim Docker <twd2@dockerz.net> wrote: Here's the steps I had to go go to get ghc7.0 working on RHEL 5.6: http://twdkz.wordpress.com/2011/12/21/installing-ghc-7-0-3-and-the-haskell-p latform-on-rhel-5-6/ I expect that the same steps will work for ghc 7.4. I need to use a more recent version of gcc that than supplied with RHEL5.6. Tim On 27/06/2012, at 5:33 PM, Johannes Waldmann wrote:
Dear all,
I need a recent ghc on a not-so-recent (?) CentOS.
The ghc binary package (7.2 or 7.4) does not work because of a mismatch in the libc version.
ghc-7.0 is working but when I use it to compile 7.4, it breaks with some linker error (relocation R_X86_64_PC32 ...) it also suggests "recompile with -fPIC" but I don't see how.
(In this particular case, I absolutely cannot change/update the OS.)
Thanks, J.W.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- adit.io
Tim Docker <twd2 <at> dockerz.net> writes:
I need to use a more recent version of gcc
Thanks! Yes, that seems to be it. When building gcc didn't work, it took me a while to figure out that I was running into this bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51935 so I am using mpfr-3.0.1 (instead of 3.1.0).
participants (5)
-
aditya bhargava -
Chris Dornan -
Johannes Waldmann -
Peter Simons -
Tim Docker