Problem with libstdc++

Hello,
I do use angstrom, the 2.6.22-omap3-kernel and CodeSourcery from http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

I do not have a problem compiling and running simple hello world-programs. But when I try to execute a bigger one I get this error:

./deviceinfo: /usr/lib/libstdc++.so.6: no version information available (required by ./deviceinfo)
./deviceinfo: /usr/lib/libstdc++.so.6: no version information available (required by ./deviceinfo)
./deviceinfo: /usr/lib/libstdc++.so.6: no version information available (required by ./deviceinfo)
./deviceinfo: /usr/lib/libstdc++.so.6: no version information available (required by /usr/local/lib/libxyz.so)

How can I solve this?

Robert

Just to make sure: did you copy the CodeSourcery libstdc++ into
your /usr/lib directory on the Beagle?

Laurent

Eeks! Do you want to break all C++ apps on the device?

Hello,
I do use angstrom, the 2.6.22-omap3-kernel and CodeSourcery from
http://www.codesourcery.com/gnu_toolchains/arm/portal/release313

I do not have a problem compiling and running simple hello world-programs.
But when I try to execute a bigger one I get this error:

./deviceinfo: /usr/lib/libstdc++.so.6: no version information available
(required by ./deviceinfo)
./deviceinfo: /usr/lib/libstdc++.so.6: no version information available
(required by ./deviceinfo)
./deviceinfo: /usr/lib/libstdc++.so.6: no version information available
(required by ./deviceinfo)
./deviceinfo: /usr/lib/libstdc++.so.6: no version information available
(required by /usr/local/lib/libxyz.so)

How can I solve this?

Running apps built with one toolchain on a machine with a rootfs using
a different toolchain is a recipe for disaster. Well, at least some
painful debugging sessions.

Philip

Right :slight_smile: The alternative is to copy these libraries in a separate
directory and play with LD_LIBRARY_PATH.

But Philip has the right solution: use the target libraries, not the
ones provided with CSL gcc.

Laurent

Hello,

thank you for your answer. But what can I do? Recompile the whole Angstrom-Distribution? Use a different compiler?

Robert

2008/10/9 Philip Balister <philip.balister@gmail.com>

Robert,

Here's what I do to link BeagleBoard applications programs on my host
machine (PC running Windows 2000 and Cygwin). As suggested above, the
important thing is to make executables on your host machine that link
to the same Ångström libraries on BeagleBoard. What I did was to
untar the Ångström demo root file system on my PC, and then tell
CodeSourcery to link to the Ångström demo's libraries instead of the
defaults. All or most of these are dynamic shared libraries (.so).
Here are my gnu make commands:

# Set $(cc) to CodeSourcery GCC compiler and tell it to generate code
for armv7-a:
cc = arm-none-linux-gnueabi-gcc -O -Wunused -march=armv7-a

# Set $(RTdir) to PC directory containing Ångström demo run-time
libraries:
RTdir = /cygdrive/c/John/Beagle/AngstromDemo/usr/lib

# Set $(GXC_OBJS) to my list of object code files for my application:
GXC_OBJS = <list of object code files .o generated by $(cc)>

# Here is the GCC command to build my executable called "gboot".
# I need to specify RTdir both for -L and -rpath options.
gboot: $(GXC_OBJS)
  $(cc) -o $@ $(GXC_OBJS) -L$(RTdir) \
    -Xlinker -rpath -Xlinker $(RTdir) -lX11 -lm

The "-L" option tells the linker to look in $(RTdir) for .a files.
The "-rpath" linker option tells the linker to look in $(RTdir)
for .so files.
The "-Xlinker" option tells gcc to pass the next string to the
linker. You need an "-Xlinker" option for each string passed, so
"-Xlinker -rpath -Xlinker $(RTdir)" passes "-rpath $(RTdir)" to the
linker.

The linker generates a small executable that includes references to
the functions in the .so files, but does not include the bodies of
those functions. When you run that executable on Ångström, it finds
the .so files and dynamically links them in. If you linked your
program using these same .so files, the references will be correct and
Ångström will link them in correctly.

Hope this helps.

John Beetem wrote:

Robert,

Here's what I do to link BeagleBoard applications programs on my host
machine (PC running Windows 2000 and Cygwin). As suggested above, the
important thing is to make executables on your host machine that link
to the same Ångström libraries on BeagleBoard. What I did was to
untar the Ångström demo root file system on my PC, and then tell
CodeSourcery to link to the Ångström demo's libraries instead of the
defaults. All or most of these are dynamic shared libraries (.so).
Here are my gnu make commands:

# Set $(cc) to CodeSourcery GCC compiler and tell it to generate code
for armv7-a:
cc = arm-none-linux-gnueabi-gcc -O -Wunused -march=armv7-a

# Set $(RTdir) to PC directory containing Ångström demo run-time
libraries:
RTdir = /cygdrive/c/John/Beagle/AngstromDemo/usr/lib

# Set $(GXC_OBJS) to my list of object code files for my application:
GXC_OBJS = <list of object code files .o generated by $(cc)>

# Here is the GCC command to build my executable called "gboot".
# I need to specify RTdir both for -L and -rpath options.
gboot: $(GXC_OBJS)
  $(cc) -o $@ $(GXC_OBJS) -L$(RTdir) \
    -Xlinker -rpath -Xlinker $(RTdir) -lX11 -lm

