[clang] [Docs] Document freestanding requirements (PR #132232)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 27 08:57:04 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:
It might be worth expanding on what being a regular symbol entails. I guess it's the ability to take address of it and the ability to call it, but it's not exactly clear to me, either.
https://github.com/llvm/llvm-project/pull/132232
More information about the cfe-commits
mailing list