[powerpc,powerpcspe,ppc64] Fix cross-build (Closes: #903096)

- Introduce linux-bootwrapper-<abiname> package containing boot wrapper
  tools for the host architecture
- linux-image: Install symlinks to boot wrapper tools instead of the
  native tools built by kbuild
This commit is contained in:
Ben Hutchings 2018-07-07 22:04:59 +01:00
parent e57ba67647
commit b8c95ad3b9
6 changed files with 65 additions and 4 deletions

5
debian/changelog vendored
View File

@ -241,6 +241,11 @@ linux (4.17.4-1) UNRELEASED; urgency=medium
- powerpc/lib/sstep: Fix building for powerpcspe
- powerpc/lib/Makefile: Don't pull in quad.o for 32-bit kernels
- linux-perf: Disable building for powerpcspe
* [powerpc,powerpcspe,ppc64] Fix cross-build (Closes: #903096):
- Introduce linux-bootwrapper-<abiname> package containing boot wrapper
tools for the host architecture
- linux-image: Install symlinks to boot wrapper tools instead of the
native tools built by kbuild
-- Sjoerd Simons <sjoerd@debian.org> Wed, 04 Jul 2018 10:25:57 +0200

View File

@ -6,6 +6,11 @@ SUBDIRS = \
scripts \
tools
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
ifneq ($(filter powerpc powerpcspe ppc64,$(DEB_HOST_ARCH)),)
SUBDIRS += arch/powerpc/boot
endif
include $(top_rulesdir)/Makefile.inc
# Build userland headers first

View File

@ -0,0 +1,11 @@
PROGS = \
addnote \
hack-coff \
mktree
SCRIPTS = \
wrapper
include $(top_rulesdir)/Makefile.inc
CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64

37
debian/rules.real vendored
View File

@ -85,6 +85,9 @@ ifneq ($(DO_TOOLS_VERSIONED),False)
binary-arch-arch: install-perf
endif
endif
ifneq ($(filter powerpc powerpcspe ppc64,$(DEB_HOST_ARCH)),)
binary-arch-arch: install-bootwrapper
endif
endif
ifneq ($(DO_TOOLS_UNVERSIONED),False)
binary-arch-arch: install-usbip install-cpupower install-liblockdep
@ -455,10 +458,20 @@ ifneq ($(filter arm64 armel armhf,$(ARCH)),)
+$(MAKE_CLEAN) -C $(DIR) dtbs_install INSTALL_DTBS_PATH=$(CURDIR)/$(DT_INSTALL_DIR)
endif
ifneq ($(filter powerpc powerpcspe ppc64,$(ARCH)),)
# Install wrapper code and DT source, but not the wrapper script or
# the executables it calls. Kbuild will always build these executable
# as native code, which is wrong for a cross-built package. Install
# symlinks to the versions in the linux-bootwrapper package instead.
rm -rf '$(DIR)_bootwrapper'
+$(MAKE_CLEAN) -C '$(DIR)' bootwrapper_install \
WRAPPER_OBJDIR='$(CURDIR)/$(DT_INSTALL_DIR)' \
WRAPPER_DTSDIR='$(CURDIR)/$(DT_INSTALL_DIR)'/dts \
WRAPPER_BINDIR='$(CURDIR)/$(DT_INSTALL_DIR)'
WRAPPER_OBJDIR='$(CURDIR)/$(DT_INSTALL_DIR)' \
WRAPPER_DTSDIR='$(CURDIR)/$(DT_INSTALL_DIR)/dts' \
WRAPPER_BINDIR='$(CURDIR)/$(DIR)_bootwrapper'
for prog in '$(DIR)_bootwrapper'/*; do \
prog="$$(basename $$prog)"; \
ln -s ../linux-bootwrapper-$(ABINAME)/$$prog \
'$(DT_INSTALL_DIR)'/$$prog; \
done
endif
install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_bug:
@ -765,4 +778,22 @@ endif
dh_md5sums
dh_builddeb
install-bootwrapper: PACKAGE_NAME = linux-bootwrapper-$(ABINAME)
install-bootwrapper: DH_OPTIONS = -p$(PACKAGE_NAME)
install-bootwrapper: DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
install-bootwrapper: $(STAMPS_DIR)/build-tools
dh_testdir
dh_testroot
dh_prep
$(call make-tools,arch/powerpc/boot) install DESTDIR=$(DIR) installdir=/usr/lib/$(PACKAGE_NAME)
dh_installchangelogs
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
# vim: filetype=make

View File

@ -1,6 +1,6 @@
Package: linux-image-@abiname@@localversion@
Build-Profiles: <!stage1>
Depends: kmod, linux-base (>= 4.3~), ${misc:Depends}
Depends: kmod, linux-base (>= 4.3~), linux-bootwrapper-@abiname@ [powerpc powerpcspe ppc64], ${misc:Depends}
Recommends: firmware-linux-free, ${kernel:Recommends}
Suggests: linux-doc-@version@, debian-kernel-handbook
Description: Linux @upstreamversion@ for @class@

View File

@ -22,3 +22,12 @@ Description: Performance analysis tools for Linux @version@
.
The linux-base package contains a 'perf' command which will invoke the
appropriate version for the running kernel.
Package: linux-bootwrapper-@abiname@
Build-Profiles: <!stage1 !pkg.linux.notools>
Architecture: powerpc powerpcspe ppc64
Depends: ${shlibs:Depends}, ${misc:Depends}
Multi-Arch: foreign
Description: Boot wrapper tools for Linux @version@ on PowerPC
This package provides the 'wrapper' script and related tools needed
to process the Linux kernel image for use with some PowerPC platforms.