Sign in Join

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

Mailing lists / fpc-pascal / 2016-08

Libraries-search-path of /usr/bin/ld ?

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

fredvs

Hello.

How to define the search path of libraries while linking ?

In a FreeBSD 64 multiarch system, fpc32 compiles without problems but at linking there is that message:

/usr/bin/ld: skipping incompatible /usr/lib/crti.o when searching for /usr/lib/crti.o

Of course because /usr/lib/crti.o is 64 bit.

The 32 bit libraries are in /usr/lib32/ and in /usr/local/lib32.

How to tell to *ld* to search in /usr/lib32 + /usr/local/lib32 while linking?

Similar problem on FreeBSD with Linux emulation enabled. fpc-linux (with Linux-units installed) can compile on FreeBSD but at linking there is a "ELF not recognized" message given by *ld*.

Can that be fixed too ?

PS: Absolutely no problem to compile and link using fpc.exe (via wine and with Windows-units installed) on a FreeBSD 64 system.

Thanks.

Fre;D

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Libraries-search-path-of-usr-bin-ld-tp5726191.html Sent from the Free Pascal - General mailing list .
Graeme Geldenhuys
to fredvs
fredvs wrote 6 lines
Of course because /usr/lib/crti.o is 64 bit. The 32 bit libraries are in /usr/lib32/ and in /usr/local/lib32. How to tell to *ld* to search in /usr/lib32 + /usr/local/lib32 while linking?

Take a look in your ~/.fpc.cfg file. If the following doesn't exist, add it, and specify the correct paths to the 32-bit libraries as found on your system.

# cross-compiling to i386 support - special library path #IFDEF cpui386
-Fl/usr/local/lib32
-Fl/usr/lib32
-Xd
#ENDIF

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp
fredvs
to Graeme Geldenhuys

Hello Graeme.

Take a look in your ~/.fpc.cfg file. If the following doesn't exist, add it, and specify the correct paths to the 32-bit libraries as found on your system.

Huh, of course it is the first thing that I did.
But, afaik, -Fl/something, has no impact on the search path of ld.

It seems that *ld* only want to search in /usr/lib.

-Xd

Or, maybe *-Xd * is the solution.
... What is -Xd ?

Many thanks.

Fre;D

PS: Do you have a idea how to link when using fpc-linux on a FreeBSD system with Linux emulation enabled ?

-----
Many thanks ;-)

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Libraries-search-path-of-usr-bin-ld-tp5726191p5726193.html Sent from the Free Pascal - General mailing list .