cygwin-compat.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. diff -Nur linux-2.6.30.orig/scripts/mod/file2alias.c linux-2.6.30/scripts/mod/file2alias.c
  2. --- linux-2.6.30.orig/scripts/mod/file2alias.c 2009-06-10 05:05:27.000000000 +0200
  3. +++ linux-2.6.30/scripts/mod/file2alias.c 2009-06-11 09:17:10.000000000 +0200
  4. @@ -29,7 +29,11 @@
  5. #include <ctype.h>
  6. +#ifdef __CYGWIN__
  7. +typedef __uint32_t __u32;
  8. +#else
  9. typedef uint32_t __u32;
  10. +#endif
  11. typedef uint16_t __u16;
  12. typedef unsigned char __u8;
  13. diff -Nur linux-2.6.30.orig/scripts/mod/modpost.h linux-2.6.30/scripts/mod/modpost.h
  14. --- linux-2.6.30.orig/scripts/mod/modpost.h 2009-06-10 05:05:27.000000000 +0200
  15. +++ linux-2.6.30/scripts/mod/modpost.h 2009-06-11 09:17:10.000000000 +0200
  16. @@ -9,6 +9,11 @@
  17. #include <unistd.h>
  18. #include <elf.h>
  19. +#ifdef __CYGWIN__
  20. +typedef uint16_t Elf32_Section;
  21. +typedef uint16_t Elf64_Section;
  22. +#endif
  23. +
  24. #include "elfconfig.h"
  25. #if KERNEL_ELFCLASS == ELFCLASS32
  26. @@ -19,13 +24,17 @@
  27. #define Elf_Addr Elf32_Addr
  28. #define Elf_Sword Elf64_Sword
  29. #define Elf_Section Elf32_Half
  30. +#ifndef __CYGWIN__
  31. #define ELF_ST_BIND ELF32_ST_BIND
  32. #define ELF_ST_TYPE ELF32_ST_TYPE
  33. +#endif
  34. #define Elf_Rel Elf32_Rel
  35. #define Elf_Rela Elf32_Rela
  36. +#ifndef __CYGWIN__
  37. #define ELF_R_SYM ELF32_R_SYM
  38. #define ELF_R_TYPE ELF32_R_TYPE
  39. +#endif
  40. #else
  41. #define Elf_Ehdr Elf64_Ehdr
  42. @@ -43,6 +52,17 @@
  43. #define ELF_R_TYPE ELF64_R_TYPE
  44. #endif
  45. +#define R_386_32 1 /* Direct 32 bit */
  46. +#define R_386_PC32 2 /* PC relative 32 bit */
  47. +
  48. +#define R_ARM_PC24 1 /* PC relative 26 bit branch */
  49. +#define R_ARM_ABS32 2 /* Direct 32 bit */
  50. +
  51. +#define R_MIPS_32 2 /* Direct 32 bit */
  52. +#define R_MIPS_26 4 /* Direct 26 bit shifted */
  53. +#define R_MIPS_HI16 5 /* High 16 bit */
  54. +#define R_MIPS_LO16 6 /* Low 16 bit */
  55. +
  56. /* The 64-bit MIPS ELF ABI uses an unusual reloc format. */
  57. typedef struct
  58. {