main: print ldflags including ThinLTO flags with -x
The -x flag prints commands as they are executed. Unfortunately, for the link command, they were printed too early: before the ThinLTO flags were added. This is somewhat confusing while debugging.
Этот коммит содержится в:
родитель
636a151ffe
коммит
2072d1bb5c
1 изменённых файлов: 3 добавлений и 3 удалений
|
@ -738,9 +738,6 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil
|
|||
}
|
||||
ldflags = append(ldflags, dependency.result)
|
||||
}
|
||||
if config.Options.PrintCommands != nil {
|
||||
config.Options.PrintCommands(config.Target.Linker, ldflags...)
|
||||
}
|
||||
if config.UseThinLTO() {
|
||||
ldflags = append(ldflags, "-mllvm", "-mcpu="+config.CPU())
|
||||
if config.GOOS() == "windows" {
|
||||
|
@ -772,6 +769,9 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil
|
|||
"-mllvm", "--rotation-max-header-size=0")
|
||||
}
|
||||
}
|
||||
if config.Options.PrintCommands != nil {
|
||||
config.Options.PrintCommands(config.Target.Linker, ldflags...)
|
||||
}
|
||||
err = link(config.Target.Linker, ldflags...)
|
||||
if err != nil {
|
||||
return &commandError{"failed to link", executable, err}
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче