From 87304f88121a46baae516ba4674fad03c545ce2c Mon Sep 17 00:00:00 2001 From: Phyo Kyaw Date: Fri, 10 Aug 2018 15:16:14 +0100 Subject: [PATCH] Updated to include user defined static lib files in the Linker object files path. ### Description This is to fix linker not finding symbols declared in object files inside static library files. For this case throwing:- > rm-none-eabi-g++: error: unrecognized command line option '--wrap=main'; did you mean '--warn-main'? For this case to include libmbed.a which contains mbed_alloc_wrappers.o: U __real__calloc_r U __real__free_r U __real__malloc_r U __real__memalign_r U __real__realloc_r 00000000 T __wrap__calloc_r 00000000 T __wrap__free_r 00000000 T __wrap__malloc_r 00000000 T __wrap__memalign_r 00000000 T __wrap__realloc_r 00000000 T free_wrapper 00000000 T malloc_wrapper 00000000 T mbed_stats_heap_get U memset This patch also changed the library order to system and then user. -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -lmbed Resolves: #7155 ### Pull request type [ x ] Fix [ ] Refactor [ ] Target update [ ] Feature [ ] Breaking change --- tools/export/e2studio/.cproject.tmpl | 7 +++++-- tools/export/gnuarmeclipse/.cproject.tmpl | 7 +++++-- tools/export/gnuarmeclipse/__init__.py | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/export/e2studio/.cproject.tmpl b/tools/export/e2studio/.cproject.tmpl index d8732301d35..57c7a9972a8 100644 --- a/tools/export/e2studio/.cproject.tmpl +++ b/tools/export/e2studio/.cproject.tmpl @@ -326,10 +326,10 @@ {% endfor %} @@ -337,6 +337,9 @@ {% for path in opts['ld']['object_files'] %} {% endfor %} + {% for path in opts['ld']['user_library_files'] %} + + {% endfor %} {% if opts['ld']['gcsections'] %} @@ -337,6 +337,9 @@ {% for path in opts['ld']['object_files'] %} {% endfor %} + {% for path in opts['ld']['user_library_files'] %} + + {% endfor %} {% if opts['ld']['gcsections'] %}