Discussion:
Patch for glibc 2.25+ in xserver config/udev.c
Manoj Gupta
2018-11-12 21:48:34 UTC
Permalink
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 <***@chromium.org>
---
config/udev.c | 5 +++++
1 file changed, 5 insertions(+)

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"
_______________________________________________
xorg-***@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://l
Adam Jackson
2018-11-13 16:14:53 UTC
Permalink
Post by Manoj Gupta
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/
Post by Manoj Gupta
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...
Post by Manoj Gupta
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
... the above will see the macrod as defined.

- ajax

_______________________________________________
xorg-***@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org
Manoj Gupta
2018-11-13 19:35:25 UTC
Permalink
Thanks,

updated the patch to modify dix-config.h.in.

[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 <***@chromium.org>
---
config/udev.c | 4 ++++
include/dix-config.h.in | 3 +++
2 files changed, 7 insertions(+)

diff --git a/config/udev.c b/config/udev.c
index 8c6c4b666..314acba6c 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -39,6 +39,10 @@
#include "globals.h"
#include "systemd-logind.h"

+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
+
#define UDEV_XKB_PROP_KEY "xkb"

#define LOG_PROPERTY(path, prop, val) \
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 3bd22b8bb..855b3d50c 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -506,4 +506,7 @@
/* Have epoll_create1() */
#undef HAVE_EPOLL_CREATE1

+/* Have <sys/sysmacros.h> header */
+#undef HAVE_SYS_SYSMACROS_H
+
#endif /* _DIX_CONFIG_H_ */
--
Post by Adam Jackson
Post by Manoj Gupta
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
https://gitlab.freedesktop.org/xorg/xserver/
Post by Manoj Gupta
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...
Post by Manoj Gupta
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
... the above will see the macrod as defined.
- ajax
_______________________________________________
xorg-***@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info
Manoj Gupta
2018-11-28 04:12:05 UTC
Permalink
Hello all,

if there are no objections to this patch, can someone merge it?

Thanks,
Manoj
Post by Manoj Gupta
Thanks,
updated the patch to modify dix-config.h.in.
[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
---
config/udev.c | 4 ++++
include/dix-config.h.in | 3 +++
2 files changed, 7 insertions(+)
diff --git a/config/udev.c b/config/udev.c
index 8c6c4b666..314acba6c 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -39,6 +39,10 @@
#include "globals.h"
#include "systemd-logind.h"
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
+
#define UDEV_XKB_PROP_KEY "xkb"
#define LOG_PROPERTY(path, prop, val) \
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 3bd22b8bb..855b3d50c 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -506,4 +506,7 @@
/* Have epoll_create1() */
#undef HAVE_EPOLL_CREATE1
+/* Have <sys/sysmacros.h> header */
+#undef HAVE_SYS_SYSMACROS_H
+
#endif /* _DIX_CONFIG_H_ */
--
Post by Adam Jackson
Post by Manoj Gupta
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
https://gitlab.freedesktop.org/xorg/xserver/
Post by Manoj Gupta
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...
Post by Manoj Gupta
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
... the above will see the macrod as defined.
- ajax
_______________________________________________
xorg-***@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists
Michel Dänzer
2018-11-28 08:49:00 UTC
Permalink
Post by Manoj Gupta
Hello all,
if there are no objections to this patch, can someone merge it?
Adam merged it last week:

https://gitlab.freedesktop.org/xorg/xserver/commit/82f8cf8990009f6cac567814dd6b7fd41cfad82d
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
xorg-***@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailma
Manoj Gupta
2018-11-28 15:48:55 UTC
Permalink
great, thanks for the info.
Post by Michel Dänzer
Post by Manoj Gupta
Hello all,
if there are no objections to this patch, can someone merge it?
https://gitlab.freedesktop.org/xorg/xserver/commit/82f8cf8990009f6cac567814dd6b7fd41cfad82d
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
xorg-***@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.

Loading...