Riku Voipio wrote:

On Thu, Mar 30, 2006 at 10:31:58AM +0100, Martin Guy wrote:
dpkg-architecture in dpkg 1.13 returns "os-cpu", where os and arch are
grabbed from ostable and cputable.
Er... are we talking about different meanings of the word "architecture" here?

s/os and arch/os and cpu/

This discussion is about the new equivalent to "arm", "i386", "m68k"
and so on, as used in the file names for Debian binary packages that
contain machine-dependent object code.

Do you mean that all the existing architectures (i386, arm, powerpc)
have to change to linux-i386, linux-powerpc etc? That makes no sense
at all.
Or that eabi/gnueabi is an operating system?

"arm", "i386", "m68k" are shorthands. Please have a look at
dpkg-architecture sources:

   if ($os eq "linux") {
       return $cpu;
   } else {
       return "$os-$cpu";
   }

Next, have a look at ostable and cputable files. After that I think it
should be clear why current dpkg-architecture limits our choices.
<rant>
Pardon me, but to me it looks outright stupid to let development be
constrained by some perl script. Can't you just change it to allow more
useful variations? Why can't we have Debian distributions tuned to our
(embedded) devices?

 I would want to install a Debian distribution compiled with
-march=armv5te -mtune=xscale -Wa,-mcpu=xscale on a newer iPAQ
and another one compiled with  -march=armv4 -mtune=strongarm1100
on my older iPAQ.

 On machines with/out FPU or VFP this is even a requirement that you
compile everything with the same options such as -msoft-float and
-mfpu=vfp.
</rant>

Attaching patches for -softfloat and -uclibc... With these patches,
this is what my local dpkg-architecture says (DEB_BUILD lines removed):

$ dpkg-architecture -aarm
DEB_HOST_ARCH=arm
DEB_HOST_ARCH_OS=linux
DEB_HOST_ARCH_CPU=arm
DEB_HOST_GNU_CPU=arm
DEB_HOST_GNU_SYSTEM=linux-gnu
DEB_HOST_GNU_TYPE=arm-linux-gnu

$ dpkg-architecture -aarm-softfloat
DEB_HOST_ARCH=arm-softfloat
DEB_HOST_ARCH_OS=linux
DEB_HOST_ARCH_CPU=arm-softfloat
DEB_HOST_GNU_CPU=arm-softfloat
DEB_HOST_GNU_SYSTEM=linux-gnu
DEB_HOST_GNU_TYPE=arm-softfloat-linux-gnu

$ dpkg-architecture -aarm-uclibc DEB_HOST_ARCH=arm-uclibc
DEB_HOST_ARCH_OS=linux-uclibc
DEB_HOST_ARCH_CPU=arm
DEB_HOST_GNU_CPU=arm
DEB_HOST_GNU_SYSTEM=linux-uclibc
DEB_HOST_GNU_TYPE=arm-linux-uclibc

Idem ditto for i386, mipsel... hurd-i386 and friends are not affected:

$ dpkg-architecture -ahurd-i386
DEB_HOST_ARCH=hurd-i386
DEB_HOST_ARCH_OS=hurd
DEB_HOST_ARCH_CPU=i386
DEB_HOST_GNU_CPU=i486
DEB_HOST_GNU_SYSTEM=gnu
DEB_HOST_GNU_TYPE=i486-gnu

I would expect arm-eabi to look like this:

$ dpkg-architecture -aarm-eabi
DEB_HOST_ARCH=arm-eabi
DEB_HOST_ARCH_OS=linux-eabi
DEB_HOST_ARCH_CPU=arm
DEB_HOST_GNU_CPU=arm
DEB_HOST_GNU_SYSTEM=linux-gnu-eabi
DEB_HOST_GNU_TYPE=arm-linux-gnu-eabi
--- dpkg-1.13.16/debian/archtable       2006-03-23 17:10:47.000000000 +0100
+++ dpkg-1.13.16-my.0/debian/archtable  2006-03-23 17:07:03.000000000 +0100
@@ -15,6 +15,7 @@
 ia64-linux-gnu                 ia64
 alpha-linux-gnu                        alpha
 arm-linux-gnu                  arm
