Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-09

RichMemo in shared SO library - relocation error

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dibo

Hi,

I have no problem with LCL and Richmemo in DLL, but on linux I can't build SO library with TRichMemo. I get this error:

/usr/bin/ld: /home/dibo/Programowanie/Lazarus/components/richmemo/lib/x86_64-linux/richmemo.o: relocation R_X86_64_32S against `TC_RICHMEMO_RTFLOADSTREAM' can not be used when making a shared object; recompile with -fPIC

/home/dibo/Programowanie/Lazarus/components/richmemo/lib/x86_64-linux/richmemo.o: could not read symbols: Bad value

Compiling with -fPIC switch doesn't help (I rebuilt RTL with CREATESHARED=1 too). Project with empty form (and with random LCL components) is compiling without errors. I post this bug on mantis some times ago, but maybe this is minor bug and I cans fix this in source by my self (it blocks the development of my project)? Any idea? It seems, that compiler have problem with this global variables:

var
  RTFLoadStream : function (AMemo: TCustomRichMemo; Source: TStream): Boolean = nil;
  RTFSaveStream : function (AMemo: TCustomRichMemo; Dest: TStream): Boolean = nil;

I have latest FPC and Lazarus from SVN
Ubuntu 10.4 64 bit

Regards

Jonas Maebe
to Dibo
Dibo wrote 28 lines
I have no problem with LCL and Richmemo in DLL, but on linux I can't build SO library with TRichMemo. I get this error: /usr/bin/ld: /home/dibo/Programowanie/Lazarus/components/richmemo/ lib/x86_64-linux/richmemo.o: relocation R_X86_64_32S against `TC_RICHMEMO_RTFLOADSTREAM' can not be used when making a shared object; recompile with -fPIC /home/dibo/Programowanie/Lazarus/components/richmemo/lib/x86_64- linux/richmemo.o: could not read symbols: Bad value Compiling with -fPIC switch doesn't help (I rebuilt RTL with CREATESHARED=1 too). Project with empty form (and with random LCL components) is compiling without errors. I post this bug on mantis some times ago, but maybe this is minor bug and I cans fix this in source by my self (it blocks the development of my project)? Any idea? It seems, that compiler have problem with this global variables: var RTFLoadStream : function (AMemo: TCustomRichMemo; Source: TStream): Boolean = nil; RTFSaveStream : function (AMemo: TCustomRichMemo; Dest: TStream): Boolean = nil; I have latest FPC and Lazarus from SVN Ubuntu 10.4 64 bit

You can probably work around the problem for now by going to line 1448 of compiler/ptconst.pas and changing

         if sym.varspez=vs_const then
           cursectype:=sec_rodata
         else
           cursectype:=sec_data;

into

         cursectype:=sec_data;

Jonas

Dibo
to Jonas Maebe
Show quoted text 11 lines
You can probably work around the problem for now by going to line 1448 of compiler/ptconst.pas and changing if sym.varspez=vs_const then cursectype:=sec_rodata else cursectype:=sec_data; into cursectype:=sec_data;

Hm, it doesn't help. Still this same error