Bug 3168 - libssh.a(utf8.o): undefined reference to symbol 'strcasestr@@GLIBC_2.17'
Summary: libssh.a(utf8.o): undefined reference to symbol 'strcasestr@@GLIBC_2.17'
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 8.2p1
Hardware: ARM64 Linux
: P5 critical
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-22 03:09 AEST by sukesh gowda
Modified: 2021-03-04 09:54 AEDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sukesh gowda 2020-05-22 03:09:01 AEST
Hi,

I am getting following error while build openssh.

/tools/xilinx/SDK/2019.1/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect2.o mux.o ssh-sk-client.o -L/new-home/sukeshg/svnwork/ant-confd/os/../art/os-ant-revi/buildos/openssh/openssh-portable-V_8_2_P1/openbsd-compat/ -lssh -lopenbsd-compat  -lcrypto -ldl -lutil -lz  -lcrypt -lresolv
/tools/xilinx/SDK/2019.1/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld: /new-home/sukeshg/svnwork/ant-confd/os/../art/os-ant-revi/buildos/openssh/openssh-portable-V_8_2_P1/openbsd-compat//libssh.a(utf8.o): undefined reference to symbol 'strcasestr@@GLIBC_2.17'
/tools/xilinx/SDK/2019.1/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld: /tools/xilinx/SDK/2019.1/gnu/aarch64/lin/aarch64-linux/bin/../aarch64-linux-gnu/libc/lib/libc.so.6: error adding symbols: DSO missing from command line
make[2]: *** [ssh] Error 1


Can anybody help me resolving this issue.

Regards,
Sukesh.R
Comment 1 Darren Tucker 2020-05-22 08:33:43 AEST
Configure should have detected that you don't have strcasestr.  What is HAVE_STRCASESTR set to in config.h

There's also something weird about your build environment:

> /tools/xilinx/SDK/2019.1/gnu/aarch64/lin/aarch64-linux/bin/aarch64-linux-gnu-ld: /new-home/sukeshg/svnwork/ant-confd/os/../art/os-ant-revi/buildos/openssh/openssh-portable-V_8_2_P1/openbsd-compat//libssh.a(utf8.o): undefined reference to symbol 'strcasestr@@GLIBC_2.17'

libssh.a lives in the top level directory not openbsd-compat.  How are you running configure?  Also make sure you don't have a config.h from another system in the path somewhere.
Comment 2 sukesh gowda 2020-05-23 01:14:27 AEST
Hi Dareen,

You are correct HAVE_STRCASESTR is set in config.h But when I do a cross compile its giving error. Because I am doing autoreconf on the host system(x86) and compiling for ARM64.

Can you please tell me How do I cross compile for a different target which doesn't support autoconf/autoreconf. Without autoreconf I don't get configure for file.

Regards,
Sukesh.R
Comment 3 sukesh gowda 2020-05-23 02:40:17 AEST
Hi Daren,

Sorry for the previous message, I got confused.
I downloaded a package from https://github.com/openssh/openssh-portable/releases/V_8_2_P1.tar.gz
Extracted it.
Do autoreconf.
Then run it on docker with cross-compiler settings.
I can see from the log “checking for strcasestr... yes”
So in config.h I can see 
#define HAVE_STRCASESTR 1

What else could be the reason for undefined reference to symbol 'strcasestr@@GLIBC_2.17'

I was getting few loader errors so moved libssh.a inside openbsd-compat folder, its just for testing

Regards,
Sukesh.R
Comment 4 Darren Tucker 2020-05-23 17:46:12 AEST
(In reply to sukesh gowda from comment #2)
> You are correct HAVE_STRCASESTR is set in config.h But when I do a
> cross compile its giving error. Because I am doing autoreconf on the
> host system(x86) and compiling for ARM64.

How are you configuring it?

> Can you please tell me How do I cross compile for a different target
> which doesn't support autoconf/autoreconf. Without autoreconf I
> don't get configure for file.
[...]
> Sorry for the previous message, I got confused.
> I downloaded a package from
> https://github.com/openssh/openssh-portable/releases/V_8_2_P1.tar.gz
> Extracted it.
> Do autoreconf.

You're downloading the source code by release tag, which is fine but it doesn't have generated files such as configure.  If you download the release tarball (eg https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-8.2p1.tar.gz) it'll have them.

> Then run it on docker with cross-compiler settings.

Exactly what "cross-compiler settings"?

> I can see from the log “checking for strcasestr... yes”
> So in config.h I can see 
> #define HAVE_STRCASESTR 1
> 
> What else could be the reason for undefined reference to symbol
> 'strcasestr@@GLIBC_2.17'
> 
> I was getting few loader errors so moved libssh.a inside
> openbsd-compat folder, its just for testing

Every thing that you do without mentioning it here makes it harder to figure out what's going on.
Comment 5 sukesh gowda 2020-06-01 03:15:26 AEST
Hi,

I was able to solve the issue. I changed compiler to aarch64-linux-gnu-gcc and was able to compile.

I am facing one more problem while connecting to ssh subsystem

fxt23190004 /usr/bin # ssh -s -vv -p 2022 root@127.0.0.1 netconf OpenSSH_8.2p1, OpenSSL 1.0.2r  26 Feb 2019
debug2: resolve_canonicalize: hostname 127.0.0.1 is address
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug2: ssh_connect_direct
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2022.
debug1: Connection established.
debug1: identity file /home/root/.ssh/id_rsa type -1
debug1: identity file /home/root/.ssh/id_rsa-cert type -1
debug1: identity file /home/root/.ssh/id_dsa type -1
debug1: identity file /home/root/.ssh/id_dsa-cert type -1
debug1: identity file /home/root/.ssh/id_ecdsa type -1
debug1: identity file /home/root/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/root/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/root/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/root/.ssh/id_ed25519 type -1
debug1: identity file /home/root/.ssh/id_ed25519-cert type -1
debug1: identity file /home/root/.ssh/id_ed25519_sk type -1
debug1: identity file /home/root/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/root/.ssh/id_xmss type -1
debug1: identity file /home/root/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2
debug1: Remote protocol version 2.0, remote software version ConfD-7.3.1
debug1: match: ConfD-7.3.1 pat ConfD-* compat 0x00000001
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to 127.0.0.1:2022 as 'root'
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 127.0.0.1 port 2022

I am not able to understand why the connection is closed.

Regards,
Sukesh.R
Comment 6 Damien Miller 2020-06-01 11:19:50 AEST
I recommend checking the server's log. A sshd run in debug mode ("sshd -ddd") will give the most information.
Comment 7 Darren Tucker 2020-06-01 12:00:24 AEST
"Remote protocol version 2.0, remote software version ConfD-7.3.1"

The server is not OpenSSH, so you'll need to consult its documentation for the equivalent debugging mode.
Comment 8 Darren Tucker 2020-11-29 18:50:15 AEDT
The original problem as reported has been resolved, the other mentioned issue does not have sufficient information to debug (but one plausible explanation is that the server is crashing on receipt of the KEX packet, which is not a fault with OpenSSH.  You could try cutting down KexAlgorithms, HostKeyAlgorithms, Ciphers, MACs to see if any of them make a difference.)

Please open a new bug if you have any evidence of a fault with OpenSSH.
Comment 9 Damien Miller 2021-03-04 09:54:21 AEDT
close bugs that were resolved in OpenSSH 8.5 release cycle