0007-phpdbg_prompt-enclose-phpdbg_load_module_or_extensio.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 9ca3de0446fcd31b1561b333020ae0674a83bec7 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Tue, 9 Aug 2016 11:39:10 +0200
  4. Subject: [PATCH] phpdbg_prompt: enclose phpdbg_load_module_or_extension() in
  5. HAVE_LIBDL
  6. The phpdbg_load_module_or_extension() function relies on libdl
  7. functionality, so it should be enclosed in HAVE_LIBDL to avoid the
  8. following build failure when libdl support is not available:
  9. php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1c20): undefined reference to `_DL_LOAD'
  10. php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1c36): undefined reference to `_GET_DL_ERROR'
  11. php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1c6a): undefined reference to `_DL_FETCH_SYMBOL'
  12. php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1c7e): undefined reference to `_DL_FETCH_SYMBOL'
  13. php-7.0.9/sapi/phpdbg/phpdbg_prompt.c:(.text+0x1dc6): undefined reference to `_DL_UNLOAD'
  14. This function is only called in the "dl" debug command, inside an
  15. HAVE_LIBDL condition.
  16. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  17. ---
  18. sapi/phpdbg/phpdbg_prompt.c | 2 ++
  19. 1 file changed, 2 insertions(+)
  20. diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
  21. index 6f73d30..6768dc5 100644
  22. --- a/sapi/phpdbg/phpdbg_prompt.c
  23. +++ b/sapi/phpdbg/phpdbg_prompt.c
  24. @@ -1019,6 +1019,7 @@ static int add_zendext_info(zend_extension *ext) /* {{{ */ {
  25. }
  26. /* }}} */
  27. +#ifdef HAVE_LIBDL
  28. PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name) /* {{{ */ {
  29. DL_HANDLE handle;
  30. char *extension_dir;
  31. @@ -1158,6 +1159,7 @@ quit:
  32. DL_UNLOAD(handle);
  33. return NULL;
  34. }
  35. +#endif
  36. /* }}} */
  37. PHPDBG_COMMAND(dl) /* {{{ */
  38. --
  39. 2.7.4