All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/1] package/numactl: Fix uClibc compile breakage after musl compile fix
@ 2016-02-13 20:02 Bernd Kuhls
  2016-02-14 12:51 ` Thomas Petazzoni
  2016-02-24 10:57 ` Thomas Petazzoni
  0 siblings, 2 replies; 5+ messages in thread
From: Bernd Kuhls @ 2016-02-13 20:02 UTC (permalink / raw)
  To: buildroot

Fixes
http://autobuild.buildroot.net/results/316/3160fb32fbb6990b0bb268524dcea02a1f6880a7/
http://autobuild.buildroot.net/results/961/9616f09e7cbd020134ba72853acaa28a308432a3//
and others

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
v3: use a better fix (Thomas)
v2: updated patch to consider improvements suggested by upstream

 .../0001-use-glibc-prereq-only-on-glibc.patch      | 41 ++++++++++++----------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/package/numactl/0001-use-glibc-prereq-only-on-glibc.patch b/package/numactl/0001-use-glibc-prereq-only-on-glibc.patch
index 0158bd9..04561e9 100644
--- a/package/numactl/0001-use-glibc-prereq-only-on-glibc.patch
+++ b/package/numactl/0001-use-glibc-prereq-only-on-glibc.patch
@@ -1,35 +1,38 @@
-Use __GLIBC_PREREQ only when __GLIBC__ is defined
+From e72abd55ae9a6509372af4e02de707c76d466698 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd.kuhls@t-online.de>
+Date: Fri, 12 Feb 2016 19:25:02 +0100
+Subject: [PATCH 1/1] Fix usage of __GLIBC_PREREQ for non-glibc toolchains
 
 The way __GLIBC_PREREQ() is currently used means that it's evaluated
 even if __GLIBC__ is not defined. But obviously, __GLIBC_PREREQ will
 not exist if __GLIBC__ is not defined, causing build failures on C
 libraries not defining __GLIBC__ such as the musl C library.
 
-Patch originally taken from:
-https://github.com/voidlinux/void-packages/blob/master/srcpkgs/numactl/patches/musl.patch
+Patch sent upstream: https://github.com/numactl/numactl/pull/5
 
 Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+[Bernd: Reworked to fix uClibc]
 [Thomas: improve patch description.]
 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ syscall.c | 4 ++++
+ 1 file changed, 4 insertions(+)
 
---- a/syscall.c.orig	2014-10-20 16:12:53.000000000 +0200
-+++ b/syscall.c	2015-06-22 08:13:22.729034702 +0200
-@@ -115,14 +115,16 @@
+diff --git a/syscall.c b/syscall.c
+index 4589b85..255853d 100644
+--- a/syscall.c
++++ b/syscall.c
+@@ -115,6 +115,10 @@
  
  #endif
  
--#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 11)
-+#if defined(__GLIBC__)
-+# if __GLIBC_PREREQ(2,11)
++#ifndef __GLIBC_PREREQ
++# define __GLIBC_PREREQ(x,y) 0
++#endif
++
+ #if defined(__GLIBC__) && __GLIBC_PREREQ(2, 11)
  
  /* glibc 2.11 seems to have working 6 argument sycall. Use the
-    glibc supplied syscall in this case.
-    The version cut-off is rather arbitary and could be probably
-    earlier. */
- 
--#define syscall6 syscall
-+#  define syscall6 syscall
-+#endif
- #elif defined(__x86_64__)
- /* 6 argument calls on x86-64 are often buggy in both glibc and
-    asm/unistd.h. Add a working version here. */
+-- 
+2.7.0
+
-- 
2.7.0

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

* [Buildroot] [PATCH v3 1/1] package/numactl: Fix uClibc compile breakage after musl compile fix
  2016-02-13 20:02 [Buildroot] [PATCH v3 1/1] package/numactl: Fix uClibc compile breakage after musl compile fix Bernd Kuhls
@ 2016-02-14 12:51 ` Thomas Petazzoni
  2016-02-14 14:11   ` Bernd Kuhls
  2016-02-24 10:57 ` Thomas Petazzoni
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2016-02-14 12:51 UTC (permalink / raw)
  To: buildroot

Dear Bernd Kuhls,

On Sat, 13 Feb 2016 21:02:48 +0100, Bernd Kuhls wrote:

> --#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 11)
> -+#if defined(__GLIBC__)
> -+# if __GLIBC_PREREQ(2,11)
> ++#ifndef __GLIBC_PREREQ
> ++# define __GLIBC_PREREQ(x,y) 0
> ++#endif
> ++
> + #if defined(__GLIBC__) && __GLIBC_PREREQ(2, 11)

I still don't understand why

#if defined(__GLIBC__)
#if __GLIBC_PREREQ(2, 11)
...
#endif
#endif

isn't the proposed solution. It looks so much cleaner and simpler than
defining __GLIBC_PREREQ to 0 when __GLIBC__ is not defined. And it is
actually the most correct solution I believe: only use __GLIBC_PREREQ
when __GLIBC__ is defined.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v3 1/1] package/numactl: Fix uClibc compile breakage after musl compile fix
  2016-02-14 12:51 ` Thomas Petazzoni
