davidrg / ckwin

Kermit 95 (C-Kermit for Windows) - scriptable internet and serial communications with terminal emulation
Other
61 stars 16 forks source link

SSH Support on ARM32 #304

Open davidrg opened 2 weeks ago

davidrg commented 2 weeks ago

SSH support was disabled on ARM32 builds due to linker errors in libssh 0.10.3:

[ 77%] Linking C shared library ssh.dll
LINK: command "C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\arm\link.exe /nologo @CMakeFiles\ssh.dir\objects1.rsp /out:ssh.dll /implib:ssh.lib /pdb:D:\a\ckwin\ckwin\libssh\0.10.6\build\src\ssh.pdb /dll /version:4.9 /machine:ARM /INCREMENTAL:NO D:\a\ckwin\ckwin\openssl\3.0.14\libcrypto.lib iphlpapi.lib ws2_32.lib kernel32.lib user32.lib /MANIFEST:EMBED,ID=2" failed (exit code 1120) with the following output:
   Creating library ssh.lib and object ssh.exp
misc.c.obj : error LNK2019: unresolved external symbol __imp_GetUserNameA referenced in function ssh_get_local_username
misc.c.obj : error LNK2019: unresolved external symbol __imp_SHGetSpecialFolderPathA referenced in function ssh_get_user_home_dir
ssh.dll : fatal error LNK1120: 2 unresolved externals

It would be nice to resolve this. Perhaps newer versions of libssh don't have this issue, or maybe the problems are easily patched away.

wmjb commented 1 week ago

both those symbols are from Advapi32.lib, just add the library. -lAdvapi32 etc library is included in windows sdks

davidrg commented 4 days ago

Turns out CMake was leaving out a bunch of the default libraries when targeting ARM32 for some reason I probably don't care about. Adding -DCMAKE_C_STANDARD_LIBRARIES="kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" to the cmake command line seems to have been enough to at least get it to build.

This artifact (valid for 7 days) at least has SSH support present - whether it actually works or not is for now unknown: https://github.com/davidrg/ckwin/actions/runs/10918637849/artifacts/1946797310