Segmentation fault while linking shared library
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
binutils (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: binutils
The last version of Ubuntu which successfully compiled a 64 bit shared library (compiler used is free pascal) was 8.04. Ever since binutils has been ubgraded to 2.19.1, I am no longer able to do so due to a segmentation fault in the linker.
To reproduce the problem, do the following:
1. Create and save a file named proj.pas, with the following contents:
library project1;
uses
Classes;
function dRound(iDec: integer; dRate: double): double;
const
TenToPower: Array[0..9] of integer = (1, 10, 100, 1000, 10000, 100000,
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.
2. Compile (but not link) the source code using free pascal (v2.2.4):
fpc -Sd -Cg -Cn -O3 proj.pas
3. Attempt to link the shared library using the generated ppas.sh script:
./ppas.sh
Here is the output I receive:
Linking libproj.so
Segmentation fault
An error occurred while linking libproj.so
summary: |
- Segmentation fault while linking 64 bit shared library + Segmentation fault while linking shared library |
Just a quick update - the same problem happens for i386.