[fpc-pascal] mips cross compiler libraries (and crti.o) problem

Luca Olivetti luca at ventoso.org
Mon Oct 8 16:25:52 CEST 2018


Hello,

I built an fpc-3.0.4 mips cross compiler on kubuntu 18.04 using the 
prepackaged mips binutils with

make all BINUTILSPREFIX=mips-linux-gnu- CPU_TARGET=mips OS_TARGET=linux
sudo make crossinstall BINUTILSPREFIX=mips-linux-gnu- CPU_TARGET=mips 
OS_TARGET=linux


When I try to compile the program I get this error:

luca at seis:~/Datos/lgmounter$ ppcrossmips lgmounter.pas
Free Pascal Compiler version 3.0.4 [2018/10/07] for mips
Copyright (c) 1993-2017 by Florian Klaempfl and others
Target OS: Linux for MIPSEB
Compiling lgmounter.pas
Compiling synaser.pas
Compiling synafpc.pas
Assembling synafpc
Compiling synautil.pas
synautil.pas(564,51) Warning: Symbol "TimeSeparator" is deprecated
synautil.pas(1804,43) Warning: Symbol "ShortMonthNames" is deprecated
synautil.pas(1805,42) Warning: Symbol "ShortMonthNames" is deprecated
Assembling synautil
synaser.pas(2278,41) Warning: range check error while evaluating 
constants (4294967295 must be between -2147483648 and 2147483647)
Assembling synaser
Assembling lgmounter
Linking lgmounter
lgmounter.pas(274) Warning: "crtbegin.o" not found, this will probably 
cause a linking failure
lgmounter.pas(274) Warning: "crtend.o" not found, this will probably 
cause a linking failure
mips-linux-gnu-ld: warning: link.res contains output sections; did you 
forget -T?
mips-linux-gnu-ld: skipping incompatible 
/usr/lib/x86_64-linux-gnu/crti.o when searching for 
/usr/lib/x86_64-linux-gnu/crti.o
mips-linux-gnu-ld: cannot find /usr/lib/x86_64-linux-gnu/crti.o
mips-linux-gnu-ld: skipping incompatible 
/usr/lib/x86_64-linux-gnu//libdl.so when searching for -ldl
mips-linux-gnu-ld: skipping incompatible 
/usr/lib/x86_64-linux-gnu//libdl.a when searching for -ldl
mips-linux-gnu-ld: skipping incompatible 
/usr/lib/i386-linux-gnu//libdl.so when searching for -ldl
mips-linux-gnu-ld: skipping incompatible 
/usr/lib/i386-linux-gnu//libdl.a when searching for -ldl
mips-linux-gnu-ld: cannot find -ldl
mips-linux-gnu-ld: skipping incompatible 
/usr/lib/x86_64-linux-gnu//libc.so when searching for -lc
mips-linux-gnu-ld: skipping incompatible 
/usr/lib/x86_64-linux-gnu//libc.a when searching for -lc
mips-linux-gnu-ld: skipping incompatible 
/usr/lib/i386-linux-gnu//libc.so when searching for -lc 

mips-linux-gnu-ld: skipping incompatible /usr/lib/i386-linux-gnu//libc.a 
when searching for -lc 

mips-linux-gnu-ld: cannot find -lc 
 

lgmounter.pas(274) Error: Error while linking 
 

lgmounter.pas(274) Fatal: There were 1 errors compiling module, stopping 
 

Fatal: Compilation aborted

I copied libc.so and libdl.so from the target into the directory 
/home/luca/mipslibs 
 


I also had to copy crtbegin.o  crtend.o  crti.o  crtn.o from an openwrt 
buildroot for the target (is that correct? I couldn't find them on the 
target)

What I tried:

1) putting this in /etc/fpc.cfg

#ifdef cpumips
-Fl/home/luca/mipslibs
#endif


2) adding a file in /etc/ld.so.conf.d with /home/luca/mipslibs and 
running ldconfig


3) putting in the PATH a custom mips-gnu-linux-ld that adds an 
--rpath=/home/luca/mipslibs/ before calling ld [*]

but the error message is always the same.

What am I doing wrong?

Bye
-- 
Luca



More information about the fpc-pascal mailing list