No, we don't want something like that. The issue can be easily fixed by compiling on a system with the suitable version of the libary instead of implemting some frickle scheme.
google tells me that "
A frickle is a fried pickle originating in America's south but now seen on the menus of hip urban pubs and cafes in Australia and New Zealand. Our modern interpretation of this addictive snack is accompanied by a sriracha (Vietnamese chilli sauce) spiked mayonnaise". although i'm not quite sure you mean this - can you please clarify your use of the term? also, who is the '
we' you mean in "
we don't want something like that"? in this country, New Zealand, 'we' refers to the sitting monarch. again, this might mean something different where you live. please clarify.
users of FPC/Lazarus seem to have been searching for a solution to the 'libc problem' for years, and this seems to be one that operates entirely within how glibc's authors intended. glibc contains multiple versions of symbols to cater for this very situation, and FPC is quite conservative in the use of libc features. if it were a problem due to FPC doing something 'weird' under the hood, then FPC would surely be designed to refuse to compile unless a minimum compatible version of libc was detected?
And what if the user does not want the old behavior? What if the new function fixed some critical functionality and by using the old one you'll run into problems because code you expect to work against the new behavior will run into problems? The __libc_start_main is exactly such an example.
"What if"... what if the user somehow manages to poke their eye out when using the mouse, or pours a hot cup of tea into their computer, or the sky suddenly falls?! there is only so much cotton wool and bubblewrap that can be placed between the user and the consequences of their actions. perhaps we should require a competency test and submission of three sworn written references before a user is allowed to download FPC/Lazarus in the first place.
i'm placing at the top of each source file:
{$INCLUDE /usr/share/fpcsrc/3.2.2/LCsymbol.inc}
and in the body code blocks of the form:
{$IF DECLARED(libcSTARTM)}
procedure libc_start_main; external name libcSTARTM;
{$ELSE}
procedure libc_start_main; external name '__libc_start_main';
{$ENDIF}
the file LCsymbol.inc will contain:
const libcSTARTM = '__libc_start_main@GLIBC_2.2.5'; // version numbers picked to match glibc at time of file creation
libcDLOPEN = 'dlopen@GLIBC_2.2.5';
libcDLSYM = 'dlsym@GLIBC_2.2.5';
libcDLADDR = 'dladdr@GLIBC_2.2.5';
libcDLERROR = 'dlerror@GLIBC_2.2.5';
libcDLCLOSE = 'dlclose@GLIBC_2.2.5';
if the user wants to go back to original behavior (using the latest version of each symbol) they merely needs to replace LCsymbol.inc with an empty file - or delete the file if i can figure out how to $INCLUDE conditionally on the file existing. after making any changes to the contents of LCsymbol.inc it will then be necessary for the user to rebuild the FPC source tree.
once i've got it working, i'll write a GUI application that gets all the available symbol versions (for
__libc_start_main,
dlopen,
dlsym,
dladdr,
dlerror, and
dlclose) and present the user with the options of: default, earliest, matching set. the user's choice can then be written to LCsymbol.inc and a rebuild of the FPC source tree initiated.
speaking of which - under linux how
do you rebuild the FPC source tree? and how do you optionally
{$INCLUDE ...} a file that may or may not exist?
cheers,
rob :-)