Просмотр исходного кода

dpkg --print-architecture now does gcc -dumpmachine instead of
--print-libgcc-file-name.

Adam Heath лет назад: 23
Родитель
Сommit
31f703e8db
4 измененных файлов с 15 добавлено и 16 удалено
  1. 5 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 5 8
      main/enquiry.c
  4. 2 8
      scripts/dpkg-architecture.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+Sat Sep 13 15:20:56 CDT 2003 Adam Heath <doogie@debian.org>
+
+  * lib/enquiry.c, scripts/dpkg-architecture.pl: dpkg --print-architecture
+    now does gcc -dumpmachine instead of --print-libgcc-file-name.
+
 Sat Sep 13 14:38:55 CDT 2003 Adam Heath <doogie@debian.org>
 
   * debian/dpkg-doc.postinst: Add set -e.

+ 3 - 0
debian/changelog

@@ -17,6 +17,9 @@ dpkg (1.10.11) unstable; urgency=low
     field name.  Closes: #198218
   * Yann Dirson <dirson@debian.org>
     Add set -e to dpkg-doc.postinst.  Closes: #191261
+  * Michael Weber <michaelw@debian.org>:
+    dpkg --print-architecture now does gcc -dumpmachine instead of
+    --print-libgcc-file-name.  Closes: #131893, #8241, #106793
 
  -- Wichert Akkerman <debian@extern.wiggy.net>  UNRELEASED
 

+ 5 - 8
main/enquiry.c

@@ -413,7 +413,7 @@ void printarch(const char *const *argv) {
   ccpipe= fdopen(p1[0],"r"); if (!ccpipe) ohshite(_("failed to fdopen CC pipe"));
   if (!(c1= m_fork())) {
     m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
-    execlp(ccompiler,ccompiler,"--print-libgcc-file-name",(char*)0);
+    execlp(ccompiler,ccompiler,"-dumpmachine",(char*)0);
     /* if we have a problem excuting the C compiler, we don't
      * want to fail. If there is a problem with the compiler,
      * like not being installed, or CC being set incorrectly,
@@ -422,23 +422,20 @@ void printarch(const char *const *argv) {
      * are being called, then we should just give them the built
      * in arch.
      */
-    if (printf("/usr/lib/gcc-lib/%s-none/0.0.0/libgcc.a\n",architecture) == EOF)
+    if (printf("%s\n",architecture) == EOF)
       werr("stdout");
     if (fflush(stdout)) werr("stdout");
     exit(0);
   }
   close(p1[1]);
   fd_vbuf_copy(fileno(ccpipe), &vb, -1, _("error reading from CC pipe"));
-  waitsubproc(c1,"gcc --print-libgcc-file-name",0);
+  waitsubproc(c1,"gcc -dumpmachine",0);
   if (!vb.used) badlgccfn(ccompiler,"",_("empty output"));
   varbufaddc(&vb,0);
   if (vb.buf[vb.used-2] != '\n') badlgccfn(ccompiler,vb.buf,_("no newline"));
   vb.used-= 2; varbufaddc(&vb,0);
-  p= strstr(vb.buf,"/gcc-lib/");
-  if (!p) badlgccfn(ccompiler,vb.buf,_("no gcc-lib component"));
-  p+= 9;
-  q= strchr(p,'/'); if (!q) badlgccfn(ccompiler,vb.buf,_("no slash after gcc-lib"));
-  ll= q-p;
+  p=vb.buf;
+  ll= strlen (p);
   for (archp=archtable;
        archp->from && strncmp(archp->from,p,ll);
        archp++);

+ 2 - 8
scripts/dpkg-architecture.pl

@@ -129,18 +129,12 @@ $deb_build_gnu_cpu = $deb_build_gnu_triple[0];
 $deb_build_gnu_system = $deb_build_gnu_triple[1];
 
 # Default host: Current gcc.
-$gcc = `\${CC:-gcc} --print-libgcc-file-name`;
+$gcc = `\${CC:-gcc} -dumpmachine`;
 if ($?>>8) {
     &warn("Couldn't determine gcc system type, falling back to default (native compilation)");
     $gcc = '';
 } else {
-    $gcc =~ s!^.*gcc-lib/([^/]*)/(?:egcs-)?\d+(?:[.\da-z]*)/(|.*/)libgcc.*$!$1!s;
-    if (defined $1 and $1 ne '') {
-	$gcc = $1;
-    } else {
-	&warn("Couldn't determine gcc system type, falling back to default (native compilation)");
-	$gcc = '';
-    }
+    chomp $gcc;
 }
 
 if ($gcc ne '') {