Linking issue in Ubuntu 9.04 (32 bit)

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Linking issue in Ubuntu 9.04 (32 bit)

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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

Jonas Maebe-2

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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

princeriley
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 

On Fri, Apr 24, 2009 at 3:49 PM, Jonas Maebe <[hidden email]> wrote:

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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

Jonas Maebe-2

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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

princeriley
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

On Fri, Apr 24, 2009 at 4:42 PM, Jonas Maebe <[hidden email]> 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



Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

Alan Krause
In reply to this post by Jonas Maebe-2
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 <[hidden email]> 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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

princeriley
Alan

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

Prince

On Fri, Apr 24, 2009 at 5:09 PM, Alan Krause <[hidden email]> wrote:
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 <[hidden email]> 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  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

Graeme Geldenhuys-2
In reply to this post by Jonas Maebe-2
On Fri, Apr 24, 2009 at 10:49 PM, Jonas Maebe <[hidden email]> wrote:
>
> 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/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

Graeme Geldenhuys-2
In reply to this post by Alan Krause
On Fri, Apr 24, 2009 at 10:39 PM, Alan Krause <[hidden email]> wrote:
>
> 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/
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Linking issue in Ubuntu 9.04 (32 bit)

Alan Krause
In reply to this post by Alan Krause
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


On Fri, Apr 24, 2009 at 1:39 PM, Alan Krause <[hidden email]> 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)

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


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal