Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build issues with cellular #397

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions connectivity/cellular/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ target_link_libraries(mbed-cellular
PUBLIC
mbed-netsocket-api
mbed-core-flags
mbed-rtos-flags
mbed-randlib
)
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,19 @@ CellularDevice *CellularDevice::get_default_instance()
static ALT1250_PPP device(&serial, MBED_CONF_ALT1250_PPP_RST, PIN_OUTPUT, OpenDrainNoPull, 1);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_ALT1250_PPP_CPP(void)
{
}
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,15 @@ target_sources(mbed-cellular
ALT1250_PPP_CellularContext.cpp
ALT1250_PPP_CellularNetwork.cpp
)

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_ALT1250_PPP_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@ target_sources(mbed-cellular
PRIVATE
STModCellular.cpp
)

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_STMODCELLULAR_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,19 @@ CellularDevice *CellularDevice::get_default_instance()
static STModCellular device(&serial);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_STMODCELLULAR_CPP(void)
{
}
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ target_sources(mbed-cellular
GEMALTO_CINTERION_CellularInformation.cpp
GEMALTO_CINTERION_CellularStack.cpp
)

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_GEMALTO_CINTERION_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,18 @@ CellularDevice *CellularDevice::get_default_instance()
static GEMALTO_CINTERION device(&serial);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_GEMALTO_CINTERION_CPP(void)
{
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@ target_sources(mbed-cellular
PRIVATE
GENERIC_AT3GPP.cpp
)

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_GENERIC_AT3GPP_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,18 @@ CellularDevice *CellularDevice::get_default_instance()
static GENERIC_AT3GPP device(&serial);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_GENERIC_AT3GPP_CPP(void)
{
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,16 @@ target_sources(mbed-cellular

if("MTS_DRAGONFLY_L471QG" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_MTS_DRAGONFLY_L471QG)
endif()
endif()

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_SARA4_PPP_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,18 @@ CellularDevice *CellularDevice::get_default_instance()
static SARA4_PPP device(&serial);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_SARA4_PPP_CPP(void)
{
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ target_sources(mbed-cellular
RM1000_AT_CellularNetwork.cpp
RM1000_AT_CellularStack.cpp
)

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_RM1000_AT_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,19 @@ CellularDevice *CellularDevice::get_default_instance()
static RM1000_AT device(&serial);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_RM1000_AT_CPP(void)
{
}
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,16 @@ endif()

if("TARGET_MTS_DRAGONFLY_F413RH" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_MTS_DRAGONFLY_F413RH)
endif()
endif()

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_TELIT_HE910_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,18 @@ CellularDevice *CellularDevice::get_default_instance()
static TELIT_HE910 device(&serial);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_TELIT_HE910_CPP(void)
{
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@ target_sources(mbed-cellular

if("TARGET_EP_ATLAS" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_EP_ATLAS)
endif()
endif()

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_TELIT_ME310_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,20 @@ CellularDevice *CellularDevice::get_default_instance()
MBED_CONF_TELIT_ME310_POLARITY);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_TELIT_ME310_CPP(void)
{
}
#endif

nsapi_error_t TELIT_ME310::hard_power_on()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,16 @@ target_sources(mbed-cellular

if("TARGET_EP_AGORA" IN_LIST MBED_TARGET_LABELS)
add_subdirectory(TARGET_EP_AGORA)
endif()
endif()

# Link override object file coming from static library anyway
#
# NOTE: This linker option is to pretend undefined symbol and won't cause
# undefined symbol error even though the override object file actually
# doesn't provide such symbol definition.
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_link_options(mbed-cellular
INTERFACE
LINKER:--undefined=LINK_TELIT_ME910_CPP
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ CellularDevice *CellularDevice::get_default_instance()
MBED_CONF_TELIT_ME910_POLARITY);
return &device;
}

/*
* With e.g. GCC linker option "--undefined=<LINK_FOO>", pull in this
* object file anyway for being able to override weak symbol successfully
* even though from static library. See:
* https://stackoverflow.com/questions/42588983/what-does-the-gnu-ld-undefined-option-do
*
* NOTE: For C++ name mangling, 'extern "C"' is necessary to match the
* <LINK_FOO> symbol correctly.
*/
extern "C"
void LINK_TELIT_ME910_CPP(void)
{
}
#endif

nsapi_error_t TELIT_ME910::hard_power_on()
Expand Down
7 changes: 7 additions & 0 deletions connectivity/netsocket/source/NetworkInterfaceDefaults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ MBED_WEAK MeshInterface *MeshInterface::get_default_instance()
return get_target_default_instance();
}

#if MBED_CONF_CELLULAR_PRESENT
MBED_WEAK CellularInterface *CellularInterface::get_default_instance()
{
return get_target_default_instance();
}
#endif // MBED_CONF_CELLULAR_PRESENT

/* For other types, we can provide a reasonable get_target_default_instance
* in some cases. This is done in EthernetInterface.cpp, mbed-mesh-api and
* OnboardCellularInterface.cpp. We have no implementation for WiFi, so a
Expand Down