|
@@ -389,18 +389,12 @@ begin
|
|
if librarysearchpath.FindFile('crti.o',false,s) then
|
|
if librarysearchpath.FindFile('crti.o',false,s) then
|
|
AddFileName(s);
|
|
AddFileName(s);
|
|
{ then the crtbegin* }
|
|
{ then the crtbegin* }
|
|
- { x86_64 requires this to use entry/exit code with pic,
|
|
|
|
- see also issue #8210 regarding a discussion
|
|
|
|
- no idea about the other non i386 CPUs (FK)
|
|
|
|
- }
|
|
|
|
-{$ifdef x86_64}
|
|
|
|
- if current_module.islibrary then
|
|
|
|
|
|
+ if cs_create_pic in current_settings.moduleswitches then
|
|
begin
|
|
begin
|
|
if librarysearchpath.FindFile('crtbeginS.o',false,s) then
|
|
if librarysearchpath.FindFile('crtbeginS.o',false,s) then
|
|
AddFileName(s);
|
|
AddFileName(s);
|
|
end
|
|
end
|
|
else
|
|
else
|
|
-{$endif x86_64}
|
|
|
|
if (cs_link_staticflag in current_settings.globalswitches) and
|
|
if (cs_link_staticflag in current_settings.globalswitches) and
|
|
librarysearchpath.FindFile('crtbeginT.o',false,s) then
|
|
librarysearchpath.FindFile('crtbeginT.o',false,s) then
|
|
AddFileName(s)
|
|
AddFileName(s)
|
|
@@ -484,15 +478,9 @@ begin
|
|
{ objects which must be at the end }
|
|
{ objects which must be at the end }
|
|
if linklibc and (libctype<>uclibc) then
|
|
if linklibc and (libctype<>uclibc) then
|
|
begin
|
|
begin
|
|
- { x86_64 requires this to use entry/exit code with pic,
|
|
|
|
- see also issue #8210 regarding a discussion
|
|
|
|
- no idea about the other non i386 CPUs (FK)
|
|
|
|
- }
|
|
|
|
-{$ifdef x86_64}
|
|
|
|
- if current_module.islibrary then
|
|
|
|
|
|
+ if cs_create_pic in current_settings.moduleswitches then
|
|
found1:=librarysearchpath.FindFile('crtendS.o',false,s1)
|
|
found1:=librarysearchpath.FindFile('crtendS.o',false,s1)
|
|
else
|
|
else
|
|
-{$endif x86_64}
|
|
|
|
found1:=librarysearchpath.FindFile('crtend.o',false,s1);
|
|
found1:=librarysearchpath.FindFile('crtend.o',false,s1);
|
|
found2:=librarysearchpath.FindFile('crtn.o',false,s2);
|
|
found2:=librarysearchpath.FindFile('crtn.o',false,s2);
|
|
if found1 or found2 then
|
|
if found1 or found2 then
|