main: remove -cflags and -ldflags flags
These are unnecessary now that they are supported in CGo.
Этот коммит содержится в:
родитель
b61751e429
коммит
7bac93aab3
3 изменённых файлов: 2 добавлений и 14 удалений
|
@ -184,7 +184,7 @@ func (c *Config) AutomaticStackSize() bool {
|
||||||
// CFlags returns the flags to pass to the C compiler. This is necessary for CGo
|
// CFlags returns the flags to pass to the C compiler. This is necessary for CGo
|
||||||
// preprocessing.
|
// preprocessing.
|
||||||
func (c *Config) CFlags() []string {
|
func (c *Config) CFlags() []string {
|
||||||
cflags := append([]string{}, c.Options.CFlags...)
|
var cflags []string
|
||||||
for _, flag := range c.Target.CFlags {
|
for _, flag := range c.Target.CFlags {
|
||||||
cflags = append(cflags, strings.ReplaceAll(flag, "{root}", goenv.Get("TINYGOROOT")))
|
cflags = append(cflags, strings.ReplaceAll(flag, "{root}", goenv.Get("TINYGOROOT")))
|
||||||
}
|
}
|
||||||
|
@ -205,7 +205,7 @@ func (c *Config) CFlags() []string {
|
||||||
func (c *Config) LDFlags() []string {
|
func (c *Config) LDFlags() []string {
|
||||||
root := goenv.Get("TINYGOROOT")
|
root := goenv.Get("TINYGOROOT")
|
||||||
// Merge and adjust LDFlags.
|
// Merge and adjust LDFlags.
|
||||||
ldflags := append([]string{}, c.Options.LDFlags...)
|
var ldflags []string
|
||||||
for _, flag := range c.Target.LDFlags {
|
for _, flag := range c.Target.LDFlags {
|
||||||
ldflags = append(ldflags, strings.ReplaceAll(flag, "{root}", root))
|
ldflags = append(ldflags, strings.ReplaceAll(flag, "{root}", root))
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,6 @@ type Options struct {
|
||||||
Debug bool
|
Debug bool
|
||||||
PrintSizes string
|
PrintSizes string
|
||||||
PrintStacks bool
|
PrintStacks bool
|
||||||
CFlags []string
|
|
||||||
LDFlags []string
|
|
||||||
Tags string
|
Tags string
|
||||||
WasmAbi string
|
WasmAbi string
|
||||||
TestConfig TestConfig
|
TestConfig TestConfig
|
||||||
|
|
10
main.go
10
main.go
|
@ -859,8 +859,6 @@ func main() {
|
||||||
ocdOutput := flag.Bool("ocd-output", false, "print OCD daemon output during debug")
|
ocdOutput := flag.Bool("ocd-output", false, "print OCD daemon output during debug")
|
||||||
port := flag.String("port", "", "flash port (can specify multiple candidates separated by commas)")
|
port := flag.String("port", "", "flash port (can specify multiple candidates separated by commas)")
|
||||||
programmer := flag.String("programmer", "", "which hardware programmer to use")
|
programmer := flag.String("programmer", "", "which hardware programmer to use")
|
||||||
cFlags := flag.String("cflags", "", "additional cflags for compiler")
|
|
||||||
ldFlags := flag.String("ldflags", "", "additional ldflags for linker")
|
|
||||||
wasmAbi := flag.String("wasm-abi", "", "WebAssembly ABI conventions: js (no i64 params) or generic")
|
wasmAbi := flag.String("wasm-abi", "", "WebAssembly ABI conventions: js (no i64 params) or generic")
|
||||||
|
|
||||||
var flagJSON, flagDeps *bool
|
var flagJSON, flagDeps *bool
|
||||||
|
@ -908,14 +906,6 @@ func main() {
|
||||||
Programmer: *programmer,
|
Programmer: *programmer,
|
||||||
}
|
}
|
||||||
|
|
||||||
if *cFlags != "" {
|
|
||||||
options.CFlags = strings.Split(*cFlags, " ")
|
|
||||||
}
|
|
||||||
|
|
||||||
if *ldFlags != "" {
|
|
||||||
options.LDFlags = strings.Split(*ldFlags, " ")
|
|
||||||
}
|
|
||||||
|
|
||||||
os.Setenv("CC", "clang -target="+*target)
|
os.Setenv("CC", "clang -target="+*target)
|
||||||
|
|
||||||
err := options.Verify()
|
err := options.Verify()
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче