[clang] [Docs] Document freestanding requirements (PR #132232)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 27 09:02:32 PDT 2025


================
@@ -1073,6 +1073,35 @@ 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 by default (``-fno-builtins``),
+* unwind tables are disabled by default 
+  (``fno-asynchronous-unwind-tables -fno-unwind-tables``), and
+* allows ``main`` to be used as a regular symbol.
----------------
Endilll wrote:

Makes sense. Also, I think you just confirmed that clarification I'm asking for would be helpful, since I forgot couple of important aspects of it.

https://github.com/llvm/llvm-project/pull/132232


More information about the cfe-commits mailing list