[GHC] #9421: Problems and workarounds when installing and using a 32bit GHC on 64bit Linux machine

GHC ghc-devs at haskell.org
Mon Sep 22 12:13:43 UTC 2014


#9421: Problems and workarounds when installing and using a 32bit GHC on 64bit
Linux machine
-------------------------------------+-------------------------------------
              Reporter:              |            Owner:  MikolajKonarski
  MikolajKonarski                    |           Status:  new
                  Type:  bug         |        Milestone:
              Priority:  normal      |          Version:  7.8.3
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  x86_64 (amd64)
      Operating System:  Linux       |       Difficulty:  Unknown
       Type of failure:  Installing  |       Blocked By:
  GHC failed                         |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by MikolajKonarski):

 I tried investigating why cabal ignores {{{"ld flags"}}} from the
 {{{$PREFIX/lib/ghc-7.8.3/settings}}} file. Cabal doesn't now about {{{"ld
 flags"}}}, but it does know about {{{"Ld Linker flags"}}}. However, just
 setting {{{"Ld Linker flags"}}} in the file doesn't help. I code-dived in
 GHC and it mentions each of the keys exactly once: in the template for the
 settings file

 {{{
 settings.in: ("ld flags", "@SettingsLdFlags@"),
 }}}

 and when dealing with commandline arguments

 {{{
 ghc/Main.hs-mode_flags =
 [...]
 ghc/Main.hs-  [ Flag k'                      (PassFlag (setMode
 (printSetting k)))
 ghc/Main.hs-  | k <- ["Project version",
 [...]
 ghc/Main.hs:          "Ld Linker flags"],
 }}}

 It seems the two keys are different things, from different namespaces ---
 almost all of the keys in {{{ghc/Main.h}}} differ from their
 {{{settings.in}}} wording.

 BTW, there is also a single possibily relevant comment in the cabal source
 code, but I hope the part about ld is outdated and, anyway, I don't
 understand it:

 {{{
 Cabal/Distribution/Simple.hs-  -- The C compiler's compilation and linker
 flags (e.g.
 Cabal/Distribution/Simple.hs:  -- "C compiler flags" and "Gcc Linker
 flags" from GHC) have already
 Cabal/Distribution/Simple.hs-  -- been merged into ccFlags, so we set both
 CFLAGS and LDFLAGS
 Cabal/Distribution/Simple.hs-  -- to ccFlags
 Cabal/Distribution/Simple.hs-  -- We don't try and tell configure which ld
 to use, as we don't have
 Cabal/Distribution/Simple.hs-  -- a way to pass its flags too
 }}}

 Looking at GHC code for other settings, I'd guess that GHC may not read
 and merge {{{"ld flags"}}} with other ld options (perhaps because it
 doesn't call ld, but cabal does?). And so cabal doesn't learn this part of
 ld setting from GHC. But the GHC source code naming of the gcc linker
 flags and the /usr/bin/ld flags is not easy to follow and sometimes the
 gcc linker flags seem to be used for the system linker, etc., so it's not
 obvious to me if GHC or cabal is to blame or both.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9421#comment:15>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list