Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#31611 closed defect (fixed)

qt4-mac @4.7.4_0+debug+quartz fails to leave debug symbols in the resulting shared libraries

Reported by: kierans (Kieran Simpson) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: michaelld (Michael Dickens), obin.mf@…, mkae (Marko Käning)
Port: qt4-mac

Description

OSX 10.6.7

XCode 4.0 Build 4A304a

The compiler used was /Developer/usr/bin/llvm-g++-4.2

I noticed when debugging a segfault, even though my binary was linked to the Qt_debug libraries no line numbers or other symbols were available. My investigation found that no -g flags were passed to the Makefile.Debug LFLAGS, thus when the shared library was built the symbols disappeared.

I added the flags (-g -gdwarf-2 like what was in CXXFLAGS) and rebuilt Qt and retried my gdb session. I got symbols, line numbers, code listings, etc.

This problem was first posted to the mailing list (http://lists.macosforge.org/pipermail/macports-users/2011-October/025840.html)

Attachments (1)

qt4-mac-build-log.txt.bz2 (223.2 KB) - added by kierans (Kieran Simpson) 13 years ago.
debug log of qt4-mac +debug build

Download all attachments as: .zip

Change History (10)

comment:1 Changed 13 years ago by michaelld (Michael Dickens)

Can you provide a debug log for the build:

sudo port clean qt4-mac
sudo port -d build qt4-mac +debug > ~/Desktop/qt4-mac-build-log.txt 2>&1
bzip2 ~/Desktop/qt4-mac-build-log.txt

and then attach the compressed logfile to this ticket.

comment:2 Changed 13 years ago by mf2k (Frank Schima)

Keywords: qt4 debug removed
Port: +debug removed

comment:3 Changed 13 years ago by obin.mf@…

Cc: obin.mf@… added

Cc Me!

Changed 13 years ago by kierans (Kieran Simpson)

Attachment: qt4-mac-build-log.txt.bz2 added

debug log of qt4-mac +debug build

comment:4 Changed 13 years ago by michaelld (Michael Dickens)

It looks from the log file like the debug libraries are being formed correctly -- with "-g -gdwarf-2". Can you double-check this ticket's issue? I did just update qt4-mac so-as to use llvm-g++ instead of clang++ -- so maybe that makes a difference? clang has some known issues already, which is why some ports cannot use it.

comment:5 Changed 13 years ago by kierans (Kieran Simpson)

Upgrading to qt4-mac @4.7.4_1+debug+quartz fixed the issue.

One does have to remember to use the -k option when building the debug libraries however so that the source doesn't disappear at the end of the build.

comment:6 Changed 13 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Yes, you do need to -k(eep) the source when using dwarf2 symbols; see < http://doc.qt.nokia.com/stable/debug.html#debug-symbols-and-size >. IIRC, we can enable debug but disable dwarf2 so that you don't need the source any longer, but that solution takes a -lot- longer to produce, results in -much- larger libraries, and also has issues (being created at all) under 10.4 and 10.5. So, your solution is the preferred way until something better comes along.

comment:7 Changed 13 years ago by mkae (Marko Käning)

Cc: mk@… added

Cc Me!

comment:8 in reply to:  5 Changed 13 years ago by macporter90210@…

Replying to kierans777@…:

Upgrading to qt4-mac @4.7.4_1+debug+quartz fixed the issue.

One does have to remember to use the -k option when building the debug libraries however so that the source doesn't disappear at the end of the build.

I am trying to build an unrelated port for debug symbols and have similar issues. Where do you specify the -k option?

comment:9 Changed 13 years ago by michaelld (Michael Dickens)

As in "sudo port -k install qt4-mac". Do "man port" for more info.

Note: See TracTickets for help on using tickets.