Comments (4)
我用简单的尝试了下, 同样的 configure 参数, gcc9及以前都是直接展开了原子指令, 但是 gcc 10 起使用了函数调用,除非开启 -mno-outline-atomics
https://godbolt.org/z/z8W7z1cqx
不过发现并不需要显式链接静态库, 这应该是我的环境有多个 gcc ,搞混了导致, 也就是这个 BUILD 补丁是不必要的
网上类似问题 cloudius-systems/osv#1129
from flare.
这个gcc是自己编译的吗?
印象里atomic的实现方式有两种,一种是直接生成ll/sc,一种是用libatomic(这个性能略差),具体选择哪个可能跟gcc的configure的参数有关。
centos8 aarch64带的gcc我记得应该是不用链接libatomic的。你可以看下你的环境的gcc是不是配置有什么不一样的地方。
from flare.
这个gcc是自己编译的吗?
印象里atomic的实现方式有两种,一种是直接生成ll/sc,一种是用libatomic(这个性能略差),具体选择哪个可能跟gcc的configure的参数有关。
centos8 aarch64带的gcc我记得应该是不用链接libatomic的。你可以看下你的环境的gcc是不是配置有什么不一样的地方。
是自己构建的,环境为 glibc 2.28 请看看是否正常
Using built-in specs.
COLLECT_GCC=/***/gcc-11.3.0/bin/gcc
COLLECT_LTO_WRAPPER=/***/gcc-11.3.0/libexec/gcc/aarch64-redhat-linux/11.3.0/lto-wrapper
Target: aarch64-redhat-linux
Configured with: ./configure --prefix=/***/gcc-11.3.0 --build=aarch64-redhat-linux --enable-threads=posix --enable-multiarch --disable-checking --enable-long-long --disable-multilib --enable-languages=c,c++,fortran --with-mpc=/***/mpc-1.2.1 --with-gmp=/***/gmp-6.2.1 --with-mpfr=/***/mpfr-4.1.0
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.3.0 (GCC)
from flare.
看起来没什么明显的问题。
我手上现在没有aarch64的环境,但是有这么一些想法:
- 可以尝试直接编译一个简单的、使用了
std::atomic
的代码,看看反汇编是不是直接生成了ldrex
/strex
或其他的类似的原子指令。是的话则不需要libatomic
。我看godbolt上面的arm-gcc是这样的。 - 可以尝试编译gcc时
configure
的时候指定--disable-libatomic
看看有没有区别。 - 可以尝试给gcc指定不同的
-march
看看会不会影响原子操作的codegen,有可能默认target到了某个很老的ISA,让gcc不得不依赖libatomic
来实现原子操作。
from flare.
Related Issues (20)
- Http header data structure HOT 13
- Rpc: Http parse HOT 5
- 针对K8s容器环境是否有需要注意的优化配置呢 HOT 2
- clang-format HOT 15
- update blade HOT 9
- logging HOT 11
- if have any plan to support bazel HOT 1
- bazel build ... 失败 HOT 6
- 请问有合适的源码阅读顺序吗 HOT 5
- 对GetFreeCount的取值比较困惑 HOT 5
- Does the server example in the flare example support 1 thread start? HOT 4
- clang-17 asan/tsan fiber coredump
- 关于Function类的疑问 HOT 2
- 问一个非常诡异的用例 HOT 10
- 关于调度参数的疑问 HOT 1
- 编译时间太长 HOT 4
- 调试相关 HOT 3
- Fiber scheduling takes too long HOT 3
- Can it support machines with large cores HOT 4
- 使用`getaddrinfo`会不会更好一点 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flare.