From a03bd2f1e7ec0de2013a17d4091dd855ac2fd79f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 5 Sep 2014 15:35:41 -0600 Subject: [PATCH] Add libgcc to the set of libraries to link against --- import/Make.defs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/import/Make.defs b/import/Make.defs index efa6820fd..3d12fd368 100644 --- a/import/Make.defs +++ b/import/Make.defs @@ -183,3 +183,12 @@ else endif LDLIBS = -lnuttx + +# Try to get the path to libgcc.a. Of course, this only works for GCC +# toolchains. + +LIBGCC = "${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name 2>/dev/null}" +ifneq ($(LIBGCC),) + LDLIBPATH += -L ${shell dirname $(LIBGCC)} + LDLIBS += -lgcc +endif