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
# 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
-XWARNINGS=$(call qstrip,$(WARNINGS)) -Wstrict-prototypes -fno-strict-aliasing
+XWARNINGS=$(call qstrip,$(WARNINGS))
+XWARNINGS+=$(foreach w,\
+ -Wstrict-prototypes \
+ -fno-strict-aliasing \
+ , $(call check_gcc,$(w),))
ifeq ($(EXTRA_WARNINGS),y)
-XWARNINGS+=-Wnested-externs -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wformat=2
-XWARNINGS+=-Wmissing-prototypes -Wmissing-declarations
-XWARNINGS+=-Wold-style-declaration -Wold-style-definition
-XWARNINGS+=-Wnonnull -Wundef
+XWARNINGS+=$(foreach w,\
+ -Wformat=2 \
+ -Wmissing-noreturn \
+ -Wmissing-format-attribute \
+ -Wmissing-prototypes \
+ -Wmissing-declarations \
+ -Wnested-externs \
+ -Wnonnull \
+ -Wold-style-declaration \
+ -Wold-style-definition \
+ -Wshadow \
+ -Wundef \
+ , $(call check_gcc,$(w),))
# Works only w/ gcc-3.4 and up, can't be checked for gcc-3.x w/ check_gcc()
#XWARNINGS+=-Wdeclaration-after-statement
endif
# Be sure that binutils support it
LDFLAGS_GNUHASH:=$(call check_ld,--hash-style=gnu)
ifeq ($(LDFLAGS_GNUHASH),)
-ifneq ($(filter-out install_headers headers-y,$(MAKECMDGOALS)),)
+ifneq ($(filter-out $(clean_targets) install_headers headers-y,$(MAKECMDGOALS)),)
$(error Your binutils do not support --hash-style option, while you want to use it)
endif
else
-I$(top_srcdir)$(PTDIR)/sysdeps/$(TARGET_ARCH) \
-I$(top_builddir)$(PTDIR)/sysdeps/unix/sysv/linux \
-I$(top_srcdir)$(PTDIR)/sysdeps/unix/sysv/linux \
- -I$(top_srcdir)$(PTDIR)/sysdeps/generic \
-I$(top_srcdir)$(PTDIR)/sysdeps/pthread \
-I$(top_srcdir)$(PTDIR)/sysdeps/pthread/bits \
-I$(top_srcdir)ldso/ldso/$(TARGET_ARCH) \