Avoid libtool 'nm' errors 45/12945/3
authorAndrew Deason <adeason@sinenomine.net>
Wed, 7 Mar 2018 19:28:34 +0000 (13:28 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 9 Mar 2018 23:56:52 +0000 (18:56 -0500)
commit3e9ea6107973ccc4fa3d405f5b5d76666bfd624f
treeff875811a0be245acfe2fe18b1c142656488b0ba
parent5a8b68153124c3a9224f0b6993df9de9c6c54541
Avoid libtool 'nm' errors

Starting around Solaris 11.3, '/usr/bin/nm -p' starts reporting some
symbols with the 'C' code. libtool cannot handle this (libtool bug
 #22373), which causes global_symbol_pipe in the generated libtool
script to be empty. This causes a rather confusing error when we go to
actually use libtool to link something ("syntax error near unexpected
token '|'"; see libtool bug #20947), and prevents the build from
continuing.

Address this in two ways:

For all Solaris 11 builds, default to /usr/sfw/bin/gnm over
/usr/bin/nm. This avoids any interop issues with libtool and nm, since
libtool of course works very well with GNU tooling.

In addition, try to catch any nm-related errors with libtool at
configure time, to provide a more helpful error message.

To implement these changes, create a wrapper around LT_INIT, called
AFS_LT_INIT.

Change-Id: I7d47c17f9d9401dc5dcc9676279bf1e4f53554c4
Reviewed-on: https://gerrit.openafs.org/12945
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
configure.ac
src/cf/afs-libtool.m4 [new file with mode: 0644]