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
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,
* 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++);
$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 '') {