hi all,
this is a half-baked idea, but i wanted to get a little feedback. i was prompted by someone posting elsewhere on the forums about a GUI application that appeared to do nothing - yet another case of a GLIBC symbol versioning problem:
https://forum.lazarus.freepascal.org/index.php/topic,69945.msg547731.html#msg547731(reply #13 from TCH)
after a bit of tinkering, i found out a way to establish if an ELF binary will fail with a GLIBC symbol versioning issue
without needing to just try running it. because the ELF binary is not actually run, it is then possible to do a bit of a man-in-the-middle and give the user some feedback about what has happened - rather than them just clicking on an icon and nothing happening

below shows the steps involved:
user@Mint19:~$ readelf -p .interp ./project.new
String dump of section '.interp':
[ 0] /lib64/ld-linux-x86-64.so.2
user@Mint19:~$
user@Mint19:~$
user@Mint19:~$ /lib64/ld-linux-x86-64.so.2 --list ./project.new 1>/dev/null
./project.new: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./project.new)
user@Mint19:~$
user@Mint19:~$
user@Mint19:~$ zenity --warning --no-wrap --text="/lib/x86_64-linux-gnu/libc.so.6:\n\nversion \`GLIBC_2.34\' not found\n(required by ./project.new)"
so
readelf -p .interp [...] gets the path to the link/loader,
the link/loader, when passed the
--list option 'reveals' the error message,
then we just need to do something with the message -
zenity is just one possible option.
it would be relatively simple (under Linux) to bundle the above steps into a small 'container' FPC program that extracts the ELF binary into
/tmp, then perform the checks to see if it will run without GLIBC symbol versioning issues - and run it if there are no issues. but, i am still not entirely happy with depending upon
zenity to display a GUI window.
i feel that there must be
something more ubiquitous than zenity... or some
simple means of getting GTK2 and other graphics toolkits to pop up a simple GUI window without need for hundreds of K's of bloat added to one's binary.
any ideas?
cheers,
rob :-)