All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
@ 2019-10-23 11:06 Giulio Benetti
  2019-10-23 21:56 ` Arnout Vandecappelle
  0 siblings, 1 reply; 12+ messages in thread
From: Giulio Benetti @ 2019-10-23 11:06 UTC (permalink / raw)
  To: buildroot

jitterentropy-library needs -fPIC flag to build so add it when building.

Fixes:
http://autobuild.buildroot.net/results/505/5059207ec9ab0b502717626cc84956dafd0c3c32/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/jitterentropy-library/jitterentropy-library.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/jitterentropy-library/jitterentropy-library.mk b/package/jitterentropy-library/jitterentropy-library.mk
index 4e791e19dd..b8db1ccb80 100644
--- a/package/jitterentropy-library/jitterentropy-library.mk
+++ b/package/jitterentropy-library/jitterentropy-library.mk
@@ -10,8 +10,11 @@ JITTERENTROPY_LIBRARY_LICENSE = GPL-2.0 or BSD-3-Clause
 JITTERENTROPY_LIBRARY_LICENSE_FILES = COPYING COPYING.bsd COPYING.gplv2
 JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
 
+JITTERENTROPY_LIBRARY_CFLAGS = $(TARGET_CFLAGS)
+JITTERENTROPY_LIBRARY_CFLAGS += -fPIC
+
 define JITTERENTROPY_LIBRARY_BUILD_CMDS
-	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(JITTERENTROPY_LIBRARY_CFLAGS)"
 endef
 
 define JITTERENTROPY_LIBRARY_INSTALL_STAGING_CMDS
-- 
2.20.1

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-23 11:06 [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC Giulio Benetti
@ 2019-10-23 21:56 ` Arnout Vandecappelle
  2019-10-24  0:02   ` Matthew Weber
  2019-10-25 16:19   ` Peter Korsgaard
  0 siblings, 2 replies; 12+ messages in thread
From: Arnout Vandecappelle @ 2019-10-23 21:56 UTC (permalink / raw)
  To: buildroot



On 23/10/2019 13:06, Giulio Benetti wrote:
> jitterentropy-library needs -fPIC flag to build so add it when building.
> 
> Fixes:
> http://autobuild.buildroot.net/results/505/5059207ec9ab0b502717626cc84956dafd0c3c32/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  package/jitterentropy-library/jitterentropy-library.mk | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/package/jitterentropy-library/jitterentropy-library.mk b/package/jitterentropy-library/jitterentropy-library.mk
> index 4e791e19dd..b8db1ccb80 100644
> --- a/package/jitterentropy-library/jitterentropy-library.mk
> +++ b/package/jitterentropy-library/jitterentropy-library.mk
> @@ -10,8 +10,11 @@ JITTERENTROPY_LIBRARY_LICENSE = GPL-2.0 or BSD-3-Clause
>  JITTERENTROPY_LIBRARY_LICENSE_FILES = COPYING COPYING.bsd COPYING.gplv2
>  JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
>  
> +JITTERENTROPY_LIBRARY_CFLAGS = $(TARGET_CFLAGS)
> +JITTERENTROPY_LIBRARY_CFLAGS += -fPIC

 This is not good. Options like fPIC should be added by the package build system
itself.

> +
>  define JITTERENTROPY_LIBRARY_BUILD_CMDS
> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(JITTERENTROPY_LIBRARY_CFLAGS)"

 And here we see the actual issue: TARGET_CONFIGURE_OPTS should be passed in the
environment instead of as arguments, so the Makefile can add its stuff to it.

 Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
fstack-protector-all requires support from the toolchain. On the other hand, we
probably *do* want to keep the -O0 and -fwrapv flags...

 Also, I notice now that it always builds both a static and a shared library,
even on BR2_STATIC_LIBS. That will probably trigger a different build failure...

 Matt?

 Regards,
 Arnout


>  endef
>  
>  define JITTERENTROPY_LIBRARY_INSTALL_STAGING_CMDS
> 

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-23 21:56 ` Arnout Vandecappelle
@ 2019-10-24  0:02   ` Matthew Weber
  2019-10-24  2:28     ` Matthew Weber
  2019-10-25 16:19   ` Peter Korsgaard
  1 sibling, 1 reply; 12+ messages in thread
From: Matthew Weber @ 2019-10-24  0:02 UTC (permalink / raw)
  To: buildroot

