public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26949] New: ELF target support seems broken on macOS 11
@ 2020-11-26 10:00 eblot.ml at gmail dot com
  2020-11-26 13:15 ` [Bug gdb/26949] " eblot.ml at gmail dot com
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: eblot.ml at gmail dot com @ 2020-11-26 10:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26949

            Bug ID: 26949
           Summary: ELF target support seems broken on macOS 11
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: eblot.ml at gmail dot com
  Target Milestone: ---

On macOS 11 (Big Sur), when GDB is built with an ELF target, for example
--target=riscv64-unknown-elf, GDB builds successfully.

At runtime, when an ELF file is loaded in GDB, the following message is raised:

I'm sorry, Dave, I can't do that.  Symbol format `elf32-littleriscv' unknown.

It appears that despite the successful build, GDB does not include ELF support,
as
gdb/config.h contains `#undef HAVE_ELF`

The root cause seems to be the gdb/configure script that fails to valide BFD
ELF support, around line 16832 on GDB 10.1, although the same issue arise with
the previous GDB 9.2 release.

The generated conftest.c test fails as strncmp function is used, but <string.h>
has not been included. I have not checked why the test file works on Linux
hosts and not on macOS hosts.

Anyway, adding <string.h> to acinclude.m4 fixes the trouble on macOS, such as
with:

--- a/gdb/acinclude.m4  2020-11-26 10:10:52.000000000 +0100
+++ b/gdb/acinclude.m4  2020-11-26 10:12:25.000000000 +0100
@@ -362,6 +362,7 @@
   AC_CACHE_CHECK([$1], [$2],
   [AC_TRY_LINK(
   [#include <stdlib.h>
+  #include <string.h>
   #include "bfd.h"
   #include "$4"
   ],

although I have no idea if this is the proper way to fix it. At least GDB keeps
building in macOS 11, and the resulting gdb application is able to load ELF
files.

As a side note, is it an expected behaviour that building for an explicit ELF
target completes successfully although ELF support cannot be included?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-02-23  7:17 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 10:00 [Bug gdb/26949] New: ELF target support seems broken on macOS 11 eblot.ml at gmail dot com
2020-11-26 13:15 ` [Bug gdb/26949] " eblot.ml at gmail dot com
2020-11-27 23:29 ` wilson at gcc dot gnu.org
2021-01-05 11:17 ` big_deady2 at web dot de
2021-01-05 16:00 ` simark at simark dot ca
2021-01-06 11:10 ` eblot.ml at gmail dot com
2021-02-09  1:54 ` sify21 at 163 dot com
2021-02-18 13:59 ` keller at metrolab dot com
2021-02-18 15:35 ` simark at simark dot ca
2021-02-22 12:46 ` keller at metrolab dot com
2021-02-22 16:40 ` simark at simark dot ca
2021-02-22 18:20 ` eblot.ml at gmail dot com
2021-02-22 18:47 ` keller at metrolab dot com
2021-02-22 18:48 ` keller at metrolab dot com
2021-02-22 20:03 ` simark at simark dot ca
2021-02-22 22:21 ` keller at metrolab dot com
2021-02-23  1:42 ` simark at simark dot ca
2021-02-23  7:17 ` keller at metrolab dot com

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