diff options
author | Salvatore Cro <salvatore.cro@st.com> | 2010-09-09 15:45:44 +0200 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2010-09-15 12:31:22 +0200 |
commit | 37eb913ed8c4798b736e678f4dbd9f4a91a68f74 (patch) | |
tree | 63fc2c1dbb887a043a7291c9c6215d2db7b5ba5a /libubacktrace/Makefile.in | |
parent | 7ac7be14eb4c8927fddffbe01fed74c605bf8597 (diff) |
libubacktrace: Provide uClibc with backtrace functions
A new shared object, libubacktrace.so.0 is added to uClibc
to provide backtrace functions to support application self-debugging.
This set of functions requires to dynamically load libgcc_s.so so they
need to call dlopen/dlsym that are provided by libdl. For this reason
they cannot be included into libc.so.0 but are provided by a new library.
User application that wants to use backtrace needs to be compiled with
-fexceptions option and -rdynamic to get full symbols printed and must be
linked against libubacktrace.so
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libubacktrace/Makefile.in')
-rw-r--r-- | libubacktrace/Makefile.in | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/libubacktrace/Makefile.in b/libubacktrace/Makefile.in new file mode 100644 index 000000000..c1dd5d7ab --- /dev/null +++ b/libubacktrace/Makefile.in @@ -0,0 +1,84 @@ +# Makefile for uClibc (libubacktrace) +# +# Copyright (C) 2010 STMicroelectronics Ltd +# Author: Carmelo Amoroso <carmelo.amoroso@st.com> + +# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. +# + +subdirs += libubacktrace + +CFLAGS-libubacktrace := -DNOT_IN_libc -DIS_IN_libubacktrace $(SSP_ALL_CFLAGS) + +LDFLAGS-libubacktrace.so := $(LDFLAGS) $(top_builddir)lib/libdl-$(VERSION).so + +LIBS-libubacktrace.so := $(LIBS) + +libubacktrace_FULL_NAME := libubacktrace-$(VERSION).so + +libubacktrace_DIR := $(top_srcdir)libubacktrace +libubacktrace_OUT := $(top_builddir)libubacktrace +libubacktrace_ARCH_DIR := $(libubacktrace_DIR)/sysdeps/$(TARGET_ARCH) +libubacktrace_ARCH_OUT := $(libubacktrace_OUT)/sysdeps/$(TARGET_ARCH) + +-include $(libubacktrace_ARCH_DIR)/Makefile.arch + +libubacktrace_SRC-y := +libubacktrace_SRC-$(UCLIBC_HAS_BACKTRACE) := backtrace.c backtracesyms.c backtracesymsfd.c + +CFLAGS-libubacktrace/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-libubacktrace) + +# remove generic sources, if arch specific version is present +ifneq ($(strip $(libubacktrace_ARCH_SRC-y)),) +libubacktrace_SRC-y := $(filter-out $(notdir $(libubacktrace_ARCH_SRC-y)),$(libubacktrace_SRC-y)) +libubacktrace_ARCH_SRC := $(addprefix $(libubacktrace_ARCH_DIR)/,$(libubacktrace_ARCH_SRC-y)) +libubacktrace_ARCH_OBJ := $(patsubst $(libubacktrace_ARCH_DIR)/%.c,$(libubacktrace_ARCH_OUT)/%.o,$(libubacktrace_ARCH_SRC)) +endif + + +libubacktrace_SRC := $(addprefix $(libubacktrace_DIR)/,$(libubacktrace_SRC-y)) +libubacktrace_OBJ := $(patsubst $(libubacktrace_DIR)/%.c,$(libubacktrace_OUT)/%.o,$(libubacktrace_SRC)) + +libubacktrace_SRCS := $(libubacktrace_SRC) $(libubacktrace_ARCH_SRC) +libubacktrace_OBJS := $(libubacktrace_OBJ) $(libubacktrace_ARCH_OBJ) + +ifeq ($(DOPIC),y) +libubacktrace-a-y := $(libubacktrace_OBJS:.o=.os) +else +libubacktrace-a-y := $(libubacktrace_OBJS) +endif +libubacktrace-so-y := $(libubacktrace_OBJS:.o=.os) + +lib-a-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.a +lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so + +objclean-y += CLEAN_libubacktrace + +ifeq ($(DOMULTI),n) +ifeq ($(DOPIC),y) +$(top_builddir)lib/libubacktrace.so: $(top_builddir)lib/libubacktrace.a $(libdl.depend) +else +$(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace_so.a $(libdl.depend) +endif + $(call link.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION)) +else +$(top_builddir)lib/libubacktrace.so: $(libubacktrace_OUT)/libubacktrace.oS | $(libdl.depend) + $(call linkm.so,$(libubacktrace_FULL_NAME),$(ABI_VERSION)) +endif + +$(libubacktrace_OUT)/libubacktrace_so.a: $(libubacktrace-so-y) + $(Q)$(RM) $@ + $(do_ar) + +$(libubacktrace_OUT)/libubacktrace.oS: $(libubacktrace_SRCS) + $(Q)$(RM) $@ + $(compile-m) + +$(top_builddir)lib/libubacktrace.a: $(libubacktrace-a-y) + $(Q)$(INSTALL) -d $(dir $@) + $(Q)$(RM) $@ + $(do_ar) + +CLEAN_libubacktrace: + $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a) \ + $(addprefix $(libubacktrace_ARCH_OUT)/*., o os oS a) |