[fpc-pascal] FPC and Mac OS X 10.5

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Jul 14 23:51:30 CEST 2008


On 14 Jul 2008, at 23:03, Mattias Gaertner wrote:

> On Fri, 26 Oct 2007 16:58:29 +0200
> Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
>
>> [...]
>> * The new linker deals differently with stabs debug information
>> compared to previous versions, causing a lot of "Unknown stabs"
>> warnings and also some errors during linking
>> - Effect: you can't compile code with stabs debug information
>> - Occurs: with any program compiled with stabs debug information
>> (programs compiled on 10.4 with stabs may still be debuggable on
>> 10.5 though)
>> - Fix: already in FPC 2.3.1 (not yet merged to FPC 2.2.1)
>
> Strange. I installed FPC 2.3.1 from svn and I still get the unknown
> stabs errors.

That's because it also has to be partly fixed in the linker (which I  
didn't realise when I posted that message). The unknown stabs warnings  
(they're not errors afaik) are caused by stabs for local constants in  
functions/procedures (the linker interprets them as function stabs,  
because they have a very similar format and gcc does not generate  
stabs for constants).

If you want, you can download a patched linker from http://trappist.elis.ugent.be/~jmaebe/cctools/ 
  (extract it to some directory, add a symbolic link to /usr/bin/as in  
the same directory, and point FPC to it using the -FD command line  
switch). That linker corresponds to the one shipped with Xcode 3.0 (+  
the patches in that directory).

But since end users most likely won't have that patched linker (and  
because stabs has been deprecated by Apple), you may want to switch to  
dwarf instead on Mac OS X 10.5+

> And I get a lot warnings like:
> ld: warning in zbase.o, file is not of required architecture

That normally means what it says: you are trying to link a PowerPC  
object file into an Intel binary or vice versa. I don't know why this  
would happen unless you somehow overwrote certain object files without  
overwriting the associated ppu files, have some strange object search  
path, etc. You can use the file command to check the architecture of  
an object file using the "file" command.

And also take into account the comments of the first note at http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=11270#bugnotes 
  (but that only affects the finally linked binaries and not the  
compilation of the unit object files).

> And finally a lot of missing symbols so linking fails. :(

That's because of the right object files were not found.


Jonas



More information about the fpc-pascal mailing list