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]

Mainline and branch: --enable-targets=all dead on cygwin


    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....


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