Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#63644 closed defect (fixed)

ruby @1.8.7-p374_13: error: implicit declaration of function 'X509_STORE_get_ex_data' is invalid in C99

Reported by: cooljeanius (Eric Gallager) Owned by: kimura wataru <kimuraw@…>
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: bigsur catalina Cc: kimuraw (kimura wataru), cjones051073 (Chris Jones)
Port: ruby

Description

Looks like some combination of -Werror=implicit-function-declaration being on by default now, and an openssl version incompatibility:

compiling openssl
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby/ruby/work/ruby-1.8.7-p374/ext/openssl'
/usr/bin/clang -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -I/opt/local/libexec/openssl10/include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -fno-common -pipe -O1 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64  -fno-common -pipe -fno-common  -I/opt/local/libexec/openssl11/include -arch x86_64 -c ossl.c
ossl.c:209:16: error: implicit declaration of function 'X509_STORE_get_ex_data' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        proc = (VALUE)X509_STORE_get_ex_data(ctx->ctx, ossl_verify_cb_idx);
                      ^
ossl.c:209:16: note: did you mean 'X509_STORE_CTX_get_ex_data'?
/opt/local/libexec/openssl10/include/openssl/x509_vfy.h:542:7: note: 'X509_STORE_CTX_get_ex_data' declared here
void *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx);
      ^
1 error generated.
make[1]: *** [ossl.o] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby/ruby/work/ruby-1.8.7-p374/ext/openssl'
make: *** [all] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby/ruby/work/ruby-1.8.7-p374'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_ruby/ruby/work/ruby-1.8.7-p374" && /usr/bin/make -j1 -w all 
Exit code: 2
Error: Failed to build ruby: command execution failed
DEBUG: Error code: CHILDSTATUS 6622 2

Change History (12)

comment:1 Changed 16 months ago by jmroot (Joshua Root)

The CPPFLAGS are pointing to both openssl 1.1 and 1.0.

comment:2 Changed 16 months ago by jmroot (Joshua Root)

Cc: cjones051073 added

And it seems to be missing its openssl dependency.

comment:3 Changed 16 months ago by cjones051073 (Chris Jones)

comment:4 Changed 16 months ago by jmroot (Joshua Root)

The implicit declaration error may well have been from using the wrong headers.

comment:5 Changed 16 months ago by cjones051073 (Chris Jones)

no, they still occur on macOS11.

comment:6 Changed 16 months ago by cjones051073 (Chris Jones)

Actually you might be right, most build instantiations correctly respect the configuration to use openssl10 by placing the include directive for this first

/usr/bin/clang -pipe -I/opt/local/libexec/openssl10/include -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64  -fno-common -pipe -fno-common    -DRUBY_EXPORT -arch x86_64 -I. -I. -I/opt/local/libexec/openssl10/include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -c numeric.c

but not all...

/usr/bin/clang -I. -I../.. -I../../. -I../.././ext/tk -I/opt/local/include -I/opt/local/include -DHAVE_RB_SAFE_LEVEL -DHAVE_RB_HASH_LOOKUP -DHAVE_RB_PROC_NEW -DHAVE_RB_OBJ_TAINT -DHAVE_ST_PTR -DHAVE_ST_LEN  -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DNO_VALUES_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DHAVE_ZLIB=1 -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_HIDDEN=1 -DMAC_OSX_TCL=1 -DHAVE_COREFOUNDATION=1 -DHAVE_CAST_TO_UNION=1 -DTCL_SHLIB_EXT=\".dylib\" -DNDEBUG=1 -DTCL_CFG_OPTIMIZED=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_GETCWD=1 -DHAVE_MKSTEMP=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETNAMEINFO=1 -DHAVE_GETADDRINFO=1 -DHAVE_FREEADDRINFO=1 -DHAVE_GAI_STRERROR=1 -DHAVE_STRUCT_ADDRINFO=1 -DHAVE_STRUCT_IN6_ADDR=1 -DHAVE_STRUCT_SOCKADDR_IN6=1 -DHAVE_STRUCT_SOCKADDR_STORAGE=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_MTSAFE_GETHOSTBYNAME=1 -DHAVE_MTSAFE_GETHOSTBYADDR=1 -DHAVE_TERMIOS_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_CHFLAGS=1 -DHAVE_MKSTEMPS=1 -DHAVE_GETATTRLIST=1 -DHAVE_COPYFILE_H=1 -DHAVE_COPYFILE=1 -DHAVE_LIBKERN_OSATOMIC_H=1 -DHAVE_OSSPINLOCKLOCK=1 -DUSE_VFORK=1 -DTCL_DEFAULT_ENCODING=\"utf-8\" -DTCL_LOAD_FROM_MEMORY=1 -DTCL_WIDE_CLICKS=1 -DHAVE_AVAILABILITYMACROS_H=1 -DHAVE_WEAK_IMPORT=1 -D_DARWIN_C_SOURCE=1 -DHAVE_FTS=1 -DHAVE_SYS_FILIO_H=1 -DTCL_UNLOAD_DLLS=1 -DHAVE_CPUID=1  -DTCL_CFG_DO64BIT=1 -DHAVE_PW_GECOS=1 -DHAVE_LIBXFT=1 -DHAVE_XFT=1 -DHAVE_XKBKEYCODETOKEYSYM=1 -DXKEYCODETOKEYSYM_IS_DEPRECATED=1 -DHAVE_XSS=1  -DRUBY_VERSION=\"1.8.7\" -DRUBY_RELEASE_DATE=\"2013-06-27\" -I/opt/local/libexec/openssl10/include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE  -I/opt/local/libexec/openssl10/include -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -DWITH_TCL_ENABLE_THREAD=1 -fno-common -pipe -I/opt/local/libexec/openssl10/include -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -arch x86_64  -fno-common -pipe -fno-common  -arch x86_64 -c tcltklib.c
tcltklib.c:6246:9: warning: assigning to 'const char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
      s = Tcl_GetByteArrayFromObj(obj, &len);
        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcltklib.c:6286:40: warning: passing 'const char *' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            return Tcl_NewByteArrayObj(s, RSTRING_LEN(str));
                                       ^
