diff --git a/helpers/check-xdg-portal.c b/helpers/check-xdg-portal.c index d9c8f3381cc91cb4c6494a80739393f5ced407cb..d5b1858c20a2e129a0b6622cabd97a46430811d1 100644 --- a/helpers/check-xdg-portal.c +++ b/helpers/check-xdg-portal.c @@ -57,7 +57,6 @@ main (int argc, g_autoptr(FILE) original_stdout = NULL; g_autoptr(JsonBuilder) builder = NULL; g_autoptr(GDBusConnection) connection = NULL; - g_autoptr(GVariant) variant_version = NULL; g_autoptr(GError) local_error = NULL; g_autoptr(GOptionContext) option_context = NULL; guint32 version; @@ -126,7 +125,9 @@ main (int argc, for (i = 0; portal_interface_name[i] != NULL; i++) { g_autoptr(GDBusProxy) portal_proxy = NULL; + g_autoptr(GVariant) variant_version = NULL; g_autofree gchar *name_owner = NULL; + portal_proxy = g_dbus_proxy_new_sync (connection, G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS, NULL, diff --git a/helpers/meson.build b/helpers/meson.build index 74cc417a7dc454e4d1b949c3b545216407bf8d58..4a2e5f57232bc4a98fac6f7574d8f4e4c32ecbc3 100644 --- a/helpers/meson.build +++ b/helpers/meson.build @@ -146,6 +146,7 @@ srt_helpers += executable( include_directories : project_include_dirs, install : true, install_dir : pkglibexecdir, + override_options : no_leak_sanitizer, # Use the adjacent libwaffle build_rpath : pkglibexec_rpath, install_rpath : pkglibexec_rpath, diff --git a/helpers/wflinfo.c b/helpers/wflinfo.c index 00317b34ee3dc8b07f887c7ddfeee76807261ed0..419d5042bdb93f2a2c3238cf44df9d84481db3c3 100644 --- a/helpers/wflinfo.c +++ b/helpers/wflinfo.c @@ -1,4 +1,4 @@ -// Modified from waffle, last update: 1.7.0 +// Modified from waffle, last update: 1.8.0 // Changes are marked with SRT.../SRT // SPDX-License-Identifier: BSD-2-Clause // @@ -36,7 +36,9 @@ /// 2. Create an OpenGL context. /// 3. Print information about the context. +// SRT: We ship an older version in the Steam Runtime #define WAFFLE_API_VERSION 0x0106 +// /SRT #include <assert.h> #include <ctype.h> @@ -76,7 +78,7 @@ static const char *usage_message = "\n" "Options:\n" " -V, --version <version>\n" - " For example --api=gl --version=3.2 would request OpenGL 3.2.\n" + " For example --api gl --version 3.2 would request OpenGL 3.2.\n" "\n" " --profile <profile>\n" " One of: core, compat or none\n" @@ -97,10 +99,10 @@ static const char *usage_message = " Print wflinfo usage information.\n" "\n" "Examples:\n" - " wflinfo --platform=glx --api=gl\n" - " wflinfo --platform=x11_egl --api=gl --version=3.2 --profile=core\n" - " wflinfo --platform=wayland --api=gles3\n" - " wflinfo --platform=gbm --api=gl --version=3.2 --verbose\n" + " wflinfo --platform glx --api gl\n" + " wflinfo --platform x11_egl --api gl --version 3.2 --profile core\n" + " wflinfo --platform wayland --api gles3\n" + " wflinfo --platform gbm --api gl --version 3.2 --verbose\n" " wflinfo -p gbm -a gl -V 3.2 -v\n" ; @@ -143,14 +145,15 @@ strneq(const char *a, const char *b, size_t n) #define NORETURN #endif -// SRT: https://gitlab.freedesktop.org/mesa/waffle/-/merge_requests/100 -// (Unmarked uses of PRINTFLIKE, below, are also changes) -#if defined(__GNUC__) -#define PRINTFLIKE(f, a) __attribute__((__format__(__printf__, f, a))) +// SRT: https://gitlab.freedesktop.org/mesa/waffle/-/merge_requests/146 +#if defined(__clang__) +#define PRINTFLIKE(f, a) __attribute__((format(printf, f, a))) +#elif defined(__GNUC__) +// /SRT +#define PRINTFLIKE(f, a) __attribute__((format(gnu_printf, f, a))) #else #define PRINTFLIKE(f, a) #endif -// /SRT static void NORETURN error_oom(void) @@ -180,7 +183,10 @@ write_usage_and_exit(FILE *f, int exit_code) exit(exit_code); } -static void NORETURN PRINTFLIKE(1, 2) usage_error_printf(const char *fmt, ...) +// clang-format off +static void NORETURN PRINTFLIKE(1, 2) +usage_error_printf(const char *fmt, ...) +// clang-format on { fprintf(stderr, "Wflinfo usage error: "); @@ -196,7 +202,6 @@ static void NORETURN PRINTFLIKE(1, 2) usage_error_printf(const char *fmt, ...) exit(EXIT_FAILURE); } -// SRT: https://gitlab.freedesktop.org/mesa/waffle/-/merge_requests/100 static void NORETURN error_waffle(void) { @@ -214,7 +219,6 @@ error_get_gl_symbol(const char *name) { error_printf("Wflinfo", "failed to get function pointer for %s", name); } -// /SRT typedef float GLclampf; typedef unsigned int GLbitfield; @@ -566,11 +570,9 @@ print_extensions(bool use_stringi) printf("\n"); } -// SRT: https://gitlab.freedesktop.org/mesa/waffle/-/merge_requests/102 static const struct { GLint flag; const char *str; -// /SRT } context_flags[] = { { GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT, "FORWARD_COMPATIBLE" }, { GL_CONTEXT_FLAG_DEBUG_BIT, "DEBUG" }, @@ -590,14 +592,12 @@ print_context_flags(void) return; } -// SRT: https://gitlab.freedesktop.org/mesa/waffle/-/merge_requests/101 if (gl_context_flags == 0) { printf(" 0x0\n"); return; } -// /SRT - for (int i = 0; i < ARRAY_SIZE(context_flags); i++) { + for (unsigned i = 0; i < ARRAY_SIZE(context_flags); i++) { if ((context_flags[i].flag & gl_context_flags) != 0) { printf(" %s", context_flags[i].str); gl_context_flags = gl_context_flags & ~context_flags[i].flag; @@ -624,7 +624,7 @@ json_print_extensions(bool use_stringi) if (glGetError() != GL_NO_ERROR) { printf(" \"WFLINFO_GL_ERROR\""); } else { - for (int i = 0; i < count; i++) { + for (GLint i = 0; i < count; i++) { ext = (const char *) glGetStringi(GL_EXTENSIONS, i); if (glGetError() != GL_NO_ERROR) ext = "WFLINFO_GL_ERROR"; diff --git a/meson.build b/meson.build index efcfbaeba444b157b014c124a0a0d0ccf33f37cd..517a3e483c6bedde0622c3ce1d2da1034fef6d51 100644 --- a/meson.build +++ b/meson.build @@ -197,6 +197,15 @@ silence_wflinfo_warnings = c_compiler.get_supported_arguments([ '-Wno-switch-default', ]) +# wflinfo with libwaffle 1.8.0 appears to have a leak from +# wegl_display_init(), which we don't particularly care about for a +# short-lived process +if ['undefined', 'address,undefined'].contains(get_option('b_sanitize')) + no_leak_sanitizer = ['b_sanitize=undefined'] +else + no_leak_sanitizer = ['b_sanitize=none'] +endif + add_project_link_arguments( c_compiler.get_supported_link_arguments( '-Wl,-z,origin', diff --git a/pressure-vessel/runtime.c b/pressure-vessel/runtime.c index cfd5526994b3f36d28f878dc4fc1e8a2b2b737df..0ff2ae027b920176581ae9aa0b1f5b40e4e61f1e 100644 --- a/pressure-vessel/runtime.c +++ b/pressure-vessel/runtime.c @@ -105,12 +105,12 @@ struct _PvRuntime int overrides_fd; int runtime_files_fd; int variable_dir_fd; - gboolean any_libc_from_provider; - gboolean all_libc_from_provider; - gboolean runtime_is_just_usr; - gboolean is_steamrt; - gboolean is_scout; - gboolean is_flatpak_env; + unsigned any_libc_from_provider : 1; + unsigned all_libc_from_provider : 1; + unsigned runtime_is_just_usr : 1; + unsigned is_steamrt : 1; + unsigned is_scout : 1; + unsigned is_flatpak_env : 1; }; struct _PvRuntimeClass