From f6639c18330bc849d5183c5ee6a19ff0799d3791 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 26 Jul 2015 12:59:18 +0300 Subject: [PATCH] Add libunwind. --- .gitmodules | 3 +++ software/libunwind/Makefile | 30 ++++++++++++++++++++++++++++ software/libunwind/__cxxabi_config.h | 0 software/libunwind/strings.h | 2 ++ software/unwinder | 1 + 5 files changed, 36 insertions(+) create mode 100644 software/libunwind/Makefile create mode 100644 software/libunwind/__cxxabi_config.h create mode 100644 software/libunwind/strings.h create mode 160000 software/unwinder diff --git a/.gitmodules b/.gitmodules index 50d3533a..38ff0db8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "extcores/litepcie_phy_wrappers"] path = extcores/litepcie_phy_wrappers url = https://github.com/enjoy-digital/litepcie_phy_wrappers +[submodule "software/unwinder"] + path = software/unwinder + url = https://github.com/whitequark/libunwind diff --git a/software/libunwind/Makefile b/software/libunwind/Makefile new file mode 100644 index 00000000..f250db79 --- /dev/null +++ b/software/libunwind/Makefile @@ -0,0 +1,30 @@ +MSCDIR=../.. +include $(MSCDIR)/software/common.mak + +COMMONFLAGS+=-integrated-as \ + -I. -I$(MSCDIR)/software/include/dyld/ -I$(MSCDIR)/software/unwinder/include/ \ + -D__ELF__ -D__linux__ + +OBJECTS=UnwindRegistersSave.o UnwindRegistersRestore.o UnwindLevel1.o libunwind.o + +all: libunwind.a + +# pull in dependency info for *existing* .o files +-include $(OBJECTS:.o=.d) + +libunwind.a: $(OBJECTS) + $(AR) crs libunwind.a $(OBJECTS) + +%.o: $(MSCDIR)/software/unwinder/src/%.cpp + $(compilexx-dep) + +%.o: $(MSCDIR)/software/unwinder/src/%.c + $(compile-dep) + +%.o: $(MSCDIR)/software/unwinder/src/%.S + $(assemble) + +.PHONY: clean + +clean: + $(RM) $(OBJECTS) $(OBJECTS:.o=.ts) $(OBJECTS:.o=.d) libuwind.a .*~ *~ diff --git a/software/libunwind/__cxxabi_config.h b/software/libunwind/__cxxabi_config.h new file mode 100644 index 00000000..e69de29b diff --git a/software/libunwind/strings.h b/software/libunwind/strings.h new file mode 100644 index 00000000..18f596f6 --- /dev/null +++ b/software/libunwind/strings.h @@ -0,0 +1,2 @@ +// This is some obsolete BSD crap that libunwind pulls in +// that's so old and useless it's not worth putting into libbase. diff --git a/software/unwinder b/software/unwinder new file mode 160000 index 00000000..7ce966d5 --- /dev/null +++ b/software/unwinder @@ -0,0 +1 @@ +Subproject commit 7ce966d59aa6c5a8b962dca43a34279b69bec597 -- 2.30.2