Add LTO support for most compilers and do some VCC fixes (#14013)
* Added LTO in nim.cfg, added /link in extccomp.nim and other fixes * Fix line endings * Fix line endings, for real this time. Almost certainly. Like, 95% certain. * Removed /MD from extccom.nim VCC comiler
This commit is contained in:
parent
6cfe2e0c3d
commit
d27bc03b21
2 changed files with 37 additions and 6 deletions
|
|
@ -157,12 +157,12 @@ compiler vcc:
|
||||||
optSize: " /O1 ",
|
optSize: " /O1 ",
|
||||||
compilerExe: "cl",
|
compilerExe: "cl",
|
||||||
cppCompiler: "cl",
|
cppCompiler: "cl",
|
||||||
compileTmpl: "/c$vccplatform $options $include /Fo$objfile $file",
|
compileTmpl: "/c$vccplatform $options $include /nologo /Fo$objfile $file",
|
||||||
buildGui: " /link /SUBSYSTEM:WINDOWS ",
|
buildGui: " /SUBSYSTEM:WINDOWS user32.lib ",
|
||||||
buildDll: " /LD",
|
buildDll: " /LD",
|
||||||
buildLib: "lib /OUT:$libfile $objfiles",
|
buildLib: "lib /OUT:$libfile $objfiles",
|
||||||
linkerExe: "cl",
|
linkerExe: "cl",
|
||||||
linkTmpl: "$builddll$vccplatform /Fe$exefile $objfiles $buildgui $options",
|
linkTmpl: "$builddll$vccplatform /Fe$exefile $objfiles $buildgui /link /nologo $options",
|
||||||
includeCmd: " /I",
|
includeCmd: " /I",
|
||||||
linkDirCmd: " /LIBPATH:",
|
linkDirCmd: " /LIBPATH:",
|
||||||
linkLibCmd: " $1.lib",
|
linkLibCmd: " $1.lib",
|
||||||
|
|
@ -180,6 +180,7 @@ compiler clangcl:
|
||||||
result.compilerExe = "clang-cl"
|
result.compilerExe = "clang-cl"
|
||||||
result.cppCompiler = "clang-cl"
|
result.cppCompiler = "clang-cl"
|
||||||
result.linkerExe = "clang-cl"
|
result.linkerExe = "clang-cl"
|
||||||
|
result.linkTmpl = "-fuse-ld=lld " & result.linkTmpl
|
||||||
|
|
||||||
# Intel C/C++ Compiler
|
# Intel C/C++ Compiler
|
||||||
compiler icl:
|
compiler icl:
|
||||||
|
|
|
||||||
|
|
@ -271,9 +271,7 @@ vcc.linkerexe = "vccexe.exe"
|
||||||
vcc.cpp.linkerexe = "vccexe.exe"
|
vcc.cpp.linkerexe = "vccexe.exe"
|
||||||
|
|
||||||
vcc.options.always = "/nologo"
|
vcc.options.always = "/nologo"
|
||||||
vcc.cpp.options.always = "/EHsc"
|
vcc.cpp.options.always = "/nologo /EHsc"
|
||||||
vcc.options.linker = "/nologo /F33554432" # set the stack size to 32 MiB
|
|
||||||
vcc.cpp.options.linker = "/nologo /F33554432"
|
|
||||||
vcc.options.debug = "/Zi /FS /Od"
|
vcc.options.debug = "/Zi /FS /Od"
|
||||||
vcc.cpp.options.debug = "/Zi /FS /Od"
|
vcc.cpp.options.debug = "/Zi /FS /Od"
|
||||||
vcc.options.speed = "/O2"
|
vcc.options.speed = "/O2"
|
||||||
|
|
@ -317,3 +315,35 @@ tcc.options.always = "-w"
|
||||||
--define:nimOldCaseObjects
|
--define:nimOldCaseObjects
|
||||||
--define:nimOldShiftRight
|
--define:nimOldShiftRight
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@if lto or lto_incremental:
|
||||||
|
@if lto_incremental:
|
||||||
|
vcc.options.always%= "${vcc.options.always} /GL /Gw /Gy"
|
||||||
|
vcc.cpp.options.always%= "${vcc.cpp.options.always} /GL /Gw /Gy"
|
||||||
|
vcc.options.linker %= "${vcc.options.linker} /LTCG:incremental"
|
||||||
|
vcc.cpp.options.linker %= "${vcc.cpp.options.linker} /LTCG:incremental"
|
||||||
|
@else:
|
||||||
|
vcc.options.always%= "${vcc.options.always} /GL"
|
||||||
|
vcc.cpp.options.always%= "${vcc.cpp.options.always} /GL"
|
||||||
|
vcc.options.linker %= "${vcc.options.linker} /LTCG"
|
||||||
|
vcc.cpp.options.linker %= "${vcc.cpp.options.linker} /LTCG"
|
||||||
|
@end
|
||||||
|
clang_cl.options.always%= "${clang_cl.options.always} -flto"
|
||||||
|
clang_cl.cpp.options.always%= "${clang.cpp.options.always} -flto"
|
||||||
|
clang.options.always%= "${clang.options.always} -flto"
|
||||||
|
clang.cpp.options.always%= "${clang.cpp.options.always} -flto"
|
||||||
|
icl.options.always %= "${icl.options.always} /Qipo"
|
||||||
|
icl.cpp.options.always %= "${icl.cpp.options.always} /Qipo"
|
||||||
|
gcc.options.always %= "${gcc.options.always} -flto"
|
||||||
|
gcc.cpp.options.always %= "${gcc.cpp.options.always} -flto"
|
||||||
|
clang.options.linker %= "${clang.options.linker} -fuse-ld=lld -flto"
|
||||||
|
clang.cpp.options.linker %= "${clang.cpp.options.linker} -fuse-ld=lld -flto"
|
||||||
|
gcc.options.linker %= "${gcc.options.linker} -flto"
|
||||||
|
gcc.cpp.options.linker %= "${gcc.cpp.options.linker} -flto"
|
||||||
|
@end
|
||||||
|
@if strip:
|
||||||
|
gcc.options.linker %= "${gcc.options.linker} -s"
|
||||||
|
gcc.cpp.options.linker %= "${gcc.cpp.options.linker} -s"
|
||||||
|
clang.options.linker %= "${clang.options.linker} -s"
|
||||||
|
clang.cpp.options.linker %= "${clang.cpp.options.linker} -s"
|
||||||
|
@end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue