xiangzhai / dragonegg

DragonEgg has been migrated to GCC 8 and LLVM 6 but also able to work for GCC 4.8 and LLVM 3.3
https://gcc.gnu.org/ml/gcc/2017-08/msg00245.html
GNU General Public License v2.0
18 stars 6 forks source link

debug_tree doesn't exist anywhere in llvm or dragonegg. #33

Open Lucretia opened 6 years ago

Lucretia commented 6 years ago
/home/laguest/src/mine/free-ada/tmp/dragonegg/src/Backend.cpp: In function ‘llvm::Value* make_decl_llvm(tree)’:
/home/laguest/src/mine/free-ada/tmp/dragonegg/src/Backend.cpp:1626:20: error: ‘debug_tree’ was not declared in this scope
     debug_tree(decl);
                    ^
In file included from /usr/lib64/llvm/6/include/llvm/Analysis/TargetFolder.h:25:0,
                 from /home/laguest/src/mine/free-ada/tmp/dragonegg/include/dragonegg/Internals.h:34,
                 from /home/laguest/src/mine/free-ada/tmp/dragonegg/include/dragonegg/Debug.h:27,
                 from /home/laguest/src/mine/free-ada/tmp/dragonegg/src/Backend.cpp:26:
/usr/lib64/llvm/6/include/llvm/IR/InstrTypes.h: In instantiation of ‘bool llvm::OperandBundleUser<InstrTy, OpIteratorTy>::isFnAttrDisallowedByOpBundle(llvm::StringRef) const [with InstrTy = llvm::CallInst; OpIteratorTy = llvm::Use*]’:
xiangzhai commented 6 years ago

@Lucretia

GCC 4.6

GCC 8.0

And what about your GNU toolchain?

$ gcc -v
Lucretia commented 6 years ago

gcc 6.4.0

Lucretia commented 6 years ago

Ahh my tree.h doesn't have it.

xiangzhai commented 6 years ago

Please install dependence at first https://github.com/xiangzhai/dragonegg/wiki/Dependence take my LinuxBox Fedora 25 for an instance:

$ grep debug_tree -r /usr/lib/gcc/x86_64-redhat-linux/6.4.1/plugin/include/
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/plugin/include/print-tree.h:extern void debug_tree (tree);
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/plugin/include/tree-into-ssa.h:extern void debug_tree_ssa (void);
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/plugin/include/tree-into-ssa.h:extern void debug_tree_ssa_stats (void);
/usr/lib/gcc/x86_64-redhat-linux/6.4.1/plugin/include/tree-pretty-print.h:extern void debug_tree_chain (tree);
Lucretia commented 6 years ago

I have the corect files in the right place, but no matter what I do it cannot find them. It keeps trying to the find the system compiler's versions.

xiangzhai commented 6 years ago

@Lucretia

#!/bin/bash

echo "Usage: for example ./debug-build /opt/gcc-git/bin/gcc /opt/llvm-svn/bin/llvm-config"

make clean

CC=$1
if [[ -z "$CC" ]]; then
    CC=gcc
fi
$CC --version

LC=$2
if [[ -z "$LC" ]]; then
    LC=llvm-config
fi
$LC --version

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$($LC --libdir)

LANG=en_US.UTF-8 GCC=$CC LLVM_CONFIG=$LC ENABLE_LLVM_PLUGINS=1 DRAGONBALL_DEBUG=1 make -j4 &> /tmp/build.log

Also tested with GNU cross-compiler:

$ ./debug-build /opt/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc /opt/llvm-svn/bin/llvm-config