[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-readline] How to determine the GPL version at compile and run t
From: |
Thomas Schmitt |
Subject: |
Re: [Bug-readline] How to determine the GPL version at compile and run time ? |
Date: |
Sun, 15 Jun 2014 12:30:24 +0200 |
Hi,
Chet Ramey:
> readline does nothing
> to prevent such theoretical version mismatches. It's unlikely, however,
> that a program compiled using readline version 5 headers would work
> without problems when linked with readline version 6.
On Debian 6 it does work after some willful self-admin manipulations.
I compiled a GNU xorriso binary (GPLv3+) on SuSE 10 with
#define RL_READLINE_VERSION 0x0501 /* Readline 5.1 */
and ran it on Debian 6 where i see
#define RL_READLINE_VERSION 0x0601 /* Readline 6.1 */
ldd on Debian 6 states
libreadline.so.5 => /lib/libreadline.so.5 (0x00007f86f2267000)
The softlink /lib/libreadline.so.5 points to libreadline.so.5.2.
So it is no wonder that the foreign binary works.
Now comes the self-admin. There is also a libreadline.so.6.1.
I changed the softlink /lib/readline.so.5 so that it points to
libreadline.so.6.1. Further i renamed libreadline.so.5.2 so that
it cannot be found by name any more.
The program still starts and works flawlessly.
Just to be sure, i next mispointed the link to a non-existing
target. Then the xorriso binary does not start any more.
So it is very probable that it runs indeed with version 6.1
although being compiled for version 5.1.
(Unless libreadline.so.6.1 can detect old callers and fallback
to the ABI of libreadline-5.x. In this case i am interested
to learn the trick.)
This would mean that the version macros in libreadline.h give no
reliable information about what is linked at run time.
Are the .so numbers surely the same as the libreadline release
versions ?
(It would be cumbersome and possibly non-portable to try to
get the .so number from the linker system.)
> > How much obligation for own effort is legally imposed on users of
> > libreadline ?
> These are mostly questions for address@hidden
Whatever the legal intentions are, there should be technical means
so that the user can determine the license situation, without studying
the license history of libreadline and best without making theories
about its .so numbering scheme.
Else it will hardly be possible to enforce the license.
How about an API function in the next release, which tells the license
and the version at run time ?
(Plus a macro in readline.h which tells the existence of the new
function at compile time.)
I am now considering to equip my libraries with license telling
functions. There are already functions to tell the run time version.
Whatever, if readline.h of major version 6 or later is encountered
at compile time, then the human readable version text of libisoburn
now says
Provided under GNU GPL version 3 or later, due to libreadline license.
Thank you for your advise.
Have a nice day :)
Thomas