perl-tk icon indicating copy to clipboard operation
perl-tk copied to clipboard

`Tk.pm` loads 32 bit libX11 on 64 bit platform

Open mtelka opened this issue 1 year ago • 0 comments

In the Tk.pm file there is this piece of code:

# This is a workround for Solaris X11 locale handling
Preload(DynaLoader::dl_findfile('-L/usr/openwin/lib','-lX11'))
  if (NeedPreload() && -d '/usr/openwin/lib');

It pre-loads libX11 from /usr/openwin/lib which contains 32 bit libraries. In a case we build 64 bit the 32 bit library is still attempted to load. This fails with errors like this:

$ /usr/bin/snmpcheck
Cannot load /usr/openwin/lib/libX11.so at /usr/perl5/vendor_perl/5.38/i86pc-solaris-thread-multi-64/Tk.pm line 93.
Compilation failed in require at /usr/bin/snmpcheck line 652.
BEGIN failed--compilation aborted at /usr/bin/snmpcheck line 652.
$

The correct path for 64 bit libraries is /usr/openwin/lib/64.

The other question is whether the code in question is still needed. The comment says something about workaround, but it is unclear what exactly is (was) the problem this was aiming to work around. I tried to remove offending lines and everything seemed to work.

Tested on OpenIndiana.

mtelka avatar Feb 13 '24 17:02 mtelka