Debian Bug report logs - #572431
busybox: add cross compilation support

version graph

Package: busybox; Maintainer for busybox is Debian Install System Team <debian-boot@lists.debian.org>; Source for busybox is src:busybox.

Reported by: Hector Oron <zumbi@debian.org>

Date: Thu, 4 Mar 2010 07:54:01 UTC

Severity: wishlist

Tags: patch

Merged with 355130, 465290, 466857

Found in versions busybox/1:1.1.3-5, busybox/1:1.14.2-2

Fixed in version busybox/1:1.19.2-1

Done: Michael Tokarev <mjt@tls.msk.ru>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#572431; Package busybox. (Thu, 04 Mar 2010 07:54:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hector Oron <zumbi@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Thu, 04 Mar 2010 07:54:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Hector Oron <zumbi@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: busybox: add cross compilation support
Date: Thu, 04 Mar 2010 08:51:08 +0100
Package: busybox
Version: 1:1.14.2-2
Severity: wishlist
Tags: patch


Hello,

Could you please consider the following patch to be able to cross compile busybox package?


diff -urN busybox-1.15.3/debian/patches/cross-compiler.patch busybox-1.15.3.foo//debian/patches/cross-compiler.patch
--- busybox-1.15.3/debian/patches/cross-compiler.patch	1970-01-01 01:00:00.000000000 +0100
+++ busybox-1.15.3.foo//debian/patches/cross-compiler.patch	2010-03-03 21:59:40.000000000 +0100
@@ -0,0 +1,14 @@
+Index: busybox-1.15.3.foo/scripts/gcc-version.sh
+===================================================================
+--- busybox-1.15.3.foo.orig/scripts/gcc-version.sh	2010-03-03 21:58:32.000000000 +0100
++++ busybox-1.15.3.foo/scripts/gcc-version.sh	2010-03-03 21:59:13.000000000 +0100
+@@ -8,5 +8,9 @@
+ 
+ compiler="$*"
+ 
++if [ x"${compiler}" == x"${DEB_HOST_GNU_TYPE}-" ]; then
++    compiler=${compiler}-gcc
++fi
++
+ MAJ_MIN=$(echo __GNUC__ __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1)
+ printf '%02d%02d\n' $MAJ_MIN
diff -urN busybox-1.15.3/debian/patches/series busybox-1.15.3.foo//debian/patches/series
--- busybox-1.15.3/debian/patches/series	2009-10-27 15:21:15.000000000 +0100
+++ busybox-1.15.3.foo//debian/patches/series	2010-03-03 21:56:18.000000000 +0100
@@ -4,3 +4,4 @@
 version.patch
 init-console.patch
 strip.patch
+cross-compiler.patch
diff -urN busybox-1.15.3/debian/rules busybox-1.15.3.foo//debian/rules
--- busybox-1.15.3/debian/rules	2010-02-11 14:07:56.000000000 +0100
+++ busybox-1.15.3.foo//debian/rules	2010-03-03 22:01:00.000000000 +0100
@@ -3,6 +3,8 @@
 SHELL := sh -e
 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
 VERSION_DEBIAN := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p')
 VERSION := $(shell echo "$(VERSION_DEBIAN)" | sed -e 's,^[^:]*:,,' -e 's,-[^-]*$$,,')
@@ -10,6 +12,10 @@
 BUILD_DIR = debian/build
 STAMPS_DIR = debian/stamps
 
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+export CROSS_COMPILE = $(DEB_HOST_GNU_TYPE)-
+endif
+
 patch: $(STAMPS_DIR)/patch
 
 $(STAMPS_DIR)/patch:

Kind regards,

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (600, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-2-686 (SMP w/2 CPU cores)
Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages busybox depends on:
ii  libc6                         2.10.2-5   Embedded GNU C Library: Shared lib

busybox recommends no packages.

busybox suggests no packages.

-- no debconf information




Merged 355130 465290 466857 572431. Request was from Miguel Figueiredo <elmig@debianpt.org> to control@bugs.debian.org. (Fri, 28 Jan 2011 21:33:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#572431; Package busybox. (Sat, 13 Aug 2011 07:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Tokarev <mjt@tls.msk.ru>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sat, 13 Aug 2011 07:09:03 GMT) Full text and rfc822 format available.

Message #12 received at 572431@bugs.debian.org (full text, mbox):

From: Michael Tokarev <mjt@tls.msk.ru>
To: Hector Oron <zumbi@debian.org>, 572431@bugs.debian.org
Subject: Re: Bug#572431: busybox: add cross compilation support
Date: Sat, 13 Aug 2011 11:04:42 +0400
04.03.2010 10:51, Hector Oron wrote:
> Package: busybox
> Version: 1:1.14.2-2
> Severity: wishlist
> Tags: patch
> 
> 
> Hello,
> 
> Could you please consider the following patch to be able to cross compile busybox package?
> 
> 
> diff -urN busybox-1.15.3/debian/patches/cross-compiler.patch busybox-1.15.3.foo//debian/patches/cross-compiler.patch
> --- busybox-1.15.3/debian/patches/cross-compiler.patch	1970-01-01 01:00:00.000000000 +0100
> +++ busybox-1.15.3.foo//debian/patches/cross-compiler.patch	2010-03-03 21:59:40.000000000 +0100
> @@ -0,0 +1,14 @@
> +Index: busybox-1.15.3.foo/scripts/gcc-version.sh
> +===================================================================
> +--- busybox-1.15.3.foo.orig/scripts/gcc-version.sh	2010-03-03 21:58:32.000000000 +0100
> ++++ busybox-1.15.3.foo/scripts/gcc-version.sh	2010-03-03 21:59:13.000000000 +0100
> +@@ -8,5 +8,9 @@
> + 
> + compiler="$*"
> + 
> ++if [ x"${compiler}" == x"${DEB_HOST_GNU_TYPE}-" ]; then
> ++    compiler=${compiler}-gcc
> ++fi

Are you sure this works as you expect?  Note the double-dash
this statement adds.

[]
> +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
> +export CROSS_COMPILE = $(DEB_HOST_GNU_TYPE)-
> +endif


Besides, can't we add something like CC=prefix-gcc to the
upstream make arguments (or to conffile), without patching
anything?

Thanks,

/mjt




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#572431; Package busybox. (Sat, 13 Aug 2011 09:06:25 GMT) Full text and rfc822 format available.

Acknowledgement sent to Hector Oron <hector.oron@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sat, 13 Aug 2011 09:06:30 GMT) Full text and rfc822 format available.

Message #17 received at 572431@bugs.debian.org (full text, mbox):

From: Hector Oron <hector.oron@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: 572431@bugs.debian.org
Subject: Re: Bug#572431: busybox: add cross compilation support
Date: Sat, 13 Aug 2011 11:03:56 +0200
Hello Michael,

2011/8/13 Michael Tokarev <mjt@tls.msk.ru>:
> 04.03.2010 10:51, Hector Oron wrote:

> Besides, can't we add something like CC=prefix-gcc to the
> upstream make arguments (or to conffile), without patching
> anything?

No need to add upstream changes, on current version I have tested this
patch and it worked for me:

--- busybox-1.18.5/debian/changelog     2011-07-25 14:25:33.000000000 +0100
+++ busybox-1.18.5/debian/changelog     2011-08-13 09:55:28.000000000 +0100
@@ -1,3 +1,9 @@
+busybox (1:1.18.5-2) UNRELEASED; urgency=low
+
+  * enable cross compilation support (Closes: #572431)
+
+ -- Hector Oron <zumbi@debian.org>  Sat, 13 Aug 2011 09:54:39 +0100
+
 busybox (1:1.18.5-1) unstable; urgency=low

   [ Loïc Minier ]
diff -Nru busybox-1.18.5/debian/rules busybox-1.18.5/debian/rules
--- busybox-1.18.5/debian/rules 2011-04-26 20:38:10.000000000 +0100
+++ busybox-1.18.5/debian/rules 2011-08-13 09:51:40.000000000 +0100
@@ -2,6 +2,8 @@

 SHELL := sh -e
 DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
 VERSION_DEBIAN := $(shell dpkg-parsechangelog | sed -ne 's,^Version:
*\(.*\)$$,\1,p')
 VERSION := $(shell echo "$(VERSION_DEBIAN)" | sed -e 's,^[^:]*:,,' -e
's,-[^-]*$$,,')
@@ -10,6 +12,10 @@
 BUILD_DIR = debian/build
 STAMPS_DIR = debian/stamps

+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+export CROSS_COMPILE = $(DEB_HOST_GNU_TYPE)-
+endif
+
 $(STAMPS_DIR)/dir:
        mkdir -p $(STAMPS_DIR)
        touch $@


After running on x86 system:
$ dpkg-buildpackage -aarmel -us -uc -rfakeroot

I can see
$ file debian/busybox/bin/busybox
debian/busybox/bin/busybox: ELF 32-bit LSB executable, ARM, version 1
(SYSV), dynamically linked (uses shared libs), stripped

and of course
$ dcmd ls -1 ../busybox_1.18.5-2_armel.changes
../busybox_1.18.5-2_armel.changes
../busybox_1.18.5-2_armel.deb
../busybox_1.18.5-2.debian.tar.gz
../busybox_1.18.5-2.dsc
../busybox-static_1.18.5-2_armel.deb
../busybox-syslogd_1.18.5-2_all.deb
../busybox-udeb_1.18.5-2_armel.udeb
../udhcpc_1.18.5-2_all.deb
../udhcpd_1.18.5-2_all.deb

Best regards,
-- 
 Héctor Orón  -.. . -... .. .- -.   -.. . ...- . .-.. --- .--. . .-.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#572431; Package busybox. (Sat, 13 Aug 2011 09:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Tokarev <mjt@tls.msk.ru>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sat, 13 Aug 2011 09:27:07 GMT) Full text and rfc822 format available.

Message #22 received at 572431@bugs.debian.org (full text, mbox):

From: Michael Tokarev <mjt@tls.msk.ru>
To: Hector Oron <hector.oron@gmail.com>
Cc: 572431@bugs.debian.org
Subject: Re: Bug#572431: busybox: add cross compilation support
Date: Sat, 13 Aug 2011 13:24:58 +0400
tags 572431 + pending
thanks

13.08.2011 13:03, Hector Oron wrote:
> Hello Michael,
> 
> 2011/8/13 Michael Tokarev <mjt@tls.msk.ru>:
>> 04.03.2010 10:51, Hector Oron wrote:
> 
>> Besides, can't we add something like CC=prefix-gcc to the
>> upstream make arguments (or to conffile), without patching
>> anything?
> 
> No need to add upstream changes, on current version I have tested this
> patch and it worked for me:

I committed this into master branch, after veryfiying it still
works on 32bit x86 userspace and 64bit kernel.. ;)  Thank you!

This will close 3 bugs (merged), oldest is #355130 from Mar 2006.

/mjt




Added tag(s) pending. Request was from Michael Tokarev <mjt@tls.msk.ru> to control@bugs.debian.org. (Sat, 13 Aug 2011 09:27:23 GMT) Full text and rfc822 format available.

Reply sent to Michael Tokarev <mjt@tls.msk.ru>:
You have taken responsibility. (Sat, 22 Oct 2011 12:51:13 GMT) Full text and rfc822 format available.

Notification sent to Hector Oron <zumbi@debian.org>:
Bug acknowledged by developer. (Sat, 22 Oct 2011 12:51:19 GMT) Full text and rfc822 format available.

Message #29 received at 572431-close@bugs.debian.org (full text, mbox):

From: Michael Tokarev <mjt@tls.msk.ru>
To: 572431-close@bugs.debian.org
Subject: Bug#572431: fixed in busybox 1:1.19.2-1
Date: Sat, 22 Oct 2011 12:47:42 +0000
Source: busybox
Source-Version: 1:1.19.2-1

We believe that the bug you reported is fixed in the latest version of
busybox, which is due to be installed in the Debian FTP archive:

busybox-static_1.19.2-1_i386.deb
  to main/b/busybox/busybox-static_1.19.2-1_i386.deb
busybox-syslogd_1.19.2-1_all.deb
  to main/b/busybox/busybox-syslogd_1.19.2-1_all.deb
busybox-udeb_1.19.2-1_i386.udeb
  to main/b/busybox/busybox-udeb_1.19.2-1_i386.udeb
busybox_1.19.2-1.debian.tar.gz
  to main/b/busybox/busybox_1.19.2-1.debian.tar.gz
busybox_1.19.2-1.dsc
  to main/b/busybox/busybox_1.19.2-1.dsc
busybox_1.19.2-1_i386.deb
  to main/b/busybox/busybox_1.19.2-1_i386.deb
busybox_1.19.2.orig.tar.bz2
  to main/b/busybox/busybox_1.19.2.orig.tar.bz2
udhcpc_1.19.2-1_all.deb
  to main/b/busybox/udhcpc_1.19.2-1_all.deb
udhcpd_1.19.2-1_all.deb
  to main/b/busybox/udhcpd_1.19.2-1_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 572431@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Tokarev <mjt@tls.msk.ru> (supplier of updated busybox package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 22 Oct 2011 16:02:37 +0400
Source: busybox
Binary: busybox busybox-static busybox-udeb busybox-syslogd udhcpc udhcpd
Architecture: source all i386
Version: 1:1.19.2-1
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Michael Tokarev <mjt@tls.msk.ru>
Description: 
 busybox    - Tiny utilities for small and embedded systems
 busybox-static - Standalone rescue shell with tons of builtin utilities
 busybox-syslogd - Provides syslogd and klogd using busybox
 busybox-udeb - Tiny utilities for the debian-installer (udeb)
 udhcpc     - Provides the busybox DHCP client implementation
 udhcpd     - Provides the busybox DHCP server implementation
Closes: 572431
Changes: 
 busybox (1:1.19.2-1) unstable; urgency=low
 .
   [ Hector Oron ]
   * enable cross compilation support (Closes: #572431)
 .
   [ Michael Tokarev ]
   * new upstream release (1.19.2):
    * refreshed all patches, except:
      o applets-fallback: disabled, will try to get rid of it
      o udhcpc-emit-correct-secs-field: applied upstream
      o dirname-basename-skip-doubledash: different version applied upstream
    * refreshed configs, not enabling most new applets
   * debian/rules:
    o get rid of debian/stamps subdir and long dirnames in debian/build
    o clean up old tarball-related stuff from debian/rules
Checksums-Sha1: 
 543305e8a3cdb8ed230d85cb95ed74adfd26e693 1576 busybox_1.19.2-1.dsc
 6dedaa62af98a8541901a30c3e400ce9e077ee16 2168055 busybox_1.19.2.orig.tar.bz2
 e5ebe20bc70ae25ef73267f6af05aecf61ae45ec 41522 busybox_1.19.2-1.debian.tar.gz
 e43868822eee079ca2a3931e87a87e7b64751cd6 13636 udhcpc_1.19.2-1_all.deb
 3eb8e343261d02e8242c9e8dccafb9fbe316fb22 16930 udhcpd_1.19.2-1_all.deb
 d758baa6a0c856153d4cf2809d369ac9070d40f7 15968 busybox-syslogd_1.19.2-1_all.deb
 36ae5b72dd6ec797106a644d5927fef5d477202f 779734 busybox-static_1.19.2-1_i386.deb
 e4f78289490315926573eb5c4c4b922101b6c252 339884 busybox_1.19.2-1_i386.deb
 7ff5067ab304350aa78d1efff9ea9310f0edcf23 165500 busybox-udeb_1.19.2-1_i386.udeb
Checksums-Sha256: 
 ce8146f105e6303aef053b1f7dc4e74689025878d6744cd56c351bd646253d46 1576 busybox_1.19.2-1.dsc
 ea7ec9b6df70b8c528f4a2b6300e9913431c7223308fb08dfafa7508d75a0cb9 2168055 busybox_1.19.2.orig.tar.bz2
 19d3880aed174405a858b233be9dbd5eb548ede07ece472c0552bab1412e2608 41522 busybox_1.19.2-1.debian.tar.gz
 1544674a47b8ddb6887fc304231411d8dca6ea39857d3f405433d963ba60636a 13636 udhcpc_1.19.2-1_all.deb
 b111a8527508884c2d67b24419a59c647657b5a5c07ee6cf521741a68a5da9c1 16930 udhcpd_1.19.2-1_all.deb
 49be173bfdd6799cdc1af9d08071297ef93f3e1a827451bcfc6bfca8bc4c5325 15968 busybox-syslogd_1.19.2-1_all.deb
 d8abbb1a3ecda9830df4b1616aa65eb072ce9ae6bb610f15813958f329596d25 779734 busybox-static_1.19.2-1_i386.deb
 8e39d04352767b1521e096f468b8eb67a6ea1657494193af988712d4970f4b90 339884 busybox_1.19.2-1_i386.deb
 3be942f73637106b37e6f1946be9c5dfaf04126ed1445667f6d2aa9626d78f08 165500 busybox-udeb_1.19.2-1_i386.udeb
Files: 
 5c3e38915d541e2a3e6da6953a3989ec 1576 utils optional busybox_1.19.2-1.dsc
 50267054345f1a0b77fe65f6e0e5ba29 2168055 utils optional busybox_1.19.2.orig.tar.bz2
 c1f9ed75eef865e8971ff7f09fe1279d 41522 utils optional busybox_1.19.2-1.debian.tar.gz
 730953a45d6ea5fe2aaf230992c48c8e 13636 net optional udhcpc_1.19.2-1_all.deb
 9f029a0c6a251a614b4fc6359adb94d4 16930 net optional udhcpd_1.19.2-1_all.deb
 4fa055fd32db745836a67186d60e40ff 15968 utils optional busybox-syslogd_1.19.2-1_all.deb
 52b3e1584c3e4e19ee44ceb80eaeb39d 779734 shells extra busybox-static_1.19.2-1_i386.deb
 ef27bb98399a6d15a596924fc7368d11 339884 utils optional busybox_1.19.2-1_i386.deb
 89ac63ca6b8193a0103582c3ecff42c6 165500 debian-installer extra busybox-udeb_1.19.2-1_i386.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iJwEAQECAAYFAk6iuH8ACgkQUlPFrXTwyDiQcgQAjhmO6jsQ5NSDX9plwe3T/XQT
1XrzZOR6RJxUhNx6PdtFe2Qqtki0j9AT1iuiF60ejBJoLZCB6q5y68sILuwUuhF6
uLzT/iwFdGYzFk7KmejyYTdu1kTr8ntyHQKuzUSw4k/nxGMQvOyRO+EjBZfy7H0N
Ey/FU3RBeEwa/UlwvFI=
=UBxe
-----END PGP SIGNATURE-----





Reply sent to Michael Tokarev <mjt@tls.msk.ru>:
You have taken responsibility. (Sat, 22 Oct 2011 12:51:24 GMT) Full text and rfc822 format available.

Notification sent to Pjotr Kourzanov <peter.kourzanov@xs4all.nl>:
Bug acknowledged by developer. (Sat, 22 Oct 2011 12:51:29 GMT) Full text and rfc822 format available.

Reply sent to Michael Tokarev <mjt@tls.msk.ru>:
You have taken responsibility. (Sat, 22 Oct 2011 12:51:36 GMT) Full text and rfc822 format available.

Notification sent to Neil Williams <codehelp@debian.org>:
Bug acknowledged by developer. (Sat, 22 Oct 2011 12:51:39 GMT) Full text and rfc822 format available.

Reply sent to Michael Tokarev <mjt@tls.msk.ru>:
You have taken responsibility. (Sat, 22 Oct 2011 12:51:46 GMT) Full text and rfc822 format available.

Notification sent to Neil Williams <codehelp@debian.org>:
Bug acknowledged by developer. (Sat, 22 Oct 2011 12:51:48 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 20 Nov 2011 07:34:35 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 20:41:31 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.