After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783311 - NetworkManager 1.8.0 runtime failure when built with LTO enabled
NetworkManager 1.8.0 runtime failure when built with LTO enabled
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
1.8.x
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-06-01 02:25 UTC by Mike Gilbert
Modified: 2017-06-01 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mike Gilbert 2017-06-01 02:25:20 UTC
When build with LTO enabled, NetworkManager fails to load critical modules and cannot connect to any networks.

I traced it down to this warning in the build log:

BINUTILS_NM="/usr/bin/x86_64-pc-linux-gnu-nm" "/x/portage/net-misc/networkmanager-1.8.0/work/NetworkManager-1.8.0/tools/create-exports-NetworkManager.sh" --called-from-make "/x/portage/net-misc/networkmanager-1.8.0/work/NetworkManager-1.8.0"

/usr/bin/x86_64-pc-linux-gnu-nm: src_libNetworkManager_la-nm-checkpoint-manager.o: plugin needed to handle lto object


Setting BINUTILS_NM=/usr/bin/gcc-nm in the environment resolves this. This is a wrapper that passes the proper --plugin arguments to the 'nm' command.
Comment 1 Mike Gilbert 2017-06-01 02:39:43 UTC
This might be resolved by replacing this line in configure.ac:

AC_PATH_TOOL(BINUTILS_NM, nm, nm)

With this:

AC_CHECK_TOOLS(NM, [gcc-nm nm])

And update Makefile.am to reference $(NM) instead of $(BINUTILS_NM).

This would look for gcc-nm before nm, and allow the user to override this using the standard 'NM' environment variable.
Comment 2 Thomas Haller 2017-06-01 11:01:50 UTC
Should be fixed on master by https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=484d666485f481ea3fce447bfeec0b32a3b4f793 .

If you don't agree with the patch or it doesn't work, please reopen.


Thanks for reporting and telling how to fix it.



Note that LTO is still broken after this. See https://bugzilla.gnome.org/show_bug.cgi?id=782525#c6