You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.0 KiB

  1. From 6bd6308fcea3541e505651bf8e8127a4a03d22cd Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
  3. Date: Tue, 12 Nov 2019 09:19:18 +0100
  4. Subject: [PATCH] Adapt Configure to GCC version 10
  5. I got a notice from Jeff Law <law@redhat.com>:
  6. Your particular package fails its testsuite. This was ultimately
  7. tracked down to a Configure problem. The perl configure script treated
  8. gcc-10 as gcc-1 and turned on -fpcc-struct-return. This is an ABI
  9. changing flag and caused Perl to not be able to interact properly with
  10. the dbm libraries on the system leading to a segfault.
  11. His proposed patch corrected only this one instance of the version
  12. mismatch. Reading the Configure script revealed more issues. This
  13. patch fixes all of them I found.
  14. ---
  15. Configure | 14 +++++++-------
  16. cflags.SH | 2 +-
  17. 2 files changed, 8 insertions(+), 8 deletions(-)
  18. diff --git a/Configure b/Configure
  19. index fad1c9f2b1..706c0b64ed 100755
  20. --- a/Configure
  21. +++ b/Configure
  22. @@ -4701,7 +4701,7 @@ else
  23. fi
  24. $rm -f try try.*
  25. case "$gccversion" in
  26. -1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
  27. +1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
  28. esac
  29. case "$gccversion" in
  30. '') gccosandvers='' ;;
  31. @@ -4741,7 +4741,7 @@ esac
  32. # gcc 3.* complain about adding -Idirectories that they already know about,
  33. # so we will take those off from locincpth.
  34. case "$gccversion" in
  35. -3*)
  36. +3.*)
  37. echo "main(){}">try.c
  38. for incdir in $locincpth; do
  39. warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
  40. @@ -5467,13 +5467,13 @@ fi
  41. case "$hint" in
  42. default|recommended)
  43. case "$gccversion" in
  44. - 1*) dflt="$dflt -fpcc-struct-return" ;;
  45. + 1.*) dflt="$dflt -fpcc-struct-return" ;;
  46. esac
  47. case "$optimize:$DEBUGGING" in
  48. *-g*:old) dflt="$dflt -DDEBUGGING";;
  49. esac
  50. case "$gccversion" in
  51. - 2*) if $test -d /etc/conf/kconfig.d &&
  52. + 2.*) if $test -d /etc/conf/kconfig.d &&
  53. $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
  54. then
  55. # Interactive Systems (ISC) POSIX mode.
  56. @@ -5482,7 +5482,7 @@ default|recommended)
  57. ;;
  58. esac
  59. case "$gccversion" in
  60. - 1*) ;;
  61. + 1.*) ;;
  62. 2.[0-8]*) ;;
  63. ?*) set strict-aliasing -fno-strict-aliasing
  64. eval $checkccflag
  65. @@ -5600,7 +5600,7 @@ case "$cppflags" in
  66. ;;
  67. esac
  68. case "$gccversion" in
  69. -1*) cppflags="$cppflags -D__GNUC__"
  70. +1.*) cppflags="$cppflags -D__GNUC__"
  71. esac
  72. case "$mips_type" in
  73. '');;
  74. @@ -23103,7 +23103,7 @@ fi
  75. : add -D_FORTIFY_SOURCE if feasible and not already there
  76. case "$gccversion" in
  77. -[4567].*) case "$optimize$ccflags" in
  78. +[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
  79. *-O*) case "$ccflags$cppsymbols" in
  80. *_FORTIFY_SOURCE=*) # Don't add it again.
  81. echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
  82. diff --git a/cflags.SH b/cflags.SH
  83. index e60742fed1..f1bcd6c38e 100755
  84. --- a/cflags.SH
  85. +++ b/cflags.SH
  86. @@ -156,7 +156,7 @@ esac
  87. case "$gccversion" in
  88. '') ;;
  89. -[12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
  90. +[12].*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
  91. Intel*) ;; # # Is that you, Intel C++?
  92. #
  93. # NOTE 1: the -std=c89 without -pedantic is a bit pointless.
  94. --
  95. 2.17.1