Commit da99a7f5 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo Committed by Erik de Castro Lopo
Browse files

Darwin: Detect broken NM program at configure time

Some recent versions of XCode ship a broken version of `nm`. Detect this
at configure time, and error out with a suggestion to rerun configure
with a `--with-nm=...` argument.

Test Plan: Test of Linux and OS X

Reviewers: carter, hvr, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2425
parent 3551e622
...@@ -483,6 +483,32 @@ AC_SUBST([LdCmd]) ...@@ -483,6 +483,32 @@ AC_SUBST([LdCmd])
dnl ** Which nm to use? dnl ** Which nm to use?
dnl -------------------------------------------------------------- dnl --------------------------------------------------------------
FP_ARG_WITH_PATH_GNU_PROG([NM], [nm], [nm]) FP_ARG_WITH_PATH_GNU_PROG([NM], [nm], [nm])
if test "$TargetOS_CPP" = "darwin"
then
AC_MSG_CHECKING(whether nm program is broken)
# Some versions of XCode ship a broken version of `nm`. Detect and work
# around this issue. See : https://ghc.haskell.org/trac/ghc/ticket/11744
nmver=$(${NM} --version | grep version | sed 's/ //g')
case "$nmver" in
LLVMversion7.3.0|LLVMversion7.3.1)
AC_MSG_RESULT(yes)
echo "The detected nm program is broken."
echo
echo "See: https://ghc.haskell.org/trac/ghc/ticket/11744"
echo
echo "Try re-running configure with:"
echo
echo ' ./configure --with-nm=$(xcrun --find nm-classic)'
echo
exit 1
;;
*)
AC_MSG_RESULT(no)
;;
esac
fi
NmCmd="$NM" NmCmd="$NM"
AC_SUBST([NmCmd]) AC_SUBST([NmCmd])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment