diff mbox series

package/x11r7/xserver_xorg-server: Fix ARM build

Message ID 20191111124807.1151582-1-thomas.preston@codethink.co.uk
State Superseded
Headers show
Series package/x11r7/xserver_xorg-server: Fix ARM build | expand

Commit Message

Thomas Preston Nov. 11, 2019, 12:48 p.m. UTC
The ARM sys/io.h has been removed from upstream glibc, which is in
buildroot. This causes the xorg-server build to fail on ARM when using
the glibc toolchain.

The following patches from upstream xserver fix this, but have not yet
been released.

Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
---
 ...-only-use-inx-outx-on-ARM-with-glibc.patch | 32 ++++++++++
 ...t-include-sys-io.h-on-ARM-with-glibc.patch | 60 +++++++++++++++++++
 2 files changed, 92 insertions(+)
 create mode 100644 package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
 create mode 100644 package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch

Comments

Thomas Petazzoni Nov. 11, 2019, 2:36 p.m. UTC | #1
Hello Thomas,

On Mon, 11 Nov 2019 12:48:07 +0000
Thomas Preston <thomas.preston@codethink.co.uk> wrote:

> The ARM sys/io.h has been removed from upstream glibc, which is in
> buildroot. This causes the xorg-server build to fail on ARM when using
> the glibc toolchain.
> 
> The following patches from upstream xserver fix this, but have not yet
> been released.
> 
> Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>

Do we have any autobuilder failures for this? From a quick look, I
don't see any. So the question is: why?

> diff --git a/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
> new file mode 100644
> index 0000000000..f1b27d7484
> --- /dev/null
> +++ b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
> @@ -0,0 +1,32 @@
> +From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
> +From: Ross Burton <ross.burton@intel.com>
> +Date: Thu, 20 Sep 2018 13:21:34 +0100
> +Subject: [PATCH 1/2] compiler.h: only use inx/outx on ARM with glibc

Use "git format-patch -N" when generating patches, so that we don't
have the "PATCH 1/2" prefix, but just "PATCH". Indeed PATCH 1/2 for a
patch labeled 0006-something is a bit useless.

> +
> +musl only implements inx/outx on x86, so check for __GLIBC__ instead of
> +__linux__.
> +
> +Signed-off-by: Ross Burton <ross.burton@intel.com>

But this commit doesn't seem at all related to the glibc failure, it
would rather be useful to fix a build issue against the musl C library.
I also don't see such build failures in our autobuilders. Why?

Thanks,

Thomas
Thomas Preston Nov. 11, 2019, 3:06 p.m. UTC | #2
Hey,
Thanks for reviewing.

On 11/11/2019 14:36, Thomas Petazzoni wrote:
> Hello Thomas,
> 
> On Mon, 11 Nov 2019 12:48:07 +0000
> Thomas Preston <thomas.preston@codethink.co.uk> wrote:
> 
>> The ARM sys/io.h has been removed from upstream glibc, which is in
>> buildroot. This causes the xorg-server build to fail on ARM when using
>> the glibc toolchain.
>>
>> The following patches from upstream xserver fix this, but have not yet
>> been released.
>>
>> Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
> 
> Do we have any autobuilder failures for this? From a quick look, I
> don't see any. So the question is: why?
> 

I will reproduce and get back to you.

>> diff --git a/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
>> new file mode 100644
>> index 0000000000..f1b27d7484
>> --- /dev/null
>> +++ b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
>> @@ -0,0 +1,32 @@
>> +From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
>> +From: Ross Burton <ross.burton@intel.com>
>> +Date: Thu, 20 Sep 2018 13:21:34 +0100
>> +Subject: [PATCH 1/2] compiler.h: only use inx/outx on ARM with glibc
> 
> Use "git format-patch -N" when generating patches, so that we don't
> have the "PATCH 1/2" prefix, but just "PATCH". Indeed PATCH 1/2 for a
> patch labeled 0006-something is a bit useless.
> 

Noted, thanks.

>> +
>> +musl only implements inx/outx on x86, so check for __GLIBC__ instead of
>> +__linux__.
>> +
>> +Signed-off-by: Ross Burton <ross.burton@intel.com>
> 
> But this commit doesn't seem at all related to the glibc failure, it
> would rather be useful to fix a build issue against the musl C library.
> I also don't see such build failures in our autobuilders. Why?

I'm not sure about failures on musl, I included this commit is to provide
context for the next patch.

Is it normal to pull in patches in from upstream or are "buildroot patches"
specifically to fix buildroot build errors. Eg. the context patch above
doesn't fix anything for buildroot per say, just prepares the source for
the following patch.
Thomas Preston Nov. 11, 2019, 5:12 p.m. UTC | #3
On 11/11/2019 15:06, Thomas Preston wrote:
> Hey,
> Thanks for reviewing.
> 
> On 11/11/2019 14:36, Thomas Petazzoni wrote:
>> Hello Thomas,
>>
>> On Mon, 11 Nov 2019 12:48:07 +0000
>> Thomas Preston <thomas.preston@codethink.co.uk> wrote:
>>
>>> The ARM sys/io.h has been removed from upstream glibc, which is in
>>> buildroot. This causes the xorg-server build to fail on ARM when using
>>> the glibc toolchain.
>>>
>>> The following patches from upstream xserver fix this, but have not yet
>>> been released.
>>>
>>> Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
>>
>> Do we have any autobuilder failures for this? From a quick look, I
>> don't see any. So the question is: why?
>>
> 
> I will reproduce and get back to you.
> 

I can reproduce with some changes to raspberrypi3_defconfig. The
changes can be summarised as:
- Switch glibc toolchain instead of uclibc
- Enable xorg-server

I don't think there are any defconfigs (except with my changes) which
meet these conditions:

	$ git grep -l BR2_arm=y configs | xargs grep -l GLIBC | xargs grep XORG_SERVER
	configs/raspberrypi3_defconfig:BR2_PACKAGE_XSERVER_XORG_SERVER=y

So this condition is never reproduced in the autobuilder.

Here is the error:

	>>> xserver_xorg-server 1.20.5 Building
	[snip]
	In file included from lnx_init.c:33:
	../../../../hw/xfree86/common/compiler.h:767:10: fatal error: sys/io.h: No such file or directory
	 #include <sys/io.h>
          ^~~~~~~~~~
	compilation terminated.

And here are my changes to raspberrypi3_defconfig:

diff --git a/configs/raspberrypi3_defconfig b/configs/raspberrypi3_defconfig
index 744b16dca9..0781a124d7 100644
--- a/configs/raspberrypi3_defconfig
+++ b/configs/raspberrypi3_defconfig
@@ -1,37 +1,27 @@
 BR2_arm=y
 BR2_cortex_a53=y
 BR2_ARM_FPU_NEON_VFPV4=y
-
+BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
-
 BR2_SYSTEM_DHCP="eth0"
-
-# Linux headers same as kernel, a 4.19 series
-BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_19=y
-
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="--add-pi3-miniuart-bt-overlay"
 BR2_LINUX_KERNEL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
 BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,raspberrypi-kernel_1.20190819-1)/linux-raspberrypi-kernel_1.20190819-1.tar.gz"
 BR2_LINUX_KERNEL_DEFCONFIG="bcm2709"
-
-# Build the DTB from the kernel sources
 BR2_LINUX_KERNEL_DTS_SUPPORT=y
 BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2710-rpi-cm3"
-
 BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
-
+BR2_PACKAGE_XORG7=y
+BR2_PACKAGE_XSERVER_XORG_SERVER=y
 BR2_PACKAGE_RPI_FIRMWARE=y
-
-# Required tools to create the SD image
-BR2_PACKAGE_HOST_DOSFSTOOLS=y
-BR2_PACKAGE_HOST_GENIMAGE=y
-BR2_PACKAGE_HOST_MTOOLS=y
-
-# Filesystem / image
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
 BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
 # BR2_TARGET_ROOTFS_TAR is not set
-BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh"
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh"
-BR2_ROOTFS_POST_SCRIPT_ARGS="--add-pi3-miniuart-bt-overlay"
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
Peter Seiderer Nov. 12, 2019, 7:05 p.m. UTC | #4
Hello Thomas,

can confirm the build failure with your given defconfig (rpi3/glibc [5])...

On Mon, 11 Nov 2019 12:48:07 +0000, Thomas Preston <thomas.preston@codethink.co.uk> wrote:

Add the following to your commit message:

Fixes:

  In file included from lnx_init.c:33:
  ../../../../hw/xfree86/common/compiler.h:767:10: fatal error: sys/io.h: No such file or directory
   #include <sys/io.h>
          ^~~~~~~~~~
  compilation terminated.

> The ARM sys/io.h has been removed from upstream glibc, which is in
> buildroot. This causes the xorg-server build to fail on ARM when using
> the glibc toolchain.

See [1], [2].

>
> The following patches ([3], [4]) from upstream xserver fix this, but have not yet
> been released.

[1] https://sourceware.org/glibc/wiki/Release/2.30#A.3Csys.2BAC8-io.h.3E_removed_on_32-bit_Arm
[2] https://gitlab.freedesktop.org/xorg/xserver/issues/840
[3] https://gitlab.freedesktop.org/xorg/xserver/commit/6a2ce6c5da9456b97683db6224f38ef3b02cce4b
[4] https://gitlab.freedesktop.org/xorg/xserver/commit/fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba

>
> Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
> ---
>  ...-only-use-inx-outx-on-ARM-with-glibc.patch | 32 ++++++++++
>  ...t-include-sys-io.h-on-ARM-with-glibc.patch | 60 +++++++++++++++++++
>  2 files changed, 92 insertions(+)
>  create mode 100644 package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
>  create mode 100644 package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch
>
> diff --git a/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
> new file mode 100644
> index 0000000000..f1b27d7484
> --- /dev/null
> +++ b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
> @@ -0,0 +1,32 @@
> +From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
> +From: Ross Burton <ross.burton@intel.com>
> +Date: Thu, 20 Sep 2018 13:21:34 +0100
> +Subject: [PATCH 1/2] compiler.h: only use inx/outx on ARM with glibc
> +
> +musl only implements inx/outx on x86, so check for __GLIBC__ instead of
> +__linux__.
> +
> +Signed-off-by: Ross Burton <ross.burton@intel.com>

Your Signed-off-by needed here, e.g.:

[Upstream: https://gitlab.freedesktop.org/xorg/xserver/commit/6a2ce6c5da9456b97683db6224f38ef3b02cce4b.patch]
Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>

> +---
> + hw/xfree86/common/compiler.h | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
> +index 7144c6a27..fb53ced80 100644
> +--- a/hw/xfree86/common/compiler.h
> ++++ b/hw/xfree86/common/compiler.h
> +@@ -758,9 +758,9 @@ inl(unsigned short port)
> +     return xf86ReadMmio32Le((void *) ioBase, port);
> + }
> +
> +-#elif defined(__arm__) && defined(__linux__)
> ++#elif defined(__arm__) && defined(__GLIBC__)
> +
> +-/* for Linux on ARM, we use the LIBC inx/outx routines */
> ++/* for glibc on ARM, we use the LIBC inx/outx routines */
> + /* note that the appropriate setup via "ioperm" needs to be done */
> + /*  *before* any inx/outx is done. */
> +
> +--
> +2.23.0
> +
> diff --git a/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch b/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch
> new file mode 100644
> index 0000000000..e589147fd5
> --- /dev/null
> +++ b/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch
> @@ -0,0 +1,60 @@
> +From fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba Mon Sep 17 00:00:00 2001
> +From: Olivier Fourdan <ofourdan@redhat.com>
> +Date: Mon, 1 Jul 2019 13:20:39 +0200
> +Subject: [PATCH 2/2] compiler.h: Do not include sys/io.h on ARM with glibc
> +
> +<sys/io.h> on ARM hasn't worked for a long, long time, so it was removed
> +it from glibc upstream.
> +
> +Remove the include to avoid a compilation failure on ARM with glibc.
> +
> +Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
> +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/840

Same here:

[Upstream: https://gitlab.freedesktop.org/xorg/xserver/commit/fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba.patch]
Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>

> +---
> + hw/xfree86/common/compiler.h | 30 ------------------------------
> + 1 file changed, 30 deletions(-)
> +
> +diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
> +index fb53ced80..2b2008b3f 100644
> +--- a/hw/xfree86/common/compiler.h
> ++++ b/hw/xfree86/common/compiler.h
> +@@ -758,36 +758,6 @@ inl(unsigned short port)
> +     return xf86ReadMmio32Le((void *) ioBase, port);
> + }
> +
> +-#elif defined(__arm__) && defined(__GLIBC__)
> +-
> +-/* for glibc on ARM, we use the LIBC inx/outx routines */
> +-/* note that the appropriate setup via "ioperm" needs to be done */
> +-/*  *before* any inx/outx is done. */
> +-
> +-#include <sys/io.h>
> +-
> +-static __inline__ void
> +-xf_outb(unsigned short port, unsigned char val)
> +-{
> +-    outb(val, port);
> +-}
> +-
> +-static __inline__ void
> +-xf_outw(unsigned short port, unsigned short val)
> +-{
> +-    outw(val, port);
> +-}
> +-
> +-static __inline__ void
> +-xf_outl(unsigned short port, unsigned int val)
> +-{
> +-    outl(val, port);
> +-}
> +-
> +-#define outb xf_outb
> +-#define outw xf_outw
> +-#define outl xf_outl
> +-
> + #elif defined(__nds32__)
> +
> + /*
> +--
> +2.23.0
> +

And I can confirm your patch/the two upstream patches fixes the compile failure...

Regards,
Peter

[5] http://lists.busybox.net/pipermail/buildroot/2019-November/265972.html
Peter Seiderer Nov. 12, 2019, 7:20 p.m. UTC | #5
Hello Thomas,

and maybe better patch subject:

	package/xserver_xorg-server: fix arm glibc-2.30 compile

Regards,
Peter

On Tue, 12 Nov 2019 20:05:22 +0100, Peter Seiderer <ps.report@gmx.net> wrote:

> Hello Thomas,
>
> can confirm the build failure with your given defconfig (rpi3/glibc [5])...
>
> On Mon, 11 Nov 2019 12:48:07 +0000, Thomas Preston <thomas.preston@codethink.co.uk> wrote:
>
> Add the following to your commit message:
>
> Fixes:
>
>   In file included from lnx_init.c:33:
>   ../../../../hw/xfree86/common/compiler.h:767:10: fatal error: sys/io.h: No such file or directory
>    #include <sys/io.h>
>           ^~~~~~~~~~
>   compilation terminated.
>
> > The ARM sys/io.h has been removed from upstream glibc, which is in
> > buildroot. This causes the xorg-server build to fail on ARM when using
> > the glibc toolchain.
>
> See [1], [2].
>
> >
> > The following patches ([3], [4]) from upstream xserver fix this, but have not yet
> > been released.
>
> [1] https://sourceware.org/glibc/wiki/Release/2.30#A.3Csys.2BAC8-io.h.3E_removed_on_32-bit_Arm
> [2] https://gitlab.freedesktop.org/xorg/xserver/issues/840
> [3] https://gitlab.freedesktop.org/xorg/xserver/commit/6a2ce6c5da9456b97683db6224f38ef3b02cce4b
> [4] https://gitlab.freedesktop.org/xorg/xserver/commit/fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba
>
> >
> > Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
> > ---
> >  ...-only-use-inx-outx-on-ARM-with-glibc.patch | 32 ++++++++++
> >  ...t-include-sys-io.h-on-ARM-with-glibc.patch | 60 +++++++++++++++++++
> >  2 files changed, 92 insertions(+)
> >  create mode 100644 package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
> >  create mode 100644 package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch
> >
> > diff --git a/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
> > new file mode 100644
> > index 0000000000..f1b27d7484
> > --- /dev/null
> > +++ b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
> > @@ -0,0 +1,32 @@
> > +From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
> > +From: Ross Burton <ross.burton@intel.com>
> > +Date: Thu, 20 Sep 2018 13:21:34 +0100
> > +Subject: [PATCH 1/2] compiler.h: only use inx/outx on ARM with glibc
> > +
> > +musl only implements inx/outx on x86, so check for __GLIBC__ instead of
> > +__linux__.
> > +
> > +Signed-off-by: Ross Burton <ross.burton@intel.com>
>
> Your Signed-off-by needed here, e.g.:
>
> [Upstream: https://gitlab.freedesktop.org/xorg/xserver/commit/6a2ce6c5da9456b97683db6224f38ef3b02cce4b.patch]
> Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
>
> > +---
> > + hw/xfree86/common/compiler.h | 4 ++--
> > + 1 file changed, 2 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
> > +index 7144c6a27..fb53ced80 100644
> > +--- a/hw/xfree86/common/compiler.h
> > ++++ b/hw/xfree86/common/compiler.h
> > +@@ -758,9 +758,9 @@ inl(unsigned short port)
> > +     return xf86ReadMmio32Le((void *) ioBase, port);
> > + }
> > +
> > +-#elif defined(__arm__) && defined(__linux__)
> > ++#elif defined(__arm__) && defined(__GLIBC__)
> > +
> > +-/* for Linux on ARM, we use the LIBC inx/outx routines */
> > ++/* for glibc on ARM, we use the LIBC inx/outx routines */
> > + /* note that the appropriate setup via "ioperm" needs to be done */
> > + /*  *before* any inx/outx is done. */
> > +
> > +--
> > +2.23.0
> > +
> > diff --git a/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch b/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch
> > new file mode 100644
> > index 0000000000..e589147fd5
> > --- /dev/null
> > +++ b/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch
> > @@ -0,0 +1,60 @@
> > +From fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba Mon Sep 17 00:00:00 2001
> > +From: Olivier Fourdan <ofourdan@redhat.com>
> > +Date: Mon, 1 Jul 2019 13:20:39 +0200
> > +Subject: [PATCH 2/2] compiler.h: Do not include sys/io.h on ARM with glibc
> > +
> > +<sys/io.h> on ARM hasn't worked for a long, long time, so it was removed
> > +it from glibc upstream.
> > +
> > +Remove the include to avoid a compilation failure on ARM with glibc.
> > +
> > +Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
> > +Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/840
>
> Same here:
>
> [Upstream: https://gitlab.freedesktop.org/xorg/xserver/commit/fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba.patch]
> Signed-off-by: Thomas Preston <thomas.preston@codethink.co.uk>
>
> > +---
> > + hw/xfree86/common/compiler.h | 30 ------------------------------
> > + 1 file changed, 30 deletions(-)
> > +
> > +diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
> > +index fb53ced80..2b2008b3f 100644
> > +--- a/hw/xfree86/common/compiler.h
> > ++++ b/hw/xfree86/common/compiler.h
> > +@@ -758,36 +758,6 @@ inl(unsigned short port)
> > +     return xf86ReadMmio32Le((void *) ioBase, port);
> > + }
> > +
> > +-#elif defined(__arm__) && defined(__GLIBC__)
> > +-
> > +-/* for glibc on ARM, we use the LIBC inx/outx routines */
> > +-/* note that the appropriate setup via "ioperm" needs to be done */
> > +-/*  *before* any inx/outx is done. */
> > +-
> > +-#include <sys/io.h>
> > +-
> > +-static __inline__ void
> > +-xf_outb(unsigned short port, unsigned char val)
> > +-{
> > +-    outb(val, port);
> > +-}
> > +-
> > +-static __inline__ void
> > +-xf_outw(unsigned short port, unsigned short val)
> > +-{
> > +-    outw(val, port);
> > +-}
> > +-
> > +-static __inline__ void
> > +-xf_outl(unsigned short port, unsigned int val)
> > +-{
> > +-    outl(val, port);
> > +-}
> > +-
> > +-#define outb xf_outb
> > +-#define outw xf_outw
> > +-#define outl xf_outl
> > +-
> > + #elif defined(__nds32__)
> > +
> > + /*
> > +--
> > +2.23.0
> > +
>
> And I can confirm your patch/the two upstream patches fixes the compile failure...
>
> Regards,
> Peter
>
> [5] http://lists.busybox.net/pipermail/buildroot/2019-November/265972.html
Thomas Petazzoni Nov. 12, 2019, 8:24 p.m. UTC | #6
Hello Thomas,

On Mon, 11 Nov 2019 17:12:13 +0000
Thomas Preston <thomas.preston@codethink.co.uk> wrote:

> I can reproduce with some changes to raspberrypi3_defconfig. The
> changes can be summarised as:
> - Switch glibc toolchain instead of uclibc
> - Enable xorg-server
> 
> I don't think there are any defconfigs (except with my changes) which
> meet these conditions:
> 
> 	$ git grep -l BR2_arm=y configs | xargs grep -l GLIBC | xargs grep XORG_SERVER
> 	configs/raspberrypi3_defconfig:BR2_PACKAGE_XSERVER_XORG_SERVER=y
> 
> So this condition is never reproduced in the autobuilder.

The autobuilders are completely unrelated to the defconfigs.

We have two completely distinct CI mechanisms:

 (1) Gitlab CI. This one does the kind of traditional CI that most
     projects have. In the case of Buildroot, it does build the defconfigs
     and runs the runtime tests on a regular basis.

 (2) Autobuilders. These generate random configurations, and build
     those random configurations. We have a number of machines (about
     5-6 machines) that do this 24/7 and report the results at
     http://autobuild.buildroot.org. This gives a much wider testing
     coverage than building defconfigs, as our defconfigs are almost all
     minimal.

So, when I say "autobuilders", I'm referring to (2) above. And I don't
get why this sys/io.h doesn't occur in the autobuilders.

Best regards,

Thomas
Thomas Preston Nov. 13, 2019, 10:39 a.m. UTC | #7
On 12/11/2019 20:24, Thomas Petazzoni wrote:
> Hello Thomas,
> 
> On Mon, 11 Nov 2019 17:12:13 +0000
> Thomas Preston <thomas.preston@codethink.co.uk> wrote:
> 
>> I don't think there are any defconfigs (except with my changes) which
>> meet these conditions:
>>
>> 	$ git grep -l BR2_arm=y configs | xargs grep -l GLIBC | xargs grep XORG_SERVER
>> 	configs/raspberrypi3_defconfig:BR2_PACKAGE_XSERVER_XORG_SERVER=y
>>
>> So this condition is never reproduced in the autobuilder.
> 
> The autobuilders are completely unrelated to the defconfigs.
> 
> We have two completely distinct CI mechanisms:
> 
>  (1) Gitlab CI. This one does the kind of traditional CI that most
>      projects have. In the case of Buildroot, it does build the defconfigs
>      and runs the runtime tests on a regular basis.
> 
>  (2) Autobuilders. These generate random configurations, and build
>      those random configurations. We have a number of machines (about
>      5-6 machines) that do this 24/7 and report the results at
>      http://autobuild.buildroot.org. This gives a much wider testing
>      coverage than building defconfigs, as our defconfigs are almost all
>      minimal.
> 
> So, when I say "autobuilders", I'm referring to (2) above. And I don't
> get why this sys/io.h doesn't occur in the autobuilders.

Got it, thanks. Is it possible to search the autobuilder configurations for
the above case? Maybe it never came up. Or maybe it *has* been tested, just
before this bug was introduced.
Thomas Petazzoni Nov. 13, 2019, 10:51 a.m. UTC | #8
On Wed, 13 Nov 2019 10:39:38 +0000
Thomas Preston <thomas.preston@codethink.co.uk> wrote:

> > So, when I say "autobuilders", I'm referring to (2) above. And I don't
> > get why this sys/io.h doesn't occur in the autobuilders.  
> 
> Got it, thanks. Is it possible to search the autobuilder configurations for
> the above case? Maybe it never came up. Or maybe it *has* been tested, just
> before this bug was introduced.

We do have an ARM toolchain configuration that builds an internal
Buildroot toolchain with glibc:

  support/config-fragments/autobuild/br-arm-internal-glibc.config

So, I did a search with this:

  http://autobuild.buildroot.net/index.php?arch=arm&symbols%5BBR2_TOOLCHAIN_BUILDROOT_GLIBC%5D=y&symbols%5BBR2_PACKAGE_XSERVER_XORG_SERVER%5D=y

And I can see:

  http://autobuild.buildroot.net/results/b7c/b7c49525277ea1ccdd7011ab9295f6bf4050e4bb/build-end.log

which is exactly the build failure you're fixing. I'm not sure why it
didn't happen more often.

Best regards,

Thomas
Romain Naour Nov. 13, 2019, 11:10 a.m. UTC | #9
Hi Thomas², All,

Le 13/11/2019 à 11:39, Thomas Preston a écrit :
> On 12/11/2019 20:24, Thomas Petazzoni wrote:
>> Hello Thomas,
>>
>> On Mon, 11 Nov 2019 17:12:13 +0000
>> Thomas Preston <thomas.preston@codethink.co.uk> wrote:
>>
>>> I don't think there are any defconfigs (except with my changes) which
>>> meet these conditions:
>>>
>>> 	$ git grep -l BR2_arm=y configs | xargs grep -l GLIBC | xargs grep XORG_SERVER
>>> 	configs/raspberrypi3_defconfig:BR2_PACKAGE_XSERVER_XORG_SERVER=y
>>>
>>> So this condition is never reproduced in the autobuilder.
>>
>> The autobuilders are completely unrelated to the defconfigs.
>>
>> We have two completely distinct CI mechanisms:
>>
>>  (1) Gitlab CI. This one does the kind of traditional CI that most
>>      projects have. In the case of Buildroot, it does build the defconfigs
>>      and runs the runtime tests on a regular basis.
>>
>>  (2) Autobuilders. These generate random configurations, and build
>>      those random configurations. We have a number of machines (about
>>      5-6 machines) that do this 24/7 and report the results at
>>      http://autobuild.buildroot.org. This gives a much wider testing
>>      coverage than building defconfigs, as our defconfigs are almost all
>>      minimal.
>>
>> So, when I say "autobuilders", I'm referring to (2) above. And I don't
>> get why this sys/io.h doesn't occur in the autobuilders.
> 
> Got it, thanks. Is it possible to search the autobuilder configurations for
> the above case? Maybe it never came up. Or maybe it *has* been tested, just
> before this bug was introduced.

@Thomas Petazzoni: Maybe we need to rebuild the arm bleeding edge toolchain used
by the autobuilders using the current glibc version (2.30).

The current prebuilt toolchain are from 06/2019 but glibc 2.30 has been released
08/2019.

There is only one internal toolchain for arm and it use uclibc-ng by default.

Maybe we can add a new internal toolchain for glibc and musl ?

Best regards,
Romain


> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
Thomas Petazzoni Nov. 13, 2019, 12:06 p.m. UTC | #10
Hello,

On Wed, 13 Nov 2019 12:10:34 +0100
Romain Naour <romain.naour@smile.fr> wrote:

> @Thomas Petazzoni: Maybe we need to rebuild the arm bleeding edge toolchain used
> by the autobuilders using the current glibc version (2.30).

True.

> The current prebuilt toolchain are from 06/2019 but glibc 2.30 has been released
> 08/2019.
> 
> There is only one internal toolchain for arm and it use uclibc-ng by default.
> 
> Maybe we can add a new internal toolchain for glibc and musl ?

We already have these:

$ ls -1 support/config-fragments/autobuild/br-arm-internal-*
support/config-fragments/autobuild/br-arm-internal-full.config
support/config-fragments/autobuild/br-arm-internal-glibc.config
support/config-fragments/autobuild/br-arm-internal-musl.config

Best regards,

Thomas
Romain Naour Nov. 13, 2019, 12:32 p.m. UTC | #11
Hi Thomas,

Le 13/11/2019 à 13:06, Thomas Petazzoni a écrit :
> Hello,
> 
> On Wed, 13 Nov 2019 12:10:34 +0100
> Romain Naour <romain.naour@smile.fr> wrote:
> 
>> @Thomas Petazzoni: Maybe we need to rebuild the arm bleeding edge toolchain used
>> by the autobuilders using the current glibc version (2.30).
> 
> True.
> 
>> The current prebuilt toolchain are from 06/2019 but glibc 2.30 has been released
>> 08/2019.
>>
>> There is only one internal toolchain for arm and it use uclibc-ng by default.
>>
>> Maybe we can add a new internal toolchain for glibc and musl ?
> 
> We already have these:
> 
> $ ls -1 support/config-fragments/autobuild/br-arm-internal-*
> support/config-fragments/autobuild/br-arm-internal-full.config
> support/config-fragments/autobuild/br-arm-internal-glibc.config
> support/config-fragments/autobuild/br-arm-internal-musl.config

Ok good, so the list here [1] is outdated.

[1] http://autobuild.buildroot.org/toolchains/configs/

Best regards,
Romain


> 
> Best regards,
> 
> Thomas
>
Thomas Petazzoni Nov. 13, 2019, 12:39 p.m. UTC | #12
On Wed, 13 Nov 2019 13:32:46 +0100
Romain Naour <romain.naour@smile.fr> wrote:

> > $ ls -1 support/config-fragments/autobuild/br-arm-internal-*
> > support/config-fragments/autobuild/br-arm-internal-full.config
> > support/config-fragments/autobuild/br-arm-internal-glibc.config
> > support/config-fragments/autobuild/br-arm-internal-musl.config  
> 
> Ok good, so the list here [1] is outdated.
> 
> [1] http://autobuild.buildroot.org/toolchains/configs/

This list is completely unused. It was kept only during the transition
period, for autobuilders that were still using the old way of
generating the configuration.

I can get rid of them, since nothing should use them nowadays.

Thomas
Arnout Vandecappelle Nov. 17, 2019, 5:08 p.m. UTC | #13
On 13/11/2019 11:51, Thomas Petazzoni wrote:
> On Wed, 13 Nov 2019 10:39:38 +0000
> Thomas Preston <thomas.preston@codethink.co.uk> wrote:
> 
>>> So, when I say "autobuilders", I'm referring to (2) above. And I don't
>>> get why this sys/io.h doesn't occur in the autobuilders.  
>>
>> Got it, thanks. Is it possible to search the autobuilder configurations for
>> the above case? Maybe it never came up. Or maybe it *has* been tested, just
>> before this bug was introduced.
> 
> We do have an ARM toolchain configuration that builds an internal
> Buildroot toolchain with glibc:
> 
>   support/config-fragments/autobuild/br-arm-internal-glibc.config
> 
> So, I did a search with this:
> 
>   http://autobuild.buildroot.net/index.php?arch=arm&symbols%5BBR2_TOOLCHAIN_BUILDROOT_GLIBC%5D=y&symbols%5BBR2_PACKAGE_XSERVER_XORG_SERVER%5D=y
> 
> And I can see:
> 
>   http://autobuild.buildroot.net/results/b7c/b7c49525277ea1ccdd7011ab9295f6bf4050e4bb/build-end.log
> 
> which is exactly the build failure you're fixing. I'm not sure why it
> didn't happen more often.

 The X packages don't get built that often. Each package has about a 10% chance
of being built, the but X packages depend on BR2_PACKAGE_XORG7, so that's 1%...

 We should probably explictly set XORG7 more often in genrandconfig to get
better exposure of everything X related.

 BTW I verified the above assumptions by doing more queries of the database, and
it works out:

http://autobuild.buildroot.net/index.php?arch=arm&symbols%5BBR2_TOOLCHAIN_BUILDROOT_GLIBC%5D=y&symbols%5BBR2_PACKAGE_XSERVER_XORG_SERVER%5D=y
http://autobuild.buildroot.net/index.php?arch=arm&symbols[BR2_TOOLCHAIN_BUILDROOT_GLIBC]=y



 Regards,
 Arnout
diff mbox series

Patch

diff --git a/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
new file mode 100644
index 0000000000..f1b27d7484
--- /dev/null
+++ b/package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch
@@ -0,0 +1,32 @@ 
+From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Thu, 20 Sep 2018 13:21:34 +0100
+Subject: [PATCH 1/2] compiler.h: only use inx/outx on ARM with glibc
+
+musl only implements inx/outx on x86, so check for __GLIBC__ instead of
+__linux__.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ hw/xfree86/common/compiler.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
+index 7144c6a27..fb53ced80 100644
+--- a/hw/xfree86/common/compiler.h
++++ b/hw/xfree86/common/compiler.h
+@@ -758,9 +758,9 @@ inl(unsigned short port)
+     return xf86ReadMmio32Le((void *) ioBase, port);
+ }
+ 
+-#elif defined(__arm__) && defined(__linux__)
++#elif defined(__arm__) && defined(__GLIBC__)
+ 
+-/* for Linux on ARM, we use the LIBC inx/outx routines */
++/* for glibc on ARM, we use the LIBC inx/outx routines */
+ /* note that the appropriate setup via "ioperm" needs to be done */
+ /*  *before* any inx/outx is done. */
+ 
+-- 
+2.23.0
+
diff --git a/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch b/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch
new file mode 100644
index 0000000000..e589147fd5
--- /dev/null
+++ b/package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch
@@ -0,0 +1,60 @@ 
+From fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Mon, 1 Jul 2019 13:20:39 +0200
+Subject: [PATCH 2/2] compiler.h: Do not include sys/io.h on ARM with glibc
+
+<sys/io.h> on ARM hasn't worked for a long, long time, so it was removed
+it from glibc upstream.
+
+Remove the include to avoid a compilation failure on ARM with glibc.
+
+Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/840
+---
+ hw/xfree86/common/compiler.h | 30 ------------------------------
+ 1 file changed, 30 deletions(-)
+
+diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
+index fb53ced80..2b2008b3f 100644
+--- a/hw/xfree86/common/compiler.h
++++ b/hw/xfree86/common/compiler.h
+@@ -758,36 +758,6 @@ inl(unsigned short port)
+     return xf86ReadMmio32Le((void *) ioBase, port);
+ }
+ 
+-#elif defined(__arm__) && defined(__GLIBC__)
+-
+-/* for glibc on ARM, we use the LIBC inx/outx routines */
+-/* note that the appropriate setup via "ioperm" needs to be done */
+-/*  *before* any inx/outx is done. */
+-
+-#include <sys/io.h>
+-
+-static __inline__ void
+-xf_outb(unsigned short port, unsigned char val)
+-{
+-    outb(val, port);
+-}
+-
+-static __inline__ void
+-xf_outw(unsigned short port, unsigned short val)
+-{
+-    outw(val, port);
+-}
+-
+-static __inline__ void
+-xf_outl(unsigned short port, unsigned int val)
+-{
+-    outl(val, port);
+-}
+-
+-#define outb xf_outb
+-#define outw xf_outw
+-#define outl xf_outl
+-
+ #elif defined(__nds32__)
+ 
+ /*
+-- 
+2.23.0
+