xref: /OK3568_Linux_fs/buildroot/package/gvfs/0001-meson.build-fix-linking-with-libmetadata.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 731256d7517f0d9cf0b999bb22f864080d5e8690 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Sat, 18 Jul 2020 10:00:50 +0200
4Subject: [PATCH] meson.build: fix linking with libmetadata
5
6libmetadata is built as a static library and depends on libgvfscommon so
7change the dependencies order to put libgvfscommon_dep after
8libmetadata_dep or gvfsd-metadata will fail to link on:
9
10FAILED: metadata/gvfsd-metadata
11/home/naourr/work/instance-3/output-1/host/bin/arm-none-linux-gnueabi-gcc  -o metadata/gvfsd-metadata 'metadata/45447b7@@gvfsd-metadata@exe/meta-daemon.c.o' -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -Wl,--start-group common/libgvfscommon.so metadata/libmetadata.a /home/naourr/work/instance-3/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgio-2.0.so /home/naourr/work/instance-3/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so /home/naourr/work/instance-3/output-1/host/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libglib-2.0.so -Wl,--end-group '-Wl,-rpath,$ORIGIN/../common:$ORIGIN/' -Wl,-rpath-link,/home/naourr/work/instance-3/output-1/build/gvfs-1.44.1/build/common -Wl,-rpath-link,/home/naourr/work/instance-3/output-1/build/gvfs-1.44.1/build/metadata
12metadata/libmetadata.a(metatree.c.o): In function `safe_open':
13metatree.c:(.text+0x9c8): undefined reference to `gvfs_randomize_string'
14collect2: error: ld returned 1 exit status
15
16Apply this change in the whole source code and not only for
17gvfsd-metadata to avoid any other build failures.
18
19Fixes:
20 - http://autobuild.buildroot.org/results//fa892c41b6b9285839a0164b000e37fb04dcc194
21
22Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
23[Upstream status:
24https://gitlab.gnome.org/GNOME/gvfs/-/merge_requests/92]
25---
26 client/meson.build   | 2 +-
27 metadata/meson.build | 5 +++--
28 2 files changed, 4 insertions(+), 3 deletions(-)
29
30diff --git a/client/meson.build b/client/meson.build
31index 8f57d0d3..1d251481 100644
32--- a/client/meson.build
33+++ b/client/meson.build
34@@ -33,8 +33,8 @@ sources = uri_parser_sources + uri_utils + files(
35
36 deps = [
37   gio_unix_dep,
38-  libgvfscommon_dep,
39   libmetadata_dep,
40+  libgvfscommon_dep,
41 ]
42
43 cflags = [
44diff --git a/metadata/meson.build b/metadata/meson.build
45index 4e120d18..5699e6f2 100644
46--- a/metadata/meson.build
47+++ b/metadata/meson.build
48@@ -72,8 +72,8 @@ libmetadata_dep = declare_dependency(
49 )
50
51 deps = [
52-  libgvfscommon_dep,
53   libmetadata_dep,
54+  libgvfscommon_dep,
55 ]
56
57 if enable_gudev
58@@ -105,8 +105,8 @@ if enable_devel_utils
59       app + '.c',
60       include_directories: top_inc,
61       dependencies: [
62-        libgvfscommon_dep,
63         libmetadata_dep,
64+        libgvfscommon_dep,
65       ],
66       c_args: cflags,
67     )
68@@ -119,6 +119,7 @@ if enable_devel_utils
69       include_directories: top_inc,
70       dependencies: [
71         libmetadata_dep,
72+        libgvfscommon_dep,
73         libxml_dep,
74       ],
75       c_args: cflags,
76--
772.27.0
78
79