Bug 227542 - devel/grpc: Fix build with LibreSSL < 2.7
Summary: devel/grpc: Fix build with LibreSSL < 2.7
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
Keywords: patch
Depends on:
Reported: 2018-04-16 06:08 UTC by Tobias Kortkamp
Modified: 2018-04-16 08:04 UTC (History)
1 user (show)

See Also:
vanilla: maintainer-feedback+

grpc.diff (1.80 KB, patch)
2018-04-16 06:08 UTC, Tobias Kortkamp
tobik: maintainer-approval? (vanilla)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Kortkamp freebsd_committer 2018-04-16 06:08:29 UTC
Created attachment 192546 [details]


building grpc fails for me with DEFAULT_VERSIONS=ssl=libressl in
make.conf.  The attached patch fixes the build for me.

/usr/bin/c++  -DPB_FIELD_16BIT -Dgrpc_cronet_EXPORTS -Iinclude -I. -isystem /usr/local/include -Ithird_party/benchmark/include -Ithird_party/address_sorting/include -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -std=c++11 -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -fPIC -MD -MT CMakeFiles/grpc_cronet.dir/src/core/tsi/alts/crypt/aes_gcm.cc.o -MF CMakeFiles/grpc_cronet.dir/src/core/tsi/alts/crypt/aes_gcm.cc.o.d -o CMakeFiles/grpc_cronet.dir/src/core/tsi/alts/crypt/aes_gcm.cc.o -c src/core/tsi/alts/crypt/aes_gcm.cc
src/core/tsi/alts/crypt/aes_gcm.cc:199:20: error: use of undeclared identifier 'HMAC_CTX_new'; did you mean 'BN_CTX_new'?
  HMAC_CTX* hmac = HMAC_CTX_new();
/usr/local/include/openssl/bn.h:350:9: note: 'BN_CTX_new' declared here
BN_CTX *BN_CTX_new(void);
src/core/tsi/alts/crypt/aes_gcm.cc:199:13: error: cannot initialize a variable of type 'HMAC_CTX *' (aka 'hmac_ctx_st *') with an rvalue of type 'BN_CTX *' (aka 'bignum_ctx *')
  HMAC_CTX* hmac = HMAC_CTX_new();
            ^      ~~~~~~~~~~~~~~
2 errors generated.
ninja: build stopped: subcommand failed.
Comment 1 Vanilla I. Shu freebsd_committer 2018-04-16 06:12:19 UTC
seems fine to me, please commit it, thanks.
Comment 2 Tobias Kortkamp freebsd_committer 2018-04-16 08:03:38 UTC
Comment 3 commit-hook freebsd_committer 2018-04-16 08:04:25 UTC
A commit references this bug:

Author: tobik
Date: Mon Apr 16 08:03:30 UTC 2018
New revision: 467465
URL: https://svnweb.freebsd.org/changeset/ports/467465

  devel/grpc: Fix build with LibreSSL < 2.7

  PR:		227542
  Approved by:	vanilla (maintainer)