All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libkcapi: fix build with BR2_OPTIMIZE_0
@ 2022-04-05 16:35 Fabrice Fontaine
  2022-04-05 17:27 ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2022-04-05 16:35 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Override COMMON_CPPFLAGS to fix the following build failure with
BR2_OPTIMIZE_0 raised since bump to version 0.14.0 in commit
cd707a9112e38b4ce98326b96c0ed12054ca1cca and
https://github.com/smuellerDD/libkcapi/commit/0e7b2b0300782aca19c324f3352f109777b4c51a:

/home/autobuild/autobuild/instance-15/output-1/host/i686-buildroot-linux-gnu/sysroot/usr/include/features.h:412:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]

It should be noted that upstream already rejected a PR to remove
-Werror: https://github.com/smuellerDD/libkcapi/pull/132

Fixes:
 - http://autobuild.buildroot.org/results/35141ea3046f5a4593e0b27ef92e4ace6bc0be66

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/libkcapi/libkcapi.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/libkcapi/libkcapi.mk b/package/libkcapi/libkcapi.mk
index 71dfbd9eff..353939bb31 100644
--- a/package/libkcapi/libkcapi.mk
+++ b/package/libkcapi/libkcapi.mk
@@ -15,6 +15,7 @@ LIBKCAPI_CONF_ENV = \
 	ac_cv_path_DB2PDF="" \
 	ac_cv_path_DB2PS="" \
 	ac_cv_path_XMLTO=""
+LIBKCAPI_MAKE_OPTS = COMMON_CPPFLAGS=""
 
 ifeq ($(BR2_PACKAGE_LIBKCAPI_ENCAPP),y)
 LIBKCAPI_CONF_OPTS += --enable-kcapi-encapp
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/libkcapi: fix build with BR2_OPTIMIZE_0
  2022-04-05 16:35 [Buildroot] [PATCH 1/1] package/libkcapi: fix build with BR2_OPTIMIZE_0 Fabrice Fontaine
@ 2022-04-05 17:27 ` Arnout Vandecappelle
  2022-04-05 18:50   ` Fabrice Fontaine
  0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2022-04-05 17:27 UTC (permalink / raw)
  To: Fabrice Fontaine, buildroot



On 05/04/2022 18:35, Fabrice Fontaine wrote:
> Override COMMON_CPPFLAGS to fix the following build failure with
> BR2_OPTIMIZE_0 raised since bump to version 0.14.0 in commit
> cd707a9112e38b4ce98326b96c0ed12054ca1cca and
> https://github.com/smuellerDD/libkcapi/commit/0e7b2b0300782aca19c324f3352f109777b4c51a:
> 
> /home/autobuild/autobuild/instance-15/output-1/host/i686-buildroot-linux-gnu/sysroot/usr/include/features.h:412:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]

  I haven't looked at the details, but in this case it seems to me the proper 
solution is to make sure _FORTIFY_SOURCE is not enabled.

  But perhaps that is exactly what this patch does?

  Regards,
  Arnout

> 
> It should be noted that upstream already rejected a PR to remove
> -Werror: https://github.com/smuellerDD/libkcapi/pull/132
> 
> Fixes:
>   - http://autobuild.buildroot.org/results/35141ea3046f5a4593e0b27ef92e4ace6bc0be66
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>   package/libkcapi/libkcapi.mk | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/package/libkcapi/libkcapi.mk b/package/libkcapi/libkcapi.mk
> index 71dfbd9eff..353939bb31 100644
> --- a/package/libkcapi/libkcapi.mk
> +++ b/package/libkcapi/libkcapi.mk
> @@ -15,6 +15,7 @@ LIBKCAPI_CONF_ENV = \
>   	ac_cv_path_DB2PDF="" \
>   	ac_cv_path_DB2PS="" \
>   	ac_cv_path_XMLTO=""
> +LIBKCAPI_MAKE_OPTS = COMMON_CPPFLAGS=""
>   
>   ifeq ($(BR2_PACKAGE_LIBKCAPI_ENCAPP),y)
>   LIBKCAPI_CONF_OPTS += --enable-kcapi-encapp
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/libkcapi: fix build with BR2_OPTIMIZE_0
  2022-04-05 17:27 ` Arnout Vandecappelle
@ 2022-04-05 18:50   ` Fabrice Fontaine
  2022-04-09 15:50     ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2022-04-05 18:50 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: Buildroot Mailing List

Le mar. 5 avr. 2022 à 19:28, Arnout Vandecappelle <arnout@mind.be> a écrit :
>
>
>
> On 05/04/2022 18:35, Fabrice Fontaine wrote:
> > Override COMMON_CPPFLAGS to fix the following build failure with
> > BR2_OPTIMIZE_0 raised since bump to version 0.14.0 in commit
> > cd707a9112e38b4ce98326b96c0ed12054ca1cca and
> > https://github.com/smuellerDD/libkcapi/commit/0e7b2b0300782aca19c324f3352f109777b4c51a:
> >
> > /home/autobuild/autobuild/instance-15/output-1/host/i686-buildroot-linux-gnu/sysroot/usr/include/features.h:412:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
>
>   I haven't looked at the details, but in this case it seems to me the proper
> solution is to make sure _FORTIFY_SOURCE is not enabled.
>
>   But perhaps that is exactly what this patch does?

This patch was removing the following flags (including -Werror):
COMMON_CPPFLAGS = -Wextra -Wall -pedantic -fwrapv --param
ssp-buffer-size=4 -O2 -Werror -std=gnu99 -Wconversion

However, -D_FORTIFY_SOURCE=2 was still set (in CPPFLAGS)

I can send a v2 to set CPPFLAGS to $(TARGET_CPPFLAGS) if you prefer
this solution.

>
>   Regards,
>   Arnout
>
> >
> > It should be noted that upstream already rejected a PR to remove
> > -Werror: https://github.com/smuellerDD/libkcapi/pull/132
> >
> > Fixes:
> >   - http://autobuild.buildroot.org/results/35141ea3046f5a4593e0b27ef92e4ace6bc0be66
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > ---
> >   package/libkcapi/libkcapi.mk | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/package/libkcapi/libkcapi.mk b/package/libkcapi/libkcapi.mk
> > index 71dfbd9eff..353939bb31 100644
> > --- a/package/libkcapi/libkcapi.mk
> > +++ b/package/libkcapi/libkcapi.mk
> > @@ -15,6 +15,7 @@ LIBKCAPI_CONF_ENV = \
> >       ac_cv_path_DB2PDF="" \
> >       ac_cv_path_DB2PS="" \
> >       ac_cv_path_XMLTO=""
> > +LIBKCAPI_MAKE_OPTS = COMMON_CPPFLAGS=""
> >
> >   ifeq ($(BR2_PACKAGE_LIBKCAPI_ENCAPP),y)
> >   LIBKCAPI_CONF_OPTS += --enable-kcapi-encapp

Best Regards,

Fabrice
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/libkcapi: fix build with BR2_OPTIMIZE_0
  2022-04-05 18:50   ` Fabrice Fontaine
@ 2022-04-09 15:50     ` Arnout Vandecappelle
  0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2022-04-09 15:50 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Buildroot Mailing List



On 05/04/2022 20:50, Fabrice Fontaine wrote:
> Le mar. 5 avr. 2022 à 19:28, Arnout Vandecappelle <arnout@mind.be> a écrit :
>>
>>
>>
>> On 05/04/2022 18:35, Fabrice Fontaine wrote:
>>> Override COMMON_CPPFLAGS to fix the following build failure with
>>> BR2_OPTIMIZE_0 raised since bump to version 0.14.0 in commit
>>> cd707a9112e38b4ce98326b96c0ed12054ca1cca and
>>> https://github.com/smuellerDD/libkcapi/commit/0e7b2b0300782aca19c324f3352f109777b4c51a:
>>>
>>> /home/autobuild/autobuild/instance-15/output-1/host/i686-buildroot-linux-gnu/sysroot/usr/include/features.h:412:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
>>
>>    I haven't looked at the details, but in this case it seems to me the proper
>> solution is to make sure _FORTIFY_SOURCE is not enabled.
>>
>>    But perhaps that is exactly what this patch does?
> 
> This patch was removing the following flags (including -Werror):
> COMMON_CPPFLAGS = -Wextra -Wall -pedantic -fwrapv --param
> ssp-buffer-size=4 -O2 -Werror -std=gnu99 -Wconversion

  -fwrapv is something that certainly should *not* be removed. -std=gnu99 as 
well. --param ssp-buffer-size=4 is a bit dubious (I *think* it only has an 
effect if SSP is enabled with another option). -O2 is something that we really 
do want to override, but if CFLAGS is added after it, it's fine. And I guess 
that's what happens, otherwise the error you're trying to fix wouldn't occur.

> 
> However, -D_FORTIFY_SOURCE=2 was still set (in CPPFLAGS)

  We really only want FORTIFY if it's enabled by Buildroot, because of 
BR2_FORTIFY_SOURCE_ARCH_SUPPORTS (and because optimisations must be enabled 
before it can be used, obviously).


> I can send a v2 to set CPPFLAGS to $(TARGET_CPPFLAGS) if you prefer
> this solution.

  Yeah, I think that's the way to go. BTW is it really CPPFLAGS? -O2 and -fwrapv 
really belong to CFLAGS, not CPPFLAGS. Not that it matters much I guess.

  Regards,
  Arnout

> 
>>
>>    Regards,
>>    Arnout
>>
>>>
>>> It should be noted that upstream already rejected a PR to remove
>>> -Werror: https://github.com/smuellerDD/libkcapi/pull/132
>>>
>>> Fixes:
>>>    - http://autobuild.buildroot.org/results/35141ea3046f5a4593e0b27ef92e4ace6bc0be66
>>>
>>> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>>> ---
>>>    package/libkcapi/libkcapi.mk | 1 +
>>>    1 file changed, 1 insertion(+)
>>>
>>> diff --git a/package/libkcapi/libkcapi.mk b/package/libkcapi/libkcapi.mk
>>> index 71dfbd9eff..353939bb31 100644
>>> --- a/package/libkcapi/libkcapi.mk
>>> +++ b/package/libkcapi/libkcapi.mk
>>> @@ -15,6 +15,7 @@ LIBKCAPI_CONF_ENV = \
>>>        ac_cv_path_DB2PDF="" \
>>>        ac_cv_path_DB2PS="" \
>>>        ac_cv_path_XMLTO=""
>>> +LIBKCAPI_MAKE_OPTS = COMMON_CPPFLAGS=""
>>>
>>>    ifeq ($(BR2_PACKAGE_LIBKCAPI_ENCAPP),y)
>>>    LIBKCAPI_CONF_OPTS += --enable-kcapi-encapp
> 
> Best Regards,
> 
> Fabrice
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-09 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 16:35 [Buildroot] [PATCH 1/1] package/libkcapi: fix build with BR2_OPTIMIZE_0 Fabrice Fontaine
2022-04-05 17:27 ` Arnout Vandecappelle
2022-04-05 18:50   ` Fabrice Fontaine
2022-04-09 15:50     ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.