Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 204166 - sys-libs/readline-5.2_p12 doesn't link against ncurses
Summary: sys-libs/readline-5.2_p12 doesn't link against ncurses
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-03 10:10 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2008-01-03 10:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (ein,4.16 KB, text/plain)
2008-01-03 10:14 UTC, Kent Fredric (IRC: kent\n) (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2008-01-03 10:10:00 UTC
Lately I upgraded from readline 5.2_p7 to 5.2_p12, and noticed all of a sudden, php was dying with 
"php: symbol lookup error: /lib/libreadline.so.5: undefined symbol: PC"

Upon trying to remerge php , it dies and tells me there is no readline support. 
Oddly, I downgrade to 5.2_p7 and suddenly php stops dying, and readline support comes back.

I extracted the "readline" config test from php's configure script and tested that exclusivley, breaking it down to a minimal set as far as i was able, and th e problem persists:

i686-pc-linux-gnu-gcc -o conftest -I/usr/include -march=native -pipe -pthread -O0  -D_REENTRANT -L/lib -L/usr/lib  -Wl,-O1 -Wl,-z,combreloc -Wl,--sort-common -Wl,--enable-new-dtags -Wl,--as-needed conftest.c -lncurses -lreadline
conftest.c: In function 'main':
conftest.c:14: warning: return makes integer from pointer without a cast
/lib/libreadline.so: undefined reference to `PC'
/lib/libreadline.so: undefined reference to `tgetflag'
/lib/libreadline.so: undefined reference to `tgetent'
/lib/libreadline.so: undefined reference to `UP'
/lib/libreadline.so: undefined reference to `tputs'
/lib/libreadline.so: undefined reference to `tgoto'
/lib/libreadline.so: undefined reference to `tgetnum'
/lib/libreadline.so: undefined reference to `BC'
/lib/libreadline.so: undefined reference to `tgetstr'
collect2: ld returned 1 exit status

The instant i downgrade to 5.2_p7, the compile line happens cleanly, and php suddely stops failing the readline config test

Having been familiar with --as-needed ness where its generally just an incorrect order of arguments, i twiddled the args a bit, and found no combination worked, except for of course removing -Wl,--as-needed 

I tried poking around, recompiled ncurses ( which provides most if not all of the missing symbols concerned ) 

Reproducible: Always




 readelf -a  /lib/libreadline.so | egrep "(PC|tgetflag|tgetent|UP|tputs|tgoto|tgetnum|[^I]BC|tgetstr)"  # _p12
0002dcb8  00000b06 R_386_GLOB_DAT    00000000   PC
0002de28  00002c06 R_386_GLOB_DAT    00000000   UP
0002df40  00004606 R_386_GLOB_DAT    00000000   BC
0002e0b4  00000d07 R_386_JUMP_SLOT   00000000   tgetflag
0002e248  00002407 R_386_JUMP_SLOT   00000000   tgetent
0002e344  00003407 R_386_JUMP_SLOT   00000000   tputs
0002e418  00004207 R_386_JUMP_SLOT   00000000   tgoto
0002e42c  00004507 R_386_JUMP_SLOT   00000000   tgetnum
0002e4d0  00005507 R_386_JUMP_SLOT   00000000   tgetstr
    11: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND PC
    13: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND tgetflag
    36: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND tgetent
    44: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND UP
    52: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND tputs
    66: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND tgoto
    69: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND tgetnum
    70: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND BC
    85: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND tgetstr


readelf -a  /lib/libreadline.so | egrep "(PC|tgetflag|tgetent|UP|tputs|tgoto|tgetnum|[^I]BC|tgetstr)" # _p7
0002dcc0  00000b06 R_386_GLOB_DAT    00000000   PC
0002de30  00002c06 R_386_GLOB_DAT    00000000   UP
0002df48  00004606 R_386_GLOB_DAT    00000000   BC
0002e0b4  00000d07 R_386_JUMP_SLOT   00000000   tgetflag
0002e248  00002407 R_386_JUMP_SLOT   00000000   tgetent
0002e344  00003407 R_386_JUMP_SLOT   00000000   tputs
0002e418  00004207 R_386_JUMP_SLOT   00000000   tgoto
0002e42c  00004507 R_386_JUMP_SLOT   00000000   tgetnum
0002e4d0  00005507 R_386_JUMP_SLOT   00000000   tgetstr
    11: 00000000     1 OBJECT  GLOBAL DEFAULT  UND PC
    13: 00000000   150 FUNC    GLOBAL DEFAULT  UND tgetflag
    36: 00000000  1412 FUNC    GLOBAL DEFAULT  UND tgetent
    44: 00000000     4 OBJECT  GLOBAL DEFAULT  UND UP
    52: 00000000   643 FUNC    GLOBAL DEFAULT  UND tputs
    66: 00000000    49 FUNC    GLOBAL DEFAULT  UND tgoto
    69: 00000000   172 FUNC    GLOBAL DEFAULT  UND tgetnum
    70: 00000000     4 OBJECT  GLOBAL DEFAULT  UND BC
    85: 00000000   272 FUNC    GLOBAL DEFAULT  UND tgetstr

I would imagine that the .dynsym table lacking "size" fields and the "Type" fields all being NOTYPE is possibly part of the problem. 

Will paste emerge --info as attachment as I've probably already hit my character limit. Summary: 
Portage 2.1.4_rc14 (default-linux/x86/2007.0, gcc-4.2.2, glibc-2.7-r1, 2.6.23-gentoo-r3kz i686)
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
Comment 1 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2008-01-03 10:14:35 UTC
Created attachment 139946 [details]
emerge --info

emerge --info data
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2008-01-03 10:33:48 UTC
This version doesn't exist any more; linking fixed in -r1.

*readline-5.2_p12-r1 (02 Jan 2008)
  	 
 02 Jan 2008; Mike Frysinger <vapier@gentoo.org>
 +readline-5.2_p12-r1.ebuild:
 Make sure we continue to always link against ncurses as reported by welp.
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2008-01-03 10:38:47 UTC
(In reply to comment #2)
> This version doesn't exist any more; linking fixed in -r1.
> 
> *readline-5.2_p12-r1 (02 Jan 2008)
> 
>  02 Jan 2008; Mike Frysinger <vapier@gentoo.org>
>  +readline-5.2_p12-r1.ebuild:
>  Make sure we continue to always link against ncurses as reported by welp.
> 

Cheers, I need to sync more often :)