On 23.07.2010 19:07, Jim Heck wrote:
Package: binutils
Version: 2.20.1-11
Severity: wishlist
Tags: patch

Here is a simple patch for your consideration that modifies the rules
makefile for the binutils package to allow an option to build statically
when creating a cross compiler by passing the environment variable
'BUILD_STATIC=yes' on the command line to dpkg-buildpackage.

The rationale for providing the ability to compile a statically linked
binutils is to allow greater portability of that toolchain to
environments other than the stock Debian environment in which the
toolchain was built.  This becomes especially interesting in the
embedded world where cross compilers (such as ones that can be created in
Debian) have long lifetimes and can be deployed to varied buildserver
enviroments to support cross compiling software for target embedded systems.
It removes the dependence on such things as having the exact correct version
of GLIBC (and other libraries) installed on the buildserver and makes
the toolchain standalone.  A static toolchain also provides the ultimate
in repeatablilty, since it does not depend on dynamically loadable modules
that can change on the build system.

The patch required a simple change to allow an intermediate build target that
performs a make on the target 'configure-host' prior to doing the full
make with the additional LDFLAGS="-all-static", which gets passed to
libtool to create static binaries.  Without the intermediate target,
configuration would fail when it tries to test gcc and passes the
unknown -all-static flag to gcc.

I have tested this patch by using dpkg-buildpackage to build binutils
version 2.20.51.20100710-2.  The resulting binaries were not dynamic.
The resulting binutils package was then used to compile gcc-4.4-4.4.4-7 (for
which am am submitting a similar patch).

this looks ok, but please could you consider passing a string within DEB_BUILD_OPTIONS, e.g cross-static?

  Matthias



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to