Bug #70158 [Csd]: Building with static imap fails
| From: | ab@php.net | Date: | Wed, 29 Jul 2015 17:13:35 +0000 |
| Subject: | Bug #70158 [Csd]: Building with static imap fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-194820@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: Closed
Type: Bug
Package: IMAP related
Operating System: Windows
PHP Version: 7.0Git-2015-07-28 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Yeah, plus the fact it fails to build static with vanilla c-client. There are quite some limitations
in several cases as many libs try to emulate Linux APIs, or have own rules, or etc. :) All that
affect core and PECL builds.
Thanks, Christoph.
Previous Comments:
------------------------------------------------------------------------
[2015-07-29 15:05:31] cmb@php.net
Well, disabling static builds of ext/imap makes sense for the
reasons you mentioned, Anatol. I've committed that to master.
------------------------------------------------------------------------
[2015-07-29 15:01:21] cmb@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ce3c869d19f3acf4befae15a4e37f527c57fa92e
Log: Fix #70158: Building with static imap fails
------------------------------------------------------------------------
[2015-07-29 08:06:56] ab@php.net
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.
------------------------------------------------------------------------
[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