0001-sysdeps-riscv-Execute-preconfiure-only-for-risv-targ.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. From 7eac5d7aba0ea86e4393eb75a995423946375dd9 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Tue, 3 Oct 2017 12:37:01 -0700
  4. Subject: [PATCH] sysdeps/riscv: Execute preconfiure only for risv target
  5. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  6. ---
  7. sysdeps/riscv/preconfigure | 93 ++++++++++++++++++++++++----------------------
  8. 1 file changed, 48 insertions(+), 45 deletions(-)
  9. diff --git a/sysdeps/riscv/preconfigure b/sysdeps/riscv/preconfigure
  10. index 43e2a4fac0..da4afb278d 100644
  11. --- a/sysdeps/riscv/preconfigure
  12. +++ b/sysdeps/riscv/preconfigure
  13. @@ -1,50 +1,53 @@
  14. -xlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_xlen \(.*\)/\1/p'`
  15. -flen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_flen \(.*\)/\1/p'`
  16. -float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_float_abi_\([^ ]*\) .*/\1/p'`
  17. +case "$machine" in
  18. +riscv*)
  19. + xlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_xlen \(.*\)/\1/p'`
  20. + flen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_flen \(.*\)/\1/p'`
  21. + float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_float_abi_\([^ ]*\) .*/\1/p'`
  22. -case "$xlen" in
  23. -32 | 64)
  24. - ;;
  25. -*)
  26. - echo "Unable to determine XLEN" >&2
  27. - exit 1
  28. - ;;
  29. -esac
  30. + case "$xlen" in
  31. + 32 | 64)
  32. + ;;
  33. + *)
  34. + echo "Unable to determine XLEN" >&2
  35. + exit 1
  36. + ;;
  37. + esac
  38. -case "$flen" in
  39. -64)
  40. - float_machine=rvd
  41. - ;;
  42. -32)
  43. - float_machine=rvf
  44. - ;;
  45. -"")
  46. - float_machine=
  47. - ;;
  48. -*)
  49. - echo "Unable to determine FLEN" >&2
  50. - exit 1
  51. - ;;
  52. -esac
  53. + case "$flen" in
  54. + 64)
  55. + float_machine=rvd
  56. + ;;
  57. + 32)
  58. + float_machine=rvf
  59. + ;;
  60. + "")
  61. + float_machine=
  62. + ;;
  63. + *)
  64. + echo "Unable to determine FLEN" >&2
  65. + exit 1
  66. + ;;
  67. + esac
  68. -case "$float_abi" in
  69. -soft)
  70. - abi_flen=0
  71. - ;;
  72. -single)
  73. - abi_flen=32
  74. - ;;
  75. -double)
  76. - abi_flen=64
  77. - ;;
  78. -*)
  79. - echo "Unable to determine floating-point ABI" >&2
  80. - exit 1
  81. - ;;
  82. -esac
  83. + case "$float_abi" in
  84. + soft)
  85. + abi_flen=0
  86. + ;;
  87. + single)
  88. + abi_flen=32
  89. + ;;
  90. + double)
  91. + abi_flen=64
  92. + ;;
  93. + *)
  94. + echo "Unable to determine floating-point ABI" >&2
  95. + exit 1
  96. + ;;
  97. + esac
  98. -base_machine=riscv
  99. -machine=riscv/rv$xlen/$float_machine
  100. + base_machine=riscv
  101. + machine=riscv/rv$xlen/$float_machine
  102. -$as_echo "#define RISCV_ABI_XLEN $xlen" >>confdefs.h
  103. -$as_echo "#define RISCV_ABI_FLEN $abi_flen" >>confdefs.h
  104. + $as_echo "#define RISCV_ABI_XLEN $xlen" >>confdefs.h
  105. + $as_echo "#define RISCV_ABI_FLEN $abi_flen" >>confdefs.h
  106. +esac
  107. --
  108. 2.14.2