From 7e02935a27864598fda0cef7f968cd7fe6b4457e Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Thu, 17 Dec 2015 12:37:01 +1100 Subject: [PATCH] Deal with ld's overly eager discarding of globals. --- app/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Makefile b/app/Makefile index 62819e9d..83cb23cc 100644 --- a/app/Makefile +++ b/app/Makefile @@ -86,8 +86,10 @@ COMPONENTS_eagle.app.v6 = \ crypto/libcrypto.a \ dhtlib/libdhtlib.a \ tsl2561/tsl2561lib.a \ - modules/libmodules.a + modules/libmodules.a \ +# Special consideration for modules to support NODEMCU_MODULE handling +MODULES_LIB = $(filter %modules.a, $(DEP_LIBS_eagle.app.v6)) LINKFLAGS_eagle.app.v6 = \ -Wl,--gc-sections \ @@ -98,6 +100,9 @@ LINKFLAGS_eagle.app.v6 = \ -Wl,--no-check-sections \ -Wl,--wrap=_xtos_set_exception_handler \ -Wl,-static \ + -Wl,--whole-archive \ + $(MODULES_LIB) \ + -Wl,--no-whole-archive \ -Wl,--start-group \ -lc \ -lgcc \