Opened 4 years ago

Closed 3 years ago

#62500 closed defect (fixed)

ruby21, ruby22: error: conflicting types for 'HMAC_CTX_copy'

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: kimuraw (kimura wataru)
Priority: Normal Milestone:
Component: ports Version: 2.6.99
Keywords: Cc:
Port: ruby21 ruby22

Description

ruby21 and ruby22 do not build:

:info:build compiling ossl_pkcs7.c
:info:build In file included from ossl_pkcs7.c:11:
:info:build In file included from ./ossl.h:219:
:info:build ./openssl_missing.h:71:6: error: conflicting types for 'HMAC_CTX_copy'
:info:build void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
:info:build      ^
:info:build /opt/local/include/openssl-1.0/openssl/hmac.h:101:5: note: previous declaration is here
:info:build int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
:info:build     ^

Attachments (2)

main.ruby21.log (99.2 KB) - added by ryandesign (Ryan Carsten Schmidt) 4 years ago.
main.ruby22.log (88.4 KB) - added by ryandesign (Ryan Carsten Schmidt) 4 years ago.

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.ruby21.log added

Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.ruby22.log added

comment:1 Changed 3 years ago by kimura wataru <kimuraw@…>

Resolution: fixed
Status: assignedclosed

In 640784d862c03447ac672d4eb3a5602a82e6c809/macports-ports (master):

lang/ruby22, ruby21: fix build error at ext/openssl

closes: #62500

see: https://github.com/rbenv/ruby-build/issues/1489

conftest from ext/openssl/extconf.rb runs without including <openssl/*.h>.
this leads conflicts between ext/openssl/extconf.h and ext/openssl/*.[hc]
under "-Werror=implicit-function-declaration", default with recent Xcode.

ext/openssl/mkmf.log:

have_func: checking for HMAC_CTX_copy()... -------------------- yes  #### <= returns "no" under -Werror=implicit-function-declaration

"/usr/bin/clang -o conftest -I../../.ext/include/x86_64-darwin20 -I../.././include -I../.././ext/openssl  -I/opt/local/include/openssl-1.0 -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -pipe -Os -Wno-error=implicit-function-declaration -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fno-common  conftest.c  -L/opt/local/lib/openssl-1.0 -L/opt/local/lib -L. -L../.. -L. -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fstack-protector -L/opt/local/lib  -L/opt/local/lib   -arch x86_64   -lssl -lcrypto -lruby.2.2.0-static -framework CoreFoundation  -lssl -lcrypto -lpthread -ldl -lobjc "
conftest.c:13:57: error: use of undeclared identifier 'HMAC_CTX_copy'
int t(void) { void ((*volatile p)()); p = (void ((*)()))HMAC_CTX_copy; return 0; }
    ¦   ¦   ¦   ¦   ¦   ¦   ¦   ¦   ¦   ¦               ^
1 error generated.
checked program was:
/* begin */
 1: #include "ruby.h"  #### <= includes only ruby.h
 2:-
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10:-
11:   return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))HMAC_CTX_copy; return 0; }
/* end */
Note: See TracTickets for help on using tickets.