[LLVMdev] where define the TARGET_80387 in md file ?

yuan liu panzerliu at gmail.com
Sun Jul 3 08:16:59 PDT 2011

thank Ciao!
I check the config of llvm-gcc and confirm that -enable-llvm path is
right. evenly I rebuild the LLVM 2.9 again, but get the same error.So
I checked the generation process of options.h and found some stranage
conditions as follows:

gawk -f ../../llvm-gcc-4.2-2.9.source/gcc/opt-gather.awk
../../llvm-gcc-4.2-2.9.source/gcc/config/linux.opt > tmp-optionlist
/bin/sh ../../llvm-gcc-4.2-2.9.source/gcc/../move-if-change
tmp-optionlist optionlist
echo timestamp > s-options
gawk -f ../../llvm-gcc-4.2-2.9.source/gcc/opt-functions.awk -f
../../llvm-gcc-4.2-2.9.source/gcc/opth-gen.awk \
            < optionlist > tmp-options.h
/bin/sh ../../llvm-gcc-4.2-2.9.source/gcc/../move-if-change
tmp-options.h options.h

in the first step, /opt-gather.awk can write ONLY 7 line into
tmp-optionlist, actual in its code "numrec" is 745

# Sort it and output it
     for (i = 1; i <= numrec; i++) {//this loop execute only 7,
although numrec=745
          print record[i] }
I try to explicitly changeto :  for (i = 1; i <= 745; i++)
but there occurs redefinition error,  I think optlist files input is
not compatible.
why I got this error, is it because of my stupid error?

> Message: 12
> Date: Fri, 01 Jul 2011 11:15:50 +0200
> From: Duncan Sands <baldrick at free.fr>
> Subject: Re: [LLVMdev] where define the TARGET_80387 in md file ?
> To: llvmdev at cs.uiuc.edu
> Message-ID: <4E0D9046.1090601 at free.fr>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Hi,
> > I am a beginner for LLVM,  and now I am building LLVM-gcc from
> > dowloaded source.  When generating  gencondmd,  the error occurs as
> > follows:
> > ../../llvm-gcc-4.2-2.9.source/gcc/config/i386/i386.md:9844: error:
> > 'TARGET_80387' undeclared here (not in a function)
> > but I use grep, there doesn't the definition for 'TARGET_80387' in the
> > whole source dir. And in orginal gcc source, I found its definition.
> > Why I can't find that in LLVM source? thanks for any advice!
> it is generated during the build in the options.h header.  That said, the
> usual reason for strange failures during the llvm-gcc build is that you
> didn't specify --enable-llvm right when configuring llvm-gcc.
> Ciao, Duncan.
> ------------------------------

More information about the llvm-dev mailing list