0004-Fix-error-on-musl.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From d3dc5f98f653342af97ebfbdf3479ee1f0d0cf38 Mon Sep 17 00:00:00 2001
  2. From: Richard Purdie <richard.purdie@linuxfoundation.org>
  3. Date: Wed, 1 May 2019 22:15:03 +0100
  4. Subject: [PATCH] Fix error on musl:
  5. | ../../elfutils-0.176/tests/elfstrmerge.c: In function 'main':
  6. | ../../elfutils-0.176/tests/elfstrmerge.c:370:60: error: 'ALLPERMS' undeclared (first use in this function); did you mean 'EPERM'?
  7. | fdnew = open (fnew, O_WRONLY | O_CREAT, st.st_mode & ALLPERMS);
  8. | ^~~~~~~~
  9. | EPERM
  10. | ../../elfutils-0.176/tests/elfstrmerge.c:370:60: note: each undeclared identifier is reported only once for each function it appears in
  11. Upstream-Status: Inappropriate [workaround in musl]
  12. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
  13. ---
  14. tests/elfstrmerge.c | 5 +++++
  15. 1 file changed, 5 insertions(+)
  16. diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
  17. index ba0d68d..1d2447f 100644
  18. --- a/tests/elfstrmerge.c
  19. +++ b/tests/elfstrmerge.c
  20. @@ -33,6 +33,11 @@
  21. #include ELFUTILS_HEADER(dwelf)
  22. #include "elf-knowledge.h"
  23. +/* for musl */
  24. +#ifndef ALLPERMS
  25. +# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
  26. +#endif
  27. +
  28. /* The original ELF file. */
  29. static int fd = -1;
  30. static Elf *elf = NULL;