Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From 3edce6a0019bcb90febc1f654b5b2e2bad5c59bd Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Thu, 26 May 2016 21:50:01 -0400 |
| 4 | Subject: [PATCH] fix compile failure with older host gcc (<=4.6) |
| 5 | |
| 6 | While host gcc version is 4.6.3 in ubuntu 1204, it |
| 7 | did not recognize -std=gnu11 and -Wmaybe-uninitialized. |
| 8 | |
| 9 | While host gcc version is 4.4.7 in centos6, it |
| 10 | did not recognize -std=gnu11, -Wmaybe-uninitialized, |
| 11 | and -flto. |
| 12 | |
| 13 | For native build, use -std=gnu99 to replace -std=gnu11, |
| 14 | and directly remove -Wmaybe-uninitialized and -flto. |
| 15 | |
| 16 | Upstream-Status: Pending |
| 17 | |
| 18 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 19 | |
| 20 | --- |
| 21 | gcc.specs | 4 ++-- |
| 22 | 1 file changed, 2 insertions(+), 2 deletions(-) |
| 23 | |
| 24 | diff --git a/gcc.specs b/gcc.specs |
| 25 | index 45d43d1..f1c6944 100644 |
| 26 | --- a/gcc.specs |
| 27 | +++ b/gcc.specs |
| 28 | @@ -2,13 +2,13 @@ |
| 29 | + -D_GNU_SOURCE |
| 30 | |
| 31 | *efivar_cpp_options: |
| 32 | - -Werror -Wall -std=gnu11 -Wextra |
| 33 | + -Werror -Wall -std=gnu99 -Wextra |
| 34 | |
| 35 | *cpp_options: |
| 36 | + %(efivar_cpp_options) |
| 37 | |
| 38 | *cc1_options: |
| 39 | -+ %(efivar_cpp_options) -Wmaybe-uninitialized -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}} |
| 40 | ++ %(efivar_cpp_options) -fno-merge-constants -fvisibility=hidden %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}} |
| 41 | |
| 42 | *self_spec: |
| 43 | + %{!shared:%{!static:%{!r:-pie}}} %{static:-Wl,-no-fatal-warnings -Wl,-static -static -Wl,-z,relro,-z,now} |