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

GHC ghc-devs at haskell.org
Tue Sep 16 16:07:51 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:  6086
  GHC failed                         |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 I fear it might be difficult, when building the Linux/x86 GHC on an
 Linux/x86 system, to anticipate all the possible systems that might be
 capable of building and running Linux/x86 executables (at least
 Linux/x86_64, but possibly others now or in the future?), and what
 command-line options the C toolchain needs to build such executables.

 But here is a slightly different suggestion. Inside
 `$PREFIX/lib/ghc-7.8.3` you will find a file `settings`, which contains
 (among other things) the options that GHC passes to the C compiler,
 linker, etc. GHC reads this file at startup, so you can change any of
 these settings just by editing the file. Can you see if it is possible to
 effect all of your needed options like `-optc=-m32` via changes to this
 `settings` file? Those options should be respected by other Haskell tools
 like cabal and hsc2hs, so this may fix your other issues automatically.
 (If those tools do not respect these settings, it is probably a bug in
 those tools that should be fixed.)

 If it's not possible because you need (for example) a new setting
 `"assembler flags"`, it should be fairly easy to add such settings to this
 file.

 If the needed changes can be made through the `settings` file, then we
 won't need to modify GHC itself at all, and we can have the binary
 distribution `configure` script automatically detect that you are trying
 to install an x86 GHC on an x86_64 system, and modify the `settings` file
 accordingly.

 (By the way I'm a bit confused by your option `-optl-m32`, because my
 linker doesn't have a `-m32` option, only `-melf_i386`. Does that
 `-optl-m32` really do anything?)

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


More information about the ghc-tickets mailing list