Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-04

Linking issue in Ubuntu 9.04 (32 bit)

10 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alan Krause

I've installed ubuntu 9.04 in a VM to test it out, and have installed fpc 2.2.4. It is always good to look before you leap, right?

Anyhow, I am trying to compile an existing project that works fine under Ubuntu 8.04. I can get all of the unit to compile, but when it comes time to link them together into a shared library, I get the following:

Linking libproj.so
Error: Can't call the linker, switching to external linking Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

Here is the source code for the sample project:

library project1;
uses
 Classes;
function dRound(iDec: integer; dRate: double): double;
const
 TenToPower: Array[0..9] of integer = (1, 10, 100, 1000, 10000, 100000,
                                       1000000, 10000000, 100000000,
1000000000);
var
 dInc : double;
begin
 if iDec > 0 then begin
    dInc := 0.5000001;
    result := trunc (dRate * (TenToPower [iDec]) + dInc) /
       TenToPower [iDec];
 end else begin
    result := dRate;
 end ;
end;
function one : double; cdecl;
begin
 Result := dRound( 2, 0.529 ) ;
end;
begin
end.

And the command I use to compile it is:
fpc -Sd -Cg -O3 proj.pas

Anyone else having similar issues?

Alan

Jonas Maebe
to Alan Krause
Alan Krause wrote 17 lines
I've installed ubuntu 9.04 in a VM to test it out, and have installed fpc 2.2.4. It is always good to look before you leap, right? Anyhow, I am trying to compile an existing project that works fine under Ubuntu 8.04. I can get all of the unit to compile, but when it comes time to link them together into a shared library, I get the following: Linking libproj.so Error: Can't call the linker, switching to external linking Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

It's probably caused by this bug in binutils: https://bugzilla.novell.com/show_bug.cgi?id=471901

It has been fixed in the mean time, but only after binutils 2.19.1 was released (and I guess your Ubuntu comes either with 2.19 or 2.19.1 -- although the bug already existed in some 2.18.x versions as well.).

Jonas

Prince Riley
to Jonas Maebe

Jonas,

Sorry to but in, but I read this post and followed the link to the binutils problem you mentioned in your reply.
Is it possible the error message, "Can't call the linker,..." is the result of a bad/missing symlink and not the problem in binutils?

I have Ubuntu 9.04 desktop now but haven't installed FPC as yet.

Prince

Jonas Maebe wrote 32 lines
On 24 Apr 2009, at 22:39, Alan Krause wrote: I've installed ubuntu 9.04 in a VM to test it out, and have installed fpc > 2.2.4. It is always good to look before you leap, right? > > Anyhow, I am trying to compile an existing project that works fine under > Ubuntu 8.04. I can get all of the unit to compile, but when it comes time > to > link them together into a shared library, I get the following: > > Linking libproj.so > Error: Can't call the linker, switching to external linking > Fatal: There were 1 errors compiling module, stopping > Fatal: Compilation aborted > Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did > not specify a source file to be compiled) > It's probably caused by this bug in binutils: https://bugzilla.novell.com/show_bug.cgi?id=471901 It has been fixed in the mean time, but only after binutils 2.19.1 was released (and I guess your Ubuntu comes either with 2.19 or 2.19.1 -- although the bug already existed in some 2.18.x versions as well.). Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Jonas Maebe
to Prince Riley
Prince Riley wrote 6 lines
Sorry to but in, but I read this post and followed the link to the binutils problem you mentioned in your reply. Is it possible the error message, "Can't call the linker,..." is the result of a bad/missing symlink and not the problem in binutils?

It's indeed a generic error message. To see what really happens, you have to compile with the "-Cn" command line parameter and then execute the generated ./ppas.sh script.

The problem is most likely the fact that ld crashes though, as I'm pretty sure that Ubuntu 9.04 ships with binutils 2.19.x

Jonas

Prince Riley
to Jonas Maebe

Jonas,

Thanks for taking the time to reply Jonas. When I get Ubuntu 9.04 installed this weekend I'll shoot you an e-mail confirming the version of binutils it has ...

Prince

Jonas Maebe wrote 25 lines
On 24 Apr 2009, at 23:28, Prince Riley wrote: Sorry to but in, but I read this post and followed the link to the > binutils > problem you mentioned in your reply. > Is it possible the error message, "Can't call the linker,..." is the > result > of a bad/missing symlink and not the problem in binutils? > It's indeed a generic error message. To see what really happens, you have to compile with the "-Cn" command line parameter and then execute the generated ./ppas.sh script. The problem is most likely the fact that ld crashes though, as I'm pretty sure that Ubuntu 9.04 ships with binutils 2.19.x Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Alan Krause
to Jonas Maebe: It's indeed a generic error message. To see what really happens, you have to compile with…

Jonas,

It does indeed ship with 2.19.1. I've had this same problem in the past, and have had to stick with ubuntu 8.04 for my development box due to this problem.

Prince - if you execute fpc with the verbose option (-va), it actually displays the search for a linker to use, which in my instance is found in /usr/bin/ld and listed as "found".

Alan

Jonas Maebe wrote 17 lines
On 24 Apr 2009, at 23:28, Prince Riley wrote: Sorry to but in, but I read this post and followed the link to the > binutils > problem you mentioned in your reply. > Is it possible the error message, "Can't call the linker,..." is the > result > of a bad/missing symlink and not the problem in binutils? > It's indeed a generic error message. To see what really happens, you have to compile with the "-Cn" command line parameter and then execute the generated ./ppas.sh script. The problem is most likely the fact that ld crashes though, as I'm pretty sure that Ubuntu 9.04 ships with binutils 2.19.x
Prince Riley
to Alan Krause

Alan

Thanks so much Alan.. another landmine I can try to avoid with 9.04 .. appreciate your help

Prince

Alan Krause wrote 39 lines
Jonas, It does indeed ship with 2.19.1. I've had this same problem in the past, and have had to stick with ubuntu 8.04 for my development box due to this problem. Prince - if you execute fpc with the verbose option (-va), it actually displays the search for a linker to use, which in my instance is found in /usr/bin/ld and listed as "found". Alan On Fri, Apr 24, 2009 at 2:42 PM, Jonas Maebe wrote: > > On 24 Apr 2009, at 23:28, Prince Riley wrote: > > Sorry to but in, but I read this post and followed the link to the >> binutils >> problem you mentioned in your reply. >> Is it possible the error message, "Can't call the linker,..." is the >> result >> of a bad/missing symlink and not the problem in binutils? >> > > It's indeed a generic error message. To see what really happens, you have > to compile with the "-Cn" command line parameter and then execute the > generated ./ppas.sh script. > > The problem is most likely the fact that ld crashes though, as I'm pretty > sure that Ubuntu 9.04 ships with binutils 2.19.x _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Graeme Geldenhuys
to Jonas Maebe: It's probably caused by this bug in binutils:…
Jonas Maebe wrote 7 lines
It's probably caused by this bug in binutils: https://bugzilla.novell.com/show_bug.cgi?id=471901 It has been fixed in the mean time, but only after binutils 2.19.1 was released (and I guess your Ubuntu comes either with 2.19 or 2.19.1 -- although the bug already existed in some 2.18.x versions as well.).

I have been running Ubuntu 9.04 (rc 2 I think) since about a month ago. It comes with binutils 2.19.1-0ubuntu3. I have not had any problems compiling FPC, Lazarus or any of our company applications.

The only issue I found is in XLib which doesn't draw connecting lines correctly. So applications running in WINE or fpGUI has a missing pixels in the bottom left corner of buttons, menus, etc... I've already reported this as a bug.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Graeme Geldenhuys
to Alan Krause: I've installed ubuntu 9.04 in a VM to test it out, and have installed fpc 2.2.4. It is…
Alan Krause wrote 5 lines
And the command I use to compile it is: fpc -Sd -Cg -O3 proj.pas Anyone else having similar issues?

Ummm.. just tried your example code and also get that error using Ubuntu 9.04 (rc 2). All our applications compile fine, so does FPC and Lazarus. But then again, I do not have library projects - as your example shows.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Alan Krause
to Alan Krause: I've installed ubuntu 9.04 in a VM to test it out, and have installed fpc 2.2.4. It is…

Just a quick update on this issue. I finally decided to submit a bug report via Ubuntu's Launchpad, as I didn't see any other similar bugs in their database. ( Bug report is here: https://bugs.launchpad.net/bugs/392197 )

It looks as if the issue has now been resolved and the fix is available for the next release (9.10 - Karmic Koala). However, I was able to download the appropriate .DEB file for my architecture and install it on a 9.04 box, and it does appear to work as advertised.

Alan

Alan Krause wrote 53 lines
I've installed ubuntu 9.04 in a VM to test it out, and have installed fpc 2.2.4. It is always good to look before you leap, right? Anyhow, I am trying to compile an existing project that works fine under Ubuntu 8.04. I can get all of the unit to compile, but when it comes time to link them together into a shared library, I get the following: Linking libproj.so Error: Can't call the linker, switching to external linking Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled) Here is the source code for the sample project: library project1; uses Classes; function dRound(iDec: integer; dRate: double): double; const TenToPower: Array[0..9] of integer = (1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000); var dInc : double; begin if iDec > 0 then begin dInc := 0.5000001; result := trunc (dRate * (TenToPower [iDec]) + dInc) / TenToPower [iDec]; end else begin result := dRate; end ; end; function one : double; cdecl; begin Result := dRound( 2, 0.529 ) ; end; begin end. And the command I use to compile it is: fpc -Sd -Cg -O3 proj.pas Anyone else having similar issues? Alan