diff options
author | Thomas Haller <thaller@redhat.com> | 2020-08-12 12:30:30 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-08-17 15:18:05 +0200 |
commit | c92a3ca5c2cd5366714da916e4f31f606901b727 (patch) | |
tree | 9e3025cb668996e83f3d5e46b94b348bc7134482 /.gitignore | |
parent | 54a1cfa97321c5990511a84f5a839e43fbb853d6 (diff) | |
download | NetworkManager-c92a3ca5c2cd5366714da916e4f31f606901b727.tar.gz |
build: fix generating "NetworkManager.ver" with LTO
We use a linker version script "NetworkManager.ver", to hide
symbols from NetworkManager that are not used. That is important
due to our habit of using internal helper libraries that we link
statically everywhere, without handpicking the symbols we actually
need. We want the tooling to get rid of unnecessary symbols.
However, NetworkManager loads shared libraries for settings and device
plugins. These libraries require symbols from the NetworkManager binary,
but which one depends on build options. Hence, we also generate
"NetworkManager.ver" by the "tools/create-exports-NetworkManager.sh"
script.
For that the script uses "nm" to find symbols that are undefined in the
plugin libraries but defined in NetworkManager. With autotools the
script looked at "./src/.libs/libNetworkManager.a" to find the present
symbols. Note that for meson that already didn't work, and we build
instead an intermediate NetworkManager binary first (with all symbols
exposed). With LTO, "nm" doesn't find all symbols in
"./src/.libs/libNetworkManager.a", and consequently they are not
exported and dropped/hidden.
This also causes unit tests to fail with LTO, because our test script
"tools/check-exports.sh" catches such bugs.
Fix that by also with autotools generate a complete "NetworkManager-all-sym"
binary that is used to generate "NetworkManager.ver", before rebuilding
"NetworkManager" again.
Diffstat (limited to '.gitignore')
-rw-r--r-- | .gitignore | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index 919b1830c9..8c08337548 100644 --- a/.gitignore +++ b/.gitignore @@ -217,6 +217,7 @@ test-*.trs /po/remove-potcdate.sin /src/NetworkManager +/src/NetworkManager-all-sym /src/NetworkManager.ver /src/devices/bluetooth/tests/nm-bt-test /src/devices/tests/test-acd |