Skip to content
New issue

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

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

Already on GitHub? # to your account

Explicitly link against rlibc to get non buggy version of memcpy #1049

Merged
merged 2 commits into from
Nov 26, 2021

Conversation

athei
Copy link
Contributor

@athei athei commented Nov 25, 2021

Fixes #364

The "ghost import" is called by the compiler inserted memcpy function. This is a workaround by providing a non buggy version of this functions ourselves.

@athei athei requested review from cmichi and Robbepop November 25, 2021 10:36
@codecov-commenter
Copy link

Codecov Report

Merging #1049 (05848f6) into master (71a2c38) will decrease coverage by 15.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1049       +/-   ##
===========================================
- Coverage   78.78%   63.76%   -15.03%     
===========================================
  Files         248      248               
  Lines        9363     9361        -2     
===========================================
- Hits         7377     5969     -1408     
- Misses       1986     3392     +1406     
Impacted Files Coverage Δ
crates/lang/codegen/src/traits.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/ir/src/ir/contract.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/env.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/mod.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/enforced_error.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/blake2b.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/storage.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/arg_list.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/contract.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/lang/codegen/src/generator/selector.rs 0.00% <0.00%> (-100.00%) ⬇️
... and 39 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71a2c38...05848f6. Read the comment docs.

@Robbepop
Copy link
Collaborator

I wonder what effects this has on the Wasm file sizes and compilation times but I guess rlibc compilation time is rather unsignificant.

@athei
Copy link
Contributor Author

athei commented Nov 25, 2021

I guess file sizes in this PR will get up because I re-enabled overflow-checks. But look at this crate. It is tiny.

@paritytech-ci
Copy link

🦑 📈 ink! Example Contracts ‒ Size Change Report 📉 🦑

These are the results of building the examples/* contracts from this branch with cargo-contract 0.15.0:

Δ Original Size Δ Optimized Size Total Optimized Size
accumulator -0.01 K 6.13 K
adder +0.33 K 7.36 K
contract-terminate +0.32 K 1.50 K
contract-transfer +0.01 K -0.18 K 7.91 K
delegator -0.23 K -0.38 K 10.04 K
dns -0.28 K -0.33 K 21.72 K
erc1155 +2.72 K +1.84 K 47.55 K
erc20 +0.14 K -0.12 K 10.28 K
erc721 +0.92 K +0.10 K 36.22 K
flipper +0.31 K 2.02 K
incrementer +0.32 K +0.02 K 1.94 K
multisig +1.63 K +0.34 K 46.16 K
proxy -0.33 K -0.40 K 3.90 K
rand-extension +0.04 K -0.21 K 5.14 K
subber +0.33 K 7.37 K
trait-erc20 +0.34 K +0.04 K 27.52 K
trait-flipper +0.31 K 1.83 K
trait-incrementer +0.32 K +0.01 K 1.93 K

Link to the run | Last update: Thu Nov 25 12:11:44 CET 2021

Copy link
Collaborator

@cmichi cmichi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@cmichi cmichi merged commit fb86286 into master Nov 26, 2021
@cmichi cmichi deleted the at-fix-ghostpanic branch November 26, 2021 03:53
tash-2s added a commit to tash-2s/open-emoji-battler that referenced this pull request Jan 16, 2022
xgreenx pushed a commit to Supercolony-net/ink that referenced this pull request Feb 8, 2022
…-ink#1049)

* Explicitly link against rlibc to get non-buggy version of memcpy

* Revert "Disable overflow checks for examples (use-ink#1034)"

This reverts commit b2256d9.
forbesus added a commit to forbesus/OpenEmojiBattler that referenced this pull request Feb 18, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uploading wasm file appear function non-existent error
5 participants