0004-internal.h-make-inline-functions-static.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. From 2b9e01ee31c1b7596b19f0c89954e93e217b0479 Mon Sep 17 00:00:00 2001
  2. From: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
  3. Date: Thu, 21 Sep 2017 10:16:33 +0200
  4. Subject: [PATCH] internal.h: make inline functions static
  5. With some GCC configurations/build options it is possible for gcc to
  6. ignore the inline hint. As the methods are not declared static, gcc
  7. expects a definition to be provided elsewhere, which is not the case
  8. here resulting in the following linker error:
  9. libtool: link: /home/marcin/br-test-pkg/br-arm-cortex-a9-glibc/host/bin/arm-linux-gcc
  10. -fstack-protector-strong -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
  11. -D_FILE_OFFSET_BITS=64 -Os -Wl,-z -Wl,relro -Wl,-z -Wl,now -o bin/kcapi
  12. test/bin_kcapi-kcapi-main.o ./.libs/libkcapi.so -Wl,-rpath
  13. -Wl,/home/marcin/br-test-pkg/br-arm-cortex-a9-glibc/build/libkcapi-0.14.0/.libs
  14. ./.libs/libkcapi.so: undefined reference to `_kcapi_common_vmsplice_iov'
  15. ./.libs/libkcapi.so: undefined reference to `_kcapi_common_read_data'
  16. ./.libs/libkcapi.so: undefined reference to `_kcapi_aio_read_iov'
  17. ./.libs/libkcapi.so: undefined reference to `_kcapi_common_recv_data'
  18. ./.libs/libkcapi.so: undefined reference to `_kcapi_common_send_data'
  19. ./.libs/libkcapi.so: undefined reference to `_kcapi_common_vmsplice_chunk'
  20. ./.libs/libkcapi.so: undefined reference to `_kcapi_common_send_meta'
  21. collect2: error: ld returned 1 exit status
  22. $ arm-linux-gcc --version
  23. arm-linux-gcc.br_real (Buildroot 2017.08-git-01078-g95b1dae) 7.1.0
  24. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
  25. Signed-off-by: Stephan Mueller <smueller@chronox.de>
  26. [Upstream commit: https://github.com/smuellerDD/libkcapi/commit/2b9e01ee31c1b7596b19f0c89954e93e217b0479]
  27. Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
  28. ---
  29. lib/internal.h | 14 +++++++-------
  30. 1 file changed, 7 insertions(+), 7 deletions(-)
  31. diff --git a/lib/internal.h b/lib/internal.h
  32. index 0d98f24..addf450 100644
  33. --- a/lib/internal.h
  34. +++ b/lib/internal.h
  35. @@ -233,7 +233,7 @@ void kcapi_dolog(int severity, const char *fmt, ...);
  36. int32_t _kcapi_common_send_meta_fd(struct kcapi_handle *handle, int *fdptr,
  37. struct iovec *iov, uint32_t iovlen,
  38. uint32_t enc, uint32_t flags);
  39. -inline int32_t _kcapi_common_send_meta(struct kcapi_handle *handle,
  40. +static inline int32_t _kcapi_common_send_meta(struct kcapi_handle *handle,
  41. struct iovec *iov, uint32_t iovlen,
  42. uint32_t enc, uint32_t flags)
  43. {
  44. @@ -244,7 +244,7 @@ inline int32_t _kcapi_common_send_meta(struct kcapi_handle *handle,
  45. int32_t _kcapi_common_vmsplice_iov_fd(struct kcapi_handle *handle, int *fdptr,
  46. struct iovec *iov, unsigned long iovlen,
  47. uint32_t flags);
  48. -inline int32_t _kcapi_common_vmsplice_iov(struct kcapi_handle *handle,
  49. +static inline int32_t _kcapi_common_vmsplice_iov(struct kcapi_handle *handle,
  50. struct iovec *iov, unsigned long iovlen,
  51. uint32_t flags)
  52. {
  53. @@ -255,7 +255,7 @@ inline int32_t _kcapi_common_vmsplice_iov(struct kcapi_handle *handle,
  54. int32_t _kcapi_common_send_data_fd(struct kcapi_handle *handle, int *fdprt,
  55. struct iovec *iov, uint32_t iovlen,
  56. uint32_t flags);
  57. -inline int32_t _kcapi_common_send_data(struct kcapi_handle *handle,
  58. +static inline int32_t _kcapi_common_send_data(struct kcapi_handle *handle,
  59. struct iovec *iov, uint32_t iovlen,
  60. uint32_t flags)
  61. {
  62. @@ -265,7 +265,7 @@ inline int32_t _kcapi_common_send_data(struct kcapi_handle *handle,
  63. int32_t _kcapi_common_recv_data_fd(struct kcapi_handle *handle, int *fdptr,
  64. struct iovec *iov, uint32_t iovlen);
  65. -inline int32_t _kcapi_common_recv_data(struct kcapi_handle *handle,
  66. +static inline int32_t _kcapi_common_recv_data(struct kcapi_handle *handle,
  67. struct iovec *iov, uint32_t iovlen)
  68. {
  69. return _kcapi_common_recv_data_fd(handle, &handle->opfd, iov, iovlen);
  70. @@ -273,7 +273,7 @@ inline int32_t _kcapi_common_recv_data(struct kcapi_handle *handle,
  71. int32_t _kcapi_common_read_data_fd(struct kcapi_handle *handle, int *fdptr,
  72. uint8_t *out, uint32_t outlen);
  73. -inline int32_t _kcapi_common_read_data(struct kcapi_handle *handle,
  74. +static inline int32_t _kcapi_common_read_data(struct kcapi_handle *handle,
  75. uint8_t *out, uint32_t outlen)
  76. {
  77. return _kcapi_common_read_data_fd(handle, &handle->opfd, out, outlen);
  78. @@ -285,7 +285,7 @@ int _kcapi_common_close(struct kcapi_handle *handle, int fdptr);
  79. int32_t _kcapi_common_vmsplice_chunk_fd(struct kcapi_handle *handle, int *fdptr,
  80. const uint8_t *in, uint32_t inlen,
  81. uint32_t flags);
  82. -inline int32_t _kcapi_common_vmsplice_chunk(struct kcapi_handle *handle,
  83. +static inline int32_t _kcapi_common_vmsplice_chunk(struct kcapi_handle *handle,
  84. const uint8_t *in, uint32_t inlen,
  85. uint32_t flags)
  86. {
  87. @@ -315,7 +315,7 @@ int _kcapi_aio_send_iov(struct kcapi_handle *handle, struct iovec *iov,
  88. int32_t _kcapi_aio_read_iov_fd(struct kcapi_handle *handle, int *fdptr,
  89. struct iovec *iov, uint32_t iovlen);
  90. -inline int32_t _kcapi_aio_read_iov(struct kcapi_handle *handle,
  91. +static inline int32_t _kcapi_aio_read_iov(struct kcapi_handle *handle,
  92. struct iovec *iov, uint32_t iovlen)
  93. {
  94. return _kcapi_aio_read_iov_fd(handle, &handle->opfd, iov, iovlen);