Skip to content

Commit ee7fb2a

Browse files
Make separate file for each level, add readme
The readme now includes the exact commands required to regenerate the none-XXX files, no manual editing needed.
1 parent bea71f1 commit ee7fb2a

File tree

10 files changed

+24
-10
lines changed

10 files changed

+24
-10
lines changed

platform.txt

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ runtime.tools.mkdir={runtime.platform.path}/tools/mkdir.py
2121
runtime.tools.cp={runtime.platform.path}/tools/cp.py
2222
runtime.tools.eboot={runtime.platform.path}/bootloaders/eboot/eboot.elf
2323

24-
compiler.warning_flags=@{runtime.platform.path}/tools/no-warnings-
25-
compiler.warning_flags.none=@{runtime.platform.path}/tools/no-warnings-
26-
compiler.warning_flags.default=-D__COMPILER=
27-
compiler.warning_flags.more=-Wall -D__COMPILER=
28-
compiler.warning_flags.all=-Wall -Wextra -D__COMPILER=
24+
compiler.warning_flags=@{runtime.platform.path}/tools/warnings/none
25+
compiler.warning_flags.none=@{runtime.platform.path}/tools/warnings/none
26+
compiler.warning_flags.default=@{runtime.platform.path}/tools/warnings/default
27+
compiler.warning_flags.more=@{runtime.platform.path}/tools/warnings/more
28+
compiler.warning_flags.all=@{runtime.platform.path}/tools/warnings/extra
2929

3030
build.lwip_lib=-llwip_gcc
3131
build.lwip_include=lwip/include
@@ -68,18 +68,18 @@ compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ -D_GNU_S
6868
compiler.libraries.ldflags=
6969

7070
compiler.c.cmd=xtensa-lx106-elf-gcc
71-
compiler.c.flags=-c {compiler.warning_flags}gcc -std=gnu17 {build.stacksmash_flags} -Os -g -free -fipa-pta -Werror=return-type -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags}
71+
compiler.c.flags=-c {compiler.warning_flags}-gcc -std=gnu17 {build.stacksmash_flags} -Os -g -free -fipa-pta -Werror=return-type -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags}
7272

7373
compiler.S.cmd=xtensa-lx106-elf-gcc
7474
compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls "-I{runtime.tools.xtensa-lx106-elf-gcc.path}/include/"
7575

76-
compiler.c.elf.flags=-g {compiler.warning_flags}gcc -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/lib/{build.sdk}" "-L{build.path}" "-L{compiler.libc.path}/lib" "-Tlocal.eagle.flash.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
76+
compiler.c.elf.flags=-g {compiler.warning_flags}-gcc -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/lib/{build.sdk}" "-L{build.path}" "-L{compiler.libc.path}/lib" "-Tlocal.eagle.flash.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
7777

7878
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
7979
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -lbearssl -lespnow -lsmartconfig -lairkiss -lwpa2 {build.stdcpp_lib} -lm -lc -lgcc
8080

8181
compiler.cpp.cmd=xtensa-lx106-elf-g++
82-
compiler.cpp.flags=-c {compiler.warning_flags}g++ {build.stacksmash_flags} -Os -g -free -fipa-pta -Werror=return-type -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags}
82+
compiler.cpp.flags=-c {compiler.warning_flags}-g++ {build.stacksmash_flags} -Os -g -free -fipa-pta -Werror=return-type -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags}
8383

8484
compiler.as.cmd=xtensa-lx106-elf-as
8585

tools/warnings/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
These are the warning options for the compiler at different levels.
2+
3+
Because GCC 10 produces code which crashes when a function is declared
4+
to return a value but doesn't (this is undefined per the C specs), we
5+
cannot warn them if we use "-w" to disable all warnings, and instead have
6+
to delete every warning but "-Wfunction-return"
7+
8+
Generate the "-none" versions with the following command:
9+
````
10+
./tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc --help=warnings -Q | grep '\[enabled\]' | grep -v 'return-type' | awk '{print $1}' | sed 's/-W/-Wno-/' | grep -v = | grep -v -- -f > tools/warnings/none-gcc
11+
./tools/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc --help=warnings -Q | grep '\[enabled\]' | grep -v 'return-type' | awk '{print $1}' | sed 's/-W/-Wno-/' | grep -v = | grep -v -- -f | egrep -v '(c11-c2x-compat|c90-c99-compat|c99-c11-compat|declaration-after-statement|designated-init|discarded-array-qualifiers|discarded-qualifiers|implicit-int|incompatible-pointer-types|int-conversion|old-style-definition|override-init-side-effects|pointer-to-int-cast)' > tools/warnings/none-g++
12+
````

tools/warnings/default-g++

Whitespace-only changes.

tools/warnings/default-gcc

Whitespace-only changes.

tools/warnings/extra-g++

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Wall -Wextra

tools/warnings/extra-gcc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Wall -Wextra

tools/warnings/more-g++

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Wall

tools/warnings/more-gcc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Wall

tools/no-warnings-g++ renamed to tools/warnings/none-g++

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
-Wno-prio-ctor-dtor
3939
-Wno-psabi
4040
-Wno-return-local-addr
41-
-Wno-return-type
4241
-Wno-shift-count-negative
4342
-Wno-shift-count-overflow
4443
-Wno-shift-negative-value

tools/no-warnings-gcc renamed to tools/warnings/none-gcc

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
-Wno-prio-ctor-dtor
5252
-Wno-psabi
5353
-Wno-return-local-addr
54-
-Wno-return-type
5554
-Wno-shift-count-negative
5655
-Wno-shift-count-overflow
5756
-Wno-shift-negative-value

0 commit comments

Comments
 (0)