Forum > Other

FreeBSD shared library problems

<< < (2/6) > >>

marcov:
And test a native version for your FreeBSD, that means in practice, using FIXES.

bbrtj:

--- Quote from: Fred vS on May 01, 2025, 05:05:05 pm ---What is the result for this?:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---$ readelf -d <your_fpc_lib>
--- End quote ---
When compiling with cwstring (Bus error):

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Dynamic section at offset 0x1ce2d8 contains 23 entries:  Tag                Type                  Name/Value 0x0000000000000001 NEEDED               Shared library: [libc.so.7] 0x000000000000000e SONAME               Library soname: [libtags.so] 0x000000000000000c INIT                 0xa2220 0x000000000000000d FINI                 0xb8040 0x0000000000000019 INIT_ARRAY 0x000000000000001b INIT_ARRAYSZ         8 (bytes) 0x0000000000000004 HASH                 0x158 0x0000000000000005 STRTAB               0xc98 0x0000000000000006 SYMTAB               0x3e0 0x000000000000000a STRSZ                745 (bytes) 0x000000000000000b SYMENT               24 (bytes) 0x0000000000000003 PLTGOT               0x1cf498 0x0000000000000002 PLTRELSZ             2136 (bytes) 0x0000000000000014 PLTREL               RELA 0x0000000000000017 JMPREL               0xa1400 0x0000000000000007 RELA                 0x1080 0x0000000000000008 RELASZ               656256 (bytes) 0x0000000000000009 RELAENT              24 (bytes) 0x000000006ffffffe VERNEED              0x1040 0x000000006fffffff VERNEEDNUM           1 0x000000006ffffff0 VERSYM               0xf82 0x000000006ffffff9 RELACOUNT            27342 0x0000000000000000 NULL                 0x0When compiling without it (works):

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Dynamic section at offset 0x134030 contains 23 entries:  Tag                Type                  Name/Value 0x0000000000000001 NEEDED               Shared library: [libc.so.7] 0x000000000000000e SONAME               Library soname: [libtags.so] 0x000000000000000c INIT                 0x5e380 0x000000000000000d FINI                 0x741a0 0x0000000000000019 INIT_ARRAY 0x000000000000001b INIT_ARRAYSZ         8 (bytes) 0x0000000000000004 HASH                 0x158 0x0000000000000005 STRTAB               0xaa0 0x0000000000000006 SYMTAB               0x398 0x000000000000000a STRSZ                572 (bytes) 0x000000000000000b SYMENT               24 (bytes) 0x0000000000000003 PLTGOT               0x1341f0 0x0000000000000002 PLTRELSZ             1704 (bytes) 0x0000000000000014 PLTREL               RELA 0x0000000000000017 JMPREL               0x5d838 0x0000000000000007 RELA                 0xda8 0x0000000000000008 RELASZ               379536 (bytes) 0x0000000000000009 RELAENT              24 (bytes) 0x000000006ffffffe VERNEED              0xd78 0x000000006fffffff VERNEEDNUM           1 0x000000006ffffff0 VERSYM               0xcdc 0x000000006ffffff9 RELACOUNT            15812 0x0000000000000000 NULL                 0x0


--- Quote from: Fred vS on May 01, 2025, 05:05:05 pm ---Did you add the -fPIC -Sh parameters at compilation?

--- End quote ---
I am compiling through lazbuild, made a shared library project in lazarus. I don't think I had these options, I added them now as custom options in the project, but no change.



--- Quote from: Fred vS on May 01, 2025, 05:05:05 pm ---Also, better use cmem with FreeBSD, place it as first unit in the uses clause.
And finally, add this at end of code:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---initialization  Set8087CW($133f); // Mask all FPU exceptions
--- End quote ---
Tried that, but no difference.



--- Quote from: marcov on May 01, 2025, 07:22:51 pm ---And test a native version for your FreeBSD, that means in practice, using FIXES.

--- End quote ---
Not sure what you mean by that, I compile FPC myself from the fixes-3.2 branch using fpcupdeluxe.

marcov:

--- Quote from: bbrtj on May 01, 2025, 07:28:39 pm ---Not sure what you mean by that, I compile FPC myself from the fixes-3.2 branch using fpcupdeluxe.

--- End quote ---

Ok. But check the ELF ident with readelf/elfdump to check that the binaries generated are really match the (major) version that you use.

Fred vS:

--- Quote from: bbrtj on May 01, 2025, 07:28:39 pm ---When compiling with cwstring (Bus error):

--- End quote ---

Where is cwstring in your uses section?
Usually it is placed just after cthreads:

--- Quote ---{$ifdef unix}cthreads, cwstring,{$endif}
--- End quote ---

Also you may add this at begin of code:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$interfaces corba}
(Maybe not useful but you may try).

Fred vS:
Do you absolutely need cwstring?

You may replace WideString with PChar or AnsiString.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version