llvm

build LLVM example: Undefined symbols for architecture x86_64

南楼画角 提交于 2020-08-06 04:01:47
问题 I've installed LLVM on my laptop but having problem compiling the Fibonacci example in llvm/examples/Fibonacci : clang++ -std=c++11 -I ../../include fibonacci.cpp -o fib /usr/local/include/llvm/Support/DataTypes.h:57:3: error: "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h" According to this question, I add some driver flags: clang++ fibonacci.cpp -std=c++11 -I ../../include -o fib -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS Different errors produced: Undefined

Rust 1.45 发布:修复了 Cast Unsoundness 并稳定了 Web 框架 Rocket 的支持

孤人 提交于 2020-08-04 09:17:15
云栖号资讯:【 点击查看更多行业资讯 】 在这里您可以找到不同行业的第一手的上云资讯,还在等什么,快来! Rust 1.45 修复了一个长期存在的浮点数强制转换问题,该问题可能导致未定义行为(undefined behaviour )异常,并稳定了流行 Web 框架 Rocket 所使用的特性。 将浮点数转换为整数时,Rest 会抛出一个 未定义行为(undefined behaviour)的已知异常。如果你对Rust 的 value proposition 有所了解的话,可能会对此感到惊讶。具体来说,下面的代码片段虽然编译时不会报错,但由于使用了 cast ( as ) 将浮点数 300 强制转换为 8 位无符号整数(仅表示值介于 0 到 255 之间的整数),在 Rust 1.44 中会抛出未定义行为的异常: fn cast(x: f32) -> u8 { x as u8 } fn main() { let f = 300.0; let x = cast(f); println!("x: {}", x); } 在底层,这个问题与 LLVM 的 fptoui 指令有关,该指令在上述情况下使用会生成一个“有毒”的值。回想一下,Rust 提供了 unsafe 关键字来标记希望 挂起Rust 安全保证的代码块。上面所示的代码片段虽然没有被标记为不安全,但它却包含了不安全的代码

LLVM (3.5+) PassManager vs LegacyPassManager

纵饮孤独 提交于 2020-08-01 02:59:09
问题 I'm working on a new language using the LLVM C++ API and would like to take advantage of optimization passes. ( Note: I'm currently using the latest from source LLVM which I believe equates to 3.8) I have yet to find any examples that use the new PassManager and even Clang is still utilizing the LegacyPassManager. I have come across posts such as this that are several years old now that mention the new PassManager, but they all still use the legacy system. Is there any examples/tutorials on

LLVM (3.5+) PassManager vs LegacyPassManager

雨燕双飞 提交于 2020-08-01 02:58:26
问题 I'm working on a new language using the LLVM C++ API and would like to take advantage of optimization passes. ( Note: I'm currently using the latest from source LLVM which I believe equates to 3.8) I have yet to find any examples that use the new PassManager and even Clang is still utilizing the LegacyPassManager. I have come across posts such as this that are several years old now that mention the new PassManager, but they all still use the legacy system. Is there any examples/tutorials on

#新闻拍一拍# 苹果强势逼迫整个 CA 行业进入一年的证书寿命期

China☆狼群 提交于 2020-07-28 10:39:43
苹果强势逼迫整个 CA 行业进入一年的证书寿命期 苹果公司在 2020 年 2 月单方面做出的一项决定,并有效地强势逼迫证书颁发机构行业接受 TLS 证书 398 天的新默认寿命。苹果打破了 CA/B 论坛的标准操作程序,没有要求投票,而是简单地宣布决定在其设备上实施 398 天的寿命。继苹果最初宣布之后,Mozilla 和谷歌也表示了类似的意向,将在其浏览器中实施同样的规则。从 2020 年 9 月 1 日开始,苹果、谷歌和 Mozilla 的浏览器和设备将对有效期超过 398 天的新 TLS 证书显示错误。TLS 证书的寿命从 8 年开始,经过多年的发展,浏览器厂商对其进行了削足适履,将其降低到 5 年,然后是 3 年,再到2年。上一次变化发生在 2018 年 3 月,当时浏览器制造商试图将 SSL 证书寿命从三年减少到一年,但在 CA 的积极反击下妥协了两年。简单点说,就是表明浏览器厂商控制了 CA/B 论坛,他们完全控制了 HTTPS 生态系统,而 CA 只是参与者,没有实际权力。 来源: cnBeta.COM 拍一拍:这个世界果然是谁的拳头大谁说了算。 部分开源项目着手支持 macOS ARM64 虽然首批搭载苹果 64 位 ARM 芯片的 MacBook/Mac 最快也要到年底才会面向消费者提供,并且在这之前苹果只向开发者提供数量有限的开发机,但部分开源项目已经在为

