[clang] [Docs] Document freestanding requirements (PR #132232)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 21 11:19:27 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.
----------------
efriedma-quic wrote:
I don't see any code in clang that "removes implicit system header search paths and link libraries" if you pass -ffreestanding. Can someone point me to it?
https://github.com/llvm/llvm-project/pull/132232
More information about the cfe-commits
mailing list