Skip to content

Duplicate symbol resolution changed between 5.7.4 and 5.8.3 #6807

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

Closed
drahnr opened this issue May 3, 2018 · 5 comments
Closed

Duplicate symbol resolution changed between 5.7.4 and 5.8.3 #6807

drahnr opened this issue May 3, 2018 · 5 comments

Comments

@drahnr
Copy link
Contributor

drahnr commented May 3, 2018

Description

  • Type: Bug | Question
  • Priority: Blocker

I am using an SDK for a Winc which I am trying to compile with my project (and is part of my project).
It used to work just fine with 5.7.4 .
Upgrading to 5.8.3 caused this conflict. No other changes were done.

Target
NRF52

Toolchain:
GCC_ARM

Toolchain version:

mbed-cli version:
1.5.1

mbed-os sha:
5.8.3

Expected behavior
Compiling

Actual behavior
Fails to compile due to conflicting decl of close of the Winc SDK Version and the mbed os one.

Steps to reproduce
Upgrade from 5.7.4 to 5.8.3


Question

How to handle multipe conflicting definitions in mbed os with mbed-cli?

Current way of including:

namespace sdk {
extern "C" {
#include "bsp/include/nm_bsp.h"
#include "driver/include/m2m_wifi.h"
#include "driver/include/m2m_ota.h"
#include "socket/include/socket.h"
#include "spi_flash.h"
#include "spi_flash_map.h"
} // extern C
} // namespace sdk

which is then used as

    int8_t ret = sdk::close (handle->id);
@0xc0170
Copy link
Contributor

0xc0170 commented May 4, 2018

I don't follow. in the question above is the code snippet how you include winc sdk? it's in separete namespace and you still get a conflict?

What exact error are you getting (where mbed OS close gets from) ?

@drahnr
Copy link
Contributor Author

drahnr commented May 4, 2018

The SDK is a separate directory in my main git repository.

This is the only include I use from outside the SDK, adding the namespace to avoid exactly this kind of issue. Within the SDK there are all kind of things going on, overlapping with standard names like open and close.

@drahnr
Copy link
Contributor Author

drahnr commented May 4, 2018

BUILD/XYZ/GCC_ARM/sdks/winc1500/socket/source/socket.o: In function `close':
/home/xyz/project/./sdks/winc1500/socket/source/socket.c:909: multiple definition of `close'
BUILD/XYZ/GCC_ARM/mbed-os/platform/mbed_retarget.o/home/xyz/project/./mbed-os/platform/mbed_retarget.cpp:482: first defined here

I can reproduceably create this by switching from 5.7.4 to 5.8.3 and revert it by moving back to 5.7.4 (mbed-cli 1.5.1)

I need a way to make this work without touching every file of the SDK.

@0xc0170
Copy link
Contributor

0xc0170 commented May 4, 2018

Based on the output, isn't this a problem in the winc SDK? extern "C" int close(int fh) is POSIX function. It was added here #5571

Looking at winc1500 sources, in socket.c file I can't find close defined (they declare their API as socketXXX or am I looking at older sources?). Update: found it, in the header file, NMI_API sint8 close(SOCKET sock); this one is causing a conflict?
I would assume this is an issue in the SDK rather here.

cc @kjbracey-arm

@drahnr
Copy link
Contributor Author

drahnr commented May 4, 2018

The issue here is the change in behaviour within minor versions without further notice.

Edit: Thanks for the link, that explains it, but essentially this implies that I have to jump through quite some hoops to make this work again, but it seems this is actually unrelated to mbed-os.

Feel free to close.

@0xc0170 0xc0170 closed this as completed May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants