php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78938 Compile IBM_DB2 module for Alpine
Submitted: 2019-12-10 00:19 UTC Modified: -
Votes:6
Avg. Score:3.8 ± 1.5
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:5 (83.3%)
From: brian dot crist at calcartage dot com Assigned:
Status: Open Package: ibm_db2 (PECL)
PHP Version: 7.3.12 OS: Alpine 3.10.1
Private report: No CVE-ID: None
 [2019-12-10 00:19 UTC] brian dot crist at calcartage dot com
Description:
------------
Not able to compile the modules for Alpine Linux even when adding libc 
 compatibility

I've followed the instructions located here.
https://github.com/php/pecl-database-ibm_db2

Alpine Linux is a very popular, and incredibly small distro which has seen widespread usage as a base docker container. 

Test script:
---------------
docker run -it php:7.3-fpm-alpine sh
apk update && apk add autoconf musl-dev gcc make re2c file libc6-compat
cd /opt
curl -O https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz  \
       && tar -zxf linuxx64_odbc_cli.tar.gz \
export IBM_DB_HOME=/opt/clidriver \
       && export LD_LIBRARY_PATH=/opt/clidriver/lib \
       && export PATH=/opt/clidriver/bin:$PATH
curl -O https://pecl.php.net/get/ibm_db2-2.0.8.tgz \
      && tar -zxf ibm_db2-2.0.8.tgz 
cd ibm_db2-2.0.8 \
      && phpize --clean \
      && phpize && ls \
  && ./configure --with-IBM_DB2=/opt/clidriver \
  && make \
  && make install \
  && docker-php-ext-enable ibm_db2

php --version

Actual result:
--------------
/usr/local/lib/php/extensions/no-debug-non-zts-20180731 # php --version
Segmentation fault (core dumped)

------------------------

/opt/clidriver/bin # ./db2level 
Error relocating /opt/clidriver/lib/libdb2.so.1: pthread_mutexattr_setkind_np: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: pthread_attr_setaffinity_np: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: __snprintf_chk: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: __register_atfork: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: __vsnprintf_chk: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: sysctl: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: backtrace: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: getgrent_r: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: __res_init: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: dlvsym: symbol not found
Error relocating ./db2level: __printf_chk: symbol not found
Error relocating ./db2level: __strncat_chk: symbol not found
Error relocating ./db2level: __vsprintf_chk: symbol not found
Error relocating ./db2level: __fprintf_chk: symbol not found


--------------------------
/usr/local/lib/php/extensions/no-debug-non-zts-20180731 # ldd ibm_db2.so 
        /lib/ld-musl-x86_64.so.1 (0x7f03ba11f000)
        libdb2.so.1 => /opt/clidriver/lib/libdb2.so.1 (0x7f03b7c7b000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f03ba11f000)
        libdl.so.2 => /lib/ld-musl-x86_64.so.1 (0x7f03ba11f000)
        libpthread.so.0 => /lib/ld-musl-x86_64.so.1 (0x7f03ba11f000)
        librt.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f03ba11f000)
        libpam.so.0 => /lib/libpam.so.0 (0x7f03b7c6c000)
        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x7f03b7b44000)
        libm.so.6 => /lib/ld-musl-x86_64.so.1 (0x7f03ba11f000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f03b79ef000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f03b79db000)
        libz.so.1 => /lib/libz.so.1 (0x7f03b79c1000)
Error relocating /opt/clidriver/lib/libdb2.so.1: pthread_mutexattr_setkind_np: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: pthread_attr_setaffinity_np: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: __snprintf_chk: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: __register_atfork: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: __vsnprintf_chk: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: sysctl: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: backtrace: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: getgrent_r: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: __res_init: symbol not found
Error relocating /opt/clidriver/lib/libdb2.so.1: dlvsym: symbol not found
Error relocating ibm_db2.so: __zend_calloc: symbol not found
Error relocating ibm_db2.so: zend_fetch_resource2: symbol not found
Error relocating ibm_db2.so: zend_hash_str_find: symbol not found
Error relocating ibm_db2.so: php_error_docref0: symbol not found
Error relocating ibm_db2.so: _erealloc: symbol not found
Error relocating ibm_db2.so: zend_register_long_constant: symbol not found
Error relocating ibm_db2.so: zend_ini_string_ex: symbol not found
Error relocating ibm_db2.so: _zend_new_array_0: symbol not found
Error relocating ibm_db2.so: add_index_null: symbol not found
Error relocating ibm_db2.so: zend_wrong_param_count: symbol not found
Error relocating ibm_db2.so: _estrdup: symbol not found
Error relocating ibm_db2.so: add_property_stringl_ex: symbol not found
Error relocating ibm_db2.so: _emalloc: symbol not found
Error relocating ibm_db2.so: zend_unregister_ini_entries: symbol not found
Error relocating ibm_db2.so: add_property_bool_ex: symbol not found
Error relocating ibm_db2.so: php_info_print_table_header: symbol not found
Error relocating ibm_db2.so: php_info_print_table_row: symbol not found
Error relocating ibm_db2.so: _ecalloc: symbol not found
Error relocating ibm_db2.so: zend_fetch_resource: symbol not found
Error relocating ibm_db2.so: php_strtoupper: symbol not found
Error relocating ibm_db2.so: _convert_to_string: symbol not found
Error relocating ibm_db2.so: object_and_properties_init: symbol not found
Error relocating ibm_db2.so: object_init: symbol not found
Error relocating ibm_db2.so: _emalloc_16: symbol not found
Error relocating ibm_db2.so: __zend_malloc: symbol not found
Error relocating ibm_db2.so: zend_hash_str_update: symbol not found
Error relocating ibm_db2.so: php_info_print_table_end: symbol not found
Error relocating ibm_db2.so: zend_register_ini_entries: symbol not found
Error relocating ibm_db2.so: php_info_print_table_start: symbol not found
Error relocating ibm_db2.so: add_index_long: symbol not found
Error relocating ibm_db2.so: add_index_stringl: symbol not found
Error relocating ibm_db2.so: _estrndup: symbol not found
Error relocating ibm_db2.so: add_property_zval_ex: symbol not found
Error relocating ibm_db2.so: add_index_double: symbol not found
Error relocating ibm_db2.so: add_assoc_null_ex: symbol not found
Error relocating ibm_db2.so: zend_hash_apply: symbol not found
Error relocating ibm_db2.so: _emalloc_24: symbol not found
Error relocating ibm_db2.so: zval_ptr_dtor: symbol not found
Error relocating ibm_db2.so: zend_rebuild_symbol_table: symbol not found
Error relocating ibm_db2.so: zend_parse_parameters: symbol not found
Error relocating ibm_db2.so: php_strtolower: symbol not found
Error relocating ibm_db2.so: zend_register_resource: symbol not found
Error relocating ibm_db2.so: zend_register_list_destructors_ex: symbol not found
Error relocating ibm_db2.so: add_property_long_ex: symbol not found
Error relocating ibm_db2.so: _efree: symbol not found
Error relocating ibm_db2.so: add_assoc_stringl_ex: symbol not found
Error relocating ibm_db2.so: _emalloc_32: symbol not found
Error relocating ibm_db2.so: add_assoc_long_ex: symbol not found
Error relocating ibm_db2.so: php_sprintf: symbol not found
Error relocating ibm_db2.so: add_assoc_double_ex: symbol not found
Error relocating ibm_db2.so: zend_array_dup: symbol not found
Error relocating ibm_db2.so: OnUpdateLong: symbol not found
Error relocating ibm_db2.so: OnUpdateLong: symbol not found
Error relocating ibm_db2.so: OnUpdateLong: symbol not found
Error relocating ibm_db2.so: zend_ini_boolean_displayer_cb: symbol not found
Error relocating ibm_db2.so: executor_globals: symbol not found
Error relocating ibm_db2.so: zend_empty_string: symbol not found
Error relocating ibm_db2.so: zend_standard_class_def: symbol not found


-------------------------
When omitting libc6-compat 

PHP Warning:  PHP Startup: Unable to load dynamic library 'ibm_db2.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20180731/ibm_db2.so (Error loading shared library libcrypt.so.1: No such file or directory (needed by /clidriver/lib//libdb2.so.1)), /usr/local/lib/php/extensions/no-debug-non-zts-20180731/ibm_db2.so.so (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20180731/ibm_db2.so.so: No such file or directory)) in Unknown on line 0


Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 00:01:33 2024 UTC