eserte / perl-tk

the perl module Tk
https://metacpan.org/release/Tk
Other
44 stars 31 forks source link

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

Open mtelka opened 7 months ago

mtelka commented 7 months ago

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.