Skip to content

Commit

Permalink
Explicitly link against rlibc to get non buggy version of memcpy (#1049)
Browse files Browse the repository at this point in the history
* Explicitly link against rlibc to get non-buggy version of memcpy

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

This reverts commit b2256d9.
  • Loading branch information
athei authored Nov 26, 2021
1 parent 74edbfa commit fb86286
Show file tree
Hide file tree
Showing 19 changed files with 5 additions and 68 deletions.
1 change: 1 addition & 0 deletions crates/env/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static_assertions = "1.1"

[target.'cfg(target_arch = "wasm32")'.dependencies]
libsecp256k1 = { version = "0.7.0", default-features = false }
rlibc = "1"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ink_engine = { version = "3.0.0-rc7", path = "../engine/", default-features = false, optional = true }
Expand Down
4 changes: 4 additions & 0 deletions crates/env/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
unused_extern_crates
)]

#[cfg(all(not(feature = "std"), target_arch = "wasm32"))]
#[allow(unused_extern_crates)]
extern crate rlibc;

#[cfg(all(not(feature = "std"), target_arch = "wasm32"))]
#[allow(unused_variables)]
#[panic_handler]
Expand Down
4 changes: 0 additions & 4 deletions examples/contract-terminate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "contract_terminate"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/contract-transfer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ name = "contract_transfer"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/delegator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ name = "delegator"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/delegator/accumulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ crate-type = [
"rlib",
]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/delegator/adder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ crate-type = [
"rlib",
]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/delegator/subber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ crate-type = [
"rlib",
]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "dns"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/erc1155/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ name = "erc1155"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/erc20/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "erc20"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/erc721/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "erc721"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/flipper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "flipper"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/incrementer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "incrementer"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/multisig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ name = "multisig"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/rand-extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "rand_extension"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/trait-erc20/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "trait_erc20"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/trait-flipper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "trait_flipper"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down
4 changes: 0 additions & 4 deletions examples/trait-incrementer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ name = "trait_incrementer"
path = "lib.rs"
crate-type = ["cdylib"]

# Needed until https://github.com/paritytech/ink/issues/364 is resolved.
[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
Expand Down

0 comments on commit fb86286

Please sign in to comment.