tile-fix-libgcc.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. diff -Nur gcc-5.3.0.orig/gcc/config/tilegx/linux.h gcc-5.3.0/gcc/config/tilegx/linux.h
  2. --- gcc-5.3.0.orig/gcc/config/tilegx/linux.h 2015-01-05 13:33:28.000000000 +0100
  3. +++ gcc-5.3.0/gcc/config/tilegx/linux.h 2016-01-25 12:53:51.975221940 +0100
  4. @@ -55,8 +55,6 @@
  5. /* For __clear_cache in libgcc2.c. */
  6. #ifdef IN_LIBGCC2
  7. -#include <arch/icache.h>
  8. -
  9. /* Use the minimum page size of 4K. Alternatively we can call
  10. getpagesize() but it introduces a libc dependence. */
  11. #undef CLEAR_INSN_CACHE
  12. diff -Nur gcc-5.3.0.orig/gcc/config/tilepro/linux.h gcc-5.3.0/gcc/config/tilepro/linux.h
  13. --- gcc-5.3.0.orig/gcc/config/tilepro/linux.h 2015-01-05 13:33:28.000000000 +0100
  14. +++ gcc-5.3.0/gcc/config/tilepro/linux.h 2016-01-25 12:56:33.687363200 +0100
  15. @@ -47,8 +47,6 @@
  16. /* For __clear_cache in libgcc2.c. */
  17. #ifdef IN_LIBGCC2
  18. -#include <arch/icache.h>
  19. -
  20. /* Use the minimum page size of 4K. Alternatively we can call getpagesize()
  21. but it introduces a libc dependence. */
  22. #undef CLEAR_INSN_CACHE
  23. diff -Nur gcc-5.3.0.orig/libgcc/config/tilepro/atomic.h gcc-5.3.0/libgcc/config/tilepro/atomic.h
  24. --- gcc-5.3.0.orig/libgcc/config/tilepro/atomic.h 2015-01-05 13:33:28.000000000 +0100
  25. +++ gcc-5.3.0/libgcc/config/tilepro/atomic.h 2016-01-25 13:16:09.116389975 +0100
  26. @@ -46,6 +46,11 @@
  27. The "exchange" and "compare and exchange" macros may also take
  28. pointer values. We use the pseudo-type "VAL" in the documentation
  29. to indicate the use of an appropriate type. */
  30. +
  31. +#ifndef SPR_CMPEXCH_VALUE
  32. +#define SPR_CMPEXCH_VALUE 0x2780
  33. +#endif
  34. +
  35. #else
  36. /* Atomic instruction macros
  37. @@ -90,14 +95,12 @@
  38. syscall, as is the 64-bit compare-and-exchange. The other 64-bit
  39. routines are implemented by looping over the 64-bit
  40. compare-and-exchange routine, so may be potentially less efficient. */
  41. -#endif
  42. -#ifdef __tilegx__
  43. -#include <arch/spr_def.h>
  44. -#else
  45. -#include <asm/unistd.h>
  46. -#endif
  47. +#define __NR_FAST_cmpxchg -1
  48. +#define __NR_FAST_atomic_update -2
  49. +#define __NR_FAST_cmpxchg64 -3
  50. +#endif
  51. /* 32-bit integer compare-and-exchange. */
  52. static __inline __attribute__ ((always_inline))