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

Make use of intrinsics a feature-flag #12

Merged
merged 2 commits into from
Apr 4, 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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added

- Add `malloc` feature flag. It allows `littlefs` to link to `malloc` and `free` instead of relying on the caller to allocate memory ([#9])
- Add a `software-intrinsics` feature flag, to disable the use of compiler intrinsics when compiling littlefs ([#12][])

# Changed

- upgrade `bindgen` to 0.69.4 and limit symbols to those prefixed with `lfs_` and `LFS_` ([#10])

[#10]: https://github.com/trussed-dev/littlefs2-sys/pull/10
[#12]: https://github.com/trussed-dev/littlefs2-sys/pull/12

## [0.1.7] - 2022-01-26

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ cc = "1"
[features]
assertions = []
trace = []
malloc = []
malloc = []
software-intrinsics = []
6 changes: 4 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.flag("-DLFS_NO_ERROR")
.file("littlefs/lfs.c")
.file("littlefs/lfs_util.c")
.file("string.c")
;
.file("string.c");

#[cfg(feature = "software-intrinsics")]
let builder = builder.flag("-DLFS_NO_INTRINSICS");

#[cfg(not(feature = "assertions"))]
let builder = builder.flag("-DLFS_NO_ASSERT");
Expand Down