This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug corefiles/21206] gdb-7.12.1 for arm-rtems4.12 fails to build on FreeBSD 11.0


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

jhb at FreeBSD dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jhb at FreeBSD dot org

--- Comment #4 from jhb at FreeBSD dot org ---
The issue is that the gnulib test checks for max_align_t using the C compiler
but gdb is then compiled as C++.  On FreeBSD 11.0, max_align_t is not defined
in C, but is defined by libc++ when using C++.  Thus, the configure tests
gnulib runs don't find max_align_t, but when compiling with C++ the definition
in libc++'s <stddef> triggers the error.

I've fixed this in FreeBSD upstream by defining a proper max_align_t (the one
in libc++ doesn't match the ABI of the one GCC uses) in both C and C++ in the
base OS <stddef.h>.  Additionally, in the port of gdb in the FreeBSD ports tree
I use a local patch to disable the use of max_align_t from the gnulib header as
a workaround for FreeBSD versions without max_align_t defined in C.

The relevant commits to FreeBSD are:

https://svnweb.freebsd.org/base?view=revision&revision=307756
https://svnweb.freebsd.org/base?view=revision&revision=309274

(both of which are merged to 11 and will be present in 11.1 when it is
released).

The hacky patch I use in the gdb port on FreeBSD is:

https://svnweb.freebsd.org/ports/head/devel/gdb/files/patch-gdb-gnulib-import-stddef.in.h?view=co

(The irony is that neither GDB nor binutils even use max_align_t.)

I chose to fix the issue in this was as I considered the lack of max_align_t
(which C11 requires) when compiling C in FreeBSD the bug.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]