From f11d9720c48173838ad4418b2e475cb94ec1b01a Mon Sep 17 00:00:00 2001 From: jackie_wu Date: Sat, 26 Jun 2021 14:51:07 +0800 Subject: [PATCH] fix build error --- fix-glibc-update-error.patch | 34 ++++++++++++++++++++++++++++++++++ umockdev.spec | 6 +++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 fix-glibc-update-error.patch diff --git a/fix-glibc-update-error.patch b/fix-glibc-update-error.patch new file mode 100644 index 0000000..8a291d1 --- /dev/null +++ b/fix-glibc-update-error.patch @@ -0,0 +1,34 @@ +From f1b416400479d861deffb4c5a40422dcdf190e85 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Fri, 23 Oct 2020 14:58:50 +0200 + +Recent glibc deprecated/dropped the `__xstat*()` family from the header +files, so the build started to fail on "no previous prototype". However, +umockdev still needs needs to keep the wrappers to run programs that got +built against an earlier glibc. + +Thus declare the prototype explicitly. It should still fail to build if +glibc defines it differently. + +Fixes #108 +--- + src/libumockdev-preload.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/libumockdev-preload.c b/src/libumockdev-preload.c +index 9328dc1..9bbec62 100644 +--- a/src/libumockdev-preload.c ++++ b/src/libumockdev-preload.c +@@ -1215,8 +1215,11 @@ int prefix ## stat ## suffix (const char *path, struct stat ## suffix *st) \ + + /* wrapper template for __xstat family; note that we abuse the sticky bit in + * the emulated /dev to indicate a block device (the sticky bit has no +- * real functionality for device nodes) */ ++ * real functionality for device nodes) ++ * This family got deprecated/dropped in glibc 2.32.9000, but we still need ++ * to keep it for a while for programs that were built against previous versions */ + #define WRAP_VERSTAT(prefix, suffix) \ ++int prefix ## stat ## suffix (int ver, const char *path, struct stat ## suffix *st); \ + int prefix ## stat ## suffix (int ver, const char *path, struct stat ## suffix *st) \ + { \ + const char *p; \ diff --git a/umockdev.spec b/umockdev.spec index f1c51f7..2a22cc4 100644 --- a/umockdev.spec +++ b/umockdev.spec @@ -1,11 +1,12 @@ Name: umockdev Version: 0.11.3 -Release: 3 +Release: 4 Summary: Mock hardware devices License: LGPLv2+ URL: https://github.com/martinpitt/%{name} Source0: https://github.com/martinpitt/%{name}/archive/%{version}.tar.gz +Patch0000: fix-glibc-update-error.patch BuildRequires: autoconf automake libtool gtk-doc gobject-introspection-devel glib2-devel BuildRequires: libgudev1-devel systemd-devel vala chrpath python3 gphoto2 @@ -60,5 +61,8 @@ rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/umockdev %{_datadir}/vala/vapi/umockdev-1.0.vapi %changelog +* Sat Jun 26 2021 wutao - 0.11.3-4 +- fix build error due to glibc update + * Tue Jan 07 2019 yangjian - 0.11.3-3 - Package init