Patch for glibc 2.25+ in xserver config/udev.c

Submitted by Manoj Gupta on Nov. 12, 2018, 9:48 p.m.

Details

Message ID CAAMbb066ZV9VOJ0SJiH3n4g0zG_Nx8u=-Y-ERH6pEtUN6WveKQ@mail.gmail.com
State New
Series "Patch for glibc 2.25+ in xserver config/udev.c"
Headers show

Commit Message

Manoj Gupta Nov. 12, 2018, 9:48 p.m.
Hi All,

I recently ran into compiler errors when building xwayland in Chrome
OS related to use of major()/minor() in config/udev.c.

The patch fixing the problem by including  "xorg-config.h"  and
<sys/sysmacros.h> .

Is this the right mailing list for this patch? If not, please advise.

Thanks,
Manoj

[PATCH]

Include header <sys/sysmacros.h> to use major/minor.

glibc 2.25 has dropped sys/sysmacros.h from sys/types.h, so add
it explicitly in config/udev.c.

This is similar to the commit 84e3b96b531363e47f6789aacfcae4aa60135e2e .

Signed-off-by: Manoj Gupta <manojgupta@chromium.org>
---
 config/udev.c | 5 +++++
 1 file changed, 5 insertions(+)

xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Patch hide | download patch | download mbox

diff --git a/config/udev.c b/config/udev.c
index 8c6c4b666..c5edc9932 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -38,6 +38,11 @@ 
 #include "os.h"
 #include "globals.h"
 #include "systemd-logind.h"
+#include "xorg-config.h"
+
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif

 #define UDEV_XKB_PROP_KEY "xkb"
_______________________________________________

Comments

Adam Jackson Nov. 13, 2018, 4:14 p.m.
On Mon, 2018-11-12 at 13:48 -0800, Manoj Gupta wrote:

> Is this the right mailing list for this patch? If not, please advise.

This is the right list, although we're generally moving to gitlab for
patch submission:

https://gitlab.freedesktop.org/xorg/xserver/

> diff --git a/config/udev.c b/config/udev.c
> index 8c6c4b666..c5edc9932 100644
> --- a/config/udev.c
> +++ b/config/udev.c
> @@ -38,6 +38,11 @@
>  #include "os.h"
>  #include "globals.h"
>  #include "systemd-logind.h"
> +#include "xorg-config.h"

This is incorrect, though an understandable mistake to make. xorg-
config.h should ideally only be included from files under hw/xfree86/,
outside of that the code is potentially built into multiple servers so
it should use dix-config.h instead.

This file already includes dix-config.h, so instead we should change
include/dix-config.h.in to also have a #undef HAVE_SYS_SYSMACROS_H so
that...

> +#ifdef HAVE_SYS_SYSMACROS_H
> +#include <sys/sysmacros.h>
> +#endif

... the above will see the macrod as defined.

- ajax