ShiftLeftSecurity / llvm2cpg

LLVM meets Code Property Graphs
https://docs.joern.io/llvm2cpg/hello-llvm
Apache License 2.0
85 stars 7 forks source link

How to install llvm2cpg #5

Open hrshy0629 opened 2 years ago

hrshy0629 commented 2 years ago

維護者是否能夠給一個具體的安裝流程,我在本地嘗試多次,都出現error 1)llvm2cpg/vendor 應該缺少相關CMakeList.txt吧? 2)googletest需要安裝吧,但是具體的操作沒有指出來? 3)cmake -G "Unix Makefiles" -DPATH_TO_LLVM=YOUR_LLVM_DIR ~/.joern/llvm2cpg?

Ferada commented 2 years ago

Either c.f. https://docs.joern.io/llvm2cpg/hello-llvm/, you don't need to install it anywhere specifically.

Or, for importCpg.llvm("foo.ll") to work (you still have to convert to .ll first!), you'd have to symlink the llvm2cpg binary to .../joern/joern-cli/llvm2cpg.sh, e.g.

cd ~/bin/joern/joern-cli
ln -s ln -s /tmp/llvm2cpg-0.8.0-LLVM-10.0-ubuntu-18.04/llvm2cpg llvm2cpg.sh

I'd suggest downloading the release instead of building it yourself. Otherwise take a look in the automated CI setup with Ansible, e.g. https://github.com/ShiftLeftSecurity/llvm2cpg/blob/main/ci/ubuntu-playbook.yaml etc.

hrshy0629 commented 2 years ago

感谢您的回复,我还有个问题,事实上LLVM从12.0.0开始,重新构建了他的文件分布情况,包括安装方式也改了很多,至少不需要再频繁的将某个文件夹移动到固定的目录了,但是llvm2cpg并没有提供对LLVM12版本的支持。我想问下,llvm2cpg是否能够直接应用于LLVM12?或者说你们有什么维护措施吗?

------------------ 原始邮件 ------------------ 发件人: "Olof-Joachim Frahm @.>; 发送时间: 2022年1月5日(星期三) 晚上7:54 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [ShiftLeftSecurity/llvm2cpg] How to install llvm2cpg (Issue #5)

Either c.f. https://docs.joern.io/llvm2cpg/hello-llvm/, you don't need to install it anywhere specifically.

Or, for importCpg.llvm("foo.ll") to work (you still have to convert to .ll first!), you'd have to symlink the llvm2cpg binary to .../joern/joern-cli/llvm2cpg.sh, e.g. cd ~/bin/joern/joern-cli ln -s ln -s /tmp/llvm2cpg-0.8.0-LLVM-10.0-ubuntu-18.04/llvm2cpg llvm2cpg.sh
I'd suggest downloading the release instead of building it yourself. Otherwise take a look in the automated CI setup with Ansible, e.g. https://github.com/ShiftLeftSecurity/llvm2cpg/blob/main/ci/ubuntu-playbook.yaml etc.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you authored the thread.Message ID: @.***>

Ferada commented 2 years ago

感谢您的回复,我还有个问题,事实上LLVM从12.0.0开始,重新构建了他的文件分布情况,包括安装方式也改了很多,至少不需要再频繁的将某个文件夹移动到固定的目录了,但是llvm2cpg并没有提供对LLVM12版本的支持。我想问下,llvm2cpg是否能够直接应用于LLVM12?

I'm sorry, I don't know that, I'd at least expect a few changes to be necessary because of the 10 to 12 upgrade though.

或者说你们有什么维护措施吗?

Unfortunately no. While we're happy to accept PRs, we don't have any immediate plans at the moment to upgrade.

rrycbar commented 2 years ago

您好,在生成.ll时,每条语句会有store,load,call等指令信息,但我注意到,当转换成cpg时,图中的节点并未显示这些信息。请问这些信息是省略了吗?