Brad Bishop | d5ae7d9 | 2018-06-14 09:52:03 -0700 | [diff] [blame] | 1 | From 6866325dd9c17412e555974dde41f9631224db52 Mon Sep 17 00:00:00 2001 |
| 2 | From: Laszlo Ersek <lersek@redhat.com> |
| 3 | Date: Wed, 7 Mar 2018 10:17:28 +0100 |
| 4 | Subject: [PATCH 3/4] BaseTools/header.makefile: revert gcc-8 "-Wno-xxx" |
| 5 | options on OSX |
| 6 | |
| 7 | I recently added the gcc-8 specific "-Wno-stringop-truncation" and |
| 8 | "-Wno-restrict" options to BUILD_CFLAGS, both for "Darwin" (XCODE5 / |
| 9 | clang, OSX) and otherwise (gcc, Linux / Cygwin). |
| 10 | |
| 11 | I also regression-tested the change with gcc-4.8 on Linux -- gcc-4.8 does |
| 12 | not know either of the (gcc-8 specific) "-Wno-stringop-truncation" and |
| 13 | "-Wno-restrict" options, yet the build completed fine (by GCC design). |
| 14 | |
| 15 | Regarding OSX, my expectation was that |
| 16 | |
| 17 | - XCODE5 / clang would either recognize these warnings options (because |
| 18 | clang does recognize most -W options of gcc), |
| 19 | |
| 20 | - or, similarly to gcc, clang would simply ignore the "-Wno-xxx" flags |
| 21 | that it didn't recognize. |
| 22 | |
| 23 | Neither is the case; the new flags have broken the BaseTools build on OSX. |
| 24 | Revert them (for OSX only). |
| 25 | |
| 26 | Cc: Liming Gao <liming.gao@intel.com> |
| 27 | Cc: Yonghong Zhu <yonghong.zhu@intel.com> |
| 28 | Reported-by: Liming Gao <liming.gao@intel.com> |
| 29 | Fixes: 1d212a83df0eaf32a6f5d4159beb2d77832e0231 |
| 30 | Fixes: 9222154ae7b3eef75ae88cdb56158256227cb929 |
| 31 | Contributed-under: TianoCore Contribution Agreement 1.1 |
| 32 | Signed-off-by: Laszlo Ersek <lersek@redhat.com> |
| 33 | Reviewed-by: Liming Gao <liming.gao@intel.com> |
| 34 | Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> |
| 35 | --- |
| 36 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 37 | Upstream-Status: Backport |
| 38 | BaseTools/Source/C/Makefiles/header.makefile | 2 +- |
| 39 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 40 | |
| 41 | Index: git/BaseTools/Source/C/Makefiles/header.makefile |
| 42 | =================================================================== |
| 43 | --- git.orig/BaseTools/Source/C/Makefiles/header.makefile |
| 44 | +++ git/BaseTools/Source/C/Makefiles/header.makefile |
| 45 | @@ -47,7 +47,7 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) |
| 46 | BUILD_CPPFLAGS += $(INCLUDE) -O2
|
| 47 | ifeq ($(DARWIN),Darwin)
|
| 48 | # assume clang or clang compatible flags on OS X
|
| 49 | -BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-self-assign -Wno-unused-result -nostdlib -c -g
|
| 50 | +BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -c -g
|
| 51 | else
|
| 52 | BUILD_CFLAGS += -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -c -g
|
| 53 | endif
|