* [Buildroot] [PATCH 1/1] package/mupdf: disable objcopy
@ 2021-11-15 17:33 Fabrice Fontaine
2021-11-16 17:20 ` Raphaël Mélotte
2021-11-17 22:46 ` Peter Korsgaard
0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2021-11-15 17:33 UTC (permalink / raw)
To: buildroot; +Cc: Raphaël Mélotte, Fabrice Fontaine
Drop fourth patch and disable objcopy as suggested by upstream in
https://bugs.ghostscript.com/show_bug.cgi?id=704442#c2
This will also fix the following build failure on sparc:
OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
/home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc64-buildroot-linux-gnu/9.3.0/../../../../sparc64-buildroot-linux-gnu/bin/ld: --relax and -r may not be used together
While at it, drop MUPDF_DISABLE_OPENGL and use the new MUPDF_MAKE_OPTS
variable
Fixes:
- http://autobuild.buildroot.org/results/e64d456174a0f701c0e0de68317debcdc429a660
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
...file-compile-hexdump.exe-with-HOSTCC.patch | 40 +++++++++++++++++
...004-Use-CC-instead-of-LD-for-OBJCOPY.patch | 43 -------------------
package/mupdf/mupdf.mk | 17 +++++---
3 files changed, 50 insertions(+), 50 deletions(-)
create mode 100644 package/mupdf/0004-Makefile-compile-hexdump.exe-with-HOSTCC.patch
delete mode 100644 package/mupdf/0004-Use-CC-instead-of-LD-for-OBJCOPY.patch
diff --git a/package/mupdf/0004-Makefile-compile-hexdump.exe-with-HOSTCC.patch b/package/mupdf/0004-Makefile-compile-hexdump.exe-with-HOSTCC.patch
new file mode 100644
index 0000000000..bc9debd332
--- /dev/null
+++ b/package/mupdf/0004-Makefile-compile-hexdump.exe-with-HOSTCC.patch
@@ -0,0 +1,40 @@
+From c0036573a995dc78d3cf60a30ff0af2b47f3680a Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 14 Nov 2021 23:24:27 +0100
+Subject: [PATCH] Makefile: compile hexdump.exe with HOSTCC
+
+hexdump.exe must be compiled for the host or the build will fail when
+cross-compiling with HAVE_OBJCOPY=no
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://bugs.ghostscript.com/show_bug.cgi?id=704442]
+---
+ Makefile | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 6492b1ca3..0732b358f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -60,6 +60,8 @@ AR_CMD = $(QUIET_AR) $(MKTGTDIR) ; $(AR) cr $@ $^
+ ifdef RANLIB
+ RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
+ endif
++HOSTCC ?= $(CC)
++HOST_LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(HOSTCC) -o $@ $^
+ LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+ TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p --exclude=platform/python --exclude=platform/c++
+ WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
+@@ -81,6 +83,9 @@ $(OUT)/%.a :
+ $(AR_CMD)
+ $(RANLIB_CMD)
+
++$(OUT)/scripts/hexdump.exe: scripts/hexdump.c
++ $(HOST_LINK_CMD)
++
+ $(OUT)/%.exe: %.c
+ $(LINK_CMD)
+
+--
+2.33.0
+
diff --git a/package/mupdf/0004-Use-CC-instead-of-LD-for-OBJCOPY.patch b/package/mupdf/0004-Use-CC-instead-of-LD-for-OBJCOPY.patch
deleted file mode 100644
index 0e0aadd29d..0000000000
--- a/package/mupdf/0004-Use-CC-instead-of-LD-for-OBJCOPY.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From da4b98447573daf77829811e95e3772e8a296934 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= <raphael.melotte@mind.be>
-Date: Thu, 2 Sep 2021 20:17:26 +0200
-Subject: [PATCH] Use CC instead of LD for OBJCOPY
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-When cross-compiling for mips targets using Buildroot, using LD for
-partial linking fails in the following way:
-/tmp/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/8.4.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: build/release/libmupdf.a(Dingbats.cff.o): ABI is incompatible with that of the selected emulation
-/tmp/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mips64el-buildroot-linux-uclibc/8.4.0/../../../../mips64el-buildroot-linux-uclibc/bin/ld: failed to merge target specific data of file build/release/libmupdf.a(Dingbats.cff.o)
-
-To fix it, use CC instead of LD for partial linking.
-
-'nostdlib' has to be added, or it will try to use GCC libraries for
-partial linking and fail with 'cannot find -lgcc_s'.
-
-Fixes:
-- http://autobuild.buildroot.net/results/156fe9ee5f6dccdc98990f6c5de5562383bc2b74
-
-Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
-[Upstream status: https://bugs.ghostscript.com/show_bug.cgi?id=704442]
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index b0fb617e2..0a8795e0e 100644
---- a/Makefile
-+++ b/Makefile
-@@ -64,7 +64,7 @@ endif
- LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
- TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p
- WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
--OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -z noexecstack -o $@ $<
-+OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(CC) -Wl,-r -Wl,-b -Wl,binary -Wl,-z -Wl,noexecstack -nostdlib -o $@ $<
-
- # --- Rules ---
-
---
-2.33.0
-
diff --git a/package/mupdf/mupdf.mk b/package/mupdf/mupdf.mk
index c9d5b4a162..56ea7cc507 100644
--- a/package/mupdf/mupdf.mk
+++ b/package/mupdf/mupdf.mk
@@ -52,25 +52,28 @@ MUPDF_MAKE_ENV = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
XLIBS="$(MUPDF_LDFLAGS)" \
USE_SYSTEM_LIBS=yes
+MUPDF_MAKE_OPTS = \
+ HAVE_OBJCOPY=no \
+ prefix="/usr"
+
ifeq ($(BR2_PACKAGE_LIBFREEGLUT),y)
MUPDF_DEPENDENCIES += libfreeglut
else
-define MUPDF_DISABLE_OPENGL
- sed -i 's/HAVE_GLUT := yes/HAVE_GLUT := no/g' $(@D)/Makerules
-endef
-MUPDF_POST_PATCH_HOOKS = MUPDF_DISABLE_OPENGL
+MUPDF_MAKE_OPTS += HAVE_GLUT=no
endif
define MUPDF_BUILD_CMDS
- $(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) all
+ $(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) all
endef
define MUPDF_INSTALL_STAGING_CMDS
- $(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(STAGING_DIR)" prefix="/usr" install_libs
+ $(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) \
+ DESTDIR="$(STAGING_DIR)" install_libs
endef
define MUPDF_INSTALL_TARGET_CMDS
- $(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" prefix="/usr" install
+ $(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) \
+ DESTDIR="$(TARGET_DIR)" install
endef
$(eval $(generic-package))
--
2.33.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/mupdf: disable objcopy
2021-11-15 17:33 [Buildroot] [PATCH 1/1] package/mupdf: disable objcopy Fabrice Fontaine
@ 2021-11-16 17:20 ` Raphaël Mélotte
2021-11-16 20:30 ` Arnout Vandecappelle
2021-11-17 22:46 ` Peter Korsgaard
1 sibling, 1 reply; 4+ messages in thread
From: Raphaël Mélotte @ 2021-11-16 17:20 UTC (permalink / raw)
To: Fabrice Fontaine, buildroot
Hello,
On 11/15/21 6:33 PM, Fabrice Fontaine wrote:
> Drop fourth patch and disable objcopy as suggested by upstream in
> https://bugs.ghostscript.com/show_bug.cgi?id=704442#c2
>
> This will also fix the following build failure on sparc:
>
> OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
> /home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc64-buildroot-linux-gnu/9.3.0/../../../../sparc64-buildroot-linux-gnu/bin/ld: --relax and -r may not be used together
Nice!
This will also fix the build for xtensa:
OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
OBJCOPY build/release/resources/fonts/urw/NimbusMonoPS-Bold.cff.o
/tmp/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/xtensa-buildroot-linux-uclibc/9.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld:
--relax and -r may not be used together
http://autobuild.buildroot.net/results/0945f305d31530677282f38fa7c99af5295d47bd
I haven't had a chance to runtime-test it, but I can confirm it builds for:
bootlin-x86-64-musl [1/6]: OK
bootlin-mipsel-uclibc [2/6]: OK
bootlin-mipsel32r6-glibc [3/6]: OK
bootlin-sparc-uclibc [4/6]: SKIPPED
bootlin-sparc64-glibc [5/6]: OK
bootlin-xtensa-uclibc [6/6]: OK
Thanks!
Raphaël
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/mupdf: disable objcopy
2021-11-16 17:20 ` Raphaël Mélotte
@ 2021-11-16 20:30 ` Arnout Vandecappelle
0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2021-11-16 20:30 UTC (permalink / raw)
To: Raphaël Mélotte, Fabrice Fontaine, buildroot
On 16/11/2021 18:20, Raphaël Mélotte wrote:
> Hello,
>
> On 11/15/21 6:33 PM, Fabrice Fontaine wrote:
>> Drop fourth patch and disable objcopy as suggested by upstream in
>> https://bugs.ghostscript.com/show_bug.cgi?id=704442#c2
>>
>> This will also fix the following build failure on sparc:
>>
>> OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
>> /home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc64-buildroot-linux-gnu/9.3.0/../../../../sparc64-buildroot-linux-gnu/bin/ld:
>> --relax and -r may not be used together
Applied to master, thanks.
>
> Nice!
>
> This will also fix the build for xtensa:
> OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
> OBJCOPY build/release/resources/fonts/urw/NimbusMonoPS-Bold.cff.o
>
> /tmp/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/xtensa-buildroot-linux-uclibc/9.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld:
> --relax and -r may not be used together
> http://autobuild.buildroot.net/results/0945f305d31530677282f38fa7c99af5295d47bd
>
>
> I haven't had a chance to runtime-test it, but I can confirm it builds for:
> bootlin-x86-64-musl [1/6]: OK
> bootlin-mipsel-uclibc [2/6]: OK
> bootlin-mipsel32r6-glibc [3/6]: OK
> bootlin-sparc-uclibc [4/6]: SKIPPED
> bootlin-sparc64-glibc [5/6]: OK
> bootlin-xtensa-uclibc [6/6]: OK
It's convenient if you can add your Tested-by and/or Reviewed-by tag. Too late
now though.
Regards,
Arnout
>
>
> Thanks!
>
> Raphaël
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/mupdf: disable objcopy
2021-11-15 17:33 [Buildroot] [PATCH 1/1] package/mupdf: disable objcopy Fabrice Fontaine
2021-11-16 17:20 ` Raphaël Mélotte
@ 2021-11-17 22:46 ` Peter Korsgaard
1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2021-11-17 22:46 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: Raphaël Mélotte, buildroot
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
> Drop fourth patch and disable objcopy as suggested by upstream in
> https://bugs.ghostscript.com/show_bug.cgi?id=704442#c2
> This will also fix the following build failure on sparc:
> OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
> /home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc64-buildroot-linux-gnu/9.3.0/../../../../sparc64-buildroot-linux-gnu/bin/ld: --relax and -r may not be used together
> While at it, drop MUPDF_DISABLE_OPENGL and use the new MUPDF_MAKE_OPTS
> variable
> Fixes:
> - http://autobuild.buildroot.org/results/e64d456174a0f701c0e0de68317debcdc429a660
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Committed to 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] 4+ messages in thread
end of thread, other threads:[~2021-11-17 22:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 17:33 [Buildroot] [PATCH 1/1] package/mupdf: disable objcopy Fabrice Fontaine
2021-11-16 17:20 ` Raphaël Mélotte
2021-11-16 20:30 ` Arnout Vandecappelle
2021-11-17 22:46 ` 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.