public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4 REVIEW] libtool and libctf fixes for Solaris 11
@ 2021-06-25 16:13 Nick Alcock
  2021-06-25 16:13 ` [PATCH 1/4] libtool.m4: augment symcode " Nick Alcock
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Nick Alcock @ 2021-06-25 16:13 UTC (permalink / raw)
  To: binutils; +Cc: gcc-patches

There are three intertwined bugs here, two in libtool.m4, one in libctf.
The underlying "problem" is that libctf tries to version its symbols: if
it can't use a GNU version script it tries to hide unnecessary symbols
using Libtool's --export-symbols-regex flag... and that flag has kinda
rusted.

Firstly, it relies on running nm and knowing what the symbol type codes
it emits (in BSD mode) mean: Solaris 11 has gained 'C' for common
symbols, like GNU nm, but libtool.m4 was never updated to know about
that, so the test failed.

Secondly, it relies on knowing how to switch nm into BSD mode, which it
does by nm'ing a bunch of candidate nms with various flags: but it nms
/dev/null and has not-very-good handling of nms that emit errors if you
do that.

Thirdly, libtool's nm option scanning is entirely suppressed if NM is
set in the environment, on the grounds that the user must have set it --
but libtool already augments other things set in the environment with
extra flags if needed, and the user can hardly be expected to know that
Libtool needs 'nm -p' on Solaris, not just nm. Worse yet, Cygnus
configure sets NM unconditionally, stopping the test dead.  Fixed by
checking flags even if the user overrides nm, but checking the specific
nm they requested.

The first two patches in this series need review because, well, libtool
upstream is dead enough that I don't know if I can even submit it there,
but it should probably go to GCC and binutils-gdb. I have tested it on
Solaris 11.3, Solaris 11.4, FreeBSD, (x86-64 and SPARC) Linux, and
Cygwin, which should be enough coverage, I hope.  libtool upstream has
diverged in this area and the patch would need redoing in any case
(though the conflicts look quite minor, I don't have time right now and
doing that wouldn't help fix any of the reporter's problems in any case).

(The latter two patches, sent to binutils@ alone, enable symbol
versioning on Solaris 11.4, which provides a --version-script flag
almost but not quite compatible with GNU ld's, and regenerate most
relevant configure scripts, skipping only sim/ because it's in a ferment
of change right now.)

Cc: gcc-patches@gcc.gnu.org

Nick Alcock (4):
  libtool.m4: augment symcode for Solaris 11
  libtool.m4: fix nm BSD flag detection
  libctf: try several possibilities for linker versioning flags
  configure: regenerate in all projects that use libtool.m4

 bfd/configure       |  91 ++++++++++++-------------
 binutils/configure  |  91 ++++++++++++-------------
 gas/configure       |  91 ++++++++++++-------------
 gprof/configure     |  91 ++++++++++++-------------
 ld/configure        |  91 ++++++++++++-------------
 libctf/Makefile.am  |   5 +-
 libctf/Makefile.in  |   6 +-
 libctf/configure    | 157 ++++++++++++++++++++++++++++++--------------
 libctf/configure.ac |  46 ++++++++++++-
 libctf/libctf.ver   |  10 ++-
 libtool.m4          |  90 ++++++++++++-------------
 opcodes/configure   |  91 ++++++++++++-------------
 zlib/configure      |  91 ++++++++++++-------------
 13 files changed, 531 insertions(+), 420 deletions(-)

-- 
2.32.0.255.gd9b1d14a2a


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-09-09 12:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 16:13 [PATCH 0/4 REVIEW] libtool and libctf fixes for Solaris 11 Nick Alcock
2021-06-25 16:13 ` [PATCH 1/4] libtool.m4: augment symcode " Nick Alcock
2021-06-25 16:13 ` [PATCH 2/4 REVIEW] libtool.m4: fix nm BSD flag detection Nick Alcock
2021-07-06 19:37   ` Nick Alcock
2021-07-07 14:39     ` Nick Clifton
2021-07-07 19:03       ` Nick Alcock
2021-07-21  8:22         ` Alan Modra
2021-09-09 12:39           ` Nick Alcock
2021-06-25 16:13 ` [PATCH 3/4] libctf: try several possibilities for linker versioning flags Nick Alcock
2021-06-25 16:13 ` [PATCH 4/4] configure: regenerate in all projects that use libtool.m4 Nick Alcock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).