All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] package/mupdf: fix building on mips
@ 2021-09-07 12:07 Raphaël Mélotte
  2021-09-07 12:07 ` [Buildroot] [PATCH 1/2] package/x11r7/xserver_xorg-server: fix building on mips with GCC10 Raphaël Mélotte
  0 siblings, 1 reply; 5+ messages in thread
From: Raphaël Mélotte @ 2021-09-07 12:07 UTC (permalink / raw)
  To: buildroot; +Cc: Raphaël Mélotte

Hello,

This series fixes building xserver_xorg-server and mupdf on mips.

It was runtime tested on mips64el under qemu (starting X, mupdf-x11
and loading a sample PDF file).

I was unfortunately not able to do the same runtime test for any other
platform yet.

Please note that with this series building mupdf on mips produces warnings:
/home/rme/Documents/buildroot/output/host/lib/gcc/mips64el-buildroot-linux-gnu/10.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: build/release/libmupdf.a(NotoSansTaiTham-Regular.ttf.o): warning: linking abicalls files with non-abicalls files

I'm not sure what the implications are for mupdf under mips. During
the runtime test a sample PDF file was nonetheless displayed
correctly, which is still better than the currently-failing build.

Any comments or suggestions are of course welcome :-)

Kind regards,

Raphaël

Raphaël Mélotte (2):
  package/x11r7/xserver_xorg-server: fix building on mips with GCC10
  package/mupdf: fix building with some toolchains

 .../0001-use-gcc-instead-of-objcopy.patch     | 29 ++++++++
 ...-define-inb-outb-and-friends-on-mips.patch | 73 +++++++++++++++++++
 2 files changed, 102 insertions(+)
 create mode 100644 package/mupdf/0001-use-gcc-instead-of-objcopy.patch
 create mode 100644 package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch

-- 
2.32.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/2] package/x11r7/xserver_xorg-server: fix building on mips with GCC10
  2021-09-07 12:07 [Buildroot] [PATCH 0/2] package/mupdf: fix building on mips Raphaël Mélotte
@ 2021-09-07 12:07 ` Raphaël Mélotte
  2021-09-19 12:30   ` Arnout Vandecappelle
  2021-10-04 12:25   ` Peter Korsgaard
  0 siblings, 2 replies; 5+ messages in thread
From: Raphaël Mélotte @ 2021-09-07 12:07 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Raphaël Mélotte

Port the following upstream commit:
https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/591/diffs?commit_id=0148a15da1616a868d71abe1b56e3f28cc79533c

This fixes the following build error on mips with GCC10:
  CCLD     libint10.la
buildroot/output/host/lib/gcc/mips64el-buildroot-linux-gnu/10.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: .libs/helper_mem.o:(.bss+0x0): multiple definition of `IOPortBase'; .libs/helper_exec.o:(.bss+0x0): first defined here

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
---
 ...-define-inb-outb-and-friends-on-mips.patch | 73 +++++++++++++++++++
 1 file changed, 73 insertions(+)
 create mode 100644 package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch

diff --git a/package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch b/package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch
new file mode 100644
index 0000000000..469ca7e3fc
--- /dev/null
+++ b/package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch
@@ -0,0 +1,73 @@
+From de5e24b5036a1a5a877f8f30169e3497d0e296d6 Mon Sep 17 00:00:00 2001
+From: Julien Cristau <jcristau@debian.org>
+Date: Wed, 6 Jan 2021 10:20:53 +0100
+Subject: [PATCH] compiler.h: don't define inb/outb and friends on mips
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The definition relies on IOPortBase, which is only ever set in
+hw/xfree86/os-support/bsd/arm_video.c
+
+This caused build failures on linux/mips with GCC 10, due to this
+change (from https://gcc.gnu.org/gcc-10/changes.html#c):
+
+"GCC now defaults to -fno-common. As a result, global variable accesses
+are more efficient on various targets. In C, global variables with
+multiple tentative definitions now result in linker errors. With
+-fcommon such definitions are silently merged during linking."
+
+As a result anything including compiler.h would get its own definition
+of IOPortBase and the linker would error out.
+
+Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
+---
+ hw/xfree86/common/compiler.h          | 8 ++------
+ hw/xfree86/os-support/bsd/arm_video.c | 3 +++
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
+index 2b2008b3f..eb788d3fd 100644
+--- a/hw/xfree86/common/compiler.h
++++ b/hw/xfree86/common/compiler.h
+@@ -518,14 +518,10 @@ xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
+     barrier();
+ }
+ 
+-#elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__))
+-#if defined(__arm32__) || defined(__mips64)
++#elif defined(__arm32__) && !defined(__linux__)
+ #define PORT_SIZE long
+-#else
+-#define PORT_SIZE short
+-#endif
+ 
+-_X_EXPORT unsigned int IOPortBase;      /* Memory mapped I/O port area */
++extern _X_EXPORT unsigned int IOPortBase;      /* Memory mapped I/O port area */
+ 
+ static __inline__ void
+ outb(unsigned PORT_SIZE port, unsigned char val)
+diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
+index dd1020e33..180d70543 100644
+--- a/hw/xfree86/os-support/bsd/arm_video.c
++++ b/hw/xfree86/os-support/bsd/arm_video.c
+@@ -65,6 +65,7 @@
+ #include "xf86Priv.h"
+ #include "xf86_OSlib.h"
+ #include "xf86OSpriv.h"
++#include "compiler.h"
+ 
+ #if defined(__NetBSD__) && !defined(MAP_FILE)
+ #define MAP_FLAGS MAP_SHARED
+@@ -162,6 +163,8 @@ xf86DisableIO()
+ 
+ #if defined(USE_ARC_MMAP) || defined(__arm32__)
+ 
++unsigned int IOPortBase;
++
+ Bool
+ xf86EnableIO()
+ {
+-- 
+2.32.0
+
-- 
2.32.0

_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/x11r7/xserver_xorg-server: fix building on mips with GCC10
  2021-09-07 12:07 ` [Buildroot] [PATCH 1/2] package/x11r7/xserver_xorg-server: fix building on mips with GCC10 Raphaël Mélotte
