From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5516 invoked by alias); 8 Jun 2011 00:41:11 -0000 Received: (qmail 5508 invoked by uid 22791); 8 Jun 2011 00:41:10 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_XV X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Jun 2011 00:40:54 +0000 Received: by vws4 with SMTP id 4so1695vws.0 for ; Tue, 07 Jun 2011 17:40:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.115.163 with SMTP id jp3mr577831vdb.187.1307493653770; Tue, 07 Jun 2011 17:40:53 -0700 (PDT) Received: by 10.52.184.8 with HTTP; Tue, 7 Jun 2011 17:40:53 -0700 (PDT) In-Reply-To: References: Date: Wed, 08 Jun 2011 00:41:00 -0000 Message-ID: Subject: Re: TARGET undefined in bucomm.c From: Luke To: "H.J. Lu" Cc: binutils@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-06/txt/msg00080.txt.bz2 I tried three approaches, all which led to the same error: First, a build folder outside of the source tree: $ tar xvf binutils-2.21.tar.bz2 $ mkdir build $ cd build $ ../binutils-2.21/configure $ make and I get: make[4]: Entering directory `/home/luke/repos/summon-arm-toolchain/build/binutils' gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.21/binutils -I. -I../../binutils-2.21/binutils -I../bfd -I../../binutils-2.21/binutils/../bfd -I../../binutils-2.21/binutils/../include -DLOCALEDIR=3D"\"/usr/local/share/locale\"" -Dbin_dummy_emulation=3Dbin_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-2.21/binutils/bucomm.c ../../binutils-2.21/binutils/bucomm.c: In function =E2=80=98set_default_bfd= _target=E2=80=99: ../../binutils-2.21/binutils/bucomm.c:160:24: error: =E2=80=98TARGET=E2=80= =99 undeclared (first use in this function) ../../binutils-2.21/binutils/bucomm.c:160:24: note: each undeclared identifier is reported only once for each function it appears in make[4]: *** [bucomm.o] Error 1 Second, I tried a build in the source tree: $ tar xvf binutils-2.21.tar.bz2 $ cd binutils-2.21 $ ./configure $ make and I get: make[4]: Entering directory `/home/luke/repos/summon-arm-toolchain/binutils-2.21/binutils' gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -DLOCALEDIR=3D"\"/usr/local/share/locale\"" -Dbin_dummy_emulation=3Dbin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -g -O2 -MT size.o -MD -MP -MF .deps/size.Tpo -c -o size.o size.c mv -f .deps/size.Tpo .deps/size.Po gcc -DHAVE_CONFIG_H -I. -I. -I. -I../bfd -I./../bfd -I./../include -DLOCALEDIR=3D"\"/usr/local/share/locale\"" -Dbin_dummy_emulation=3Dbin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -g -O2 -MT bucomm.o -MD -MP -MF .deps/bucomm.Tpo -c -o bucomm.o bucomm.c bucomm.c: In function =E2=80=98set_default_bfd_target=E2=80=99: bucomm.c:160:24: error: =E2=80=98TARGET=E2=80=99 undeclared (first use in t= his function) bucomm.c:160:24: note: each undeclared identifier is reported only once for each function it appears in make[4]: *** [bucomm.o] Error 1 Finally, if I make a build folder inside of the source tree, I get the same exact result, which is what I reported previously. So this doesn't seem to be the source of the problem. ~Luke On Tue, Jun 7, 2011 at 11:58 AM, H.J. Lu wrote: > On Tue, Jun 7, 2011 at 11:26 AM, Luke wrote: >> Here are the first lines of bucomm.i: >> >> # 1 "../../binutils/bucomm.c" >> # 1 "/home/luke/repos/summon-arm-toolchain/binutils-2.21/build/binutils/= /" >> # 1 "" >> # 1 "" >> # 1 "../../binutils/bucomm.c" >> # 26 "../../binutils/bucomm.c" >> # 1 "../../binutils/sysdep.h" 1 >> # 25 "../../binutils/sysdep.h" >> # 1 "../../binutils/../include/alloca-conf.h" 1 >> # 1 "../bfd/config.h" 1 >> # 2 "../../binutils/../include/alloca-conf.h" 2 >> >> >> # 1 "/usr/include/alloca.h" 1 3 4 >> # 22 "/usr/include/alloca.h" 3 4 >> # 1 "/usr/include/features.h" 1 3 4 >> >> So, for some reason, it is finding config.h in the bfd folder. >> >> What should I do to fix this? >> > > Don't put build directory inside binutils source tree. > > > H.J. > --=20 "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