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

multiple definition of `__mi_server #682

Closed
vitlav opened this issue Feb 24, 2021 · 5 comments · Fixed by #685
Closed

multiple definition of `__mi_server #682

vitlav opened this issue Feb 24, 2021 · 5 comments · Fixed by #685

Comments

@vitlav
Copy link

vitlav commented Feb 24, 2021

omi build has multiple definition of `__mi_server:

gcc -o /usr/src/RPM/BUILD/omi-1.6.8/Unix/output/bin/omiserver /usr/src/RPM/BUILD/omi-1.6.8/Unix/output/obj/server/server.o /usr/src/RPM/BUILD/omi-1.6.8/Unix/output/obj/server/servermain.o /usr/src/RPM/BUILD/omi-1.6.8/Unix/output/obj/server/servercommon.o -L/usr/src/RPM/BUILD/omi-1.6.8/Unix/output/lib -L/usr/lib64 -lwsman -lxmlserializer -lhttp -lprotocol -lsock -ldisp -lprovreg -lprovmgr -lmiapi -lwql -lbase -lxml -lpal -lindimgr -lomi_error -lindicmn -lmicodec -lmofparser  -lwsman -lxmlserializer -lhttp -lprotocol -lsock -ldisp -lprovreg -lprovmgr -lmiapi -lwql -lbase -lxml -lpal -lindimgr -lomi_error -lindicmn -lmicodec -lmofparser   -lpthread -ldl -lpam -lssl -lcrypto 
ld: /usr/src/RPM/BUILD/omi-1.6.8/Unix/output/lib/libomi_error.a(schema.o):/usr/src/RPM/BUILD/omi-1.6.8/Unix/omi_error/schema.c:503: multiple definition of `__mi_server'; /usr/src/RPM/BUILD/omi-1.6.8/Unix/output/lib/libprovmgr.a(indicationSchema.o):/usr/src/RPM/BUILD/omi-1.6.8/Unix/provmgr/indicationSchema.c:802: first defined here
@JumpingYang001
Copy link
Contributor

@vitlav , what is your OS version cat /etc/*-release and gcc & gcc-c++ version?
did you follow this https://github.com/microsoft/build-omi?

@vitlav
Copy link
Author

vitlav commented Feb 26, 2021

@vitlav , what is your OS version cat /etc/*-release and gcc & gcc-c++ version?
did you follow this https://github.com/microsoft/build-omi?

It is just a gcc 10 issue. Please, check https://gcc.gnu.org/gcc-10/porting_to.html about multiple definition mistake.
I used gcc 10.2.1.

@jborean93
Copy link

While it doesn't fix the underlying issue itself you can ignore it and go back to the pre gcc 10 behaviour with https://github.com/jborean93/omi/blob/297686252944e32d2525ea2f72937df371df8c38/Unix/buildtool#L801-L804.

@JumpingYang001
Copy link
Contributor

JumpingYang001 commented Mar 17, 2021

@vitlav @jborean93 thanks for sharing!

because we used redhat5/centos5 to build universal packages, we doesn't meet the issue on our build system.
For build the code on latest OS, we doesn't try it yet, maybe we will have chance to try it in the future.

build universal rpm/deb packages docs:

  1. build openssl: https://github.com/microsoft/ostc-openssl
  2. build universal packages: https://github.com/microsoft/Build-omi#building-packages

@JumpingYang001
Copy link
Contributor

@vitlav @jborean93 I have verified jborean93 's fixes works fine for gcc 10 compilation and the fixes also doesn't break exist build system, and I will new a PR next week to fix the issue, thanks for contribution!

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

Successfully merging a pull request may close this issue.

3 participants