summaryrefslogtreecommitdiff
path: root/recipes/glib/0001-gio-fix-duplicate-g_trace_-symbols-in-static-libs-wi.patch
blob: 7dbf68d9742a937ecefa95735d0ecef8d2985170 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 4d0deab466d8f5e0fdd331ddb84d4aeac1d31f11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
Date: Thu, 29 Dec 2022 00:47:28 +0100
Subject: [PATCH] gio: fix duplicate g_trace_* symbols in static libs with
 --default-library=both

Should fix ld.gold linker errors linking static glib/gio into an app:

error: /builds/cerbero-android-universal/arm64/lib/libglib-2.0.a(gtrace.c.o): multiple definition of 'g_trace_mark'
/builds/cerbero-android-universal/arm64/lib/libgio-2.0.a(.._glib_gtrace.c.o): previous definition here

error: /builds/cerbero-android-universal/arm64/lib/libglib-2.0.a(gtrace.c.o): multiple definition of 'g_trace_define_int64_counter'
/builds/cerbero-android-universal/arm64/lib/libgio-2.0.a(.._glib_gtrace.c.o): previous definition here

error: /builds/cerbero-android-universal/arm64/lib/libglib-2.0.a(gtrace.c.o): multiple definition of 'g_trace_set_int64_counter'
/builds/cerbero-android-universal/arm64/lib/libgio-2.0.a(.._glib_gtrace.c.o): previous definition here
---
 gio/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gio/meson.build b/gio/meson.build
index 79dfaa0..69fb0fa 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -615,7 +615,7 @@ gio_sources = files(
   'gliststore.c',
 )
 
-if get_option('default_library') != 'static'
+if get_option('default_library') == 'shared'
   gio_sources += files ('../glib/gtrace.c')
 endif
 
-- 
2.38.1