Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #[linkage = "weak"] attribute to all mem instrinics. #411

Merged
merged 1 commit into from
Apr 5, 2021

Conversation

MabezDev
Copy link
Contributor

@MabezDev MabezDev commented Apr 3, 2021

Following on from #379, in particular this comment #379 (comment).

The rational for such a change is to provide a simple way to override the builtin memcpy routines, in particular no_std targets because the mem feature of compiler-builtins is always enabled for those targets and cannot be disabled.

@Amanieu
Copy link
Member

Amanieu commented Apr 4, 2021

Weak linkage isn't properly supported on some targets (Windows, maybe apple too) and should be disabled on those.

@MabezDev MabezDev force-pushed the mem-intrinsics-weak-linkage branch from b8c5f64 to ba9e00c Compare April 4, 2021 18:15
@MabezDev
Copy link
Contributor Author

MabezDev commented Apr 4, 2021

I grepped the rustc_target crate in the compiler repo and found that only windows gnu targets don't support weak linkage along with uefi targets:

grep -rn "allows_weak_linkage"
windows_gnu_base.rs:80:        allows_weak_linkage: false,
uefi_msvc_base.rs:44:        allows_weak_linkage: false,

The changes I have just pushed should cover those cases.

@MabezDev
Copy link
Contributor Author

MabezDev commented Apr 4, 2021

Current CI error seems unrelated? Failing to pull a docker registry it seems.

@Amanieu Amanieu merged commit 8ab9fd8 into rust-lang:master Apr 5, 2021
@MabezDev MabezDev deleted the mem-intrinsics-weak-linkage branch April 5, 2021 11:49
MabezDev added a commit to esp-rs/esp32-hal that referenced this pull request Aug 11, 2021
* Bump xtensa-lx crates
* Bump esp32 crate
* Update to fix any breaking changes
* use `build-std` by default - now that
rust-lang/compiler-builtins#411 is merged
MabezDev added a commit to esp-rs/esp32-hal that referenced this pull request Aug 12, 2021
* Ecosystem bump

* Bump xtensa-lx crates
* Bump esp32 crate
* Update to fix any breaking changes
* use `build-std` by default - now that
rust-lang/compiler-builtins#411 is merged

* v0.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants