Control: tags -1 + patch

I've attached a patch implementing this change.
>From 6438b18cb788b577e721c7c03d08445b7c306bd4 Mon Sep 17 00:00:00 2001
Message-Id: <6438b18cb788b577e721c7c03d08445b7c306bd4.1619302754.git.j...@joshtriplett.org>
From: Josh Triplett <j...@joshtriplett.org>
Date: Sat, 24 Apr 2021 15:13:39 -0700
Subject: [PATCH] Provide cross-compilation versions of musl-gcc

Move the specs file to musl-dev.

Move the musl-gcc wrapper to musl-dev, name it with a target prefix, and
have it call the corresponding cross-gcc
(aarch64-linux-gnu-gcc).

Ship musl-gcc in musl-tools as a symlink to the musl-dev wrapper for the
native architecture.

This depends on the "gcc-for-host" package, currently available in
experimental, which means this version of musl will need to go to
experimental as well. Given the current freeze, a new version of the
musl package would need to go to experimental anyway. Using gcc-for-host
makes this change much more maintainable, by avoiding a long list of
architecture-specific Build-Depends.
---
 debian/control                      | 14 +++++++++-----
 debian/musl-dev.install             |  2 ++
 debian/musl-dev.lintian-overrides   |  2 ++
 debian/musl-tools.install           |  3 ---
 debian/musl-tools.links             |  1 +
 debian/musl-tools.lintian-overrides |  3 ---
 debian/rules                        | 12 +++---------
 7 files changed, 17 insertions(+), 20 deletions(-)
 delete mode 100755 debian/musl-tools.install
 delete mode 100644 debian/musl-tools.lintian-overrides

diff --git a/debian/control b/debian/control
index 4b67bb3..805a7ae 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: musl
 Section: libs
 Priority: optional
 Maintainer: Reiner Herrmann <rei...@reiner-h.de>
-Build-Depends: debhelper-compat (= 13), dh-exec
+Build-Depends: debhelper-compat (= 13), dh-exec, gcc-for-host
 Standards-Version: 4.5.1
 Homepage: https://musl.libc.org/
 Vcs-Git: https://salsa.debian.org/reiner/musl.git
@@ -25,7 +25,7 @@ Section: libdevel
 Architecture: arm64 musl-linux-arm64 armel armhf musl-linux-armhf i386 musl-linux-i386 amd64 musl-linux-amd64 m68k musl-linux-m68k mips musl-linux-mips mipsel musl-linux-mipsel mips64el musl-linux-mips64el s390x musl-linux-s390x sh4 musl-linux-sh4 ppc64el musl-linux-ppc64el riscv64 musl-linux-riscv64
 Multi-Arch: same
 Provides: ${libc-dev:Provides}
-Depends: ${misc:Depends}, musl (= ${binary:Version}), ${linux-libc-dev:Depends}
+Depends: ${misc:Depends}, musl (= ${binary:Version}), ${linux-libc-dev:Depends}, gcc-for-host
 Recommends: ${linux-musl-dev:Recommends}
 Description: standard C library development files
  musl is lightweight, fast, simple, free and strives
@@ -34,11 +34,15 @@ Description: standard C library development files
  .
  This package contains the static linked libraries
  and the include files.
+ .
+ This package also contains the specs file and gcc
+ wrapper script for cross-compilation. For the native
+ musl-gcc script, install the musl-tools package.
 
 Package: musl-tools
 Section: devel
 Architecture: arm64 armel armhf i386 amd64 m68k mips mipsel mips64el s390x sh4 ppc64el riscv64
-Depends: ${misc:Depends}, musl-dev (= ${binary:Version}), gcc
+Depends: ${misc:Depends}, musl-dev (= ${binary:Version})
 Replaces: musl (<< 1.1.15-1)
 Breaks: musl (<< 1.1.15-1)
 Description: standard C library tools
@@ -46,6 +50,6 @@ Description: standard C library tools
  to be correct in the sense of standards-conformance
  and safety.
  .
- This package contains the gcc spec file and the
- musl-gcc wrapper script to make easy-to-deploy static
+ This package contains the musl-gcc wrapper script for
+ the native architecture, to make easy-to-deploy static
  and minimal dynamically linked programs.
diff --git a/debian/musl-dev.install b/debian/musl-dev.install
index 78736e1..46eed94 100755
--- a/debian/musl-dev.install
+++ b/debian/musl-dev.install
@@ -1,4 +1,6 @@
 #! /usr/bin/dh-exec
+usr/bin/musl-gcc => usr/bin/${MUSL_TRIPLE}-gcc
 usr/lib/${MUSL_TRIPLE}/*.a
 usr/lib/${MUSL_TRIPLE}/*.o
+usr/lib/${MUSL_TRIPLE}/*.specs
 usr/include/${MUSL_TRIPLE}/*
diff --git a/debian/musl-dev.lintian-overrides b/debian/musl-dev.lintian-overrides
index a138afd..0220ab3 100644
--- a/debian/musl-dev.lintian-overrides
+++ b/debian/musl-dev.lintian-overrides
@@ -3,3 +3,5 @@
 musl-dev binary: triplet-dir-and-architecture-mismatch
 # musl needs to use its own namespace to not conflict with other libcs
 musl-dev binary: arch-dependent-file-not-in-arch-specific-directory
+# manpage for musl-gcc lives in musl-tools
+musl-dev binary: no-manual-page
diff --git a/debian/musl-tools.install b/debian/musl-tools.install
deleted file mode 100755
index 6c20dd1..0000000
--- a/debian/musl-tools.install
+++ /dev/null
@@ -1,3 +0,0 @@
-#! /usr/bin/dh-exec
-usr/bin/*
-usr/lib/${MUSL_TRIPLE}/*.specs
diff --git a/debian/musl-tools.links b/debian/musl-tools.links
index 67cde40..dc602c9 100755
--- a/debian/musl-tools.links
+++ b/debian/musl-tools.links
@@ -1,2 +1,3 @@
 #! /usr/bin/dh-exec
+/usr/bin/${MUSL_TRIPLE}-gcc /usr/bin/musl-gcc
 /lib/${MUSL_TRIPLE}/libc.so /usr/bin/musl-ldd
diff --git a/debian/musl-tools.lintian-overrides b/debian/musl-tools.lintian-overrides
deleted file mode 100644
index 6c7ca79..0000000
--- a/debian/musl-tools.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-# musl needs to use its own namespace to not conflict with other libcs
-# The installed files are the same for CPU architecture
-musl-tools binary: triplet-dir-and-architecture-mismatch
diff --git a/debian/rules b/debian/rules
index c308bc6..fc727bc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -38,15 +38,9 @@ endif
 export MUSL_ARCH
 export MUSL_TRIPLE
 
-# Cross build support
-ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
-  CC ?= cc
-else
-  CC=$(DEB_HOST_GNU_TYPE)-gcc
-  CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
-  export CROSS_COMPILE
-endif
-export CC
+CC=$(DEB_HOST_GNU_TYPE)-gcc
+CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)-
+export CROSS_COMPILE
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
-- 
2.31.1

Reply via email to