Opened 9 years ago

Closed 6 years ago

Last modified 5 years ago

#12112 closed bug (invalid)

runtime_loader cannot find libstdc++

Reported by: haiqu Owned by: bonefish
Priority: normal Milestone:
Component: System/runtime_loader Version: R1/Development
Keywords: Lazarus Cc:
Blocked By: Blocking:
Platform: All

Description

Recently built Lazarus from sources on a hybrid system with the GCC4 compiler. Qt runs fine, FPC runs fine, Lazarus compiles without error. When invoked, Lazarus causes the following system message:

runtime_loader cannot find libstdc++.so.6 - no such file or directory.

Bizarre.

Attachments (1)

fgrep.txt (5.7 KB ) - added by haiqu 9 years ago.
fgrep as requested

Download all attachments as: .zip

Change History (11)

comment:1 by pulkomandy, 9 years ago

This error is usually caused by linking together apps/libs using both the gcc2 and gcc4 runtime. In this case, you probably used a gcc4 Qt with a gcc2 fpc?

comment:2 by diver, 9 years ago

Probably the same thing happens in #11187.

comment:3 by haiqu, 9 years ago

OK, I got to the bpottom of this one. Using 'strace -l lazarus > strace.txt' and reading the result it's clear that the system is never searching /boot/system/lib/x86 for the required libraries. You can also see this by doing 'setarch x86' then dumping the environment to screen. The library path is always the gcc2 files.

Version 0, edited 9 years ago by haiqu (next)

comment:4 by haiqu, 9 years ago

And as proof, I did this:

export LIBRARY_PATH=/boot/system/lib/x86:$LIBRARY_PATH

and it started right up!

comment:5 by haiqu, 9 years ago

NB This is a purely x86 GCC4 build, fyi.

comment:6 by hamish, 9 years ago

Can you paste the result of these commands:

objdump -s --section .comment /path/to/binary

objdump -x /path/to/binary | fgrep RPATH

Last edited 9 years ago by hamish (previous) (diff)

comment:7 by haiqu, 9 years ago

Sure.

./lazarus: file format elf32-i386

Contents of section .comment:

0000 00474343 3a202847 4e552920 322e3935 .GCC: (GNU) 2.95 0010 2e332d68 61696b75 2d323031 345f3037 .3-haiku-2014_07 0020 5f323600 _26.

I'll attach the fgrep, it's pretty big.

by haiqu, 9 years ago

Attachment: fgrep.txt added

fgrep as requested

comment:8 by haiqu, 9 years ago

Dunno where that .comment section got gcc2 from, although I did use a pre-packaged version of FPC and it may have been compiled with gcc2

Edit: Nope, an objdump of FPC shows it was built with GCC4

Last edited 9 years ago by haiqu (previous) (diff)

comment:9 by waddlesplash, 6 years ago

Resolution: invalid
Status: newclosed

You must have linked with LD from GCC2 binutils, that will use the init_term_dyn and GCC2 crtbegin/crtend. Either way, this isn't a runtime_loader bug, for certain.

comment:10 by nielx, 5 years ago

Milestone: Unscheduled

Remove milestone for tickets with status = closed and resolution != fixed

Note: See TracTickets for help on using tickets.