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: Problem with Pascal compiler


On 15 March 2006 17:44, Dave Korn wrote:

> On 15 March 2006 17:18, Alastair McDonald wrote:
> 
>> I have just downloaded the New Cygwin DLL 1.5.19-4 release including gcc
>> and gpc the Pascal compiler. The C compiler gcc works with a "hello world"
>> program but when I use gpc to compile a simple pascal file I get the
>> message 
>>> 
>> 
>> /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld:
>> crtbegin.o: No such file: No such file or directory.
>> 
>> crtbegin.o does exist.  Is this a bug in the distribution, and how can I
>> get round it? 
>> 
>> Cheers, Alastair McDonald.
> 
>   Sounds as if the postinstall script didn't run and so a necessary softlink
> didn't get created.  

  No, on second thoughts I think there may be a real bug in gpc or the
packaging.  I can reproduce this failure:

---------------------------------<snip>
dk@rainbow /artimi/software/firmware/temp> cat hw.pas
program Hello;

begin
    WriteLn('Hello, World!');
end.

dk@rainbow /artimi/software/firmware/temp> gpc hw.pas  -o hw
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld:
crtbegi
n.o: No such file: No such file or directory
dk@rainbow /artimi/software/firmware/temp>
---------------------------------<snip>

  Adding the -v option lets us see the linker command line (--save-temps added
too):

---------------------------------<snip>
 /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld.exe
-Bdynamic --dll-search-prefix=cyg -o hw.exe
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib/crt0.o
crtbegin.o -L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/lib
-L/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../.. hw.o  -lgpc -lgcc -lcygwin
-luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc crtend.o
---------------------------------<snip>

  Now, according to
http://cygwin.com/packages/gcc-core/gcc-core-3.3.3-3 
crtbegin.o should have been unpacked into
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/.  And we can see that path is being
searched by a -L option.  So, it's looking in the correct directory, but
there's no .o file there.

---------------------------------<snip>
dk@rainbow /artimi/software/firmware/temp> ls
/usr/lib/gcc-lib/i686-pc-cygwin/3
.3.3/ -la
total 3368
drwxrwx---+ 4 dk Users       0 Feb 15 12:16 .
drwxrwx---+ 3 dk Users       0 Feb 15 12:16 ..
-rwxr-x---+ 1 dk Users 3110351 Aug 19  2004 gpc1.exe
-rwxr-x---+ 1 dk Users   66384 Aug 19  2004 gpcpp.exe
drwxrwx---+ 2 dk Users       0 Feb 15 12:16 include
-rwxr-x---+ 1 dk Users  264734 Aug 19  2004 libgpc.a
drwxrwx---+ 2 dk Users       0 Feb 15 12:16 units
dk@rainbow /artimi/software/firmware/temp>
---------------------------------<snip>

  And when we look at
http://cygwin.com/packages/gcc-core/gcc-core-3.4.4-1
we see there's no crtbegin/end at all.  I'm guessing that these two .o files
were supposed to move from gcc-core to the gcc-gpc package in between 3.3.3
and 3.4.4, that the 3.3.3->3.4.4 gcc upgrade helper package removed them prior
to installing the new ones, but that for some reason gcc-gpc has stayed at
3.3.3 and there's no new version with the crtbegin/end files in
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.4 available yet.  

  So, this counts as a kind-of packaging error where something's fallen
between the gaps of a partially-finished version upgrade.  I'll raise it on
the -apps list.

  In the meantime, your best bet for a workaround would be to manually grab a
copy of the file and drop it into that directory; hopefully there's little
enough difference between the 3.3.3 and 3.4.4 versions of it that this will
solve your problem, but it's not guaranteed.

  You said in your original post that the file 'does exist', but I bet it's
the wrong one - I checked my system and found that I still had copies lying
around under the mingw subdir, but they are probably only good for -mno-cygwin
compiles, so you probably need to grab a copy of gcc-core-3.3.3-3.tar.bz2 from
your local mirror and unpack it yourself.


[ ten minutes later ]

  OK, I just tried it, and it almost worked first time.  Turns out I also
needed to copy the libgcc.a from the tarball into the gcc-lib/3.3.3 subdir.
Then I got hw.pas to compile and run!


    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]