Darwin: Detect broken NM program at configure time
ClosedPublic

Authored by erikd on Jul 25 2016, 5:45 AM.

Details

Summary

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=....

Test Plan

Test of Linux and OS X

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
erikd updated this revision to Diff 8322.Jul 25 2016, 5:45 AM
erikd retitled this revision from to Detect and work around broken NM program.
erikd updated this object.
erikd edited the test plan for this revision. (Show Details)
erikd added reviewers: hvr, bgamari, carter.
hvr requested changes to this revision.EditedJul 25 2016, 6:26 AM
hvr edited edge metadata.

Unfortunately I have to strongly disagree with this workaround.

Afaik, this goes against the principles of Autoconf-based systems. Especially, ./configure must honour the choice the user made about the tool to use. If the user passes ./configure a bad nm tool to use, the best you can do is tell the user that he needs to provide a better one. In any case, you're certainly are not supposed to start searching for an alternative one on your own or disregarding the too passed via --with-nm to configure. Also, this is the kind of workarounds I'm trying to rid our Autoconf from, rather than introducing yet more.

See also https://github.com/snowleopard/hadrian/pull/276#issuecomment-234848057 where I commented about the same thing earlier today

This revision now requires changes to proceed.Jul 25 2016, 6:26 AM
erikd added a comment.Jul 25 2016, 7:22 AM

Let me explain the problem I'm trying to address.

I rarely build on OS X, but every time I do, I forget about this issue (because it doesn't happen in Linux) and when I come back to the machine hoping to completed build I find the build has failed in the early stages with a message that I have to run configure again. That is a *huge* pain in the neck.

@hvr Do you have a suggestion for a better way to address this isssue?

carter edited edge metadata.Jul 27 2016, 4:11 PM

Something needs to be done to address this, because otherwise its making build from source for new contributors on OSX even more second class than it already sometimes is :)

point being: something needs to be done so that handling this corner case, while it exists, isn't a folklore / googling around issue. and its not someting that most folks even are aware of!

erikd updated this revision to Diff 8356.Jul 30 2016, 5:52 AM
erikd edited edge metadata.

Be more autoconf like.

erikd retitled this revision from Detect and work around broken NM program to Darwin: Detect broken NM program at configure time.Jul 30 2016, 5:53 AM
erikd updated this object.
erikd edited edge metadata.
erikd updated this revision to Diff 8357.Jul 30 2016, 5:55 AM
erikd updated this object.

Whitespace

bgamari accepted this revision.Aug 4 2016, 4:28 PM
bgamari edited edge metadata.

This looks fine to me. @hvr, any objections?

This revision was automatically updated to reflect the committed changes.