php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81499 symbol lookup error when build pdo_dblib as shared extension
Submitted: 2021-10-04 08:42 UTC Modified: 2021-10-21 11:00 UTC
From: kak dot serpom dot po dot yaitsam at gmail dot com Assigned: nikic (profile)
Status: Closed Package: PDO DBlib
PHP Version: 8.1.0RC3 OS:
Private report: No CVE-ID: None
 [2021-10-04 08:42 UTC] kak dot serpom dot po dot yaitsam at gmail dot com
Description:
------------
php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20201009/pdo_dblib.so: undefined symbol: dbinit



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-10-06 10:05 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-10-06 10:05 UTC] cmb@php.net
This looks like a setup issue on your system; do you have the
appropriate FreeTDS driver installed?
 [2021-10-07 22:45 UTC] kak dot serpom dot po dot yaitsam at gmail dot com
Yes, I have it installed. 'configure' and 'make' worked fine. An identical Dockerfile with PHP 8.0.11   results in a working extension.

Dockerfile: https://pastebin.com/raw/ewsCLhGP
Build log: https://pastebin.com/raw/STjKpRjq
 [2021-10-08 11:36 UTC] cmb@php.net
Possibly, the library against PDO_DBlib was built against, is not
the library used when running.  There was a respective commit[1]
which might cause that change.  I suggest you try again with that
commit reverted.

[1] <https://github.com/php/php-src/commit/47fe4125189833e80eac8c09f7d1cf83b10aeb0d>
 [2021-10-17 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2021-10-21 10:09 UTC] thomas dot lamy at netwake dot de
Same problem here, I can't build pdo_dblib any more (on Linux 22fab5e80b8c 5.10.47-linuxkit #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 aarch64 GNU/Linux, which is Docker Desktop for Mac on M1 processor) using (essentially) this Dockerfile:

----
FROM php:8.1-rc-fpm

RUN apt-get -y update &&                                     \
    apt-get -y upgrade &&                                    \
    apt-get -y -q --no-install-recommends install               \
    git procps tini unzip wget zip                              \
    libfcgi-bin                                                 \
    libpng-dev libfreetype6-dev libjpeg62-turbo-dev libwebp-dev \
    zlib1g-dev libzip-dev libgmp-dev libtidy-dev \
    libpq-dev freetds-dev procps
RUN cp /usr/lib/*/libsybdb.* /usr/lib/*/libct.* /usr/lib/ && ldconfig -v
RUN docker-php-ext-install pdo_dblib && docker-php-ext-enable pdo_dblib
-----

Here's the build output:

-----
 > [20/32] RUN docker-php-ext-install pdo_dblib && docker-php-ext-enable pdo_dblib:
