Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51901 - /usr/lib/libcurses.so missing
Summary: /usr/lib/libcurses.so missing
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-24 02:24 UTC by Ervin Németh
Modified: 2004-10-14 05:57 UTC (History)
1 user (show)

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


Attachments
gen_usr_ldscript libcurses.so (ncurses-5.4-r1.ebuild.diff,425 bytes, patch)
2004-05-24 02:27 UTC, Ervin Németh
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ervin Németh 2004-05-24 02:24:42 UTC
We need a libcurses.so in /usr/lib just like the libncurses.so.
Comment 1 Ervin Németh 2004-05-24 02:27:56 UTC
Created attachment 31935 [details, diff]
gen_usr_ldscript libcurses.so

My proposed solution for this problem.
Comment 2 Ervin Németh 2004-06-11 04:44:52 UTC
Many software don't even look for libncurses just libcurses. They rely on libcurses being a symlink to libncurses on systems with ncurses.

And because the linker doesn't search in /lib these programs get linked with the static version of libncurses.

Just check your bash or tcsh how is it linked to libcurses. They sould look like

bash-2.05b$ ldd /bin/bash 
        linux-gate.so.1 =>  (0xffffe000)
        libncurses.so.5 => /lib/libncurses.so.5 (0x40023000)
        libdl.so.2 => /lib/libdl.so.2 (0x40060000)
        libc.so.6 => /lib/libc.so.6 (0x40063000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
Comment 3 Robert Moss (RETIRED) gentoo-dev 2004-08-07 16:55:16 UTC
Sorry, I don't get what you mean here. Why do we need a libcurses.so in /usr/lib? One already exists in /lib, and it's a symlink to /lib/libncurses.so.5.4 (obviously that depends on the version you use). Are you saying we need a "fake" dynamic lib in /usr/lib, like we have at /usr/lib/libncurses.so? If so, can you provide us with an example situation of a package which requires this?

Also, my bash is *not* linked to ncurses in any way - only glibc. Please provide the output of "emerge info" or we don't really know what's going on.
Comment 4 SpanKY gentoo-dev 2004-08-07 22:22:59 UTC
please provide info on why a libcurses.so linker script is needed
Comment 5 Ervin Németh 2004-08-08 02:32:03 UTC
The link editor (ld) finds only the static version of libcurses in /usr. This is the same issue as in bug #4411.

bash is linked like this:

gcc -lcurses -o bash ...

The link editor looks in /usr/lib and finds only libcurses.a, no libcurses.so, so the library gets linked to the executable statically. This problem is already solved for libncurses but not for libcurses.
Comment 6 Travis Tilley (RETIRED) gentoo-dev 2004-08-11 09:22:42 UTC
i have no idea why this bug is assigned to toolchain...
Comment 7 SpanKY gentoo-dev 2004-08-20 22:18:19 UTC
we actually want bash linking statically with ncurses ...
Comment 8 Ervin Németh 2004-08-22 01:10:20 UTC
I don't see the rationale behind this. You say Gantoo has libncurses.so but no libcurses.so just to get bash staticaly linked to it?

But why do we need the static ncurses library in bash? The only reason would be a single situation where libncurses.so is unavailable or damaged. If /lib is not available, bash is still unfunctional because the libc.so dependency. So this protects for nothing.

Anyway, the correct thing to do would be linking bash like this: "-Bstatic -lcurses -Bdynamic".

But again, why? we have sash. It has no shared library dependencies.
Comment 9 SpanKY gentoo-dev 2004-08-22 10:11:46 UTC
ncurses changes api over time and such an upgrade would break bash and thus your entire system
Comment 10 Ervin Németh 2004-08-23 03:06:10 UTC
On my system bash is runtime-linked to libncurses.so.5 (now libncursesw.so.5). If a library ABI changes (not the API, as API doesn't necessarily affect binaries) the library major version changes. In this case there will be a libncurses.so.6 on my the system (symlinked to libncurses.so.6.0), but the bash binary will still use  the old library. This is how shared libraries work. Only the openssl team doesn't know this.
Comment 11 SpanKY gentoo-dev 2004-08-29 21:30:22 UTC
the bash binary wont use the old library because the old library wouldnt exist once you've upgraded

i'll add the ldscript in a bit
Comment 12 Ervin Németh 2004-08-30 01:01:49 UTC
Yes, I agree, that is an issue, but this affects all other libraries, too. Maybe the emerge system should be made aware of it.
Comment 13 SpanKY gentoo-dev 2004-09-08 08:08:09 UTC
added the ldscript to all the current ebuilds

your suggested fix of -Bstatic -lcurses -Bdynamic didnt work for me ...

i changed the bash ebuild to link against $ROOT/usr/lib/libcurses.a
instead of using -lcurses
Comment 14 SpanKY gentoo-dev 2004-09-08 19:04:31 UTC
ah we want '-Wl,-Bstatic -lcurses -Wl,-Bdynamic'

added that in the ebuild
Comment 15 SpanKY gentoo-dev 2004-10-14 05:57:56 UTC
*** Bug 67481 has been marked as a duplicate of this bug. ***