diff mbox series

package/olsr: needs -fPIC on Microblaze

Message ID 20200118222034.48072-1-giulio.benetti@benettiengineering.com
State Superseded
Headers show
Series package/olsr: needs -fPIC on Microblaze | expand

Commit Message

Giulio Benetti Jan. 18, 2020, 10:20 p.m. UTC
When building on Microblaze package olsr needs to be compiled with
-fPIC, so append -fPIC to CFLAGS when invoking make.

Fixes:
http://autobuild.buildroot.net/results/9d6/9d6d69133789aba16daeb6dc53721597e6be9806/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/olsr/olsr.mk | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

Comments

Evgeniy Didin Jan. 20, 2020, 9:46 a.m. UTC | #1
Hi Giulio,

>When building on Microblaze package olsr needs to be compiled with
>-fPIC, so append -fPIC to CFLAGS when invoking make.

>Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>---
>  package/olsr/olsr.mk | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)

> diff --git a/package/olsr/olsr.mk b/package/olsr/olsr.mk
>index 53bf874af0..ab4d5f1a76 100644
>--- a/package/olsr/olsr.mk
>+++ b/package/olsr/olsr.mk
>@@ -16,10 +16,19 @@ 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)
>+

This error appears for other architectures(ARC, RISCV, arm) as well:
http://autobuild.buildroot.net/results/0d3/0d3489b14f4f4f0d4837d00209b5c1ee8d6f6a98//
http://autobuild.buildroot.net/results/b85/b85d27b3a4bab5d68460401ff49e624177d55afa//

Could you please remove ifeq statement below so that the "-fPIC" option is applied for all purposes?

>+# microblaze needs -fPIC to link
>+ifeq ($(BR2_microblaze),y)
>+OLSR_CFLAGS += -fPIC
>+endif
>+
> 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

> --
> 2.20.1



Best regards,
Evgeniy Didin
Giulio Benetti Jan. 20, 2020, 2:50 p.m. UTC | #2
Hi Evgeniy,

On 1/20/20 10:46 AM, Evgeniy Didin wrote:
> Hi Giulio,
> 
>  >When building on Microblaze package olsr needs to be compiled with
>  >-fPIC, so append -fPIC to CFLAGS when invoking make.
> 
>  >Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>  >---
>  >  package/olsr/olsr.mk | 13 +++++++++++--
>  > 1 file changed, 11 insertions(+), 2 deletions(-)
> 
>  > diff --git a/package/olsr/olsr.mk b/package/olsr/olsr.mk
>  >index 53bf874af0..ab4d5f1a76 100644
>  >--- a/package/olsr/olsr.mk
>  >+++ b/package/olsr/olsr.mk
>  >@@ -16,10 +16,19 @@ 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)
>  >+
> 
> This error appears for other architectures(ARC, RISCV, arm) as well:
> http://autobuild.buildroot.net/results/0d3/0d3489b14f4f4f0d4837d00209b5c1ee8d6f6a98//
> http://autobuild.buildroot.net/results/b85/b85d27b3a4bab5d68460401ff49e624177d55afa//

You're right, and I've checked if there is something in common with all 
those architectures, but nothing, so it's better to append -fPIC as you 
suggest below.

> Could you please remove ifeq statement below so that the "-fPIC" option 
> is applied for all purposes?

Yes, I'm going to send a patch for this

Best regards
diff mbox series

Patch

diff --git a/package/olsr/olsr.mk b/package/olsr/olsr.mk
index 53bf874af0..ab4d5f1a76 100644
--- a/package/olsr/olsr.mk
+++ b/package/olsr/olsr.mk
@@ -16,10 +16,19 @@  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)
+
+# microblaze needs -fPIC to link
+ifeq ($(BR2_microblaze),y)
+OLSR_CFLAGS += -fPIC
+endif
+
 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