Opened 4 years ago

Closed 4 years ago

#7281 closed bug (fixed)

GHC 7.4.2 build fails on Fedora17

Reported by: PaulJohnson Owned by: judah.jacobson@…
Priority: high Milestone: 7.8.1
Component: libraries (other) Version: 7.4.2
Keywords: Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by igloo)

On Fedora 17 the build fails when attempting to run "configure". The relevant section says:

checking for ncurses.h... yes
checking for setupterm in -lncursesw... no
checking for setupterm in -lncurses... no
checking for setupterm in -lcurses... no
configure: error: in `/home/paj/packages/ghc-7.4.2/libraries/terminfo':
configure: error: curses library not found, so this package cannot be built

The relevant section from config.log says:

configure~:3285: gcc -o conftest -g -O2   conftest.c -lncursesw   >&5
/usr/bin/ld: /tmp/cc1CCCaI.o: undefined reference to symbol 'setupterm'
/usr/bin/ld: note: 'setupterm' is defined in DSO /lib64/libtinfo.so.5 so try adding it to the linker command line
/lib64/libtinfo.so.5: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status

I've set the architecture to x86_64 because thats what I run, but I expect it would happen on other Fedora 17s as well.

Change History (10)

comment:1 Changed 4 years ago by simonmar

difficulty: Unknown
Milestone: 7.6.2
Priority: normalhigh

comment:2 Changed 4 years ago by igloo

Description: modified (diff)

comment:3 Changed 4 years ago by igloo

Owner: set to judah.jacobson@…

Hmm, the nightly builders have libtinfo, so odd that they didn't run into this.

Judah, this looks like a bug in the terminfo configure script; could you take a look please?

comment:4 Changed 4 years ago by judahj

It seems that ncurses was changed recently (?) to allow splitting off the terminfo-specific functionality into a separate library. The fix should be pretty simple; just edit configure.ac and change

AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw,

[AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses,

[AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses,

HaveLibCurses=NO; LibCurses=not-installed)])])

adding an extra line to try tinfo first, and otherwise fall back to the above curses variants.

Unfortunately, I don't have a system with libtinfo to test this on. Can someone please confirm whether that fixes the problem?

comment:5 in reply to:  4 Changed 4 years ago by judahj

Replying to judahj:

Sorry, messed up the formatting:

AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw,
  [AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses,
    [AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses,
      HaveLibCurses=NO; LibCurses=not-installed)])])

comment:6 Changed 4 years ago by PaulJohnson

Sorry to take so long to check this. I can confirm that this fix allows GHC 7.4.2 to compile on Fedora 17.

[paj@eiffel terminfo]$ diff configure.ac~ configure.ac
42,45c42,46
< AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw,
<   [AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses,
<     [AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses,
<       HaveLibCurses=NO; LibCurses=not-installed)])])
---
> AC_CHECK_LIB(tinfo, setupterm, HaveLibCurses=YES; LibCurses=tinfo,
>   [AC_CHECK_LIB(ncursesw, setupterm, HaveLibCurses=YES; LibCurses=ncursesw,
>     [AC_CHECK_LIB(ncurses, setupterm, HaveLibCurses=YES; LibCurses=ncurses,
>       [AC_CHECK_LIB(curses, setupterm, HaveLibCurses=YES; LibCurses=curses,
>         HaveLibCurses=NO; LibCurses=not-installed)])])])

comment:7 Changed 4 years ago by igloo

Component: Compilerlibraries (other)
Milestone: 7.6.27.8.1

I've applied this change as 6dde36fa0c347dbbb92affe932c5c79d030867db in GHC's 7.6 branch.

Judah, could you apply it in the terminfo main repo please? Then I'll pull it into GHC HEAD.

comment:8 in reply to:  7 Changed 4 years ago by judahj

Replying to igloo:

I've applied this change as 6dde36fa0c347dbbb92affe932c5c79d030867db in GHC's 7.6 branch.

Judah, could you apply it in the terminfo main repo please? Then I'll pull it into GHC HEAD.

Done, thanks; apologies for the delay.

comment:9 Changed 4 years ago by ian@…

commit 77e78416e97d96b55c299c6ccdd1741d38372052

Author: Ian Lynagh <ian@well-typed.com>
Date:   Fri Jan 11 14:39:46 2013 +0000

    Update bytestring and terminfo repos
    
    bytestring fixes #7556.
    terminfo fixes #7281.

 libraries/bytestring |    2 +-
 libraries/terminfo   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

comment:10 Changed 4 years ago by igloo

Resolution: fixed
Status: newclosed

Thanks! HEAD updated.

Note: See TracTickets for help on using tickets.