The diversions are gone. History. :-) To use pre2, you'll need two patches to dpkg (attached) which I am continuing to test before submitting to debian-dpkg@l.d.o. There is a third patch (changelog) that just creates a separate version so that the patched version will be replaced by the next release of dpkg. (Ignore the lintian warnings about the version string.) The patches are (almost) trivial so I'm sure I'm missing something (!) (like some corner cases involving $crossroot) but the old scripts are retained in /usr/share/dpkg-cross so bespoke implementations can still be achieved. The main changes are in dpkg-cross pre2. 1. Depends on binutils-multiarch : allows the diversions to be removed with very small (PATH and environment) changes to dpkg-dev, removing the need for all the customised objdump code used by the dpkg-shlibdeps diversion. Essentially, the dpkg-dev versions of dpkg-buildpackage and dpkg-shlibdeps work precisely as with a native build, except that the PATH and environment changes allow them to find the cross building data. 2. Older %pkgvars code and $crosstools has been circumvented. $crossroot is also not currently implemented. I'll continue to look after the /usr/share/dpkg-cross scripts but I need information on how people want to use them with $crossroot and %scope as well as exactly where and how they need to be changed. Please test with pre2 because there have been so many changes that most of the "legacy" code may not function in the same was as with dpkg-cross << 1.39. 3. When changing the dependency chain, I'm thinking that we should be able to install the $arch-cross version of our own binaries that implement the dependency changes. e.g. if libfoo depends on libbar in Debian but not in Emdebian, installing the Emdebian libfoo via dpkg-cross will provide the correct data to dpkg-shlibdeps by putting the adjusted .so in /usr/arm-linux-gnu/lib/ where the non-diverted dpkg-buildpackage will read the pkgconfig data and binutils-multiarch will be able to process the shlibdeps. Let me know if this is wrong. ;-) The emphasis of this rewrite has been a change of focus in dpkg-cross - to concentrate on the core code of preparing pkg-arch-cross and give as much of the build process back to dpkg. This means that a "default" Emdebian cross-build is as close to a Debian native build as possible, which is likely to raise new bugs in packages that may have cross-built successfully in the past. I believe that the pain of this change is worthwhile because: a) we gain significant benefits from the updates in dpkg since dpkg-cross first diverted dpkg-buildpackage and particularly dpkg-shlibdeps. b) it makes it easier for Debian developers to understand dpkg-cross if it is only PATH and $ENV{} that have changed. This makes (or should make) cross-building bugs easier to replicate and test without the concerns of diverting the dpkg scripts (which has been a cause of concern with non-crossbuilding DD's when trying to fix cross-build bugs). pre2 is now ready in CVS and I'll probably upload to Debian experimental tonight. apt-cross 0.2.9 (apt-nc-cross branch) and emdebian-tools 0.3.9 work with pre2. I may well merge the apt-nc-cross branch into trunk this week and upload apt-cross 0.2.9 +0.3.0pre1 to Debian experimental. pre2 closes all but one of the dpkg-cross bugs - the one remaining bug (#285569) relates to cross-building perl and if anyone wants to investigate that one, feel free. ;-) pre3 will complete the rewrite by migrating more functions from dpkg-cross into Debian::DpkgCross so that the final objectives of the rewrite can be achieved: 1) make the converted filenames available via the module 2) allow apt-cross to --build without forking dpkg-cross 3) allow apt-cross to provide a --simulate option for --install that dpkg-cross cannot support directly. -- Neil Williams ============= http://www.data-freedom.org/ http://www.nosoftwarepatents.com/ http://www.linux.codehelp.co.uk/
--- dpkg-1.14.5/scripts/dpkg-buildpackage.sh 2007-08-27 13:14:12.000000000 +0100 +++ dpkg.new/scripts/dpkg-buildpackage.sh 2007-08-27 13:14:49.000000000 +0100 @@ -84,6 +84,18 @@ passopts='' admindir='' +DPKGCROSSENABLE=0 +if [ -f /usr/share/dpkg-cross/buildcross ]; then + . /usr/share/dpkg-cross/buildcross + DPKGCROSSENABLE=1 +fi + +function enhance_cross { + if [ $DPKGCROSSENABLE -gt 0 ]; then + setup_cross + fi +} + while [ $# != 0 ] do value="`echo x\"$1\" | sed -e 's/x--.*=//;s/^x-.//'`" @@ -104,7 +116,7 @@ -us) signsource=: ;; -uc) signchanges=: ;; -ap) usepause="true";; - -a*) targetarch="$value"; checkbuilddep=false ;; + -a*) targetarch="$value"; checkbuilddep=false; enhance_cross ;; -si) sourcestyle=-si ;; -sa) sourcestyle=-sa ;; -sd) sourcestyle=-sd ;; @@ -181,7 +193,7 @@ if test "$signinterface" = "gpg" ; then (cat "../$1" ; echo "") | \ $signcommand --local-user "${signkey:-$maintainer}" --clearsign --armor \ - --textmode > "../$1.asc" + --textmode > "../$1.asc" else $signcommand -u "${signkey:-$maintainer}" +clearsig=on -fast <"../$1" \ >"../$1.asc" @@ -226,7 +238,7 @@ cd ..; withecho dpkg-source $passopts $diffignore $tarignore -b "$dirn"; cd "$dirn" fi if [ x$sourceonly = x ]; then - withecho debian/rules build + withecho debian/rules build withecho $rootcommand debian/rules $binarytarget fi if [ "$usepause" = "true" ] && \ @@ -251,7 +263,7 @@ fir=$? set -e return $fir -} +} if fileomitted '\.deb'; then
--- dpkg.new/debian/changelog 2007-08-27 13:04:42.000000000 +0100 +++ dpkg-1.14.5/debian/changelog 2007-08-27 13:24:56.000000000 +0100 @@ -1,3 +1,11 @@ +dpkg (1.14.5.1) unstable; urgency=low + + * Dummy entry to test the patches. + * Include patches to support removal of dpkg-cross diversions + for dpkg-buildpackage and dpkg-shlibdeps + + -- Neil Williams <codehelp@debian.org> Mon, 27 Aug 2007 12:58:20 +0100 + dpkg (1.14.5) unstable; urgency=low [ Guillem Jover ]
--- dpkg-1.14.5/scripts/dpkg-shlibdeps.pl 2007-08-27 13:14:06.000000000 +0100 +++ dpkg.new/scripts/dpkg-shlibdeps.pl 2007-08-27 13:16:46.000000000 +0100 @@ -75,6 +75,16 @@ "), $progname, join("/",@depfields); } +# detect cross-compilation +my $result = `dpkg-architecture -qDEB_HOST_ARCH`; +chomp($result); +my $host_arch = $result; +$result = `dpkg-architecture -qDEB_BUILD_ARCH`; +chomp($result); +my $target_arch = $result; +my $use_cross = 0; +$use_cross = 1 if ($host_arch ne $target_arch); + my ($stdout, @exec, @execfield); foreach (@ARGV) { if (m/^-T/) { @@ -134,8 +144,16 @@ } } -my @librarypaths = qw( /lib /usr/lib /lib32 /usr/lib32 /lib64 /usr/lib64 - /emul/ia32-linux/lib /emul/ia32-linux/usr/lib ); +my $crossprefix = '/'; +if ($use_cross) +{ + $crossprefix = `dpkg-architecture -qDEB_HOST_GNU_TYPE`; + chomp($crossprefix); + $crossprefix = "$crossprefix/"; +} +my @librarypaths = ( "${crossprefix}lib", "/usr/${crossprefix}lib", "${crossprefix}lib32", + "/usr/${crossprefix}lib32", "${crossprefix}lib64", "/usr/${crossprefix}lib64", + "/emul/ia32-linux/lib", "/emul/ia32-linux/usr/lib" ); my %librarypaths = map { $_ => 'default' } @librarypaths; if ($ENV{LD_LIBRARY_PATH}) {
Attachment:
pgpyMuoR31IpV.pgp
Description: PGP signature