Skip to contentSkip to conversation

package/x11r7/xserver_xorg-server: Fix ARM build

PATCH New Thomas Preston 5 participants 14 messages Nov 11, 2019 – Nov 17, 2019 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

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.

---
 ...-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
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +32 -0
new file mode 100644
index 0000000000..f1b27d7484
@@ -0,0 +1,32 @@
+From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
+From: Ross Burton <[email protected]>
+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 <[email protected]>
+---
+ 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
+
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Hello Thomas,

Quoted 8 lines · On Mon, 11 Nov 2019 12:48:07 +0000 Thomas Preston…

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.

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

package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch line 4

Quoted 10 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +4 -0
new file mode 100644
index 0000000000..f1b27d7484
@@ -0,0 +1,32 @@
+From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
+From: Ross Burton <[email protected]>
+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.

package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch line 9

Quoted 5 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +5 -0
+
+musl only implements inx/outx on x86, so check for __GLIBC__ instead of
+__linux__.
+
+Signed-off-by: Ross Burton <[email protected]>

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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Hey,
Thanks for reviewing.

Quoted 9 lines · Thomas Petazzoni

Hello Thomas,

Quoted 4 lines · On Mon, 11 Nov 2019 12:48:07 +0000 Thomas Preston…

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.

Quoted 8 lines
Quoted 4 lines

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

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.

Quoted 6 lines
Quoted 6 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +0 -0
new file mode 100644
index 0000000000..f1b27d7484
@@ -0,0 +1,32 @@
Quoted 9 lines

package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch line 4

Quoted 4 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +4 -0
+From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
+From: Ross Burton <[email protected]>
+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.

Quoted 9 lines

package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch line 9

Quoted 5 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +5 -0
+
+musl only implements inx/outx on x86, so check for __GLIBC__ instead of
+__linux__.
+
+Signed-off-by: Ross Burton <[email protected]>

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.

#3 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Quoted 16 lines · Thomas Preston

Hey,
Thanks for reviewing.

Quoted 12 lines · Thomas Petazzoni

Hello Thomas,

Quoted 7 lines · On Mon, 11 Nov 2019 12:48:07 +0000 Thomas Preston…

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

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:

configs/raspberrypi3_defconfig +10 -20
index 744b16dca9..0781a124d7 100644
@@ -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
#4 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Hello Thomas,

Quoted 5 lines · On Mon, 11 Nov 2019 17:12:13 +0000 Thomas Preston…

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

Quoted 7 lines

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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#5 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Quoted 28 lines · Thomas Petazzoni

Hello Thomas,

Quoted 7 lines · On Mon, 11 Nov 2019 17:12:13 +0000 Thomas Preston…

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.

Quoted 2 lines

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.

#6 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Quoted 6 lines · On Wed, 13 Nov 2019 10:39:38 +0000 Thomas Preston…
Quoted 2 lines

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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Quoted 17 lines · Thomas Petazzoni
Quoted 6 lines · On Wed, 13 Nov 2019 10:39:38 +0000 Thomas Preston…
Quoted 2 lines

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:

Quoted 8 lines

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

#8 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

In reply to Thomas Preston

Hi Thomas?, All,

Le 13/11/2019 ? 11:39, Thomas Preston a ?crit?:

Quoted 29 lines · Thomas Petazzoni
Quoted 28 lines

Hello Thomas,

Quoted 7 lines · On Mon, 11 Nov 2019 17:12:13 +0000 Thomas Preston…

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.

Quoted 6 lines
Quoted 2 lines

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

Quoted 5 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#9 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Hello,

Quoted 2 lines · On Wed, 13 Nov 2019 12:10:34 +0100 Romain Naour <[email protected]> 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.

Quoted 6 lines

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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#10 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Hi Thomas,

Le 13/11/2019 ? 13:06, Thomas Petazzoni a ?crit?:

Quoted 15 lines

Hello,

Quoted 2 lines · On Wed, 13 Nov 2019 12:10:34 +0100 Romain Naour <[email protected]> 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.

Quoted 5 lines

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.

Quoted 8 lines
Quoted 1 line

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

Quoted 5 lines

Best regards,

Thomas

#11 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Quoted 8 lines · On Wed, 13 Nov 2019 13:32:46 +0100 Romain Naour <[email protected]> wrote:
Quoted 4 lines
$ 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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#12 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

In reply to Thomas Preston

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 <[email protected]> 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.

Quoted 3 lines

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].

Quoted 3 lines

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

Quoted 15 lines
---
 ...-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
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +0 -0
new file mode 100644
index 0000000000..f1b27d7484

package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch line 9

Quoted 9 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +9 -0
@@ -0,0 +1,32 @@
+From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
+From: Ross Burton <[email protected]>
+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 <[email protected]>

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

[Upstream: https://gitlab.freedesktop.org/xorg/xserver/commit/6a2ce6c5da9456b97683db6224f38ef3b02cce4b.patch]
Quoted 31 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +23 -0
+---
+ 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
+
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +2 -0
new file mode 100644
index 0000000000..e589147fd5
@@ -0,0 +1,60 @@
+From fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <[email protected]>

package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch line 12

Quoted 10 lines
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +10 -0
+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 <[email protected]>
+Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/840

Same here:

[Upstream: https://gitlab.freedesktop.org/xorg/xserver/commit/fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba.patch]
Quoted 38 lines
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +38 -0
+---
+ 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);
+-}
+-

package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch line 60

Quoted 10 lines
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +10 -0
+-#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

#13 lore raw

PATCH 1/1 package/x11r7/xserver_xorg-server: Fix ARM build

Hello Thomas,

and maybe better patch subject:

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

Regards,
Peter

Quoted 163 lines · Peter Seiderer

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 <[email protected]> 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.

Quoted 3 lines

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].

Quoted 3 lines

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

Quoted 15 lines
---
 ...-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
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +0 -0
new file mode 100644
index 0000000000..f1b27d7484

package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch line 9

Quoted 9 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +9 -0
@@ -0,0 +1,32 @@
+From 6a2ce6c5da9456b97683db6224f38ef3b02cce4b Mon Sep 17 00:00:00 2001
+From: Ross Burton <[email protected]>
+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 <[email protected]>

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

[Upstream: https://gitlab.freedesktop.org/xorg/xserver/commit/6a2ce6c5da9456b97683db6224f38ef3b02cce4b.patch]
Quoted 31 lines
package/x11r7/xserver_xorg-server/1.20.5/0006-compiler.h-only-use-inx-outx-on-ARM-with-glibc.patch new file +23 -0
+---
+ 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
+
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +2 -0
new file mode 100644
index 0000000000..e589147fd5
@@ -0,0 +1,60 @@
+From fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <[email protected]>

package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch line 12

Quoted 10 lines
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +10 -0
+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 <[email protected]>
+Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/840

Same here:

[Upstream: https://gitlab.freedesktop.org/xorg/xserver/commit/fe4cd0e7f5c58fa94db36326aadc1bd4e6d73eba.patch]
Quoted 38 lines
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +38 -0
+---
+ 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);
+-}
+-

package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch line 60

Quoted 10 lines
package/x11r7/xserver_xorg-server/1.20.5/0007-compiler.h-Do-not-include-sys-io.h-on-ARM-with-glibc.patch new file +10 -0
+-#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