Problems compiling PHP 4.3 on Solaris 8

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andres Rosado-Sepulveda

    Problems compiling PHP 4.3 on Solaris 8

    Hello,

    I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the error
    message it is showing:

    -- start --
    Undefined first referenced
    symbol in file
    php_parse_date ext/standard/datetime.o
    ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
    collect2: ld returned 1 exit status
    *** Error code 1
    make: Fatal error: Command failed for target `sapi/cli/php'
    -- end --

    The most common suggestiong I found while searching google was to
    upgrade GCC from 2.95 to the latest. I upgraded both the GCC and the
    libgcc packages and the error still continues. I also tried rolling back
    to an earlier version (4.3.3) unsuccessfully.

    Should I try rolling back to 4.3.2 or earlier? Is there anything I might
    be missing? Any additional information?

    TIA!

    --
    Andres Rosado
    Email: andresr@despamm ed.com
    ICQ: 66750646
    AIM: pantear
    Homepage: http://andres980.tripod.com/

    "Megatron will not twist this innocent to his dark designs. I will
    not allow it!"
    "Hah! You will be too busy burning to prevent it!"
    -- Silverbolt and Inferno, "Transmutat e"
  • Andres Rosado-Sepulveda

    #2
    Re: Problems compiling PHP 4.3 on Solaris 8

    Andres Rosado-Sepulveda wrote:[color=blue]
    > Hello,
    >
    > I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the error
    > message it is showing:
    >
    > -- start --
    > Undefined first referenced
    > symbol in file
    > php_parse_date ext/standard/datetime.o
    > ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
    > collect2: ld returned 1 exit status
    > *** Error code 1
    > make: Fatal error: Command failed for target `sapi/cli/php'
    > -- end --
    >
    > The most common suggestiong I found while searching google was to
    > upgrade GCC from 2.95 to the latest. I upgraded both the GCC and the
    > libgcc packages and the error still continues. I also tried rolling back
    > to an earlier version (4.3.3) unsuccessfully.
    >
    > Should I try rolling back to 4.3.2 or earlier? Is there anything I might
    > be missing? Any additional information?
    >
    > TIA!
    >[/color]

    Checking on the PHP-install list archive, I found two links to how-to's
    ( http://www.tldp.org/HOWTO/Apache-Compile-HOWTO/php.html and
    http://www.bolthole.com/solaris/php+solaris.html ). I have followed both
    how-to's instructions and I am still unable to compile PHP.

    TIA!

    --
    Andres Rosado
    Email: andresr@despamm ed.com
    ICQ: 66750646
    AIM: pantear
    Homepage: http://andres980.tripod.com/

    "I laugh in the face of danger. Then I hide until it goes away."
    -- Xander, "Buffy, The Vampire Slayer"

    Comment

    • Rob Ristroph

      #3
      Re: Problems compiling PHP 4.3 on Solaris 8

      >>>>> "Andres" == Andres Rosado-Sepulveda <arosado@softho me.net> writes:
      Andres>
      Andres> Andres Rosado-Sepulveda wrote:[color=blue][color=green]
      >> Hello,
      >> I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the
      >> error message it is showing:[/color][/color]
      Andres>[color=blue][color=green]
      >> -- start --[/color][/color]
      Andres>[color=blue][color=green]
      >> Undefined first referenced
      >> symbol in file
      >> php_parse_date ext/standard/datetime.o
      >> ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
      >> collect2: ld returned 1 exit status
      >> *** Error code 1
      >> make: Fatal error: Command failed for target `sapi/cli/php'
      >> -- end --
      >> The most common suggestiong I found while searching google was to
      >> upgrade GCC from 2.95 to the latest. I upgraded both the GCC and
      >> the libgcc packages and the error still continues. I also tried
      >> rolling back to an earlier version (4.3.3) unsuccessfully.[/color][/color]
      Andres>[color=blue][color=green]
      >> Should I try rolling back to 4.3.2 or earlier? Is there anything I
      >> might be missing? Any additional information?[/color][/color]
      Andres>[color=blue][color=green]
      >> TIA![/color][/color]
      Andres>[color=blue][color=green]
      >>[/color][/color]
      Andres>
      Andres> Checking on the PHP-install list archive, I found two links to
      Andres> how-to's (
      Andres> http://www.tldp.org/HOWTO/Apache-Compile-HOWTO/php.html and
      Andres> http://www.bolthole.com/solaris/php+solaris.html ). I have
      Andres> followed both how-to's instructions and I am still unable to
      Andres> compile PHP.

      Just prior to where you cut the output, there should be the command
      that was used to link sapi/cli/php. This command is missing a .o
      file, or maybe a library listed in the -llib format, that has that
      symbol.

      If you run the command "nm" on an object file or library, it will list
      the symbols. So if you by hand or with a simple script ran nm on
      every .so and .o in the php source tree, you should find that library
      if it was correctly built.

      cd php-4.3.4
      for file in *.so */*.so */*/*.so ; do
      echo $file
      nm $file | grep php_parse_date
      done

      This will help you find the library that you need to add to the link
      line. Note that the grep will catch objects that have the symbol in
      them but because they refer to it not because they define it.

      It might also help if you were to post the ./configure command you
      used and a little more the output of the failed make, say 50 lines or
      so so that we can see the link command.

      --Rob


      Comment

      • Andres Rosado-Sepulveda

        #4
        Re: Problems compiling PHP 4.3 on Solaris 8

        Rob Ristroph wrote:[color=blue][color=green][color=darkred]
        >>>>>>"Andres " == Andres Rosado-Sepulveda <arosado@softho me.net> writes:[/color][/color]
        >
        > Andres>
        > Andres> Andres Rosado-Sepulveda wrote:
        >[color=green][color=darkred]
        >>>Hello,
        >>>I'm having trouble compiling PHP 4.3.4 on Solaris 8. This is the
        >>>error message it is showing:[/color][/color]
        >
        > Andres>
        >[color=green][color=darkred]
        >>>-- start --[/color][/color]
        >
        > Andres>
        >[color=green][color=darkred]
        >>>Undefined first referenced
        >>>symbol in file
        >>>php_parse_da te ext/standard/datetime.o
        >>>ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
        >>>collect2: ld returned 1 exit status
        >>>*** Error code 1
        >>>make: Fatal error: Command failed for target `sapi/cli/php'
        >>>-- end --
        >>>The most common suggestiong I found while searching google was to
        >>>upgrade GCC from 2.95 to the latest. I upgraded both the GCC and
        >>>the libgcc packages and the error still continues. I also tried
        >>>rolling back to an earlier version (4.3.3) unsuccessfully.[/color][/color]
        >
        > Andres>
        >[color=green][color=darkred]
        >>>Should I try rolling back to 4.3.2 or earlier? Is there anything I
        >>>might be missing? Any additional information?[/color][/color]
        >
        > Andres>
        >[color=green][color=darkred]
        >>>TIA![/color][/color]
        >
        > Andres>
        >
        > Andres>
        > Andres> Checking on the PHP-install list archive, I found two links to
        > Andres> how-to's (
        > Andres> http://www.tldp.org/HOWTO/Apache-Compile-HOWTO/php.html and
        > Andres> http://www.bolthole.com/solaris/php+solaris.html ). I have
        > Andres> followed both how-to's instructions and I am still unable to
        > Andres> compile PHP.
        >
        > Just prior to where you cut the output, there should be the command
        > that was used to link sapi/cli/php. This command is missing a .o
        > file, or maybe a library listed in the -llib format, that has that
        > symbol.
        >
        > If you run the command "nm" on an object file or library, it will list
        > the symbols. So if you by hand or with a simple script ran nm on
        > every .so and .o in the php source tree, you should find that library
        > if it was correctly built.
        >
        > cd php-4.3.4
        > for file in *.so */*.so */*/*.so ; do
        > echo $file
        > nm $file | grep php_parse_date
        > done
        >
        > This will help you find the library that you need to add to the link
        > line. Note that the grep will catch objects that have the symbol in
        > them but because they refer to it not because they define it.
        >
        > It might also help if you were to post the ./configure command you
        > used and a little more the output of the failed make, say 50 lines or
        > so so that we can see the link command.[/color]

        Thanks for the input! Here's the last few commands.

        -- start --
        bison -y -p ini_ -v -d
        /usr/local/php4.3.4src/php-4.3.4/Zend/zend_ini_parser .y -o
        Zend/zend_ini_parser .c
        conflicts: 2 shift/reduce
        /bin/sh /usr/local/php4.3.4src/php-4.3.4/libtool --silent
        --preserve-dup-deps --mode=link gcc -export-dynamic -g -O2
        -L/usr/ucblib -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.3.2
        -L/usr/local/ssl//lib -L/usr/local/lib -L./imap-2002e/c-client
        -L../ldap/lib -R /usr/ucblib -R
        /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.3.2 -R /usr/local/ssl//lib
        -R /usr/local/lib -R ./imap-2002e/c-client -R ./ldap/lib
        ext/openssl/openssl.lo ext/zlib/zlib.lo ext/zlib/zlib_fopen_wrap per.lo
        ext/ctype/ctype.lo ext/dba/dba.lo ext/dba/dba_cdb.lo ext/dba/dba_db2.lo
        ext/dba/dba_dbm.lo ext/dba/dba_gdbm.lo ext/dba/dba_ndbm.lo
        ext/dba/dba_db3.lo ext/dba/dba_db4.lo ext/dba/dba_flatfile.lo
        ext/dba/dba_inifile.lo ext/dba/libcdb/cdb.lo ext/dba/libcdb/cdb_make.lo
        ext/dba/libcdb/uint32.lo ext/dba/libflatfile/flatfile.lo
        ext/dba/libinifile/inifile.lo ext/gd/gd.lo ext/gd/gdttf.lo
        ext/gd/libgd/gd.lo ext/gd/libgd/gd_gd.lo ext/gd/libgd/gd_gd2.lo
        ext/gd/libgd/gd_io.lo ext/gd/libgd/gd_io_dp.lo
        ext/gd/libgd/gd_io_file.lo ext/gd/libgd/gd_ss.lo
        ext/gd/libgd/gd_io_ss.lo ext/gd/libgd/gd_png.lo ext/gd/libgd/gd_jpeg.lo
        ext/gd/libgd/gdxpm.lo ext/gd/libgd/gdfontt.lo ext/gd/libgd/gdfonts.lo
        ext/gd/libgd/gdfontmb.lo ext/gd/libgd/gdfontl.lo ext/gd/libgd/gdfontg.lo
        ext/gd/libgd/gdtables.lo ext/gd/libgd/gdft.lo ext/gd/libgd/gdcache.lo
        ext/gd/libgd/gdkanji.lo ext/gd/libgd/wbmp.lo ext/gd/libgd/gd_wbmp.lo
        ext/gd/libgd/gdhelpers.lo ext/gd/libgd/gd_topal.lo
        ext/gd/libgd/gd_gif_in.lo ext/gd/libgd/xbm.lo ext/imap/php_imap.lo
        ext/ldap/ldap.lo ext/mysql/php_mysql.lo ext/mysql/libmysql/libmysql.lo
        ext/mysql/libmysql/errmsg.lo ext/mysql/libmysql/net.lo
        ext/mysql/libmysql/violite.lo ext/mysql/libmysql/password.lo
        ext/mysql/libmysql/my_init.lo ext/mysql/libmysql/my_lib.lo
        ext/mysql/libmysql/my_static.lo ext/mysql/libmysql/my_malloc.lo
        ext/mysql/libmysql/my_realloc.lo ext/mysql/libmysql/my_create.lo
        ext/mysql/libmysql/my_delete.lo ext/mysql/libmysql/my_tempnam.lo
        ext/mysql/libmysql/my_open.lo ext/mysql/libmysql/mf_casecnv.lo
        ext/mysql/libmysql/my_read.lo ext/mysql/libmysql/my_write.lo
        ext/mysql/libmysql/errors.lo ext/mysql/libmysql/my_error.lo
        ext/mysql/libmysql/my_getwd.lo ext/mysql/libmysql/my_div.lo
        ext/mysql/libmysql/mf_pack.lo ext/mysql/libmysql/my_messnc.lo
        ext/mysql/libmysql/mf_dirname.lo ext/mysql/libmysql/mf_fn_ext.lo
        ext/mysql/libmysql/mf_wcomp.lo ext/mysql/libmysql/typelib.lo
        ext/mysql/libmysql/safemalloc.lo ext/mysql/libmysql/my_alloc.lo
        ext/mysql/libmysql/mf_format.lo ext/mysql/libmysql/mf_path.lo
        ext/mysql/libmysql/mf_unixpath.lo ext/mysql/libmysql/my_fopen.lo
        ext/mysql/libmysql/mf_loadpath.lo ext/mysql/libmysql/my_pthread.lo
        ext/mysql/libmysql/my_thr_init.lo ext/mysql/libmysql/thr_mutex.lo
        ext/mysql/libmysql/mulalloc.lo ext/mysql/libmysql/string.lo
        ext/mysql/libmysql/default.lo ext/mysql/libmysql/my_compress.lo
        ext/mysql/libmysql/array.lo ext/mysql/libmysql/my_once.lo
        ext/mysql/libmysql/list.lo ext/mysql/libmysql/my_net.lo
        ext/mysql/libmysql/dbug.lo ext/mysql/libmysql/strmov.lo
        ext/mysql/libmysql/strxmov.lo ext/mysql/libmysql/strnmov.lo
        ext/mysql/libmysql/strmake.lo ext/mysql/libmysql/strend.lo
        ext/mysql/libmysql/strfill.lo ext/mysql/libmysql/is_prefix.lo
        ext/mysql/libmysql/int2str.lo ext/mysql/libmysql/str2int.lo
        ext/mysql/libmysql/strinstr.lo ext/mysql/libmysql/strcont.lo
        ext/mysql/libmysql/strcend.lo ext/mysql/libmysql/bchange.lo
        ext/mysql/libmysql/bmove.lo ext/mysql/libmysql/bmove_upp.lo
        ext/mysql/libmysql/longlong2str.lo ext/mysql/libmysql/strtoull.lo
        ext/mysql/libmysql/strtoll.lo ext/mysql/libmysql/charset.lo
        ext/mysql/libmysql/ctype.lo ext/overload/overload.lo
        ext/pcre/pcrelib/maketables.lo ext/pcre/pcrelib/get.lo
        ext/pcre/pcrelib/study.lo ext/pcre/pcrelib/pcre.lo ext/pcre/php_pcre.lo
        ext/posix/posix.lo ext/session/session.lo ext/session/mod_files.lo
        ext/session/mod_mm.lo ext/session/mod_user.lo regex/regcomp.lo
        regex/regexec.lo regex/regerror.lo regex/regfree.lo
        ext/standard/array.lo ext/standard/base64.lo
        ext/standard/basic_functions .lo ext/standard/browscap.lo
        ext/standard/crc32.lo ext/standard/crypt.lo ext/standard/cyr_convert.lo
        ext/standard/datetime.lo ext/standard/dir.lo ext/standard/dl.lo
        ext/standard/dns.lo ext/standard/exec.lo ext/standard/file.lo
        ext/standard/filestat.lo ext/standard/flock_compat.lo
        ext/standard/formatted_print .lo ext/standard/fsock.lo
        ext/standard/head.lo ext/standard/html.lo ext/standard/image.lo
        ext/standard/info.lo ext/standard/iptc.lo ext/standard/lcg.lo
        ext/standard/link.lo ext/standard/mail.lo ext/standard/math.lo
        ext/standard/md5.lo ext/standard/metaphone.lo ext/standard/microtime.lo
        ext/standard/pack.lo ext/standard/pageinfo.lo ext/standard/parsedate.lo
        ext/standard/quot_print.lo ext/standard/rand.lo ext/standard/reg.lo
        ext/standard/soundex.lo ext/standard/string.lo ext/standard/scanf.lo
        ext/standard/syslog.lo ext/standard/type.lo ext/standard/uniqid.lo
        ext/standard/url.lo ext/standard/url_scanner.lo ext/standard/var.lo
        ext/standard/versioning.lo ext/standard/assert.lo
        ext/standard/strnatcmp.lo ext/standard/levenshtein.lo
        ext/standard/incomplete_clas s.lo ext/standard/url_scanner_ex. lo
        ext/standard/ftp_fopen_wrapp er.lo ext/standard/http_fopen_wrap per.lo
        ext/standard/php_fopen_wrapp er.lo ext/standard/credits.lo
        ext/standard/css.lo ext/standard/var_unserialize r.lo
        ext/standard/ftok.lo ext/standard/aggregation.lo ext/standard/sha1.lo
        ext/tokenizer/tokenizer.lo ext/xml/xml.lo ext/xml/expat/xmlparse.lo
        ext/xml/expat/xmlrole.lo ext/xml/expat/xmltok.lo TSRM/TSRM.lo
        TSRM/tsrm_strtok_r.l o TSRM/tsrm_virtual_cw d.lo main/main.lo
        main/snprintf.lo main/spprintf.lo main/php_sprintf.lo main/safe_mode.lo
        main/fopen_wrappers. lo main/alloca.lo main/php_scandir.lo
        main/php_ini.lo main/SAPI.lo main/rfc1867.lo main/php_content_typ es.lo
        main/strlcpy.lo main/strlcat.lo main/mergesort.lo main/reentrancy.lo
        main/php_variables.l o main/php_ticks.lo main/streams.lo main/network.lo
        main/php_open_tempor ary_file.lo main/php_logos.lo main/output.lo
        main/memory_streams. lo main/user_streams.lo Zend/zend_language_p arser.lo
        Zend/zend_language_s canner.lo Zend/zend_ini_parser .lo
        Zend/zend_ini_scanne r.lo Zend/zend_alloc.lo Zend/zend_compile.lo
        Zend/zend_constants. lo Zend/zend_dynamic_ar ray.lo
        Zend/zend_execute_AP I.lo Zend/zend_highlight. lo Zend/zend_llist.lo
        Zend/zend_opcode.lo Zend/zend_operators. lo Zend/zend_ptr_stack. lo
        Zend/zend_stack.lo Zend/zend_variables. lo Zend/zend.lo Zend/zend_API.lo
        Zend/zend_extensions .lo Zend/zend_hash.lo Zend/zend_list.lo
        Zend/zend_indent.lo Zend/zend_builtin_fu nctions.lo Zend/zend_sprintf.lo
        Zend/zend_ini.lo Zend/zend_qsort.lo Zend/zend_multibyte. lo
        Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/getopt.lo
        main/internal_functi ons_cli.lo -lcrypt -lc-client -lssl -lcrypto -lldap
        -llber -lcrypt -lpam -lt1 -lpng -lz -ljpeg -lgdbm -lz -lssl -lcrypto
        -lresolv -lm -ldl -lnsl -lsocket -lgcc -lcrypt -o sapi/cli/php
        Undefined first referenced
        symbol in file
        php_parse_date ext/standard/datetime.o
        ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
        collect2: ld returned 1 exit status
        *** Error code 1
        make: Fatal error: Command failed for target `sapi/cli/php'
        -- end --

        And here's the ./configure line:

        -- start --

        ../configure --with-apache=../apache --disable-display-source
        --disable-short-tags --with-gdbm --with-imap=../imap-2002e
        --with-imsp=../libimsp --with-ldap=../ldap --with-gd
        --with-jpeg-dir=/usr/local/lib/ --with-t1lib=/usr/local/lib
        --with-openssl=/usr/local/ssl/ --with-zlib-dir=/usr/local/lib
        --with-png-dir=/usr/local/lib/ --with-imap-ssl=/usr/local/ssl/

        -- end --
        (Note: All the paths in both are absolute. I shorten them manually)

        There is only one instance of php_parse_date in the files already
        compiled in ext/standard/datetime.o. Aside from that, nothing else. BTW,
        I only found *.o and *.lo files (I only checked *.o files though).

        I got to compile it without the Command Line Interface and without PEAR.

        Any problems I might encounter by disabling PEAR?

        TIA,

        --
        Andres Rosado
        Email: andresr@despamm ed.com
        ICQ: 66750646
        AIM: pantear
        Homepage: http://andres980.tripod.com/

        Microsoft Palladium:
        "Where the hell do you think YOU'RE going today?"

        Comment

        • Rob Ristroph

          #5
          Re: Problems compiling PHP 4.3 on Solaris 8


          The object file parsedate.o (or parsedate.lo, one should be a link to
          the other I think) should define that symbol. If you look in
          ext/standard/parsedate.c you should see where that function is
          defined.

          Perhaps the order in which the objects are linked matters ? You could
          try cutting and pasting that long link command to the command line,
          and editting it to move parsedate.lo to just after datetime.lo. I'm
          not sure where in the build system you would change that order to make
          it happen automatically, but you could report it as a bug.

          I don't know about PEAR; it depends on if you are using it. I was
          under the impression that it was just a bunch of php class files and
          could be installed by untarring it in the right place and editting
          something in php.ini, but I am not sure about that.

          --Rob

          Comment

          • Andres Rosado-Sepulveda

            #6
            Re: Problems compiling PHP 4.3 on Solaris 8

            Rob Ristroph wrote:
            [color=blue]
            > The object file parsedate.o (or parsedate.lo, one should be a link to
            > the other I think) should define that symbol. If you look in
            > ext/standard/parsedate.c you should see where that function is
            > defined.
            >
            > Perhaps the order in which the objects are linked matters ? You could
            > try cutting and pasting that long link command to the command line,
            > and editting it to move parsedate.lo to just after datetime.lo. I'm
            > not sure where in the build system you would change that order to make
            > it happen automatically, but you could report it as a bug.[/color]

            I editted the line and it didn't worked either. I checked again the bug
            reports and nothing seemed to help either. I'm submitting a bug report
            for this situation. Thanks!
            [color=blue]
            > I don't know about PEAR; it depends on if you are using it. I was
            > under the impression that it was just a bunch of php class files and
            > could be installed by untarring it in the right place and editting
            > something in php.ini, but I am not sure about that.[/color]

            I managed to compile PHP 4.3.4 without PEAR support. I wanted to make
            sure if something was moved between PHP4.0.x and 4.3.4 (IIRC, some
            classes were moved to PEAR in PHP5. I don't know the validity of this
            statement).

            --
            Andres Rosado
            Email: andresr@despamm ed.com
            ICQ: 66750646
            AIM: pantear
            Homepage: http://andres980.tripod.com/

            Strike first, strike fast, strike hard.
            -- Cliffjumper (G1)

            Comment

            • Andres Rosado-Sepulveda

              #7
              Re: Problems compiling PHP 4.3 on Solaris 8

              Andres Rosado-Sepulveda wrote:[color=blue]
              > I editted the line and it didn't worked either. I checked again the bug
              > reports and nothing seemed to help either. I'm submitting a bug report
              > for this situation. Thanks![/color]

              The problem was solved by upgrading bison and using the latest snapshot.
              (link: http://bugs.php.net/bug.php?id=27449 ).

              --
              Andres Rosado
              Email: andresr@despamm ed.com
              ICQ: 66750646
              AIM: pantear
              Homepage: http://andres980.tripod.com/

              Go confidently in the direction of your dreams. Live the life you've
              imagined.
              -- Henry David Thoreau

              Comment

              Working...