xujibicool 发表于 2024-2-27 19:29:17

sdcc编译选项,AI翻译的,蹩脚英语自己脑补

Usage : sdcc filename
Options :-

General options:
      --help                显示此帮助                                                                                                Display this help
-v--version             显示sdcc的版本                                                                                        Display sdcc's version
      --verbose             跟踪调用预处理器,汇编器和连接器                                                                Trace calls to the preprocessor, assembler, and linker
-V                        详细执行。显示子命令运行时                                                                        Execute verbosely. Show sub commands as they are run
-d                        有效宏定义的输出列表。与-E一起使用                                                        Output list of macro definitions in effect. Use with -E
-D                        在-Dmacro中定义宏                                                                                        Define macro as in -Dmacro
-I                        添加到include(*.h)路径中,如-Ipath                                                        Add to the include (*.h) path, as in -Ipath
-A       
-U                        在-Umacro中取消宏定义                                                                                Undefine macro as in -Umacro
-M                        预处理器选项                                                                                                Preprocessor option
-W                        将选项传递给预处理器(p),汇编器(a)或连接器(l)                                        Pass through options to the pre-processor (p), assembler (a) or linker (l)
      --include             在预处理期间预先包含一个文件                                                                        Pre-include a file during pre-processing
-S                        只编译,不汇编或链接                                                                                Compile only; do not assemble or link
-c--compile-only      编译和汇编,但不链接                                                                                Compile and assemble, but do not link
-E--preprocessonly      只预处理,不编译                                                                                        Preprocess only, do not compile
      --c1mode            在c1模式下工作。标准输入是预处理代码,输出是汇编代码。                        Act in c1 mode.The standard input is preprocessed code, the output is assembly code.
-o                        将输出放入给定的路径resp.file                                                                 Place the output into the given path resp. file
-x                        可选的文件类型覆盖(c,c-header或none),有效期到下一个-x                 Optional file type override (c, c-header or none), valid until the next -x
      --print-search-dirs   显示编译器搜索路径中的目录                                                                        display the directories in the compiler's search path
      --vc                  消息与Microsoft Visual Studio兼容                                                        messages are compatible with Micro$oft visual studio
      --use-stdout          将错误发送到stdout而不是                                                                        stderr send errors to stdout instead of stderr
      --nostdlib            在搜索路径中不包括标准库目录                                                                        Do not include the standard library directory in the search path
      --nostdinc            在搜索路径中不包括标准包含目录                                                                Do not include the standard include directory in the search path
      --less-pedantic       禁用一些更迂腐的警告                                                                                Disable some of the more pedantic warnings
      --disable-warning   <nnnn> 禁用特定警告                                                                                <nnnn> Disable specific warning
      --Werror            将警告视为错误                                                                                                Treat the warnings as errors
      --debug               启用调试符号                                                                                                Enable debugging symbol output
      --cyclomatic          输出显示编译函数的复杂性                                                                        Display complexity of compiled functions
      --std-c89             使用C90(aka ANSI C89)标准(稍不完整)                                                Use ISO C90 (aka ANSI C89) standard (slightly incomplete)
      --std-sdcc89          使用ISO C90(aka ANSI C89)标准和SDCC扩展                                        ISO Use ISO C90 (aka ANSI C89) standard with SDCC extensions
      --std-c95             使用ISO C95(aka ISO C94)标准(稍不完整)                                                Use ISO C95 (aka ISO C94) standard (slightly incomplete)
      --std-c99             使用ISO C99标准(不完整)                                                                        Use ISO C99 standard (incomplete)
      --std-sdcc99          使用ISO C99标准和SDCC扩展                                                                        Use ISO C99 standard with SDCC extensions
      --std-c11             使用ISO C11标准(不完整)                                                                        Use ISO C11 standard (incomplete)
      --std-sdcc11          使用ISO C11标准和SDCC扩展(默认)                                                        Use ISO C11 standard with SDCC extensions (default)
      --std-c2x             使用ISO C2X标准(不完整)                                                                        Use ISO C2X standard (incomplete)
      --std-sdcc2x          使用ISO C2X标准和SDCC扩展                                                                        Use ISO C2X standard with SDCC extensions
      --fdollars-in-identifiersPermit '$' as an identifier character
      --fsigned-char      Make "char" signed by default
      --use-non-free      Search / include non-free licensed libraries and header files

Code generation options:
-m                        设置端口,例如-mz80                                                                                 Set the port to use e.g. -mz80.
-p                        选择特定端口处理器,例如-mpic14 -p16f84                                         Select port specific processor e.g. -mpic14 -p16f84
      --stack-auto          堆栈自动变量                                                                                                Stack automatic variables
      --xstack            使用外部堆栈                                                                                                Use external stack
      --int-long-reent      在int和long支持函数上使用重入调用                                                        Use reentrant calls on the int and long support functions
      --float-reent         在float支持函数上使用重入调用                                                                Use reentrant calls on the float support functions
      --xram-movc         使用movc而不是movx来读取xram(xdata)                                                Use movc instead of movx to read xram (xdata)
      --callee-saves      <func[,func,...]> 使被调用函数而不是调用函数保存寄存器                 <func[,func,...]> Cause the called function to save registers instead of the caller
      --fomit-frame-pointer省略帧指针。                                                                                                Leave out the frame pointer.
      --all-callee-saves    被调用函数总是保存所使用的寄存器                                                                callee will always save registers used
      --stack-probe         在每个函数序言中插入对函数__stack_probe的调用                                        insert call to function __stack_probe at each function prologue
      --no-xinit-opt      不要从代码中memcpy初始化                                                                        xram don't memcpy initialized xram from code
      --no-c-code-in-asm    不要在asm文件中将c代码作为注释                                                                don't include c-code as comments in the asm file
      --no-peep-comments    不要包括窥孔优化器注释                                                                                don't include peephole optimizer comments
      --codeseg             <name> 为代码段使用此名称                                                                        <name> use this name for the code segment
      --constseg            <name> 为常量段使用此名称                                                                        <name> use this name for the const segment
      --dataseg             <name> 为数据段使用此名称                                                                        <name> use this name for the data segment

Optimization options:
      --nooverlay         禁用覆盖叶函数自动变量                                                                                Disable overlaying leaf function auto variables
      --nogcse            禁用GCSE优化                                                                                                Disable the GCSE optimisation
      --nolabelopt          禁用标签优化                                                                                                Disable label optimisation
      --noinvariant         禁用不变量的优化                                                                                        Disable optimisation of invariants
      --noinduction         禁用循环变量归纳                                                                                        Disable loop variable induction
      --noloopreverse       禁用循环反向优化                                                                                        Disable the loop reverse optimisation
      --no-peep             禁用窥视孔程序集文件优化                                                                        Disable the peephole assembly file optimisation
      --no-reg-params       在某些端口上,禁用在寄存器中传递某些参数                                                On some ports, disable passing some parameters in registers
      --peep-asm            在内联程序集上启用窥视孔优化                                                                        Enable peephole optimization on inline assembly
      --peep-return         为返回指令启用窥视孔优化                                                                        Enable peephole optimization for return instructions
      --no-peep-return      为返回指令禁用窥视孔优化                                                                        Disable peephole optimization for return instructions
      --peep-file         <file> 使用这个额外的窥视孔文件                                                                <file> use this extra peephole file
      --opt-code-speed      优化代码速度而不是大小                                                                                Optimize for code speed rather than size
      --opt-code-size       优化代码大小而不是速度                                                                                Optimize for code size rather than speed
      --max-allocs-per-node 在树分解的每个节点考虑的寄存器分配的最大数量                                         Maximum number of register assignments considered at each node of the tree decomposition
      --nolospre            禁用lospre                                                                                                Disable lospre
      --allow-unsafe-read   允许优化随时读取任何内存位置                                                                        Allow optimizations to read any memory location anytime
      --nostdlibcall      禁用对标准库调用的优化                                                                                  Disable optimization of calls to standard library

Internal debugging options:
      --dump-ast            在生成 i 代码前转储前端                                                                         ASTDump front-end AST before generating i-code
      --dump-i-code         转储所有阶段的 i 代码结构                                                                        Dump the i-code structure at all stages
      --dump-graphs         转储图形(控制流、冲突等)                                                                        Dump graphs (control-flow, conflict, etc)
      --i-code-in-asm       将 i 代码作为注释包含在 asm 文件中                                                        Include i-code as comments in the asm file
      --fverbose-asm      在 asm 输出中包含代码生成器注释                                                                Include code generator comments in the asm output
                                       
Linker options:                                       
-l                        在链接中包含指定库                                                                                        Include the given library in the link
-L                        在库搜索路径中添加下一个字段                                                                        Add the next field to the library search path
      --lib-path            <path> 使用此路径搜索库                                                                        <path>use this path to search for libraries
      --out-fmt-ihx         以英特尔十六进制格式输出                                                                        Output in Intel hex format
      --out-fmt-s19         以 S19 十六进制格式输出                                                                        Output in S19 hex format
      --xram-loc            <nnnn> 外部内存起始位置                                                                        <nnnn> External Ram start location
      --xram-size         <nnn> 外部内存大小                                                                                <nnnn> External Ram size
      --iram-size         <nnn> 内部内存大小                                                                                <nnnn> Internal Ram size
      --xstack-loc          <nnn> 外部堆栈起始位置                                                                                <nnnn> External Stack start location
      --code-loc            <nnnn> 代码段位置                                                                                        <nnnn> Code Segment Location
      --code-size         <nnn> 代码段大小                                                                                        <nnnn> Code Segment size
      --stack-loc         <nnnn> 堆栈指针初始值                                                                                <nnnn> Stack pointer initial value
      --data-loc            <nnnn> 直接数据起始位置                                                                        <nnnn> Direct data start location
      --idata-loc
      --no-optsdcc-in-asm   Do not emit .optsdcc in asm

Special options for the mcs51 port:
      --model-small                 使用内部数据空间(默认)                                                                internal data space is used (default)
      --model-medium              使用外部分页数据空间                                                                        external paged data space is used
      --model-large                 使用外部数据空间                                                                                external data space is used
      --model-huge                  函数已入库,数据在外部空间                                                                functions are banked, data in external space
      --stack-size                  告诉链接器为堆栈分配此空间                                                                Tells the linker to allocate this space for stack
      --parms-in-bank1              使用 Bank1 进行参数传递                                                                use Bank1 for parameter passing
      --acall-ajmp                  使用 acall/ajmp 代替                                                                        lcall/ljmp        Use acall/ajmp instead of lcall/ljmp
      --no-ret-without-call         不要使用与 acall/lcall 无关的 ret                                                Do not use ret independent of acall/lcall

WHX 发表于 2024-2-27 22:53:22

{:4_250:}

kksk 发表于 2024-2-28 11:41:34

--verbose (Trace calls to the preprocessor, assembler, and linker) 和 -V (Execute verbosely. Show sub commands as they are run) 用于调整输出内容(日志)详细程度

-D (Define macro as in -Dmacro) 定义宏,如-Dmacro
-U (Undefine macro as in -Umacro) 取消定义宏,如-Umacro

-o (Place the output into the given path resp. file) 将输出放在指定位置(路径和文件名)
页: [1]
查看完整版本: sdcc编译选项,AI翻译的,蹩脚英语自己脑补