Building 5.5p1 on HPUX 10.20 (yeah, it's pretty ancient) fails here: gcc -o ssh-pkcs11-helper ssh-pkcs11-helper.o ssh-pkcs11.o -L. -Lopenbsd-compat/ -L/usr/local/ssl-0.9.8n/lib -lssh -lopenbsd-compat -lssh -lcrypto -lz -lxnet -lsec /usr/ccs/bin/ld: Unsatisfied symbols: strlcpy (code) vasprintf (code) collect2: ld returned 1 exit status The problem here seems to be circular dependencies between libssh and libopenbsd-compat (because the latter depends on xstrdup which is defined in the former). The link succeeds if I add another instance of -lopenbsd-compat at the end of the command. That's a pretty crocky workaround though. Maybe xstrdup ought to be moved to libopenbsd-compat? FWIW, openssh 4.6p1 built successfully on this platform, so the problem's been introduced since then. Another possibly useful datapoint is that ssh-pkcs11-helper is the only executable that exhibits a problem.
Created attachment 1847 [details] openssh-pkcs11-helper-link.patch Only link libssh in once.
Looks like the problem is that libssh is linked twice: $(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
Nope, I'm wrong. After discussing it we've decided that fixing it properly is a lot of work and since it only impacts old or odd platforms (eg embedded) we're going to take the easy way out. This has been committed and will be in the next release. Thanks.
Sorry, that proposed patch does *not* fix it. When I do that I get /usr/ccs/bin/ld: Unsatisfied symbols: xstrdup (code) You really do have a circular dependency here, and the only way to make it work with just rejiggering the link line is to mention both libraries twice.
Created attachment 1882 [details] openssh-bug1770.patch Link against libraries twice (this is what was committed).
Sorry, it wasn't clear from the bug history but that's exactly what we ended up doing (list both libraries twice). I have attached the patch that was committed. If it's still broken in the current snapshots (http://mindrot.org/openssh_snap/) then please reopen.
Move resolved bugs to CLOSED after 5.7 release