[fpc-pascal] Problem with Objective Pascal and delphi mode

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Jan 31 14:37:21 CET 2010


On 31 Jan 2010, at 12:47, Michael Van Canneyt wrote:

> On Sat, 30 Jan 2010, Jonas Maebe wrote:
> 
>> It means/meant version one of the Objective-C language. The Objective-C language evolves semi-independently of the run time (you can write programs in Objective-C 2.0 running on i386 and ppc32, whose Objective-C runtime is version 1). Objective-C 2.0 (the language) features require Mac OS X 10.5 or later, while 1.0 features are available as of 10.0.
> 
> Eh ?
> 
> How can a programming language feature depend on an operating system ?

Objective-C, being a very dynamic language, relies on support in a runtime library for several language features (even method dispatching is handled using interaction with the runtime). Mac OS X 10.4 and earlier ship with a version of the runtime library that does not support all features added in the Objective-C 2.0 language. For example, it has no RTTI support for properties or garbage collected classes (GC requires for each class a layout in the rtti that describes which fields contain strong and which contain weak references to class instances).

You could in theory build a newer version of the run time library and include that with your app, but given how dynamic linking is implemented in Mac OS X (the absolute path to a dynamic library is hardcoded in applications/libraries that use this library, in order to avoid accidentally loading a wrong/different version if it happens to be in the path), you'd probably end up with two versions of the Objective-C run time library in memory at the same time (one for your app, and one for the system libraries -- which would have exactly the same consequences as using an FPC app with an FPC library and both having their own copy of the rtl: no shared class hierarchy etc).

So you'd have to replace the system version of the Objective-C runtime library with your copy, which is kind of not-done for third party apps.


Jonas


More information about the fpc-pascal mailing list