fpc silently omits crti.o and crtn.o from linker script if it can't find them.
Original Reporter info from Mantis: plugwash
-
Reporter name: peter green
Original Reporter info from Mantis: plugwash
- Reporter name: peter green
Description:
When building a program that links against a C library if fpc can't find crti.o and crtn.o it silently leaves them out of the linker script. On i386 and x86-64 the program is linked sucessfully anyway. However on other platforms it causes link errors. For example.
Linking test
/usr/bin/ld.bfd.real: warning: link.res contains output sections; did you forget -T?
./usr/lib/fpc/2.6.0/units/arm-linux/rtl/cprt0.o: In function _haltproc_eabi':<br/> (.text+0x88): undefined reference to
_fini'
./usr/lib/fpc/2.6.0/units/arm-linux/rtl/cprt0.o: In function _haltproc_eabi':<br/> (.text+0x90): undefined reference to
_init'
test.dpr(4,4) Error: Error while linking
test.dpr(4,4) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
These errors do not make it at all obvious that the problem is that freepascal can't find files it needs.
This happens at least with 2.6.0 and 2.6.2 but i'm fairly sure it happens over a wider range of versions than that.
Mantis conversion info:
- Mantis ID: 24518
- OS: linux
- Platform: arm, powerpc, sparc
- Version: 2.6.0
- Fixed in version: 3.0.0
- Fixed in revision: 23892 (#7511968f)