From: Giulio Benetti Date: Mon, 20 Jan 2020 15:52:29 +0100 Subject: [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure In-Reply-To: <20200120145147.22650-1-giulio.benetti@benettiengineering.com> References: <20200120145147.22650-1-giulio.benetti@benettiengineering.com> Message-ID: <8227aa13-a690-89cd-d932-80c07cb2888b@benettiengineering.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net On 1/20/20 3:51 PM, Giulio Benetti wrote: > When building on Arc, Microblaze, Riscv32, Riscv64, package olsr needs > to be compiled with -fPIC, so append -fPIC to CFLAGS when invoking make > by default, since it seems to be mandatory in general and it's harmless > for other architectures. > > Fixes: > http://autobuild.buildroot.net/results/9d6/9d6d69133789aba16daeb6dc53721597e6be9806/ > http://autobuild.buildroot.net/results/b85/b85d27b3a4bab5d68460401ff49e624177d55afa/ > http://autobuild.buildroot.net/results/0d3/0d3489b14f4f4f0d4837d00209b5c1ee8d6f6a98/ > http://autobuild.buildroot.net/results/d9a/d9a143c8e9a175741acfafd17b63544d04744ac9/ > > Signed-off-by: Giulio Benetti > --- V1->V2: * append -fPIC to CFLAGS by default > package/olsr/olsr.mk | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/package/olsr/olsr.mk b/package/olsr/olsr.mk > index 31c601f80e..f930b3cacf 100644 > --- a/package/olsr/olsr.mk > +++ b/package/olsr/olsr.mk > @@ -14,10 +14,17 @@ OLSR_LICENSE = BSD-3-Clause, LGPL-2.1+ > OLSR_LICENSE_FILES = license.txt lib/pud/nmealib/LICENSE > OLSR_DEPENDENCIES = host-flex host-bison > > +OLSR_CFLAGS = $(TARGET_CFLAGS) > + > +# it needs -fPIC to link on lot of architectures > +OLSR_CFLAGS += -fPIC > + > define OLSR_BUILD_CMDS > - $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) -C $(@D) olsrd > + $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) \ > + CFLAGS="$(OLSR_CFLAGS)" -C $(@D) olsrd > $(foreach p,$(OLSR_PLUGINS), \ > - $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) -C $(@D)/lib/$(p) > + $(TARGET_CONFIGURE_OPTS) $(MAKE) ARCH=$(KERNEL_ARCH) \ > + CFLAGS="$(OLSR_CFLAGS)" -C $(@D)/lib/$(p) > ) > endef > > -- Giulio Benetti Benetti Engineering sas