-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support wifi as default network interface #373
Support wifi as default network interface #373
Conversation
2597b53
to
7c2d892
Compare
This fixes WiFi doesn't get linked in when configued as default network interface.
The location where the 'mbed-wifi' target is created is now fixed to the top directory. CMake commands e.g. add_custom_command are required to invoke in the same directory as where the 'mbed-wifi' target is created.
This requires support for weak symbol override. Object files arcived in static library don't always participate in linking, dependent on linker and link order. To fix this, the object files which will override weak symbols are extracted and passed to linker command line separately to actively participate in linking.
7c2d892
to
67b6fd9
Compare
Hmm, I'm confused why this is needed... I have successfully used Arduino boards with Mbed CE that use Cypress WHD wifi modules, and I do not believe those needed anything special to get the default network interface to work |
Actually no, you're right, this is an issue as the weak symbol override is defined in a .a file. How the heck did this work before? Anyway, I guess we either need to do this, or we need to do something like move the definitions of |
In Mbed CLI 2,
This would be more concise. But if the override comes from another wifi library out of mbed-os tree, then it also cannot override unless it can apply either of above approaches. |
Fixed via #377 |
Summary of changes
This supports configuring WiFi as default network interface. This support requires overriding weak symbol
WiFiInterface::get_default_instance
when e.g."esp8266.provide-default: true"
is specified inmbed_app.json
. The override will fail because WiFi objects are archived in static librarylibmbed-wifi.a
and don't participate in linking as expected, dependent on linker and library link order. To fix this, the override objects are extracted and passed to linker command line so that they always participate in the linking.Pull request type