[Buildroot] [PATCH] package/jitterentropy-library: fix build failure due to missing -fPIC

Arnout Vandecappelle arnout at mind.be
Wed Oct 23 21:56:29 UTC 2019



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 at 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
> 



More information about the buildroot mailing list