Error while loading shared libraries
Hello,i have completed LFS and started BLFS and while installing attr i am getting the following error
Code:
ls: error while loading shared libraries: /lib/libacl.so.1: file too short I am on chroot environment i checked that /lib/libacl.so.1 its 0 byte I couldn't find an solution for this expecting for an good solution here!!Please help me to get rid of this problem! |
Quote:
Other than being aware of it and taking precautions, I've never worked out a real remedy and have just been making do with that workaround hack. I then just manually copy the newly built file like this: Code:
install ./libacl/.libs/libacl.so.1.1.0 /lib |
Quote:
|
Quote:
|
Quote:
|
Quote:
I'm surprised that this hasn't impacted more people. It happens on a live system, in a chroot environment and in a virtual system as well. The commonality is that the coreutils tools are linked to ACL. |
Strange, I don't have this problem... I create packages of all packages (or how to say it...), so I installed it to $pkgdir using fakeroot. Except from that I followed the book. I also recompiled coreutils after acl. I installed it in a chroot.
I still have my logs if that could give some clue. Code:
grep libacl.so build.log |
Quote:
Ideally, the ACL (and ATTR) packages would have a DESTDIR variable as is common in most Makefiles so that we LFS users could likewise use such a staging area before clobbering the "in-use" libraries. |
Quote:
Try rebuilding ACL exactly by the BLFS book without using that $pkgdir. In short, what would be interesting is to discern if the install command, presuming it does have linkage to the ACL shared library ends up creating that 0-byte file in the actual /lib target as opposed to a staging area. |
I don't want to bork my working system, but I can install all packages before acl to a chroot, and then build acl by the book in that chroot. I don't have time for it now, but during the weekend.
Quote:
|
So I have done the experiment now. I installed the packages from lfs, and attr. I still had the old package of coreutils, which was compiled before acl. Then I just copy-pasted the commands from the book, and the result is:
Code:
~/Data/LFS/build-chroot/lib |
Quote:
1). Install coreutils per the LFS book on a system without the acl/attr packages from BLFS. None of the commands (cp, install, ln and so on) will thus be linked against the acl/attr shared libraries of course. 2). Then build and install acl/attr per BLFS. There will be no problem at this point. 3). With acl/attr now present, go back and rebuild coreutils in order to get linkage to acl/attr. 4). And finally, rebuild acl/attr anew. At this point, the 0-byte shared library file problem will occur. Since experience has taught me to guard against this known problem, I can follow these steps every time and replicate the problem regardless of the underlying platform -- chroot, virtual system or live system. The problem first became evident to me circa 2005 when a new version of the acl/attr packages were released through BLFS. It was then that I initially experienced the 0-byte shared library file. |
Quote:
Code:
FORCE_UNSAFE_CONFIGURE=1 ./configure \ I have removed those libacl files just for testing but i have those files in another location, please help me to fix this problem. |
Quote:
1). Rebuild coreutils with these two additional flag: --disable-acl and --disable-xattr. For the moment, just forget about ACL/ATTR but otherwise follow the LFS instructions. 2). Now, with coreutils no longer linked against ACL/ATTR, go back and build ACL/ATTR per the BLFS instructions. 3). With ACL/ATTR now built, one final time, go back and rebuild coreutils without the two flags shown in step 1. On this pass of the coreutils build, you'll then link to ACL/ATTR and get the benefits of extended attributes and access control lists for tools such as ls, cp, mv and so forth. |
I continued my experiment and recompiled coreutils and then recompiled acl. This time I also got the error.
But why do you recompile acl after coreutils? What I can see it shouldn't make any difference. I ran ldd on the binaries in acl: /usr/bin/chacl, /usr/bin/getfacl and /usr/bin/setfacl. None of them added dependency to coreutils. They still only depend on acl(itself), attr and glibc. Edit: I ran ldd on the binaries in the build folder, in case they weren't installed yet, but no difference. |
It seems this borked the system completely... I tried to recompile coreutils, but got the same error.
Code:
FORCE_UNSAFE_CONFIGURE=1 ./configure \ |
Quote:
Quote:
That's the background and now for a direct answer to your question. I recompiled acl after coreutils simply because a newer version of the ACL/ATTR duo came along in BLFS's SVN book. The crux of the matter is the install binary from coreutils. It does have linkage against ACL/ATTR. Thus my theory is that the "make install-lib" phase of ACL/ATTR clobbers a shared library in use currently by the install command. I hope to prove this theory over the weekend by rebuilding all of coreutils without ACL/ATTR and then extracting just install from the build to install onto the system. If my theory is indeed sound, the 0-byte shared library file should then not occur. EDIT: My theory was wrong! See post #21 in this thread. The problem is that install is never used but a rather old shell wrapper uses cp to put the new library in place. Both the acl and attr packages suffer from this misfeature. |
Quote:
|
I did another test.
1. I reinstalled the original coreutils package. 2. Then I recompiled acl. (But I still had the remnants from the former acl, with the empty libraries...) 3. I then recompiled coreutils with '--enable-no-install-program=kill,uptime,install' but it installed /usr/bin/install anyway. Before ran 'make install' I made a copy of /usr/bin/install, and after 'make install' I copied it back. 4. Then I recompiled acl, and again I got the 'file too short' error. So it can't be only /usr/bin/install that is the problem. For what it's worth... I'm defenately too tired for this now... |
Quote:
|
Maybe we can mark this thread as [SOLVED] if Dinesh and Lennie are willing to try something out. First of all, make sure you have a good, working LFS system with coreutils not failing due to the ACL/ATTR 0-byte file problem.
Then execute this command within the acl-2.2.25 and attr-2.4.47 source trees (changing the version if necessary for the directory name): Code:
sed -ie 's/CP=cp/CP="cp -b"/' $(find -name 'install-sh' -exec grep -l 'CP=cp' {} +) When complete, you can then remove the tilde-appended backup files to tidy up. So, as it turns out, the problem isn't due to the install but due to the script which doesn't even use install at all. |
I tried your solution and it worked for me too. Maybe you should write about this to the blfs mailing list where the developers are, so they can add this to the book. A big red warning about this would be great.
To the op: If you still have your acl build directory, you should have the real library there. Code:
~/Data/LFS/build-chroot/sources/acl-2.2.52 |
Quote:
Code:
root:/sources/coreutils-8.21# FORCE_UNSAFE_CONFIGURE=1 ./configure \ |
Quote:
Code:
root:/sources/acl-2.2.51# find -name libacl.so.1.1.0 |
Quote:
This one also dint work for me :( but my LFS system is working here is the results after using this above command Code:
root:/sources/attr-2.4.47# sed -i -e 's|/@pkg_name@|&-@pkg_version@|' include/builddefs.in && |
Quote:
Then see post #14 and follow the steps as shown there. |
One last thing you can try is to copy libacl.so.1.1.0 from another distro. I copied it from Slackware, and it worked.
|
Quote:
|
Quote:
Feeling Up :) |
Quote:
|
Quote:
Glad it all worked out! :) |
Quote:
|
All times are GMT -5. The time now is 01:24 AM. |