File tree Expand file tree Collapse file tree 9 files changed +113
-1
lines changed
COMPONENT_ESPRESSIF_ESP8266
TARGET_STM/COMPONENT_EMW3080B Expand file tree Collapse file tree 9 files changed +113
-1
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,15 @@ target_include_directories(mbed-wifi
12
12
.
13
13
./ESP8266
14
14
)
15
+
16
+ # Link override object file coming from static library anyway
17
+ #
18
+ # NOTE: This linker option is to pretend undefined symbol and won't cause
19
+ # undefined symbol error even though the override object file actually
20
+ # doesn't provide such symbol definition.
21
+ if (${MBED_TOOLCHAIN} STREQUAL "GCC_ARM" )
22
+ target_link_options (mbed-wifi
23
+ INTERFACE
24
+ LINKER:--undefined=LINK_ESP8266INTERFACE_CPP
25
+ )
26
+ endif ()
Original file line number Diff line number Diff line change @@ -1149,6 +1149,20 @@ WiFiInterface *WiFiInterface::get_default_instance()
1149
1149
return &esp;
1150
1150
}
1151
1151
1152
+ /*
1153
+ * With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
1154
+ * object file anyway for being able to override weak symbol successfully
1155
+ * even though from static library. See:
1156
+ * https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
1157
+ *
1158
+ * NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
1159
+ * <LINK_FOO> symbol correctly.
1160
+ */
1161
+ extern " C"
1162
+ void LINK_ESP8266INTERFACE_CPP (void )
1163
+ {
1164
+ }
1165
+
1152
1166
#endif
1153
1167
1154
1168
void ESP8266Interface::refresh_conn_state_cb ()
Original file line number Diff line number Diff line change @@ -21,3 +21,15 @@ target_sources(mbed-wifi
21
21
utils/cydhcp_server_debug.cpp
22
22
utils/cynetwork_utils.c
23
23
)
24
+
25
+ # Link override object file coming from static library anyway
26
+ #
27
+ # NOTE: This linker option is to pretend undefined symbol and won't cause
28
+ # undefined symbol error even though the override object file actually
29
+ # doesn't provide such symbol definition.
30
+ if (${MBED_TOOLCHAIN} STREQUAL "GCC_ARM" )
31
+ target_link_options (mbed-wifi
32
+ INTERFACE
33
+ LINKER:--undefined=LINK_WHD_INTERFACE_CPP
34
+ )
35
+ endif ()
Original file line number Diff line number Diff line change @@ -32,3 +32,17 @@ WhdSoftAPInterface *WhdSoftAPInterface::get_default_instance()
32
32
static WhdSoftAPInterface softap;
33
33
return &softap;
34
34
}
35
+
36
+ /*
37
+ * With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
38
+ * object file anyway for being able to override weak symbol successfully
39
+ * even though from static library. See:
40
+ * https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
41
+ *
42
+ * NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
43
+ * <LINK_FOO> symbol correctly.
44
+ */
45
+ extern " C"
46
+ void LINK_WHD_INTERFACE_CPP (void )
47
+ {
48
+ }
Original file line number Diff line number Diff line change @@ -21,3 +21,15 @@ target_sources(mbed-wifi
21
21
mx_wifi/core/mx_wifi_ipc.c
22
22
mx_wifi/core/mx_wifi_slip.c
23
23
)
24
+
25
+ # Link override object file coming from static library anyway
26
+ #
27
+ # NOTE: This linker option is to pretend undefined symbol and won't cause
28
+ # undefined symbol error even though the override object file actually
29
+ # doesn't provide such symbol definition.
30
+ if (${MBED_TOOLCHAIN} STREQUAL "GCC_ARM" )
31
+ target_link_options (mbed-wifi
32
+ INTERFACE
33
+ LINKER:--undefined=LINK_EMW3080BINTERFACE_CPP
34
+ )
35
+ endif ()
Original file line number Diff line number Diff line change @@ -365,3 +365,19 @@ WiFiInterface *WiFiInterface::get_target_default_instance()
365
365
return &wifi;
366
366
}
367
367
#endif /* MBED_CONF_NSAPI_PRESENT */
368
+
369
+ #if MBED_CONF_EMW3080B_PROVIDE_DEFAULT || defined(MBED_CONF_NSAPI_PRESENT)
370
+ /*
371
+ * With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
372
+ * object file anyway for being able to override weak symbol successfully
373
+ * even though from static library. See:
374
+ * https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
375
+ *
376
+ * NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
377
+ * <LINK_FOO> symbol correctly.
378
+ */
379
+ extern " C"
380
+ void LINK_EMW3080BINTERFACE_CPP (void )
381
+ {
382
+ }
383
+ #endif
Original file line number Diff line number Diff line change @@ -23,4 +23,16 @@ target_sources(mbed-wiced
23
23
wiced_interface/default_wifi_interface.cpp
24
24
)
25
25
26
- target_link_libraries (mbed-wifi PUBLIC mbed-wiced )
26
+ target_link_libraries (mbed-wifi PUBLIC mbed-wiced )
27
+
28
+ # Link override object file coming from static library anyway
29
+ #
30
+ # NOTE: This linker option is to pretend undefined symbol and won't cause
31
+ # undefined symbol error even though the override object file actually
32
+ # doesn't provide such symbol definition.
33
+ if (${MBED_TOOLCHAIN} STREQUAL "GCC_ARM" )
34
+ target_link_options (mbed-wifi
35
+ INTERFACE
36
+ LINKER:--undefined=LINK_DEFAULT_WIFI_INTERFACE_CPP
37
+ )
38
+ endif ()
Original file line number Diff line number Diff line change @@ -25,4 +25,18 @@ WiFiInterface *WiFiInterface::get_target_default_instance()
25
25
return &wifi;
26
26
}
27
27
28
+ /*
29
+ * With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
30
+ * object file anyway for being able to override weak symbol successfully
31
+ * even though from static library. See:
32
+ * https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
33
+ *
34
+ * NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
35
+ * <LINK_FOO> symbol correctly.
36
+ */
37
+ extern " C"
38
+ void LINK_DEFAULT_WIFI_INTERFACE_CPP (void )
39
+ {
40
+ }
41
+
28
42
#endif
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ if("MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE=MESH" IN_LIST MBED_CONFIG_DE
74
74
target_link_libraries (mbed-netsocket-api PUBLIC mbed-nanostack-mbed_mesh_api )
75
75
endif ()
76
76
77
+ # Similarly if wifi networking is used bring in that library
78
+ if ("MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE=WIFI" IN_LIST MBED_CONFIG_DEFINITIONS )
79
+ if (TARGET mbed-wifi )
80
+ target_link_libraries (mbed-netsocket-api PUBLIC mbed-wifi )
81
+ endif ()
82
+ endif ()
77
83
78
84
if ("DEVICE_EMAC=1" IN_LIST MBED_TARGET_DEFINITIONS )
79
85
target_link_libraries (mbed-netsocket-api
You can’t perform that action at this time.
0 commit comments