+2017-09-19 Wilco Dijkstra <wdijkstr@arm.com>
+
+ * csu/Makefile: Add -funwind-tables to libc-start.c.
+ * debug/Makefile: Add -funwind-tables to backtrace.c.
+ * sysdeps/aarch64/Makefile: Remove CFLAGS-backtrace.c.
+ * sysdeps/arm/Makefile: Likewise.
+ * sysdeps/i386/Makefile: Likewise.
+ * sysdeps/m68k/Makefile: Likewise.
+ * sysdeps/mips/Makefile: Likewise.
+ * sysdeps/nios2/Makefile: Likewise.
+ * sysdeps/sh/Makefile: Likewise.
+ * sysdeps/sparc/Makefile: Likewise.
+
2017-09-19 Joseph Myers <joseph@codesourcery.com>
* benchtests/Makefile (bench-math): Add trunc and truncf.
extra-objs += abi-note.o init.o
asm-CPPFLAGS += -I$(objpfx).
+# Enable unwinding so backtrace unwinds to __libc_start_main
+CFLAGS-libc-start.c += -funwind-tables
+
include ../Rules
# Make these in the lib pass so they're available in time to link things with.
CFLAGS-stack_chk_fail.c = $(no-stack-protector)
CFLAGS-stack_chk_fail_local.c = $(no-stack-protector)
-CFLAGS-backtrace.c = -fno-omit-frame-pointer
+CFLAGS-backtrace.c = -fno-omit-frame-pointer -funwind-tables
CFLAGS-sprintf_chk.c = $(libio-mtsafe)
CFLAGS-snprintf_chk.c = $(libio-mtsafe)
CFLAGS-vsprintf_chk.c = $(libio-mtsafe)
long-double-fcts = yes
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),elf)
sysdep-dl-routines += tlsdesc dl-tlsdesc
gen-as-const-headers += dl-link.sym
static-only-routines += $(aeabi_constants) aeabi_read_tp
shared-only-routines += libc-aeabi_read_tp
-# In order for unwinding to fail when it falls out of main, we need a
-# cantunwind marker. There's one in start.S. To make sure we reach it, add
-# unwind tables for __libc_start_main.
-CFLAGS-libc-start.c += -fexceptions
-
sysdep_routines += arm-unwind-resume
shared-only-routines += arm-unwind-resume
endif
sysdep_routines += arm-mcount
endif
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),rt)
librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
CFLAGS-dl-reloc.c += -Wno-unused
endif
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -fexceptions
-endif
-
# Most of the glibc routines don't ever call user defined callbacks
# nor use any FPU or SSE* and as such don't need bigger %esp alignment
# than 4 bytes.
CFLAGS-setjmp.c := -fno-omit-frame-pointer
endif
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),elf)
CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
endif
librt-shared-only-routines += rt-sysdep
endif
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),csu)
CPPFLAGS-crti.S += $(pic-ccflag)
CPPFLAGS-crtn.S += $(pic-ccflag)
ifeq ($(subdir),csu)
gen-as-const-headers += tcb-offsets.sym
endif
-
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
ifeq ($(subdir),gmon)
sysdep_routines += _mcount
endif
-
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
pie-ccflag = -fPIE
-ifeq ($(subdir),debug)
-CFLAGS-backtrace.c += -funwind-tables
-endif
-
ifeq ($(subdir),gmon)
sysdep_routines += sparc-mcount
endif