[fpc-pascal] The strange case of arm-linux-ld: skipping incompatible

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Sat Nov 26 20:24:17 CET 2011


On Sat, Nov 26, 2011 at 2:57 PM, Sven Barth <pascaldragon at googlemail.com> wrote:
> There should be something similar as C applications AFAIK rely on this.
> Otherwise we'd need to change arm-linux to use an internal sysinit like
> i386-linux and the Windows targets do.

Yes, the ndk r7 has something similar, but it has many files, which
look like this:

crtbegin.o
crtbeginS.o
crtbeginT.o
crtend.o
crtendS.o
libgcc.a
libgcov.a

In prebilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3

There is no crtn.o in r7

In r5 there was:

crtbegin.o
crtend.o
crti.o
crtn.o
libgcc.a
libgcov.a

> I have taken a look at the compiler's code that leads to the inclusion of
> "crtn.o" (for the curious:
> compiler/systems/t_linux.pas/tlinkerlinux.WriteResponseFile). It searches
> for the file in the set library search path (this is extended by the "-Fl"
> option). Thus you should add - as Jonas wrote - the "-Xd" option which tells
> the compiler to not search in the default paths (the help of FPC even
> mentions that this option is "needed for cross compilation").

Quite interresting, Jonas did mention that, but I hadn't understood
his e-mail. Now I explored a bit more what -Xd can do for us here and
if I use it, then it will add both crtn.o and crtbegin.o from the ndk
r5 and the application seams to work just the same. Now I also see
that there are many folders from which to choose from with many
different sets of .o files.

I am quite confused about why there are so many .o files, what each of
them does and which ones should be linked into the library.
Unfortunately the ndk documentation is much worse then the sdk
documentation. It isn't even available online for browsing.

-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list