Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 591586 - dev-libs/icu-57.1 on uclibc-ng: icu/source-abi_x86_32.x86/bin/icupkg: can't load library 'libicutu.so.57'
Summary: dev-libs/icu-57.1 on uclibc-ng: icu/source-abi_x86_32.x86/bin/icupkg: can't l...
Status: RESOLVED DUPLICATE of bug 630598
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 475754 uclibc-porting
  Show dependency tree
 
Reported: 2016-08-18 09:22 UTC by tt_1
Modified: 2020-11-29 09:35 UTC (History)
3 users (show)

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


Attachments
gzipped build.log (icu-fails-with-uclibc-build.log.gz,14.04 KB, application/octet-stream)
2016-08-18 09:22 UTC, tt_1
Details
emerge.info (emerge.info,4.22 KB, text/plain)
2016-08-18 09:22 UTC, tt_1
Details
build.log (dev-libs:icu-58.1-r1:20170126-032844.log,126.37 KB, text/x-log)
2017-01-26 05:45 UTC, Dave Kennedy
Details
emerge --info (emerge-info,4.56 KB, text/plain)
2017-01-26 05:45 UTC, Dave Kennedy
Details
emerge -pqv (emerge-pqv,80 bytes, text/plain)
2017-01-26 05:45 UTC, Dave Kennedy
Details
environment (environment,128.69 KB, text/plain)
2017-01-26 05:46 UTC, Dave Kennedy
Details
ldd -r (ldd-r,912 bytes, text/plain)
2017-01-26 05:46 UTC, Dave Kennedy
Details
icu-58.1-uclibcng.patch (icu-58.1-uclibcng.patch,325 bytes, patch)
2017-02-11 14:00 UTC, René Rhéaume
Details | Diff
icu-hack-makefile-use-absolute-LD_LIBRARY-path.patch (icu-hack-makefile-use-absolute-LD_LIBRARY-path.patch,680 bytes, patch)
2017-10-17 19:19 UTC, Ed Wildgoose
Details | Diff
compressed build log (icu-67-with-uclibc-ng.log.gz,14.82 KB, application/gzip)
2020-11-28 18:20 UTC, tt_1
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2016-08-18 09:22:12 UTC
Created attachment 443678 [details]
gzipped build.log

how to reproduce 

grab a recent stage 3, unpack, chroot in and emerge dev-libs/icu. 

this happens with arm and x86, cannot test on amd64 because that stage3 tarball is broken
Comment 1 tt_1 2016-08-18 09:22:40 UTC
Created attachment 443680 [details]
emerge.info
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2016-11-19 22:12:18 UTC
Please... run the build again, and when it has failed, 

* cd into the build directory, /var/tmp/portage/dev-libs/icu-57.1/work/icu/source-abi_x86_32.x86

* find in there libicutu.so.57

* run "ldd -r pathtothelibrary/libicutu.so.57"

and add the output here...

Also, does the problem still happen with icu-58.1-r1 ?
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2016-11-19 22:15:28 UTC
Correction...

> Please... run the build again, and when it has failed, 
> 
> * cd into the build directory,
> /var/tmp/portage/dev-libs/icu-57.1/work/icu/source-abi_x86_32.x86
> 
> * find in there libicutu.so.57
> 

* cd into that directory

* run "LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ldd -r ./libicutu.so.57"

> 
> and add the output here...
> 
> Also, does the problem still happen with icu-58.1-r1 ?
Comment 4 tt_1 2016-11-20 10:44:28 UTC
on an ARM system, the libicutu.so.57 is to be found in /var/tmp/portage/dev-libs/icu-57.1/work/icu/source-.arm/lib/ ; if I run

LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ldd -r ./libicutu.so.57

from this path I get the following output 

