-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[Docs] Document freestanding requirements #132232
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
Changes from 1 commit
5008e3c
e6bcd39
537dc66
d593347
6576792
b88b4a0
74bbff4
bcd5db3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1076,13 +1076,11 @@ Language and Target-Independent Features | |
| Freestanding Builds | ||
| ------------------- | ||
| Passing the ``-ffreestanding`` flag causes Clang to build for a freestanding | ||
| (rather than a hosted) environment. The ``__STDC_HOSTED__`` predefined macro | ||
| will expand to ``0`` in a freestanding environment. In such an environment, | ||
| execution of the program may happen without an operating system and so a | ||
| startup function (e.g., ``main``) may not be automatically called, though file | ||
| scope objects which need to run startup code (constructors in C++, | ||
| ``__attribute__((constructor))``, etc) are executed via implementation-defined | ||
| means such as ``__cxx_global_var_init``. | ||
| (rather than a hosted) environment. The flag has the following effects: | ||
|
|
||
| * the ``__STDC_HOSTED__`` predefined macro will expand to ``0``, | ||
| * builtin functions are disabled (``-fno-builtins``), and | ||
| * unwind tables are disabled (``fno-asynchronous-unwind-tables -fno-unwind-tables``) | ||
|
|
||
| A freestanding environment is not one which has no C standard library support. | ||
|
||
| A conforming freestanding C standard library implementation is required. Clang | ||
|
|
@@ -1093,9 +1091,8 @@ Clause 4 (Conformance) of the C standard. Additionally, Clang requires the | |
| following runtime interfaces to be provided: | ||
|
|
||
| * `memcpy`, | ||
| * `memmove`, | ||
| * `memset`, and | ||
| * `memcmp`. | ||
| * `memmove`, and | ||
| * `memset`. | ||
|
|
||
| Controlling Errors and Warnings | ||
| ------------------------------- | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.