public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Dave Korn" <dave.korn@artimi.com>
To: <binutils@sourceware.org>
Subject: Mainline and branch: --enable-targets=all dead on cygwin
Date: Wed, 19 Apr 2006 16:27:00 -0000	[thread overview]
Message-ID: <00d201c663c0$5f6f2cf0$a501a8c0@CAM.ARTIMI.COM> (raw)


    Hi all,

  Configuring binutils with --enable-targets=all fails when building gas at
obj-coff.o:

gcc -DHAVE_CONFIG_H -I. -I/gnu/binutils/binutils-2.16.92/gas -I. -D_GNU_SOURCE
-
I. -I/gnu/binutils/binutils-2.16.92/gas -I../bfd
-I/gnu/binutils/binutils-2.16.9
2/gas/config -I/gnu/binutils/binutils-2.16.92/gas/../include
-I/gnu/binutils/bin
utils-2.16.92/gas/.. -I/gnu/binutils/binutils-2.16.92/gas/../bfd
-I/gnu/binutils
/binutils-2.16.92/gas/../intl -I../intl
-DLOCALEDIR="\"/usr/build/install/share/
locale\""   -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2
-c
/gnu/binutils/binutils-2.16.92/gas/config/obj-coff.c
In file included from
/gnu/binutils/binutils-2.16.92/gas/config/obj-multi.h:26,
                 from ./obj-format.h:1,
                 from /gnu/binutils/binutils-2.16.92/gas/config/te-pe.h:7,
                 from ./targ-env.h:1,
                 from /gnu/binutils/binutils-2.16.92/gas/as.h:585,
                 from /gnu/binutils/binutils-2.16.92/gas/config/obj-coff.c:25:
/gnu/binutils/binutils-2.16.92/gas/config/obj-coff.h:63:1: "TARGET_FORMAT"
redefined
In file included from ./targ-cpu.h:1,
                 from /gnu/binutils/binutils-2.16.92/gas/config/obj-coff.h:28,
                 from
/gnu/binutils/binutils-2.16.92/gas/config/obj-multi.h:26,
                 from ./obj-format.h:1,
                 from /gnu/binutils/binutils-2.16.92/gas/config/te-pe.h:7,
                 from ./targ-env.h:1,
                 from /gnu/binutils/binutils-2.16.92/gas/as.h:585,
                 from /gnu/binutils/binutils-2.16.92/gas/config/obj-coff.c:25:
/gnu/binutils/binutils-2.16.92/gas/config/tc-i386.h:69:1: this is the location
of the previous definition
make[4]: *** [obj-coff.o] Error 1


  Both obj-coff.h and tc-i386.h seem to believe they 'own' TARGET_FORMAT.

/gnu/binutils/binutils-2.16.92/gas/config/obj-coff.h
    59  #ifdef TC_I386
    60  #include "coff/i386.h"
    61
    62  #ifdef TE_PE
    63  #define TARGET_FORMAT "pe-i386"
    64  #endif
    65
    66  #ifndef TARGET_FORMAT
    67  #define TARGET_FORMAT "coff-i386"
    68  #endif
    69  #endif


/gnu/binutils/binutils-2.16.92/gas/config/tc-i386.h

    66  #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \
    67       || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF))
    68  extern const char *i386_target_format PARAMS ((void));
    69  #define TARGET_FORMAT i386_target_format ()
    70  #else
    71  #ifdef OBJ_ELF
    72  #define TARGET_FORMAT           ELF_TARGET_FORMAT
    73  #endif
    74  #ifdef OBJ_AOUT
    75  #define TARGET_FORMAT           AOUT_TARGET_FORMAT
    76  #endif
    77  #endif


  Ummm.  The next thing I tried was to move that #ifdef TE_PE inside the
#ifndef TARGET_FORMAT, like so:

    59  #ifdef TC_I386
    60  #include "coff/i386.h"
    61
    62  #ifndef TARGET_FORMAT
    63  #ifdef TE_PE
    64  #define TARGET_FORMAT "pe-i386"
    65  #else
    66  #define TARGET_FORMAT "coff-i386"
    67  #endif
    68  #endif
    69  #endif

and now all I get is

mkdir .libs
gcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -o
as-new.e
xe app.o as.o atof-generic.o cond.o depend.o dwarf2dbg.o dw2gencfi.o ecoff.o
eho
pt.o expr.o flonum-copy.o flonum-konst.o flonum-mult.o frags.o hash.o
input-file
.o input-scrub.o listing.o literal.o macro.o messages.o output-file.o read.o
sb.
o stabs.o subsegs.o symbols.o write.o tc-i386.o obj-multi.o atof-ieee.o
obj-coff
.o obj-aout.o obj-elf.o e-i386coff.o e-i386aout.o e-i386elf.o
../bfd/.libs/libb
fd.a ../libiberty/libiberty.a ./../intl/libintl.a
obj-coff.o: In function `coff_frob_symbol':
/gnu/binutils/binutils-2.16.92/gas/config/obj-coff.c:1055: undefined reference
t
o `_an_external_name'
collect2: ld returned 1 exit status
make[4]: *** [as-new.exe] Error 1
make[4]: Leaving directory `/repository/davek/patch-gnu/binutils/obj-all/gas'

because of this:

  1054  #ifdef USE_UNIQUE
  1055    if (an_external_name != NULL)
  1056      unique = an_external_name;
  1057  #endif

where 'an_external_name' should exist in symbols.c:

    62  #ifdef USE_UNIQUE
    63  /* The name of an external symbol which is
    64     used to make weak PE symbol names unique.  */
    65  const char * an_external_name;
    66  #endif

but doesn't.  It is defined in obj-coff.h under #ifdef TE_PE, but symbols.c
doesn't include obj-coff.h in this arrangement, because obj-coff.h is included
from obj-multi.h:

    25  #ifdef OBJ_HEADER
    26  #include OBJ_HEADER
    27  #else

and OBJ_HEADER is only defined in the obj-*.c files and not in symbols.c.

  Could anyone who knows better than me where the responsibility for setting
TARGET_FORMAT truly lies and what's the difference between a TC_xxxx and a
TE_xxxxx please comment on this clash?  I don't yet get it myself. :-(


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

             reply	other threads:[~2006-04-19 14:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-19 16:27 Dave Korn [this message]
2006-04-26 11:31 ` Nick Clifton
2006-04-26 12:47   ` Dave Korn
2006-04-26 14:38     ` Alan Modra
2006-04-26 16:59       ` Dave Korn
2006-04-26 18:18         ` Dave Korn
2006-04-26 20:07         ` Alan Modra
2006-05-29 18:00           ` Aaron W. LaFramboise

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='00d201c663c0$5f6f2cf0$a501a8c0@CAM.ARTIMI.COM' \
    --to=dave.korn@artimi.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).