[LLVMdev] Valgrind Help Needed

Devang Patel dpatel at apple.com
Thu Sep 20 10:24:45 PDT 2007


On Sep 20, 2007, at 2:52 AM, Bill Wendling wrote:

> On Sep 19, 2007, at 5:41 PM, Devang Patel wrote:
>> On Sep 19, 2007, at 4:48 PM, Bill Wendling wrote:
>>
>> In llvm-backend.cpp  :
>>
>> 1086	        if (GV->getName() != Name) {
>> 1087	          Function *F = TheModule->getFunction(Name);
>> 1088	          assert(F && F->isDeclaration() && "A function turned  
>> into a global?");
>> 1089	
>> 1090	          // Replace any uses of "F" with uses of GV.
>> 1091	          Value *FInNewType = ConstantExpr::getBitCast(GV, F- 
>> >getType());
>>
>>
>> (gdb) p Name
>> $3 = 0x41819430 "\001L_OBJC_PROTOCOL_$_CPTransferThreadObserving"
>>
>> However  TheModule->getFunction(Name) returns NULL and you get ICE  
>> at F->getType() #1091. I'll let you investigate this further ...   :)
>>
> How were you able to get gdb to work with this?!

I built llvm-gcc Apple way after applying following build_gcc  
hack ... :)

-
Devang

Index: build_gcc
===================================================================
--- build_gcc	(revision 42066)
+++ build_gcc	(working copy)
@@ -42,7 +42,7 @@
  # $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).
  # We will allow this to override the default $CFLAGS and $CXXFLAGS.

-CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"
+CFLAGS="-g "

  # This isn't a parameter; it is the architecture of the current  
machine.
  BUILD=`arch | $TRANSLATE_ARCH`
@@ -194,7 +194,7 @@
    # we don't want to make the builders hit swap by firing off too  
many gcc's at
    # the same time.
    ## FIXME: Remove -O2 when rdar://4560645 is fixed.
-  make ENABLE_OPTIMIZED=1 UNIVERSAL=1 UNIVERSAL_ARCH="$LLVM_ARCHS" \
+  make UNIVERSAL=1 UNIVERSAL_ARCH="$LLVM_ARCHS" \
         OPTIMIZE_OPTION='-O2' \
         CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION 
\"'"

@@ -246,7 +246,7 @@
  fi
  # Unset RC_DEBUG_OPTIONS because it causes the bootstrap to fail.
  RC_DEBUG_OPTIONS= \
-  make $MAKEFLAGS $BOOTSTRAP CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" ||  
exit 1
+  make $MAKEFLAGS CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
  make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
  make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install- 
target \
    CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
@@ -541,7 +541,7 @@
    cd $DIR/obj-llvm || exit 1

    ## Install the tree into the destination directory.
-  make $MAKEFLAGS ENABLE_OPTIMIZED=1 UNIVERSAL=1 OPTIMIZE_OPTION='- 
O2' install
+  make $MAKEFLAGS UNIVERSAL=1 OPTIMIZE_OPTION='-O2' install

    if ! test $? == 0 ; then
        echo "error: LLVM 'make install' failed!"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070920/d686aaa5/attachment.html>


More information about the llvm-dev mailing list