Skip to content

Commit 0fa07ac

Browse files
authored
Linux: ensure GLib's g_print*() functions wrap the system ones (#264)
C99 `printf()` semantics are well-supported by these Linux cross-targets, avoids the need for gnulib compat functions. An alternative is setting up QEMU when cross-compiling, as this functionality is gated by `meson.can_run_host_binaries()`, but this is a bit simpler.
1 parent ce6c888 commit 0fa07ac

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

platforms/linux-armv6/meson.ini

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ ld = 'arm-rpi-linux-gnueabihf-gcc-ld'
1313
strip = 'arm-rpi-linux-gnueabihf-strip'
1414
ranlib = 'arm-rpi-linux-gnueabihf-gcc-ranlib'
1515

16+
[properties]
17+
# https://docs.gtk.org/glib/cross-compiling.html#cross-properties
18+
have_c99_vsnprintf = true
19+
have_c99_snprintf = true
20+
have_unix98_printf = true
21+
1622
[built-in options]
1723
libdir = 'lib'
1824
datadir = '/usr/share'

platforms/linux-ppc64le/meson.ini

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ strip = 'powerpc64le-linux-gnu-strip'
1414
ranlib = 'powerpc64le-linux-gnu-gcc-ranlib'
1515
#exe_wrapper = 'qemu-ppc64le-static'
1616

17+
[properties]
18+
# https://docs.gtk.org/glib/cross-compiling.html#cross-properties
19+
have_c99_vsnprintf = true
20+
have_c99_snprintf = true
21+
have_unix98_printf = true
22+
1723
[built-in options]
1824
libdir = 'lib'
1925
datadir = '/usr/share'

platforms/linux-s390x/meson.ini

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ strip = 's390x-linux-gnu-strip'
1414
ranlib = 's390x-linux-gnu-gcc-ranlib'
1515
#exe_wrapper = 'qemu-s390x-static'
1616

17+
[properties]
18+
# https://docs.gtk.org/glib/cross-compiling.html#cross-properties
19+
have_c99_vsnprintf = true
20+
have_c99_snprintf = true
21+
have_unix98_printf = true
22+
1723
[built-in options]
1824
libdir = 'lib'
1925
datadir = '/usr/share'

platforms/linuxmusl-arm64v8/meson.ini

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ ld = 'aarch64-linux-musl-ld'
1313
strip = 'aarch64-linux-musl-strip'
1414
ranlib = 'aarch64-linux-musl-ranlib'
1515

16+
[properties]
1617
# Ensure we disable the inotify backend in GIO
1718
# See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2991#note_1592863
18-
[properties]
1919
has_function_inotify_init1 = false
20+
# https://docs.gtk.org/glib/cross-compiling.html#cross-properties
21+
have_c99_vsnprintf = true
22+
have_c99_snprintf = true
23+
have_unix98_printf = true
2024

2125
[built-in options]
2226
libdir = 'lib'

platforms/linuxmusl-x64/meson.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[binaries]
22
strip = 'strip'
33

4+
[properties]
45
# Ensure we disable the inotify backend in GIO
56
# See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2991#note_1592863
6-
[properties]
77
has_function_inotify_init1 = false
88

99
[built-in options]

0 commit comments

Comments
 (0)