Bug 154 - libtool has incorrect paths embedded
Summary: libtool has incorrect paths embedded
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.0
Hardware: All Multiple
: Medium normal
Target Milestone: 1.0 M4
Assignee: Nitin Kamble
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2010-07-28 12:44 UTC by Richard Purdie
Modified: 2011-02-22 08:36 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2010-07-28 12:44:34 UTC
running "libtool" in a poky-image-sdk results in /usr/bin/sed not found. Its finding and using build system paths instead of those for the target device.
Comment 1 Nitin Kamble 2010-08-25 14:46:26 UTC
What are the steps to reproduce?
Comment 2 Richard Purdie 2010-08-26 09:04:57 UTC
If you boot an sdk image and run "libtool" from the bash prompt you will see this error.
Comment 3 Nitin Kamble 2010-08-27 11:19:12 UTC
I tried running libtoolize inside the sdkimage, and I did not see the issue.


root@qemux86:~/sudoku-savant-1.3# libtoolize 
libtoolize: putting macros in `m4'.
libtoolize: You should add the contents of `m4/libtool.m4' to `aclocal.m4'.
libtoolize: You should add the contents of `m4/ltoptions.m4' to `aclocal.m4'.
libtoolize: You should add the contents of `m4/ltsugar.m4' to `aclocal.m4'.
libtoolize: You should add the contents of `m4/ltversion.m4' to `aclocal.m4'.
libtoolize: You should add the contents of `m4/lt~obsolete.m4' to `aclocal.m4'.
libtoolize: Remember to add `LT_INIT' to configure.in.
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
Comment 4 Saul Wold 2010-09-07 18:38:42 UTC
Can you verify if this is fixed.
Comment 5 Richard Purdie 2010-09-08 16:04:35 UTC
ok, I've tracked this one down a bit. To reproduce:

bitbake libtool -c clean
create a symlink on the build system from /usr/bin/sed to /bin/sed
bitbake libtool

then grep work/*/libtool-2.2.10-r1/image/ for "/usr/bin/sed" and you will see a match in ltmain.sh and usr/bin/libtoolize itself.

This should always be "/bin/sed" regardless of whether /usr/bin/sed exists on the build machine.
Comment 6 Nitin Kamble 2010-09-09 12:24:22 UTC
I tried 
 ln -s /usr/bin/sed /bin/sed
and also this after mving /bin/sed to /usr/bin/sed
 ln -s /bin/sed /usr/bin/sed

Both times found this setting of SED in the libtool scripts

$cd /tmp/work/i586-poky-linux/libtool-2.2.10-r1/image/

$ grep -r /bin/sed .
./usr/bin/libtoolize:: ${SED="/bin/sed"}
./usr/bin/libtool:SED="/bin/sed"
./usr/bin/libtool:: ${SED="/bin/sed"}
./usr/share/aclocal/libtool.m4:# Add /usr/xpg4/bin/sed as it is typically found on Solaris
./usr/share/aclocal/libtool.m4:# along with /bin/sed that truncates output.
./usr/share/aclocal/libtool.m4:for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
./usr/share/libtool/config/ltmain.sh:: ${SED="/bin/sed"}


So still could not reproduce the issue.
Comment 7 Nitin Kamble 2010-09-28 09:00:53 UTC
can't reproduce.
Comment 8 Scott Garman 2011-01-27 14:56:15 UTC
I can confirm that this does not occur with the latest master. I cannot say with any certainty that things were fixed with my libtool sysroot changes, but grepping for references to "/sed" in the image workdir for libtool only shows /bin/sed even when built with a host symlink of /usr/bin/sed.
Comment 9 Richard Purdie 2011-01-27 15:12:31 UTC
This does still exist.

$ ls /bin/sed* -la
-rwxr-xr-x 1 root root 69088 2010-05-10 09:55 /bin/sed
$ ls /usr/bin/sed* -la
lrwxrwxrwx 1 root root 8 2011-01-27 23:05 /usr/bin/sed -> /bin/sed
$ which sed
/usr/bin/sed

$ bitbake libtool -c cleanall
$ bitbake libtool
$ grep bin/sed tmp/work/*/libtool-2.4*/image/ -r
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/bin/libtoolize:: ${SED="/usr/bin/sed"}
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/share/libtool/config/ltmain.sh:: ${SED="/usr/bin/sed"}
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/share/aclocal/libtool.m4:# Add /usr/xpg4/bin/sed as it is typically found on Solaris
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/share/aclocal/libtool.m4:# along with /bin/sed that truncates output.
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/share/aclocal/libtool.m4:for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do

# rm /usr/bin/sed
$ which sed
/bin/sed

$ bitbake libtool -c cleanall
$ bitbake libtool
$ grep bin/sed tmp/work/*/libtool-2.4*/image/ -r
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/bin/libtoolize:: ${SED="/bin/sed"}
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/share/libtool/config/ltmain.sh:: ${SED="/bin/sed"}
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/share/aclocal/libtool.m4:# Add /usr/xpg4/bin/sed as it is typically found on Solaris
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/share/aclocal/libtool.m4:# along with /bin/sed that truncates output.
tmp/work/core2-poky-linux/libtool-2.4-r1/image/usr/share/aclocal/libtool.m4:for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do

The key problem being there is a hardcoded reference in /usr/share/libtool/config/ltmain.sh:: ${SED="/usr/bin/sed"} which is depending on the host system.
Comment 10 Scott Garman 2011-01-28 18:44:15 UTC
My apologies for the confusion. On my Fedora 14 system, /bin is before /usr/bin in $PATH (which is an unusual default IMO). This masks the issue (and I'd bet is why Nitin also was unable to reproduce this). I can now reproduce it on my Ubuntu host.
Comment 12 Nitin Kamble 2011-02-22 08:36:22 UTC
Fixed in this commit which has gone in master
Please help verify.

commit 489465b82be73da1d845a0cea601b41ce5ade411
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date:   Fri Feb 18 10:13:48 2011 -0800

    libtool: avoid absolute pathnames of general utils
    
    addded a new patch:
        libtool/avoid_absolute_paths_for_general_utils.patch
    
    This fixes [BUGID #154]
    This fixes [BUGID #734]
    
    Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>