| Crates.io | cargo-dtc |
| lib.rs | cargo-dtc |
| version | 1.7.6 |
| created_at | 2024-07-22 01:25:17.426376+00 |
| updated_at | 2025-08-07 15:14:47.724388+00 |
| description | Devicetree Compiler packaged for building with cargo |
| homepage | |
| repository | https://github.com/xobs/cargo-dtc |
| max_upload_size | |
| id | 1310714 |
| size | 498,138 |
Wrap the dtc source code in Rust to make it easier to build for non-Posix platforms.
The binary is named cargo-dtc to avoid conflicts with the original dtc binary.
This project wraps the GPL2-licensed dtc code. As such, this project is also licensed under GPL2.
Generated files (namely the flex and bison grammar files) were generated and the resulting file copied to dtc. Original files may be consulted from the original source.
Any non-Posix code was adapted to build under more strict compilers.
The main() was renamed to dtc_main() and is wrapped by Rust.
dtcThe original version of dtc is available as a submodule in the dtc-orig directory. The code in this directory is unused, and it serves to provide a reference for the changes made to the original code.
The following changes were made:
dtc-lexer.lex.l and dtc-parser.tab.y were copied to dtc/src/ and are used to avoid needing to install flex and bison.__VA_ARGS__ in MSVC, the CHECK_ENTRY() macro inserts a NULL element at the start of the array. checks.c was modified to ignore the first element.treesource.c was modified to be C99 compliant.main() function was renamed to dtc_main() and is wrapped by Rust.strcasecmp is renamed to _stricmp inside dtc.c via a macro.getopt.c was taken from https://github.com/Chunde/getopt-for-windows as a drop-in replacement for the one from glibc.dirent.h was taken from https://github.com/tronkko/dirent.unistd.h was added that renames main and chain-includes dirent.h to define S_ISDIR and S_ISREG.build.rs performs the rename of main.version_gen.h gets generated indicating it comes from Rust.The version numbers are, unfortunately, out of sync with upstream. This will continue until upstream dtc reaches version 1.8.0.