mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 19:23:25 +00:00
compileopts: automatically add -g flag when including debug symbols
Debug information is often useful and there is no reason to include it for Go code but not for C code. Also, disabling debug information should disable it entirely, not just for Go code.
This commit is contained in:
committed by
Ron Evans
parent
04d097f4ea
commit
39433a3553
@@ -176,6 +176,9 @@ func (c *Config) CFlags() []string {
|
|||||||
cflags = append(cflags, "-nostdlibinc", "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(root, "lib", "picolibc", "newlib", "libc", "include"))
|
cflags = append(cflags, "-nostdlibinc", "-Xclang", "-internal-isystem", "-Xclang", filepath.Join(root, "lib", "picolibc", "newlib", "libc", "include"))
|
||||||
cflags = append(cflags, "-I"+filepath.Join(root, "lib/picolibc-include"))
|
cflags = append(cflags, "-I"+filepath.Join(root, "lib/picolibc-include"))
|
||||||
}
|
}
|
||||||
|
if c.Debug() {
|
||||||
|
cflags = append(cflags, "-g")
|
||||||
|
}
|
||||||
return cflags
|
return cflags
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
"rtlib": "compiler-rt",
|
"rtlib": "compiler-rt",
|
||||||
"libc": "picolibc",
|
"libc": "picolibc",
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"-g",
|
|
||||||
"--target=arm4-none-eabi",
|
"--target=arm4-none-eabi",
|
||||||
"-mcpu=arm7tdmi",
|
"-mcpu=arm7tdmi",
|
||||||
"-Oz",
|
"-Oz",
|
||||||
|
|||||||
Reference in New Issue
Block a user