Giter Club home page Giter Club logo

Comments (10)

dixyes avatar dixyes commented on May 9, 2024 3

给event扩展提了个pr(已合并):https://bitbucket.org/osmanov/pecl-event/pull-requests/18
理论上来说现在已经可以了

from static-php-cli.

char101 avatar char101 commented on May 9, 2024 2
  1. Add -lssl to LIBS before configure -> LIBS="-lssl [other libs]" ./configure
  2. Yes you need to copy the headers for the matching php version

from static-php-cli.

char101 avatar char101 commented on May 9, 2024 1

This is my configure line to embed event extension

configure() {
  OPTS=(
    --prefix=$PREFIX
    --disable-rpath
    --enable-re2c-cgoto
    --enable-fpm
    --disable-ipv6
    --with-openssl
    --with-pcre-jit
    --with-zlib
    --with-bz2
    --with-curl
    --enable-exif
    --with-ffi
    --enable-gd
    --with-webp
    --with-jpeg
    --with-freetype
    --with-gettext
    # --enable-intl  # static library too big, use carbon
    --with-ldap
    --enable-mbstring
    --with-mysqli=mysqlnd
    --enable-pcntl
    --with-pdo-mysql=mysqlnd
    --with-pdo-pgsql
    --with-pgsql
    --with-snmp
    --enable-soap
    --enable-sockets
    --with-zip
    --without-pear
    --enable-static
    --disable-shared
    --with-event-core
    --enable-redis
    --with-yaml
  )

  # rebuild configure to pick new ext

  rm configure
  ./buildconf --force

  # libevent
  sed -ie 's@\$abs_srcdir/php7@$abs_srcdir/ext/event/php7@' configure
  sed -ie 's@\$phpincludedir/ext/sockets/php_sockets.h@$abs_srcdir/ext/sockets/php_sockets.h@' configure
  cp  -f ext/event/php8/*.h ext/event

  # pq: pgcommon
  # freetype: brotli
  echo LDFLAGS=-static CFLAGS=-static LIBS=\"-lpgcommon -lpgport -lstdc++ -lsasl2 -lgdbm -levent\" ./configure "${OPTS[@]}" > config.cmd
  . config.cmd

  # brotli must be added last
  if [ -e Makefile ]; then
    sed -ie 's/^EXTRA_LIBS.*/\0 -lbrotlidec -lbrotlicommon/' Makefile
    sed -ie 's/-levent /-levent -levent_openssl /' Makefile
    sed -ie 's/-o $(SAPI_CLI_PATH)/-all-static -o $(SAPI_CLI_PATH)/g' Makefile
    sed -ie 's/-o $(SAPI_FPM_PATH)/-all-static -o $(SAPI_FPM_PATH)/g' Makefile
  fi
}

from static-php-cli.

char101 avatar char101 commented on May 9, 2024
mini:~/compile/php-static/dist-8.0.8$ ./bin/php -i | rg event
Configure Command =>  './configure'  '--prefix=/home/char/compile/php-static/dist-8.0.8' '--disable-rpath' '--enable-re2c-cgoto' '--enable-fpm' '--disable-ipv6' '--with-openssl' '--with-pcre-jit' '--with-zlib' '--with-bz2' '--with-curl' '--enable-exif' '--with-ffi' '--enable-gd' '--with-webp' '--with-jpeg' '--with-freetype' '--with-gettext' '--with-ldap' '--enable-mbstring' '--with-mysqli=mysqlnd' '--enable-pcntl' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql' '--with-pgsql' '--with-snmp' '--enable-soap' '--enable-sockets' '--with-zip' '--without-pear' '--enable-static' '--disable-shared' '--with-pic' '--with-event-core' '--enable-redis' '--with-yaml'
event
libevent2 headers version => 2.1.12-stable

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on May 9, 2024

With event added, it shows some error like this:

