This is the mail archive of the mailing list for the GDB 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: Problem building cross-debugger

Michael Shatz wrote:
> Jim Blandy wrote:
>> "Gerrit van Niekerk" <gerritvn at> writes:
>>>>> I am trying to use Cygwin to build a Cygwin host, DJGPP target version
>>>>> of GDB: 
>>>>> config --target=djgpp All libraries seem to build ok (make does not
>>>>> stop), but 
>>>>> the final link gives a number of undefined references  
>>>> There is now only one undefined reference remaining: `_bfd_i386_arch'
>>> This is turning out to be a very one-sided thread :)
>>> I managed to get the link phase to work by explicitly including
>>> ../bfd/cpu-i386.o in the gcc command doing the final link.  Perhaps
>>> the GDB maintainers can have a look at the cause of the problem.
>> I think the reason you haven't gotten much interaction is that you may
>> be the only person on the list who's working with such a
>> configuration.  If you could figure out the source of the problem and
>> suggest a patch, that would get things rolling.
> I got exactly the same problem building i386-elf target on i686-pc-cygwin
> host with gcc 3.4.4. The problem exists both for binutils-2.16.1 and for
> binutils-2.17.
> Thank you, Gerrit. Your tip helped me to go on.
> Other errors prevented me from building readelf.exe. Hopefullly I could
> live with one from standard cygwin distribution.

Finally found the problem.

It's all about cygwin "textmode" mount huck.
When the build drive (or may be source, or both, in my case they were the
same) is mounted in the text mode the following command misbehaves:
/bin/sh ./libtool --tag=CC --mode=link i686-pc-cygwin-gcc -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2   -o
-rpath /usr/local/emb386/i686-pc-cygwin/i386-elf/lib -release `cat
libtool-soversion`  archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo
cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo
reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo
tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo `cat

Either 'libtool' or, more likely, 'sh' somehow ignores the tail of the
'ofiles' file which happens to contain the  cpu-i386.o

When running from binary-mounted drive everything compiles as expected.
Hope it helps.

View this message in context:
Sent from the Sourceware - gdb list mailing list archive at

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