1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-28 20:21:45 +02:00
Commit graph

10 commits

Author SHA1 Message Date
Konstantin Belousov 2b606faa21 Fix compilation on non-glibc machines.
Commit 297d9cd07d (Fix for failing test-setjmp)
breaks non glibc systems, since __GLIBC_PREREQ is not defined there.
As a consequence, preprocessor aborts with an error.

Trying to hide __GLIBC_PREREQ under #ifdef __GLIBC would require
either code duplication, or moving the longjmp implementation into
the separate file, which is included twice. In fact, I am not sure
in any use of the __GLIBC_PREREQ at the compile time, because the
compiled code can be run on the later version of glibc.

Below is the patch, tested on FreeBSD x86/x86_64 and Scientific Linux 6.1
x86_64. I compile the code always, but keep it in under unused static
symbol. In principle, the code could be optimized out by linker.

[ Minor formatting edits: asharma@fb.com ]
2011-11-30 21:59:09 -08:00
Paul Pluzhnikov 297d9cd07d Fix for failing test-setjmp
On Mon, Nov 14, 2011 at 5:02 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:

> P.S. test-setjmp is failing for me (before or after the patch).
> When I enable assertions (to confirm my new assertions are correct), I see:
>
>  lt-test-setjmp: ../../src/dwarf/Gparser.c:754: apply_reg_state: \
>    Assertion `rs->reg[17].where == DWARF_WHERE_EXPR' failed.
>
> which likely explains that failure.

The problem is actually two-fold:

First, the loops in {sig,}longjmp.c are "do { ... } while (unw_step() >= 0);"

But unw_step() returns 0 on reaching the end of the chain (_start),
and the loop should stop there.

The second problem is that with this commit:
  c67da0b50e
glibc obfuscates value of SP in jmp_buf, so we might as well just give up.

Patch attached.

Thanks,
--
Paul Pluzhnikov
2011-11-19 15:37:35 -08:00
Arun Sharma c4133e879b undef FORTIFY_SOURCE
It's a bit annoying to undefine at configure or compile time.

Signed-off-by: Arun Sharma <asharma@fb.com>
2011-10-15 23:10:00 -07:00
Konstantin Belousov 5715d912f4 Make setjmp/longjmp work at least on FreeBSD/amd64.
FreeBSD-supplied setjmp() saves incremented stack pointer into jmpbuf.

I have no idea whether siglongjmp ever worked on amd64, since
UNW_NUM_EH_REGS == 2 and abort at siglongjmp.c:81 is firing.
2010-04-03 19:02:43 +03:00
Konstantin Belousov 093855f12a Remove unneeded includes of sys/types.h 2010-03-08 00:25:22 +02:00
Konstantin Belousov 3eabce18b1 Include sys/types.h when needed. 2010-03-06 16:43:39 +02:00
Daniel Jacobowitz 3842dac733 Add initial ARM and MIPS support. To support this, also enable the
reading of .debug_frame sections (used in lieu of .eh_frame sections
when they're not available).
2008-02-04 17:16:37 -07:00
David Mosberger-Tang a369768c27 Revert "Initial revision"
This reverts 06d223e924 commit.
2006-07-26 14:47:44 -06:00
mostang.com!davidm 06d223e924 Initial revision 2005-05-03 09:13:17 +00:00
mostang.com!davidm 4f16756123 Include "setjmp_i.h".
Abstract ia64-specific code into bsp_match() routine.
Support any platform with at least 2 EH argument registers.

2004/12/06 01:33:16-08:00 mostang.com!davidm
Rename: src/longjmp.c -> src/setjmp/longjmp.c

(Logical change 1.290)
2005-05-03 09:13:17 +00:00