All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/libnss: fix build failure on Aarch64 host for powerpc64 target
@ 2022-05-24 22:07 Giulio Benetti
  2022-05-24 23:08 ` James Hilliard
  2022-05-28 20:06 ` Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: Giulio Benetti @ 2022-05-24 22:07 UTC (permalink / raw)
  To: buildroot, James Hilliard; +Cc: Joseph Kogut, Giulio Benetti

When building on Aarch64 host for powerpc64 we get this error:
gcc: error: unrecognized command-line option '-m64'

This happens because we don't have the flexibility to override the LDFLAGS
when linking nsinstall host tool that is built in libnss. Also libnss uses
the same LDFLAGS it uses for target and that is not correct.
So let's add a patch to add NATIVE_LDFLAGS variable to override LFDFLAGS
when building nsinstall utility and set it to HOST_LDFLAGS in libnss.mk

Fixes:
http://autobuild.buildroot.net/results/67500395f19aa698b98404cde8d20463e55504bf/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
Patch is pending upstream:
https://bugzilla.mozilla.org/show_bug.cgi?id=1771036
---
 ...36-Fix-build-failure-on-Aarch64-host.patch | 36 +++++++++++++++++++
 package/libnss/libnss.mk                      |  4 ++-
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch

diff --git a/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch b/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
new file mode 100644
index 0000000000..2ca373cd21
--- /dev/null
+++ b/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
@@ -0,0 +1,36 @@
+From 9d5900c1ee9000906a90923e861b0fd7f1061cde Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Tue, 24 May 2022 23:40:45 +0200
+Subject: [PATCH] Bug 1771036 - Fix build failure on Aarch64 host
+
+If trying to build on Aarch64 host for powerpc64 target we can't override
+the LDFLAGS leading to this build failure:
+gcc: error: unrecognized command-line option '-m64'
+
+So let's add NATIVE_LDFLAGS check and use it to link nsinstall. This way
+any build environment can pass LDFLAGS that fits better for host
+architecture.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ coreconf/nsinstall/Makefile | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/nss/coreconf/nsinstall/Makefile b/nss/coreconf/nsinstall/Makefile
+index 08dfbc2fe..5061789ff 100644
+--- a/nss/coreconf/nsinstall/Makefile
++++ b/nss/coreconf/nsinstall/Makefile
+@@ -34,6 +34,10 @@ ifdef NATIVE_FLAGS
+ OS_CFLAGS=$(NATIVE_FLAGS)
+ endif
+ 
++ifdef NATIVE_LDFLAGS
++LDFLAGS=$(NATIVE_LDFLAGS)
++endif
++
+ include $(DEPTH)/coreconf/rules.mk
+ 
+ # Redefine MAKE_OBJDIR for just this directory
+-- 
+2.34.1
+
diff --git a/package/libnss/libnss.mk b/package/libnss/libnss.mk
index 540092dfcf..0d0f1d84b9 100644
--- a/package/libnss/libnss.mk
+++ b/package/libnss/libnss.mk
@@ -92,7 +92,9 @@ define LIBNSS_BUILD_CMDS
 		SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
 		DIST=$(@D)/$(LIBNSS_DISTDIR) \
 		CHECKLOC= \
-		$(LIBNSS_BUILD_VARS) NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX"
+		$(LIBNSS_BUILD_VARS) \
+		NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX" \
+		NATIVE_LDFLAGS="$(HOST_LDFLAGS)"
 endef
 
 define LIBNSS_INSTALL_STAGING_CMDS
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/libnss: fix build failure on Aarch64 host for powerpc64 target
  2022-05-24 22:07 [Buildroot] [PATCH] package/libnss: fix build failure on Aarch64 host for powerpc64 target Giulio Benetti
@ 2022-05-24 23:08 ` James Hilliard
  2022-05-28 20:06 ` Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: James Hilliard @ 2022-05-24 23:08 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Joseph Kogut, buildroot

