Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 472680 - dev-db/sqlite[icu] failed to link; libstdc++.so.6 not found
Summary: dev-db/sqlite[icu] failed to link; libstdc++.so.6 not found
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Arfrever Frehtes Taifersar Arahesis
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-06-08 16:19 UTC by Simon Maurer
Modified: 2013-07-29 00:45 UTC (History)
1 user (show)

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


Attachments
patch file for fixing linker error with cross compiler (fix-cross-compile.patch,440 bytes, patch)
2013-06-08 16:19 UTC, Simon Maurer
Details | Diff
the build log for the unmodified ebuild (build.log,15.41 KB, text/plain)
2013-06-09 08:25 UTC, Simon Maurer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Maurer 2013-06-08 16:19:11 UTC
Created attachment 350414 [details, diff]
patch file for fixing linker error with cross compiler

sqlite is linked with gcc, but icu is a cpp library, which needs libstdc++.
This bug only appeared when I use an arm cross-compiler. Somehow it worked with x86_64-pc-linux-gnu-gcc, but the patch should fix the problem anyway.
Comment 1 Rafał Mużyło 2013-06-08 20:21:00 UTC
This looks incorrect, as it shouldn't be needed.

Attach full build log from that cross compiling and output of 'ldd -r' on the lib created in such build.
Comment 2 Simon Maurer 2013-06-09 08:25:55 UTC
Created attachment 350494 [details]
the build log for the unmodified ebuild

if I use arm-linux-gnueabi-g++ instead of arm-linux-gnueabi-gcc it works.
Comment 3 Rafał Mużyło 2013-06-09 11:41:01 UTC
(In reply to Simon Maurer from comment #2)
> Created attachment 350494 [details]
> the build log for the unmodified ebuild
> 
> if I use arm-linux-gnueabi-g++ instead of arm-linux-gnueabi-gcc it works.

Did you noticed, that the log basically says it's icu that's broken, not sqlite ?
Comment 4 Rafał Mużyło 2013-06-09 11:47:35 UTC
...or rather your environment.

It says that libicui18n and libicuuc link to libstdc++, but ld can't find it within the paths it searches.
Comment 5 Simon Maurer 2013-06-09 11:52:31 UTC
Yes because it is linked with gcc.


http://stackoverflow.com/questions/5853664/whats-the-difference-between-gcc-and-g-gcc-c
Comment 6 Simon Maurer 2013-06-09 11:57:46 UTC
Another solution could be to patch the configure script, so g++ is used for linking instead of gcc.
Comment 7 Rafał Mużyło 2013-06-09 14:02:57 UTC
(In reply to Simon Maurer from comment #5)
> Yes because it is linked with gcc.
> 
> 
> http://stackoverflow.com/questions/5853664/whats-the-difference-between-gcc-
> and-g-gcc-c

:roll: No, because your cross environment isn't set up correctly.

In case of native builds, gcc-config sets up an entry in /etc/ld.so.conf.d/ for gcc. Your arm-linux-gnueabi prefix seems to fail to do anything alike.
Comment 8 Simon Maurer 2013-06-11 12:17:22 UTC
Thank you for your help, i finally figured it out. You were right.
Here is the complete solution for the problem:

-create a symlink for the gcc libraries. 
mkdir /usr/arm-linux-gnueabi/usr/lib/gcc
cd /usr/arm-linux-gnueabi/usr/lib/gcc/
ln -s /usr/lib/gcc/arm-linux-gnueabi arm-linux-gnueabi

-add the ld path to the environment
echo "LDPATH=/usr/lib/gcc/arm-linux-gnueabi/4.7.3" > /usr/arm-linux-gnueabi/etc/env.d/05gcc-arm-linux-gnueabi

update the environment and check if the LDPATH was added to /usr/arm-linux-gnueabi/etc/ld.so.conf