+arm-softfloat-linux-gnu                arm-softfloat
 hppa-linux-gnu                 hppa
 m68k-linux-gnu                 m68k
 mips-linux-gnu                 mips
--- dpkg-1.13.16/cputable       2006-01-20 04:34:28.000000000 +0100
+++ dpkg-1.13.16-my.0/cputable  2006-03-23 17:07:15.000000000 +0100
@@ -19,6 +19,7 @@
 amd64          x86_64          x86_64
 armeb          armeb           arm.*b
 arm            arm             arm.*
+arm-softfloat  arm-softfloat   arm.*
 hppa           hppa            hppa.*
 m32r           m32r            m32r
 m68k           m68k            m68k
--- dpkg-1.13.16/scripts/dpkg-architecture.pl   2006-03-23 17:10:47.000000000 
+0100
+++ dpkg-1.13.16-my.0/scripts/dpkg-architecture.pl      2006-03-23 
17:08:35.000000000 +0100
@@ -55,14 +55,16 @@
 sub split_debian {
     local ($_) = @_;
     
+    return ("linux",$_) if exists ($cputable{$_});
+
     if (/^([^-]*)-([^-]*)-(.*)/) {
-       return ($3, join("-", $1, $2));
+       return (join("-","linux",$3), join("-", $1, $2)) if 
exists($cputable{join("-",$1,$2)});
     }
     if (/^(hurd)-(.*)/) {
-       return ($1, $2);
+       return ($1, $2) if exists($cputable{$2});
     }
     if (/^([^-]*)-(.*)/) {
-       return (join("-", "linux", $2), $1);
+       return (join("-", "linux", $2), $1) if exists($cputable{$1});
     } else {
        return ("linux", $_);
     }
@@ -79,6 +81,9 @@
 sub split_gnu {
     local ($_) = @_;
 
+    /^([^-]*)-([^-]*)-(.*)/;
+    return (join("-",$1, $2), $3) if exists($cputable{join("-",$1,$2)});
+    
     /^([^-]*)-(.*)/;
     return ($1, $2);
 }
--- dpkg-1.13.16/debian/archtable       2006-01-18 09:30:03.000000000 +0100
+++ dpkg-1.13.16-my.0/debian/archtable  2006-03-11 16:10:10.000000000 +0100
@@ -24,3 +24,6 @@
 sh-linux-gnu                   sh
 sparc-linux-gnu                        sparc
 i486-gnu                       hurd-i386
+i486-linux-uclibc              i386-uclibc
+arm-linux-uclibc               arm-uclibc
+mipsel-linux-uclibc            mipsel-uclibc
--- dpkg-1.13.16/ostable        2006-01-18 09:30:03.000000000 +0100
+++ dpkg-1.13.16-my.0/ostable   2006-03-11 16:08:04.000000000 +0100
@@ -14,6 +14,7 @@
 #
 # <Debian name>        <GNU name>      <config.guess regex>
 linux          linux-gnu       linux[^-]*(-gnu.*)?
+linux-uclibc   linux-uclibc    linux[^-]*(-uclibc.*)?
 darwin         darwin          darwin[^-]*
 freebsd                freebsd         freebsd[^-]*
 kfreebsd       kfreebsd-gnu    kfreebsd[^-]*(-gnu.*)?
--- dpkg-1.13.16/scripts/dpkg-architecture.pl   2006-01-28 05:29:10.000000000 
+0100
+++ dpkg-1.13.16-my.0/scripts/dpkg-architecture.pl      2006-03-12 
15:56:44.000000000 +0100
@@ -55,8 +55,14 @@
 sub split_debian {
     local ($_) = @_;
     
+    if (/^([^-]*)-([^-]*)-(.*)/) {
+       return ($3, join("-", $1, $2));
+    }
+    if (/^(hurd)-(.*)/) {
+       return ($1, $2);
+    }
     if (/^([^-]*)-(.*)/) {
-       return ($1, $2);
+       return (join("-", "linux", $2), $1);
     } else {
        return ("linux", $_);
     }

Reply via email to