#24 1.594 Configuring for:
#24 1.594 PHP Api Version:         20210902
#24 1.594 Zend Module Api No:      20210902
#24 1.594 Zend Extension Api No:   420210902
#24 1.997 checking for grep that handles long lines and -e... /bin/grep
#24 1.999 checking for egrep... /bin/grep -E
#24 2.001 checking for a sed that does not truncate output... /bin/sed
#24 2.027 checking for pkg-config... /usr/bin/pkg-config
#24 2.027 checking pkg-config is at least version 0.9.0... yes
#24 2.029 checking for cc... cc
#24 2.051 checking whether the C compiler works... yes
#24 2.087 checking for C compiler default output file name... a.out
#24 2.088 checking for suffix of executables... 
#24 2.118 checking whether we are cross compiling... no
#24 2.154 checking for suffix of object files... o
#24 2.178 checking whether we are using the GNU C compiler... yes
#24 2.196 checking whether cc accepts -g... yes
#24 2.215 checking for cc option to accept ISO C89... none needed
#24 2.241 checking how to run the C preprocessor... cc -E
#24 2.283 checking for icc... no
#24 2.291 checking for suncc... no
#24 2.298 checking for system library directory... lib
#24 2.298 checking if compiler supports -R... no
#24 2.308 checking if compiler supports -Wl,-rpath,... yes
#24 2.340 checking build system type... aarch64-unknown-linux-gnu
#24 2.344 checking host system type... aarch64-unknown-linux-gnu
#24 2.344 checking target system type... aarch64-unknown-linux-gnu
#24 2.382 checking for PHP prefix... /usr/local
#24 2.382 checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
#24 2.382 checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20210902
#24 2.382 checking for PHP installed headers prefix... /usr/local/include/php
#24 2.383 checking if debug is enabled... no
#24 2.395 checking if zts is enabled... no
#24 2.407 checking for gawk... no
#24 2.408 checking for nawk... nawk
#24 2.408 checking if nawk is broken... no
#24 2.409 checking for PDO_DBLIB support via FreeTDS... yes, shared
#24 2.410 checking for dbsqlexec in -lsybdb... yes
#24 2.450 checking for PDO includes... /usr/local/include/php/ext
#24 2.456 checking for dnet_addr in -ldnet_stub... no
#24 2.483 checking for a sed that does not truncate output... /bin/sed
#24 2.486 checking for ld used by cc... /usr/bin/ld
#24 2.492 checking if the linker (/usr/bin/ld) is GNU ld... yes
#24 2.493 checking for /usr/bin/ld option to reload object files... -r
#24 2.493 checking for BSD-compatible nm... /usr/bin/nm -B
#24 2.496 checking whether ln -s works... yes
#24 2.496 checking how to recognize dependent libraries... pass_all
#24 2.496 checking for ANSI C header files... yes
#24 2.578 checking for sys/types.h... yes
#24 2.608 checking for sys/stat.h... yes
#24 2.635 checking for stdlib.h... yes
#24 2.660 checking for string.h... yes
#24 2.692 checking for memory.h... yes
#24 2.725 checking for strings.h... yes
#24 2.760 checking for inttypes.h... yes
#24 2.788 checking for stdint.h... yes
#24 2.817 checking for unistd.h... yes
#24 2.847 checking dlfcn.h usability... yes
#24 2.871 checking dlfcn.h presence... yes
#24 2.878 checking for dlfcn.h... yes
#24 2.879 checking the maximum length of command line arguments... 1572864
#24 2.883 checking command to parse /usr/bin/nm -B output from cc object... ok
#24 2.938 checking for objdir... .libs
#24 2.942 checking for ar... ar
#24 2.942 checking for ranlib... ranlib
#24 2.942 checking for strip... strip
#24 2.996 checking if cc supports -fno-rtti -fno-exceptions... no
#24 3.020 checking for cc option to produce PIC... -fPIC
#24 3.020 checking if cc PIC flag -fPIC works... yes
#24 3.043 checking if cc static flag -static works... yes
#24 3.104 checking if cc supports -c -o file.o... yes
#24 3.132 checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
#24 3.146 checking whether -lc should be explicitly linked in... no
#24 3.172 checking dynamic linker characteristics... GNU/Linux ld.so
#24 3.188 checking how to hardcode library paths into programs... immediate
#24 3.188 checking whether stripping libraries is possible... yes
#24 3.191 checking if libtool supports shared libraries... yes
#24 3.191 checking whether to build shared libraries... yes
#24 3.191 checking whether to build static libraries... no
#24 3.334 
#24 3.334 creating libtool
#24 3.349 appending configuration tag "CXX" to libtool
#24 3.411 configure: patching config.h.in
#24 3.413 configure: creating ./config.status
#24 3.470 config.status: creating config.h
#24 3.504 /bin/bash /usr/src/php/ext/pdo_dblib/libtool --mode=compile cc -I. -I/usr/src/php/ext/pdo_dblib -I/usr/src/php/ext/pdo_dblib/include -I/usr/src/php/ext/pdo_dblib/main -I/usr/src/php/ext/pdo_dblib -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -I/usr/local/include/php/ext -DPDO_DBLIB_FLAVOUR=\"freetds\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/pdo_dblib/pdo_dblib.c -o pdo_dblib.lo  -MMD -MF pdo_dblib.dep -MT pdo_dblib.lo
#24 3.597 mkdir .libs
#24 3.600  cc -I. -I/usr/src/php/ext/pdo_dblib -I/usr/src/php/ext/pdo_dblib/include -I/usr/src/php/ext/pdo_dblib/main -I/usr/src/php/ext/pdo_dblib -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include/php/ext -DPDO_DBLIB_FLAVOUR=\"freetds\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/pdo_dblib/pdo_dblib.c -MMD -MF pdo_dblib.dep -MT pdo_dblib.lo  -fPIC -DPIC -o .libs/pdo_dblib.o
#24 3.680 /bin/bash /usr/src/php/ext/pdo_dblib/libtool --mode=compile cc -I. -I/usr/src/php/ext/pdo_dblib -I/usr/src/php/ext/pdo_dblib/include -I/usr/src/php/ext/pdo_dblib/main -I/usr/src/php/ext/pdo_dblib -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -I/usr/local/include/php/ext -DPDO_DBLIB_FLAVOUR=\"freetds\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/pdo_dblib/dblib_driver.c -o dblib_driver.lo  -MMD -MF dblib_driver.dep -MT dblib_driver.lo
#24 3.763  cc -I. -I/usr/src/php/ext/pdo_dblib -I/usr/src/php/ext/pdo_dblib/include -I/usr/src/php/ext/pdo_dblib/main -I/usr/src/php/ext/pdo_dblib -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include/php/ext -DPDO_DBLIB_FLAVOUR=\"freetds\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/pdo_dblib/dblib_driver.c -MMD -MF dblib_driver.dep -MT dblib_driver.lo  -fPIC -DPIC -o .libs/dblib_driver.o
#24 3.895 /bin/bash /usr/src/php/ext/pdo_dblib/libtool --mode=compile cc -I. -I/usr/src/php/ext/pdo_dblib -I/usr/src/php/ext/pdo_dblib/include -I/usr/src/php/ext/pdo_dblib/main -I/usr/src/php/ext/pdo_dblib -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64   -I/usr/local/include/php/ext -DPDO_DBLIB_FLAVOUR=\"freetds\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/pdo_dblib/dblib_stmt.c -o dblib_stmt.lo  -MMD -MF dblib_stmt.dep -MT dblib_stmt.lo
#24 3.971  cc -I. -I/usr/src/php/ext/pdo_dblib -I/usr/src/php/ext/pdo_dblib/include -I/usr/src/php/ext/pdo_dblib/main -I/usr/src/php/ext/pdo_dblib -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include/php/ext -DPDO_DBLIB_FLAVOUR=\"freetds\" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/pdo_dblib/dblib_stmt.c -MMD -MF dblib_stmt.dep -MT dblib_stmt.lo  -fPIC -DPIC -o .libs/dblib_stmt.o
#24 4.087 /bin/bash /usr/src/php/ext/pdo_dblib/libtool --mode=link cc -shared -I/usr/src/php/ext/pdo_dblib/include -I/usr/src/php/ext/pdo_dblib/main -I/usr/src/php/ext/pdo_dblib -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H  -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -Wl,-O1 -pie  -o pdo_dblib.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/src/php/ext/pdo_dblib/modules  pdo_dblib.lo dblib_driver.lo dblib_stmt.lo 
#24 4.165 cc -shared  .libs/pdo_dblib.o .libs/dblib_driver.o .libs/dblib_stmt.o   -Wl,-O1 -Wl,-soname -Wl,pdo_dblib.so -o .libs/pdo_dblib.so
#24 4.176 creating pdo_dblib.la
#24 4.182 (cd .libs && rm -f pdo_dblib.la && ln -s ../pdo_dblib.la pdo_dblib.la)
#24 4.186 /bin/bash /usr/src/php/ext/pdo_dblib/libtool --mode=install cp ./pdo_dblib.la /usr/src/php/ext/pdo_dblib/modules
#24 4.209 cp ./.libs/pdo_dblib.so /usr/src/php/ext/pdo_dblib/modules/pdo_dblib.so
#24 4.213 cp ./.libs/pdo_dblib.lai /usr/src/php/ext/pdo_dblib/modules/pdo_dblib.la
#24 4.228 PATH="$PATH:/sbin" ldconfig -n /usr/src/php/ext/pdo_dblib/modules
#24 4.230 ----------------------------------------------------------------------
#24 4.230 Libraries have been installed in:
#24 4.230    /usr/src/php/ext/pdo_dblib/modules
#24 4.230 
#24 4.231 If you ever happen to want to link against installed libraries
#24 4.231 in a given directory, LIBDIR, you must either use libtool, and
#24 4.231 specify the full pathname of the library, or use the `-LLIBDIR'
#24 4.231 flag during linking and do at least one of the following:
#24 4.231    - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
#24 4.231      during execution
#24 4.231    - add LIBDIR to the `LD_RUN_PATH' environment variable
#24 4.231      during linking
#24 4.231    - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
#24 4.231    - have your system administrator add LIBDIR to `/etc/ld.so.conf'
#24 4.231 
#24 4.231 See any operating system documentation about shared libraries for
#24 4.231 more information, such as the ld(1) and ld.so(8) manual pages.
#24 4.232 ----------------------------------------------------------------------
#24 4.234 
#24 4.235 Build complete.
#24 4.237 Don't forget to run 'make test'.
#24 4.237 
#24 4.240 + strip --strip-all modules/pdo_dblib.so
#24 4.264 Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20210902/
#24 4.323 find . -name \*.gcno -o -name \*.gcda | xargs rm -f
#24 4.326 find . -name \*.lo -o -name \*.o -o -name \*.dep | xargs rm -f
#24 4.329 find . -name \*.la -o -name \*.a | xargs rm -f
#24 4.332 find . -name \*.so | xargs rm -f
#24 4.335 find . -name .libs -a -type d|xargs rm -rf
#24 4.337 rm -f libphp.la      modules/* libs/*
#24 4.339 rm -f ext/opcache/jit/zend_jit_x86.c
#24 4.340 rm -f ext/opcache/jit/zend_jit_arm64.c
#24 4.615 php: symbol lookup error: /usr/local/lib/php/extensions/no-debug-non-zts-20210902/pdo_dblib.so: undefined symbol: dbinit
------
executor failed running [/bin/sh -c docker-php-ext-install pdo_dblib && docker-php-ext-enable pdo_dblib]: exit code: 127
 [2021-10-21 10:32 UTC] cmb@php.net
-Status: No Feedback +Status: Open -Assigned To: cmb +Assigned To:
 [2021-10-21 10:58 UTC] thomas dot lamy at netwake dot de
I mimicked https://github.com/php/php-src/commit/f27d07499672ad3fd7056b4758b0cc0b44ceae39

by using

RUN docker-php-ext-configure pdo_dblib
RUN sed -i -e 's,GMP_SHARED_LIBADD,PDO_DBLIB_SHARED_LIBADD,g' /usr/src/php/ext/pdo_dblib/config.m4
RUN docker-php-ext-configure pdo_dblib
RUN docker-php-ext-install pdo_dblib && docker-php-ext-enable pdo_dblib


in my Dockerfile, and now the build succeeds.

Thanks!
 [2021-10-21 11:00 UTC] nikic@php.net
-Summary: symbol lookup error +Summary: symbol lookup error when build pdo_dblib as shared extension -Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2021-10-21 11:00 UTC] nikic@php.net
Thanks for the confirmation!
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Dec 04 21:03:34 2021 UTC