@ 2016-02-14 14:11   ` Bernd Kuhls
  2016-02-15 22:30     ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Bernd Kuhls @ 2016-02-14 14:11 UTC (permalink / raw)
  To: buildroot

Am Sun, 14 Feb 2016 13:51:41 +0100 schrieb Thomas Petazzoni:

> I still don't understand why
> 
> #if defined(__GLIBC__)
> #if __GLIBC_PREREQ(2, 11)
> ...
> #endif #endif
> 
> isn't the proposed solution. It looks so much cleaner and simpler than
> defining __GLIBC_PREREQ to 0 when __GLIBC__ is not defined. And it is
> actually the most correct solution I believe: only use __GLIBC_PREREQ
> when __GLIBC__ is defined.

Hi,

the code you mentioned above was the first PR I sent on github[1] and 
received this answer: 
https://github.com/numactl/numactl/pull/4#issuecomment-183441544

"I don't think the patch is correct. If GLIBC_PREREQ fails the #elif 
defined(__x86_64) path still needs to be taken. So you need to combine 
the two #ifs into one line"

And combining the two #ifs into one line breaks compilation on musl so I 
wrote the current patch.

Regards, Bernd

[1] http://patchwork.ozlabs.org/patch/575931/

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

* [Buildroot] [PATCH v3 1/1] package/numactl: Fix uClibc compile breakage after musl compile fix
  2016-02-14 14:11   ` Bernd Kuhls
@ 2016-02-15 22:30     ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-02-15 22:30 UTC (permalink / raw)
  To: buildroot

Bernd,

On Sun, 14 Feb 2016 15:11:50 +0100, Bernd Kuhls wrote:

> the code you mentioned above was the first PR I sent on github[1] and 
> received this answer: 
> https://github.com/numactl/numactl/pull/4#issuecomment-183441544
> 
> "I don't think the patch is correct. If GLIBC_PREREQ fails the #elif 
> defined(__x86_64) path still needs to be taken. So you need to combine 
> the two #ifs into one line"
> 
> And combining the two #ifs into one line breaks compilation on musl so I 
> wrote the current patch.

Can you try the below patch instead?

Index: b/syscall.c
===================================================================
--- a/syscall.c
+++ b/syscall.c
@@ -115,7 +115,13 @@
 
 #endif
 
-#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 11)
+#if defined(__GLIBC__)
+# if __GLIBC_PREREQ(2, 11)
+#  define GLIBC_HAS_WORKING_SYSCALL6
+# endif
+#endif
+
+#if defined(GLIBC_HAS_WORKING_SYSCALL6)
 
 /* glibc 2.11 seems to have working 6 argument sycall. Use the
    glibc supplied syscall in this case.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH v3 1/1] package/numactl: Fix uClibc compile breakage after musl compile fix
  2016-02-13 20:02 [Buildroot] [PATCH v3 1/1] package/numactl: Fix uClibc compile breakage after musl compile fix Bernd Kuhls
  2016-02-14 12:51 ` Thomas Petazzoni
@ 2016-02-24 10:57 ` Thomas Petazzoni
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2016-02-24 10:57 UTC (permalink / raw)
  To: buildroot

Dear Bernd Kuhls,

On Sat, 13 Feb 2016 21:02:48 +0100, Bernd Kuhls wrote:
> Fixes
> http://autobuild.buildroot.net/results/316/3160fb32fbb6990b0bb268524dcea02a1f6880a7/
> http://autobuild.buildroot.net/results/961/9616f09e7cbd020134ba72853acaa28a308432a3//
> and others
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
> v3: use a better fix (Thomas)
> v2: updated patch to consider improvements suggested by upstream

Instead of this patch, I've committed a patch that simply replaces our
private patch with a NUMACTL_PATCH variable that references the two
upstream commits that fix the numactl build issue for both musl and
uclibc.

Thanks a lot for having worked with upstream on this, definitely
appreciated!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-13 20:02 [Buildroot] [PATCH v3 1/1] package/numactl: Fix uClibc compile breakage after musl compile fix Bernd Kuhls
2016-02-14 12:51 ` Thomas Petazzoni
2016-02-14 14:11   ` Bernd Kuhls
2016-02-15 22:30     ` Thomas Petazzoni
2016-02-24 10:57 ` Thomas Petazzoni

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.