From 31f703e8db6bcbfc368ca78481bbdb87befd7cb0 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sat, 13 Sep 2003 20:21:22 +0000 Subject: [PATCH] dpkg --print-architecture now does gcc -dumpmachine instead of --print-libgcc-file-name. --- ChangeLog | 5 +++++ debian/changelog | 3 +++ main/enquiry.c | 13 +++++-------- scripts/dpkg-architecture.pl | 10 ++-------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3649c5d..1cb6787d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Sep 13 15:20:56 CDT 2003 Adam Heath + + * 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 * debian/dpkg-doc.postinst: Add set -e. diff --git a/debian/changelog b/debian/changelog index 7af5a10d..1defef5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,9 @@ dpkg (1.10.11) unstable; urgency=low field name. Closes: #198218 * Yann Dirson Add set -e to dpkg-doc.postinst. Closes: #191261 + * Michael Weber : + dpkg --print-architecture now does gcc -dumpmachine instead of + --print-libgcc-file-name. Closes: #131893, #8241, #106793 -- Wichert Akkerman UNRELEASED diff --git a/main/enquiry.c b/main/enquiry.c index 9036bd32..c1060495 100644 --- a/main/enquiry.c +++ b/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++); diff --git a/scripts/dpkg-architecture.pl b/scripts/dpkg-architecture.pl index 4f48e7a8..0e478fb0 100755 --- a/scripts/dpkg-architecture.pl +++ b/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 '') { -- 2.39.5