mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 08:19:22 +02:00
* cleanup external/nolink options
git-svn-id: trunk@3375 -
This commit is contained in:
parent
469789071d
commit
d69ad5d84d
@ -92,10 +92,10 @@ begin
|
|||||||
{$ELSE USE_SYSUTILS}
|
{$ELSE USE_SYSUTILS}
|
||||||
fsplit(resbin,respath,n,e);
|
fsplit(resbin,respath,n,e);
|
||||||
{$ENDIF USE_SYSUTILS}
|
{$ENDIF USE_SYSUTILS}
|
||||||
if (not resfound) and not(cs_link_extern in aktglobalswitches) then
|
if (not resfound) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
Message(exec_e_res_not_found);
|
Message(exec_e_res_not_found);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
end;
|
end;
|
||||||
{$IFDEF USE_SYSUTILS}
|
{$IFDEF USE_SYSUTILS}
|
||||||
srcfilepath := SplitPath(current_module.mainsource^);
|
srcfilepath := SplitPath(current_module.mainsource^);
|
||||||
@ -117,7 +117,7 @@ begin
|
|||||||
(srcfilepath<>'') then
|
(srcfilepath<>'') then
|
||||||
s:=s+' --include '+maybequoted(srcfilepath);
|
s:=s+' --include '+maybequoted(srcfilepath);
|
||||||
{ Execute the command }
|
{ Execute the command }
|
||||||
if not (cs_link_extern in aktglobalswitches) then
|
if not (cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
Message1(exec_i_compilingresource,fname);
|
Message1(exec_i_compilingresource,fname);
|
||||||
Message2(exec_d_resbin_params,resbin,s);
|
Message2(exec_d_resbin_params,resbin,s);
|
||||||
@ -126,13 +126,13 @@ begin
|
|||||||
if ExecuteProcess(resbin,s) <> 0 then
|
if ExecuteProcess(resbin,s) <> 0 then
|
||||||
begin
|
begin
|
||||||
Message(exec_e_error_while_linking);
|
Message(exec_e_error_while_linking);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
end;
|
end;
|
||||||
except
|
except
|
||||||
on E:EOSError do
|
on E:EOSError do
|
||||||
begin
|
begin
|
||||||
Message(exec_e_cant_call_linker);
|
Message(exec_e_cant_call_linker);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
{$ELSE USE_SYSUTILS}
|
{$ELSE USE_SYSUTILS}
|
||||||
@ -142,18 +142,18 @@ begin
|
|||||||
if (doserror<>0) then
|
if (doserror<>0) then
|
||||||
begin
|
begin
|
||||||
Message(exec_e_cant_call_linker);
|
Message(exec_e_cant_call_linker);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (dosexitcode<>0) then
|
if (dosexitcode<>0) then
|
||||||
begin
|
begin
|
||||||
Message(exec_e_error_while_linking);
|
Message(exec_e_error_while_linking);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
end;
|
end;
|
||||||
{$ENDIF USE_SYSUTILS}
|
{$ENDIF USE_SYSUTILS}
|
||||||
end;
|
end;
|
||||||
{ Update asmres when externmode is set }
|
{ Update asmres when externmode is set }
|
||||||
if cs_link_extern in aktglobalswitches then
|
if cs_link_nolink in aktglobalswitches then
|
||||||
AsmRes.AddLinkCommand(resbin,s,'');
|
AsmRes.AddLinkCommand(resbin,s,'');
|
||||||
if ObjUsed then
|
if ObjUsed then
|
||||||
current_module.linkotherofiles.add(resobj,link_always);
|
current_module.linkotherofiles.add(resobj,link_always);
|
||||||
|
@ -92,6 +92,4 @@
|
|||||||
{$DEFINE MACOS_USE_FAKE_SYSUTILS}
|
{$DEFINE MACOS_USE_FAKE_SYSUTILS}
|
||||||
{$ENDIF MACOS}
|
{$ENDIF MACOS}
|
||||||
|
|
||||||
{ Use the internal linker by default }
|
{$define SUPPORT_UNALIGNED}
|
||||||
{ define INTERNALLINKER}
|
|
||||||
{$define SUPPORT_UNALIGNED}
|
|
||||||
|
@ -69,7 +69,7 @@ end;
|
|||||||
destructor tdeffile.destroy;
|
destructor tdeffile.destroy;
|
||||||
begin
|
begin
|
||||||
if WrittenOnDisk and
|
if WrittenOnDisk and
|
||||||
not(cs_link_extern in aktglobalswitches) then
|
not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(FName);
|
RemoveFile(FName);
|
||||||
importlist.Free;
|
importlist.Free;
|
||||||
exportlist.Free;
|
exportlist.Free;
|
||||||
|
@ -2266,7 +2266,7 @@ end;
|
|||||||
initmodeswitches:=fpcmodeswitches;
|
initmodeswitches:=fpcmodeswitches;
|
||||||
initlocalswitches:=[cs_check_io,cs_typed_const_writable];
|
initlocalswitches:=[cs_check_io,cs_typed_const_writable];
|
||||||
initmoduleswitches:=[cs_extsyntax,cs_implicit_exceptions];
|
initmoduleswitches:=[cs_extsyntax,cs_implicit_exceptions];
|
||||||
initglobalswitches:=[cs_check_unit_name,cs_link_static{$ifdef INTERNALLINKER},cs_link_internal{$endif}];
|
initglobalswitches:=[cs_check_unit_name,cs_link_static,cs_link_extern];
|
||||||
initoptimizerswitches:=[];
|
initoptimizerswitches:=[];
|
||||||
initsourcecodepage:='8859-1';
|
initsourcecodepage:='8859-1';
|
||||||
initpackenum:=4;
|
initpackenum:=4;
|
||||||
|
@ -132,8 +132,8 @@ than 255 characters. That's why using Ansi Strings}
|
|||||||
cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
|
cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
|
||||||
cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,
|
cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,
|
||||||
{ linking }
|
{ linking }
|
||||||
cs_link_extern,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
|
cs_link_nolink,cs_link_static,cs_link_smart,cs_link_shared,cs_link_deffile,
|
||||||
cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_internal,cs_link_opt_vtable,
|
cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_extern,cs_link_opt_vtable,
|
||||||
cs_link_opt_used_sections,
|
cs_link_opt_used_sections,
|
||||||
cs_link_map,cs_link_pthread
|
cs_link_map,cs_link_pthread
|
||||||
);
|
);
|
||||||
|
@ -190,7 +190,7 @@ begin
|
|||||||
found:=objectsearchpath.FindFile(s,foundfile);
|
found:=objectsearchpath.FindFile(s,foundfile);
|
||||||
if not(cs_link_on_target in aktglobalswitches) and (not found) then
|
if not(cs_link_on_target in aktglobalswitches) and (not found) then
|
||||||
found:=FindFile(s,exepath,foundfile);
|
found:=FindFile(s,exepath,foundfile);
|
||||||
if not(cs_link_extern in aktglobalswitches) and (not found) then
|
if not(cs_link_nolink in aktglobalswitches) and (not found) then
|
||||||
Message1(exec_w_objfile_not_found,s);
|
Message1(exec_w_objfile_not_found,s);
|
||||||
|
|
||||||
{Restore file extension}
|
{Restore file extension}
|
||||||
@ -435,7 +435,7 @@ begin
|
|||||||
if s='' then
|
if s='' then
|
||||||
exit;
|
exit;
|
||||||
found:=FindLibraryFile(s,target_info.staticlibprefix,target_info.staticlibext,ns);
|
found:=FindLibraryFile(s,target_info.staticlibprefix,target_info.staticlibext,ns);
|
||||||
if not(cs_link_extern in aktglobalswitches) and (not found) then
|
if not(cs_link_nolink in aktglobalswitches) and (not found) then
|
||||||
Message1(exec_w_libfile_not_found,s);
|
Message1(exec_w_libfile_not_found,s);
|
||||||
StaticLibFiles.Concat(ns);
|
StaticLibFiles.Concat(ns);
|
||||||
end;
|
end;
|
||||||
@ -464,7 +464,7 @@ begin
|
|||||||
if s='' then
|
if s='' then
|
||||||
exit;
|
exit;
|
||||||
found:=FindLibraryFile(s,target_info.staticclibprefix,target_info.staticclibext,ns);
|
found:=FindLibraryFile(s,target_info.staticclibprefix,target_info.staticclibext,ns);
|
||||||
if not(cs_link_extern in aktglobalswitches) and (not found) then
|
if not(cs_link_nolink in aktglobalswitches) and (not found) then
|
||||||
Message1(exec_w_libfile_not_found,s);
|
Message1(exec_w_libfile_not_found,s);
|
||||||
StaticLibFiles.Concat(ns);
|
StaticLibFiles.Concat(ns);
|
||||||
end;
|
end;
|
||||||
@ -553,10 +553,10 @@ begin
|
|||||||
Found:=FindFile(utilexe,utilsdirectory,Foundbin);
|
Found:=FindFile(utilexe,utilsdirectory,Foundbin);
|
||||||
if (not Found) then
|
if (not Found) then
|
||||||
Found:=FindExe(utilexe,Foundbin);
|
Found:=FindExe(utilexe,Foundbin);
|
||||||
if (not Found) and not(cs_link_extern in aktglobalswitches) then
|
if (not Found) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
Message1(exec_e_util_not_found,utilexe);
|
Message1(exec_e_util_not_found,utilexe);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
end;
|
end;
|
||||||
if (FoundBin<>'') then
|
if (FoundBin<>'') then
|
||||||
Message1(exec_t_using_util,FoundBin);
|
Message1(exec_t_using_util,FoundBin);
|
||||||
@ -569,7 +569,7 @@ var
|
|||||||
exitcode: longint;
|
exitcode: longint;
|
||||||
begin
|
begin
|
||||||
DoExec:=true;
|
DoExec:=true;
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
if useshell then
|
if useshell then
|
||||||
exitcode := shell(maybequoted(command)+' '+para)
|
exitcode := shell(maybequoted(command)+' '+para)
|
||||||
@ -579,13 +579,13 @@ begin
|
|||||||
if ExecuteProcess(command,para) <> 0
|
if ExecuteProcess(command,para) <> 0
|
||||||
then begin
|
then begin
|
||||||
Message(exec_e_error_while_linking);
|
Message(exec_e_error_while_linking);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
DoExec:=false;
|
DoExec:=false;
|
||||||
end;
|
end;
|
||||||
except on E:EOSError do
|
except on E:EOSError do
|
||||||
begin
|
begin
|
||||||
Message(exec_e_cant_call_linker);
|
Message(exec_e_cant_call_linker);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
DoExec:=false;
|
DoExec:=false;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
@ -600,20 +600,20 @@ begin
|
|||||||
if (doserror<>0) then
|
if (doserror<>0) then
|
||||||
begin
|
begin
|
||||||
Message(exec_e_cant_call_linker);
|
Message(exec_e_cant_call_linker);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
DoExec:=false;
|
DoExec:=false;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if (exitcode<>0) then
|
if (exitcode<>0) then
|
||||||
begin
|
begin
|
||||||
Message(exec_e_error_while_linking);
|
Message(exec_e_error_while_linking);
|
||||||
aktglobalswitches:=aktglobalswitches+[cs_link_extern];
|
aktglobalswitches:=aktglobalswitches+[cs_link_nolink];
|
||||||
DoExec:=false;
|
DoExec:=false;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ENDIF USE_SYSUTILS}
|
{$ENDIF USE_SYSUTILS}
|
||||||
{ Update asmres when externmode is set }
|
{ Update asmres when externmode is set }
|
||||||
if cs_link_extern in aktglobalswitches then
|
if cs_link_nolink in aktglobalswitches then
|
||||||
begin
|
begin
|
||||||
if showinfo then
|
if showinfo then
|
||||||
begin
|
begin
|
||||||
@ -702,7 +702,7 @@ begin
|
|||||||
|
|
||||||
{ Clean up }
|
{ Clean up }
|
||||||
if not(cs_asm_leave in aktglobalswitches) then
|
if not(cs_asm_leave in aktglobalswitches) then
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
while not SmartLinkOFiles.Empty do
|
while not SmartLinkOFiles.Empty do
|
||||||
RemoveFile(SmartLinkOFiles.GetFirst);
|
RemoveFile(SmartLinkOFiles.GetFirst);
|
||||||
@ -976,33 +976,32 @@ end;
|
|||||||
Init/Done
|
Init/Done
|
||||||
*****************************************************************************}
|
*****************************************************************************}
|
||||||
|
|
||||||
procedure InitLinker;
|
procedure InitLinker;
|
||||||
var
|
var
|
||||||
lk : TlinkerClass;
|
lk : TlinkerClass;
|
||||||
begin
|
begin
|
||||||
if (cs_link_internal in aktglobalswitches) and
|
if (cs_link_extern in aktglobalswitches) and
|
||||||
assigned(target_info.link) then
|
assigned(target_info.linkextern) then
|
||||||
begin
|
begin
|
||||||
lk:=TLinkerClass(target_info.link);
|
lk:=TlinkerClass(target_info.linkextern);
|
||||||
linker:=lk.Create;
|
linker:=lk.Create;
|
||||||
end
|
end
|
||||||
else if assigned(target_info.linkextern) then
|
else
|
||||||
begin
|
if assigned(target_info.link) then
|
||||||
lk:=TlinkerClass(target_info.linkextern);
|
begin
|
||||||
linker:=lk.Create;
|
lk:=TLinkerClass(target_info.link);
|
||||||
end
|
linker:=lk.Create;
|
||||||
else
|
end
|
||||||
begin
|
else
|
||||||
linker:=Tlinker.Create;
|
linker:=Tlinker.Create;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure DoneLinker;
|
procedure DoneLinker;
|
||||||
begin
|
begin
|
||||||
if assigned(linker) then
|
if assigned(linker) then
|
||||||
Linker.Free;
|
Linker.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{*****************************************************************************
|
{*****************************************************************************
|
||||||
|
@ -101,25 +101,11 @@ var
|
|||||||
|
|
||||||
procedure set_default_link_type;
|
procedure set_default_link_type;
|
||||||
begin
|
begin
|
||||||
{ win32 and wdosx need smartlinking by default to prevent including too much
|
undef_system_macro('FPC_LINK_SMART');
|
||||||
dll dependencies }
|
def_system_macro('FPC_LINK_STATIC');
|
||||||
if not(cs_link_internal in initglobalswitches) and
|
undef_system_macro('FPC_LINK_DYNAMIC');
|
||||||
(target_info.system in [system_i386_win32,system_i386_wdosx]) then
|
initglobalswitches:=initglobalswitches+[cs_link_static];
|
||||||
begin
|
initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart];
|
||||||
def_system_macro('FPC_LINK_SMART');
|
|
||||||
undef_system_macro('FPC_LINK_STATIC');
|
|
||||||
undef_system_macro('FPC_LINK_DYNAMIC');
|
|
||||||
initglobalswitches:=initglobalswitches+[cs_link_smart];
|
|
||||||
initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_static];
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
undef_system_macro('FPC_LINK_SMART');
|
|
||||||
def_system_macro('FPC_LINK_STATIC');
|
|
||||||
undef_system_macro('FPC_LINK_DYNAMIC');
|
|
||||||
initglobalswitches:=initglobalswitches+[cs_link_static];
|
|
||||||
initglobalswitches:=initglobalswitches-[cs_link_shared,cs_link_smart];
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -544,9 +530,9 @@ begin
|
|||||||
include(initlocalswitches,cs_check_io);
|
include(initlocalswitches,cs_check_io);
|
||||||
'n' :
|
'n' :
|
||||||
If UnsetBool(More, j) then
|
If UnsetBool(More, j) then
|
||||||
exclude(initglobalswitches,cs_link_extern)
|
exclude(initglobalswitches,cs_link_nolink)
|
||||||
Else
|
Else
|
||||||
include(initglobalswitches,cs_link_extern);
|
include(initglobalswitches,cs_link_nolink);
|
||||||
'o' :
|
'o' :
|
||||||
If UnsetBool(More, j) then
|
If UnsetBool(More, j) then
|
||||||
exclude(initlocalswitches,cs_check_overflow)
|
exclude(initlocalswitches,cs_check_overflow)
|
||||||
@ -675,9 +661,9 @@ begin
|
|||||||
'E' :
|
'E' :
|
||||||
begin
|
begin
|
||||||
if UnsetBool(More, 0) then
|
if UnsetBool(More, 0) then
|
||||||
exclude(initglobalswitches,cs_link_extern)
|
exclude(initglobalswitches,cs_link_nolink)
|
||||||
else
|
else
|
||||||
include(initglobalswitches,cs_link_extern);
|
include(initglobalswitches,cs_link_nolink);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
'F' :
|
'F' :
|
||||||
@ -982,13 +968,13 @@ begin
|
|||||||
begin
|
begin
|
||||||
if UnsetBool(More, 0) then
|
if UnsetBool(More, 0) then
|
||||||
begin
|
begin
|
||||||
initglobalswitches:=initglobalswitches-[cs_asm_extern,cs_link_extern];
|
initglobalswitches:=initglobalswitches-[cs_asm_extern,cs_link_extern,cs_link_nolink];
|
||||||
if more<>'' then
|
if more<>'' then
|
||||||
IllegalPara(opt);
|
IllegalPara(opt);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
initglobalswitches:=initglobalswitches+[cs_asm_extern,cs_link_extern];
|
initglobalswitches:=initglobalswitches+[cs_asm_extern,cs_link_extern,cs_link_nolink];
|
||||||
if more='h' then
|
if more='h' then
|
||||||
initglobalswitches:=initglobalswitches-[cs_link_on_target]
|
initglobalswitches:=initglobalswitches-[cs_link_on_target]
|
||||||
else if more='t' then
|
else if more='t' then
|
||||||
@ -1225,12 +1211,23 @@ begin
|
|||||||
while j<=length(more) do
|
while j<=length(more) do
|
||||||
begin
|
begin
|
||||||
case More[j] of
|
case More[j] of
|
||||||
|
'c' : Cshared:=TRUE;
|
||||||
|
'd' : Dontlinkstdlibpath:=TRUE;
|
||||||
|
'e' :
|
||||||
|
begin
|
||||||
|
If UnsetBool(More, j) then
|
||||||
|
exclude(initglobalswitches,cs_link_extern)
|
||||||
|
else
|
||||||
|
include(initglobalswitches,cs_link_extern);
|
||||||
|
end;
|
||||||
|
'f' :
|
||||||
|
include(initglobalswitches,cs_link_pthread);
|
||||||
'i' :
|
'i' :
|
||||||
begin
|
begin
|
||||||
If UnsetBool(More, j) then
|
If UnsetBool(More, j) then
|
||||||
exclude(initglobalswitches,cs_link_internal)
|
include(initglobalswitches,cs_link_extern)
|
||||||
else
|
else
|
||||||
include(initglobalswitches,cs_link_internal);
|
exclude(initglobalswitches,cs_link_extern);
|
||||||
end;
|
end;
|
||||||
'm' :
|
'm' :
|
||||||
begin
|
begin
|
||||||
@ -1239,8 +1236,12 @@ begin
|
|||||||
else
|
else
|
||||||
include(initglobalswitches,cs_link_map);
|
include(initglobalswitches,cs_link_map);
|
||||||
end;
|
end;
|
||||||
'f' :
|
'r' :
|
||||||
include(initglobalswitches,cs_link_pthread);
|
begin
|
||||||
|
rlinkpath:=Copy(more,2,length(More)-1);
|
||||||
|
DefaultReplacements(rlinkpath);
|
||||||
|
More:='';
|
||||||
|
end;
|
||||||
's' :
|
's' :
|
||||||
begin
|
begin
|
||||||
If UnsetBool(More, j) then
|
If UnsetBool(More, j) then
|
||||||
@ -1248,7 +1249,6 @@ begin
|
|||||||
else
|
else
|
||||||
include(initglobalswitches,cs_link_strip);
|
include(initglobalswitches,cs_link_strip);
|
||||||
end;
|
end;
|
||||||
'c' : Cshared:=TRUE;
|
|
||||||
't' :
|
't' :
|
||||||
include(initglobalswitches,cs_link_staticflag);
|
include(initglobalswitches,cs_link_staticflag);
|
||||||
'v' :
|
'v' :
|
||||||
@ -1268,17 +1268,17 @@ begin
|
|||||||
include(initglobalswitches,cs_link_shared);
|
include(initglobalswitches,cs_link_shared);
|
||||||
LinkTypeSetExplicitly:=true;
|
LinkTypeSetExplicitly:=true;
|
||||||
end;
|
end;
|
||||||
'd' : Dontlinkstdlibpath:=TRUE;
|
'M' :
|
||||||
'P' : Begin
|
begin
|
||||||
utilsprefix:=Copy(more,2,length(More)-1);
|
mainaliasname:=Copy(more,2,length(More)-1);
|
||||||
DefaultReplacements(utilsprefix);
|
More:='';
|
||||||
More:='';
|
end;
|
||||||
End;
|
'P' :
|
||||||
'r' : Begin
|
begin
|
||||||
rlinkpath:=Copy(more,2,length(More)-1);
|
utilsprefix:=Copy(more,2,length(More)-1);
|
||||||
DefaultReplacements(rlinkpath);
|
DefaultReplacements(utilsprefix);
|
||||||
More:='';
|
More:='';
|
||||||
end;
|
end;
|
||||||
'S' :
|
'S' :
|
||||||
begin
|
begin
|
||||||
def_system_macro('FPC_LINK_STATIC');
|
def_system_macro('FPC_LINK_STATIC');
|
||||||
@ -1299,11 +1299,6 @@ begin
|
|||||||
exclude(initglobalswitches,cs_link_shared);
|
exclude(initglobalswitches,cs_link_shared);
|
||||||
LinkTypeSetExplicitly:=true;
|
LinkTypeSetExplicitly:=true;
|
||||||
end;
|
end;
|
||||||
'M' :
|
|
||||||
begin
|
|
||||||
mainaliasname:=Copy(more,2,length(More)-1);
|
|
||||||
More:='';
|
|
||||||
end;
|
|
||||||
'-' :
|
'-' :
|
||||||
begin
|
begin
|
||||||
exclude(initglobalswitches,cs_link_staticflag);
|
exclude(initglobalswitches,cs_link_staticflag);
|
||||||
@ -2188,10 +2183,12 @@ begin
|
|||||||
set_target_asm(target_info.assemextern);
|
set_target_asm(target_info.assemextern);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ disable internal linker if it is not registered }
|
{ disable internal linker if it is not registered or
|
||||||
if not assigned(target_info.link) and
|
if we skip the linking }
|
||||||
(cs_link_internal in initglobalswitches) then
|
if not(cs_link_extern in initglobalswitches) and
|
||||||
exclude(initglobalswitches,cs_link_internal);
|
(not assigned(target_info.link) or
|
||||||
|
(cs_link_nolink in initglobalswitches)) then
|
||||||
|
exclude(initglobalswitches,cs_link_extern);
|
||||||
|
|
||||||
{ turn off stripping if compiling with debuginfo or profile }
|
{ turn off stripping if compiling with debuginfo or profile }
|
||||||
if (cs_debuginfo in initmoduleswitches) or
|
if (cs_debuginfo in initmoduleswitches) or
|
||||||
@ -2204,13 +2201,10 @@ begin
|
|||||||
|
|
||||||
{ Section smartlinking conflicts with import sections on Windows }
|
{ Section smartlinking conflicts with import sections on Windows }
|
||||||
if GenerateImportSection and
|
if GenerateImportSection and
|
||||||
(target_info.system in [system_i386_win32]) then
|
(target_info.system in [system_i386_win32,system_x86_64_win64]) then
|
||||||
exclude(target_info.flags,tf_smartlink_sections);
|
exclude(target_info.flags,tf_smartlink_sections);
|
||||||
|
|
||||||
if (cs_link_extern in initglobalswitches) then
|
if (cs_link_extern in initglobalswitches) then
|
||||||
exclude(initglobalswitches,cs_link_internal);
|
|
||||||
|
|
||||||
if (cs_link_internal in initglobalswitches) then
|
|
||||||
begin
|
begin
|
||||||
{ By default don't create import section if we use the internal linker }
|
{ By default don't create import section if we use the internal linker }
|
||||||
if not GenerateImportSectionSetExplicitly then
|
if not GenerateImportSectionSetExplicitly then
|
||||||
|
@ -379,7 +379,7 @@ var
|
|||||||
StaticStr,
|
StaticStr,
|
||||||
StripStr : string[40];
|
StripStr : string[40];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -414,7 +414,7 @@ begin
|
|||||||
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,true);
|
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,true);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
@ -432,7 +432,7 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
MakeSharedLibrary:=false;
|
MakeSharedLibrary:=false;
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -474,7 +474,7 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -529,7 +529,7 @@ var
|
|||||||
StaticStr,
|
StaticStr,
|
||||||
StripStr : string[40];
|
StripStr : string[40];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -582,7 +582,7 @@ begin
|
|||||||
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,LdSupportsNoResponseFile);
|
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,LdSupportsNoResponseFile);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
@ -599,7 +599,7 @@ var
|
|||||||
success : boolean;
|
success : boolean;
|
||||||
begin
|
begin
|
||||||
MakeSharedLibrary:=false;
|
MakeSharedLibrary:=false;
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||||
|
|
||||||
{ Write used files and libraries }
|
{ Write used files and libraries }
|
||||||
@ -637,7 +637,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -443,7 +443,7 @@ var
|
|||||||
ES: ExtStr;
|
ES: ExtStr;
|
||||||
OutName: PathStr;
|
OutName: PathStr;
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -497,7 +497,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -242,7 +242,7 @@ var
|
|||||||
StaticStr,
|
StaticStr,
|
||||||
StripStr : string[40];
|
StripStr : string[40];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -282,7 +282,7 @@ begin
|
|||||||
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
|
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -215,7 +215,7 @@ var
|
|||||||
success : boolean;
|
success : boolean;
|
||||||
StripStr : string[40];
|
StripStr : string[40];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -238,7 +238,7 @@ begin
|
|||||||
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
RemoveFile(outputexedir+Info.ScriptName);
|
RemoveFile(outputexedir+Info.ScriptName);
|
||||||
@ -289,7 +289,7 @@ var
|
|||||||
zerobuf : pointer;
|
zerobuf : pointer;
|
||||||
begin
|
begin
|
||||||
{ when -s is used quit, because there is no .exe }
|
{ when -s is used quit, because there is no .exe }
|
||||||
if cs_link_extern in aktglobalswitches then
|
if cs_link_nolink in aktglobalswitches then
|
||||||
exit;
|
exit;
|
||||||
{ open file }
|
{ open file }
|
||||||
assign(f,n);
|
assign(f,n);
|
||||||
|
@ -583,7 +583,7 @@ var
|
|||||||
StaticStr,
|
StaticStr,
|
||||||
StripStr : string[40];
|
StripStr : string[40];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -629,7 +629,7 @@ begin
|
|||||||
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
|
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
if (success) then
|
if (success) then
|
||||||
@ -650,7 +650,7 @@ var
|
|||||||
success : boolean;
|
success : boolean;
|
||||||
begin
|
begin
|
||||||
MakeSharedLibrary:=false;
|
MakeSharedLibrary:=false;
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||||
|
|
||||||
{ Write used files and libraries }
|
{ Write used files and libraries }
|
||||||
@ -682,7 +682,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -210,7 +210,7 @@ var
|
|||||||
begin
|
begin
|
||||||
//TODO Only external link in MPW is possible, otherwise yell.
|
//TODO Only external link in MPW is possible, otherwise yell.
|
||||||
|
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -248,7 +248,7 @@ begin
|
|||||||
success:=DoExec('Execute',CmdStr,true,false);
|
success:=DoExec('Execute',CmdStr,true,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -207,7 +207,7 @@ var
|
|||||||
StripStr: string[40];
|
StripStr: string[40];
|
||||||
begin
|
begin
|
||||||
|
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
if not (cs_link_on_target in aktglobalswitches) then
|
if not (cs_link_on_target in aktglobalswitches) then
|
||||||
@ -251,7 +251,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -549,7 +549,7 @@ var
|
|||||||
xdcpresent,usexdc : boolean;
|
xdcpresent,usexdc : boolean;
|
||||||
f : file;
|
f : file;
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -596,7 +596,7 @@ begin
|
|||||||
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
{ Call nlmconv }
|
{ Call nlmconv }
|
||||||
@ -608,7 +608,7 @@ begin
|
|||||||
Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
|
Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
|
||||||
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
|
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
|
||||||
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
RemoveFile(outputexedir+'n'+Info.ResName);
|
RemoveFile(outputexedir+'n'+Info.ResName);
|
||||||
RemoveFile(outputexedir+tmpLinkFileName);
|
RemoveFile(outputexedir+tmpLinkFileName);
|
||||||
|
@ -516,7 +516,7 @@ var
|
|||||||
success : boolean;
|
success : boolean;
|
||||||
StripStr : string[2];
|
StripStr : string[2];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -540,7 +540,7 @@ begin
|
|||||||
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
{ Call nlmconv }
|
{ Call nlmconv }
|
||||||
@ -552,7 +552,7 @@ begin
|
|||||||
Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
|
Replace(cmdstr,'$RES',maybequoted(outputexedir+'n'+Info.ResName));
|
||||||
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
|
Comment (v_debug,'Executing '+BinStr+' '+cmdstr);
|
||||||
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
RemoveFile(outputexedir+'n'+Info.ResName);
|
RemoveFile(outputexedir+'n'+Info.ResName);
|
||||||
RemoveFile(outputexedir+tmpLinkFileName);
|
RemoveFile(outputexedir+tmpLinkFileName);
|
||||||
|
@ -443,7 +443,7 @@ var
|
|||||||
ES: ExtStr;
|
ES: ExtStr;
|
||||||
OutName: PathStr;
|
OutName: PathStr;
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -497,7 +497,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -162,7 +162,7 @@ var
|
|||||||
StripStr : string[40];
|
StripStr : string[40];
|
||||||
i : longint;
|
i : longint;
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -194,7 +194,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -398,7 +398,7 @@ var
|
|||||||
StaticStr,
|
StaticStr,
|
||||||
StripStr : string[40];
|
StripStr : string[40];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -428,7 +428,7 @@ begin
|
|||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
{$IFNDEF LinkTest}
|
{$IFNDEF LinkTest}
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
@ -442,7 +442,7 @@ var
|
|||||||
success : boolean;
|
success : boolean;
|
||||||
begin
|
begin
|
||||||
MakeSharedLibrary:=false;
|
MakeSharedLibrary:=false;
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||||
|
|
||||||
{ Write used files and libraries }
|
{ Write used files and libraries }
|
||||||
@ -465,7 +465,7 @@ begin
|
|||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
{$IFNDEF LinkTest}
|
{$IFNDEF LinkTest}
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
MakeSharedLibrary:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -137,7 +137,7 @@ var
|
|||||||
success : boolean;
|
success : boolean;
|
||||||
StripStr : string[40];
|
StripStr : string[40];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -157,7 +157,7 @@ begin
|
|||||||
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
success:=DoExec(FindUtil(utilsprefix+BinStr),cmdstr,true,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
|
|
||||||
MakeExecutable:=success; { otherwise a recursive call to link method }
|
MakeExecutable:=success; { otherwise a recursive call to link method }
|
||||||
|
@ -1212,7 +1212,7 @@ var
|
|||||||
EntryStr,
|
EntryStr,
|
||||||
ImageBaseStr : string[40];
|
ImageBaseStr : string[40];
|
||||||
begin
|
begin
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.exefilename^);
|
Message1(exec_i_linking,current_module.exefilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -1289,7 +1289,7 @@ begin
|
|||||||
success:=PostProcessExecutable(current_module.exefilename^,false);
|
success:=PostProcessExecutable(current_module.exefilename^,false);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
RemoveFile('base.$$$');
|
RemoveFile('base.$$$');
|
||||||
@ -1318,7 +1318,7 @@ var
|
|||||||
ImageBaseStr : string[40];
|
ImageBaseStr : string[40];
|
||||||
begin
|
begin
|
||||||
MakeSharedLibrary:=false;
|
MakeSharedLibrary:=false;
|
||||||
if not(cs_link_extern in aktglobalswitches) then
|
if not(cs_link_nolink in aktglobalswitches) then
|
||||||
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
Message1(exec_i_linking,current_module.sharedlibfilename^);
|
||||||
|
|
||||||
{ Create some replacements }
|
{ Create some replacements }
|
||||||
@ -1391,7 +1391,7 @@ begin
|
|||||||
success:=PostProcessExecutable(current_module.sharedlibfilename^,true);
|
success:=PostProcessExecutable(current_module.sharedlibfilename^,true);
|
||||||
|
|
||||||
{ Remove ReponseFile }
|
{ Remove ReponseFile }
|
||||||
if (success) and not(cs_link_extern in aktglobalswitches) then
|
if (success) and not(cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
RemoveFile(outputexedir+Info.ResName);
|
RemoveFile(outputexedir+Info.ResName);
|
||||||
RemoveFile('base.$$$');
|
RemoveFile('base.$$$');
|
||||||
@ -1498,7 +1498,7 @@ var
|
|||||||
begin
|
begin
|
||||||
postprocessexecutable:=false;
|
postprocessexecutable:=false;
|
||||||
{ when -s is used or it's a dll then quit }
|
{ when -s is used or it's a dll then quit }
|
||||||
if (cs_link_extern in aktglobalswitches) then
|
if (cs_link_nolink in aktglobalswitches) then
|
||||||
begin
|
begin
|
||||||
case apptype of
|
case apptype of
|
||||||
app_native :
|
app_native :
|
||||||
@ -1687,7 +1687,6 @@ initialization
|
|||||||
RegisterTarget(system_i386_wince_info);
|
RegisterTarget(system_i386_wince_info);
|
||||||
{$endif i386}
|
{$endif i386}
|
||||||
{$ifdef x86_64}
|
{$ifdef x86_64}
|
||||||
RegisterExternalLinker(system_x64_win64_info,TLinkerWin32);
|
|
||||||
RegisterInternalLinker(system_x64_win64_info,TPECoffLinker);
|
RegisterInternalLinker(system_x64_win64_info,TPECoffLinker);
|
||||||
RegisterImport(system_x86_64_win64,TImportLibWin32);
|
RegisterImport(system_x86_64_win64,TImportLibWin32);
|
||||||
RegisterExport(system_x86_64_win64,TExportLibWin32);
|
RegisterExport(system_x86_64_win64,TExportLibWin32);
|
||||||
|
Loading…
Reference in New Issue
Block a user