all: use -opt flag for optimization level in CFlags (-Os, etc)
This brings some consistency to the CFlags and fixes the issue that on some platforms (Linux, MacOS), no optimization level was set and therefore C files in packages were not optimized at all.
Этот коммит содержится в:
родитель
32899d1cc3
коммит
6234bf9a88
7 изменённых файлов: 4 добавлений и 8 удалений
|
@ -211,6 +211,8 @@ func (c *Config) CFlags() []string {
|
||||||
}
|
}
|
||||||
// Always emit debug information. It is optionally stripped at link time.
|
// Always emit debug information. It is optionally stripped at link time.
|
||||||
cflags = append(cflags, "-g")
|
cflags = append(cflags, "-g")
|
||||||
|
// Use the same optimization level as TinyGo.
|
||||||
|
cflags = append(cflags, "-O"+c.Options.Opt)
|
||||||
return cflags
|
return cflags
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
"automatic-stack-size": true,
|
"automatic-stack-size": true,
|
||||||
"default-stack-size": 2048,
|
"default-stack-size": 2048,
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"-Oz",
|
|
||||||
"-mthumb",
|
"-mthumb",
|
||||||
"-Werror",
|
"-Werror",
|
||||||
"-fshort-enums",
|
"-fshort-enums",
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=arm4-none-eabi",
|
"--target=arm4-none-eabi",
|
||||||
"-mcpu=arm7tdmi",
|
"-mcpu=arm7tdmi",
|
||||||
"-Oz",
|
|
||||||
"-Werror",
|
"-Werror",
|
||||||
"-fshort-enums",
|
"-fshort-enums",
|
||||||
"-fomit-frame-pointer",
|
"-fomit-frame-pointer",
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
"rtlib": "compiler-rt",
|
"rtlib": "compiler-rt",
|
||||||
"libc": "picolibc",
|
"libc": "picolibc",
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"-Os",
|
|
||||||
"-Werror",
|
"-Werror",
|
||||||
"-fno-exceptions", "-fno-unwind-tables",
|
"-fno-exceptions", "-fno-unwind-tables",
|
||||||
"-ffunction-sections", "-fdata-sections"
|
"-ffunction-sections", "-fdata-sections"
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
"libc": "wasi-libc",
|
"libc": "wasi-libc",
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=wasm32--wasi",
|
"--target=wasm32--wasi",
|
||||||
"--sysroot={root}/lib/wasi-libc/sysroot",
|
"--sysroot={root}/lib/wasi-libc/sysroot"
|
||||||
"-Oz"
|
|
||||||
],
|
],
|
||||||
"ldflags": [
|
"ldflags": [
|
||||||
"--allow-undefined",
|
"--allow-undefined",
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
"libc": "wasi-libc",
|
"libc": "wasi-libc",
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=wasm32--wasi",
|
"--target=wasm32--wasi",
|
||||||
"--sysroot={root}/lib/wasi-libc/sysroot",
|
"--sysroot={root}/lib/wasi-libc/sysroot"
|
||||||
"-Oz"
|
|
||||||
],
|
],
|
||||||
"ldflags": [
|
"ldflags": [
|
||||||
"--allow-undefined",
|
"--allow-undefined",
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
"scheduler": "none",
|
"scheduler": "none",
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"--target=xtensa",
|
"--target=xtensa",
|
||||||
"-Oz",
|
|
||||||
"-Werror",
|
"-Werror",
|
||||||
"-fshort-enums",
|
"-fshort-enums",
|
||||||
"-Wno-macro-redefined",
|
"-Wno-macro-redefined",
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче