Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build system. #8

Merged
merged 1 commit into from
Mar 12, 2015
Merged

CMake build system. #8

merged 1 commit into from
Mar 12, 2015

Conversation

alamaison
Copy link
Contributor

Tested:

  • Windows:
    • Visual C++ 2005/2008/2010/2012/2013/MinGW-w64
    • static/shared
    • 32/64-bit
    • OpenSSL/WinCNG
    • Without zlib
  • Linux:
    • GCC 4.6.3/Clang 3.4
    • static/shared
    • 32/64-bit
    • OpenSSL/Libgcrypt
    • With/Without zlib
  • MacOS X
    • AppleClang 6.0.0
    • static
    • 64-bit
    • OpenSSL
    • Without zlib

Tested:
 - Windows:
    - Visual C++ 2005/2008/2010/2012/2013/MinGW-w64
    - static/shared
    - 32/64-bit
    - OpenSSL/WinCNG
    - Without zlib
 - Linux:
    - GCC 4.6.3/Clang 3.4
    - static/shared
    - 32/64-bit
    - OpenSSL/Libgcrypt
    - With/Without zlib
 - MacOS X
    - AppleClang 6.0.0
    - static
    - 64-bit
    - OpenSSL
    - Without zlib

Conflicts:
	README
@alamaison alamaison self-assigned this Mar 12, 2015
@bagder
Copy link
Member

bagder commented Mar 12, 2015

+1 from me

alamaison added a commit that referenced this pull request Mar 12, 2015
@alamaison alamaison merged commit 41ed2b7 into libssh2:master Mar 12, 2015
@alamaison alamaison deleted the cmake branch March 12, 2015 23:13
@bagder
Copy link
Member

bagder commented Mar 12, 2015

Unfortunately this broke the configure build... (and if I may ask, I think we should avoid merge commits and keep a linear history)

@alamaison
Copy link
Contributor Author

What error are you seeing? It seems to be working: https://drone.io/github.com/alamaison/libssh2/51

@alamaison
Copy link
Contributor Author

I'll do pull requests from master in future.

@alamaison
Copy link
Contributor Author

I think I know the problem, testing a fix now.

alamaison added a commit to alamaison/libssh2 that referenced this pull request Mar 13, 2015
Autotools expects a configuration template file at src/libssh2_config.h.in, which buildconf generates.  But the CMake build system has its CMake-specific version of the file at this path.  This means that, if you don't run buildconf, the Autotools build will fail because it configured the wrong header template.

See libssh2#8.
alamaison added a commit to alamaison/libssh2 that referenced this pull request Mar 13, 2015
Autotools expects a configuration template file at src/libssh2_config.h.in, which buildconf generates.  But the CMake build system has its CMake-specific version of the file at this path.  This means that, if you don't run buildconf, the Autotools build will fail because it configured the wrong header template.

See libssh2#8.
@alamaison
Copy link
Contributor Author

Fixed: 042993b

The CMake build didn't actually break the Autotools build, it just seemed that way because it made the error less obvious. You probably forgot to run buildconf, am I right?

Previously, you would have seen an error, during configure, saying something like 'could not find src/libssh2_config.h.in'. But I had added a file at that location for CMake. buildconf would overwrite it, which was why the CI builds didn't notice anything.

@bagder
Copy link
Member

bagder commented Mar 13, 2015

Yeps, works fine now. One little nit remains though. After I run buildconf and configure (running in the source tree), a file in the git repo is changed: example/libssh2_config.h.in.

I think we need to come up with a way to make this not happen.

@alamaison
Copy link
Contributor Author

Same cause: Fixed now:
bbbdf94

On 13 March 2015 at 07:10, Daniel Stenberg notifications@github.com wrote:

Yeps, works fine now. One little nit remains though. After I run buildconf
and configure (running in the source tree), a file in the git repo is
changed: example/libssh2_config.h.in.

I think we need to come up with a way to make this not happen.


Reply to this email directly or view it on GitHub
#8 (comment).

@bagder
Copy link
Member

bagder commented Mar 13, 2015

Lovely, thanks. Confirmed to work for me now!

@JxLiu2016
Copy link

@alamaison Hi, I build libssh2 with x86 Windows. Is it possible to build libssh2 with 64 windows?
I wish to use libssh2.lib with "Release 64" in Visual Studio 2015.

@alamaison
Copy link
Contributor Author

Yes, you just choose the 64 bit generator when you configure the build with
CMake

On Mon, 10 Oct 2016, 09:39 JxLiu2016, notifications@github.com wrote:

@alamaison https://github.com/alamaison Hi, I build libssh2 with x86
Windows. Is it possible to build libssh2 with 64 windows?
I wish to use libssh2.lib with "Release 64" in Visual Studio 2015.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#8 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAkbBwhnbkRSg2L0S6CMolYTq7PqOxt9ks5qyfmtgaJpZM4Dt-WR
.

