[compiler-rt][builtins] Add compiler flags to catch potential errors
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 26 Aug 2022 04:34:09 +0000 (21:34 -0700)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 26 Aug 2022 15:35:19 +0000 (08:35 -0700)
commit2e9df860468425645dcd1b241c5dbf76c072e314
treedbdc61324057cf378f4534dfe883375ae49710a4
parent6e56779e6bc168a3acd14f9bf2c4fd3fd9d86bd1
[compiler-rt][builtins] Add compiler flags to catch potential errors
that can lead to security vulnerabilities

Also, fix a few places that were causing -Wshadow and
-Wformat-nonliteral warnings to be emitted.

This reapplies the patch that was reverted in caaafe4ae250 because it
broke Fuchsia builders.

I reverted the changes I made to InstrProfData.inc and instead renamed
the variables in InstrProfilingWriter.c. Also fixed a bug in function
add_security_warnings that was causing it to pass -Wformat-nonliteral
when the compiler doesn't support it.
compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
compiler-rt/cmake/config-ix.cmake
compiler-rt/lib/builtins/CMakeLists.txt
compiler-rt/lib/builtins/eprintf.c
compiler-rt/lib/profile/InstrProfiling.c
compiler-rt/lib/profile/InstrProfilingWriter.c