mirror of https://github.com/acidanthera/audk.git
BaseTools: Add GCC flags to Basetool build.
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1764 Some compiler flags restrict the compiler from making arbitrary decisions while handling undefined C/C++ behaviors. Therefore they can be used to fix some issues caused by undefined behavior. For example, for GCC, the following flags are available: -fno-delete-null-pointer-checks tells the compiler NOT to assume that null pointer deference does not exist. -fwrapv tells the compiler that signed overflow always wraps. This patch is going to add these 2 build options to BaseTool GCC build option. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
0d6de095a5
commit
c4c8c340ef
|
@ -71,7 +71,8 @@ ifeq ($(DARWIN),Darwin)
|
||||||
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
|
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
|
||||||
-Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
|
-Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g
|
||||||
else
|
else
|
||||||
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \
|
BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \
|
||||||
|
-fno-delete-null-pointer-checks -Wall -Werror \
|
||||||
-Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
|
-Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict \
|
||||||
-Wno-unused-result -nostdlib -g
|
-Wno-unused-result -nostdlib -g
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue