Skip to content

Commit

Permalink
gcc: xtensa: fix for libgcc unwinding on windowed elf targets
Browse files Browse the repository at this point in the history
This fixes build for elf target with windowed xtensa core that currently
breaks with the following error message:

  unwind-dw2-fde-dip.c:36:40: fatal error: elf.h: No such file or directory

Signed-off-by: Max Filippov <[email protected]>
  • Loading branch information
jcmvbkbc committed Oct 17, 2016
1 parent b2c0b8f commit a194053
Showing 1 changed file with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
From d2468b58ff3106a04f1888991e410bde1b659f25 Mon Sep 17 00:00:00 2001
From: Max Filippov <[email protected]>
Date: Mon, 17 Oct 2016 13:38:36 -0700
Subject: [PATCH] xtensa: don't use unwind-dw2-fde-dip with elf targets

Define LIB2ADDEH_XTENSA_UNWIND_DW2_FDE to unwind-dw2-fde.c in
xtensa/t-elf and to unwind-dw2-fde-dip.c in xtensa/t-linux and use
LIB2ADDEH_XTENSA_UNWIND_DW2_FDE in LIB2ADDEH definition.

2016-10-17 Max Filippov <[email protected]>
libgcc/
* config/xtensa/t-elf (LIB2ADDEH_XTENSA_UNWIND_DW2_FDE): New
definition.
* config/xtensa/t-linux (LIB2ADDEH_XTENSA_UNWIND_DW2_FDE): New
definition.
* config/xtensa/t-windowed (LIB2ADDEH): Use
LIB2ADDEH_XTENSA_UNWIND_DW2_FDE defined by either xtensa/t-elf
or xtensa/t-linux.

Signed-off-by: Max Filippov <[email protected]>
---
libgcc/config/xtensa/t-elf | 2 ++
libgcc/config/xtensa/t-linux | 2 ++
libgcc/config/xtensa/t-windowed | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libgcc/config/xtensa/t-elf b/libgcc/config/xtensa/t-elf
index 59d5121..967cf9b 100644
--- a/libgcc/config/xtensa/t-elf
+++ b/libgcc/config/xtensa/t-elf
@@ -3,3 +3,5 @@ CRTSTUFF_T_CFLAGS += -mlongcalls
CRTSTUFF_T_CFLAGS_S += -mlongcalls

HOST_LIBGCC2_CFLAGS += -mlongcalls
+
+LIB2ADDEH_XTENSA_UNWIND_DW2_FDE = $(srcdir)/unwind-dw2-fde.c
diff --git a/libgcc/config/xtensa/t-linux b/libgcc/config/xtensa/t-linux
index 6f4ae89..412ecca 100644
--- a/libgcc/config/xtensa/t-linux
+++ b/libgcc/config/xtensa/t-linux
@@ -1 +1,3 @@
SHLIB_MAPFILES += $(srcdir)/config/xtensa/libgcc-glibc.ver
+
+LIB2ADDEH_XTENSA_UNWIND_DW2_FDE = $(srcdir)/unwind-dw2-fde-dip.c
diff --git a/libgcc/config/xtensa/t-windowed b/libgcc/config/xtensa/t-windowed
index a99156c..f140136 100644
--- a/libgcc/config/xtensa/t-windowed
+++ b/libgcc/config/xtensa/t-windowed
@@ -1,2 +1,2 @@
LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \
- $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+ $(LIB2ADDEH_XTENSA_UNWIND_DW2_FDE) $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
--
2.1.4

0 comments on commit a194053

Please sign in to comment.