Bug 247229 - security/john: Fails to build on FreeBSD 12.1 if OpenCL is installed
Summary: security/john: Fails to build on FreeBSD 12.1 if OpenCL is installed
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-13 07:13 UTC by Ting-Wei Lan
Modified: 2020-06-13 07:13 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ting-Wei Lan 2020-06-13 07:13:48 UTC
Here are the error messages. It looks like there are some OpenSSL problems in the code when OpenCL is enabled.

gmake[2]: Entering directory '/wrkdirs/usr/ports/security/john/work/john-1.8.0-jumbo-1/src'
cc -DAC_BUILT -march=native  -c -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -I/usr/local/include -I/usr/include -DARCH_LITTLE_ENDIAN=1 -DJOHN_SYSTEMWIDE=1  -Wall -Wdeclaration-after-statement -fomit-frame-pointer -Wno-deprecated-declarations -Wno-format-extra-args -Qunused-arguments -D__BSD_VISIBLE   -I/usr/include -fopenmp  -D_THREAD_SAFE -pthread  -DHAVE_OPENCL -D_THREAD_SAFE -pthread -funroll-loops opencl_dmg_fmt_plug.c -o opencl_dmg_fmt_plug.o
opencl_dmg_fmt_plug.c:527:17: error: variable has incomplete type 'EVP_CIPHER_CTX' (aka 'struct evp_cipher_ctx_st')
        EVP_CIPHER_CTX ctx;
                       ^
/usr/include/openssl/ossl_typ.h:90:16: note: forward declaration of 'struct evp_cipher_ctx_st'
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
               ^
opencl_dmg_fmt_plug.c:575:18: error: variable has incomplete type 'EVP_CIPHER_CTX' (aka 'struct evp_cipher_ctx_st')
                EVP_CIPHER_CTX ctx;
                               ^
/usr/include/openssl/ossl_typ.h:90:16: note: forward declaration of 'struct evp_cipher_ctx_st'
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
               ^
opencl_dmg_fmt_plug.c:582:12: error: variable has incomplete type 'HMAC_CTX' (aka 'struct hmac_ctx_st')
                HMAC_CTX hmacsha1_ctx;
                         ^
/usr/include/openssl/ossl_typ.h:102:16: note: forward declaration of 'struct hmac_ctx_st'
typedef struct hmac_ctx_st HMAC_CTX;
               ^
opencl_dmg_fmt_plug.c:600:3: warning: implicit declaration of function 'HMAC_CTX_init' is invalid in C99 [-Wimplicit-function-declaration]
                HMAC_CTX_init(&hmacsha1_ctx);
                ^
opencl_dmg_fmt_plug.c:604:3: warning: implicit declaration of function 'HMAC_CTX_cleanup' is invalid in C99 [-Wimplicit-function-declaration]
                HMAC_CTX_cleanup(&hmacsha1_ctx);
                ^
2 warnings and 3 errors generated.
gmake[2]: *** [Makefile:502: opencl_dmg_fmt_plug.o] Error 1
gmake[2]: Leaving directory '/wrkdirs/usr/ports/security/john/work/john-1.8.0-jumbo-1/src'

This problem was found when building john on a desktop machine. To reproduce it in poudriere, adds opencl and ocl-icd to the build environment:

diff --git a/security/john/Makefile b/security/john/Makefile
index 287d45e8982..153a61feb89 100644
--- a/security/john/Makefile
+++ b/security/john/Makefile
@@ -19,6 +19,7 @@ LICENSE=      GPLv2
 BROKEN_mips64= cannot detect CPU architecture
 
 LIB_DEPENDS=   libgmp.so:math/gmp
+BUILD_DEPENDS= opencl>=0:devel/opencl ocl-icd>=0:devel/ocl-icd
 
 USES=          gmake shebangfix ssl tar:xz
 GNU_CONFIGURE= yes