0018-disable-warning-as-error-when-building-gcc.patch 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 67a1a6ac1667cf6968b8007888654b4b940ea820 Mon Sep 17 00:00:00 2001
  2. From: Leah Rowe <leah@libreboot.org>
  3. Date: Mon, 15 Jan 2024 22:39:12 +0000
  4. Subject: [PATCH 2/2] disable warning-as-error when building gcc
  5. needed, because newer host gcc will treat warnings as errors,
  6. and some of this older code will trip on the newer handling.
  7. Signed-off-by: Leah Rowe <info@minifree.org>
  8. ---
  9. util/crossgcc/buildgcc | 20 ++++++++++----------
  10. 1 file changed, 10 insertions(+), 10 deletions(-)
  11. diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
  12. index dd32ee6ba8..5e6a3310a7 100755
  13. --- a/util/crossgcc/buildgcc
  14. +++ b/util/crossgcc/buildgcc
  15. @@ -609,7 +609,7 @@ set_hostcflags_from_gmp() {
  16. # Now set CFLAGS to match GMP CFLAGS but strip out -pedantic
  17. # as GCC 4.6.x fails if it's there.
  18. HOSTCFLAGS="$(grep __GMP_CFLAGS "$DESTDIR$TARGETDIR/include/gmp.h" |cut -d\" -f2 |\
  19. - sed s,-pedantic,,)"
  20. + sed s,-pedantic,,) -Wno-error -w"
  21. export HOSTCFLAGS
  22. }
  23. @@ -698,13 +698,13 @@ build_BINUTILS() {
  24. bootstrap_GCC() {
  25. # shellcheck disable=SC2086
  26. - CC="$(hostcc host)" CXX="$(hostcxx host)" \
  27. - CFLAGS="$HOSTCFLAGS" \
  28. - CFLAGS_FOR_BUILD="$HOSTCFLAGS" \
  29. - CFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC" \
  30. - CXXFLAGS="$HOSTCFLAGS" \
  31. - CXXFLAGS_FOR_BUILD="$HOSTCFLAGS" \
  32. - CXXFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC" \
  33. + CC="$(hostcc host) -Wno-error -w" CXX="$(hostcxx host) -Wno-error -w" \
  34. + CFLAGS="$HOSTCFLAGS -Wno-error -w" \
  35. + CFLAGS_FOR_BUILD="$HOSTCFLAGS -Wno-error -w" \
  36. + CFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC -Wno-error -w" \
  37. + CXXFLAGS="$HOSTCFLAGS -Wno-error -w" \
  38. + CXXFLAGS_FOR_BUILD="$HOSTCFLAGS -Wno-error -w" \
  39. + CXXFLAGS_FOR_TARGET="$HOSTCFLAGS -fPIC -Wno-error -w" \
  40. ../gcc-${GCC_VERSION}/configure \
  41. --prefix="$TARGETDIR" --libexecdir="$TARGETDIR/lib" \
  42. --enable-bootstrap \
  43. @@ -1021,7 +1021,7 @@ if [ -n "$CC" ]; then
  44. fi
  45. else
  46. if searchtool gnatgcc "Free Software Foundation" nofail > /dev/null; then
  47. - CC=gnatgcc
  48. + CC="gnatgcc"
  49. elif searchtool gcc "Free Software Foundation" nofail > /dev/null; then
  50. CC=gcc
  51. else
  52. @@ -1143,7 +1143,7 @@ if ada_requested; then
  53. fi
  54. fi # GCC
  55. -export HOSTCFLAGS="-Os"
  56. +export HOSTCFLAGS="-Os -Wno-error -w"
  57. if have_hostcflags_from_gmp; then
  58. set_hostcflags_from_gmp
  59. fi
  60. --
  61. 2.39.2