[llvm-commits] [llvm] r82775 - in /llvm/trunk: Makefile.rules docs/MakefileGuide.html

Jeffrey Yasskin jyasskin at google.com
Fri Sep 25 09:46:09 PDT 2009


Author: jyasskin
Date: Fri Sep 25 11:46:09 2009
New Revision: 82775

URL: http://llvm.org/viewvc/llvm-project?rev=82775&view=rev
Log:
This patch causes the --enable-debug-runtime configure flag and the
DEBUG_RUNTIME Makefile variable to pass -g to gcc when building LLVM's objects.
Without this, it's very hard to debug crashes that happen in Release-Asserts
mode but not Debug mode.


Modified:
    llvm/trunk/Makefile.rules
    llvm/trunk/docs/MakefileGuide.html

Modified: llvm/trunk/Makefile.rules
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=82775&r1=82774&r2=82775&view=diff

==============================================================================
--- llvm/trunk/Makefile.rules (original)
+++ llvm/trunk/Makefile.rules Fri Sep 25 11:46:09 2009
@@ -313,6 +313,13 @@
   CXX.Flags += $(OPTIMIZE_OPTION) $(OmitFramePointer)
   C.Flags   += $(OPTIMIZE_OPTION) $(OmitFramePointer)
   LD.Flags  += $(OPTIMIZE_OPTION)
+  ifdef DEBUG_RUNTIME
+    BuildMode := $(BuildMode)+Debug
+    CXX.Flags += -g
+    C.Flags   += -g
+    LD.Flags  += -g
+    KEEP_SYMBOLS := 1
+  endif
 else
   BuildMode := Debug
   CXX.Flags += -g

Modified: llvm/trunk/docs/MakefileGuide.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/MakefileGuide.html?rev=82775&r1=82774&r2=82775&view=diff

==============================================================================
--- llvm/trunk/docs/MakefileGuide.html (original)
+++ llvm/trunk/docs/MakefileGuide.html Fri Sep 25 11:46:09 2009
@@ -626,6 +626,11 @@
     <dd>If set to any value, causes a bitcode library (.bc) to be built.</dd>
     <dt><a name="CONFIG_FILES"><tt>CONFIG_FILES</tt></a></dt>
     <dd>Specifies a set of configuration files to be installed.</dd>
+    <dt><a name="DEBUG_RUNTIME"><tt>DEBUG_RUNTIME</tt></a></dt>
+    <dd>If set to any value, causes the build to include debugging
+    symbols even in optimized objects, libraries and executables. This
+    alters the flags specified to the compilers and linkers. Debugging
+    isn't fun in an optimized build, but it is possible.</dd>
     <dt><a name="DIRS"><tt>DIRS</tt></a></dt>
     <dd>Specifies a set of directories, usually children of the current
     directory, that should also be made using the same goal. These directories 





More information about the llvm-commits mailing list