/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/event_util.o: warning: relocation against `socket_ce' in read-only section `.text'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/php_event.o: in function `php_event_bevent_free_obj':
php_event.c:(.text+0x591): undefined reference to `SSL_set_shutdown'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: php_event.c:(.text+0x59d): undefined reference to `SSL_shutdown'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: php_event.c:(.text+0x5a9): undefined reference to `SSL_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/php_event.o: in function `php_event_ssl_context_free_obj':
php_event.c:(.text+0xcc7): undefined reference to `SSL_CTX_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/php_event.o: in function `zm_startup_event':
php_event.c:(.text+0x81e6): undefined reference to `OPENSSL_init_ssl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: php_event.c:(.text+0x81f5): undefined reference to `OPENSSL_init_ssl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: php_event.c:(.text+0x8204): undefined reference to `OPENSSL_init_crypto'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: php_event.c:(.text+0x8213): undefined reference to `OPENSSL_init_crypto'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: php_event.c:(.text+0x8222): undefined reference to `OPENSSL_init_crypto'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: php_event.c:(.text+0x8249): undefined reference to `CRYPTO_get_ex_new_index'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/php_event.o: in function `zm_shutdown_event':
php_event.c:(.text+0x829a): undefined reference to `FIPS_mode_set'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: php_event.c:(.text+0x82a4): undefined reference to `CONF_modules_unload'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/src/util.o: in function `php_event_zval_to_fd':
util.c:(.text+0x286): undefined reference to `socket_ce'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/buffer_event.o: in function `zim_EventBufferEvent_createSslFilter':
buffer_event.c:(.text+0x468c): undefined reference to `SSL_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: buffer_event.c:(.text+0x46e9): undefined reference to `SSL_set_ex_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/buffer_event.o: in function `zim_EventBufferEvent_sslSocket':
buffer_event.c:(.text+0x4ab9): undefined reference to `SSL_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: buffer_event.c:(.text+0x4b0d): undefined reference to `SSL_set_ex_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/buffer_event.o: in function `zim_EventBufferEvent_sslError':
buffer_event.c:(.text+0x4db7): undefined reference to `ERR_error_string'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/buffer_event.o: in function `zim_EventBufferEvent_sslGetCipherInfo':
buffer_event.c:(.text+0x517c): undefined reference to `SSL_get_current_cipher'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: buffer_event.c:(.text+0x51a1): undefined reference to `SSL_CIPHER_description'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: buffer_event.c:(.text+0x52e7): undefined reference to `CRYPTO_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/buffer_event.o: in function `zim_EventBufferEvent_sslGetCipherName':
buffer_event.c:(.text+0x5421): undefined reference to `SSL_get_current_cipher'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: buffer_event.c:(.text+0x5429): undefined reference to `SSL_CIPHER_get_name'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/buffer_event.o: in function `zim_EventBufferEvent_sslGetCipherVersion':
buffer_event.c:(.text+0x5671): undefined reference to `SSL_get_current_cipher'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: buffer_event.c:(.text+0x5679): undefined reference to `SSL_CIPHER_get_version'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/buffer_event.o: in function `zim_EventBufferEvent_sslGetProtocol':
buffer_event.c:(.text+0x58c1): undefined reference to `SSL_get_version'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/event_util.o: in function `zim_EventUtil_sslRandPoll':
event_util.c:(.text+0x463): undefined reference to `RAND_poll'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/event_util.o: in function `zim_EventUtil_createSocket':
event_util.c:(.text+0xba2): undefined reference to `socket_ce'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: event_util.c:(.text+0xbd8): undefined reference to `socket_import_file_descriptor'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/http.o: in function `_bev_ssl_callback':
http.c:(.text+0xc3a): undefined reference to `SSL_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/http_connection.o: in function `zim_EventHttpConnection___construct':
http_connection.c:(.text+0x5a7): undefined reference to `SSL_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: http_connection.c:(.text+0x5f6): undefined reference to `SSL_set_ex_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/ssl_context.o: in function `verify_callback':
ssl_context.c:(.text+0x10): undefined reference to `SSL_get_ex_data_X509_STORE_CTX_idx'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x20): undefined reference to `X509_STORE_CTX_get_ex_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x38): undefined reference to `SSL_get_ex_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x48): undefined reference to `X509_STORE_CTX_get_current_cert'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x54): undefined reference to `X509_STORE_CTX_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/ssl_context.o: in function `_php_event_ssl_ctx_set_private_key':
ssl_context.c:(.text+0x186): undefined reference to `SSL_CTX_use_PrivateKey_file'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/ssl_context.o: in function `_php_event_ssl_ctx_set_local_cert':
ssl_context.c:(.text+0x243): undefined reference to `SSL_CTX_use_certificate_chain_file'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x2c3): undefined reference to `SSL_CTX_use_PrivateKey_file'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/ssl_context.o: in function `set_ssl_ctx_options':
ssl_context.c:(.text+0x539): undefined reference to `SSL_CTX_set_default_passwd_cb_userdata'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x54f): undefined reference to `SSL_CTX_set_default_passwd_cb'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x676): undefined reference to `SSL_CTX_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x6ef): undefined reference to `SSL_CTX_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x768): undefined reference to `SSL_CTX_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x794): undefined reference to `SSL_CTX_set_options'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x7ad): undefined reference to `SSL_CTX_clear_options'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x843): undefined reference to `SSL_CTX_set_verify_depth'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x8bc): undefined reference to `SSL_CTX_set_cipher_list'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x98c): undefined reference to `SSL_CTX_set_verify'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0x9c3): undefined reference to `SSL_CTX_set_cipher_list'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xa46): undefined reference to `SSL_CTX_load_verify_locations'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xa86): undefined reference to `SSL_load_client_CA_file'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xa98): undefined reference to `SSL_CTX_set_client_CA_list'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/ssl_context.o: in function `zim_EventSslContext___construct':
ssl_context.c:(.text+0xb75): undefined reference to `TLS_client_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xb83): undefined reference to `TLS_client_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xbf6): undefined reference to `TLS_server_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xc04): undefined reference to `TLS_server_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xc2d): undefined reference to `TLS_client_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xc53): undefined reference to `TLS_server_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xc79): undefined reference to `TLS_client_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xc9f): undefined reference to `TLS_server_method'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xcee): undefined reference to `SSL_CTX_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xe1a): undefined reference to `SSL_CTX_set_options'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ssl_context.c:(.text+0xe44): undefined reference to `SSL_CTX_set_session_id_context'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/ssl_context.o: in function `zim_EventSslContext_setMinProtoVersion':
ssl_context.c:(.text+0xf4f): undefined reference to `SSL_CTX_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: ext/event/php8/classes/ssl_context.o: in function `zim_EventSslContext_setMaxProtoVersion':
ssl_context.c:(.text+0x1075): undefined reference to `SSL_CTX_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bio_bufferevent_new':
bufferevent_openssl.c:(.text+0x47): undefined reference to `BIO_set_init'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x53): undefined reference to `BIO_set_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `BIO_new_bufferevent':
bufferevent_openssl.c:(.text+0x8f): undefined reference to `BIO_meth_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xaa): undefined reference to `BIO_meth_set_write'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xbd): undefined reference to `BIO_meth_set_read'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xd0): undefined reference to `BIO_meth_set_puts'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xe3): undefined reference to `BIO_meth_set_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xf6): undefined reference to `BIO_meth_set_create'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x109): undefined reference to `BIO_meth_set_destroy'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x115): undefined reference to `BIO_new'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x12a): undefined reference to `BIO_set_init'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x135): undefined reference to `BIO_set_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x13f): undefined reference to `BIO_set_shutdown'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bio_bufferevent_ctrl':
bufferevent_openssl.c:(.text+0x15c): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x183): undefined reference to `BIO_get_shutdown'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x18e): undefined reference to `BIO_set_shutdown'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `decrement_buckets':
bufferevent_openssl.c:(.text+0x20a): undefined reference to `SSL_get_wbio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x212): undefined reference to `BIO_number_written'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x221): undefined reference to `SSL_get_rbio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x229): undefined reference to `BIO_number_read'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `be_openssl_destruct':
bufferevent_openssl.c:(.text+0x3cb): undefined reference to `SSL_get_wbio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x3e1): undefined reference to `BIO_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bio_bufferevent_free':
bufferevent_openssl.c:(.text+0x415): undefined reference to `BIO_get_shutdown'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x42a): undefined reference to `BIO_get_init'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x436): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x443): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x453): undefined reference to `BIO_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bio_bufferevent_read':
bufferevent_openssl.c:(.text+0x475): undefined reference to `BIO_clear_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x482): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x48f): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x4b4): undefined reference to `BIO_set_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bio_bufferevent_write':
bufferevent_openssl.c:(.text+0x4f0): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x500): undefined reference to `BIO_clear_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x508): undefined reference to `BIO_get_data'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x553): undefined reference to `BIO_set_flags'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `conn_closed':
bufferevent_openssl.c:(.text+0x6d1): undefined reference to `SSL_get_shutdown'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x6f4): undefined reference to `ERR_peek_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x737): undefined reference to `ERR_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `do_read':
bufferevent_openssl.c:(.text+0x952): undefined reference to `ERR_clear_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x964): undefined reference to `SSL_read'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x9c1): undefined reference to `SSL_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `do_handshake':
bufferevent_openssl.c:(.text+0xbfc): undefined reference to `ERR_clear_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xc08): undefined reference to `SSL_do_handshake'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xc62): undefined reference to `SSL_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `be_openssl_set_fd':
bufferevent_openssl.c:(.text+0xe23): undefined reference to `SSL_clear'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xe38): undefined reference to `SSL_set_accept_state'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xe46): undefined reference to `SSL_clear'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xe56): undefined reference to `SSL_set_connect_state'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `be_openssl_ctrl':
bufferevent_openssl.c:(.text+0xeb3): undefined reference to `BIO_new_socket'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xed4): undefined reference to `SSL_set_bio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `do_write.isra.0':
bufferevent_openssl.c:(.text+0xfd1): undefined reference to `ERR_clear_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0xfe4): undefined reference to `SSL_write'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x103b): undefined reference to `SSL_get_error'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `consider_reading':
bufferevent_openssl.c:(.text+0x1368): undefined reference to `SSL_pending'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bufferevent_openssl_new_impl':
bufferevent_openssl.c:(.text+0x158c): undefined reference to `SSL_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x1612): undefined reference to `SSL_get_wbio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x1621): undefined reference to `BIO_number_written'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x1634): undefined reference to `SSL_get_rbio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x1643): undefined reference to `BIO_number_read'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x16d1): undefined reference to `SSL_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bufferevent_ssl_renegotiate':
bufferevent_openssl.c:(.text+0x1728): undefined reference to `SSL_renegotiate'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bufferevent_openssl_filter_new':
bufferevent_openssl.c:(.text+0x17e6): undefined reference to `SSL_set_bio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x1813): undefined reference to `SSL_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `bufferevent_openssl_socket_new':
bufferevent_openssl.c:(.text+0x1841): undefined reference to `SSL_get_wbio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x185a): undefined reference to `BIO_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x187e): undefined reference to `SSL_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x1891): undefined reference to `BIO_ctrl'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x18a2): undefined reference to `BIO_new_socket'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: bufferevent_openssl.c:(.text+0x18b0): undefined reference to `SSL_set_bio'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../lib/libevent_openssl.a(libevent_openssl_la-bufferevent_openssl.o): in function `be_openssl_destruct':
bufferevent_openssl.c:(.text+0x3fa): undefined reference to `SSL_free'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: read-only segment has dynamic relocations
collect2: error: ld returned 1 exit status
make: *** [Makefile:257: sapi/cli/php] Error 1

