aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2019-10-11 11:01:22 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-10-21 01:08:05 +0300
commit212a05b87ed34f921dfd07142305389dbfa9bb7d (patch)
treeeb6cea91360c05c4eaf0e9b591f271e8c94288a3 /mesonbuild/backend/backends.py
parentaece7ecded6f9113535c5b1c3e2f41056d3d041d (diff)
downloadmeson-212a05b87ed34f921dfd07142305389dbfa9bb7d.zip
meson-212a05b87ed34f921dfd07142305389dbfa9bb7d.tar.gz
meson-212a05b87ed34f921dfd07142305389dbfa9bb7d.tar.bz2
Remove duplicated object files in static libraries
When a static library link_whole to a bunch of other static libraries, we have to extract all their objects recursively. But that could introduce duplicated objects. ar is dumb enough to allow this without error, but once the resulting static library is linked into an executable or shared library, the linker will complain about duplicated symbols.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 947be1c..e548096 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -281,7 +281,8 @@ class Backend:
os.path.join('dummyprefixdir', fromdir))
def flatten_object_list(self, target, proj_dir_to_build_root=''):
- return self._flatten_object_list(target, target.get_objects(), proj_dir_to_build_root)
+ obj_list = self._flatten_object_list(target, target.get_objects(), proj_dir_to_build_root)
+ return list(dict.fromkeys(obj_list))
def _flatten_object_list(self, target, objects, proj_dir_to_build_root):
obj_list = []