diff --git a/src/libs/Jamfile b/src/libs/Jamfile index 2d9d7bed35..81f8d7df6f 100644 --- a/src/libs/Jamfile +++ b/src/libs/Jamfile @@ -11,6 +11,7 @@ SubInclude HAIKU_TOP src libs gnu ; SubInclude HAIKU_TOP src libs icon ; SubInclude HAIKU_TOP src libs iconv ; SubInclude HAIKU_TOP src libs libtelnet ; +SubInclude HAIKU_TOP src libs libunwind ; SubInclude HAIKU_TOP src libs linprog ; SubInclude HAIKU_TOP src libs mapm ; SubInclude HAIKU_TOP src libs pdflib ; diff --git a/src/libs/libunwind/Jamfile b/src/libs/libunwind/Jamfile new file mode 100644 index 0000000000..401312b0f5 --- /dev/null +++ b/src/libs/libunwind/Jamfile @@ -0,0 +1,8 @@ +SubDir HAIKU_TOP src libs libunwind ; + +SubInclude HAIKU_TOP src libs libunwind $(TARGET_ARCH) ; +SubInclude HAIKU_TOP src libs libunwind mi ; +SubInclude HAIKU_TOP src libs libunwind unwind ; + +UseLibraryHeaders libunwind ; +SubDirCcFlags [ FDefines HAVE_CONFIG_H=1 ] ; diff --git a/src/libs/libunwind/config.h b/src/libs/libunwind/config.h new file mode 100644 index 0000000000..da5df78ec8 --- /dev/null +++ b/src/libs/libunwind/config.h @@ -0,0 +1,232 @@ +/* include/config.h. Generated from config.h.in by configure. */ +/* include/config.h.in. Generated from configure.ac by autoheader. */ + +/* Block signals before mutex operations */ +#define CONFIG_BLOCK_SIGNALS /**/ + +/* Enable Debug Frame */ +/* #undef CONFIG_DEBUG_FRAME */ + +/* Support for Microsoft ABI extensions */ +/* #undef CONFIG_MSABI_SUPPORT */ + +/* Define to 1 if you want every memory access validated */ +#define CONSERVATIVE_CHECKS 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ASM_PTRACE_OFFSETS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ATOMIC_OPS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_BYTESWAP_H */ + +/* Define to 1 if you have the declaration of `PTRACE_CONT', and to 0 if you + don't. */ +#define HAVE_DECL_PTRACE_CONT 0 + +/* Define to 1 if you have the declaration of `PTRACE_POKEDATA', and to 0 if + you don't. */ +#define HAVE_DECL_PTRACE_POKEDATA 0 + +/* Define to 1 if you have the declaration of `PTRACE_POKEUSER', and to 0 if + you don't. */ +#define HAVE_DECL_PTRACE_POKEUSER 0 + +/* Define to 1 if you have the declaration of `PTRACE_SINGLESTEP', and to 0 if + you don't. */ +#define HAVE_DECL_PTRACE_SINGLESTEP 0 + +/* Define to 1 if you have the declaration of `PTRACE_SYSCALL', and to 0 if + you don't. */ +#define HAVE_DECL_PTRACE_SYSCALL 0 + +/* Define to 1 if you have the declaration of `PTRACE_TRACEME', and to 0 if + you don't. */ +#define HAVE_DECL_PTRACE_TRACEME 0 + +/* Define to 1 if you have the declaration of `PT_CONTINUE', and to 0 if you + don't. */ +#define HAVE_DECL_PT_CONTINUE 0 + +/* Define to 1 if you have the declaration of `PT_GETFPREGS', and to 0 if you + don't. */ +#define HAVE_DECL_PT_GETFPREGS 0 + +/* Define to 1 if you have the declaration of `PT_GETREGS', and to 0 if you + don't. */ +#define HAVE_DECL_PT_GETREGS 0 + +/* Define to 1 if you have the declaration of `PT_IO', and to 0 if you don't. + */ +#define HAVE_DECL_PT_IO 0 + +/* Define to 1 if you have the declaration of `PT_STEP', and to 0 if you + don't. */ +#define HAVE_DECL_PT_STEP 0 + +/* Define to 1 if you have the declaration of `PT_SYSCALL', and to 0 if you + don't. */ +#define HAVE_DECL_PT_SYSCALL 0 + +/* Define to 1 if you have the declaration of `PT_TRACE_ME', and to 0 if you + don't. */ +#define HAVE_DECL_PT_TRACE_ME 0 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `dlmodinfo' function. */ +/* #undef HAVE_DLMODINFO */ + +/* Define to 1 if you have the `dl_iterate_phdr' function. */ +/* #undef HAVE_DL_ITERATE_PHDR */ + +/* Define to 1 if you have the `dl_phdr_removals_counter' function. */ +/* #undef HAVE_DL_PHDR_REMOVALS_COUNTER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ELF_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ENDIAN_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_EXECINFO_H */ + +/* Define to 1 if you have the `getunwind' function. */ +/* #undef HAVE_GETUNWIND */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_IA64INTRIN_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `uca' library (-luca). */ +/* #undef HAVE_LIBUCA */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LINK_H */ + +/* Define if you have liblzma */ +/* #undef HAVE_LZMA */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `mincore' function. */ +/* #undef HAVE_MINCORE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if `dlpi_subs' is a member of `struct dl_phdr_info'. */ +/* #undef HAVE_STRUCT_DL_PHDR_INFO_DLPI_SUBS */ + +/* Define to 1 if the system has the type `struct elf_prstatus'. */ +/* #undef HAVE_STRUCT_ELF_PRSTATUS */ + +/* Define to 1 if the system has the type `struct prstatus'. */ +/* #undef HAVE_STRUCT_PRSTATUS */ + +/* Defined if __sync atomics are available */ +/* #undef HAVE_SYNC_ATOMICS */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_ELF_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_ENDIAN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_LINK_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PROCFS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_PTRACE_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_UC_ACCESS_H */ + +/* Define to 1 if you have the `ttrace' function. */ +/* #undef HAVE_TTRACE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Defined if __builtin_unreachable() is available */ +/* #undef HAVE__BUILTIN_UNREACHABLE */ + +/* Defined if __builtin___clear_cache() is available */ +/* #undef HAVE__BUILTIN___CLEAR_CACHE */ + +/* Define to 1 if __thread keyword is supported by the C compiler. */ +/* #undef HAVE___THREAD */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libunwind" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "libunwind-devel@nongnu.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libunwind" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libunwind 1.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libunwind" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.1" + +/* The size of `off_t', as computed by sizeof. */ +#define SIZEOF_OFF_T 8 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.1" + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ diff --git a/src/libs/libunwind/elfxx.h b/src/libs/libunwind/elfxx.h index cef6647b42..1315a812bd 100644 --- a/src/libs/libunwind/elfxx.h +++ b/src/libs/libunwind/elfxx.h @@ -42,6 +42,19 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ # define elf_w(x) _Uelf64_##x #endif +#ifdef __HAIKU__ +# define ELFMAG ELF_MAGIC +#endif +#ifndef SELFMAG +# define SELFMAG 4 +#endif +#ifndef EV_NONE +# define EV_NONE 0 +#endif +#ifndef EV_CURRENT +# define EV_CURRENT 1 +#endif + extern int elf_w (get_proc_name) (unw_addr_space_t as, pid_t pid, unw_word_t ip, char *buf, size_t len, diff --git a/src/libs/libunwind/x86_64/Ginit.c b/src/libs/libunwind/x86_64/Ginit.c index 480d470b2c..375e89f04e 100644 --- a/src/libs/libunwind/x86_64/Ginit.c +++ b/src/libs/libunwind/x86_64/Ginit.c @@ -27,7 +27,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifdef HAVE_CONFIG_H -#include +#include "config.h" #endif #include diff --git a/src/libs/libunwind/x86_64/Jamfile b/src/libs/libunwind/x86_64/Jamfile new file mode 100644 index 0000000000..33bf430cac --- /dev/null +++ b/src/libs/libunwind/x86_64/Jamfile @@ -0,0 +1,38 @@ +SubDir HAIKU_TOP src libs libunwind x86_64 ; + +UseLibraryHeaders libunwind ; +SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ; +SubDirCcFlags [ FDefines HAVE_CONFIG_H=1 ] ; + +MergeObject libunwind_x86_64.o : + Gcreate_addr_space.c + Gget_proc_info.c + Gget_save_loc.c + Gglobal.c + Ginit.c + Ginit_local.c + Ginit_remote.c + Gregs.c + Gresume.c + Gstash_frame.c + Gstep.c + Gtrace.c + Lcreate_addr_space.c + Lget_proc_info.c + Lget_save_loc.c + Lglobal.c + Linit.c + Linit_local.c + Linit_remote.c + Lregs.c + Lresume.c + Lstash_frame.c + Lstep.c + Ltrace.c + getcontext.S + is_fpreg.c + longjmp.S + regname.c + setcontext.S + siglongjmp.S +; diff --git a/src/libs/libunwind/x86_64/unwind_i.h b/src/libs/libunwind/x86_64/unwind_i.h index 4f81566ad0..1d0a4727b6 100644 --- a/src/libs/libunwind/x86_64/unwind_i.h +++ b/src/libs/libunwind/x86_64/unwind_i.h @@ -33,7 +33,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "libunwind_i.h" -#include +#ifndef __HAIKU__ +# include +#endif /* DWARF column numbers for x86_64: */ #define RAX 0