Skip to content

Commit

Permalink
编译 LLVM 源码,使用 Clion 调试 clang
Browse files Browse the repository at this point in the history
  • Loading branch information
CYRUS-STUDIO committed Nov 24, 2024
1 parent 1a094f5 commit e2348e7
Show file tree
Hide file tree
Showing 14 changed files with 1,479 additions and 106 deletions.
568 changes: 568 additions & 0 deletions content/posts/编译 LLVM 源码,使用 Clion 调试 clang.md

Large diffs are not rendered by default.

40 changes: 23 additions & 17 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@
<h1>CYRUS STUDIO</h1>
<ul class="posts-list">

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/%E7%BC%96%E8%AF%91-llvm-%E6%BA%90%E7%A0%81%E4%BD%BF%E7%94%A8-clion-%E8%B0%83%E8%AF%95-clang/">编译 LLVM 源码,使用 Clion 调试 clang</a>
<span class="posts-list-item-description">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
<title>calendar</title>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
Nov 24, 2024
<span class="posts-list-item-separator">-</span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
<title>clock</title>
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
9 min read
</span>
</li>

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/%E4%BD%BF%E7%94%A8-frida-hook-android-app/">使用 Frida Hook Android App</a>
<span class="posts-list-item-description">
Expand Down Expand Up @@ -207,23 +224,6 @@ <h1>CYRUS STUDIO</h1>
</span>
</li>

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/frida%E8%84%9A%E6%9C%AC%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AF%BB%E5%9D%80jni%E6%96%B9%E6%B3%95/">frida脚本,自动化寻址JNI方法</a>
<span class="posts-list-item-description">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
<title>calendar</title>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
Oct 29, 2024
<span class="posts-list-item-separator">-</span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
<title>clock</title>
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
3 min read
</span>
</li>

</ul>


Expand Down Expand Up @@ -254,6 +254,12 @@ <h1>CYRUS STUDIO</h1>
</a>
</li>

<li class="page-item">
<a class="page-link" href="/blog/page/5/">
5
</a>
</li>


<li class="page-item">
<a class="page-link" href="/blog/page/2/">
Expand Down
9 changes: 8 additions & 1 deletion public/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
<description>Recent content on CYRUS STUDIO</description>
<generator>Hugo</generator>
<language>zh-cn</language>
<lastBuildDate>Sun, 10 Nov 2024 13:11:20 +0800</lastBuildDate>
<lastBuildDate>Sun, 24 Nov 2024 23:00:44 +0800</lastBuildDate>
<atom:link href="https://cyrus-studio.github.io/blog/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>编译 LLVM 源码,使用 Clion 调试 clang</title>
<link>https://cyrus-studio.github.io/blog/posts/%E7%BC%96%E8%AF%91-llvm-%E6%BA%90%E7%A0%81%E4%BD%BF%E7%94%A8-clion-%E8%B0%83%E8%AF%95-clang/</link>
<pubDate>Sun, 24 Nov 2024 23:00:44 +0800</pubDate>
<guid>https://cyrus-studio.github.io/blog/posts/%E7%BC%96%E8%AF%91-llvm-%E6%BA%90%E7%A0%81%E4%BD%BF%E7%94%A8-clion-%E8%B0%83%E8%AF%95-clang/</guid>
<description>版权归作者所有,如有转发,请注明文章出处:https://cyrus-studio.github.io/blog/&#xA;1. LLVM 简介 LLVM 是一个开源的编译器基础架构,最初由 Chris Lattner 于 2000 年在伊利诺伊大学开发,后来成为一个广泛应用于编译器和程序分析的项目。&#xA;LLVM 的核心组件:&#xA;LLVM Core Libraries:提供用于编译器开发的核心工具集,包括代码生成、优化、目标机器描述等。&#xA;Clang:一个基于 LLVM 的 C、C++、Objective-C 编译器前端。&#xA;LLVM IR(Intermediate Representation):一种类似汇编的中间表示语言,是 LLVM 的核心抽象。代码在编译过程中先被转换为 LLVM IR,随后进行各种优化,再生成目标机器码。&#xA;LLVM Optimizer:对 LLVM IR 进行各种优化,如循环优化、内联展开等,以提升性能。&#xA;LLVM Code Generator:将优化后的 LLVM IR 转换为特定平台的机器码。&#xA;Linker:LLVM 也包含了一些链接器工具(如 LLD),用于将编译好的目标文件链接成可执行文件或库。&#xA;LLVM 的优势:&#xA;模块化设计:可用于多种语言的编译器开发(如 Rust、Swift)。&#xA;跨平台支持:支持多种处理器架构(如 x86、ARM、RISC-V)。&#xA;高度优化:提供丰富的优化技术,帮助生成更高效的机器码。&#xA;动态编译支持:适用于 JIT(即时编译),如 WebAssembly 和 Swift 的 REPL 环境。&#xA;LLVM 官网:https://llvm.org/&#xA;Getting Started with LLVM Core Libraries(中文版)&#xA;2. 下载 LLVM 在 Android NDK 中,LLVM/Clang 是默认的编译器。自 Android NDK r18 开始,Google 弃用了 GCC,全面转向使用 LLVM/Clang 作为 NDK 的编译工具链。</description>
</item>
<item>
<title>使用 Frida Hook Android App</title>
<link>https://cyrus-studio.github.io/blog/posts/%E4%BD%BF%E7%94%A8-frida-hook-android-app/</link>
Expand Down
40 changes: 23 additions & 17 deletions public/page/2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@
<h1>CYRUS STUDIO</h1>
<ul class="posts-list">

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/frida%E8%84%9A%E6%9C%AC%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AF%BB%E5%9D%80jni%E6%96%B9%E6%B3%95/">frida脚本,自动化寻址JNI方法</a>
<span class="posts-list-item-description">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
<title>calendar</title>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
Oct 29, 2024
<span class="posts-list-item-separator">-</span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
<title>clock</title>
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
3 min read
</span>
</li>

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/windows%E4%B8%8B%E5%88%9B%E5%BB%BAftp%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%9E%E7%8E%B0%E6%96%87%E4%BB%B6%E5%85%B1%E4%BA%AB/">Windows下创建FTP服务器,实现文件共享</a>
<span class="posts-list-item-description">
Expand Down Expand Up @@ -207,23 +224,6 @@ <h1>CYRUS STUDIO</h1>
</span>
</li>

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/%E4%BD%BF%E7%94%A8ida-pro%E5%8A%A8%E6%80%81%E8%B0%83%E8%AF%95android-app/">使用IDA Pro动态调试Android APP</a>
<span class="posts-list-item-description">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
<title>calendar</title>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
Sep 30, 2024
<span class="posts-list-item-separator">-</span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
<title>clock</title>
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
3 min read
</span>
</li>

</ul>


Expand Down Expand Up @@ -263,6 +263,12 @@ <h1>CYRUS STUDIO</h1>
</a>
</li>

<li class="page-item">
<a class="page-link" href="/blog/page/5/">
5
</a>
</li>


<li class="page-item">
<a class="page-link" href="/blog/page/3/">
Expand Down
40 changes: 23 additions & 17 deletions public/page/3/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@
<h1>CYRUS STUDIO</h1>
<ul class="posts-list">

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/%E4%BD%BF%E7%94%A8ida-pro%E5%8A%A8%E6%80%81%E8%B0%83%E8%AF%95android-app/">使用IDA Pro动态调试Android APP</a>
<span class="posts-list-item-description">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
<title>calendar</title>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
Sep 30, 2024
<span class="posts-list-item-separator">-</span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
<title>clock</title>
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
3 min read
</span>
</li>

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/%E4%BD%BF%E7%94%A8readelf%E5%88%86%E6%9E%90so%E6%96%87%E4%BB%B6/">使用readelf分析so文件</a>
<span class="posts-list-item-description">
Expand Down Expand Up @@ -207,23 +224,6 @@ <h1>CYRUS STUDIO</h1>
</span>
</li>

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/lineageos%E5%88%B7%E6%9C%BA%E6%95%99%E7%A8%8B/">LineageOS刷机教程</a>
<span class="posts-list-item-description">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
<title>calendar</title>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
Sep 15, 2024
<span class="posts-list-item-separator">-</span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
<title>clock</title>
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
2 min read
</span>
</li>

</ul>


Expand Down Expand Up @@ -263,6 +263,12 @@ <h1>CYRUS STUDIO</h1>
</a>
</li>

<li class="page-item">
<a class="page-link" href="/blog/page/5/">
5
</a>
</li>


<li class="page-item">
<a class="page-link" href="/blog/page/4/">
Expand Down
32 changes: 32 additions & 0 deletions public/page/4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,23 @@
<h1>CYRUS STUDIO</h1>
<ul class="posts-list">

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/lineageos%E5%88%B7%E6%9C%BA%E6%95%99%E7%A8%8B/">LineageOS刷机教程</a>
<span class="posts-list-item-description">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-calendar">
<title>calendar</title>
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
Sep 15, 2024
<span class="posts-list-item-separator">-</span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-clock">
<title>clock</title>
<circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline>
</svg>
2 min read
</span>
</li>

<li class="posts-list-item">
<a class="posts-list-item-title" href="https://cyrus-studio.github.io/blog/posts/%E5%B0%8F%E7%B1%B3%E6%89%8B%E6%9C%BA%E8%A7%A3%E9%99%A4bl%E9%94%81%E5%88%B7%E6%9C%BAroot/">小米手机解除BL锁&amp;刷机&amp;root</a>
<span class="posts-list-item-description">
Expand Down Expand Up @@ -246,6 +263,21 @@ <h1>CYRUS STUDIO</h1>
</a>
</li>

<li class="page-item">
<a class="page-link" href="/blog/page/5/">
5
</a>
</li>


<li class="page-item">
<a class="page-link" href="/blog/page/5/">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-arrow-right">
<title>arrow-right</title>
<line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline>
</svg>
</a>
</li>

</ul>

Expand Down
111 changes: 111 additions & 0 deletions public/page/5/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<!doctype html>
<html lang="zh-cn">
<head>
<title>CYRUS STUDIO</title>
<link rel="shortcut icon" href="/favicon.ico" />
<meta charset="utf-8" />
<meta name="generator" content="Hugo 0.131.0">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="John Doe" />
<meta name="description" content="Android &amp; Python Developer" />
<link rel="stylesheet" href="/blog/css/main.min.856983674a1492cba25db6068ef48dfbdb023b4eff9d156be563fc5a10af7654.css" />
<link rel="alternate" type="application/rss+xml" href="https://cyrus-studio.github.io/blog/index.xml" title="CYRUS STUDIO">







<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="CYRUS STUDIO">
<meta name="twitter:description" content="Android &amp; Python Developer">

<meta property="og:url" content="https://cyrus-studio.github.io/blog/">
<meta property="og:site_name" content="CYRUS STUDIO">
<meta property="og:title" content="CYRUS STUDIO">
<meta property="og:description" content="Android &amp; Python Developer">
<meta property="og:locale" content="zh_cn">
<meta property="og:type" content="website">


</head>
<body>
<header class="app-header">
<a href="https://cyrus-studio.github.io/blog/"><img class="app-header-avatar" src="/blog/avatar.jpg" alt="John Doe" /></a>
<span class="app-header-title">CYRUS STUDIO</span>
<nav class="app-header-menu">
<a class="app-header-menu-item" href="/blog/">Home</a>
-

<a class="app-header-menu-item" href="/blog/about/">About</a>
-

<a class="app-header-menu-item" href="https://github.com/CYRUS-STUDIO">GitHub</a>
</nav>
<p>Android &amp; Python Developer</p>
<div class="visitor-counter">
<img src="https://profile-counter.glitch.me/CYRUS-STUDIO-blog/count.svg" alt="Visitor Count">
</div>
</header>
<main class="app-container">

<article>
<h1>CYRUS STUDIO</h1>
<ul class="posts-list">

</ul>


<ul class="pagination">

<li class="page-item">
<a class="page-link" href="/blog/page/4/">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-arrow-left">
<title>arrow-left</title>
<line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline>
</svg>
</a>
</li>


<li class="page-item">
<a class="page-link" href="/blog/">
1
</a>
</li>

<li class="page-item">
<a class="page-link" href="/blog/page/2/">
2
</a>
</li>

<li class="page-item">
<a class="page-link" href="/blog/page/3/">
3
</a>
</li>

<li class="page-item">
<a class="page-link" href="/blog/page/4/">
4
</a>
</li>

<li class="page-item active">
<a class="page-link" href="/blog/page/5/">
5
</a>
</li>


</ul>



</article>

</main>
</body>
</html>
Loading

0 comments on commit e2348e7

Please sign in to comment.