FLANG(1)
โจ FLANG(1) โจ โ flang, the Flang Fortran compiler ๐
๐ NAME ๐
flang โ the Flang Fortran compiler. That's the whole name situation, bestie: it's flang, it's the Flang compiler, and it speaks Fortran. ๐
๐ธ SYNOPSIS ๐ธ
flang [options] filename ...
๐ฆ DESCRIPTION ๐ฆ
Okay so flang is a Fortran compiler that supports all of Fortran 95 and many newer language features. It supports OpenMP and has some support for OpenACC and CUDA. It encompasses preprocessing, parsing, optimization, code generation, assembly, and linking. Depending on the options you pass in, Flang will do only some โ or literally all โ of these actions. While Flang is highly integrated, it's important to understand the stages of compilation so you know how to invoke it. These stages are:
- Driver โ The
flangexecutable is actually a small driver that orchestrates the execution of other tools such as the compiler, assembler, and linker. Typically you don't need to interact with the driver, but you transparently use it to run the other tools. - Preprocessing โ This stage performs tokenization of the input source file, macro expansion,
#includeexpansion, and handles other preprocessor directives. - Parsing and Semantic Analysis โ This stage parses the input file, translating preprocessor tokens into a parse tree. Once it's in the form of a parse tree, it applies semantic analysis to compute types for expressions and determine whether the code is well formed. Parse errors and most compiler warnings are generated by this stage.
- Code Generation and Optimization โ This stage translates the parse tree into intermediate code (known as "LLVM IR") and, ultimately, machine code. It also optimizes this intermediate code and handles target-specific code generation. The output of this stage is typically a
.sfile, referred to as an "assembly" file. Flang also supports the use of an integrated assembler, in which the code generator produces object files directly. This avoids the overhead of generating the.sfile and calling the target assembler explicitly. - Assembler โ This stage runs the target assembler to translate the output of the compiler into a target object file. The output of this stage is typically a
.ofile, referred to as an "object" file. - Linker โ This stage runs the target linker to merge multiple object files into an executable or dynamic library. The output of this stage is typically an
a.out,.dylib, or.sofile.
๐ OPTIONS ๐
-B<prefix>โ Search$prefix$filefor executables, libraries, and data files. If$prefixis a directory, search$prefix/$file.-Qunused-argumentsโ Don't emit warning for unused driver arguments.--config=<file>,--config <arg>โ Specify configuration file.-dumpmachineโ Display the compiler's target processor.-dumpversionโ Display the version of the compiler.-fdo-concurrent-to-openmp=<arg>โ Try to mapdo concurrentloops to OpenMP[none|host|device].<arg>must be'none',' host'or' device'.-finit-global-zero,-fno-init-global-zeroโ Zero initialize globals without default initialization (default).-fppc-native-vector-element-order,-fno-ppc-native-vector-element-orderโ Specifies PowerPC native vector element order (default).-frepack-arrays,-fno-repack-arraysโ Create temporary copies of non-contiguous assumed shape dummy arrays in subprogram prologues, and destroy them in subprogram epilogues. The temporary copy is initialized with values from the original array in the prologue, if needed. In the epilogue, the current values in the temporary array are copied into the original array, if needed. Accessing the contiguous temporary in the program code may result in faster execution comparing to accessing elements of the original array, when they are sparse in memory. At the same time, the overhead of copying values between the original and the temporary arrays may be significant, which may slow down some programs. Enabling array repacking may also change the behavior of certain programs:- The copy actions may introduce a data race in valid OpenACC/OpenMP programs. For example, if different threads execute the same subprogram with a non-contiguous assumed shape dummy array, and the different threads access unrelated parts of the array, then the whole array copy made in each thread will cause a data race.
- OpenACC/OpenMP offload programs may behave incorrectly with regards to the device data environment, due to the fact that the original array and the temporary may have different presence status on the device.
IS_CONTIGUOUSintrinsic may returnTRUEwith the array repacking enabled, whereas it would returnFALSEwith the repacking disabled.- The result of
LOCintrinsic applied to an actual argument associated with a non-contiguous assumed shape dummy array may be different from the result ofLOCapplied to the dummy array.
-frtlib-add-rpath,-fno-rtlib-add-rpathโ Add-rpathwith architecture-specific resource directory to the linker flags. When--hip-linkis specified, also add-rpathwith HIP runtime library directory to the linker flags.-fsave-main-program,-fno-save-main-programโ Place all main program variables in static memory (otherwise scalars may be placed on the stack).-fstack-arrays,-fno-stack-arraysโ Attempt to allocate array temporaries on the stack, no matter their size.-fstack-repack-arrays,-fno-stack-repack-arraysโ Controls whether the array temporaries created under-frepack-arraysare allocated on the stack or on the heap. By default, the heap is used. Allocations of polymorphic types are always done on the heap, though this may change in future releases.-funsafe-cray-pointers,-fno-unsafe-cray-pointersโ Optimizations allow for unsafe Cray pointer usages.-fversion-loops-for-stride,-fno-version-loops-for-strideโ Create unit-strided versions of loops.--gcc-install-dir=<arg>โ Use GCC installation in the specified directory. The directory ends with path components likelib{,32,64}/gcc{,-cross}/$triple/$version. Note: executables (e.g.ld) used by the compiler are not overridden by the selected GCC installation.--gcc-toolchain=<arg>โ Specify a directory where Flang can findlib{,32,64}/gcc{,-cross}/$triple/$version. Flang will use the GCC installation with the largest version.--gcc-triple=<arg>โ Search for the GCC installation with the specified triple.-gpulibcโ Link the LLVM C Library for GPUs.-help,--helpโ Display available options.--help-hiddenโ Display help for hidden options.-mllvm <arg>,-mllvm=<arg>โ Additional arguments to forward to LLVM's option processing.-mmlir <arg>โ Additional arguments to forward to MLIR's option processing.-module-dir<dir>,-J<arg>โ This option specifies where to put.modfiles for compiled modules. It is also added to the list of directories to be searched by anUSEstatement. The default is the current directory.--no-default-configโ Disable loading default configuration files.-nodefaultlibsโ (no description given in the original here, bestie โ just the flag itself).-nogpulibcโ (no description given in the original here, bestie โ just the flag itself).-nopieโ (no description given in the original here, bestie โ just the flag itself).-o<file>โ Write output to<file>.--offloadlib,--no-offloadlibโ Link device libraries for GPU device compilation.-print-effective-triple,--print-effective-tripleโ Print the effective target triple.-print-resource-dir,--print-resource-dirโ Print the resource directory pathname that containslibandincludedirectories with the runtime libraries andMODULEfiles.-print-target-triple,--print-target-tripleโ Print the normalized target triple.-pthread,-no-pthreadโ Support POSIX threads in generated code.-resource-dir <arg>,-resource-dir=<arg>โ The directory which holds the compiler resource files.-rtlib=<arg>,--rtlib=<arg>โ Compiler runtime library to use.-save-temps=<arg>,--save-temps=<arg>,-save-temps(equivalent to-save-temps=cwd),--save-temps(equivalent to-save-temps=cwd) โ Save intermediate compilation results.<arg>can be set to'cwd'for current working directory, or'obj'which will save temporary files in the same directory as the final output file.--sysroot=<arg>โ (no description given in the original here, bestie โ just the flag itself).--target=<arg>,-target <arg>โ Generate code for the given target.-vโ Show commands to run and use verbose output.--versionโ Print version information.-w,--no-warningsโ Suppress all warnings.-x<language>โ Treat subsequent input files as having type<language>.
๐ Actions ๐
The action to perform on the input.
-Eโ Only run the preprocessor.-Sโ Only run preprocess and compilation steps.-cโ Only run preprocess, compile, and assemble steps.-emit-llvmโ Use the LLVM representation for assembler and object files.-fsyntax-onlyโ Run the preprocessor, parser and semantic analysis stages.
โจ Compilation options โจ
Flags controlling the behavior of Flang during compilation. These flags have no effect during actions that do not perform compilation.
-Xflang <arg>โ Pass<arg>to the flang compiler.-moutline-atomics,-mno-outline-atomicsโ Generate local calls to out-of-line atomic operations.-print-supported-cpus,--print-supported-cpus,-mcpu=help,-mtune=helpโ Print supported cpu models for the given target (if target is not specified, it will print the supported cpus for the default target).-std=<arg>,--std=<arg>โ Language standard to compile for.
๐ง Preprocessor options ๐ง
Flags controlling the behavior of the Flang preprocessor.
-D<macro>=<value>โ Define<macro>to<value>(or 1 if<value>omitted).-Pโ Disable linemarker output in-Emode.-U<macro>โ Undefine macro<macro>.
๐ Include path management ๐
Flags controlling how #includes are resolved to files.
-I<dir>โ Add directory to include search path. For C++ inputs, if there are multiple-Ioptions, these directories are searched in the order they are given before the standard system directories are searched. If the same directory is in theSYSTEMinclude search paths, for example if also specified with-isystem, the-Ioption will be ignored.-isysroot<dir>โ Set the system root directory (usually/).
๐ Dumping preprocessor state ๐
Flags allowing the state of the preprocessor to be dumped in various ways.
-dMโ Print macro definitions in-Emode instead of normal output.
๐ Diagnostic options ๐
Flags controlling which warnings, errors, and remarks Flang will generate. See Clang's Diagnostic Reference for a full list of warning and remark flags.
-R<remark>โ Enable the specified remark.-Rpass-analysis=<arg>โ Report transformation analysis from optimization passes whose name matches the given POSIX regular expression.-Rpass-missed=<arg>
And for the ones that didn't fire? Report missed transformations by optimization passes whose name matches the given POSIX regular expression ๐ซถ
-Rpass=<arg>โ Report transformations performed by optimization passes whose name matches the given POSIX regular expression-W<warning>โ turn on the warning you just named, periodt.
โจ Target-independent compilation options โจ
okay this is the big one, grab a snack ๐
-cppโ turn on the predefined macros and the command-line preprocessor macros ๐-fPIC,-fno-PIC-fPIE,-fno-PIE-falternative-parameter-statementโ enables the old stylePARAMETERstatement, the vintage one โจ-fapprox-func,-fno-approx-funcโ lets certain math function calls get swapped out for an approximately equivalent calculation-fassociative-math,-fno-associative-math-fatomic-fine-grained-memory,-fno-atomic-fine-grained-memoryโ may have atomic operations on fine-grained memory-fatomic-ignore-denormal-mode,-fno-atomic-ignore-denormal-mode,-munsafe-fp-atomicsโ lets atomic operations ignore denormal mode-fatomic-remote-memory,-fno-atomic-remote-memoryโ may have atomic operations on remote memory-fbackslash,-fno-backslashโ says a backslash inside a string introduces an escape character-fbuiltin,-fno-builtin-fcoarrayโ enables Coarray features ๐-fcolor-diagnostics,-fdiagnostics-color,-fno-color-diagnosticsโ enables colors in diagnostics (yes queen, make the errors pretty)-fcomplex-arithmetic=<arg>โ controls how complex number multiplication and division get calculated. arg must be'full','improved','promoted'or'basic'.-fconvert=<arg>โ set endian conversion of data for unformatted files-fd-lines-as-code,-fno-d-lines-as-codeโ treat fixed form lines with'd'or'D'in the first column as blank.-fd-lines-as-comments,-fno-d-lines-as-commentsโ treat fixed form lines with'd'or'D'in the first column as comments.-fdefault-double-8โ set the default double precision kind to an 8 byte wide type-fdefault-integer-4โ set the default integer and logical kind to a 4 byte wide type-fdefault-integer-8โ set the default integer and logical kind to an 8 byte wide type-fdefault-real-4โ set the default real kind to a 4 byte wide type-fdefault-real-8โ set the default real kind to an 8 byte wide type-fdiagnostics-color=<arg>โ when to use colors in diagnostics. arg must be'auto','always'or'never'.-fexperimental-loop-fusion,-fno-experimental-loop-fusionโ enable the loop fusion pass ๐ฅ-ffast-math,-fno-fast-mathโ allows aggressive, lossy floating-point optimizations. it's giving "we ball" energy, so know what you're doing.-ffast-real-mod,-fno-fast-real-modโ enable optimization ofMODforREALtypes-ffat-lto-objects,-fno-fat-lto-objectsโ enable fat LTO object support-ffixed-formโ process source files in fixed form-ffixed-line-length=<arg>,-ffixed-line-length-<arg>โ set the column after which characters are ignored in typical fixed-form lines in the source file-ffp-contract=<arg>โ form fused FP ops (e.g. FMAs). the tea:fastโ fuses across statements, disregarding pragmasonโ only fuses in the same statement unless dictated by pragmasoffโ never fusesfast-honor-pragmasโ fuses across statements unless dictated by pragmas
default is 'fast' for CUDA, 'fast-honor-pragmas' for HIP, and 'on' otherwise. arg must be 'fast', 'on', 'off' or 'fast-honor-pragmas'.
-ffree-formโ process source files in free form ๐ฆ-fhermetic-module-filesโ emit hermetic module files (no nestedUSEassociation)-fhonor-infinities,-fno-honor-infinitiesโ says floating-point optimizations aren't allowed to assume arguments and results aren't+-inf.-fhonor-nans,-fno-honor-nansโ says floating-point optimizations aren't allowed to assume arguments and results aren't NANs.-fimplicit-none,-fno-implicit-noneโ no implicit typing allowed unless anIMPLICITstatement overrides it-fimplicit-none-ext,-fno-implicit-none-extโ no implicit externals allowed-finput-charset=<arg>โ specify the default character set for source files-finstrument-functionsโ generate calls to instrument function entry and exit-fintegrated-as,-fno-integrated-asโ enable the integrated assembler-fintrinsic-modules-path <dir>,-fintrinsic-modules-path=<arg>โ this one tells the compiler where your pre-compiled intrinsic modules live, for when they're not in the default location it expects. ๐-flarge-sizesโ useINTEGER(KIND=8)for the result type in size-related intrinsics-flogical-abbreviations,-fno-logical-abbreviationsโ enable logical abbreviations-floop-interchange,-fno-loop-interchangeโ enable the loop interchange pass-flto-partitions=<arg>โ how many partitions to use for parallel full LTO codegen,ld.lldonly.-flto=<arg>,-flto(equivalent to-flto=full),-flto=auto(equivalent to-flto=full),-flto=jobserver(equivalent to-flto=full) โ set LTO mode. arg must be'thin'or'full'.-fms-runtime-lib=<arg>โ specify Visual Studio C runtime library."static"and"static_dbg"correspond to the cl flags/MTand/MTdwhich use the multithread, static version."dll"and"dll_dbg"correspond to the cl flags/MDand/MDdwhich use the multithread, dll version. arg must be'static','static_dbg','dll'or'dll_dbg'.-fomit-frame-pointer,-fno-omit-frame-pointerโ omit the frame pointer from functions that don't need it. some stack unwinding cases, like profilers and sanitizers, may prefer you specify-fno-omit-frame-pointer. on many targets,-O1and higher omit the frame pointer by default.-m[no-]omit-leaf-frame-pointertakes precedence for leaf functions. ๐-fopenaccโ enable OpenACC-fopenmp,-fno-openmpโ parse OpenMP pragmas and generate parallel code.-fopenmp-force-usmโ force behavior as if the user specifiedpragma omp requires unified_shared_memory.-fopenmp-simd,-fno-openmp-simdโ emit OpenMP code only for SIMD-based constructs.-fopenmp-target-debug,-fno-openmp-target-debugโ enable debugging in the OpenMP offloading device RTL-fopenmp-version=<arg>โ set OpenMP version (e.g.45for OpenMP 4.5,51for OpenMP 5.1). default value is31for Flang.-fopenmp=<arg>-foptimization-record-file=<file>โ specify the output name of the file containing the optimization remarks. implies-fsave-optimization-record. on Darwin platforms, this cannot be used with multiple-arch <arch>options. ๐ซ-foptimization-record-passes=<regex>โ only include passes which match a specified regular expression in the generated optimization record (by default, include all passes)-fpass-plugin=<dsopath>โ load pass plugin from a dynamic shared object file (only with new pass manager).-fpic,-fno-pic-fpie,-fno-pie-fprofile-generateโ generate instrumented code to collect execution counts intodefault.profraw(overridden by theLLVM_PROFILE_FILEenv var)-fprofile-use=<pathname>โ use instrumentation data for profile-guided optimization. if pathname is a directory, it reads from<pathname>/default.profdata. otherwise, it reads from file pathname.-frealloc-lhs,-fno-realloc-lhsโ if an allocatable left-hand side of an intrinsic assignment is unallocated, or its shape/type doesn't match the right-hand side, then it gets automatically (re)allocated โจ-freciprocal-math,-fno-reciprocal-mathโ allow division operations to be reassociated-frecord-command-line,-fno-record-command-lineโ generate a section named".GCC.command.line"containing the driver command-line. after linking, the section may contain multiple command lines, which will be individually terminated by null bytes. separate arguments within a command line are combined with spaces; spaces and backslashes within an argument are escaped with backslashes. this format differs from the format of the equivalent section produced by GCC with the-frecord-gcc-switchesflag. this option is currently only supported on ELF targets.-frepack-arrays-contiguity=<arg>โ when-frepack-arraysis in effect,'whole'enables repacking for arrays that are non-contiguous in any dimension,'innermost'enables repacking for arrays that are non-contiguous in the innermost dimension (the default). arg must be'whole'or'innermost'.-fropi,-fno-ropiโ generate read-only position independent code (ARM only)-frwpi,-fno-rwpiโ generate read-write position independent code (ARM only)-fsave-optimization-record,-fno-save-optimization-recordโ generate a YAML optimization record file-fsave-optimization-record=<format>โ generate an optimization record file in a specific format-fsigned-zeros,-fno-signed-zeros-fslp-vectorize,-fno-slp-vectorize,-ftree-slp-vectorizeโ enable the superword-level parallelism vectorization passes-fstrict-overflow,-fno-strict-overflow-ftime-report-ftime-report-json-funderscoring,-fno-underscoringโ appends one trailing underscore to external names-funroll-loops,-fno-unroll-loopsโ turn on loop unroller-funsigned,-fno-unsignedโ enablesUNSIGNEDtype-fuse-ld=<arg>-fveclib=<arg>โ use the given vector functions library.
Note: -fveclib=libmvec on AArch64 requires GLIBC 2.40 or newer.
arg must be 'Accelerate', 'libmvec', 'MASSV', 'SVML', 'SLEEF', 'Darwin_libsystem_m', 'ArmPL', 'AMDLIBM' or 'none'.
-fvectorize,-fno-vectorize,-ftree-vectorizeโ enable the loop vectorization passes-fverbose-asm,-fno-verbose-asmโ generate verbose assembly output-fwrapv,-fno-wrapvโ treat signed integer overflow as two's complement-fwrapv-pointer,-fno-wrapv-pointerโ treat pointer overflow as two's complement-fxor-operator,-fno-xor-operatorโ enable.XOR.as a synonym of.NEQV.-nocppโ disable predefined and command line preprocessor macros-pedantic,--pedanticโ warn on language extensions
๐ Common Offloading options ๐
--offload-arch=<arg1>,<arg2>...,--no-offload-arch=<arg1>,<arg2>...โ specify an offloading device architecture for CUDA, HIP, or OpenMP (e.g.sm_35). if'native'is used, the compiler will detect locally installed architectures. for HIP offloading, the device architecture can be followed by target ID features delimited by a colon (e.g.gfx908:xnack+:sramecc-). may be specified more than once. ๐--offload-device-onlyโ only compile for the offloading device.--offload-host-deviceโ compile for both the offloading host and device (default).--offload-host-onlyโ only compile for the offloading host.--offload-targets=<arg1>,<arg2>...,-fopenmp-targets=<arg1>,<arg2>...โ specify a list of target architectures to use for offloading.
๐ HIP options ๐
--rocm-device-lib-path=<arg>โ ROCm device library path. alternative torocm-path.--rocm-path=<arg>- ROCm installation path โ used for finding and automatically linking required bitcode libraries. yes bestie, it goes looking for your bitcode for you, we love a self-sufficient king ๐ซถ
๐ฏ Target-dependent compilation options ๐ฏ
okay so these ones are all about what machine you're building for, and a bunch of them come with zero description in the source. I'm not gonna invent lore for them โ I'm just gonna list them like the mysterious little icons they are. no notes given, and honestly? that's the vibe ๐
-m32โ listed with no description attached. that's it, that's the whole entry. ๐-m64โ same energy as-m32, no description in the source.-mabi=<arg>โ no description given.-maix32โ no description given.-maix64โ no description given.-march=<arg>โ want the list of available architectures for your target? Run-mcpu=help. (yes,-mcpu=helpgives you the arch list too, that's just how it is โจ)-masm=<arg>โ no description given.-mcmodel=<arg>โ no description given.-mcode-object-version=<arg>โ specify the code object ABI version. Defaults to6. (AMDGPU only!) And<arg>has to be one ofnone,4,5, or6โ anything else and it's not it, bestie.-mcpu=<arg>โ want the list of available CPUs for your target? Run-mcpu=help. ๐ฅ๏ธ-mdynamic-no-pic<arg>โ no description given.-mlarge-data-threshold=<arg>โ no description given.-mmacos-version-min=<arg>,-mmacosx-version-min=<arg>โ set the macOS deployment target. ๐ two spellings, one destiny-mprefer-vector-width=<arg>โ picks the preferred vector width for auto-vectorization. Defaults tonone, which just means "let the target make its own choices". letting your target decide, very autonomous of it-mrecipโ literally equivalent to-mrecip=all. that's the whole thing. ๐-mrecip=<arg1>,<arg2>...โ controls use of approximate reciprocal and reciprocal square root instructions, followed by<n>iterations of Newton-Raphson refinement. Here's the grammar, verbatim, do not lose it:<value> = ( ['!'] ['vec-'] ('rcp'|'sqrt') [('h'|'s'|'d')] [':'<n>] ) | 'all' | 'default' | 'none'๐งฎ-mrvv-vector-bits=<arg>โ specify the size in bits of an RVV vector register. Defaults to the vector length agnostic value of"scalable". Accepts powers of 2 between64and65536. It also accepts"zvl"to use the value implied by-march/-mcpu. (RISC-V only!)-mtune=<arg>โ only supported on AArch64, PowerPC, RISC-V, SPARC, SystemZ, and X86. if your arch isn't on that list, this flag is not for you and it's not personal, it's just architecture ๐ฆ
๐ฆ AARCH64 ๐ฆ
-msve-streaming-vector-bits=<arg>โ specify the size in bits of an SVE vector register in streaming mode. Defaults to the vector length agnostic value of"scalable". (AArch64 only!)-msve-vector-bits=<arg>โ specify the size in bits of an SVE vector register (no streaming mode this time, bestie). Defaults to the vector length agnostic value of"scalable". (AArch64 only!)
๐ป X86 ๐ป
-mapx-features=<arg1>,<arg2>...,-mno-apx-features=<arg1>,<arg2>...โ enable features of APX.<arg>must be one ofegpr,push2pop2,ppx,ndd,ccmp,nf,cf, orzu. eight options, one flag family, we love a checklist โจ
๐ LoongArch ๐
okay so LoongArch brought a LOT of pairs โ every one of these is a thing-on/thing-off duo, so I'm listing both halves together like the matching set they are. ๐
-mannotate-tablejump,-mno-annotate-tablejumpโ enable annotate table jump instruction, to correlate it with the jump table.-mdiv32,-mno-div32โ usediv.w[u]andmod.w[u]instructions with input not sign-extended.-mfrecipe,-mno-frecipeโ enablefrecipe.{s/d}andfrsqrte.{s/d}.-mlam-bh,-mno-lam-bhโ enableamswap[_db].{b/h}andamadd[_db].{b/h}.-mlamcas,-mno-lamcasโ enableamcas[_db].{b/h/w/d}.-mlasx,-mno-lasxโ enable the Loongson Advanced SIMD Extension (LASX).-mld-seq-sa,-mno-ld-seq-saโ do not generate same-address load-load barrier instructions (dbar 0x700). not me generating the barrier, we are NOT generating the barrier ๐ซ-mlsx,-mno-lsxโ enable the Loongson SIMD Extension (LSX).-mscq,-mno-scqโ enable thesc.qinstruction.-msimd=<arg>โ select which SIMD extension(s) get enabled in LoongArch. Your choices are'none','lsx', or'lasx'. pick your fighter ๐
โก Optimization level โก
Flags controlling how much optimization should be performed. the "how hard should we try" section, basically
-O<arg>โ no description given in the source.-Ofast<arg>โ DEPRECATED. ๐ Here's the replacement math, straight from the page: use'-O3 -ffast-math -fstack-arrays'for the same behavior, or'-O3 -fstack-arrays'if you only want conforming optimizations. she's retired, she's still iconic, but she's retired ๐ญ
๐ Debug information generation ๐
Flags controlling how much and what kind of debug information should be generated. future-you debugging past-you: this section is your bestie fr fr
๐ Kind and level of debug information ๐
-gโ generate source-level debug information.-gdwarfโ generate source-level debug information with the default DWARF version.-gdwarf-2โ generate source-level debug information with DWARF version 2.-gdwarf-3โ generate source-level debug information with DWARF version 3.-gdwarf-4โ generate source-level debug information with DWARF version 4.-gdwarf-5โ generate source-level debug information with DWARF version 5.-gdwarf-6โ generate source-level debug information with DWARF version 6.
๐ Debug level ๐
-g0โ no description given.-g2โ no description given.-g3โ no description given.-gline-directives-onlyโ emit debug line info directives only.-gline-tables-only,-g1โ emit debug line number tables only. tables, not directives, important distinction bestie ๐ซถ
๐ง Debug information options ๐ง
-gsplit-dwarf,-gno-split-dwarfโ no description given for the pair.-gsplit-dwarf=<arg>โ set the DWARF fission mode.<arg>must be'split'or'single'. fission mode sounds so dramatic and I respect it deeply ๐
๐ Linker options ๐
Flags that are passed on to the linker. say hi to your linker for me ๐
-L<dir>โ add directory to library search path.-Wl,<arg>,<arg2>...โ pass the comma separated arguments in<arg>to the linker.-Xlinker <arg>โ pass<arg>to the linker.-Xoffload-linker<triple> <arg>โ pass<arg>to the offload linkers, or the ones identified by-<triple>.-l<arg>โ no description given.-nostdlibโ no description given.-pie,-no-pieโ no description given.-rdynamicโ no description given.-rpath <arg>โ no description given.-shared,--sharedโ no description given.-shared-libflangrtโ link theflang-rtshared library.-static,--staticโ no description given.-static-libflangrtโ link theflang-rtstatic library.-stdlibโ no description given. the page just ends it there, right after-stdlib, no further comment, and honestly? main character exit ๐
๐ Author ๐
Flang Contributors. the whole squad, no single name, just collective slay ๐ซถ
ยฉ๏ธ Copyright ยฉ๏ธ
2017-2026, The Flang Team. ๐
okay bestie that's the whole page, we made it, and before you go: this one is FLANG(1), volume 22, dated Jul 16, 2026 โ so if your copy says something else, you're reading a different edition and I need you to go check. go compile something beautiful, you absolute legend, periodt โจ๐๐ฆ
๐ฆ where this page comes from
- fedora 44: flang 22.1.8-4.fc44 ยท Apache-2.0 WITH LLVM-exception
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms