mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
package/mupdf: disable objcopy
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 and xtensa: 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 - http://autobuild.buildroot.net/results/0945f305d31530677282f38fa7c99af5295d47bd Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
committed by
Arnout Vandecappelle (Essensium/Mind)
parent
3c2245cb65
commit
cf8900b063
@@ -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
|
||||||
|
|
||||||
@@ -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
|
|
||||||
|
|
||||||
@@ -52,25 +52,28 @@ MUPDF_MAKE_ENV = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
|
|||||||
XLIBS="$(MUPDF_LDFLAGS)" \
|
XLIBS="$(MUPDF_LDFLAGS)" \
|
||||||
USE_SYSTEM_LIBS=yes
|
USE_SYSTEM_LIBS=yes
|
||||||
|
|
||||||
|
MUPDF_MAKE_OPTS = \
|
||||||
|
HAVE_OBJCOPY=no \
|
||||||
|
prefix="/usr"
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_LIBFREEGLUT),y)
|
ifeq ($(BR2_PACKAGE_LIBFREEGLUT),y)
|
||||||
MUPDF_DEPENDENCIES += libfreeglut
|
MUPDF_DEPENDENCIES += libfreeglut
|
||||||
else
|
else
|
||||||
define MUPDF_DISABLE_OPENGL
|
MUPDF_MAKE_OPTS += HAVE_GLUT=no
|
||||||
sed -i 's/HAVE_GLUT := yes/HAVE_GLUT := no/g' $(@D)/Makerules
|
|
||||||
endef
|
|
||||||
MUPDF_POST_PATCH_HOOKS = MUPDF_DISABLE_OPENGL
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define MUPDF_BUILD_CMDS
|
define MUPDF_BUILD_CMDS
|
||||||
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) all
|
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) all
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define MUPDF_INSTALL_STAGING_CMDS
|
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
|
endef
|
||||||
|
|
||||||
define MUPDF_INSTALL_TARGET_CMDS
|
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
|
endef
|
||||||
|
|
||||||
$(eval $(generic-package))
|
$(eval $(generic-package))
|
||||||
|
|||||||
Reference in New Issue
Block a user