@ 2021-09-19 12:30   ` Arnout Vandecappelle
  2021-10-04 12:25   ` Peter Korsgaard
  1 sibling, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2021-09-19 12:30 UTC (permalink / raw)
  To: Raphaël Mélotte, buildroot; +Cc: Bernd Kuhls



On 07/09/2021 14:07, Raphaël Mélotte wrote:
> Port the following upstream commit:
> https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/591/diffs?commit_id=0148a15da1616a868d71abe1b56e3f28cc79533c
> 
> This fixes the following build error on mips with GCC10:
>    CCLD     libint10.la
> buildroot/output/host/lib/gcc/mips64el-buildroot-linux-gnu/10.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: .libs/helper_mem.o:(.bss+0x0): multiple definition of `IOPortBase'; .libs/helper_exec.o:(.bss+0x0): first defined here
> 
> Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   ...-define-inb-outb-and-friends-on-mips.patch | 73 +++++++++++++++++++
>   1 file changed, 73 insertions(+)
>   create mode 100644 package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch
> 
> diff --git a/package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch b/package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch
> new file mode 100644
> index 0000000000..469ca7e3fc
> --- /dev/null
> +++ b/package/x11r7/xserver_xorg-server/0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch
> @@ -0,0 +1,73 @@
> +From de5e24b5036a1a5a877f8f30169e3497d0e296d6 Mon Sep 17 00:00:00 2001
> +From: Julien Cristau <jcristau@debian.org>
> +Date: Wed, 6 Jan 2021 10:20:53 +0100
> +Subject: [PATCH] compiler.h: don't define inb/outb and friends on mips
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +The definition relies on IOPortBase, which is only ever set in
> +hw/xfree86/os-support/bsd/arm_video.c
> +
> +This caused build failures on linux/mips with GCC 10, due to this
> +change (from https://gcc.gnu.org/gcc-10/changes.html#c):
> +
> +"GCC now defaults to -fno-common. As a result, global variable accesses
> +are more efficient on various targets. In C, global variables with
> +multiple tentative definitions now result in linker errors. With
> +-fcommon such definitions are silently merged during linking."
> +
> +As a result anything including compiler.h would get its own definition
> +of IOPortBase and the linker would error out.
> +
> +Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
> +---
> + hw/xfree86/common/compiler.h          | 8 ++------
> + hw/xfree86/os-support/bsd/arm_video.c | 3 +++
> + 2 files changed, 5 insertions(+), 6 deletions(-)
> +
> +diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
> +index 2b2008b3f..eb788d3fd 100644
> +--- a/hw/xfree86/common/compiler.h
> ++++ b/hw/xfree86/common/compiler.h
> +@@ -518,14 +518,10 @@ xf86WriteMmio32Le(__volatile__ void *base, const unsigned long offset,
> +     barrier();
> + }
> +
> +-#elif defined(__mips__) || (defined(__arm32__) && !defined(__linux__))
> +-#if defined(__arm32__) || defined(__mips64)
> ++#elif defined(__arm32__) && !defined(__linux__)
> + #define PORT_SIZE long
> +-#else
> +-#define PORT_SIZE short
> +-#endif
> +
> +-_X_EXPORT unsigned int IOPortBase;      /* Memory mapped I/O port area */
> ++extern _X_EXPORT unsigned int IOPortBase;      /* Memory mapped I/O port area */
> +
> + static __inline__ void
> + outb(unsigned PORT_SIZE port, unsigned char val)
> +diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
> +index dd1020e33..180d70543 100644
> +--- a/hw/xfree86/os-support/bsd/arm_video.c
> ++++ b/hw/xfree86/os-support/bsd/arm_video.c
> +@@ -65,6 +65,7 @@
> + #include "xf86Priv.h"
> + #include "xf86_OSlib.h"
> + #include "xf86OSpriv.h"
> ++#include "compiler.h"
> +
> + #if defined(__NetBSD__) && !defined(MAP_FILE)
> + #define MAP_FLAGS MAP_SHARED
> +@@ -162,6 +163,8 @@ xf86DisableIO()
> +
> + #if defined(USE_ARC_MMAP) || defined(__arm32__)
> +
> ++unsigned int IOPortBase;
> ++
> + Bool
> + xf86EnableIO()
> + {
> +--
> +2.32.0
> +
> 
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/x11r7/xserver_xorg-server: fix building on mips with GCC10
  2021-09-07 12:07 ` [Buildroot] [PATCH 1/2] package/x11r7/xserver_xorg-server: fix building on mips with GCC10 Raphaël Mélotte
  2021-09-19 12:30   ` Arnout Vandecappelle
@ 2021-10-04 12:25   ` Peter Korsgaard
  2021-10-11 18:39     ` Peter Korsgaard
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2021-10-04 12:25 UTC (permalink / raw)
  To: Raphaël Mélotte; +Cc: Bernd Kuhls, buildroot

>>>>> "Raphaël" == Raphaël Mélotte <raphael.melotte@mind.be> writes:

 > Port the following upstream commit:
 > https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/591/diffs?commit_id=0148a15da1616a868d71abe1b56e3f28cc79533c

 > This fixes the following build error on mips with GCC10:
 >   CCLD     libint10.la
 > buildroot/output/host/lib/gcc/mips64el-buildroot-linux-gnu/10.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: .libs/helper_mem.o:(.bss+0x0): multiple definition of `IOPortBase'; .libs/helper_exec.o:(.bss+0x0): first defined here

 > Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>

Committed to 2021.05.x and 2021.08.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH 1/2] package/x11r7/xserver_xorg-server: fix building on mips with GCC10
  2021-10-04 12:25   ` Peter Korsgaard
@ 2021-10-11 18:39     ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2021-10-11 18:39 UTC (permalink / raw)
  To: Raphaël Mélotte; +Cc: Bernd Kuhls, buildroot

>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

>>>>> "Raphaël" == Raphaël Mélotte <raphael.melotte@mind.be> writes:
 >> Port the following upstream commit:
 >> https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/591/diffs?commit_id=0148a15da1616a868d71abe1b56e3f28cc79533c

 >> This fixes the following build error on mips with GCC10:
 >> CCLD     libint10.la
 >> buildroot/output/host/lib/gcc/mips64el-buildroot-linux-gnu/10.3.0/../../../../mips64el-buildroot-linux-gnu/bin/ld: .libs/helper_mem.o:(.bss+0x0): multiple definition of `IOPortBase'; .libs/helper_exec.o:(.bss+0x0): first defined here

 >> Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>

 > Committed to 2021.05.x and 2021.08.x, thanks.

And 2021.02.x.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-11 18:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 12:07 [Buildroot] [PATCH 0/2] package/mupdf: fix building on mips Raphaël Mélotte
2021-09-07 12:07 ` [Buildroot] [PATCH 1/2] package/x11r7/xserver_xorg-server: fix building on mips with GCC10 Raphaël Mélotte
2021-09-19 12:30   ` Arnout Vandecappelle
2021-10-04 12:25   ` Peter Korsgaard
2021-10-11 18:39     ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.