[GHC] #898: GHC compiles against Apple's readline, giving error

GHC trac at galois.com
Sat Nov 25 15:33:30 EST 2006


#898: GHC compiles against Apple's readline, giving error
----------------------------+-----------------------------------------------
 Reporter:  doaitse         |          Owner:  thorkilnaur
     Type:  bug             |         Status:  new        
 Priority:  high            |      Milestone:  6.6.1      
Component:  Build System    |        Version:  6.5        
 Severity:  normal          |     Resolution:             
 Keywords:  "OS X" Sockets  |     Difficulty:  Unknown    
 Testcase:  N/A             |   Architecture:  x86        
       Os:  MacOS X         |  
----------------------------+-----------------------------------------------
Comment (by thorkilnaur):

 I cannot reproduce this under what I would consider fair circumstances.
 On Mac OS X 10.4, with the masquerading in place:
 {{{
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$ ls
 -l /usr/include/readline
 total 24
 lrwxr-xr-x   1 root  wheel    10 Nov 22 21:35 history.h -> readline.h
 -r--r--r--   1 root  wheel  6435 Dec 25  2005 readline.h
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$ ls
 -l /usr/lib/ | grep readline
 lrwxr-xr-x    1 root  wheel        13 Nov 22 20:16 libreadline.dylib ->
 libedit.dylib
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$
 }}}
 I build GHC 6.6 without installing readline:
 {{{
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$
 find /opt/local/include -name '*readline*'
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$
 find /opt/local/lib -name '*readline*'
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$
 }}}
 And I get a GHCi without readline support, as I am supposed to in this
 case: The readline configure
 patched by gwright at antiope.com
 (#766) correctly detects that readline is not installed:
 {{{
 ...
 configure: configuring in readline
 configure: running /bin/sh './configure' --prefix=/usr/local  '--
 prefix=/usr/local' '--with-readline-includes=/opt/local/include/' '--with-
 readline-libraries=/opt/local/lib' '--cache-file=/dev/null' '--srcdir=.'
 --cache-file=/dev/null --srcdir=.
 ...
 checking for readline in -lreadline... yes
 checking for rl_readline_version in -lreadline... no
 ...
 }}}
 And no complaints from the build. So this case works as it should.
 Then I install (actually: "port activate") GNU readline, as witnessed by:
 {{{
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$ ls
 -l `find /opt/local/include -name '*readline*'`
 -rw-r--r--   2 root  admin  34354 Nov 19 19:50
 /opt/local/include/readline/readline.h

 /opt/local/include/readline:
 total 152
 -rw-r--r--   2 root  admin   4684 Nov 19 19:50 chardefs.h
 -rw-r--r--   2 root  admin  10207 Nov 19 19:50 history.h
 -rw-r--r--   2 root  admin   3529 Nov 19 19:50 keymaps.h
 -rw-r--r--   2 root  admin  34354 Nov 19 19:50 readline.h
 -rw-r--r--   2 root  admin   2182 Nov 19 19:50 rlconf.h
 -rw-r--r--   2 root  admin   1503 Nov 19 19:50 rlstdc.h
 -rw-r--r--   2 root  admin   2977 Nov 19 19:50 rltypedefs.h
 -rw-r--r--   2 root  admin   3167 Nov 19 19:50 tilde.h
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$ ls
 -l `find /opt/local/lib -name '*readline*'`
 -r-xr-xr-x   2 root  admin  456876 Nov 19 19:50
 /opt/local/lib/libreadline.5.1.dylib
 lrwxr-xr-x   1 root  admin      21 Nov 24 00:06
 /opt/local/lib/libreadline.5.dylib -> libreadline.5.1.dylib
 -rw-r--r--   2 root  admin  657996 Nov 19 19:50
 /opt/local/lib/libreadline.a
 lrwxr-xr-x   1 root  admin      21 Nov 24 00:06
 /opt/local/lib/libreadline.dylib -> libreadline.5.1.dylib
 Thorkil-Naurs-Computer:~/tn/GHCDarcsRepository/ghc-6.6/ghc thorkilnaur$
 }}}
 And rebuild GHC 6.6 (configured --with-readline-
 includes=/opt/local/include/ --with-readline-libraries=/opt/local/lib).
 The installed readline is detected:
 {{{
 ...
 configure: configuring in readline
 configure: running /bin/sh './configure' --prefix=/usr/local  '--
 prefix=/usr/local' '--with-readline-includes=/opt/local/include/' '--with-
 readline-libraries=/opt/local/lib' '--cache-file=/dev/null' '--srcdir=.'
 --cache-file=/dev/null --srcdir=.
 ...
 checking for readline in -lreadline... yes
 checking for rl_readline_version in -lreadline... yes
 checking for rl_erase_empty_line in -lreadline... yes
 checking for rl_free_undo_list in -lreadline... yes
 ...
 }}}
 and I get a GHCi with readline support. So this case also works as it
 should.

 To be sure, it is possible to get the reported error reaction: If I
 deactivate
 the GNU readline after succesfully building GHCi with readline support and
 then
 force a rebuild of InteractiveUI.o (rm
 compiler/stage2/ghci/InteractiveUI.o), I
 get:
 {{{
 ../compiler/stage1/ghc-inplace -H16m -O  -istage2/utils
 -istage2/basicTypes  -istage2/types  -istage2/hsSyn  -istage2/prelude
 -istage2/rename  -istage2/typecheck  -istage2/deSugar  -istage2/coreSyn
 -istage2/specialise  -istage2/simplCore  -istage2/stranal  -istage2/stgSyn
 -istage2/simplStg  -istage2/codeGen  -istage2/main  -istage2/profiling
 -istage2/parser  -istage2/cprAnalysis  -istage2/ndpFlatten  -istage2/iface
 -istage2/cmm  -istage2/nativeGen  -istage2/ghci -Istage2 -DGHCI
 -DBREAKPOINT -package template-haskell -threaded -package readline
 -DUSE_READLINE -cpp -fglasgow-exts -fno-generics -Rghc-timing -I. -Iparser
 -package unix -package Cabal -package regex-compat -ignore-package lang
 -recomp -Rghc-timing  -H16M '-#include "cutils.h"' -package-name  ghc-6.6
 -fgenerics  -fno-cse  -c ghci/InteractiveUI.hs -o
 stage2/ghci/InteractiveUI.o  -ohi stage2/ghci/InteractiveUI.hi
 /tmp/ghc9149_0/ghc9149_0.hc: In function 'smnS_ret':

 /tmp/ghc9149_0/ghc9149_0.hc:45171:0:
      error: void value not ignored as it ought to be
 /tmp/ghc9149_0/ghc9149_0.hc: In function 'smnM_ret':

 /tmp/ghc9149_0/ghc9149_0.hc:45204:0:
      error: void value not ignored as it ought to be
 <<ghc: 767097624 bytes, 2491 GCs, 16280232/32660728 avg/max bytes
 residency (8 samples), 83M in use, 0.02 INIT (0.00 elapsed), 19.63 MUT
 (96.28 elapsed), 35.13 GC (37.11 elapsed) :ghc>>
 gmake[2]: *** [stage2/ghci/InteractiveUI.o] Error 1
 gmake[2]: Leaving directory
 `/Users/thorkilnaur/tn/GHCDarcsRepository/ghc-6.6/ghc/compiler'
 gmake[1]: *** [stage2] Error 2
 gmake[1]: Leaving directory
 `/Users/thorkilnaur/tn/GHCDarcsRepository/ghc-6.6/ghc'
 gmake: *** [bootstrap2] Error 2
 }}}
 However, if I simply remember to configure, all stays sane: The
 library/readline configure
 correctly detects that GNU readline is not installed and, as a result, the
 build
 of the stage 2 compiler refrains from assuming readline and simply
 produces a GHCi
 without readline support.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/898>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list