php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2574 DSO module fails link (dupe symbols _pcre*)
Submitted: 1999-10-20 00:52 UTC Modified: 2000-03-29 23:16 UTC
From: jkrage at buser dot net Assigned:
Status: Closed Package: Compile Failure
PHP Version: 3.0.12 OS: OpenBSD 2.6 (RELEASE & -current)
Private report: No CVE-ID: None
 [1999-10-20 00:52 UTC] jkrage at buser dot net
(Build transcript follows; additional details at end)
[php-3.0.12]$ ./configure --with-apxs=/usr/sbin/apxs
                                    --with-config-file-path=/var/www
                                    --with-pgsql
...
[php-3.0.12]$ make
...
(cd pcrelib; make)
gcc -g -O2 -O2  -c maketables.c
gcc -g -O2 -O2  -c get.c
gcc -g -O2 -O2  -c study.c
gcc -g -O2 -O2  -c pcre.c
rm -f libpcre.a
ar cq libpcre.a maketables.o get.o study.o pcre.o
ranlib libpcre.a
ar rc libmodphp3-so.a language-parser.tab.o language-scanner.o
    main.o php3_hash.o operators.o  variables.o token_cache.o stack.o
    internal_functions.o  snprintf.o php3_sprintf.o alloc.o list.o highlight.o
    debugger.o  configuration-parser.tab.o configuration-scanner.o
    request_info.o safe_mode.o fopen-wrappers.o constants.o 
    php3_realpath.o alloca.o php_compat.o functions/adabasd.o
    functions/aspell.o functions/apache.o functions/fhttpd.o
    functions/basic_functions.o functions/crypt.o functions/datetime.o
    functions/db.o functions/dbase.o functions/dir.o functions/dl.o
    functions/dns.o functions/exec.o functions/file.o functions/filepro.o
    functions/filestat.o functions/formatted_print.o functions/fsock.o
    functions/gd.o functions/head.o functions/html.o functions/image.o
    functions/imap.o functions/link.o functions/mail.o functions/math.o
    functions/iptc.o functions/md5.o functions/microtime.o functions/mime.o
    functions/msql.o functions/mysql.o functions/oracle.o functions/oci8.o
    functions/pack.o functions/pageinfo.o functions/pgsql.o
    functions/magick.o functions/post.o functions/rand.o functions/reg.o
    functions/solid.o functions/soundex.o functions/string.o
    functions/syslog.o functions/type.o functions/uniqid.o
    functions/sybase.o functions/sybase-ct.o functions/url.o
    functions/base64.o functions/info.o functions/bcmath.o
    functions/number.o functions/xml.o functions/unified_odbc.o
    functions/ldap.o functions/browscap.o functions/velocis.o
    functions/gdttf.o functions/gdcache.o functions/zlib.o 
    functions/COM.o functions/ifx.o functions/pdf.o functions/cpdf.o
    functions/hw.o functions/hg_comm.o functions/dlist.o functions/fdf.o
    functions/wddx.o functions/wddx_a.o functions/snmp.o functions/var.o
    functions/interbase.o functions/quot_print.o functions/cyr_convert.o
    functions/sysvsem.o functions/dav.o functions/sysvshm.o
    functions/gettext.o functions/php3_mckcrypt.o functions/yp.o
    functions/dba.o functions/dba_gdbm.o functions/dba_dbm.o
    functions/dba_ndbm.o functions/dba_cdb.o functions/mcrypt.o
    functions/dba_db2.o functions/mhash.o functions/pcre.o
    functions/posix.o functions/parsedate.o pcrelib/maketables.o
    pcrelib/get.o pcrelib/study.o pcrelib/pcre.o
ranlib libmodphp3-so.a
/usr/sbin/apxs -c -o libphp3.so -I. -I.  -Wl,-R'/usr/local/pgsql/lib' ./mod_php3.c libmodphp3-so.a -L/usr/local/lib  -L/usr/local/pgsql/lib -lpq                               pcrelib/libpcre.a -lm  -lresolv  -Lpcrelib -lpcre
gcc -DDEV_RANDOM=/dev/arandom -DMOD_SSL=204105 -DEAPI -DUSE_EXPAT -I../lib/expat-lite -fPIC -DSHARED_MODULE -I/usr/lib/apache/include -I. -I.  -c ./mod_php3.c
ld -Bforcearchive -Bshareable -o libphp3.so ./mod_php3.o libmodphp3-so.a -L/usr/local/lib -L/usr/local/pgsql/lib -lpq pcrelib/libpcre.a -lm -lresolv -Lpcrelib -lpcre -R/usr/local/pgsql/lib 
maketables.c:68: Definition of symbol `_pcre_maketables' (multiply defined)
get.c:77: Definition of symbol `_pcre_copy_substring' (multiply defined)
get.c:115: Definition of symbol `_pcre_get_substring_list' (multiply defined)
get.c:174: Definition of symbol `_pcre_get_substring' (multiply defined)
study.c:341: Definition of symbol `_pcre_study' (multiply defined)
libmodphp3-so.a(pcre.o): Definition of symbol `_pcre_malloc' (multiply defined)
libmodphp3-so.a(pcre.o): Definition of symbol `_pcre_free' (multiply defined)
pcre.c:154: Definition of symbol `_pcre_version' (multiply defined)
pcre.c:180: Definition of symbol `_pcre_info' (multiply defined)
pcre.c:1973: Definition of symbol `_pcre_compile' (multiply defined)
pcre.c:4134: Definition of symbol `_pcre_exec' (multiply defined)
maketables.c:68: Definition of symbol `_pcre_maketables' (multiply defined)
get.c:77: Definition of symbol `_pcre_copy_substring' (multiply defined)
get.c:115: Definition of symbol `_pcre_get_substring_list' (multiply defined)
get.c:174: Definition of symbol `_pcre_get_substring' (multiply defined)
study.c:341: Definition of symbol `_pcre_study' (multiply defined)
pcrelib/libpcre.a(pcre.o): Definition of symbol `_pcre_malloc' (multiply defined)
pcrelib/libpcre.a(pcre.o): Definition of symbol `_pcre_free' (multiply defined)
pcre.c:154: Definition of symbol `_pcre_version' (multiply defined)
pcre.c:180: Definition of symbol `_pcre_info' (multiply defined)
pcre.c:1973: Definition of symbol `_pcre_compile' (multiply defined)
pcre.c:4134: Definition of symbol `_pcre_exec' (multiply defined)
maketables.c:68: Definition of symbol `_pcre_maketables' (multiply defined)
get.c:77: Definition of symbol `_pcre_copy_substring' (multiply defined)
get.c:115: Definition of symbol `_pcre_get_substring_list' (multiply defined)
get.c:174: Definition of symbol `_pcre_get_substring' (multiply defined)
study.c:341: Definition of symbol `_pcre_study' (multiply defined)
pcrelib/libpcre.a(pcre.o): Definition of symbol `_pcre_malloc' (multiply defined)
pcrelib/libpcre.a(pcre.o): Definition of symbol `_pcre_free' (multiply defined)
pcre.c:154: Definition of symbol `_pcre_version' (multiply defined)
pcre.c:180: Definition of symbol `_pcre_info' (multiply defined)
pcre.c:1973: Definition of symbol `_pcre_compile' (multiply defined)
pcre.c:4134: Definition of symbol `_pcre_exec' (multiply defined)
apxs:Break: Command failed with rc=65536
*** Error code 1


Build environment:
  OpenBSD 2.6-current (pre-release)
  Apache 1.3.9 w/ embedded SSL support (standard for OS)

From /usr/sbin/apxs (wrapped manually):
    ...
    my $CFG_TARGET        = 'httpd';            # substituted via Makefile.tmpl 
    my $CFG_CC            = 'gcc';                # substituted via Makefile.tmpl
    my $CFG_CFLAGS        = ' -DDEV_RANDOM=/dev/arandom
 -DMOD_SSL=204105 -DEAPI -DUSE_EXPAT -I../lib/expat-lite
 `../apaci`';            # substituted via Makefile.tmpl
    my $CFG_CFLAGS_SHLIB  = '-fPIC -DSHARED_MODULE';      
# substituted via Makefile.tmpl
    my $CFG_LD_SHLIB      = 'ld';          # substituted via Makefile.tmpl
    my $CFG_LDFLAGS_SHLIB = '-Bforcearchive -Bshareable'; 
# substituted via Makefile.tmpl 
    my $CFG_LIBS_SHLIB    = '';        # substituted via Makefile.tmpl 
    my $CFG_PREFIX        = '/var/www';            # substituted via 
APACI install
    my $CFG_SBINDIR       = '/usr/sbin';           # substituted via 
APACI install
    my $CFG_INCLUDEDIR    = '/usr/lib/apache/include';        
# substituted via APACI install
    my $CFG_LIBEXECDIR    = '/usr/lib/apache/modules';        
# substituted via APACI install
    my $CFG_SYSCONFDIR    = '/var/www/conf';        
# substituted via APACI install

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-12-15 01:26 UTC] jkrage at buser dot net
Problem reproduced on OpenBSD 2.6-RELEASE and -current.

The following patches correct the problems.  The first is applied
php-3.0.12/Makefile.in and the second to
php-3.0.12/pcrelib/Makefile.in.  Both patches in diff -u format.

The first patch clears up redundant inclusion of libpcre symbols
in the Makefile.  The second patch force -fPIC to be used for
the pcre library build.  This isn't the proper approach (it
should be automatically set by the configure script), but I
couldn't convince configure to do it properly (didn't spend a
lot of time on it either).

$PHP-DIST/Makefile.in
################################################################################
--- Makefile.in.orig    Tue Jul 13 09:43:01 1999
+++ Makefile.in Wed Dec  8 01:27:50 1999
@@ -114,21 +114,21 @@
        $(CC) $(CFLAGS) -o $(BINNAME) $(LDFLAGS) $(OBJS) $(FUNCTIONS) $(LIBS)

 libphp3.a: $(OBJS) $(FUNCTIONS) @PCRE_LIB@ @DBASE_LIB@
-       $(AR) $(BINNAME) $(OBJS) $(FUNCTIONS) @PCRE_OBJS@ @DBASE_OBJS@
+       $(AR) $(BINNAME) $(OBJS) $(FUNCTIONS) @DBASE_OBJS@
        $(RANLIB) $(BINNAME)

 libmodphp3.a: $(OBJS) $(FUNCTIONS) @PCRE_LIB@ @DBASE_LIB@
-       $(AR) $(BINNAME) $(OBJS) $(FUNCTIONS) @PCRE_OBJS@ @DBASE_OBJS@
+       $(AR) $(BINNAME) $(OBJS) $(FUNCTIONS) @DBASE_OBJS@
        $(RANLIB) $(BINNAME)

 libmodphp3-so.a: $(OBJS) $(FUNCTIONS) @PCRE_LIB@ @DBASE_LIB@
-       $(AR) libmodphp3-so.a $(OBJS) $(FUNCTIONS) @PCRE_OBJS@ @DBASE_OBJS@
+       $(AR) libmodphp3-so.a $(OBJS) $(FUNCTIONS) @DBASE_OBJS@
        $(RANLIB) libmodphp3-so.a

 libphp3.so: mod_php3.c libmodphp3-so.a @DBASE_LIB@ @PCRE_LIB@
        -@test -f ./mod_php3.c || test -L ./mod_php3.c || $(LN_S) $(srcdir)/mod_
php3.c ./mod_ph.c
        -@test -f ./mod_php3.c || test -h ./mod_php3.c || $(LN_S) $(srcdir)/mod_
php3.c ./mod_php3.c
-       $(APXS) -c -o libphp3.so -I$(srcdir) -I. @RPATHS@ ./mod_php3.c libmodphp
3-so.a $(APXS_LDFLAGS) @APXS_EXP@ @PCRE_LIBS@
+       $(APXS) -c -o libphp3.so -I$(srcdir) -I. @RPATHS@ ./mod_php3.c libmodphp
3-so.a $(APXS_LDFLAGS) @APXS_EXP@

 pcrelib/libpcre.a:
        (cd pcrelib; $(MAKE))
################################################################################


$PHP-DIST/pcrelib/Makefile.in
################################################################################
--- Makefile.in.orig    Wed Jun  2 07:28:01 1999
+++ Makefile.in Wed Dec  8 02:47:32 1999
@@ -2,7 +2,7 @@

 AR = ar cq
 CC = @CC@
-CFLAGS = @CFLAGS@
+CFLAGS = @CFLAGS@ -fPIC
 RANLIB = @RANLIB@
 VPATH = @srcdir@
################################################################################

 [2000-01-08 06:46 UTC] sas at cvs dot php dot net
Try to configure with --with-pcre-regex=/usr
 [2000-03-29 23:16 UTC] sas at cvs dot php dot net
Fixed in CVS. Thanks for your report.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Jul 03 02:00:01 2026 UTC