The "-L" option tells the linker to look in $(RTdir) for .a files.
The "-rpath" linker option tells the linker to look in $(RTdir)
for .so files.
The "-Xlinker" option tells gcc to pass the next string to the
linker. You need an "-Xlinker" option for each string passed, so
"-Xlinker -rpath -Xlinker $(RTdir)" passes "-rpath $(RTdir)" to the
linker.

The linker generates a small executable that includes references to
the functions in the .so files, but does not include the bodies of
those functions. When you run that executable on Ångström, it finds
the .so files and dynamically links them in. If you linked your
program using these same .so files, the references will be correct and
Ångström will link them in correctly.

Hope this helps.

Sounds like this is worth adding to wiki/FAQ :wink:

Dirk

Hello John,

thank you, I will give it a try. I use OpenSUSE10.3 and will report any failure or sucess.

thanks again
Robert

2008/10/9 John Beetem <johnbeetem@yahoo.com>

You can also try setting your path to
PATH=$(HOME)/oe/tmp/cross/armv7a/bin/ and using these tools. This has
worked for me in the past. This is the toolchain used by OE.

Philip

Hello again :slight_smile:

Here's what I do to link BeagleBoard applications programs on my host
machine...

I am still struggling with this problem.

I thought that when I am using Angstrom and CS2007q3 as compiler I do
not have this problem because Angstrom is build with CS2007q3 and so
when I use CS2007q3 too I link against the same libs?!?

Does Angstrom uses the CS2007q3 libs or does Angstrom compiles its own
libraries? How can I solve this when using linux? Is it the same like
on windows?

Thanks for any help or tips - Robert

I tried that without success. This is what I did:
* Install OE following the instructions from
http://elinux.org/BeagleBoardAndOpenEmbeddedGit
* changed PATH:
~/oe$ echo $PATH
/home/developer/oe/tmp/cross/armv7a/bin:/bin:/usr/bin
* Compiled qtopia for arm
* boot the beagle with the Angstrom-image
* try to execute a example program:
root@beagleboard:/usr/local/Trolltech/QtEmbedded-4.4.3-arm/examples/dialogs/findfiles#
./findfiles -qws
./findfiles: error while loading shared libraries: libstdc++.so.6:
cannot open shared object file: No such file or directory

My questions:
How can I solve this?
How can I build the Angstrom-X11-image?
Is there somewhere a description how to make a
cross-plattform-build-system for beginners like me?

Thankfull for any help - Robert

Try to add the directory containing the .so files to your LD_LIBRARY_PATH
environment variable on your Beagle.

Laurent

root@beagleboard:/usr/local/Trolltech/QtEmbedded-4.4.3-arm/examples/dialogs/findfiles#
./findfiles -qws
./findfiles: error while loading shared libraries: libstdc++.so.6:
cannot open shared object file: No such file or directory

My questions:
How can I solve this?

Try to add the directory containing the .so files to your LD_LIBRARY_PATH
environment variable on your Beagle.

Sorry, forget to mention that:
root@beagleboard:/# find . -name libstdc,*
root@beagleboard:/#

The Angstrom-consle-image does not contain this file (at least on my system).
Now I try to build a Angstrom-X11-Image. Is it correct that therefore
I have to change the line
DISTRO = "angstrom-2008.1"
in $OE_HOME/beagleboard/beagleboard/conf to something else?

Robert

Why aren't you using the qtembedded 4.4.3 from OE?

regards,

Koen

Cause I want to test if my cross plattform compile setup is correct
and working. qtopia was only an example.

Robert

Okay, I found
bitbake x11-image
...

Robert

I agree that this is a general area of confusion. Once this
discussion settles in, I'll try to post to our wiki. But I have
questions about the gestalt. And these questions are because I'm
relatively new to the community approach.

The confusion arises from there being two (at least) different
environments being used on Beagle. There is the TI PSP Kernel
(2.6.22) that is in http://code.google.com/p/beagleboard/wiki/BeagleSourceCode
and elsewhere. And there is the Angstrom Kernel (2.6.26-27) that is
described in: http://code.google.com/p/beagleboard/wiki/HowToGetAngstromRunning.
Both use the same toolchain, but they have different libraries. So
applications need to be built twice -- once for TI Linux and once for
Angstrom Linux.

Over time, will this converge? Or over time, will people gravitate to
one platform so that developers don't have to build twice? Or will it
stay so that we essentially need to always build our own versions of
everything for our specific platforms? How does the community see
this playing out?

Thanks very much for your ideas here.

Best regards,
Geof

I believe you should not mix the kernel on the one hand and the
Linux-images on the other side.

You can use TI's omap3-kernel or the git kernel with angstrom - as you
like it. (I think so, I used both without any problem).

The problem here is how to cross compile on a x86-linux-machine for
the beagleboard.

Robert

And that's where you make a mistake. There's no such thing as "cross-
compiling for beagle". ARM has at least 10 different ABIs that can't
mixed (e.g. softfpa OABI, hardfpa OABI, EABI, etc). You need to
crosscompile things for the distribution you are running on a device,
not for the device itself.

regards,

Koen