Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2011-11

crti.o problem

4 messages · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Henry Vermaak

Hi list

I've got a problem with crti.o not being found when compiling certain programs. Here's an example:

/usr/local/lib/fpc/2.6.0/ppcarm -gl -Fu. -Fu../lcl/units/arm-linux -Fu../components/lazutils/lib/arm-linux -Fu../lcl/units/arm-linux/gtk2 -Fu/usr/local/lib/fpc/2.6.0/units/arm-linux/rtl -FE. -FU. -Fl/usr/lib/gcc/arm-linux-gnueabi/4.6.1 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -CfSOFT -darm svn2revisioninc.pas Free Pascal Compiler version 2.6.0rc1 [2011/11/08] for arm Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for ARMEL
Compiling svn2revisioninc.pas
Assembling svn2revisioninc
Linking ./svn2revisioninc
/usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/local/lib/fpc/2.6.0/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/usr/local/lib/fpc/2.6.0/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'

When I add -Fl/usr/lib/arm-linux-gnueabi, the linking succeeds. It seems like the -Fl/etc/ld.so.conf.d/*.conf option that gets added by the compiler should work, since I've got the following under /etc/ld.so.conf.d (among other files):

cat /etc/ld.so.conf.d/arm-linux-gnueabi.conf
# Multiarch support
/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabi

But perhaps this isn't working as expected. Any ideas?

Henry

Reply by email

Henry Vermaak
to Henry Vermaak
Henry Vermaak wrote 27 lines
Hi list I've got a problem with crti.o not being found when compiling certain programs.  Here's an example: /usr/local/lib/fpc/2.6.0/ppcarm -gl  -Fu. -Fu../lcl/units/arm-linux -Fu../components/lazutils/lib/arm-linux -Fu../lcl/units/arm-linux/gtk2 -Fu/usr/local/lib/fpc/2.6.0/units/arm-linux/rtl -FE. -FU. -Fl/usr/lib/gcc/arm-linux-gnueabi/4.6.1 -Flinclude -Fl/etc/ld.so.conf.d/*.conf -CfSOFT -darm svn2revisioninc.pas Free Pascal Compiler version 2.6.0rc1 [2011/11/08] for arm Copyright (c) 1993-2011 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling svn2revisioninc.pas Assembling svn2revisioninc Linking ./svn2revisioninc /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/local/lib/fpc/2.6.0/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /usr/local/lib/fpc/2.6.0/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' When I add -Fl/usr/lib/arm-linux-gnueabi, the linking succeeds.  It seems like the -Fl/etc/ld.so.conf.d/*.conf option that gets added by the compiler should work, since I've got the following under

Sorry, bad assumption, it's not the compiler. Fpcmake adds all the entries in /etc/ld.so.conf, which gets added in turn to -Fl option(s). The problem is that the entries in /etc/ld.so.conf may contain wildcards. Using $(wildcard $var) won't work if the entry doesn't contain a pattern, though, so each entry will have to be checked for wildcards.

Henry

Reply by email

Henry Vermaak
to Henry Vermaak
Henry Vermaak wrote 6 lines
Sorry, bad assumption, it's not the compiler.  Fpcmake adds all the entries in /etc/ld.so.conf, which gets added in turn to -Fl option(s).  The problem is that the entries in /etc/ld.so.conf may contain wildcards.  Using $(wildcard $var) won't work if the entry doesn't contain a pattern, though, so each entry will have to be checked for wildcards.

Actually, a solution would be to add this to fpcmake.ini:

OTHERLIBDIR += $(wildcard $(OTHERLIBDIR))

This is a bit dirty, since the wildcard will still be passed to -Fl, which will ignore it, presumably. A better solution would of course be to enable -Fl to accept wildcards.

Henry

Reply by email

Henry Vermaak
to Henry Vermaak
Henry Vermaak wrote 15 lines
On 8 November 2011 14:38, Henry Vermaak wrote: > Sorry, bad assumption, it's not the compiler.  Fpcmake adds all the > entries in /etc/ld.so.conf, which gets added in turn to -Fl option(s). >  The problem is that the entries in /etc/ld.so.conf may contain > wildcards.  Using $(wildcard $var) won't work if the entry doesn't > contain a pattern, though, so each entry will have to be checked for > wildcards. Actually, a solution would be to add this to fpcmake.ini: OTHERLIBDIR += $(wildcard $(OTHERLIBDIR)) This is a bit dirty, since the wildcard will still be passed to -Fl, which will ignore it, presumably.  A better solution would of course be to enable -Fl to accept wildcards.

Sigh, none of this will work, since, /etc/ld.so.conf here contains a wildcard of files (with an "include" in front), which in turn contains directories. Fpcmake assumes that /etc/ld.so.conf contains directories. Is this already solved in fpmake?

Henry

Reply by email