www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/29/15:24:35

Date: Wed, 29 Aug 2001 11:24:27 -0700 (PDT)
From: Will Robinson <wsr23 AT Stanford DOT EDU>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: <djgpp AT delorie DOT com>
Subject: Re: linux->dos cross-compiler
In-Reply-To: <Pine.SUN.3.91.1010829114431.15631F@is>
Message-ID: <Pine.GSO.4.31.0108291102410.117-100000@elaine10.Stanford.EDU>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > End result was exactly the same (still had to explicitly include crt0.o,
> > libc, libgcc, and libstdc++ when linking
>
> This sounds like a problem with the specs file, I think.  What does
> "gcc -v" print about the specs file it uses?

Assume you're talking about the gcc cross-compiler, but I went ahead and
did it for both just in case (gcc-dos is the cross-compiler):

[wsr23 AT dhcp-197-222 wsr23]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux/2.96/specs
gcc version 2.96 20000731 (Linux-Mandrake 8.0 2.96-0.48mdk)

[wsr23 AT dhcp-197-222 wsr23]$ gcc-dos -v
Reading specs from /opt/djgpp/lib/gcc-lib/i586-pc-msdosdjgpp/3.0.1/specs
Configured with: ../configure --target=i586-pc-msdosdjgpp
--prefix=/opt/djgpp --enable-languages=c,c++ : (reconfigured)
Thread model: single
gcc version 3.0.1

The cross-compiler's specs file does indeed exist; not sure what I should
be looking for, but I can give you any info you need from that file.

Also, if it makes any difference, know that I'm linking with an explicit
"ld-dos" command line, not with gcc-dos itself.

> Also, note that "-lc -lstdc++ -lgcc" is not what you need to put at
> the end of the link command if GCC doesn't get that by itself.  The
> correct list of libraries is "-lc -lgcc -lc" (yes, -lc should appear
> twice, and in the order shown), and for C++ programs it should be
> "-lstdc++ -lm -lc -lgcc -lc".

Wow!  I don't understand why that helped, but it did.  The missing
tolower, toupper, etc. are gone.  Now the only link error I'm left with is
the multiply-defined "__register_frame_info":

/opt/djgpp/i586-pc-msdosdjgpp/lib/libgcc.a(unwind-dw2-fde.o): In function
`read_encoded_value_with_base':
unwind-dw2-fde.c:211: multiple definition of `__register_frame_info'
/opt/djgpp/i586-pc-msdosdjgpp/lib/libc.a(rfinfo.o)(.text+0x0):rfinfo.c:
first defined here

Thanks for your help,
Will Robinson

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019