On Tue, May 24, 2022 at 4:07 PM Giulio Benetti
<giulio.benetti@benettiengineering.com> wrote:
>
> When building on Aarch64 host for powerpc64 we get this error:
> gcc: error: unrecognized command-line option '-m64'
>
> This happens because we don't have the flexibility to override the LDFLAGS
> when linking nsinstall host tool that is built in libnss. Also libnss uses
> the same LDFLAGS it uses for target and that is not correct.
> So let's add a patch to add NATIVE_LDFLAGS variable to override LFDFLAGS
> when building nsinstall utility and set it to HOST_LDFLAGS in libnss.mk
>
> Fixes:
> http://autobuild.buildroot.net/results/67500395f19aa698b98404cde8d20463e55504bf/
>
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Tested-by: James Hilliard <james.hilliard1@gmail.com>
> ---
> Patch is pending upstream:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1771036
> ---
>  ...36-Fix-build-failure-on-Aarch64-host.patch | 36 +++++++++++++++++++
>  package/libnss/libnss.mk                      |  4 ++-
>  2 files changed, 39 insertions(+), 1 deletion(-)
>  create mode 100644 package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
>
> diff --git a/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch b/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
> new file mode 100644
> index 0000000000..2ca373cd21
> --- /dev/null
> +++ b/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
> @@ -0,0 +1,36 @@
> +From 9d5900c1ee9000906a90923e861b0fd7f1061cde Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Tue, 24 May 2022 23:40:45 +0200
> +Subject: [PATCH] Bug 1771036 - Fix build failure on Aarch64 host
> +
> +If trying to build on Aarch64 host for powerpc64 target we can't override
> +the LDFLAGS leading to this build failure:
> +gcc: error: unrecognized command-line option '-m64'
> +
> +So let's add NATIVE_LDFLAGS check and use it to link nsinstall. This way
> +any build environment can pass LDFLAGS that fits better for host
> +architecture.
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + coreconf/nsinstall/Makefile | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/nss/coreconf/nsinstall/Makefile b/nss/coreconf/nsinstall/Makefile
> +index 08dfbc2fe..5061789ff 100644
> +--- a/nss/coreconf/nsinstall/Makefile
> ++++ b/nss/coreconf/nsinstall/Makefile
> +@@ -34,6 +34,10 @@ ifdef NATIVE_FLAGS
> + OS_CFLAGS=$(NATIVE_FLAGS)
> + endif
> +
> ++ifdef NATIVE_LDFLAGS
> ++LDFLAGS=$(NATIVE_LDFLAGS)
> ++endif
> ++
> + include $(DEPTH)/coreconf/rules.mk
> +
> + # Redefine MAKE_OBJDIR for just this directory
> +--
> +2.34.1
> +
> diff --git a/package/libnss/libnss.mk b/package/libnss/libnss.mk
> index 540092dfcf..0d0f1d84b9 100644
> --- a/package/libnss/libnss.mk
> +++ b/package/libnss/libnss.mk
> @@ -92,7 +92,9 @@ define LIBNSS_BUILD_CMDS
>                 SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
>                 DIST=$(@D)/$(LIBNSS_DISTDIR) \
>                 CHECKLOC= \
> -               $(LIBNSS_BUILD_VARS) NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX"
> +               $(LIBNSS_BUILD_VARS) \
> +               NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX" \
> +               NATIVE_LDFLAGS="$(HOST_LDFLAGS)"
>  endef
>
>  define LIBNSS_INSTALL_STAGING_CMDS
> --
> 2.34.1
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/libnss: fix build failure on Aarch64 host for powerpc64 target
  2022-05-24 22:07 [Buildroot] [PATCH] package/libnss: fix build failure on Aarch64 host for powerpc64 target Giulio Benetti
  2022-05-24 23:08 ` James Hilliard
@ 2022-05-28 20:06 ` Yann E. MORIN
  2022-05-28 20:08   ` Giulio Benetti
  1 sibling, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2022-05-28 20:06 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Joseph Kogut, James Hilliard, buildroot

Giulio, All,

On 2022-05-25 00:07 +0200, Giulio Benetti spake thusly:
> When building on Aarch64 host for powerpc64 we get this error:
> gcc: error: unrecognized command-line option '-m64'
> 
> This happens because we don't have the flexibility to override the LDFLAGS
> when linking nsinstall host tool that is built in libnss. Also libnss uses
> the same LDFLAGS it uses for target and that is not correct.
> So let's add a patch to add NATIVE_LDFLAGS variable to override LFDFLAGS
> when building nsinstall utility and set it to HOST_LDFLAGS in libnss.mk
> 
> Fixes:
> http://autobuild.buildroot.net/results/67500395f19aa698b98404cde8d20463e55504bf/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> Patch is pending upstream:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1771036

We need that information in the patch itself, so that we handily have it
where we need it when we bump the version and can check whether the
patch still makes sense or not.

Applied to master, thanks.

(And upstream seemed to be happy with the patch, even if it has not yet
been applied.)

Regards,
Yann E. MORIN.

> ---
>  ...36-Fix-build-failure-on-Aarch64-host.patch | 36 +++++++++++++++++++
>  package/libnss/libnss.mk                      |  4 ++-
>  2 files changed, 39 insertions(+), 1 deletion(-)
>  create mode 100644 package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
> 
> diff --git a/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch b/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
> new file mode 100644
> index 0000000000..2ca373cd21
> --- /dev/null
> +++ b/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
> @@ -0,0 +1,36 @@
> +From 9d5900c1ee9000906a90923e861b0fd7f1061cde Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Tue, 24 May 2022 23:40:45 +0200
> +Subject: [PATCH] Bug 1771036 - Fix build failure on Aarch64 host
> +
> +If trying to build on Aarch64 host for powerpc64 target we can't override
> +the LDFLAGS leading to this build failure:
> +gcc: error: unrecognized command-line option '-m64'
> +
> +So let's add NATIVE_LDFLAGS check and use it to link nsinstall. This way
> +any build environment can pass LDFLAGS that fits better for host
> +architecture.
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + coreconf/nsinstall/Makefile | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/nss/coreconf/nsinstall/Makefile b/nss/coreconf/nsinstall/Makefile
> +index 08dfbc2fe..5061789ff 100644
> +--- a/nss/coreconf/nsinstall/Makefile
> ++++ b/nss/coreconf/nsinstall/Makefile
> +@@ -34,6 +34,10 @@ ifdef NATIVE_FLAGS
> + OS_CFLAGS=$(NATIVE_FLAGS)
> + endif
> + 
> ++ifdef NATIVE_LDFLAGS
> ++LDFLAGS=$(NATIVE_LDFLAGS)
> ++endif
> ++
> + include $(DEPTH)/coreconf/rules.mk
> + 
> + # Redefine MAKE_OBJDIR for just this directory
> +-- 
> +2.34.1
> +
> diff --git a/package/libnss/libnss.mk b/package/libnss/libnss.mk
> index 540092dfcf..0d0f1d84b9 100644
> --- a/package/libnss/libnss.mk
> +++ b/package/libnss/libnss.mk
> @@ -92,7 +92,9 @@ define LIBNSS_BUILD_CMDS
>  		SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
>  		DIST=$(@D)/$(LIBNSS_DISTDIR) \
>  		CHECKLOC= \
> -		$(LIBNSS_BUILD_VARS) NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX"
> +		$(LIBNSS_BUILD_VARS) \
> +		NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX" \
> +		NATIVE_LDFLAGS="$(HOST_LDFLAGS)"
>  endef
>  
>  define LIBNSS_INSTALL_STAGING_CMDS
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/libnss: fix build failure on Aarch64 host for powerpc64 target
  2022-05-28 20:06 ` Yann E. MORIN
@ 2022-05-28 20:08   ` Giulio Benetti
  0 siblings, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2022-05-28 20:08 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: Joseph Kogut, James Hilliard, buildroot

Hi Yann,

On 28/05/22 22:06, Yann E. MORIN wrote:
> Giulio, All,
> 
> On 2022-05-25 00:07 +0200, Giulio Benetti spake thusly:
>> When building on Aarch64 host for powerpc64 we get this error:
>> gcc: error: unrecognized command-line option '-m64'
>>
>> This happens because we don't have the flexibility to override the LDFLAGS
>> when linking nsinstall host tool that is built in libnss. Also libnss uses
>> the same LDFLAGS it uses for target and that is not correct.
>> So let's add a patch to add NATIVE_LDFLAGS variable to override LFDFLAGS
>> when building nsinstall utility and set it to HOST_LDFLAGS in libnss.mk
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/67500395f19aa698b98404cde8d20463e55504bf/
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> Patch is pending upstream:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=1771036
> 
> We need that information in the patch itself, so that we handily have it
> where we need it when we bump the version and can check whether the
> patch still makes sense or not.

Ok, next time I'll put it in commit log.

Thank you for pointing.

Best regards
-- 
Giulio Benetti
CTO/CEO@Benetti Engineering sas

> 
> Applied to master, thanks.
> 
> (And upstream seemed to be happy with the patch, even if it has not yet
> been applied.)
> 
> Regards,
> Yann E. MORIN.
> 
>> ---
>>   ...36-Fix-build-failure-on-Aarch64-host.patch | 36 +++++++++++++++++++
>>   package/libnss/libnss.mk                      |  4 ++-
>>   2 files changed, 39 insertions(+), 1 deletion(-)
>>   create mode 100644 package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
>>
>> diff --git a/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch b/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
>> new file mode 100644
>> index 0000000000..2ca373cd21
>> --- /dev/null
>> +++ b/package/libnss/0001-Bug-1771036-Fix-build-failure-on-Aarch64-host.patch
>> @@ -0,0 +1,36 @@
>> +From 9d5900c1ee9000906a90923e861b0fd7f1061cde Mon Sep 17 00:00:00 2001
>> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> +Date: Tue, 24 May 2022 23:40:45 +0200
>> +Subject: [PATCH] Bug 1771036 - Fix build failure on Aarch64 host
>> +
>> +If trying to build on Aarch64 host for powerpc64 target we can't override
>> +the LDFLAGS leading to this build failure:
>> +gcc: error: unrecognized command-line option '-m64'
>> +
>> +So let's add NATIVE_LDFLAGS check and use it to link nsinstall. This way
>> +any build environment can pass LDFLAGS that fits better for host
>> +architecture.
>> +
>> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> +---
>> + coreconf/nsinstall/Makefile | 4 ++++
>> + 1 file changed, 4 insertions(+)
>> +
>> +diff --git a/nss/coreconf/nsinstall/Makefile b/nss/coreconf/nsinstall/Makefile
>> +index 08dfbc2fe..5061789ff 100644
>> +--- a/nss/coreconf/nsinstall/Makefile
>> ++++ b/nss/coreconf/nsinstall/Makefile
>> +@@ -34,6 +34,10 @@ ifdef NATIVE_FLAGS
>> + OS_CFLAGS=$(NATIVE_FLAGS)
>> + endif
>> +
>> ++ifdef NATIVE_LDFLAGS
>> ++LDFLAGS=$(NATIVE_LDFLAGS)
>> ++endif
>> ++
>> + include $(DEPTH)/coreconf/rules.mk
>> +
>> + # Redefine MAKE_OBJDIR for just this directory
>> +--
>> +2.34.1
>> +
>> diff --git a/package/libnss/libnss.mk b/package/libnss/libnss.mk
>> index 540092dfcf..0d0f1d84b9 100644
>> --- a/package/libnss/libnss.mk
>> +++ b/package/libnss/libnss.mk
>> @@ -92,7 +92,9 @@ define LIBNSS_BUILD_CMDS
>>   		SOURCE_MD_DIR=$(@D)/$(LIBNSS_DISTDIR) \
>>   		DIST=$(@D)/$(LIBNSS_DISTDIR) \
>>   		CHECKLOC= \
>> -		$(LIBNSS_BUILD_VARS) NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX"
>> +		$(LIBNSS_BUILD_VARS) \
>> +		NATIVE_FLAGS="$(HOST_CFLAGS) -DLINUX" \
>> +		NATIVE_LDFLAGS="$(HOST_LDFLAGS)"
>>   endef
>>   
>>   define LIBNSS_INSTALL_STAGING_CMDS
>> -- 
>> 2.34.1
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot@buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
> 

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-05-28 20:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24 22:07 [Buildroot] [PATCH] package/libnss: fix build failure on Aarch64 host for powerpc64 target Giulio Benetti
2022-05-24 23:08 ` James Hilliard
2022-05-28 20:06 ` Yann E. MORIN
2022-05-28 20:08   ` Giulio Benetti

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.