Subject Re: [firebird-support] UDF - FreePascal - Linux
Author Carlos H. Cantu
Ivan, about 4 years ago, I tried to use FreePascal to create UDFs, but
I had problems because at that time, FreePascal wasn't able to create
PIC code correctly for shared objects. I'm not sure if this situation
improved in the currently FP version.

It is not difficult to test. What I have done in the past:

Created a UDF to get a timestamp and return the date of the first day
of that month, ie: fdom('15.10.2008') would return '1.10.2008'. I did
not use any global variable.

The problem (fbserver crash) happened when I opened simultaneous
connections to the database and create a loop to call that UDF several
times, in the different connections, at the same time.

I had no problems with connections calling the UDF at different times.
The same code worked fine if compiled with Kylix, so it was really a
FP problem. You can find some messages from me about this in the FP


FireBase -

IP> Can anybody confirm whether FreePascal is/is not able to create UDFs for Linux ?
IP> FreePascal faq says "Creation of shared libraries (for Linux) is not recommended
IP> with the current version of the compiler", but I am sure I saw posts on this list
IP> from people doing it.

IP> I understand that it should work as long as I do not use any global variables ?
IP> (i.e. do not declare them, nor include units that use them)

IP> Ivan