All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/numactl: link with -latomic if needed
@ 2022-11-02 12:35 Fabrice Fontaine
  2022-11-02 20:02 ` Thomas Petazzoni via buildroot
  2022-11-03 21:12 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2022-11-02 12:35 UTC (permalink / raw)
  To: buildroot; +Cc: Pierre-Jean Texier, Fabrice Fontaine

Fix the following build failure raised since bump to version 2.0.16 in
commit e9bc980d93a189a16e7320bd254b906c87ca9f87:

/nvmedata/autobuild/instance-7/output-1/per-package/numactl/host/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: ./.libs/libnuma.a(libnuma.o): in function `numa_police_memory':
libnuma.c:(.text+0xe28): undefined reference to `__atomic_fetch_and_1'

Fixes:
 - http://autobuild.buildroot.org/results/a92c1c60518d3fe08f3f808f9cc812031e85a4e9

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...01-link-with-latomic-if-needed-again.patch | 41 +++++++++++++++++++
 package/numactl/numactl.mk                    |  2 +
 2 files changed, 43 insertions(+)
 create mode 100644 package/numactl/0001-link-with-latomic-if-needed-again.patch

diff --git a/package/numactl/0001-link-with-latomic-if-needed-again.patch b/package/numactl/0001-link-with-latomic-if-needed-again.patch
new file mode 100644
index 0000000000..54d55656ec
--- /dev/null
+++ b/package/numactl/0001-link-with-latomic-if-needed-again.patch
@@ -0,0 +1,41 @@
+From 692abb6d751a41c7f0206771ecd454933750256e Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 2 Nov 2022 13:28:02 +0100
+Subject: [PATCH] link with -latomic if needed (again ...)
+
+numactl unconditionally uses __atomic_fetch_and but some architectures
+(e.g. sparc) needs to link with -latomic to be able to use it. So check
+if -latomic is needed and update numa.pc accordingly.
+
+This linking was made by e0de0d9e981ddb53bdeb4a4b9dc43046c9ff4ff9 but
+wrongly reverted by 10c277c20768be9a563f75265bcd7e73954763ad resulting
+in the following build failure on sparc or microblaze:
+
+/nvmedata/autobuild/instance-7/output-1/per-package/numactl/host/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: ./.libs/libnuma.a(libnuma.o): in function `numa_police_memory':
+libnuma.c:(.text+0xe28): undefined reference to `__atomic_fetch_and_1'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/54b7567d804d9abff56f47cd26bae774c1e38669
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/numactl/numactl/pull/144]
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 8510fc5..ebf9917 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,6 +27,8 @@ AM_CONDITIONAL([RISCV64], [test x"${target_cpu}" = x"riscv64"])
+ 
+ AC_CONFIG_FILES([Makefile])
+ 
++AC_SEARCH_LIBS([__atomic_fetch_and_1], [atomic])
++
+ # GCC tries to be "helpful" and only issue a warning for unrecognized
+ # attributes.  So we compile the test with Werror, so that if the
+ # attribute is not recognized the compilation fails
+-- 
+2.35.1
+
diff --git a/package/numactl/numactl.mk b/package/numactl/numactl.mk
index b2f349255f..157f953c51 100644
--- a/package/numactl/numactl.mk
+++ b/package/numactl/numactl.mk
@@ -10,6 +10,8 @@ NUMACTL_SITE = \
 NUMACTL_LICENSE = LGPL-2.1 (libnuma), GPL-2.0 (programs)
 NUMACTL_LICENSE_FILES = LICENSE.GPL2 LICENSE.LGPL2.1
 NUMACTL_INSTALL_STAGING = YES
+# We're patching configure.ac
+NUMACTL_AUTORECONF = YES
 NUMACTL_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -fPIC"
 
 $(eval $(autotools-package))
-- 
2.35.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 1/1] package/numactl: link with -latomic if needed
  2022-11-02 12:35 [Buildroot] [PATCH 1/1] package/numactl: link with -latomic if needed Fabrice Fontaine
@ 2022-11-02 20:02 ` Thomas Petazzoni via buildroot
  2022-11-02 22:14   ` Fabrice Fontaine
  2022-11-03 21:12 ` Thomas Petazzoni via buildroot
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-02 20:02 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Pierre-Jean Texier, buildroot

On Wed,  2 Nov 2022 13:35:00 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure raised since bump to version 2.0.16 in
> commit e9bc980d93a189a16e7320bd254b906c87ca9f87:
> 
> /nvmedata/autobuild/instance-7/output-1/per-package/numactl/host/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: ./.libs/libnuma.a(libnuma.o): in function `numa_police_memory':
> libnuma.c:(.text+0xe28): undefined reference to `__atomic_fetch_and_1'
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/a92c1c60518d3fe08f3f808f9cc812031e85a4e9
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...01-link-with-latomic-if-needed-again.patch | 41 +++++++++++++++++++
>  package/numactl/numactl.mk                    |  2 +
>  2 files changed, 43 insertions(+)
>  create mode 100644 package/numactl/0001-link-with-latomic-if-needed-again.patch

Also related to numactl and libatomic, we also have this pending patch:
https://patchwork.ozlabs.org/project/buildroot/patch/20221024174911.75444-1-abrodkin@synopsys.com/,
which still seems weird to me.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
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 1/1] package/numactl: link with -latomic if needed
  2022-11-02 20:02 ` Thomas Petazzoni via buildroot
@ 2022-11-02 22:14   ` Fabrice Fontaine
  0 siblings, 0 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2022-11-02 22:14 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Pierre-Jean Texier, buildroot


[-- Attachment #1.1: Type: text/plain, Size: 1716 bytes --]

Le mer. 2 nov. 2022 à 21:02, Thomas Petazzoni <thomas.petazzoni@bootlin.com>
a écrit :

> On Wed,  2 Nov 2022 13:35:00 +0100
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > Fix the following build failure raised since bump to version 2.0.16 in
> > commit e9bc980d93a189a16e7320bd254b906c87ca9f87:
> >
> >
> /nvmedata/autobuild/instance-7/output-1/per-package/numactl/host/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld:
> ./.libs/libnuma.a(libnuma.o): in function `numa_police_memory':
> > libnuma.c:(.text+0xe28): undefined reference to `__atomic_fetch_and_1'
> >
> > Fixes:
> >  -
> http://autobuild.buildroot.org/results/a92c1c60518d3fe08f3f808f9cc812031e85a4e9
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > ---
> >  ...01-link-with-latomic-if-needed-again.patch | 41 +++++++++++++++++++
> >  package/numactl/numactl.mk                    |  2 +
> >  2 files changed, 43 insertions(+)
> >  create mode 100644
> package/numactl/0001-link-with-latomic-if-needed-again.patch
>
> Also related to numactl and libatomic, we also have this pending patch:
>
> https://patchwork.ozlabs.org/project/buildroot/patch/20221024174911.75444-1-abrodkin@synopsys.com/
> ,
> which still seems weird to me.
>

This weird patch tries to handle a very specific case where LD_LIBRARY_PATH
points to a self-build toolchain. I think this is out of scope of buildroot
but I'll let you confirm.
Otherwise, it should be noted that upstream merged my patch.


>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>

Best Regards,

Fabrice

[-- Attachment #1.2: Type: text/html, Size: 2911 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
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 1/1] package/numactl: link with -latomic if needed
  2022-11-02 12:35 [Buildroot] [PATCH 1/1] package/numactl: link with -latomic if needed Fabrice Fontaine
  2022-11-02 20:02 ` Thomas Petazzoni via buildroot
@ 2022-11-03 21:12 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-03 21:12 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Pierre-Jean Texier, buildroot

On Wed,  2 Nov 2022 13:35:00 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure raised since bump to version 2.0.16 in
> commit e9bc980d93a189a16e7320bd254b906c87ca9f87:
> 
> /nvmedata/autobuild/instance-7/output-1/per-package/numactl/host/bin/../lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: ./.libs/libnuma.a(libnuma.o): in function `numa_police_memory':
> libnuma.c:(.text+0xe28): undefined reference to `__atomic_fetch_and_1'
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/a92c1c60518d3fe08f3f808f9cc812031e85a4e9
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...01-link-with-latomic-if-needed-again.patch | 41 +++++++++++++++++++
>  package/numactl/numactl.mk                    |  2 +
>  2 files changed, 43 insertions(+)
>  create mode 100644 package/numactl/0001-link-with-latomic-if-needed-again.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
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-11-03 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 12:35 [Buildroot] [PATCH 1/1] package/numactl: link with -latomic if needed Fabrice Fontaine
2022-11-02 20:02 ` Thomas Petazzoni via buildroot
2022-11-02 22:14   ` Fabrice Fontaine
2022-11-03 21:12 ` Thomas Petazzoni via buildroot

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.