summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2020-03-06 15:01:36 -0800
committerDan Albert <danalbert@google.com>2020-03-06 15:20:31 -0800
commitdb669320a80553c85a1e7f860f158a21ae53d02b (patch)
tree12bf3711129328292c1e69841e215edb0d435b4b
parent429959397e24bdf23aad6a51abada533986a7372 (diff)
downloadbinutils-db669320a80553c85a1e7f860f158a21ae53d02b.tar.gz
Attempt to fix build on macOS 10.10.
GCC (our GCC, anyway) always prints a warning to stderr on newer versions of macOS. Disable stderr checking in AC_CHECK_HEADERS for Mac. Test: autoconf, treehugger Bug: None Change-Id: If22e92928f8f9fa4abebff5a4640fc118e293088
-rwxr-xr-xbinutils-2.27/libiberty/configure16
-rw-r--r--binutils-2.27/libiberty/configure.ac18
2 files changed, 33 insertions, 1 deletions
diff --git a/binutils-2.27/libiberty/configure b/binutils-2.27/libiberty/configure
index bde78ffd..a5ca71b2 100755
--- a/binutils-2.27/libiberty/configure
+++ b/binutils-2.27/libiberty/configure
@@ -4386,8 +4386,24 @@ rm -rf conftest*
fi
fi
+# Android edit:
+# This behavior is disabled when building for Mac because we still use GCC to
+# build binutils, and the GCC is old enough that it will always emit a warning
+# about not being able to understand kern.osversion. The warning does not seem
+# to prevent the compiler from working.
+#
+# This change was originally made to libiberty in
+# https://gcc.gnu.org/ml/gcc-patches/2003-09/msg01666.html. It claims the patch
+# was made to fix configure on FreeBSD, which we don't target, so presumably we
+# don't need the patch.
+case "${host_os}" in
+ darwin*)
+ ;;
+ *)
ac_c_preproc_warn_flag=yes
+ ;;
+esac
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
diff --git a/binutils-2.27/libiberty/configure.ac b/binutils-2.27/libiberty/configure.ac
index 9d3f2988..0f540151 100644
--- a/binutils-2.27/libiberty/configure.ac
+++ b/binutils-2.27/libiberty/configure.ac
@@ -157,7 +157,23 @@ GCC_NO_EXECUTABLES
AC_PROG_CC
AC_GNU_SOURCE
AC_SYS_LARGEFILE
-AC_PROG_CPP_WERROR
+# Android edit:
+# This behavior is disabled when building for Mac because we still use GCC to
+# build binutils, and the GCC is old enough that it will always emit a warning
+# about not being able to understand kern.osversion. The warning does not seem
+# to prevent the compiler from working.
+#
+# This change was originally made to libiberty in
+# https://gcc.gnu.org/ml/gcc-patches/2003-09/msg01666.html. It claims the patch
+# was made to fix configure on FreeBSD, which we don't target, so presumably we
+# don't need the patch.
+case "${host_os}" in
+ darwin*)
+ ;;
+ *)
+ AC_PROG_CPP_WERROR
+ ;;
+esac
ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wc++-compat \
-Wstrict-prototypes], [ac_libiberty_warn_cflags])