Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 873355 - net-misc/putty-0.77-r2: undefined reference to `dlsym' (also dlopen, dlclose)
Summary: net-misc/putty-0.77-r2: undefined reference to `dlsym' (also dlopen, dlclose)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Matthew Smith
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-28 20:15 UTC by Luke-Jr
Modified: 2022-09-29 08:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,545.37 KB, text/x-log)
2022-09-28 20:15 UTC, Luke-Jr
Details
emerge --info (emerge--info.ishi,11.90 KB, text/plain)
2022-09-28 20:40 UTC, Luke-Jr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke-Jr 2022-09-28 20:15:23 UTC
Created attachment 814549 [details]
build log

/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ssh/libsshclient.a(gss.c.o): in f
unction `gss_init':
/var/tmp/portage/net-misc/putty-0.77-r2/work/putty-0.77/unix/gss.c:41: undefined reference to `dlsym'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ssh/libsshclient.a(gss.c.o): in f
unction `ssh_gss_setup':
/var/tmp/portage/net-misc/putty-0.77-r2/work/putty-0.77/unix/gss.c:69: undefined reference to `dlopen'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ssh/libsshclient.a(gss.c.o): in f
unction `ssh_gss_cleanup':
/var/tmp/portage/net-misc/putty-0.77-r2/work/putty-0.77/unix/gss.c:105: undefined reference to `dlclose'
collect2: error: ld returned 1 exit status
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-28 20:21:15 UTC
Please always include emerge --info.
Comment 2 Luke-Jr 2022-09-28 20:40:08 UTC
Created attachment 814552 [details]
emerge --info
Comment 3 Ionen Wolkens gentoo-dev 2022-09-28 22:14:15 UTC
From a quick look seems it only adds libdl when gssapi = dynamic (not set if USE=-gssapi)

  if(PUTTY_GSSAPI STREQUAL DYNAMIC)
    add_optional_system_lib(dl dlopen)

But PUTTY_GSSAPI=off doesn't seem to entirely disable building gssapi and its dl* code?

I still see things like that in the binary despite USE=-gssapi:

  $ strings /usr/bin/putty | grep libgssapi.so.2
  libgssapi.so.2
  Using GSSAPI from libgssapi.so.2

However, this is only a problem for you because still using glibc-2.33 (in >=glibc-2.34 and musl these symbols are included in libc.so, so this wouldn't happen)
Comment 4 Matthew Smith gentoo-dev 2022-09-29 08:32:16 UTC
It looks like the generated header 'cmake.h' doesn't #define NO_GSSAPI so all of the related code still gets included.

> putty-0.77 $ cmake -Bbuild -DPUTTY_GSSAPI=OFF
> putty-0.77 $ grep NO_GSSAPI build/CMakeFiles/cmake.h
> /* #undef NO_GSSAPI */

It seem that the CMake variable NO_GSSAPI doesn't get set if you pass -DPUTTY_GSSAPI=OFF, only if you pass -DPUTTY_GSSAPI=DYNAMIC and libdl isn't found.

Will fix in -r3 and email patch upstream.
Comment 5 Larry the Git Cow gentoo-dev 2022-09-29 08:44:57 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5fafbac4f479bf7c882d4e58962d5e5b313e8bbe

commit 5fafbac4f479bf7c882d4e58962d5e5b313e8bbe
Author:     Matthew Smith <matthew@gentoo.org>
AuthorDate: 2022-09-29 08:42:47 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2022-09-29 08:42:47 +0000

    net-misc/putty: fix USE=-gssapi build
    
    Closes: https://bugs.gentoo.org/873355
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 net-misc/putty/files/putty-0.77-nogssapi.patch         | 18 ++++++++++++++++++
 .../{putty-0.77-r2.ebuild => putty-0.77-r3.ebuild}     |  5 +++++
 2 files changed, 23 insertions(+)