kbulgrien pushed a commit to kbulgrien/libssh2-1.2.4-sco3.2v5.0.7 that referenced this pull request Dec 14, 2018
kbulgrien pushed a commit to kbulgrien/libssh2-1.2.4-sco3.2v5.0.7 that referenced this pull request Dec 14, 2018
Autotools expects a configuration template file at src/libssh2_config.h.in, which buildconf generates.  But the CMake build system has its CMake-specific version of the file at this path.  This means that, if you don't run buildconf, the Autotools build will fail because it configured the wrong header template.

See libssh2#8.
tiennou added a commit to tiennou/libssh2 that referenced this pull request Jul 4, 2019
Caught by ASAN:

=================================================================
==73797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700001bcf0 at pc 0x00010026198d bp 0x7ffeefbfed30 sp 0x7ffeefbfe4d8
READ of size 69 at 0x60700001bcf0 thread T0
2019-07-04 08:35:30.292502+0200 atos[73890:2639175] examining /Users/USER/*/libssh2_clar [73797]
    #0 0x10026198c in wrap_memchr (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c)
    #1 0x1000f8e66 in file_read_publickey userauth.c:633
    #2 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
    libssh2#3 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
    libssh2#4 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
    libssh2#5 0x1000090c3 in clar_run_test clar.c:260
    libssh2#6 0x1000038f3 in clar_run_suite clar.c:343
    libssh2#7 0x100003272 in clar_test_run clar.c:522
    libssh2#8 0x10000c3cc in main runner.c:60
    libssh2#9 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)

0x60700001bcf0 is located 0 bytes to the right of 80-byte region [0x60700001bca0,0x60700001bcf0)
allocated by thread T0 here:
    #0 0x10029e053 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5c053)
    #1 0x1000b4978 in libssh2_default_alloc session.c:67
    #2 0x1000f8aba in file_read_publickey userauth.c:597
    libssh2#3 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
    libssh2#4 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
    libssh2#5 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
    libssh2#6 0x1000090c3 in clar_run_test clar.c:260
    libssh2#7 0x1000038f3 in clar_run_suite clar.c:343
    libssh2#8 0x100003272 in clar_test_run clar.c:522
    libssh2#9 0x10000c3cc in main runner.c:60
    libssh2#10 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)

SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) in wrap_memchr
Shadow bytes around the buggy address:
  0x1c0e00003740: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd
  0x1c0e00003750: fd fd fd fd fd fd fd fa fa fa fa fa 00 00 00 00
  0x1c0e00003760: 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 00 00
  0x1c0e00003770: 00 00 00 fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x1c0e00003780: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fa
=>0x1c0e00003790: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[fa]fa
  0x1c0e000037a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
willco007 pushed a commit that referenced this pull request Jul 15, 2019
…386)

File: userauth.c

Credit: 
Etienne Samson

Notes: 
Caught by ASAN:

=================================================================
==73797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700001bcf0 at pc 0x00010026198d bp 0x7ffeefbfed30 sp 0x7ffeefbfe4d8
READ of size 69 at 0x60700001bcf0 thread T0
2019-07-04 08:35:30.292502+0200 atos[73890:2639175] examining /Users/USER/*/libssh2_clar [73797]
    #0 0x10026198c in wrap_memchr (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c)
    #1 0x1000f8e66 in file_read_publickey userauth.c:633
    #2 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
    #3 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
    #4 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
    #5 0x1000090c3 in clar_run_test clar.c:260
    #6 0x1000038f3 in clar_run_suite clar.c:343
    #7 0x100003272 in clar_test_run clar.c:522
    #8 0x10000c3cc in main runner.c:60
    #9 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)

0x60700001bcf0 is located 0 bytes to the right of 80-byte region [0x60700001bca0,0x60700001bcf0)
allocated by thread T0 here:
    #0 0x10029e053 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5c053)
    #1 0x1000b4978 in libssh2_default_alloc session.c:67
    #2 0x1000f8aba in file_read_publickey userauth.c:597
    #3 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
    #4 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
    #5 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
    #6 0x1000090c3 in clar_run_test clar.c:260
    #7 0x1000038f3 in clar_run_suite clar.c:343
    #8 0x100003272 in clar_test_run clar.c:522
    #9 0x10000c3cc in main runner.c:60
    #10 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)

SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) in wrap_memchr
Shadow bytes around the buggy address:
  0x1c0e00003740: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd
  0x1c0e00003750: fd fd fd fd fd fd fd fa fa fa fa fa 00 00 00 00
  0x1c0e00003760: 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 00 00
  0x1c0e00003770: 00 00 00 fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x1c0e00003780: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fa
=>0x1c0e00003790: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[fa]fa
  0x1c0e000037a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
alex-weaver pushed a commit to alex-weaver/libssh2 that referenced this pull request Mar 23, 2023
alex-weaver pushed a commit to alex-weaver/libssh2 that referenced this pull request Mar 23, 2023
Autotools expects a configuration template file at src/libssh2_config.h.in, which buildconf generates.  But the CMake build system has its CMake-specific version of the file at this path.  This means that, if you don't run buildconf, the Autotools build will fail because it configured the wrong header template.

See libssh2#8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants