Bernd Nies wrote:

> I'm trying PHP5 to get compiled with the imap2006b client libraries. The
> compiler options are:
> 
> PATH="/share/app/gnu/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin"
> CC=gcc
> CFLAGS=-O3 -fPIC -Wall
> CXX=g++
> CXXFLAGS=-O3 -fPIC -Wall
> CPPFLAGS="-I/opt/adnwebmail/include"
> LDFLAGS="-R/opt/adnwebmail/lib -L/opt/adnwebmail/lib
> -R/opt/adnwebmail/lib/sparcv9 -L/opt/adnwebmail/lib/sparcv9"
> LD_OPTIONS=$LDFLAGS
[snip]
> ### UW-IMAP
> gtar -C /tmp -xvzf imap-2006b.tar.Z
> cd /tmp/imap-2006b
> gmake gso SSLDIR=/opt/adnwebmail
> cp c-client/*.h /opt/adnwebmail/include
> cp c-client/c-client.a /opt/adnwebmail/lib/libc-client.a
> cd -
> 
> ### PHP
> gtar -C /tmp -xvzf phpphp5.2-200610161030.tar.gz
> cd /tmp/phpphp5.2-200610161030
> ./configure --prefix=/opt/adnwebmail \
>             --with-apxs2=/opt/adnwebmail/bin/apxs \
>             --with-ldap=/opt/adnwebmail \
>             --with-imap=/opt/adnwebmail \
>             --with-imap-ssl=/opt/adnwebmail \
>             --with-ssl=/opt/adnwebmail \
>             --with-libxml-dir=/opt/adnwebmail \
>             --with-config-file-path=/etc/opt/adnwebmail \
>             --enable-safe-mode
> gmake
> 
> The linker errors are:
> 
> Text relocation remains                         referenced
>     against symbol                  offset      in file
> <unknown>                           0x2730
> /opt/adnwebmail/lib/libc-client.a(osdep.o)
[snip]
> time                                0x8e0
[snip]
> /opt/adnwebmail/lib/libc-client.a(netmsg.o)
> realloc                             0xcc
> /opt/adnwebmail/lib/libc-client.a(osdep.o)
> printf                              0x54d4
> /opt/adnwebmail/lib/libc-client.a(osdep.o)
> ld: fatal: relocations remain against allocatable but non-writable
> sections
> collect2: ld returned 1 exit status
> gmake: *** [libphp5.la] Error 1
> 
> 
> I already posted this to PHP Bugzilla but they forwarded me to the
> developers of the IMAP c-client library.
> 
> http://bugs.php.net/bug.php?id=39045
> 
> Any hints or bugfixes would be appreciated. Thanks in advance.

Not much help from those guys at php's bugzilla...

The interesting part is the actual compile command which you included in your
bug report, it is wrong but not your fault.

The compilation is wrong because you are using dynamic and at least one static
library, c-client, so unless things have changed lately with gcc and they made
it much smarter the link should specify explicitly the static library.  This is
done in one of two ways, you can link the whole library by including just its
name (whithout the -l<name>) or you surround the link command (-static
-lc-client -dynamic).

I haven't tested this but the only easy way seems to do the linking part by hand
(store the output of the build process with 'gmake | tee make.log', then copy
that long command and execute it in the directory it is being executed with one
of the changes).

BTW I'm not an imap developer and I don't speak for them; this is a user's list.
I hope my comments are useful.
-- 
René Berber

_______________________________________________
Imap-uw mailing list
[email protected]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to