]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/php/0007-main-php_ini.c-build-empty-php_load_zend_extension_c.patch
package/freeswitch-mod-bcg729: bump version to v1.0.4
[coffee/buildroot.git] / package / php / 0007-main-php_ini.c-build-empty-php_load_zend_extension_c.patch
1 From b7bbdfbcb0869b5c068143d4e27bab9eac4ae72b Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
3 Date: Mon, 26 Feb 2018 19:30:55 +0100
4 Subject: [PATCH] main/php_ini.c: build empty php_load_zend_extension_cb() when
5  !HAVE_LIBDL
6
7 Commit 0782a7fc6314c8bd3cbfd57f12d0479bf9cc8dc7 ("Fixed bug #74866
8 extension_dir = "./ext" now use current directory for base") modified
9 the php_load_zend_extension_cb() function to use php_load_shlib(), and
10 pass a handle to the newly introduced zend_load_extension_handle()
11 function instead of passing the extension path to
12 zend_load_extension().
13
14 While doing so, it introduced a call to php_load_shlib() from code
15 that is built even when HAVE_LIBDL is not defined. However,
16 php_load_shlib() is not implemented when HAVE_LIBDL is not defined,
17 for obvious reasons.
18
19 It turns out that zend_load_extension_handle() anyway doesn't do
20 anything when ZEND_EXTENSIONS_SUPPORT is defined to 0, and
21 ZEND_EXTENSIONS_SUPPORT is not defined when HAVE_LIBDL is not defined
22 (Zend/zend_portability.h).
23
24 Fixes the following build failure when building on a system that
25 doesn't have libdl:
26
27 main/php_ini.o: In function `php_load_zend_extension_cb':
28 php_ini.c:(.text+0x478): undefined reference to `php_load_shlib'
29 php_ini.c:(.text+0x4b0): undefined reference to `php_load_shlib'
30 collect2: error: ld returned 1 exit status
31
32 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
33 Upstream-status: https://github.com/php/php-src/pull/3161
34 ---
35  main/php_ini.c | 4 ++++
36  1 file changed, 4 insertions(+)
37
38 diff --git a/main/php_ini.c b/main/php_ini.c
39 index ba58eb1180..fca263e5f0 100644
40 --- a/main/php_ini.c
41 +++ b/main/php_ini.c
42 @@ -350,6 +350,7 @@ static void php_load_php_extension_cb(void *arg)
43  
44  /* {{{ php_load_zend_extension_cb
45   */
46 +#ifdef HAVE_LIBDL
47  static void php_load_zend_extension_cb(void *arg)
48  {
49         char *filename = *((char **) arg);
50 @@ -409,6 +410,9 @@ static void php_load_zend_extension_cb(void *arg)
51                 efree(libpath);
52         }
53  }
54 +#else
55 +static void php_load_zend_extension_cb(void *arg) { }
56 +#endif
57  /* }}} */
58  
59  /* {{{ php_init_config
60 -- 
61 2.14.3
62