llvm-project/clang/docs
Fangrui Song 34b60d8a56 Add -fbinutils-version= to gate ELF features on the specified binutils version
There are two use cases.

Assembler
We have accrued some code gated on MCAsmInfo::useIntegratedAssembler().  Some
features are supported by latest GNU as, but we have to use
MCAsmInfo::useIntegratedAs() because the newer versions have not been widely
adopted (e.g. SHF_LINK_ORDER 'o' and 'unique' linkage in 2.35, --compress-debug-sections= in 2.26).

Linker
We want to use features supported only by LLD or very new GNU ld, or don't want
to work around older GNU ld. We currently can't represent that "we don't care
about old GNU ld".  You can find such workarounds in a few other places, e.g.
Mips/MipsAsmprinter.cpp PowerPC/PPCTOCRegDeps.cpp X86/X86MCInstrLower.cpp
AArch64 TLS workaround for R_AARCH64_TLSLD_MOVW_DTPREL_* (PR ld/18276),
R_AARCH64_TLSLE_LDST8_TPREL_LO12 (https://bugs.llvm.org/show_bug.cgi?id=36727 https://sourceware.org/bugzilla/show_bug.cgi?id=22969)

Mixed SHF_LINK_ORDER and non-SHF_LINK_ORDER components (supported by LLD in D84001;
GNU ld feature request https://sourceware.org/bugzilla/show_bug.cgi?id=16833 may take a while before available).
This feature allows to garbage collect some unused sections (e.g. fragmented .gcc_except_table).

This patch adds `-fbinutils-version=` to clang and `-binutils-version` to llc.
It changes one codegen place in SHF_MERGE to demonstrate its usage.
`-fbinutils-version=2.35` means the produced object file does not care about GNU
ld<2.35 compatibility. When `-fno-integrated-as` is specified, the produced
assembly can be consumed by GNU as>=2.35, but older versions may not work.

`-fbinutils-version=none` means that we can use all ELF features, regardless of
GNU as/ld support.

Both clang and llc need `parseBinutilsVersion`. Such command line parsing is
usually implemented in `llvm/lib/CodeGen/CommandFlags.cpp` (LLVMCodeGen),
however, ClangCodeGen does not depend on LLVMCodeGen. So I add
`parseBinutilsVersion` to `llvm/lib/Target/TargetMachine.cpp` (LLVMTarget).

Differential Revision: https://reviews.llvm.org/D85474
2021-01-26 12:28:23 -08:00
..
CommandGuide [clang][docs] Fix documentation of -O 2020-09-17 13:44:01 +01:00
analyzer [NFC][Docs] fix clang-docs compilation 2020-09-24 13:13:38 +02:00
tools [clang-format] Add the possibility to align assignments spanning empty lines or comments 2021-01-25 09:41:50 +01:00
APINotes.rst docs: add documentation describing API Notes 2020-10-05 18:29:13 +00:00
AddressSanitizer.rst [Docs] Modernize references to macOS 2019-05-30 16:46:22 +00:00
AutomaticReferenceCounting.rst Rewrite the non-trivial structs section of the ARC spec. 2020-03-06 02:51:45 -05:00
Block-ABI-Apple.rst Fix the type of the invoke function in the block ABI documentation 2020-09-04 10:29:09 -07:00
Block-ABI-Apple.txt
BlockLanguageSpec.rst
CMakeLists.txt fix comment typo to cycle bots 2020-04-06 18:58:27 -04:00
ClangCheck.rst
ClangCommandLineReference.rst Revert "Support for instrumenting only selected files or functions" 2021-01-26 12:25:28 -08:00
ClangFormat.rst Fix -Wno-error= parsing in clang-format. 2020-12-17 22:23:42 +01:00
ClangFormatStyleOptions.rst Revert "[clang-format] add case aware include sorting" 2021-01-26 11:58:56 +01:00
ClangFormattedStatus.rst [clang-format] NFC update in the overall clang-formatted status 2020-12-04 20:10:10 +00:00
ClangOffloadBundler.rst [Clang][Docs] Fix ambiguity in clang-offload-bundler docs 2021-01-11 17:23:24 +00:00
ClangPlugins.rst Add an attribute plugin example 2020-03-25 14:33:44 +00:00
ClangStaticAnalyzer.rst [analyzer]Add user docs rst 2019-07-10 14:49:53 +00:00
ClangTools.rst
ConstantInterpreter.rst [docs] Fix warnings in ConstantInterpreter 2020-05-23 19:36:05 +00:00
ControlFlowIntegrity.rst [docs] Update ControlFlowIntegrity.rst. 2020-10-02 12:01:05 -07:00
ControlFlowIntegrityDesign.rst
CrossCompilation.rst
DataFlowSanitizer.rst [docs] Add missing semicolon to example. 2020-08-14 13:46:05 -07:00
DataFlowSanitizerDesign.rst
DiagnosticsReference.rst Revert "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2020-11-14 13:12:38 +03:00
DriverArchitecture.png
DriverInternals.rst
ExternalClangExamples.rst
FAQ.rst
HardwareAssistedAddressSanitizerDesign.rst AArch64: Use SBFX instead of UBFX to extract address granule in outlined HWASan checks. 2020-10-30 12:53:15 -07:00
HowToSetupToolingForLLVM.rst Don't call anyone lazy in the documentation. 2020-03-17 16:33:28 -04:00
InternalsManual.rst Add ParsedAttrInfo::handleDeclAttribute 2020-03-23 13:23:11 +00:00
IntroductionToTheClangAST.rst
ItaniumMangleAbiTags.rst
JSONCompilationDatabase.rst
LTOVisibility.rst [Docs] Document --lto-whole-program-visibility 2020-08-25 19:44:54 -07:00
LanguageExtensions.rst [SVE] Add support to vectorize_width loop pragma for scalable vectors 2021-01-08 11:37:27 +00:00
LeakSanitizer.rst [Docs] Modernize references to macOS 2019-05-30 16:46:22 +00:00
LibASTImporter.rst Doc: Links should use https 2020-03-22 22:49:33 +01:00
LibASTMatchers.rst
LibASTMatchersReference.html [ASTMatchers] Add support for CXXRewrittenBinaryOperator 2021-01-16 13:44:22 +00:00
LibASTMatchersTutorial.rst fix a doc typo to cycle bots 2019-12-20 21:39:01 -05:00
LibFormat.rst [clang-format][docfix] Update predefined styles in docs 2020-05-20 20:03:53 -04:00
LibTooling.rst [Tooling] Migrated APIs that take ownership of objects to unique_ptr 2019-08-30 09:29:34 +00:00
MSVCCompatibility.rst
Makefile.sphinx
MatrixTypes.rst typo fixes to cycle bots 2020-07-01 19:20:05 -04:00
MemorySanitizer.rst [ReleaseNotes] MemorySanitizer support of ASLR on FreeBSD 2019-08-27 10:04:03 +00:00
Modules.rst Allow searching for prebuilt implicit modules. 2020-11-10 10:14:13 -08:00
ObjectiveCLiterals.rst
OpenCLSupport.rst [OpenCL][Docs] Describe tablegen BIFs declarations. 2021-01-25 11:17:03 +00:00
OpenMPSupport.rst [OpenMP][Docs] Mark finished features as done 2021-01-07 14:39:18 -06:00
PCHInternals.rst
PCHLayout.graffle
PCHLayout.png
RAVFrontendAction.rst [Tooling] Migrated APIs that take ownership of objects to unique_ptr 2019-08-30 09:29:34 +00:00
README.txt
RefactoringEngine.rst
ReleaseNotes.rst Add -fbinutils-version= to gate ELF features on the specified binutils version 2021-01-26 12:28:23 -08:00
SafeStack.rst [Docs] Modernize references to macOS 2019-05-30 16:46:22 +00:00
SanitizerCoverage.rst [SanitizeCoverage] Rename -fsanitize-coverage-{white,black}list to -fsanitize-coverage-{allow,block}list 2020-06-19 22:22:47 -07:00
SanitizerSpecialCaseList.rst
SanitizerStats.rst
ShadowCallStack.rst
SourceBasedCodeCoverage.rst Revert "Support for instrumenting only selected files or functions" 2021-01-26 12:25:28 -08:00
ThinLTO.rst [docs] Try to make this bullet list in ThinLTO.rst actually be a bullet list 2020-11-24 14:08:42 +01:00
ThreadSafetyAnalysis.rst Thread safety analysis: Improve documentation for ASSERT_CAPABILITY 2020-09-26 22:16:50 +02:00
ThreadSanitizer.rst
Toolchain.rst
Tooling.rst
UndefinedBehaviorSanitizer.rst Add an unsigned shift base sanitizer 2020-08-27 19:50:10 -07:00
UsersManual.rst Revert "Support for instrumenting only selected files or functions" 2021-01-26 12:25:28 -08:00
conf.py Bump the trunk major version to 12 2020-07-15 12:05:05 +02:00
doxygen-mainpage.dox
doxygen.cfg.in [NFC] Remove LLVM_ALIGNAS 2019-07-31 03:22:08 +00:00
index.rst [NFC] Add CLangOffloadBundler documentation to Clang index 2020-12-02 02:47:44 +00:00
make.bat

README.txt

See llvm/docs/README.txt