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

Build failing with "multiple definition" errors #28

Closed
aJunk opened this issue Jun 11, 2020 · 10 comments
Closed

Build failing with "multiple definition" errors #28

aJunk opened this issue Jun 11, 2020 · 10 comments

Comments

@aJunk
Copy link

aJunk commented Jun 11, 2020

Hi,

For me both the master and development branch fail due to some symbols being defined more than once. I think this is due to some variables not being declared extern in their respective header files.

Namely, those are:
NETADDR_SOCKET_IPV4_ANY, NETADDR_SOCKET_IPV6_ANY, LOG_DLEP_RADIO, LOG_NL80211, LOG_MPR, LOG_NHDP, LOG_NHDP_R, LOG_NHDP_W, LOG_OLSRV2, LOG_OLSRV2_R, LOG_OLSRV2_ROUTING, LOG_OLSRV2_W

If this is actually a bug and not my setup being wrong I would love to submit a pull request for the fix.

@HRogge
Copy link
Contributor

HRogge commented Jun 11, 2020

I think it might be a good thing for you say what you used as your build chain and how you generate the error.

Did you use a different compiler than GCC for example (I think I never tested anything else).

@aJunk
Copy link
Author

aJunk commented Jun 11, 2020

Oh, yes, of course, I am sorry! I completely skipped that info.

I am building on Arch Linux with GCC 10.1.0.
I followed the instructions in the Readme and ran cmake .. in the build directory and invoked make after that.
I just tried it with 9.2.1 on a different Machine and 8.0 on the same machine which both work.

I think I have identified the problem: In GCC versions before 10, symbol conflicts caused by ommiting the extern keyword in declarations in header files were silently ignored. GCC 10 defaults to '-fno-common' which raises an error.
This is documented here.

The behaviour can be verified by using GCC <10 and adding '-fno-common' to the linker flags in the CMakeCache.txt file prior to running make.

@HRogge
Copy link
Contributor

HRogge commented Jun 12, 2020

Thank you for the quick diagnosis of the problem... if you already have a solution feel free to send me a push request to the develop branch... if not I will look into it at the weekend.

@aJunk
Copy link
Author

aJunk commented Jun 12, 2020

I would be very glad to do so!
Although I have never made a PR before, so please let me know if I do something wrong.

@aJunk
Copy link
Author

aJunk commented Jun 12, 2020

I created a pull request for this issue.

However, when merging the changes into the development branch another problem cropped up with the DNS library. I have created a new issue, I hope that is alright.

@HRogge
Copy link
Contributor

HRogge commented Jun 12, 2020

Yes, the DNS library was a pain in the ass... I will see what I can do, most likely add more special GCC Arguments for its compilation.

@aJunk
Copy link
Author

aJunk commented Jun 12, 2020

I documented my findings in issue #30, it took me a while since I ran out of disk space half way through...
I do not think this can be worked around that way, since apparently this should not have worked to begin with and was allowed through a bug in GCC.

@jpo-github-work
Copy link
Contributor

The problem is still not fixed.

@jpo-github-work
Copy link
Contributor

This should be fixed now with #40 and #42 merged.

@mathiashro
Copy link
Contributor

Thank you & closing.

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

4 participants