This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: config.guess and Linux/GNU


At 00:59 14.06.00, Bruce Korb wrote:
>Mike Stump wrote:
> > Bruce Korb wrote:
> > > No, wrong, do *not* delete the "elf_i?86" entry.
> >
> > [...] As [a] config.guess [contributor], let me shed some light.
>
>As the author of the patch in question, let me shed some history.
>Several years ago, I was working on a Linux box that had a working
>gcc, but not a working cc.  I posted some questions as to why it
>was necessary to specify the machine to configure, but got no
>response.  Eventually, I was sufficiently irritated to grope my
>way through the config.guess script to the point where I saw it
>was trying to invoke "cc", failing and giving up.  Hey, no problem:
>
>   ln -s /usr/local/bin/gcc /usr/local/bin/cc
>
>No luck.  Configuring "cc" turned out to be much harder.

What do you mean by that? The only requirement here is to have a working cc 
in your path or set $CC accordingly. AFAI can see this requirement was 
always there with config.guess and on a platform like Linux this is merely 
an installation problem and not a config.guess problem.

>Over time I noticed that every now and then someone else would
>stub their toe the same way with a similar result.  So, I
>looked deeper into config.guess and found that the first thing
>it attempts to do is to parse the output from "ld --help"
>and then simply ignore it if the supported emulation was i?86_elf.

What do you mean with "ignore"? That's rubbish, it's a normal fall-through 
to this part detecting the exact platform type:

           # Determine whether the default compiler is a.out or elf
           cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h>  /* for printf() prototype */
         int main (int argc, char *argv[]) {
#else
         int main (argc, argv) int argc; char *argv[]; {
#endif
#ifdef __ELF__
# ifdef __GLIBC__
#  if __GLIBC__ >= 2
     printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
#  else
     printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
#  endif
# else
    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
# endif
#else
   printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
#endif
   return 0;
}
EOF
           $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy 
"${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0

I see nothing going wrong here, if you want to fix stuff, fix it here. Or, 
alternatively, move this test into your elf_i?86 case, if you happier with 
that. This distinction between different Linux libc versions is needed by 
at least the gcc, binutils and glibc, which means you just broke the heart 
of all GNU software :-(. You are welcome to change this test to use ld or 
other tools only, but this distinction has to stay.

>It then goes on and fails with the "cc" testing.  My first patch,
>approximately *TWO YEARS* ago was to emit the "i386-pc-linux-gnu"
>string that you GCC folks prefer.  It was rejected because of
>the big-sizean vs. little-sizean config name wars.  I submitted
>a patch that emitted the "i386-pc-linux" string, but *it* was
>rejected because the whole thing was going to be reworked
>"Real Soon Now"(tm).  After that, every now and then, someone
>hurt their toe and, if I were in the mood, I would post another
>"Come on, guys, let's clean this up" message.  A month or two ago,
>the config.guess maintainer finally relented and installed my
>patch.  Now, you're complaining.

Well, actually I could say "Let this crazy x86 lovers shoot them in their 
feet" and live happy ever after with my PPC, but after all, GNU software is 
a community effort.
I don't know about earlier discussions, but I know the original method 
worked fine for a long time and I just see no reason for your patch.

Franz.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]