[clang] [Docs] Document freestanding requirements (PR #132232)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 21 11:20:44 PDT 2025
================
@@ -1073,6 +1073,29 @@ inputs. Here is some example of ``$``-prefixed options:
Language and Target-Independent Features
========================================
+Freestanding Builds
+-------------------
+Passing the ``-ffreestanding`` flag causes Clang to build for a freestanding
+(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``),
+* unwind tables are disabled (``fno-asynchronous-unwind-tables -fno-unwind-tables``),
+* allows ``main`` to be used as a regular function, and
+* removes implicit system header search paths and link libraries.
----------------
jhuber6 wrote:
That's my bad, I confused it with `-nostdlib` because they usually go together.
https://github.com/llvm/llvm-project/pull/132232
More information about the cfe-commits
mailing list