All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/olsr: needs -fPIC on Microblaze
@ 2020-01-18 22:20 Giulio Benetti
  2020-01-20  9:46 ` Evgeniy Didin
  0 siblings, 1 reply; 6+ messages in thread
From: Giulio Benetti @ 2020-01-18 22:20 UTC (permalink / raw)
  To: buildroot

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(-)

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

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

* [Buildroot] [PATCH] package/olsr: needs -fPIC on Microblaze
  2020-01-18 22:20 [Buildroot] [PATCH] package/olsr: needs -fPIC on Microblaze Giulio Benetti
@ 2020-01-20  9:46 ` Evgeniy Didin
  2020-01-20 14:50   ` Giulio Benetti
  2020-01-20 14:51   ` [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure Giulio Benetti
  0 siblings, 2 replies; 6+ messages in thread
From: Evgeniy Didin @ 2020-01-20  9:46 UTC (permalink / raw)
  To: buildroot

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200120/1fba3b37/attachment.html>

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

* [Buildroot] [PATCH] package/olsr: needs -fPIC on Microblaze
  2020-01-20  9:46 ` Evgeniy Didin
@ 2020-01-20 14:50   ` Giulio Benetti
  2020-01-20 14:51   ` [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure Giulio Benetti
  1 sibling, 0 replies; 6+ messages in thread
From: Giulio Benetti @ 2020-01-20 14:50 UTC (permalink / raw)
  To: buildroot

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
-- 
Giulio Benetti
Benetti Engineering sas

>  >+# 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
> 
> 

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

* [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure
  2020-01-20  9:46 ` Evgeniy Didin
  2020-01-20 14:50   ` Giulio Benetti
@ 2020-01-20 14:51   ` Giulio Benetti
  2020-01-20 14:52     ` Giulio Benetti
  2020-02-03 10:24     ` Peter Korsgaard
  1 sibling, 2 replies; 6+ messages in thread
From: Giulio Benetti @ 2020-01-20 14:51 UTC (permalink / raw)
  To: buildroot

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 <giulio.benetti@benettiengineering.com>
---
 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
 
-- 
2.20.1

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

* [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure
  2020-01-20 14:51   ` [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure Giulio Benetti
@ 2020-01-20 14:52     ` Giulio Benetti
  2020-02-03 10:24     ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Giulio Benetti @ 2020-01-20 14:52 UTC (permalink / raw)
  To: buildroot



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 <giulio.benetti@benettiengineering.com>
> ---

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

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

* [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure
  2020-01-20 14:51   ` [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure Giulio Benetti
  2020-01-20 14:52     ` Giulio Benetti
@ 2020-02-03 10:24     ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2020-02-03 10:24 UTC (permalink / raw)
  To: buildroot

>>>>> "Giulio" == Giulio Benetti <giulio.benetti@benettiengineering.com> writes:

 > 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 <giulio.benetti@benettiengineering.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2020-02-03 10:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-18 22:20 [Buildroot] [PATCH] package/olsr: needs -fPIC on Microblaze Giulio Benetti
2020-01-20  9:46 ` Evgeniy Didin
2020-01-20 14:50   ` Giulio Benetti
2020-01-20 14:51   ` [Buildroot] [PATCH v2] package/olsr: needs -fPIC to avoid build failure Giulio Benetti
2020-01-20 14:52     ` Giulio Benetti
2020-02-03 10:24     ` Peter Korsgaard

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.