armhf.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. diff -Nur gcc-4.7.2.orig/gcc/config/arm/linux-eabi.h gcc-4.7.2/gcc/config/arm/linux-eabi.h
  2. --- gcc-4.7.2.orig/gcc/config/arm/linux-eabi.h 2011-11-02 16:03:19.000000000 +0100
  3. +++ gcc-4.7.2/gcc/config/arm/linux-eabi.h 2013-05-03 16:38:21.000000000 +0200
  4. @@ -34,7 +34,21 @@
  5. /* We default to a soft-float ABI so that binaries can run on all
  6. target hardware. */
  7. #undef TARGET_DEFAULT_FLOAT_ABI
  8. +#ifdef TARGET_CONFIGURED_FLOAT_ABI
  9. +#if TARGET_CONFIGURED_FLOAT_ABI == 2
  10. +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
  11. +#define MULTILIB_DEFAULT_FLOAT_ABI "mfloat-abi=hard"
  12. +#elif TARGET_CONFIGURED_FLOAT_ABI == 1
  13. +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFTFP
  14. +#define MULTILIB_DEFAULT_FLOAT_ABI "mfloat-abi=softfp"
  15. +#else
  16. #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
  17. +#define MULTILIB_DEFAULT_FLOAT_ABI "mfloat-abi=soft"
  18. +#endif
  19. +#else
  20. +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
  21. +#define MULTILIB_DEFAULT_FLOAT_ABI "mfloat-abi=soft"
  22. +#endif
  23. /* We default to the "aapcs-linux" ABI so that enums are int-sized by
  24. default. */
  25. @@ -62,7 +76,45 @@
  26. /* Use ld-linux.so.3 so that it will be possible to run "classic"
  27. GNU/Linux binaries on an EABI system. */
  28. #undef GLIBC_DYNAMIC_LINKER
  29. -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
  30. +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
  31. +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
  32. +#ifdef TARGET_CONFIGURED_FLOAT_ABI
  33. +#if TARGET_CONFIGURED_FLOAT_ABI == 2
  34. +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_HARD_FLOAT
  35. +#else
  36. +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
  37. +#endif
  38. +#else
  39. +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
  40. +#endif
  41. +
  42. +#define GLIBC_DYNAMIC_LINKER \
  43. + "%{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \
  44. + %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
  45. + %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
  46. +
  47. +/* Set the multilib defaults according the configuration, needed to
  48. + let gcc -print-multi-dir do the right thing. */
  49. +
  50. +#if TARGET_BIG_ENDIAN_DEFAULT
  51. +#define MULTILIB_DEFAULT_ENDIAN "mbig-endian"
  52. +#else
  53. +#define MULTILIB_DEFAULT_ENDIAN "mlittle-endian"
  54. +#endif
  55. +
  56. +#ifndef TARGET_CONFIGURED_THUMB_MODE
  57. +#define MULTILIB_DEFAULT_MODE "marm"
  58. +#elif TARGET_CONFIGURED_THUMB_MODE == 1
  59. +#define MULTILIB_DEFAULT_MODE "mthumb"
  60. +#else
  61. +#define MULTILIB_DEFAULT_MODE "marm"
  62. +#endif
  63. +
  64. +#undef MULTILIB_DEFAULTS
  65. +#define MULTILIB_DEFAULTS \
  66. + { MULTILIB_DEFAULT_MODE, MULTILIB_DEFAULT_ENDIAN, \
  67. + MULTILIB_DEFAULT_FLOAT_ABI, "mno-thumb-interwork" }
  68. +
  69. /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
  70. use the GNU/Linux version, not the generic BPABI version. */