configure.tgt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. # This is the target specific configuration file. This is invoked by the
  2. # autoconf generated configure script. Putting it in a separate shell file
  3. # lets us skip running autoconf when modifying target specific information.
  4. # This file switches on the shell variable ${target}, and sets the
  5. # following shell variables:
  6. # config_path An ordered list of directories to search for
  7. # sources and headers. This is relative to the
  8. # config subdirectory of the source tree.
  9. # XCFLAGS Add extra compile flags to use.
  10. # XLDFLAGS Add extra link flags to use.
  11. # tmake_file A list of machine-description-specific
  12. # makefile fragments.
  13. # Optimize TLS usage by avoiding the overhead of dynamic allocation.
  14. if test $gcc_cv_have_tls = yes ; then
  15. case "${target}" in
  16. *-*-k*bsd*-gnu*)
  17. ;;
  18. *-*-musl*)
  19. ;;
  20. *-*-linux* | *-*-gnu*)
  21. XCFLAGS="${XCFLAGS} -ftls-model=initial-exec -DUSING_INITIAL_EXEC_TLS"
  22. ;;
  23. *-*-rtems*)
  24. XCFLAGS="${XCFLAGS} -ftls-model=local-exec"
  25. ;;
  26. esac
  27. fi
  28. tmake_file=
  29. # Since we require POSIX threads, assume a POSIX system by default.
  30. config_path="posix"
  31. # Check for futex enabled all at once.
  32. if test x$enable_linux_futex = xyes; then
  33. case "${target}" in
  34. aarch64*-*-linux*)
  35. config_path="linux posix"
  36. ;;
  37. alpha*-*-linux*)
  38. config_path="linux/alpha linux posix"
  39. ;;
  40. arm*-*-linux*)
  41. config_path="linux posix"
  42. ;;
  43. ia64*-*-linux*)
  44. config_path="linux/ia64 linux posix"
  45. ;;
  46. loongarch*-*-linux*)
  47. config_path="linux posix"
  48. ;;
  49. mips*-*-linux*)
  50. config_path="linux/mips linux posix"
  51. ;;
  52. powerpc*-*-linux*)
  53. config_path="linux/powerpc linux posix"
  54. ;;
  55. riscv64*-*-linux*)
  56. config_path="linux posix"
  57. ;;
  58. s390*-*-linux*)
  59. config_path="linux/s390 linux posix"
  60. ;;
  61. tile*-*-linux*)
  62. config_path="linux/tile linux posix"
  63. ;;
  64. # Note that bare i386 is not included here. We need cmpxchg.
  65. i[456]86-*-linux* | x86_64-*-linux*)
  66. config_path="linux/x86 linux posix"
  67. cat > conftestx.c <<EOF
  68. #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
  69. #error need -march=i486
  70. #endif
  71. EOF
  72. if ${CC} ${CFLAGS} -E conftestx.c > /dev/null 2>&1; then
  73. :
  74. else
  75. if test "${target_cpu}" = x86_64; then
  76. XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
  77. else
  78. XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
  79. fi
  80. fi
  81. rm -f conftestx.c
  82. ;;
  83. # Note that sparcv7 and sparcv8 is not included here. We need cas.
  84. sparcv9-*-linux* | sparc64-*-linux*)
  85. echo "int i;" > conftestx.c
  86. if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
  87. config_path="linux/sparc linux posix"
  88. case "`/usr/bin/file conftestx.o`" in
  89. *32-bit*)
  90. case " ${CC} ${CFLAGS}" in
  91. *" -mcpu=ultrasparc"*)
  92. ;;
  93. *)
  94. XCFLAGS="${XCFLAGS} -mcpu=v9"
  95. ;;
  96. esac
  97. ;;
  98. esac
  99. fi
  100. rm -f conftestx.c conftestx.o
  101. ;;
  102. esac
  103. fi
  104. # Other system configury
  105. case "${target}" in
  106. *-*-hpux*)
  107. config_path="hpux posix"
  108. case "${target}" in
  109. *-*-hpux11*)
  110. # HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
  111. XLDFLAGS="${XLDFLAGS} -lrt"
  112. ;;
  113. esac
  114. case "${target}" in
  115. hppa[12]*-*-hpux*)
  116. # PA 32 HP-UX needs -frandom-seed for bootstrap compare.
  117. XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed"
  118. ;;
  119. esac
  120. ;;
  121. *-*-mingw32*)
  122. config_path="mingw32 posix"
  123. ;;
  124. *-*-darwin*)
  125. config_path="bsd darwin posix"
  126. ;;
  127. *-*-freebsd*)
  128. # Need to link with -lpthread so libgomp.so is self-contained.
  129. XLDFLAGS="${XLDFLAGS} -lpthread"
  130. ;;
  131. *-*-aix*)
  132. config_path="posix"
  133. # Need to link with -lpthread so libgomp.so is self-contained.
  134. XLDFLAGS="${XLDFLAGS} -lpthread"
  135. # AIX needs -frandom-seed for bootstrap compare.
  136. XCFLAGS="${XCFLAGS} -frandom-seed=\$@"
  137. # Create AIX-style "FAT" libraries.
  138. tmake_file="t-aix"
  139. ;;
  140. nvptx*-*-*)
  141. config_path="nvptx accel"
  142. ;;
  143. *-*-rtems*)
  144. # Use self-contained synchronization objects if provided by Newlib
  145. if test "x$ac_cv_type_struct__Mutex_Control" = xyes ; then
  146. config_path="rtems posix"
  147. fi
  148. ;;
  149. amdgcn*-*-*)
  150. config_path="gcn accel"
  151. #TODO PR101484
  152. XCFLAGS="$XCFLAGS -Wno-error=array-bounds"
  153. ;;
  154. *)
  155. ;;
  156. esac