Opened 14 years ago

Closed 12 years ago

Last modified 12 years ago

#762 closed defect (fixed)

Host System Reqs - libc.so.6 on Fedora x86_64

Reported by: Andrew Bradford Owned by: clfs-commits@…
Priority: major Milestone: CLFS Embedded 1.0.0
Component: BOOK Version: CLFS Embedded GIT
Keywords: Cc:

Description

Turns out that on x86_64 versions of Fedora 13 (and possibly others), libc.so.6 isn't located in /lib, it's in /lib64. This means that the version-check.sh in Host System Requirements can't find it even when glibc is properly installed.

version-check.sh should check both /lib and /lib64 (or use a path that's already set?) to look for libc.so.6 rather than explicitly looking in /lib.

Change History (10)

comment:1 by Andrew Bradford, 13 years ago

Another option is to find where libc.so lives is to use ldd:

ldd /bin/bash | grep libc.so | cut -d ' ' -f 3

The result should be the absolute path of libc.so. From that, the usual command can be run to pull out the actual version of glibc installed.

ldd /bin/bash | grep libc.so | cut -d ' ' -f 3 | /bin/bash | head -n 1 | cut -d ' ' -f 1-7

Tested on Debian 6 x86_64 and Ubuntu 11.10 i386. Ubuntu 11.10 stores libc.so.6 in /lib/i386-linux-gnu/libc.so.6 due to the somewhat implementation of multi-arch, so Fedora or others who also store libc.so.6 somewhere different than directly in /lib should also work.

comment:2 by Andrew Bradford, 12 years ago

Per my comment [1], could update the way to find which version of libc.so is being used (to remove the explicit /bin/bash) with:

ldd $(which bash) | grep libc.so | cut -d ' ' -f 3 | bash | head -n 1 | cut -d ' ' -f 1-7

[1]: http://lists.cross-lfs.org/pipermail/clfs-support-cross-lfs.org/2012-August/001400.html

Tested on Debian 6 amd64 and Ubuntu 12.04 x86_64.

Last edited 12 years ago by Andrew Bradford (previous) (diff)

comment:3 by William Harrington, 12 years ago

bradfa,

ldd $(which bash) Do most distros include which in the base instaled? I haven't ran across a default install that didn't, but if some distro doesn't, would ldd $(type -p bash) be better as bash should be used?

Also if using type -p bash would that work when the SHELL is dash as in the case of current debian based systems?

comment:4 by William Harrington, 12 years ago

Resolution: fixed
Status: newclosed

comment:5 by Andrew Bradford, 12 years ago

Resolution: fixed
Status: closedreopened

This ticket was opened on the Embedded book. The main CLFS book was fixed, but Embedded has not been.

Reopening.

in reply to:  3 comment:6 by Andrew Bradford, 12 years ago

Replying to kb0iic:

ldd $(which bash) Do most distros include which in the base instaled? I haven't ran across a default install that didn't, but if some distro doesn't, would ldd $(type -p bash) be better as bash should be used?

Also if using type -p bash would that work when the SHELL is dash as in the case of current debian based systems?

Bash is "essential" for Squeeze, Wheezy, and Sid, right now. Dash (as I understand it) is just kind of a front-end for your shell of choice, but many people choose Bash as it's often the default shell you actually use. Which is a part of debianutils, which is also "essential" and should be on all Debian based systems. I would assume which and bash are available on 99% of people's machines, whereas the issue that this fixes will start affecting quite a lot of people "real soon now" since Ubuntu and Fedora no longer have /lib/libc.so.6 anymore.

But, if you'd like something using $SHELL, use:

ldd $(which $SHELL)

But then you're reliant upon $SHELL being set. I'm not sure if it ever isn't, but it might not be. It (SHELL) is set in Debian and Ubuntu (what I have to test with right now).

comment:7 by William Harrington, 12 years ago

Oops didn't mean to close this ticket for embedded. I need to see if I have write permissions for the embedded book. If so, I'll add what I did to the cross-lfs book which you had above with bash and finding the version as well.

comment:8 by William Harrington, 12 years ago

Resolution: fixed
Status: reopenedclosed

in reply to:  8 comment:9 by Andrew Bradford, 12 years ago

Just for giggles, remove the need for bash:

$(which ${SHELL}) | grep libc.so | cut -d ' ' -f 3 | ${SHELL} | head -n 1 | cut -d ' ' -f 1-7

I've only tested with bash, ironically... :)

Version 0, edited 12 years ago by Andrew Bradford (next)

comment:10 by William Harrington, 12 years ago

We'll see how well it works. It is in embedded and cross-lfs books.

Note: See TracTickets for help on using tickets.