0004-Forward-declare-open_temp_exec_file-764.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. From ce077e5565366171aa1b4438749b0922fce887a4 Mon Sep 17 00:00:00 2001
  2. From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
  3. Date: Thu, 2 Feb 2023 14:46:29 +0000
  4. Subject: [PATCH] Forward declare open_temp_exec_file (#764)
  5. It's defined in closures.c and used in tramp.c.
  6. Also declare it as an hidden symbol, as it should be.
  7. Co-authored-by: serge-sans-paille <sguelton@mozilla.com>
  8. Upstream: https://github.com/libffi/libffi/pull/764
  9. Signed-off-by: Roy Kollen Svendsen <roy.kollen.svendsen@akersolutions.com>
  10. ---
  11. include/ffi_common.h | 4 ++++
  12. src/tramp.c | 4 ++++
  13. 2 files changed, 8 insertions(+)
  14. diff --git a/include/ffi_common.h b/include/ffi_common.h
  15. index 2bd31b0..c53a794 100644
  16. --- a/include/ffi_common.h
  17. +++ b/include/ffi_common.h
  18. @@ -128,6 +128,10 @@ void *ffi_data_to_code_pointer (void *data) FFI_HIDDEN;
  19. static trampoline. */
  20. int ffi_tramp_is_present (void *closure) FFI_HIDDEN;
  21. +/* Return a file descriptor of a temporary zero-sized file in a
  22. + writable and executable filesystem. */
  23. +int open_temp_exec_file(void) FFI_HIDDEN;
  24. +
  25. /* Extended cif, used in callback from assembly routine */
  26. typedef struct
  27. {
  28. diff --git a/src/tramp.c b/src/tramp.c
  29. index 7e005b0..5f19b55 100644
  30. --- a/src/tramp.c
  31. +++ b/src/tramp.c
  32. @@ -39,6 +39,10 @@
  33. #ifdef __linux__
  34. #define _GNU_SOURCE 1
  35. #endif
  36. +
  37. +#include <ffi.h>
  38. +#include <ffi_common.h>
  39. +
  40. #include <stdio.h>
  41. #include <unistd.h>
  42. #include <stdlib.h>
  43. --
  44. 2.45.1