[MSEide-MSEgui-talk] MSE and XLib.

classic Classic list List threaded Threaded
60 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] MSE and XLib.

fredvs


Hello Martin.


May I ask you why MSE and fpGUI use the buggy code of fpc/packages/x11 ?


At the end it is only Pascal headers for the libX11.so library, mse could have his own x11 code.


Fre;D 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs

Hello Martin

You know that I never give up.

A concrete example.

A Linux/FreeBSD fpc release was compiled using the pascal headers for libX11.so.6 and using symlink libX11.so >> libX11.so.6.0.8.

This release was installed on a system (with libX11-dev too to make it work).

If, some time later, a system-update was done to the brand new version libX11.so.7.0.1,
this will update also libX11-dev >> libX11.so >> libX11.so.7.0.1.

And using fpc, there will be a error because libX11.so does not point to a libX11.so.6 version.

But if the same Linux/FreeBSD fpc release was compiled using symlink libX11.so.6, there, no problem, it will use the still installed symlink libX11.so.6.

Or, if libX11.so.6 is no more installed, fpc could say "libX11.so.6 not found" (because fpc knows now what version of libX11 he needs).

Other thing.

If it *is* the way to do, why fpc does not use libc6-dev (that will create symlink libc.so) but uses LIBC_SO = 'libc.so.6' instead of LIBC_SO = 'libc.so' ?

(By the way LIBC_SO = 'libc.so.6' **is** the correct way).

Fre;D



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

Graeme Geldenhuys
On 2017-08-14 14:34, Fred van Stappen wrote:
> A Linux/FreeBSD fpc release was compiled using the pascal headers for libX11.so.6 and using symlink libX11.so >> libX11.so.6.0.8.


Fred, as they tried to explain in the FPC mailing list, it is the way
Unix-type systems have worked for decades. The issue you mention is also
not just limited to libX11.so, but to any libraries that FPC has header
translations too. I have had similar issuer with database access too.
It's annoying, but the way Unix-type systems have always worked. The
*.so files (without version in the name) always links to the latest
version. Luckily most libraries in Unix don't change major version
numbers very often. ;-)  The other lucky thing is that backward
compatibility with popular libraries are pretty darn good. No guarantee
of that when major versions changes though, but still pretty good.

I guess what you are proposing is that the FPC in Free Pascal should be
updated so also versioned libraries (probably with major version only.
eg: libX11.so.6) are searched for. The issue has been around for so
long, I doubt the FPC will bother making such a change. If somebody
contributes such a patch, it might go some way to resolve the problem.


ps:
   I know the fcl-db code has been updated a few years back to
   search a few more named posibilities. But no other parts of
   the FCL was ever updated in a similar way.


Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs

Hello Graeme.


Thank you to your answer but could you explain me why, if using lib**-dev **is** the way to do, why fpc does it only for third library.


Why, for example for libc.so.6 (needed to compile fpc himself), fpc does not use libc-dev and the libc.so created ?


I am very sorry but if like they say, using lib**-dev is the rigth way then the code to lead libc is buggy.


Fre;D




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs

> Why, for example for libc.so.6 (needed to compile fpc himself), fpc does not use libc-dev and the libc.so created ?


Sory, I am hot, I cannot resist.


For me, fpc act as very selfish. For himself and the libraries needed to compile himself ---> ok, the good soname is used.


But for all that fpc does need --> a wrong using of libxxx-dev.


Also, I did read the doc of linux- maintenance. The use of libxxx-dev is only for C developpers who wants to test the last dev-release.  And for this, they may use the c headers provided by  libxxx-dev + the "root-for-development" libxxx.so.


And all the blabla that the fpc gurus give is only blabla of lazy and old developers who do not want to change their mind.


But I see that nobody want to understand that I try to explain , so I give up. (Trust me, it is very rare, I usually never give up).


FreD




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

Graeme Geldenhuys
In reply to this post by fredvs
On 2017-08-14 15:28, Fred van Stappen wrote:
> Why, for example for libc.so.6 (needed to compile fpc himself), fpc does not use libc-dev and the libc.so created ?

Good question, and I guess only the FPC compiler team can answer that.
But if true, it does sound a bit inconsistent (from their side) as you
suggest.

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

mse
Administrator
In reply to this post by fredvs
On Monday 14 August 2017 15:26:17 Fred van Stappen wrote:
> Hello Martin.
>
>
> May I ask you why MSE and fpGUI use the buggy code of fpc/packages/x11 ?
>
>
> At the end it is only Pascal headers for the libX11.so library, mse could
> have his own x11 code.
>
I'll fork it and use initializedynlib() from msedynload which loads
dynamically. It will take a while...
BTW, the code is not buggy. ;-)

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs


I'll fork it and use initializedynlib() from msedynload which loads dynamically. It will take a while...

Excellent idea and or freedom, I can be patient.

BTW, the code is not buggy. 

As explained to Graeme, if, like they said, the right way is to use lib***-dev then there is a bug.

Total logic would be that fpc uses also libc-dev and his link libX11.so.

But in the fpc code they do:

LIBC_SO = 'libc.so.6' instead of LIBC_SO = 'libc.so' 

So to follow their logic, it is a bug to not use 'libc.so' .

But, for me it is the opposite, using LIBC_SO = 'libc.so' is a bug and using LIBC_SO = 'libc.so.6' is the right way ).

I am happy that you will do a MSE-libx11 (but I am sad that you did not understand what I try to explain).

Fre:D

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs
Ooops, in previous mail, please read:

