debian/control: Fix build-dependencies for cross-building

The current cross-compiler packages don't set the Multi-Arch field, so
specify that the cross-compiler package must be native, rather than any
architecture.

flex doesn't support multi-arch, and this would require splitting it
(#611230, #761449).  Force use of the native package for now.

openssl doesn't support multi-arch but probably easily could (#827028).
Force use of the native package for now.

We need the native libssl-dev while building the kernel itself and the
host libssl-dev while building tools for linux-kbuild.

Document the state of cross-building in README.source.
This commit is contained in:
Ben Hutchings 2016-06-12 20:45:36 +01:00
parent cc2ac0be61
commit 0aceb8739a
6 changed files with 30 additions and 9 deletions

View File

@ -233,3 +233,6 @@ Several build profiles are understood and supported:
- nodoc: Exclude most documentation
- pkg.linux.notools: Exclude userland tool packages (linux-kbuild-<version>,
linux-perf-<version>, etc.)
- cross: Needed when cross-building. Currently this must be used
together with pkg.linux.notools as not all the userland tools can be
cross-built.

View File

@ -134,6 +134,17 @@ class Gencontrol(Base):
self._setup_makeflags(self.arch_makeflags, makeflags, config_base)
try:
gnu_type_bytes = subprocess.check_output(['dpkg-architecture',
'-a', arch,
'-q', 'DEB_HOST_GNU_TYPE'],
stderr=subprocess.DEVNULL)
except subprocess.CalledProcessError:
# This sometimes happens for the newest ports :-/
print('W: Unable to get GNU type for %s' % arch, file=sys.stderr)
else:
vars['gnu-type-package'] = gnu_type_bytes.decode('utf-8').strip().replace('_', '-')
def do_arch_packages(self, packages, makefile, arch, vars, makeflags, extra):
if self.version.linux_modifier is None:
try:
@ -296,16 +307,22 @@ class Gencontrol(Base):
compiler = config_entry_base.get('compiler', 'gcc')
# Work out dependency from linux-headers to compiler. Strip
# Work out dependency from linux-headers to compiler. Drop
# dependencies for cross-builds. Strip any remaining
# restrictions, as they don't apply to binary Depends.
relations_compiler_headers = PackageRelation(
config_entry_relations.get('headers%' + compiler) or
config_entry_relations.get(compiler))
self.substitute(config_entry_relations.get('headers%' + compiler) or
config_entry_relations.get(compiler), vars))
relations_compiler_headers = PackageRelation(
PackageRelationGroup(entry for entry in group
if 'cross' not in entry.restrictions)
for group in relations_compiler_headers)
for group in relations_compiler_headers:
for entry in group:
entry.restrictions = []
relations_compiler_build_dep = PackageRelation(config_entry_relations[compiler])
relations_compiler_build_dep = PackageRelation(
self.substitute(config_entry_relations[compiler], vars))
for group in relations_compiler_build_dep:
for item in group:
item.arches = [arch]

1
debian/changelog vendored
View File

@ -16,6 +16,7 @@ linux (4.7~rc2-1~exp1) UNRELEASED; urgency=medium
userland headers
* linux-cpupower: Define PACKAGE_BUGREPORT to refer to reportbug, not upstream
* debian/README.source: Document the supported build profiles
* debian/control: Fix build-dependencies for cross-building
-- Ben Hutchings <ben@decadent.org.uk> Tue, 07 Jun 2016 19:37:55 +0100

View File

@ -59,7 +59,7 @@ initramfs-generators: initramfs-tools initramfs-fallback
[relations]
# compilers
gcc-5: gcc-5 <!stage1>
gcc-5: gcc-5 <!stage1 !cross>, gcc-5-@gnu-type-package@:native <!stage1 cross>
# initramfs-generators
initramfs-fallback: linux-initramfs-tool

View File

@ -24,5 +24,5 @@ hardware: multiprocessor 64-bit PA-RISC
hardware-long: HP PA-RISC 64-bit SMP systems with support for more than 4 GB RAM
[relations]
gcc-5: gcc-5 <!stage1>, binutils-hppa64-linux-gnu <!stage1>, gcc-5-hppa64-linux-gnu <!stage1>
gcc-5: gcc-5 <!stage1 !cross>, binutils-hppa64-linux-gnu <!stage1 !cross>, gcc-5-hppa64-linux-gnu <!stage1 !cross>, gcc-5-hppa-linux-gnu:native <!stage1 cross>, binutils-hppa64-linux-gnu:native <!stage1 cross>, gcc-5-hppa64-linux-gnu:native <!stage1 cross>

View File

@ -20,14 +20,14 @@ Build-Depends:
# used by upstream to build include/generated/timeconst.h
bc <!stage1>,
# used by upstream to build signing tools and to process certificates
libssl-dev <!stage1>,
openssl <!stage1>,
libssl-dev:native <!stage1>, libssl-dev <!stage1 !pkg.linux.notools cross>,
openssl:native <!stage1>,
# used by upstream to build perf documentation
asciidoc <!stage1 !nodoc !pkg.linux.notools>,
xmlto <!stage1 !nodoc !pkg.linux.notools>,
# used by upstream to build perf
bison <!stage1 !pkg.linux.notools>,
flex <!stage1 !pkg.linux.notools>,
flex:native <!stage1 !pkg.linux.notools>,
gcc-multilib [amd64 ppc64 s390x sparc64] <!stage1 !pkg.linux.notools>,
libaudit-dev <!stage1 !pkg.linux.notools>,
libdw-dev <!stage1 !pkg.linux.notools>,