Hi Andrew, all,
On Thu, 2016-07-28 at 15:40 -0700, Vineet Gupta wrote:
> On 07/28/2016 03:04 PM, Bernhard Reutner-Fischer wrote:
> >
> > >
> > > Indeed your 2/2 seems to be the most "past-proof" code change. So I
> > > >
> > > > would think it
> > > > is indeed better and is something I should have done in the first
> > > > place.
> > > >
> > > > @Alexey, @Vlad what say you ?
> > uClibc traditionally supports the current stable release of binutils, which would make it patch #1 I think.
> >
>
> But 2/2 works for both and makes actual binutils version moot. FWIW, ARC tools
> don't as of last release didn't use the upstream/stable binutils, but we are
> pretty close to that now though.
Personally I'd prefer to not add more conditional defines in uClibc but
make it a little-bit simpler.
I.e. either Vlad's patch or #1 from this series IMHO looks better.
It's been quite some time since we updated our tools with PCL support
and I'm not really sure if there's anybody interested in using ages old
tools with today's uClibc. We don't test such combinations and there could
be issues already in such combos.
BTW I noticed that Vlad's patch removes/reverts that thing as well:
http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/ldso/ldso/arc/dl-sy…
c5187
While Andrew just replaces ".&" construction with "@pcl".
I'm wondering which is the correct approach here?
-Alexey
This short series introduces fixes of 2 observed isues (#1 & #2) in clone()
syscall in ARC port and one enhancement (#3).
It all started from failing tst-clone1 in uClibc testsuite and during
its debugging we observed another quite subtle issue which was then not only
solved but better (which means shorter and simpler) implementation was made.
Alexey Brodkin (3):
arc: clone: Recover PID correctly
arc: clone: Fix CLONE_THREAD detection
arc: clone: Simplify CLONE_THREAD detection
libc/sysdeps/linux/arc/clone.S | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
--
2.7.4
There are two copies of jmpbuf-unwind.h in the tree,
the NPTL one isn't really used. No regressions found
by embedded-test run.
Signed-off-by: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
---
libc/sysdeps/linux/alpha/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/arc/jmpbuf-unwind.h | 6 ----
libc/sysdeps/linux/arm/jmpbuf-unwind.h | 7 +----
libc/sysdeps/linux/avr32/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/bfin/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/c6x/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/cris/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/hppa/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/ia64/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/m68k/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/metag/bits/setjmp.h | 10 -------
libc/sysdeps/linux/metag/jmpbuf-offsets.h | 7 +++++
libc/sysdeps/linux/metag/jmpbuf-unwind.h | 8 ++++--
libc/sysdeps/linux/microblaze/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/mips/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/nios2/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/powerpc/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/sh/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/sparc/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/x86_64/jmpbuf-unwind.h | 1 +
libc/sysdeps/linux/xtensa/jmpbuf-unwind.h | 1 +
libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h | 32 ---------------------
libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h | 32 ---------------------
libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h | 35 -----------------------
libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h | 26 -----------------
libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h | 27 -----------------
libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h | 32 ---------------------
32 files changed, 29 insertions(+), 344 deletions(-)
create mode 100644 libc/sysdeps/linux/metag/jmpbuf-offsets.h
delete mode 100644 libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h
delete mode 100644 libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h
diff --git a/libc/sysdeps/linux/alpha/jmpbuf-unwind.h b/libc/sysdeps/linux/alpha/jmpbuf-unwind.h
index 80fe8b3..b14837e 100644
--- a/libc/sysdeps/linux/alpha/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/alpha/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/arc/jmpbuf-unwind.h b/libc/sysdeps/linux/arc/jmpbuf-unwind.h
index 8c41816..d16506a 100644
--- a/libc/sysdeps/linux/arc/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/arc/jmpbuf-unwind.h
@@ -16,12 +16,6 @@
#include <stdint.h>
#include <unwind.h>
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
-
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
_JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
diff --git a/libc/sysdeps/linux/arm/jmpbuf-unwind.h b/libc/sysdeps/linux/arm/jmpbuf-unwind.h
index d7b49e2..44f9a1b 100644
--- a/libc/sysdeps/linux/arm/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/arm/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
@@ -15,12 +16,6 @@
#include <stdint.h>
#include <unwind.h>
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
-
#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
_JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
diff --git a/libc/sysdeps/linux/avr32/jmpbuf-unwind.h b/libc/sysdeps/linux/avr32/jmpbuf-unwind.h
index 5caa2ee..f19f491 100644
--- a/libc/sysdeps/linux/avr32/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/avr32/jmpbuf-unwind.h
@@ -5,6 +5,7 @@
* Public License. See the file "COPYING.LIB" in the main directory of this
* archive for more details.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/bfin/jmpbuf-unwind.h b/libc/sysdeps/linux/bfin/jmpbuf-unwind.h
index bb7a374..26b56db 100644
--- a/libc/sysdeps/linux/bfin/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/bfin/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/c6x/jmpbuf-unwind.h b/libc/sysdeps/linux/c6x/jmpbuf-unwind.h
index ad2ab59..58eb18a 100644
--- a/libc/sysdeps/linux/c6x/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/c6x/jmpbuf-unwind.h
@@ -17,6 +17,7 @@
* along with this program; see the file COPYING.LIB. If not, see
* <http://www.gnu.org/licenses/>.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/cris/jmpbuf-unwind.h b/libc/sysdeps/linux/cris/jmpbuf-unwind.h
index 8b75dce..b5950ad 100644
--- a/libc/sysdeps/linux/cris/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/cris/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/hppa/jmpbuf-unwind.h b/libc/sysdeps/linux/hppa/jmpbuf-unwind.h
index 0590754..efed134 100644
--- a/libc/sysdeps/linux/hppa/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/hppa/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/ia64/jmpbuf-unwind.h b/libc/sysdeps/linux/ia64/jmpbuf-unwind.h
index 91e2df8..4eb0eea 100644
--- a/libc/sysdeps/linux/ia64/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/ia64/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame containing a local
diff --git a/libc/sysdeps/linux/m68k/jmpbuf-unwind.h b/libc/sysdeps/linux/m68k/jmpbuf-unwind.h
index d87ace3..c5a8886 100644
--- a/libc/sysdeps/linux/m68k/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/m68k/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/metag/bits/setjmp.h b/libc/sysdeps/linux/metag/bits/setjmp.h
index 8ad4b12..d80a355 100644
--- a/libc/sysdeps/linux/metag/bits/setjmp.h
+++ b/libc/sysdeps/linux/metag/bits/setjmp.h
@@ -28,17 +28,7 @@
*/
#define _JBLEN 24
-#if defined (__USE_MISC) || defined (_ASM)
-#define JB_SP 0
-#endif
-#ifndef _ASM
typedef int __jmp_buf[_JBLEN] __attribute__((aligned (8)));
-#endif
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) > (void *) (jmpbuf)[JB_SP])
#endif /* bits/setjmp.h */
diff --git a/libc/sysdeps/linux/metag/jmpbuf-offsets.h b/libc/sysdeps/linux/metag/jmpbuf-offsets.h
new file mode 100644
index 0000000..e4faf42
--- /dev/null
+++ b/libc/sysdeps/linux/metag/jmpbuf-offsets.h
@@ -0,0 +1,7 @@
+/*
+ * Copyright (C) 2013, Imagination Technologies Ltd.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#define JB_SP 0
diff --git a/libc/sysdeps/linux/metag/jmpbuf-unwind.h b/libc/sysdeps/linux/metag/jmpbuf-unwind.h
index 175cd7a..bf79141 100644
--- a/libc/sysdeps/linux/metag/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/metag/jmpbuf-unwind.h
@@ -1,14 +1,16 @@
/*
+ * Copyright (C) 2013, Imagination Technologies Ltd.
+ *
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <setjmp.h>
+#include <jmpbuf-offsets.h>
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) > (void *) demangle (jmpbuf[JB_SP]))
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) > (void *) jmpbuf[JB_SP])
#ifdef __UCLIBC_HAS_THREADS_NATIVE__
#include <stdint.h>
diff --git a/libc/sysdeps/linux/microblaze/jmpbuf-unwind.h b/libc/sysdeps/linux/microblaze/jmpbuf-unwind.h
index a24cd12..2c1c079 100644
--- a/libc/sysdeps/linux/microblaze/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/microblaze/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/mips/jmpbuf-unwind.h b/libc/sysdeps/linux/mips/jmpbuf-unwind.h
index 2c0df95..3242eae 100644
--- a/libc/sysdeps/linux/mips/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/mips/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/nios2/jmpbuf-unwind.h b/libc/sysdeps/linux/nios2/jmpbuf-unwind.h
index 64cd55f..c22ab24 100644
--- a/libc/sysdeps/linux/nios2/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/nios2/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/powerpc/jmpbuf-unwind.h b/libc/sysdeps/linux/powerpc/jmpbuf-unwind.h
index 54322b8..d650b32 100644
--- a/libc/sysdeps/linux/powerpc/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/powerpc/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/sh/jmpbuf-unwind.h b/libc/sysdeps/linux/sh/jmpbuf-unwind.h
index 8875cc1..34977df 100644
--- a/libc/sysdeps/linux/sh/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/sh/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
/* Test if longjmp to JMPBUF would unwind the frame
diff --git a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
index 90efb77..31449d8 100644
--- a/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/sparc/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/x86_64/jmpbuf-unwind.h b/libc/sysdeps/linux/x86_64/jmpbuf-unwind.h
index 1525872..b3f39b5 100644
--- a/libc/sysdeps/linux/x86_64/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/x86_64/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libc/sysdeps/linux/xtensa/jmpbuf-unwind.h b/libc/sysdeps/linux/xtensa/jmpbuf-unwind.h
index 4516d93..13161e9 100644
--- a/libc/sysdeps/linux/xtensa/jmpbuf-unwind.h
+++ b/libc/sysdeps/linux/xtensa/jmpbuf-unwind.h
@@ -3,6 +3,7 @@
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
+
#include <setjmp.h>
#include <jmpbuf-offsets.h>
diff --git a/libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d..0000000
--- a/libpthread/nptl/sysdeps/alpha/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h
deleted file mode 100644
index 11a043b..0000000
--- a/libpthread/nptl/sysdeps/arc/jmpbuf-unwind.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[__JMP_BUF_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h
deleted file mode 100644
index 11a043b..0000000
--- a/libpthread/nptl/sysdeps/arm/jmpbuf-unwind.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[__JMP_BUF_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d..0000000
--- a/libpthread/nptl/sysdeps/i386/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h
deleted file mode 100644
index b3da6bd..0000000
--- a/libpthread/nptl/sysdeps/metag/jmpbuf-unwind.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; see the file COPYING.LIB. If
- not, see <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) > (void *) demangle (jmpbuf[JB_SP]))
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) > (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
-
-#define __libc_unwind_longjmp(buf, val) __libc_longjmp (buf, val)
diff --git a/libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h
deleted file mode 100644
index 9739efd..0000000
--- a/libpthread/nptl/sysdeps/mips/jmpbuf-unwind.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (C) 2003, 2005 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[0].__sp - (_adj))
diff --git a/libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h
deleted file mode 100644
index 4a88b04..0000000
--- a/libpthread/nptl/sysdeps/powerpc/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_GPR1] - (_adj))
diff --git a/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h
deleted file mode 100644
index 2f7f852..0000000
--- a/libpthread/nptl/sysdeps/sh/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(jmpbuf, address, adj) \
- ((uintptr_t) (address) - (adj) < (uintptr_t) (jmpbuf)[0].__regs[7] - (adj))
diff --git a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
deleted file mode 100644
index 2f64e7d..0000000
--- a/libpthread/nptl/sysdeps/sparc/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h
deleted file mode 100644
index 304bf85..0000000
--- a/libpthread/nptl/sysdeps/x86_64/jmpbuf-unwind.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub(a)redhat.com>, 2003.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_RSP] - (_adj))
diff --git a/libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h b/libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h
deleted file mode 100644
index bda498b..0000000
--- a/libpthread/nptl/sysdeps/xtensa/jmpbuf-unwind.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Copyright (C) 2005,2006 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-#include <setjmp.h>
-#include <stdint.h>
-#include <unwind.h>
-
-/* Test if longjmp to JMPBUF would unwind the frame
- containing a local variable at ADDRESS. */
-#undef _JMPBUF_UNWINDS
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
- ((void *) (address) < (void *) demangle (jmpbuf[JB_SP]))
-
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
- _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
-
-#define _JMPBUF_UNWINDS_ADJ(_jmpbuf, _address, _adj) \
- ((uintptr_t) (_address) - (_adj) < (uintptr_t) (_jmpbuf)[JB_SP] - (_adj))
--
1.7.10.4
Hi Maintainers,
How would you like to handle global reorganization patches touching
arch specific parts. Do you would like to be in Cc?
How long should I wait for a comment or veto?
I sent out two patches recently, one today only to the mailinglist.
Thanks for your opinion.
best regards
Waldemar
This is a slightly odd series of 2 patches. The two patches are
actually alternative solutions to the same problem. I'm keen to see
one of these merged, but I don't know which method would be preferred.
This commit aims to address an issue that was introduced / mentioned
in commit 20554a78a9bba278c6b9cbbb4cfc5bde3772c56d (ARC:
Conditionalise certain relocations as provided by TLS tools only).
The problem is that not all historic versions of binutils have
supported the @pcl relocation type. This problem is compounded by the
fact that the arithmetic construct that was previously used to
synthesise an @pcl like behaviour, does not work on recent versions of
binutils.
In the commit 20554a78a code was added that selects between the new
style @pcl relocations, and the old style arithmetic construct,
however, this selection is done based on whether the uClibc user has
configured with native threads or not.
Of course, a uClibc user could choose to use a modern version of
binutils AND configure without native thread support, in which case
uClibc will not compile.
I have two proposed solutions. In patch 1/2 I simply drop support for
the older versions of binutils in favour of the new @pcl relocation
type. This feels the cleanest solution, but I don't know how strongly
the uClibc(-ng) community feels about maintaining compatibility for
older versions of the tools.
Given that I anticipated push back against the first patch I took a
look at how I might maintain compatibility. It turns out to be pretty
easy, and that is patch 2/2. In this patch I drew inspiration from
similar examples in the Rules.mak file to check if the toolchain
supports @pcl relocations or not. With this done we have a new define
based on the specific toolchain feature being supported or not, which
can then be used to conditionalise the code.
Would you consider merging one of these patches?
Thanks,
Andrew
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via ff58e44fc38474b1898c59caf9a5e75d0d8c6c57 (commit)
from 084e597e9f8e630e9b3fc7044d544699ad5d2886 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ff58e44fc38474b1898c59caf9a5e75d0d8c6c57
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sun Jul 17 02:23:24 2016 +0200
mips: add regdef.h glibc compatibility header
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/mips/Makefile.arch | 3 +--
{libpthread/nptl/sysdeps => libc/sysdeps/linux}/mips/regdef.h | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
copy {libpthread/nptl/sysdeps => libc/sysdeps/linux}/mips/regdef.h (86%)
diff --git a/libc/sysdeps/linux/mips/Makefile.arch b/libc/sysdeps/linux/mips/Makefile.arch
index 2c2e66f..844bc2b 100644
--- a/libc/sysdeps/linux/mips/Makefile.arch
+++ b/libc/sysdeps/linux/mips/Makefile.arch
@@ -20,5 +20,4 @@ SSRC-$(UCLIBC_HAS_CONTEXT_FUNCS) += makecontext.S setcontext.S getcontext.S \
ASFLAGS-syscall_error.S += -D_LIBC_REENTRANT
-ARCH_HEADERS := sgidefs.h
-# regdef.h
+ARCH_HEADERS := sgidefs.h regdef.h
diff --git a/libpthread/nptl/sysdeps/mips/regdef.h b/libc/sysdeps/linux/mips/regdef.h
similarity index 86%
copy from libpthread/nptl/sysdeps/mips/regdef.h
copy to libc/sysdeps/linux/mips/regdef.h
index e4ebd9a..64cffbf 100644
--- a/libpthread/nptl/sysdeps/mips/regdef.h
+++ b/libc/sysdeps/linux/mips/regdef.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ralf Baechle <ralf(a)gnu.org>.
@@ -13,7 +13,7 @@
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
+ License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
#ifndef _REGDEF_H
hooks/post-receive
--
uClibc-ng - small C library for embedded systems