"Inconsistency detected by ld.so" when compiling
Original Reporter info from Mantis: sethdgrover@gmail.com
-
Reporter name: Seth Grover
Original Reporter info from Mantis: sethdgrover@gmail.com
- Reporter name: Seth Grover
Description:
After compiling and linking tw12704a.pp and tw12704b.pp in the tests on Ubuntu Linux 9.10 with FreePascal 2.4.0 (from the tags/release_2_4_0 tag in subversion) and then running it, ld.so complains with an error:
====================================================
user@localhost:/tmp$ export LD_LIBRARY_PATH=./tmp$ fpc tw12704a.pp
user@localhost:
Free Pascal Compiler version 2.4.0 [2009/12/07] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for i386
Compiling tw12704a.pp
tw12704a.pp(23,3) Note: Local variable "p" not used
Linking libtw12704a.so
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
107 lines compiled, 0.2 sec
1 note(s) issued
user@localhost:/tmp$ fpc tw12704b.pp /tmp$ ldd libtw12704a.so
Free Pascal Compiler version 2.4.0 [2009/12/07] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for i386
Compiling tw12704b.pp
tw12704b.pp(22,3) Note: Local variable "p" not used
Linking tw12704b
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
49 lines compiled, 0.1 sec
1 note(s) issued
user@localhost:
statically linked
user@localhost:/tmp$ ldd tw12704b/tmp$ ./tw12704b
linux-gate.so.1 => (0x0021c000)
libtw12704a.so => ./libtw12704a.so (0x00f0a000)
user@localhost:
Inconsistency detected by ld.so: dl-fini.c: 195: _dl_fini: Assertion `ns != 0 || i == nloaded' failed!
====================================================
However, if i add libc to the uses clause of tw12704b.pp I get no error.
Steps to reproduce:
Most of the feedback I've gotten from the mailing list about this issue is that I've got something wrong in my setup. However, to eliminate me doing anything wrong personally, here's what I did:
- Create a virtual machine and install a stock 32-bit Ubuntu 9.10 installation
- After it boots for the first time, install the "build-essential" and
"subversion" packages. I did not alter the distribution in ANY other way
other than installing these two packages.
- check out http://svn.freepascal.org/svn/fpc/tags/release_2_4_0 from svn
- compile (make clean all) and install (sudo make install) freepascal. I
used a ppc386 I extracted from the sourceforge debs to compile the
compiler, then I used samplecfg to generate my /etc/fpc.cfg
- Compile and run the tw12704a and tw12704b tests as I did in the description.
As far as I can see, there's no way it's something I'm going wrong.
Additional information:
After I did the steps to reproduce, I had a though and reverted to a snapshot in my VM before I started installing fpc from svn. I installed the fpc 2.2.4 from the standard ubuntu repositories and could not reproduce the problem. So it appears to be something changed in FPC recently (?).
Mantis conversion info:
- Mantis ID: 15278
- OS: Ubuntu Linux
- OS Build: 9.10 (2.6.31-14)
- Build: svn release_2_4_0 tag rev 14350
- Platform: x86
- Version: 2.3.1