Tk Source Code

View Ticket
Login
Ticket UUID: 2534237
Title: Tk not linking correctly on netbsd
Type: Bug Version: None
Submitter: egavilan Created on: 2009-01-25 01:47:24
Subsystem: 84. Unix Build Assigned To: stwo
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2026-10-22 17:22:35
Resolution: Out of Date Closed By: serhiy.storchaka
    Closed on: 2026-09-27 15:21:43
Description:
NetBSD elf linker don't use /etc/ld.so.conf to find the shared libraries at runtime. As a consequence, the linker option -rpath must be used to hardcode the library search path into the binaries on this platform.
The following patch address these issues.

The reversed order of arguments for the X11_LIB_SWITCHES variables in Makefile.in is to allow the library path of the xft library appears in the rpath before the x11 one, as on this platform the xft library can be installed separatedly. If the x11 library path appears first, the xft delivered with the X system will be picked up instead of the choosed one (usually on /usr/pkg/lib).
User Comments: serhiy.storchaka added on 2026-09-27 15:21:43:

Out of date. The Makefile part is applied: X11_LIB_SWITCHES puts $(XFT_LIBS) before @XLIBSW@. And configure adds the X library directory to LIB_RUNTIME_DIR, so it is in the rpath. On NetBSD 10.1, libX11 is found at run time with Tk 8.6 and 9.1, with and without Xft.


jenglish added on 2009-01-30 00:55:47:
The tcl.m4 part of the patch looks OK.

The change to Makefile.in (which affects all platforms, not just NetBSD) also looks reasonable -- -lX11 et. al normally *should* be specified after -lXft (since libXft has forward references to libX11). 

Also worth noting that `pkg-config --libs Xft` normally already contains "-lX11" etc.

egavilan added on 2009-01-25 08:47:25:

File Added - 310491: rpath.diff

Attachments: