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

feat: add ironfish-frost package on rust code #18

Merged
merged 13 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .github/workflows/codeql.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/lint.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "js"]
path = js
url = https://github.com/Zondax/ledger-ironfish-js
[submodule "deps/ledger-rust"]
path = deps/ledger-rust
url = https://github.com/Zondax/ledger-rust
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ test_all:
PRODUCTION_BUILD=1 make
make zemu_install
make zemu_test

all:
@$(MAKE) clean
@$(MAKE) buildS
@$(MAKE) buildX
@$(MAKE) buildS2
@$(MAKE) buildST
2 changes: 1 addition & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ RUST_TARGET:=thumbv6m-none-eabi

.PHONY: rust
rust:
cd rust && RUSTC_BOOTSTRAP=1 CARGO_HOME="$(CURDIR)/rust/.cargo" cargo build --target $(RUST_TARGET) --release
cd rust && RUSTC_BOOTSTRAP=1 CARGO_HOME="$(CURDIR)/rust/.cargo" TARGET_NAME=$(TARGET_NAME) cargo build --target $(RUST_TARGET) --release

.PHONY: rust_clean
rust_clean:
Expand Down
4 changes: 2 additions & 2 deletions app/Makefile.version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is the major version
APPVERSION_M=0
# This is the minor version
APPVERSION_N=0
APPVERSION_N=1
# This is the patch version
APPVERSION_P=12
APPVERSION_P=0
26 changes: 22 additions & 4 deletions app/rust/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[build]

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
rustflags = [
"--emit", "asm",
Expand All @@ -8,6 +6,26 @@ rustflags = [
"-C", "link-arg=-Tlink.ld",
"-C", "inline-threshold=0"
]

# rustflags required in order to bolos-sys won't compile. Required in this project to use lazy_static
# - rustflags = ["-Ctarget-feature=-crt-static"]
# Reference: https://github.com/rust-lang/rust-bindgen/issues/2360#issuecomment-1595909134
[host]
rustflags = ["-Ctarget-feature=-crt-static"]

# Needed for the embedded alloc feature, which enables the global alloc using the stack memory
# Come from this example to use ironfish-frost on ledger devices
# - build-std=["alloc"]
# - build-std-features=["compiler-builtins-mem"]
# Reference: https://github.com/iron-fish/ironfish-frost-ledger/tree/ad03ed83b5f2ebf4f494ae260fa1cf81c4599d58
# -----
# These two flags need to be true, otherwise bolos-sys crate won't compile. Required in this project to use lazy_static
# - target-applies-to-host = true
# - host-config = true
# Reference: https://github.com/rust-lang/rust-bindgen/issues/2360#issuecomment-1595909134
[unstable]
build-std=["core"]
build-std-features=["panic_immediate_abort"]
build-std=["core", "alloc"]
build-std-features=["panic_immediate_abort", "compiler-builtins-mem"]
target-applies-to-host = true
host-config = true

2 changes: 2 additions & 0 deletions app/rust/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
target/
.cargo/git
.cargo/registry
Loading
Loading