Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-13 Thread Marc Santhoff
On Fr, 2015-02-13 at 07:33 +0100, Jonas Maebe wrote: > On 12/02/15 00:42, Marc Santhoff wrote: > > Some data points: > > fpc 2.6.2 x86_64 > > Always use the latest FPC release, in this case 2.6.4. I think even some > x86-64 calling convention issues were fixed between 2.6.2 and 2.6.4. Wow, comple

Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-13 Thread Marc Santhoff
On Fr, 2015-02-13 at 09:07 +, Tony Whyman wrote: > A pity, because that would have been an easy fix. This type of error > comes from either mis-matched calling conventions or incompatible > argument lists. No easy solution in sight... > >From having done this sort of thing before all I can ad

Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-13 Thread Marc Santhoff
On Fr, 2015-02-13 at 07:33 +0100, Jonas Maebe wrote: > On 12/02/15 00:42, Marc Santhoff wrote: > > Some data points: > > fpc 2.6.2 x86_64 > > Always use the latest FPC release, in this case 2.6.4. I think even some > x86-64 calling convention issues were fixed between 2.6.2 and 2.6.4. Done, no ch

Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-13 Thread Tony Whyman
A pity, because that would have been an easy fix. This type of error comes from either mis-matched calling conventions or incompatible argument lists. >From having done this sort of thing before all I can advise is to go through each function argument one by one and make sure that each argument ty

Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-12 Thread Jonas Maebe
On 12/02/15 00:42, Marc Santhoff wrote: > Some data points: > fpc 2.6.2 x86_64 Always use the latest FPC release, in this case 2.6.4. I think even some x86-64 calling convention issues were fixed between 2.6.2 and 2.6.4. Jonas ___ fpc-pascal maillist

Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-12 Thread Marc Santhoff
On Do, 2015-02-12 at 09:03 +, Tony Whyman wrote: > Marc, > > If your running on a *nix system then you probably want "cdecl" rather > than "stdcall" Err ... you're right and it is cdecl. I have mixed it up because it is an $if_n_def ...: ...;{$ifndef Win32}cdecl{$else}stdcall{$endif};externa

Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-12 Thread Tony Whyman
Marc, If your running on a *nix system then you probably want "cdecl" rather than "stdcall" Regards Tony Whyman MWA On 12/02/15 04:54, Marc Santhoff wrote: > On Do, 2015-02-12 at 00:42 +0100, Marc Santhoff wrote: >> Hi, >> >> when I try to run a program that dynamically links an external .so >>

Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-12 Thread Tony Whyman
Marc, If your running on a *nix system then you probably want "cdecl" rather than "stdcall" Regards Tony Whyman MWA On 12/02/15 04:54, Marc Santhoff wrote: > On Do, 2015-02-12 at 00:42 +0100, Marc Santhoff wrote: >> Hi, >> >> when I try to run a program that dynamically links an external .so >>

Re: [fpc-pascal] linking and using dynamic libraries on amd64

2015-02-11 Thread Marc Santhoff
On Do, 2015-02-12 at 00:42 +0100, Marc Santhoff wrote: > Hi, > > when I try to run a program that dynamically links an external .so > library it throws a SIGSEGV error at startup. That seems to happen while > loading the library before any code of mine is exeuted. > > The library is pulled into i

[fpc-pascal] linking and using dynamic libraries on amd64

2015-02-11 Thread Marc Santhoff
Hi, when I try to run a program that dynamically links an external .so library it throws a SIGSEGV error at startup. That seems to happen while loading the library before any code of mine is exeuted. The library is pulled into it by a header translation from C to Pascal. The functions are declare