gnutls-correct_rpl_gettimeofday_signature.patch 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. [PATCH] fix build on uClibc
  2. Currently we fail on uclibc like below
  3. | In file included from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/procfs.h:32:0,
  4. | from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/ucontext.h:26,
  5. | from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/signal.h:392,
  6. | from ../../gl/signal.h:52,
  7. | from ../../gl/sys/select.h:58,
  8. | from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/types.h:220,
  9. | from ../../gl/sys/types.h:28,
  10. | from ../../lib/includes/gnutls/gnutls.h:46,
  11. | from ex-cxx.cpp:3:
  12. | ../../gl/sys/time.h:396:66: error: conflicting declaration 'void* restrict'
  13. | ../../gl/sys/time.h:396:50: error: 'restrict' has a previous declaration as 'timeval* restrict'
  14. | make[4]: *** [ex-cxx.o] Error 1
  15. | make[4]: *** Waiting for unfinished jobs....
  16. GCC detects that we call 'restrict' as param name in function
  17. signatures and complains since both params are called 'restrict'
  18. therefore we use __restrict to denote the C99 keywork
  19. This only happens of uclibc since this code is not excercised with
  20. eglibc otherwise we will have same issue there too
  21. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  22. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
  23. Index: gnutls-2.12.14/gl/sys_time.in.h
  24. ===================================================================
  25. --- gnutls-2.12.14.orig/gl/sys_time.in.h 2012-01-15 10:54:39.517285351 -0800
  26. +++ gnutls-2.12.14/gl/sys_time.in.h 2012-01-15 10:59:23.773299108 -0800
  27. @@ -82,20 +82,20 @@
  28. # define gettimeofday rpl_gettimeofday
  29. # endif
  30. _GL_FUNCDECL_RPL (gettimeofday, int,
  31. - (struct timeval *restrict, void *restrict)
  32. + (struct timeval *__restrict, void *__restrict)
  33. _GL_ARG_NONNULL ((1)));
  34. _GL_CXXALIAS_RPL (gettimeofday, int,
  35. - (struct timeval *restrict, void *restrict));
  36. + (struct timeval *__restrict, void *__restrict));
  37. # else
  38. # if !@HAVE_GETTIMEOFDAY@
  39. _GL_FUNCDECL_SYS (gettimeofday, int,
  40. - (struct timeval *restrict, void *restrict)
  41. + (struct timeval *__restrict, void *__restrict)
  42. _GL_ARG_NONNULL ((1)));
  43. # endif
  44. /* Need to cast, because on glibc systems, by default, the second argument is
  45. struct timezone *. */
  46. _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
  47. - (struct timeval *restrict, void *restrict));
  48. + (struct timeval *__restrict, void *__restrict));
  49. # endif
  50. _GL_CXXALIASWARN (gettimeofday);
  51. # elif defined GNULIB_POSIXCHECK