Opened 5 years ago

Closed 22 months ago

Last modified 7 months 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


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 - no such file or directory.


Attachments (1)

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

Download all attachments as: .zip

Change History (11)

comment:1 by pulkomandy, 5 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, 5 years ago

Probably the same thing happens in #11187.

comment:3 by haiqu, 5 years ago

OK, I got to the bottom 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.

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

comment:4 by haiqu, 5 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, 5 years ago

NB This is a purely x86 GCC4 build, fyi.

comment:6 by hamish, 5 years ago

Can you paste the result of:

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

Version 0, edited 5 years ago by hamish (next)

comment:7 by haiqu, 5 years ago


./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, 5 years ago

Attachment: fgrep.txt added

fgrep as requested

comment:8 by haiqu, 5 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 5 years ago by haiqu (previous) (diff)

comment:9 by waddlesplash, 22 months 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, 7 months ago

Milestone: Unscheduled

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

Note: See TracTickets for help on using tickets.