[edk2] [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning options

Ard Biesheuvel posted 1 patch 6 years, 11 months ago
Failed in applying to current master (apply log)
BaseTools/Conf/tools_def.template | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2] [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning options
Posted by Ard Biesheuvel 6 years, 11 months ago
Ironically, disabling warnings in the OpensslLib library build is
causing breakage when using the CLANG35 toolchain to build for ARM:

error: unknown warning option '-Werror=maybe-uninitialized'; did you mean '-Werror=uninitialized'? [-Werror,-Wunknown-warning-option]

So let's add -Wno-unknown-warning-option to the list of warning to
ignore when using Clang 3.5

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 BaseTools/Conf/tools_def.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index d8fde02ea351..6afe5ebe9fe3 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -5595,7 +5595,7 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W
 DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf
 DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu
 
-DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body
+DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare -Wno-empty-body -Wno-unknown-warning-option
 DEFINE CLANG35_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS) DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES)
 DEFINE CLANG35_AARCH64_CC_FLAGS  = DEF(GCC_AARCH64_CC_FLAGS) DEF(CLANG35_AARCH64_TARGET) -mcmodel=small DEF(CLANG35_WARNING_OVERRIDES)
 
-- 
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning options
Posted by Gao, Liming 6 years, 11 months ago
Reviewed-by: Liming Gao <liming.gao@intel.com>

>-----Original Message-----
>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>Sent: Saturday, January 20, 2018 12:22 AM
>To: edk2-devel@lists.01.org
>Cc: leif.lindholm@linaro.org; Gao, Liming <liming.gao@intel.com>; Zhu,
>Yonghong <yonghong.zhu@intel.com>; Ard Biesheuvel
><ard.biesheuvel@linaro.org>
>Subject: [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning
>options
>
>Ironically, disabling warnings in the OpensslLib library build is
>causing breakage when using the CLANG35 toolchain to build for ARM:
>
>error: unknown warning option '-Werror=maybe-uninitialized'; did you mean
>'-Werror=uninitialized'? [-Werror,-Wunknown-warning-option]
>
>So let's add -Wno-unknown-warning-option to the list of warning to
>ignore when using Clang 3.5
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>---
> BaseTools/Conf/tools_def.template | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/BaseTools/Conf/tools_def.template
>b/BaseTools/Conf/tools_def.template
>index d8fde02ea351..6afe5ebe9fe3 100755
>--- a/BaseTools/Conf/tools_def.template
>+++ b/BaseTools/Conf/tools_def.template
>@@ -5595,7 +5595,7 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS =
>DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W
> DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf
> DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu
>
>-DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
>Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare
>-Wno-empty-body
>+DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
>Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare
>-Wno-empty-body -Wno-unknown-warning-option
> DEFINE CLANG35_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS)
>DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES)
> DEFINE CLANG35_AARCH64_CC_FLAGS  = DEF(GCC_AARCH64_CC_FLAGS)
>DEF(CLANG35_AARCH64_TARGET) -mcmodel=small
>DEF(CLANG35_WARNING_OVERRIDES)
>
>--
>2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning options
Posted by Ard Biesheuvel 6 years, 11 months ago
On 22 January 2018 at 02:21, Gao, Liming <liming.gao@intel.com> wrote:
> Reviewed-by: Liming Gao <liming.gao@intel.com>
>

Thanks Liming.

Do you agree to add this to CLANG38_WARNING_OVERRIDES as well? We need
this on ARM, and I assume on x86 as well.


>>-----Original Message-----
>>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>>Sent: Saturday, January 20, 2018 12:22 AM
>>To: edk2-devel@lists.01.org
>>Cc: leif.lindholm@linaro.org; Gao, Liming <liming.gao@intel.com>; Zhu,
>>Yonghong <yonghong.zhu@intel.com>; Ard Biesheuvel
>><ard.biesheuvel@linaro.org>
>>Subject: [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning
>>options
>>
>>Ironically, disabling warnings in the OpensslLib library build is
>>causing breakage when using the CLANG35 toolchain to build for ARM:
>>
>>error: unknown warning option '-Werror=maybe-uninitialized'; did you mean
>>'-Werror=uninitialized'? [-Werror,-Wunknown-warning-option]
>>
>>So let's add -Wno-unknown-warning-option to the list of warning to
>>ignore when using Clang 3.5
>>
>>Contributed-under: TianoCore Contribution Agreement 1.1
>>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>---
>> BaseTools/Conf/tools_def.template | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/BaseTools/Conf/tools_def.template
>>b/BaseTools/Conf/tools_def.template
>>index d8fde02ea351..6afe5ebe9fe3 100755
>>--- a/BaseTools/Conf/tools_def.template
>>+++ b/BaseTools/Conf/tools_def.template
>>@@ -5595,7 +5595,7 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS =
>>DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W
>> DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf
>> DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu
>>
>>-DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
>>Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare
>>-Wno-empty-body
>>+DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
>>Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare
>>-Wno-empty-body -Wno-unknown-warning-option
>> DEFINE CLANG35_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS)
>>DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES)
>> DEFINE CLANG35_AARCH64_CC_FLAGS  = DEF(GCC_AARCH64_CC_FLAGS)
>>DEF(CLANG35_AARCH64_TARGET) -mcmodel=small
>>DEF(CLANG35_WARNING_OVERRIDES)
>>
>>--
>>2.11.0
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning options
Posted by Gao, Liming 6 years, 11 months ago
Ard:
  I don't meet with the error on CLANG38 for x86. I use clang3.8 compiler. 

Thanks
Liming
>-----Original Message-----
>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>Sent: Monday, January 22, 2018 4:52 PM
>To: Gao, Liming <liming.gao@intel.com>
>Cc: edk2-devel@lists.01.org; leif.lindholm@linaro.org; Zhu, Yonghong
><yonghong.zhu@intel.com>
>Subject: Re: [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning
>options
>
>On 22 January 2018 at 02:21, Gao, Liming <liming.gao@intel.com> wrote:
>> Reviewed-by: Liming Gao <liming.gao@intel.com>
>>
>
>Thanks Liming.
>
>Do you agree to add this to CLANG38_WARNING_OVERRIDES as well? We
>need
>this on ARM, and I assume on x86 as well.
>
>
>>>-----Original Message-----
>>>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>>>Sent: Saturday, January 20, 2018 12:22 AM
>>>To: edk2-devel@lists.01.org
>>>Cc: leif.lindholm@linaro.org; Gao, Liming <liming.gao@intel.com>; Zhu,
>>>Yonghong <yonghong.zhu@intel.com>; Ard Biesheuvel
>>><ard.biesheuvel@linaro.org>
>>>Subject: [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning
>>>options
>>>
>>>Ironically, disabling warnings in the OpensslLib library build is
>>>causing breakage when using the CLANG35 toolchain to build for ARM:
>>>
>>>error: unknown warning option '-Werror=maybe-uninitialized'; did you
>mean
>>>'-Werror=uninitialized'? [-Werror,-Wunknown-warning-option]
>>>
>>>So let's add -Wno-unknown-warning-option to the list of warning to
>>>ignore when using Clang 3.5
>>>
>>>Contributed-under: TianoCore Contribution Agreement 1.1
>>>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>>---
>>> BaseTools/Conf/tools_def.template | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>>diff --git a/BaseTools/Conf/tools_def.template
>>>b/BaseTools/Conf/tools_def.template
>>>index d8fde02ea351..6afe5ebe9fe3 100755
>>>--- a/BaseTools/Conf/tools_def.template
>>>+++ b/BaseTools/Conf/tools_def.template
>>>@@ -5595,7 +5595,7 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS =
>>>DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W
>>> DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf
>>> DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu
>>>
>>>-DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
>>>Wno-tautological-compare -Wno-tautological-constant-out-of-range-
>compare
>>>-Wno-empty-body
>>>+DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
>>>Wno-tautological-compare -Wno-tautological-constant-out-of-range-
>compare
>>>-Wno-empty-body -Wno-unknown-warning-option
>>> DEFINE CLANG35_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS)
>>>DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES)
>>> DEFINE CLANG35_AARCH64_CC_FLAGS  = DEF(GCC_AARCH64_CC_FLAGS)
>>>DEF(CLANG35_AARCH64_TARGET) -mcmodel=small
>>>DEF(CLANG35_WARNING_OVERRIDES)
>>>
>>>--
>>>2.11.0
>>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning options
Posted by Ard Biesheuvel 6 years, 11 months ago
On 22 January 2018 at 09:05, Gao, Liming <liming.gao@intel.com> wrote:
> Ard:
>   I don't meet with the error on CLANG38 for x86. I use clang3.8 compiler.
>

I solved the mystery: CLANG38 for x86 already has -Wno-unknown-warning-option

So if you agree, I will add it to CLANG35_WARNING_OVERRIDES (as in
this patch) and move it from CLANG38_ALL_CC_FLAGS to
CLANG38_WARNING_OVERRIDES as well.


>>-----Original Message-----
>>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>>Sent: Monday, January 22, 2018 4:52 PM
>>To: Gao, Liming <liming.gao@intel.com>
>>Cc: edk2-devel@lists.01.org; leif.lindholm@linaro.org; Zhu, Yonghong
>><yonghong.zhu@intel.com>
>>Subject: Re: [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning
>>options
>>
>>On 22 January 2018 at 02:21, Gao, Liming <liming.gao@intel.com> wrote:
>>> Reviewed-by: Liming Gao <liming.gao@intel.com>
>>>
>>
>>Thanks Liming.
>>
>>Do you agree to add this to CLANG38_WARNING_OVERRIDES as well? We
>>need
>>this on ARM, and I assume on x86 as well.
>>
>>
>>>>-----Original Message-----
>>>>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
>>>>Sent: Saturday, January 20, 2018 12:22 AM
>>>>To: edk2-devel@lists.01.org
>>>>Cc: leif.lindholm@linaro.org; Gao, Liming <liming.gao@intel.com>; Zhu,
>>>>Yonghong <yonghong.zhu@intel.com>; Ard Biesheuvel
>>>><ard.biesheuvel@linaro.org>
>>>>Subject: [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning
>>>>options
>>>>
>>>>Ironically, disabling warnings in the OpensslLib library build is
>>>>causing breakage when using the CLANG35 toolchain to build for ARM:
>>>>
>>>>error: unknown warning option '-Werror=maybe-uninitialized'; did you
>>mean
>>>>'-Werror=uninitialized'? [-Werror,-Wunknown-warning-option]
>>>>
>>>>So let's add -Wno-unknown-warning-option to the list of warning to
>>>>ignore when using Clang 3.5
>>>>
>>>>Contributed-under: TianoCore Contribution Agreement 1.1
>>>>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>>>---
>>>> BaseTools/Conf/tools_def.template | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>>diff --git a/BaseTools/Conf/tools_def.template
>>>>b/BaseTools/Conf/tools_def.template
>>>>index d8fde02ea351..6afe5ebe9fe3 100755
>>>>--- a/BaseTools/Conf/tools_def.template
>>>>+++ b/BaseTools/Conf/tools_def.template
>>>>@@ -5595,7 +5595,7 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS =
>>>>DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W
>>>> DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf
>>>> DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu
>>>>
>>>>-DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
>>>>Wno-tautological-compare -Wno-tautological-constant-out-of-range-
>>compare
>>>>-Wno-empty-body
>>>>+DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
>>>>Wno-tautological-compare -Wno-tautological-constant-out-of-range-
>>compare
>>>>-Wno-empty-body -Wno-unknown-warning-option
>>>> DEFINE CLANG35_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS)
>>>>DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES)
>>>> DEFINE CLANG35_AARCH64_CC_FLAGS  = DEF(GCC_AARCH64_CC_FLAGS)
>>>>DEF(CLANG35_AARCH64_TARGET) -mcmodel=small
>>>>DEF(CLANG35_WARNING_OVERRIDES)
>>>>
>>>>--
>>>>2.11.0
>>>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning options
Posted by Gao, Liming 6 years, 11 months ago
It's ok to me. Thanks!

> -----Original Message-----
> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
> Sent: Monday, January 22, 2018 4:52 PM
> To: Gao, Liming <liming.gao@intel.com>
> Cc: edk2-devel@lists.01.org; leif.lindholm@linaro.org; Zhu, Yonghong <yonghong.zhu@intel.com>
> Subject: Re: [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning options
> 
> On 22 January 2018 at 02:21, Gao, Liming <liming.gao@intel.com> wrote:
> > Reviewed-by: Liming Gao <liming.gao@intel.com>
> >
> 
> Thanks Liming.
> 
> Do you agree to add this to CLANG38_WARNING_OVERRIDES as well? We need
> this on ARM, and I assume on x86 as well.
> 
> 
> >>-----Original Message-----
> >>From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]
> >>Sent: Saturday, January 20, 2018 12:22 AM
> >>To: edk2-devel@lists.01.org
> >>Cc: leif.lindholm@linaro.org; Gao, Liming <liming.gao@intel.com>; Zhu,
> >>Yonghong <yonghong.zhu@intel.com>; Ard Biesheuvel
> >><ard.biesheuvel@linaro.org>
> >>Subject: [PATCH] BaseTools/tools_def CLANG35: ignore unknown warning
> >>options
> >>
> >>Ironically, disabling warnings in the OpensslLib library build is
> >>causing breakage when using the CLANG35 toolchain to build for ARM:
> >>
> >>error: unknown warning option '-Werror=maybe-uninitialized'; did you mean
> >>'-Werror=uninitialized'? [-Werror,-Wunknown-warning-option]
> >>
> >>So let's add -Wno-unknown-warning-option to the list of warning to
> >>ignore when using Clang 3.5
> >>
> >>Contributed-under: TianoCore Contribution Agreement 1.1
> >>Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >>---
> >> BaseTools/Conf/tools_def.template | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >>diff --git a/BaseTools/Conf/tools_def.template
> >>b/BaseTools/Conf/tools_def.template
> >>index d8fde02ea351..6afe5ebe9fe3 100755
> >>--- a/BaseTools/Conf/tools_def.template
> >>+++ b/BaseTools/Conf/tools_def.template
> >>@@ -5595,7 +5595,7 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS =
> >>DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W
> >> DEFINE CLANG35_ARM_TARGET        = -target arm-linux-gnueabihf
> >> DEFINE CLANG35_AARCH64_TARGET    = -target aarch64-linux-gnu
> >>
> >>-DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
> >>Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare
> >>-Wno-empty-body
> >>+DEFINE CLANG35_WARNING_OVERRIDES = -Wno-parentheses-equality -
> >>Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare
> >>-Wno-empty-body -Wno-unknown-warning-option
> >> DEFINE CLANG35_ARM_CC_FLAGS      = DEF(GCC_ARM_CC_FLAGS)
> >>DEF(CLANG35_ARM_TARGET) DEF(CLANG35_WARNING_OVERRIDES)
> >> DEFINE CLANG35_AARCH64_CC_FLAGS  = DEF(GCC_AARCH64_CC_FLAGS)
> >>DEF(CLANG35_AARCH64_TARGET) -mcmodel=small
> >>DEF(CLANG35_WARNING_OVERRIDES)
> >>
> >>--
> >>2.11.0
> >
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel