Introduction to Hexagon LLVM Compilation Architecture

3.3 Input and output files

The LLVM compiler preprocesses and compiles one or more C source files into an assembly source file. The compiler then calls the Hexagon assembler, which converts the assembly source files into target files. The compiler eventually calls the linker, which combines the target files into an executable file.

Table 3-1 lists the input file types and tools for handling each type of file. The compiler uses file extensions to determine how to handle files.


Be careful:
All file extensions are case-sensitive text strings. Input files with unrecognized extensions are considered target files.
For more information on assemblies and target files, see the Hexagon Utilities user guide.

Table 3-2 lists the output file types and the tools used to generate each file type. The compiler option (section 3.4) specifies the output file type.


Be careful:
If the output file name is not explicitly specified (with the -o option), the compiler will use the default file name listed in tables 3-2.

3.4 Compiler Options

The LLVM compiler is controlled by command line options (section 3.2). Many GCC options are supported, as well as LLVM-specific options.

Be careful:
many -f , -m and -W Options can be written in two ways:-fsetting Enable binary settings, or -fno-setting Disable settings.

Exhibition
See Section 3.4.1

-help
-v

assembly
See Section 3.4.2

-###
-c -E -S -pipe
-o file
-Wp,arg[,arg...]
-Wa,arg[,arg...]
-Wl,arg[,arg...]
-x language

C dialect
See Section 3.4.3

-ansi -fno-asm -fno-builtin
-ffreestanding -fgnu-runtime -fgnu89-inline
-fsigned-bitfields -fsigned-char -funsigned-char
-no-integrated-cpp -std=standard
-traditional -traditional-cpp -trigraphs
-Wpointer-sign

C++ dialect
See Section 3.4.4

-cxx-isystem dir
-fno-access-control -fno-elide-constructors
-ffor-scope -fno-for-scope -fno-gnu-keywords
-fms-extensions -fno-operator-names -fno-rtti
-ftemplate-depth-n -fno-threadsafe-statics
-fvisibility-inlines-hidden
-fuse-cxa-atexit -nobuiltininc -nostdinc++
-Wc++0x-compat -Wno-deprecated
-Wnon-virtual-dtor -Woverloaded-virtual
-Wreorder

Warning and error messages
See Section 3.4.5

-ferror-limit=n -ftemplate-backtrace-limit=n
-ferror-warn filename -fsyntax-only -pedantic
-pedantic-errors -Q-unused-arguments
-w -Wfoo -Wno-foo -Wall -Warray-bounds
-Wcast-align -Wchar-subscripts
-Wcomment -Wconversion
-Wdeclaration-after-statement -Wno-deprecated-declarations
-Wempty-body -Wendif-labels -Werror
-Werror=foo -Wno-error=foo
-Werror-implicit-function-declaration
-Weverything -Wextra -Wfloat-equal
-Wformat -Wformat=2 -Wno-format-extra-args
-Wformat-nonliteral -Wformat-security -Wignored-qualifiers
-Wimplicit -Wimplicit-function-declaration -Wimplicit-int
-Wno-invalid-offsetof -Wlong-long -Wmain
-Wmissing-braces -Wmissing-declarations
-Wmissing-noreturn -Wmissing-prototypes -Wno-multichar
-Wnonnull -Wpacked -Wpadded -Wparentheses -Wpointer-arith
-Wreturn-type -Wshadow -Wsign-compare
-Wswitch -Wswitch-enum -Wsystem-headers
-Wtrigraphs -Wundef -Wuninitialized -Wunknown-pragmas
-Wunreachable-code -Wunused -Wunused-function -Wunused-label
-Wunused-parameter -Wunused-value -Wunused-variable
-Wwrite-strings

debugging
See Section 3.4.6

-dumpmachine -dumpversion
-feliminate-unused-debug-symbols
-ftime-report -g[level] -print-file-name=library
-print-libgcc-file-name -print-multi-directory
-print-multi-lib -print-multi-os-directory
-print-prog-name=program -print-search-dirs
-save-temps -time

Diagnostic Format
See Section 3.4.7

