0005-unix-configure-remove-GID-UID-size-check.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. From d8da4e5f0ebed000f880e60b6cca7c575f7ed1c7 Mon Sep 17 00:00:00 2001
  2. From: Romain Naour <romain.naour@openwide.fr>
  3. Date: Fri, 23 Jan 2015 22:13:14 +0100
  4. Subject: [PATCH] unix/configure: remove GID/UID size check
  5. This check can't work for cross-compilation since it
  6. try to run a target's binary on the host system.
  7. Reported-by: Richard Genoud <richard.genoud@gmail.com>
  8. Signed-off-by: Romain Naour <romain.naour@openwide.fr>
  9. ---
  10. unix/configure | 57 ---------------------------------------------------------
  11. 1 file changed, 57 deletions(-)
  12. diff --git a/unix/configure b/unix/configure
  13. index de9fd68..7bfc9eb 100644
  14. --- a/unix/configure
  15. +++ b/unix/configure
  16. @@ -237,63 +237,6 @@ _EOF_
  17. $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
  18. [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_OFF_T"
  19. -
  20. -echo Check size of UIDs and GIDs
  21. -echo "(Now zip stores variable size UIDs/GIDs using a new extra field. This"
  22. -echo " tests if this OS uses 16-bit UIDs/GIDs and so if the old 16-bit storage"
  23. -echo " should also be used for backward compatibility.)"
  24. -# Added 2008-04-15 CS
  25. -cat > conftest.c << _EOF_
  26. -# define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
  27. -# define _LARGEFILE64_SOURCE
  28. -# define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */
  29. -# define _LARGE_FILES /* some OSes need this for 64-bit off_t */
  30. -#include <sys/types.h>
  31. -#include <sys/stat.h>
  32. -#include <unistd.h>
  33. -#include <stdio.h>
  34. -int main()
  35. -{
  36. - struct stat s;
  37. -
  38. - printf(" s.st_uid is %u bytes\n", sizeof(s.st_uid));
  39. - printf(" s.st_gid is %u bytes\n", sizeof(s.st_gid));
  40. -
  41. - /* see if have 16-bit UID */
  42. - if (sizeof(s.st_uid) != 2) {
  43. - return 1;
  44. - }
  45. - /* see if have 16-bit GID */
  46. - if (sizeof(s.st_gid) != 2) {
  47. - return 2;
  48. - }
  49. - return 3;
  50. -}
  51. -_EOF_
  52. -# compile it
  53. -$CC -o conftest conftest.c >/dev/null 2>/dev/null
  54. -if [ $? -ne 0 ]; then
  55. - echo -- UID/GID test failed on compile - disabling old 16-bit UID/GID support
  56. - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
  57. -else
  58. -# run it
  59. - ./conftest
  60. - r=$?
  61. - if [ $r -eq 1 ]; then
  62. - echo -- UID not 2 bytes - disabling old 16-bit UID/GID support
  63. - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
  64. - elif [ $r -eq 2 ]; then
  65. - echo -- GID not 2 bytes - disabling old 16-bit UID/GID support
  66. - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
  67. - elif [ $r -eq 3 ]; then
  68. - echo -- 16-bit UIDs and GIDs - keeping old 16-bit UID/GID support
  69. - else
  70. - echo -- test failed - conftest returned $r - disabling old 16-bit UID/GID support
  71. - CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
  72. - fi
  73. -fi
  74. -
  75. -
  76. # Now we set the 64-bit file environment and check the size of off_t
  77. # Added 11/4/2003 EG
  78. # Revised 8/12/2004 EG
  79. --
  80. 1.9.3