This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: TARGET undefined in bucomm.c


Ian,
  I don't know why it isn't working.  What you state is correct, but
for some reason, TARGET is not defined in bucomm.c when it attempts to
compile it.  Again, here is the error message:

make[4]: Entering directory
`/home/luke/repos/summon-arm-toolchain/binutils-2.21/build/binutils'
gcc -DHAVE_CONFIG_H -I. -I../../binutils  -I. -I../../binutils
-I../bfd -I../../binutils/../bfd -I../../binutils/../include
-DLOCALEDIR="\"/usr/local/share/locale\""
-Dbin_dummy_emulation=bin_vanilla_emulation  -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wshadow -g -O2 -MT bucomm.o
-MD -MP -MF .deps/bucomm.Tpo -c -o bucomm.o ../../binutils/bucomm.c
../../binutils/bucomm.c: In function âset_default_bfd_targetâ:
../../binutils/bucomm.c:160:24: error: âTARGETâ undeclared (first use
in this function)
../../binutils/bucomm.c:160:24: note: each undeclared identifier is
reported only once for each function it appears in

I tried putting a #warning into build/binutils/config.h, and the
warning is printed when compiling other files in binutils,
specifically syslex.c.  However, no warning is echoed when bucomm.c is
compiled, indicating to me that this config.h is not being included,
but perhaps another one is?  I put this into build/binutils/config.h:
#warning "build/binutils/config.h is included"

this warning is echoed when building syslex:
make[2]: Entering directory
`/home/luke/repos/summon-arm-toolchain/binutils-2.21/build/binutils'
if [ -r sysinfo.c ]; then \
          gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wshadow -g -O2  sysinfo.c ; \
        else \
          gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wshadow -g -O2  ../../binutils/sysinfo.c ; \
        fi
if [ -r syslex.c ]; then \
          gcc -c -I. -W -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wshadow -g -O2  syslex.c ; \
        else \
          gcc -c -I. -I../../binutils -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wshadow -g -O2  ../../binutils/syslex.c ;\
        fi
In file included from syslex.l:23:0:
./config.h:16:2: warning: #warning "build/binutils/config.h is included"
gcc -g -O2  -o sysinfo sysinfo.o syslex.o

but not when building bucomm.c.  So config.h *isn't* being included,
for some reason.  I don't know which config.h is being included by
alloca-conf.h, but it isn't the generated binutils/config.h.  The only
major difference I can see is the -I flags.  Could this have something
to do with it?

~Luke



On Mon, Jun 6, 2011 at 1:04 PM, Ian Lance Taylor <iant@google.com> wrote:
> Luke <hazelnusse@gmail.com> writes:
>
>> In contrast, in binutils, only these three files #include "config.h":
>> elfedit.c
>> readelf.c
>> syslex.c
>
> In the binutils sysdep.h includes alloca-conf.h which includes config.h.
>
> Why is that not working for you?
>
> Ian
>



-- 
"Those who would give up essential liberty to purchase a little
temporary safety deserve neither liberty nor safety."

-- Benjamin Franklin, Historical Review of Pennsylvania, 1759


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