Welcome, Guest
Username: Password: Remember me
Discussions for CodeTyphon Studio Installation and Setup.
  • Page:
  • 1
  • 2

TOPIC:

CT on Ubuntu 1 year 8 months ago #17228

  • fredvs
  • fredvs's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 205
  • Thank you received: 1
Yes, testing is the key.
Anyway that "DynLib" method has lot of advantages, you may check the lib before to load it, if it does not load, try a other or use yours, no problems with .so names, etc...

But I agree, for libc (and how fpc deals with it on his rtl-packages) it is very complicated and lot of work to enable it. (But for MEgui, it takes me only 2 white nights).



 

Please Log in or Create an account to join the conversation.

CT on Ubuntu 1 year 8 months ago #17229

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4513
  • Thank you received: 1102
ALL TyphonIDE packages use "DynLib" method,
in latest CT LAB release rev 007870.

Even pl_AggPas pkg, unit agg_font_freetype_lib.pas use "DynLib" method now
ca_libGTKv2
ca_libGTKv3
ca_libGTKv4
etc
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

CT on Ubuntu 1 year 8 months ago #17236

  • fredvs
  • fredvs's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 205
  • Thank you received: 1
Hello Sternas.

In case you want to explore dynamic load of libc.so, in attachment the mse version of libc.pp.
 

File Attachment:

File Name: mselibc.pas.7z
File Size:25 KB

It has a define "mse_dynlibc" and if you add the fpc parameter "-dmse_dynlibc", libc.so will be dynamic loaded.
Without that parameter, the original static loading, with "external" is used.

Here result of the link.res script ( with -sh parameter ) of this program:

program testlibc;
uses
 mselibc;
begin
end.



Without the -dmse_dynlibc parameter ( using "external" ):

INPUT(
-l:libc.so
-l:libpthread.so.0
-l:librt.so
-l:libdl.so
-l:libc.so
)
GROUP(
-lc
)


With the -dmse_dynlibc parameter ( dynamic loading ):

INPUT(
-l:libpthread.so.0
-l:libdl.so
)
 
Attachments:

Please Log in or Create an account to join the conversation.

CT on Ubuntu 1 year 8 months ago #17237

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4513
  • Thank you received: 1102
Thanks my friend
After Aug, I will add this task to a LAB programmer.

 
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

CT on Ubuntu 1 year 8 months ago #17238

  • fredvs
  • fredvs's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 205
  • Thank you received: 1
Ha, ok, nice.

Note that fpc does not use libc.pp (where all the libc methods should be regrouped but only few are there).
The mselibc.pas units regroup (nearly all) the libc.so methods, with the choice for users to use "external" or "dynlib" way.

With /fpc/rtl/, when a unit needs to call a libc.so method, it adds in code declaration of the libc-method with "external" + link libc.
So same methods are re-declared lot of time.
It should be simpler, imho, add "libc" in uses section (like msegui does with his centralized "mselibc.pas unit).

So the (hard) work is to find all the /fpc/rtl units that use "external" or "external libc" and add  "CTlibc" in uses section.
And remove the declarations of methods with "external" ( that are now declared in CTlibc ).

Good luck with lot of courage and fun.

[EDIT] In attachment, mselibc.pas without any dependencies to msegui.
Note that it is possible that some /fpc/rtl/ units use some "external" methods that are not yet in mselibc.pas.
If it is the case, just copy that methods and add it into mselibc.pas (or CTlibc.pas).

 

File Attachment:

File Name: mselibc.pa...08-11.7z
File Size:25 KB


Fre;D
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by fredvs.
  • Page:
  • 1
  • 2