And my configure scripts:

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on May 9, 2024

I commit it in event-debug branch, and another question, if I compile PHP7, cp -f ext/event/php8/*.h ext/event to cp -f ext/event/php7/*.h ext/event ?

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on May 9, 2024

OHHHH! It works, thanks a lot ! 😃

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on May 9, 2024

I commit it in event-debug branch, and another question, if I compile PHP7, cp -f ext/event/php8/*.h ext/event to cp -f ext/event/php7/*.h ext/event ?

I tried it with php 7.4.18, and not working.

It seems that ext/event/php7/ missing header files arginfo.h and php_event_arginfo.h.

from static-php-cli.

char101 avatar char101 commented on May 9, 2024

You can try modifying the event extension config.m4 rather than patching with sed

diff --git a/config.m4 b/config.m4
index 7f02469..8a1575b 100644
--- a/config.m4
+++ b/config.m4
@@ -48,7 +48,7 @@ if test "$PHP_EVENT_CORE" != "no"; then
 
   dnl {{{ Check for PHP version
   AC_MSG_CHECKING(PHP version)
-  if test -d $abs_srcdir/php7; then
+  if test -d PHP_EXT_SRCDIR/php7; then
     dnl # only for PECL, not for PHP
     export OLD_CPPFLAGS="$CPPFLAGS"
     export CPPFLAGS="$CPPFLAGS $INCLUDES"
@@ -74,8 +74,8 @@ if test "$PHP_EVENT_CORE" != "no"; then
     ])
     export CPPFLAGS="$OLD_CPPFLAGS"
 
-    PHP_ADD_BUILD_DIR($abs_builddir/$PHP_EVENT_SUBDIR, 1)
-    PHP_ADD_INCLUDE([$ext_srcdir/$PHP_EVENT_SUBDIR])
+    PHP_ADD_BUILD_DIR(PHP_EXT_BUILDDIR/$PHP_EVENT_SUBDIR, 1)
+    PHP_ADD_INCLUDE([PHP_EXT_SRCDIR/$PHP_EVENT_SUBDIR])
   else
     AC_MSG_ERROR([unknown source])
     PHP_EVENT_SUBDIR="."
@@ -133,7 +133,7 @@ if test "$PHP_EVENT_CORE" != "no"; then
     EVENT_LIBDIR=$EVENT_DIR/$PHP_LIBDIR
   fi
   LDFLAGS="$EVENT_LIBS $LDFLAGS"
-  LIBS="$LIBS -levent_core"
+  LIBS="$LIBS -levent -levent_core"
 
   dnl {{{ event_core
   AC_CHECK_LIB(event_core, event_free, [
@@ -238,14 +238,14 @@ if test "$PHP_EVENT_CORE" != "no"; then
   PHP_ADD_INCLUDE($ext_builddir/$PHP_EVENT_SUBDIR)
   PHP_SUBST(EVENT_SHARED_LIBADD)
 
-  LDFLAGS=$OLD_LDFLAGS
-  LIBS=$OLD_LIBS
+  dnl LDFLAGS=$OLD_LDFLAGS
+  dnl LIBS=$OLD_LIBS
 
   dnl This works with static building only
   dnl test -z $PHP_SOCKETS && PHP_SOCKETS="no"
 
   if test "$PHP_EVENT_SOCKETS" != "no"; then
-    AC_CHECK_HEADERS([$phpincludedir/ext/sockets/php_sockets.h], ,
+    AC_CHECK_HEADERS([$abs_srcdir/ext/sockets/php_sockets.h], ,
       [
         AC_MSG_ERROR([Couldn't find $phpincludedir/sockets/php_sockets.h. Please check if sockets extension installed])
       ]

from static-php-cli.

ikilobyte avatar ikilobyte commented on May 9, 2024

牛逼!!!

from static-php-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.