root lib # LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ldd -r ./libicutu.so.57 
-r:
-r: No such file or directory
./libicutu.so.57:
checking sub-depends for 'libicui18n.so.57'
checking sub-depends for 'libicuuc.so.57'
checking sub-depends for '/usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.4/libstdc++.so.6'
checking sub-depends for '/usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.4/libgcc_s.so.1'
checking sub-depends for '/lib/libc.so.0'
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x54b65000)
        libicui18n.so.57 => libicui18n.so.57 (0x00000000)
        libicuuc.so.57 => libicuuc.so.57 (0x00000000)
        libstdc++.so.6 => /usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.4/libstdc++.so.6 (0x00000000)
        libgcc_s.so.1 => /usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.4/libgcc_s.so.1 (0x00000000)
        libc.so.0 => /lib/libc.so.0 (0x00000000)
        /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)
        /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)





with icu-58.1-r1 

root lib # LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ldd -r ./libicutu.so.58
libicutu.so.58    libicutu.so.58.1  
root lib # LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ldd -r ./libicutu.so.58.1 
-r:
-r: No such file or directory
./libicutu.so.58.1:
checking sub-depends for 'libicui18n.so.58'
checking sub-depends for 'libicuuc.so.58'
checking sub-depends for '/usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.4/libstdc++.so.6'
checking sub-depends for '/usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.4/libgcc_s.so.1'
checking sub-depends for '/lib/libc.so.0'
        ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x54b24000)
        libicui18n.so.58 => libicui18n.so.58 (0x00000000)
        libicuuc.so.58 => libicuuc.so.58 (0x00000000)
        libstdc++.so.6 => /usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.4/libstdc++.so.6 (0x00000000)
        libgcc_s.so.1 => /usr/lib/gcc/armv7a-hardfloat-linux-uclibceabi/4.9.4/libgcc_s.so.1 (0x00000000)
        libc.so.0 => /lib/libc.so.0 (0x00000000)
        /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)
        /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)
Comment 5 Dave Kennedy 2017-01-26 05:44:40 UTC
Same thing happens to me with icu-58.1-r1. I'll attach the relevant info.
Comment 6 Dave Kennedy 2017-01-26 05:45:18 UTC
Created attachment 461458 [details]
build.log
Comment 7 Dave Kennedy 2017-01-26 05:45:38 UTC
Created attachment 461460 [details]
emerge --info
Comment 8 Dave Kennedy 2017-01-26 05:45:52 UTC
Created attachment 461462 [details]
emerge -pqv
Comment 9 Dave Kennedy 2017-01-26 05:46:07 UTC
Created attachment 461464 [details]
environment
Comment 10 Dave Kennedy 2017-01-26 05:46:22 UTC
Created attachment 461466 [details]
ldd -r
Comment 11 René Rhéaume 2017-02-11 01:41:41 UTC
(In reply to Dave Kennedy from comment #5)
> Same thing happens to me with icu-58.1-r1. I'll attach the relevant info.

The failing command (I also have the problem on uclibc-ng 1.0.17) is LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH  ../bin/icupkg -d ./out/build/icudt58l --list -x \* /var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source/data/in/icudt58l.dat -o out/tmp/icudata.lst

However, when I replace the relative paths that are set to LD_LIBRARY_PATH with their absolute counterparts, the command succeeds.
Comment 12 René Rhéaume 2017-02-11 14:00:27 UTC
Created attachment 463294 [details, diff]
icu-58.1-uclibcng.patch

After searching though the Makefiles, I found out where the relative paths come from. In GNU make, there is a function to convert relative paths to absolute paths. 

Working on native uclibc-ng 1.0.17 hardened AMD64. Can someone test a cross-compile?
Comment 13 tt_1 2017-02-11 15:24:21 UTC
I tested your patch on nativ arm, which doesn't work unfortunately. Will provide the full build log later on, fyi I am using uclibc-ng-1.0.20 with activated symlink-compat useflag. 


make -f pkgdataMakefile
   armv7a-hardfloat-linux-uclibceabi-gcc         ...  /var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source/extra/uconv/uwmsg.c
   armv7a-hardfloat-linux-uclibceabi-g++         ...  /var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source/extra/uconv/uconv.cpp
mkdir uconvmsg
LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH  ../../bin/genrb -e UTF-8 -s /var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source/extra/uconv/resources -d uconvmsg root.txt
make[3]: Entering directory '/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-.arm/extra/uconv'
rm -rf pkgdata.inc
/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-.arm/bin/genrb: can't load library 'libicutu.so.58'
Makefile:175: recipe for target 'uconvmsg/root.res' failed
make[2]: *** [uconvmsg/root.res] Error 16
make[2]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-.arm/extra/uconv'
make[2]: Leaving directory '/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-.arm/extra/uconv'
Makefile:49: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 2
make[1]: Leaving directory '/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-.arm/extra'
Makefile:143: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 2
Comment 14 Pandu POLUAN 2017-02-20 20:16:14 UTC
Something similar happened to me with dev-libs/icu-58.1-r1 on a uclibc-hardened installation.

The offending lines seem to be this:

LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH  ../bin/icupkg -d ./out/build/icudt58l --list -x \* /var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source/data/in/icudt58l.dat -o out/tmp/icudata.lst
/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-abi_x86_64.amd64/bin/icupkg: can't load library 'libicutu.so.58'

That one's fixed by invoking emerge as such:

LD_LIBRARY_PATH=/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-abi_x86_64.amd64/lib emerge icu

But a new error happened:

LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH  ../bin/icupkg -d ./out/build/icudt58l --list -x \* /var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source/data/in/icudt58l.dat -o out/tmp/icudata.lst
/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-abi_x86_64.amd64/bin/icupkg: can't load library 'libicudata.so.58'

So I appended the location of libicudata:

LD_LIBRARY_PATH=/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-abi_x86_64.amd64/lib:/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-abi_x86_64.amd64/stubdata emerge icu

And now it compiles.

Temporarily I work around this needing explicit LD_LIBRARY_PATH by using the package.env mechanism.

Would be nice if it can be fixed without a workaround.
Comment 15 tt_1 2017-04-09 08:25:57 UTC
indeed, the issuee can be solved by setting the LD_LIBRARY path
for an arm system, it is 

LD_LIBRARY_PATH=/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-.arm/lib:/var/tmp/portage/dev-libs/icu-58.1-r1/work/icu/source-.arm/stubdata
Comment 16 Anthony Basile gentoo-dev 2017-04-09 14:45:11 UTC
This is probably related to bug #608312 where LD_LIBRARY_PATH isn't properly parsed.  I'll see if I can narrow it down this summer when I get some time.
Comment 17 Ed Wildgoose 2017-10-17 19:19:42 UTC
Created attachment 499016 [details, diff]
icu-hack-makefile-use-absolute-LD_LIBRARY-path.patch

I think René is on the right track. Here is a tweaked version which works for me for icu-58.2-r1
Comment 18 Waldemar Brodkorb 2018-01-19 06:12:27 UTC
Instead of patching every ebuild to use absolute PATH in LD_LIBRARY_PATH,
why LDSO_SAFE_RUNPATH is not simply added to defs_n in the uclibc-ng ebuild?

Not loading a library from a relative path is a feature, not a bug.

Works for me this way, tested on amd64.
Comment 19 tt_1 2018-06-29 11:14:35 UTC
Same problem with llvm by the way.
Comment 20 Andreas K. Hüttel archtester gentoo-dev 2020-11-28 17:07:43 UTC
Is this still a problem with current versions?
Comment 21 tt_1 2020-11-28 18:20:55 UTC
Created attachment 675625 [details]
compressed build log
Comment 22 tt_1 2020-11-28 18:22:29 UTC
yes, this is still a problem. also with brandnew icu-68.1
Comment 23 tt_1 2020-11-29 09:35:15 UTC
closing in favour of #630598 , which has working patch

*** This bug has been marked as a duplicate of bug 630598 ***