Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 285067 - dev-libs/icu-4.0.1 fails to build on IRIX due to LD_LIBRARY_PATH assumptions
Summary: dev-libs/icu-4.0.1 fails to build on IRIX due to LD_LIBRARY_PATH assumptions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All IRIX
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-15 10:29 UTC by Stuart Shelton
Modified: 2009-09-27 07:58 UTC (History)
0 users

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


Attachments
icu-4.0.1.ebuild.patch for IRIX (icu.patch,991 bytes, patch)
2009-09-26 21:59 UTC, Stuart Shelton
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2009-09-15 10:29:04 UTC
dev-libs/icu-4.0.1 fails with:

make[0]: Making `all' in `data'
make[1]: Entering directory `/usr/opt/gentoo/var/tmp/portage/dev-libs/icu-4.0.1/work/icu/source/data'
/opt/gentoo/bin/bash ../mkinstalldirs ./out ./out/build ./out/build/icudt40b ./out/build/icudt40b/brkitr ./out/build/icudt40b/coll ./out/build/icudt40b/rbnf ./out/build/icudt40b/translit ./out/tmp ./out/tmp/coll ./out/tmp/rbnf ./out/tmp/translit ./out/tmp/brkitr
mkdir ./out
mkdir ./out/build
mkdir ./out/build/icudt40b
mkdir ./out/build/icudt40b/brkitr
mkdir ./out/build/icudt40b/coll
mkdir ./out/build/icudt40b/rbnf
mkdir ./out/build/icudt40b/translit
mkdir ./out/tmp
mkdir ./out/tmp/coll
mkdir ./out/tmp/rbnf
mkdir ./out/tmp/translit
mkdir ./out/tmp/brkitr
LD_LIBRARY_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARY_PATH  ../bin/icupkg -tb ./in/icudt40l.dat ./out/icudt40b.dat
112344075:../bin/icupkg: rld: Fatal Error: Cannot Successfully map soname 'libicutu.so.40' under any of the filenames /opt/gentoo/usr/lib32/libicutu.so.40:/opt/gentoo/lib32/libicutu.so.40:/opt/gentoo/usr/lib32/nspr/libicutu.so.40:/usr/opt/gentoo/usr/lib32/binutils/mips-sgi-irix6.5/2.19.51.0.14/libicutu.so.40:/usr/lib32/libicutu.so.40:/usr/lib32/internal/libicutu.so.40:/lib32/libicutu.so.40:/opt/lib32/libicutu.so.40:
make[1]: *** [out/icudt40b.dat] Error 1
make[1]: Leaving directory `/usr/opt/gentoo/var/tmp/portage/dev-libs/icu-4.0.1/work/icu/source/data'
make: *** [all-recursive] Error 2
 * ERROR: dev-libs/icu-4.0.1 failed:
 *   emake failed
 *
 * Call stack:
 *               ebuild.sh:  51: <call call-ebuildshell 'src_compile'>
 *             environment: 602: <call src_compile>
 *             environment:3154: <call _eapi2_src_compile>
 *               ebuild.sh: 700:                emake || die "emake failed"


... because, on IRIX, LD_LIBRARY_PATH is only for o32 binaries, not n32 (or, indeed, 64 bit binaries).

If this failing instruction is changed to:

LD_LIBRARYN32_PATH=../lib:../stubdata:../tools/ctestfw:$LD_LIBRARYN32_PATH  ../bin/icupkg -tb ./in/icudt40l.dat ./out/icudt40b.dat

... then the command succeeds.

The good news is that the build system does appear to anticipate this situation, and 'icudefs.mk' contains:

# Environment variable to set a runtime search path
LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH

... which could presumably be altered/overwritten in the ebuild for CHOST == *-irix* (as the value seems to be hardcoded in 'icudefs.mk.in').

There also seems to be a 'config/mh-irix' file, although this doesn't include a LD_LIBRARY_PATH setting.

The ebuild could be modified as follows:

if [[ $CHOST == *-irix* ]]; then
    case "$ABI" in
        mipso32)
            :
            ;;
        mips64)
            echo "LDLIBRARYPATH_ENVVAR = LD_LIBRARY64_PATH" >> \
                ${S}/source/config/mh-irix
            export LDLIBRARYPATH_ENVVAR=LD_LIBRARY64_PATH
            ;;
        *)
            echo "LDLIBRARYPATH_ENVVAR = LD_LIBRARYN32_PATH" >> \
                ${S}/source/config/mh-irix
            export LDLIBRARYPATH_ENVVAR=LD_LIBRARYN32_PATH
            ;;
    esac
fi

I'll test this now (the build takes some time) and report back on whether such a change succeeds.
Comment 1 Fabian Groffen gentoo-dev 2009-09-15 10:32:55 UTC
Is it possible to put that logic in config/mh-irix instead?  In that case upstream might pick it up.
Comment 2 Stuart Shelton 2009-09-15 13:46:35 UTC
It'd much much cleaner, certainly - but I'm not sure that the Makefiles will pick up the (Gentoo-specific) Portage environment variables.

I'm not aware of any generic way of determining the active ABI without directly inspecting CFLAGS for -o32/-32/-n32/-64 - and even then this variable may be unset, over-ridden, or changed before compilation.

I could well be missing something obvious, though ;)
Comment 3 Stuart Shelton 2009-09-15 17:11:05 UTC
Just to confirm, altering the 'mh-irix' file (only) does allow the build to progress past the above problem.

I seem to remember from my test-build that one of the utilities built during the build process calls $CC with arguments on the wrong order (something like '-c -o file.out file.c', or something that MIPSpro doesn't like, at least) which also breaks the build - testing now.
Comment 4 Stuart Shelton 2009-09-16 12:44:49 UTC
Okay - after trawling the run-time linker manpages I have a better solution:

Although the documentation strongly advises against it, for backwards compatibility LD_LIBRARY_PATH can be used as a fall-back for rld if neither LD_LIBRARYN32_PATH or LD_LIBRARY64_PATH are set.

Therefore, this fix works:

--- icu-4.0.1.ebuild
+++ icu-4.0.1.ebuild
@@ -76,6 +76,33 @@ src_prepare() {
 }
 
 src_configure() {
+       if [[ ${CHOST} == *-irix* ]]; then
+               if [[ -n "${LD_LIBRARYN32_PATH}" || -n "${LD_LIBRARY64_PATH}" ]]; then
+                       case "${ABI:-$DEFAULT_ABI}" in
+                               mips32)
+                                       if [[ -z "${LD_LIBRARY_PATH}" ]]; then
+                                               LD_LIBRARY_PATH="${LD_LIBRARYN32_PATH}"
+                                       else
+                                               LD_LIBRARY_PATH="${LD_LIBRARYN32_PATH}:${LD_LIBRARY_PATH}"
+                                       fi
+                                       ;;
+                               mips64)
+                                       if [[ -z "${LD_LIBRARY_PATH}" ]]; then
+                                               LD_LIBRARY_PATH="${LD_LIBRARY64_PATH}"
+                                       else
+                                               LD_LIBRARY_PATH="${LD_LIBRARY64_PATH}:${LD_LIBRARY_PATH}"
+                                       fi
+                                       ;;
+                               mipso32|*)
+                                       :
+                                       ;;
+                       esac
+               fi
+               export LD_LIBRARY_PATH
+               unset  LD_LIBRARYN32_PATH
+               unset  LD_LIBRARY64_PATH
+       fi
+
        econf \
                --enable-static \
                $(use_enable debug) \
Comment 5 Fabian Groffen gentoo-dev 2009-09-25 15:35:29 UTC
can you attach that latter patch so I can apply it straight away?
Comment 6 Stuart Shelton 2009-09-26 21:59:40 UTC
Created attachment 205344 [details, diff]
icu-4.0.1.ebuild.patch for IRIX
Comment 7 Fabian Groffen gentoo-dev 2009-09-27 07:58:14 UTC
committed, thanks