On Wed, Oct 23, 2019 at 4:56 PM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 23/10/2019 13:06, Giulio Benetti wrote:
> > jitterentropy-library needs -fPIC flag to build so add it when building.
> >
> > Fixes:
> > http://autobuild.buildroot.net/results/505/5059207ec9ab0b502717626cc84956dafd0c3c32/
> >
> > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> > ---
> >  package/jitterentropy-library/jitterentropy-library.mk | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/package/jitterentropy-library/jitterentropy-library.mk b/package/jitterentropy-library/jitterentropy-library.mk
> > index 4e791e19dd..b8db1ccb80 100644
> > --- a/package/jitterentropy-library/jitterentropy-library.mk
> > +++ b/package/jitterentropy-library/jitterentropy-library.mk
> > @@ -10,8 +10,11 @@ JITTERENTROPY_LIBRARY_LICENSE = GPL-2.0 or BSD-3-Clause
> >  JITTERENTROPY_LIBRARY_LICENSE_FILES = COPYING COPYING.bsd COPYING.gplv2
> >  JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
> >
> > +JITTERENTROPY_LIBRARY_CFLAGS = $(TARGET_CFLAGS)
> > +JITTERENTROPY_LIBRARY_CFLAGS += -fPIC
>
>  This is not good. Options like fPIC should be added by the package build system
> itself.

Upstream was really receptive to other changes.  Giulio, do you want
to submit it?  If not I can.

>
> > +
> >  define JITTERENTROPY_LIBRARY_BUILD_CMDS
> > -     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
> > +     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(JITTERENTROPY_LIBRARY_CFLAGS)"
>
>  And here we see the actual issue: TARGET_CONFIGURE_OPTS should be passed in the
> environment instead of as arguments, so the Makefile can add its stuff to it.
>
>  Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
> fstack-protector-all requires support from the toolchain. On the other hand, we
> probably *do* want to keep the -O0 and -fwrapv flags...
>
>  Also, I notice now that it always builds both a static and a shared library,
> even on BR2_STATIC_LIBS. That will probably trigger a different build failure...
>

I'll take a look at some other packages to see how we didi this.
Right not upstream isn't setup to break the two apart.

Regards,
Matt

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-24  0:02   ` Matthew Weber
@ 2019-10-24  2:28     ` Matthew Weber
  2019-10-24 12:03       ` Matthew Weber
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew Weber @ 2019-10-24  2:28 UTC (permalink / raw)
  To: buildroot

Arnout,

On Wed, Oct 23, 2019 at 7:02 PM Matthew Weber
<matthew.weber@rockwellcollins.com> wrote:
>
> On Wed, Oct 23, 2019 at 4:56 PM Arnout Vandecappelle <arnout@mind.be> wrote:
> >
> >
> >
> > On 23/10/2019 13:06, Giulio Benetti wrote:
> > > jitterentropy-library needs -fPIC flag to build so add it when building.
> > >
> > > Fixes:
> > > http://autobuild.buildroot.net/results/505/5059207ec9ab0b502717626cc84956dafd0c3c32/
> > >
> > > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> > > ---
> > >  package/jitterentropy-library/jitterentropy-library.mk | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/package/jitterentropy-library/jitterentropy-library.mk b/package/jitterentropy-library/jitterentropy-library.mk
> > > index 4e791e19dd..b8db1ccb80 100644
> > > --- a/package/jitterentropy-library/jitterentropy-library.mk
> > > +++ b/package/jitterentropy-library/jitterentropy-library.mk
> > > @@ -10,8 +10,11 @@ JITTERENTROPY_LIBRARY_LICENSE = GPL-2.0 or BSD-3-Clause
> > >  JITTERENTROPY_LIBRARY_LICENSE_FILES = COPYING COPYING.bsd COPYING.gplv2
> > >  JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
> > >
> > > +JITTERENTROPY_LIBRARY_CFLAGS = $(TARGET_CFLAGS)
> > > +JITTERENTROPY_LIBRARY_CFLAGS += -fPIC
> >
> >  This is not good. Options like fPIC should be added by the package build system
> > itself.
>
> Upstream was really receptive to other changes.  Giulio, do you want
> to submit it?  If not I can.

Oops looking close are this it looks like what Arnout mentioned about
moving the TARGET_CONFIGURE_OPTS to be part of the env.  Guessing that
will create some other failures with overlapping hardening and ssp
flags but then the intent of the O0 and fPIC come through.

>
> >
> > > +
> > >  define JITTERENTROPY_LIBRARY_BUILD_CMDS
> > > -     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
> > > +     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(JITTERENTROPY_LIBRARY_CFLAGS)"
> >
> >  And here we see the actual issue: TARGET_CONFIGURE_OPTS should be passed in the
> > environment instead of as arguments, so the Makefile can add its stuff to it.
> >
> >  Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
> > fstack-protector-all requires support from the toolchain. On the other hand, we
> > probably *do* want to keep the -O0 and -fwrapv flags...
> >
> >  Also, I notice now that it always builds both a static and a shared library,
> > even on BR2_STATIC_LIBS. That will probably trigger a different build failure...
> >
>
> I'll take a look at some other packages to see how we didi this.
> Right not upstream isn't setup to break the two apart.
>

It doesn't look like the current upstream pkg Makefile is installing
the static library beyond creating it in the local build folder.  As
rng-tools solely uses it as shared, do you think I can just go with
adding "depends on !BR2_STATIC_LIBS" to the jitter-entropy-library
Config.in?  It looks like in rng-tools the jitter support is just
disabled when it can't find the library so in the static case it
shouldn't break the build.  I'd just need to also add a conditional on
the  jitter-entropy-library dependency in rng-tools based on
BR2_STATIC_LIBS.

Regards,
Matt

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-24  2:28     ` Matthew Weber
@ 2019-10-24 12:03       ` Matthew Weber
  2019-10-25  8:17         ` Matthew Weber
  0 siblings, 1 reply; 12+ messages in thread
From: Matthew Weber @ 2019-10-24 12:03 UTC (permalink / raw)
  To: buildroot

Arnout, Giulio,

On Wed, Oct 23, 2019 at 9:28 PM Matthew Weber
<matthew.weber@rockwellcollins.com> wrote:
>
> Arnout,
>
> On Wed, Oct 23, 2019 at 7:02 PM Matthew Weber
> <matthew.weber@rockwellcollins.com> wrote:
> >
> > On Wed, Oct 23, 2019 at 4:56 PM Arnout Vandecappelle <arnout@mind.be> wrote:
> > >
> > >
> > >
> > > On 23/10/2019 13:06, Giulio Benetti wrote:
> > > > jitterentropy-library needs -fPIC flag to build so add it when building.
> > > >
> > > > Fixes:
> > > > http://autobuild.buildroot.net/results/505/5059207ec9ab0b502717626cc84956dafd0c3c32/
> > > >
> > > > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> > > > ---
> > > >  package/jitterentropy-library/jitterentropy-library.mk | 5 ++++-
> > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/package/jitterentropy-library/jitterentropy-library.mk b/package/jitterentropy-library/jitterentropy-library.mk
> > > > index 4e791e19dd..b8db1ccb80 100644
> > > > --- a/package/jitterentropy-library/jitterentropy-library.mk
> > > > +++ b/package/jitterentropy-library/jitterentropy-library.mk
> > > > @@ -10,8 +10,11 @@ JITTERENTROPY_LIBRARY_LICENSE = GPL-2.0 or BSD-3-Clause
> > > >  JITTERENTROPY_LIBRARY_LICENSE_FILES = COPYING COPYING.bsd COPYING.gplv2
> > > >  JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
> > > >
> > > > +JITTERENTROPY_LIBRARY_CFLAGS = $(TARGET_CFLAGS)
> > > > +JITTERENTROPY_LIBRARY_CFLAGS += -fPIC
> > >
> > >  This is not good. Options like fPIC should be added by the package build system
> > > itself.
> >
> > Upstream was really receptive to other changes.  Giulio, do you want
> > to submit it?  If not I can.
>
> Oops looking close are this it looks like what Arnout mentioned about
> moving the TARGET_CONFIGURE_OPTS to be part of the env.  Guessing that
> will create some other failures with overlapping hardening and ssp
> flags but then the intent of the O0 and fPIC come through.

This snippet works to resolve the failure.

      3 --- a/package/jitterentropy-library/jitterentropy-library.mk
      4 +++ b/package/jitterentropy-library/jitterentropy-library.mk
      5 @@ -11,7 +11,7 @@ JITTERENTROPY_LIBRARY_LICENSE_FILES =
COPYING COPYING.bsd COPYING.gplv2
      6  JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
      7
      8  define JITTERENTROPY_LIBRARY_BUILD_CMDS
      9 -       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
     10 +       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
     11  endef

>
> >
> > >
> > > > +
> > > >  define JITTERENTROPY_LIBRARY_BUILD_CMDS
> > > > -     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
> > > > +     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(JITTERENTROPY_LIBRARY_CFLAGS)"
> > >
> > >  And here we see the actual issue: TARGET_CONFIGURE_OPTS should be passed in the
> > > environment instead of as arguments, so the Makefile can add its stuff to it.
> > >
> > >  Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
> > > fstack-protector-all requires support from the toolchain. On the other hand, we
> > > probably *do* want to keep the -O0 and -fwrapv flags...
> > >
> > >  Also, I notice now that it always builds both a static and a shared library,
> > > even on BR2_STATIC_LIBS. That will probably trigger a different build failure...
> > >
> >
> > I'll take a look at some other packages to see how we didi this.
> > Right not upstream isn't setup to break the two apart.
> >
>
> It doesn't look like the current upstream pkg Makefile is installing
> the static library beyond creating it in the local build folder.  As
> rng-tools solely uses it as shared, do you think I can just go with
> adding "depends on !BR2_STATIC_LIBS" to the jitter-entropy-library
> Config.in?  It looks like in rng-tools the jitter support is just
> disabled when it can't find the library so in the static case it
> shouldn't break the build.  I'd just need to also add a conditional on
> the  jitter-entropy-library dependency in rng-tools based on
> BR2_STATIC_LIBS.
>

Something like this?
https://pastebin.com/aeWL40Yr

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-24 12:03       ` Matthew Weber
@ 2019-10-25  8:17         ` Matthew Weber
  0 siblings, 0 replies; 12+ messages in thread
From: Matthew Weber @ 2019-10-25  8:17 UTC (permalink / raw)
  To: buildroot

Arnout, Giulio,

On Thu, Oct 24, 2019 at 7:03 AM Matthew Weber
<matthew.weber@rockwellcollins.com> wrote:
>
> Arnout, Giulio,
>
> On Wed, Oct 23, 2019 at 9:28 PM Matthew Weber
> <matthew.weber@rockwellcollins.com> wrote:
> >
> > Arnout,
> >
> > On Wed, Oct 23, 2019 at 7:02 PM Matthew Weber
> > <matthew.weber@rockwellcollins.com> wrote:
> > >
> > > On Wed, Oct 23, 2019 at 4:56 PM Arnout Vandecappelle <arnout@mind.be> wrote:
> > > >
> > > >
> > > >
> > > > On 23/10/2019 13:06, Giulio Benetti wrote:
> > > > > jitterentropy-library needs -fPIC flag to build so add it when building.
> > > > >
> > > > > Fixes:
> > > > > http://autobuild.buildroot.net/results/505/5059207ec9ab0b502717626cc84956dafd0c3c32/
> > > > >
> > > > > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> > > > > ---
> > > > >  package/jitterentropy-library/jitterentropy-library.mk | 5 ++++-
> > > > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/package/jitterentropy-library/jitterentropy-library.mk b/package/jitterentropy-library/jitterentropy-library.mk
> > > > > index 4e791e19dd..b8db1ccb80 100644
> > > > > --- a/package/jitterentropy-library/jitterentropy-library.mk
> > > > > +++ b/package/jitterentropy-library/jitterentropy-library.mk
> > > > > @@ -10,8 +10,11 @@ JITTERENTROPY_LIBRARY_LICENSE = GPL-2.0 or BSD-3-Clause
> > > > >  JITTERENTROPY_LIBRARY_LICENSE_FILES = COPYING COPYING.bsd COPYING.gplv2
> > > > >  JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
> > > > >
> > > > > +JITTERENTROPY_LIBRARY_CFLAGS = $(TARGET_CFLAGS)
> > > > > +JITTERENTROPY_LIBRARY_CFLAGS += -fPIC
> > > >
> > > >  This is not good. Options like fPIC should be added by the package build system
> > > > itself.
> > >
> > > Upstream was really receptive to other changes.  Giulio, do you want
> > > to submit it?  If not I can.
> >
> > Oops looking close are this it looks like what Arnout mentioned about
> > moving the TARGET_CONFIGURE_OPTS to be part of the env.  Guessing that
> > will create some other failures with overlapping hardening and ssp
> > flags but then the intent of the O0 and fPIC come through.
>
> This snippet works to resolve the failure.
>
>       3 --- a/package/jitterentropy-library/jitterentropy-library.mk
>       4 +++ b/package/jitterentropy-library/jitterentropy-library.mk
>       5 @@ -11,7 +11,7 @@ JITTERENTROPY_LIBRARY_LICENSE_FILES =
> COPYING COPYING.bsd COPYING.gplv2
>       6  JITTERENTROPY_LIBRARY_INSTALL_STAGING = YES
>       7
>       8  define JITTERENTROPY_LIBRARY_BUILD_CMDS
>       9 -       $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
>      10 +       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
>      11  endef
>

I've sent a v2 of this one proposing the reordering for now.
http://patchwork.ozlabs.org/patch/1183895/

> >
> > >
> > > >
> > > > > +
> > > > >  define JITTERENTROPY_LIBRARY_BUILD_CMDS
> > > > > -     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
> > > > > +     $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(JITTERENTROPY_LIBRARY_CFLAGS)"
> > > >
> > > >  And here we see the actual issue: TARGET_CONFIGURE_OPTS should be passed in the
> > > > environment instead of as arguments, so the Makefile can add its stuff to it.
> > > >
> > > >  Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
> > > > fstack-protector-all requires support from the toolchain. On the other hand, we
> > > > probably *do* want to keep the -O0 and -fwrapv flags...
> > > >
> > > >  Also, I notice now that it always builds both a static and a shared library,
> > > > even on BR2_STATIC_LIBS. That will probably trigger a different build failure...
> > > >
> > >
> > > I'll take a look at some other packages to see how we didi this.
> > > Right not upstream isn't setup to break the two apart.
> > >
> >
> > It doesn't look like the current upstream pkg Makefile is installing
> > the static library beyond creating it in the local build folder.  As
> > rng-tools solely uses it as shared, do you think I can just go with
> > adding "depends on !BR2_STATIC_LIBS" to the jitter-entropy-library
> > Config.in?  It looks like in rng-tools the jitter support is just
> > disabled when it can't find the library so in the static case it
> > shouldn't break the build.  I'd just need to also add a conditional on
> > the  jitter-entropy-library dependency in rng-tools based on
> > BR2_STATIC_LIBS.
> >
>
> Something like this?
> https://pastebin.com/aeWL40Yr

Ignore, +Fabrice Fontaine handled this in
http://patchwork.ozlabs.org/project/buildroot/list/?series=138439

Regards,
Matt

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-23 21:56 ` Arnout Vandecappelle
  2019-10-24  0:02   ` Matthew Weber
@ 2019-10-25 16:19   ` Peter Korsgaard
  2019-10-25 18:52     ` Arnout Vandecappelle
  1 sibling, 1 reply; 12+ messages in thread
From: Peter Korsgaard @ 2019-10-25 16:19 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

Hi,

 >> +
 >> define JITTERENTROPY_LIBRARY_BUILD_CMDS
 >> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
 >> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(JITTERENTROPY_LIBRARY_CFLAGS)"

 >  And here we see the actual issue: TARGET_CONFIGURE_OPTS should be passed in the
 > environment instead of as arguments, so the Makefile can add its stuff to it.

 >  Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
 > fstack-protector-all requires support from the toolchain. On the other hand, we
 > probably *do* want to keep the -O0 and -fwrapv flags...

The fstack-protector-* options should be handled by BR2_SSP_* and
hardcoded in the package. Why would we want to use -O0?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-25 16:19   ` Peter Korsgaard
@ 2019-10-25 18:52     ` Arnout Vandecappelle
  2019-10-25 19:23       ` Peter Korsgaard
  0 siblings, 1 reply; 12+ messages in thread
From: Arnout Vandecappelle @ 2019-10-25 18:52 UTC (permalink / raw)
  To: buildroot



On 25/10/2019 18:19, Peter Korsgaard wrote:
>>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
> 
> Hi,
> 
>  >> +
>  >> define JITTERENTROPY_LIBRARY_BUILD_CMDS
>  >> -	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS)
>  >> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(JITTERENTROPY_LIBRARY_CFLAGS)"
> 
>  >  And here we see the actual issue: TARGET_CONFIGURE_OPTS should be passed in the
>  > environment instead of as arguments, so the Makefile can add its stuff to it.
> 
>  >  Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
>  > fstack-protector-all requires support from the toolchain. On the other hand, we
>  > probably *do* want to keep the -O0 and -fwrapv flags...
> 
> The fstack-protector-* options should be handled by BR2_SSP_* and
> hardcoded in the package. 

 If with "hardcoded in the package" you mean "set by the package's .mk file",
then I disagree, since it is passed by the toolchain wrapper.


> Why would we want to use -O0?

 The package description is "Hardware RNG based on CPU timing jitter." I expect
that compiler optimisations mess with CPU timing jitter.

 Regards,
 Arnout

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-25 18:52     ` Arnout Vandecappelle
@ 2019-10-25 19:23       ` Peter Korsgaard
  2019-10-25 19:57         ` Arnout Vandecappelle
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Korsgaard @ 2019-10-25 19:23 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

Hi,

 >> >  Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
 >> > fstack-protector-all requires support from the toolchain. On the other hand, we
 >> > probably *do* want to keep the -O0 and -fwrapv flags...
 >> 
 >> The fstack-protector-* options should be handled by BR2_SSP_* and
 >> hardcoded in the package. 

 >  If with "hardcoded in the package" you mean "set by the package's .mk file",
 > then I disagree, since it is passed by the toolchain wrapper.

Sorry, there was a NOT missing, E.G. NOT hardcoded in .mk.

 >> Why would we want to use -O0?

 >  The package description is "Hardware RNG based on CPU timing jitter." I expect
 > that compiler optimisations mess with CPU timing jitter.

Ah yes, possibly.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-25 19:23       ` Peter Korsgaard
@ 2019-10-25 19:57         ` Arnout Vandecappelle
  2019-10-25 23:17           ` Markus Mayer
  0 siblings, 1 reply; 12+ messages in thread
From: Arnout Vandecappelle @ 2019-10-25 19:57 UTC (permalink / raw)
  To: buildroot



On 25/10/2019 21:23, Peter Korsgaard wrote:
>>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
> 
> Hi,
> 
>  >> >  Hm, but maybe there are indeed good reasons to override the CFLAGS, because the
>  >> > fstack-protector-all requires support from the toolchain. On the other hand, we
>  >> > probably *do* want to keep the -O0 and -fwrapv flags...
>  >> 
>  >> The fstack-protector-* options should be handled by BR2_SSP_* and
>  >> hardcoded in the package. 
> 
>  >  If with "hardcoded in the package" you mean "set by the package's .mk file",
>  > then I disagree, since it is passed by the toolchain wrapper.
> 
> Sorry, there was a NOT missing, E.G. NOT hardcoded in .mk.

 Yes, that's what I meant to say: CFLAGS should be overridden because we *don't*
want the Makefile's stack-protector option, because the toolchain may not
support it.

 Regards,
 Arnout

> 
>  >> Why would we want to use -O0?
> 
>  >  The package description is "Hardware RNG based on CPU timing jitter." I expect
>  > that compiler optimisations mess with CPU timing jitter.
> 
> Ah yes, possibly.
> 

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-25 19:57         ` Arnout Vandecappelle
@ 2019-10-25 23:17           ` Markus Mayer
  2019-10-26  0:01             ` Markus Mayer
  0 siblings, 1 reply; 12+ messages in thread
From: Markus Mayer @ 2019-10-25 23:17 UTC (permalink / raw)
  To: buildroot

FWIW, we are now getting build errors in jitterentropy-library. The
"fPIC" commit seems to be to blame. Specifically, the backslash that
was removed.

If I put the backslash back, it works again:

$ git diff
diff --git a/package/jitterentropy-library/jitterentropy-library.mk
b/package/jitterentropy-library/jitterentropy-library.mk
index 75c770f..3db04b2 100644
--- a/package/jitterentropy-library/jitterentropy-library.mk
+++ b/package/jitterentropy-library/jitterentropy-library.mk
@@ -22,7 +22,7 @@ JITTERENTROPY_LIBRARY_INSTALL_TARGETS += install-shared
 endif

 define JITTERENTROPY_LIBRARY_BUILD_CMDS
-       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
+       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
                $(JITTERENTROPY_LIBRARY_BUILD_TARGETS)
 endef

This is the error without the above change:

>>> jitterentropy-library 2.2.0 Building
PATH="/local/users/mmayer/buildroot/output/arm64/host/bin:/local/users/mmayer/buildroot/output/arm64/host/sbin:/home/mm940762/bin:/home/mm940762/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
PATH="/local/users/mmayer/buildroot/output/arm64/host/bin:/local/users/mmayer/buildroot/output/arm64/host/sbin:/home/mm940762/bin:/home/mm940762/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
AR="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ar"
AS="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-as"
LD="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ld"
NM="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-nm"
CC="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gcc"
GCC="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gcc"
CPP="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-cpp"
CXX="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-g++"
FC="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gfortran"
F77="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gfortran"
RANLIB="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ranlib"
READELF="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-readelf"
STRIP="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-strip"
OBJCOPY="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-objcopy"
OBJDUMP="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-objdump"
AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as"
CC_FOR_BUILD="/usr/bin/gcc" GCC_FOR_BUILD="/usr/bin/gcc"
CXX_FOR_BUILD="/usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld"
CPPFLAGS_FOR_BUILD="-I/local/users/mmayer/buildroot/output/arm64/host/include
-DNDEBUG" CFLAGS_FOR_BUILD="-O2
-I/local/users/mmayer/buildroot/output/arm64/host/include -DNDEBUG"
CXXFLAGS_FOR_BUILD="-O2
-I/local/users/mmayer/buildroot/output/arm64/host/include -DNDEBUG"
LDFLAGS_FOR_BUILD="-L/local/users/mmayer/buildroot/output/arm64/host/lib
-Wl,-rpath,/local/users/mmayer/buildroot/output/arm64/host/lib"
FCFLAGS_FOR_BUILD=""
DEFAULT_ASSEMBLER="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-as"
DEFAULT_LINKER="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ld"
CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  "
CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64  -Os  " LDFLAGS="" FCFLAGS=" -Os " FFLAGS=" -Os
" PKG_CONFIG="/local/users/mmayer/buildroot/output/arm64/host/bin/pkg-config"
STAGING_DIR="/local/users/mmayer/buildroot/output/arm64/host/aarch64-buildroot-linux-gnu/sysroot"
INTLTOOL_PERL=/usr/local/bin/perl ROOTDIR=../.. LINUXDIR=linux-stb-4.9
PKG_CONFIG="/local/users/mmayer/buildroot/output/arm64/host/bin/pkg-config"
/usr/bin/make -j33 -C
/local/users/mmayer/buildroot/output/arm64/build/jitterentropy-library-2.2.0
/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gcc
-shared -Wl,-soname,libjitterentropy.so.2 -o libjitterentropy.so.2.2.0
jitterentropy-base.o  -Wl,-z,relro,-z,now  -lrt
/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ar
rcs libjitterentropy.a jitterentropy-base.o
jitterentropy
/bin/bash: jitterentropy: command not found
package/pkg-generic.mk:238: recipe for target
'/local/users/mmayer/buildroot/output/arm64/build/jitterentropy-library-2.2.0/.stamp_built'
failed
make[1]: *** [/local/users/mmayer/buildroot/output/arm64/build/jitterentropy-library-2.2.0/.stamp_built]
Error 127
Makefile:25: recipe for target '_all' failed
make: *** [_all] Error 2

Regards,
-Markus

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

* [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC
  2019-10-25 23:17           ` Markus Mayer
@ 2019-10-26  0:01             ` Markus Mayer
  0 siblings, 0 replies; 12+ messages in thread
From: Markus Mayer @ 2019-10-26  0:01 UTC (permalink / raw)
  To: buildroot

On Fri, 25 Oct 2019 at 16:17, Markus Mayer <mmayer@broadcom.com> wrote:

> $ git diff
> diff --git a/package/jitterentropy-library/jitterentropy-library.mk
> b/package/jitterentropy-library/jitterentropy-library.mk
> index 75c770f..3db04b2 100644
> --- a/package/jitterentropy-library/jitterentropy-library.mk
> +++ b/package/jitterentropy-library/jitterentropy-library.mk
> @@ -22,7 +22,7 @@ JITTERENTROPY_LIBRARY_INSTALL_TARGETS += install-shared
>  endif
>
>  define JITTERENTROPY_LIBRARY_BUILD_CMDS
> -       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
> +       $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
>                 $(JITTERENTROPY_LIBRARY_BUILD_TARGETS)
>  endef

I submitted a proper patch for this.

http://lists.busybox.net/pipermail/buildroot/2019-October/263865.html

Regards,
-Markus

> This is the error without the above change:
>
> >>> jitterentropy-library 2.2.0 Building
> PATH="/local/users/mmayer/buildroot/output/arm64/host/bin:/local/users/mmayer/buildroot/output/arm64/host/sbin:/home/mm940762/bin:/home/mm940762/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
> PATH="/local/users/mmayer/buildroot/output/arm64/host/bin:/local/users/mmayer/buildroot/output/arm64/host/sbin:/home/mm940762/bin:/home/mm940762/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
> AR="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ar"
> AS="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-as"
> LD="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ld"
> NM="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-nm"
> CC="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gcc"
> GCC="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gcc"
> CPP="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-cpp"
> CXX="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-g++"
> FC="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gfortran"
> F77="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gfortran"
> RANLIB="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ranlib"
> READELF="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-readelf"
> STRIP="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-strip"
> OBJCOPY="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-objcopy"
> OBJDUMP="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-objdump"
> AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as"
> CC_FOR_BUILD="/usr/bin/gcc" GCC_FOR_BUILD="/usr/bin/gcc"
> CXX_FOR_BUILD="/usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld"
> CPPFLAGS_FOR_BUILD="-I/local/users/mmayer/buildroot/output/arm64/host/include
> -DNDEBUG" CFLAGS_FOR_BUILD="-O2
> -I/local/users/mmayer/buildroot/output/arm64/host/include -DNDEBUG"
> CXXFLAGS_FOR_BUILD="-O2
> -I/local/users/mmayer/buildroot/output/arm64/host/include -DNDEBUG"
> LDFLAGS_FOR_BUILD="-L/local/users/mmayer/buildroot/output/arm64/host/lib
> -Wl,-rpath,/local/users/mmayer/buildroot/output/arm64/host/lib"
> FCFLAGS_FOR_BUILD=""
> DEFAULT_ASSEMBLER="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-as"
> DEFAULT_LINKER="/local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ld"
> CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE
> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  "
> CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64  -Os  " LDFLAGS="" FCFLAGS=" -Os " FFLAGS=" -Os
> " PKG_CONFIG="/local/users/mmayer/buildroot/output/arm64/host/bin/pkg-config"
> STAGING_DIR="/local/users/mmayer/buildroot/output/arm64/host/aarch64-buildroot-linux-gnu/sysroot"
> INTLTOOL_PERL=/usr/local/bin/perl ROOTDIR=../.. LINUXDIR=linux-stb-4.9
> PKG_CONFIG="/local/users/mmayer/buildroot/output/arm64/host/bin/pkg-config"
> /usr/bin/make -j33 -C
> /local/users/mmayer/buildroot/output/arm64/build/jitterentropy-library-2.2.0
> /local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-gcc
> -shared -Wl,-soname,libjitterentropy.so.2 -o libjitterentropy.so.2.2.0
> jitterentropy-base.o  -Wl,-z,relro,-z,now  -lrt
> /local/users/mmayer/buildroot/output/arm64/host/bin/aarch64-linux-ar
> rcs libjitterentropy.a jitterentropy-base.o
> jitterentropy
> /bin/bash: jitterentropy: command not found
> package/pkg-generic.mk:238: recipe for target
> '/local/users/mmayer/buildroot/output/arm64/build/jitterentropy-library-2.2.0/.stamp_built'
> failed
> make[1]: *** [/local/users/mmayer/buildroot/output/arm64/build/jitterentropy-library-2.2.0/.stamp_built]
> Error 127
> Makefile:25: recipe for target '_all' failed
> make: *** [_all] Error 2
>
> Regards,
> -Markus

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

end of thread, other threads:[~2019-10-26  0:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-23 11:06 [Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC Giulio Benetti
2019-10-23 21:56 ` Arnout Vandecappelle
2019-10-24  0:02   ` Matthew Weber
2019-10-24  2:28     ` Matthew Weber
2019-10-24 12:03       ` Matthew Weber
2019-10-25  8:17         ` Matthew Weber
2019-10-25 16:19   ` Peter Korsgaard
2019-10-25 18:52     ` Arnout Vandecappelle
2019-10-25 19:23       ` Peter Korsgaard
2019-10-25 19:57         ` Arnout Vandecappelle
2019-10-25 23:17           ` Markus Mayer
2019-10-26  0:01             ` Markus Mayer

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.