all: use -Qunused-arguments only for assembly files
The -Qunused-arguments flag disables the warning where some flags are not relevant to a compilation. This commonly happens when compiling assembly files (.s or .S files) because some flags are specific to C and not relevant to assembly. Because practically all baremetal targets need some form of assembly, this flag is added to most CFlags. This creates a lot of noise. And it is also added for compiling C code where it might hide bugs (by hiding the fact a flag is actually unused). This commit adds the flag to all assembly compilations and removes them from all target JSON files.
Этот коммит содержится в:
родитель
f234df7a50
коммит
96b1b76483
29 изменённых файлов: 20 добавлений и 53 удалений
|
@ -124,6 +124,13 @@ func compileAndCacheCFile(abspath, tmpdir string, cflags []string, config *compi
|
|||
flags := append([]string{}, cflags...) // copy cflags
|
||||
flags = append(flags, "-MD", "-MV", "-MTdeps", "-MF", depTmpFile.Name()) // autogenerate dependencies
|
||||
flags = append(flags, "-c", "-o", objTmpFile.Name(), abspath)
|
||||
if strings.ToLower(filepath.Ext(abspath)) == ".s" {
|
||||
// If this is an assembly file (.s or .S, lowercase or uppercase), then
|
||||
// we'll need to add -Qunused-arguments because many parameters are
|
||||
// relevant to C, not assembly. And with -Werror, having meaningless
|
||||
// flags (for the assembler) is a compiler error.
|
||||
flags = append(flags, "-Qunused-arguments")
|
||||
}
|
||||
if config.Options.PrintCommands {
|
||||
fmt.Printf("%s %s\n", config.Target.Compiler, strings.Join(flags, " "))
|
||||
}
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
"llvm-target": "armv6m-none-eabi",
|
||||
"build-tags": ["atsamd21e18a", "atsamd21e18", "atsamd21", "sam"],
|
||||
"cflags": [
|
||||
"--target=armv6m-none-eabi",
|
||||
"-Qunused-arguments"
|
||||
"--target=armv6m-none-eabi"
|
||||
],
|
||||
"linkerscript": "targets/atsamd21.ld",
|
||||
"extra-files": [
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
"llvm-target": "armv6m-none-eabi",
|
||||
"build-tags": ["atsamd21g18a", "atsamd21g18", "atsamd21", "sam"],
|
||||
"cflags": [
|
||||
"--target=armv6m-none-eabi",
|
||||
"-Qunused-arguments"
|
||||
"--target=armv6m-none-eabi"
|
||||
],
|
||||
"linkerscript": "targets/atsamd21.ld",
|
||||
"extra-files": [
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["atsamd51g19a", "atsamd51g19", "atsamd51", "sam"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments"
|
||||
],
|
||||
"linkerscript": "targets/atsamd51.ld",
|
||||
"extra-files": [
|
||||
"src/device/sam/atsamd51g19a.s"
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["atsamd51j19a", "atsamd51j19", "atsamd51", "sam"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments"
|
||||
],
|
||||
"linkerscript": "targets/atsamd51.ld",
|
||||
"extra-files": [
|
||||
"src/device/sam/atsamd51j19a.s"
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["sam", "atsamd51", "atsamd51j20", "atsamd51j20a"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments"
|
||||
],
|
||||
"linkerscript": "targets/atsamd51j20a.ld",
|
||||
"extra-files": [
|
||||
"src/device/sam/atsamd51j20a.s"
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["atsamd51p19a", "atsamd51p19", "atsamd51", "sam"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments"
|
||||
],
|
||||
"linkerscript": "targets/atsamd51.ld",
|
||||
"extra-files": [
|
||||
"src/device/sam/atsamd51p19a.s"
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["sam", "atsamd51", "atsamd51p20", "atsamd51p20a"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments"
|
||||
],
|
||||
"linkerscript": "targets/atsamd51p20a.ld",
|
||||
"extra-files": [
|
||||
"src/device/sam/atsamd51p20a.s"
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
"build-tags": ["attiny85", "attiny", "avr2", "avr25"],
|
||||
"cflags": [
|
||||
"-mmcu=attiny85",
|
||||
"-D__AVR_ARCH__=25",
|
||||
"-Qunused-arguments"
|
||||
"-D__AVR_ARCH__=25"
|
||||
],
|
||||
"ldflags": [
|
||||
"-mmcu=avr25"
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
"scheduler": "none",
|
||||
"default-stack-size": 256,
|
||||
"cflags": [
|
||||
"--target=avr-unknown-unknown"
|
||||
"--target=avr-unknown-unknown",
|
||||
"-Werror"
|
||||
],
|
||||
"ldflags": [
|
||||
"-T", "targets/avr.ld",
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
"llvm-target": "armv7m-none-eabi",
|
||||
"build-tags": ["bluepill", "stm32f103", "stm32f1", "stm32"],
|
||||
"cflags": [
|
||||
"--target=armv7m-none-eabi",
|
||||
"-Qunused-arguments"
|
||||
"--target=armv7m-none-eabi"
|
||||
],
|
||||
"linkerscript": "targets/stm32.ld",
|
||||
"extra-files": [
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
"llvm-target": "armv7m-none-eabi",
|
||||
"build-tags": ["qemu", "lm3s6965"],
|
||||
"cflags": [
|
||||
"--target=armv7m-none-eabi",
|
||||
"-Qunused-arguments"
|
||||
"--target=armv7m-none-eabi"
|
||||
],
|
||||
"linkerscript": "targets/lm3s6965.ld",
|
||||
"extra-files": [
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"inherits": ["cortex-m"],
|
||||
"llvm-target": "armv6m-none-eabi",
|
||||
"cflags": [
|
||||
"--target=armv6m-none-eabi",
|
||||
"-Qunused-arguments"
|
||||
"--target=armv6m-none-eabi"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
"llvm-target": "armv7m-none-eabi",
|
||||
"cflags": [
|
||||
"--target=armv7m-none-eabi",
|
||||
"-mfloat-abi=soft",
|
||||
"-Qunused-arguments"
|
||||
"-mfloat-abi=soft"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
"llvm-target": "armv7em-none-eabi",
|
||||
"cflags": [
|
||||
"--target=armv7em-none-eabi",
|
||||
"-mfloat-abi=soft",
|
||||
"-Qunused-arguments"
|
||||
"-mfloat-abi=soft"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"inherits": ["cortex-m"],
|
||||
"llvm-target": "armv7em-none-eabi",
|
||||
"cflags": [
|
||||
"--target=armv7em-none-eabi",
|
||||
"-Qunused-arguments"
|
||||
"--target=armv7em-none-eabi"
|
||||
]
|
||||
}
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
"build-tags": ["feather_stm32f405", "stm32f405", "stm32f4", "stm32"],
|
||||
"automatic-stack-size": false,
|
||||
"default-stack-size": 1024,
|
||||
"cflags": [
|
||||
"-Qunused-arguments"
|
||||
],
|
||||
"linkerscript": "targets/stm32f405.ld",
|
||||
"extra-files": [
|
||||
"src/device/stm32/stm32f405.s"
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"-Werror",
|
||||
"-fshort-enums",
|
||||
"-fomit-frame-pointer",
|
||||
"-Qunused-arguments",
|
||||
"-fno-exceptions", "-fno-unwind-tables",
|
||||
"-ffunction-sections", "-fdata-sections"
|
||||
],
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"-mcpu=cortex-a57",
|
||||
"-fPIE",
|
||||
"-Werror",
|
||||
"-Qunused-arguments",
|
||||
"-fshort-enums",
|
||||
"-fomit-frame-pointer",
|
||||
"-fno-exceptions", "-fno-unwind-tables",
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
"build-tags": ["nrf51822", "nrf51", "nrf"],
|
||||
"cflags": [
|
||||
"--target=armv6m-none-eabi",
|
||||
"-Qunused-arguments",
|
||||
"-DNRF51",
|
||||
"-I{root}/lib/CMSIS/CMSIS/Include",
|
||||
"-I{root}/lib/nrfx/mdk"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["nrf52", "nrf"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments",
|
||||
"-DNRF52832_XXAA",
|
||||
"-I{root}/lib/CMSIS/CMSIS/Include",
|
||||
"-I{root}/lib/nrfx/mdk"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["nrf52833", "nrf"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments",
|
||||
"-DNRF52833_XXAA",
|
||||
"-I{root}/lib/CMSIS/CMSIS/Include",
|
||||
"-I{root}/lib/nrfx/mdk"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["nrf52840", "nrf"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments",
|
||||
"-DNRF52840_XXAA",
|
||||
"-I{root}/lib/CMSIS/CMSIS/Include",
|
||||
"-I{root}/lib/nrfx/mdk"
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
"llvm-target": "armv7m-none-eabi",
|
||||
"build-tags": ["nucleof103rb", "stm32f103", "stm32f1","stm32"],
|
||||
"cflags": [
|
||||
"--target=armv7m-none-eabi",
|
||||
"-Qunused-arguments"
|
||||
"--target=armv7m-none-eabi"
|
||||
],
|
||||
"linkerscript": "targets/stm32f103rb.ld",
|
||||
"extra-files": [
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
{
|
||||
"inherits": ["cortex-m4"],
|
||||
"build-tags": ["stm32f4disco", "stm32f407", "stm32f4", "stm32"],
|
||||
"cflags": [
|
||||
"-Qunused-arguments"
|
||||
],
|
||||
"linkerscript": "targets/stm32f407.ld",
|
||||
"extra-files": [
|
||||
"src/device/stm32/stm32f407.s"
|
||||
|
|
|
@ -9,8 +9,7 @@
|
|||
"stm32"
|
||||
],
|
||||
"cflags": [
|
||||
"--target=armv6m-none-eabi",
|
||||
"-Qunused-arguments"
|
||||
"--target=armv6m-none-eabi"
|
||||
],
|
||||
"extra-files": [
|
||||
"src/device/stm32/stm32l0x2.s"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
"build-tags": ["teensy36", "teensy", "mk66f18", "nxp"],
|
||||
"cflags": [
|
||||
"--target=armv7em-none-eabi",
|
||||
"-Qunused-arguments",
|
||||
"-mfloat-abi=hard",
|
||||
"-mfpu=fpv4-sp-d16"
|
||||
],
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
"default-stack-size": 4096,
|
||||
"cflags": [
|
||||
"--target=armv7em-none-eabi",
|
||||
"-Qunused-arguments",
|
||||
"-mfloat-abi=soft"
|
||||
],
|
||||
"linkerscript": "targets/mimxrt1062-teensy40.ld",
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
"-Werror",
|
||||
"-fshort-enums",
|
||||
"-Wno-macro-redefined",
|
||||
"-Qunused-arguments",
|
||||
"-fno-exceptions", "-fno-unwind-tables",
|
||||
"-ffunction-sections", "-fdata-sections"
|
||||
],
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче