Opened 12 years ago

Closed 12 years ago

#32161 closed defect (fixed)

gdb @7.3 fails to build with clang

Reported by: gthb (Gunnlaugur Thor Briem) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: clang haspatch Cc: ryandesign (Ryan Carsten Schmidt)
Port: gdb

Description

Salient bit from main.log:

:info:build bfdio.c:580:3: error: argument to 'sizeof' in '__builtin___memset_chk' call is the same expression as the destination; did you mean to dereference it? [-Werror,-Wsizeof-pointer-memaccess]
:info:build   memset (statbuf, 0, sizeof (statbuf));
:info:build   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build /usr/include/secure/_string.h:77:41: note: instantiated from:
:info:build    ? __builtin___memset_chk (dest, val, len, __darwin_obsz0 (dest))     \
:info:build                                         ^
:info:build bfdio.c:580:31: note: instantiated from:
:info:build   memset (statbuf, 0, sizeof (statbuf));
:info:build           ~~~~~~~             ^~~~~~~

The compiler has a point there, and upstream has patched this 6 months ago:

http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/bfdio.c.diff?r1=1.27&r2=1.28&cvsroot=src

Attachments (1)

Portfile-gdb.diff (563 bytes) - added by gthb (Gunnlaugur Thor Briem) 12 years ago.
Use llvm-gcc-4.2 instead of clang to get gdb to build on Lion

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by gthb (Gunnlaugur Thor Briem)

Patching to use *statbuf does get past this, but hits another issue. Seems like gdb is not ready for clang; patching portfile to build with llvm-gcc-4.2 gets gdb to build; will attach.

Changed 12 years ago by gthb (Gunnlaugur Thor Briem)

Attachment: Portfile-gdb.diff added

Use llvm-gcc-4.2 instead of clang to get gdb to build on Lion

comment:2 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: dweber@… removed
Owner: changed from macports-tickets@… to dweber@…

If upstream has already fixed this 6 months ago, then we should update gdb to version 7.3.1 (released 2 months ago).

comment:3 Changed 12 years ago by gthb (Gunnlaugur Thor Briem)

We probably should, yes, but it seems they didn't put this fix on the 7.3.x branch; I tried updating the portfile to 7.3.1 but it still hit this error (and more, when I patched it) so I didn't post the portfile patch.

comment:4 in reply to:  1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Keywords: clang haspatch added
Resolution: fixed
Status: newclosed
Summary: gdb @7.3 fails to build on Lion/XCode 4.2gdb @7.3 fails to build with clang

Replying to gunnlaugur@…:

patching portfile to build with llvm-gcc-4.2 gets gdb to build; will attach.

Thanks. r88366.

comment:5 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: closedreopened

This is an obvious bug in the project (even when built with gcc).

comment:6 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Owner: changed from dweber@… to jeremyhu@…
Status: reopenednew

comment:7 Changed 12 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.