[llvm-dev] Enabling debug information for debug only

77 views
Skip to first unread message

John Paul Adrian Glaubitz via llvm-dev

unread,
Jul 6, 2020, 6:27:39 AM7/6/20
to llvm-dev
Hello!

I would like to debug Clang but avoid having to build LLVM with debug symbols
enabled due to the size of the debug build which causes problems on the target
system where I want to debug due to disk constraints.

Is it possible to build LLVM and Clang but enable debug symbols for Clang only?

If yes, how?

Adrian

PS: I'm only receiving digests on this list, so please keep me CC'ed.

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glau...@debian.org
`. `' Freie Universitaet Berlin - glau...@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Alexey Zhikhartsev via llvm-dev

unread,
Jul 6, 2020, 10:14:10 AM7/6/20
to John Paul Adrian Glaubitz, llvm-dev

John Paul Adrian Glaubitz via llvm-dev

unread,
Jul 6, 2020, 10:34:31 AM7/6/20
to Alexey Zhikhartsev, llvm-dev
Hi Alexey!

On 7/6/20 4:13 PM, Alexey Zhikhartsev wrote:
> This should help:
> http://lists.llvm.org/pipermail/llvm-dev/2019-August/134606.html

Thanks. Exactly what I was looking for.

Kind Regards,
Adrian

Zachary Turner via llvm-dev

unread,
Jul 6, 2020, 11:21:12 AM7/6/20
to John Paul Adrian Glaubitz, llvm-dev
Another solution is to build the entire program with debug info, then write a small shell sscript which crawls your tree using objcopy or something to strip out the debug symbols, then re-run your build step.  It should see the object files as not being out of date since they are newer than the source files, but the final executable being out of date since the object files are newer than the executable.  So it should simply re-link with debug info stripped out of whichever files you ran objcopy on.  This has the nice property that you don't have to make local changes to cmake, and you can keep this script somewhere in your local repository.
Reply all
Reply to author
Forward
0 new messages