Repository navigation
Build and configure with a C++ compiler - #1317
Open
ejohnstown wants to merge 3 commits into
Open
ejohnstown wants to merge 3 commits into
ejohnstown wants to merge 3 commits into
Conversation
AC_CHECK_LIB and AC_CHECK_FUNCS declare the probed symbol themselves, without extern "C", so under CC=g++ the link looks for a mangled name and the check fails. Probe each library with AC_LINK_IFELSE through the header the sources use, so the checks work under C and C++. - wolfssl: wolfCrypt_Init and wc_ecc_set_rng, after options.h - util: forkpty through pty.h or util.h; glibc before 2.34 needs -lutil - crypt: crypt through unistd.h, with the XSI feature-test macros - wolftpm: wolfTPM2_Init through wolftpm/tpm2_wrap.h
C++ rejects three C idioms the tree uses: a conditional mixing an enum
constant with a byte, one mixing INADDR_ANY with a pointer, and a {0}
initializer for a struct. Cast the integer arms of the conditionals,
and clear the structs with WMEMSET instead.
- internal.c, regress.c: cast the ID_UNKNOWN arm to byte
- test.h: cast INADDR_ANY through size_t to const char*
- keygen.c, certman.c, echoserver.c, auth.c: replace {0} with WMEMSET
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1317
Scan targets checked: wolfssh-src, wolfssh-bugs
Coverage: 0 of 7 in-scope changed file(s) opened by the reviewer; not opened: examples/echoserver/echoserver.c, src/certman.c, src/internal.c, src/keygen.c, tests/auth.c, tests/regress.c, wolfssh/test.h
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Lite
Run the wolfSSL link probe under AC_CACHE_CHECK with AC_CHECK_LIB's cache name, so a preset ac_cv_lib_wolfssl_wolfCrypt_Init=yes skips the link test. The mingw cert-store CI job relies on this, as it has no cross-built wolfSSL to link against.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
configure and the sources now work with a C++ compiler as
CC. Autoconf'sAC_CHECK_LIBandAC_CHECK_FUNCSdeclare the probed symbol withoutextern "C", so underCC=g++every library check failed to link.AC_LINK_IFELSEthrough the headers the sources useWMEMSETinstead of{0}