This is the mail archive of the cygwin mailing list for the Cygwin 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: Link problem when building cygwin1.dll (parsing cygwin.def)


----Original Message----
>From: Eitan Eliahu
>Sent: 27 July 2005 15:47

> Dave, attached is the def file after I ran d2u on it.

  It still has \r\n line ends.  I'm afraid my advice wasn't any too clever:
cygwin.def is a generated file, so it's only likely to get re-generated.
Read on:

> I'm getting a different error in the link. I was wondering if we could
> compare this def file and the one you might have.

  My one doesn't, and I'm sure that's why it doesn't crash ld.

> I am wondering if a .def should be considered a "linker script" for this
> linker.

  Nope.  It should be considered a .def file.  The linker is failing to
correctly understand the format because it has CRLF line ends, and that's
just what it does as a last-ditch-try-and-make-it-work-attempt when it is
given a file on the command line that it doesn't recognize the format of.

> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:
> cygwin.de
> 4: syntax error
>
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:cygwin.d
ef
> file format not recognized; treating as linker script
>
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld:cygwin.d
ef
>> syntax error
> collect2: ld returned 1 exit status
> make[2]: *** [cygwin0.dll] Error 1
> make[2]: Leaving directory `/slv/src/build/i686-pc-cygwin/winsup/cygwin'

  Alas this bit isn't terribly useful, as whatever happened to the .def file
that gave it DOS lineends has already happened.  Look for the invocation of
'gendef' earlier in your build output.

  However, I am glad to see that all the old 3.1.1 references have gone
away.

  Anyway, gendef is a shell script in ..../src/winsup/cygwin.  Perhaps
gendef itself has acquired DOS style linefeeds, and as a consequence is
outputting them to the generated .def file, perhaps because it has some
literal text or a HERE document.  If those command lines are terminated with
\r\n, the shell will take the \n as the line end, but leave the \r, and
gendef might output that \r verbatim, as if it was just any other part of
the text.

  Thus, if gendef has DOS lineends, it may output .def files with DOS
lineends.  Since your system was mounted textmode at the time when you
checked out the cvs tree, it's quite likely that it was given dos linefeeds
when CVS wrote it to your local drive.  I don't know whether running d2u
over the entire cvs tree will help or harm; you might just want to check out
a fresh tree now that you've got everything mounted in binary mode.

  If you want to test this theory out, you could do this:

cd /cygdrive/c/Cyg/src/winsup/cygwin
cvs update -C gendef
if [ x`diff -bB gendef .#gendef.1.18 | wc -l` != \
x`diff gendef .#gendef.1.18 | wc -l` ] ; \
then echo We have a winner ; \
else echo Oops still wonder what the problem is. ; \
fi


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


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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