libc-dev and his link libc.so.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs
In reply to this post by Graeme Geldenhuys

>> Why, for example for libc.so.6 (needed to compile fpc himself), fpc does not use libc-dev and the libc.so created ? 
Good question, and I guess only the FPC compiler team can answer that. 


Huh, I did ask it (now 14 hours ago) but still nothing in fpc-mailing list. (as usual, when I ask something boring, the mail is loosed).

Fre;D

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

mse
Administrator
In reply to this post by mse
On Monday 14 August 2017 17:40:44 Martin Schreiber wrote:

> On Monday 14 August 2017 15:26:17 Fred van Stappen wrote:
> > Hello Martin.
> >
> >
> > May I ask you why MSE and fpGUI use the buggy code of fpc/packages/x11 ?
> >
> >
> > At the end it is only Pascal headers for the libX11.so library, mse could
> > have his own x11 code.
>
> I'll fork it and use initializedynlib() from msedynload which loads
> dynamically. It will take a while...

I reverted the changes. It is too dangerous and there must be forked too much
because of the various {$linklib} statements in FPC code, sorry.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs
This post was updated on .
>  reverted the changes. It is too dangerous and there must be forked too much
> because of the various {$linklib} statements in FPC code

Ha, ok ;-(

I am very happy that fpc is twice the Project of the Month in Source Forge. (I voted too).

There is also now a fpc Fundation, yep, they are rich now.

I will stop to develop with fpc.

I was thinking to keep fpc for building libraries but the **huge** carence in float calculation makes fpc not efficient.

Back to C.

Martin, of course, when mselang is ready, it will be a immense pleasure to come back to my lovely Pascal language.

Many thanks for all.

Fre;D  



Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

code dz
i am also back to c/c++ about year ago now , i don't know why but
maybe because i feel comfortable with c/c++ more than pascal (less
restriction ;) ) also i am using imgui
(https://github.com/ocornut/imgui)  its nice lightweight immediate
mode gui library .

but to be honest , the thing that keep me using fpc till now is
mseide/msegui and nothing else ;)

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs
Hello Wkitty.

Many thanks for your clear explanation in fpc-forum.

> the thing that keep me using fpc till now is mseide/msegui

Ha, I see that you have good taste so I will try imgui.

By the way, thanks for the many times you help me in Lazarus forum.

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs
Hello Martin.

Here better explanation of the utility of libX11.so (many thanks Graeme for the infos).

https://unix.stackexchange.com/questions/475/how-do-so-shared-object-numbers-work

To resume:

libX11.so (and then libx11-dev) is needed for the linker only.

Here part of answer of stackexchange:

The reason for the symbolic link is for the linker. When you want to link against libpthread.so directly, you give gcc the flag -lpthread, and it adds on the lib prefix and .so suffix automatically. You can't tell it to add on the .so.0 suffix, so the symbolic link points to the newest version of the lib to faciliate that.

And this explain why libc-dev is not needed : the libc.so is not linked but loaded as "common" library.

OK, I was wrong, I admit.

But now I am richer (thanks to Graeme), I learn lot things.

Fre;D

Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

Graeme Geldenhuys
On 2017-08-16 14:10, fredvs wrote:
> Here better explanation of the utility of libX11.so (many thanks Graeme for
> the infos).
>
> https://unix.stackexchange.com/questions/475/how-do-so-shared-object-numbers-work
>

Yes, that is a very good explanation. Read the full question, and the
two answers that follow. They all give vital information on how and why
Unix-type systems work they way they do, and why unversioned symlink
shared library files exist, and what they are needed for.

Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs
Hello Graeme.

OK, understood that libX11.so is needed for linking against that library.

But ( aaargh, I am unbearable), is it really needed to link libX11.so ?

Could fpc do like it does for libc, consider libX11 as a "coomon" library and only load it (without to link it) ?

And that way, spare also few kb in the binary ?

Fre;D
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

Graeme Geldenhuys
On 2017-08-16 14:52, fredvs wrote:
> But ( aaargh, I am unbearable), is it really needed to link libX11.so ?

As I mentioned in a private message, the unversioned symlink shared
library files are only needed during linking time (ie: when you compile
your program). Those symlink files are NOT needed when you try and run
your program (say on another system that do doesn't have development
tools or libraries installed).


> Could fpc do like it does for libc, consider libX11 as a "coomon" library
> and only load it (without to link it) ?

Yes, but it really isn't needed. When linking occurs, the SONAME fields
in a ELF binary get populated with the versioned shared library name. So
the dependency is resolved to the exact version of the shared library
that the binary needs for running.

If you did want to change all the x11, xutils, x etc header units to
load at runtime, you can, but that would require much work - for little
benefit I think. Plus, then the 'ldd' command will not display what the
binary really needs to actually run.


Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs
> As I mentioned in a private message, the unversioned symlink shared library files are only needed during linking time (ie: when you compile your program).

Huh, I was asking if the fact of linking was absolutely necessary, not if the unversioned symlink was needed.

> If you did want to change all the x11, xutils, x etc header units to load at runtime
Yes, it is that my question.

> you can, but that would require much work - for little benefit I think.

OK,  I think that all is perfectly clear for me now.

Many thanks.

Fre;D


Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] MSE and XLib.

fredvs
Re-re...-re hello.

I profit that I am still not banned from mse mailing-list.
(All development fora, when I ask things about linker --> or banned or insulted (FreeBSD, fpc, ...).

If you develop from scratch, what are the advantages to link a library vs to load it dynamically ?

Fre;D
123