Skip to content

Conversation

willieyz
Copy link
Contributor

@willieyz willieyz commented Aug 14, 2025

  • Resolves Add no-stdlib build for mlkem-native #963
  • This PR add an example demonstrating how to build mlkem-native without the standard library (-nostdlib)
    • Create an example folder named multilevel_build_no_stdlib
    • Add the example_no_stdlib_config.h reference from test/custom_stdlib_config.h,
      this config file provide custom implementations for mlk_memcpy and mlk_memset
    • Add the -nostdlib cflag during generating objects file.
    • Integrate this example to the tests script and ./Makefile

@willieyz willieyz force-pushed the add-no-stdlib-build branch 3 times, most recently from 4fdf64b to 2e4aaaa Compare August 15, 2025 10:42
@willieyz willieyz marked this pull request as ready for review August 15, 2025 11:07
@willieyz willieyz requested a review from a team as a code owner August 15, 2025 11:07
@mkannwischer mkannwischer marked this pull request as draft August 15, 2025 11:09
Copy link
Contributor

Choose a reason for hiding this comment

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

This README still needs to be adjusted

Copy link
Contributor Author

@willieyz willieyz Aug 15, 2025

Choose a reason for hiding this comment

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

Yes, thanks for the reminder!
I have addressed this and re-pushed the changes,
including

  • examples/README.md,
  • examples/multilevel_build_no_stdlib/README.md
  • mlkem/README.md

and also added this example to base.yml for the CI tests.

@willieyz willieyz force-pushed the add-no-stdlib-build branch 4 times, most recently from faec912 to cebb880 Compare August 15, 2025 11:39
@willieyz willieyz marked this pull request as ready for review August 15, 2025 13:15
Comment on lines 19 to 20
with `-nostdlib` flag, the `mlk_memcpy` and `mlk_memset` are replaced by custom implementation.
in such a way that level-independent code with no stadard libary is shared.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the grammar

Copy link
Contributor Author

@willieyz willieyz Aug 18, 2025

Choose a reason for hiding this comment

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

Hello Hanno, thank you for reviewing!
I have addressed the grammar issue and also restructured the explanation in what I believe is a better format.
I know this README is intended for users and serves as a formal document,
please feel free to let me know if there is anything you find inappropriate. I will make the adjustments until it meets expectations.

-Wno-unknown-pragmas \
-Wno-unused-command-line-argument \
-fomit-frame-pointer \
-DMLK_CONFIG_NAMESPACE_PREFIX=mlkem \
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: indentation

Copy link
Contributor Author

@willieyz willieyz Aug 18, 2025

Choose a reason for hiding this comment

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

Hello Hanno, thank you for reviewing!
I have addressed the indentation issue.
Additionally, since this Makefile is based on examples/multilevel_build/Makefile, and the same indentation issue appeared there as well, I have fixed it too.

@willieyz willieyz force-pushed the add-no-stdlib-build branch 4 times, most recently from 709a22c to abfc2dc Compare August 22, 2025 02:46
@willieyz willieyz force-pushed the add-no-stdlib-build branch from abfc2dc to b9ee08d Compare August 23, 2025 03:34
@willieyz willieyz force-pushed the add-no-stdlib-build branch from b9ee08d to 37163aa Compare September 5, 2025 02:36
- This commit add an example demonstrating how to build mlkem-native without the standard library (-nostdlib)
- Create an example folder named `multilevel_build_no_stdlib`
- Add the `example_no_stdlib_config.h` reference from `test/custom_stdlib_config.h`,
  this config provide custom implementations for mlk_memcpy and mlk_memset
- Add the `-nostdlib` cflag during generating objects file.
- Integrate this example to the `tests` script and ./Makefile
- Add this example to the `base.yml` for CI testing
Signed-off-by: willieyz <[email protected]>
@willieyz willieyz force-pushed the add-no-stdlib-build branch from 37163aa to e847379 Compare September 7, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add no-stdlib build for mlkem-native
3 participants