Bug #70158 [Opn]: Building with static imap fails
| From: | ab@php.net | Date: | Wed, 29 Jul 2015 08:06:57 +0000 |
| Subject: | Bug #70158 [Opn]: Building with static imap fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194804@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70158&edit=1
ID: 70158
Updated by: ab@php.net
Reported by: cmb@php.net
Summary: Building with static imap fails
Status: Open
Type: Bug
Package: IMAP related
Operating System: Windows
PHP Version: 7.0Git-2015-07-28 (Git)
Block user comment: N
Private report: N
New Comment:
Hi Christoph,
yeah, imap is never built static on Windows. And, the same c-client is used unchanged through all
the PHP versions.
As far as I see, c-client uses the same implementation by Mark Crispin. In PHP it already contains
some patches. I just went through winlibs and there are several other libs using at least
openlog/syslog - libsasl, openldap, net-snmp, postgresql. Without going much into detail what I
previously thought - we could export those symbols in PHP and patch c-client. But probably it's
too much given other libs will possibly need to be patched and there's no good possibility to
evaluate the impacts.
With the ext/imap case I would rather disable the static building (eq force to be shared always,
like intl or fileinfo). It's compiled shared in the official releases (snapshot build). Also
for security reasons as c-client is dead.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2015-07-28 13:28:39] cmb@php.net
Description:
------------
On Windows trying to build with the imap extension statically
linked fails. This happens with the latest deps[1], but most
likely also with self compiled c-client libs.
The cause is that openlog(), syslog() and flock() are defined by
imap's[2] as well as PHP's[3] Unix compat layer for Windows.
[1] <http://windows.php.net/downloads/php-sdk/>
[2] <https://github.com/winlibs/imap/blob/master/src/osdep/nt/yunchan.c>
[3] <https://github.com/php/php-src/tree/php-7.0.0beta2/win32>
Test script:
---------------
configure --disable-all --enable-cli --with-imap
nmake
Expected result:
----------------
no errors
Actual result:
--------------
cclient_a.lib(os_w2k.obj) : error LNK2005: flock already defined in flock_compat.obj
cclient_a.lib(os_w2k.obj) : error LNK2005: openlog already defined in wsyslog.obj
cclient_a.lib(os_w2k.obj) : error LNK2005: syslog already defined in wsyslog.obj
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70158&edit=1