-
Notifications
You must be signed in to change notification settings - Fork 196
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: add optional dynamic linking to boost::log #1663
Conversation
@aduskett, Let me know if you want to start the integration pipeline by mentioning me and the command "start pipeline". my commands and optionsYou can trigger a pipeline on multiple prs with:
You can start a fast pipeline, disabling full integration tests with:
You can trigger GitHub->GitLab branch sync with:
You can cherry pick to a given branch or branches with:
|
When building boost as a dynamic library, during linking, hundreds of `undefined reference to `boost::log` errors occure. As the default behavior currently is to statically link against boost::log, it is best to add a new option that explicitly enables dynamically linking to boost::log. This new option is called MENDER_USE_DYNAMIC_BOOST_LOG. Signed-off-by: Adam Duskett <aduskett@gmail.com>
@mender-test-bot start pipeline --pr mender/127 --pr mender-connect/255 |
Hello 😺 I created a pipeline for you here: Pipeline-1445846749 Build Configuration Matrix
|
I would like to see what failed, but the pipeline URL goes to a 404 :( |
@mender-test-bot start pipeline |
Hello 😺 I created a pipeline for you here: Pipeline-1447273009 Build Configuration Matrix
|
You copied the example start, pointing the bot to old or non-existing PR for mender and mender-connect. I started it for you.
Yeah, this pipeline is internal to the Mender team, sorry. |
Thank you so much! |
Hey 😃 Thank you for your contribution! I have some comments/questions. As far as I know, and can see from the pre-existing code, it defaults to dynamically linking boost, not statically (unless you set
Secondly, I don't get any |
Indeed, Boost is already linked dynamically. The proposed fix was removed earlier for this reason. It must be something in the environment. |
What this looks like is Buildroot not setting BOOST_LOG_DYN_LINK or BOOST_ALL_DYN_LINKS as found in boosts config.hpp:238
Which causes the above issue. Both Fedora and Debian do indeed define BOOST_LOG_DYN_LINK which is why the autobuilders aren't having the problem. Now, as to how to set BOOST_LOG_DYN_LINK is the issue. |
@aduskett: Can you elaborate on how Debian and Fedora define this? I cannot find this on my system, nor on a fresh one, in fact, it's quite clearly not turned on (in Debian):
( There are also some other issues with the proposal:
I'm wondering if it isn't better to just do this in autobuild with direct flags instead of having an option (which has some pitfalls, as we have seen). Something like this, for example:
Would that work for autobuild? |
Hey! So I * did * figure out the problem with buildroot, which is from commit
Five years ago! The fix is to remove |
No worries, great that you figured it out! |
This reverts commit 4349746 which states: commit 4349746 Author: Fabrice Fontaine <fontaine.fabrice@gmail.com> Date: Thu Apr 18 11:13:50 2019 +0200 package/boost: don't install boost cmake files Since version 1.70.0, boost installs its own cmake files which are utterly broken so don't install them otherwise all cmake packages using boost (host-thrift, domoticz, i2pd ...) will fail because BOOST_INCLUDE_DIRS will be empty Fixes: - http://autobuild.buildroot.org/results/4ada26bab5c1e6504c7d8c92672326ced1d336df Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> However, this has since been fixed upstream in the five years this change has been in Buildroot. Furthermore, having --no-cmake-config breaks packages expecting to dynamically link to boost::log with a multitude of `undefined reference to boost::log` errors. See: mendersoftware/mender#1663 for one such example. As the --no-cmake-config is no longer needed because the original problem has long since been fixed upstream, it is safe to revert the change. Tested with the following packages as a smoke test: - host-thrift - domoticz - i2pd - libcpprestsdk - log4cxx - mpd - libcamera-apps Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com> Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
When building boost as a dynamic library, hundreds of
undefined reference to
boost::log` errors occur during linking. As the default behavior currently is to link against boost::log statically, it is best to add a new option that explicitly enables dynamic linking to boost::log. This new option is called MENDER_USE_DYNAMIC_BOOST_LOG.Changelog: None
Ticket: None