Skip to content

Commit

Permalink
feat: add tls
Browse files Browse the repository at this point in the history
  • Loading branch information
richerfu committed Apr 16, 2024
1 parent 27d9823 commit f51c1f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Binary file added src/docs/more/assets/x86_64_error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions src/docs/more/emu-tls.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
editLink: true
outline: "deep"
---

# EMU-TLS
Expand All @@ -10,7 +11,7 @@ For versions of LLVM 15 and above, emu-tls related symbols have been moved into
__emutls_get_address: symbol not found
:::

## Solve
## How to solve it?

```rust
// build.rs
Expand All @@ -20,4 +21,17 @@ fn main() {
// or
// println!("cargo:rustc-link-lib=static=clang_rt.builtins");
}
```
```

### x86_64

When dealing with the x86_64 architecture, we might encounter an error like the one below.

![error](assets/x86_64_error.png)

Add `.cargo/config.toml` file in your project, and add some code.

```toml
[unstable]
build-std-features = ["compiler-builtins-weak-intrinsics"]
```

0 comments on commit f51c1f6

Please sign in to comment.