[fpc-devel] FPC on SPARC Linux

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Wed Jan 7 12:00:49 CET 2015


Mark Morgan Lloyd wrote:
> Pierre Free Pascal wrote:
>> Hi  Mark,
>>
>> did you try to generate the libraries needed to compile FP IDE with 
>> GDB support by
>> using the script in fpcsrc/packages/gdbint/gen-gdblib-inc.sh ?
>>
>> If you have a build directory of a certain GDB version (let's say 7.8.1
>> as an example), simply copy the script over to build-gdb-7.8.1/gdb, 
>> and run
>> it locally.
>>
>>  This script tries to determine all the libraries needed
>> and generates a second script called copy-libs.sh
>> that you should call in turn, with a simple arg, the target directory,
>> for example, ./copy-libs.sh ~/pas/libgdb-7.8.1
>>
>> After that,
>>   using make -C ./packages/gdbint GDBLIBDIR=~/pas/libgdb-7.8.1
>> followed by
>> make -C ide GDBLIBDIR=~/pas/libgdb-7.8.1
>> should makes the things much easier.
>>
>> One caveat is to avoid system installed libraries to be installed 
>> instead of the ones inside this directory.
>>  On systems on which I got this problem, I had to manually
>> remove all lines {$librarypath XXX}
>> where XXX resolved to /usr/lib or /lib

I've found where we discussed this before, about August 2013. Part of 
the solution at the time was to use -Xd but...

>> In the hope this will help,
>>
>> Pierre Muller
> 
> Thanks Pierre, I'll investigate. OTOH the existing GDB 6.7.1 libraries 
> appear sufficient for 2.2.4 through 2.4.4 and for 2.6.4, all on the same 
> system without any underlying adjustments.

The problem is that there's now a -Xd being put in the internal command 
line, without a -Fl for the location of libgcc.a since it's no longer 
being picked up from fpc.cfg.

If I add an explicit -Fl/usr/lib/gcc/sparc-linux-gnu/4.4 (or whatever) 
to match libgcc.a then fp builds and runs with libgcc, although I've not 
tested this aggressively. There was an outdated reference to 4.3.2 in 
fpc.cfg which had been moved around between several generations of 
machines, this could have affected some earlier builds.

Is there a more appropriate way of doing this than using OPT=-Fl..., and 
is having a fixed path for libgcc in fpc.cfg still appropriate?

Noting that the makefile is able to work around the case where it can't 
find libgdb, could something similar be done for libgcc? In other words, 
a stern warning that something's not right without screwing the entire 
build?

I notice that on at least some systems (not limited to SPARC) the libgcc 
path in /etc/fpc.cfg is derived from the gcc version info even if this 
doesn't match what's on disc, e.g. something like ...linux-gnu/4.3.2 
rather than ...linux-gnu/4.3

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-devel mailing list