Blame SOURCES/0001-meson-set-D_GNU_SOURCE-for-updwtmpx.patch

4abf37
From 5a2d5dbdf8c6f6d3c896082a5a07b4292f5fb410 Mon Sep 17 00:00:00 2001
4abf37
From: Sam James <sam@gentoo.org>
4abf37
Date: Tue, 5 Jul 2022 01:47:35 +0100
4abf37
Subject: [PATCH 1/2] meson: set -D_GNU_SOURCE for updwtmpx
4abf37
MIME-Version: 1.0
4abf37
Content-Type: text/plain; charset=UTF-8
4abf37
Content-Transfer-Encoding: 8bit
4abf37
4abf37
Without setting GNU_SOURCE, we end up getting:
4abf37
```
4abf37
../gdm-42.0/daemon/gdm-session-record.c:200:9: error: implicit declaration of function ‘updwtmpx’; did you mean ‘updwtmp’? [-Werror=implicit-function-declaration]
4abf37
updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record);
4abf37
```
4abf37
4abf37
This ended up exposing a bug in updwtmp(3) (which is now fixed
4abf37
thanks to the man-pages maintainers!) as it didn't mention that updwtmpx
4abf37
is a GNU extension (and hence needs GNU_SOURCE in order to be available).
4abf37
4abf37
Alternatively, we could just #define _GNU_SOURCE in gdm-session-record.c
4abf37
for updwtmpx.
4abf37
4abf37
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216168
4abf37
---
4abf37
 meson.build | 3 +++
4abf37
 1 file changed, 3 insertions(+)
4abf37
4abf37
diff --git a/meson.build b/meson.build
4abf37
index 8328dd97..4a286f97 100644
4abf37
--- a/meson.build
4abf37
+++ b/meson.build
4abf37
@@ -1,44 +1,47 @@
4abf37
 project('gdm', 'c',
4abf37
   version: '40.0',
4abf37
   license: 'GPL2+',
4abf37
   meson_version: '>= 0.50',
4abf37
 )
4abf37
 
4abf37
 # Modules
4abf37
 gnome = import('gnome')
4abf37
 pkgconfig = import('pkgconfig')
4abf37
 i18n = import('i18n')
4abf37
 
4abf37
 # Compiler
4abf37
 cc = meson.get_compiler('c')
4abf37
 
4abf37
+# Use GNU extensions if available
4abf37
+add_project_arguments('-D_GNU_SOURCE', language: 'c')
4abf37
+
4abf37
 # Options
4abf37
 gdm_prefix = get_option('prefix')
4abf37
 
4abf37
 gdmconfdir = (get_option('sysconfsubdir') == '')? gdm_prefix / get_option('sysconfdir') : gdm_prefix / get_option('sysconfdir') / get_option('sysconfsubdir')
4abf37
 dmconfdir = (get_option('dmconfdir') != '')? get_option('dmconfdir') : gdm_prefix / get_option('sysconfdir') / 'dm'
4abf37
 udev_dir = get_option('udev-dir')
4abf37
 at_spi_registryd_dir = (get_option('at-spi-registryd-dir') != '')? get_option('at-spi-registryd-dir') : gdm_prefix / get_option('libexecdir')
4abf37
 lang_config_file = (get_option('lang-file') != '')? get_option('lang-file') : gdm_prefix / get_option('sysconfdir') / 'locale.conf'
4abf37
 pam_mod_dir = (get_option('pam-mod-dir') != '')? get_option('pam-mod-dir') : gdm_prefix / get_option('libdir') / 'security'
4abf37
 dbus_sys_dir = (get_option('dbus-sys') != '')? get_option('dbus-sys') : get_option('sysconfdir') / 'dbus-1' / 'system.d'
4abf37
 gdm_defaults_conf = (get_option('defaults-conf') != '')? get_option('defaults-conf') : gdm_prefix / get_option('datadir') / 'gdm' / 'defaults.conf'
4abf37
 gdm_custom_conf = (get_option('custom-conf') != '')? get_option('custom-conf') : gdmconfdir / 'custom.conf'
4abf37
 gnome_settings_daemon_dir = (get_option('gnome-settings-daemon-dir') != '')? get_option('gnome-settings-daemon-dir') : gdm_prefix / get_option('libexecdir')
4abf37
 gdm_run_dir = (get_option('run-dir') != '')? get_option('run-dir') : gdm_prefix / get_option('localstatedir') / 'run' / 'gdm'
4abf37
 gdm_runtime_conf = (get_option('runtime-conf') != '')? get_option('runtime-conf') : gdm_run_dir / 'custom.conf'
4abf37
 gdm_pid_file = (get_option('pid-file') != '')? get_option('pid-file') : gdm_run_dir / 'gdm.pid'
4abf37
 ran_once_marker_dir = (get_option('ran-once-marker-dir') != '')? get_option('ran-once-marker-dir') : gdm_run_dir
4abf37
 working_dir = (get_option('working-dir') != '')? get_option('working-dir') : gdm_prefix / get_option('localstatedir') / 'lib' / 'gdm'
4abf37
 gdm_xauth_dir = (get_option('xauth-dir') != '')? get_option('xauth-dir') : gdm_run_dir
4abf37
 gdm_screenshot_dir = (get_option('screenshot-dir') != '')? get_option('screenshot-dir') : gdm_run_dir / 'greeter'
4abf37
 
4abf37
 # Common variables
4abf37
 config_h_dir = include_directories('.')
4abf37
 
4abf37
 # Dependencies
4abf37
 udev_dep = dependency('udev')
4abf37
 
4abf37
 glib_min_version = '2.56.0'
4abf37
 
4abf37
 glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
4abf37
-- 
4abf37
2.31.1
4abf37