/opt/local/include/tclDecls.h:195:59: note: passing argument to parameter 'bytes' here
EXTERN Tcl_Obj *        Tcl_NewByteArrayObj(const unsigned char *bytes,
                                                                 ^
tcltklib.c:6298:36: warning: passing 'const char *' to parameter of type 'const unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
        return Tcl_NewByteArrayObj(s, RSTRING_LEN(str));
                                   ^
/opt/local/include/tclDecls.h:195:59: note: passing argument to parameter 'bytes' here
EXTERN Tcl_Obj *        Tcl_NewByteArrayObj(const unsigned char *bytes,
                                                                 ^
tcltklib.c:6387:26: error: implicit declaration of function 'rb_proc_new' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ret = rb_funcall(rb_proc_new(callq_safelevel_handler, q_dat), 
                         ^
tcltklib.c:6862:26: error: implicit declaration of function 'rb_proc_new' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ret = rb_funcall(rb_proc_new(evq_safelevel_handler, q_dat), 
                         ^
tcltklib.c:7454:15: warning: assigning to 'char *' from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            s = Tcl_GetByteArrayFromObj(tclstr, &len);
              ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcltklib.c:8256:26: error: implicit declaration of function 'rb_proc_new' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ret = rb_funcall(rb_proc_new(ivq_safelevel_handler, q_dat), 
                         ^
tcltklib.c:8337:46: warning: format specifies type 'int' but the argument has type 'Tcl_ThreadId' (aka 'struct Tcl_ThreadId_ *') [-Wformat]
    DUMP2("status: Tcl_GetCurrentThread %d", Tcl_GetCurrentThread());
                                        ~~   ^~~~~~~~~~~~~~~~~~~~~~
tcltklib.c:94:23: note: expanded from macro 'DUMP2'
fprintf(stderr, ARG1, ARG2); fprintf(stderr, "\n"); fflush(stderr); }
                ~~~~  ^~~~
tcltklib.c:10252:27: warning: assigning to 'Tcl_ObjType *' (aka 'struct Tcl_ObjType *') from 'const Tcl_ObjType *' (aka 'const struct Tcl_ObjType *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    Tcl_ObjType_ByteArray = Tcl_GetObjType(Tcl_ObjTypeName_ByteArray);
                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcltklib.c:10253:27: warning: assigning to 'Tcl_ObjType *' (aka 'struct Tcl_ObjType *') from 'const Tcl_ObjType *' (aka 'const struct Tcl_ObjType *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
    Tcl_ObjType_String    = Tcl_GetObjType(Tcl_ObjTypeName_String);
                          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcltklib.c:10008:43: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
    rb_define_const(ev_flag, "ALL",       INT2FIX(TCL_ALL_EVENTS));
                                          ^~~~~~~~~~~~~~~~~~~~~~~
../../ruby.h:143:40: note: expanded from macro 'INT2FIX'
#define INT2FIX(i) ((VALUE)(((long)(i))<<1 | FIXNUM_FLAG))
                            ~~~~~~~~~~~^
8 warnings and 3 errors generated.

note I do not think this is a result of the recent openssl changes - it would have also happened with the old_openssl PG if the default openssl port was installed at build time. The buildbot builds are OK because openssl is not in the deps., so will not be installed (only openssl10) and thus nothing will be found in the default prefix.

Last edited 16 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:7 Changed 16 months ago by kimuraw (kimura wataru)

port:ruby disables tk extension by default. (+tk or +mactk variant)

it looks "--without-tk" was deleted at https://github.com/macports/macports-ports/commit/04b491b387d4ba53ecf5f986de85a91ae66e4559. I think this is not an intentional change.

comment:8 Changed 16 months ago by cjones051073 (Chris Jones)

No, it was intentional as the configure step reports a warning that that option was not recognised, so it wasn’t doing anything.

comment:9 Changed 16 months ago by kimura wataru <kimuraw@…>

Owner: set to kimura wataru <kimuraw@…>
Resolution: fixed
Status: newclosed

In b7fca338790e1c9baeb17ffc44d8954d2516342b/macports-ports (master):

lang/ruby: fix build error of @1.8.7-p374_13

closes: #63644

  • revert deleting "--without-tk" from configure.args
  • update implicit.patch for ext/tk

comment:10 Changed 16 months ago by kimuraw (kimura wataru)

unfortunately, some of configure options works against "unrecognized" warnings.

comment:11 Changed 16 months ago by cjones051073 (Chris Jones)

No, its not required. Get rid of the option again and then just remove

	configure.args-delete	--without-tk

from the two variants that currently do this...

Last edited 16 months ago by cjones051073 (Chris Jones) (previous) (diff)

comment:12 Changed 16 months ago by cjones051073 (Chris Jones)

So, the default port build gives this during configure

configure: WARNING: unrecognized options: --without-tk

with the tk variant ...

configure: WARNING: unrecognized options: --with-tk, --disable-tcltk-framework

and with the mactk variant

configure: WARNING: unrecognized options: --enable-tcltk-framework

so the bottom line is *none* of these with or without tk configure options are actually valid and thus are not doing anything to the build... They should all be removed.

Last edited 16 months ago by cjones051073 (Chris Jones) (previous) (diff)
Note: See TracTickets for help on using tickets.