|
Lines 385-402
Link Here
|
| 385 |
see also issue #8210 regarding a discussion |
385 |
see also issue #8210 regarding a discussion |
| 386 |
no idea about the other non i386 CPUs (FK) |
386 |
no idea about the other non i386 CPUs (FK) |
| 387 |
} |
387 |
} |
|
|
388 |
{ crtbegin[S].o and crti.o should not be used with absolute paths |
| 389 |
as FindFile is not locating appropriate library for x86 when |
| 390 |
compiling on x86_64 machine (should use /usr/lib32/...). Let |
| 391 |
ld find the right one to link with if found in system. } |
| 388 |
{$ifdef x86_64} |
392 |
{$ifdef x86_64} |
| 389 |
if current_module.islibrary then |
393 |
if current_module.islibrary then |
| 390 |
begin |
394 |
begin |
| 391 |
if librarysearchpath.FindFile('crtbeginS.o',false,s) then |
395 |
if librarysearchpath.FindFile('crtbeginS.o',false,s) then |
| 392 |
AddFileName(s); |
396 |
AddFileName('crtbeginS.o'); |
| 393 |
end |
397 |
end |
| 394 |
else |
398 |
else |
| 395 |
{$endif x86_64} |
399 |
{$endif x86_64} |
| 396 |
if librarysearchpath.FindFile('crtbegin.o',false,s) then |
400 |
if librarysearchpath.FindFile('crtbegin.o',false,s) then |
| 397 |
AddFileName(s); |
401 |
AddFileName('crtbegin.o'); |
| 398 |
if librarysearchpath.FindFile('crti.o',false,s) then |
402 |
if librarysearchpath.FindFile('crti.o',false,s) then |
| 399 |
AddFileName(s); |
403 |
AddFileName('crti.o'); |
| 400 |
end; |
404 |
end; |
| 401 |
{ main objectfiles } |
405 |
{ main objectfiles } |
| 402 |
while not ObjectFiles.Empty do |
406 |
while not ObjectFiles.Empty do |
|
Lines 462-473
Link Here
|
| 462 |
see also issue #8210 regarding a discussion |
466 |
see also issue #8210 regarding a discussion |
| 463 |
no idea about the other non i386 CPUs (FK) |
467 |
no idea about the other non i386 CPUs (FK) |
| 464 |
} |
468 |
} |
|
|
469 |
{ crtend[S].o and crtn.o should not be used with absolute paths |
| 470 |
as FindFile is not locating appropriate library for x86 when |
| 471 |
compiling on x86_64 machine (should use /usr/lib32/...). Let |
| 472 |
ld find the right one to link with if found in system. } |
| 465 |
{$ifdef x86_64} |
473 |
{$ifdef x86_64} |
| 466 |
if current_module.islibrary then |
474 |
if current_module.islibrary then |
| 467 |
found1:=librarysearchpath.FindFile('crtendS.o',false,s1) |
475 |
begin |
|
|
476 |
found1:=librarysearchpath.FindFile('crtendS.o',false,s1); |
| 477 |
if found1 then s1:='crtendS.o'; |
| 478 |
end |
| 468 |
else |
479 |
else |
| 469 |
{$endif x86_64} |
480 |
{$endif x86_64} |
|
|
481 |
begin |
| 470 |
found1:=librarysearchpath.FindFile('crtend.o',false,s1); |
482 |
found1:=librarysearchpath.FindFile('crtend.o',false,s1); |
|
|
483 |
if found1 then s1:='crtend.o'; |
| 484 |
end; |
| 471 |
found2:=librarysearchpath.FindFile('crtn.o',false,s2); |
485 |
found2:=librarysearchpath.FindFile('crtn.o',false,s2); |
| 472 |
if found1 or found2 then |
486 |
if found1 or found2 then |
| 473 |
begin |
487 |
begin |
|
Lines 475-481
Link Here
|
| 475 |
if found1 then |
489 |
if found1 then |
| 476 |
AddFileName(s1); |
490 |
AddFileName(s1); |
| 477 |
if found2 then |
491 |
if found2 then |
| 478 |
AddFileName(s2); |
492 |
AddFileName('crtn.o'); |
| 479 |
Add(')'); |
493 |
Add(')'); |
| 480 |
end; |
494 |
end; |
| 481 |
end; |
495 |
end; |