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

Build system cleanups, provide minimal <inttypes.h> #76

Merged
merged 3 commits into from
May 6, 2020

Conversation

mato
Copy link
Contributor

@mato mato commented May 6, 2020

The primary goal here is to provide a minimal <inttypes.h>, which fixes #60. The associated changes improve the build system, notably adding compile-testing of all public headers provided by nolibc.

See individual commits for details:

  • Build system cleanup, remove build/ (a5b14dd)
  • nolibc: Compile-test public headers at build time (7ca57b9)
  • nolibc: Provide a minimal <inttypes.h> (38a35e1)

/cc @hannesm @emillon @dinosaure (you asked for/could use an inttypes.h) @samoht (build system changes)

mato added 3 commits May 6, 2020 09:16
This change removes the use of build/ in the build system.

This was forcing unnecessary ordering dependencies between nolibc,
openlibm and the OCaml runtime, and making it necessary to jump through
various hoops when doing "in-tree" development.

An additional benefit is that parallel builds are now deterministic
(always either fail due to a real error or complete fully), whereas
previously they could randomly fail due to the ordering issue mentioned
above.

The OCaml runtime is now the only code that is copied into the tree,
from $(ocamlfind query ocaml-src) into ocaml/.

The following minor changes have also been done:

- Replace unnecessary use of -isystem in the internal build with -I.
This is actually harmful as it relaxes C standards applied to those
headers in unpredictable ways, see [1].

[1]
https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html#System-Headers
and description of -isystem in
https://gcc.gnu.org/onlinedocs/cpp/Invocation.html#Invocation
This change tests at build time that each nolibc-provided public header
file is a) self-contained and b) compiles with no errors.
Add an inttypes.h derived from musl, providing only the PRIXXX macros
for use by printf-style format strings.
Copy link
Member

@dinosaure dinosaure left a comment

Choose a reason for hiding this comment

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

Nice pull-request 👍 (clear explanation) and thanks for this update. I trust on you and the CI then.

@mato mato mentioned this pull request May 6, 2020
@mato
Copy link
Contributor Author

mato commented May 6, 2020

Acked by @hannesm in #77, merging.

@mato mato merged commit 46a715a into mirage:master May 6, 2020
@mato mato deleted the test-headers branch May 6, 2020 13:37
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.

How to add support for <inttypes.h>
2 participants