-fcaret-diagnostics -fno-caret-diagnostics
-fcolor-diagnostics -fno-color-diagnostics
-fdiagnostics-format=(clang|msvc|vi)
-fdiagnostics-show-name -fno-diagnostics-show-name
-fdiagnostics-show-option -fno-diagnostics-show-option
-fdiagnostics-show-category=(none|id|name)
-fdiagnostics-fixit-info -fno-diagnostics-fixit-info
-fdiagnostics-print-source-range-info
-fno-diagnostics-print-source-range-info
-fdiagnostics-parseable-fixits
-fdiagnostics-show-note-include-stack
-fdiagnostics-show-template-tree
-fno-elide-type -fmessage-length=n
-fshow-column -fno-show-column
-fshow-source-location -fno-show-source-location

Individual warning groups
See Section 3.4.8

-Wextra-tokens -Wambiguous-member-template
-Wbind-to-temporary-copy

Compiler Crash Diagnosis
See Section 3.4.9

-fno-crash-diagnostics

Preprocessor
See Section 3.4.10

-A pred=ans -A -pred=ans -ansi -C -CC
-d(DMN) -D name -D name=definition
-fdollars-in-identifiers -fexec-charset=charset
-finput-charset=charset -fpch-deps -fpreprocessed
-fno-show-column -fstrict-overflow
-ftabstop=width -fwide-exec-charset=charset
-fworking-directory --help -H -I dir -I-
-idirafter dir -imacros file -include file
-iprefix prefix -isystem dir -iwithprefix dir
-iwithprefixbefore dir -M -MD -MF file
-MG -MM -MMD -MP -MQ target -MT target
-nostdinc -nostdinc++ -o file -P
-remap -std=standard --target-help -traditional-cpp
-trigraphs -U name -undef -v -version
--version -w -Wall -Wcomment
-Wcomments -Wendif-labels -Werror -Wimport
-Wsystem-headers
-Wtrigraphs -Wundef -Wunused-macros
-Xpreprocessor option

assembly
See Section 3.4.11

-Xassembler option

link
See Section 3.4.12

object_file_name -c -dynamic -E
-l library -mG0lib -moslib=library
-nodefaultlibs -nostartfiles -nostdlib
-pie -s -S -shared -shared-libgcc
-static -static-libgcc
-symbolic -u symbol -Xlinker option

Directory Search
See Section 3.4.13

-Bprefix
-F dir -I dir
-I-
-Ldir

Processor Version
See Section 3.4.14

-march=archname -mcpu=archname
-mv4 -mv5 -mv55

code generation
See Section 3.4.15

-fasynchronous-unwind-tables
-fno-common -femit-all-data -femit-all-decls
-fno-exceptions
-finstrument-functions
-fmerge-functions
-fpack-struct=n
-fpic -fPIC -fpie -fPIE
-fshort-enums -fno-short-enums
-fshort-wchar -fshort-wchar
-ftrap-function=value -ftrapv -ftrapv-handler
-funwind-tables -fverbose-asm -fwrapv
-fvisibility=[default|internal|hidden|protected]
-G size
-mno-global-merge
-mlong-calls
-pthread

Vectorization
See Section 3.4.16

-fvectorize-loops -fvectorize-loops-debug

optimization
See Section 3.4.17

-O
-O0
-O1
-O2
-O3
-Os
```**
Specific optimization**
See 3.4.18 section

```bash
-falign-functions[=n] -falign-jumps[=n]
-falign-labels[=n] -falign-loops[=n]
-fdata-sections -ffunction-sections
-finline -finline-functions
-fnomerge-all-constants -fomit-frame-pointer
-foptimize-sibling-calls -fstack-protector
-fstack-protector-all -fstrict-aliasing
-funit-at-a-time -funroll-all-loops
-funroll-loops -fno-zero-initialized-in-bss

Mathematical optimization
See Section 3.4.19

-fassociative-math -ffast-math -ffinite-math-only
-fmath-errno -fno-math-errno -freciprocal-math
-fno-signed-zeros -fno-trapping-math
-funsafe-math-optimizations

Link time optimization
See Section 3.4.20

-S-lto -c-lto -Wlto arg,...
-flto-scope=(program|library)
-lto-no-inter-mod-inline -lto-w-no-unknown-sym
-lto-preserve symbol -lto-preserve-list filename

Security Programming
See Section 3.4.21

-analyze -compile-and-analyze dir
-analyzer-output type
-analyzer-checker=checker
-analyzer-disable-checker=checker
-analyzer-checker-help

Tags: tools llvm

Posted on Sat, 18 Sep 2021 23:26:39 -0400 by DeFacto