summaryrefslogtreecommitdiffstats
path: root/Rules.mak
diff options
context:
space:
mode:
authorSalvatore Cro <salvatore.cro@st.com>2010-09-09 15:45:44 +0200
committerCarmelo Amoroso <carmelo.amoroso@st.com>2010-09-15 12:31:22 +0200
commit37eb913ed8c4798b736e678f4dbd9f4a91a68f74 (patch)
tree63fc2c1dbb887a043a7291c9c6215d2db7b5ba5a /Rules.mak
parent7ac7be14eb4c8927fddffbe01fed74c605bf8597 (diff)
downloaduClibc-alpine-37eb913ed8c4798b736e678f4dbd9f4a91a68f74.tar.bz2
uClibc-alpine-37eb913ed8c4798b736e678f4dbd9f4a91a68f74.tar.xz
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 'Rules.mak')
-rw-r--r--Rules.mak9
1 files changed, 8 insertions, 1 deletions
diff --git a/Rules.mak b/Rules.mak
index 89127043c..ade86c6ac 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -118,7 +118,7 @@ export MAJOR_VERSION MINOR_VERSION SUBLEVEL VERSION ABI_VERSION LC_ALL
LIBC := libc
SHARED_LIBNAME := $(LIBC).so.$(ABI_VERSION)
-
+UBACKTRACE_DSO := libubacktrace.so.$(MAJOR_VERSION)
ifneq ($(findstring $(TARGET_ARCH) , hppa64 ia64 mips64 powerpc64 s390x sparc64 x86_64 ),)
UCLIBC_LDSO_NAME := ld64-uClibc
ARCH_NATIVE_BIT := 64
@@ -528,6 +528,13 @@ link.asneeded = $(if $(and $(CC_FLAG_ASNEEDED),$(CC_FLAG_NO_ASNEEDED)),$(CC_FLAG
# Check for AS_NEEDED support in linker script (binutils>=2.16.1 has it)
ifndef ASNEEDED
export ASNEEDED:=$(shell $(LD) --help 2>/dev/null | grep -q -- --as-needed && echo "AS_NEEDED ( $(UCLIBC_LDSO) )" || echo "$(UCLIBC_LDSO)")
+ifeq ($(UCLIBC_HAS_BACKTRACE),y)
+# Only used in installed libc.so linker script
+UBACKTRACE_FULL_NAME := $(RUNTIME_PREFIX)lib/$(UBACKTRACE_DSO)
+export UBACKTRACE_ASNEEDED:=$(shell $(LD) --help 2>/dev/null | grep -q -- --as-needed && echo "AS_NEEDED ( $(UBACKTRACE_FULL_NAME) )" || echo "$(UBACKTRACE_FULL_NAME)")
+else
+export UBACKTRACE_ASNEEDED:=""
+endif
endif
# Add a bunch of extra pedantic annoyingly strict checks