<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On Sep 20, 2007, at 2:52 AM, Bill Wendling wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><div><div>On Sep 19, 2007, at 5:41 PM, Devang Patel wrote:</div><blockquote type="cite"><div><div>On Sep 19, 2007, at 4:48 PM, Bill Wendling wrote:</div><br></div><div>In llvm-backend.cpp  :</div><div><br></div><div><div><font class="Apple-style-span" face="Courier">1086</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">     </font></span><font class="Apple-style-span" face="Courier">        if (GV->getName() != Name) {</font></div><div><font class="Apple-style-span" face="Courier">1087</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">       </font></span><font class="Apple-style-span" face="Courier">          Function *F = TheModule->getFunction(Name);</font></div><div><font class="Apple-style-span" face="Courier">1088</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier"> </font></span><font class="Apple-style-span" face="Courier">          assert(F && F->isDeclaration() && "A function turned into a global?");</font></div><div><font class="Apple-style-span" face="Courier">1089</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">    </font></span><font class="Apple-style-span" face="Courier">          </font></div><div><font class="Apple-style-span" face="Courier">1090</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">       </font></span><font class="Apple-style-span" face="Courier">          // Replace any uses of "F" with uses of GV.</font></div><div><font class="Apple-style-span" face="Courier">1091</font><span class="Apple-tab-span" style="white-space:pre"><font class="Apple-style-span" face="Courier">  </font></span><font class="Apple-style-span" face="Courier">          Value *FInNewType = ConstantExpr::getBitCast(GV, F->getType());</font></div><br><br class="webkit-block-placeholder"></div><div><div>(gdb) p Name</div><div>$3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThreadObserving"</div><br>However  <font class="Apple-style-span" face="Courier">TheModule->getFunction(Name)</font> returns NULL and you get ICE at <font class="Apple-style-span" face="Courier">F->getType(</font>) #1091. I'll let you investigate this further ...   :)</div><div> </div></blockquote>How were you able to get gdb to work with this?!</div></div></blockquote><br></div><div>I built llvm-gcc Apple way after applying following build_gcc hack ... :)</div><div> </div><div>-</div><div>Devang</div><div><br class="webkit-block-placeholder"></div><div><div>Index: build_gcc</div><div>===================================================================</div><div>--- build_gcc<span class="Apple-tab-span" style="white-space:pre">      </span>(revision 42066)</div><div>+++ build_gcc<span class="Apple-tab-span" style="white-space:pre">        </span>(working copy)</div><div>@@ -42,7 +42,7 @@</div><div> # $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).</div><div> # We will allow this to override the default $CFLAGS and $CXXFLAGS.</div><div> </div><div>-CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"</div><div>+CFLAGS="-g "</div><div> </div><div> # This isn't a parameter; it is the architecture of the current machine.</div><div> BUILD=`arch | $TRANSLATE_ARCH`</div><div>@@ -194,7 +194,7 @@</div><div>   # we don't want to make the builders hit swap by firing off too many gcc's at</div><div>   # the same time.</div><div>   ## FIXME: Remove -O2 when <a href="rdar://4560645">rdar://4560645</a> is fixed.</div><div>-  make ENABLE_OPTIMIZED=1 UNIVERSAL=1 UNIVERSAL_ARCH="$LLVM_ARCHS" \</div><div>+  make UNIVERSAL=1 UNIVERSAL_ARCH="$LLVM_ARCHS" \</div><div>        OPTIMIZE_OPTION='-O2' \</div><div>        CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'"</div><div> </div><div>@@ -246,7 +246,7 @@</div><div> fi</div><div> # Unset RC_DEBUG_OPTIONS because it causes the bootstrap to fail.</div><div> RC_DEBUG_OPTIONS= \</div><div>-  make $MAKEFLAGS $BOOTSTRAP CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1</div><div>+  make $MAKEFLAGS CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1</div><div> make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1</div><div> make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install-target \</div><div>   CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1</div><div>@@ -541,7 +541,7 @@</div><div>   cd $DIR/obj-llvm || exit 1</div><div> </div><div>   ## Install the tree into the destination directory.</div><div>-  make $MAKEFLAGS ENABLE_OPTIMIZED=1 UNIVERSAL=1 OPTIMIZE_OPTION='-O2' install</div><div>+  make $MAKEFLAGS UNIVERSAL=1 OPTIMIZE_OPTION='-O2' install</div><div> </div><div>   if ! test $? == 0 ; then</div><div>       echo "error: LLVM 'make install' failed!"</div><div><br class="webkit-block-placeholder"></div></div></body></html>