From: Maciej W. Rozycki Date: Tue, 29 Sep 2020 00:20:01 +0000 (+0100) Subject: RISC-V/libgcc: Use `-fasynchronous-unwind-tables' for LIB2_DIVMOD_FUNCS X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=090d3f5ab390e74caa1f93b7d9f5074c62ba9d07;p=gcc.git RISC-V/libgcc: Use `-fasynchronous-unwind-tables' for LIB2_DIVMOD_FUNCS Use `-fasynchronous-unwind-tables' rather than `-fexceptions -fnon-call-exceptions' in LIB2_DIVMOD_FUNCS compilation flags so as to provide unwind tables for the affected functions while not pulling the unwinder proper, which is not required here. Beyond saving program space it fixes a RISC-V glibc build error due to unsatisfied `malloc' and `free' references from the unwinder causing link errors with `ld.so' where libgcc has been built at -O0. libgcc/ * config/riscv/t-elf (LIB2_DIVMOD_EXCEPTION_FLAGS): New variable. --- diff --git a/libgcc/config/riscv/t-elf b/libgcc/config/riscv/t-elf index dbc8f85dfc5..415e1fffbe7 100644 --- a/libgcc/config/riscv/t-elf +++ b/libgcc/config/riscv/t-elf @@ -4,3 +4,5 @@ LIB2ADD += $(srcdir)/config/riscv/save-restore.S \ $(srcdir)/config/riscv/div.S \ $(srcdir)/config/riscv/atomic.c \ +# Avoid the full unwinder being pulled along with the division libcalls. +LIB2_DIVMOD_EXCEPTION_FLAGS := -fasynchronous-unwind-tables