Android的Soong介绍

柔情痞子 提交于 2020-07-28 10:35:29
原文: https://android.googlesource.com/platform/build/soong/+/master/README.md Soong Soong是以前Android基于make的编译系统的替代品。它以Android.bp文件替代Android.mk,Android.bp文件用类似JSON的简洁声明来描述需要构建的模块。 Android.bp文件格式 Android.bp文件设计得非常简洁。没有条件或控制流语言(任何复杂性都在用Go编写的构建逻辑中被处理)。Android.bp文件的语法和语义在可能的情况下有意类似于 Bazel构建文件 。 模块 Android.bp文件中的模块以模块类型开头,后跟一组 name: value 格式的属性: cc_binary { name : "gzip" , srcs : [ "src/test/minigzip.c" ] , shared_libs : [ "libz" ] , stl : "none" , } 每个模块必须有 name 属性,且其值在所有Android.bp文件中必须是唯一的。 关于可用模块类型及其属性列表,参见 $OUT_DIR/soong/.bootstrap/docs/soong_build.html . Glob模式 获取文件列表的属性可以采用glob模式

「译」静态单赋值小册

被刻印的时光 ゝ 提交于 2020-07-23 18:16:37
有一本小册子Static Single Assignment Book写的很好,内容又较少,试着翻译一下,意译较多(说人话),不是严肃的翻译,感兴趣的可以看看。频率可能是周更。。anyway,stay tuned~ 在日常编程中,名字是一个很有用的东西。这本书想传递的关键内容是对于每个不同的东西给它一个独一无二的名字可以消除很多不确定性以及不精确性。 举个例子,如果你无意中听到一段对话中有'Homer'这个词,没有上下文的情况下你不知道他说的是Homer Simpson(辛普森)还是古希腊诗人荷马还是你认识的某个叫Homer的人。但是只要你听到对话提及Springfield (辛普森一家)而不是Smyrna(希腊诗歌),你就能知道他们说的是辛普森一家这个电视剧。不过话又说回来,如果每个人都有一个独一无二的名字,那么就不可能混淆电视剧角色和古希腊文学人物,这个问题都不会成立。 这本书主要讨论静态单赋值(Static Single Assignment Form,SSA)形式,它是一种变量的命名约定。术语static说明SSA与属性和代码分析相关,术语single说明SSA强制变量名具有唯一性。术语assignment表示变量的定义。举个例子,在下面的代码中: x = y + 1; 变量x被赋予表达式(y+1)的值。这是一个定义,或者对于x来说是赋值语句

LLVM OPT not giving optimised file as output.

有些话、适合烂在心里 提交于 2020-07-21 03:29:41
问题 The man page for opt says: "It takes LLVM source files as input, runs the specified optimizations or analyses on it, and then outputs the optimized file or the analysis results". My Goal: To use the inbuilt optimisation pass -dce available in opt . This pass does Dead Code Elimination My Source file foo.c : int foo(void) { int a = 24; int b = 25; /* Assignment to dead variable -- dead code */ int c; c = a * 4; return c; } Here is what I did: 1. clang-7.0 -S -emit-llvm foo.c -o foo.ll 2. opt

LLVM OPT not giving optimised file as output.

孤街浪徒 提交于 2020-07-21 03:28:28
问题 The man page for opt says: "It takes LLVM source files as input, runs the specified optimizations or analyses on it, and then outputs the optimized file or the analysis results". My Goal: To use the inbuilt optimisation pass -dce available in opt . This pass does Dead Code Elimination My Source file foo.c : int foo(void) { int a = 24; int b = 25; /* Assignment to dead variable -- dead code */ int c; c = a * 4; return c; } Here is what I did: 1. clang-7.0 -S -emit-llvm foo.c -o foo.ll 2. opt

clang: warning: no such sysroot directory: '-mmacosx-version-min=10.5' on compiling LLVM (3.9.0)

我与影子孤独终老i 提交于 2020-07-19 18:55:51
问题 I am compiling LLVM (3.9.0) using CMake (3.6.2) on my Mac (OsX) using GCC, but somehow I am getting the following error with following GCC configuration Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.3.0 (clang-703.0.31) Target: x86_64-apple-darwin15.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin [50%] Building C object projects/compiler-rt/lib/builtins/CMakeFiles/clang_rt