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.

96 lines
2.9 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. --- a/Configure
  19. +++ b/Configure
  20. @@ -4689,7 +4689,7 @@ else
  21. fi
  22. $rm -f try try.*
  23. case "$gccversion" in
  24. -1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
  25. +1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
  26. esac
  27. case "$gccversion" in
  28. '') gccosandvers='' ;;
  29. @@ -4729,7 +4729,7 @@ esac
  30. # gcc 3.* complain about adding -Idirectories that they already know about,
  31. # so we will take those off from locincpth.
  32. case "$gccversion" in
  33. -3*)
  34. +3.*)
  35. echo "main(){}">try.c
  36. for incdir in $locincpth; do
  37. warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
  38. @@ -5455,13 +5455,13 @@ fi
  39. case "$hint" in
  40. default|recommended)
  41. case "$gccversion" in
  42. - 1*) dflt="$dflt -fpcc-struct-return" ;;
  43. + 1.*) dflt="$dflt -fpcc-struct-return" ;;
  44. esac
  45. case "$optimize:$DEBUGGING" in
  46. *-g*:old) dflt="$dflt -DDEBUGGING";;
  47. esac
  48. case "$gccversion" in
  49. - 2*) if $test -d /etc/conf/kconfig.d &&
  50. + 2.*) if $test -d /etc/conf/kconfig.d &&
  51. $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
  52. then
  53. # Interactive Systems (ISC) POSIX mode.
  54. @@ -5470,7 +5470,7 @@ default|recommended)
  55. ;;
  56. esac
  57. case "$gccversion" in
  58. - 1*) ;;
  59. + 1.*) ;;
  60. 2.[0-8]*) ;;
  61. ?*) set strict-aliasing -fno-strict-aliasing
  62. eval $checkccflag
  63. @@ -5588,7 +5588,7 @@ case "$cppflags" in
  64. ;;
  65. esac
  66. case "$gccversion" in
  67. -1*) cppflags="$cppflags -D__GNUC__"
  68. +1.*) cppflags="$cppflags -D__GNUC__"
  69. esac
  70. case "$mips_type" in
  71. '');;
  72. @@ -22957,7 +22957,7 @@ fi
  73. : add -D_FORTIFY_SOURCE if feasible and not already there
  74. case "$gccversion" in
  75. -[4567].*) case "$optimize$ccflags" in
  76. +[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
  77. *-O*) case "$ccflags$cppsymbols" in
  78. *_FORTIFY_SOURCE=*) # Don't add it again.
  79. echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
  80. --- a/cflags.SH
  81. +++ b/cflags.SH
  82. @@ -156,7 +156,7 @@ esac
  83. case "$gccversion" in
  84. '') ;;
  85. -[12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
  86. +[12].*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
  87. Intel*) ;; # # Is that you, Intel C++?
  88. #
  89. # NOTE 1: the -std=c89 without -pedantic is a bit pointless.