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.

See Section 3.4.1


See Section 3.4.2

-c -E -S -pipe
-o file
-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

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
-fuse-cxa-atexit -nobuiltininc -nostdinc++
-Wc++0x-compat -Wno-deprecated
-Wnon-virtual-dtor -Woverloaded-virtual

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
-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

See Section 3.4.6

-dumpmachine -dumpversion
-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-show-name -fno-diagnostics-show-name
-fdiagnostics-show-option -fno-diagnostics-show-option
-fdiagnostics-fixit-info -fno-diagnostics-fixit-info
-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

Compiler Crash Diagnosis
See Section 3.4.9


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
-Wtrigraphs -Wundef -Wunused-macros
-Xpreprocessor option

See Section 3.4.11

-Xassembler option

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

-F dir -I dir

Processor Version
See Section 3.4.14

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

code generation
See Section 3.4.15

-fno-common -femit-all-data -femit-all-decls
-fpic -fPIC -fpie -fPIE
-fshort-enums -fno-short-enums
-fshort-wchar -fshort-wchar
-ftrap-function=value -ftrapv -ftrapv-handler
-funwind-tables -fverbose-asm -fwrapv
-G size

See Section 3.4.16

-fvectorize-loops -fvectorize-loops-debug

See Section 3.4.17

Specific optimization**
See 3.4.18 section

-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

Link time optimization
See Section 3.4.20

-S-lto -c-lto -Wlto arg,...
-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

Tags: tools llvm

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