Error when compiling gdb on Mac OSX

1.2k Views Asked by At

I am attempting to compile GDB 7.4 (the version that is on the gdb website) under Mac OSX and I receive the following error:

mach-o.c: In function 'bfd_mach_o_header_p': mach-o.c.2978: warning: 'header.reserved' may be used uninitialized in this function

While trying to figure out the cause of this problem I came across the following article:

http://www.puredarwin.org/blockers

which claims that the cause of this problem is that the normal version of gdb doesn't work on the Darwin OS (when I do ./configure the "system type" comes up as i386-apple-darwin9.8.0). Is this corret, and if so, where do I get the "Apple version" which does work on Mac OSX?

2

There are 2 best solutions below

4
On

Apple puts a lot of custom junk in gdb (or did, they're probably not going to spend a lot of time on it, instead focusing on lldb). So out-of-the-box gdb doesn't work on osx.

You can grab their junky old version of gdb from http://opensource.apple.com/

0
On

GDB developers certainly try to make FSF version of GDB work on Mac OSX.

But since none of them actively use Mac OSX, breakage creeps in.

You should report the build problem here.

Also, adding -Wno-error to your CFLAGS should get you past that first hurdle (though there could be many more ahead).